diff options
Diffstat (limited to 'arch/x86/pci/legacy.c')
-rw-r--r-- | arch/x86/pci/legacy.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c index 0db5eaf54560..8d460eaf524f 100644 --- a/arch/x86/pci/legacy.c +++ b/arch/x86/pci/legacy.c | |||
@@ -11,28 +11,14 @@ | |||
11 | */ | 11 | */ |
12 | static void __devinit pcibios_fixup_peer_bridges(void) | 12 | static void __devinit pcibios_fixup_peer_bridges(void) |
13 | { | 13 | { |
14 | int n, devfn; | 14 | int n; |
15 | long node; | ||
16 | 15 | ||
17 | if (pcibios_last_bus <= 0 || pcibios_last_bus > 0xff) | 16 | if (pcibios_last_bus <= 0 || pcibios_last_bus > 0xff) |
18 | return; | 17 | return; |
19 | DBG("PCI: Peer bridge fixup\n"); | 18 | DBG("PCI: Peer bridge fixup\n"); |
20 | 19 | ||
21 | for (n=0; n <= pcibios_last_bus; n++) { | 20 | for (n=0; n <= pcibios_last_bus; n++) |
22 | u32 l; | 21 | pcibios_scan_specific_bus(n); |
23 | if (pci_find_bus(0, n)) | ||
24 | continue; | ||
25 | node = get_mp_bus_to_node(n); | ||
26 | for (devfn = 0; devfn < 256; devfn += 8) { | ||
27 | if (!raw_pci_read(0, n, devfn, PCI_VENDOR_ID, 2, &l) && | ||
28 | l != 0x0000 && l != 0xffff) { | ||
29 | DBG("Found device at %02x:%02x [%04x]\n", n, devfn, l); | ||
30 | printk(KERN_INFO "PCI: Discovered peer bus %02x\n", n); | ||
31 | pci_scan_bus_on_node(n, &pci_root_ops, node); | ||
32 | break; | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | } | 22 | } |
37 | 23 | ||
38 | int __init pci_legacy_init(void) | 24 | int __init pci_legacy_init(void) |
@@ -50,6 +36,28 @@ int __init pci_legacy_init(void) | |||
50 | return 0; | 36 | return 0; |
51 | } | 37 | } |
52 | 38 | ||
39 | void pcibios_scan_specific_bus(int busn) | ||
40 | { | ||
41 | int devfn; | ||
42 | long node; | ||
43 | u32 l; | ||
44 | |||
45 | if (pci_find_bus(0, busn)) | ||
46 | return; | ||
47 | |||
48 | node = get_mp_bus_to_node(busn); | ||
49 | for (devfn = 0; devfn < 256; devfn += 8) { | ||
50 | if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) && | ||
51 | l != 0x0000 && l != 0xffff) { | ||
52 | DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l); | ||
53 | printk(KERN_INFO "PCI: Discovered peer bus %02x\n", busn); | ||
54 | pci_scan_bus_on_node(busn, &pci_root_ops, node); | ||
55 | return; | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | EXPORT_SYMBOL_GPL(pcibios_scan_specific_bus); | ||
60 | |||
53 | int __init pci_subsys_init(void) | 61 | int __init pci_subsys_init(void) |
54 | { | 62 | { |
55 | /* | 63 | /* |