[rtems commit] bsp/qoriq: Fix L1 cache flush

Sebastian Huber sebh at rtems.org
Mon Apr 3 12:09:16 UTC 2017


Module:    rtems
Branch:    master
Commit:    d2a45a58aa9b2d739daa3768af2864effc8f3660
Changeset: http://git.rtems.org/rtems/commit/?id=d2a45a58aa9b2d739daa3768af2864effc8f3660

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 23 10:07:52 2017 +0100

bsp/qoriq: Fix L1 cache flush

---

 c/src/lib/libbsp/powerpc/qoriq/start/start.S | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index 481b664..d9a8a39 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -54,14 +54,21 @@ _start:
 	bl	bsp_fdt_copy
 
 #ifdef QORIQ_HAS_WRITE_BACK_L1_CACHE
-	LWI	r3, bsp_section_start_begin
-	LWI	r4, bsp_section_data_load_end
-	sub	r4, r4, r3
-	bl	rtems_cache_flush_multiple_data_lines
-#else
-	bl	qoriq_l1cache_invalidate
+	/*
+	 * See PowerPC e500 Core Family Reference Manual, 11.5, L1 Data Cache
+	 * Flushing.
+	 */
+	LWI	r3, 12 * 128
+	mtctr	r3
+	LWI	r4, bsp_section_bss_begin
+1:
+	dcbz	r0, r4
+	addi	r4, r4, 32
+	bdnz	1b
 #endif
 
+	bl	qoriq_l1cache_invalidate
+
 #ifdef QORIQ_CLUSTER_1_L2CSR0
 	LWI	r3, QORIQ_CLUSTER_1_L2CSR0
 	bl	qoriq_l2cache_flush_invalidate



More information about the vc mailing list