public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2
@ 2014-03-31 21:40 York Sun
  2014-04-02 10:05 ` FengHua
  2014-04-07 20:23 ` Albert ARIBAUD
  0 siblings, 2 replies; 3+ messages in thread
From: York Sun @ 2014-03-31 21:40 UTC (permalink / raw)
  To: u-boot

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();
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2
  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
  1 sibling, 0 replies; 3+ messages in thread
From: FengHua @ 2014-04-02 10:05 UTC (permalink / raw)
  To: u-boot




> -----Original Messages-----
> From: "York Sun" <yorksun@freescale.com>
> Sent Time: 2014-04-01 05:40:32 (Tuesday)
> To: albert.u.boot at aribaud.net
> Cc: u-boot at lists.denx.de, "York Sun" <yorksun@freescale.com>
> Subject: [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2
> 
> 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();
> -- 
> 1.7.9.5

fine!

Acked-by: David.Feng <fenghua@phytium.com.cn>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] armv8: Flush dcache before switching to EL2
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Albert ARIBAUD @ 2014-04-07 20:23 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-07 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox