[rtems commit] bsp/qoriq: Fix MMU initialization for e6500
Sebastian Huber
sebh at rtems.org
Thu Apr 14 06:00:50 UTC 2016
Module: rtems
Branch: master
Commit: a12724f9343a2016958fdc31b4c7362c9429ce78
Changeset: http://git.rtems.org/rtems/commit/?id=a12724f9343a2016958fdc31b4c7362c9429ce78
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Apr 14 07:57:38 2016 +0200
bsp/qoriq: Fix MMU initialization for e6500
In case a hypervisor mode is present, then we must set MAS8 for some TLB
operations, otherwise the run-time behaviour is unpredictable.
---
c/src/lib/libbsp/powerpc/qoriq/configure.ac | 4 ++++
c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S | 13 +++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/c/src/lib/libbsp/powerpc/qoriq/configure.ac b/c/src/lib/libbsp/powerpc/qoriq/configure.ac
index a02f209..bc78d7d 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/configure.ac
+++ b/c/src/lib/libbsp/powerpc/qoriq/configure.ac
@@ -164,6 +164,10 @@ RTEMS_BSPOPTS_SET([QORIQ_MMU_DEVICE_MAS7],[qoriq_t*],[0xf])
RTEMS_BSPOPTS_SET([QORIQ_MMU_DEVICE_MAS7],[*],[0x0])
RTEMS_BSPOPTS_HELP([QORIQ_MMU_DEVICE_MAS7],[MAS7 value for device TLB1 entries])
+RTEMS_BSPOPTS_SET([QORIQ_HAS_HYPERVISOR_MODE],[qoriq_t*],[1])
+RTEMS_BSPOPTS_SET([QORIQ_HAS_HYPERVISOR_MODE],[*],[])
+RTEMS_BSPOPTS_HELP([QORIQ_HAS_HYPERVISOR_MODE],[defined if the processor core has a hypervisor mode])
+
RTEMS_BSPOPTS_SET([QORIQ_L2CSR0],[qoriq_t*],[0xfec20000])
RTEMS_BSPOPTS_SET([QORIQ_L2CSR0],[*],[])
RTEMS_BSPOPTS_HELP([QORIQ_L2CSR0],[address of L2CSR0 register])
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 dfd0be9..5d04c2f 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/mmu-tlb1.S
@@ -7,10 +7,10 @@
*/
/*
- * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2011, 2016 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems at embedded-brains.de>
@@ -20,6 +20,8 @@
* http://www.rtems.org/license/LICENSE.
*/
+#include <bspopts.h>
+
#include <libcpu/powerpc-utility.h>
.global qoriq_tlb1_write
@@ -42,6 +44,10 @@ qoriq_tlb1_write:
or r6, r8, r6
mtspr FSL_EIS_MAS3, r6
mtspr FSL_EIS_MAS7, r7
+#ifdef QORIQ_HAS_HYPERVISOR_MODE
+ li r0, 0
+ mtspr FSL_EIS_MAS8, r0
+#endif
tlbwe
sync
isync
@@ -56,6 +62,9 @@ qoriq_tlb1_invalidate:
mtspr FSL_EIS_MAS2, r0
mtspr FSL_EIS_MAS3, r0
mtspr FSL_EIS_MAS7, r0
+#ifdef QORIQ_HAS_HYPERVISOR_MODE
+ mtspr FSL_EIS_MAS8, r0
+#endif
tlbwe
sync
isync
More information about the vc
mailing list