Convert more boards to use mptable_write_buses.
authorPatrick Georgi <patrick@georgi-clan.de>
Sun, 21 Nov 2010 14:41:07 +0000 (14:41 +0000)
committerPatrick Georgi <patrick.georgi@coresystems.de>
Sun, 21 Nov 2010 14:41:07 +0000 (14:41 +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@6106 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

69 files changed:
src/mainboard/arima/hdama/mptable.c
src/mainboard/broadcom/blast/get_bus_conf.c
src/mainboard/broadcom/blast/irq_tables.c
src/mainboard/broadcom/blast/mptable.c
src/mainboard/dell/s1850/mptable.c
src/mainboard/getac/p470/mptable.c
src/mainboard/gigabyte/ga_2761gxdk/get_bus_conf.c
src/mainboard/gigabyte/ga_2761gxdk/irq_tables.c
src/mainboard/gigabyte/ga_2761gxdk/mptable.c
src/mainboard/gigabyte/m57sli/get_bus_conf.c
src/mainboard/gigabyte/m57sli/irq_tables.c
src/mainboard/gigabyte/m57sli/mptable.c
src/mainboard/hp/dl145_g1/get_bus_conf.c
src/mainboard/hp/dl145_g1/mptable.c
src/mainboard/hp/dl145_g3/get_bus_conf.c
src/mainboard/hp/dl145_g3/mb_sysconf.h
src/mainboard/hp/dl145_g3/mptable.c
src/mainboard/hp/dl165_g6_fam10/get_bus_conf.c
src/mainboard/hp/dl165_g6_fam10/mb_sysconf.h
src/mainboard/hp/dl165_g6_fam10/mptable.c
src/mainboard/ibase/mb899/mptable.c
src/mainboard/ibm/e325/mptable.c
src/mainboard/ibm/e326/mptable.c
src/mainboard/intel/d945gclf/mptable.c
src/mainboard/iwill/dk8_htx/get_bus_conf.c
src/mainboard/iwill/dk8_htx/mb_sysconf.h
src/mainboard/iwill/dk8_htx/mptable.c
src/mainboard/iwill/dk8s2/mptable.c
src/mainboard/iwill/dk8x/mptable.c
src/mainboard/msi/ms7135/get_bus_conf.c
src/mainboard/msi/ms7135/irq_tables.c
src/mainboard/msi/ms7260/get_bus_conf.c
src/mainboard/msi/ms7260/irq_tables.c
src/mainboard/msi/ms7260/mptable.c
src/mainboard/msi/ms9185/get_bus_conf.c
src/mainboard/msi/ms9185/mb_sysconf.h
src/mainboard/msi/ms9185/mptable.c
src/mainboard/msi/ms9282/get_bus_conf.c
src/mainboard/msi/ms9282/mb_sysconf.h
src/mainboard/msi/ms9282/mptable.c
src/mainboard/msi/ms9652_fam10/get_bus_conf.c
src/mainboard/msi/ms9652_fam10/mb_sysconf.h
src/mainboard/msi/ms9652_fam10/mptable.c
src/mainboard/newisys/khepri/mptable.c
src/mainboard/nvidia/l1_2pvv/get_bus_conf.c
src/mainboard/nvidia/l1_2pvv/mb_sysconf.h
src/mainboard/nvidia/l1_2pvv/mptable.c
src/mainboard/roda/rk886ex/mptable.c
src/mainboard/sunw/ultra40/get_bus_conf.c
src/mainboard/sunw/ultra40/mptable.c
src/mainboard/tyan/s2881/get_bus_conf.c
src/mainboard/tyan/s2881/mptable.c
src/mainboard/tyan/s2882/mptable.c
src/mainboard/tyan/s2885/get_bus_conf.c
src/mainboard/tyan/s2885/mptable.c
src/mainboard/tyan/s2891/get_bus_conf.c
src/mainboard/tyan/s2891/irq_tables.c
src/mainboard/tyan/s2891/mptable.c
src/mainboard/tyan/s2892/get_bus_conf.c
src/mainboard/tyan/s2892/irq_tables.c
src/mainboard/tyan/s2892/mptable.c
src/mainboard/tyan/s2895/get_bus_conf.c
src/mainboard/tyan/s2895/mptable.c
src/mainboard/tyan/s2912/get_bus_conf.c
src/mainboard/tyan/s2912/mb_sysconf.h
src/mainboard/tyan/s2912/mptable.c
src/mainboard/tyan/s2912_fam10/get_bus_conf.c
src/mainboard/tyan/s2912_fam10/mb_sysconf.h
src/mainboard/tyan/s2912_fam10/mptable.c

index f51abccac29d403988b5c04e488735ac9c81414a..663d2e1ba89ad2fcc5a58457c3af9da3a7dc9565 100644 (file)
@@ -111,8 +111,7 @@ static unsigned max_apicid(void)
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_chain_0;
        unsigned char bus_8131_1;
        unsigned char bus_8131_2;
@@ -146,44 +145,32 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x03,0));
                if (dev) {
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", bus_chain_0);
-
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
                /* 8131-1 */
                dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x01,0));
                if (dev) {
                        bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:01.0, using defaults\n", bus_chain_0);
-
                        bus_8131_1 = 2;
                }
                /* 8131-2 */
                dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x02,0));
                if (dev) {
                        bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_chain_0);
-
                        bus_8131_2 = 3;
                }
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
        smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
index 06f42f409227b760f4bd0f8dffb64d3150afb1d9..869f04967bcfc38dfc8e95a5efee610f605dcd74 100644 (file)
@@ -13,7 +13,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-unsigned char bus_isa = 10;
 unsigned char bus_bcm5780[7];
 unsigned char bus_bcm5785_0 = 1;
 unsigned char bus_bcm5785_1 = 8;
@@ -83,11 +82,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(bus_bcm5785_1, PCI_DEVFN(0x0d,0));
                if(dev) {
                        bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
-//                     printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
                }
         }
        else {
@@ -99,12 +93,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(bus_bcm5780[0], PCI_DEVFN(sbdn2 + i - 1,0));
                if(dev) {
                        bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                        bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
-//                      printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:01.0, using defaults\n", bus_bcm5780[i]);
index 406419d6d8feb7ca17645bfa634a8885788c87a7..64734a54858d8fac7414f3f06f3db739fccecd68 100644 (file)
@@ -32,7 +32,6 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus, uint8_t dev
        pirq_info->rfu = rfu;
 }
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_bcm5780[7];
 extern  unsigned char bus_bcm5785_0;
 extern  unsigned char bus_bcm5785_1;
index da0f2a89937a4010dee896c0e4b2d24ca161af1e..b98703f711a62b411235f88609d0ccc93d8a5afe 100644 (file)
@@ -9,7 +9,6 @@
 #endif
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_bcm5780[7];
 extern  unsigned char bus_bcm5785_0;
 extern  unsigned char bus_bcm5785_1;
@@ -21,8 +20,7 @@ extern  unsigned sbdn2;
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -32,12 +30,7 @@ static void *smp_write_config_table(void *v)
 
        get_bus_conf();
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
index 46f21c68cb59c43812d030754b66c08e9bb4987b..5ce0a3d5740035de2a92ffe59cd9b79cf3dad531 100644 (file)
@@ -8,8 +8,7 @@
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_pxhd_1;
        unsigned char bus_pxhd_2;
        unsigned char bus_pxhd_3;
@@ -29,35 +28,27 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(0, PCI_DEVFN(0x1e,0));
                if (dev) {
                        bus_ich5r_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 0:1e.0, using defaults\n");
-
                        bus_ich5r_1 = 7;
-                       bus_isa = 8;
                }
                /* pxhd-1 */
                dev = dev_find_slot(1, PCI_DEVFN(0x0,0));
                if (dev) {
                        bus_pxhd_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:00.0, using defaults\n");
-
                        bus_pxhd_1 = 2;
                }
                /* pxhd-2 */
                dev = dev_find_slot(1, PCI_DEVFN(0x00,2));
                if (dev) {
                        bus_pxhd_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:00.2, using defaults\n");
-
                        bus_pxhd_2 = 3;
                }
 
@@ -65,32 +56,24 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(0, PCI_DEVFN(0x4,0));
                if (dev) {
                        bus_pxhd_3 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 0:04.0, using defaults\n");
-
                        bus_pxhd_3 = 5;
                }
                /* pxhd-4 */
                dev = dev_find_slot(0, PCI_DEVFN(0x06,0));
                if (dev) {
                        bus_pxhd_4 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 0:06.0, using defaults\n");
-
                        bus_pxhd_4 = 6;
                }
 
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
 
index f7b8902b8aef0b523602d598c87b975391f33440..d652dcb5a178dd236841cd189f6e0f57d7c85312 100644 (file)
@@ -30,8 +30,7 @@
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-       int i;
-       int max_pci_bus, isa_bus;
+       int isa_bus;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -39,16 +38,7 @@ static void *smp_write_config_table(void *v)
 
         smp_write_processors(mc);
 
-       max_pci_bus = 5; // XXX read me from bridges.
-
-       /* ISA bus follows */
-       isa_bus = max_pci_bus + 1;
-
-       /* Bus:         Bus ID  Type */
-       for (i=0; i <= max_pci_bus; i++)
-               smp_write_bus(mc, i, "PCI   ");
-
-       smp_write_bus(mc, isa_bus, "ISA   ");
+       mptable_write_buses(mc, NULL, &isa_bus);
 
        /* I/O APICs:   APIC ID Version State           Address */
        smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
index 0b8534094854ab82820ba6390cc6650fd38fb83c..2fda60645ab25f13bb8d3ab96c36b3ed74c97b63 100644 (file)
@@ -36,7 +36,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_sis966[8]; //1
         unsigned apicid_sis966;
 
@@ -64,9 +63,6 @@ unsigned hcdnx[] =
 //        0x20202020,
 //        0x20202020,
 };
