2 * legacy.c - traditional, old school PCI bus probing
4 #include <linux/init.h>
9 * Discover remaining PCI buses in case there are peer host bridges.
10 * We use the number of last PCI bus provided by the PCI BIOS.
12 static void __devinit
pcibios_fixup_peer_bridges(void)
16 if (pcibios_last_bus
<= 0 || pcibios_last_bus
>= 0xff)
18 DBG("PCI: Peer bridge fixup\n");
20 for (n
=0; n
<= pcibios_last_bus
; n
++) {
22 if (pci_find_bus(0, n
))
24 for (devfn
= 0; devfn
< 256; devfn
+= 8) {
25 if (!raw_pci_ops
->read(0, n
, devfn
, PCI_VENDOR_ID
, 2, &l
) &&
26 l
!= 0x0000 && l
!= 0xffff) {
27 DBG("Found device at %02x:%02x [%04x]\n", n
, devfn
, l
);
28 printk(KERN_INFO
"PCI: Discovered peer bus %02x\n", n
);
29 pci_scan_bus(n
, &pci_root_ops
, NULL
);
36 static int __init
pci_legacy_init(void)
39 printk("PCI: System does not support PCI\n");
43 if (pcibios_scanned
++)
46 printk("PCI: Probing PCI hardware\n");
47 pci_root_bus
= pcibios_scan_root(0);
49 pci_bus_add_devices(pci_root_bus
);
51 pcibios_fixup_peer_bridges();
56 subsys_initcall(pci_legacy_init
);