From e771f1ac962332d35ae2139cba4c30bbd3cc8828 Mon Sep 17 00:00:00 2001 From: Firefly Date: Fri, 11 Mar 2016 15:30:07 +0800 Subject: [PATCH] [u-boot] rk33plat: enable exception rounting to EL2 when running EL2. Change-Id: If81e8ea0b2cc42356658194b2516b820f12e6775 Signed-off-by: Firefly (cherry picked from commit 6a8ab9e6142cb781595e502cabc7cad5b5954873) --- u-boot/arch/arm/cpu/armv8/start.S | 17 +++++++++++++++++ u-boot/include/configs/rk33plat.h | 3 --- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/u-boot/arch/arm/cpu/armv8/start.S b/u-boot/arch/arm/cpu/armv8/start.S index 1c94bb64a6..8810f251d5 100644 --- a/u-boot/arch/arm/cpu/armv8/start.S +++ b/u-boot/arch/arm/cpu/armv8/start.S @@ -225,6 +225,23 @@ el1_start: bl gic_init_secure_percpu #endif +#if defined(CONFIG_ROCKCHIP) + /* + * Setting HCR_EL2.TGE AMO IMO FMO for exception rounting to EL2 + */ + mrs x0, CurrentEL /* check currentEL */ + cmp x0, 0x8 + b.ne endseting /* currentEL != EL2 */ + + mrs x9, hcr_el2 + orr x9, x9, #(7 << 3) /* HCR_EL2.AMO IMO FMO set */ + orr x9, x9, #(1 << 27) /* HCR_EL2.TGE set */ + msr hcr_el2, x9 + +endseting: + nop +#endif /* CONFIG_ROCKCHIP */ + branch_if_master x0, x1, 2f /* diff --git a/u-boot/include/configs/rk33plat.h b/u-boot/include/configs/rk33plat.h index d7f52c27d7..238f379834 100755 --- a/u-boot/include/configs/rk33plat.h +++ b/u-boot/include/configs/rk33plat.h @@ -65,9 +65,6 @@ #define CONFIG_SWITCH_EL3_TO_EL1 #endif -/* do_nonsec_virt_switch when enter kernel */ -#define CONFIG_ARMV8_SWITCH_TO_EL1 - /* icache enable when start to kernel */ #define CONFIG_ICACHE_ENABLE_FOR_KERNEL