-unsigned bus_type[256];
-
-
 
 static unsigned get_bus_conf_done = 0;
 
@@ -77,7 +73,7 @@ void get_bus_conf(void)
        unsigned sbdn;
 
         device_t dev;
-        int i, j;
+        int i;
 
         if(get_bus_conf_done==1) return; //do it only once
 
@@ -98,23 +94,14 @@ void get_bus_conf(void)
                bus_sis966[i] = 0;
        }
 
-       for(i=0;i<256; i++) {
-               bus_type[i] = 0;
-       }
-
-       bus_type[0] = 1; //pci
-
        bus_sis966[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
-       bus_type[bus_sis966[0]] = 1;
-
                 /* SIS966 */
                 dev = dev_find_slot(bus_sis966[0], PCI_DEVFN(sbdn + 0x06,0));
                 if (dev) {
                         bus_sis966[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
                         bus_sis966[2] = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
                         bus_sis966[2]++;
-                       for(j=bus_sis966[1];j<bus_sis966[2]; j++) bus_type[j] = 1;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n", sbdn + 0x06);
@@ -127,14 +114,7 @@ void get_bus_conf(void)
                        dev = dev_find_slot(bus_sis966[0], PCI_DEVFN(sbdn + 0x0a + i - 2 , 0));
                        if (dev) {
                                bus_sis966[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                               bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                               bus_isa++;
-                               for(j=bus_sis966[i];j<bus_isa; j++) bus_type[j] = 1;
                        }
-                       else {
-                               printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", bus_sis966[0], sbdn + 0x0a + i - 2 );
-                               bus_isa = bus_sis966[i-1]+1;
-                       }
                }
 
 
index aa4ef6034e84a5cbecca28e8ecabdfa85e2c63cb..ad68cce2b1c3d5c84ab2154f79ef9b6d85a800d4 100644 (file)
@@ -52,11 +52,8 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus, uint8_t dev
         pirq_info->slot = slot;
         pirq_info->rfu = rfu;
 }
-extern unsigned char bus_isa;
 extern unsigned char bus_sis966[8]; //1
 
-
-
 unsigned long write_pirq_routing_table(unsigned long addr)
 {
 
index b6356f055b5b59764cac2bb2673305f99c124e38..9c3f34121b7551fcb03b36511473fce88c8a4d50 100644 (file)
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern unsigned char bus_isa;
 extern unsigned char bus_sis966[8]; //1
 
 extern unsigned apicid_sis966;
 
-extern unsigned bus_type[256];
-
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
        unsigned sbdn;
-       int i,j;
+       int i, j, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -50,13 +47,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(j= 0; j < 256 ; j++) {
-               if(bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
index cad922f16adc6d9cce4a4a3ced3403f13bfc7992..0df65c7d6bc5103f7c72a4ea3cfb6a6370ee16c2 100644 (file)
@@ -34,7 +34,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_mcp55[8]; //1
         unsigned apicid_mcp55;
 
@@ -62,9 +61,6 @@ unsigned hcdnx[] =
 //        0x20202020,
 //        0x20202020,
 };
-unsigned bus_type[256];
-
-
 
 static unsigned get_bus_conf_done = 0;
 
@@ -75,7 +71,7 @@ void get_bus_conf(void)
        unsigned sbdn;
 
         device_t dev;
-        int i, j;
+        int i;
 
         if(get_bus_conf_done==1) return; //do it only once
 
@@ -96,23 +92,14 @@ void get_bus_conf(void)
                bus_mcp55[i] = 0;
        }
 
-       for(i=0;i<256; i++) {
-               bus_type[i] = 0;
-       }
-
-       bus_type[0] = 1; //pci
-
        bus_mcp55[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
-       bus_type[bus_mcp55[0]] = 1;
-
                 /* MCP55 */
                 dev = dev_find_slot(bus_mcp55[0], PCI_DEVFN(sbdn + 0x06,0));
                 if (dev) {
                         bus_mcp55[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
                         bus_mcp55[2] = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
                         bus_mcp55[2]++;
-                       for(j=bus_mcp55[1];j<bus_mcp55[2]; j++) bus_type[j] = 1;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n", sbdn + 0x06);
@@ -125,14 +112,7 @@ void get_bus_conf(void)
                        dev = dev_find_slot(bus_mcp55[0], PCI_DEVFN(sbdn + 0x0a + i - 2 , 0));
                        if (dev) {
                                bus_mcp55[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                               bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                               bus_isa++;
-                               for(j=bus_mcp55[i];j<bus_isa; j++) bus_type[j] = 1;
                        }
-                       else {
-                               printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", bus_mcp55[0], sbdn + 0x0a + i - 2 );
-                               bus_isa = bus_mcp55[i-1]+1;
-                       }
                }
 
 
index bc6aded97fc4aaec05c0950d111d91aab9e7fa44..ad9ce77912ffea8e806a31530fd1c17a45b59f17 100644 (file)
@@ -50,7 +50,6 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus, uint8_t dev
         pirq_info->slot = slot;
         pirq_info->rfu = rfu;
 }
-extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8]; //1
 
 
index 61e0e2821f58e137f531a97550feac4b352b83ed..135174d8d45fe7a1972ad1bc38c09588331ac9aa 100644 (file)
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8]; //1
 
 extern unsigned apicid_mcp55;
 
-extern unsigned bus_type[256];
-
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
        unsigned sbdn;
-       int i,j,k;
+       int i, j, k, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -49,13 +46,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(j= 0; j < 256 ; j++) {
-               if(bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
@@ -106,7 +97,7 @@ static void *smp_write_config_table(void *v)
         }
 
        /* On bus 1: the PCI bus slots...
-          pyhsical PCI slots are j = 7,8
+          physical PCI slots are j = 7,8
           FireWire is j = 10
        */
         k=2;
index 562ba935d81f2722f429734314ae3487101338d6..e4721ce42e25123c49cc1fef935e5d2b4f63481a 100644 (file)
@@ -13,7 +13,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-unsigned char bus_isa = 5 ;
 unsigned char bus_8131_0 = 1;
 unsigned char bus_8131_1 = 2;
 unsigned char bus_8131_2 = 3;
@@ -82,11 +81,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
         if (dev) {
                 bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//             printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
        else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", bus_8111_0);
@@ -105,11 +99,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
         if (dev) {
                 bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//              printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
         else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
index 6e10a8fa2c244972b9b1484cc666f80a6f16078c..ba4ecf9d854336ed7e7d05ccddf9e5b3afceccf9 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_8131_0;
 extern  unsigned char bus_8131_1;
 extern  unsigned char bus_8131_2;
@@ -21,7 +20,7 @@ extern  unsigned sbdn3;
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
+       int bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -31,13 +30,7 @@ static void *smp_write_config_table(void *v)
 
        get_bus_conf();
 
-/*Bus:          Bus ID  Type*/
-        /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
-
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        smp_write_ioapic(mc, apicid_8111, 0x20, IO_APIC_ADDR);
index 6bb587b6a7c404266e15d4c2571194a75ffe7f33..36852f13017a1d05b92507fe7214326472514d2f 100644 (file)
@@ -108,11 +108,6 @@ void get_bus_conf(void)
                printk(BIOS_DEBUG, "now found %s...\n",dev_path(dev));
                if(dev) {
                        m->bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                       m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       m->bus_isa++;
-                       printk(BIOS_DEBUG, "bus_isa 1=%d\n",m->bus_isa);
-#endif
                }
        }
        else {
@@ -124,12 +119,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(m->bus_bcm5780[0], PCI_DEVFN(m->sbdn2 + i - 1,0));
                if(dev) {
                        m->bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                       m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       m->bus_isa++;
-                       printk(BIOS_DEBUG, "bus_isa 2=%d\n",m->bus_isa);
-#endif
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5780[0], m->sbdn2+i-1);
index fa713897b61043349ba3767944993a36492f49dd..a75b421bfca9266d9a8c3dd6ce5008218db806b5 100644 (file)
@@ -29,7 +29,6 @@
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_bcm5780[7];
        unsigned char bus_bcm5785_0;
        unsigned char bus_bcm5785_1;
index c971d51e7e94ce66596b3fcf8b02730e615261ca..96cdc87938092fdf0609173cd4dda90743fbbf58 100644 (file)
@@ -43,6 +43,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
+       int bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -53,22 +54,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        m = sysconf.mb;
 
-       /*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-#if 0
-       unsigned char bus_num;
-       for(bus_num = 0; bus_num < m->bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-               printk(BIOS_DEBUG, "writing bus %d as PCI...\n",bus_num);
-       }
-#endif
-       smp_write_bus(mc, 0, "PCI   ");
-       smp_write_bus(mc, 1, "PCI   ");
-       smp_write_bus(mc, 7, "PCI   ");
-       smp_write_bus(mc, 8, "PCI   ");
-
-       smp_write_bus(mc,m->bus_isa, "ISA   ");
-       printk(BIOS_DEBUG, "writing %d as ISA...\n",m->bus_isa);
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /*I/O APICs:   APIC ID Version State           Address*/
        {
@@ -130,7 +116,7 @@ static void *smp_write_config_table(void *v)
                }
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_bcm5785[0], 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_bcm5785[0], 0);
 
        //SATA
 /*     printk(BIOS_DEBUG, "MPTABLE_SATA: bus_id:%d irq:%d apic_id:%d pin:%d\n",m->bus_bcm5785_1, (0x0e<<2)|0, m->apicid_bcm5785[0], 0x7); */
@@ -177,9 +163,9 @@ static void *smp_write_config_table(void *v)
        }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       printk(BIOS_DEBUG, "m->bus_isa is: %x\n",m->bus_isa);
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa , 0x0, MP_APIC_ALL, 0x1);
+       printk(BIOS_DEBUG, "bus_isa is: %x\n", bus_isa);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa , 0x0, MP_APIC_ALL, 0x1);
 
        //extended table entries
        smp_write_address_space(mc,0 , ADDRESS_TYPE_IO, 0x0, 0x0, 0x0, 0x0001);
index f275841e708f09bd37273d27bb98fc47ab81a8fa..7f4112b542a9f280e028ae43e4daefe6136e1774 100644 (file)
@@ -110,11 +110,6 @@ void get_bus_conf(void)
                printk(BIOS_DEBUG, "now found %s...\n",dev_path(dev));
                if(dev) {
                        m->bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                       m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       m->bus_isa++;
-                       printk(BIOS_DEBUG, "bus_isa 1=%d\n",m->bus_isa);
-#endif
                }
        }
        else {
@@ -126,11 +121,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(m->bus_bcm5780[0], PCI_DEVFN(m->sbdn2 + i - 1,0));
                if(dev) {
                        m->bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                       m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       m->bus_isa++;
-                       printk(BIOS_DEBUG, "bus_isa 2=%d\n",m->bus_isa);
-#endif
 
                }
                else {
index de965c7004a59ad74aff3435fe04b26943a97c8f..a75b421bfca9266d9a8c3dd6ce5008218db806b5 100644 (file)
@@ -29,7 +29,6 @@
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_bcm5780[7];
        unsigned char bus_bcm5785_0;
        unsigned char bus_bcm5785_1;
@@ -37,7 +36,6 @@ struct mb_sysconf_t {
        unsigned apicid_bcm5785[3];
 
        unsigned sbdn2;
-       unsigned bus_type[256]; 
 };
 
 #endif
index e379630410704865f05291939380c5d5c2ee93e9..2243c72294983c7299e8e0b77e058b2ef4ed079c 100644 (file)
@@ -56,7 +56,6 @@ static void *smp_write_config_table(void *v)
        m = sysconf.mb;
 
        mptable_write_buses(mc, NULL, &isa_bus);
-       printk(BIOS_DEBUG, "writing %d as ISA to mptable (%d for real)...\n", isa_bus, m->bus_isa);
 
        /*I/O APICs:   APIC ID Version State           Address*/
        {
index 0d05638e39bc29384ef61fd8acd6f19c87cac5a8..0ada84d7bb1faa233f8ce61f51ecf38c6e55be6f 100644 (file)
@@ -29,8 +29,7 @@ static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
        struct device *riser = NULL, *firewire = NULL;
-       int i;
-       int max_pci_bus, firewire_bus = 0, riser_bus = 0, isa_bus;
+       int firewire_bus = 0, riser_bus = 0, isa_bus;
        int ioapic_id;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
@@ -38,14 +37,12 @@ static void *smp_write_config_table(void *v)
        mptable_init(mc, "MB899       ", LAPIC_ADDR);
 
         smp_write_processors(mc);
-       max_pci_bus=0;
 
        firewire = dev_find_device(0x104c, 0x8023, 0);
        if (firewire) {
                firewire_bus = firewire->bus->secondary;
                printk(BIOS_SPEW, "Firewire device is on bus %x\n",
                                firewire_bus);
-               max_pci_bus = firewire_bus;
        }
 
        // If a riser card is used, this riser is detected on bus 4, so its secondary bus is the
@@ -56,17 +53,9 @@ static void *smp_write_config_table(void *v)
        if (riser) {
                riser_bus = riser->link_list->secondary;
                printk(BIOS_SPEW, "Riser bus is %x\n", riser_bus);
-               max_pci_bus = riser_bus;
        }
 
-       /* ISA bus follows */
-       isa_bus = max_pci_bus + 1;
-
-       /* Bus:         Bus ID  Type */
-       for (i=0; i <= max_pci_bus; i++)
-               smp_write_bus(mc, i, "PCI   ");
-
-       smp_write_bus(mc, isa_bus, "ISA   ");
+       mptable_write_buses(mc, NULL, &isa_bus);
 
        /* I/O APICs:   APIC ID Version State           Address */
        ioapic_id = 2;
index 3c1312e399e38d6dca11dc27c247319f543818f5..32f8312118f2dbffe3cc0a5afe4a361a992340f4 100644 (file)
@@ -9,8 +9,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
 
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_8111_0;
        unsigned char bus_8111_1;
        unsigned char bus_8131_1;
@@ -30,13 +29,10 @@ static void *smp_write_config_table(void *v)
                if (dev) {
                        bus_8111_0 = pci_read_config8(dev, PCI_PRIMARY_BUS);
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                } else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
                        bus_8111_0 = 1;
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
 
                /* 8131-1 */
@@ -59,11 +55,7 @@ static void *smp_write_config_table(void *v)
                }
        }
 
-       /* define bus and isa numbers */
-       for (bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* Legacy IOAPIC #2 */
        smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
index 0656be2a5bf6d1bde7c40e3bacefebf8bf25c015..b0ea641b81757b60749d32baed130f3ed074fef6 100644 (file)
@@ -9,8 +9,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
 
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_8111_0;
        unsigned char bus_8111_1;
        unsigned char bus_8131_1;
@@ -30,13 +29,10 @@ static void *smp_write_config_table(void *v)
                if (dev) {
                        bus_8111_0 = pci_read_config8(dev, PCI_PRIMARY_BUS);
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                } else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
                        bus_8111_0 = 1;
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
 
                /* 8131-1 */
@@ -58,11 +54,7 @@ static void *smp_write_config_table(void *v)
                }
        }
 
-       /* define bus and isa numbers */
-       for (bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* Legacy IOAPIC #2 */
        smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
index 6edbfe4d29ae3b1ddb14e414979c157976bc6d24..2aff5e3d55f9ac90df3c3ffffee4e30e43530eb8 100644 (file)
@@ -28,8 +28,7 @@
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-       int i;
-       int max_pci_bus, isa_bus;
+       int isa_bus;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -37,16 +36,7 @@ static void *smp_write_config_table(void *v)
 
         smp_write_processors(mc);
 
-       max_pci_bus = 5; // XXX read me from bridges.
-
-       /* ISA bus follows */
-       isa_bus = max_pci_bus + 1;
-
-       /* Bus:         Bus ID  Type */
-       for (i=0; i <= max_pci_bus; i++)
-               smp_write_bus(mc, i, "PCI   ");
-
-       smp_write_bus(mc, isa_bus, "ISA   ");
+       mptable_write_buses(mc, NULL, &isa_bus);
 
        /* I/O APICs:   APIC ID Version State           Address */
        smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
index 30b9e368abb199e826ccb43bb523cfea9566ffa9..aa6d21f849261fc0a16eed11207bbf83d9ed7ae9 100644 (file)
@@ -109,11 +109,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(m->bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
         if (dev) {
                 m->bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                m->bus_isa++;
-//             printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
        else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_8111_0, sysconf.sbdn);
@@ -132,11 +127,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN(m->sbdn3+1,0));
         if (dev) {
                 m->bus_8132_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                m->bus_isa++;
-//              printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
         else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_8132_0, m->sbdn3+1);
@@ -172,9 +162,6 @@ void get_bus_conf(void)
                         dev = dev_find_slot(m->bus_8132a[j][0], PCI_DEVFN(m->sbdn3a[j]+1,0));
                         if (dev) {
                                 m->bus_8132a[j][2] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                                m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                                m->bus_isa++;
-                //              printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
                                 }
                         else {
                                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_8132a[j][0], m->sbdn3a[j]+1);
@@ -191,9 +178,6 @@ void get_bus_conf(void)
 
                         if (dev) {
                                 m->bus_8151[j][1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-        //                        printk(BIOS_DEBUG, "bus_8151_1=%d\n",bus_8151[j][1]);
-                                m->bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                                m->bus_isa++;
                         }
                         else {
                                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_8151[j][0], m->sbdn5[j]+1);
index 189c518414683ec0369f92aaf90cd7afa60a5a75..3042dd071a599d109ce97caff1f00c85ccfb2d23 100644 (file)
@@ -3,7 +3,6 @@
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_8132_0;
        unsigned char bus_8132_1;
        unsigned char bus_8132_2;
index 4270ed45330dc712737bfa1f4d70ee0bc669aec7..6279890fb1f4ce114958baf00730b227db70bc30 100644 (file)
@@ -13,8 +13,7 @@
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-       int i, j;
+       int i, j, bus_isa;
        struct mb_sysconf_t *m;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
@@ -27,12 +26,7 @@ static void *smp_write_config_table(void *v)
 
        m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < m->bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        smp_write_ioapic(mc, m->apicid_8111, 0x11, IO_APIC_ADDR); //8111
@@ -83,7 +77,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_8111, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_8111, 0);
 
 //??? What
         smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_8111_0, ((sysconf.sbdn+1)<<2)|3, m->apicid_8111, 0x13);
@@ -173,8 +167,8 @@ static void *smp_write_config_table(void *v)
 
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index 382bf908f0c1e6137fe66c58c8ecef81797daa0c..c77c1bf40d64eabdbb5c0f79f998eb88e624407d 100644 (file)
@@ -8,8 +8,7 @@
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_8131_1;
        unsigned char bus_8131_2;
        unsigned char bus_8111_1;
@@ -27,44 +26,32 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(1, PCI_DEVFN(0x03,0));
                if (dev) {
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
-
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
                /* 8131-1 */
                dev = dev_find_slot(1, PCI_DEVFN(0x01,0));
                if (dev) {
                        bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:01.0, using defaults\n");
-
                        bus_8131_1 = 2;
                }
                /* 8131-2 */
                dev = dev_find_slot(1, PCI_DEVFN(0x02,0));
                if (dev) {
                        bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:02.0, using defaults\n");
-
                        bus_8131_2 = 3;
                }
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
        smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
index 6c9b67294e0697a4447c1c199cd91c1213a38e01..55315fe5b8f0f20294918b5280ec408023c76674 100644 (file)
@@ -8,8 +8,7 @@
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_8131_1;
        unsigned char bus_8131_2;
        unsigned char bus_8111_1;
@@ -27,44 +26,32 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(1, PCI_DEVFN(0x03,0));
                if (dev) {
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
-
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
                /* 8131-1 */
                dev = dev_find_slot(1, PCI_DEVFN(0x01,0));
                if (dev) {
                        bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:01.0, using defaults\n");
-
                        bus_8131_1 = 2;
                }
                /* 8131-2 */
                dev = dev_find_slot(1, PCI_DEVFN(0x02,0));
                if (dev) {
                        bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:02.0, using defaults\n");
-
                        bus_8131_2 = 3;
                }
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
        smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
index 6ccd97587d9d39e005288f4d73f31bc984e91f34..cfcce2fa8bbb3d8a33ad7dd3bd02f6fda05de4fb 100644 (file)
@@ -38,7 +38,6 @@
  * mptable and acpi_tables.
  */
 /* busnum is default */
-unsigned char bus_isa;
 unsigned char bus_ck804[6];
 unsigned apicid_ck804;
 
@@ -49,9 +48,6 @@ unsigned pci1234x[] = {               //Here you only need to set value in pci1234 for HT-IO
 unsigned hcdnx[] = {           //HT Chain device num, actually it is unit id base of every ht device in chain, assume every chain only have 4 ht device at most
        0x20202020,             //ms7135 has only one ht-chain
 };
-unsigned bus_type[256];
-
-
 
 static unsigned get_bus_conf_done = 0;
 
@@ -61,7 +57,7 @@ void get_bus_conf(void)
 
        device_t dev;
        unsigned sbdn;
-       int i, j;
+       int i;
 
        if (get_bus_conf_done == 1)
                return;         //do it only once
@@ -84,16 +80,8 @@ void get_bus_conf(void)
                bus_ck804[i] = 0;
        }
 
-       for (i = 0; i < 256; i++) {
-               bus_type[i] = 0;
-       }
-
-       bus_type[0] = 1;        //pci
-
        bus_ck804[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
-       bus_type[bus_ck804[0]] = 1;
-
        /* CK804 */
        int dn = -1;
        for (i = 1; i < 4; i++) {
@@ -106,15 +94,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(bus_ck804[0], PCI_DEVFN(sbdn + dn, 0));
                if (dev) {
                        bus_ck804[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
-                       for (j = bus_ck804[i]; j < bus_isa; j++)
-                               bus_type[j] = 1;
-               } else {
-                       printk
-                           (BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
-                            bus_ck804[0], sbdn + dn);
-                       bus_isa = bus_ck804[i - 1] + 1;
                }
        }
 
index e4a717ba72443b826331b0cca9e952467f9948f3..81cc53c1304f54f08500c3a491d60ccdfda9efee 100644 (file)
@@ -35,7 +35,6 @@
 #include <arch/pirq_routing.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern unsigned char bus_isa;
 extern unsigned char bus_ck804[6];
 
 
index 6f4e198785dc568dfd8b0b04856812683a9fb9ae..fadc3fe703ed86afe819f574e57c050fe9ba767b 100644 (file)
@@ -32,7 +32,6 @@
 
 /* Global variables for MB layouts (shared by irqtable/mptable/acpi_table). */
 // busnum is default.
-unsigned char bus_isa;
 unsigned char bus_mcp55[8];    // 1
 unsigned apicid_mcp55;
 
@@ -65,17 +64,13 @@ unsigned hcdnx[] = {
 //      0x20202020,
 };
 
-unsigned bus_type[256];
-
-
-
 static unsigned get_bus_conf_done = 0;
 
 void get_bus_conf(void)
 {
        unsigned int apicid_base, sbdn;
        device_t dev;
-       int i, j;
+       int i;
 
        if (get_bus_conf_done == 1)
                return;         /* Do it only once. */
@@ -96,23 +91,14 @@ void get_bus_conf(void)
        for (i = 0; i < 8; i++)
                bus_mcp55[i] = 0;
 
-       for (i = 0; i < 256; i++)
-               bus_type[i] = 0;
-
-       bus_type[0] = 1;        /* PCI */
-
        bus_mcp55[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
-       bus_type[bus_mcp55[0]] = 1;
-
        /* MCP55 */
        dev = dev_find_slot(bus_mcp55[0], PCI_DEVFN(sbdn + 0x06, 0));
        if (dev) {
                bus_mcp55[1] = pci_read_config8(dev, PCI_SECONDARY_BUS);
                bus_mcp55[2] = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
                bus_mcp55[2]++;
-               for (j = bus_mcp55[1]; j < bus_mcp55[2]; j++)
-                       bus_type[j] = 1;
        } else {
                printk
                    (BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n",
@@ -127,15 +113,6 @@ void get_bus_conf(void)
                                    PCI_DEVFN(sbdn + 0x0a + i - 2, 0));
                if (dev) {
                        bus_mcp55[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
-                       for (j = bus_mcp55[i]; j < bus_isa; j++)
-                               bus_type[j] = 1;
-               } else {
-                       printk
-                           (BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n",
-                            bus_mcp55[0], sbdn + 0x0a + i - 2);
-                       bus_isa = bus_mcp55[i - 1] + 1;
                }
        }
 
index 345b0fac29296823f488c478fa1278e0223a55cf..df471267be83473a4331d658dc289984130ae225 100644 (file)
@@ -46,11 +46,8 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus,
        pirq_info->rfu = rfu;
 }
 
-extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8];     // 1
 
-
-
 unsigned long write_pirq_routing_table(unsigned long addr)
 {
        struct irq_routing_table *pirq;
index 5184985ba4f3c379f3982c8b48c7b86883cbfe41..2e365b332dfaabcaea4863ba19252b3afea03dc1 100644 (file)
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern unsigned char bus_isa;
 extern unsigned char bus_mcp55[8];     // 1
 extern unsigned apicid_mcp55;
-extern unsigned bus_type[256];
 
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
        unsigned int sbdn;
-       int i, j;
+       int i, j, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -46,13 +44,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-       /* Bus: Bus ID  Type */
-       /* Define bus and ISA numbers. */
-       for (j = 0; j < 256; j++) {
-               if (bus_type[j])
-                       smp_write_bus(mc, j, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* I/O APICs: APIC ID   Version State           Address */
        {
index a94acdeb1958cfc11763162d59e27ddf656156bf..0e97de6ed4d62c99376ab9b484fa50d6f79c7dc7 100644 (file)
@@ -105,11 +105,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(m->bus_bcm5785_1, PCI_DEVFN(0xd,0));
                if(dev) {
                        m->bus_bcm5785_1_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                       m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       m->bus_isa++;
-                       printk(BIOS_DEBUG, "bus_isa=%d\n",m->bus_isa);
-#endif
                }
         }
        else {
@@ -121,12 +116,6 @@ void get_bus_conf(void)
                dev = dev_find_slot(m->bus_bcm5780[0], PCI_DEVFN(m->sbdn2 + i - 1,0));
                if(dev) {
                        m->bus_bcm5780[i] = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                        m->bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        m->bus_isa++;
-                      printk(BIOS_DEBUG, "bus_isa=%d\n",m->bus_isa);
-#endif
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", m->bus_bcm5780[0], m->sbdn2+i-1);
index 401bcd704f8acbdb5a1d58435623011e7cd9c34a..88db3855fc3edd1f032e2942d9fad7387b5d0ec5 100644 (file)
@@ -25,7 +25,6 @@
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_bcm5780[7];
        unsigned char bus_bcm5785_0;
        unsigned char bus_bcm5785_1;
index bd4518461803973e9216daa5fd4c89f9c783955c..c43816b2928906d32e0bf87c858de68390d663ba 100644 (file)
@@ -40,9 +40,8 @@ static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
 
-        unsigned char bus_num;
-       int i;
-       struct mb_sysconf_t *m;
+       int i, bus_isa;
+       struct mb_sysconf_t *m;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -50,15 +49,10 @@ static void *smp_write_config_table(void *v)
 
         smp_write_processors(mc);
 
-       get_bus_conf();
-       m = sysconf.mb;
+       get_bus_conf();
+       m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < m->bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
@@ -76,7 +70,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_bcm5785[0], 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_bcm5785[0], 0);
 
 //IDE
        outb(0x02, 0xc00); outb(0x0e, 0xc01);
@@ -152,8 +146,8 @@ static void *smp_write_config_table(void *v)
         }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index 5b4ee487c17b3987773f606a09701e0bdea4fd23..833b29b711b4e93a79fce35d12d2a5695b4f1eeb 100644 (file)
@@ -75,7 +75,7 @@ void get_bus_conf(void)
        struct mb_sysconf_t *m;
 
         device_t dev;
-        int i, j;
+        int i;
 
         if(get_bus_conf_done==1) return; //do it only once
 
@@ -96,8 +96,6 @@ void get_bus_conf(void)
 
        sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain
 
-       m->bus_type[0] = 1; //pci
-
        m->bus_mcp55[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
                 /* MCP55 */
@@ -119,20 +117,6 @@ void get_bus_conf(void)
                        }
                }
 
-       for(i=0; i< sysconf.hc_possible_num; i++) {
-               if(!(sysconf.pci1234[i] & 0x1) ) continue;
-
-                unsigned busn = (sysconf.pci1234[i] >> 16) & 0xff;
-                unsigned busn_max = (sysconf.pci1234[i] >> 24) & 0xff;
-               for (j = busn; j <= busn_max; j++)
-                       m->bus_type[j] = 1;
-               if(m->bus_isa <= busn_max)
-                       m->bus_isa = busn_max + 1;
-               printk(BIOS_DEBUG, "i=%d bus range: [%x, %x] bus_isa=%x\n",i, busn, busn_max, m->bus_isa);
-       }
-
-
-
 /*I/O APICs:   APIC ID Version State           Address*/
 #if CONFIG_LOGICAL_CPUS==1
        apicid_base = get_apicid_base(1);
index 71770203ecdaad15b22ba852e4f912b46cc7b7e3..6d0ee75d3e7569cde960508f2bbd462cf938fd8b 100644 (file)
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-        unsigned char bus_isa;
         unsigned char bus_mcp55[8]; //1
         unsigned apicid_mcp55;
-       unsigned bus_type[256];
-
 };
 
 #endif
index d800932e7f464ad88412e828920b57bc66f6c6ca..391101276f867565d63be24e9da4a759dbc4b88f 100644 (file)
@@ -36,7 +36,7 @@ static void *smp_write_config_table(void *v)
        struct mb_sysconf_t *m;
        unsigned sbdn;
 
-       int i,j;
+       int i, j, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -44,17 +44,11 @@ static void *smp_write_config_table(void *v)
 
         smp_write_processors(mc);
 
-       get_bus_conf();
-       sbdn = sysconf.sbdn;
-       m = sysconf.mb;
+       get_bus_conf();
+       sbdn = sysconf.sbdn;
+       m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(j= 0; j < 256 ; j++) {
-               if(m->bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-        }
-        smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
@@ -83,7 +77,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_mcp55, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_mcp55, 0);
 
 //SMBUS
         smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
@@ -121,8 +115,8 @@ static void *smp_write_config_table(void *v)
                }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index c5f908339200bf662be9d727ad12249ca76b1320..746abc88b23e1507307b6f1f4281b80791037260 100644 (file)
@@ -72,7 +72,7 @@ void get_bus_conf(void)
        struct mb_sysconf_t *m;
 
        device_t dev;
-       int i, j;
+       int i;
 
        printk(BIOS_SPEW, "get_bus_conf()\n");
 
@@ -93,7 +93,6 @@ void get_bus_conf(void)
 
        get_pci1234();
 
-       m->bus_type[0] = 1; //pci
        sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain
        m->bus_mcp55[0] = (sysconf.pci1234[0] >> 12) & 0xff;
 
@@ -116,18 +115,6 @@ void get_bus_conf(void)
                        }
                }
 
-       for(i=0; i< sysconf.hc_possible_num; i++) {
-               if(!(sysconf.pci1234[i] & 0x1) ) continue;
-
-               unsigned busn = (sysconf.pci1234[i] >> 12) & 0xff;
-               unsigned busn_max = (sysconf.pci1234[i] >> 20) & 0xff;
-               for (j = busn; j <= busn_max; j++)
-                       m->bus_type[j] = 1;
-               if(m->bus_isa <= busn_max)
-                       m->bus_isa = busn_max + 1;
-               printk(BIOS_DEBUG, "i=%d bus range: [%x, %x] bus_isa=%x\n",i, busn, busn_max, m->bus_isa);
-       }
-
 /*I/O APICs:   APIC ID Version State           Address*/
 #if CONFIG_LOGICAL_CPUS==1
        apicid_base = get_apicid_base(1);
index a2e6fc7ade7c8f3df1de373279bf00ee1dfae7a6..d27ee3f69e4ed163ae975b8e1ceeb56aecec255f 100644 (file)
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_mcp55[8]; //1
        unsigned apicid_mcp55;
-       unsigned bus_type[256];
-
 };
 
 #endif
index bb64bc10bd13694dae8bcef0403c187ae005b5ae..370c6dbc561cb0bd4bb97e58cf5bc501cecff661 100644 (file)
@@ -33,7 +33,7 @@ static void *smp_write_config_table(void *v)
        struct mb_sysconf_t *m;
        unsigned sbdn;
 
-       int i,j;
+       int i, j, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -45,13 +45,7 @@ static void *smp_write_config_table(void *v)
        sbdn = sysconf.sbdn;
        m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(j= 0; j < 256 ; j++) {
-               if(m->bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-       }
-       smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
@@ -80,7 +74,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_mcp55, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_mcp55, 0);
 
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
 
@@ -110,8 +104,8 @@ static void *smp_write_config_table(void *v)
                }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index 2aa8fe5264ba82b71df7ae3e8291dc317d0a48c4..f7632800dfbfc3899a027060779bd2374f2663d4 100644 (file)
@@ -8,8 +8,7 @@
 static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
-       unsigned char bus_num;
-       unsigned char bus_isa;
+       int bus_isa;
        unsigned char bus_8131_1;
        unsigned char bus_8131_2;
        unsigned char bus_8111_1;
@@ -27,44 +26,32 @@ static void *smp_write_config_table(void *v)
                dev = dev_find_slot(1, PCI_DEVFN(0x03,0));
                if (dev) {
                        bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                       bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
-
                        bus_8111_1 = 4;
-                       bus_isa = 5;
                }
                /* 8131-1 */
                dev = dev_find_slot(1, PCI_DEVFN(0x01,0));
                if (dev) {
                        bus_8131_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:01.0, using defaults\n");
-
                        bus_8131_1 = 2;
                }
                /* 8131-2 */
                dev = dev_find_slot(1, PCI_DEVFN(0x02,0));
                if (dev) {
                        bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-
                }
                else {
                        printk(BIOS_DEBUG, "ERROR - could not find PCI 1:02.0, using defaults\n");
-
                        bus_8131_2 = 3;
                }
        }
 
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
        /* IOAPIC handling */
 
index e5380d77b82a5eaf9a2fefcddf9b1323a2d7fb51..99f8431d8619eb5d085493591ae77335928eff24 100644 (file)
@@ -95,7 +95,7 @@ void get_bus_conf(void)
        unsigned apicid_base;
        struct mb_sysconf_t *m;
 
-       int i, j;
+       int i;
 
        if (get_bus_conf_done)
                return; //do it only once
@@ -119,25 +119,8 @@ void get_bus_conf(void)
 
        m->sbdnb = (sysconf.hcdn[1] & 0xff); // first byte of second chain
 
-       m->bus_type[0] = 1; //pci
-
        m->bus_mcp55 = (sysconf.pci1234[0] >> 16) & 0xff;
 
-       for (i = 0; i < sysconf.hc_possible_num; i++) {
-               unsigned busn_min, busn_max;
-
-               if (!(sysconf.pci1234[i] & 0x1))
-                       continue;
-
-               busn_min = (sysconf.pci1234[i] >> 16) & 0xff;
-               busn_max = (sysconf.pci1234[i] >> 24) & 0xff;
-               for (j = busn_min; j <= busn_max; j++)
-                       m->bus_type[j] = 1;
-               if(m->bus_isa <= busn_max)
-                       m->bus_isa = busn_max + 1;
-               printk(BIOS_DEBUG, "i=%d bus range: [%x, %x] bus_isa=%x\n",i, busn_min, busn_max, m->bus_isa);
-       }
-
                /* MCP55b */
        for (i = 1; i < sysconf.hc_possible_num; i++) {
                if (!(sysconf.pci1234[i] & 0x0f))
index 763653fd32b87e85e70eeb436828c39317a78f25..09ee5df8cca7f81c807928a8a5547459f273d386 100644 (file)
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_mcp55;
        unsigned char bus_mcp55b;
        unsigned apicid_mcp55;
        unsigned apicid_mcp55b;
-       unsigned bus_type[256];
-
        unsigned sbdnb;
-
 };
 
 #endif
index 988c7f496a4328b54c4d31b7721c624afc2219c3..6f8476719f6de5548b5299b248d68ee094fc9b5e 100644 (file)
@@ -32,7 +32,7 @@ static void *smp_write_config_table(void *v)
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-       int i,j;
+       int i, j, bus_isa;
        unsigned char apicpin[4];
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
@@ -45,13 +45,7 @@ static void *smp_write_config_table(void *v)
        sbdn = sysconf.sbdn;
        m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for (j = 0; j < 256 ; j++) {
-               if (m->bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-       }
-       smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
@@ -104,7 +98,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_mcp55, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_mcp55, 0);
 
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55, ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa); // 10
 
