aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c12
-rw-r--r--include/asm-ppc/pci-bridge.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index 3dedf8f5bfb4..d490e71f0533 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -33,6 +33,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
33 struct pci_controller *hose = bus->sysdata; 33 struct pci_controller *hose = bus->sysdata;
34 volatile void __iomem *cfg_data; 34 volatile void __iomem *cfg_data;
35 u8 cfg_type = 0; 35 u8 cfg_type = 0;
36 u32 bus_no;
36 37
37 if (ppc_md.pci_exclude_device) 38 if (ppc_md.pci_exclude_device)
38 if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) 39 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
@@ -42,8 +43,11 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
42 if (bus->number != hose->first_busno) 43 if (bus->number != hose->first_busno)
43 cfg_type = 1; 44 cfg_type = 1;
44 45
46 bus_no = (bus->number == hose->first_busno) ?
47 hose->self_busno : bus->number - hose->bus_offset;
48
45 PCI_CFG_OUT(hose->cfg_addr, 49 PCI_CFG_OUT(hose->cfg_addr,
46 (0x80000000 | ((bus->number - hose->bus_offset) << 16) 50 (0x80000000 | (bus_no << 16)
47 | (devfn << 8) | ((offset & 0xfc) | cfg_type))); 51 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
48 52
49 /* 53 /*
@@ -72,6 +76,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
72 struct pci_controller *hose = bus->sysdata; 76 struct pci_controller *hose = bus->sysdata;
73 volatile void __iomem *cfg_data; 77 volatile void __iomem *cfg_data;
74 u8 cfg_type = 0; 78 u8 cfg_type = 0;
79 u32 bus_no;
75 80
76 if (ppc_md.pci_exclude_device) 81 if (ppc_md.pci_exclude_device)
77 if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) 82 if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
@@ -81,8 +86,11 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
81 if (bus->number != hose->first_busno) 86 if (bus->number != hose->first_busno)
82 cfg_type = 1; 87 cfg_type = 1;
83 88
89 bus_no = (bus->number == hose->first_busno) ?
90 hose->self_busno : bus->number - hose->bus_offset;
91
84 PCI_CFG_OUT(hose->cfg_addr, 92 PCI_CFG_OUT(hose->cfg_addr,
85 (0x80000000 | ((bus->number - hose->bus_offset) << 16) 93 (0x80000000 | (bus_no << 16)
86 | (devfn << 8) | ((offset & 0xfc) | cfg_type))); 94 | (devfn << 8) | ((offset & 0xfc) | cfg_type)));
87 95
88 /* 96 /*
diff --git a/include/asm-ppc/pci-bridge.h b/include/asm-ppc/pci-bridge.h
index 4d35b844bc58..2c2abdaad42f 100644
--- a/include/asm-ppc/pci-bridge.h
+++ b/include/asm-ppc/pci-bridge.h
@@ -47,6 +47,7 @@ struct pci_controller {
47 47
48 int first_busno; 48 int first_busno;
49 int last_busno; 49 int last_busno;
50 int self_busno;
50 int bus_offset; 51 int bus_offset;
51 52
52 void __iomem *io_base_virt; 53 void __iomem *io_base_virt;