[PATCH 22/26 v6] spl: spl_legacy: Add cache flush after reading U-Boot image

Simon Goldschmidt simon.k.r.goldschmidt at gmail.com
Thu Apr 9 09:29:48 CEST 2020


Am 08.04.2020 um 10:09 schrieb Stefan Roese:
> From: Weijie Gao <weijie.gao at mediatek.com>
> 
> Flush the cache after reading of the U-Boot proper into SDRAM so that
> it can be started.
> 
> This is needed on some platforms, e.g. MT76x8.
> 
> Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Weijie Gao <weijie.gao at mediatek.com>
> Cc: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
> ---
> Changes in v6:
> - New patch
> 
>  common/spl/spl_legacy.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
> index 2cd2a74a4c..e320206098 100644
> --- a/common/spl/spl_legacy.c
> +++ b/common/spl/spl_legacy.c
> @@ -4,6 +4,7 @@
>   */
>  
>  #include <common.h>
> +#include <cpu_func.h>
>  #include <malloc.h>
>  #include <spl.h>
>  
> @@ -108,5 +109,8 @@ int spl_load_legacy_img(struct spl_image_info *spl_image,
>  		return -EINVAL;
>  	}
>  
> +	/* Flush cache of loaded U-Boot image */
> +	flush_cache((unsigned long)spl_image->load_addr, spl_image->size);
> +

I failed to find the mail, but haven't we discussed moving this cache
flush to your arch before starting a binary?

I cannot see this being required or implemented for non-legacy images,
and it still seems wrong here.

Regards,
Simon

>  	return 0;
>  }
> 



More information about the U-Boot mailing list