Skip to contentSkip to conversation

arm: cache_v7: fix dcache invalidation

RFC PATCH New Markus Niebel 2 participants 2 messages Aug 28, 2015 – Sep 1, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 arm: cache_v7: fix dcache invalidation

From: Markus Niebel <[email protected]>

according to

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka14802.html

and the clarification given by Marc Rutland of ARM

data cache invalidation should go from outer to inner cache. This patch corrects the order in

flush_dcache_range
flush_dcache_all

---
Changes for v2:
- delete non related stuff (thanks to Hannes Schmelzer)

 arch/arm/cpu/armv7/cache_v7.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/cache_v7.c +4 -4
index a5aa4fa..81eb286 100644
@@ -235,9 +235,9 @@ static void v7_inval_tlb(void)
 
 void invalidate_dcache_all(void)
 {
-	v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
-
 	v7_outer_cache_inval_all();
+
+	v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
 }
 
 /*
@@ -257,9 +257,9 @@ void flush_dcache_all(void)
  */
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
-	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
-
 	v7_outer_cache_inval_range(start, stop);
+
+	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
 }
 
 /*
Signature · 1 line
2.3.0
#1 lore raw

RFC PATCH v2 1/1 arm: cache_v7: fix dcache invalidation

Quoted 6 lines · Markus Niebel

From: Markus Niebel <[email protected]>

according to

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka14802.html

Quoted 7 lines

and the clarification given by Marc Rutland of ARM

data cache invalidation should go from outer to inner cache. This patch corrects the order in

flush_dcache_range
flush_dcache_all

Should be invalidate_dcache_range and invalidate_dcache_all, right?

Later, you should Cc maintainers.

Quoted 44 lines

---
Changes for v2:
- delete non related stuff (thanks to Hannes Schmelzer)

arch/arm/cpu/armv7/cache_v7.c | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/cache_v7.c +4 -4
index a5aa4fa..81eb286 100644
@@ -235,9 +235,9 @@ static void v7_inval_tlb(void)
 
 void invalidate_dcache_all(void)
 {
-	v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
-
 	v7_outer_cache_inval_all();
+
+	v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
 }
 
 /*
@@ -257,9 +257,9 @@ void flush_dcache_all(void)
 */
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
-	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
-
 	v7_outer_cache_inval_range(start, stop);
+
+	v7_dcache_maint_range(start, stop, ARMV7_DCACHE_INVAL_RANGE);
 }
 
 /*
Signature · 6 lines
2.3.0

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot