diff options
author | Anton Blanchard <anton@samba.org> | 2010-05-16 16:28:35 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-21 03:31:12 -0400 |
commit | bc8449cc57898bc9cf1ffc4619d026f77bf327c1 (patch) | |
tree | bb4d846c5c3ad66d4e98278f43ff520320f8d917 | |
parent | 56608209d34b8add40af54031d4e420afbcde9f6 (diff) |
powerpc/numa: Use ibm,architecture-vec-5 to detect form 1 affinity
I've been told that the architected way to determine we are in form 1
affinity mode is by reading the ibm,architecture-vec-5 property which
mirrors the layout of the fifth vector of the ibm,client-architecture
structure.
Eventually we may want to parse the ibm,architecture-vec-5 and create
FW_FEATURE_* bits.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/mm/numa.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index aace5e5dfa0a..80d110635d24 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -271,7 +271,8 @@ static int __init find_min_common_depth(void) | |||
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 | struct device_node *chosen; |
275 | const char *vec5; | ||
275 | 276 | ||
276 | rtas_root = of_find_node_by_path("/rtas"); | 277 | rtas_root = of_find_node_by_path("/rtas"); |
277 | 278 | ||
@@ -289,14 +290,17 @@ static int __init find_min_common_depth(void) | |||
289 | "ibm,associativity-reference-points", &len); | 290 | "ibm,associativity-reference-points", &len); |
290 | 291 | ||
291 | /* | 292 | /* |
292 | * For type 1 affinity information we want the first field | 293 | * For form 1 affinity information we want the first field |
293 | */ | 294 | */ |
294 | options = of_find_node_by_path("/options"); | 295 | #define VEC5_AFFINITY_BYTE 5 |
295 | if (options) { | 296 | #define VEC5_AFFINITY 0x80 |
296 | const char *str; | 297 | chosen = of_find_node_by_path("/chosen"); |
297 | str = of_get_property(options, "ibm,associativity-form", NULL); | 298 | if (chosen) { |
298 | if (str && !strcmp(str, "1")) | 299 | vec5 = of_get_property(chosen, "ibm,architecture-vec-5", NULL); |
299 | index = 0; | 300 | if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & VEC5_AFFINITY)) { |
301 | dbg("Using form 1 affinity\n"); | ||
302 | index = 0; | ||
303 | } | ||
300 | } | 304 | } |
301 | 305 | ||
302 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { | 306 | if ((len >= 2 * sizeof(unsigned int)) && ref_points) { |