diff options
author | Rob Herring <rob.herring@calxeda.com> | 2012-02-28 17:05:10 -0500 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2012-07-26 10:10:00 -0400 |
commit | d191bb6961ab5f8de9b20b9540b81f352f5dd765 (patch) | |
tree | 7fc845deb658b3307f6285747cb7320741bc2b61 | |
parent | 8ef6e6201b26cb9fde79c1baa08145af6aca2815 (diff) |
ARM: dove: use fixed PCI i/o mapping
The i/o regions are changed from 1MB to 64KB. It's likely that the 2nd
bus is not setup correctly.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-dove/common.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-dove/include/mach/dove.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-dove/include/mach/io.h | 19 | ||||
-rw-r--r-- | arch/arm/mach-dove/pcie.c | 43 |
5 files changed, 17 insertions, 64 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7215ebfcd6cb..ed930adf58a1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -537,7 +537,6 @@ config ARCH_DOVE | |||
537 | select PCI | 537 | select PCI |
538 | select ARCH_REQUIRE_GPIOLIB | 538 | select ARCH_REQUIRE_GPIOLIB |
539 | select GENERIC_CLOCKEVENTS | 539 | select GENERIC_CLOCKEVENTS |
540 | select NEED_MACH_IO_H | ||
541 | select PLAT_ORION | 540 | select PLAT_ORION |
542 | help | 541 | help |
543 | Support for the Marvell Dove SoC 88AP510 | 542 | Support for the Marvell Dove SoC 88AP510 |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 9493076fc594..95e78a840a7b 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -49,16 +49,6 @@ static struct map_desc dove_io_desc[] __initdata = { | |||
49 | .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE), | 49 | .pfn = __phys_to_pfn(DOVE_NB_REGS_PHYS_BASE), |
50 | .length = DOVE_NB_REGS_SIZE, | 50 | .length = DOVE_NB_REGS_SIZE, |
51 | .type = MT_DEVICE, | 51 | .type = MT_DEVICE, |
52 | }, { | ||
53 | .virtual = DOVE_PCIE0_IO_VIRT_BASE, | ||
54 | .pfn = __phys_to_pfn(DOVE_PCIE0_IO_PHYS_BASE), | ||
55 | .length = DOVE_PCIE0_IO_SIZE, | ||
56 | .type = MT_DEVICE, | ||
57 | }, { | ||
58 | .virtual = DOVE_PCIE1_IO_VIRT_BASE, | ||
59 | .pfn = __phys_to_pfn(DOVE_PCIE1_IO_PHYS_BASE), | ||
60 | .length = DOVE_PCIE1_IO_SIZE, | ||
61 | .type = MT_DEVICE, | ||
62 | }, | 52 | }, |
63 | }; | 53 | }; |
64 | 54 | ||
diff --git a/arch/arm/mach-dove/include/mach/dove.h b/arch/arm/mach-dove/include/mach/dove.h index d52b0ef313b7..c91e3004a47b 100644 --- a/arch/arm/mach-dove/include/mach/dove.h +++ b/arch/arm/mach-dove/include/mach/dove.h | |||
@@ -50,14 +50,12 @@ | |||
50 | #define DOVE_NB_REGS_SIZE SZ_8M | 50 | #define DOVE_NB_REGS_SIZE SZ_8M |
51 | 51 | ||
52 | #define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 | 52 | #define DOVE_PCIE0_IO_PHYS_BASE 0xf2000000 |
53 | #define DOVE_PCIE0_IO_VIRT_BASE 0xfee00000 | ||
54 | #define DOVE_PCIE0_IO_BUS_BASE 0x00000000 | 53 | #define DOVE_PCIE0_IO_BUS_BASE 0x00000000 |
55 | #define DOVE_PCIE0_IO_SIZE SZ_1M | 54 | #define DOVE_PCIE0_IO_SIZE SZ_64K |
56 | 55 | ||
57 | #define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000 | 56 | #define DOVE_PCIE1_IO_PHYS_BASE 0xf2100000 |
58 | #define DOVE_PCIE1_IO_VIRT_BASE 0xfef00000 | 57 | #define DOVE_PCIE1_IO_BUS_BASE 0x00010000 |
59 | #define DOVE_PCIE1_IO_BUS_BASE 0x00100000 | 58 | #define DOVE_PCIE1_IO_SIZE SZ_64K |
60 | #define DOVE_PCIE1_IO_SIZE SZ_1M | ||
61 | 59 | ||
62 | /* | 60 | /* |
63 | * Dove Core Registers Map | 61 | * Dove Core Registers Map |
diff --git a/arch/arm/mach-dove/include/mach/io.h b/arch/arm/mach-dove/include/mach/io.h deleted file mode 100644 index 29c8b85355a5..000000000000 --- a/arch/arm/mach-dove/include/mach/io.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-dove/include/mach/io.h | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_ARCH_IO_H | ||
10 | #define __ASM_ARCH_IO_H | ||
11 | |||
12 | #include "dove.h" | ||
13 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | ||
15 | |||
16 | #define __io(a) ((void __iomem *)(((a) - DOVE_PCIE0_IO_BUS_BASE) + \ | ||
17 | DOVE_PCIE0_IO_VIRT_BASE)) | ||
18 | |||
19 | #endif | ||
diff --git a/arch/arm/mach-dove/pcie.c b/arch/arm/mach-dove/pcie.c index 47921b0cdc65..355332d502cb 100644 --- a/arch/arm/mach-dove/pcie.c +++ b/arch/arm/mach-dove/pcie.c | |||
@@ -26,9 +26,8 @@ struct pcie_port { | |||
26 | u8 root_bus_nr; | 26 | u8 root_bus_nr; |
27 | void __iomem *base; | 27 | void __iomem *base; |
28 | spinlock_t conf_lock; | 28 | spinlock_t conf_lock; |
29 | char io_space_name[16]; | ||
30 | char mem_space_name[16]; | 29 | char mem_space_name[16]; |
31 | struct resource res[2]; | 30 | struct resource res; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | static struct pcie_port pcie_port[2]; | 33 | static struct pcie_port pcie_port[2]; |
@@ -53,24 +52,10 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) | |||
53 | 52 | ||
54 | orion_pcie_setup(pp->base); | 53 | orion_pcie_setup(pp->base); |
55 | 54 | ||
56 | /* | 55 | if (pp->index == 0) |
57 | * IORESOURCE_IO | 56 | pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE0_IO_PHYS_BASE); |
58 | */ | 57 | else |
59 | snprintf(pp->io_space_name, sizeof(pp->io_space_name), | 58 | pci_ioremap_io(sys->busnr * SZ_64K, DOVE_PCIE1_IO_PHYS_BASE); |
60 | "PCIe %d I/O", pp->index); | ||
61 | pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0; | ||
62 | pp->res[0].name = pp->io_space_name; | ||
63 | if (pp->index == 0) { | ||
64 | pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE; | ||
65 | pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1; | ||
66 | } else { | ||
67 | pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE; | ||
68 | pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1; | ||
69 | } | ||
70 | pp->res[0].flags = IORESOURCE_IO; | ||
71 | if (request_resource(&ioport_resource, &pp->res[0])) | ||
72 | panic("Request PCIe IO resource failed\n"); | ||
73 | pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset); | ||
74 | 59 | ||
75 | /* | 60 | /* |
76 | * IORESOURCE_MEM | 61 | * IORESOURCE_MEM |
@@ -78,18 +63,18 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys) | |||
78 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), | 63 | snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), |
79 | "PCIe %d MEM", pp->index); | 64 | "PCIe %d MEM", pp->index); |
80 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; | 65 | pp->mem_space_name[sizeof(pp->mem_space_name) - 1] = 0; |
81 | pp->res[1].name = pp->mem_space_name; | 66 | pp->res.name = pp->mem_space_name; |
82 | if (pp->index == 0) { | 67 | if (pp->index == 0) { |
83 | pp->res[1].start = DOVE_PCIE0_MEM_PHYS_BASE; | 68 | pp->res.start = DOVE_PCIE0_MEM_PHYS_BASE; |
84 | pp->res[1].end = pp->res[1].start + DOVE_PCIE0_MEM_SIZE - 1; | 69 | pp->res.end = pp->res.start + DOVE_PCIE0_MEM_SIZE - 1; |
85 | } else { | 70 | } else { |
86 | pp->res[1].start = DOVE_PCIE1_MEM_PHYS_BASE; | 71 | pp->res.start = DOVE_PCIE1_MEM_PHYS_BASE; |
87 | pp->res[1].end = pp->res[1].start + DOVE_PCIE1_MEM_SIZE - 1; | 72 | pp->res.end = pp->res.start + DOVE_PCIE1_MEM_SIZE - 1; |
88 | } | 73 | } |
89 | pp->res[1].flags = IORESOURCE_MEM; | 74 | pp->res.flags = IORESOURCE_MEM; |
90 | if (request_resource(&iomem_resource, &pp->res[1])) | 75 | if (request_resource(&iomem_resource, &pp->res)) |
91 | panic("Request PCIe Memory resource failed\n"); | 76 | panic("Request PCIe Memory resource failed\n"); |
92 | pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset); | 77 | pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset); |
93 | 78 | ||
94 | return 1; | 79 | return 1; |
95 | } | 80 | } |
@@ -210,7 +195,7 @@ static void __init add_pcie_port(int index, unsigned long base) | |||
210 | pp->root_bus_nr = -1; | 195 | pp->root_bus_nr = -1; |
211 | pp->base = (void __iomem *)base; | 196 | pp->base = (void __iomem *)base; |
212 | spin_lock_init(&pp->conf_lock); | 197 | spin_lock_init(&pp->conf_lock); |
213 | memset(pp->res, 0, sizeof(pp->res)); | 198 | memset(&pp->res, 0, sizeof(pp->res)); |
214 | } else { | 199 | } else { |
215 | printk(KERN_INFO "link down, ignoring\n"); | 200 | printk(KERN_INFO "link down, ignoring\n"); |
216 | } | 201 | } |