From: Andre Przywara Date: Thu, 19 Sep 2013 16:06:43 +0000 (+0200) Subject: ARM: trigger non-secure state switch during bootm execution X-Git-Tag: v2013.10~46^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bb975455650b1f36681de31a93ffe54952ed3a6b;p=u-boot 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 --- diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index eefb456efb..b3a961a825 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -22,6 +22,10 @@ #include #include +#ifdef CONFIG_ARMV7_NONSEC +#include +#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 */