aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-versatile
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-07-08 23:13:54 -0400
committerRob Herring <rob.herring@calxeda.com>2012-07-26 10:09:56 -0400
commitfe5051754263e7198aa8f415b2e1298c126adb4e (patch)
tree7c50331d94c244d5f7df21a33c53c964aff2d0c4 /arch/arm/mach-versatile
parent3c5d1699887bfcd17e6d9842ba7e2b3234e665db (diff)
ARM: versatile: use fixed PCI i/o mapping
Move versatile PCI to fixed i/o mapping and remove io.h. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r--arch/arm/mach-versatile/core.c5
-rw-r--r--arch/arm/mach-versatile/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-versatile/include/mach/io.h27
-rw-r--r--arch/arm/mach-versatile/pci.c22
4 files changed, 4 insertions, 51 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index cd8ea3588f93..ca7902c6ed18 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -169,11 +169,6 @@ static struct map_desc versatile_io_desc[] __initdata = {
169 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE), 169 .pfn = __phys_to_pfn(VERSATILE_PCI_CFG_BASE),
170 .length = VERSATILE_PCI_CFG_BASE_SIZE, 170 .length = VERSATILE_PCI_CFG_BASE_SIZE,
171 .type = MT_DEVICE 171 .type = MT_DEVICE
172 }, {
173 .virtual = (unsigned long)VERSATILE_PCI_VIRT_MEM_BASE0,
174 .pfn = __phys_to_pfn(VERSATILE_PCI_MEM_BASE0),
175 .length = IO_SPACE_LIMIT,
176 .type = MT_DEVICE
177 }, 172 },
178#endif 173#endif
179}; 174};
diff --git a/arch/arm/mach-versatile/include/mach/hardware.h b/arch/arm/mach-versatile/include/mach/hardware.h
index 408e58da46c6..3e5d425e2a92 100644
--- a/arch/arm/mach-versatile/include/mach/hardware.h
+++ b/arch/arm/mach-versatile/include/mach/hardware.h
@@ -29,7 +29,6 @@
29 */ 29 */
30#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul 30#define VERSATILE_PCI_VIRT_BASE (void __iomem *)0xe8000000ul
31#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul 31#define VERSATILE_PCI_CFG_VIRT_BASE (void __iomem *)0xe9000000ul
32#define VERSATILE_PCI_VIRT_MEM_BASE0 (void __iomem *)PCIO_BASE
33 32
34/* macro to get at MMIO space when running virtually */ 33/* macro to get at MMIO space when running virtually */
35#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) 34#define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
diff --git a/arch/arm/mach-versatile/include/mach/io.h b/arch/arm/mach-versatile/include/mach/io.h
deleted file mode 100644
index 0406513be7d8..000000000000
--- a/arch/arm/mach-versatile/include/mach/io.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * arch/arm/mach-versatile/include/mach/io.h
3 *
4 * Copyright (C) 2003 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __ASM_ARM_ARCH_IO_H
21#define __ASM_ARM_ARCH_IO_H
22
23#define PCIO_BASE 0xeb000000ul
24
25#define __io(a) ((a) + PCIO_BASE)
26
27#endif
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c
index e95bf84cc837..2f84f4094f13 100644
--- a/arch/arm/mach-versatile/pci.c
+++ b/arch/arm/mach-versatile/pci.c
@@ -169,13 +169,6 @@ static struct pci_ops pci_versatile_ops = {
169 .write = versatile_write_config, 169 .write = versatile_write_config,
170}; 170};
171 171
172static struct resource io_port = {
173 .name = "PCI",
174 .start = 0,
175 .end = IO_SPACE_LIMIT,
176 .flags = IORESOURCE_IO,
177};
178
179static struct resource io_mem = { 172static struct resource io_mem = {
180 .name = "PCI I/O space", 173 .name = "PCI I/O space",
181 .start = VERSATILE_PCI_MEM_BASE0, 174 .start = VERSATILE_PCI_MEM_BASE0,
@@ -207,12 +200,6 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
207 "memory region (%d)\n", ret); 200 "memory region (%d)\n", ret);
208 goto out; 201 goto out;
209 } 202 }
210 ret = request_resource(&ioport_resource, &io_port);
211 if (ret) {
212 printk(KERN_ERR "PCI: unable to allocate I/O "
213 "port region (%d)\n", ret);
214 goto out;
215 }
216 ret = request_resource(&iomem_resource, &non_mem); 203 ret = request_resource(&iomem_resource, &non_mem);
217 if (ret) { 204 if (ret) {
218 printk(KERN_ERR "PCI: unable to allocate non-prefetchable " 205 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
@@ -227,11 +214,9 @@ static int __init pci_versatile_setup_resources(struct pci_sys_data *sys)
227 } 214 }
228 215
229 /* 216 /*
230 * the IO resource for this bus
231 * the mem resource for this bus 217 * the mem resource for this bus
232 * the prefetch mem resource for this bus 218 * the prefetch mem resource for this bus
233 */ 219 */
234 pci_add_resource_offset(&sys->resources, &io_port, sys->io_offset);
235 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); 220 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
236 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); 221 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
237 222
@@ -260,9 +245,11 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
260 goto out; 245 goto out;
261 } 246 }
262 247
248 ret = pci_ioremap_io(0, VERSATILE_PCI_MEM_BASE0);
249 if (ret)
250 goto out;
251
263 if (nr == 0) { 252 if (nr == 0) {
264 sys->mem_offset = 0;
265 sys->io_offset = 0;
266 ret = pci_versatile_setup_resources(sys); 253 ret = pci_versatile_setup_resources(sys);
267 if (ret < 0) { 254 if (ret < 0) {
268 printk("pci_versatile_setup: resources... oops?\n"); 255 printk("pci_versatile_setup: resources... oops?\n");
@@ -319,7 +306,6 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
319 306
320void __init pci_versatile_preinit(void) 307void __init pci_versatile_preinit(void)
321{ 308{
322 pcibios_min_io = 0x44000000;
323 pcibios_min_mem = 0x50000000; 309 pcibios_min_mem = 0x50000000;
324 310
325 __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0); 311 __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);