summaryrefslogtreecommitdiff
path: root/cpu/mpc85xx
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2009-08-20 17:45:05 -0500
committerTom Rix <Tom.Rix@windriver.com>2009-10-03 09:04:27 -0500
commiteea886da9a7f4fc2cb27952ce460e9daae98d2d0 (patch)
tree6947584c6a2054d3a841b25e9cd11823430968cb /cpu/mpc85xx
parent3477bda1f5944a7e97918917c63d56dc144e1a51 (diff)
ppc/85xx: Ensure that MAS8 is zero when writing TLB entries.
Its reset value is random, and we sometimes read uninitialized TLB arrays. Make sure that we don't retain MAS8 from reading such an entry if the VF bit in MAS8 is set, attempts to use the mapping will trap. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'cpu/mpc85xx')
-rw-r--r--cpu/mpc85xx/start.S4
-rw-r--r--cpu/mpc85xx/tlb.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/cpu/mpc85xx/start.S b/cpu/mpc85xx/start.S
index eaed0e0be5..7a23b4f811 100644
--- a/cpu/mpc85xx/start.S
+++ b/cpu/mpc85xx/start.S
@@ -156,6 +156,10 @@ _start_e500:
mtspr MCSR,r0 /* machine check syndrome register */
mtxer r0 /* clear integer exception register */
+#ifdef CONFIG_SYS_BOOK3E_HV
+ mtspr MAS8,r0 /* make sure MAS8 is clear */
+#endif
+
/* Enable Time Base and Select Time Base Clock */
lis r0,HID0_EMCP@h /* Enable machine check */
#if defined(CONFIG_ENABLE_36BIT_PHYS)
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c
index 0497a29ba8..03c2449b5c 100644
--- a/cpu/mpc85xx/tlb.c
+++ b/cpu/mpc85xx/tlb.c
@@ -51,6 +51,9 @@ void set_tlb(u8 tlb, u32 epn, u64 rpn,
#ifdef CONFIG_ENABLE_36BIT_PHYS
mtspr(MAS7, _mas7);
#endif
+#ifdef CONFIG_SYS_BOOK3E_HV
+ mtspr(MAS8, 0);
+#endif
asm volatile("isync;msync;tlbwe;isync");
#ifdef CONFIG_ADDR_MAP