Convert boards to use mptable_write_buses.
authorPatrick Georgi <patrick@georgi-clan.de>
Sun, 21 Nov 2010 14:40:09 +0000 (14:40 +0000)
committerPatrick Georgi <patrick.georgi@coresystems.de>
Sun, 21 Nov 2010 14:40:09 +0000 (14:40 +0000)
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

41 files changed:
src/mainboard/amd/dbm690t/get_bus_conf.c
src/mainboard/amd/dbm690t/irq_tables.c
src/mainboard/amd/dbm690t/mptable.c
src/mainboard/amd/mahogany/get_bus_conf.c
src/mainboard/amd/mahogany/irq_tables.c
src/mainboard/amd/mahogany/mptable.c
src/mainboard/amd/mahogany_fam10/get_bus_conf.c
src/mainboard/amd/mahogany_fam10/irq_tables.c
src/mainboard/amd/mahogany_fam10/mptable.c
src/mainboard/amd/pistachio/get_bus_conf.c
src/mainboard/amd/pistachio/irq_tables.c
src/mainboard/amd/pistachio/mptable.c
src/mainboard/amd/tilapia_fam10/get_bus_conf.c
src/mainboard/amd/tilapia_fam10/irq_tables.c
src/mainboard/amd/tilapia_fam10/mptable.c
src/mainboard/asrock/939a785gmh/get_bus_conf.c
src/mainboard/asrock/939a785gmh/irq_tables.c
src/mainboard/asrock/939a785gmh/mptable.c
src/mainboard/asus/m4a785-m/get_bus_conf.c
src/mainboard/asus/m4a785-m/mptable.c
src/mainboard/gigabyte/ma785gmt/get_bus_conf.c
src/mainboard/gigabyte/ma785gmt/irq_tables.c
src/mainboard/gigabyte/ma785gmt/mptable.c
src/mainboard/gigabyte/ma78gm/get_bus_conf.c
src/mainboard/gigabyte/ma78gm/irq_tables.c
src/mainboard/gigabyte/ma78gm/mptable.c
src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c
src/mainboard/iei/kino-780am2-fam10/irq_tables.c
src/mainboard/iei/kino-780am2-fam10/mptable.c
src/mainboard/jetway/pa78vm5/get_bus_conf.c
src/mainboard/jetway/pa78vm5/irq_tables.c
src/mainboard/jetway/pa78vm5/mptable.c
src/mainboard/kontron/kt690/get_bus_conf.c
src/mainboard/kontron/kt690/irq_tables.c
src/mainboard/kontron/kt690/mptable.c
src/mainboard/technexion/tim5690/get_bus_conf.c
src/mainboard/technexion/tim5690/irq_tables.c
src/mainboard/technexion/tim5690/mptable.c
src/mainboard/technexion/tim8690/get_bus_conf.c
src/mainboard/technexion/tim8690/irq_tables.c
src/mainboard/technexion/tim8690/mptable.c

