|
20 | 20 | #include <asm/pci-bridge.h> |
21 | 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 | 23 | static int |
30 | 24 | indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, |
31 | 25 | int len, u32 *val) |
@@ -58,9 +52,12 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, |
58 | 52 | else |
59 | 53 | reg = offset & 0xfc; |
60 | 54 |
|
61 | | - PCI_CFG_OUT(hose->cfg_addr, |
62 | | - (0x80000000 | (bus_no << 16) |
63 | | - | (devfn << 8) | reg | cfg_type)); |
| 55 | + if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN) |
| 56 | + out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | |
| 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 | 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 | 110 | else |
114 | 111 | reg = offset & 0xfc; |
115 | 112 |
|
116 | | - PCI_CFG_OUT(hose->cfg_addr, |
117 | | - (0x80000000 | (bus_no << 16) |
118 | | - | (devfn << 8) | reg | cfg_type)); |
| 113 | + if (hose->indirect_type & PPC_INDIRECT_TYPE_BIG_ENDIAN) |
| 114 | + out_be32(hose->cfg_addr, (0x80000000 | (bus_no << 16) | |
| 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 | 120 | /* surpress setting of PCI_PRIMARY_BUS */ |
121 | 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 | 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 | 154 | unsigned long base = cfg_addr & PAGE_MASK; |
155 | 155 | void __iomem *mbase; |
|
0 commit comments