aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-nomadik/cpu-8815.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-01-05 20:25:20 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-01-28 17:25:37 -0500
commit5f66d482af4e12e2a2d4cda0686820550b80ac8e (patch)
tree470a6f640ebce8a7e59923ba860b2a8549c7170f /arch/arm/mach-nomadik/cpu-8815.c
parent09e02f4d1d3ba6e5ccfada24162817d00e4675bc (diff)
ARM: nomadik: delete old board files
The Device Tree support on Nomadik can do everything the old board files could do, so delete the old board files and make the nomadik select CONFIG_OF. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-nomadik/cpu-8815.c')
-rw-r--r--arch/arm/mach-nomadik/cpu-8815.c112
1 files changed, 2 insertions, 110 deletions
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 5ad301e4eb2f..60a18e12e6ce 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -48,53 +48,6 @@
48#include <asm/cacheflush.h> 48#include <asm/cacheflush.h>
49#include <asm/hardware/cache-l2x0.h> 49#include <asm/hardware/cache-l2x0.h>
50 50
51#include "cpu-8815.h"
52
53/* The 8815 has 4 GPIO blocks, let's register them immediately */
54static resource_size_t __initdata cpu8815_gpio_base[] = {
55 NOMADIK_GPIO0_BASE,
56 NOMADIK_GPIO1_BASE,
57 NOMADIK_GPIO2_BASE,
58 NOMADIK_GPIO3_BASE,
59};
60
61static struct platform_device *
62cpu8815_add_gpio(int id, resource_size_t addr, int irq,
63 struct nmk_gpio_platform_data *pdata)
64{
65 struct resource resources[] = {
66 {
67 .start = addr,
68 .end = addr + 127,
69 .flags = IORESOURCE_MEM,
70 },
71 {
72 .start = irq,
73 .end = irq,
74 .flags = IORESOURCE_IRQ,
75 }
76 };
77
78 return platform_device_register_resndata(NULL, "gpio", id,
79 resources, ARRAY_SIZE(resources),
80 pdata, sizeof(*pdata));
81}
82
83void cpu8815_add_gpios(resource_size_t *base, int num, int irq,
84 struct nmk_gpio_platform_data *pdata)
85{
86 int first = 0;
87 int i;
88
89 for (i = 0; i < num; i++, first += 32, irq++) {
90 pdata->first_gpio = first;
91 pdata->first_irq = NOMADIK_GPIO_TO_IRQ(first);
92 pdata->num_gpio = 32;
93
94 cpu8815_add_gpio(i, base[i], irq, pdata);
95 }
96}
97
98static unsigned long out_low[] = { PIN_OUTPUT_LOW }; 51static unsigned long out_low[] = { PIN_OUTPUT_LOW };
99static unsigned long out_high[] = { PIN_OUTPUT_HIGH }; 52static unsigned long out_high[] = { PIN_OUTPUT_HIGH };
100static unsigned long in_nopull[] = { PIN_INPUT_NOPULL }; 53static unsigned long in_nopull[] = { PIN_INPUT_NOPULL };
@@ -137,38 +90,6 @@ static struct pinctrl_map __initdata nhk8815_pinmap[] = {
137 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup), 90 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-stn8815", "GPIO74_C20", in_pullup),
138}; 91};
139 92
140static inline void
141cpu8815_add_pinctrl(struct device *parent, const char *name)
142{
143 struct platform_device_info pdevinfo = {
144 .parent = parent,
145 .name = name,
146 .id = -1,
147 };
148
149 pinctrl_register_mappings(nhk8815_pinmap, ARRAY_SIZE(nhk8815_pinmap));
150 platform_device_register_full(&pdevinfo);
151}
152
153static int __init cpu8815_init(void)
154{
155 struct nmk_gpio_platform_data pdata = {
156 /* No custom data yet */
157 };
158
159 /* For e.g. device tree boots */
160 if (!machine_is_nomadik())
161 return 0;
162
163 cpu8815_add_gpios(cpu8815_gpio_base, ARRAY_SIZE(cpu8815_gpio_base),
164 IRQ_GPIO0, &pdata);
165 cpu8815_add_pinctrl(NULL, "pinctrl-stn8815");
166 amba_apb_device_add(NULL, "rng", NOMADIK_RNG_BASE, SZ_4K, 0, 0, NULL, 0);
167 amba_apb_device_add(NULL, "rtc-pl031", NOMADIK_RTC_BASE, SZ_4K, IRQ_RTC_RTT, 0, NULL, 0);
168 return 0;
169}
170arch_initcall(cpu8815_init);
171
172/* All SoC devices live in the same area (see hardware.h) */ 93/* All SoC devices live in the same area (see hardware.h) */
173static struct map_desc nomadik_io_desc[] __initdata = { 94static struct map_desc nomadik_io_desc[] __initdata = {
174 { 95 {
@@ -180,37 +101,12 @@ static struct map_desc nomadik_io_desc[] __initdata = {
180 /* static ram and secured ram may be added later */ 101 /* static ram and secured ram may be added later */
181}; 102};
182 103
183void __init cpu8815_map_io(void) 104static void __init cpu8815_map_io(void)
184{ 105{
185 iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc)); 106 iotable_init(nomadik_io_desc, ARRAY_SIZE(nomadik_io_desc));
186} 107}
187 108
188void __init cpu8815_init_irq(void) 109static void cpu8815_restart(char mode, const char *cmd)
189{
190 /* This modified VIC cell has two register blocks, at 0 and 0x20 */
191 vic_init(io_p2v(NOMADIK_IC_BASE + 0x00), IRQ_VIC_START + 0, ~0, 0);
192 vic_init(io_p2v(NOMADIK_IC_BASE + 0x20), IRQ_VIC_START + 32, ~0, 0);
193
194 /*
195 * Init clocks here so that they are available for system timer
196 * initialization.
197 */
198 nomadik_clk_init();
199}
200
201/*
202 * This function is called from the board init ("init_machine").
203 */
204 void __init cpu8815_platform_init(void)
205{
206#ifdef CONFIG_CACHE_L2X0
207 /* At full speed latency must be >=2, so 0x249 in low bits */
208 l2x0_init(io_p2v(NOMADIK_L2CC_BASE), 0x00730249, 0xfe000fff);
209#endif
210 return;
211}
212
213void cpu8815_restart(char mode, const char *cmd)
214{ 110{
215 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18); 111 void __iomem *src_rstsr = io_p2v(NOMADIK_SRC_BASE + 0x18);
216 112
@@ -220,8 +116,6 @@ void cpu8815_restart(char mode, const char *cmd)
220 writel(1, src_rstsr); 116 writel(1, src_rstsr);
221} 117}
222 118
223#ifdef CONFIG_OF
224
225/* Initial value for SRC control register: all timers use MXTAL/8 source */ 119/* Initial value for SRC control register: all timers use MXTAL/8 source */
226#define SRC_CR_INIT_MASK 0x00007fff 120#define SRC_CR_INIT_MASK 0x00007fff
227#define SRC_CR_INIT_VAL 0x2aaa8000 121#define SRC_CR_INIT_VAL 0x2aaa8000
@@ -393,5 +287,3 @@ DT_MACHINE_START(NOMADIK_DT, "Nomadik STn8815")
393 .restart = cpu8815_restart, 287 .restart = cpu8815_restart,
394 .dt_compat = cpu8815_board_compat, 288 .dt_compat = cpu8815_board_compat,
395MACHINE_END 289MACHINE_END
396
397#endif