Move pci_probe() call into pciinit() code.
authorKevin O'Connor <kevin@koconnor.net>
Wed, 22 Jun 2011 02:22:58 +0000 (22:22 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 22 Jun 2011 02:22:58 +0000 (22:22 -0400)
Call pci_probe after pci bridge setup and before pci device setup.
This will allow the pci device setup to use 'struct pci_device'.

src/pciinit.c
src/post.c

index 6bd8390954500c00256739fc65368a2dbf435db4..efb91876a63fa88f2d2d20523365b9f21f31efdf 100644 (file)
@@ -436,9 +436,11 @@ pci_bios_init_bus(void)
 void
 pci_setup(void)
 {
-    if (CONFIG_COREBOOT || usingXen())
-        // Already done by coreboot or Xen.
+    if (CONFIG_COREBOOT || usingXen()) {
+        // PCI setup already done by coreboot or Xen - just do probe.
+        pci_probe();
         return;
+    }
 
     dprintf(3, "pci setup\n");
 
@@ -450,6 +452,8 @@ pci_setup(void)
 
     pci_bios_init_bus();
 
+    pci_probe();
+
     int bdf, max;
     foreachbdf(bdf, max) {
         pci_init_device(pci_isa_bridge_tbl, bdf, NULL);
index 7618b176154b933f4b5f28c514ae1088942f68cf..813ff2037aafee649bd7b0fc343a5c13330cc4a2 100644 (file)
@@ -224,7 +224,6 @@ maininit(void)
 
     // Initialize pci
     pci_setup();
-    pci_probe();
     smm_init();
 
     // Initialize internal tables