summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@linaro.org>2013-09-19 18:06:43 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-10-03 21:28:46 +0200
commitbb975455650b1f36681de31a93ffe54952ed3a6b (patch)
treec3fa9698a0cf9246d22f301d4e49616e53a051c6 /arch
parent1ef923851ab8ffcc4265fd991815b88d9c1f12d7 (diff)
downloadu-boot-imx-bb975455650b1f36681de31a93ffe54952ed3a6b.zip
u-boot-imx-bb975455650b1f36681de31a93ffe54952ed3a6b.tar.gz
u-boot-imx-bb975455650b1f36681de31a93ffe54952ed3a6b.tar.bz2
ARM: trigger non-secure state switch during bootm execution
To actually trigger the non-secure switch we just implemented, call the switching routine from within the bootm command implementation. This way we automatically enable this feature without further user intervention. Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/lib/bootm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index eefb456..b3a961a 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -22,6 +22,10 @@
#include <asm/bootm.h>
#include <linux/compiler.h>
+#ifdef CONFIG_ARMV7_NONSEC
+#include <asm/armv7.h>
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
static struct tag *params;
@@ -181,6 +185,14 @@ static void setup_end_tag(bd_t *bd)
__weak void setup_board_tags(struct tag **in_params) {}
+static void do_nonsec_virt_switch(void)
+{
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+ if (armv7_switch_nonsec() == 0)
+ debug("entered non-secure state\n");
+#endif
+}
+
/* Subcommand: PREP */
static void boot_prep_linux(bootm_headers_t *images)
{
@@ -217,6 +229,7 @@ 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 */