aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAristeu Rozanski <aris@redhat.com>2009-07-09 21:21:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-10 10:44:51 -0400
commit5707b24a50b40582226618c56692af932db9fe02 (patch)
tree63d843d6fe6ea3c414b142363188889bf90569e0 /arch
parente9bd2e73793bf0f7fcd8f94b532bb8f5c5b44171 (diff)
pci: Add a probing code that seeks for an specific bus
This patch adds a probing code that seeks for an specific pci bus. It still needs testing, but it is hoped that this will help to identify the memory controller with Xeon 55xx series. Signed-off-by: Aristeu Sergio <arozansk@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/pci_x86.h2
-rw-r--r--arch/x86/pci/legacy.c42
2 files changed, 27 insertions, 17 deletions
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 1a0422348d6d..ff5404b82fdc 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -53,6 +53,8 @@ extern int pcibios_last_bus;
53extern struct pci_bus *pci_root_bus; 53extern struct pci_bus *pci_root_bus;
54extern struct pci_ops pci_root_ops; 54extern struct pci_ops pci_root_ops;
55 55
56void pcibios_scan_specific_bus(int busn);
57
56/* pci-irq.c */ 58/* pci-irq.c */
57 59
58struct irq_info { 60struct irq_info {
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index 0db5eaf54560..c734c277b116 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -11,28 +11,14 @@
11 */ 11 */
12static void __devinit pcibios_fixup_peer_bridges(void) 12static 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
38int __init pci_legacy_init(void) 24int __init pci_legacy_init(void)
@@ -49,6 +35,28 @@ int __init pci_legacy_init(void)
49 35
50 return 0; 36 return 0;
51} 37}
38EXPORT_SYMBOL_GPL(pci_legacy_init);
39
40void pcibios_scan_specific_bus(int busn)
41{
42 int devfn;
43 long node;
44 u32 l;
45
46 if (pci_find_bus(0, busn))
47 return;
48
49 node = get_mp_bus_to_node(busn);
50 for (devfn = 0; devfn < 256; devfn += 8) {
51 if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) &&
52 l != 0x0000 && l != 0xffff) {
53 DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l);
54 printk(KERN_INFO "PCI: Discovered peer bus %02x\n", busn);
55 pci_scan_bus_on_node(busn, &pci_root_ops, node);
56 return;
57 }
58 }
59}
52 60
53int __init pci_subsys_init(void) 61int __init pci_subsys_init(void)
54{ 62{