aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-05-06 21:29:25 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-05-06 21:29:25 -0400
commit1ed31d6db90d51010545921e59d369d2f92b7ac2 (patch)
tree358a0b346bc8135cd5e53700eb44308b1a7c8c5b /arch/powerpc/mm
parentceba1abcb00b0ef0b1efcd715285f6e05523edef (diff)
parent722154e4cacf015161efe60009ae9be23d492296 (diff)
Merge commit 'origin/master' into next
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/fsl_booke_mmu.c9
-rw-r--r--arch/powerpc/mm/numa.c17
2 files changed, 17 insertions, 9 deletions
diff --git a/arch/powerpc/mm/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index c5394728bf2e..1ed6b52f3031 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -116,7 +116,7 @@ void loadcam_entry(int idx)
116 mtspr(SPRN_MAS2, TLBCAM[idx].MAS2); 116 mtspr(SPRN_MAS2, TLBCAM[idx].MAS2);
117 mtspr(SPRN_MAS3, TLBCAM[idx].MAS3); 117 mtspr(SPRN_MAS3, TLBCAM[idx].MAS3);
118 118
119 if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS) 119 if (mmu_has_feature(MMU_FTR_BIG_PHYS))
120 mtspr(SPRN_MAS7, TLBCAM[idx].MAS7); 120 mtspr(SPRN_MAS7, TLBCAM[idx].MAS7);
121 121
122 asm volatile("isync;tlbwe;isync" : : : "memory"); 122 asm volatile("isync;tlbwe;isync" : : : "memory");
@@ -152,18 +152,13 @@ static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
152 152
153 TLBCAM[index].MAS3 = (phys & MAS3_RPN) | MAS3_SX | MAS3_SR; 153 TLBCAM[index].MAS3 = (phys & MAS3_RPN) | MAS3_SX | MAS3_SR;
154 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0); 154 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_SW : 0);
155 if (cur_cpu_spec->cpu_features & MMU_FTR_BIG_PHYS) 155 if (mmu_has_feature(MMU_FTR_BIG_PHYS))
156 TLBCAM[index].MAS7 = (u64)phys >> 32; 156 TLBCAM[index].MAS7 = (u64)phys >> 32;
157 157
158#ifndef CONFIG_KGDB /* want user access for breakpoints */
159 if (flags & _PAGE_USER) { 158 if (flags & _PAGE_USER) {
160 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; 159 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
161 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); 160 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
162 } 161 }
163#else
164 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR;
165 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0);
166#endif
167 162
168 tlbcam_addrs[index].start = virt; 163 tlbcam_addrs[index].start = virt;
169 tlbcam_addrs[index].limit = virt + size - 1; 164 tlbcam_addrs[index].limit = virt + size - 1;
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d68491b31e38..aace5e5dfa0a 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -267,10 +267,11 @@ EXPORT_SYMBOL_GPL(of_node_to_nid);
267 */ 267 */
268static int __init find_min_common_depth(void) 268static int __init find_min_common_depth(void)
269{ 269{
270 int depth; 270 int depth, index;
271 const unsigned int *ref_points; 271 const unsigned int *ref_points;
272 struct device_node *rtas_root; 272 struct device_node *rtas_root;
273 unsigned int len; 273 unsigned int len;
274 struct device_node *options;
274 275
275 rtas_root = of_find_node_by_path("/rtas"); 276 rtas_root = of_find_node_by_path("/rtas");
276 277
@@ -283,11 +284,23 @@ static int __init find_min_common_depth(void)
283 * configuration (should be all 0's) and the second is for a normal 284 * configuration (should be all 0's) and the second is for a normal
284 * NUMA configuration. 285 * NUMA configuration.
285 */ 286 */
287 index = 1;
286 ref_points = of_get_property(rtas_root, 288 ref_points = of_get_property(rtas_root,
287 "ibm,associativity-reference-points", &len); 289 "ibm,associativity-reference-points", &len);
288 290
291 /*
292 * For type 1 affinity information we want the first field
293 */
294 options = of_find_node_by_path("/options");
295 if (options) {
296 const char *str;
297 str = of_get_property(options, "ibm,associativity-form", NULL);
298 if (str && !strcmp(str, "1"))
299 index = 0;
300 }
301
289 if ((len >= 2 * sizeof(unsigned int)) && ref_points) { 302 if ((len >= 2 * sizeof(unsigned int)) && ref_points) {
290 depth = ref_points[1]; 303 depth = ref_points[index];
291 } else { 304 } else {
292 dbg("NUMA: ibm,associativity-reference-points not found.\n"); 305 dbg("NUMA: ibm,associativity-reference-points not found.\n");
293 depth = -1; 306 depth = -1;