aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
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')
-rw-r--r--arch/arm/mach-versatile/include/mach/platform.h2
-rw-r--r--arch/arm/mach-versatile/pci.c16
2 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-versatile/include/mach/platform.h b/arch/arm/mach-versatile/include/mach/platform.h
index ec087407b163..6f938ccb0c54 100644
--- a/arch/arm/mach-versatile/include/mach/platform.h
+++ b/arch/arm/mach-versatile/include/mach/platform.h
@@ -231,12 +231,14 @@
231/* PCI space */ 231/* PCI space */
232#define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */ 232#define VERSATILE_PCI_BASE 0x41000000 /* PCI Interface */
233#define VERSATILE_PCI_CFG_BASE 0x42000000 233#define VERSATILE_PCI_CFG_BASE 0x42000000
234#define VERSATILE_PCI_IO_BASE 0x43000000
234#define VERSATILE_PCI_MEM_BASE0 0x44000000 235#define VERSATILE_PCI_MEM_BASE0 0x44000000
235#define VERSATILE_PCI_MEM_BASE1 0x50000000 236#define VERSATILE_PCI_MEM_BASE1 0x50000000
236#define VERSATILE_PCI_MEM_BASE2 0x60000000 237#define VERSATILE_PCI_MEM_BASE2 0x60000000
237/* Sizes of above maps */ 238/* Sizes of above maps */
238#define VERSATILE_PCI_BASE_SIZE 0x01000000 239#define VERSATILE_PCI_BASE_SIZE 0x01000000
239#define VERSATILE_PCI_CFG_BASE_SIZE 0x02000000 240#define VERSATILE_PCI_CFG_BASE_SIZE 0x02000000
241#define VERSATILE_PCI_IO_BASE_SIZE 0x01000000
240#define VERSATILE_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */ 242#define VERSATILE_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */
241#define VERSATILE_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */ 243#define VERSATILE_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */
242#define VERSATILE_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */ 244#define VERSATILE_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */
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