diff options
author | Dipankar Sarma <dipankar@in.ibm.com> | 2011-10-28 00:25:32 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-11-07 22:51:46 -0500 |
commit | 1c8ee73395af762726e9eb628636d3b763618c60 (patch) | |
tree | 5742e4d091f0d9c479b6d2e14a5fcb5df7d02e00 /arch/powerpc/mm | |
parent | c40dd2f76644016ca7677545fc846ec2470d70a1 (diff) |
powerpc/numa: NUMA topology support for PowerNV
This patch adds support for numa topology on powernv platforms running
OPAL formware. It checks for the type of platform at run time and
sets the affinity form correctly so that NUMA topology can be discovered
correctly.
Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/numa.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index c7dd4dec4df8..b22a83a91cb8 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -315,7 +315,10 @@ static int __init find_min_common_depth(void) | |||
315 | struct device_node *root; | 315 | struct device_node *root; |
316 | const char *vec5; | 316 | const char *vec5; |
317 | 317 | ||
318 | root = of_find_node_by_path("/rtas"); | 318 | if (firmware_has_feature(FW_FEATURE_OPAL)) |
319 | root = of_find_node_by_path("/ibm,opal"); | ||
320 | else | ||
321 | root = of_find_node_by_path("/rtas"); | ||
319 | if (!root) | 322 | if (!root) |
320 | root = of_find_node_by_path("/"); | 323 | root = of_find_node_by_path("/"); |
321 | 324 | ||
@@ -344,12 +347,19 @@ static int __init find_min_common_depth(void) | |||
344 | 347 | ||
345 | #define VEC5_AFFINITY_BYTE 5 | 348 | #define VEC5_AFFINITY_BYTE 5 |
346 | #define VEC5_AFFINITY 0x80 | 349 | #define VEC5_AFFINITY 0x80 |
347 | chosen = of_find_node_by_path("/chosen"); | 350 | |
348 | if (chosen) { | 351 | if (firmware_has_feature(FW_FEATURE_OPAL)) |
349 | vec5 = of_get_property(chosen, "ibm,architecture-vec-5", NULL); | 352 | form1_affinity = 1; |
350 | if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & VEC5_AFFINITY)) { | 353 | else { |
351 | dbg("Using form 1 affinity\n"); | 354 | chosen = of_find_node_by_path("/chosen"); |
352 | form1_affinity = 1; | 355 | if (chosen) { |
356 | vec5 = of_get_property(chosen, | ||
357 | "ibm,architecture-vec-5", NULL); | ||
358 | if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & | ||
359 | VEC5_AFFINITY)) { | ||
360 | dbg("Using form 1 affinity\n"); | ||
361 | form1_affinity = 1; | ||
362 | } | ||
353 | } | 363 | } |
354 | } | 364 | } |
355 | 365 | ||