]> git.sur5r.net Git - u-boot/commitdiff
ARM: trigger non-secure state switch during bootm execution
authorAndre Przywara <andre.przywara@linaro.org>
Thu, 19 Sep 2013 16:06:43 +0000 (18:06 +0200)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 3 Oct 2013 19:28:46 +0000 (21:28 +0200)
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>
arch/arm/lib/bootm.c

index eefb456efb50257283a3d215a98404ac0c23d504..b3a961a825afbcd9834b64974d5d030527594d95 100644 (file)
 #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 */