diff options
author | Anton Blanchard <anton@samba.org> | 2010-05-16 20:28:35 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-21 17:31:12 +1000 |
commit | bc8449cc57898bc9cf1ffc4619d026f77bf327c1 (patch) | |
tree | bb4d846c5c3ad66d4e98278f43ff520320f8d917 /arch/powerpc/mm/numa.c | |
parent | 56608209d34b8add40af54031d4e420afbcde9f6 (diff) | |
download | linux-bc8449cc57898bc9cf1ffc4619d026f77bf327c1.tar.gz linux-bc8449cc57898bc9cf1ffc4619d026f77bf327c1.tar.bz2 linux-bc8449cc57898bc9cf1ffc4619d026f77bf327c1.zip |
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>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-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) const unsigned int *ref_points; struct device_node *rtas_root; unsigned int len; - struct device_node *options; + struct device_node *chosen; + const char *vec5; rtas_root = of_find_node_by_path("/rtas"); @@ -289,14 +290,17 @@ static int __init find_min_common_depth(void) "ibm,associativity-reference-points", &len); /* - * For type 1 affinity information we want the first field + * For form 1 affinity information we want the first field */ - options = of_find_node_by_path("/options"); - if (options) { - const char *str; - str = of_get_property(options, "ibm,associativity-form", NULL); - if (str && !strcmp(str, "1")) - index = 0; +#define VEC5_AFFINITY_BYTE 5 +#define VEC5_AFFINITY 0x80 + chosen = of_find_node_by_path("/chosen"); + if (chosen) { + vec5 = of_get_property(chosen, "ibm,architecture-vec-5", NULL); + if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & VEC5_AFFINITY)) { + dbg("Using form 1 affinity\n"); + index = 0; + } } if ((len >= 2 * sizeof(unsigned int)) && ref_points) { |