blob: 3920abeaec7a19e0f45aa4b4ba1fea4a2ca2acb7 [file] [log] [blame]
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05301/* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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>
Deepak Kotur12301a72011-11-09 18:30:29 -080018#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <mach/irqs.h>
20#include <mach/dma.h>
21#include <asm/mach/mmc.h>
22#include <asm/clkdev.h>
Jordan Crouse914de9b2012-07-09 13:49:46 -060023#include <mach/kgsl.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070024#include <linux/msm_rotator.h>
25#include <mach/msm_hsusb.h>
26#include "footswitch.h"
27#include "clock.h"
28#include "clock-rpm.h"
29#include "clock-voter.h"
30#include "devices.h"
31#include "devices-msm8x60.h"
32#include <linux/dma-mapping.h>
33#include <linux/irq.h>
34#include <linux/clk.h>
35#include <asm/hardware/gic.h>
36#include <asm/mach-types.h>
37#include <asm/clkdev.h>
38#include <mach/msm_serial_hs_lite.h>
39#include <mach/msm_bus.h>
40#include <mach/msm_bus_board.h>
41#include <mach/socinfo.h>
42#include <mach/msm_memtypes.h>
43#include <mach/msm_tsif.h>
44#include <mach/scm-io.h>
45#ifdef CONFIG_MSM_DSPS
46#include <mach/msm_dsps.h>
47#endif
48#include <linux/android_pmem.h>
49#include <linux/gpio.h>
50#include <linux/delay.h>
51#include <mach/mdm.h>
52#include <mach/rpm.h>
53#include <mach/board.h>
Lei Zhou01366a42011-08-19 13:12:00 -040054#include <sound/apr_audio.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060055#include "rpm_log.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#include "rpm_stats.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053057#include <mach/mpm.h>
Jeff Ohlstein7e668552011-10-06 16:17:25 -070058#include "msm_watchdog.h"
Laura Abbottd92be422012-06-04 15:11:09 -070059#include <mach/iommu_domains.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060
61/* Address of GSBI blocks */
62#define MSM_GSBI1_PHYS 0x16000000
63#define MSM_GSBI2_PHYS 0x16100000
64#define MSM_GSBI3_PHYS 0x16200000
65#define MSM_GSBI4_PHYS 0x16300000
66#define MSM_GSBI5_PHYS 0x16400000
67#define MSM_GSBI6_PHYS 0x16500000
68#define MSM_GSBI7_PHYS 0x16600000
69#define MSM_GSBI8_PHYS 0x19800000
70#define MSM_GSBI9_PHYS 0x19900000
71#define MSM_GSBI10_PHYS 0x19A00000
72#define MSM_GSBI11_PHYS 0x19B00000
73#define MSM_GSBI12_PHYS 0x19C00000
74
75/* GSBI QUPe devices */
76#define MSM_GSBI1_QUP_PHYS 0x16080000
77#define MSM_GSBI2_QUP_PHYS 0x16180000
78#define MSM_GSBI3_QUP_PHYS 0x16280000
79#define MSM_GSBI4_QUP_PHYS 0x16380000
80#define MSM_GSBI5_QUP_PHYS 0x16480000
81#define MSM_GSBI6_QUP_PHYS 0x16580000
82#define MSM_GSBI7_QUP_PHYS 0x16680000
83#define MSM_GSBI8_QUP_PHYS 0x19880000
84#define MSM_GSBI9_QUP_PHYS 0x19980000
85#define MSM_GSBI10_QUP_PHYS 0x19A80000
86#define MSM_GSBI11_QUP_PHYS 0x19B80000
87#define MSM_GSBI12_QUP_PHYS 0x19C80000
88
89/* GSBI UART devices */
90#define MSM_UART1DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
91#define INT_UART1DM_IRQ GSBI6_UARTDM_IRQ
92#define INT_UART2DM_IRQ GSBI12_UARTDM_IRQ
93#define MSM_UART2DM_PHYS 0x19C40000
94#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
95#define INT_UART3DM_IRQ GSBI3_UARTDM_IRQ
96#define TCSR_BASE_PHYS 0x16b00000
97
98/* PRNG device */
99#define MSM_PRNG_PHYS 0x16C00000
100#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
101#define INT_UART9DM_IRQ GSBI9_UARTDM_IRQ
102
103static void charm_ap2mdm_kpdpwr_on(void)
104{
105 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
Laura Abbotteda23372011-08-17 09:25:56 -0700106 gpio_direction_output(AP2MDM_KPDPWR_N, 1);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700107}
108
109static void charm_ap2mdm_kpdpwr_off(void)
110{
111 int i;
112
113 gpio_direction_output(AP2MDM_ERRFATAL, 1);
114
115 for (i = 20; i > 0; i--) {
116 if (gpio_get_value(MDM2AP_STATUS) == 0)
117 break;
118 msleep(100);
119 }
120 gpio_direction_output(AP2MDM_ERRFATAL, 0);
121
122 if (i == 0) {
123 pr_err("%s: MDM2AP_STATUS never went low. Doing a hard reset \
124 of the charm modem.\n", __func__);
125 gpio_direction_output(AP2MDM_PMIC_RESET_N, 1);
126 /*
127 * Currently, there is a debounce timer on the charm PMIC. It is
128 * necessary to hold the AP2MDM_PMIC_RESET low for ~3.5 seconds
129 * for the reset to fully take place. Sleep here to ensure the
130 * reset has occured before the function exits.
131 */
132 msleep(4000);
133 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
134 }
135}
136
137static struct resource charm_resources[] = {
138 /* MDM2AP_ERRFATAL */
139 {
140 .start = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
141 .end = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
142 .flags = IORESOURCE_IRQ,
143 },
144 /* MDM2AP_STATUS */
145 {
146 .start = MSM_GPIO_TO_INT(MDM2AP_STATUS),
147 .end = MSM_GPIO_TO_INT(MDM2AP_STATUS),
148 .flags = IORESOURCE_IRQ,
149 }
150};
151
152static struct charm_platform_data mdm_platform_data = {
153 .charm_modem_on = charm_ap2mdm_kpdpwr_on,
154 .charm_modem_off = charm_ap2mdm_kpdpwr_off,
155};
156
157struct platform_device msm_charm_modem = {
158 .name = "charm_modem",
159 .id = -1,
160 .num_resources = ARRAY_SIZE(charm_resources),
161 .resource = charm_resources,
162 .dev = {
163 .platform_data = &mdm_platform_data,
164 },
165};
166
Matt Wagantallbf430eb2012-03-22 11:45:49 -0700167struct platform_device msm8x60_device_acpuclk = {
168 .name = "acpuclk-8x60",
169 .id = -1,
170};
171
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700172#ifdef CONFIG_MSM_DSPS
173#define GSBI12_DEV (&msm_dsps_device.dev)
174#else
175#define GSBI12_DEV (&msm_gsbi12_qup_i2c_device.dev)
176#endif
177
178void __init msm8x60_init_irq(void)
179{
Praveen Chidambaram78499012011-11-01 17:15:17 -0600180 struct msm_mpm_device_data *data = NULL;
181
182#ifdef CONFIG_MSM_MPM
183 data = &msm8660_mpm_dev_data;
184#endif
185
186 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700187 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700188}
189
Stephen Boyd3acc9e42011-09-28 16:46:40 -0700190#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
191
192static struct resource msm_8660_q6_resources[] = {
193 {
194 .start = MSM_LPASS_QDSP6SS_PHYS,
195 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
196 .flags = IORESOURCE_MEM,
197 },
198};
199
200struct platform_device msm_pil_q6v3 = {
201 .name = "pil_qdsp6v3",
202 .id = -1,
203 .num_resources = ARRAY_SIZE(msm_8660_q6_resources),
204 .resource = msm_8660_q6_resources,
205};
206
Stephen Boyd4eb885b2011-09-29 01:16:03 -0700207#define MSM_MSS_REGS_PHYS 0x10200000
208
209static struct resource msm_8660_modem_resources[] = {
210 {
211 .start = MSM_MSS_REGS_PHYS,
212 .end = MSM_MSS_REGS_PHYS + SZ_256 - 1,
213 .flags = IORESOURCE_MEM,
214 },
215};
216
217struct platform_device msm_pil_modem = {
218 .name = "pil_modem",
219 .id = -1,
220 .num_resources = ARRAY_SIZE(msm_8660_modem_resources),
221 .resource = msm_8660_modem_resources,
222};
223
Stephen Boydd89eebe2011-09-28 23:28:11 -0700224struct platform_device msm_pil_tzapps = {
225 .name = "pil_tzapps",
226 .id = -1,
227};
228
Stephen Boyd25c4a0b2011-09-20 00:12:36 -0700229struct platform_device msm_pil_dsps = {
230 .name = "pil_dsps",
231 .id = -1,
232 .dev.platform_data = "dsps",
233};
234
Riaz Rahamandd18ebf2012-06-27 16:06:34 +0530235struct platform_device msm_pil_vidc = {
236 .name = "pil_vidc",
237 .id = -1,
238};
239
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700240static struct resource msm_uart1_dm_resources[] = {
241 {
242 .start = MSM_UART1DM_PHYS,
243 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
244 .flags = IORESOURCE_MEM,
245 },
246 {
247 .start = INT_UART1DM_IRQ,
248 .end = INT_UART1DM_IRQ,
249 .flags = IORESOURCE_IRQ,
250 },
251 {
252 /* GSBI6 is UARTDM1 */
253 .start = MSM_GSBI6_PHYS,
254 .end = MSM_GSBI6_PHYS + 4 - 1,
255 .name = "gsbi_resource",
256 .flags = IORESOURCE_MEM,
257 },
258 {
259 .start = DMOV_HSUART1_TX_CHAN,
260 .end = DMOV_HSUART1_RX_CHAN,
261 .name = "uartdm_channels",
262 .flags = IORESOURCE_DMA,
263 },
264 {
265 .start = DMOV_HSUART1_TX_CRCI,
266 .end = DMOV_HSUART1_RX_CRCI,
267 .name = "uartdm_crci",
268 .flags = IORESOURCE_DMA,
269 },
270};
271
272static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
273
274struct platform_device msm_device_uart_dm1 = {
275 .name = "msm_serial_hs",
276 .id = 0,
277 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
278 .resource = msm_uart1_dm_resources,
279 .dev = {
280 .dma_mask = &msm_uart_dm1_dma_mask,
281 .coherent_dma_mask = DMA_BIT_MASK(32),
282 },
283};
284
285static struct resource msm_uart3_dm_resources[] = {
286 {
287 .start = MSM_UART3DM_PHYS,
288 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
289 .name = "uartdm_resource",
290 .flags = IORESOURCE_MEM,
291 },
292 {
293 .start = INT_UART3DM_IRQ,
294 .end = INT_UART3DM_IRQ,
295 .flags = IORESOURCE_IRQ,
296 },
297 {
298 .start = MSM_GSBI3_PHYS,
299 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
300 .name = "gsbi_resource",
301 .flags = IORESOURCE_MEM,
302 },
303};
304
305struct platform_device msm_device_uart_dm3 = {
306 .name = "msm_serial_hsl",
307 .id = 2,
308 .num_resources = ARRAY_SIZE(msm_uart3_dm_resources),
309 .resource = msm_uart3_dm_resources,
310};
311
312static struct resource msm_uart12_dm_resources[] = {
313 {
314 .start = MSM_UART2DM_PHYS,
315 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
316 .name = "uartdm_resource",
317 .flags = IORESOURCE_MEM,
318 },
319 {
320 .start = INT_UART2DM_IRQ,
321 .end = INT_UART2DM_IRQ,
322 .flags = IORESOURCE_IRQ,
323 },
324 {
325 /* GSBI 12 is UARTDM2 */
326 .start = MSM_GSBI12_PHYS,
327 .end = MSM_GSBI12_PHYS + PAGE_SIZE - 1,
328 .name = "gsbi_resource",
329 .flags = IORESOURCE_MEM,
330 },
331};
332
333struct platform_device msm_device_uart_dm12 = {
334 .name = "msm_serial_hsl",
335 .id = 0,
336 .num_resources = ARRAY_SIZE(msm_uart12_dm_resources),
337 .resource = msm_uart12_dm_resources,
338};
339
340#ifdef CONFIG_MSM_GSBI9_UART
341static struct msm_serial_hslite_platform_data uart_gsbi9_pdata = {
342 .config_gpio = 1,
343 .uart_tx_gpio = 67,
344 .uart_rx_gpio = 66,
Stepan Moskovchenko798fe552012-03-29 19:47:19 -0700345 .line = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346};
347
348static struct resource msm_uart_gsbi9_resources[] = {
349 {
350 .start = MSM_UART9DM_PHYS,
351 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
352 .name = "uartdm_resource",
353 .flags = IORESOURCE_MEM,
354 },
355 {
356 .start = INT_UART9DM_IRQ,
357 .end = INT_UART9DM_IRQ,
358 .flags = IORESOURCE_IRQ,
359 },
360 {
361 /* GSBI 9 is UART_GSBI9 */
362 .start = MSM_GSBI9_PHYS,
363 .end = MSM_GSBI9_PHYS + PAGE_SIZE - 1,
364 .name = "gsbi_resource",
365 .flags = IORESOURCE_MEM,
366 },
367};
368struct platform_device *msm_device_uart_gsbi9;
369struct platform_device *msm_add_gsbi9_uart(void)
370{
371 return platform_device_register_resndata(NULL, "msm_serial_hsl",
372 1, msm_uart_gsbi9_resources,
373 ARRAY_SIZE(msm_uart_gsbi9_resources),
374 &uart_gsbi9_pdata,
375 sizeof(uart_gsbi9_pdata));
376}
377#endif
378
379static struct resource gsbi3_qup_i2c_resources[] = {
380 {
381 .name = "qup_phys_addr",
382 .start = MSM_GSBI3_QUP_PHYS,
383 .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1,
384 .flags = IORESOURCE_MEM,
385 },
386 {
387 .name = "gsbi_qup_i2c_addr",
388 .start = MSM_GSBI3_PHYS,
389 .end = MSM_GSBI3_PHYS + 4 - 1,
390 .flags = IORESOURCE_MEM,
391 },
392 {
393 .name = "qup_err_intr",
394 .start = GSBI3_QUP_IRQ,
395 .end = GSBI3_QUP_IRQ,
396 .flags = IORESOURCE_IRQ,
397 },
398 {
399 .name = "i2c_clk",
400 .start = 44,
401 .end = 44,
402 .flags = IORESOURCE_IO,
403 },
404 {
405 .name = "i2c_sda",
406 .start = 43,
407 .end = 43,
408 .flags = IORESOURCE_IO,
409 },
410};
411
412static struct resource gsbi4_qup_i2c_resources[] = {
413 {
414 .name = "qup_phys_addr",
415 .start = MSM_GSBI4_QUP_PHYS,
416 .end = MSM_GSBI4_QUP_PHYS + SZ_4K - 1,
417 .flags = IORESOURCE_MEM,
418 },
419 {
420 .name = "gsbi_qup_i2c_addr",
421 .start = MSM_GSBI4_PHYS,
422 .end = MSM_GSBI4_PHYS + 4 - 1,
423 .flags = IORESOURCE_MEM,
424 },
425 {
426 .name = "qup_err_intr",
427 .start = GSBI4_QUP_IRQ,
428 .end = GSBI4_QUP_IRQ,
429 .flags = IORESOURCE_IRQ,
430 },
431};
432
433static struct resource gsbi7_qup_i2c_resources[] = {
434 {
435 .name = "qup_phys_addr",
436 .start = MSM_GSBI7_QUP_PHYS,
437 .end = MSM_GSBI7_QUP_PHYS + SZ_4K - 1,
438 .flags = IORESOURCE_MEM,
439 },
440 {
441 .name = "gsbi_qup_i2c_addr",
442 .start = MSM_GSBI7_PHYS,
443 .end = MSM_GSBI7_PHYS + 4 - 1,
444 .flags = IORESOURCE_MEM,
445 },
446 {
447 .name = "qup_err_intr",
448 .start = GSBI7_QUP_IRQ,
449 .end = GSBI7_QUP_IRQ,
450 .flags = IORESOURCE_IRQ,
451 },
452 {
453 .name = "i2c_clk",
454 .start = 60,
455 .end = 60,
456 .flags = IORESOURCE_IO,
457 },
458 {
459 .name = "i2c_sda",
460 .start = 59,
461 .end = 59,
462 .flags = IORESOURCE_IO,
463 },
464};
465
466static struct resource gsbi8_qup_i2c_resources[] = {
467 {
468 .name = "qup_phys_addr",
469 .start = MSM_GSBI8_QUP_PHYS,
470 .end = MSM_GSBI8_QUP_PHYS + SZ_4K - 1,
471 .flags = IORESOURCE_MEM,
472 },
473 {
474 .name = "gsbi_qup_i2c_addr",
475 .start = MSM_GSBI8_PHYS,
476 .end = MSM_GSBI8_PHYS + 4 - 1,
477 .flags = IORESOURCE_MEM,
478 },
479 {
480 .name = "qup_err_intr",
481 .start = GSBI8_QUP_IRQ,
482 .end = GSBI8_QUP_IRQ,
483 .flags = IORESOURCE_IRQ,
484 },
485};
486
487static struct resource gsbi9_qup_i2c_resources[] = {
488 {
489 .name = "qup_phys_addr",
490 .start = MSM_GSBI9_QUP_PHYS,
491 .end = MSM_GSBI9_QUP_PHYS + SZ_4K - 1,
492 .flags = IORESOURCE_MEM,
493 },
494 {
495 .name = "gsbi_qup_i2c_addr",
496 .start = MSM_GSBI9_PHYS,
497 .end = MSM_GSBI9_PHYS + 4 - 1,
498 .flags = IORESOURCE_MEM,
499 },
500 {
501 .name = "qup_err_intr",
502 .start = GSBI9_QUP_IRQ,
503 .end = GSBI9_QUP_IRQ,
504 .flags = IORESOURCE_IRQ,
505 },
506};
507
508static struct resource gsbi12_qup_i2c_resources[] = {
509 {
510 .name = "qup_phys_addr",
511 .start = MSM_GSBI12_QUP_PHYS,
512 .end = MSM_GSBI12_QUP_PHYS + SZ_4K - 1,
513 .flags = IORESOURCE_MEM,
514 },
515 {
516 .name = "gsbi_qup_i2c_addr",
517 .start = MSM_GSBI12_PHYS,
518 .end = MSM_GSBI12_PHYS + 4 - 1,
519 .flags = IORESOURCE_MEM,
520 },
521 {
522 .name = "qup_err_intr",
523 .start = GSBI12_QUP_IRQ,
524 .end = GSBI12_QUP_IRQ,
525 .flags = IORESOURCE_IRQ,
526 },
527};
528
529#ifdef CONFIG_MSM_BUS_SCALING
530static struct msm_bus_vectors grp3d_init_vectors[] = {
531 {
532 .src = MSM_BUS_MASTER_GRAPHICS_3D,
533 .dst = MSM_BUS_SLAVE_EBI_CH0,
534 .ab = 0,
535 .ib = 0,
536 },
537};
538
Lucille Sylvester293217d2011-08-19 17:50:52 -0600539static struct msm_bus_vectors grp3d_low_vectors[] = {
540 {
541 .src = MSM_BUS_MASTER_GRAPHICS_3D,
542 .dst = MSM_BUS_SLAVE_EBI_CH0,
543 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700544 .ib = KGSL_CONVERT_TO_MBPS(990),
Lucille Sylvester293217d2011-08-19 17:50:52 -0600545 },
546};
547
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700548static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
549 {
550 .src = MSM_BUS_MASTER_GRAPHICS_3D,
551 .dst = MSM_BUS_SLAVE_EBI_CH0,
552 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700553 .ib = KGSL_CONVERT_TO_MBPS(1300),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700554 },
555};
556
557static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
558 {
559 .src = MSM_BUS_MASTER_GRAPHICS_3D,
560 .dst = MSM_BUS_SLAVE_EBI_CH0,
561 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700562 .ib = KGSL_CONVERT_TO_MBPS(2008),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700563 },
564};
565
566static struct msm_bus_vectors grp3d_max_vectors[] = {
567 {
568 .src = MSM_BUS_MASTER_GRAPHICS_3D,
569 .dst = MSM_BUS_SLAVE_EBI_CH0,
570 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700571 .ib = KGSL_CONVERT_TO_MBPS(2484),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700572 },
573};
574
575static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
576 {
577 ARRAY_SIZE(grp3d_init_vectors),
578 grp3d_init_vectors,
579 },
580 {
Lucille Sylvester293217d2011-08-19 17:50:52 -0600581 ARRAY_SIZE(grp3d_low_vectors),
Suman Tatirajuc87f58c2011-10-14 10:58:37 -0700582 grp3d_low_vectors,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600583 },
584 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700585 ARRAY_SIZE(grp3d_nominal_low_vectors),
586 grp3d_nominal_low_vectors,
587 },
588 {
589 ARRAY_SIZE(grp3d_nominal_high_vectors),
590 grp3d_nominal_high_vectors,
591 },
592 {
593 ARRAY_SIZE(grp3d_max_vectors),
594 grp3d_max_vectors,
595 },
596};
597
598static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
599 grp3d_bus_scale_usecases,
600 ARRAY_SIZE(grp3d_bus_scale_usecases),
601 .name = "grp3d",
602};
603
604static struct msm_bus_vectors grp2d0_init_vectors[] = {
605 {
606 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
607 .dst = MSM_BUS_SLAVE_EBI_CH0,
608 .ab = 0,
609 .ib = 0,
610 },
611};
612
613static struct msm_bus_vectors grp2d0_max_vectors[] = {
614 {
615 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
616 .dst = MSM_BUS_SLAVE_EBI_CH0,
617 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700618 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700619 },
620};
621
622static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
623 {
624 ARRAY_SIZE(grp2d0_init_vectors),
625 grp2d0_init_vectors,
626 },
627 {
628 ARRAY_SIZE(grp2d0_max_vectors),
629 grp2d0_max_vectors,
630 },
631};
632
633static struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
634 grp2d0_bus_scale_usecases,
635 ARRAY_SIZE(grp2d0_bus_scale_usecases),
636 .name = "grp2d0",
637};
638
639static struct msm_bus_vectors grp2d1_init_vectors[] = {
640 {
641 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
642 .dst = MSM_BUS_SLAVE_EBI_CH0,
643 .ab = 0,
644 .ib = 0,
645 },
646};
647
648static struct msm_bus_vectors grp2d1_max_vectors[] = {
649 {
650 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
651 .dst = MSM_BUS_SLAVE_EBI_CH0,
652 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700653 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700654 },
655};
656
657static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
658 {
659 ARRAY_SIZE(grp2d1_init_vectors),
660 grp2d1_init_vectors,
661 },
662 {
663 ARRAY_SIZE(grp2d1_max_vectors),
664 grp2d1_max_vectors,
665 },
666};
667
668static struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
669 grp2d1_bus_scale_usecases,
670 ARRAY_SIZE(grp2d1_bus_scale_usecases),
671 .name = "grp2d1",
672};
673#endif
674
675#ifdef CONFIG_HW_RANDOM_MSM
676static struct resource rng_resources = {
677 .flags = IORESOURCE_MEM,
678 .start = MSM_PRNG_PHYS,
679 .end = MSM_PRNG_PHYS + SZ_512 - 1,
680};
681
682struct platform_device msm_device_rng = {
683 .name = "msm_rng",
684 .id = 0,
685 .num_resources = 1,
686 .resource = &rng_resources,
687};
688#endif
689
690static struct resource kgsl_3d0_resources[] = {
691 {
692 .name = KGSL_3D0_REG_MEMORY,
693 .start = 0x04300000, /* GFX3D address */
694 .end = 0x0431ffff,
695 .flags = IORESOURCE_MEM,
696 },
697 {
698 .name = KGSL_3D0_IRQ,
699 .start = GFX3D_IRQ,
700 .end = GFX3D_IRQ,
701 .flags = IORESOURCE_IRQ,
702 },
703};
704
705static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600706 .pwrlevel = {
707 {
708 .gpu_freq = 266667000,
709 .bus_freq = 4,
710 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700711 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600712 {
713 .gpu_freq = 228571000,
714 .bus_freq = 3,
715 .io_fraction = 33,
716 },
717 {
718 .gpu_freq = 200000000,
719 .bus_freq = 2,
720 .io_fraction = 100,
721 },
722 {
723 .gpu_freq = 177778000,
724 .bus_freq = 1,
725 .io_fraction = 100,
726 },
727 {
728 .gpu_freq = 27000000,
729 .bus_freq = 0,
730 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700731 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600732 .init_level = 0,
733 .num_levels = 5,
734 .set_grp_async = NULL,
735 .idle_timeout = HZ/5,
736 .nap_allowed = true,
737 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700738#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600739 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700740#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700741};
742
743struct platform_device msm_kgsl_3d0 = {
744 .name = "kgsl-3d0",
745 .id = 0,
746 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
747 .resource = kgsl_3d0_resources,
748 .dev = {
749 .platform_data = &kgsl_3d0_pdata,
750 },
751};
752
753static struct resource kgsl_2d0_resources[] = {
754 {
755 .name = KGSL_2D0_REG_MEMORY,
756 .start = 0x04100000, /* Z180 base address */
757 .end = 0x04100FFF,
758 .flags = IORESOURCE_MEM,
759 },
760 {
761 .name = KGSL_2D0_IRQ,
762 .start = GFX2D0_IRQ,
763 .end = GFX2D0_IRQ,
764 .flags = IORESOURCE_IRQ,
765 },
766};
767
768static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600769 .pwrlevel = {
770 {
771 .gpu_freq = 200000000,
772 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700773 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600774 {
775 .gpu_freq = 200000000,
776 .bus_freq = 0,
777 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700778 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600779 .init_level = 0,
780 .num_levels = 2,
781 .set_grp_async = NULL,
782 .idle_timeout = HZ/10,
783 .nap_allowed = true,
784 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700785#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600786 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700787#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700788};
789
790struct platform_device msm_kgsl_2d0 = {
791 .name = "kgsl-2d0",
792 .id = 0,
793 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
794 .resource = kgsl_2d0_resources,
795 .dev = {
796 .platform_data = &kgsl_2d0_pdata,
797 },
798};
799
800static struct resource kgsl_2d1_resources[] = {
801 {
802 .name = KGSL_2D1_REG_MEMORY,
803 .start = 0x04200000, /* Z180 device 1 base address */
804 .end = 0x04200FFF,
805 .flags = IORESOURCE_MEM,
806 },
807 {
808 .name = KGSL_2D1_IRQ,
809 .start = GFX2D1_IRQ,
810 .end = GFX2D1_IRQ,
811 .flags = IORESOURCE_IRQ,
812 },
813};
814
815static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600816 .pwrlevel = {
817 {
818 .gpu_freq = 200000000,
819 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700820 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600821 {
822 .gpu_freq = 200000000,
823 .bus_freq = 0,
824 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700825 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600826 .init_level = 0,
827 .num_levels = 2,
828 .set_grp_async = NULL,
829 .idle_timeout = HZ/10,
830 .nap_allowed = true,
831 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700832#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600833 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700834#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700835};
836
837struct platform_device msm_kgsl_2d1 = {
838 .name = "kgsl-2d1",
839 .id = 1,
840 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
841 .resource = kgsl_2d1_resources,
842 .dev = {
843 .platform_data = &kgsl_2d1_pdata,
844 },
845};
846
847/*
848 * this a software workaround for not having two distinct board
849 * files for 8660v1 and 8660v2. 8660v1 has a faulty 2d clock, and
850 * this workaround detects the cpu version to tell if the kernel is on a
851 * 8660v1, and should disable the 2d core. it is called from the board file
852 */
853void __init msm8x60_check_2d_hardware(void)
854{
855 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) &&
856 (SOCINFO_VERSION_MINOR(socinfo_get_version()) == 0)) {
857 printk(KERN_WARNING "kgsl: 2D cores disabled on 8660v1\n");
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600858 kgsl_2d0_pdata.clk_map = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700859 }
860}
861
862/* Use GSBI3 QUP for /dev/i2c-0 */
863struct platform_device msm_gsbi3_qup_i2c_device = {
864 .name = "qup_i2c",
865 .id = MSM_GSBI3_QUP_I2C_BUS_ID,
866 .num_resources = ARRAY_SIZE(gsbi3_qup_i2c_resources),
867 .resource = gsbi3_qup_i2c_resources,
868};
869
870/* Use GSBI4 QUP for /dev/i2c-1 */
871struct platform_device msm_gsbi4_qup_i2c_device = {
872 .name = "qup_i2c",
873 .id = MSM_GSBI4_QUP_I2C_BUS_ID,
874 .num_resources = ARRAY_SIZE(gsbi4_qup_i2c_resources),
875 .resource = gsbi4_qup_i2c_resources,
876};
877
878/* Use GSBI8 QUP for /dev/i2c-3 */
879struct platform_device msm_gsbi8_qup_i2c_device = {
880 .name = "qup_i2c",
881 .id = MSM_GSBI8_QUP_I2C_BUS_ID,
882 .num_resources = ARRAY_SIZE(gsbi8_qup_i2c_resources),
883 .resource = gsbi8_qup_i2c_resources,
884};
885
886/* Use GSBI9 QUP for /dev/i2c-2 */
887struct platform_device msm_gsbi9_qup_i2c_device = {
888 .name = "qup_i2c",
889 .id = MSM_GSBI9_QUP_I2C_BUS_ID,
890 .num_resources = ARRAY_SIZE(gsbi9_qup_i2c_resources),
891 .resource = gsbi9_qup_i2c_resources,
892};
893
894/* Use GSBI7 QUP for /dev/i2c-4 (Marimba) */
895struct platform_device msm_gsbi7_qup_i2c_device = {
896 .name = "qup_i2c",
897 .id = MSM_GSBI7_QUP_I2C_BUS_ID,
898 .num_resources = ARRAY_SIZE(gsbi7_qup_i2c_resources),
899 .resource = gsbi7_qup_i2c_resources,
900};
901
902/* Use GSBI12 QUP for /dev/i2c-5 (Sensors) */
903struct platform_device msm_gsbi12_qup_i2c_device = {
904 .name = "qup_i2c",
905 .id = MSM_GSBI12_QUP_I2C_BUS_ID,
906 .num_resources = ARRAY_SIZE(gsbi12_qup_i2c_resources),
907 .resource = gsbi12_qup_i2c_resources,
908};
909
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +0530910#ifdef CONFIG_MSM_SSBI
911#define MSM_SSBI_PMIC1_PHYS 0x00500000
912static struct resource resources_ssbi_pmic1_resource[] = {
913 {
914 .start = MSM_SSBI_PMIC1_PHYS,
915 .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1,
916 .flags = IORESOURCE_MEM,
917 },
918};
919
920struct platform_device msm_device_ssbi_pmic1 = {
921 .name = "msm_ssbi",
922 .id = 0,
923 .resource = resources_ssbi_pmic1_resource,
924 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1_resource),
925};
Anirudh Ghayalc49157f2011-11-09 14:49:59 +0530926
927#define MSM_SSBI2_PMIC2B_PHYS 0x00C00000
928static struct resource resources_ssbi_pmic2_resource[] = {
929 {
930 .start = MSM_SSBI2_PMIC2B_PHYS,
931 .end = MSM_SSBI2_PMIC2B_PHYS + SZ_4K - 1,
932 .flags = IORESOURCE_MEM,
933 },
934};
935
936struct platform_device msm_device_ssbi_pmic2 = {
937 .name = "msm_ssbi",
938 .id = 1,
939 .resource = resources_ssbi_pmic2_resource,
940 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2_resource),
941};
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +0530942#endif
943
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700944#ifdef CONFIG_I2C_SSBI
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700945/* CODEC SSBI on /dev/i2c-8 */
946#define MSM_SSBI3_PHYS 0x18700000
947static struct resource msm_ssbi3_resources[] = {
948 {
949 .name = "ssbi_base",
950 .start = MSM_SSBI3_PHYS,
951 .end = MSM_SSBI3_PHYS + SZ_4K - 1,
952 .flags = IORESOURCE_MEM,
953 },
954};
955
956struct platform_device msm_device_ssbi3 = {
957 .name = "i2c_ssbi",
958 .id = MSM_SSBI3_I2C_BUS_ID,
959 .num_resources = ARRAY_SIZE(msm_ssbi3_resources),
960 .resource = msm_ssbi3_resources,
961};
962#endif /* CONFIG_I2C_SSBI */
963
964static struct resource gsbi1_qup_spi_resources[] = {
965 {
966 .name = "spi_base",
967 .start = MSM_GSBI1_QUP_PHYS,
968 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
969 .flags = IORESOURCE_MEM,
970 },
971 {
972 .name = "gsbi_base",
973 .start = MSM_GSBI1_PHYS,
974 .end = MSM_GSBI1_PHYS + 4 - 1,
975 .flags = IORESOURCE_MEM,
976 },
977 {
978 .name = "spi_irq_in",
979 .start = GSBI1_QUP_IRQ,
980 .end = GSBI1_QUP_IRQ,
981 .flags = IORESOURCE_IRQ,
982 },
983 {
984 .name = "spidm_channels",
985 .start = 5,
986 .end = 6,
987 .flags = IORESOURCE_DMA,
988 },
989 {
990 .name = "spidm_crci",
991 .start = 8,
992 .end = 7,
993 .flags = IORESOURCE_DMA,
994 },
995 {
996 .name = "spi_clk",
997 .start = 36,
998 .end = 36,
999 .flags = IORESOURCE_IO,
1000 },
1001 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001002 .name = "spi_miso",
1003 .start = 34,
1004 .end = 34,
1005 .flags = IORESOURCE_IO,
1006 },
1007 {
1008 .name = "spi_mosi",
1009 .start = 33,
1010 .end = 33,
1011 .flags = IORESOURCE_IO,
1012 },
Harini Jayaraman5d93be12011-11-29 18:32:20 -07001013 {
1014 .name = "spi_cs",
1015 .start = 35,
1016 .end = 35,
1017 .flags = IORESOURCE_IO,
1018 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001019};
1020
1021/* Use GSBI1 QUP for SPI-0 */
1022struct platform_device msm_gsbi1_qup_spi_device = {
1023 .name = "spi_qsd",
1024 .id = 0,
1025 .num_resources = ARRAY_SIZE(gsbi1_qup_spi_resources),
1026 .resource = gsbi1_qup_spi_resources,
1027};
1028
1029
1030static struct resource gsbi10_qup_spi_resources[] = {
1031 {
1032 .name = "spi_base",
1033 .start = MSM_GSBI10_QUP_PHYS,
1034 .end = MSM_GSBI10_QUP_PHYS + SZ_4K - 1,
1035 .flags = IORESOURCE_MEM,
1036 },
1037 {
1038 .name = "gsbi_base",
1039 .start = MSM_GSBI10_PHYS,
1040 .end = MSM_GSBI10_PHYS + 4 - 1,
1041 .flags = IORESOURCE_MEM,
1042 },
1043 {
1044 .name = "spi_irq_in",
1045 .start = GSBI10_QUP_IRQ,
1046 .end = GSBI10_QUP_IRQ,
1047 .flags = IORESOURCE_IRQ,
1048 },
1049 {
1050 .name = "spi_clk",
1051 .start = 73,
1052 .end = 73,
1053 .flags = IORESOURCE_IO,
1054 },
1055 {
1056 .name = "spi_cs",
1057 .start = 72,
1058 .end = 72,
1059 .flags = IORESOURCE_IO,
1060 },
1061 {
1062 .name = "spi_mosi",
1063 .start = 70,
1064 .end = 70,
1065 .flags = IORESOURCE_IO,
1066 },
1067};
1068
1069/* Use GSBI10 QUP for SPI-1 */
1070struct platform_device msm_gsbi10_qup_spi_device = {
1071 .name = "spi_qsd",
1072 .id = 1,
1073 .num_resources = ARRAY_SIZE(gsbi10_qup_spi_resources),
1074 .resource = gsbi10_qup_spi_resources,
1075};
1076#define MSM_SDC1_BASE 0x12400000
1077#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1078#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1079#define MSM_SDC2_BASE 0x12140000
1080#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1081#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1082#define MSM_SDC3_BASE 0x12180000
1083#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1084#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1085#define MSM_SDC4_BASE 0x121C0000
1086#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1087#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1088#define MSM_SDC5_BASE 0x12200000
1089#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
1090#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
1091
1092static struct resource resources_sdc1[] = {
1093 {
1094 .start = MSM_SDC1_BASE,
1095 .end = MSM_SDC1_DML_BASE - 1,
1096 .flags = IORESOURCE_MEM,
1097 },
1098 {
1099 .start = SDC1_IRQ_0,
1100 .end = SDC1_IRQ_0,
1101 .flags = IORESOURCE_IRQ,
1102 },
1103#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1104 {
1105 .name = "sdcc_dml_addr",
1106 .start = MSM_SDC1_DML_BASE,
1107 .end = MSM_SDC1_BAM_BASE - 1,
1108 .flags = IORESOURCE_MEM,
1109 },
1110 {
1111 .name = "sdcc_bam_addr",
1112 .start = MSM_SDC1_BAM_BASE,
1113 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1114 .flags = IORESOURCE_MEM,
1115 },
1116 {
1117 .name = "sdcc_bam_irq",
1118 .start = SDC1_BAM_IRQ,
1119 .end = SDC1_BAM_IRQ,
1120 .flags = IORESOURCE_IRQ,
1121 },
1122#else
1123 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001124 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001125 .start = DMOV_SDC1_CHAN,
1126 .end = DMOV_SDC1_CHAN,
1127 .flags = IORESOURCE_DMA,
1128 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001129 {
1130 .name = "sdcc_dma_crci",
1131 .start = DMOV_SDC1_CRCI,
1132 .end = DMOV_SDC1_CRCI,
1133 .flags = IORESOURCE_DMA,
1134 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001135#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1136};
1137
1138static struct resource resources_sdc2[] = {
1139 {
1140 .start = MSM_SDC2_BASE,
1141 .end = MSM_SDC2_DML_BASE - 1,
1142 .flags = IORESOURCE_MEM,
1143 },
1144 {
1145 .start = SDC2_IRQ_0,
1146 .end = SDC2_IRQ_0,
1147 .flags = IORESOURCE_IRQ,
1148 },
1149#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1150 {
1151 .name = "sdcc_dml_addr",
1152 .start = MSM_SDC2_DML_BASE,
1153 .end = MSM_SDC2_BAM_BASE - 1,
1154 .flags = IORESOURCE_MEM,
1155 },
1156 {
1157 .name = "sdcc_bam_addr",
1158 .start = MSM_SDC2_BAM_BASE,
1159 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1160 .flags = IORESOURCE_MEM,
1161 },
1162 {
1163 .name = "sdcc_bam_irq",
1164 .start = SDC2_BAM_IRQ,
1165 .end = SDC2_BAM_IRQ,
1166 .flags = IORESOURCE_IRQ,
1167 },
1168#else
1169 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001170 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001171 .start = DMOV_SDC2_CHAN,
1172 .end = DMOV_SDC2_CHAN,
1173 .flags = IORESOURCE_DMA,
1174 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001175 {
1176 .name = "sdcc_dma_crci",
1177 .start = DMOV_SDC2_CRCI,
1178 .end = DMOV_SDC2_CRCI,
1179 .flags = IORESOURCE_DMA,
1180 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001181#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1182};
1183
1184static struct resource resources_sdc3[] = {
1185 {
1186 .start = MSM_SDC3_BASE,
1187 .end = MSM_SDC3_DML_BASE - 1,
1188 .flags = IORESOURCE_MEM,
1189 },
1190 {
1191 .start = SDC3_IRQ_0,
1192 .end = SDC3_IRQ_0,
1193 .flags = IORESOURCE_IRQ,
1194 },
1195#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1196 {
1197 .name = "sdcc_dml_addr",
1198 .start = MSM_SDC3_DML_BASE,
1199 .end = MSM_SDC3_BAM_BASE - 1,
1200 .flags = IORESOURCE_MEM,
1201 },
1202 {
1203 .name = "sdcc_bam_addr",
1204 .start = MSM_SDC3_BAM_BASE,
1205 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1206 .flags = IORESOURCE_MEM,
1207 },
1208 {
1209 .name = "sdcc_bam_irq",
1210 .start = SDC3_BAM_IRQ,
1211 .end = SDC3_BAM_IRQ,
1212 .flags = IORESOURCE_IRQ,
1213 },
1214#else
1215 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001216 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001217 .start = DMOV_SDC3_CHAN,
1218 .end = DMOV_SDC3_CHAN,
1219 .flags = IORESOURCE_DMA,
1220 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001221 {
1222 .name = "sdcc_dma_crci",
1223 .start = DMOV_SDC3_CRCI,
1224 .end = DMOV_SDC3_CRCI,
1225 .flags = IORESOURCE_DMA,
1226 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001227#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1228};
1229
1230static struct resource resources_sdc4[] = {
1231 {
1232 .start = MSM_SDC4_BASE,
1233 .end = MSM_SDC4_DML_BASE - 1,
1234 .flags = IORESOURCE_MEM,
1235 },
1236 {
1237 .start = SDC4_IRQ_0,
1238 .end = SDC4_IRQ_0,
1239 .flags = IORESOURCE_IRQ,
1240 },
1241#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1242 {
1243 .name = "sdcc_dml_addr",
1244 .start = MSM_SDC4_DML_BASE,
1245 .end = MSM_SDC4_BAM_BASE - 1,
1246 .flags = IORESOURCE_MEM,
1247 },
1248 {
1249 .name = "sdcc_bam_addr",
1250 .start = MSM_SDC4_BAM_BASE,
1251 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1252 .flags = IORESOURCE_MEM,
1253 },
1254 {
1255 .name = "sdcc_bam_irq",
1256 .start = SDC4_BAM_IRQ,
1257 .end = SDC4_BAM_IRQ,
1258 .flags = IORESOURCE_IRQ,
1259 },
1260#else
1261 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001262 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001263 .start = DMOV_SDC4_CHAN,
1264 .end = DMOV_SDC4_CHAN,
1265 .flags = IORESOURCE_DMA,
1266 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001267 {
1268 .name = "sdcc_dma_crci",
1269 .start = DMOV_SDC4_CRCI,
1270 .end = DMOV_SDC4_CRCI,
1271 .flags = IORESOURCE_DMA,
1272 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001273#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1274};
1275
1276static struct resource resources_sdc5[] = {
1277 {
1278 .start = MSM_SDC5_BASE,
1279 .end = MSM_SDC5_DML_BASE - 1,
1280 .flags = IORESOURCE_MEM,
1281 },
1282 {
1283 .start = SDC5_IRQ_0,
1284 .end = SDC5_IRQ_0,
1285 .flags = IORESOURCE_IRQ,
1286 },
1287#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1288 {
1289 .name = "sdcc_dml_addr",
1290 .start = MSM_SDC5_DML_BASE,
1291 .end = MSM_SDC5_BAM_BASE - 1,
1292 .flags = IORESOURCE_MEM,
1293 },
1294 {
1295 .name = "sdcc_bam_addr",
1296 .start = MSM_SDC5_BAM_BASE,
1297 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
1298 .flags = IORESOURCE_MEM,
1299 },
1300 {
1301 .name = "sdcc_bam_irq",
1302 .start = SDC5_BAM_IRQ,
1303 .end = SDC5_BAM_IRQ,
1304 .flags = IORESOURCE_IRQ,
1305 },
1306#else
1307 {
Krishna Konda25786ec2011-07-25 16:21:36 -07001308 .name = "sdcc_dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001309 .start = DMOV_SDC5_CHAN,
1310 .end = DMOV_SDC5_CHAN,
1311 .flags = IORESOURCE_DMA,
1312 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001313 {
1314 .name = "sdcc_dma_crci",
1315 .start = DMOV_SDC5_CRCI,
1316 .end = DMOV_SDC5_CRCI,
1317 .flags = IORESOURCE_DMA,
1318 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001319#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1320};
1321
1322struct platform_device msm_device_sdc1 = {
1323 .name = "msm_sdcc",
1324 .id = 1,
1325 .num_resources = ARRAY_SIZE(resources_sdc1),
1326 .resource = resources_sdc1,
1327 .dev = {
1328 .coherent_dma_mask = 0xffffffff,
1329 },
1330};
1331
1332struct platform_device msm_device_sdc2 = {
1333 .name = "msm_sdcc",
1334 .id = 2,
1335 .num_resources = ARRAY_SIZE(resources_sdc2),
1336 .resource = resources_sdc2,
1337 .dev = {
1338 .coherent_dma_mask = 0xffffffff,
1339 },
1340};
1341
1342struct platform_device msm_device_sdc3 = {
1343 .name = "msm_sdcc",
1344 .id = 3,
1345 .num_resources = ARRAY_SIZE(resources_sdc3),
1346 .resource = resources_sdc3,
1347 .dev = {
1348 .coherent_dma_mask = 0xffffffff,
1349 },
1350};
1351
1352struct platform_device msm_device_sdc4 = {
1353 .name = "msm_sdcc",
1354 .id = 4,
1355 .num_resources = ARRAY_SIZE(resources_sdc4),
1356 .resource = resources_sdc4,
1357 .dev = {
1358 .coherent_dma_mask = 0xffffffff,
1359 },
1360};
1361
1362struct platform_device msm_device_sdc5 = {
1363 .name = "msm_sdcc",
1364 .id = 5,
1365 .num_resources = ARRAY_SIZE(resources_sdc5),
1366 .resource = resources_sdc5,
1367 .dev = {
1368 .coherent_dma_mask = 0xffffffff,
1369 },
1370};
1371
1372static struct platform_device *msm_sdcc_devices[] __initdata = {
1373 &msm_device_sdc1,
1374 &msm_device_sdc2,
1375 &msm_device_sdc3,
1376 &msm_device_sdc4,
1377 &msm_device_sdc5,
1378};
1379
1380int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1381{
1382 struct platform_device *pdev;
1383
1384 if (controller < 1 || controller > 5)
1385 return -EINVAL;
1386
1387 pdev = msm_sdcc_devices[controller-1];
1388 pdev->dev.platform_data = plat;
1389 return platform_device_register(pdev);
1390}
1391
Kevin Chan3be11612012-03-22 20:05:40 -07001392#ifdef CONFIG_MSM_CAMERA_V4L2
1393static struct resource msm_csic0_resources[] = {
1394 {
1395 .name = "csic",
1396 .start = 0x04800000,
1397 .end = 0x04800000 + 0x00000400 - 1,
1398 .flags = IORESOURCE_MEM,
1399 },
1400 {
1401 .name = "csic",
1402 .start = CSI_0_IRQ,
1403 .end = CSI_0_IRQ,
1404 .flags = IORESOURCE_IRQ,
1405 },
1406};
1407
1408static struct resource msm_csic1_resources[] = {
1409 {
1410 .name = "csic",
1411 .start = 0x04900000,
1412 .end = 0x04900000 + 0x00000400 - 1,
1413 .flags = IORESOURCE_MEM,
1414 },
1415 {
1416 .name = "csic",
1417 .start = CSI_1_IRQ,
1418 .end = CSI_1_IRQ,
1419 .flags = IORESOURCE_IRQ,
1420 },
1421};
1422
1423struct resource msm_vfe_resources[] = {
1424 {
1425 .name = "msm_vfe",
1426 .start = 0x04500000,
1427 .end = 0x04500000 + SZ_1M - 1,
1428 .flags = IORESOURCE_MEM,
1429 },
1430 {
1431 .name = "msm_vfe",
1432 .start = VFE_IRQ,
1433 .end = VFE_IRQ,
1434 .flags = IORESOURCE_IRQ,
1435 },
1436};
1437
1438static struct resource msm_vpe_resources[] = {
1439 {
1440 .name = "vpe",
1441 .start = 0x05300000,
1442 .end = 0x05300000 + SZ_1M - 1,
1443 .flags = IORESOURCE_MEM,
1444 },
1445 {
1446 .name = "vpe",
1447 .start = INT_VPE,
1448 .end = INT_VPE,
1449 .flags = IORESOURCE_IRQ,
1450 },
1451};
1452
1453struct platform_device msm_device_csic0 = {
1454 .name = "msm_csic",
1455 .id = 0,
1456 .resource = msm_csic0_resources,
1457 .num_resources = ARRAY_SIZE(msm_csic0_resources),
1458};
1459
1460struct platform_device msm_device_csic1 = {
1461 .name = "msm_csic",
1462 .id = 1,
1463 .resource = msm_csic1_resources,
1464 .num_resources = ARRAY_SIZE(msm_csic1_resources),
1465};
1466
1467struct platform_device msm_device_vfe = {
1468 .name = "msm_vfe",
1469 .id = 0,
1470 .resource = msm_vfe_resources,
1471 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1472};
1473
1474struct platform_device msm_device_vpe = {
1475 .name = "msm_vpe",
1476 .id = 0,
1477 .resource = msm_vpe_resources,
1478 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1479};
1480
1481#endif
1482
1483
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001484#define MIPI_DSI_HW_BASE 0x04700000
1485#define ROTATOR_HW_BASE 0x04E00000
1486#define TVENC_HW_BASE 0x04F00000
1487#define MDP_HW_BASE 0x05100000
1488
1489static struct resource msm_mipi_dsi_resources[] = {
1490 {
1491 .name = "mipi_dsi",
1492 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001493 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001494 .flags = IORESOURCE_MEM,
1495 },
1496 {
1497 .start = DSI_IRQ,
1498 .end = DSI_IRQ,
1499 .flags = IORESOURCE_IRQ,
1500 },
1501};
1502
1503static struct platform_device msm_mipi_dsi_device = {
1504 .name = "mipi_dsi",
1505 .id = 1,
1506 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
1507 .resource = msm_mipi_dsi_resources,
1508};
1509
1510static struct resource msm_mdp_resources[] = {
1511 {
1512 .name = "mdp",
1513 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001514 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001515 .flags = IORESOURCE_MEM,
1516 },
1517 {
1518 .start = INT_MDP,
1519 .end = INT_MDP,
1520 .flags = IORESOURCE_IRQ,
1521 },
1522};
1523
1524static struct platform_device msm_mdp_device = {
1525 .name = "mdp",
1526 .id = 0,
1527 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1528 .resource = msm_mdp_resources,
1529};
1530#ifdef CONFIG_MSM_ROTATOR
1531static struct resource resources_msm_rotator[] = {
1532 {
1533 .start = 0x04E00000,
1534 .end = 0x04F00000 - 1,
1535 .flags = IORESOURCE_MEM,
1536 },
1537 {
1538 .start = ROT_IRQ,
1539 .end = ROT_IRQ,
1540 .flags = IORESOURCE_IRQ,
1541 },
1542};
1543
1544static struct msm_rot_clocks rotator_clocks[] = {
1545 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001546 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001547 .clk_type = ROTATOR_CORE_CLK,
1548 .clk_rate = 160 * 1000 * 1000,
1549 },
1550 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001551 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001552 .clk_type = ROTATOR_PCLK,
1553 .clk_rate = 0,
1554 },
1555};
1556
1557static struct msm_rotator_platform_data rotator_pdata = {
1558 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1559 .hardware_version_number = 0x01010307,
1560 .rotator_clks = rotator_clocks,
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08001561#ifdef CONFIG_MSM_BUS_SCALING
1562 .bus_scale_table = &rotator_bus_scale_pdata,
1563#endif
Olav Hauganef95ae32012-05-15 09:50:30 -07001564 .rot_iommu_split_domain = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001565};
1566
1567struct platform_device msm_rotator_device = {
1568 .name = "msm_rotator",
1569 .id = 0,
1570 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1571 .resource = resources_msm_rotator,
1572 .dev = {
1573 .platform_data = &rotator_pdata,
1574 },
1575};
1576#endif
1577
1578
1579/* Sensors DSPS platform data */
1580#ifdef CONFIG_MSM_DSPS
1581
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07001582#define PPSS_DSPS_TCM_CODE_BASE 0x12000000
1583#define PPSS_DSPS_TCM_CODE_SIZE 0x28000
1584#define PPSS_DSPS_TCM_BUF_BASE 0x12040000
1585#define PPSS_DSPS_TCM_BUF_SIZE 0x4000
1586#define PPSS_DSPS_PIPE_BASE 0x12800000
1587#define PPSS_DSPS_PIPE_SIZE 0x0 /* 8660 V2 does not use PIPE memory */
1588#define PPSS_DSPS_DDR_BASE 0x8fe00000
1589#define PPSS_DSPS_DDR_SIZE 0x0 /* 8660 V2 does not use DDR memory */
1590#define PPSS_SMEM_BASE 0x40000000
1591#define PPSS_SMEM_SIZE 0x4000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001592#define PPSS_REG_PHYS_BASE 0x12080000
karthik karuppasamy9dac5492012-06-19 15:03:10 -07001593#define PPSS_PAUSE_REG 0x1804
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001594
1595#define MHZ (1000*1000)
1596
Wentao Xu7a1c9302011-09-19 17:57:43 -04001597#define TCSR_GSBI_IRQ_MUX_SEL 0x0044
1598
1599#define GSBI_IRQ_MUX_SEL_MASK 0xF
1600#define GSBI_IRQ_MUX_SEL_DSPS 0xB
1601
1602static void dsps_init1(struct msm_dsps_platform_data *data)
1603{
1604 int val;
1605
1606 /* route GSBI12 interrutps to DSPS */
1607 val = secure_readl(MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1608 val &= ~GSBI_IRQ_MUX_SEL_MASK;
1609 val |= GSBI_IRQ_MUX_SEL_DSPS;
1610 secure_writel(val, MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1611}
1612
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001613static struct dsps_clk_info dsps_clks[] = {
1614 {
Matt Wagantall5bb16ca2012-04-19 11:34:01 -07001615 .name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001616 .rate = 0, /* no rate just on/off */
1617 },
1618 {
Matt Wagantalld86d6832011-08-17 14:06:55 -07001619 .name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001620 .rate = 0, /* no rate just on/off */
1621 },
1622 {
1623 .name = "gsbi_qup_clk",
1624 .rate = 24 * MHZ, /* See clk_tbl_gsbi_qup[] */
1625 },
1626 {
1627 .name = "dfab_dsps_clk",
1628 .rate = 64 * MHZ, /* Same rate as USB. */
1629 }
1630};
1631
1632static struct dsps_regulator_info dsps_regs[] = {
1633 {
1634 .name = "8058_l5",
1635 .volt = 2850000, /* in uV */
1636 },
1637 {
1638 .name = "8058_s3",
1639 .volt = 1800000, /* in uV */
1640 }
1641};
1642
1643/*
1644 * Note: GPIOs field is intialized in run-time at the function
1645 * msm8x60_init_dsps().
1646 */
1647
1648struct msm_dsps_platform_data msm_dsps_pdata = {
1649 .clks = dsps_clks,
1650 .clks_num = ARRAY_SIZE(dsps_clks),
1651 .gpios = NULL,
1652 .gpios_num = 0,
1653 .regs = dsps_regs,
1654 .regs_num = ARRAY_SIZE(dsps_regs),
Wentao Xu7a1c9302011-09-19 17:57:43 -04001655 .init = dsps_init1,
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07001656 .tcm_code_start = PPSS_DSPS_TCM_CODE_BASE,
1657 .tcm_code_size = PPSS_DSPS_TCM_CODE_SIZE,
1658 .tcm_buf_start = PPSS_DSPS_TCM_BUF_BASE,
1659 .tcm_buf_size = PPSS_DSPS_TCM_BUF_SIZE,
1660 .pipe_start = PPSS_DSPS_PIPE_BASE,
1661 .pipe_size = PPSS_DSPS_PIPE_SIZE,
1662 .ddr_start = PPSS_DSPS_DDR_BASE,
1663 .ddr_size = PPSS_DSPS_DDR_SIZE,
1664 .smem_start = PPSS_SMEM_BASE,
1665 .smem_size = PPSS_SMEM_SIZE,
karthik karuppasamy9dac5492012-06-19 15:03:10 -07001666 .ppss_pause_reg = PPSS_PAUSE_REG,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001667 .signature = DSPS_SIGNATURE,
1668};
1669
1670static struct resource msm_dsps_resources[] = {
1671 {
1672 .start = PPSS_REG_PHYS_BASE,
1673 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
1674 .name = "ppss_reg",
1675 .flags = IORESOURCE_MEM,
1676 },
1677};
1678
1679struct platform_device msm_dsps_device = {
1680 .name = "msm_dsps",
1681 .id = 0,
1682 .num_resources = ARRAY_SIZE(msm_dsps_resources),
1683 .resource = msm_dsps_resources,
1684 .dev.platform_data = &msm_dsps_pdata,
1685};
1686
1687#endif /* CONFIG_MSM_DSPS */
1688
1689#ifdef CONFIG_FB_MSM_TVOUT
1690static struct resource msm_tvenc_resources[] = {
1691 {
1692 .name = "tvenc",
1693 .start = TVENC_HW_BASE,
1694 .end = TVENC_HW_BASE + PAGE_SIZE - 1,
1695 .flags = IORESOURCE_MEM,
1696 }
1697};
1698
1699static struct resource tvout_device_resources[] = {
1700 {
1701 .name = "tvout_device_irq",
1702 .start = TV_ENC_IRQ,
1703 .end = TV_ENC_IRQ,
1704 .flags = IORESOURCE_IRQ,
1705 },
1706};
1707#endif
1708static void __init msm_register_device(struct platform_device *pdev, void *data)
1709{
1710 int ret;
1711
1712 pdev->dev.platform_data = data;
1713
1714 ret = platform_device_register(pdev);
1715 if (ret)
1716 dev_err(&pdev->dev,
1717 "%s: platform_device_register() failed = %d\n",
1718 __func__, ret);
1719}
1720
1721static struct platform_device msm_lcdc_device = {
1722 .name = "lcdc",
1723 .id = 0,
1724};
1725
1726#ifdef CONFIG_FB_MSM_TVOUT
1727static struct platform_device msm_tvenc_device = {
1728 .name = "tvenc",
1729 .id = 0,
1730 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1731 .resource = msm_tvenc_resources,
1732};
1733
1734static struct platform_device msm_tvout_device = {
1735 .name = "tvout_device",
1736 .id = 0,
1737 .num_resources = ARRAY_SIZE(tvout_device_resources),
1738 .resource = tvout_device_resources,
1739};
1740#endif
1741
1742#ifdef CONFIG_MSM_BUS_SCALING
1743static struct platform_device msm_dtv_device = {
1744 .name = "dtv",
1745 .id = 0,
1746};
1747#endif
1748
1749void __init msm_fb_register_device(char *name, void *data)
1750{
1751 if (!strncmp(name, "mdp", 3))
1752 msm_register_device(&msm_mdp_device, data);
1753 else if (!strncmp(name, "lcdc", 4))
1754 msm_register_device(&msm_lcdc_device, data);
1755 else if (!strncmp(name, "mipi_dsi", 8))
1756 msm_register_device(&msm_mipi_dsi_device, data);
1757#ifdef CONFIG_FB_MSM_TVOUT
1758 else if (!strncmp(name, "tvenc", 5))
1759 msm_register_device(&msm_tvenc_device, data);
1760 else if (!strncmp(name, "tvout_device", 12))
1761 msm_register_device(&msm_tvout_device, data);
1762#endif
1763#ifdef CONFIG_MSM_BUS_SCALING
1764 else if (!strncmp(name, "dtv", 3))
1765 msm_register_device(&msm_dtv_device, data);
1766#endif
1767 else
1768 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1769}
1770
1771static struct resource resources_otg[] = {
1772 {
1773 .start = 0x12500000,
1774 .end = 0x12500000 + SZ_1K - 1,
1775 .flags = IORESOURCE_MEM,
1776 },
1777 {
1778 .start = USB1_HS_IRQ,
1779 .end = USB1_HS_IRQ,
1780 .flags = IORESOURCE_IRQ,
1781 },
1782};
1783
1784struct platform_device msm_device_otg = {
1785 .name = "msm_otg",
1786 .id = -1,
1787 .num_resources = ARRAY_SIZE(resources_otg),
1788 .resource = resources_otg,
1789};
1790
1791static u64 dma_mask = 0xffffffffULL;
1792struct platform_device msm_device_gadget_peripheral = {
1793 .name = "msm_hsusb",
1794 .id = -1,
1795 .dev = {
1796 .dma_mask = &dma_mask,
1797 .coherent_dma_mask = 0xffffffffULL,
1798 },
1799};
1800#ifdef CONFIG_USB_EHCI_MSM_72K
1801static struct resource resources_hsusb_host[] = {
1802 {
1803 .start = 0x12500000,
1804 .end = 0x12500000 + SZ_1K - 1,
1805 .flags = IORESOURCE_MEM,
1806 },
1807 {
1808 .start = USB1_HS_IRQ,
1809 .end = USB1_HS_IRQ,
1810 .flags = IORESOURCE_IRQ,
1811 },
1812};
1813
1814struct platform_device msm_device_hsusb_host = {
1815 .name = "msm_hsusb_host",
1816 .id = 0,
1817 .num_resources = ARRAY_SIZE(resources_hsusb_host),
1818 .resource = resources_hsusb_host,
1819 .dev = {
1820 .dma_mask = &dma_mask,
1821 .coherent_dma_mask = 0xffffffffULL,
1822 },
1823};
1824
1825static struct platform_device *msm_host_devices[] = {
1826 &msm_device_hsusb_host,
1827};
1828
1829int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1830{
1831 struct platform_device *pdev;
1832
1833 pdev = msm_host_devices[host];
1834 if (!pdev)
1835 return -ENODEV;
1836 pdev->dev.platform_data = plat;
1837 return platform_device_register(pdev);
1838}
1839#endif
1840
1841#define MSM_TSIF0_PHYS (0x18200000)
1842#define MSM_TSIF1_PHYS (0x18201000)
1843#define MSM_TSIF_SIZE (0x200)
1844#define TCSR_ADM_0_A_CRCI_MUX_SEL 0x0070
1845
1846#define TSIF_0_CLK GPIO_CFG(93, 1, GPIO_CFG_INPUT, \
1847 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1848#define TSIF_0_EN GPIO_CFG(94, 1, GPIO_CFG_INPUT, \
1849 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1850#define TSIF_0_DATA GPIO_CFG(95, 1, GPIO_CFG_INPUT, \
1851 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1852#define TSIF_0_SYNC GPIO_CFG(96, 1, GPIO_CFG_INPUT, \
1853 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1854#define TSIF_1_CLK GPIO_CFG(97, 1, GPIO_CFG_INPUT, \
1855 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1856#define TSIF_1_EN GPIO_CFG(98, 1, GPIO_CFG_INPUT, \
1857 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1858#define TSIF_1_DATA GPIO_CFG(99, 1, GPIO_CFG_INPUT, \
1859 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1860#define TSIF_1_SYNC GPIO_CFG(100, 1, GPIO_CFG_INPUT, \
1861 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1862
1863static const struct msm_gpio tsif0_gpios[] = {
1864 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1865 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1866 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1867 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1868};
1869
1870static const struct msm_gpio tsif1_gpios[] = {
1871 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1872 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1873 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1874 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1875};
1876
1877static void tsif_release(struct device *dev)
1878{
1879}
1880
1881static void tsif_init1(struct msm_tsif_platform_data *data)
1882{
1883 int val;
1884
1885 /* configure mux to use correct tsif instance */
1886 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1887 val |= 0x80000000;
1888 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1889}
1890
1891struct msm_tsif_platform_data tsif1_platform_data = {
1892 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1893 .gpios = tsif1_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001894 .tsif_pclk = "iface_clk",
1895 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001896 .init = tsif_init1
1897};
1898
1899struct resource tsif1_resources[] = {
1900 [0] = {
1901 .flags = IORESOURCE_IRQ,
1902 .start = TSIF2_IRQ,
1903 .end = TSIF2_IRQ,
1904 },
1905 [1] = {
1906 .flags = IORESOURCE_MEM,
1907 .start = MSM_TSIF1_PHYS,
1908 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1909 },
1910 [2] = {
1911 .flags = IORESOURCE_DMA,
1912 .start = DMOV_TSIF_CHAN,
1913 .end = DMOV_TSIF_CRCI,
1914 },
1915};
1916
1917static void tsif_init0(struct msm_tsif_platform_data *data)
1918{
1919 int val;
1920
1921 /* configure mux to use correct tsif instance */
1922 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1923 val &= 0x7FFFFFFF;
1924 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1925}
1926
1927struct msm_tsif_platform_data tsif0_platform_data = {
1928 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1929 .gpios = tsif0_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001930 .tsif_pclk = "iface_clk",
1931 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001932 .init = tsif_init0
1933};
1934struct resource tsif0_resources[] = {
1935 [0] = {
1936 .flags = IORESOURCE_IRQ,
1937 .start = TSIF1_IRQ,
1938 .end = TSIF1_IRQ,
1939 },
1940 [1] = {
1941 .flags = IORESOURCE_MEM,
1942 .start = MSM_TSIF0_PHYS,
1943 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1944 },
1945 [2] = {
1946 .flags = IORESOURCE_DMA,
1947 .start = DMOV_TSIF_CHAN,
1948 .end = DMOV_TSIF_CRCI,
1949 },
1950};
1951
1952struct platform_device msm_device_tsif[2] = {
1953 {
1954 .name = "msm_tsif",
1955 .id = 0,
1956 .num_resources = ARRAY_SIZE(tsif0_resources),
1957 .resource = tsif0_resources,
1958 .dev = {
1959 .release = tsif_release,
1960 .platform_data = &tsif0_platform_data
1961 },
1962 },
1963 {
1964 .name = "msm_tsif",
1965 .id = 1,
1966 .num_resources = ARRAY_SIZE(tsif1_resources),
1967 .resource = tsif1_resources,
1968 .dev = {
1969 .release = tsif_release,
1970 .platform_data = &tsif1_platform_data
1971 },
1972 }
1973};
1974
1975struct platform_device msm_device_smd = {
1976 .name = "msm_smd",
1977 .id = -1,
1978};
1979
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001980static struct msm_watchdog_pdata msm_watchdog_pdata = {
1981 .pet_time = 10000,
1982 .bark_time = 11000,
1983 .has_secure = true,
1984};
1985
1986struct platform_device msm8660_device_watchdog = {
1987 .name = "msm_watchdog",
1988 .id = -1,
1989 .dev = {
1990 .platform_data = &msm_watchdog_pdata,
1991 },
1992};
1993
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001994static struct resource msm_dmov_resource_adm0[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001995 {
1996 .start = INT_ADM0_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001997 .flags = IORESOURCE_IRQ,
1998 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001999 {
2000 .start = 0x18320000,
2001 .end = 0x18320000 + SZ_1M - 1,
2002 .flags = IORESOURCE_MEM,
2003 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002004};
2005
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002006static struct resource msm_dmov_resource_adm1[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002007 {
2008 .start = INT_ADM1_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002009 .flags = IORESOURCE_IRQ,
2010 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002011 {
2012 .start = 0x18420000,
2013 .end = 0x18420000 + SZ_1M - 1,
2014 .flags = IORESOURCE_MEM,
2015 },
2016};
2017
2018static struct msm_dmov_pdata msm_dmov_pdata_adm0 = {
2019 .sd = 1,
2020 .sd_size = 0x800,
2021};
2022
2023static struct msm_dmov_pdata msm_dmov_pdata_adm1 = {
2024 .sd = 1,
2025 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002026};
2027
2028struct platform_device msm_device_dmov_adm0 = {
2029 .name = "msm_dmov",
2030 .id = 0,
2031 .resource = msm_dmov_resource_adm0,
2032 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm0),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002033 .dev = {
2034 .platform_data = &msm_dmov_pdata_adm0,
2035 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002036};
2037
2038struct platform_device msm_device_dmov_adm1 = {
2039 .name = "msm_dmov",
2040 .id = 1,
2041 .resource = msm_dmov_resource_adm1,
2042 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm1),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002043 .dev = {
2044 .platform_data = &msm_dmov_pdata_adm1,
2045 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002046};
2047
2048/* MSM Video core device */
2049#ifdef CONFIG_MSM_BUS_SCALING
2050static struct msm_bus_vectors vidc_init_vectors[] = {
2051 {
2052 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2053 .dst = MSM_BUS_SLAVE_SMI,
2054 .ab = 0,
2055 .ib = 0,
2056 },
2057 {
2058 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2059 .dst = MSM_BUS_SLAVE_SMI,
2060 .ab = 0,
2061 .ib = 0,
2062 },
2063 {
2064 .src = MSM_BUS_MASTER_AMPSS_M0,
2065 .dst = MSM_BUS_SLAVE_EBI_CH0,
2066 .ab = 0,
2067 .ib = 0,
2068 },
2069 {
2070 .src = MSM_BUS_MASTER_AMPSS_M0,
2071 .dst = MSM_BUS_SLAVE_SMI,
2072 .ab = 0,
2073 .ib = 0,
2074 },
2075};
2076static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
2077 {
2078 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2079 .dst = MSM_BUS_SLAVE_SMI,
2080 .ab = 54525952,
2081 .ib = 436207616,
2082 },
2083 {
2084 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2085 .dst = MSM_BUS_SLAVE_SMI,
2086 .ab = 72351744,
2087 .ib = 289406976,
2088 },
2089 {
2090 .src = MSM_BUS_MASTER_AMPSS_M0,
2091 .dst = MSM_BUS_SLAVE_EBI_CH0,
2092 .ab = 500000,
2093 .ib = 1000000,
2094 },
2095 {
2096 .src = MSM_BUS_MASTER_AMPSS_M0,
2097 .dst = MSM_BUS_SLAVE_SMI,
2098 .ab = 500000,
2099 .ib = 1000000,
2100 },
2101};
2102static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
2103 {
2104 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2105 .dst = MSM_BUS_SLAVE_SMI,
2106 .ab = 40894464,
2107 .ib = 327155712,
2108 },
2109 {
2110 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2111 .dst = MSM_BUS_SLAVE_SMI,
2112 .ab = 48234496,
2113 .ib = 192937984,
2114 },
2115 {
2116 .src = MSM_BUS_MASTER_AMPSS_M0,
2117 .dst = MSM_BUS_SLAVE_EBI_CH0,
2118 .ab = 500000,
2119 .ib = 2000000,
2120 },
2121 {
2122 .src = MSM_BUS_MASTER_AMPSS_M0,
2123 .dst = MSM_BUS_SLAVE_SMI,
2124 .ab = 500000,
2125 .ib = 2000000,
2126 },
2127};
2128static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
2129 {
2130 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2131 .dst = MSM_BUS_SLAVE_SMI,
2132 .ab = 163577856,
2133 .ib = 1308622848,
2134 },
2135 {
2136 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2137 .dst = MSM_BUS_SLAVE_SMI,
2138 .ab = 219152384,
2139 .ib = 876609536,
2140 },
2141 {
2142 .src = MSM_BUS_MASTER_AMPSS_M0,
2143 .dst = MSM_BUS_SLAVE_EBI_CH0,
2144 .ab = 1750000,
2145 .ib = 3500000,
2146 },
2147 {
2148 .src = MSM_BUS_MASTER_AMPSS_M0,
2149 .dst = MSM_BUS_SLAVE_SMI,
2150 .ab = 1750000,
2151 .ib = 3500000,
2152 },
2153};
2154static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
2155 {
2156 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2157 .dst = MSM_BUS_SLAVE_SMI,
2158 .ab = 121634816,
2159 .ib = 973078528,
2160 },
2161 {
2162 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2163 .dst = MSM_BUS_SLAVE_SMI,
2164 .ab = 155189248,
2165 .ib = 620756992,
2166 },
2167 {
2168 .src = MSM_BUS_MASTER_AMPSS_M0,
2169 .dst = MSM_BUS_SLAVE_EBI_CH0,
2170 .ab = 1750000,
2171 .ib = 7000000,
2172 },
2173 {
2174 .src = MSM_BUS_MASTER_AMPSS_M0,
2175 .dst = MSM_BUS_SLAVE_SMI,
2176 .ab = 1750000,
2177 .ib = 7000000,
2178 },
2179};
2180static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
2181 {
2182 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2183 .dst = MSM_BUS_SLAVE_SMI,
2184 .ab = 372244480,
2185 .ib = 1861222400,
2186 },
2187 {
2188 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2189 .dst = MSM_BUS_SLAVE_SMI,
2190 .ab = 501219328,
2191 .ib = 2004877312,
2192 },
2193 {
2194 .src = MSM_BUS_MASTER_AMPSS_M0,
2195 .dst = MSM_BUS_SLAVE_EBI_CH0,
2196 .ab = 2500000,
2197 .ib = 5000000,
2198 },
2199 {
2200 .src = MSM_BUS_MASTER_AMPSS_M0,
2201 .dst = MSM_BUS_SLAVE_SMI,
2202 .ab = 2500000,
2203 .ib = 5000000,
2204 },
2205};
2206static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
2207 {
2208 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2209 .dst = MSM_BUS_SLAVE_SMI,
2210 .ab = 222298112,
2211 .ib = 1778384896,
2212 },
2213 {
2214 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2215 .dst = MSM_BUS_SLAVE_SMI,
2216 .ab = 330301440,
2217 .ib = 1321205760,
2218 },
2219 {
2220 .src = MSM_BUS_MASTER_AMPSS_M0,
2221 .dst = MSM_BUS_SLAVE_EBI_CH0,
2222 .ab = 2500000,
2223 .ib = 700000000,
2224 },
2225 {
2226 .src = MSM_BUS_MASTER_AMPSS_M0,
2227 .dst = MSM_BUS_SLAVE_SMI,
2228 .ab = 2500000,
2229 .ib = 10000000,
2230 },
2231};
2232
2233static struct msm_bus_paths vidc_bus_client_config[] = {
2234 {
2235 ARRAY_SIZE(vidc_init_vectors),
2236 vidc_init_vectors,
2237 },
2238 {
2239 ARRAY_SIZE(vidc_venc_vga_vectors),
2240 vidc_venc_vga_vectors,
2241 },
2242 {
2243 ARRAY_SIZE(vidc_vdec_vga_vectors),
2244 vidc_vdec_vga_vectors,
2245 },
2246 {
2247 ARRAY_SIZE(vidc_venc_720p_vectors),
2248 vidc_venc_720p_vectors,
2249 },
2250 {
2251 ARRAY_SIZE(vidc_vdec_720p_vectors),
2252 vidc_vdec_720p_vectors,
2253 },
2254 {
2255 ARRAY_SIZE(vidc_venc_1080p_vectors),
2256 vidc_venc_1080p_vectors,
2257 },
2258 {
2259 ARRAY_SIZE(vidc_vdec_1080p_vectors),
2260 vidc_vdec_1080p_vectors,
2261 },
2262};
2263
2264static struct msm_bus_scale_pdata vidc_bus_client_data = {
2265 vidc_bus_client_config,
2266 ARRAY_SIZE(vidc_bus_client_config),
2267 .name = "vidc",
2268};
2269
2270#endif
2271
2272#define MSM_VIDC_BASE_PHYS 0x04400000
2273#define MSM_VIDC_BASE_SIZE 0x00100000
2274
2275static struct resource msm_device_vidc_resources[] = {
2276 {
2277 .start = MSM_VIDC_BASE_PHYS,
2278 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
2279 .flags = IORESOURCE_MEM,
2280 },
2281 {
2282 .start = VCODEC_IRQ,
2283 .end = VCODEC_IRQ,
2284 .flags = IORESOURCE_IRQ,
2285 },
2286};
2287
2288struct msm_vidc_platform_data vidc_platform_data = {
2289#ifdef CONFIG_MSM_BUS_SCALING
2290 .vidc_bus_client_pdata = &vidc_bus_client_data,
2291#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -07002292#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Deepak Kotur59955cb2011-12-08 10:23:01 -08002293 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002294 .enable_ion = 1,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302295 .cp_enabled = 1,
2296 .secure_wb_heap = 1,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002297#else
Deepak Kotur12301a72011-11-09 18:30:29 -08002298 .memtype = MEMTYPE_SMI_KERNEL,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002299 .enable_ion = 0,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302300 .secure_wb_heap = 0,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002301#endif
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05302302 .disable_dmx = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08002303 .disable_fullhd = 0,
Deva Ramasubramanian837ae362012-05-12 23:26:53 -07002304 .cont_mode_dpb_count = 8,
2305 .disable_turbo = 1,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302306 .fw_addr = 0x38000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002307};
2308
2309struct platform_device msm_device_vidc = {
2310 .name = "msm_vidc",
2311 .id = 0,
2312 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
2313 .resource = msm_device_vidc_resources,
2314 .dev = {
2315 .platform_data = &vidc_platform_data,
2316 },
2317};
2318
Praveen Chidambaram78499012011-11-01 17:15:17 -06002319#if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE)
2320static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2321 .phys_addr_base = 0x00106000,
2322 .reg_offsets = {
2323 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000C80,
2324 [MSM_RPM_LOG_PAGE_BUFFER] = 0x00000CA0,
2325 },
2326 .phys_size = SZ_8K,
2327 .log_len = 4096, /* log's buffer length in bytes */
2328 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2329};
2330
2331struct platform_device msm8660_rpm_log_device = {
2332 .name = "msm_rpm_log",
2333 .id = -1,
2334 .dev = {
2335 .platform_data = &msm_rpm_log_pdata,
2336 },
2337};
2338#endif
2339
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002340#if defined(CONFIG_MSM_RPM_STATS_LOG)
2341static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2342 .phys_addr_base = 0x00107E04,
2343 .phys_size = SZ_8K,
2344};
2345
Praveen Chidambaram78499012011-11-01 17:15:17 -06002346struct platform_device msm8660_rpm_stat_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002347 .name = "msm_rpm_stat",
2348 .id = -1,
2349 .dev = {
2350 .platform_data = &msm_rpm_stat_pdata,
2351 },
2352};
2353#endif
2354
Mona Hossainceca6152012-04-10 09:55:41 -07002355#define SHARED_IMEM_TZ_BASE 0x2a05f720
2356static struct resource tzlog_resources[] = {
2357 {
2358 .start = SHARED_IMEM_TZ_BASE,
2359 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
2360 .flags = IORESOURCE_MEM,
2361 },
2362};
2363
2364struct platform_device msm_device_tz_log = {
2365 .name = "tz_log",
2366 .id = 0,
2367 .num_resources = ARRAY_SIZE(tzlog_resources),
2368 .resource = tzlog_resources,
2369};
2370
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002371#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002372static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002373 [1] = MSM_GPIO_TO_INT(61),
2374 [4] = MSM_GPIO_TO_INT(87),
2375 [5] = MSM_GPIO_TO_INT(88),
2376 [6] = MSM_GPIO_TO_INT(89),
2377 [7] = MSM_GPIO_TO_INT(90),
2378 [8] = MSM_GPIO_TO_INT(91),
2379 [9] = MSM_GPIO_TO_INT(34),
2380 [10] = MSM_GPIO_TO_INT(38),
2381 [11] = MSM_GPIO_TO_INT(42),
2382 [12] = MSM_GPIO_TO_INT(46),
2383 [13] = MSM_GPIO_TO_INT(50),
2384 [14] = MSM_GPIO_TO_INT(54),
2385 [15] = MSM_GPIO_TO_INT(58),
2386 [16] = MSM_GPIO_TO_INT(63),
2387 [17] = MSM_GPIO_TO_INT(160),
2388 [18] = MSM_GPIO_TO_INT(162),
2389 [19] = MSM_GPIO_TO_INT(144),
2390 [20] = MSM_GPIO_TO_INT(146),
2391 [25] = USB1_HS_IRQ,
2392 [26] = TV_ENC_IRQ,
2393 [27] = HDMI_IRQ,
2394 [29] = MSM_GPIO_TO_INT(123),
2395 [30] = MSM_GPIO_TO_INT(172),
2396 [31] = MSM_GPIO_TO_INT(99),
2397 [32] = MSM_GPIO_TO_INT(96),
2398 [33] = MSM_GPIO_TO_INT(67),
2399 [34] = MSM_GPIO_TO_INT(71),
2400 [35] = MSM_GPIO_TO_INT(105),
2401 [36] = MSM_GPIO_TO_INT(117),
2402 [37] = MSM_GPIO_TO_INT(29),
2403 [38] = MSM_GPIO_TO_INT(30),
2404 [39] = MSM_GPIO_TO_INT(31),
2405 [40] = MSM_GPIO_TO_INT(37),
2406 [41] = MSM_GPIO_TO_INT(40),
2407 [42] = MSM_GPIO_TO_INT(41),
2408 [43] = MSM_GPIO_TO_INT(45),
2409 [44] = MSM_GPIO_TO_INT(51),
2410 [45] = MSM_GPIO_TO_INT(52),
2411 [46] = MSM_GPIO_TO_INT(57),
2412 [47] = MSM_GPIO_TO_INT(73),
2413 [48] = MSM_GPIO_TO_INT(93),
2414 [49] = MSM_GPIO_TO_INT(94),
2415 [50] = MSM_GPIO_TO_INT(103),
2416 [51] = MSM_GPIO_TO_INT(104),
2417 [52] = MSM_GPIO_TO_INT(106),
2418 [53] = MSM_GPIO_TO_INT(115),
2419 [54] = MSM_GPIO_TO_INT(124),
2420 [55] = MSM_GPIO_TO_INT(125),
2421 [56] = MSM_GPIO_TO_INT(126),
2422 [57] = MSM_GPIO_TO_INT(127),
2423 [58] = MSM_GPIO_TO_INT(128),
2424 [59] = MSM_GPIO_TO_INT(129),
2425};
2426
Praveen Chidambaram78499012011-11-01 17:15:17 -06002427static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002428 TLMM_MSM_SUMMARY_IRQ,
2429 RPM_SCSS_CPU0_GP_HIGH_IRQ,
2430 RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2431 RPM_SCSS_CPU0_GP_LOW_IRQ,
2432 RPM_SCSS_CPU0_WAKE_UP_IRQ,
2433 RPM_SCSS_CPU1_GP_HIGH_IRQ,
2434 RPM_SCSS_CPU1_GP_MEDIUM_IRQ,
2435 RPM_SCSS_CPU1_GP_LOW_IRQ,
2436 RPM_SCSS_CPU1_WAKE_UP_IRQ,
2437 MARM_SCSS_GP_IRQ_0,
2438 MARM_SCSS_GP_IRQ_1,
2439 MARM_SCSS_GP_IRQ_2,
2440 MARM_SCSS_GP_IRQ_3,
2441 MARM_SCSS_GP_IRQ_4,
2442 MARM_SCSS_GP_IRQ_5,
2443 MARM_SCSS_GP_IRQ_6,
2444 MARM_SCSS_GP_IRQ_7,
2445 MARM_SCSS_GP_IRQ_8,
2446 MARM_SCSS_GP_IRQ_9,
2447 LPASS_SCSS_GP_LOW_IRQ,
2448 LPASS_SCSS_GP_MEDIUM_IRQ,
2449 LPASS_SCSS_GP_HIGH_IRQ,
2450 SDC4_IRQ_0,
2451 SPS_MTI_31,
2452};
2453
Praveen Chidambaram78499012011-11-01 17:15:17 -06002454struct msm_mpm_device_data msm8660_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002455 .irqs_m2a = msm_mpm_irqs_m2a,
2456 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2457 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2458 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2459 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2460 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2461 .mpm_apps_ipc_reg = MSM_GCC_BASE + 0x008,
2462 .mpm_apps_ipc_val = BIT(1),
2463 .mpm_ipc_irq = RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2464
2465};
2466#endif
2467
2468
2469#ifdef CONFIG_MSM_BUS_SCALING
2470struct platform_device msm_bus_sys_fabric = {
2471 .name = "msm_bus_fabric",
2472 .id = MSM_BUS_FAB_SYSTEM,
2473};
2474struct platform_device msm_bus_apps_fabric = {
2475 .name = "msm_bus_fabric",
2476 .id = MSM_BUS_FAB_APPSS,
2477};
2478struct platform_device msm_bus_mm_fabric = {
2479 .name = "msm_bus_fabric",
2480 .id = MSM_BUS_FAB_MMSS,
2481};
2482struct platform_device msm_bus_sys_fpb = {
2483 .name = "msm_bus_fabric",
2484 .id = MSM_BUS_FAB_SYSTEM_FPB,
2485};
2486struct platform_device msm_bus_cpss_fpb = {
2487 .name = "msm_bus_fabric",
2488 .id = MSM_BUS_FAB_CPSS_FPB,
2489};
2490#endif
2491
Lei Zhou01366a42011-08-19 13:12:00 -04002492#ifdef CONFIG_SND_SOC_MSM8660_APQ
2493struct platform_device msm_pcm = {
2494 .name = "msm-pcm-dsp",
2495 .id = -1,
2496};
2497
2498struct platform_device msm_pcm_routing = {
2499 .name = "msm-pcm-routing",
2500 .id = -1,
2501};
2502
2503struct platform_device msm_cpudai0 = {
2504 .name = "msm-dai-q6",
2505 .id = PRIMARY_I2S_RX,
2506};
2507
2508struct platform_device msm_cpudai1 = {
2509 .name = "msm-dai-q6",
2510 .id = PRIMARY_I2S_TX,
2511};
2512
2513struct platform_device msm_cpudai_hdmi_rx = {
2514 .name = "msm-dai-q6",
2515 .id = HDMI_RX,
2516};
2517
2518struct platform_device msm_cpudai_bt_rx = {
2519 .name = "msm-dai-q6",
2520 .id = INT_BT_SCO_RX,
2521};
2522
2523struct platform_device msm_cpudai_bt_tx = {
2524 .name = "msm-dai-q6",
2525 .id = INT_BT_SCO_TX,
2526};
2527
2528struct platform_device msm_cpudai_fm_rx = {
2529 .name = "msm-dai-q6",
2530 .id = INT_FM_RX,
2531};
2532
2533struct platform_device msm_cpudai_fm_tx = {
2534 .name = "msm-dai-q6",
2535 .id = INT_FM_TX,
2536};
2537
2538struct platform_device msm_cpu_fe = {
2539 .name = "msm-dai-fe",
2540 .id = -1,
2541};
2542
2543struct platform_device msm_stub_codec = {
2544 .name = "msm-stub-codec",
2545 .id = 1,
2546};
2547
2548struct platform_device msm_voice = {
2549 .name = "msm-pcm-voice",
2550 .id = -1,
2551};
2552
2553struct platform_device msm_voip = {
2554 .name = "msm-voip-dsp",
2555 .id = -1,
2556};
2557
2558struct platform_device msm_lpa_pcm = {
2559 .name = "msm-pcm-lpa",
2560 .id = -1,
2561};
2562
2563struct platform_device msm_pcm_hostless = {
2564 .name = "msm-pcm-hostless",
2565 .id = -1,
2566};
2567#endif
2568
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002569struct platform_device asoc_msm_pcm = {
2570 .name = "msm-dsp-audio",
2571 .id = 0,
2572};
2573
2574struct platform_device asoc_msm_dai0 = {
2575 .name = "msm-codec-dai",
2576 .id = 0,
2577};
2578
2579struct platform_device asoc_msm_dai1 = {
2580 .name = "msm-cpu-dai",
2581 .id = 0,
2582};
2583
2584#if defined (CONFIG_MSM_8x60_VOIP)
2585struct platform_device asoc_msm_mvs = {
2586 .name = "msm-mvs-audio",
2587 .id = 0,
2588};
2589
2590struct platform_device asoc_mvs_dai0 = {
2591 .name = "mvs-codec-dai",
2592 .id = 0,
2593};
2594
2595struct platform_device asoc_mvs_dai1 = {
2596 .name = "mvs-cpu-dai",
2597 .id = 0,
2598};
2599#endif
2600
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002601static struct fs_driver_data gfx2d0_fs_data = {
2602 .clks = (struct fs_clk_data[]){
2603 { .name = "core_clk" },
2604 { .name = "iface_clk" },
2605 { 0 }
2606 },
2607 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002608};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002609
2610static struct fs_driver_data gfx2d1_fs_data = {
2611 .clks = (struct fs_clk_data[]){
2612 { .name = "core_clk" },
2613 { .name = "iface_clk" },
2614 { 0 }
2615 },
2616 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2617};
2618
2619static struct fs_driver_data gfx3d_fs_data = {
2620 .clks = (struct fs_clk_data[]){
2621 { .name = "core_clk", .reset_rate = 27000000 },
2622 { .name = "iface_clk" },
2623 { 0 }
2624 },
2625 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2626};
2627
2628static struct fs_driver_data ijpeg_fs_data = {
2629 .clks = (struct fs_clk_data[]){
2630 { .name = "core_clk" },
2631 { .name = "iface_clk" },
2632 { .name = "bus_clk" },
2633 { 0 }
2634 },
2635 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2636};
2637
2638static struct fs_driver_data mdp_fs_data = {
2639 .clks = (struct fs_clk_data[]){
2640 { .name = "core_clk" },
2641 { .name = "iface_clk" },
2642 { .name = "bus_clk" },
2643 { .name = "vsync_clk" },
2644 { .name = "tv_src_clk" },
2645 { .name = "tv_clk" },
2646 { .name = "pixel_mdp_clk" },
2647 { .name = "pixel_lcdc_clk" },
2648 { 0 }
2649 },
2650 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2651 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2652};
2653
2654static struct fs_driver_data rot_fs_data = {
2655 .clks = (struct fs_clk_data[]){
2656 { .name = "core_clk" },
2657 { .name = "iface_clk" },
2658 { .name = "bus_clk" },
2659 { 0 }
2660 },
2661 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2662};
2663
2664static struct fs_driver_data ved_fs_data = {
2665 .clks = (struct fs_clk_data[]){
2666 { .name = "core_clk" },
2667 { .name = "iface_clk" },
2668 { .name = "bus_clk" },
2669 { 0 }
2670 },
2671 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
2672 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
2673};
2674
2675static struct fs_driver_data vfe_fs_data = {
2676 .clks = (struct fs_clk_data[]){
2677 { .name = "core_clk" },
2678 { .name = "iface_clk" },
2679 { .name = "bus_clk" },
2680 { 0 }
2681 },
2682 .bus_port0 = MSM_BUS_MASTER_VFE,
2683};
2684
2685static struct fs_driver_data vpe_fs_data = {
2686 .clks = (struct fs_clk_data[]){
2687 { .name = "core_clk" },
2688 { .name = "iface_clk" },
2689 { .name = "bus_clk" },
2690 { 0 }
2691 },
2692 .bus_port0 = MSM_BUS_MASTER_VPE,
2693};
2694
2695struct platform_device *msm8660_footswitch[] __initdata = {
Matt Wagantalle4454b82012-05-03 20:48:01 -07002696 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Matt Wagantalld4aab1e2012-05-03 20:26:56 -07002697 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07002698 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002699 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07002700 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
2701 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002702 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
2703 FS_8X60(FS_GFX2D0, "vdd", "kgsl-2d0.0", &gfx2d0_fs_data),
2704 FS_8X60(FS_GFX2D1, "vdd", "kgsl-2d1.1", &gfx2d1_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002705};
2706unsigned msm8660_num_footswitch __initdata = ARRAY_SIZE(msm8660_footswitch);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002707
Praveen Chidambaram78499012011-11-01 17:15:17 -06002708struct msm_rpm_platform_data msm8660_rpm_data __initdata = {
2709 .reg_base_addrs = {
2710 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2711 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2712 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2713 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2714 },
2715 .irq_ack = RPM_SCSS_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002716 .irq_err = RPM_SCSS_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06002717 .irq_wakeup = RPM_SCSS_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002718 .ipc_rpm_reg = MSM_GCC_BASE + 0x008,
2719 .ipc_rpm_val = 4,
2720 .target_id = {
2721 MSM_RPM_MAP(8660, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 8),
2722 MSM_RPM_MAP(8660, NOTIFICATION_REGISTERED_0, NOTIFICATION, 8),
2723 MSM_RPM_MAP(8660, INVALIDATE_0, INVALIDATE, 8),
2724 MSM_RPM_MAP(8660, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2725 MSM_RPM_MAP(8660, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2726 MSM_RPM_MAP(8660, TRIGGER_SET_FROM, TRIGGER_SET, 1),
2727 MSM_RPM_MAP(8660, TRIGGER_SET_TO, TRIGGER_SET, 1),
2728 MSM_RPM_MAP(8660, TRIGGER_SET_TRIGGER, TRIGGER_SET, 1),
2729 MSM_RPM_MAP(8660, TRIGGER_CLEAR_FROM, TRIGGER_CLEAR, 1),
2730 MSM_RPM_MAP(8660, TRIGGER_CLEAR_TO, TRIGGER_CLEAR, 1),
2731 MSM_RPM_MAP(8660, TRIGGER_CLEAR_TRIGGER, TRIGGER_CLEAR, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002732
Praveen Chidambaram78499012011-11-01 17:15:17 -06002733 MSM_RPM_MAP(8660, CXO_CLK, CXO_CLK, 1),
2734 MSM_RPM_MAP(8660, PXO_CLK, PXO_CLK, 1),
2735 MSM_RPM_MAP(8660, PLL_4, PLL_4, 1),
2736 MSM_RPM_MAP(8660, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2737 MSM_RPM_MAP(8660, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2738 MSM_RPM_MAP(8660, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2739 MSM_RPM_MAP(8660, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2740 MSM_RPM_MAP(8660, SFPB_CLK, SFPB_CLK, 1),
2741 MSM_RPM_MAP(8660, CFPB_CLK, CFPB_CLK, 1),
2742 MSM_RPM_MAP(8660, MMFPB_CLK, MMFPB_CLK, 1),
2743 MSM_RPM_MAP(8660, SMI_CLK, SMI_CLK, 1),
2744 MSM_RPM_MAP(8660, EBI1_CLK, EBI1_CLK, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002745
Praveen Chidambaram78499012011-11-01 17:15:17 -06002746 MSM_RPM_MAP(8660, APPS_L2_CACHE_CTL, APPS_L2_CACHE_CTL, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002747
Praveen Chidambaram78499012011-11-01 17:15:17 -06002748 MSM_RPM_MAP(8660, APPS_FABRIC_HALT_0, APPS_FABRIC_HALT, 2),
2749 MSM_RPM_MAP(8660, APPS_FABRIC_CLOCK_MODE_0,
2750 APPS_FABRIC_CLOCK_MODE, 3),
2751 MSM_RPM_MAP(8660, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002752
Praveen Chidambaram78499012011-11-01 17:15:17 -06002753 MSM_RPM_MAP(8660, SYSTEM_FABRIC_HALT_0, SYSTEM_FABRIC_HALT, 2),
2754 MSM_RPM_MAP(8660, SYSTEM_FABRIC_CLOCK_MODE_0,
2755 SYSTEM_FABRIC_CLOCK_MODE, 3),
2756 MSM_RPM_MAP(8660, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 22),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002757
Praveen Chidambaram78499012011-11-01 17:15:17 -06002758 MSM_RPM_MAP(8660, MM_FABRIC_HALT_0, MM_FABRIC_HALT, 2),
2759 MSM_RPM_MAP(8660, MM_FABRIC_CLOCK_MODE_0,
2760 MM_FABRIC_CLOCK_MODE, 3),
2761 MSM_RPM_MAP(8660, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002762
Praveen Chidambaram78499012011-11-01 17:15:17 -06002763 MSM_RPM_MAP(8660, SMPS0B_0, SMPS0B, 2),
2764 MSM_RPM_MAP(8660, SMPS1B_0, SMPS1B, 2),
2765 MSM_RPM_MAP(8660, SMPS2B_0, SMPS2B, 2),
2766 MSM_RPM_MAP(8660, SMPS3B_0, SMPS3B, 2),
2767 MSM_RPM_MAP(8660, SMPS4B_0, SMPS4B, 2),
2768 MSM_RPM_MAP(8660, LDO0B_0, LDO0B, 2),
2769 MSM_RPM_MAP(8660, LDO1B_0, LDO1B, 2),
2770 MSM_RPM_MAP(8660, LDO2B_0, LDO2B, 2),
2771 MSM_RPM_MAP(8660, LDO3B_0, LDO3B, 2),
2772 MSM_RPM_MAP(8660, LDO4B_0, LDO4B, 2),
2773 MSM_RPM_MAP(8660, LDO5B_0, LDO5B, 2),
2774 MSM_RPM_MAP(8660, LDO6B_0, LDO6B, 2),
2775 MSM_RPM_MAP(8660, LVS0B, LVS0B, 1),
2776 MSM_RPM_MAP(8660, LVS1B, LVS1B, 1),
2777 MSM_RPM_MAP(8660, LVS2B, LVS2B, 1),
2778 MSM_RPM_MAP(8660, LVS3B, LVS3B, 1),
2779 MSM_RPM_MAP(8660, MVS, MVS, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002780
Praveen Chidambaram78499012011-11-01 17:15:17 -06002781 MSM_RPM_MAP(8660, SMPS0_0, SMPS0, 2),
2782 MSM_RPM_MAP(8660, SMPS1_0, SMPS1, 2),
2783 MSM_RPM_MAP(8660, SMPS2_0, SMPS2, 2),
2784 MSM_RPM_MAP(8660, SMPS3_0, SMPS3, 2),
2785 MSM_RPM_MAP(8660, SMPS4_0, SMPS4, 2),
2786 MSM_RPM_MAP(8660, LDO0_0, LDO0, 2),
2787 MSM_RPM_MAP(8660, LDO1_0, LDO1, 2),
2788 MSM_RPM_MAP(8660, LDO2_0, LDO2, 2),
2789 MSM_RPM_MAP(8660, LDO3_0, LDO3, 2),
2790 MSM_RPM_MAP(8660, LDO4_0, LDO4, 2),
2791 MSM_RPM_MAP(8660, LDO5_0, LDO5, 2),
2792 MSM_RPM_MAP(8660, LDO6_0, LDO6, 2),
2793 MSM_RPM_MAP(8660, LDO7_0, LDO7, 2),
2794 MSM_RPM_MAP(8660, LDO8_0, LDO8, 2),
2795 MSM_RPM_MAP(8660, LDO9_0, LDO9, 2),
2796 MSM_RPM_MAP(8660, LDO10_0, LDO10, 2),
2797 MSM_RPM_MAP(8660, LDO11_0, LDO11, 2),
2798 MSM_RPM_MAP(8660, LDO12_0, LDO12, 2),
2799 MSM_RPM_MAP(8660, LDO13_0, LDO13, 2),
2800 MSM_RPM_MAP(8660, LDO14_0, LDO14, 2),
2801 MSM_RPM_MAP(8660, LDO15_0, LDO15, 2),
2802 MSM_RPM_MAP(8660, LDO16_0, LDO16, 2),
2803 MSM_RPM_MAP(8660, LDO17_0, LDO17, 2),
2804 MSM_RPM_MAP(8660, LDO18_0, LDO18, 2),
2805 MSM_RPM_MAP(8660, LDO19_0, LDO19, 2),
2806 MSM_RPM_MAP(8660, LDO20_0, LDO20, 2),
2807 MSM_RPM_MAP(8660, LDO21_0, LDO21, 2),
2808 MSM_RPM_MAP(8660, LDO22_0, LDO22, 2),
2809 MSM_RPM_MAP(8660, LDO23_0, LDO23, 2),
2810 MSM_RPM_MAP(8660, LDO24_0, LDO24, 2),
2811 MSM_RPM_MAP(8660, LDO25_0, LDO25, 2),
2812 MSM_RPM_MAP(8660, LVS0, LVS0, 1),
2813 MSM_RPM_MAP(8660, LVS1, LVS1, 1),
2814 MSM_RPM_MAP(8660, NCP_0, NCP, 2),
2815 MSM_RPM_MAP(8660, CXO_BUFFERS, CXO_BUFFERS, 1),
2816 },
2817 .target_status = {
2818 MSM_RPM_STATUS_ID_MAP(8660, VERSION_MAJOR),
2819 MSM_RPM_STATUS_ID_MAP(8660, VERSION_MINOR),
2820 MSM_RPM_STATUS_ID_MAP(8660, VERSION_BUILD),
2821 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_0),
2822 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_1),
2823 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_2),
2824 MSM_RPM_STATUS_ID_MAP(8660, SEQUENCE),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002825
Praveen Chidambaram78499012011-11-01 17:15:17 -06002826 MSM_RPM_STATUS_ID_MAP(8660, CXO_CLK),
2827 MSM_RPM_STATUS_ID_MAP(8660, PXO_CLK),
2828 MSM_RPM_STATUS_ID_MAP(8660, PLL_4),
2829 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_CLK),
2830 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_CLK),
2831 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_CLK),
2832 MSM_RPM_STATUS_ID_MAP(8660, DAYTONA_FABRIC_CLK),
2833 MSM_RPM_STATUS_ID_MAP(8660, SFPB_CLK),
2834 MSM_RPM_STATUS_ID_MAP(8660, CFPB_CLK),
2835 MSM_RPM_STATUS_ID_MAP(8660, MMFPB_CLK),
2836 MSM_RPM_STATUS_ID_MAP(8660, SMI_CLK),
2837 MSM_RPM_STATUS_ID_MAP(8660, EBI1_CLK),
2838
2839 MSM_RPM_STATUS_ID_MAP(8660, APPS_L2_CACHE_CTL),
2840
2841 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_HALT),
2842 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_CLOCK_MODE),
2843 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_ARB),
2844
2845 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_HALT),
2846 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_CLOCK_MODE),
2847 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_ARB),
2848
2849 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_HALT),
2850 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_CLOCK_MODE),
2851 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_ARB),
2852
2853
2854 MSM_RPM_STATUS_ID_MAP(8660, SMPS0B_0),
2855 MSM_RPM_STATUS_ID_MAP(8660, SMPS0B_1),
2856 MSM_RPM_STATUS_ID_MAP(8660, SMPS1B_0),
2857 MSM_RPM_STATUS_ID_MAP(8660, SMPS1B_1),
2858 MSM_RPM_STATUS_ID_MAP(8660, SMPS2B_0),
2859 MSM_RPM_STATUS_ID_MAP(8660, SMPS2B_1),
2860 MSM_RPM_STATUS_ID_MAP(8660, SMPS3B_0),
2861 MSM_RPM_STATUS_ID_MAP(8660, SMPS3B_1),
2862 MSM_RPM_STATUS_ID_MAP(8660, SMPS4B_0),
2863 MSM_RPM_STATUS_ID_MAP(8660, SMPS4B_1),
2864 MSM_RPM_STATUS_ID_MAP(8660, LDO0B_0),
2865 MSM_RPM_STATUS_ID_MAP(8660, LDO0B_1),
2866 MSM_RPM_STATUS_ID_MAP(8660, LDO1B_0),
2867 MSM_RPM_STATUS_ID_MAP(8660, LDO1B_1),
2868 MSM_RPM_STATUS_ID_MAP(8660, LDO2B_0),
2869 MSM_RPM_STATUS_ID_MAP(8660, LDO2B_1),
2870 MSM_RPM_STATUS_ID_MAP(8660, LDO3B_0),
2871 MSM_RPM_STATUS_ID_MAP(8660, LDO3B_1),
2872 MSM_RPM_STATUS_ID_MAP(8660, LDO4B_0),
2873 MSM_RPM_STATUS_ID_MAP(8660, LDO4B_1),
2874 MSM_RPM_STATUS_ID_MAP(8660, LDO5B_0),
2875 MSM_RPM_STATUS_ID_MAP(8660, LDO5B_1),
2876 MSM_RPM_STATUS_ID_MAP(8660, LDO6B_0),
2877 MSM_RPM_STATUS_ID_MAP(8660, LDO6B_1),
2878 MSM_RPM_STATUS_ID_MAP(8660, LVS0B),
2879 MSM_RPM_STATUS_ID_MAP(8660, LVS1B),
2880 MSM_RPM_STATUS_ID_MAP(8660, LVS2B),
2881 MSM_RPM_STATUS_ID_MAP(8660, LVS3B),
2882 MSM_RPM_STATUS_ID_MAP(8660, MVS),
2883
2884
2885 MSM_RPM_STATUS_ID_MAP(8660, SMPS0_0),
2886 MSM_RPM_STATUS_ID_MAP(8660, SMPS0_1),
2887 MSM_RPM_STATUS_ID_MAP(8660, SMPS1_0),
2888 MSM_RPM_STATUS_ID_MAP(8660, SMPS1_1),
2889 MSM_RPM_STATUS_ID_MAP(8660, SMPS2_0),
2890 MSM_RPM_STATUS_ID_MAP(8660, SMPS2_1),
2891 MSM_RPM_STATUS_ID_MAP(8660, SMPS3_0),
2892 MSM_RPM_STATUS_ID_MAP(8660, SMPS3_1),
2893 MSM_RPM_STATUS_ID_MAP(8660, SMPS4_0),
2894 MSM_RPM_STATUS_ID_MAP(8660, SMPS4_1),
2895 MSM_RPM_STATUS_ID_MAP(8660, LDO0_0),
2896 MSM_RPM_STATUS_ID_MAP(8660, LDO0_1),
2897 MSM_RPM_STATUS_ID_MAP(8660, LDO1_0),
2898 MSM_RPM_STATUS_ID_MAP(8660, LDO1_1),
2899 MSM_RPM_STATUS_ID_MAP(8660, LDO2_0),
2900 MSM_RPM_STATUS_ID_MAP(8660, LDO2_1),
2901 MSM_RPM_STATUS_ID_MAP(8660, LDO3_0),
2902 MSM_RPM_STATUS_ID_MAP(8660, LDO3_1),
2903 MSM_RPM_STATUS_ID_MAP(8660, LDO4_0),
2904 MSM_RPM_STATUS_ID_MAP(8660, LDO4_1),
2905 MSM_RPM_STATUS_ID_MAP(8660, LDO5_0),
2906 MSM_RPM_STATUS_ID_MAP(8660, LDO5_1),
2907 MSM_RPM_STATUS_ID_MAP(8660, LDO6_0),
2908 MSM_RPM_STATUS_ID_MAP(8660, LDO6_1),
2909 MSM_RPM_STATUS_ID_MAP(8660, LDO7_0),
2910 MSM_RPM_STATUS_ID_MAP(8660, LDO7_1),
2911 MSM_RPM_STATUS_ID_MAP(8660, LDO8_0),
2912 MSM_RPM_STATUS_ID_MAP(8660, LDO8_1),
2913 MSM_RPM_STATUS_ID_MAP(8660, LDO9_0),
2914 MSM_RPM_STATUS_ID_MAP(8660, LDO9_1),
2915 MSM_RPM_STATUS_ID_MAP(8660, LDO10_0),
2916 MSM_RPM_STATUS_ID_MAP(8660, LDO10_1),
2917 MSM_RPM_STATUS_ID_MAP(8660, LDO11_0),
2918 MSM_RPM_STATUS_ID_MAP(8660, LDO11_1),
2919 MSM_RPM_STATUS_ID_MAP(8660, LDO12_0),
2920 MSM_RPM_STATUS_ID_MAP(8660, LDO12_1),
2921 MSM_RPM_STATUS_ID_MAP(8660, LDO13_0),
2922 MSM_RPM_STATUS_ID_MAP(8660, LDO13_1),
2923 MSM_RPM_STATUS_ID_MAP(8660, LDO14_0),
2924 MSM_RPM_STATUS_ID_MAP(8660, LDO14_1),
2925 MSM_RPM_STATUS_ID_MAP(8660, LDO15_0),
2926 MSM_RPM_STATUS_ID_MAP(8660, LDO15_1),
2927 MSM_RPM_STATUS_ID_MAP(8660, LDO16_0),
2928 MSM_RPM_STATUS_ID_MAP(8660, LDO16_1),
2929 MSM_RPM_STATUS_ID_MAP(8660, LDO17_0),
2930 MSM_RPM_STATUS_ID_MAP(8660, LDO17_1),
2931 MSM_RPM_STATUS_ID_MAP(8660, LDO18_0),
2932 MSM_RPM_STATUS_ID_MAP(8660, LDO18_1),
2933 MSM_RPM_STATUS_ID_MAP(8660, LDO19_0),
2934 MSM_RPM_STATUS_ID_MAP(8660, LDO19_1),
2935 MSM_RPM_STATUS_ID_MAP(8660, LDO20_0),
2936 MSM_RPM_STATUS_ID_MAP(8660, LDO20_1),
2937 MSM_RPM_STATUS_ID_MAP(8660, LDO21_0),
2938 MSM_RPM_STATUS_ID_MAP(8660, LDO21_1),
2939 MSM_RPM_STATUS_ID_MAP(8660, LDO22_0),
2940 MSM_RPM_STATUS_ID_MAP(8660, LDO22_1),
2941 MSM_RPM_STATUS_ID_MAP(8660, LDO23_0),
2942 MSM_RPM_STATUS_ID_MAP(8660, LDO23_1),
2943 MSM_RPM_STATUS_ID_MAP(8660, LDO24_0),
2944 MSM_RPM_STATUS_ID_MAP(8660, LDO24_1),
2945 MSM_RPM_STATUS_ID_MAP(8660, LDO25_0),
2946 MSM_RPM_STATUS_ID_MAP(8660, LDO25_1),
2947 MSM_RPM_STATUS_ID_MAP(8660, LVS0),
2948 MSM_RPM_STATUS_ID_MAP(8660, LVS1),
2949 MSM_RPM_STATUS_ID_MAP(8660, NCP_0),
2950 MSM_RPM_STATUS_ID_MAP(8660, NCP_1),
2951 MSM_RPM_STATUS_ID_MAP(8660, CXO_BUFFERS),
2952 },
2953 .target_ctrl_id = {
2954 MSM_RPM_CTRL_MAP(8660, VERSION_MAJOR),
2955 MSM_RPM_CTRL_MAP(8660, VERSION_MINOR),
2956 MSM_RPM_CTRL_MAP(8660, VERSION_BUILD),
2957 MSM_RPM_CTRL_MAP(8660, REQ_CTX_0),
2958 MSM_RPM_CTRL_MAP(8660, REQ_SEL_0),
2959 MSM_RPM_CTRL_MAP(8660, ACK_CTX_0),
2960 MSM_RPM_CTRL_MAP(8660, ACK_SEL_0),
2961 },
2962 .sel_invalidate = MSM_RPM_8660_SEL_INVALIDATE,
2963 .sel_notification = MSM_RPM_8660_SEL_NOTIFICATION,
2964 .sel_last = MSM_RPM_8660_SEL_LAST,
2965 .ver = {2, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002966};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002967
Praveen Chidambaram78499012011-11-01 17:15:17 -06002968struct platform_device msm8660_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002969 .name = "msm_rpm",
2970 .id = -1,
2971};
Laura Abbottd92be422012-06-04 15:11:09 -07002972
2973struct msm_iommu_domain_name msm8660_iommu_ctx_names[] = {
2974 /* Camera */
2975 {
2976 .name = "vpe_src",
2977 .domain = CAMERA_DOMAIN,
2978 },
2979 /* Camera */
2980 {
2981 .name = "vpe_dst",
2982 .domain = CAMERA_DOMAIN,
2983 },
2984 /* Camera */
2985 {
2986 .name = "vfe_imgwr",
2987 .domain = CAMERA_DOMAIN,
2988 },
2989 /* Camera */
2990 {
2991 .name = "vfe_misc",
2992 .domain = CAMERA_DOMAIN,
2993 },
2994 /* Camera */
2995 {
2996 .name = "ijpeg_src",
2997 .domain = CAMERA_DOMAIN,
2998 },
2999 /* Camera */
3000 {
3001 .name = "ijpeg_dst",
3002 .domain = CAMERA_DOMAIN,
3003 },
3004 /* Camera */
3005 {
3006 .name = "jpegd_src",
3007 .domain = CAMERA_DOMAIN,
3008 },
3009 /* Camera */
3010 {
3011 .name = "jpegd_dst",
3012 .domain = CAMERA_DOMAIN,
3013 },
3014 /* Rotator */
3015 {
3016 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07003017 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbottd92be422012-06-04 15:11:09 -07003018 },
3019 /* Rotator */
3020 {
3021 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07003022 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbottd92be422012-06-04 15:11:09 -07003023 },
3024 /* Video */
3025 {
3026 .name = "vcodec_a_mm1",
3027 .domain = VIDEO_DOMAIN,
3028 },
3029 /* Video */
3030 {
3031 .name = "vcodec_b_mm2",
3032 .domain = VIDEO_DOMAIN,
3033 },
3034 /* Video */
3035 {
3036 .name = "vcodec_a_stream",
3037 .domain = VIDEO_DOMAIN,
3038 },
3039};
3040
3041static struct mem_pool msm8660_video_pools[] = {
3042 /*
3043 * Video hardware has the following requirements:
3044 * 1. All video addresses used by the video hardware must be at a higher
3045 * address than video firmware address.
3046 * 2. Video hardware can only access a range of 256MB from the base of
3047 * the video firmware.
3048 */
3049 [VIDEO_FIRMWARE_POOL] =
3050 /* Low addresses, intended for video firmware */
3051 {
3052 .paddr = SZ_128K,
3053 .size = SZ_16M - SZ_128K,
3054 },
3055 [VIDEO_MAIN_POOL] =
3056 /* Main video pool */
3057 {
3058 .paddr = SZ_16M,
3059 .size = SZ_256M - SZ_16M,
3060 },
3061 [GEN_POOL] =
3062 /* Remaining address space up to 2G */
3063 {
3064 .paddr = SZ_256M,
3065 .size = SZ_2G - SZ_256M,
3066 },
3067};
3068
3069static struct mem_pool msm8660_camera_pools[] = {
3070 [GEN_POOL] =
3071 /* One address space for camera */
3072 {
3073 .paddr = SZ_128K,
3074 .size = SZ_2G - SZ_128K,
3075 },
3076};
3077
3078static struct mem_pool msm8660_display_pools[] = {
3079 [GEN_POOL] =
3080 /* One address space for display */
3081 {
3082 .paddr = SZ_128K,
3083 .size = SZ_2G - SZ_128K,
3084 },
3085};
3086
3087static struct mem_pool msm8660_rotator_pools[] = {
3088 [GEN_POOL] =
3089 /* One address space for rotator */
3090 {
3091 .paddr = SZ_128K,
3092 .size = SZ_2G - SZ_128K,
3093 },
3094};
3095
3096static struct msm_iommu_domain msm8660_iommu_domains[] = {
3097 [VIDEO_DOMAIN] = {
3098 .iova_pools = msm8660_video_pools,
3099 .npools = ARRAY_SIZE(msm8660_video_pools),
3100 },
3101 [CAMERA_DOMAIN] = {
3102 .iova_pools = msm8660_camera_pools,
3103 .npools = ARRAY_SIZE(msm8660_camera_pools),
3104 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003105 [DISPLAY_READ_DOMAIN] = {
Laura Abbottd92be422012-06-04 15:11:09 -07003106 .iova_pools = msm8660_display_pools,
3107 .npools = ARRAY_SIZE(msm8660_display_pools),
3108 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003109 [ROTATOR_SRC_DOMAIN] = {
Laura Abbottd92be422012-06-04 15:11:09 -07003110 .iova_pools = msm8660_rotator_pools,
3111 .npools = ARRAY_SIZE(msm8660_rotator_pools),
3112 },
3113};
3114
3115struct iommu_domains_pdata msm8660_iommu_domain_pdata = {
3116 .domains = msm8660_iommu_domains,
3117 .ndomains = ARRAY_SIZE(msm8660_iommu_domains),
3118 .domain_names = msm8660_iommu_ctx_names,
3119 .nnames = ARRAY_SIZE(msm8660_iommu_ctx_names),
3120 .domain_alloc_flags = 0,
3121};
3122
3123struct platform_device msm8660_iommu_domain_device = {
3124 .name = "iommu_domains",
3125 .id = -1,
3126 .dev = {
3127 .platform_data = &msm8660_iommu_domain_pdata,
3128 }
3129};