diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-06-17 17:58:25 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-04 10:22:31 -0500 |
commit | 307b96677c98bc444262e3d1a7d26c0ca8a1c6e0 (patch) | |
tree | 1175417c6ff476dbbb97a09a109e9981a3c1e2ab /arch/arm/mach-integrator | |
parent | 78d1632183454dba46ca8295484a5e7603acdc18 (diff) |
ARM: integrator: move EBI to the device tree
This moves the External Bus Interface (EBI) over to a device
tree node and deletes the static mappings from the platform.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 52 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 6 |
2 files changed, 30 insertions, 28 deletions
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index a762712bc2f2..cc1d3fe21c4e 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -63,6 +63,8 @@ | |||
63 | 63 | ||
64 | /* Base address to the AP system controller */ | 64 | /* Base address to the AP system controller */ |
65 | void __iomem *ap_syscon_base; | 65 | void __iomem *ap_syscon_base; |
66 | /* Base address to the external bus interface */ | ||
67 | static void __iomem *ebi_base; | ||
66 | 68 | ||
67 | 69 | ||
68 | /* | 70 | /* |
@@ -73,13 +75,11 @@ void __iomem *ap_syscon_base; | |||
73 | * just for now). | 75 | * just for now). |
74 | */ | 76 | */ |
75 | #define VA_IC_BASE __io_address(INTEGRATOR_IC_BASE) | 77 | #define VA_IC_BASE __io_address(INTEGRATOR_IC_BASE) |
76 | #define VA_EBI_BASE __io_address(INTEGRATOR_EBI_BASE) | ||
77 | 78 | ||
78 | /* | 79 | /* |
79 | * Logical Physical | 80 | * Logical Physical |
80 | * ef000000 Cache flush | 81 | * ef000000 Cache flush |
81 | * f1100000 11000000 System controller registers | 82 | * f1100000 11000000 System controller registers |
82 | * f1200000 12000000 EBI registers | ||
83 | * f1300000 13000000 Counter/Timer | 83 | * f1300000 13000000 Counter/Timer |
84 | * f1400000 14000000 Interrupt controller | 84 | * f1400000 14000000 Interrupt controller |
85 | * f1600000 16000000 UART 0 | 85 | * f1600000 16000000 UART 0 |
@@ -90,11 +90,6 @@ void __iomem *ap_syscon_base; | |||
90 | 90 | ||
91 | static struct map_desc ap_io_desc[] __initdata __maybe_unused = { | 91 | static struct map_desc ap_io_desc[] __initdata __maybe_unused = { |
92 | { | 92 | { |
93 | .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE), | ||
94 | .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE), | ||
95 | .length = SZ_4K, | ||
96 | .type = MT_DEVICE | ||
97 | }, { | ||
98 | .virtual = IO_ADDRESS(INTEGRATOR_CT_BASE), | 93 | .virtual = IO_ADDRESS(INTEGRATOR_CT_BASE), |
99 | .pfn = __phys_to_pfn(INTEGRATOR_CT_BASE), | 94 | .pfn = __phys_to_pfn(INTEGRATOR_CT_BASE), |
100 | .length = SZ_4K, | 95 | .length = SZ_4K, |
@@ -168,9 +163,6 @@ device_initcall(irq_syscore_init); | |||
168 | /* | 163 | /* |
169 | * Flash handling. | 164 | * Flash handling. |
170 | */ | 165 | */ |
171 | #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET) | ||
172 | #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) | ||
173 | |||
174 | static int ap_flash_init(struct platform_device *dev) | 166 | static int ap_flash_init(struct platform_device *dev) |
175 | { | 167 | { |
176 | u32 tmp; | 168 | u32 tmp; |
@@ -178,13 +170,15 @@ static int ap_flash_init(struct platform_device *dev) | |||
178 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, | 170 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, |
179 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); | 171 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); |
180 | 172 | ||
181 | tmp = readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE; | 173 | tmp = readl(ebi_base + INTEGRATOR_EBI_CSR1_OFFSET) | |
182 | writel(tmp, EBI_CSR1); | 174 | INTEGRATOR_EBI_WRITE_ENABLE; |
175 | writel(tmp, ebi_base + INTEGRATOR_EBI_CSR1_OFFSET); | ||
183 | 176 | ||
184 | if (!(readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE)) { | 177 | if (!(readl(ebi_base + INTEGRATOR_EBI_CSR1_OFFSET) |
185 | writel(0xa05f, EBI_LOCK); | 178 | & INTEGRATOR_EBI_WRITE_ENABLE)) { |
186 | writel(tmp, EBI_CSR1); | 179 | writel(0xa05f, ebi_base + INTEGRATOR_EBI_LOCK_OFFSET); |
187 | writel(0, EBI_LOCK); | 180 | writel(tmp, ebi_base + INTEGRATOR_EBI_CSR1_OFFSET); |
181 | writel(0, ebi_base + INTEGRATOR_EBI_LOCK_OFFSET); | ||
188 | } | 182 | } |
189 | return 0; | 183 | return 0; |
190 | } | 184 | } |
@@ -196,13 +190,15 @@ static void ap_flash_exit(struct platform_device *dev) | |||
196 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, | 190 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, |
197 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); | 191 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); |
198 | 192 | ||
199 | tmp = readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE; | 193 | tmp = readl(ebi_base + INTEGRATOR_EBI_CSR1_OFFSET) & |
200 | writel(tmp, EBI_CSR1); | 194 | ~INTEGRATOR_EBI_WRITE_ENABLE; |
195 | writel(tmp, ebi_base + INTEGRATOR_EBI_CSR1_OFFSET); | ||
201 | 196 | ||
202 | if (readl(EBI_CSR1) & INTEGRATOR_EBI_WRITE_ENABLE) { | 197 | if (readl(ebi_base + INTEGRATOR_EBI_CSR1_OFFSET) & |
203 | writel(0xa05f, EBI_LOCK); | 198 | INTEGRATOR_EBI_WRITE_ENABLE) { |
204 | writel(tmp, EBI_CSR1); | 199 | writel(0xa05f, ebi_base + INTEGRATOR_EBI_LOCK_OFFSET); |
205 | writel(0, EBI_LOCK); | 200 | writel(tmp, ebi_base + INTEGRATOR_EBI_CSR1_OFFSET); |
201 | writel(0, ebi_base + INTEGRATOR_EBI_LOCK_OFFSET); | ||
206 | } | 202 | } |
207 | } | 203 | } |
208 | 204 | ||
@@ -469,11 +465,17 @@ static const struct of_device_id ap_syscon_match[] = { | |||
469 | { }, | 465 | { }, |
470 | }; | 466 | }; |
471 | 467 | ||
468 | static const struct of_device_id ebi_match[] = { | ||
469 | { .compatible = "arm,external-bus-interface"}, | ||
470 | { }, | ||
471 | }; | ||
472 | |||
472 | static void __init ap_init_of(void) | 473 | static void __init ap_init_of(void) |
473 | { | 474 | { |
474 | unsigned long sc_dec; | 475 | unsigned long sc_dec; |
475 | struct device_node *root; | 476 | struct device_node *root; |
476 | struct device_node *syscon; | 477 | struct device_node *syscon; |
478 | struct device_node *ebi; | ||
477 | struct device *parent; | 479 | struct device *parent; |
478 | struct soc_device *soc_dev; | 480 | struct soc_device *soc_dev; |
479 | struct soc_device_attribute *soc_dev_attr; | 481 | struct soc_device_attribute *soc_dev_attr; |
@@ -489,10 +491,16 @@ static void __init ap_init_of(void) | |||
489 | syscon = of_find_matching_node(root, ap_syscon_match); | 491 | syscon = of_find_matching_node(root, ap_syscon_match); |
490 | if (!syscon) | 492 | if (!syscon) |
491 | return; | 493 | return; |
494 | ebi = of_find_matching_node(root, ebi_match); | ||
495 | if (!ebi) | ||
496 | return; | ||
492 | 497 | ||
493 | ap_syscon_base = of_iomap(syscon, 0); | 498 | ap_syscon_base = of_iomap(syscon, 0); |
494 | if (!ap_syscon_base) | 499 | if (!ap_syscon_base) |
495 | return; | 500 | return; |
501 | ebi_base = of_iomap(ebi, 0); | ||
502 | if (!ebi_base) | ||
503 | return; | ||
496 | 504 | ||
497 | ap_sc_id = readl(ap_syscon_base); | 505 | ap_sc_id = readl(ap_syscon_base); |
498 | 506 | ||
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 916c0f345a3a..5e84149d1790 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -64,7 +64,6 @@ static void __iomem *intcp_con_base; | |||
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Logical Physical | 66 | * Logical Physical |
67 | * f1200000 12000000 EBI registers | ||
68 | * f1300000 13000000 Counter/Timer | 67 | * f1300000 13000000 Counter/Timer |
69 | * f1400000 14000000 Interrupt controller | 68 | * f1400000 14000000 Interrupt controller |
70 | * f1600000 16000000 UART 0 | 69 | * f1600000 16000000 UART 0 |
@@ -76,11 +75,6 @@ static void __iomem *intcp_con_base; | |||
76 | 75 | ||
77 | static struct map_desc intcp_io_desc[] __initdata __maybe_unused = { | 76 | static struct map_desc intcp_io_desc[] __initdata __maybe_unused = { |
78 | { | 77 | { |
79 | .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE), | ||
80 | .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE), | ||
81 | .length = SZ_4K, | ||
82 | .type = MT_DEVICE | ||
83 | }, { | ||
84 | .virtual = IO_ADDRESS(INTEGRATOR_CT_BASE), | 78 | .virtual = IO_ADDRESS(INTEGRATOR_CT_BASE), |
85 | .pfn = __phys_to_pfn(INTEGRATOR_CT_BASE), | 79 | .pfn = __phys_to_pfn(INTEGRATOR_CT_BASE), |
86 | .length = SZ_4K, | 80 | .length = SZ_4K, |