aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/pci
diff options
context:
space:
mode:
authorJayachandran C <jchandra@broadcom.com>2013-01-16 06:12:40 -0500
committerJohn Crispin <blogic@openwrt.org>2013-02-16 18:15:19 -0500
commita264b5e8dc3cae1b07cea010d6283be6e67b0209 (patch)
tree7f615fd95de4f72fd5375432f7e29ee9587dbd28 /arch/mips/pci
parent220d9122e8c5a467fdeefc1857e077f29a623bfd (diff)
MIPS: PCI: Byteswap not needed in little-endian mode
Rename function xlp_enable_pci_bswap() to xlp_config_pci_bswap(), which is a better description for its functionality. When compiled in big-endian mode, xlp_config_pci_bswap() will configure the PCIe links to byteswap. In little-endian mode, no swap configuration is needed for the PCIe controller, and the function is empty. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Patchwork: http://patchwork.linux-mips.org/patch/4802/ Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/pci')
-rw-r--r--arch/mips/pci/pci-xlp.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/mips/pci/pci-xlp.c b/arch/mips/pci/pci-xlp.c
index 140557a20488..5077148bd67d 100644
--- a/arch/mips/pci/pci-xlp.c
+++ b/arch/mips/pci/pci-xlp.c
@@ -191,7 +191,13 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
191 return 0; 191 return 0;
192} 192}
193 193
194static int xlp_enable_pci_bswap(void) 194/*
195 * If big-endian, enable hardware byteswap on the PCIe bridges.
196 * This will make both the SoC and PCIe devices behave consistently with
197 * readl/writel.
198 */
199#ifdef __BIG_ENDIAN
200static void xlp_config_pci_bswap(void)
195{ 201{
196 uint64_t pciebase, sysbase; 202 uint64_t pciebase, sysbase;
197 int node, i; 203 int node, i;
@@ -222,8 +228,11 @@ static int xlp_enable_pci_bswap(void)
222 reg = nlm_read_bridge_reg(sysbase, BRIDGE_PCIEIO_LIMIT0 + i); 228 reg = nlm_read_bridge_reg(sysbase, BRIDGE_PCIEIO_LIMIT0 + i);
223 nlm_write_pci_reg(pciebase, PCIE_BYTE_SWAP_IO_LIM, reg | 0xfff); 229 nlm_write_pci_reg(pciebase, PCIE_BYTE_SWAP_IO_LIM, reg | 0xfff);
224 } 230 }
225 return 0;
226} 231}
232#else
233/* Swap configuration not needed in little-endian mode */
234static inline void xlp_config_pci_bswap(void) {}
235#endif /* __BIG_ENDIAN */
227 236
228static int __init pcibios_init(void) 237static int __init pcibios_init(void)
229{ 238{
@@ -235,7 +244,7 @@ static int __init pcibios_init(void)
235 ioport_resource.start = 0; 244 ioport_resource.start = 0;
236 ioport_resource.end = ~0; 245 ioport_resource.end = ~0;
237 246
238 xlp_enable_pci_bswap(); 247 xlp_config_pci_bswap();
239 set_io_port_base(CKSEG1); 248 set_io_port_base(CKSEG1);
240 nlm_pci_controller.io_map_base = CKSEG1; 249 nlm_pci_controller.io_map_base = CKSEG1;
241 250