summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2014-07-12 14:23:58 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2014-07-28 17:05:59 +0200
commitc19e0dd7412f5c4bce8c5057c40e747b1acb39e2 (patch)
treeab8ac050894738e2be417d7bb09bc1fc7d339cc3
parentb1cdd8baa14f518288ceddb391d6587c1ecb3174 (diff)
downloadu-boot-imx-c19e0dd7412f5c4bce8c5057c40e747b1acb39e2.zip
u-boot-imx-c19e0dd7412f5c4bce8c5057c40e747b1acb39e2.tar.gz
u-boot-imx-c19e0dd7412f5c4bce8c5057c40e747b1acb39e2.tar.bz2
ARM: HYP/non-sec: move switch to non-sec to the last boot phase
Having the switch to non-secure in the "prep" phase is causing all kind of troubles, as that stage can be called multiple times. Instead, move the switch to non-secure to the last possible phase, when there is no turning back anymore. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
-rw-r--r--arch/arm/lib/bootm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 47ee070..304210e 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -242,7 +242,6 @@ static void boot_prep_linux(bootm_headers_t *images)
printf("FDT and ATAGS support not compiled in - hanging\n");
hang();
}
- do_nonsec_virt_switch();
}
/* Subcommand: GO */
@@ -260,8 +259,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
announce_and_cleanup(fake);
- if (!fake)
+ if (!fake) {
+ do_nonsec_virt_switch();
kernel_entry(images->ft_addr);
+ }
#else
unsigned long machid = gd->bd->bi_arch_number;
char *s;
@@ -287,8 +288,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
else
r2 = gd->bd->bi_boot_params;
- if (!fake)
+ if (!fake) {
+ do_nonsec_virt_switch();
kernel_entry(0, machid, r2);
+ }
#endif
}