diff options
author | Peng Fan <Peng.Fan@freescale.com> | 2015-02-04 18:15:09 +0800 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2015-03-01 16:33:21 +0100 |
commit | 02251eefc95c477f4ff6aa7568dfd4be7c69c31f (patch) | |
tree | c4b9382fa20815bb8fc7983e1e0d383734ffedc8 | |
parent | 419fa9ae216716789e45f2b18cb975db35c6d669 (diff) | |
download | u-boot-imx-02251eefc95c477f4ff6aa7568dfd4be7c69c31f.zip u-boot-imx-02251eefc95c477f4ff6aa7568dfd4be7c69c31f.tar.gz u-boot-imx-02251eefc95c477f4ff6aa7568dfd4be7c69c31f.tar.bz2 |
ARM: HYP/non-sec: relocation before enable secondary cores
If CONFIG_ARMV7_PSCI is not defined and CONFIG_ARMV7_SECURE_BASE is defined,
smp_kicl_all_cpus may enable secondary cores and runs into secure_ram_addr(
_smp_pen), before code is relocated to secure ram.
So need relocation to secure ram before enable secondary cores.
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | arch/arm/cpu/armv7/virt-v7.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/virt-v7.c b/arch/arm/cpu/armv7/virt-v7.c index b69fd37..4cb8806 100644 --- a/arch/arm/cpu/armv7/virt-v7.c +++ b/arch/arm/cpu/armv7/virt-v7.c @@ -112,13 +112,20 @@ int armv7_init_nonsec(void) for (i = 1; i <= itlinesnr; i++) writel((unsigned)-1, gic_dist_addr + GICD_IGROUPRn + 4 * i); + /* + * Relocate secure section before any cpu runs in secure ram. + * smp_kick_all_cpus may enable other cores and runs into secure + * ram, so need to relocate secure section before enabling other + * cores. + */ + relocate_secure_section(); + #ifndef CONFIG_ARMV7_PSCI smp_set_core_boot_addr((unsigned long)secure_ram_addr(_smp_pen), -1); smp_kick_all_cpus(); #endif /* call the non-sec switching code on this CPU also */ - relocate_secure_section(); secure_ram_addr(_nonsec_init)(); return 0; } |