[rtems commit] bsp/qoriq: Fix tlbwe synchronization

Sebastian Huber sebh at rtems.org
Thu Jul 28 10:06:55 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jul 28 10:35:24 2016 +0200

bsp/qoriq: Fix tlbwe synchronization

---

 c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S | 6 ++++--
 c/src/lib/libbsp/powerpc/qoriq/startup/mmu.c      | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S
index 25ef053..e988656 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S
@@ -48,8 +48,9 @@ qoriq_tlb1_write:
 	li	r0, 0
 	mtspr	FSL_EIS_MAS8, r0
 #endif
+	isync
+	msync
 	tlbwe
-	sync
 	isync
 	blr
 
@@ -65,8 +66,9 @@ qoriq_tlb1_invalidate:
 #ifdef QORIQ_HAS_HYPERVISOR_MODE
 	mtspr	FSL_EIS_MAS8, r0
 #endif
+	isync
+	msync
 	tlbwe
-	sync
 	isync
 	blr
 
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu.c b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu.c
index e2a0188..90a4b23 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu.c
@@ -317,7 +317,7 @@ void qoriq_mmu_change_perm(uint32_t test, uint32_t set, uint32_t clear)
 				mas3 &= ~(clear & mask);
 				mas3 |= set & mask;
 				PPC_SET_SPECIAL_PURPOSE_REGISTER(FSL_EIS_MAS3, mas3);
-				asm volatile ("tlbwe; msync; isync" : : : "memory");
+				asm volatile ("isync; msync; tlbwe; isync" : : : "memory");
 			}
 		}
 	}




More information about the vc mailing list