Commit bc8449cc authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 56608209
...@@ -271,7 +271,8 @@ static int __init find_min_common_depth(void) ...@@ -271,7 +271,8 @@ static int __init find_min_common_depth(void)
const unsigned int *ref_points; const unsigned int *ref_points;
struct device_node *rtas_root; struct device_node *rtas_root;
unsigned int len; unsigned int len;
struct device_node *options; struct device_node *chosen;
const char *vec5;
rtas_root = of_find_node_by_path("/rtas"); rtas_root = of_find_node_by_path("/rtas");
...@@ -289,14 +290,17 @@ static int __init find_min_common_depth(void) ...@@ -289,14 +290,17 @@ static int __init find_min_common_depth(void)
"ibm,associativity-reference-points", &len); "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"); #define VEC5_AFFINITY_BYTE 5
if (options) { #define VEC5_AFFINITY 0x80
const char *str; chosen = of_find_node_by_path("/chosen");
str = of_get_property(options, "ibm,associativity-form", NULL); if (chosen) {
if (str && !strcmp(str, "1")) vec5 = of_get_property(chosen, "ibm,architecture-vec-5", NULL);
index = 0; if (vec5 && (vec5[VEC5_AFFINITY_BYTE] & VEC5_AFFINITY)) {
dbg("Using form 1 affinity\n");
index = 0;
}
} }
if ((len >= 2 * sizeof(unsigned int)) && ref_points) { if ((len >= 2 * sizeof(unsigned int)) && ref_points) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment