aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile/pci.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2013-08-22 12:47:49 -0400
committerKevin Hilman <khilman@linaro.org>2013-09-04 17:53:26 -0400
commit829f9fedee30cde2ec15e88d57ec11074db791e2 (patch)
tree331a7e28950bc5cfab94f8d7faabd589a0c5df90 /arch/arm/mach-versatile/pci.c
parentf9b71fef12f0d6ac5c7051cfd87f7700f78c56b6 (diff)
ARM: PCI: versatile: Fix PCI I/O
The versatile PCI controller code was confused between the PCI I/O window (at 0x43000000) and the first PCI memory window (at 0x44000000). Pass the correct base address to pci_remap_io() so that PCI I/O accesses work. Since the first PCI memory window isn't used at all (it's an odd size), rename the associated variables and labels so that it's clear that it isn't related to the I/O window. This has been tested and confirmed to fix PCI I/O accesses both on physical PB926+PCI backplane hardware and on QEMU. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Cc: stable@vger.kernel.org Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'arch/arm/mach-versatile/pci.c')
-rw-r--r--arch/arm/mach-versatile/pci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index 234740d90385..1e48878cc768 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -170,8 +170,8 @@ static struct pci_ops pci_versatile_ops = {
170 .write = versatile_write_config, 170 .write = versatile_write_config,
171}; 171};
172 172
173static struct resource io_mem = { 173static struct resource unused_mem = {
174 .name = "PCI I/O space", 174 .name = "PCI unused",
175 .start = VERSATILE_PCI_MEM_BASE0, 175 .start = VERSATILE_PCI_MEM_BASE0,
176 .end = VERSATILE_PCI_MEM_BASE0+VERSATILE_PCI_MEM_BASE0_SIZE-1, 176 .end = VERSATILE_PCI_MEM_BASE0+VERSATILE_PCI_MEM_BASE0_SIZE-1,
177 .flags = IORESOURCE_MEM, 177 .flags = IORESOURCE_MEM,
@@ -195,9 +195,9 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
195{ 195{
196 int ret = 0; 196 int ret = 0;
197 197
198 ret = request_resource(&iomem_resource, &io_mem); 198 ret = request_resource(&iomem_resource, &unused_mem);
199 if (ret) { 199 if (ret) {
200 printk(KERN_ERR "PCI: unable to allocate I/O " 200 printk(KERN_ERR "PCI: unable to allocate unused "
201 "memory region (%d)\n", ret); 201 "memory region (%d)\n", ret);
202 goto out; 202 goto out;
203 } 203 }
@@ -205,7 +205,7 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
205 if (ret) { 205 if (ret) {
206 printk(KERN_ERR "PCI: unable to allocate non-prefetchable " 206 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
207 "memory region (%d)\n", ret); 207 "memory region (%d)\n", ret);
208 goto release_io_mem; 208 goto release_unused_mem;
209 } 209 }
210 ret = request_resource(&iomem_resource, &pre_mem); 210 ret = request_resource(&iomem_resource, &pre_mem);
211 if (ret) { 211 if (ret) {
@@ -225,8 +225,8 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
225 225
226 release_non_mem: 226 release_non_mem:
227 release_resource(&non_mem); 227 release_resource(&non_mem);
228 release_io_mem: 228 release_unused_mem:
229 release_resource(&io_mem); 229 release_resource(&unused_mem);
230 out: 230 out:
231 return ret; 231 return ret;
232} 232}
@@ -246,7 +246,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
246 goto out; 246 goto out;
247 } 247 }
248 248
249 ret = pci_ioremap_io(0, VERSATILE_PCI_MEM_BASE0); 249 ret = pci_ioremap_io(0, VERSATILE_PCI_IO_BASE);
250 if (ret) 250 if (ret)
251 goto out; 251 goto out;
252 252