diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-03-01 21:48:12 -0500 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-07-26 10:09:59 -0400 |
commit | 8ef6e6201b26cb9fde79c1baa08145af6aca2815 (patch) | |
tree | c2ae90128bfea1a6ff8d463141b1a14ab1b1faf6 /arch/arm/mach-footbridge | |
parent | c04dc9a6bfe88b8c15bf8dd298fc24d6b9df3f22 (diff) |
ARM: footbridge: use fixed PCI i/o mapping
Move footbridge PCI to fixed i/o mapping. io.h is still needed for the
!MMU case.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-footbridge')
-rw-r--r-- | arch/arm/mach-footbridge/common.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/dc21285.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/include/mach/debug-macro.S | 3 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/include/mach/io.h | 12 |
4 files changed, 13 insertions, 30 deletions
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c index 3e6aaa6361d..a42b369bc43 100644 --- a/arch/arm/mach-footbridge/common.c +++ b/arch/arm/mach-footbridge/common.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
18 | 18 | ||
19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <asm/mach/irq.h> | 27 | #include <asm/mach/irq.h> |
28 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
29 | #include <asm/mach/pci.h> | ||
29 | 30 | ||
30 | #include "common.h" | 31 | #include "common.h" |
31 | 32 | ||
@@ -175,11 +176,6 @@ static struct map_desc ebsa285_host_io_desc[] __initdata = { | |||
175 | .pfn = __phys_to_pfn(DC21285_PCI_IACK), | 176 | .pfn = __phys_to_pfn(DC21285_PCI_IACK), |
176 | .length = PCIIACK_SIZE, | 177 | .length = PCIIACK_SIZE, |
177 | .type = MT_DEVICE, | 178 | .type = MT_DEVICE, |
178 | }, { | ||
179 | .virtual = PCIO_BASE, | ||
180 | .pfn = __phys_to_pfn(DC21285_PCI_IO), | ||
181 | .length = PCIO_SIZE, | ||
182 | .type = MT_DEVICE, | ||
183 | }, | 179 | }, |
184 | #endif | 180 | #endif |
185 | }; | 181 | }; |
@@ -196,8 +192,10 @@ void __init footbridge_map_io(void) | |||
196 | * Now, work out what we've got to map in addition on this | 192 | * Now, work out what we've got to map in addition on this |
197 | * platform. | 193 | * platform. |
198 | */ | 194 | */ |
199 | if (footbridge_cfn_mode()) | 195 | if (footbridge_cfn_mode()) { |
200 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); | 196 | iotable_init(ebsa285_host_io_desc, ARRAY_SIZE(ebsa285_host_io_desc)); |
197 | pci_map_io_early(__phys_to_pfn(DC21285_PCI_IO)); | ||
198 | } | ||
201 | } | 199 | } |
202 | 200 | ||
203 | void footbridge_restart(char mode, const char *cmd) | 201 | void footbridge_restart(char mode, const char *cmd) |
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 9d62e338102..a7cd2cf5e08 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -276,8 +276,8 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys) | |||
276 | 276 | ||
277 | sys->mem_offset = DC21285_PCI_MEM; | 277 | sys->mem_offset = DC21285_PCI_MEM; |
278 | 278 | ||
279 | pci_add_resource_offset(&sys->resources, | 279 | pci_ioremap_io(0, DC21285_PCI_IO); |
280 | &ioport_resource, sys->io_offset); | 280 | |
281 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); | 281 | pci_add_resource_offset(&sys->resources, &res[0], sys->mem_offset); |
282 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); | 282 | pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); |
283 | 283 | ||
@@ -298,7 +298,7 @@ void __init dc21285_preinit(void) | |||
298 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; | 298 | mem_size = (unsigned int)high_memory - PAGE_OFFSET; |
299 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) | 299 | for (mem_mask = 0x00100000; mem_mask < 0x10000000; mem_mask <<= 1) |
300 | if (mem_mask >= mem_size) | 300 | if (mem_mask >= mem_size) |
301 | break; | 301 | break; |
302 | 302 | ||
303 | /* | 303 | /* |
304 | * These registers need to be set up whether we're the | 304 | * These registers need to be set up whether we're the |
@@ -350,14 +350,6 @@ void __init dc21285_preinit(void) | |||
350 | "PCI data parity", NULL); | 350 | "PCI data parity", NULL); |
351 | 351 | ||
352 | if (cfn_mode) { | 352 | if (cfn_mode) { |
353 | static struct resource csrio; | ||
354 | |||
355 | csrio.flags = IORESOURCE_IO; | ||
356 | csrio.name = "Footbridge"; | ||
357 | |||
358 | allocate_resource(&ioport_resource, &csrio, 128, | ||
359 | 0xff00, 0xffff, 128, NULL, NULL); | ||
360 | |||
361 | /* | 353 | /* |
362 | * Map our SDRAM at a known address in PCI space, just in case | 354 | * Map our SDRAM at a known address in PCI space, just in case |
363 | * the firmware had other ideas. Using a nonzero base is | 355 | * the firmware had other ideas. Using a nonzero base is |
@@ -365,7 +357,7 @@ void __init dc21285_preinit(void) | |||
365 | * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). | 357 | * in the range 0x000a0000 to 0x000c0000. (eg, S3 cards). |
366 | */ | 358 | */ |
367 | *CSR_PCICSRBASE = 0xf4000000; | 359 | *CSR_PCICSRBASE = 0xf4000000; |
368 | *CSR_PCICSRIOBASE = csrio.start; | 360 | *CSR_PCICSRIOBASE = 0; |
369 | *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); | 361 | *CSR_PCISDRAMBASE = __virt_to_bus(PAGE_OFFSET); |
370 | *CSR_PCIROMBASE = 0; | 362 | *CSR_PCIROMBASE = 0; |
371 | *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | 363 | *CSR_PCICMD = PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | |
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S index e5acde25ffc..c169f0c99b2 100644 --- a/arch/arm/mach-footbridge/include/mach/debug-macro.S +++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S | |||
@@ -17,7 +17,8 @@ | |||
17 | /* For NetWinder debugging */ | 17 | /* For NetWinder debugging */ |
18 | .macro addruart, rp, rv, tmp | 18 | .macro addruart, rp, rv, tmp |
19 | mov \rp, #0x000003f8 | 19 | mov \rp, #0x000003f8 |
20 | orr \rv, \rp, #0xff000000 @ virtual | 20 | orr \rv, \rp, #0xfe000000 @ virtual |
21 | orr \rv, \rv, #0x00e00000 @ virtual | ||
21 | orr \rp, \rp, #0x7c000000 @ physical | 22 | orr \rp, \rp, #0x7c000000 @ physical |
22 | .endm | 23 | .endm |
23 | 24 | ||
diff --git a/arch/arm/mach-footbridge/include/mach/io.h b/arch/arm/mach-footbridge/include/mach/io.h index aba531eebbc..aba46388cc0 100644 --- a/arch/arm/mach-footbridge/include/mach/io.h +++ b/arch/arm/mach-footbridge/include/mach/io.h | |||
@@ -14,18 +14,10 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #ifdef CONFIG_MMU | ||
18 | #define MMU_IO(a, b) (a) | ||
19 | #else | ||
20 | #define MMU_IO(a, b) (b) | ||
21 | #endif | ||
22 | |||
23 | #define PCIO_SIZE 0x00100000 | ||
24 | #define PCIO_BASE MMU_IO(0xff000000, 0x7c000000) | ||
25 | |||
26 | /* | 17 | /* |
27 | * Translation of various region addresses to virtual addresses | 18 | * Translation of various i/o addresses to host addresses for !CONFIG_MMU |
28 | */ | 19 | */ |
20 | #define PCIO_BASE 0x7c000000 | ||
29 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 21 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) |
30 | 22 | ||
31 | #endif | 23 | #endif |