[PATCH 2/2] D-cache clean&&invalidate for Tiny6410

Peng Fan van.freenix at gmail.com
Wed Apr 17 12:54:05 UTC 2013


---
 c/src/lib/libcpu/arm/shared/include/arm-cp15.h |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/c/src/lib/libcpu/arm/shared/include/arm-cp15.h b/c/src/lib/libcpu/arm/shared/include/arm-cp15.h
index 3edc83f..017c0e3 100644
--- a/c/src/lib/libcpu/arm/shared/include/arm-cp15.h
+++ b/c/src/lib/libcpu/arm/shared/include/arm-cp15.h
@@ -609,6 +609,27 @@ static inline void arm_cp15_data_cache_test_and_clean(void)
   );
 }
 
+/*	In DDI0301H_arm1176jzfs_r0p7_trm
+ * 	'MCR p15, 0, <Rd>, c7, c14, 0' means
+ * 	Clean and Invalidate Entire Data Cache
+ */
+static inline void arm_cp15_data_cache_clean_and_invalidate(void)
+{
+  ARM_SWITCH_REGISTERS;
+
+  uint32_t sbz = 0;
+
+  __asm__ volatile (
+    ARM_SWITCH_TO_ARM
+    "mcr p15, 0, %[sbz], c7, c14, 0\n"
+    ARM_SWITCH_BACK
+    : ARM_SWITCH_OUTPUT
+    : [sbz] "r" (sbz)
+    : "memory"
+  );
+
+}
+
 static inline void arm_cp15_data_cache_clean_and_invalidate_line(const void *mva)
 {
   ARM_SWITCH_REGISTERS;
-- 
1.7.10.4




More information about the devel mailing list