[PATCH 05/10] arm/raspberrypi: update VideoCore cache flush workaround to work on RPi2.

pisa at cmp.felk.cvut.cz pisa at cmp.felk.cvut.cz
Mon Jul 4 00:07:09 UTC 2016


From: Pavel Pisa <pisa at cmp.felk.cvut.cz>

The arm_cp15_data_cache_clean_and_invalidate leads to hang on RPi2,
clean by individual lines works on RPi1 and RPi2.
---
 c/src/lib/libbsp/arm/raspberrypi/misc/vc.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c b/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
index 7bc17ba..0bec0c2 100644
--- a/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
+++ b/c/src/lib/libbsp/arm/raspberrypi/misc/vc.c
@@ -73,9 +73,20 @@ static inline void bcm2835_mailbox_buffer_flush_and_invalidate(
      */
     rtems_cache_flush_multiple_data_lines( buf, size );
     rtems_cache_invalidate_multiple_data_lines( buf, size );
-#else
-    /* Flush complete data cache */
+#elif 0
+    /* Flush complete data cache, does not work on RPi2 for some reason */
     arm_cp15_data_cache_clean_and_invalidate();
+#else
+    /*
+     * This is temporal workaround for missing cache meanager
+     * which works on RPi2
+     */
+    size += (uintptr_t)buf & ~63;
+    size = (size + 63) & ~63;
+    while ( size ) {
+      size -= 32;
+      arm_cp15_data_cache_clean_and_invalidate_line(buf);
+    }
 #endif
   }
 }
-- 
1.9.1




More information about the devel mailing list