From patchwork Wed Apr 8 08:09:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 237383 List-Id: U-Boot discussion From: sr at denx.de (Stefan Roese) Date: Wed, 8 Apr 2020 10:09:38 +0200 Subject: [PATCH 22/26 v6] spl: spl_legacy: Add cache flush after reading U-Boot image In-Reply-To: <20200408080942.7694-1-sr@denx.de> References: <20200408080942.7694-1-sr@denx.de> Message-ID: <20200408080942.7694-23-sr@denx.de> From: Weijie Gao 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 Signed-off-by: Stefan Roese Cc: Weijie Gao Cc: Simon Goldschmidt --- 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 +#include #include #include @@ -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); + return 0; }