@@ -167,8 +161,8 @@ static void *smp_write_config_table(void *v)
        }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index 825aed2009913009a8f90f9815f6f7c50610cfd5..83049b9c0d0042c9f834e186e4cac1f5441f1ed4 100644 (file)
@@ -30,8 +30,7 @@
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-       int i;
-       int max_pci_bus, isa_bus;
+       int isa_bus;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -39,16 +38,7 @@ static void *smp_write_config_table(void *v)
 
         smp_write_processors(mc);
 
-       max_pci_bus = 5; // XXX read me from bridges.
-
-       /* ISA bus follows */
-       isa_bus = max_pci_bus + 1;
-
-       /* Bus:         Bus ID  Type */
-       for (i=0; i <= max_pci_bus; i++)
-               smp_write_bus(mc, i, "PCI   ");
-
-       smp_write_bus(mc, isa_bus, "ISA   ");
+       mptable_write_buses(mc, NULL, &isa_bus);
 
        /* I/O APICs:   APIC ID Version State           Address */
        smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
index 8309c8a10f9d620fb31b2cddf2bdb7dfa8034ee8..bd57defb934500ecc11320085e57c8857a9e5ce7 100644 (file)
@@ -12,7 +12,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_ck804_0; //1
         unsigned char bus_ck804_1; //2
         unsigned char bus_ck804_2; //3
