From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Date: Tue, 26 Nov 2013 15:36:53 +0100 Subject: [U-Boot] [PATCH 2/9] ARM: HYP/non-sec: move switch to non-sec to the last boot phase In-Reply-To: <1385024402-23585-3-git-send-email-marc.zyngier@arm.com> References: <1385024402-23585-1-git-send-email-marc.zyngier@arm.com> <1385024402-23585-3-git-send-email-marc.zyngier@arm.com> Message-ID: <5294B205.2020604@linaro.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/21/2013 09:59 AM, Marc Zyngier wrote: > 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. Tested on Versatile Express TC2. Albert, Tom: please apply for v2014.01. Acked-by: Andre Przywara > > Signed-off-by: Marc Zyngier > --- > arch/arm/lib/bootm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c > index f476a89..f3da634 100644 > --- a/arch/arm/lib/bootm.c > +++ b/arch/arm/lib/bootm.c > @@ -234,7 +234,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 */ > @@ -264,8 +263,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); > + } > } > > /* Main Entry point for arm bootm implementation >