blob: b1733c37f209d2f1d96f482d8aa2b9a2e5c3c397 [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
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <linux/io.h>
18#include <asm/hardware/vic.h>
19#include <asm/irq.h>
20#include <asm/mach/arch.h>
21#include <mach/generic.h>
viresh kumar02aa06b2011-03-07 05:57:02 +010022#include <mach/hardware.h>
viresh kumarbc4e8142010-04-01 12:30:58 +010023
24/* Add spear3xx machines common devices here */
Uwe Kleine-Königb5950762010-11-01 15:38:34 -040025/* gpio device registration */
viresh kumarbc4e8142010-04-01 12:30:58 +010026static struct pl061_platform_data gpio_plat_data = {
27 .gpio_base = 0,
Ryan Mallon61e72bc2011-05-20 08:34:21 +010028 .irq_base = SPEAR3XX_GPIO_INT_BASE,
viresh kumarbc4e8142010-04-01 12:30:58 +010029};
30
Russell Kingb5b654f2012-01-20 09:14:14 +000031AMBA_APB_DEVICE(spear3xx_gpio, "gpio", 0, SPEAR3XX_ICM3_GPIO_BASE,
32 {SPEAR3XX_IRQ_BASIC_GPIO}, &gpio_plat_data);
viresh kumarbc4e8142010-04-01 12:30:58 +010033
Uwe Kleine-Königb5950762010-11-01 15:38:34 -040034/* uart device registration */
Russell Kingb5b654f2012-01-20 09:14:14 +000035AMBA_APB_DEVICE(spear3xx_uart, "uart", 0, SPEAR3XX_ICM1_UART_BASE,
36 {SPEAR3XX_IRQ_UART}, NULL);
viresh kumarbc4e8142010-04-01 12:30:58 +010037
38/* Do spear3xx familiy common initialization part here */
39void __init spear3xx_init(void)
40{
41 /* nothing to do for now */
42}
43
44/* This will initialize vic */
45void __init spear3xx_init_irq(void)
46{
47 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
48}
49
50/* Following will create static virtual/physical mappings */
51struct map_desc spear3xx_io_desc[] __initdata = {
52 {
53 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
54 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
viresh kumar53821162011-03-07 05:57:06 +010055 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010056 .type = MT_DEVICE
57 }, {
58 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
59 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
viresh kumar53821162011-03-07 05:57:06 +010060 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010061 .type = MT_DEVICE
62 }, {
63 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
64 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
viresh kumar53821162011-03-07 05:57:06 +010065 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010066 .type = MT_DEVICE
67 }, {
68 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
69 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
viresh kumar53821162011-03-07 05:57:06 +010070 .length = SZ_4K,
viresh kumarbc4e8142010-04-01 12:30:58 +010071 .type = MT_DEVICE
72 },
73};
74
75/* This will create static memory mapping for selected devices */
76void __init spear3xx_map_io(void)
77{
78 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
79
80 /* This will initialize clock framework */
viresh kumarb997f6e2011-05-20 08:34:18 +010081 spear3xx_clk_init();
viresh kumarbc4e8142010-04-01 12:30:58 +010082}
viresh kumar70f4c0b2010-04-01 12:31:29 +010083
84/* pad multiplexing support */
85/* devices */
Ryan Mallon6618c3a2011-05-20 08:34:22 +010086static struct pmx_dev_mode pmx_firda_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +010087 {
88 .ids = 0xffffffff,
89 .mask = PMX_FIRDA_MASK,
90 },
91};
92
Ryan Mallon6618c3a2011-05-20 08:34:22 +010093struct pmx_dev spear3xx_pmx_firda = {
viresh kumar70f4c0b2010-04-01 12:31:29 +010094 .name = "firda",
95 .modes = pmx_firda_modes,
96 .mode_count = ARRAY_SIZE(pmx_firda_modes),
97 .enb_on_reset = 0,
98};
99
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100100static struct pmx_dev_mode pmx_i2c_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100101 {
102 .ids = 0xffffffff,
103 .mask = PMX_I2C_MASK,
104 },
105};
106
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100107struct pmx_dev spear3xx_pmx_i2c = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100108 .name = "i2c",
109 .modes = pmx_i2c_modes,
110 .mode_count = ARRAY_SIZE(pmx_i2c_modes),
111 .enb_on_reset = 0,
112};
113
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100114static struct pmx_dev_mode pmx_ssp_cs_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100115 {
116 .ids = 0xffffffff,
117 .mask = PMX_SSP_CS_MASK,
118 },
119};
120
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100121struct pmx_dev spear3xx_pmx_ssp_cs = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100122 .name = "ssp_chip_selects",
123 .modes = pmx_ssp_cs_modes,
124 .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes),
125 .enb_on_reset = 0,
126};
127
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100128static struct pmx_dev_mode pmx_ssp_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100129 {
130 .ids = 0xffffffff,
131 .mask = PMX_SSP_MASK,
132 },
133};
134
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100135struct pmx_dev spear3xx_pmx_ssp = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100136 .name = "ssp",
137 .modes = pmx_ssp_modes,
138 .mode_count = ARRAY_SIZE(pmx_ssp_modes),
139 .enb_on_reset = 0,
140};
141
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100142static struct pmx_dev_mode pmx_mii_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100143 {
144 .ids = 0xffffffff,
145 .mask = PMX_MII_MASK,
146 },
147};
148
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100149struct pmx_dev spear3xx_pmx_mii = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100150 .name = "mii",
151 .modes = pmx_mii_modes,
152 .mode_count = ARRAY_SIZE(pmx_mii_modes),
153 .enb_on_reset = 0,
154};
155
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100156static struct pmx_dev_mode pmx_gpio_pin0_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100157 {
158 .ids = 0xffffffff,
159 .mask = PMX_GPIO_PIN0_MASK,
160 },
161};
162
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100163struct pmx_dev spear3xx_pmx_gpio_pin0 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100164 .name = "gpio_pin0",
165 .modes = pmx_gpio_pin0_modes,
166 .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes),
167 .enb_on_reset = 0,
168};
169
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100170static struct pmx_dev_mode pmx_gpio_pin1_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100171 {
172 .ids = 0xffffffff,
173 .mask = PMX_GPIO_PIN1_MASK,
174 },
175};
176
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100177struct pmx_dev spear3xx_pmx_gpio_pin1 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100178 .name = "gpio_pin1",
179 .modes = pmx_gpio_pin1_modes,
180 .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes),
181 .enb_on_reset = 0,
182};
183
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100184static struct pmx_dev_mode pmx_gpio_pin2_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100185 {
186 .ids = 0xffffffff,
187 .mask = PMX_GPIO_PIN2_MASK,
188 },
189};
190
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100191struct pmx_dev spear3xx_pmx_gpio_pin2 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100192 .name = "gpio_pin2",
193 .modes = pmx_gpio_pin2_modes,
194 .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes),
195 .enb_on_reset = 0,
196};
197
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100198static struct pmx_dev_mode pmx_gpio_pin3_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100199 {
200 .ids = 0xffffffff,
201 .mask = PMX_GPIO_PIN3_MASK,
202 },
203};
204
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100205struct pmx_dev spear3xx_pmx_gpio_pin3 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100206 .name = "gpio_pin3",
207 .modes = pmx_gpio_pin3_modes,
208 .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes),
209 .enb_on_reset = 0,
210};
211
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100212static struct pmx_dev_mode pmx_gpio_pin4_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100213 {
214 .ids = 0xffffffff,
215 .mask = PMX_GPIO_PIN4_MASK,
216 },
217};
218
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100219struct pmx_dev spear3xx_pmx_gpio_pin4 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100220 .name = "gpio_pin4",
221 .modes = pmx_gpio_pin4_modes,
222 .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes),
223 .enb_on_reset = 0,
224};
225
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100226static struct pmx_dev_mode pmx_gpio_pin5_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100227 {
228 .ids = 0xffffffff,
229 .mask = PMX_GPIO_PIN5_MASK,
230 },
231};
232
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100233struct pmx_dev spear3xx_pmx_gpio_pin5 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100234 .name = "gpio_pin5",
235 .modes = pmx_gpio_pin5_modes,
236 .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes),
237 .enb_on_reset = 0,
238};
239
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100240static struct pmx_dev_mode pmx_uart0_modem_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100241 {
242 .ids = 0xffffffff,
243 .mask = PMX_UART0_MODEM_MASK,
244 },
245};
246
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100247struct pmx_dev spear3xx_pmx_uart0_modem = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100248 .name = "uart0_modem",
249 .modes = pmx_uart0_modem_modes,
250 .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes),
251 .enb_on_reset = 0,
252};
253
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100254static struct pmx_dev_mode pmx_uart0_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100255 {
256 .ids = 0xffffffff,
257 .mask = PMX_UART0_MASK,
258 },
259};
260
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100261struct pmx_dev spear3xx_pmx_uart0 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100262 .name = "uart0",
263 .modes = pmx_uart0_modes,
264 .mode_count = ARRAY_SIZE(pmx_uart0_modes),
265 .enb_on_reset = 0,
266};
267
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100268static struct pmx_dev_mode pmx_timer_3_4_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100269 {
270 .ids = 0xffffffff,
271 .mask = PMX_TIMER_3_4_MASK,
272 },
273};
274
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100275struct pmx_dev spear3xx_pmx_timer_3_4 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100276 .name = "timer_3_4",
277 .modes = pmx_timer_3_4_modes,
278 .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes),
279 .enb_on_reset = 0,
280};
281
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100282static struct pmx_dev_mode pmx_timer_1_2_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100283 {
284 .ids = 0xffffffff,
285 .mask = PMX_TIMER_1_2_MASK,
286 },
287};
288
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100289struct pmx_dev spear3xx_pmx_timer_1_2 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100290 .name = "timer_1_2",
291 .modes = pmx_timer_1_2_modes,
292 .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes),
293 .enb_on_reset = 0,
294};
295
296#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
297/* plgpios devices */
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100298static struct pmx_dev_mode pmx_plgpio_0_1_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100299 {
300 .ids = 0x00,
301 .mask = PMX_FIRDA_MASK,
302 },
303};
304
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100305struct pmx_dev spear3xx_pmx_plgpio_0_1 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100306 .name = "plgpio 0 and 1",
307 .modes = pmx_plgpio_0_1_modes,
308 .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes),
309 .enb_on_reset = 1,
310};
311
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100312static struct pmx_dev_mode pmx_plgpio_2_3_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100313 {
314 .ids = 0x00,
315 .mask = PMX_UART0_MASK,
316 },
317};
318
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100319struct pmx_dev spear3xx_pmx_plgpio_2_3 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100320 .name = "plgpio 2 and 3",
321 .modes = pmx_plgpio_2_3_modes,
322 .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes),
323 .enb_on_reset = 1,
324};
325
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100326static struct pmx_dev_mode pmx_plgpio_4_5_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100327 {
328 .ids = 0x00,
329 .mask = PMX_I2C_MASK,
330 },
331};
332
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100333struct pmx_dev spear3xx_pmx_plgpio_4_5 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100334 .name = "plgpio 4 and 5",
335 .modes = pmx_plgpio_4_5_modes,
336 .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes),
337 .enb_on_reset = 1,
338};
339
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100340static struct pmx_dev_mode pmx_plgpio_6_9_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100341 {
342 .ids = 0x00,
343 .mask = PMX_SSP_MASK,
344 },
345};
346
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100347struct pmx_dev spear3xx_pmx_plgpio_6_9 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100348 .name = "plgpio 6 to 9",
349 .modes = pmx_plgpio_6_9_modes,
350 .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes),
351 .enb_on_reset = 1,
352};
353
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100354static struct pmx_dev_mode pmx_plgpio_10_27_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100355 {
356 .ids = 0x00,
357 .mask = PMX_MII_MASK,
358 },
359};
360
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100361struct pmx_dev spear3xx_pmx_plgpio_10_27 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100362 .name = "plgpio 10 to 27",
363 .modes = pmx_plgpio_10_27_modes,
364 .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes),
365 .enb_on_reset = 1,
366};
367
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100368static struct pmx_dev_mode pmx_plgpio_28_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100369 {
370 .ids = 0x00,
371 .mask = PMX_GPIO_PIN0_MASK,
372 },
373};
374
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100375struct pmx_dev spear3xx_pmx_plgpio_28 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100376 .name = "plgpio 28",
377 .modes = pmx_plgpio_28_modes,
378 .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes),
379 .enb_on_reset = 1,
380};
381
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100382static struct pmx_dev_mode pmx_plgpio_29_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100383 {
384 .ids = 0x00,
385 .mask = PMX_GPIO_PIN1_MASK,
386 },
387};
388
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100389struct pmx_dev spear3xx_pmx_plgpio_29 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100390 .name = "plgpio 29",
391 .modes = pmx_plgpio_29_modes,
392 .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes),
393 .enb_on_reset = 1,
394};
395
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100396static struct pmx_dev_mode pmx_plgpio_30_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100397 {
398 .ids = 0x00,
399 .mask = PMX_GPIO_PIN2_MASK,
400 },
401};
402
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100403struct pmx_dev spear3xx_pmx_plgpio_30 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100404 .name = "plgpio 30",
405 .modes = pmx_plgpio_30_modes,
406 .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes),
407 .enb_on_reset = 1,
408};
409
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100410static struct pmx_dev_mode pmx_plgpio_31_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100411 {
412 .ids = 0x00,
413 .mask = PMX_GPIO_PIN3_MASK,
414 },
415};
416
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100417struct pmx_dev spear3xx_pmx_plgpio_31 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100418 .name = "plgpio 31",
419 .modes = pmx_plgpio_31_modes,
420 .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes),
421 .enb_on_reset = 1,
422};
423
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100424static struct pmx_dev_mode pmx_plgpio_32_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100425 {
426 .ids = 0x00,
427 .mask = PMX_GPIO_PIN4_MASK,
428 },
429};
430
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100431struct pmx_dev spear3xx_pmx_plgpio_32 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100432 .name = "plgpio 32",
433 .modes = pmx_plgpio_32_modes,
434 .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes),
435 .enb_on_reset = 1,
436};
437
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100438static struct pmx_dev_mode pmx_plgpio_33_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100439 {
440 .ids = 0x00,
441 .mask = PMX_GPIO_PIN5_MASK,
442 },
443};
444
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100445struct pmx_dev spear3xx_pmx_plgpio_33 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100446 .name = "plgpio 33",
447 .modes = pmx_plgpio_33_modes,
448 .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes),
449 .enb_on_reset = 1,
450};
451
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100452static struct pmx_dev_mode pmx_plgpio_34_36_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100453 {
454 .ids = 0x00,
455 .mask = PMX_SSP_CS_MASK,
456 },
457};
458
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100459struct pmx_dev spear3xx_pmx_plgpio_34_36 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100460 .name = "plgpio 34 to 36",
461 .modes = pmx_plgpio_34_36_modes,
462 .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes),
463 .enb_on_reset = 1,
464};
465
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100466static struct pmx_dev_mode pmx_plgpio_37_42_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100467 {
468 .ids = 0x00,
469 .mask = PMX_UART0_MODEM_MASK,
470 },
471};
472
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100473struct pmx_dev spear3xx_pmx_plgpio_37_42 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100474 .name = "plgpio 37 to 42",
475 .modes = pmx_plgpio_37_42_modes,
476 .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes),
477 .enb_on_reset = 1,
478};
479
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100480static struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100481 {
482 .ids = 0x00,
483 .mask = PMX_TIMER_1_2_MASK,
484 },
485};
486
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100487struct pmx_dev spear3xx_pmx_plgpio_43_44_47_48 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100488 .name = "plgpio 43, 44, 47 and 48",
489 .modes = pmx_plgpio_43_44_47_48_modes,
490 .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes),
491 .enb_on_reset = 1,
492};
493
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100494static struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100495 {
496 .ids = 0x00,
497 .mask = PMX_TIMER_3_4_MASK,
498 },
499};
500
Ryan Mallon6618c3a2011-05-20 08:34:22 +0100501struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50 = {
viresh kumar70f4c0b2010-04-01 12:31:29 +0100502 .name = "plgpio 45, 46, 49 and 50",
503 .modes = pmx_plgpio_45_46_49_50_modes,
504 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
505 .enb_on_reset = 1,
506};
Shiraz Hashim5c881d92011-02-16 07:40:32 +0100507#endif /* CONFIG_MACH_SPEAR310 || CONFIG_MACH_SPEAR320 */
viresh kumar70f4c0b2010-04-01 12:31:29 +0100508
Shiraz Hashim5c881d92011-02-16 07:40:32 +0100509static void __init spear3xx_timer_init(void)
510{
511 char pclk_name[] = "pll3_48m_clk";
512 struct clk *gpt_clk, *pclk;
513
514 /* get the system timer clock */
515 gpt_clk = clk_get_sys("gpt0", NULL);
516 if (IS_ERR(gpt_clk)) {
517 pr_err("%s:couldn't get clk for gpt\n", __func__);
518 BUG();
519 }
520
521 /* get the suitable parent clock for timer*/
522 pclk = clk_get(NULL, pclk_name);
523 if (IS_ERR(pclk)) {
524 pr_err("%s:couldn't get %s as parent for gpt\n",
525 __func__, pclk_name);
526 BUG();
527 }
528
529 clk_set_parent(gpt_clk, pclk);
530 clk_put(gpt_clk);
531 clk_put(pclk);
532
533 spear_setup_timer();
534}
535
536struct sys_timer spear3xx_timer = {
537 .init = spear3xx_timer_init,
538};