]> git.sur5r.net Git - u-boot/commitdiff
armv7m: cache: add flush & invalidate all dcache
authorVikas Manocha <vikas.manocha@st.com>
Wed, 3 May 2017 22:48:25 +0000 (15:48 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 12 May 2017 12:19:14 +0000 (08:19 -0400)
Add functionality to flush & invalidate all the dcache using the
prototype declared in common header file.

Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
[trini: Add dummy functions for the not-enabled case]
Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/cpu/armv7m/cache.c

index 162cfe3928fa067a160ccd9ef726c415a2ea2677..e8f86420cf85454346994a3581af4c4f52f95e74 100644 (file)
@@ -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)
 {
@@ -268,6 +283,14 @@ int dcache_status(void)
 {
        return 0;
 }
+
+void flush_dcache_all(void)
+{
+}
+
+void invalidate_dcache_all(void)
+{
+}
 #endif
 
 #ifndef CONFIG_SYS_ICACHE_OFF