blob: 0cdfd65c7d01705bc831aa38b0cb33dd2e24e45e [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch_helpers.h>
8
9void tftf_arch_setup(void)
10{
11 /* Do not try to configure EL2 if TFTF is running at NS-EL1 */
12 if (IS_IN_EL2()) {
Sandrine Bailleuxdddec6b2018-12-18 15:45:01 +010013 /*
14 * Route physical interrupts to EL2 regardless of the value of
15 * the IMO/FMO bits. Without this, interrupts would not be taken
16 * and would remain pending, regardless of the PSTATE.{A, I, F}
17 * interrupt masks.
18 */
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020019 write_hcr_el2(HCR_TGE_BIT);
20 isb();
21 }
22}