@@ -178,8 +177,6 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3,0));
                 if (dev) {
                         bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
@@ -245,8 +242,6 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_ck804b_0, PCI_DEVFN(sbdnb + 0x0e,0));
                 if (dev) {
                         bus_ck804b_5 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", bus_ck804b_0,sbdnb+0x0e);
@@ -254,7 +249,6 @@ void get_bus_conf(void)
                         bus_ck804b_5 = bus_ck804b_4+1;
 #endif
 
-                        bus_isa = bus_ck804b_5+1;
                 }
        }
 
index 886c1ffcda58d02abf2f3f839c1e14cdfe9e8a61..90c4d55cba49ce49f052087eabc4bd64c85dfd27 100644 (file)
@@ -5,7 +5,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
@@ -36,8 +35,7 @@ extern  unsigned sbdnb;
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -47,12 +45,7 @@ static void *smp_write_config_table(void *v)
 
        get_bus_conf();
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
         {
index 562ba935d81f2722f429734314ae3487101338d6..e4721ce42e25123c49cc1fef935e5d2b4f63481a 100644 (file)
@@ -13,7 +13,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-unsigned char bus_isa = 5 ;
 unsigned char bus_8131_0 = 1;
 unsigned char bus_8131_1 = 2;
 unsigned char bus_8131_2 = 3;
@@ -82,11 +81,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
         if (dev) {
                 bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//             printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
        else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", bus_8111_0);
@@ -105,11 +99,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
         if (dev) {
                 bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//              printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
         else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
index 37ca8f20debefca3ba5de497ad238a4a9f47581a..2754d870d4e3b10bcafb57ceb645d9ef7ceab55e 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_8131_0;
 extern  unsigned char bus_8131_1;
 extern  unsigned char bus_8131_2;
@@ -21,8 +20,7 @@ extern  unsigned sbdn3;
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -32,13 +30,7 @@ static void *smp_write_config_table(void *v)
 
        get_bus_conf();
 
-/*Bus:          Bus ID  Type*/
-        /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
-
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
index 5ee995c2a993fce9b6f1aea7f46292cae4ddc590..9b040defaff2d54823df236546682b08caf5e3f2 100644 (file)
@@ -46,8 +46,7 @@ static unsigned node_link_to_bus(unsigned node, unsigned link)
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-        unsigned char bus_isa;
+        int bus_isa;
        unsigned char bus_chain_0;
         unsigned char bus_8131_1;
         unsigned char bus_8131_2;
@@ -76,14 +75,11 @@ static void *smp_write_config_table(void *v)
                 dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x03,0));
                 if (dev) {
                         bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI 1:03.0, using defaults\n");
 
                         bus_8111_1 = 4;
-                        bus_isa = 5;
                 }
                 /* 8131-1 */
                 dev = dev_find_slot(bus_chain_0, PCI_DEVFN(0x01,0));
@@ -108,13 +104,7 @@ static void *smp_write_config_table(void *v)
                         bus_8131_2 = 3;
                 }
         }
