summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch')
-rw-r--r--recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch b/recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch
new file mode 100644
index 0000000..4c5e0ef
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0.6/acp3448v2/0005-Patch-arch_powerpc_mm_tlb_nohash_c.patch
@@ -0,0 +1,85 @@
1From c1707a8d6ec37484edeb8d0221ebd6de41b3f4ad Mon Sep 17 00:00:00 2001
2From: Jerry Pei <jerry.pei@enea.com>
3Date: Mon, 23 Apr 2012 14:54:32 +0800
4Subject: [PATCH 5/7] Patch arch_powerpc_mm_tlb_nohash_c to support lsi acp
5
6Signed-off-by: Jerry Pei <jerry.pei@enea.com>
7---
8 arch/powerpc/mm/tlb_nohash.c | 35 ++++++++++++++++++++++++++++++++++-
9 1 files changed, 34 insertions(+), 1 deletions(-)
10
11diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
12index 0bdad3a..b4e065b 100644
13--- a/arch/powerpc/mm/tlb_nohash.c
14+++ b/arch/powerpc/mm/tlb_nohash.c
15@@ -36,6 +36,7 @@
16 #include <linux/spinlock.h>
17 #include <linux/memblock.h>
18
19+#include <linux/of_fdt.h>
20 #include <asm/tlbflush.h>
21 #include <asm/tlb.h>
22 #include <asm/code-patching.h>
23@@ -152,6 +153,16 @@ EXPORT_SYMBOL(local_flush_tlb_page);
24 * And here are the SMP non-local implementations
25 */
26 #ifdef CONFIG_SMP
27+static int amp;
28+
29+#ifdef CONFIG_44x
30+void __init early_init_mmu_44x(void)
31+{
32+ unsigned long root = of_get_flat_dt_root();
33+ if (of_flat_dt_is_compatible(root, "ibm,47x-AMP"))
34+ amp = 1;
35+}
36+#endif /* CONFIG_44x */
37
38 static DEFINE_RAW_SPINLOCK(tlbivax_lock);
39
40@@ -232,7 +243,7 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
41 cpu_mask = mm_cpumask(mm);
42 if (!mm_is_core_local(mm)) {
43 /* If broadcast tlbivax is supported, use it */
44- if (mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) {
45+ if (!amp && mmu_has_feature(MMU_FTR_USE_TLBIVAX_BCAST)) {
46 int lock = mmu_has_feature(MMU_FTR_LOCK_BCAST_INVAL);
47 if (lock)
48 raw_spin_lock(&tlbivax_lock);
49@@ -266,6 +277,17 @@ EXPORT_SYMBOL(flush_tlb_page);
50
51 #endif /* CONFIG_SMP */
52
53+#ifdef CONFIG_PPC_47x
54+void __init early_init_mmu_47x(void)
55+{
56+#ifdef CONFIG_SMP
57+ unsigned long root = of_get_flat_dt_root();
58+ if (of_get_flat_dt_prop(root, "cooperative-partition", NULL))
59+ mmu_clear_feature(MMU_FTR_USE_TLBIVAX_BCAST);
60+#endif /* CONFIG_SMP */
61+}
62+#endif /* CONFIG_PPC_47x */
63+
64 /*
65 * Flush kernel TLB entries in the given range
66 */
67@@ -584,4 +606,15 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
68 /* Finally limit subsequent allocations */
69 memblock_set_current_limit(first_memblock_base + ppc64_rma_size);
70 }
71+#else /* ! CONFIG_PPC64 */
72+void __init early_init_mmu(void)
73+{
74+#if defined(CONFIG_SMP) && defined(CONFIG_PPC_44x)
75+ early_init_mmu_44x();
76+#endif
77+#ifdef CONFIG_PPC_47x
78+ early_init_mmu_47x();
79+#endif
80+}
81 #endif /* CONFIG_PPC64 */
82+
83--
841.7.0.4
85