From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2
Date: Mon, 7 Apr 2014 22:23:44 +0200 [thread overview]
Message-ID: <E1WXG54-0000EM-6V@janus> (raw)
In-Reply-To: <1396302032-31292-1-git-send-email-yorksun@freescale.com>
Hi York,
On Mon, 31 Mar 2014 14:40:32 -0700, York Sun <yorksun@freescale.com>
wrote:
> For ARMv8, U-boot has been running at EL3 with cache and MMU enabled.
> Without proper setup for EL2, cache and MMU are both disabled (out of
> reset). Before switching, we need to flush the dcache to make sure the
> data is in the main memory.
>
> Signed-off-by: York Sun <yorksun@freescale.com>
> ---
> arch/arm/lib/bootm.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index a8295bf..9782ddb 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -199,6 +199,7 @@ static void do_nonsec_virt_switch(void)
>
> #ifdef CONFIG_ARM64
> smp_kick_all_cpus();
> + flush_dcache_all(); /* flush cache before swtiching to EL2 */
> armv8_switch_to_el2();
> #ifdef CONFIG_ARMV8_SWITCH_TO_EL1
> armv8_switch_to_el1();
Applied as a bugfix to u-boot-arm/master, thanks!
Amicalement,
--
Albert.
prev parent reply other threads:[~2014-04-07 20:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 21:40 [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2 York Sun
2014-04-02 10:05 ` FengHua
2014-04-07 20:23 ` Albert ARIBAUD [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1WXG54-0000EM-6V@janus \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox