summaryrefslogtreecommitdiffstats
path: root/arch/sh/mm/tlb-sh4.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-04-02 16:13:27 +0900
committerPaul Mundt <lethal@linux-sh.org>2010-04-02 16:13:27 +0900
commitbe97d758e5728099e95fe229866d5c6c900d3092 (patch)
tree5c5a3fa4b7978857562d730e3101181b5fbebb9f /arch/sh/mm/tlb-sh4.c
parent5dd6ef5050c5012267e2b84f3d82ba85cdb5ca32 (diff)
downloadblackbird-op-linux-be97d758e5728099e95fe229866d5c6c900d3092.tar.gz
blackbird-op-linux-be97d758e5728099e95fe229866d5c6c900d3092.zip
sh: Fix up the SH-3 build for recent TLB changes.
While the MMUCR.URB and ITLB/UTLB differentiation works fine for all SH-4 and later TLBs, these features are absent on SH-3. This splits out local_flush_tlb_all() in to SH-4 and PTEAEX copies while restoring the old SH-3 one, subsequently fixing up the build. This will probably want some further reordering and tidying in the future, but that's out of scope at present. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/tlb-sh4.c')
-rw-r--r--arch/sh/mm/tlb-sh4.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/sh/mm/tlb-sh4.c b/arch/sh/mm/tlb-sh4.c
index ccac77f504a8..cfdf7930d294 100644
--- a/arch/sh/mm/tlb-sh4.c
+++ b/arch/sh/mm/tlb-sh4.c
@@ -80,3 +80,31 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page)
__raw_writel(data, addr);
back_to_cached();
}
+
+void local_flush_tlb_all(void)
+{
+ unsigned long flags, status;
+ int i;
+
+ /*
+ * Flush all the TLB.
+ */
+ local_irq_save(flags);
+ jump_to_uncached();
+
+ status = __raw_readl(MMUCR);
+ status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT);
+
+ if (status == 0)
+ status = MMUCR_URB_NENTRIES;
+
+ for (i = 0; i < status; i++)
+ __raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8));
+
+ for (i = 0; i < 4; i++)
+ __raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8));
+
+ back_to_cached();
+ ctrl_barrier();
+ local_irq_restore(flags);
+}
OpenPOWER on IntegriCloud