blob: a236925e13b308ed20e28936c9593cb42887f5ff [file] [log] [blame]
viresh kumarbc4e8142010-04-01 12:30:58 +01001/*
2 * arch/arm/mach-spear3xx/spear3xx.c
3 *
4 * SPEAr3XX machines common source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
Viresh Kumar5fb00f92012-03-26 10:39:43 +053014#define pr_fmt(fmt) "SPEAr3xx: " fmt
15
viresh kumarbc4e8142010-04-01 12:30:58 +010016#include <linux/types.h>
17#include <linux/amba/pl061.h>
18#include <linux/ptrace.h>
19#include <linux/io.h>
20#include <asm/hardware/vic.h>
21#include <asm/irq.h>
22#include <asm/mach/arch.h>
23#include <mach/generic.h>
viresh kumar02aa06b2011-03-07 05:57:02 +010024#include <mach/hardware.h>
viresh kumarbc4e8142010-04-01 12:30:58 +010025
26/* Add spear3xx machines common devices here */
Uwe Kleine-Königb5950762010-11-01 15:38:34 -040027/* gpio device registration */
viresh kumarbc4e8142010-04-01 12:30:58 +010028static struct pl061_platform_data gpio_plat_data = {
29 .gpio_base = 0,
Ryan Mallon61e72bc2011-05-20 08:34:21 +010030 .irq_base = SPEAR3XX_GPIO_INT_BASE,
viresh kumarbc4e8142010-04-01 12:30:58 +010031};
32
Russell Kingb5b654f2012-01-20 09:14:14 +000033AMBA_APB_DEVICE(spear3xx_gpio, "gpio", 0, SPEAR3XX_ICM3_GPIO_BASE,
34 {SPEAR3XX_IRQ_BASIC_GPIO}, &gpio_plat_data);
viresh kumarbc4e8142010-04-01 12:30:58 +010035
Uwe Kleine-Königb5950762010-11-01 15:38:34 -040036/* uart device registration */
Russell Kingb5b654f2012-01-20 09:14:14 +000037AMBA_APB_DEVICE(spear3xx_uart, "uart", 0, SPEAR3XX_ICM1_UART_BASE,
38 {SPEAR3XX_IRQ_UART}, NULL);
viresh kumarbc4e8142010-04-01 12:30:58 +010039
40/* Do spear3xx familiy common initialization part here */
41void __init spear3xx_init(void)
42{
43 /* nothing to do for now */
44}
45
46/* This will initialize vic */
47void __init spear3xx_init_irq(void)
48{
49 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
50}
51
52/* Following will create static virtual/physical mappings */
53struct map_desc spear3xx_io_desc[] __initdata = {
54 {
55 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
56 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
viresh kumar53821162011-03-07 05:57:06 +010057 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010058 .type = MT_DEVICE
59 }, {
60 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
61 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
viresh kumar53821162011-03-07 05:57:06 +010062 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010063 .type = MT_DEVICE
64 }, {
65 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
66 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
viresh kumar53821162011-03-07 05:57:06 +010067 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010068 .type = MT_DEVICE
69 }, {
70 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
71 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
viresh kumar53821162011-03-07 05:57:06 +010072 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010073 .type = MT_DEVICE
74 },
75};
76
77/* This will create static memory mapping for selected devices */
78void __init spear3xx_map_io(void)
79{
80 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
81
82 /* This will initialize clock framework */
viresh kumarb997f6e2011-05-20 08:34:18 +010083 spear3xx_clk_init();
viresh kumarbc4e8142010-04-01 12:30:58 +010084}
viresh kumar70f4c0b2010-04-01 12:31:29 +010085
86/* pad multiplexing support */
87/* devices */
Ryan Mallon6618c3a2011-05-20 08:34:22 +010088static struct pmx_dev_mode pmx_firda_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +010089 {
90 .ids = 0xffffffff,
91 .mask = PMX_FIRDA_MASK,
92 },
93};
94
Ryan Mallon6618c3a2011-05-20 08:34:22 +010095struct pmx_dev spear3xx_pmx_firda = {
viresh kumar70f4c0b2010-04-01 12:31:29 +010096 .name = "firda",
97 .modes = pmx_firda_modes,
98 .mode_count = ARRAY_SIZE(pmx_firda_modes),
99 .enb_on_reset = 0,
100};
101
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100102static struct pmx_dev_mode pmx_i2c_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100103 {
104 .ids = 0xffffffff,
105 .mask = PMX_I2C_MASK,
106 },
107};
108
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100109struct pmx_dev spear3xx_pmx_i2c = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100110 .name = "i2c",
111 .modes = pmx_i2c_modes,
112 .mode_count = ARRAY_SIZE(pmx_i2c_modes),
113 .enb_on_reset = 0,
114};
115
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100116static struct pmx_dev_mode pmx_ssp_cs_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100117 {
118 .ids = 0xffffffff,
119 .mask = PMX_SSP_CS_MASK,
120 },
121};
122
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100123struct pmx_dev spear3xx_pmx_ssp_cs = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100124 .name = "ssp_chip_selects",
125 .modes = pmx_ssp_cs_modes,
126 .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes),
127 .enb_on_reset = 0,
128};
129
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100130static struct pmx_dev_mode pmx_ssp_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100131 {
132 .ids = 0xffffffff,
133 .mask = PMX_SSP_MASK,
134 },
135};
136
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100137struct pmx_dev spear3xx_pmx_ssp = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100138 .name = "ssp",
139 .modes = pmx_ssp_modes,
140 .mode_count = ARRAY_SIZE(pmx_ssp_modes),
141 .enb_on_reset = 0,
142};
143
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100144static struct pmx_dev_mode pmx_mii_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100145 {
146 .ids = 0xffffffff,
147 .mask = PMX_MII_MASK,
148 },
149};
150
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100151struct pmx_dev spear3xx_pmx_mii = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100152 .name = "mii",
153 .modes = pmx_mii_modes,
154 .mode_count = ARRAY_SIZE(pmx_mii_modes),
155 .enb_on_reset = 0,
156};
157
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100158static struct pmx_dev_mode pmx_gpio_pin0_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100159 {
160 .ids = 0xffffffff,
161 .mask = PMX_GPIO_PIN0_MASK,
162 },
163};
164
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100165struct pmx_dev spear3xx_pmx_gpio_pin0 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100166 .name = "gpio_pin0",
167 .modes = pmx_gpio_pin0_modes,
168 .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes),
169 .enb_on_reset = 0,
170};
171
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100172static struct pmx_dev_mode pmx_gpio_pin1_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100173 {
174 .ids = 0xffffffff,
175 .mask = PMX_GPIO_PIN1_MASK,
176 },
177};
178
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100179struct pmx_dev spear3xx_pmx_gpio_pin1 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100180 .name = "gpio_pin1",
181 .modes = pmx_gpio_pin1_modes,
182 .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes),
183 .enb_on_reset = 0,
184};
185
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100186static struct pmx_dev_mode pmx_gpio_pin2_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100187 {
188 .ids = 0xffffffff,
189 .mask = PMX_GPIO_PIN2_MASK,
190 },
191};
192
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100193struct pmx_dev spear3xx_pmx_gpio_pin2 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100194 .name = "gpio_pin2",
195 .modes = pmx_gpio_pin2_modes,
196 .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes),
197 .enb_on_reset = 0,
198};
199
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100200static struct pmx_dev_mode pmx_gpio_pin3_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100201 {
202 .ids = 0xffffffff,
203 .mask = PMX_GPIO_PIN3_MASK,
204 },
205};
206
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100207struct pmx_dev spear3xx_pmx_gpio_pin3 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100208 .name = "gpio_pin3",
209 .modes = pmx_gpio_pin3_modes,
210 .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes),
211 .enb_on_reset = 0,
212};
213
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100214static struct pmx_dev_mode pmx_gpio_pin4_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100215 {
216 .ids = 0xffffffff,
217 .mask = PMX_GPIO_PIN4_MASK,
218 },
219};
220
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100221struct pmx_dev spear3xx_pmx_gpio_pin4 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100222 .name = "gpio_pin4",
223 .modes = pmx_gpio_pin4_modes,
224 .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes),
225 .enb_on_reset = 0,
226};
227
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100228static struct pmx_dev_mode pmx_gpio_pin5_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100229 {
230 .ids = 0xffffffff,
231 .mask = PMX_GPIO_PIN5_MASK,
232 },
233};
234
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100235struct pmx_dev spear3xx_pmx_gpio_pin5 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100236 .name = "gpio_pin5",
237 .modes = pmx_gpio_pin5_modes,
238 .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes),
239 .enb_on_reset = 0,
240};
241
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100242static struct pmx_dev_mode pmx_uart0_modem_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100243 {
244 .ids = 0xffffffff,
245 .mask = PMX_UART0_MODEM_MASK,
246 },
247};
248
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100249struct pmx_dev spear3xx_pmx_uart0_modem = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100250 .name = "uart0_modem",
251 .modes = pmx_uart0_modem_modes,
252 .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes),
253 .enb_on_reset = 0,
254};
255
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100256static struct pmx_dev_mode pmx_uart0_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100257 {
258 .ids = 0xffffffff,
259 .mask = PMX_UART0_MASK,
260 },
261};
262
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100263struct pmx_dev spear3xx_pmx_uart0 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100264 .name = "uart0",
265 .modes = pmx_uart0_modes,
266 .mode_count = ARRAY_SIZE(pmx_uart0_modes),
267 .enb_on_reset = 0,
268};
269
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100270static struct pmx_dev_mode pmx_timer_3_4_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100271 {
272 .ids = 0xffffffff,
273 .mask = PMX_TIMER_3_4_MASK,
274 },
275};
276
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100277struct pmx_dev spear3xx_pmx_timer_3_4 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100278 .name = "timer_3_4",
279 .modes = pmx_timer_3_4_modes,
280 .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes),
281 .enb_on_reset = 0,
282};
283
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100284static struct pmx_dev_mode pmx_timer_1_2_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100285 {
286 .ids = 0xffffffff,
287 .mask = PMX_TIMER_1_2_MASK,
288 },
289};
290
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100291struct pmx_dev spear3xx_pmx_timer_1_2 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100292 .name = "timer_1_2",
293 .modes = pmx_timer_1_2_modes,
294 .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes),
295 .enb_on_reset = 0,
296};
297
298#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
299/* plgpios devices */
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100300static struct pmx_dev_mode pmx_plgpio_0_1_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100301 {
302 .ids = 0x00,
303 .mask = PMX_FIRDA_MASK,
304 },
305};
306
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100307struct pmx_dev spear3xx_pmx_plgpio_0_1 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100308 .name = "plgpio 0 and 1",
309 .modes = pmx_plgpio_0_1_modes,
310 .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes),
311 .enb_on_reset = 1,
312};
313
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100314static struct pmx_dev_mode pmx_plgpio_2_3_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100315 {
316 .ids = 0x00,
317 .mask = PMX_UART0_MASK,
318 },
319};
320
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100321struct pmx_dev spear3xx_pmx_plgpio_2_3 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100322 .name = "plgpio 2 and 3",
323 .modes = pmx_plgpio_2_3_modes,
324 .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes),
325 .enb_on_reset = 1,
326};
327
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100328static struct pmx_dev_mode pmx_plgpio_4_5_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100329 {
330 .ids = 0x00,
331 .mask = PMX_I2C_MASK,
332 },
333};
334
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100335struct pmx_dev spear3xx_pmx_plgpio_4_5 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100336 .name = "plgpio 4 and 5",
337 .modes = pmx_plgpio_4_5_modes,
338 .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes),
339 .enb_on_reset = 1,
340};
341
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100342static struct pmx_dev_mode pmx_plgpio_6_9_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100343 {
344 .ids = 0x00,
345 .mask = PMX_SSP_MASK,
346 },
347};
348
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100349struct pmx_dev spear3xx_pmx_plgpio_6_9 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100350 .name = "plgpio 6 to 9",
351 .modes = pmx_plgpio_6_9_modes,
352 .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes),
353 .enb_on_reset = 1,
354};
355
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100356static struct pmx_dev_mode pmx_plgpio_10_27_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100357 {
358 .ids = 0x00,
359 .mask = PMX_MII_MASK,
360 },
361};
362
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100363struct pmx_dev spear3xx_pmx_plgpio_10_27 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100364 .name = "plgpio 10 to 27",
365 .modes = pmx_plgpio_10_27_modes,
366 .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes),
367 .enb_on_reset = 1,
368};
369
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100370static struct pmx_dev_mode pmx_plgpio_28_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100371 {
372 .ids = 0x00,
373 .mask = PMX_GPIO_PIN0_MASK,
374 },
375};
376
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100377struct pmx_dev spear3xx_pmx_plgpio_28 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100378 .name = "plgpio 28",
379 .modes = pmx_plgpio_28_modes,
380 .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes),
381 .enb_on_reset = 1,
382};
383
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100384static struct pmx_dev_mode pmx_plgpio_29_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100385 {
386 .ids = 0x00,
387 .mask = PMX_GPIO_PIN1_MASK,
388 },
389};
390
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100391struct pmx_dev spear3xx_pmx_plgpio_29 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100392 .name = "plgpio 29",
393 .modes = pmx_plgpio_29_modes,
394 .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes),
395 .enb_on_reset = 1,
396};
397
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100398static struct pmx_dev_mode pmx_plgpio_30_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100399 {
400 .ids = 0x00,
401 .mask = PMX_GPIO_PIN2_MASK,
402 },
403};
404
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100405struct pmx_dev spear3xx_pmx_plgpio_30 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100406 .name = "plgpio 30",
407 .modes = pmx_plgpio_30_modes,
408 .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes),
409 .enb_on_reset = 1,
410};
411
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100412static struct pmx_dev_mode pmx_plgpio_31_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100413 {
414 .ids = 0x00,
415 .mask = PMX_GPIO_PIN3_MASK,
416 },
417};
418
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100419struct pmx_dev spear3xx_pmx_plgpio_31 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100420 .name = "plgpio 31",
421 .modes = pmx_plgpio_31_modes,
422 .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes),
423 .enb_on_reset = 1,
424};
425
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100426static struct pmx_dev_mode pmx_plgpio_32_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100427 {
428 .ids = 0x00,
429 .mask = PMX_GPIO_PIN4_MASK,
430 },
431};
432
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100433struct pmx_dev spear3xx_pmx_plgpio_32 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100434 .name = "plgpio 32",
435 .modes = pmx_plgpio_32_modes,
436 .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes),
437 .enb_on_reset = 1,
438};
439
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100440static struct pmx_dev_mode pmx_plgpio_33_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100441 {
442 .ids = 0x00,
443 .mask = PMX_GPIO_PIN5_MASK,
444 },
445};
446
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100447struct pmx_dev spear3xx_pmx_plgpio_33 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100448 .name = "plgpio 33",
449 .modes = pmx_plgpio_33_modes,
450 .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes),
451 .enb_on_reset = 1,
452};
453
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100454static struct pmx_dev_mode pmx_plgpio_34_36_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100455 {
456 .ids = 0x00,
457 .mask = PMX_SSP_CS_MASK,
458 },
459};
460
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100461struct pmx_dev spear3xx_pmx_plgpio_34_36 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100462 .name = "plgpio 34 to 36",
463 .modes = pmx_plgpio_34_36_modes,
464 .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes),
465 .enb_on_reset = 1,
466};
467
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100468static struct pmx_dev_mode pmx_plgpio_37_42_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100469 {
470 .ids = 0x00,
471 .mask = PMX_UART0_MODEM_MASK,
472 },
473};
474
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100475struct pmx_dev spear3xx_pmx_plgpio_37_42 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100476 .name = "plgpio 37 to 42",
477 .modes = pmx_plgpio_37_42_modes,
478 .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes),
479 .enb_on_reset = 1,
480};
481
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100482static struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100483 {
484 .ids = 0x00,
485 .mask = PMX_TIMER_1_2_MASK,
486 },
487};
488
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100489struct pmx_dev spear3xx_pmx_plgpio_43_44_47_48 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100490 .name = "plgpio 43, 44, 47 and 48",
491 .modes = pmx_plgpio_43_44_47_48_modes,
492 .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes),
493 .enb_on_reset = 1,
494};
495
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100496static struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100497 {
498 .ids = 0x00,
499 .mask = PMX_TIMER_3_4_MASK,
500 },
501};
502
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100503struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100504 .name = "plgpio 45, 46, 49 and 50",
505 .modes = pmx_plgpio_45_46_49_50_modes,
506 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
507 .enb_on_reset = 1,
508};
Shiraz Hashim5c881d92011-02-16 07:40:32 +0100509#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
viresh kumar70f4c0b2010-04-01 12:31:29 +0100510
Shiraz Hashim5c881d92011-02-16 07:40:32 +0100511static void __init spear3xx_timer_init(void)
512{
513 char pclk_name[] = "pll3_48m_clk";
514 struct clk *gpt_clk, *pclk;
515
516 /* get the system timer clock */
517 gpt_clk = clk_get_sys("gpt0", NULL);
518 if (IS_ERR(gpt_clk)) {
519 pr_err("%s:couldn't get clk for gpt\n", __func__);
520 BUG();
521 }
522
523 /* get the suitable parent clock for timer*/
524 pclk = clk_get(NULL, pclk_name);
525 if (IS_ERR(pclk)) {
526 pr_err("%s:couldn't get %s as parent for gpt\n",
527 __func__, pclk_name);
528 BUG();
529 }
530
531 clk_set_parent(gpt_clk, pclk);
532 clk_put(gpt_clk);
533 clk_put(pclk);
534
535 spear_setup_timer();
536}
537
538struct sys_timer spear3xx_timer = {
539 .init = spear3xx_timer_init,
540};