aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-07-09 23:43:33 -0400
committerRob Herring <rob.herring@calxeda.com>2012-07-26 10:10:01 -0400
commit2bb080851a5193a10b89d3f550c60240ef401aa1 (patch)
treec063c109a4081c23208153552065faab4574c6fb /arch/arm/mach-kirkwood
parentd191bb6961ab5f8de9b20b9540b81f352f5dd765 (diff)
ARM: kirkwood: use fixed PCI i/o mapping
Move kirkwood PCI to fixed i/o mapping and remove io.h. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Lennert Buytenhek <kernel@wantstofly.org> Acked-by: Nicolas Pitre <nico@linaro.org> Cc: Jason Cooper <jason@lakedaemon.net> Tested-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r--arch/arm/mach-kirkwood/common.c10
-rw-r--r--arch/arm/mach-kirkwood/include/mach/io.h24
-rw-r--r--arch/arm/mach-kirkwood/include/mach/kirkwood.h8
-rw-r--r--arch/arm/mach-kirkwood/pcie.c44
4 files changed, 16 insertions, 70 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f261cd242643..55e4d7937964 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -41,16 +41,6 @@
41 ****************************************************************************/ 41 ****************************************************************************/
42static struct map_desc kirkwood_io_desc[] __initdata = { 42static struct map_desc kirkwood_io_desc[] __initdata = {
43 { 43 {
44 .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE,
45 .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE),
46 .length = KIRKWOOD_PCIE_IO_SIZE,
47 .type = MT_DEVICE,
48 }, {
49 .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE,
50 .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE),
51 .length = KIRKWOOD_PCIE1_IO_SIZE,
52 .type = MT_DEVICE,
53 }, {
54 .virtual = KIRKWOOD_REGS_VIRT_BASE, 44 .virtual = KIRKWOOD_REGS_VIRT_BASE,
55 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), 45 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
56 .length = KIRKWOOD_REGS_SIZE, 46 .length = KIRKWOOD_REGS_SIZE,
diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h
deleted file mode 100644
index 5d0ab61700d2..000000000000
--- a/arch/arm/mach-kirkwood/include/mach/io.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/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 "kirkwood.h"
13
14#define IO_SPACE_LIMIT 0xffffffff
15
16static inline void __iomem *__io(unsigned long addr)
17{
18 return (void __iomem *)((addr - KIRKWOOD_PCIE_IO_BUS_BASE)
19 + KIRKWOOD_PCIE_IO_VIRT_BASE);
20}
21
22#define __io(a) __io(a)
23
24#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index c5b68510776b..af4f0000dcef 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -37,14 +37,12 @@
37#define KIRKWOOD_NAND_MEM_SIZE SZ_1K 37#define KIRKWOOD_NAND_MEM_SIZE SZ_1K
38 38
39#define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000 39#define KIRKWOOD_PCIE1_IO_PHYS_BASE 0xf3000000
40#define KIRKWOOD_PCIE1_IO_VIRT_BASE 0xfef00000 40#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00010000
41#define KIRKWOOD_PCIE1_IO_BUS_BASE 0x00100000 41#define KIRKWOOD_PCIE1_IO_SIZE SZ_64K
42#define KIRKWOOD_PCIE1_IO_SIZE SZ_1M
43 42
44#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 43#define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000
45#define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfee00000
46#define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000 44#define KIRKWOOD_PCIE_IO_BUS_BASE 0x00000000
47#define KIRKWOOD_PCIE_IO_SIZE SZ_1M 45#define KIRKWOOD_PCIE_IO_SIZE SZ_64K
48 46
49#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 47#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000
50#define KIRKWOOD_REGS_VIRT_BASE 0xfed00000 48#define KIRKWOOD_REGS_VIRT_BASE 0xfed00000
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index 6e8b2efa3c35..532d8acb38f9 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -56,7 +56,7 @@ struct pcie_port {
56 void __iomem *base; 56 void __iomem *base;
57 spinlock_t conf_lock; 57 spinlock_t conf_lock;
58 int irq; 58 int irq;
59 struct resource res[2]; 59 struct resource res;
60}; 60};
61 61
62static int pcie_port_map[2]; 62static int pcie_port_map[2];
@@ -137,20 +137,12 @@ static void __init pcie0_ioresources_init(struct pcie_port *pp)
137 pp->irq = IRQ_KIRKWOOD_PCIE; 137 pp->irq = IRQ_KIRKWOOD_PCIE;
138 138
139 /* 139 /*
140 * IORESOURCE_IO
141 */
142 pp->res[0].name = "PCIe 0 I/O Space";
143 pp->res[0].start = KIRKWOOD_PCIE_IO_BUS_BASE;
144 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE_IO_SIZE - 1;
145 pp->res[0].flags = IORESOURCE_IO;
146
147 /*
148 * IORESOURCE_MEM 140 * IORESOURCE_MEM
149 */ 141 */
150 pp->res[1].name = "PCIe 0 MEM"; 142 pp->res.name = "PCIe 0 MEM";
151 pp->res[1].start = KIRKWOOD_PCIE_MEM_PHYS_BASE; 143 pp->res.start = KIRKWOOD_PCIE_MEM_PHYS_BASE;
152 pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE_MEM_SIZE - 1; 144 pp->res.end = pp->res.start + KIRKWOOD_PCIE_MEM_SIZE - 1;
153 pp->res[1].flags = IORESOURCE_MEM; 145 pp->res.flags = IORESOURCE_MEM;
154} 146}
155 147
156static void __init pcie1_ioresources_init(struct pcie_port *pp) 148static void __init pcie1_ioresources_init(struct pcie_port *pp)
@@ -159,20 +151,12 @@ static void __init pcie1_ioresources_init(struct pcie_port *pp)
159 pp->irq = IRQ_KIRKWOOD_PCIE1; 151 pp->irq = IRQ_KIRKWOOD_PCIE1;
160 152
161 /* 153 /*
162 * IORESOURCE_IO
163 */
164 pp->res[0].name = "PCIe 1 I/O Space";
165 pp->res[0].start = KIRKWOOD_PCIE1_IO_BUS_BASE;
166 pp->res[0].end = pp->res[0].start + KIRKWOOD_PCIE1_IO_SIZE - 1;
167 pp->res[0].flags = IORESOURCE_IO;
168
169 /*
170 * IORESOURCE_MEM 154 * IORESOURCE_MEM
171 */ 155 */
172 pp->res[1].name = "PCIe 1 MEM"; 156 pp->res.name = "PCIe 1 MEM";
173 pp->res[1].start = KIRKWOOD_PCIE1_MEM_PHYS_BASE; 157 pp->res.start = KIRKWOOD_PCIE1_MEM_PHYS_BASE;
174 pp->res[1].end = pp->res[1].start + KIRKWOOD_PCIE1_MEM_SIZE - 1; 158 pp->res.end = pp->res.start + KIRKWOOD_PCIE1_MEM_SIZE - 1;
175 pp->res[1].flags = IORESOURCE_MEM; 159 pp->res.flags = IORESOURCE_MEM;
176} 160}
177 161
178static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys) 162static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
@@ -197,23 +181,21 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
197 case 0: 181 case 0:
198 kirkwood_enable_pcie_clk("0"); 182 kirkwood_enable_pcie_clk("0");
199 pcie0_ioresources_init(pp); 183 pcie0_ioresources_init(pp);
184 pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE_IO_PHYS_BASE);
200 break; 185 break;
201 case 1: 186 case 1:
202 kirkwood_enable_pcie_clk("1"); 187 kirkwood_enable_pcie_clk("1");
203 pcie1_ioresources_init(pp); 188 pcie1_ioresources_init(pp);
189 pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE);
204 break; 190 break;
205 default: 191 default:
206 panic("PCIe setup: invalid controller %d", index); 192 panic("PCIe setup: invalid controller %d", index);
207 } 193 }
208 194
209 if (request_resource(&ioport_resource, &pp->res[0])) 195 if (request_resource(&iomem_resource, &pp->res))
210 panic("Request PCIe%d IO resource failed\n", index);
211 if (request_resource(&iomem_resource, &pp->res[1]))
212 panic("Request PCIe%d Memory resource failed\n", index); 196 panic("Request PCIe%d Memory resource failed\n", index);
213 197
214 sys->io_offset = 0; 198 pci_add_resource_offset(&sys->resources, &pp->res, sys->mem_offset);
215 pci_add_resource_offset(&sys->resources, &pp->res[0], sys->io_offset);
216 pci_add_resource_offset(&sys->resources, &pp->res[1], sys->mem_offset);
217 199
218 /* 200 /*
219 * Generic PCIe unit setup. 201 * Generic PCIe unit setup.