Skip to content

Commit 02c3231

Browse files
povergoingcfriedt
authored andcommitted
arm64: Fix booting issue with FVP V8R >= 11.16.16
In the Armv8R AArch64 profile[1], the Armv8R AArch64 is always in secure mode. But the FVP_BaseR_AEMv8R before version 11.16.16 doesn't strictly follow this rule. It still has some non-secure registers (e.g. CNTHP_CTL_EL2). Since version 11.16.16, the FVP_BaseR_AEMv8R has fixed this issue. The CNTHP_XXX_EL2 registers have been changed to CNTHPS_XXX_EL2. So the FVP_BaseR_AEMv8R (version >= 11.16.16) cannot boot Zephyr. This patch will fix it. [1] https://developer.arm.com/documentation/ddi0600/latest/ Signed-off-by: Jaxson Han <[email protected]> Change-Id: If986f34dc080ae7a8b226bba589b6fe616a4260b (cherry picked from commit fd231e3)
1 parent 9bf5718 commit 02c3231

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arch/arm64/core/reset.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ void z_arm64_el2_init(void)
129129

130130
zero_cntvoff_el2(); /* Set 64-bit virtual timer offset to 0 */
131131
zero_cnthctl_el2();
132+
#ifdef CONFIG_CPU_AARCH64_CORTEX_R
133+
zero_cnthps_ctl_el2();
134+
#else
132135
zero_cnthp_ctl_el2();
136+
#endif
133137
/*
134138
* Enable this if/when we use the hypervisor timer.
135139
* write_cnthp_cval_el2(~(uint64_t)0);

include/arch/arm64/lib_helpers.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
MAKE_REG_HELPER(cntfrq_el0);
5757
MAKE_REG_HELPER(cnthctl_el2);
5858
MAKE_REG_HELPER(cnthp_ctl_el2);
59+
MAKE_REG_HELPER(cnthps_ctl_el2);
5960
MAKE_REG_HELPER(cntv_ctl_el0)
6061
MAKE_REG_HELPER(cntv_cval_el0)
6162
MAKE_REG_HELPER(cntvct_el0);

0 commit comments

Comments
 (0)