Skip to content
Snippets Groups Projects
Commit 02251eef authored by Peng Fan's avatar Peng Fan Committed by Albert ARIBAUD
Browse files

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: default avatarPeng Fan <Peng.Fan@freescale.com>
Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
parent 419fa9ae
No related branches found
No related tags found
No related merge requests found
...@@ -112,13 +112,20 @@ int armv7_init_nonsec(void) ...@@ -112,13 +112,20 @@ int armv7_init_nonsec(void)
for (i = 1; i <= itlinesnr; i++) for (i = 1; i <= itlinesnr; i++)
writel((unsigned)-1, gic_dist_addr + GICD_IGROUPRn + 4 * 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 #ifndef CONFIG_ARMV7_PSCI
smp_set_core_boot_addr((unsigned long)secure_ram_addr(_smp_pen), -1); smp_set_core_boot_addr((unsigned long)secure_ram_addr(_smp_pen), -1);
smp_kick_all_cpus(); smp_kick_all_cpus();
#endif #endif
/* call the non-sec switching code on this CPU also */ /* call the non-sec switching code on this CPU also */
relocate_secure_section();
secure_ram_addr(_nonsec_init)(); secure_ram_addr(_nonsec_init)();
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment