From 5244e1ba63e5f3ea12066734bfb0d864a8f1f11d Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sun, 21 Nov 2010 14:41:07 +0000 Subject: Convert more boards to use mptable_write_buses. Signed-off-by: Patrick Georgi Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6106 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/mainboard/msi/ms7260/get_bus_conf.c | 25 +------------------------ src/mainboard/msi/ms7260/irq_tables.c | 3 --- src/mainboard/msi/ms7260/mptable.c | 12 ++---------- 3 files changed, 3 insertions(+), 37 deletions(-) (limited to 'src/mainboard/msi/ms7260') diff --git a/src/mainboard/msi/ms7260/get_bus_conf.c b/src/mainboard/msi/ms7260/get_bus_conf.c index 6f4e198785..fadc3fe703 100644 --- a/src/mainboard/msi/ms7260/get_bus_conf.c +++ b/src/mainboard/msi/ms7260/get_bus_conf.c @@ -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; } } diff --git a/src/mainboard/msi/ms7260/irq_tables.c b/src/mainboard/msi/ms7260/irq_tables.c index 345b0fac29..df471267be 100644 --- a/src/mainboard/msi/ms7260/irq_tables.c +++ b/src/mainboard/msi/ms7260/irq_tables.c @@ -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; diff --git a/src/mainboard/msi/ms7260/mptable.c b/src/mainboard/msi/ms7260/mptable.c index 5184985ba4..2e365b332d 100644 --- a/src/mainboard/msi/ms7260/mptable.c +++ b/src/mainboard/msi/ms7260/mptable.c @@ -26,16 +26,14 @@ #include #include -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 */ { -- cgit v1.2.3