diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 11:53:54 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 11:53:54 -0500 |
commit | cb81eaedf12d3e5e6e3dcf3320089660f7fb7464 (patch) | |
tree | 64ee5ad8d9b58d405dd4aac25705a64cad96966b | |
parent | 36afc3af04f4d3dfa709f7659fcadb3336d66ed2 (diff) |
x86, numaq_32: clean up, misc
Impact: cleanup
- misc other cleanups that change the md5 signature
- consolidate global variables
- remove unnecessary __numaq_mps_oem_check() wrapper
- make numaq_mps_oem_check static
- update copyrights
- misc other cleanups pointed out by checkpatch
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/include/asm/mpspec.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/numaq_32.c | 97 |
2 files changed, 48 insertions, 51 deletions
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 5916c8df09d9..642fc7fc8cdc 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -167,6 +167,4 @@ extern int generic_mps_oem_check(struct mpc_table *, char *, char *); | |||
167 | 167 | ||
168 | extern int default_acpi_madt_oem_check(char *, char *); | 168 | extern int default_acpi_madt_oem_check(char *, char *); |
169 | 169 | ||
170 | extern void numaq_mps_oem_check(struct mpc_table *, char *, char *); | ||
171 | |||
172 | #endif /* _ASM_X86_MPSPEC_H */ | 170 | #endif /* _ASM_X86_MPSPEC_H */ |
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c index a4ea08a9ac94..62f9274a2edb 100644 --- a/arch/x86/kernel/numaq_32.c +++ b/arch/x86/kernel/numaq_32.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * Written by: Patricia Gaughen, IBM Corporation | 2 | * Written by: Patricia Gaughen, IBM Corporation |
3 | * | 3 | * |
4 | * Copyright (C) 2002, IBM Corp. | 4 | * Copyright (C) 2002, IBM Corp. |
5 | * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar | ||
5 | * | 6 | * |
6 | * All rights reserved. | 7 | * All rights reserved. |
7 | * | 8 | * |
@@ -23,6 +24,7 @@ | |||
23 | * Send feedback to <gone@us.ibm.com> | 24 | * Send feedback to <gone@us.ibm.com> |
24 | */ | 25 | */ |
25 | #include <linux/nodemask.h> | 26 | #include <linux/nodemask.h> |
27 | #include <linux/topology.h> | ||
26 | #include <linux/bootmem.h> | 28 | #include <linux/bootmem.h> |
27 | #include <linux/threads.h> | 29 | #include <linux/threads.h> |
28 | #include <linux/cpumask.h> | 30 | #include <linux/cpumask.h> |
@@ -33,10 +35,10 @@ | |||
33 | #include <linux/init.h> | 35 | #include <linux/init.h> |
34 | #include <linux/numa.h> | 36 | #include <linux/numa.h> |
35 | #include <linux/smp.h> | 37 | #include <linux/smp.h> |
38 | #include <linux/io.h> | ||
36 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
37 | 40 | ||
38 | #include <asm/processor.h> | 41 | #include <asm/processor.h> |
39 | #include <asm/topology.h> | ||
40 | #include <asm/fixmap.h> | 42 | #include <asm/fixmap.h> |
41 | #include <asm/mpspec.h> | 43 | #include <asm/mpspec.h> |
42 | #include <asm/numaq.h> | 44 | #include <asm/numaq.h> |
@@ -44,10 +46,36 @@ | |||
44 | #include <asm/apic.h> | 46 | #include <asm/apic.h> |
45 | #include <asm/e820.h> | 47 | #include <asm/e820.h> |
46 | #include <asm/ipi.h> | 48 | #include <asm/ipi.h> |
47 | #include <asm/io.h> | ||
48 | 49 | ||
49 | #define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) | 50 | #define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) |
50 | 51 | ||
52 | int found_numaq; | ||
53 | |||
54 | /* | ||
55 | * Have to match translation table entries to main table entries by counter | ||
56 | * hence the mpc_record variable .... can't see a less disgusting way of | ||
57 | * doing this .... | ||
58 | */ | ||
59 | struct mpc_trans { | ||
60 | unsigned char mpc_type; | ||
61 | unsigned char trans_len; | ||
62 | unsigned char trans_type; | ||
63 | unsigned char trans_quad; | ||
64 | unsigned char trans_global; | ||
65 | unsigned char trans_local; | ||
66 | unsigned short trans_reserved; | ||
67 | }; | ||
68 | |||
69 | /* x86_quirks member */ | ||
70 | static int mpc_record; | ||
71 | |||
72 | static __cpuinitdata struct mpc_trans *translation_table[MAX_MPC_ENTRY]; | ||
73 | |||
74 | int mp_bus_id_to_node[MAX_MP_BUSSES]; | ||
75 | int mp_bus_id_to_local[MAX_MP_BUSSES]; | ||
76 | int quad_local_to_mp_bus_id[NR_CPUS/4][4]; | ||
77 | |||
78 | |||
51 | static inline void numaq_register_node(int node, struct sys_cfg_data *scd) | 79 | static inline void numaq_register_node(int node, struct sys_cfg_data *scd) |
52 | { | 80 | { |
53 | struct eachquadmem *eq = scd->eq + node; | 81 | struct eachquadmem *eq = scd->eq + node; |
@@ -108,28 +136,6 @@ static int __init numaq_pre_time_init(void) | |||
108 | return 0; | 136 | return 0; |
109 | } | 137 | } |
110 | 138 | ||
111 | int found_numaq; | ||
112 | |||
113 | /* | ||
114 | * Have to match translation table entries to main table entries by counter | ||
115 | * hence the mpc_record variable .... can't see a less disgusting way of | ||
116 | * doing this .... | ||
117 | */ | ||
118 | struct mpc_trans { | ||
119 | unsigned char mpc_type; | ||
120 | unsigned char trans_len; | ||
121 | unsigned char trans_type; | ||
122 | unsigned char trans_quad; | ||
123 | unsigned char trans_global; | ||
124 | unsigned char trans_local; | ||
125 | unsigned short trans_reserved; | ||
126 | }; | ||
127 | |||
128 | /* x86_quirks member */ | ||
129 | static int mpc_record; | ||
130 | |||
131 | static __cpuinitdata struct mpc_trans *translation_table[MAX_MPC_ENTRY]; | ||
132 | |||
133 | static inline int generate_logical_apicid(int quad, int phys_apicid) | 139 | static inline int generate_logical_apicid(int quad, int phys_apicid) |
134 | { | 140 | { |
135 | return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1); | 141 | return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1); |
@@ -150,10 +156,6 @@ static int mpc_apic_id(struct mpc_cpu *m) | |||
150 | return logical_apicid; | 156 | return logical_apicid; |
151 | } | 157 | } |
152 | 158 | ||
153 | int mp_bus_id_to_node[MAX_MP_BUSSES]; | ||
154 | |||
155 | int mp_bus_id_to_local[MAX_MP_BUSSES]; | ||
156 | |||
157 | /* x86_quirks member */ | 159 | /* x86_quirks member */ |
158 | static void mpc_oem_bus_info(struct mpc_bus *m, char *name) | 160 | static void mpc_oem_bus_info(struct mpc_bus *m, char *name) |
159 | { | 161 | { |
@@ -166,8 +168,6 @@ static void mpc_oem_bus_info(struct mpc_bus *m, char *name) | |||
166 | printk(KERN_INFO "Bus #%d is %s (node %d)\n", m->busid, name, quad); | 168 | printk(KERN_INFO "Bus #%d is %s (node %d)\n", m->busid, name, quad); |
167 | } | 169 | } |
168 | 170 | ||
169 | int quad_local_to_mp_bus_id[NR_CPUS/4][4]; | ||
170 | |||
171 | /* x86_quirks member */ | 171 | /* x86_quirks member */ |
172 | static void mpc_oem_pci_bus(struct mpc_bus *m) | 172 | static void mpc_oem_pci_bus(struct mpc_bus *m) |
173 | { | 173 | { |
@@ -180,7 +180,7 @@ static void mpc_oem_pci_bus(struct mpc_bus *m) | |||
180 | static void __init MP_translation_info(struct mpc_trans *m) | 180 | static void __init MP_translation_info(struct mpc_trans *m) |
181 | { | 181 | { |
182 | printk(KERN_INFO | 182 | printk(KERN_INFO |
183 | "Translation: record %d, type %d, quad %d, global %d, local %d\n", | 183 | "Translation: record %d, type %d, quad %d, global %d, local %d\n", |
184 | mpc_record, m->trans_type, m->trans_quad, m->trans_global, | 184 | mpc_record, m->trans_type, m->trans_quad, m->trans_global, |
185 | m->trans_local); | 185 | m->trans_local); |
186 | 186 | ||
@@ -281,14 +281,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { | |||
281 | .update_genapic = numaq_update_genapic, | 281 | .update_genapic = numaq_update_genapic, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | void numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | ||
285 | { | ||
286 | if (strncmp(oem, "IBM NUMA", 8)) | ||
287 | printk("Warning! Not a NUMA-Q system!\n"); | ||
288 | else | ||
289 | found_numaq = 1; | ||
290 | } | ||
291 | |||
292 | static __init void early_check_numaq(void) | 284 | static __init void early_check_numaq(void) |
293 | { | 285 | { |
294 | /* | 286 | /* |
@@ -338,8 +330,6 @@ static inline void numaq_send_IPI_all(int vector) | |||
338 | numaq_send_IPI_mask(cpu_online_mask, vector); | 330 | numaq_send_IPI_mask(cpu_online_mask, vector); |
339 | } | 331 | } |
340 | 332 | ||
341 | extern void numaq_mps_oem_check(struct mpc_table *, char *, char *); | ||
342 | |||
343 | #define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8) | 333 | #define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8) |
344 | #define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa) | 334 | #define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa) |
345 | 335 | ||
@@ -355,7 +345,7 @@ static inline void numaq_smp_callin_clear_local_apic(void) | |||
355 | static inline void | 345 | static inline void |
356 | numaq_store_NMI_vector(unsigned short *high, unsigned short *low) | 346 | numaq_store_NMI_vector(unsigned short *high, unsigned short *low) |
357 | { | 347 | { |
358 | printk("Storing NMI vector\n"); | 348 | printk(KERN_ERR "Storing NMI vector\n"); |
359 | *high = | 349 | *high = |
360 | *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)); | 350 | *((volatile unsigned short *)phys_to_virt(NUMAQ_TRAMPOLINE_PHYS_HIGH)); |
361 | *low = | 351 | *low = |
@@ -390,8 +380,9 @@ static inline void numaq_init_apic_ldr(void) | |||
390 | 380 | ||
391 | static inline void numaq_setup_apic_routing(void) | 381 | static inline void numaq_setup_apic_routing(void) |
392 | { | 382 | { |
393 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", | 383 | printk(KERN_INFO |
394 | "NUMA-Q", nr_ioapics); | 384 | "Enabling APIC mode: NUMA-Q. Using %d I/O APICs\n", |
385 | nr_ioapics); | ||
395 | } | 386 | } |
396 | 387 | ||
397 | /* | 388 | /* |
@@ -473,9 +464,13 @@ static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb) | |||
473 | } | 464 | } |
474 | 465 | ||
475 | static int | 466 | static int |
476 | __numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) | 467 | numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid) |
477 | { | 468 | { |
478 | numaq_mps_oem_check(mpc, oem, productid); | 469 | if (strncmp(oem, "IBM NUMA", 8)) |
470 | printk(KERN_ERR "Warning! Not a NUMA-Q system!\n"); | ||
471 | else | ||
472 | found_numaq = 1; | ||
473 | |||
479 | return found_numaq; | 474 | return found_numaq; |
480 | } | 475 | } |
481 | 476 | ||
@@ -505,9 +500,13 @@ static void numaq_setup_portio_remap(void) | |||
505 | if (num_quads <= 1) | 500 | if (num_quads <= 1) |
506 | return; | 501 | return; |
507 | 502 | ||
508 | printk("Remapping cross-quad port I/O for %d quads\n", num_quads); | 503 | printk(KERN_INFO |
504 | "Remapping cross-quad port I/O for %d quads\n", num_quads); | ||
505 | |||
509 | xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD); | 506 | xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD); |
510 | printk("xquad_portio vaddr 0x%08lx, len %08lx\n", | 507 | |
508 | printk(KERN_INFO | ||
509 | "xquad_portio vaddr 0x%08lx, len %08lx\n", | ||
511 | (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); | 510 | (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD); |
512 | } | 511 | } |
513 | 512 | ||
@@ -542,7 +541,7 @@ struct genapic apic_numaq = { | |||
542 | .check_phys_apicid_present = numaq_check_phys_apicid_present, | 541 | .check_phys_apicid_present = numaq_check_phys_apicid_present, |
543 | .enable_apic_mode = NULL, | 542 | .enable_apic_mode = NULL, |
544 | .phys_pkg_id = numaq_phys_pkg_id, | 543 | .phys_pkg_id = numaq_phys_pkg_id, |
545 | .mps_oem_check = __numaq_mps_oem_check, | 544 | .mps_oem_check = numaq_mps_oem_check, |
546 | 545 | ||
547 | .get_apic_id = numaq_get_apic_id, | 546 | .get_apic_id = numaq_get_apic_id, |
548 | .set_apic_id = NULL, | 547 | .set_apic_id = NULL, |