-/*Bus:          Bus ID  Type*/
-        /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
-
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
 #if CONFIG_LOGICAL_CPUS==1
index a511afa3955ac2624ebacff3319fa849c07ae6f2..5cb760da2f0f7db89814389d5266b2539c42252b 100644 (file)
@@ -12,7 +12,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-unsigned char bus_isa = 7 ;
 unsigned char bus_8131_0 = 1;
 unsigned char bus_8131_1 = 2;
 unsigned char bus_8131_2 = 3;
@@ -85,11 +84,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8111_0, PCI_DEVFN(sysconf.sbdn,0));
         if (dev) {
                 bus_8111_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE >= CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//             printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
         }
        else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:03.0, using defaults\n", bus_8111_0);
@@ -108,12 +102,6 @@ void get_bus_conf(void)
         dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
         if (dev) {
                 bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-#if CONFIG_HT_CHAIN_END_UNITID_BASE < CONFIG_HT_CHAIN_UNITID_BASE
-                bus_isa    = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                bus_isa++;
-//              printk(BIOS_DEBUG, "bus_isa=%d\n",bus_isa);
-#endif
-
         }
         else {
                 printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
@@ -128,8 +116,6 @@ void get_bus_conf(void)
         if (dev) {
                bus_8151_1 = pci_read_config8(dev, PCI_SECONDARY_BUS);
 //              printk(BIOS_DEBUG, "bus_8151_1=%d\n",bus_8151_1);
-                bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                       bus_isa++;
                }
 
 /*I/O APICs:   APIC ID Version State           Address*/
index 733e82bef32c44049c32597a0b7be44c087c4f4b..d3a26207e25e083e1df57656d5dfbfaac3860cb6 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_8131_0;
 extern  unsigned char bus_8131_1;
 extern  unsigned char bus_8131_2;
@@ -24,8 +23,7 @@ extern  unsigned sbdn5;
 static void *smp_write_config_table(void *v)
 {
         struct mp_config_table *mc;
-        unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
         mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -35,12 +33,7 @@ static void *smp_write_config_table(void *v)
 
        get_bus_conf();
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-        for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-                smp_write_bus(mc, bus_num, "PCI   ");
-        }
-        smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); //8111
index 2bd6954389ecd14606dc5f0350cd24a3aef39d5f..bbb02e9f98bf8fd3a77a32be5a139d66af765b99 100644 (file)
@@ -12,7 +12,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_ck804_0; //1
         unsigned char bus_ck804_1; //2
         unsigned char bus_ck804_2; //3
