From ee7e1300f44a635c12abcdfae46453ca253d6499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 3 Jan 2019 11:39:03 +0200 Subject: amdfam10 boards: Drop array bus_sb700 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only bus_sb700[0] is evaluated. Change-Id: Ie2cbbdebed3ae03da916d02919cd6a5d36f53562 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/30647 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Angel Pons --- src/mainboard/amd/mahogany_fam10/get_bus_conf.c | 14 +------------- src/mainboard/amd/mahogany_fam10/irq_tables.c | 5 ++--- src/mainboard/amd/mahogany_fam10/mptable.c | 3 +-- src/mainboard/amd/tilapia_fam10/get_bus_conf.c | 14 +------------- src/mainboard/amd/tilapia_fam10/irq_tables.c | 5 ++--- src/mainboard/amd/tilapia_fam10/mptable.c | 3 +-- src/mainboard/asus/m4a78-em/get_bus_conf.c | 14 +------------- src/mainboard/asus/m4a78-em/mptable.c | 3 +-- src/mainboard/asus/m4a785-m/get_bus_conf.c | 14 +------------- src/mainboard/asus/m4a785-m/mptable.c | 3 +-- src/mainboard/gigabyte/ma785gm/get_bus_conf.c | 14 +------------- src/mainboard/gigabyte/ma785gm/irq_tables.c | 5 ++--- src/mainboard/gigabyte/ma785gm/mptable.c | 3 +-- src/mainboard/gigabyte/ma785gmt/get_bus_conf.c | 15 +-------------- src/mainboard/gigabyte/ma785gmt/irq_tables.c | 5 ++--- src/mainboard/gigabyte/ma785gmt/mptable.c | 3 +-- src/mainboard/gigabyte/ma78gm/get_bus_conf.c | 14 +------------- src/mainboard/gigabyte/ma78gm/irq_tables.c | 5 ++--- src/mainboard/gigabyte/ma78gm/mptable.c | 3 +-- src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c | 14 +------------- src/mainboard/iei/kino-780am2-fam10/irq_tables.c | 5 ++--- src/mainboard/iei/kino-780am2-fam10/mptable.c | 3 +-- src/mainboard/jetway/pa78vm5/get_bus_conf.c | 14 +------------- src/mainboard/jetway/pa78vm5/irq_tables.c | 5 ++--- src/mainboard/jetway/pa78vm5/mptable.c | 3 +-- 25 files changed, 32 insertions(+), 157 deletions(-) diff --git a/src/mainboard/amd/mahogany_fam10/get_bus_conf.c b/src/mainboard/amd/mahogany_fam10/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/amd/mahogany_fam10/get_bus_conf.c +++ b/src/mainboard/amd/mahogany_fam10/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/amd/mahogany_fam10/irq_tables.c b/src/mainboard/amd/mahogany_fam10/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/amd/mahogany_fam10/irq_tables.c +++ b/src/mainboard/amd/mahogany_fam10/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/amd/mahogany_fam10/mptable.c b/src/mainboard/amd/mahogany_fam10/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/amd/mahogany_fam10/mptable.c +++ b/src/mainboard/amd/mahogany_fam10/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/amd/tilapia_fam10/get_bus_conf.c b/src/mainboard/amd/tilapia_fam10/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/amd/tilapia_fam10/get_bus_conf.c +++ b/src/mainboard/amd/tilapia_fam10/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/amd/tilapia_fam10/irq_tables.c b/src/mainboard/amd/tilapia_fam10/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/amd/tilapia_fam10/irq_tables.c +++ b/src/mainboard/amd/tilapia_fam10/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/amd/tilapia_fam10/mptable.c b/src/mainboard/amd/tilapia_fam10/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/amd/tilapia_fam10/mptable.c +++ b/src/mainboard/amd/tilapia_fam10/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/asus/m4a78-em/get_bus_conf.c b/src/mainboard/asus/m4a78-em/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/asus/m4a78-em/get_bus_conf.c +++ b/src/mainboard/asus/m4a78-em/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/asus/m4a78-em/mptable.c b/src/mainboard/asus/m4a78-em/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/asus/m4a78-em/mptable.c +++ b/src/mainboard/asus/m4a78-em/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/asus/m4a785-m/get_bus_conf.c b/src/mainboard/asus/m4a785-m/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/asus/m4a785-m/get_bus_conf.c +++ b/src/mainboard/asus/m4a785-m/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/asus/m4a785-m/mptable.c b/src/mainboard/asus/m4a785-m/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/asus/m4a785-m/mptable.c +++ b/src/mainboard/asus/m4a785-m/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/gigabyte/ma785gm/get_bus_conf.c b/src/mainboard/gigabyte/ma785gm/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/gigabyte/ma785gm/get_bus_conf.c +++ b/src/mainboard/gigabyte/ma785gm/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/gigabyte/ma785gm/irq_tables.c b/src/mainboard/gigabyte/ma785gm/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/gigabyte/ma785gm/irq_tables.c +++ b/src/mainboard/gigabyte/ma785gm/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/gigabyte/ma785gm/mptable.c b/src/mainboard/gigabyte/ma785gm/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/gigabyte/ma785gm/mptable.c +++ b/src/mainboard/gigabyte/ma785gm/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c b/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c index b97556c4b3..541b45f656 100644 --- a/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c +++ b/src/mainboard/gigabyte/ma785gmt/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -60,18 +58,7 @@ void get_bus_conf(void) get_pci1234(); sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/gigabyte/ma785gmt/irq_tables.c b/src/mainboard/gigabyte/ma785gmt/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/gigabyte/ma785gmt/irq_tables.c +++ b/src/mainboard/gigabyte/ma785gmt/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/gigabyte/ma785gmt/mptable.c b/src/mainboard/gigabyte/ma785gmt/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/gigabyte/ma785gmt/mptable.c +++ b/src/mainboard/gigabyte/ma785gmt/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/gigabyte/ma78gm/get_bus_conf.c b/src/mainboard/gigabyte/ma78gm/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/gigabyte/ma78gm/get_bus_conf.c +++ b/src/mainboard/gigabyte/ma78gm/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/gigabyte/ma78gm/irq_tables.c b/src/mainboard/gigabyte/ma78gm/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/gigabyte/ma78gm/irq_tables.c +++ b/src/mainboard/gigabyte/ma78gm/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/gigabyte/ma78gm/mptable.c b/src/mainboard/gigabyte/ma78gm/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/gigabyte/ma78gm/mptable.c +++ b/src/mainboard/gigabyte/ma78gm/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c b/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c +++ b/src/mainboard/iei/kino-780am2-fam10/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/iei/kino-780am2-fam10/irq_tables.c b/src/mainboard/iei/kino-780am2-fam10/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/iei/kino-780am2-fam10/irq_tables.c +++ b/src/mainboard/iei/kino-780am2-fam10/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/iei/kino-780am2-fam10/mptable.c b/src/mainboard/iei/kino-780am2-fam10/mptable.c index 1fd89cc2de..895b747f2e 100644 --- a/src/mainboard/iei/kino-780am2-fam10/mptable.c +++ b/src/mainboard/iei/kino-780am2-fam10/mptable.c @@ -20,7 +20,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -45,7 +44,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; diff --git a/src/mainboard/jetway/pa78vm5/get_bus_conf.c b/src/mainboard/jetway/pa78vm5/get_bus_conf.c index b97556c4b3..88b7bf115e 100644 --- a/src/mainboard/jetway/pa78vm5/get_bus_conf.c +++ b/src/mainboard/jetway/pa78vm5/get_bus_conf.c @@ -24,7 +24,6 @@ /* Global variables for MB layouts and these will be shared by irqtable mptable * and acpi_tables busnum is default. */ -u8 bus_sb700[2]; u32 apicid_sb700; /* @@ -48,7 +47,6 @@ u32 hcdnx[] = { void get_bus_conf(void) { u32 apicid_base; - struct device *dev; int i; sysconf.hc_possible_num = ARRAY_SIZE(pci1234x); @@ -61,17 +59,7 @@ void get_bus_conf(void) sysconf.sbdn = (sysconf.hcdn[0] & 0xff); - for (i = 0; i < 2; i++) { - bus_sb700[i] = 0; - } - - bus_sb700[0] = (sysconf.pci1234[0] >> 16) & 0xff; - - /* sb700 */ - dev = dev_find_slot(bus_sb700[0], PCI_DEVFN(0x14, 4)); - if (dev) { - bus_sb700[1] = pci_read_config8(dev, PCI_SECONDARY_BUS); - } + pirq_router_bus = (sysconf.pci1234[0] >> 16) & 0xff; /* I/O APICs: APIC ID Version State Address */ if (IS_ENABLED(CONFIG_LOGICAL_CPUS)) diff --git a/src/mainboard/jetway/pa78vm5/irq_tables.c b/src/mainboard/jetway/pa78vm5/irq_tables.c index 9d4624ff6f..0f7192514e 100644 --- a/src/mainboard/jetway/pa78vm5/irq_tables.c +++ b/src/mainboard/jetway/pa78vm5/irq_tables.c @@ -40,7 +40,6 @@ static void write_pirq_info(struct irq_info *pirq_info, u8 bus, u8 devfn, pirq_info->rfu = rfu; } -extern u8 bus_sb700[2]; unsigned long write_pirq_routing_table(unsigned long addr) { @@ -65,7 +64,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) pirq->signature = PIRQ_SIGNATURE; pirq->version = PIRQ_VERSION; - pirq->rtr_bus = bus_sb700[0]; + pirq->rtr_bus = pirq_router_bus; pirq->rtr_devfn = PCI_DEVFN(0x14, 4); pirq->exclusive_irqs = 0; @@ -81,7 +80,7 @@ unsigned long write_pirq_routing_table(unsigned long addr) slot_num = 0; /* pci bridge */ - write_pirq_info(pirq_info, bus_sb700[0], PCI_DEVFN(0x14, 4), + write_pirq_info(pirq_info, pirq_router_bus, PCI_DEVFN(0x14, 4), 0x1, 0xdef8, 0x2, 0xdef8, 0x3, 0xdef8, 0x4, 0xdef8, 0, 0); pirq_info++; diff --git a/src/mainboard/jetway/pa78vm5/mptable.c b/src/mainboard/jetway/pa78vm5/mptable.c index f153a7e562..db94b02bd0 100644 --- a/src/mainboard/jetway/pa78vm5/mptable.c +++ b/src/mainboard/jetway/pa78vm5/mptable.c @@ -21,7 +21,6 @@ #include #include -extern u8 bus_sb700[2]; extern u32 apicid_sb700; @@ -46,7 +45,7 @@ static void *smp_write_config_table(void *v) u8 byte; dev = - dev_find_slot(bus_sb700[0], + dev_find_slot(pirq_router_bus, PCI_DEVFN(0x14, 0)); if (dev) { dword = pci_read_config32(dev, 0x74) & 0xfffffff0; -- cgit v1.2.3