[U-Boot] [PATCH 1/2] armv7m: cache: add flush & invalidate all dcache

Vikas Manocha vikas.manocha at st.com
Wed May 3 22:48:25 UTC 2017


Add functionality to flush & invalidate all the dcache using the
prototype declared in common header file.

Signed-off-by: Vikas Manocha <vikas.manocha at st.com>
---
 arch/arm/cpu/armv7m/cache.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/cpu/armv7m/cache.c b/arch/arm/cpu/armv7m/cache.c
index 162cfe3..84f658d 100644
--- a/arch/arm/cpu/armv7m/cache.c
+++ b/arch/arm/cpu/armv7m/cache.c
@@ -253,6 +253,21 @@ void flush_dcache_range(unsigned long start, unsigned long stop)
 		return;
 	}
 }
+void flush_dcache_all(void)
+{
+	if (action_dcache_all(FLUSH_SET_WAY)) {
+		printf("ERR: D-cache not flushed\n");
+		return;
+	}
+}
+
+void invalidate_dcache_all(void)
+{
+	if (action_dcache_all(INVALIDATE_SET_WAY)) {
+		printf("ERR: D-cache not invalidated\n");
+		return;
+	}
+}
 #else
 void dcache_enable(void)
 {
-- 
1.9.1



More information about the U-Boot mailing list