@@ -117,8 +116,6 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_ck804_0, PCI_DEVFN(sbdn+ 0x0e,0));
                 if (dev) {
                         bus_ck804_5 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n", sbdn+ 0x0e);
@@ -142,14 +139,11 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
                 if (dev) {
                         bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
 
                         bus_8131_2 = bus_8131_1+1;
-                        bus_isa = bus_8131_1+2;
                 }
 
                if(sysconf.pci1234[2] & 1) {
index cd40c999f75941113970df42296abe19598b8aa4..d584dbb7a710798c329e8d25227d97d3fc85ee1d 100644 (file)
@@ -30,7 +30,6 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus, uint8_t dev
        pirq_info->rfu = rfu;
 }
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
index b7dd77ac265323223707595d5e7c6f255b32ab8a..56635e5340b90854f519657c10d469e8bd8edbe7 100644 (file)
@@ -5,7 +5,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
@@ -25,8 +24,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
        unsigned sbdn;
-       unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -37,12 +35,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
index cadf9d953f3afdc5bd18796db08983edebd1aa71..3a45cfa15811de271bf534761cb48e1ff81967a9 100644 (file)
@@ -12,7 +12,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_ck804_0; //1
         unsigned char bus_ck804_1; //2
         unsigned char bus_ck804_2; //3
@@ -114,8 +113,6 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_ck804_0, PCI_DEVFN(sbdn+ 0x0e,0));
                 if (dev) {
                         bus_ck804_5 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI 1:%02x.0, using defaults\n", sbdn+ 0x0e);
@@ -139,14 +136,11 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3+1,0));
                 if (dev) {
                         bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
 
                         bus_8131_2 = bus_8131_1+1;
-                        bus_isa = bus_8131_1+2;
                 }
 
 
