Skip to contentSkip to conversation

spl: Flush spl image after loading

RFC PATCH New York Sun 1 participant 1 message Feb 3, 2017

lore
Share & tools
lore

York Sun

author
#0 lore raw

RFC PATCH 1/1 spl: Flush spl image after loading

Flush spl image after loading into memory in case d-cache is enabled.

---
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(-)
common/spl/spl.c +4 -1
index f7df834..a3b9d9f 100644
@@ -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;
Signature · 1 line
2.7.4