Commit 37d1206a authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Patrick Mochel

[PATCH] mpparse cleanups

Most of code originally by James Cleverdon.

More stuff reformed in the mpparse sections - this time not apic stuff,
so we create mach_mpparse.h and stick it in there.

Abstracts out:
 - mpc_oem_bus_info() - stores mappings between buses and nodes/quads.
 - mpc_oem_pci_bus()  - stores mappings between global and local pci bus numbers

Changes summit_check() into mps_oem_check() to generalise it.
parent 43f1c206
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/io_apic.h> #include <asm/io_apic.h>
#include <mach_apic.h> #include <mach_apic.h>
#include <mach_mpparse.h>
/* Have we found an MP table */ /* Have we found an MP table */
int smp_found_config; int smp_found_config;
...@@ -191,28 +192,18 @@ void __init MP_processor_info (struct mpc_config_processor *m) ...@@ -191,28 +192,18 @@ void __init MP_processor_info (struct mpc_config_processor *m)
static void __init MP_bus_info (struct mpc_config_bus *m) static void __init MP_bus_info (struct mpc_config_bus *m)
{ {
char str[7]; char str[7];
int quad;
memcpy(str, m->mpc_bustype, 6); memcpy(str, m->mpc_bustype, 6);
str[6] = 0; str[6] = 0;
if (clustered_apic_mode) { mpc_oem_bus_info(m, str, translation_table[mpc_record]);
quad = translation_table[mpc_record]->trans_quad;
mp_bus_id_to_node[m->mpc_busid] = quad;
mp_bus_id_to_local[m->mpc_busid] = translation_table[mpc_record]->trans_local;
printk("Bus #%d is %s (node %d)\n", m->mpc_busid, str, quad);
} else {
Dprintk("Bus #%d is %s\n", m->mpc_busid, str);
}
if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) { if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA)-1) == 0) {
mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA;
} else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) { } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA)-1) == 0) {
mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA; mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA;
} else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI)-1) == 0) { } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI)-1) == 0) {
if (clustered_apic_mode){ mpc_oem_pci_bus(m, translation_table[mpc_record]);
quad_local_to_mp_bus_id[quad][translation_table[mpc_record]->trans_local] = m->mpc_busid;
}
mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI; mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI;
mp_bus_id_to_pci_bus[m->mpc_busid] = mp_current_pci_id; mp_bus_id_to_pci_bus[m->mpc_busid] = mp_current_pci_id;
mp_current_pci_id++; mp_current_pci_id++;
...@@ -300,6 +291,7 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, \ ...@@ -300,6 +291,7 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, \
int count = sizeof (*oemtable); /* the header size */ int count = sizeof (*oemtable); /* the header size */
unsigned char *oemptr = ((unsigned char *)oemtable)+count; unsigned char *oemptr = ((unsigned char *)oemtable)+count;
mpc_record = 0;
printk("Found an OEM MPC table at %8p - parsing it ... \n", oemtable); printk("Found an OEM MPC table at %8p - parsing it ... \n", oemtable);
if (memcmp(oemtable->oem_signature,MPC_OEM_SIGNATURE,4)) if (memcmp(oemtable->oem_signature,MPC_OEM_SIGNATURE,4))
{ {
...@@ -376,7 +368,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) ...@@ -376,7 +368,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
str[12]=0; str[12]=0;
printk("Product ID: %s ",str); printk("Product ID: %s ",str);
summit_check(oem, str); mps_oem_check(mpc, oem, str);
printk("APIC at: 0x%lX\n",mpc->mpc_lapic); printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
...@@ -387,16 +379,10 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) ...@@ -387,16 +379,10 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
if (!acpi_lapic) if (!acpi_lapic)
mp_lapic_addr = mpc->mpc_lapic; mp_lapic_addr = mpc->mpc_lapic;
if (clustered_apic_mode && mpc->mpc_oemptr) {
/* We need to process the oem mpc tables to tell us which quad things are in ... */
mpc_record = 0;
smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr, mpc->mpc_oemsize);
mpc_record = 0;
}
/* /*
* Now process the configuration blocks. * Now process the configuration blocks.
*/ */
mpc_record = 0;
while (count < mpc->mpc_length) { while (count < mpc->mpc_length) {
switch(*mpt) { switch(*mpt) {
case MP_PROCESSOR: case MP_PROCESSOR:
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
#define APIC_BROADCAST_ID 0x0F #define APIC_BROADCAST_ID 0x0F
#define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid)) #define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid))
static inline void summit_check(char *oem, char *productid)
{
}
static inline int apic_id_registered(void) static inline int apic_id_registered(void)
{ {
return (test_bit(GET_APIC_ID(apic_read(APIC_ID)), return (test_bit(GET_APIC_ID(apic_read(APIC_ID)),
......
#ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation)
{
Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
}
static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
struct mpc_config_translation *translation)
{
}
static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
}
#endif /* __ASM_MACH_MPPARSE_H */
...@@ -10,10 +10,6 @@ ...@@ -10,10 +10,6 @@
#define APIC_BROADCAST_ID 0x0F #define APIC_BROADCAST_ID 0x0F
#define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid)) #define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid))
static inline void summit_check(char *oem, char *productid)
{
}
static inline int apic_id_registered(void) static inline int apic_id_registered(void)
{ {
return (1); return (1);
......
#ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H
static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
unsigned short oemsize);
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation)
{
int quad = translation->trans_quad;
int local = translation->trans_local;
mp_bus_id_to_node[m->mpc_busid] = quad;
mp_bus_id_to_local[m->mpc_busid] = local;
printk("Bus #%d is %s (node %d)\n", m->mpc_busid, name, quad);
}
static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
struct mpc_config_translation *translation)
{
int quad = translation->trans_quad;
int local = translation->trans_local;
quad_local_to_mp_bus_id[quad][local] = m->mpc_busid;
}
static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
if (strncmp(oem, "IBM NUMA", 8))
printk("Warning! May not be a NUMA-Q system!\n");
if (mpc->mpc_oemptr)
smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr,
mpc->mpc_oemsize);
}
#endif /* __ASM_MACH_MPPARSE_H */
...@@ -26,12 +26,6 @@ static inline unsigned long calculate_ldr(unsigned long old) ...@@ -26,12 +26,6 @@ static inline unsigned long calculate_ldr(unsigned long old)
#define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F) #define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F)
#define check_apicid_used(bitmap, apicid) (0) #define check_apicid_used(bitmap, apicid) (0)
static inline void summit_check(char *oem, char *productid)
{
if (!strncmp(oem, "IBM ENSW", 8) && !strncmp(str, "VIGIL SMP", 9))
x86_summit = 1;
}
static inline void clustered_apic_check(void) static inline void clustered_apic_check(void)
{ {
printk("Enabling APIC mode: %s. Using %d I/O APICs\n", printk("Enabling APIC mode: %s. Using %d I/O APICs\n",
......
#ifndef __ASM_MACH_MPPARSE_H
#define __ASM_MACH_MPPARSE_H
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation)
{
Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
}
static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
struct mpc_config_translation *translation)
{
}
static inline void mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
if (!strncmp(oem, "IBM ENSW", 8) && !strncmp(str, "VIGIL SMP", 9))
x86_summit = 1;
}
#endif /* __ASM_MACH_MPPARSE_H */
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