index dbe15efdedaf911d07ad7bccb7f5134f0bd6b35e..157ed128646078ddb25bed243b0c4f7a451710f0 100644 (file)
@@ -30,7 +30,6 @@ static void write_pirq_info(struct irq_info *pirq_info, uint8_t bus, uint8_t dev
        pirq_info->rfu = rfu;
 }
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
index 151659018d2ae1df6e7acda4e18b32564c1dc8f7..79064ed40d383c95a8b0741ed0415dda0b175ff3 100644 (file)
@@ -5,7 +5,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
@@ -25,8 +24,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
        unsigned sbdn;
-       unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -37,12 +35,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
index ef5963e39e923879fc654e8c8fb2340088139ec6..9de16291fdd792bdcc8931280034cb3096c41e28 100644 (file)
@@ -12,7 +12,6 @@
 
 // Global variables for MB layouts and these will be shared by irqtable mptable and acpi_tables
 //busnum is default
-        unsigned char bus_isa;
         unsigned char bus_ck804_0; //1
         unsigned char bus_ck804_1; //2
         unsigned char bus_ck804_2; //3
@@ -134,8 +133,6 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_8131_0, PCI_DEVFN(sbdn3,0));
                 if (dev) {
                         bus_8131_2 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:02.0, using defaults\n", bus_8131_0);
@@ -151,13 +148,10 @@ void get_bus_conf(void)
                 dev = dev_find_slot(bus_ck804b_0, PCI_DEVFN(sbdnb + 0x0e,0));
                 if (dev) {
                         bus_ck804b_5 = pci_read_config8(dev, PCI_SECONDARY_BUS);
-                        bus_isa = pci_read_config8(dev, PCI_SUBORDINATE_BUS);
-                        bus_isa++;
                 }
                 else {
                         printk(BIOS_DEBUG, "ERROR - could not find PCI %02x:%02x.0, using defaults\n", bus_ck804b_0,sbdnb+0x0e);
                         bus_ck804b_5 = bus_ck804b_4+1;
-                        bus_isa = bus_ck804b_5+1;
                 }
        }
 
