From: York Sun Date: Fri, 3 Feb 2017 14:25:44 -0800 Subject: [U-Boot] [RFC PATCH] spl: Flush spl image after loading Message-ID: <1486160744-1571-1-git-send-email-york.sun@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Flush spl image after loading into memory in case d-cache is enabled. Signed-off-by: York Sun --- Not sure if anyone noticed that SPL loads image but it doesn't flush the cache. As far as MMU/cache stays the same, we don't notice it. Shall we flush it? This patch is only tested on limited platforms. common/spl/spl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index f7df834..a3b9d9f 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -320,8 +320,11 @@ static int boot_from_devices(struct spl_image_info *spl_image, else puts("SPL: Unsupported Boot Device!\n"); #endif - if (loader && !spl_load_image(spl_image, loader)) + if (loader && !spl_load_image(spl_image, loader)) { + flush_dcache_range(spl_image->load_addr, + spl_image->load_addr + spl_image->size); return 0; + } } return -ENODEV; -- 2.7.4