index 24b9f28132e8142544930ececd01756aa1f15c03..2b0fca7abf3b6fa485832261c22cfed765177a40 100644 (file)
@@ -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
index e3ec01a5c43801f179202ca72aa40d0aa01ab8c4..1e94a924d48a61ed10d4670f6dc7b30e2a5a0271 100644 (file)
@@ -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;
index 54dedece17473db10ae818352dc1425e8c2304c7..e6c33c7189e6936be89b05dfa705b3105cfcca83 100644 (file)
 #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 */
        {
index 43558ac984645848500f5173086debba35140fb4..bed760618e0621b3bae7b63205e1abcb296401c8 100644 (file)
@@ -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
index 800a41535740ba868259432c95704b96668209b4..8719226b31f4498f8bce8087ac509673806c191b 100644 (file)
@@ -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;
index 9a14364b3651ef12adae3bac3d481e1d5840b8ca..1b22dc6493b896ac1db2fce663aa005229a5372b 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index 9114b96ce42cb35af2c02c465bc3ca40f10a1b6b..7409cff9303ffdcd6cc3526a0f325789b15bfabc 100644 (file)
 #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 */
        {
index 24b9f28132e8142544930ececd01756aa1f15c03..2b0fca7abf3b6fa485832261c22cfed765177a40 100644 (file)
@@ -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
index 9189bf9fae5721a257e92352b01a19f052e506fd..7584de2a98d3d27c26d85546ee07833cda2fad13 100644 (file)
@@ -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;
index 9f3ffa87978cab0dc4553286cd924c760abd3324..e9b81f5fe619e73f5a47361c3045786cb7c3945a 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index c6f2bbfa0eb8d85c0f2ca98b4fdcfc8b632c55c3..edcf30e35037a2b675f6b04aec17910660dcdda3 100644 (file)
 #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 */
        {
index 43558ac984645848500f5173086debba35140fb4..bed760618e0621b3bae7b63205e1abcb296401c8 100644 (file)
@@ -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
index 800a41535740ba868259432c95704b96668209b4..8719226b31f4498f8bce8087ac509673806c191b 100644 (file)
@@ -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;
index 6c57840bc75f3dc24720f00127cdf9ddf46c6882..3c43e3cc858244544c2ca0d1f1137ec9717fdd82 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index 6cfe88e3bf9621eb2ec12c90f439e85ee4294541..a81350e0b3a5930c4d8ad8073754f244c9a88608 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index cfd639b74523ff8f34bae825f26f681cc01bb9c0..eedda4adef46c546952f64e8bc423bfdb43bfa7b 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index b59d0a74c55b85b7517b6580fc2a8911a2635d29..efe80ca6c683cf415d08d44b7091b6cf3c42c693 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index 26fa5febf4fa3383ab6f62b95413727fe5c18468..5e5f6fde1ab78d6d5a8aa5f2997f52169dcd12eb 100644 (file)
 #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 */
        {
index 672f9e9efb497b65db10441fa68c205588e491ee..b169775456bb6c8ff05f860516be31db9c094953 100644 (file)
@@ -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
index b6b0ef1941c89b93d108b3aae1f5f8a286cd91bb..fc9e42cddf367bb91d3fd5ab086f519dd333f85e 100644 (file)
@@ -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;
index a6b9e350a7d9b8087d0f975c9afd90cd46bc10fd..526820bd4c20f7c6abe8b5be802867fd54136402 100644 (file)
 #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 */
        {
index 24b9f28132e8142544930ececd01756aa1f15c03..2b0fca7abf3b6fa485832261c22cfed765177a40 100644 (file)
@@ -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
index e3ec01a5c43801f179202ca72aa40d0aa01ab8c4..1e94a924d48a61ed10d4670f6dc7b30e2a5a0271 100644 (file)
@@ -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;
index 71adaae8bc2f9839257aee5c8d059c71898eb284..3792e73c9128913042916ec8ab607e572d72c033 100644 (file)
 #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 */
        {
index 24b9f28132e8142544930ececd01756aa1f15c03..2b0fca7abf3b6fa485832261c22cfed765177a40 100644 (file)
@@ -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
index e3ec01a5c43801f179202ca72aa40d0aa01ab8c4..1e94a924d48a61ed10d4670f6dc7b30e2a5a0271 100644 (file)
@@ -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;
index f9c92b446f83e143de07c8d79cc69c5046fa3396..ec9179e0a4261c31bef7920688a1a7bcb1578326 100644 (file)
 #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 */
        {
index 24b9f28132e8142544930ececd01756aa1f15c03..2b0fca7abf3b6fa485832261c22cfed765177a40 100644 (file)
@@ -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
index e3ec01a5c43801f179202ca72aa40d0aa01ab8c4..1e94a924d48a61ed10d4670f6dc7b30e2a5a0271 100644 (file)
@@ -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;
index fa9b43b7a53215906ee1ad84605b96afa0532dc9..10080532de07f7a8ffbdce16250c5059a9dc8acb 100644 (file)
 #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 */
        {