index 71c7f9045b95e87ae2b38835329d347c60d5f45e..d62a087280781403b6fc40a5e6858c2b2b738ccf 100644 (file)
@@ -5,7 +5,6 @@
 #include <stdint.h>
 #include <cpu/amd/amdk8_sysconf.h>
 
-extern  unsigned char bus_isa;
 extern  unsigned char bus_ck804_0; //1
 extern  unsigned char bus_ck804_1; //2
 extern  unsigned char bus_ck804_2; //3
@@ -33,8 +32,7 @@ static void *smp_write_config_table(void *v)
 {
        struct mp_config_table *mc;
        unsigned sbdn;
-       unsigned char bus_num;
-       int i;
+       int i, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -45,12 +43,7 @@ static void *smp_write_config_table(void *v)
        get_bus_conf();
        sbdn = sysconf.sbdn;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(bus_num = 0; bus_num < bus_isa; bus_num++) {
-               smp_write_bus(mc, bus_num, "PCI   ");
-       }
-       smp_write_bus(mc, bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
index 9ff59d24abc5e42a5bae008131598b386220aeeb..d16f4e6d4089b63ffe6c2c46a1251ea7b5855ac0 100644 (file)
@@ -71,7 +71,7 @@ void get_bus_conf(void)
        struct mb_sysconf_t *m;
 
        device_t dev;
-       int i, j;
+       int i;
 
        if(get_bus_conf_done==1) return; //do it only once
 
@@ -92,8 +92,6 @@ void get_bus_conf(void)
 
        sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain
 
-       m->bus_type[0] = 1; //pci
-
        m->bus_mcp55[0] = (sysconf.pci1234[0] >> 16) & 0xff;
 
        /* MCP55 */
@@ -113,18 +111,6 @@ void get_bus_conf(void)
                }
        }
 
-       for(i=0; i< sysconf.hc_possible_num; i++) {
-               if(!(sysconf.pci1234[i] & 0x1) ) continue;
-
-               unsigned busn = (sysconf.pci1234[i] >> 16) & 0xff;
-               unsigned busn_max = (sysconf.pci1234[i] >> 24) & 0xff;
-               for (j = busn; j <= busn_max; j++)
-                       m->bus_type[j] = 1;
-               if(m->bus_isa <= busn_max)
-                       m->bus_isa = busn_max + 1;
-               printk(BIOS_DEBUG, "i=%d bus range: [%x, %x] bus_isa=%x\n",i, busn, busn_max, m->bus_isa);
-       }
-
 /*I/O APICs:   APIC ID Version State           Address*/
 #if CONFIG_LOGICAL_CPUS==1
        apicid_base = get_apicid_base(1);
index a2e6fc7ade7c8f3df1de373279bf00ee1dfae7a6..d27ee3f69e4ed163ae975b8e1ceeb56aecec255f 100644 (file)
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_mcp55[8]; //1
        unsigned apicid_mcp55;
-       unsigned bus_type[256];
-
 };
 
 #endif
index 927d6742b735ef8dbd6242f1908c11b591439e6f..d6fe9345002199d6fb04bb79b07e526e75049166 100644 (file)
@@ -32,7 +32,7 @@ static void *smp_write_config_table(void *v)
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-       int i,j;
+       int i, j, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -44,13 +44,7 @@ static void *smp_write_config_table(void *v)
        sbdn = sysconf.sbdn;
        m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(j= 0; j < 256 ; j++) {
-               if(m->bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-       }
-       smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
@@ -79,7 +73,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_mcp55, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_mcp55, 0);
 
                   /*I/O Ints:  Type    Polarity    Trigger                     Bus ID   IRQ    APIC ID PIN# */
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
@@ -108,8 +102,8 @@ static void *smp_write_config_table(void *v)
                }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */
index 5a82b4ce6975e76c0b6ae25a02f569c7f9415b74..da0ed546537b0ec000a7b6ced1159f8fb7824ab9 100644 (file)
@@ -72,7 +72,7 @@ void get_bus_conf(void)
        struct mb_sysconf_t *m;
 
        device_t dev;
-       int i, j;
+       int i;
 
        if(get_bus_conf_done==1) return; //do it only once
 
@@ -91,7 +91,6 @@ void get_bus_conf(void)
 
        get_pci1234();
 
-       m->bus_type[0] = 1; //pci
        sysconf.sbdn = (sysconf.hcdn[0] & 0xff); // first byte of first chain
        m->bus_mcp55[0] = (sysconf.pci1234[0] >> 12) & 0xff;
 
@@ -114,18 +113,6 @@ void get_bus_conf(void)
                        }
                }
 
-       for(i=0; i< sysconf.hc_possible_num; i++) {
-               if(!(sysconf.pci1234[i] & 0x1) ) continue;
-
-               unsigned busn = (sysconf.pci1234[i] >> 12) & 0xff;
-               unsigned busn_max = (sysconf.pci1234[i] >> 20) & 0xff;
-               for (j = busn; j <= busn_max; j++)
-                       m->bus_type[j] = 1;
-               if(m->bus_isa <= busn_max)
-                       m->bus_isa = busn_max + 1;
-               printk(BIOS_DEBUG, "i=%d bus range: [%x, %x] bus_isa=%x\n",i, busn, busn_max, m->bus_isa);
-       }
-
 /*I/O APICs:   APIC ID Version State           Address*/
 #if CONFIG_LOGICAL_CPUS==1
        apicid_base = get_apicid_base(1);
index a2e6fc7ade7c8f3df1de373279bf00ee1dfae7a6..d27ee3f69e4ed163ae975b8e1ceeb56aecec255f 100644 (file)
 #define MB_SYSCONF_H
 
 struct mb_sysconf_t {
-       unsigned char bus_isa;
        unsigned char bus_mcp55[8]; //1
        unsigned apicid_mcp55;
-       unsigned bus_type[256];
-
 };
 
 #endif
index be0c9a3d9fd201dabfda4e97f78956b6d17e4119..1bea664bb718833f7da337fdd15f4ccd72674ae3 100644 (file)
@@ -32,7 +32,7 @@ static void *smp_write_config_table(void *v)
        struct mp_config_table *mc;
        struct mb_sysconf_t *m;
        unsigned sbdn;
-       int i,j;
+       int i, j, bus_isa;
 
        mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
 
@@ -44,13 +44,7 @@ static void *smp_write_config_table(void *v)
        sbdn = sysconf.sbdn;
        m = sysconf.mb;
 
-/*Bus:         Bus ID  Type*/
-       /* define bus and isa numbers */
-       for(j= 0; j < 256 ; j++) {
-               if(m->bus_type[j])
-                        smp_write_bus(mc, j, "PCI   ");
-       }
-       smp_write_bus(mc, m->bus_isa, "ISA   ");
+       mptable_write_buses(mc, NULL, &bus_isa);
 
 /*I/O APICs:   APIC ID Version State           Address*/
        {
@@ -79,7 +73,7 @@ static void *smp_write_config_table(void *v)
 
        }
 
-       mptable_add_isa_interrupts(mc, m->bus_isa, m->apicid_mcp55, 0);
+       mptable_add_isa_interrupts(mc, bus_isa, m->apicid_mcp55, 0);
 
                        /*I/O Ints:     Type    Polarity    Trigger                     Bus ID   IRQ    APIC ID PIN# */
        smp_write_intsrc(mc, mp_INT, MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
@@ -108,8 +102,8 @@ static void *smp_write_config_table(void *v)
                }
 
 /*Local Ints:  Type    Polarity    Trigger     Bus ID   IRQ    APIC ID PIN#*/
-       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x0);
-       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, m->bus_isa, 0x0, MP_APIC_ALL, 0x1);
+       smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x0);
+       smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, bus_isa, 0x0, MP_APIC_ALL, 0x1);
        /* There is no extension information... */
 
        /* Compute the checksums */