From ae8ce535f3e5243cb74ba627b32462250353c44a Mon Sep 17 00:00:00 2001 From: zouboan Date: Sun, 14 Jul 2024 20:54:56 +0800 Subject: [PATCH] arm64/arm64_boot.c: Fix exception caused by accesses to ICC_SRE_EL3 when GICv3 was not implemented --- arch/arm64/src/common/arm64_boot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/src/common/arm64_boot.c b/arch/arm64/src/common/arm64_boot.c index a82028857c..31230c424f 100644 --- a/arch/arm64/src/common/arm64_boot.c +++ b/arch/arm64/src/common/arm64_boot.c @@ -89,6 +89,7 @@ void arm64_boot_el3_init(void) SCR_SMD_BIT); /* Do not trap SMC */ write_sysreg(reg, scr_el3); +#if CONFIG_ARM64_GIC_VERSION > 2 reg = read_sysreg(ICC_SRE_EL3); reg |= (ICC_SRE_ELX_DFB_BIT | /* Disable FIQ bypass */ ICC_SRE_ELX_DIB_BIT | /* Disable IRQ bypass */ @@ -96,6 +97,7 @@ void arm64_boot_el3_init(void) ICC_SRE_EL3_EN_BIT); /* Enables lower Exception level access to * ICC_SRE_EL1 */ write_sysreg(reg, ICC_SRE_EL3); +#endif ARM64_ISB(); }