blob: def25581b7dae2b82e10c9010e7d9d62ebdb682d [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/regulator/machine.h>
17#include <linux/regulator/consumer.h>
18#include <mach/irqs.h>
19#include <mach/dma.h>
20#include <asm/mach/mmc.h>
21#include <asm/clkdev.h>
22#include <linux/msm_kgsl.h>
23#include <linux/msm_rotator.h>
24#include <mach/msm_hsusb.h>
25#include "footswitch.h"
26#include "clock.h"
27#include "clock-rpm.h"
28#include "clock-voter.h"
29#include "devices.h"
30#include "devices-msm8x60.h"
31#include <linux/dma-mapping.h>
32#include <linux/irq.h>
33#include <linux/clk.h>
34#include <asm/hardware/gic.h>
35#include <asm/mach-types.h>
36#include <asm/clkdev.h>
37#include <mach/msm_serial_hs_lite.h>
38#include <mach/msm_bus.h>
39#include <mach/msm_bus_board.h>
40#include <mach/socinfo.h>
41#include <mach/msm_memtypes.h>
42#include <mach/msm_tsif.h>
43#include <mach/scm-io.h>
44#ifdef CONFIG_MSM_DSPS
45#include <mach/msm_dsps.h>
46#endif
47#include <linux/android_pmem.h>
48#include <linux/gpio.h>
49#include <linux/delay.h>
50#include <mach/mdm.h>
51#include <mach/rpm.h>
52#include <mach/board.h>
Lei Zhou01366a42011-08-19 13:12:00 -040053#include <sound/apr_audio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054#include "rpm_stats.h"
55#include "mpm.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070056#include "msm_watchdog.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057
58/* Address of GSBI blocks */
59#define MSM_GSBI1_PHYS 0x16000000
60#define MSM_GSBI2_PHYS 0x16100000
61#define MSM_GSBI3_PHYS 0x16200000
62#define MSM_GSBI4_PHYS 0x16300000
63#define MSM_GSBI5_PHYS 0x16400000
64#define MSM_GSBI6_PHYS 0x16500000
65#define MSM_GSBI7_PHYS 0x16600000
66#define MSM_GSBI8_PHYS 0x19800000
67#define MSM_GSBI9_PHYS 0x19900000
68#define MSM_GSBI10_PHYS 0x19A00000
69#define MSM_GSBI11_PHYS 0x19B00000
70#define MSM_GSBI12_PHYS 0x19C00000
71
72/* GSBI QUPe devices */
73#define MSM_GSBI1_QUP_PHYS 0x16080000
74#define MSM_GSBI2_QUP_PHYS 0x16180000
75#define MSM_GSBI3_QUP_PHYS 0x16280000
76#define MSM_GSBI4_QUP_PHYS 0x16380000
77#define MSM_GSBI5_QUP_PHYS 0x16480000
78#define MSM_GSBI6_QUP_PHYS 0x16580000
79#define MSM_GSBI7_QUP_PHYS 0x16680000
80#define MSM_GSBI8_QUP_PHYS 0x19880000
81#define MSM_GSBI9_QUP_PHYS 0x19980000
82#define MSM_GSBI10_QUP_PHYS 0x19A80000
83#define MSM_GSBI11_QUP_PHYS 0x19B80000
84#define MSM_GSBI12_QUP_PHYS 0x19C80000
85
86/* GSBI UART devices */
87#define MSM_UART1DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
88#define INT_UART1DM_IRQ GSBI6_UARTDM_IRQ
89#define INT_UART2DM_IRQ GSBI12_UARTDM_IRQ
90#define MSM_UART2DM_PHYS 0x19C40000
91#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
92#define INT_UART3DM_IRQ GSBI3_UARTDM_IRQ
93#define TCSR_BASE_PHYS 0x16b00000
94
95/* PRNG device */
96#define MSM_PRNG_PHYS 0x16C00000
97#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
98#define INT_UART9DM_IRQ GSBI9_UARTDM_IRQ
99
100static void charm_ap2mdm_kpdpwr_on(void)
101{
102 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
Laura Abbotteda23372011-08-17 09:25:56 -0700103 gpio_direction_output(AP2MDM_KPDPWR_N, 1);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700104}
105
106static void charm_ap2mdm_kpdpwr_off(void)
107{
108 int i;
109
110 gpio_direction_output(AP2MDM_ERRFATAL, 1);
111
112 for (i = 20; i > 0; i--) {
113 if (gpio_get_value(MDM2AP_STATUS) == 0)
114 break;
115 msleep(100);
116 }
117 gpio_direction_output(AP2MDM_ERRFATAL, 0);
118
119 if (i == 0) {
120 pr_err("%s: MDM2AP_STATUS never went low. Doing a hard reset \
121 of the charm modem.\n", __func__);
122 gpio_direction_output(AP2MDM_PMIC_RESET_N, 1);
123 /*
124 * Currently, there is a debounce timer on the charm PMIC. It is
125 * necessary to hold the AP2MDM_PMIC_RESET low for ~3.5 seconds
126 * for the reset to fully take place. Sleep here to ensure the
127 * reset has occured before the function exits.
128 */
129 msleep(4000);
130 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
131 }
132}
133
134static struct resource charm_resources[] = {
135 /* MDM2AP_ERRFATAL */
136 {
137 .start = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
138 .end = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
139 .flags = IORESOURCE_IRQ,
140 },
141 /* MDM2AP_STATUS */
142 {
143 .start = MSM_GPIO_TO_INT(MDM2AP_STATUS),
144 .end = MSM_GPIO_TO_INT(MDM2AP_STATUS),
145 .flags = IORESOURCE_IRQ,
146 }
147};
148
149static struct charm_platform_data mdm_platform_data = {
150 .charm_modem_on = charm_ap2mdm_kpdpwr_on,
151 .charm_modem_off = charm_ap2mdm_kpdpwr_off,
152};
153
154struct platform_device msm_charm_modem = {
155 .name = "charm_modem",
156 .id = -1,
157 .num_resources = ARRAY_SIZE(charm_resources),
158 .resource = charm_resources,
159 .dev = {
160 .platform_data = &mdm_platform_data,
161 },
162};
163
164#ifdef CONFIG_MSM_DSPS
165#define GSBI12_DEV (&msm_dsps_device.dev)
166#else
167#define GSBI12_DEV (&msm_gsbi12_qup_i2c_device.dev)
168#endif
169
170void __init msm8x60_init_irq(void)
171{
172 unsigned int i;
173
174 msm_mpm_irq_extn_init();
175 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, (void *)MSM_QGIC_CPU_BASE);
176
177 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
178 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
179
180 /* FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
181 * as they are configured as level, which does not play nice with
182 * handle_percpu_irq.
183 */
184 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
185 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
186 irq_set_handler(i, handle_percpu_irq);
187 }
188}
189
190static struct resource msm_uart1_dm_resources[] = {
191 {
192 .start = MSM_UART1DM_PHYS,
193 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
194 .flags = IORESOURCE_MEM,
195 },
196 {
197 .start = INT_UART1DM_IRQ,
198 .end = INT_UART1DM_IRQ,
199 .flags = IORESOURCE_IRQ,
200 },
201 {
202 /* GSBI6 is UARTDM1 */
203 .start = MSM_GSBI6_PHYS,
204 .end = MSM_GSBI6_PHYS + 4 - 1,
205 .name = "gsbi_resource",
206 .flags = IORESOURCE_MEM,
207 },
208 {
209 .start = DMOV_HSUART1_TX_CHAN,
210 .end = DMOV_HSUART1_RX_CHAN,
211 .name = "uartdm_channels",
212 .flags = IORESOURCE_DMA,
213 },
214 {
215 .start = DMOV_HSUART1_TX_CRCI,
216 .end = DMOV_HSUART1_RX_CRCI,
217 .name = "uartdm_crci",
218 .flags = IORESOURCE_DMA,
219 },
220};
221
222static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
223
224struct platform_device msm_device_uart_dm1 = {
225 .name = "msm_serial_hs",
226 .id = 0,
227 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
228 .resource = msm_uart1_dm_resources,
229 .dev = {
230 .dma_mask = &msm_uart_dm1_dma_mask,
231 .coherent_dma_mask = DMA_BIT_MASK(32),
232 },
233};
234
235static struct resource msm_uart3_dm_resources[] = {
236 {
237 .start = MSM_UART3DM_PHYS,
238 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
239 .name = "uartdm_resource",
240 .flags = IORESOURCE_MEM,
241 },
242 {
243 .start = INT_UART3DM_IRQ,
244 .end = INT_UART3DM_IRQ,
245 .flags = IORESOURCE_IRQ,
246 },
247 {
248 .start = MSM_GSBI3_PHYS,
249 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
250 .name = "gsbi_resource",
251 .flags = IORESOURCE_MEM,
252 },
253};
254
255struct platform_device msm_device_uart_dm3 = {
256 .name = "msm_serial_hsl",
257 .id = 2,
258 .num_resources = ARRAY_SIZE(msm_uart3_dm_resources),
259 .resource = msm_uart3_dm_resources,
260};
261
262static struct resource msm_uart12_dm_resources[] = {
263 {
264 .start = MSM_UART2DM_PHYS,
265 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
266 .name = "uartdm_resource",
267 .flags = IORESOURCE_MEM,
268 },
269 {
270 .start = INT_UART2DM_IRQ,
271 .end = INT_UART2DM_IRQ,
272 .flags = IORESOURCE_IRQ,
273 },
274 {
275 /* GSBI 12 is UARTDM2 */
276 .start = MSM_GSBI12_PHYS,
277 .end = MSM_GSBI12_PHYS + PAGE_SIZE - 1,
278 .name = "gsbi_resource",
279 .flags = IORESOURCE_MEM,
280 },
281};
282
283struct platform_device msm_device_uart_dm12 = {
284 .name = "msm_serial_hsl",
285 .id = 0,
286 .num_resources = ARRAY_SIZE(msm_uart12_dm_resources),
287 .resource = msm_uart12_dm_resources,
288};
289
290#ifdef CONFIG_MSM_GSBI9_UART
291static struct msm_serial_hslite_platform_data uart_gsbi9_pdata = {
292 .config_gpio = 1,
293 .uart_tx_gpio = 67,
294 .uart_rx_gpio = 66,
295};
296
297static struct resource msm_uart_gsbi9_resources[] = {
298 {
299 .start = MSM_UART9DM_PHYS,
300 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
301 .name = "uartdm_resource",
302 .flags = IORESOURCE_MEM,
303 },
304 {
305 .start = INT_UART9DM_IRQ,
306 .end = INT_UART9DM_IRQ,
307 .flags = IORESOURCE_IRQ,
308 },
309 {
310 /* GSBI 9 is UART_GSBI9 */
311 .start = MSM_GSBI9_PHYS,
312 .end = MSM_GSBI9_PHYS + PAGE_SIZE - 1,
313 .name = "gsbi_resource",
314 .flags = IORESOURCE_MEM,
315 },
316};
317struct platform_device *msm_device_uart_gsbi9;
318struct platform_device *msm_add_gsbi9_uart(void)
319{
320 return platform_device_register_resndata(NULL, "msm_serial_hsl",
321 1, msm_uart_gsbi9_resources,
322 ARRAY_SIZE(msm_uart_gsbi9_resources),
323 &uart_gsbi9_pdata,
324 sizeof(uart_gsbi9_pdata));
325}
326#endif
327
328static struct resource gsbi3_qup_i2c_resources[] = {
329 {
330 .name = "qup_phys_addr",
331 .start = MSM_GSBI3_QUP_PHYS,
332 .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1,
333 .flags = IORESOURCE_MEM,
334 },
335 {
336 .name = "gsbi_qup_i2c_addr",
337 .start = MSM_GSBI3_PHYS,
338 .end = MSM_GSBI3_PHYS + 4 - 1,
339 .flags = IORESOURCE_MEM,
340 },
341 {
342 .name = "qup_err_intr",
343 .start = GSBI3_QUP_IRQ,
344 .end = GSBI3_QUP_IRQ,
345 .flags = IORESOURCE_IRQ,
346 },
347 {
348 .name = "i2c_clk",
349 .start = 44,
350 .end = 44,
351 .flags = IORESOURCE_IO,
352 },
353 {
354 .name = "i2c_sda",
355 .start = 43,
356 .end = 43,
357 .flags = IORESOURCE_IO,
358 },
359};
360
361static struct resource gsbi4_qup_i2c_resources[] = {
362 {
363 .name = "qup_phys_addr",
364 .start = MSM_GSBI4_QUP_PHYS,
365 .end = MSM_GSBI4_QUP_PHYS + SZ_4K - 1,
366 .flags = IORESOURCE_MEM,
367 },
368 {
369 .name = "gsbi_qup_i2c_addr",
370 .start = MSM_GSBI4_PHYS,
371 .end = MSM_GSBI4_PHYS + 4 - 1,
372 .flags = IORESOURCE_MEM,
373 },
374 {
375 .name = "qup_err_intr",
376 .start = GSBI4_QUP_IRQ,
377 .end = GSBI4_QUP_IRQ,
378 .flags = IORESOURCE_IRQ,
379 },
380};
381
382static struct resource gsbi7_qup_i2c_resources[] = {
383 {
384 .name = "qup_phys_addr",
385 .start = MSM_GSBI7_QUP_PHYS,
386 .end = MSM_GSBI7_QUP_PHYS + SZ_4K - 1,
387 .flags = IORESOURCE_MEM,
388 },
389 {
390 .name = "gsbi_qup_i2c_addr",
391 .start = MSM_GSBI7_PHYS,
392 .end = MSM_GSBI7_PHYS + 4 - 1,
393 .flags = IORESOURCE_MEM,
394 },
395 {
396 .name = "qup_err_intr",
397 .start = GSBI7_QUP_IRQ,
398 .end = GSBI7_QUP_IRQ,
399 .flags = IORESOURCE_IRQ,
400 },
401 {
402 .name = "i2c_clk",
403 .start = 60,
404 .end = 60,
405 .flags = IORESOURCE_IO,
406 },
407 {
408 .name = "i2c_sda",
409 .start = 59,
410 .end = 59,
411 .flags = IORESOURCE_IO,
412 },
413};
414
415static struct resource gsbi8_qup_i2c_resources[] = {
416 {
417 .name = "qup_phys_addr",
418 .start = MSM_GSBI8_QUP_PHYS,
419 .end = MSM_GSBI8_QUP_PHYS + SZ_4K - 1,
420 .flags = IORESOURCE_MEM,
421 },
422 {
423 .name = "gsbi_qup_i2c_addr",
424 .start = MSM_GSBI8_PHYS,
425 .end = MSM_GSBI8_PHYS + 4 - 1,
426 .flags = IORESOURCE_MEM,
427 },
428 {
429 .name = "qup_err_intr",
430 .start = GSBI8_QUP_IRQ,
431 .end = GSBI8_QUP_IRQ,
432 .flags = IORESOURCE_IRQ,
433 },
434};
435
436static struct resource gsbi9_qup_i2c_resources[] = {
437 {
438 .name = "qup_phys_addr",
439 .start = MSM_GSBI9_QUP_PHYS,
440 .end = MSM_GSBI9_QUP_PHYS + SZ_4K - 1,
441 .flags = IORESOURCE_MEM,
442 },
443 {
444 .name = "gsbi_qup_i2c_addr",
445 .start = MSM_GSBI9_PHYS,
446 .end = MSM_GSBI9_PHYS + 4 - 1,
447 .flags = IORESOURCE_MEM,
448 },
449 {
450 .name = "qup_err_intr",
451 .start = GSBI9_QUP_IRQ,
452 .end = GSBI9_QUP_IRQ,
453 .flags = IORESOURCE_IRQ,
454 },
455};
456
457static struct resource gsbi12_qup_i2c_resources[] = {
458 {
459 .name = "qup_phys_addr",
460 .start = MSM_GSBI12_QUP_PHYS,
461 .end = MSM_GSBI12_QUP_PHYS + SZ_4K - 1,
462 .flags = IORESOURCE_MEM,
463 },
464 {
465 .name = "gsbi_qup_i2c_addr",
466 .start = MSM_GSBI12_PHYS,
467 .end = MSM_GSBI12_PHYS + 4 - 1,
468 .flags = IORESOURCE_MEM,
469 },
470 {
471 .name = "qup_err_intr",
472 .start = GSBI12_QUP_IRQ,
473 .end = GSBI12_QUP_IRQ,
474 .flags = IORESOURCE_IRQ,
475 },
476};
477
478#ifdef CONFIG_MSM_BUS_SCALING
479static struct msm_bus_vectors grp3d_init_vectors[] = {
480 {
481 .src = MSM_BUS_MASTER_GRAPHICS_3D,
482 .dst = MSM_BUS_SLAVE_EBI_CH0,
483 .ab = 0,
484 .ib = 0,
485 },
486};
487
Lucille Sylvester293217d2011-08-19 17:50:52 -0600488static struct msm_bus_vectors grp3d_low_vectors[] = {
489 {
490 .src = MSM_BUS_MASTER_GRAPHICS_3D,
491 .dst = MSM_BUS_SLAVE_EBI_CH0,
492 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700493 .ib = KGSL_CONVERT_TO_MBPS(990),
Lucille Sylvester293217d2011-08-19 17:50:52 -0600494 },
495};
496
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700497static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
498 {
499 .src = MSM_BUS_MASTER_GRAPHICS_3D,
500 .dst = MSM_BUS_SLAVE_EBI_CH0,
501 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700502 .ib = KGSL_CONVERT_TO_MBPS(1300),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700503 },
504};
505
506static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
507 {
508 .src = MSM_BUS_MASTER_GRAPHICS_3D,
509 .dst = MSM_BUS_SLAVE_EBI_CH0,
510 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700511 .ib = KGSL_CONVERT_TO_MBPS(2008),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700512 },
513};
514
515static struct msm_bus_vectors grp3d_max_vectors[] = {
516 {
517 .src = MSM_BUS_MASTER_GRAPHICS_3D,
518 .dst = MSM_BUS_SLAVE_EBI_CH0,
519 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700520 .ib = KGSL_CONVERT_TO_MBPS(2484),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700521 },
522};
523
524static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
525 {
526 ARRAY_SIZE(grp3d_init_vectors),
527 grp3d_init_vectors,
528 },
529 {
Lucille Sylvester293217d2011-08-19 17:50:52 -0600530 ARRAY_SIZE(grp3d_low_vectors),
Suman Tatirajuc87f58c2011-10-14 10:58:37 -0700531 grp3d_low_vectors,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600532 },
533 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700534 ARRAY_SIZE(grp3d_nominal_low_vectors),
535 grp3d_nominal_low_vectors,
536 },
537 {
538 ARRAY_SIZE(grp3d_nominal_high_vectors),
539 grp3d_nominal_high_vectors,
540 },
541 {
542 ARRAY_SIZE(grp3d_max_vectors),
543 grp3d_max_vectors,
544 },
545};
546
547static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
548 grp3d_bus_scale_usecases,
549 ARRAY_SIZE(grp3d_bus_scale_usecases),
550 .name = "grp3d",
551};
552
553static struct msm_bus_vectors grp2d0_init_vectors[] = {
554 {
555 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
556 .dst = MSM_BUS_SLAVE_EBI_CH0,
557 .ab = 0,
558 .ib = 0,
559 },
560};
561
562static struct msm_bus_vectors grp2d0_max_vectors[] = {
563 {
564 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
565 .dst = MSM_BUS_SLAVE_EBI_CH0,
566 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700567 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700568 },
569};
570
571static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
572 {
573 ARRAY_SIZE(grp2d0_init_vectors),
574 grp2d0_init_vectors,
575 },
576 {
577 ARRAY_SIZE(grp2d0_max_vectors),
578 grp2d0_max_vectors,
579 },
580};
581
582static struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
583 grp2d0_bus_scale_usecases,
584 ARRAY_SIZE(grp2d0_bus_scale_usecases),
585 .name = "grp2d0",
586};
587
588static struct msm_bus_vectors grp2d1_init_vectors[] = {
589 {
590 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
591 .dst = MSM_BUS_SLAVE_EBI_CH0,
592 .ab = 0,
593 .ib = 0,
594 },
595};
596
597static struct msm_bus_vectors grp2d1_max_vectors[] = {
598 {
599 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
600 .dst = MSM_BUS_SLAVE_EBI_CH0,
601 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700602 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700603 },
604};
605
606static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
607 {
608 ARRAY_SIZE(grp2d1_init_vectors),
609 grp2d1_init_vectors,
610 },
611 {
612 ARRAY_SIZE(grp2d1_max_vectors),
613 grp2d1_max_vectors,
614 },
615};
616
617static struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
618 grp2d1_bus_scale_usecases,
619 ARRAY_SIZE(grp2d1_bus_scale_usecases),
620 .name = "grp2d1",
621};
622#endif
623
624#ifdef CONFIG_HW_RANDOM_MSM
625static struct resource rng_resources = {
626 .flags = IORESOURCE_MEM,
627 .start = MSM_PRNG_PHYS,
628 .end = MSM_PRNG_PHYS + SZ_512 - 1,
629};
630
631struct platform_device msm_device_rng = {
632 .name = "msm_rng",
633 .id = 0,
634 .num_resources = 1,
635 .resource = &rng_resources,
636};
637#endif
638
639static struct resource kgsl_3d0_resources[] = {
640 {
641 .name = KGSL_3D0_REG_MEMORY,
642 .start = 0x04300000, /* GFX3D address */
643 .end = 0x0431ffff,
644 .flags = IORESOURCE_MEM,
645 },
646 {
647 .name = KGSL_3D0_IRQ,
648 .start = GFX3D_IRQ,
649 .end = GFX3D_IRQ,
650 .flags = IORESOURCE_IRQ,
651 },
652};
653
654static struct kgsl_device_platform_data kgsl_3d0_pdata = {
655 .pwr_data = {
656 .pwrlevel = {
657 {
658 .gpu_freq = 266667000,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600659 .bus_freq = 4,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700660 },
661 {
662 .gpu_freq = 228571000,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600663 .bus_freq = 3,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700664 },
665 {
666 .gpu_freq = 200000000,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600667 .bus_freq = 2,
668 },
669 {
670 .gpu_freq = 177778000,
671 .bus_freq = 1
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700672 },
673 {
674 .gpu_freq = 27000000,
675 .bus_freq = 0,
676 },
677 },
678 .init_level = 0,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600679 .num_levels = 5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700680 .set_grp_async = NULL,
681 .idle_timeout = HZ/5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700682 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700683 },
684 .clk = {
685 .name = {
Matt Wagantall9dc01632011-08-17 18:55:04 -0700686 .clk = "core_clk",
687 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700688 },
689#ifdef CONFIG_MSM_BUS_SCALING
690 .bus_scale_table = &grp3d_bus_scale_pdata,
691#endif
692 },
693 .imem_clk_name = {
694 .clk = NULL,
Matt Wagantall9dc01632011-08-17 18:55:04 -0700695 .pclk = "mem_iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700696 },
697};
698
699struct platform_device msm_kgsl_3d0 = {
700 .name = "kgsl-3d0",
701 .id = 0,
702 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
703 .resource = kgsl_3d0_resources,
704 .dev = {
705 .platform_data = &kgsl_3d0_pdata,
706 },
707};
708
709static struct resource kgsl_2d0_resources[] = {
710 {
711 .name = KGSL_2D0_REG_MEMORY,
712 .start = 0x04100000, /* Z180 base address */
713 .end = 0x04100FFF,
714 .flags = IORESOURCE_MEM,
715 },
716 {
717 .name = KGSL_2D0_IRQ,
718 .start = GFX2D0_IRQ,
719 .end = GFX2D0_IRQ,
720 .flags = IORESOURCE_IRQ,
721 },
722};
723
724static struct kgsl_device_platform_data kgsl_2d0_pdata = {
725 .pwr_data = {
726 .pwrlevel = {
727 {
728 .gpu_freq = 200000000,
729 .bus_freq = 1,
730 },
731 {
732 .gpu_freq = 200000000,
733 .bus_freq = 0,
734 },
735 },
736 .init_level = 0,
737 .num_levels = 2,
738 .set_grp_async = NULL,
739 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700740 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700741 },
742 .clk = {
743 .name = {
744 /* note: 2d clocks disabled on v1 */
Matt Wagantall9dc01632011-08-17 18:55:04 -0700745 .clk = "core_clk",
746 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700747 },
748#ifdef CONFIG_MSM_BUS_SCALING
749 .bus_scale_table = &grp2d0_bus_scale_pdata,
750#endif
751 },
752};
753
754struct platform_device msm_kgsl_2d0 = {
755 .name = "kgsl-2d0",
756 .id = 0,
757 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
758 .resource = kgsl_2d0_resources,
759 .dev = {
760 .platform_data = &kgsl_2d0_pdata,
761 },
762};
763
764static struct resource kgsl_2d1_resources[] = {
765 {
766 .name = KGSL_2D1_REG_MEMORY,
767 .start = 0x04200000, /* Z180 device 1 base address */
768 .end = 0x04200FFF,
769 .flags = IORESOURCE_MEM,
770 },
771 {
772 .name = KGSL_2D1_IRQ,
773 .start = GFX2D1_IRQ,
774 .end = GFX2D1_IRQ,
775 .flags = IORESOURCE_IRQ,
776 },
777};
778
779static struct kgsl_device_platform_data kgsl_2d1_pdata = {
780 .pwr_data = {
781 .pwrlevel = {
782 {
783 .gpu_freq = 200000000,
784 .bus_freq = 1,
785 },
786 {
787 .gpu_freq = 200000000,
788 .bus_freq = 0,
789 },
790 },
791 .init_level = 0,
792 .num_levels = 2,
793 .set_grp_async = NULL,
794 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700795 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700796 },
797 .clk = {
798 .name = {
799 .clk = "gfx2d1_clk",
800 .pclk = "gfx2d1_pclk",
801 },
802#ifdef CONFIG_MSM_BUS_SCALING
803 .bus_scale_table = &grp2d1_bus_scale_pdata,
804#endif
805 },
806};
807
808struct platform_device msm_kgsl_2d1 = {
809 .name = "kgsl-2d1",
810 .id = 1,
811 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
812 .resource = kgsl_2d1_resources,
813 .dev = {
814 .platform_data = &kgsl_2d1_pdata,
815 },
816};
817
818/*
819 * this a software workaround for not having two distinct board
820 * files for 8660v1 and 8660v2. 8660v1 has a faulty 2d clock, and
821 * this workaround detects the cpu version to tell if the kernel is on a
822 * 8660v1, and should disable the 2d core. it is called from the board file
823 */
824void __init msm8x60_check_2d_hardware(void)
825{
826 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) &&
827 (SOCINFO_VERSION_MINOR(socinfo_get_version()) == 0)) {
828 printk(KERN_WARNING "kgsl: 2D cores disabled on 8660v1\n");
829 kgsl_2d0_pdata.clk.name.clk = NULL;
830 kgsl_2d1_pdata.clk.name.clk = NULL;
831 }
832}
833
834/* Use GSBI3 QUP for /dev/i2c-0 */
835struct platform_device msm_gsbi3_qup_i2c_device = {
836 .name = "qup_i2c",
837 .id = MSM_GSBI3_QUP_I2C_BUS_ID,
838 .num_resources = ARRAY_SIZE(gsbi3_qup_i2c_resources),
839 .resource = gsbi3_qup_i2c_resources,
840};
841
842/* Use GSBI4 QUP for /dev/i2c-1 */
843struct platform_device msm_gsbi4_qup_i2c_device = {
844 .name = "qup_i2c",
845 .id = MSM_GSBI4_QUP_I2C_BUS_ID,
846 .num_resources = ARRAY_SIZE(gsbi4_qup_i2c_resources),
847 .resource = gsbi4_qup_i2c_resources,
848};
849
850/* Use GSBI8 QUP for /dev/i2c-3 */
851struct platform_device msm_gsbi8_qup_i2c_device = {
852 .name = "qup_i2c",
853 .id = MSM_GSBI8_QUP_I2C_BUS_ID,
854 .num_resources = ARRAY_SIZE(gsbi8_qup_i2c_resources),
855 .resource = gsbi8_qup_i2c_resources,
856};
857
858/* Use GSBI9 QUP for /dev/i2c-2 */
859struct platform_device msm_gsbi9_qup_i2c_device = {
860 .name = "qup_i2c",
861 .id = MSM_GSBI9_QUP_I2C_BUS_ID,
862 .num_resources = ARRAY_SIZE(gsbi9_qup_i2c_resources),
863 .resource = gsbi9_qup_i2c_resources,
864};
865
866/* Use GSBI7 QUP for /dev/i2c-4 (Marimba) */
867struct platform_device msm_gsbi7_qup_i2c_device = {
868 .name = "qup_i2c",
869 .id = MSM_GSBI7_QUP_I2C_BUS_ID,
870 .num_resources = ARRAY_SIZE(gsbi7_qup_i2c_resources),
871 .resource = gsbi7_qup_i2c_resources,
872};
873
874/* Use GSBI12 QUP for /dev/i2c-5 (Sensors) */
875struct platform_device msm_gsbi12_qup_i2c_device = {
876 .name = "qup_i2c",
877 .id = MSM_GSBI12_QUP_I2C_BUS_ID,
878 .num_resources = ARRAY_SIZE(gsbi12_qup_i2c_resources),
879 .resource = gsbi12_qup_i2c_resources,
880};
881
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +0530882#ifdef CONFIG_MSM_SSBI
883#define MSM_SSBI_PMIC1_PHYS 0x00500000
884static struct resource resources_ssbi_pmic1_resource[] = {
885 {
886 .start = MSM_SSBI_PMIC1_PHYS,
887 .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1,
888 .flags = IORESOURCE_MEM,
889 },
890};
891
892struct platform_device msm_device_ssbi_pmic1 = {
893 .name = "msm_ssbi",
894 .id = 0,
895 .resource = resources_ssbi_pmic1_resource,
896 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1_resource),
897};
898#endif
899
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700900#ifdef CONFIG_I2C_SSBI
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700901/* 8901 PMIC SSBI on /dev/i2c-7 */
902#define MSM_SSBI2_PMIC2B_PHYS 0x00C00000
903static struct resource msm_ssbi2_resources[] = {
904 {
905 .name = "ssbi_base",
906 .start = MSM_SSBI2_PMIC2B_PHYS,
907 .end = MSM_SSBI2_PMIC2B_PHYS + SZ_4K - 1,
908 .flags = IORESOURCE_MEM,
909 },
910};
911
912struct platform_device msm_device_ssbi2 = {
913 .name = "i2c_ssbi",
914 .id = MSM_SSBI2_I2C_BUS_ID,
915 .num_resources = ARRAY_SIZE(msm_ssbi2_resources),
916 .resource = msm_ssbi2_resources,
917};
918
919/* CODEC SSBI on /dev/i2c-8 */
920#define MSM_SSBI3_PHYS 0x18700000
921static struct resource msm_ssbi3_resources[] = {
922 {
923 .name = "ssbi_base",
924 .start = MSM_SSBI3_PHYS,
925 .end = MSM_SSBI3_PHYS + SZ_4K - 1,
926 .flags = IORESOURCE_MEM,
927 },
928};
929
930struct platform_device msm_device_ssbi3 = {
931 .name = "i2c_ssbi",
932 .id = MSM_SSBI3_I2C_BUS_ID,
933 .num_resources = ARRAY_SIZE(msm_ssbi3_resources),
934 .resource = msm_ssbi3_resources,
935};
936#endif /* CONFIG_I2C_SSBI */
937
938static struct resource gsbi1_qup_spi_resources[] = {
939 {
940 .name = "spi_base",
941 .start = MSM_GSBI1_QUP_PHYS,
942 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
943 .flags = IORESOURCE_MEM,
944 },
945 {
946 .name = "gsbi_base",
947 .start = MSM_GSBI1_PHYS,
948 .end = MSM_GSBI1_PHYS + 4 - 1,
949 .flags = IORESOURCE_MEM,
950 },
951 {
952 .name = "spi_irq_in",
953 .start = GSBI1_QUP_IRQ,
954 .end = GSBI1_QUP_IRQ,
955 .flags = IORESOURCE_IRQ,
956 },
957 {
958 .name = "spidm_channels",
959 .start = 5,
960 .end = 6,
961 .flags = IORESOURCE_DMA,
962 },
963 {
964 .name = "spidm_crci",
965 .start = 8,
966 .end = 7,
967 .flags = IORESOURCE_DMA,
968 },
969 {
970 .name = "spi_clk",
971 .start = 36,
972 .end = 36,
973 .flags = IORESOURCE_IO,
974 },
975 {
976 .name = "spi_cs",
977 .start = 35,
978 .end = 35,
979 .flags = IORESOURCE_IO,
980 },
981 {
982 .name = "spi_miso",
983 .start = 34,
984 .end = 34,
985 .flags = IORESOURCE_IO,
986 },
987 {
988 .name = "spi_mosi",
989 .start = 33,
990 .end = 33,
991 .flags = IORESOURCE_IO,
992 },
993};
994
995/* Use GSBI1 QUP for SPI-0 */
996struct platform_device msm_gsbi1_qup_spi_device = {
997 .name = "spi_qsd",
998 .id = 0,
999 .num_resources = ARRAY_SIZE(gsbi1_qup_spi_resources),
1000 .resource = gsbi1_qup_spi_resources,
1001};
1002
1003
1004static struct resource gsbi10_qup_spi_resources[] = {
1005 {
1006 .name = "spi_base",
1007 .start = MSM_GSBI10_QUP_PHYS,
1008 .end = MSM_GSBI10_QUP_PHYS + SZ_4K - 1,
1009 .flags = IORESOURCE_MEM,
1010 },
1011 {
1012 .name = "gsbi_base",
1013 .start = MSM_GSBI10_PHYS,
1014 .end = MSM_GSBI10_PHYS + 4 - 1,
1015 .flags = IORESOURCE_MEM,
1016 },
1017 {
1018 .name = "spi_irq_in",
1019 .start = GSBI10_QUP_IRQ,
1020 .end = GSBI10_QUP_IRQ,
1021 .flags = IORESOURCE_IRQ,
1022 },
1023 {
1024 .name = "spi_clk",
1025 .start = 73,
1026 .end = 73,
1027 .flags = IORESOURCE_IO,
1028 },
1029 {
1030 .name = "spi_cs",
1031 .start = 72,
1032 .end = 72,
1033 .flags = IORESOURCE_IO,
1034 },
1035 {
1036 .name = "spi_mosi",
1037 .start = 70,
1038 .end = 70,
1039 .flags = IORESOURCE_IO,
1040 },
1041};
1042
1043/* Use GSBI10 QUP for SPI-1 */
1044struct platform_device msm_gsbi10_qup_spi_device = {
1045 .name = "spi_qsd",
1046 .id = 1,
1047 .num_resources = ARRAY_SIZE(gsbi10_qup_spi_resources),
1048 .resource = gsbi10_qup_spi_resources,
1049};
1050#define MSM_SDC1_BASE 0x12400000
1051#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1052#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1053#define MSM_SDC2_BASE 0x12140000
1054#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1055#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1056#define MSM_SDC3_BASE 0x12180000
1057#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1058#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1059#define MSM_SDC4_BASE 0x121C0000
1060#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1061#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1062#define MSM_SDC5_BASE 0x12200000
1063#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
1064#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
1065
1066static struct resource resources_sdc1[] = {
1067 {
1068 .start = MSM_SDC1_BASE,
1069 .end = MSM_SDC1_DML_BASE - 1,
1070 .flags = IORESOURCE_MEM,
1071 },
1072 {
1073 .start = SDC1_IRQ_0,
1074 .end = SDC1_IRQ_0,
1075 .flags = IORESOURCE_IRQ,
1076 },
1077#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1078 {
1079 .name = "sdcc_dml_addr",
1080 .start = MSM_SDC1_DML_BASE,
1081 .end = MSM_SDC1_BAM_BASE - 1,
1082 .flags = IORESOURCE_MEM,
1083 },
1084 {
1085 .name = "sdcc_bam_addr",
1086 .start = MSM_SDC1_BAM_BASE,
1087 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1088 .flags = IORESOURCE_MEM,
1089 },
1090 {
1091 .name = "sdcc_bam_irq",
1092 .start = SDC1_BAM_IRQ,
1093 .end = SDC1_BAM_IRQ,
1094 .flags = IORESOURCE_IRQ,
1095 },
1096#else
1097 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001098 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001099 .start = DMOV_SDC1_CHAN,
1100 .end = DMOV_SDC1_CHAN,
1101 .flags = IORESOURCE_DMA,
1102 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001103 {
1104 .name = "sdcc_dma_crci",
1105 .start = DMOV_SDC1_CRCI,
1106 .end = DMOV_SDC1_CRCI,
1107 .flags = IORESOURCE_DMA,
1108 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001109#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1110};
1111
1112static struct resource resources_sdc2[] = {
1113 {
1114 .start = MSM_SDC2_BASE,
1115 .end = MSM_SDC2_DML_BASE - 1,
1116 .flags = IORESOURCE_MEM,
1117 },
1118 {
1119 .start = SDC2_IRQ_0,
1120 .end = SDC2_IRQ_0,
1121 .flags = IORESOURCE_IRQ,
1122 },
1123#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1124 {
1125 .name = "sdcc_dml_addr",
1126 .start = MSM_SDC2_DML_BASE,
1127 .end = MSM_SDC2_BAM_BASE - 1,
1128 .flags = IORESOURCE_MEM,
1129 },
1130 {
1131 .name = "sdcc_bam_addr",
1132 .start = MSM_SDC2_BAM_BASE,
1133 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1134 .flags = IORESOURCE_MEM,
1135 },
1136 {
1137 .name = "sdcc_bam_irq",
1138 .start = SDC2_BAM_IRQ,
1139 .end = SDC2_BAM_IRQ,
1140 .flags = IORESOURCE_IRQ,
1141 },
1142#else
1143 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001144 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001145 .start = DMOV_SDC2_CHAN,
1146 .end = DMOV_SDC2_CHAN,
1147 .flags = IORESOURCE_DMA,
1148 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001149 {
1150 .name = "sdcc_dma_crci",
1151 .start = DMOV_SDC2_CRCI,
1152 .end = DMOV_SDC2_CRCI,
1153 .flags = IORESOURCE_DMA,
1154 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001155#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1156};
1157
1158static struct resource resources_sdc3[] = {
1159 {
1160 .start = MSM_SDC3_BASE,
1161 .end = MSM_SDC3_DML_BASE - 1,
1162 .flags = IORESOURCE_MEM,
1163 },
1164 {
1165 .start = SDC3_IRQ_0,
1166 .end = SDC3_IRQ_0,
1167 .flags = IORESOURCE_IRQ,
1168 },
1169#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1170 {
1171 .name = "sdcc_dml_addr",
1172 .start = MSM_SDC3_DML_BASE,
1173 .end = MSM_SDC3_BAM_BASE - 1,
1174 .flags = IORESOURCE_MEM,
1175 },
1176 {
1177 .name = "sdcc_bam_addr",
1178 .start = MSM_SDC3_BAM_BASE,
1179 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1180 .flags = IORESOURCE_MEM,
1181 },
1182 {
1183 .name = "sdcc_bam_irq",
1184 .start = SDC3_BAM_IRQ,
1185 .end = SDC3_BAM_IRQ,
1186 .flags = IORESOURCE_IRQ,
1187 },
1188#else
1189 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001190 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001191 .start = DMOV_SDC3_CHAN,
1192 .end = DMOV_SDC3_CHAN,
1193 .flags = IORESOURCE_DMA,
1194 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001195 {
1196 .name = "sdcc_dma_crci",
1197 .start = DMOV_SDC3_CRCI,
1198 .end = DMOV_SDC3_CRCI,
1199 .flags = IORESOURCE_DMA,
1200 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001201#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1202};
1203
1204static struct resource resources_sdc4[] = {
1205 {
1206 .start = MSM_SDC4_BASE,
1207 .end = MSM_SDC4_DML_BASE - 1,
1208 .flags = IORESOURCE_MEM,
1209 },
1210 {
1211 .start = SDC4_IRQ_0,
1212 .end = SDC4_IRQ_0,
1213 .flags = IORESOURCE_IRQ,
1214 },
1215#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1216 {
1217 .name = "sdcc_dml_addr",
1218 .start = MSM_SDC4_DML_BASE,
1219 .end = MSM_SDC4_BAM_BASE - 1,
1220 .flags = IORESOURCE_MEM,
1221 },
1222 {
1223 .name = "sdcc_bam_addr",
1224 .start = MSM_SDC4_BAM_BASE,
1225 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1226 .flags = IORESOURCE_MEM,
1227 },
1228 {
1229 .name = "sdcc_bam_irq",
1230 .start = SDC4_BAM_IRQ,
1231 .end = SDC4_BAM_IRQ,
1232 .flags = IORESOURCE_IRQ,
1233 },
1234#else
1235 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001236 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001237 .start = DMOV_SDC4_CHAN,
1238 .end = DMOV_SDC4_CHAN,
1239 .flags = IORESOURCE_DMA,
1240 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001241 {
1242 .name = "sdcc_dma_crci",
1243 .start = DMOV_SDC4_CRCI,
1244 .end = DMOV_SDC4_CRCI,
1245 .flags = IORESOURCE_DMA,
1246 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001247#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1248};
1249
1250static struct resource resources_sdc5[] = {
1251 {
1252 .start = MSM_SDC5_BASE,
1253 .end = MSM_SDC5_DML_BASE - 1,
1254 .flags = IORESOURCE_MEM,
1255 },
1256 {
1257 .start = SDC5_IRQ_0,
1258 .end = SDC5_IRQ_0,
1259 .flags = IORESOURCE_IRQ,
1260 },
1261#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1262 {
1263 .name = "sdcc_dml_addr",
1264 .start = MSM_SDC5_DML_BASE,
1265 .end = MSM_SDC5_BAM_BASE - 1,
1266 .flags = IORESOURCE_MEM,
1267 },
1268 {
1269 .name = "sdcc_bam_addr",
1270 .start = MSM_SDC5_BAM_BASE,
1271 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
1272 .flags = IORESOURCE_MEM,
1273 },
1274 {
1275 .name = "sdcc_bam_irq",
1276 .start = SDC5_BAM_IRQ,
1277 .end = SDC5_BAM_IRQ,
1278 .flags = IORESOURCE_IRQ,
1279 },
1280#else
1281 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001282 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001283 .start = DMOV_SDC5_CHAN,
1284 .end = DMOV_SDC5_CHAN,
1285 .flags = IORESOURCE_DMA,
1286 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001287 {
1288 .name = "sdcc_dma_crci",
1289 .start = DMOV_SDC5_CRCI,
1290 .end = DMOV_SDC5_CRCI,
1291 .flags = IORESOURCE_DMA,
1292 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001293#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1294};
1295
1296struct platform_device msm_device_sdc1 = {
1297 .name = "msm_sdcc",
1298 .id = 1,
1299 .num_resources = ARRAY_SIZE(resources_sdc1),
1300 .resource = resources_sdc1,
1301 .dev = {
1302 .coherent_dma_mask = 0xffffffff,
1303 },
1304};
1305
1306struct platform_device msm_device_sdc2 = {
1307 .name = "msm_sdcc",
1308 .id = 2,
1309 .num_resources = ARRAY_SIZE(resources_sdc2),
1310 .resource = resources_sdc2,
1311 .dev = {
1312 .coherent_dma_mask = 0xffffffff,
1313 },
1314};
1315
1316struct platform_device msm_device_sdc3 = {
1317 .name = "msm_sdcc",
1318 .id = 3,
1319 .num_resources = ARRAY_SIZE(resources_sdc3),
1320 .resource = resources_sdc3,
1321 .dev = {
1322 .coherent_dma_mask = 0xffffffff,
1323 },
1324};
1325
1326struct platform_device msm_device_sdc4 = {
1327 .name = "msm_sdcc",
1328 .id = 4,
1329 .num_resources = ARRAY_SIZE(resources_sdc4),
1330 .resource = resources_sdc4,
1331 .dev = {
1332 .coherent_dma_mask = 0xffffffff,
1333 },
1334};
1335
1336struct platform_device msm_device_sdc5 = {
1337 .name = "msm_sdcc",
1338 .id = 5,
1339 .num_resources = ARRAY_SIZE(resources_sdc5),
1340 .resource = resources_sdc5,
1341 .dev = {
1342 .coherent_dma_mask = 0xffffffff,
1343 },
1344};
1345
1346static struct platform_device *msm_sdcc_devices[] __initdata = {
1347 &msm_device_sdc1,
1348 &msm_device_sdc2,
1349 &msm_device_sdc3,
1350 &msm_device_sdc4,
1351 &msm_device_sdc5,
1352};
1353
1354int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1355{
1356 struct platform_device *pdev;
1357
1358 if (controller < 1 || controller > 5)
1359 return -EINVAL;
1360
1361 pdev = msm_sdcc_devices[controller-1];
1362 pdev->dev.platform_data = plat;
1363 return platform_device_register(pdev);
1364}
1365
1366#define MIPI_DSI_HW_BASE 0x04700000
1367#define ROTATOR_HW_BASE 0x04E00000
1368#define TVENC_HW_BASE 0x04F00000
1369#define MDP_HW_BASE 0x05100000
1370
1371static struct resource msm_mipi_dsi_resources[] = {
1372 {
1373 .name = "mipi_dsi",
1374 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001375 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001376 .flags = IORESOURCE_MEM,
1377 },
1378 {
1379 .start = DSI_IRQ,
1380 .end = DSI_IRQ,
1381 .flags = IORESOURCE_IRQ,
1382 },
1383};
1384
1385static struct platform_device msm_mipi_dsi_device = {
1386 .name = "mipi_dsi",
1387 .id = 1,
1388 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
1389 .resource = msm_mipi_dsi_resources,
1390};
1391
1392static struct resource msm_mdp_resources[] = {
1393 {
1394 .name = "mdp",
1395 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001396 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001397 .flags = IORESOURCE_MEM,
1398 },
1399 {
1400 .start = INT_MDP,
1401 .end = INT_MDP,
1402 .flags = IORESOURCE_IRQ,
1403 },
1404};
1405
1406static struct platform_device msm_mdp_device = {
1407 .name = "mdp",
1408 .id = 0,
1409 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1410 .resource = msm_mdp_resources,
1411};
1412#ifdef CONFIG_MSM_ROTATOR
1413static struct resource resources_msm_rotator[] = {
1414 {
1415 .start = 0x04E00000,
1416 .end = 0x04F00000 - 1,
1417 .flags = IORESOURCE_MEM,
1418 },
1419 {
1420 .start = ROT_IRQ,
1421 .end = ROT_IRQ,
1422 .flags = IORESOURCE_IRQ,
1423 },
1424};
1425
1426static struct msm_rot_clocks rotator_clocks[] = {
1427 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001428 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001429 .clk_type = ROTATOR_CORE_CLK,
1430 .clk_rate = 160 * 1000 * 1000,
1431 },
1432 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001433 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001434 .clk_type = ROTATOR_PCLK,
1435 .clk_rate = 0,
1436 },
1437};
1438
1439static struct msm_rotator_platform_data rotator_pdata = {
1440 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1441 .hardware_version_number = 0x01010307,
1442 .rotator_clks = rotator_clocks,
1443 .regulator_name = "fs_rot",
1444};
1445
1446struct platform_device msm_rotator_device = {
1447 .name = "msm_rotator",
1448 .id = 0,
1449 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1450 .resource = resources_msm_rotator,
1451 .dev = {
1452 .platform_data = &rotator_pdata,
1453 },
1454};
1455#endif
1456
1457
1458/* Sensors DSPS platform data */
1459#ifdef CONFIG_MSM_DSPS
1460
1461#define PPSS_REG_PHYS_BASE 0x12080000
1462
1463#define MHZ (1000*1000)
1464
Wentao Xu7a1c9302011-09-19 17:57:43 -04001465#define TCSR_GSBI_IRQ_MUX_SEL 0x0044
1466
1467#define GSBI_IRQ_MUX_SEL_MASK 0xF
1468#define GSBI_IRQ_MUX_SEL_DSPS 0xB
1469
1470static void dsps_init1(struct msm_dsps_platform_data *data)
1471{
1472 int val;
1473
1474 /* route GSBI12 interrutps to DSPS */
1475 val = secure_readl(MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1476 val &= ~GSBI_IRQ_MUX_SEL_MASK;
1477 val |= GSBI_IRQ_MUX_SEL_DSPS;
1478 secure_writel(val, MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1479}
1480
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001481static struct dsps_clk_info dsps_clks[] = {
1482 {
1483 .name = "ppss_pclk",
1484 .rate = 0, /* no rate just on/off */
1485 },
1486 {
Matt Wagantalld86d6832011-08-17 14:06:55 -07001487 .name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001488 .rate = 0, /* no rate just on/off */
1489 },
1490 {
1491 .name = "gsbi_qup_clk",
1492 .rate = 24 * MHZ, /* See clk_tbl_gsbi_qup[] */
1493 },
1494 {
1495 .name = "dfab_dsps_clk",
1496 .rate = 64 * MHZ, /* Same rate as USB. */
1497 }
1498};
1499
1500static struct dsps_regulator_info dsps_regs[] = {
1501 {
1502 .name = "8058_l5",
1503 .volt = 2850000, /* in uV */
1504 },
1505 {
1506 .name = "8058_s3",
1507 .volt = 1800000, /* in uV */
1508 }
1509};
1510
1511/*
1512 * Note: GPIOs field is intialized in run-time at the function
1513 * msm8x60_init_dsps().
1514 */
1515
1516struct msm_dsps_platform_data msm_dsps_pdata = {
1517 .clks = dsps_clks,
1518 .clks_num = ARRAY_SIZE(dsps_clks),
1519 .gpios = NULL,
1520 .gpios_num = 0,
1521 .regs = dsps_regs,
1522 .regs_num = ARRAY_SIZE(dsps_regs),
Wentao Xu7a1c9302011-09-19 17:57:43 -04001523 .init = dsps_init1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001524 .signature = DSPS_SIGNATURE,
1525};
1526
1527static struct resource msm_dsps_resources[] = {
1528 {
1529 .start = PPSS_REG_PHYS_BASE,
1530 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
1531 .name = "ppss_reg",
1532 .flags = IORESOURCE_MEM,
1533 },
1534};
1535
1536struct platform_device msm_dsps_device = {
1537 .name = "msm_dsps",
1538 .id = 0,
1539 .num_resources = ARRAY_SIZE(msm_dsps_resources),
1540 .resource = msm_dsps_resources,
1541 .dev.platform_data = &msm_dsps_pdata,
1542};
1543
1544#endif /* CONFIG_MSM_DSPS */
1545
1546#ifdef CONFIG_FB_MSM_TVOUT
1547static struct resource msm_tvenc_resources[] = {
1548 {
1549 .name = "tvenc",
1550 .start = TVENC_HW_BASE,
1551 .end = TVENC_HW_BASE + PAGE_SIZE - 1,
1552 .flags = IORESOURCE_MEM,
1553 }
1554};
1555
1556static struct resource tvout_device_resources[] = {
1557 {
1558 .name = "tvout_device_irq",
1559 .start = TV_ENC_IRQ,
1560 .end = TV_ENC_IRQ,
1561 .flags = IORESOURCE_IRQ,
1562 },
1563};
1564#endif
1565static void __init msm_register_device(struct platform_device *pdev, void *data)
1566{
1567 int ret;
1568
1569 pdev->dev.platform_data = data;
1570
1571 ret = platform_device_register(pdev);
1572 if (ret)
1573 dev_err(&pdev->dev,
1574 "%s: platform_device_register() failed = %d\n",
1575 __func__, ret);
1576}
1577
1578static struct platform_device msm_lcdc_device = {
1579 .name = "lcdc",
1580 .id = 0,
1581};
1582
1583#ifdef CONFIG_FB_MSM_TVOUT
1584static struct platform_device msm_tvenc_device = {
1585 .name = "tvenc",
1586 .id = 0,
1587 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1588 .resource = msm_tvenc_resources,
1589};
1590
1591static struct platform_device msm_tvout_device = {
1592 .name = "tvout_device",
1593 .id = 0,
1594 .num_resources = ARRAY_SIZE(tvout_device_resources),
1595 .resource = tvout_device_resources,
1596};
1597#endif
1598
1599#ifdef CONFIG_MSM_BUS_SCALING
1600static struct platform_device msm_dtv_device = {
1601 .name = "dtv",
1602 .id = 0,
1603};
1604#endif
1605
1606void __init msm_fb_register_device(char *name, void *data)
1607{
1608 if (!strncmp(name, "mdp", 3))
1609 msm_register_device(&msm_mdp_device, data);
1610 else if (!strncmp(name, "lcdc", 4))
1611 msm_register_device(&msm_lcdc_device, data);
1612 else if (!strncmp(name, "mipi_dsi", 8))
1613 msm_register_device(&msm_mipi_dsi_device, data);
1614#ifdef CONFIG_FB_MSM_TVOUT
1615 else if (!strncmp(name, "tvenc", 5))
1616 msm_register_device(&msm_tvenc_device, data);
1617 else if (!strncmp(name, "tvout_device", 12))
1618 msm_register_device(&msm_tvout_device, data);
1619#endif
1620#ifdef CONFIG_MSM_BUS_SCALING
1621 else if (!strncmp(name, "dtv", 3))
1622 msm_register_device(&msm_dtv_device, data);
1623#endif
1624 else
1625 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1626}
1627
1628static struct resource resources_otg[] = {
1629 {
1630 .start = 0x12500000,
1631 .end = 0x12500000 + SZ_1K - 1,
1632 .flags = IORESOURCE_MEM,
1633 },
1634 {
1635 .start = USB1_HS_IRQ,
1636 .end = USB1_HS_IRQ,
1637 .flags = IORESOURCE_IRQ,
1638 },
1639};
1640
1641struct platform_device msm_device_otg = {
1642 .name = "msm_otg",
1643 .id = -1,
1644 .num_resources = ARRAY_SIZE(resources_otg),
1645 .resource = resources_otg,
1646};
1647
1648static u64 dma_mask = 0xffffffffULL;
1649struct platform_device msm_device_gadget_peripheral = {
1650 .name = "msm_hsusb",
1651 .id = -1,
1652 .dev = {
1653 .dma_mask = &dma_mask,
1654 .coherent_dma_mask = 0xffffffffULL,
1655 },
1656};
1657#ifdef CONFIG_USB_EHCI_MSM_72K
1658static struct resource resources_hsusb_host[] = {
1659 {
1660 .start = 0x12500000,
1661 .end = 0x12500000 + SZ_1K - 1,
1662 .flags = IORESOURCE_MEM,
1663 },
1664 {
1665 .start = USB1_HS_IRQ,
1666 .end = USB1_HS_IRQ,
1667 .flags = IORESOURCE_IRQ,
1668 },
1669};
1670
1671struct platform_device msm_device_hsusb_host = {
1672 .name = "msm_hsusb_host",
1673 .id = 0,
1674 .num_resources = ARRAY_SIZE(resources_hsusb_host),
1675 .resource = resources_hsusb_host,
1676 .dev = {
1677 .dma_mask = &dma_mask,
1678 .coherent_dma_mask = 0xffffffffULL,
1679 },
1680};
1681
1682static struct platform_device *msm_host_devices[] = {
1683 &msm_device_hsusb_host,
1684};
1685
1686int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1687{
1688 struct platform_device *pdev;
1689
1690 pdev = msm_host_devices[host];
1691 if (!pdev)
1692 return -ENODEV;
1693 pdev->dev.platform_data = plat;
1694 return platform_device_register(pdev);
1695}
1696#endif
1697
1698#define MSM_TSIF0_PHYS (0x18200000)
1699#define MSM_TSIF1_PHYS (0x18201000)
1700#define MSM_TSIF_SIZE (0x200)
1701#define TCSR_ADM_0_A_CRCI_MUX_SEL 0x0070
1702
1703#define TSIF_0_CLK GPIO_CFG(93, 1, GPIO_CFG_INPUT, \
1704 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1705#define TSIF_0_EN GPIO_CFG(94, 1, GPIO_CFG_INPUT, \
1706 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1707#define TSIF_0_DATA GPIO_CFG(95, 1, GPIO_CFG_INPUT, \
1708 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1709#define TSIF_0_SYNC GPIO_CFG(96, 1, GPIO_CFG_INPUT, \
1710 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1711#define TSIF_1_CLK GPIO_CFG(97, 1, GPIO_CFG_INPUT, \
1712 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1713#define TSIF_1_EN GPIO_CFG(98, 1, GPIO_CFG_INPUT, \
1714 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1715#define TSIF_1_DATA GPIO_CFG(99, 1, GPIO_CFG_INPUT, \
1716 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1717#define TSIF_1_SYNC GPIO_CFG(100, 1, GPIO_CFG_INPUT, \
1718 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1719
1720static const struct msm_gpio tsif0_gpios[] = {
1721 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1722 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1723 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1724 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1725};
1726
1727static const struct msm_gpio tsif1_gpios[] = {
1728 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1729 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1730 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1731 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1732};
1733
1734static void tsif_release(struct device *dev)
1735{
1736}
1737
1738static void tsif_init1(struct msm_tsif_platform_data *data)
1739{
1740 int val;
1741
1742 /* configure mux to use correct tsif instance */
1743 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1744 val |= 0x80000000;
1745 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1746}
1747
1748struct msm_tsif_platform_data tsif1_platform_data = {
1749 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1750 .gpios = tsif1_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001751 .tsif_pclk = "iface_clk",
1752 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001753 .init = tsif_init1
1754};
1755
1756struct resource tsif1_resources[] = {
1757 [0] = {
1758 .flags = IORESOURCE_IRQ,
1759 .start = TSIF2_IRQ,
1760 .end = TSIF2_IRQ,
1761 },
1762 [1] = {
1763 .flags = IORESOURCE_MEM,
1764 .start = MSM_TSIF1_PHYS,
1765 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1766 },
1767 [2] = {
1768 .flags = IORESOURCE_DMA,
1769 .start = DMOV_TSIF_CHAN,
1770 .end = DMOV_TSIF_CRCI,
1771 },
1772};
1773
1774static void tsif_init0(struct msm_tsif_platform_data *data)
1775{
1776 int val;
1777
1778 /* configure mux to use correct tsif instance */
1779 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1780 val &= 0x7FFFFFFF;
1781 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1782}
1783
1784struct msm_tsif_platform_data tsif0_platform_data = {
1785 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1786 .gpios = tsif0_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001787 .tsif_pclk = "iface_clk",
1788 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001789 .init = tsif_init0
1790};
1791struct resource tsif0_resources[] = {
1792 [0] = {
1793 .flags = IORESOURCE_IRQ,
1794 .start = TSIF1_IRQ,
1795 .end = TSIF1_IRQ,
1796 },
1797 [1] = {
1798 .flags = IORESOURCE_MEM,
1799 .start = MSM_TSIF0_PHYS,
1800 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1801 },
1802 [2] = {
1803 .flags = IORESOURCE_DMA,
1804 .start = DMOV_TSIF_CHAN,
1805 .end = DMOV_TSIF_CRCI,
1806 },
1807};
1808
1809struct platform_device msm_device_tsif[2] = {
1810 {
1811 .name = "msm_tsif",
1812 .id = 0,
1813 .num_resources = ARRAY_SIZE(tsif0_resources),
1814 .resource = tsif0_resources,
1815 .dev = {
1816 .release = tsif_release,
1817 .platform_data = &tsif0_platform_data
1818 },
1819 },
1820 {
1821 .name = "msm_tsif",
1822 .id = 1,
1823 .num_resources = ARRAY_SIZE(tsif1_resources),
1824 .resource = tsif1_resources,
1825 .dev = {
1826 .release = tsif_release,
1827 .platform_data = &tsif1_platform_data
1828 },
1829 }
1830};
1831
1832struct platform_device msm_device_smd = {
1833 .name = "msm_smd",
1834 .id = -1,
1835};
1836
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001837static struct msm_watchdog_pdata msm_watchdog_pdata = {
1838 .pet_time = 10000,
1839 .bark_time = 11000,
1840 .has_secure = true,
1841};
1842
1843struct platform_device msm8660_device_watchdog = {
1844 .name = "msm_watchdog",
1845 .id = -1,
1846 .dev = {
1847 .platform_data = &msm_watchdog_pdata,
1848 },
1849};
1850
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001851static struct resource msm_dmov_resource_adm0[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001852 {
1853 .start = INT_ADM0_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001854 .flags = IORESOURCE_IRQ,
1855 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001856 {
1857 .start = 0x18320000,
1858 .end = 0x18320000 + SZ_1M - 1,
1859 .flags = IORESOURCE_MEM,
1860 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001861};
1862
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001863static struct resource msm_dmov_resource_adm1[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001864 {
1865 .start = INT_ADM1_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001866 .flags = IORESOURCE_IRQ,
1867 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001868 {
1869 .start = 0x18420000,
1870 .end = 0x18420000 + SZ_1M - 1,
1871 .flags = IORESOURCE_MEM,
1872 },
1873};
1874
1875static struct msm_dmov_pdata msm_dmov_pdata_adm0 = {
1876 .sd = 1,
1877 .sd_size = 0x800,
1878};
1879
1880static struct msm_dmov_pdata msm_dmov_pdata_adm1 = {
1881 .sd = 1,
1882 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001883};
1884
1885struct platform_device msm_device_dmov_adm0 = {
1886 .name = "msm_dmov",
1887 .id = 0,
1888 .resource = msm_dmov_resource_adm0,
1889 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm0),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001890 .dev = {
1891 .platform_data = &msm_dmov_pdata_adm0,
1892 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001893};
1894
1895struct platform_device msm_device_dmov_adm1 = {
1896 .name = "msm_dmov",
1897 .id = 1,
1898 .resource = msm_dmov_resource_adm1,
1899 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm1),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001900 .dev = {
1901 .platform_data = &msm_dmov_pdata_adm1,
1902 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001903};
1904
1905/* MSM Video core device */
1906#ifdef CONFIG_MSM_BUS_SCALING
1907static struct msm_bus_vectors vidc_init_vectors[] = {
1908 {
1909 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1910 .dst = MSM_BUS_SLAVE_SMI,
1911 .ab = 0,
1912 .ib = 0,
1913 },
1914 {
1915 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1916 .dst = MSM_BUS_SLAVE_SMI,
1917 .ab = 0,
1918 .ib = 0,
1919 },
1920 {
1921 .src = MSM_BUS_MASTER_AMPSS_M0,
1922 .dst = MSM_BUS_SLAVE_EBI_CH0,
1923 .ab = 0,
1924 .ib = 0,
1925 },
1926 {
1927 .src = MSM_BUS_MASTER_AMPSS_M0,
1928 .dst = MSM_BUS_SLAVE_SMI,
1929 .ab = 0,
1930 .ib = 0,
1931 },
1932};
1933static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
1934 {
1935 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1936 .dst = MSM_BUS_SLAVE_SMI,
1937 .ab = 54525952,
1938 .ib = 436207616,
1939 },
1940 {
1941 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1942 .dst = MSM_BUS_SLAVE_SMI,
1943 .ab = 72351744,
1944 .ib = 289406976,
1945 },
1946 {
1947 .src = MSM_BUS_MASTER_AMPSS_M0,
1948 .dst = MSM_BUS_SLAVE_EBI_CH0,
1949 .ab = 500000,
1950 .ib = 1000000,
1951 },
1952 {
1953 .src = MSM_BUS_MASTER_AMPSS_M0,
1954 .dst = MSM_BUS_SLAVE_SMI,
1955 .ab = 500000,
1956 .ib = 1000000,
1957 },
1958};
1959static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
1960 {
1961 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1962 .dst = MSM_BUS_SLAVE_SMI,
1963 .ab = 40894464,
1964 .ib = 327155712,
1965 },
1966 {
1967 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1968 .dst = MSM_BUS_SLAVE_SMI,
1969 .ab = 48234496,
1970 .ib = 192937984,
1971 },
1972 {
1973 .src = MSM_BUS_MASTER_AMPSS_M0,
1974 .dst = MSM_BUS_SLAVE_EBI_CH0,
1975 .ab = 500000,
1976 .ib = 2000000,
1977 },
1978 {
1979 .src = MSM_BUS_MASTER_AMPSS_M0,
1980 .dst = MSM_BUS_SLAVE_SMI,
1981 .ab = 500000,
1982 .ib = 2000000,
1983 },
1984};
1985static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
1986 {
1987 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1988 .dst = MSM_BUS_SLAVE_SMI,
1989 .ab = 163577856,
1990 .ib = 1308622848,
1991 },
1992 {
1993 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1994 .dst = MSM_BUS_SLAVE_SMI,
1995 .ab = 219152384,
1996 .ib = 876609536,
1997 },
1998 {
1999 .src = MSM_BUS_MASTER_AMPSS_M0,
2000 .dst = MSM_BUS_SLAVE_EBI_CH0,
2001 .ab = 1750000,
2002 .ib = 3500000,
2003 },
2004 {
2005 .src = MSM_BUS_MASTER_AMPSS_M0,
2006 .dst = MSM_BUS_SLAVE_SMI,
2007 .ab = 1750000,
2008 .ib = 3500000,
2009 },
2010};
2011static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
2012 {
2013 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2014 .dst = MSM_BUS_SLAVE_SMI,
2015 .ab = 121634816,
2016 .ib = 973078528,
2017 },
2018 {
2019 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2020 .dst = MSM_BUS_SLAVE_SMI,
2021 .ab = 155189248,
2022 .ib = 620756992,
2023 },
2024 {
2025 .src = MSM_BUS_MASTER_AMPSS_M0,
2026 .dst = MSM_BUS_SLAVE_EBI_CH0,
2027 .ab = 1750000,
2028 .ib = 7000000,
2029 },
2030 {
2031 .src = MSM_BUS_MASTER_AMPSS_M0,
2032 .dst = MSM_BUS_SLAVE_SMI,
2033 .ab = 1750000,
2034 .ib = 7000000,
2035 },
2036};
2037static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
2038 {
2039 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2040 .dst = MSM_BUS_SLAVE_SMI,
2041 .ab = 372244480,
2042 .ib = 1861222400,
2043 },
2044 {
2045 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2046 .dst = MSM_BUS_SLAVE_SMI,
2047 .ab = 501219328,
2048 .ib = 2004877312,
2049 },
2050 {
2051 .src = MSM_BUS_MASTER_AMPSS_M0,
2052 .dst = MSM_BUS_SLAVE_EBI_CH0,
2053 .ab = 2500000,
2054 .ib = 5000000,
2055 },
2056 {
2057 .src = MSM_BUS_MASTER_AMPSS_M0,
2058 .dst = MSM_BUS_SLAVE_SMI,
2059 .ab = 2500000,
2060 .ib = 5000000,
2061 },
2062};
2063static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
2064 {
2065 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2066 .dst = MSM_BUS_SLAVE_SMI,
2067 .ab = 222298112,
2068 .ib = 1778384896,
2069 },
2070 {
2071 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2072 .dst = MSM_BUS_SLAVE_SMI,
2073 .ab = 330301440,
2074 .ib = 1321205760,
2075 },
2076 {
2077 .src = MSM_BUS_MASTER_AMPSS_M0,
2078 .dst = MSM_BUS_SLAVE_EBI_CH0,
2079 .ab = 2500000,
2080 .ib = 700000000,
2081 },
2082 {
2083 .src = MSM_BUS_MASTER_AMPSS_M0,
2084 .dst = MSM_BUS_SLAVE_SMI,
2085 .ab = 2500000,
2086 .ib = 10000000,
2087 },
2088};
2089
2090static struct msm_bus_paths vidc_bus_client_config[] = {
2091 {
2092 ARRAY_SIZE(vidc_init_vectors),
2093 vidc_init_vectors,
2094 },
2095 {
2096 ARRAY_SIZE(vidc_venc_vga_vectors),
2097 vidc_venc_vga_vectors,
2098 },
2099 {
2100 ARRAY_SIZE(vidc_vdec_vga_vectors),
2101 vidc_vdec_vga_vectors,
2102 },
2103 {
2104 ARRAY_SIZE(vidc_venc_720p_vectors),
2105 vidc_venc_720p_vectors,
2106 },
2107 {
2108 ARRAY_SIZE(vidc_vdec_720p_vectors),
2109 vidc_vdec_720p_vectors,
2110 },
2111 {
2112 ARRAY_SIZE(vidc_venc_1080p_vectors),
2113 vidc_venc_1080p_vectors,
2114 },
2115 {
2116 ARRAY_SIZE(vidc_vdec_1080p_vectors),
2117 vidc_vdec_1080p_vectors,
2118 },
2119};
2120
2121static struct msm_bus_scale_pdata vidc_bus_client_data = {
2122 vidc_bus_client_config,
2123 ARRAY_SIZE(vidc_bus_client_config),
2124 .name = "vidc",
2125};
2126
2127#endif
2128
2129#define MSM_VIDC_BASE_PHYS 0x04400000
2130#define MSM_VIDC_BASE_SIZE 0x00100000
2131
2132static struct resource msm_device_vidc_resources[] = {
2133 {
2134 .start = MSM_VIDC_BASE_PHYS,
2135 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
2136 .flags = IORESOURCE_MEM,
2137 },
2138 {
2139 .start = VCODEC_IRQ,
2140 .end = VCODEC_IRQ,
2141 .flags = IORESOURCE_IRQ,
2142 },
2143};
2144
2145struct msm_vidc_platform_data vidc_platform_data = {
2146#ifdef CONFIG_MSM_BUS_SCALING
2147 .vidc_bus_client_pdata = &vidc_bus_client_data,
2148#endif
2149 .memtype = MEMTYPE_SMI_KERNEL
2150};
2151
2152struct platform_device msm_device_vidc = {
2153 .name = "msm_vidc",
2154 .id = 0,
2155 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
2156 .resource = msm_device_vidc_resources,
2157 .dev = {
2158 .platform_data = &vidc_platform_data,
2159 },
2160};
2161
2162#if defined(CONFIG_MSM_RPM_STATS_LOG)
2163static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2164 .phys_addr_base = 0x00107E04,
2165 .phys_size = SZ_8K,
2166};
2167
2168struct platform_device msm_rpm_stat_device = {
2169 .name = "msm_rpm_stat",
2170 .id = -1,
2171 .dev = {
2172 .platform_data = &msm_rpm_stat_pdata,
2173 },
2174};
2175#endif
2176
2177#ifdef CONFIG_MSM_MPM
2178static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = {
2179 [1] = MSM_GPIO_TO_INT(61),
2180 [4] = MSM_GPIO_TO_INT(87),
2181 [5] = MSM_GPIO_TO_INT(88),
2182 [6] = MSM_GPIO_TO_INT(89),
2183 [7] = MSM_GPIO_TO_INT(90),
2184 [8] = MSM_GPIO_TO_INT(91),
2185 [9] = MSM_GPIO_TO_INT(34),
2186 [10] = MSM_GPIO_TO_INT(38),
2187 [11] = MSM_GPIO_TO_INT(42),
2188 [12] = MSM_GPIO_TO_INT(46),
2189 [13] = MSM_GPIO_TO_INT(50),
2190 [14] = MSM_GPIO_TO_INT(54),
2191 [15] = MSM_GPIO_TO_INT(58),
2192 [16] = MSM_GPIO_TO_INT(63),
2193 [17] = MSM_GPIO_TO_INT(160),
2194 [18] = MSM_GPIO_TO_INT(162),
2195 [19] = MSM_GPIO_TO_INT(144),
2196 [20] = MSM_GPIO_TO_INT(146),
2197 [25] = USB1_HS_IRQ,
2198 [26] = TV_ENC_IRQ,
2199 [27] = HDMI_IRQ,
2200 [29] = MSM_GPIO_TO_INT(123),
2201 [30] = MSM_GPIO_TO_INT(172),
2202 [31] = MSM_GPIO_TO_INT(99),
2203 [32] = MSM_GPIO_TO_INT(96),
2204 [33] = MSM_GPIO_TO_INT(67),
2205 [34] = MSM_GPIO_TO_INT(71),
2206 [35] = MSM_GPIO_TO_INT(105),
2207 [36] = MSM_GPIO_TO_INT(117),
2208 [37] = MSM_GPIO_TO_INT(29),
2209 [38] = MSM_GPIO_TO_INT(30),
2210 [39] = MSM_GPIO_TO_INT(31),
2211 [40] = MSM_GPIO_TO_INT(37),
2212 [41] = MSM_GPIO_TO_INT(40),
2213 [42] = MSM_GPIO_TO_INT(41),
2214 [43] = MSM_GPIO_TO_INT(45),
2215 [44] = MSM_GPIO_TO_INT(51),
2216 [45] = MSM_GPIO_TO_INT(52),
2217 [46] = MSM_GPIO_TO_INT(57),
2218 [47] = MSM_GPIO_TO_INT(73),
2219 [48] = MSM_GPIO_TO_INT(93),
2220 [49] = MSM_GPIO_TO_INT(94),
2221 [50] = MSM_GPIO_TO_INT(103),
2222 [51] = MSM_GPIO_TO_INT(104),
2223 [52] = MSM_GPIO_TO_INT(106),
2224 [53] = MSM_GPIO_TO_INT(115),
2225 [54] = MSM_GPIO_TO_INT(124),
2226 [55] = MSM_GPIO_TO_INT(125),
2227 [56] = MSM_GPIO_TO_INT(126),
2228 [57] = MSM_GPIO_TO_INT(127),
2229 [58] = MSM_GPIO_TO_INT(128),
2230 [59] = MSM_GPIO_TO_INT(129),
2231};
2232
2233static uint16_t msm_mpm_bypassed_apps_irqs[] = {
2234 TLMM_MSM_SUMMARY_IRQ,
2235 RPM_SCSS_CPU0_GP_HIGH_IRQ,
2236 RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2237 RPM_SCSS_CPU0_GP_LOW_IRQ,
2238 RPM_SCSS_CPU0_WAKE_UP_IRQ,
2239 RPM_SCSS_CPU1_GP_HIGH_IRQ,
2240 RPM_SCSS_CPU1_GP_MEDIUM_IRQ,
2241 RPM_SCSS_CPU1_GP_LOW_IRQ,
2242 RPM_SCSS_CPU1_WAKE_UP_IRQ,
2243 MARM_SCSS_GP_IRQ_0,
2244 MARM_SCSS_GP_IRQ_1,
2245 MARM_SCSS_GP_IRQ_2,
2246 MARM_SCSS_GP_IRQ_3,
2247 MARM_SCSS_GP_IRQ_4,
2248 MARM_SCSS_GP_IRQ_5,
2249 MARM_SCSS_GP_IRQ_6,
2250 MARM_SCSS_GP_IRQ_7,
2251 MARM_SCSS_GP_IRQ_8,
2252 MARM_SCSS_GP_IRQ_9,
2253 LPASS_SCSS_GP_LOW_IRQ,
2254 LPASS_SCSS_GP_MEDIUM_IRQ,
2255 LPASS_SCSS_GP_HIGH_IRQ,
2256 SDC4_IRQ_0,
2257 SPS_MTI_31,
2258};
2259
2260struct msm_mpm_device_data msm_mpm_dev_data = {
2261 .irqs_m2a = msm_mpm_irqs_m2a,
2262 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2263 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2264 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2265 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2266 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2267 .mpm_apps_ipc_reg = MSM_GCC_BASE + 0x008,
2268 .mpm_apps_ipc_val = BIT(1),
2269 .mpm_ipc_irq = RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2270
2271};
2272#endif
2273
2274
2275#ifdef CONFIG_MSM_BUS_SCALING
2276struct platform_device msm_bus_sys_fabric = {
2277 .name = "msm_bus_fabric",
2278 .id = MSM_BUS_FAB_SYSTEM,
2279};
2280struct platform_device msm_bus_apps_fabric = {
2281 .name = "msm_bus_fabric",
2282 .id = MSM_BUS_FAB_APPSS,
2283};
2284struct platform_device msm_bus_mm_fabric = {
2285 .name = "msm_bus_fabric",
2286 .id = MSM_BUS_FAB_MMSS,
2287};
2288struct platform_device msm_bus_sys_fpb = {
2289 .name = "msm_bus_fabric",
2290 .id = MSM_BUS_FAB_SYSTEM_FPB,
2291};
2292struct platform_device msm_bus_cpss_fpb = {
2293 .name = "msm_bus_fabric",
2294 .id = MSM_BUS_FAB_CPSS_FPB,
2295};
2296#endif
2297
Lei Zhou01366a42011-08-19 13:12:00 -04002298#ifdef CONFIG_SND_SOC_MSM8660_APQ
2299struct platform_device msm_pcm = {
2300 .name = "msm-pcm-dsp",
2301 .id = -1,
2302};
2303
2304struct platform_device msm_pcm_routing = {
2305 .name = "msm-pcm-routing",
2306 .id = -1,
2307};
2308
2309struct platform_device msm_cpudai0 = {
2310 .name = "msm-dai-q6",
2311 .id = PRIMARY_I2S_RX,
2312};
2313
2314struct platform_device msm_cpudai1 = {
2315 .name = "msm-dai-q6",
2316 .id = PRIMARY_I2S_TX,
2317};
2318
2319struct platform_device msm_cpudai_hdmi_rx = {
2320 .name = "msm-dai-q6",
2321 .id = HDMI_RX,
2322};
2323
2324struct platform_device msm_cpudai_bt_rx = {
2325 .name = "msm-dai-q6",
2326 .id = INT_BT_SCO_RX,
2327};
2328
2329struct platform_device msm_cpudai_bt_tx = {
2330 .name = "msm-dai-q6",
2331 .id = INT_BT_SCO_TX,
2332};
2333
2334struct platform_device msm_cpudai_fm_rx = {
2335 .name = "msm-dai-q6",
2336 .id = INT_FM_RX,
2337};
2338
2339struct platform_device msm_cpudai_fm_tx = {
2340 .name = "msm-dai-q6",
2341 .id = INT_FM_TX,
2342};
2343
2344struct platform_device msm_cpu_fe = {
2345 .name = "msm-dai-fe",
2346 .id = -1,
2347};
2348
2349struct platform_device msm_stub_codec = {
2350 .name = "msm-stub-codec",
2351 .id = 1,
2352};
2353
2354struct platform_device msm_voice = {
2355 .name = "msm-pcm-voice",
2356 .id = -1,
2357};
2358
2359struct platform_device msm_voip = {
2360 .name = "msm-voip-dsp",
2361 .id = -1,
2362};
2363
2364struct platform_device msm_lpa_pcm = {
2365 .name = "msm-pcm-lpa",
2366 .id = -1,
2367};
2368
2369struct platform_device msm_pcm_hostless = {
2370 .name = "msm-pcm-hostless",
2371 .id = -1,
2372};
2373#endif
2374
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002375struct platform_device asoc_msm_pcm = {
2376 .name = "msm-dsp-audio",
2377 .id = 0,
2378};
2379
2380struct platform_device asoc_msm_dai0 = {
2381 .name = "msm-codec-dai",
2382 .id = 0,
2383};
2384
2385struct platform_device asoc_msm_dai1 = {
2386 .name = "msm-cpu-dai",
2387 .id = 0,
2388};
2389
2390#if defined (CONFIG_MSM_8x60_VOIP)
2391struct platform_device asoc_msm_mvs = {
2392 .name = "msm-mvs-audio",
2393 .id = 0,
2394};
2395
2396struct platform_device asoc_mvs_dai0 = {
2397 .name = "mvs-codec-dai",
2398 .id = 0,
2399};
2400
2401struct platform_device asoc_mvs_dai1 = {
2402 .name = "mvs-cpu-dai",
2403 .id = 0,
2404};
2405#endif
2406
2407struct platform_device *msm_footswitch_devices[] = {
2408 FS_8X60(FS_IJPEG, "fs_ijpeg"),
2409 FS_8X60(FS_MDP, "fs_mdp"),
2410 FS_8X60(FS_ROT, "fs_rot"),
2411 FS_8X60(FS_VED, "fs_ved"),
2412 FS_8X60(FS_VFE, "fs_vfe"),
2413 FS_8X60(FS_VPE, "fs_vpe"),
2414 FS_8X60(FS_GFX3D, "fs_gfx3d"),
2415 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
2416 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
2417};
2418unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
2419
2420#ifdef CONFIG_MSM_RPM
2421struct msm_rpm_map_data rpm_map_data[] __initdata = {
2422 MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2423 MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2424 MSM_RPM_MAP(TRIGGER_SET_FROM, TRIGGER_SET, 1),
2425 MSM_RPM_MAP(TRIGGER_SET_TO, TRIGGER_SET, 1),
2426 MSM_RPM_MAP(TRIGGER_SET_TRIGGER, TRIGGER_SET, 1),
2427 MSM_RPM_MAP(TRIGGER_CLEAR_FROM, TRIGGER_CLEAR, 1),
2428 MSM_RPM_MAP(TRIGGER_CLEAR_TO, TRIGGER_CLEAR, 1),
2429 MSM_RPM_MAP(TRIGGER_CLEAR_TRIGGER, TRIGGER_CLEAR, 1),
2430
2431 MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1),
2432 MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1),
2433 MSM_RPM_MAP(PLL_4, PLL_4, 1),
2434 MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2435 MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2436 MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2437 MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2438 MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1),
2439 MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1),
2440 MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1),
2441 MSM_RPM_MAP(SMI_CLK, SMI_CLK, 1),
2442 MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1),
2443
2444 MSM_RPM_MAP(APPS_L2_CACHE_CTL, APPS_L2_CACHE_CTL, 1),
2445
2446 MSM_RPM_MAP(APPS_FABRIC_HALT_0, APPS_FABRIC_HALT, 2),
2447 MSM_RPM_MAP(APPS_FABRIC_CLOCK_MODE_0, APPS_FABRIC_CLOCK_MODE, 3),
2448 MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6),
2449
2450 MSM_RPM_MAP(SYSTEM_FABRIC_HALT_0, SYSTEM_FABRIC_HALT, 2),
2451 MSM_RPM_MAP(SYSTEM_FABRIC_CLOCK_MODE_0, SYSTEM_FABRIC_CLOCK_MODE, 3),
2452 MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 22),
2453
2454 MSM_RPM_MAP(MM_FABRIC_HALT_0, MM_FABRIC_HALT, 2),
2455 MSM_RPM_MAP(MM_FABRIC_CLOCK_MODE_0, MM_FABRIC_CLOCK_MODE, 3),
2456 MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2457
2458 MSM_RPM_MAP(SMPS0B_0, SMPS0B, 2),
2459 MSM_RPM_MAP(SMPS1B_0, SMPS1B, 2),
2460 MSM_RPM_MAP(SMPS2B_0, SMPS2B, 2),
2461 MSM_RPM_MAP(SMPS3B_0, SMPS3B, 2),
2462 MSM_RPM_MAP(SMPS4B_0, SMPS4B, 2),
2463 MSM_RPM_MAP(LDO0B_0, LDO0B, 2),
2464 MSM_RPM_MAP(LDO1B_0, LDO1B, 2),
2465 MSM_RPM_MAP(LDO2B_0, LDO2B, 2),
2466 MSM_RPM_MAP(LDO3B_0, LDO3B, 2),
2467 MSM_RPM_MAP(LDO4B_0, LDO4B, 2),
2468 MSM_RPM_MAP(LDO5B_0, LDO5B, 2),
2469 MSM_RPM_MAP(LDO6B_0, LDO6B, 2),
2470 MSM_RPM_MAP(LVS0B, LVS0B, 1),
2471 MSM_RPM_MAP(LVS1B, LVS1B, 1),
2472 MSM_RPM_MAP(LVS2B, LVS2B, 1),
2473 MSM_RPM_MAP(LVS3B, LVS3B, 1),
2474 MSM_RPM_MAP(MVS, MVS, 1),
2475
2476 MSM_RPM_MAP(SMPS0_0, SMPS0, 2),
2477 MSM_RPM_MAP(SMPS1_0, SMPS1, 2),
2478 MSM_RPM_MAP(SMPS2_0, SMPS2, 2),
2479 MSM_RPM_MAP(SMPS3_0, SMPS3, 2),
2480 MSM_RPM_MAP(SMPS4_0, SMPS4, 2),
2481 MSM_RPM_MAP(LDO0_0, LDO0, 2),
2482 MSM_RPM_MAP(LDO1_0, LDO1, 2),
2483 MSM_RPM_MAP(LDO2_0, LDO2, 2),
2484 MSM_RPM_MAP(LDO3_0, LDO3, 2),
2485 MSM_RPM_MAP(LDO4_0, LDO4, 2),
2486 MSM_RPM_MAP(LDO5_0, LDO5, 2),
2487 MSM_RPM_MAP(LDO6_0, LDO6, 2),
2488 MSM_RPM_MAP(LDO7_0, LDO7, 2),
2489 MSM_RPM_MAP(LDO8_0, LDO8, 2),
2490 MSM_RPM_MAP(LDO9_0, LDO9, 2),
2491 MSM_RPM_MAP(LDO10_0, LDO10, 2),
2492 MSM_RPM_MAP(LDO11_0, LDO11, 2),
2493 MSM_RPM_MAP(LDO12_0, LDO12, 2),
2494 MSM_RPM_MAP(LDO13_0, LDO13, 2),
2495 MSM_RPM_MAP(LDO14_0, LDO14, 2),
2496 MSM_RPM_MAP(LDO15_0, LDO15, 2),
2497 MSM_RPM_MAP(LDO16_0, LDO16, 2),
2498 MSM_RPM_MAP(LDO17_0, LDO17, 2),
2499 MSM_RPM_MAP(LDO18_0, LDO18, 2),
2500 MSM_RPM_MAP(LDO19_0, LDO19, 2),
2501 MSM_RPM_MAP(LDO20_0, LDO20, 2),
2502 MSM_RPM_MAP(LDO21_0, LDO21, 2),
2503 MSM_RPM_MAP(LDO22_0, LDO22, 2),
2504 MSM_RPM_MAP(LDO23_0, LDO23, 2),
2505 MSM_RPM_MAP(LDO24_0, LDO24, 2),
2506 MSM_RPM_MAP(LDO25_0, LDO25, 2),
2507 MSM_RPM_MAP(LVS0, LVS0, 1),
2508 MSM_RPM_MAP(LVS1, LVS1, 1),
2509 MSM_RPM_MAP(NCP_0, NCP, 2),
2510
2511 MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1),
2512};
2513unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data);
2514
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002515struct platform_device msm_rpm_device = {
2516 .name = "msm_rpm",
2517 .id = -1,
2518};
2519
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002520#endif