[coreboot] New patch to review for coreboot: bbfaf24 amd agesa family15 pci domain should scan bus from 0x18.0

Siyuan Wang (wangsiyuanbuaa@gmail.com) gerrit at coreboot.org
Sun Oct 28 10:04:20 CET 2012


Siyuan Wang (wangsiyuanbuaa at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1639

-gerrit

commit bbfaf24b04ed8964a785cd2092570e795dfdf265
Author: Siyuan Wang <wangsiyuanbuaa at gmail.com>
Date:   Sun Oct 28 18:06:40 2012 +0800

    amd agesa family15 pci domain should scan bus from 0x18.0
    
    there are 4 mainboards using agesa family15 code:
    supermicro h8scm and h8qgi, tyan s8226 and amd dinar.
    all of these boards's pci domain is start from 0x18.0.
    take h8scm as an example, pci devices from 0.0 to 0x14.5 is under 0x18.0.
    Now, the pci domain's scan bus function stats from 0.0. this would
    result to the pci devices be scanned twice. because when the function
    run to device 18.0, it will scan from 0.0 again.
    this issue would result to 2 problem:
    1) pci device may be assigned two different pci address.
       if this happenned on vga device, coreboot may be not load
       vga bios correctly.
    2) coreboot initializes rd890's io apic twice.
    so this patch scans from 0x18.0 and could resolve the problems above.
    
    Change-Id: I90fbdf695413fd24c7a5e3e9b426dc7ca6e128b1
    Signed-off-by: Siyuan Wang <SiYuan.Wang at amd.com>
    Signed-off-by: Siyuan Wang <wangsiyuanbuaa at gmail.com>
---
 src/northbridge/amd/agesa/family15/northbridge.c | 9 ++++++++-
 src/northbridge/amd/agesa/family15/northbridge.h | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index f297fc0..12a211f 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -846,7 +846,7 @@ static struct device_operations pci_domain_ops = {
 	.set_resources	  = domain_set_resources,
 	.enable_resources = domain_enable_resources,
 	.init		  = NULL,
-	.scan_bus	  = pci_domain_scan_bus,
+	.scan_bus	  = f15_pci_domain_scan_bus,
 
 #if CONFIG_MMCONF_SUPPORT_DEFAULT
 	.ops_pci_bus	  = &pci_ops_mmconf,
@@ -1143,3 +1143,10 @@ struct chip_operations northbridge_amd_agesa_family15_root_complex_ops = {
 	CHIP_NAME("AMD FAM15 Root Complex")
 	.enable_dev = root_complex_enable_dev,
 };
+
+/* all family15's pci devices are under 0x18.0, so we search from dev 0x18 fun 0 */
+static unsigned int f15_pci_domain_scan_bus(device_t dev, unsigned int max)
+{
+	max = pci_scan_bus(dev->link_list, PCI_DEVFN(0x18, 0), 0xff, max);
+	return max;
+}
diff --git a/src/northbridge/amd/agesa/family15/northbridge.h b/src/northbridge/amd/agesa/family15/northbridge.h
index 7606b32..cd9f83c 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.h
+++ b/src/northbridge/amd/agesa/family15/northbridge.h
@@ -22,5 +22,6 @@
 
 static struct device_operations pci_domain_ops;
 static struct device_operations cpu_bus_ops;
+static unsigned int f15_pci_domain_scan_bus(device_t dev, unsigned int max);
 
 #endif /* NORTHBRIDGE_AMD_AGESA_FAM15_H */




More information about the coreboot mailing list