diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-18 23:36:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-24 23:33:54 -0400 |
commit | 072bd413b88c17509c7aa7dbc398ab8bade633b3 (patch) | |
tree | 3758c722bba0a3472c88d656a925f8f0382cdeec /arch/sparc64/mm/init.c | |
parent | 83097aca8567a0bd593534853b71fe0fa9a75d69 (diff) |
sparc64: Add JBUS NUMA detection.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index b4aeb0f696dc..75d82e293c89 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -938,6 +938,10 @@ int of_node_to_nid(struct device_node *dp) | |||
938 | int count, nid; | 938 | int count, nid; |
939 | u64 grp; | 939 | u64 grp; |
940 | 940 | ||
941 | /* This is the right thing to do on currently supported | ||
942 | * SUN4U NUMA platforms as well, as the PCI controller does | ||
943 | * not sit behind any particular memory controller. | ||
944 | */ | ||
941 | if (!mlgroups) | 945 | if (!mlgroups) |
942 | return -1; | 946 | return -1; |
943 | 947 | ||
@@ -1206,8 +1210,44 @@ out: | |||
1206 | return err; | 1210 | return err; |
1207 | } | 1211 | } |
1208 | 1212 | ||
1213 | static int __init numa_parse_jbus(void) | ||
1214 | { | ||
1215 | unsigned long cpu, index; | ||
1216 | |||
1217 | /* NUMA node id is encoded in bits 36 and higher, and there is | ||
1218 | * a 1-to-1 mapping from CPU ID to NUMA node ID. | ||
1219 | */ | ||
1220 | index = 0; | ||
1221 | for_each_present_cpu(cpu) { | ||
1222 | numa_cpu_lookup_table[cpu] = index; | ||
1223 | numa_cpumask_lookup_table[index] = cpumask_of_cpu(cpu); | ||
1224 | node_masks[index].mask = ~((1UL << 36UL) - 1UL); | ||
1225 | node_masks[index].val = cpu << 36UL; | ||
1226 | |||
1227 | index++; | ||
1228 | } | ||
1229 | num_node_masks = index; | ||
1230 | |||
1231 | add_node_ranges(); | ||
1232 | |||
1233 | for (index = 0; index < num_node_masks; index++) { | ||
1234 | allocate_node_data(index); | ||
1235 | node_set_online(index); | ||
1236 | } | ||
1237 | |||
1238 | return 0; | ||
1239 | } | ||
1240 | |||
1209 | static int __init numa_parse_sun4u(void) | 1241 | static int __init numa_parse_sun4u(void) |
1210 | { | 1242 | { |
1243 | if (tlb_type == cheetah || tlb_type == cheetah_plus) { | ||
1244 | unsigned long ver; | ||
1245 | |||
1246 | __asm__ ("rdpr %%ver, %0" : "=r" (ver)); | ||
1247 | if ((ver >> 32UL) == __JALAPENO_ID || | ||
1248 | (ver >> 32UL) == __SERRANO_ID) | ||
1249 | return numa_parse_jbus(); | ||
1250 | } | ||
1211 | return -1; | 1251 | return -1; |
1212 | } | 1252 | } |
1213 | 1253 | ||