aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-integrator
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-11-04 15:03:02 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-11-16 16:26:17 -0500
commite6fae083b9cc7e27b65660eaa7b2ce6cf871b99a (patch)
treec0234c16bf633f8417703d05bda6bfdf3e4a56b5 /arch/arm/mach-integrator
parent83feba511e5df2fd63a25610d43fe16af02b0742 (diff)
ARM: integrator: remove static CP syscon mapping
This removes the static mapping for the CP system controller for the device tree case. Fork the static mappings table and move the system controller to only be statically mapped in the ATAG boot path. Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 9194a4f3339c..72202108bd71 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -52,11 +52,13 @@
52 52
53#include "common.h" 53#include "common.h"
54 54
55/* Base address to the CP controller */
56static void __iomem *intcp_con_base;
57
55#define INTCP_PA_FLASH_BASE 0x24000000 58#define INTCP_PA_FLASH_BASE 0x24000000
56 59
57#define INTCP_PA_CLCD_BASE 0xc0000000 60#define INTCP_PA_CLCD_BASE 0xc0000000
58 61
59#define INTCP_VA_CTRL_BASE __io_address(INTEGRATOR_CP_CTL_BASE)
60#define INTCP_FLASHPROG 0x04 62#define INTCP_FLASHPROG 0x04
61#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) 63#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
62#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1) 64#define CINTEGRATOR_FLASHPROG_FLWREN (1 << 1)
@@ -127,11 +129,6 @@ static struct map_desc intcp_io_desc[] __initdata = {
127 .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE), 129 .pfn = __phys_to_pfn(INTEGRATOR_CP_SIC_BASE),
128 .length = SZ_4K, 130 .length = SZ_4K,
129 .type = MT_DEVICE 131 .type = MT_DEVICE
130 }, {
131 .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE),
132 .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE),
133 .length = SZ_4K,
134 .type = MT_DEVICE
135 } 132 }
136}; 133};
137 134
@@ -147,9 +144,9 @@ static int intcp_flash_init(struct platform_device *dev)
147{ 144{
148 u32 val; 145 u32 val;
149 146
150 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 147 val = readl(intcp_con_base + INTCP_FLASHPROG);
151 val |= CINTEGRATOR_FLASHPROG_FLWREN; 148 val |= CINTEGRATOR_FLASHPROG_FLWREN;
152 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 149 writel(val, intcp_con_base + INTCP_FLASHPROG);
153 150
154 return 0; 151 return 0;
155} 152}
@@ -158,21 +155,21 @@ static void intcp_flash_exit(struct platform_device *dev)
158{ 155{
159 u32 val; 156 u32 val;
160 157
161 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 158 val = readl(intcp_con_base + INTCP_FLASHPROG);
162 val &= ~(CINTEGRATOR_FLASHPROG_FLVPPEN|CINTEGRATOR_FLASHPROG_FLWREN); 159 val &= ~(CINTEGRATOR_FLASHPROG_FLVPPEN|CINTEGRATOR_FLASHPROG_FLWREN);
163 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 160 writel(val, intcp_con_base + INTCP_FLASHPROG);
164} 161}
165 162
166static void intcp_flash_set_vpp(struct platform_device *pdev, int on) 163static void intcp_flash_set_vpp(struct platform_device *pdev, int on)
167{ 164{
168 u32 val; 165 u32 val;
169 166
170 val = readl(INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 167 val = readl(intcp_con_base + INTCP_FLASHPROG);
171 if (on) 168 if (on)
172 val |= CINTEGRATOR_FLASHPROG_FLVPPEN; 169 val |= CINTEGRATOR_FLASHPROG_FLVPPEN;
173 else 170 else
174 val &= ~CINTEGRATOR_FLASHPROG_FLVPPEN; 171 val &= ~CINTEGRATOR_FLASHPROG_FLVPPEN;
175 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 172 writel(val, intcp_con_base + INTCP_FLASHPROG);
176} 173}
177 174
178static struct physmap_flash_data intcp_flash_data = { 175static struct physmap_flash_data intcp_flash_data = {
@@ -191,7 +188,7 @@ static struct physmap_flash_data intcp_flash_data = {
191static unsigned int mmc_status(struct device *dev) 188static unsigned int mmc_status(struct device *dev)
192{ 189{
193 unsigned int status = readl(__io_address(0xca000000 + 4)); 190 unsigned int status = readl(__io_address(0xca000000 + 4));
194 writel(8, __io_address(INTEGRATOR_CP_CTL_BASE + 8)); 191 writel(8, intcp_con_base + 8);
195 192
196 return status & 8; 193 return status & 8;
197} 194}
@@ -337,9 +334,6 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = {
337 { /* sentinel */ }, 334 { /* sentinel */ },
338}; 335};
339 336
340/* Base address to the CP controller */
341static void __iomem *intcp_con_base;
342
343static void __init intcp_init_of(void) 337static void __init intcp_init_of(void)
344{ 338{
345 struct device_node *root; 339 struct device_node *root;
@@ -418,6 +412,28 @@ MACHINE_END
418#ifdef CONFIG_ATAGS 412#ifdef CONFIG_ATAGS
419 413
420/* 414/*
415 * For the ATAG boot some static mappings are needed. This will
416 * go away with the ATAG support down the road.
417 */
418
419static struct map_desc intcp_io_desc_atag[] __initdata = {
420 {
421 .virtual = IO_ADDRESS(INTEGRATOR_CP_CTL_BASE),
422 .pfn = __phys_to_pfn(INTEGRATOR_CP_CTL_BASE),
423 .length = SZ_4K,
424 .type = MT_DEVICE
425 },
426};
427
428static void __init intcp_map_io_atag(void)
429{
430 iotable_init(intcp_io_desc_atag, ARRAY_SIZE(intcp_io_desc_atag));
431 intcp_con_base = __io_address(INTEGRATOR_CP_CTL_BASE);
432 intcp_map_io();
433}
434
435
436/*
421 * This is where non-devicetree initialization code is collected and stashed 437 * This is where non-devicetree initialization code is collected and stashed
422 * for eventual deletion. 438 * for eventual deletion.
423 */ 439 */
@@ -556,7 +572,7 @@ MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
556 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 572 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
557 .atag_offset = 0x100, 573 .atag_offset = 0x100,
558 .reserve = integrator_reserve, 574 .reserve = integrator_reserve,
559 .map_io = intcp_map_io, 575 .map_io = intcp_map_io_atag,
560 .nr_irqs = NR_IRQS_INTEGRATOR_CP, 576 .nr_irqs = NR_IRQS_INTEGRATOR_CP,
561 .init_early = intcp_init_early, 577 .init_early = intcp_init_early,
562 .init_irq = intcp_init_irq, 578 .init_irq = intcp_init_irq,