imx8qm-mek: Resolve boot issue for non-EL3 environments.
This commit addresses the issue of unauthorized writes to cntfrq_el0 during boot when not in EL3 mode. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
a46eb84334
commit
a45f903650
1 changed files with 8 additions and 2 deletions
|
|
@ -80,9 +80,15 @@ const struct arm_mmu_config g_mmu_config =
|
|||
|
||||
void arm64_el_init(void)
|
||||
{
|
||||
write_sysreg(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, cntfrq_el0);
|
||||
uint64_t el = arm64_current_el();
|
||||
|
||||
ARM64_ISB();
|
||||
/* Only in EL3 we can write to cntfrq_el0. */
|
||||
|
||||
if (el == 3)
|
||||
{
|
||||
write_sysreg(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, cntfrq_el0);
|
||||
ARM64_ISB();
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue