diff options
Diffstat (limited to 'arch/powerpc/sysdev/indirect_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/indirect_pci.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c index ad341f5ff94f..a8ac2dfdd3d4 100644 --- a/arch/powerpc/sysdev/indirect_pci.c +++ b/arch/powerpc/sysdev/indirect_pci.c | |||
@@ -20,12 +20,6 @@ | |||
20 | #include <asm/pci-bridge.h> | 20 | #include <asm/pci-bridge.h> |
21 | #include <asm/machdep.h> | 21 | #include <asm/machdep.h> |
22 | 22 | ||
23 | #ifdef CONFIG_PPC_INDIRECT_PCI_BE | ||
24 | #define PCI_CFG_OUT out_be32 | ||
25 | #else | ||
26 | #define PCI_CFG_OUT out_le32 | ||
27 | #endif | ||
28 | |||
29 | static int | 23 | static int |
30 | indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, | 24 | indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, |
31 | int len, u32 *val) | 25 | int len, u32 *val) |
@@ -58,9 +52,12 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, | |||
58 | else | 52 | else |
59 | reg = offset & 0xfc; | 53 | reg = offset & 0xfc; |
60 | 54 | ||
61 | PCI_CFG_OUT(hose->cfg_addr, | 55 | if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN) |
62 | (0x80000000 | (bus_no << 16) | 56 | out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | |
63 | | (devfn << 8) | reg | cfg_type)); | 57 | (devfn << 8) | reg | cfg_type)); |
58 | else | ||
59 | out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | | ||
60 | (devfn << 8) | reg | cfg_type)); | ||
64 | 61 | ||
65 | /* | 62 | /* |
66 | * Note: the caller has already checked that offset is | 63 | * Note: the caller has already checked that offset is |
@@ -113,9 +110,12 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, | |||
113 | else | 110 | else |
114 | reg = offset & 0xfc; | 111 | reg = offset & 0xfc; |
115 | 112 | ||
116 | PCI_CFG_OUT(hose->cfg_addr, | 113 | if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN) |
117 | (0x80000000 | (bus_no << 16) | 114 | out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | |
118 | | (devfn << 8) | reg | cfg_type)); | 115 | (devfn << 8) | reg | cfg_type)); |
116 | else | ||
117 | out_le32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | | ||
118 | (devfn << 8) | reg | cfg_type)); | ||
119 | 119 | ||
120 | /* surpress setting of PCI_PRIMARY_BUS */ | 120 | /* surpress setting of PCI_PRIMARY_BUS */ |
121 | if (hose->indirect_type & PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS) | 121 | if (hose->indirect_type & PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS) |
@@ -149,7 +149,7 @@ static struct pci_ops indirect_pci_ops = | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | void __init | 151 | void __init |
152 | setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data) | 152 | setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32 flags) |
153 | { | 153 | { |
154 | unsigned long base = cfg_addr & PAGE_MASK; | 154 | unsigned long base = cfg_addr & PAGE_MASK; |
155 | void __iomem *mbase; | 155 | void __iomem *mbase; |