diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2010-11-21 14:40:09 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-11-21 14:40:09 +0000 |
commit | 8cda9699d4a2fea8ed2c5e4a7e66e8e1e0f831df (patch) | |
tree | 34e4f2c370bd2d7977a6cc3756aeeadd7ef4e6c0 /src | |
parent | d8a789f6dfa6a8215ee3f737111e19c265af8f92 (diff) | |
download | coreboot-8cda9699d4a2fea8ed2c5e4a7e66e8e1e0f831df.tar.xz |
Convert boards to use mptable_write_buses.
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6105 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
41 files changed, 42 insertions, 447 deletions
diff --git a/src/mainboard/amd/dbm690t/get_bus_conf.c b/src/mainboard/amd/dbm690t/get_bus_conf.c index 24b9f28132..2b0fca7abf 100644 --- a/src/mainboard/amd/dbm690t/get_bus_conf.c +++ b/src/mainboard/amd/dbm690t/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs690[8]; u8 bus_sb600[2]; u32 apicid_sb600; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs690; u32 sbdn_sb600; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs690[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs690[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb600[0] = bus_rs690[0]; - bus_type[bus_rs690[0]] = 1; - /* sb600 */ dev = dev_find_slot(bus_sb600[0], PCI_DEVFN(sbdn_sb600 + 0x14, 4)); if (dev) { bus_sb600[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb600[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs690 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs690[0], PCI_DEVFN(sbdn_rs690 + i, 0)); if (dev) { bus_rs690[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs690[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs690[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/amd/dbm690t/irq_tables.c b/src/mainboard/amd/dbm690t/irq_tables.c index e3ec01a5c4..1e94a924d4 100644 --- a/src/mainboard/amd/dbm690t/irq_tables.c +++ b/src/mainboard/amd/dbm690t/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern unsigned long sbdn_sb600; diff --git a/src/mainboard/amd/dbm690t/mptable.c b/src/mainboard/amd/dbm690t/mptable.c index 54dedece17..e6c33c7189 100644 --- a/src/mainboard/amd/dbm690t/mptable.c +++ b/src/mainboard/amd/dbm690t/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 apicid_sb600; -extern u32 bus_type[256]; extern u32 sbdn_rs690; extern u32 sbdn_sb600; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/amd/mahogany/get_bus_conf.c b/src/mainboard/amd/mahogany/get_bus_conf.c index 43558ac984..bed760618e 100644 --- a/src/mainboard/amd/mahogany/get_bus_conf.c +++ b/src/mainboard/amd/mahogany/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/amd/mahogany/irq_tables.c b/src/mainboard/amd/mahogany/irq_tables.c index 800a415357..8719226b31 100644 --- a/src/mainboard/amd/mahogany/irq_tables.c +++ b/src/mainboard/amd/mahogany/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/amd/mahogany/mptable.c b/src/mainboard/amd/mahogany/mptable.c index 9a14364b36..1b22dc6493 100644 --- a/src/mainboard/amd/mahogany/mptable.c +++ b/src/mainboard/amd/mahogany/mptable.c @@ -26,20 +26,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -49,12 +47,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/amd/mahogany_fam10/get_bus_conf.c b/src/mainboard/amd/mahogany_fam10/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/amd/mahogany_fam10/get_bus_conf.c +++ b/src/mainboard/amd/mahogany_fam10/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/amd/mahogany_fam10/irq_tables.c b/src/mainboard/amd/mahogany_fam10/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/amd/mahogany_fam10/irq_tables.c +++ b/src/mainboard/amd/mahogany_fam10/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/amd/mahogany_fam10/mptable.c b/src/mainboard/amd/mahogany_fam10/mptable.c index 9114b96ce4..7409cff930 100644 --- a/src/mainboard/amd/mahogany_fam10/mptable.c +++ b/src/mainboard/amd/mahogany_fam10/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/amd/pistachio/get_bus_conf.c b/src/mainboard/amd/pistachio/get_bus_conf.c index 24b9f28132..2b0fca7abf 100644 --- a/src/mainboard/amd/pistachio/get_bus_conf.c +++ b/src/mainboard/amd/pistachio/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs690[8]; u8 bus_sb600[2]; u32 apicid_sb600; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs690; u32 sbdn_sb600; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs690[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs690[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb600[0] = bus_rs690[0]; - bus_type[bus_rs690[0]] = 1; - /* sb600 */ dev = dev_find_slot(bus_sb600[0], PCI_DEVFN(sbdn_sb600 + 0x14, 4)); if (dev) { bus_sb600[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb600[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs690 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs690[0], PCI_DEVFN(sbdn_rs690 + i, 0)); if (dev) { bus_rs690[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs690[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs690[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/amd/pistachio/irq_tables.c b/src/mainboard/amd/pistachio/irq_tables.c index 9189bf9fae..7584de2a98 100644 --- a/src/mainboard/amd/pistachio/irq_tables.c +++ b/src/mainboard/amd/pistachio/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 sbdn_sb600; diff --git a/src/mainboard/amd/pistachio/mptable.c b/src/mainboard/amd/pistachio/mptable.c index 9f3ffa8797..e9b81f5fe6 100644 --- a/src/mainboard/amd/pistachio/mptable.c +++ b/src/mainboard/amd/pistachio/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 apicid_sb600; -extern u32 bus_type[256]; extern u32 sbdn_rs690; extern u32 sbdn_sb600; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/amd/tilapia_fam10/get_bus_conf.c b/src/mainboard/amd/tilapia_fam10/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/amd/tilapia_fam10/get_bus_conf.c +++ b/src/mainboard/amd/tilapia_fam10/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/amd/tilapia_fam10/irq_tables.c b/src/mainboard/amd/tilapia_fam10/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/amd/tilapia_fam10/irq_tables.c +++ b/src/mainboard/amd/tilapia_fam10/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/amd/tilapia_fam10/mptable.c b/src/mainboard/amd/tilapia_fam10/mptable.c index c6f2bbfa0e..edcf30e350 100644 --- a/src/mainboard/amd/tilapia_fam10/mptable.c +++ b/src/mainboard/amd/tilapia_fam10/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/asrock/939a785gmh/get_bus_conf.c b/src/mainboard/asrock/939a785gmh/get_bus_conf.c index 43558ac984..bed760618e 100644 --- a/src/mainboard/asrock/939a785gmh/get_bus_conf.c +++ b/src/mainboard/asrock/939a785gmh/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/asrock/939a785gmh/irq_tables.c b/src/mainboard/asrock/939a785gmh/irq_tables.c index 800a415357..8719226b31 100644 --- a/src/mainboard/asrock/939a785gmh/irq_tables.c +++ b/src/mainboard/asrock/939a785gmh/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/asrock/939a785gmh/mptable.c b/src/mainboard/asrock/939a785gmh/mptable.c index 6c57840bc7..3c43e3cc85 100644 --- a/src/mainboard/asrock/939a785gmh/mptable.c +++ b/src/mainboard/asrock/939a785gmh/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/asus/m4a785-m/get_bus_conf.c b/src/mainboard/asus/m4a785-m/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/asus/m4a785-m/get_bus_conf.c +++ b/src/mainboard/asus/m4a785-m/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/asus/m4a785-m/mptable.c b/src/mainboard/asus/m4a785-m/mptable.c index 6cfe88e3bf..a81350e0b3 100644 --- a/src/mainboard/asus/m4a785-m/mptable.c +++ b/src/mainboard/asus/m4a785-m/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c b/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c +++ b/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/gigabyte/ma785gmt/irq_tables.c b/src/mainboard/gigabyte/ma785gmt/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/gigabyte/ma785gmt/irq_tables.c +++ b/src/mainboard/gigabyte/ma785gmt/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/gigabyte/ma785gmt/mptable.c b/src/mainboard/gigabyte/ma785gmt/mptable.c index cfd639b745..eedda4adef 100644 --- a/src/mainboard/gigabyte/ma785gmt/mptable.c +++ b/src/mainboard/gigabyte/ma785gmt/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/gigabyte/ma78gm/get_bus_conf.c b/src/mainboard/gigabyte/ma78gm/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/gigabyte/ma78gm/get_bus_conf.c +++ b/src/mainboard/gigabyte/ma78gm/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/gigabyte/ma78gm/irq_tables.c b/src/mainboard/gigabyte/ma78gm/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/gigabyte/ma78gm/irq_tables.c +++ b/src/mainboard/gigabyte/ma78gm/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/gigabyte/ma78gm/mptable.c b/src/mainboard/gigabyte/ma78gm/mptable.c index b59d0a74c5..efe80ca6c6 100644 --- a/src/mainboard/gigabyte/ma78gm/mptable.c +++ b/src/mainboard/gigabyte/ma78gm/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c b/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c +++ b/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/iei/kino-780am2-fam10/irq_tables.c b/src/mainboard/iei/kino-780am2-fam10/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/iei/kino-780am2-fam10/irq_tables.c +++ b/src/mainboard/iei/kino-780am2-fam10/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/iei/kino-780am2-fam10/mptable.c b/src/mainboard/iei/kino-780am2-fam10/mptable.c index 26fa5febf4..5e5f6fde1a 100644 --- a/src/mainboard/iei/kino-780am2-fam10/mptable.c +++ b/src/mainboard/iei/kino-780am2-fam10/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/jetway/pa78vm5/get_bus_conf.c b/src/mainboard/jetway/pa78vm5/get_bus_conf.c index 672f9e9efb..b169775456 100644 --- a/src/mainboard/jetway/pa78vm5/get_bus_conf.c +++ b/src/mainboard/jetway/pa78vm5/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs780[11]; u8 bus_sb700[2]; u32 apicid_sb700; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs780; u32 sbdn_sb700; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs780[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs780[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb700[0] = bus_rs780[0]; - bus_type[bus_rs780[0]] = 1; - /* sb700 */ dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(sbdn_sb700 + 0x14, 4)); if (dev) { bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb700[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs780 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs780[0], PCI_DEVFN(sbdn_rs780 + i, 0)); if (dev) { bus_rs780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs780[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs780[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/jetway/pa78vm5/irq_tables.c b/src/mainboard/jetway/pa78vm5/irq_tables.c index b6b0ef1941..fc9e42cddf 100644 --- a/src/mainboard/jetway/pa78vm5/irq_tables.c +++ b/src/mainboard/jetway/pa78vm5/irq_tables.c @@ -45,7 +45,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs780[8]; extern u8 bus_sb700[2]; extern unsigned long sbdn_sb700; diff --git a/src/mainboard/jetway/pa78vm5/mptable.c b/src/mainboard/jetway/pa78vm5/mptable.c index a6b9e350a7..526820bd4c 100644 --- a/src/mainboard/jetway/pa78vm5/mptable.c +++ b/src/mainboard/jetway/pa78vm5/mptable.c @@ -26,20 +26,18 @@ #include <stdint.h> #include <cpu/amd/amdfam10_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs780[11]; extern u8 bus_sb700[2]; extern u32 apicid_sb700; -extern u32 bus_type[256]; extern u32 sbdn_rs780; extern u32 sbdn_sb700; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -49,12 +47,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/kontron/kt690/get_bus_conf.c b/src/mainboard/kontron/kt690/get_bus_conf.c index 24b9f28132..2b0fca7abf 100644 --- a/src/mainboard/kontron/kt690/get_bus_conf.c +++ b/src/mainboard/kontron/kt690/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs690[8]; u8 bus_sb600[2]; u32 apicid_sb600; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs690; u32 sbdn_sb600; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs690[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs690[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb600[0] = bus_rs690[0]; - bus_type[bus_rs690[0]] = 1; - /* sb600 */ dev = dev_find_slot(bus_sb600[0], PCI_DEVFN(sbdn_sb600 + 0x14, 4)); if (dev) { bus_sb600[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb600[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs690 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs690[0], PCI_DEVFN(sbdn_rs690 + i, 0)); if (dev) { bus_rs690[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs690[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs690[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/kontron/kt690/irq_tables.c b/src/mainboard/kontron/kt690/irq_tables.c index e3ec01a5c4..1e94a924d4 100644 --- a/src/mainboard/kontron/kt690/irq_tables.c +++ b/src/mainboard/kontron/kt690/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern unsigned long sbdn_sb600; diff --git a/src/mainboard/kontron/kt690/mptable.c b/src/mainboard/kontron/kt690/mptable.c index 71adaae8bc..3792e73c91 100644 --- a/src/mainboard/kontron/kt690/mptable.c +++ b/src/mainboard/kontron/kt690/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 apicid_sb600; -extern u32 bus_type[256]; extern u32 sbdn_rs690; extern u32 sbdn_sb600; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/technexion/tim5690/get_bus_conf.c b/src/mainboard/technexion/tim5690/get_bus_conf.c index 24b9f28132..2b0fca7abf 100644 --- a/src/mainboard/technexion/tim5690/get_bus_conf.c +++ b/src/mainboard/technexion/tim5690/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs690[8]; u8 bus_sb600[2]; u32 apicid_sb600; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs690; u32 sbdn_sb600; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs690[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs690[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb600[0] = bus_rs690[0]; - bus_type[bus_rs690[0]] = 1; - /* sb600 */ dev = dev_find_slot(bus_sb600[0], PCI_DEVFN(sbdn_sb600 + 0x14, 4)); if (dev) { bus_sb600[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb600[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs690 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs690[0], PCI_DEVFN(sbdn_rs690 + i, 0)); if (dev) { bus_rs690[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs690[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs690[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/technexion/tim5690/irq_tables.c b/src/mainboard/technexion/tim5690/irq_tables.c index e3ec01a5c4..1e94a924d4 100644 --- a/src/mainboard/technexion/tim5690/irq_tables.c +++ b/src/mainboard/technexion/tim5690/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern unsigned long sbdn_sb600; diff --git a/src/mainboard/technexion/tim5690/mptable.c b/src/mainboard/technexion/tim5690/mptable.c index f9c92b446f..ec9179e0a4 100644 --- a/src/mainboard/technexion/tim5690/mptable.c +++ b/src/mainboard/technexion/tim5690/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 apicid_sb600; -extern u32 bus_type[256]; extern u32 sbdn_rs690; extern u32 sbdn_sb600; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { diff --git a/src/mainboard/technexion/tim8690/get_bus_conf.c b/src/mainboard/technexion/tim8690/get_bus_conf.c index 24b9f28132..2b0fca7abf 100644 --- a/src/mainboard/technexion/tim8690/get_bus_conf.c +++ b/src/mainboard/technexion/tim8690/get_bus_conf.c @@ -32,7 +32,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_isa; u8 bus_rs690[8]; u8 bus_sb600[2]; u32 apicid_sb600; @@ -54,8 +53,6 @@ u32 hcdnx[] = { 0x20202020, }; -u32 bus_type[256]; - u32 sbdn_rs690; u32 sbdn_sb600; @@ -67,7 +64,7 @@ void get_bus_conf(void) { u32 apicid_base; device_t dev; - int i, j; + int i; if (get_bus_conf_done == 1) return; /* do it only once */ @@ -92,25 +89,13 @@ void get_bus_conf(void) bus_rs690[i] = 0; } - for (i = 0; i < 256; i++) { - bus_type[i] = 0; /* default ISA bus. */ - } - - bus_type[0] = 1; /* pci */ - bus_rs690[0] = (sysconf.pci1234[0] >> 16) & 0xff; bus_sb600[0] = bus_rs690[0]; - bus_type[bus_rs690[0]] = 1; - /* sb600 */ dev = dev_find_slot(bus_sb600[0], PCI_DEVFN(sbdn_sb600 + 0x14, 4)); if (dev) { bus_sb600[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - for (j = bus_sb600[1]; j < bus_isa; j++) - bus_type[j] = 1; } /* rs690 */ @@ -118,16 +103,10 @@ void get_bus_conf(void) dev = dev_find_slot(bus_rs690[0], PCI_DEVFN(sbdn_rs690 + i, 0)); if (dev) { bus_rs690[i] = pci_read_config8(dev, PCI_SECONDARY_BUS); - if(255 != bus_rs690[i]) { - bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS); - bus_isa++; - bus_type[bus_rs690[i]] = 1; /* PCI bus. */ - } } } /* I/O APICs: APIC ID Version State Address */ - bus_isa = 10; #if CONFIG_LOGICAL_CPUS==1 apicid_base = get_apicid_base(1); #else diff --git a/src/mainboard/technexion/tim8690/irq_tables.c b/src/mainboard/technexion/tim8690/irq_tables.c index e3ec01a5c4..1e94a924d4 100644 --- a/src/mainboard/technexion/tim8690/irq_tables.c +++ b/src/mainboard/technexion/tim8690/irq_tables.c @@ -51,7 +51,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->slot = slot; pirq_info->rfu = rfu; } -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern unsigned long sbdn_sb600; diff --git a/src/mainboard/technexion/tim8690/mptable.c b/src/mainboard/technexion/tim8690/mptable.c index fa9b43b7a5..10080532de 100644 --- a/src/mainboard/technexion/tim8690/mptable.c +++ b/src/mainboard/technexion/tim8690/mptable.c @@ -25,20 +25,18 @@ #include <stdint.h> #include <cpu/amd/amdk8_sysconf.h> -extern u8 bus_isa; extern u8 bus_rs690[8]; extern u8 bus_sb600[2]; extern u32 apicid_sb600; -extern u32 bus_type[256]; extern u32 sbdn_rs690; extern u32 sbdn_sb600; static void *smp_write_config_table(void *v) { struct mp_config_table *mc; - int j; + int bus_isa; mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN); @@ -48,12 +46,7 @@ static void *smp_write_config_table(void *v) get_bus_conf(); - /* Bus: Bus ID Type */ - /* define bus and isa numbers */ - for (j = 0; j < bus_isa; j++) { - smp_write_bus(mc, j, (char *)"PCI "); - } - smp_write_bus(mc, bus_isa, (char *)"ISA "); + mptable_write_buses(mc, NULL, &bus_isa); /* I/O APICs: APIC ID Version State Address */ { |