blob: 05858a54d03dd9a9be6f43fc669cbcd8044cc7e9 [file] [log] [blame]
Praveen Chidambaramf27a5152013-02-01 11:44:53 -07001/* Copyright (c) 2010-2013, The Linux Foundation. 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>
Mitchel Humpherys3c075492012-09-06 11:36:33 -070018#include <linux/msm_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
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070048#include <linux/gpio.h>
49#include <linux/delay.h>
50#include <mach/mdm.h>
51#include <mach/rpm.h>
52#include <mach/board.h>
Lei Zhou01366a42011-08-19 13:12:00 -040053#include <sound/apr_audio.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060054#include "rpm_log.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#include "rpm_stats.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053056#include <mach/mpm.h>
Jeff Ohlstein7e668552011-10-06 16:17:25 -070057#include "msm_watchdog.h"
Laura Abbottd92be422012-06-04 15:11:09 -070058#include <mach/iommu_domains.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059
60/* Address of GSBI blocks */
61#define MSM_GSBI1_PHYS 0x16000000
62#define MSM_GSBI2_PHYS 0x16100000
63#define MSM_GSBI3_PHYS 0x16200000
64#define MSM_GSBI4_PHYS 0x16300000
65#define MSM_GSBI5_PHYS 0x16400000
66#define MSM_GSBI6_PHYS 0x16500000
67#define MSM_GSBI7_PHYS 0x16600000
68#define MSM_GSBI8_PHYS 0x19800000
69#define MSM_GSBI9_PHYS 0x19900000
70#define MSM_GSBI10_PHYS 0x19A00000
71#define MSM_GSBI11_PHYS 0x19B00000
72#define MSM_GSBI12_PHYS 0x19C00000
73
74/* GSBI QUPe devices */
75#define MSM_GSBI1_QUP_PHYS 0x16080000
76#define MSM_GSBI2_QUP_PHYS 0x16180000
77#define MSM_GSBI3_QUP_PHYS 0x16280000
78#define MSM_GSBI4_QUP_PHYS 0x16380000
79#define MSM_GSBI5_QUP_PHYS 0x16480000
80#define MSM_GSBI6_QUP_PHYS 0x16580000
81#define MSM_GSBI7_QUP_PHYS 0x16680000
82#define MSM_GSBI8_QUP_PHYS 0x19880000
83#define MSM_GSBI9_QUP_PHYS 0x19980000
84#define MSM_GSBI10_QUP_PHYS 0x19A80000
85#define MSM_GSBI11_QUP_PHYS 0x19B80000
86#define MSM_GSBI12_QUP_PHYS 0x19C80000
87
88/* GSBI UART devices */
89#define MSM_UART1DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
90#define INT_UART1DM_IRQ GSBI6_UARTDM_IRQ
91#define INT_UART2DM_IRQ GSBI12_UARTDM_IRQ
92#define MSM_UART2DM_PHYS 0x19C40000
93#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
94#define INT_UART3DM_IRQ GSBI3_UARTDM_IRQ
95#define TCSR_BASE_PHYS 0x16b00000
96
97/* PRNG device */
98#define MSM_PRNG_PHYS 0x16C00000
99#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
100#define INT_UART9DM_IRQ GSBI9_UARTDM_IRQ
101
Rohit Vaswanid2001522012-12-05 19:23:44 -0800102static struct resource msm_gpio_resources[] = {
103 {
104 .start = TLMM_MSM_SUMMARY_IRQ,
105 .end = TLMM_MSM_SUMMARY_IRQ,
106 .flags = IORESOURCE_IRQ,
107 },
108};
109
Rohit Vaswani341c2032012-11-08 18:49:29 -0800110static struct msm_gpio_pdata msm8660_gpio_pdata = {
111 .ngpio = 173,
Rohit Vaswanied0a4ef2012-12-11 15:14:42 -0800112 .direct_connect_irqs = 10,
Rohit Vaswani341c2032012-11-08 18:49:29 -0800113};
114
Rohit Vaswanib1cc4932012-07-23 21:30:11 -0700115struct platform_device msm_gpio_device = {
Rohit Vaswani341c2032012-11-08 18:49:29 -0800116 .name = "msmgpio",
117 .id = -1,
118 .num_resources = ARRAY_SIZE(msm_gpio_resources),
119 .resource = msm_gpio_resources,
120 .dev.platform_data = &msm8660_gpio_pdata,
Rohit Vaswanib1cc4932012-07-23 21:30:11 -0700121};
122
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700123static void charm_ap2mdm_kpdpwr_on(void)
124{
125 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
Laura Abbotteda23372011-08-17 09:25:56 -0700126 gpio_direction_output(AP2MDM_KPDPWR_N, 1);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700127}
128
129static void charm_ap2mdm_kpdpwr_off(void)
130{
131 int i;
132
133 gpio_direction_output(AP2MDM_ERRFATAL, 1);
134
135 for (i = 20; i > 0; i--) {
136 if (gpio_get_value(MDM2AP_STATUS) == 0)
137 break;
138 msleep(100);
139 }
140 gpio_direction_output(AP2MDM_ERRFATAL, 0);
141
142 if (i == 0) {
143 pr_err("%s: MDM2AP_STATUS never went low. Doing a hard reset \
144 of the charm modem.\n", __func__);
145 gpio_direction_output(AP2MDM_PMIC_RESET_N, 1);
146 /*
147 * Currently, there is a debounce timer on the charm PMIC. It is
148 * necessary to hold the AP2MDM_PMIC_RESET low for ~3.5 seconds
149 * for the reset to fully take place. Sleep here to ensure the
150 * reset has occured before the function exits.
151 */
152 msleep(4000);
153 gpio_direction_output(AP2MDM_PMIC_RESET_N, 0);
154 }
155}
156
157static struct resource charm_resources[] = {
158 /* MDM2AP_ERRFATAL */
159 {
160 .start = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
161 .end = MSM_GPIO_TO_INT(MDM2AP_ERRFATAL),
162 .flags = IORESOURCE_IRQ,
163 },
164 /* MDM2AP_STATUS */
165 {
166 .start = MSM_GPIO_TO_INT(MDM2AP_STATUS),
167 .end = MSM_GPIO_TO_INT(MDM2AP_STATUS),
168 .flags = IORESOURCE_IRQ,
169 }
170};
171
172static struct charm_platform_data mdm_platform_data = {
173 .charm_modem_on = charm_ap2mdm_kpdpwr_on,
174 .charm_modem_off = charm_ap2mdm_kpdpwr_off,
175};
176
177struct platform_device msm_charm_modem = {
178 .name = "charm_modem",
179 .id = -1,
180 .num_resources = ARRAY_SIZE(charm_resources),
181 .resource = charm_resources,
182 .dev = {
183 .platform_data = &mdm_platform_data,
184 },
185};
186
Matt Wagantallbf430eb2012-03-22 11:45:49 -0700187struct platform_device msm8x60_device_acpuclk = {
188 .name = "acpuclk-8x60",
189 .id = -1,
190};
191
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700192#ifdef CONFIG_MSM_DSPS
193#define GSBI12_DEV (&msm_dsps_device.dev)
194#else
195#define GSBI12_DEV (&msm_gsbi12_qup_i2c_device.dev)
196#endif
197
198void __init msm8x60_init_irq(void)
199{
Praveen Chidambaram78499012011-11-01 17:15:17 -0600200 struct msm_mpm_device_data *data = NULL;
201
202#ifdef CONFIG_MSM_MPM
203 data = &msm8660_mpm_dev_data;
204#endif
205
206 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700207 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700208}
209
Stephen Boyd2e19d932012-05-09 17:36:04 -0700210#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
211#define MSM_LPASS_QDSP6SS_WDOG_PHYS 0x28882000
212#define MSM_LPASS_QDSP6SS_IM_PHYS 0x288A0000
Stephen Boyd3acc9e42011-09-28 16:46:40 -0700213
214static struct resource msm_8660_q6_resources[] = {
215 {
216 .start = MSM_LPASS_QDSP6SS_PHYS,
217 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
218 .flags = IORESOURCE_MEM,
219 },
Stephen Boyd2e19d932012-05-09 17:36:04 -0700220 {
221 .start = MSM_LPASS_QDSP6SS_IM_PHYS,
222 .end = MSM_LPASS_QDSP6SS_IM_PHYS + SZ_4K - 1,
223 .flags = IORESOURCE_MEM,
224 },
225 {
226 .start = MSM_LPASS_QDSP6SS_WDOG_PHYS,
227 .end = MSM_LPASS_QDSP6SS_WDOG_PHYS + SZ_4K - 1,
228 .flags = IORESOURCE_MEM,
229 },
230 {
Stephen Boyde24edf52012-07-12 17:46:19 -0700231 .start = 0x00900000,
232 .end = 0x00900000 + SZ_16K - 1,
233 .flags = IORESOURCE_MEM,
234 },
235 {
Stephen Boyd2e19d932012-05-09 17:36:04 -0700236 .start = LPASS_Q6SS_WDOG_EXPIRED,
237 .end = LPASS_Q6SS_WDOG_EXPIRED,
238 .flags = IORESOURCE_IRQ,
239 },
Stephen Boyd3acc9e42011-09-28 16:46:40 -0700240};
241
242struct platform_device msm_pil_q6v3 = {
243 .name = "pil_qdsp6v3",
244 .id = -1,
245 .num_resources = ARRAY_SIZE(msm_8660_q6_resources),
246 .resource = msm_8660_q6_resources,
247};
248
Stephen Boyd4eb885b2011-09-29 01:16:03 -0700249#define MSM_MSS_REGS_PHYS 0x10200000
Stephen Boyd3ac20732012-05-03 18:46:08 -0700250#define MSM_MSS_WDOG_PHYS 0x10020000
Stephen Boyd4eb885b2011-09-29 01:16:03 -0700251
252static struct resource msm_8660_modem_resources[] = {
253 {
254 .start = MSM_MSS_REGS_PHYS,
255 .end = MSM_MSS_REGS_PHYS + SZ_256 - 1,
256 .flags = IORESOURCE_MEM,
257 },
Stephen Boyd3ac20732012-05-03 18:46:08 -0700258 {
259 .start = MSM_MSS_WDOG_PHYS,
260 .end = MSM_MSS_WDOG_PHYS + SZ_4K - 1,
261 .flags = IORESOURCE_MEM,
262 },
263 {
Stephen Boyde24edf52012-07-12 17:46:19 -0700264 .start = 0x00900000,
265 .end = 0x00900000 + SZ_16K - 1,
266 .flags = IORESOURCE_MEM,
267 },
268 {
Stephen Boyd3ac20732012-05-03 18:46:08 -0700269 .start = MARM_WDOG_EXPIRED,
270 .end = MARM_WDOG_EXPIRED,
271 .flags = IORESOURCE_IRQ,
272 },
Stephen Boyd4eb885b2011-09-29 01:16:03 -0700273};
274
275struct platform_device msm_pil_modem = {
276 .name = "pil_modem",
277 .id = -1,
278 .num_resources = ARRAY_SIZE(msm_8660_modem_resources),
279 .resource = msm_8660_modem_resources,
280};
281
Stephen Boydd89eebe2011-09-28 23:28:11 -0700282struct platform_device msm_pil_tzapps = {
283 .name = "pil_tzapps",
284 .id = -1,
285};
286
Stephen Boyde24edf52012-07-12 17:46:19 -0700287static struct resource msm_pil_dsps_resources[] = {
288 {
289 .start = 0x00900000,
290 .end = 0x00900000 + SZ_16K - 1,
291 .flags = IORESOURCE_MEM,
292 },
293};
294
Stephen Boyd25c4a0b2011-09-20 00:12:36 -0700295struct platform_device msm_pil_dsps = {
296 .name = "pil_dsps",
297 .id = -1,
Stephen Boyde24edf52012-07-12 17:46:19 -0700298 .resource = msm_pil_dsps_resources,
299 .num_resources = ARRAY_SIZE(msm_pil_dsps_resources),
Stephen Boyd25c4a0b2011-09-20 00:12:36 -0700300 .dev.platform_data = "dsps",
301};
302
Riaz Rahamandd18ebf2012-06-27 16:06:34 +0530303struct platform_device msm_pil_vidc = {
304 .name = "pil_vidc",
305 .id = -1,
306};
307
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700308static struct resource msm_uart1_dm_resources[] = {
309 {
310 .start = MSM_UART1DM_PHYS,
311 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
312 .flags = IORESOURCE_MEM,
313 },
314 {
315 .start = INT_UART1DM_IRQ,
316 .end = INT_UART1DM_IRQ,
317 .flags = IORESOURCE_IRQ,
318 },
319 {
320 /* GSBI6 is UARTDM1 */
321 .start = MSM_GSBI6_PHYS,
322 .end = MSM_GSBI6_PHYS + 4 - 1,
323 .name = "gsbi_resource",
324 .flags = IORESOURCE_MEM,
325 },
326 {
327 .start = DMOV_HSUART1_TX_CHAN,
328 .end = DMOV_HSUART1_RX_CHAN,
329 .name = "uartdm_channels",
330 .flags = IORESOURCE_DMA,
331 },
332 {
333 .start = DMOV_HSUART1_TX_CRCI,
334 .end = DMOV_HSUART1_RX_CRCI,
335 .name = "uartdm_crci",
336 .flags = IORESOURCE_DMA,
337 },
338};
339
340static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
341
342struct platform_device msm_device_uart_dm1 = {
343 .name = "msm_serial_hs",
344 .id = 0,
345 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
346 .resource = msm_uart1_dm_resources,
347 .dev = {
348 .dma_mask = &msm_uart_dm1_dma_mask,
349 .coherent_dma_mask = DMA_BIT_MASK(32),
350 },
351};
352
353static struct resource msm_uart3_dm_resources[] = {
354 {
355 .start = MSM_UART3DM_PHYS,
356 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
357 .name = "uartdm_resource",
358 .flags = IORESOURCE_MEM,
359 },
360 {
361 .start = INT_UART3DM_IRQ,
362 .end = INT_UART3DM_IRQ,
363 .flags = IORESOURCE_IRQ,
364 },
365 {
366 .start = MSM_GSBI3_PHYS,
367 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
368 .name = "gsbi_resource",
369 .flags = IORESOURCE_MEM,
370 },
371};
372
373struct platform_device msm_device_uart_dm3 = {
374 .name = "msm_serial_hsl",
375 .id = 2,
376 .num_resources = ARRAY_SIZE(msm_uart3_dm_resources),
377 .resource = msm_uart3_dm_resources,
378};
379
380static struct resource msm_uart12_dm_resources[] = {
381 {
382 .start = MSM_UART2DM_PHYS,
383 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
384 .name = "uartdm_resource",
385 .flags = IORESOURCE_MEM,
386 },
387 {
388 .start = INT_UART2DM_IRQ,
389 .end = INT_UART2DM_IRQ,
390 .flags = IORESOURCE_IRQ,
391 },
392 {
393 /* GSBI 12 is UARTDM2 */
394 .start = MSM_GSBI12_PHYS,
395 .end = MSM_GSBI12_PHYS + PAGE_SIZE - 1,
396 .name = "gsbi_resource",
397 .flags = IORESOURCE_MEM,
398 },
399};
400
401struct platform_device msm_device_uart_dm12 = {
402 .name = "msm_serial_hsl",
403 .id = 0,
404 .num_resources = ARRAY_SIZE(msm_uart12_dm_resources),
405 .resource = msm_uart12_dm_resources,
406};
407
408#ifdef CONFIG_MSM_GSBI9_UART
409static struct msm_serial_hslite_platform_data uart_gsbi9_pdata = {
410 .config_gpio = 1,
411 .uart_tx_gpio = 67,
412 .uart_rx_gpio = 66,
Stepan Moskovchenko798fe552012-03-29 19:47:19 -0700413 .line = 1,
Mayank Rana965e9e72013-02-22 12:14:14 +0530414 .set_uart_clk_zero = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700415};
416
417static struct resource msm_uart_gsbi9_resources[] = {
418 {
419 .start = MSM_UART9DM_PHYS,
420 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
421 .name = "uartdm_resource",
422 .flags = IORESOURCE_MEM,
423 },
424 {
425 .start = INT_UART9DM_IRQ,
426 .end = INT_UART9DM_IRQ,
427 .flags = IORESOURCE_IRQ,
428 },
429 {
430 /* GSBI 9 is UART_GSBI9 */
431 .start = MSM_GSBI9_PHYS,
432 .end = MSM_GSBI9_PHYS + PAGE_SIZE - 1,
433 .name = "gsbi_resource",
434 .flags = IORESOURCE_MEM,
435 },
436};
437struct platform_device *msm_device_uart_gsbi9;
438struct platform_device *msm_add_gsbi9_uart(void)
439{
440 return platform_device_register_resndata(NULL, "msm_serial_hsl",
441 1, msm_uart_gsbi9_resources,
442 ARRAY_SIZE(msm_uart_gsbi9_resources),
443 &uart_gsbi9_pdata,
444 sizeof(uart_gsbi9_pdata));
445}
446#endif
447
448static struct resource gsbi3_qup_i2c_resources[] = {
449 {
450 .name = "qup_phys_addr",
451 .start = MSM_GSBI3_QUP_PHYS,
452 .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1,
453 .flags = IORESOURCE_MEM,
454 },
455 {
456 .name = "gsbi_qup_i2c_addr",
457 .start = MSM_GSBI3_PHYS,
458 .end = MSM_GSBI3_PHYS + 4 - 1,
459 .flags = IORESOURCE_MEM,
460 },
461 {
462 .name = "qup_err_intr",
463 .start = GSBI3_QUP_IRQ,
464 .end = GSBI3_QUP_IRQ,
465 .flags = IORESOURCE_IRQ,
466 },
467 {
468 .name = "i2c_clk",
469 .start = 44,
470 .end = 44,
471 .flags = IORESOURCE_IO,
472 },
473 {
474 .name = "i2c_sda",
475 .start = 43,
476 .end = 43,
477 .flags = IORESOURCE_IO,
478 },
479};
480
481static struct resource gsbi4_qup_i2c_resources[] = {
482 {
483 .name = "qup_phys_addr",
484 .start = MSM_GSBI4_QUP_PHYS,
485 .end = MSM_GSBI4_QUP_PHYS + SZ_4K - 1,
486 .flags = IORESOURCE_MEM,
487 },
488 {
489 .name = "gsbi_qup_i2c_addr",
490 .start = MSM_GSBI4_PHYS,
491 .end = MSM_GSBI4_PHYS + 4 - 1,
492 .flags = IORESOURCE_MEM,
493 },
494 {
495 .name = "qup_err_intr",
496 .start = GSBI4_QUP_IRQ,
497 .end = GSBI4_QUP_IRQ,
498 .flags = IORESOURCE_IRQ,
499 },
500};
501
502static struct resource gsbi7_qup_i2c_resources[] = {
503 {
504 .name = "qup_phys_addr",
505 .start = MSM_GSBI7_QUP_PHYS,
506 .end = MSM_GSBI7_QUP_PHYS + SZ_4K - 1,
507 .flags = IORESOURCE_MEM,
508 },
509 {
510 .name = "gsbi_qup_i2c_addr",
511 .start = MSM_GSBI7_PHYS,
512 .end = MSM_GSBI7_PHYS + 4 - 1,
513 .flags = IORESOURCE_MEM,
514 },
515 {
516 .name = "qup_err_intr",
517 .start = GSBI7_QUP_IRQ,
518 .end = GSBI7_QUP_IRQ,
519 .flags = IORESOURCE_IRQ,
520 },
521 {
522 .name = "i2c_clk",
523 .start = 60,
524 .end = 60,
525 .flags = IORESOURCE_IO,
526 },
527 {
528 .name = "i2c_sda",
529 .start = 59,
530 .end = 59,
531 .flags = IORESOURCE_IO,
532 },
533};
534
535static struct resource gsbi8_qup_i2c_resources[] = {
536 {
537 .name = "qup_phys_addr",
538 .start = MSM_GSBI8_QUP_PHYS,
539 .end = MSM_GSBI8_QUP_PHYS + SZ_4K - 1,
540 .flags = IORESOURCE_MEM,
541 },
542 {
543 .name = "gsbi_qup_i2c_addr",
544 .start = MSM_GSBI8_PHYS,
545 .end = MSM_GSBI8_PHYS + 4 - 1,
546 .flags = IORESOURCE_MEM,
547 },
548 {
549 .name = "qup_err_intr",
550 .start = GSBI8_QUP_IRQ,
551 .end = GSBI8_QUP_IRQ,
552 .flags = IORESOURCE_IRQ,
553 },
554};
555
556static struct resource gsbi9_qup_i2c_resources[] = {
557 {
558 .name = "qup_phys_addr",
559 .start = MSM_GSBI9_QUP_PHYS,
560 .end = MSM_GSBI9_QUP_PHYS + SZ_4K - 1,
561 .flags = IORESOURCE_MEM,
562 },
563 {
564 .name = "gsbi_qup_i2c_addr",
565 .start = MSM_GSBI9_PHYS,
566 .end = MSM_GSBI9_PHYS + 4 - 1,
567 .flags = IORESOURCE_MEM,
568 },
569 {
570 .name = "qup_err_intr",
571 .start = GSBI9_QUP_IRQ,
572 .end = GSBI9_QUP_IRQ,
573 .flags = IORESOURCE_IRQ,
574 },
575};
576
577static struct resource gsbi12_qup_i2c_resources[] = {
578 {
579 .name = "qup_phys_addr",
580 .start = MSM_GSBI12_QUP_PHYS,
581 .end = MSM_GSBI12_QUP_PHYS + SZ_4K - 1,
582 .flags = IORESOURCE_MEM,
583 },
584 {
585 .name = "gsbi_qup_i2c_addr",
586 .start = MSM_GSBI12_PHYS,
587 .end = MSM_GSBI12_PHYS + 4 - 1,
588 .flags = IORESOURCE_MEM,
589 },
590 {
591 .name = "qup_err_intr",
592 .start = GSBI12_QUP_IRQ,
593 .end = GSBI12_QUP_IRQ,
594 .flags = IORESOURCE_IRQ,
595 },
596};
597
598#ifdef CONFIG_MSM_BUS_SCALING
599static struct msm_bus_vectors grp3d_init_vectors[] = {
600 {
601 .src = MSM_BUS_MASTER_GRAPHICS_3D,
602 .dst = MSM_BUS_SLAVE_EBI_CH0,
603 .ab = 0,
604 .ib = 0,
605 },
606};
607
Lucille Sylvester293217d2011-08-19 17:50:52 -0600608static struct msm_bus_vectors grp3d_low_vectors[] = {
609 {
610 .src = MSM_BUS_MASTER_GRAPHICS_3D,
611 .dst = MSM_BUS_SLAVE_EBI_CH0,
612 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700613 .ib = KGSL_CONVERT_TO_MBPS(990),
Lucille Sylvester293217d2011-08-19 17:50:52 -0600614 },
615};
616
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700617static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
618 {
619 .src = MSM_BUS_MASTER_GRAPHICS_3D,
620 .dst = MSM_BUS_SLAVE_EBI_CH0,
621 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700622 .ib = KGSL_CONVERT_TO_MBPS(1300),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700623 },
624};
625
626static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
627 {
628 .src = MSM_BUS_MASTER_GRAPHICS_3D,
629 .dst = MSM_BUS_SLAVE_EBI_CH0,
630 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700631 .ib = KGSL_CONVERT_TO_MBPS(2008),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700632 },
633};
634
635static struct msm_bus_vectors grp3d_max_vectors[] = {
636 {
637 .src = MSM_BUS_MASTER_GRAPHICS_3D,
638 .dst = MSM_BUS_SLAVE_EBI_CH0,
639 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700640 .ib = KGSL_CONVERT_TO_MBPS(2484),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700641 },
642};
643
644static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
645 {
646 ARRAY_SIZE(grp3d_init_vectors),
647 grp3d_init_vectors,
648 },
649 {
Lucille Sylvester293217d2011-08-19 17:50:52 -0600650 ARRAY_SIZE(grp3d_low_vectors),
Suman Tatirajuc87f58c2011-10-14 10:58:37 -0700651 grp3d_low_vectors,
Lucille Sylvester293217d2011-08-19 17:50:52 -0600652 },
653 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700654 ARRAY_SIZE(grp3d_nominal_low_vectors),
655 grp3d_nominal_low_vectors,
656 },
657 {
658 ARRAY_SIZE(grp3d_nominal_high_vectors),
659 grp3d_nominal_high_vectors,
660 },
661 {
662 ARRAY_SIZE(grp3d_max_vectors),
663 grp3d_max_vectors,
664 },
665};
666
667static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
668 grp3d_bus_scale_usecases,
669 ARRAY_SIZE(grp3d_bus_scale_usecases),
670 .name = "grp3d",
671};
672
673static struct msm_bus_vectors grp2d0_init_vectors[] = {
674 {
675 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
676 .dst = MSM_BUS_SLAVE_EBI_CH0,
677 .ab = 0,
678 .ib = 0,
679 },
680};
681
682static struct msm_bus_vectors grp2d0_max_vectors[] = {
683 {
684 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
685 .dst = MSM_BUS_SLAVE_EBI_CH0,
686 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700687 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700688 },
689};
690
691static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
692 {
693 ARRAY_SIZE(grp2d0_init_vectors),
694 grp2d0_init_vectors,
695 },
696 {
697 ARRAY_SIZE(grp2d0_max_vectors),
698 grp2d0_max_vectors,
699 },
700};
701
702static struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
703 grp2d0_bus_scale_usecases,
704 ARRAY_SIZE(grp2d0_bus_scale_usecases),
705 .name = "grp2d0",
706};
707
708static struct msm_bus_vectors grp2d1_init_vectors[] = {
709 {
710 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
711 .dst = MSM_BUS_SLAVE_EBI_CH0,
712 .ab = 0,
713 .ib = 0,
714 },
715};
716
717static struct msm_bus_vectors grp2d1_max_vectors[] = {
718 {
719 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
720 .dst = MSM_BUS_SLAVE_EBI_CH0,
721 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -0700722 .ib = KGSL_CONVERT_TO_MBPS(990),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700723 },
724};
725
726static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
727 {
728 ARRAY_SIZE(grp2d1_init_vectors),
729 grp2d1_init_vectors,
730 },
731 {
732 ARRAY_SIZE(grp2d1_max_vectors),
733 grp2d1_max_vectors,
734 },
735};
736
737static struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
738 grp2d1_bus_scale_usecases,
739 ARRAY_SIZE(grp2d1_bus_scale_usecases),
740 .name = "grp2d1",
741};
742#endif
743
744#ifdef CONFIG_HW_RANDOM_MSM
745static struct resource rng_resources = {
746 .flags = IORESOURCE_MEM,
747 .start = MSM_PRNG_PHYS,
748 .end = MSM_PRNG_PHYS + SZ_512 - 1,
749};
750
751struct platform_device msm_device_rng = {
752 .name = "msm_rng",
753 .id = 0,
754 .num_resources = 1,
755 .resource = &rng_resources,
756};
757#endif
758
759static struct resource kgsl_3d0_resources[] = {
760 {
761 .name = KGSL_3D0_REG_MEMORY,
762 .start = 0x04300000, /* GFX3D address */
763 .end = 0x0431ffff,
764 .flags = IORESOURCE_MEM,
765 },
766 {
767 .name = KGSL_3D0_IRQ,
768 .start = GFX3D_IRQ,
769 .end = GFX3D_IRQ,
770 .flags = IORESOURCE_IRQ,
771 },
772};
773
774static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600775 .pwrlevel = {
776 {
777 .gpu_freq = 266667000,
778 .bus_freq = 4,
779 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700780 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600781 {
782 .gpu_freq = 228571000,
783 .bus_freq = 3,
784 .io_fraction = 33,
785 },
786 {
787 .gpu_freq = 200000000,
788 .bus_freq = 2,
789 .io_fraction = 100,
790 },
791 {
792 .gpu_freq = 177778000,
793 .bus_freq = 1,
794 .io_fraction = 100,
795 },
796 {
797 .gpu_freq = 27000000,
798 .bus_freq = 0,
799 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700800 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600801 .init_level = 0,
802 .num_levels = 5,
803 .set_grp_async = NULL,
804 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600805 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700806#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600807 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700808#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700809};
810
811struct platform_device msm_kgsl_3d0 = {
812 .name = "kgsl-3d0",
813 .id = 0,
814 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
815 .resource = kgsl_3d0_resources,
816 .dev = {
817 .platform_data = &kgsl_3d0_pdata,
818 },
819};
820
821static struct resource kgsl_2d0_resources[] = {
822 {
823 .name = KGSL_2D0_REG_MEMORY,
824 .start = 0x04100000, /* Z180 base address */
825 .end = 0x04100FFF,
826 .flags = IORESOURCE_MEM,
827 },
828 {
829 .name = KGSL_2D0_IRQ,
830 .start = GFX2D0_IRQ,
831 .end = GFX2D0_IRQ,
832 .flags = IORESOURCE_IRQ,
833 },
834};
835
836static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600837 .pwrlevel = {
838 {
839 .gpu_freq = 200000000,
840 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700841 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600842 {
843 .gpu_freq = 200000000,
844 .bus_freq = 0,
845 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700846 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600847 .init_level = 0,
848 .num_levels = 2,
849 .set_grp_async = NULL,
850 .idle_timeout = HZ/10,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600851 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700852#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600853 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700854#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700855};
856
857struct platform_device msm_kgsl_2d0 = {
858 .name = "kgsl-2d0",
859 .id = 0,
860 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
861 .resource = kgsl_2d0_resources,
862 .dev = {
863 .platform_data = &kgsl_2d0_pdata,
864 },
865};
866
867static struct resource kgsl_2d1_resources[] = {
868 {
869 .name = KGSL_2D1_REG_MEMORY,
870 .start = 0x04200000, /* Z180 device 1 base address */
871 .end = 0x04200FFF,
872 .flags = IORESOURCE_MEM,
873 },
874 {
875 .name = KGSL_2D1_IRQ,
876 .start = GFX2D1_IRQ,
877 .end = GFX2D1_IRQ,
878 .flags = IORESOURCE_IRQ,
879 },
880};
881
882static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600883 .pwrlevel = {
884 {
885 .gpu_freq = 200000000,
886 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700887 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600888 {
889 .gpu_freq = 200000000,
890 .bus_freq = 0,
891 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700892 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600893 .init_level = 0,
894 .num_levels = 2,
895 .set_grp_async = NULL,
896 .idle_timeout = HZ/10,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600897 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700898#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600899 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700900#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700901};
902
903struct platform_device msm_kgsl_2d1 = {
904 .name = "kgsl-2d1",
905 .id = 1,
906 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
907 .resource = kgsl_2d1_resources,
908 .dev = {
909 .platform_data = &kgsl_2d1_pdata,
910 },
911};
912
913/*
914 * this a software workaround for not having two distinct board
915 * files for 8660v1 and 8660v2. 8660v1 has a faulty 2d clock, and
916 * this workaround detects the cpu version to tell if the kernel is on a
917 * 8660v1, and should disable the 2d core. it is called from the board file
918 */
919void __init msm8x60_check_2d_hardware(void)
920{
921 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) &&
922 (SOCINFO_VERSION_MINOR(socinfo_get_version()) == 0)) {
923 printk(KERN_WARNING "kgsl: 2D cores disabled on 8660v1\n");
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600924 kgsl_2d0_pdata.clk_map = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700925 }
926}
927
928/* Use GSBI3 QUP for /dev/i2c-0 */
929struct platform_device msm_gsbi3_qup_i2c_device = {
930 .name = "qup_i2c",
931 .id = MSM_GSBI3_QUP_I2C_BUS_ID,
932 .num_resources = ARRAY_SIZE(gsbi3_qup_i2c_resources),
933 .resource = gsbi3_qup_i2c_resources,
934};
935
936/* Use GSBI4 QUP for /dev/i2c-1 */
937struct platform_device msm_gsbi4_qup_i2c_device = {
938 .name = "qup_i2c",
939 .id = MSM_GSBI4_QUP_I2C_BUS_ID,
940 .num_resources = ARRAY_SIZE(gsbi4_qup_i2c_resources),
941 .resource = gsbi4_qup_i2c_resources,
942};
943
944/* Use GSBI8 QUP for /dev/i2c-3 */
945struct platform_device msm_gsbi8_qup_i2c_device = {
946 .name = "qup_i2c",
947 .id = MSM_GSBI8_QUP_I2C_BUS_ID,
948 .num_resources = ARRAY_SIZE(gsbi8_qup_i2c_resources),
949 .resource = gsbi8_qup_i2c_resources,
950};
951
952/* Use GSBI9 QUP for /dev/i2c-2 */
953struct platform_device msm_gsbi9_qup_i2c_device = {
954 .name = "qup_i2c",
955 .id = MSM_GSBI9_QUP_I2C_BUS_ID,
956 .num_resources = ARRAY_SIZE(gsbi9_qup_i2c_resources),
957 .resource = gsbi9_qup_i2c_resources,
958};
959
960/* Use GSBI7 QUP for /dev/i2c-4 (Marimba) */
961struct platform_device msm_gsbi7_qup_i2c_device = {
962 .name = "qup_i2c",
963 .id = MSM_GSBI7_QUP_I2C_BUS_ID,
964 .num_resources = ARRAY_SIZE(gsbi7_qup_i2c_resources),
965 .resource = gsbi7_qup_i2c_resources,
966};
967
968/* Use GSBI12 QUP for /dev/i2c-5 (Sensors) */
969struct platform_device msm_gsbi12_qup_i2c_device = {
970 .name = "qup_i2c",
971 .id = MSM_GSBI12_QUP_I2C_BUS_ID,
972 .num_resources = ARRAY_SIZE(gsbi12_qup_i2c_resources),
973 .resource = gsbi12_qup_i2c_resources,
974};
975
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +0530976#ifdef CONFIG_MSM_SSBI
977#define MSM_SSBI_PMIC1_PHYS 0x00500000
978static struct resource resources_ssbi_pmic1_resource[] = {
979 {
980 .start = MSM_SSBI_PMIC1_PHYS,
981 .end = MSM_SSBI_PMIC1_PHYS + SZ_4K - 1,
982 .flags = IORESOURCE_MEM,
983 },
984};
985
986struct platform_device msm_device_ssbi_pmic1 = {
987 .name = "msm_ssbi",
988 .id = 0,
989 .resource = resources_ssbi_pmic1_resource,
990 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1_resource),
991};
Anirudh Ghayalc49157f2011-11-09 14:49:59 +0530992
993#define MSM_SSBI2_PMIC2B_PHYS 0x00C00000
994static struct resource resources_ssbi_pmic2_resource[] = {
995 {
996 .start = MSM_SSBI2_PMIC2B_PHYS,
997 .end = MSM_SSBI2_PMIC2B_PHYS + SZ_4K - 1,
998 .flags = IORESOURCE_MEM,
999 },
1000};
1001
1002struct platform_device msm_device_ssbi_pmic2 = {
1003 .name = "msm_ssbi",
1004 .id = 1,
1005 .resource = resources_ssbi_pmic2_resource,
1006 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2_resource),
1007};
Anirudh Ghayal9d9cdc22011-10-10 17:17:07 +05301008#endif
1009
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001010#ifdef CONFIG_I2C_SSBI
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001011/* CODEC SSBI on /dev/i2c-8 */
1012#define MSM_SSBI3_PHYS 0x18700000
1013static struct resource msm_ssbi3_resources[] = {
1014 {
1015 .name = "ssbi_base",
1016 .start = MSM_SSBI3_PHYS,
1017 .end = MSM_SSBI3_PHYS + SZ_4K - 1,
1018 .flags = IORESOURCE_MEM,
1019 },
1020};
1021
1022struct platform_device msm_device_ssbi3 = {
1023 .name = "i2c_ssbi",
1024 .id = MSM_SSBI3_I2C_BUS_ID,
1025 .num_resources = ARRAY_SIZE(msm_ssbi3_resources),
1026 .resource = msm_ssbi3_resources,
1027};
1028#endif /* CONFIG_I2C_SSBI */
1029
1030static struct resource gsbi1_qup_spi_resources[] = {
1031 {
1032 .name = "spi_base",
1033 .start = MSM_GSBI1_QUP_PHYS,
1034 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1035 .flags = IORESOURCE_MEM,
1036 },
1037 {
1038 .name = "gsbi_base",
1039 .start = MSM_GSBI1_PHYS,
1040 .end = MSM_GSBI1_PHYS + 4 - 1,
1041 .flags = IORESOURCE_MEM,
1042 },
1043 {
1044 .name = "spi_irq_in",
1045 .start = GSBI1_QUP_IRQ,
1046 .end = GSBI1_QUP_IRQ,
1047 .flags = IORESOURCE_IRQ,
1048 },
1049 {
1050 .name = "spidm_channels",
1051 .start = 5,
1052 .end = 6,
1053 .flags = IORESOURCE_DMA,
1054 },
1055 {
1056 .name = "spidm_crci",
1057 .start = 8,
1058 .end = 7,
1059 .flags = IORESOURCE_DMA,
1060 },
1061 {
1062 .name = "spi_clk",
1063 .start = 36,
1064 .end = 36,
1065 .flags = IORESOURCE_IO,
1066 },
1067 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001068 .name = "spi_miso",
1069 .start = 34,
1070 .end = 34,
1071 .flags = IORESOURCE_IO,
1072 },
1073 {
1074 .name = "spi_mosi",
1075 .start = 33,
1076 .end = 33,
1077 .flags = IORESOURCE_IO,
1078 },
Harini Jayaraman5d93be12011-11-29 18:32:20 -07001079 {
1080 .name = "spi_cs",
1081 .start = 35,
1082 .end = 35,
1083 .flags = IORESOURCE_IO,
1084 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001085};
1086
1087/* Use GSBI1 QUP for SPI-0 */
1088struct platform_device msm_gsbi1_qup_spi_device = {
1089 .name = "spi_qsd",
1090 .id = 0,
1091 .num_resources = ARRAY_SIZE(gsbi1_qup_spi_resources),
1092 .resource = gsbi1_qup_spi_resources,
1093};
1094
1095
1096static struct resource gsbi10_qup_spi_resources[] = {
1097 {
1098 .name = "spi_base",
1099 .start = MSM_GSBI10_QUP_PHYS,
1100 .end = MSM_GSBI10_QUP_PHYS + SZ_4K - 1,
1101 .flags = IORESOURCE_MEM,
1102 },
1103 {
1104 .name = "gsbi_base",
1105 .start = MSM_GSBI10_PHYS,
1106 .end = MSM_GSBI10_PHYS + 4 - 1,
1107 .flags = IORESOURCE_MEM,
1108 },
1109 {
1110 .name = "spi_irq_in",
1111 .start = GSBI10_QUP_IRQ,
1112 .end = GSBI10_QUP_IRQ,
1113 .flags = IORESOURCE_IRQ,
1114 },
1115 {
1116 .name = "spi_clk",
1117 .start = 73,
1118 .end = 73,
1119 .flags = IORESOURCE_IO,
1120 },
1121 {
1122 .name = "spi_cs",
1123 .start = 72,
1124 .end = 72,
1125 .flags = IORESOURCE_IO,
1126 },
1127 {
1128 .name = "spi_mosi",
1129 .start = 70,
1130 .end = 70,
1131 .flags = IORESOURCE_IO,
1132 },
1133};
1134
1135/* Use GSBI10 QUP for SPI-1 */
1136struct platform_device msm_gsbi10_qup_spi_device = {
1137 .name = "spi_qsd",
1138 .id = 1,
1139 .num_resources = ARRAY_SIZE(gsbi10_qup_spi_resources),
1140 .resource = gsbi10_qup_spi_resources,
1141};
1142#define MSM_SDC1_BASE 0x12400000
1143#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1144#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1145#define MSM_SDC2_BASE 0x12140000
1146#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1147#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1148#define MSM_SDC3_BASE 0x12180000
1149#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1150#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1151#define MSM_SDC4_BASE 0x121C0000
1152#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1153#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1154#define MSM_SDC5_BASE 0x12200000
1155#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
1156#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
1157
1158static struct resource resources_sdc1[] = {
1159 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301160 .name = "core_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001161 .start = MSM_SDC1_BASE,
1162 .end = MSM_SDC1_DML_BASE - 1,
1163 .flags = IORESOURCE_MEM,
1164 },
1165 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301166 .name = "core_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001167 .start = SDC1_IRQ_0,
1168 .end = SDC1_IRQ_0,
1169 .flags = IORESOURCE_IRQ,
1170 },
1171#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1172 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301173 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001174 .start = MSM_SDC1_DML_BASE,
1175 .end = MSM_SDC1_BAM_BASE - 1,
1176 .flags = IORESOURCE_MEM,
1177 },
1178 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301179 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001180 .start = MSM_SDC1_BAM_BASE,
1181 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1182 .flags = IORESOURCE_MEM,
1183 },
1184 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301185 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001186 .start = SDC1_BAM_IRQ,
1187 .end = SDC1_BAM_IRQ,
1188 .flags = IORESOURCE_IRQ,
1189 },
1190#else
1191 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301192 .name = "dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001193 .start = DMOV_SDC1_CHAN,
1194 .end = DMOV_SDC1_CHAN,
1195 .flags = IORESOURCE_DMA,
1196 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001197 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301198 .name = "dma_crci",
Krishna Konda25786ec2011-07-25 16:21:36 -07001199 .start = DMOV_SDC1_CRCI,
1200 .end = DMOV_SDC1_CRCI,
1201 .flags = IORESOURCE_DMA,
1202 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001203#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1204};
1205
1206static struct resource resources_sdc2[] = {
1207 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301208 .name = "core_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001209 .start = MSM_SDC2_BASE,
1210 .end = MSM_SDC2_DML_BASE - 1,
1211 .flags = IORESOURCE_MEM,
1212 },
1213 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301214 .name = "core_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001215 .start = SDC2_IRQ_0,
1216 .end = SDC2_IRQ_0,
1217 .flags = IORESOURCE_IRQ,
1218 },
1219#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1220 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301221 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001222 .start = MSM_SDC2_DML_BASE,
1223 .end = MSM_SDC2_BAM_BASE - 1,
1224 .flags = IORESOURCE_MEM,
1225 },
1226 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301227 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001228 .start = MSM_SDC2_BAM_BASE,
1229 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1230 .flags = IORESOURCE_MEM,
1231 },
1232 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301233 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001234 .start = SDC2_BAM_IRQ,
1235 .end = SDC2_BAM_IRQ,
1236 .flags = IORESOURCE_IRQ,
1237 },
1238#else
1239 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301240 .name = "dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001241 .start = DMOV_SDC2_CHAN,
1242 .end = DMOV_SDC2_CHAN,
1243 .flags = IORESOURCE_DMA,
1244 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001245 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301246 .name = "dma_crci",
Krishna Konda25786ec2011-07-25 16:21:36 -07001247 .start = DMOV_SDC2_CRCI,
1248 .end = DMOV_SDC2_CRCI,
1249 .flags = IORESOURCE_DMA,
1250 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001251#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1252};
1253
1254static struct resource resources_sdc3[] = {
1255 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301256 .name = "core_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001257 .start = MSM_SDC3_BASE,
1258 .end = MSM_SDC3_DML_BASE - 1,
1259 .flags = IORESOURCE_MEM,
1260 },
1261 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301262 .name = "core_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001263 .start = SDC3_IRQ_0,
1264 .end = SDC3_IRQ_0,
1265 .flags = IORESOURCE_IRQ,
1266 },
1267#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1268 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301269 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001270 .start = MSM_SDC3_DML_BASE,
1271 .end = MSM_SDC3_BAM_BASE - 1,
1272 .flags = IORESOURCE_MEM,
1273 },
1274 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301275 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001276 .start = MSM_SDC3_BAM_BASE,
1277 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1278 .flags = IORESOURCE_MEM,
1279 },
1280 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301281 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001282 .start = SDC3_BAM_IRQ,
1283 .end = SDC3_BAM_IRQ,
1284 .flags = IORESOURCE_IRQ,
1285 },
1286#else
1287 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301288 .name = "dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001289 .start = DMOV_SDC3_CHAN,
1290 .end = DMOV_SDC3_CHAN,
1291 .flags = IORESOURCE_DMA,
1292 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001293 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301294 .name = "dma_crci",
Krishna Konda25786ec2011-07-25 16:21:36 -07001295 .start = DMOV_SDC3_CRCI,
1296 .end = DMOV_SDC3_CRCI,
1297 .flags = IORESOURCE_DMA,
1298 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001299#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1300};
1301
1302static struct resource resources_sdc4[] = {
1303 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301304 .name = "core_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001305 .start = MSM_SDC4_BASE,
1306 .end = MSM_SDC4_DML_BASE - 1,
1307 .flags = IORESOURCE_MEM,
1308 },
1309 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301310 .name = "core_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001311 .start = SDC4_IRQ_0,
1312 .end = SDC4_IRQ_0,
1313 .flags = IORESOURCE_IRQ,
1314 },
1315#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1316 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301317 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001318 .start = MSM_SDC4_DML_BASE,
1319 .end = MSM_SDC4_BAM_BASE - 1,
1320 .flags = IORESOURCE_MEM,
1321 },
1322 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301323 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001324 .start = MSM_SDC4_BAM_BASE,
1325 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1326 .flags = IORESOURCE_MEM,
1327 },
1328 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301329 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001330 .start = SDC4_BAM_IRQ,
1331 .end = SDC4_BAM_IRQ,
1332 .flags = IORESOURCE_IRQ,
1333 },
1334#else
1335 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301336 .name = "dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001337 .start = DMOV_SDC4_CHAN,
1338 .end = DMOV_SDC4_CHAN,
1339 .flags = IORESOURCE_DMA,
1340 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001341 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301342 .name = "dma_crci",
Krishna Konda25786ec2011-07-25 16:21:36 -07001343 .start = DMOV_SDC4_CRCI,
1344 .end = DMOV_SDC4_CRCI,
1345 .flags = IORESOURCE_DMA,
1346 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001347#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1348};
1349
1350static struct resource resources_sdc5[] = {
1351 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301352 .name = "core_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001353 .start = MSM_SDC5_BASE,
1354 .end = MSM_SDC5_DML_BASE - 1,
1355 .flags = IORESOURCE_MEM,
1356 },
1357 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301358 .name = "core_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001359 .start = SDC5_IRQ_0,
1360 .end = SDC5_IRQ_0,
1361 .flags = IORESOURCE_IRQ,
1362 },
1363#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1364 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301365 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001366 .start = MSM_SDC5_DML_BASE,
1367 .end = MSM_SDC5_BAM_BASE - 1,
1368 .flags = IORESOURCE_MEM,
1369 },
1370 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301371 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001372 .start = MSM_SDC5_BAM_BASE,
1373 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
1374 .flags = IORESOURCE_MEM,
1375 },
1376 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301377 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001378 .start = SDC5_BAM_IRQ,
1379 .end = SDC5_BAM_IRQ,
1380 .flags = IORESOURCE_IRQ,
1381 },
1382#else
1383 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301384 .name = "dma_chnl",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001385 .start = DMOV_SDC5_CHAN,
1386 .end = DMOV_SDC5_CHAN,
1387 .flags = IORESOURCE_DMA,
1388 },
Krishna Konda25786ec2011-07-25 16:21:36 -07001389 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301390 .name = "dma_crci",
Krishna Konda25786ec2011-07-25 16:21:36 -07001391 .start = DMOV_SDC5_CRCI,
1392 .end = DMOV_SDC5_CRCI,
1393 .flags = IORESOURCE_DMA,
1394 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001395#endif /* CONFIG_MMC_MSM_SPS_SUPPORT */
1396};
1397
1398struct platform_device msm_device_sdc1 = {
1399 .name = "msm_sdcc",
1400 .id = 1,
1401 .num_resources = ARRAY_SIZE(resources_sdc1),
1402 .resource = resources_sdc1,
1403 .dev = {
1404 .coherent_dma_mask = 0xffffffff,
1405 },
1406};
1407
1408struct platform_device msm_device_sdc2 = {
1409 .name = "msm_sdcc",
1410 .id = 2,
1411 .num_resources = ARRAY_SIZE(resources_sdc2),
1412 .resource = resources_sdc2,
1413 .dev = {
1414 .coherent_dma_mask = 0xffffffff,
1415 },
1416};
1417
1418struct platform_device msm_device_sdc3 = {
1419 .name = "msm_sdcc",
1420 .id = 3,
1421 .num_resources = ARRAY_SIZE(resources_sdc3),
1422 .resource = resources_sdc3,
1423 .dev = {
1424 .coherent_dma_mask = 0xffffffff,
1425 },
1426};
1427
1428struct platform_device msm_device_sdc4 = {
1429 .name = "msm_sdcc",
1430 .id = 4,
1431 .num_resources = ARRAY_SIZE(resources_sdc4),
1432 .resource = resources_sdc4,
1433 .dev = {
1434 .coherent_dma_mask = 0xffffffff,
1435 },
1436};
1437
1438struct platform_device msm_device_sdc5 = {
1439 .name = "msm_sdcc",
1440 .id = 5,
1441 .num_resources = ARRAY_SIZE(resources_sdc5),
1442 .resource = resources_sdc5,
1443 .dev = {
1444 .coherent_dma_mask = 0xffffffff,
1445 },
1446};
1447
1448static struct platform_device *msm_sdcc_devices[] __initdata = {
1449 &msm_device_sdc1,
1450 &msm_device_sdc2,
1451 &msm_device_sdc3,
1452 &msm_device_sdc4,
1453 &msm_device_sdc5,
1454};
1455
1456int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1457{
1458 struct platform_device *pdev;
1459
1460 if (controller < 1 || controller > 5)
1461 return -EINVAL;
1462
1463 pdev = msm_sdcc_devices[controller-1];
1464 pdev->dev.platform_data = plat;
1465 return platform_device_register(pdev);
1466}
1467
Kevin Chan3be11612012-03-22 20:05:40 -07001468#ifdef CONFIG_MSM_CAMERA_V4L2
1469static struct resource msm_csic0_resources[] = {
1470 {
1471 .name = "csic",
1472 .start = 0x04800000,
1473 .end = 0x04800000 + 0x00000400 - 1,
1474 .flags = IORESOURCE_MEM,
1475 },
1476 {
1477 .name = "csic",
1478 .start = CSI_0_IRQ,
1479 .end = CSI_0_IRQ,
1480 .flags = IORESOURCE_IRQ,
1481 },
1482};
1483
1484static struct resource msm_csic1_resources[] = {
1485 {
1486 .name = "csic",
1487 .start = 0x04900000,
1488 .end = 0x04900000 + 0x00000400 - 1,
1489 .flags = IORESOURCE_MEM,
1490 },
1491 {
1492 .name = "csic",
1493 .start = CSI_1_IRQ,
1494 .end = CSI_1_IRQ,
1495 .flags = IORESOURCE_IRQ,
1496 },
1497};
1498
1499struct resource msm_vfe_resources[] = {
1500 {
1501 .name = "msm_vfe",
1502 .start = 0x04500000,
1503 .end = 0x04500000 + SZ_1M - 1,
1504 .flags = IORESOURCE_MEM,
1505 },
1506 {
1507 .name = "msm_vfe",
1508 .start = VFE_IRQ,
1509 .end = VFE_IRQ,
1510 .flags = IORESOURCE_IRQ,
1511 },
1512};
1513
1514static struct resource msm_vpe_resources[] = {
1515 {
1516 .name = "vpe",
1517 .start = 0x05300000,
1518 .end = 0x05300000 + SZ_1M - 1,
1519 .flags = IORESOURCE_MEM,
1520 },
1521 {
1522 .name = "vpe",
1523 .start = INT_VPE,
1524 .end = INT_VPE,
1525 .flags = IORESOURCE_IRQ,
1526 },
1527};
1528
1529struct platform_device msm_device_csic0 = {
1530 .name = "msm_csic",
1531 .id = 0,
1532 .resource = msm_csic0_resources,
1533 .num_resources = ARRAY_SIZE(msm_csic0_resources),
1534};
1535
1536struct platform_device msm_device_csic1 = {
1537 .name = "msm_csic",
1538 .id = 1,
1539 .resource = msm_csic1_resources,
1540 .num_resources = ARRAY_SIZE(msm_csic1_resources),
1541};
1542
1543struct platform_device msm_device_vfe = {
1544 .name = "msm_vfe",
1545 .id = 0,
1546 .resource = msm_vfe_resources,
1547 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1548};
1549
1550struct platform_device msm_device_vpe = {
1551 .name = "msm_vpe",
1552 .id = 0,
1553 .resource = msm_vpe_resources,
1554 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1555};
1556
1557#endif
1558
1559
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001560#define MIPI_DSI_HW_BASE 0x04700000
1561#define ROTATOR_HW_BASE 0x04E00000
1562#define TVENC_HW_BASE 0x04F00000
1563#define MDP_HW_BASE 0x05100000
1564
1565static struct resource msm_mipi_dsi_resources[] = {
1566 {
1567 .name = "mipi_dsi",
1568 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001569 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001570 .flags = IORESOURCE_MEM,
1571 },
1572 {
1573 .start = DSI_IRQ,
1574 .end = DSI_IRQ,
1575 .flags = IORESOURCE_IRQ,
1576 },
1577};
1578
1579static struct platform_device msm_mipi_dsi_device = {
1580 .name = "mipi_dsi",
1581 .id = 1,
1582 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
1583 .resource = msm_mipi_dsi_resources,
1584};
1585
1586static struct resource msm_mdp_resources[] = {
1587 {
1588 .name = "mdp",
1589 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001590 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001591 .flags = IORESOURCE_MEM,
1592 },
1593 {
1594 .start = INT_MDP,
1595 .end = INT_MDP,
1596 .flags = IORESOURCE_IRQ,
1597 },
1598};
1599
1600static struct platform_device msm_mdp_device = {
1601 .name = "mdp",
1602 .id = 0,
1603 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1604 .resource = msm_mdp_resources,
1605};
1606#ifdef CONFIG_MSM_ROTATOR
1607static struct resource resources_msm_rotator[] = {
1608 {
1609 .start = 0x04E00000,
1610 .end = 0x04F00000 - 1,
1611 .flags = IORESOURCE_MEM,
1612 },
1613 {
1614 .start = ROT_IRQ,
1615 .end = ROT_IRQ,
1616 .flags = IORESOURCE_IRQ,
1617 },
1618};
1619
1620static struct msm_rot_clocks rotator_clocks[] = {
1621 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001622 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001623 .clk_type = ROTATOR_CORE_CLK,
1624 .clk_rate = 160 * 1000 * 1000,
1625 },
1626 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001627 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001628 .clk_type = ROTATOR_PCLK,
1629 .clk_rate = 0,
1630 },
1631};
1632
1633static struct msm_rotator_platform_data rotator_pdata = {
1634 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1635 .hardware_version_number = 0x01010307,
1636 .rotator_clks = rotator_clocks,
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08001637#ifdef CONFIG_MSM_BUS_SCALING
1638 .bus_scale_table = &rotator_bus_scale_pdata,
1639#endif
Olav Hauganef95ae32012-05-15 09:50:30 -07001640 .rot_iommu_split_domain = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001641};
1642
1643struct platform_device msm_rotator_device = {
1644 .name = "msm_rotator",
1645 .id = 0,
1646 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1647 .resource = resources_msm_rotator,
1648 .dev = {
1649 .platform_data = &rotator_pdata,
1650 },
1651};
1652#endif
1653
1654
1655/* Sensors DSPS platform data */
1656#ifdef CONFIG_MSM_DSPS
1657
1658#define PPSS_REG_PHYS_BASE 0x12080000
karthik karuppasamy9dac5492012-06-19 15:03:10 -07001659#define PPSS_PAUSE_REG 0x1804
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001660
1661#define MHZ (1000*1000)
1662
Wentao Xu7a1c9302011-09-19 17:57:43 -04001663#define TCSR_GSBI_IRQ_MUX_SEL 0x0044
1664
1665#define GSBI_IRQ_MUX_SEL_MASK 0xF
1666#define GSBI_IRQ_MUX_SEL_DSPS 0xB
1667
1668static void dsps_init1(struct msm_dsps_platform_data *data)
1669{
1670 int val;
1671
1672 /* route GSBI12 interrutps to DSPS */
1673 val = secure_readl(MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1674 val &= ~GSBI_IRQ_MUX_SEL_MASK;
1675 val |= GSBI_IRQ_MUX_SEL_DSPS;
1676 secure_writel(val, MSM_TCSR_BASE + TCSR_GSBI_IRQ_MUX_SEL);
1677}
1678
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001679static struct dsps_clk_info dsps_clks[] = {
1680 {
Matt Wagantall5bb16ca2012-04-19 11:34:01 -07001681 .name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001682 .rate = 0, /* no rate just on/off */
1683 },
1684 {
Matt Wagantalld86d6832011-08-17 14:06:55 -07001685 .name = "mem_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001686 .rate = 0, /* no rate just on/off */
1687 },
1688 {
1689 .name = "gsbi_qup_clk",
1690 .rate = 24 * MHZ, /* See clk_tbl_gsbi_qup[] */
1691 },
1692 {
1693 .name = "dfab_dsps_clk",
1694 .rate = 64 * MHZ, /* Same rate as USB. */
1695 }
1696};
1697
1698static struct dsps_regulator_info dsps_regs[] = {
1699 {
1700 .name = "8058_l5",
1701 .volt = 2850000, /* in uV */
1702 },
1703 {
1704 .name = "8058_s3",
1705 .volt = 1800000, /* in uV */
1706 }
1707};
1708
1709/*
1710 * Note: GPIOs field is intialized in run-time at the function
1711 * msm8x60_init_dsps().
1712 */
1713
1714struct msm_dsps_platform_data msm_dsps_pdata = {
1715 .clks = dsps_clks,
1716 .clks_num = ARRAY_SIZE(dsps_clks),
1717 .gpios = NULL,
1718 .gpios_num = 0,
1719 .regs = dsps_regs,
1720 .regs_num = ARRAY_SIZE(dsps_regs),
Wentao Xu7a1c9302011-09-19 17:57:43 -04001721 .init = dsps_init1,
karthik karuppasamy9dac5492012-06-19 15:03:10 -07001722 .ppss_pause_reg = PPSS_PAUSE_REG,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001723 .signature = DSPS_SIGNATURE,
1724};
1725
1726static struct resource msm_dsps_resources[] = {
1727 {
1728 .start = PPSS_REG_PHYS_BASE,
1729 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
1730 .name = "ppss_reg",
1731 .flags = IORESOURCE_MEM,
1732 },
1733};
1734
1735struct platform_device msm_dsps_device = {
1736 .name = "msm_dsps",
1737 .id = 0,
1738 .num_resources = ARRAY_SIZE(msm_dsps_resources),
1739 .resource = msm_dsps_resources,
1740 .dev.platform_data = &msm_dsps_pdata,
1741};
1742
1743#endif /* CONFIG_MSM_DSPS */
1744
1745#ifdef CONFIG_FB_MSM_TVOUT
1746static struct resource msm_tvenc_resources[] = {
1747 {
1748 .name = "tvenc",
1749 .start = TVENC_HW_BASE,
1750 .end = TVENC_HW_BASE + PAGE_SIZE - 1,
1751 .flags = IORESOURCE_MEM,
1752 }
1753};
1754
1755static struct resource tvout_device_resources[] = {
1756 {
1757 .name = "tvout_device_irq",
1758 .start = TV_ENC_IRQ,
1759 .end = TV_ENC_IRQ,
1760 .flags = IORESOURCE_IRQ,
1761 },
1762};
1763#endif
1764static void __init msm_register_device(struct platform_device *pdev, void *data)
1765{
1766 int ret;
1767
1768 pdev->dev.platform_data = data;
1769
1770 ret = platform_device_register(pdev);
1771 if (ret)
1772 dev_err(&pdev->dev,
1773 "%s: platform_device_register() failed = %d\n",
1774 __func__, ret);
1775}
1776
Padmanabhan Komandurue77bcf52012-07-26 12:43:39 +05301777struct platform_device msm_lcdc_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001778 .name = "lcdc",
1779 .id = 0,
1780};
1781
1782#ifdef CONFIG_FB_MSM_TVOUT
1783static struct platform_device msm_tvenc_device = {
1784 .name = "tvenc",
1785 .id = 0,
1786 .num_resources = ARRAY_SIZE(msm_tvenc_resources),
1787 .resource = msm_tvenc_resources,
1788};
1789
1790static struct platform_device msm_tvout_device = {
1791 .name = "tvout_device",
1792 .id = 0,
1793 .num_resources = ARRAY_SIZE(tvout_device_resources),
1794 .resource = tvout_device_resources,
1795};
1796#endif
1797
1798#ifdef CONFIG_MSM_BUS_SCALING
1799static struct platform_device msm_dtv_device = {
1800 .name = "dtv",
1801 .id = 0,
1802};
1803#endif
1804
1805void __init msm_fb_register_device(char *name, void *data)
1806{
1807 if (!strncmp(name, "mdp", 3))
1808 msm_register_device(&msm_mdp_device, data);
1809 else if (!strncmp(name, "lcdc", 4))
1810 msm_register_device(&msm_lcdc_device, data);
1811 else if (!strncmp(name, "mipi_dsi", 8))
1812 msm_register_device(&msm_mipi_dsi_device, data);
1813#ifdef CONFIG_FB_MSM_TVOUT
1814 else if (!strncmp(name, "tvenc", 5))
1815 msm_register_device(&msm_tvenc_device, data);
1816 else if (!strncmp(name, "tvout_device", 12))
1817 msm_register_device(&msm_tvout_device, data);
1818#endif
1819#ifdef CONFIG_MSM_BUS_SCALING
1820 else if (!strncmp(name, "dtv", 3))
1821 msm_register_device(&msm_dtv_device, data);
1822#endif
1823 else
1824 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1825}
1826
1827static struct resource resources_otg[] = {
1828 {
1829 .start = 0x12500000,
1830 .end = 0x12500000 + SZ_1K - 1,
1831 .flags = IORESOURCE_MEM,
1832 },
1833 {
1834 .start = USB1_HS_IRQ,
1835 .end = USB1_HS_IRQ,
1836 .flags = IORESOURCE_IRQ,
1837 },
1838};
1839
1840struct platform_device msm_device_otg = {
1841 .name = "msm_otg",
1842 .id = -1,
1843 .num_resources = ARRAY_SIZE(resources_otg),
1844 .resource = resources_otg,
1845};
1846
1847static u64 dma_mask = 0xffffffffULL;
1848struct platform_device msm_device_gadget_peripheral = {
1849 .name = "msm_hsusb",
1850 .id = -1,
1851 .dev = {
1852 .dma_mask = &dma_mask,
1853 .coherent_dma_mask = 0xffffffffULL,
1854 },
1855};
1856#ifdef CONFIG_USB_EHCI_MSM_72K
1857static struct resource resources_hsusb_host[] = {
1858 {
1859 .start = 0x12500000,
1860 .end = 0x12500000 + SZ_1K - 1,
1861 .flags = IORESOURCE_MEM,
1862 },
1863 {
1864 .start = USB1_HS_IRQ,
1865 .end = USB1_HS_IRQ,
1866 .flags = IORESOURCE_IRQ,
1867 },
1868};
1869
1870struct platform_device msm_device_hsusb_host = {
1871 .name = "msm_hsusb_host",
1872 .id = 0,
1873 .num_resources = ARRAY_SIZE(resources_hsusb_host),
1874 .resource = resources_hsusb_host,
1875 .dev = {
1876 .dma_mask = &dma_mask,
1877 .coherent_dma_mask = 0xffffffffULL,
1878 },
1879};
1880
1881static struct platform_device *msm_host_devices[] = {
1882 &msm_device_hsusb_host,
1883};
1884
1885int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1886{
1887 struct platform_device *pdev;
1888
1889 pdev = msm_host_devices[host];
1890 if (!pdev)
1891 return -ENODEV;
1892 pdev->dev.platform_data = plat;
1893 return platform_device_register(pdev);
1894}
1895#endif
1896
1897#define MSM_TSIF0_PHYS (0x18200000)
1898#define MSM_TSIF1_PHYS (0x18201000)
1899#define MSM_TSIF_SIZE (0x200)
1900#define TCSR_ADM_0_A_CRCI_MUX_SEL 0x0070
1901
1902#define TSIF_0_CLK GPIO_CFG(93, 1, GPIO_CFG_INPUT, \
1903 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1904#define TSIF_0_EN GPIO_CFG(94, 1, GPIO_CFG_INPUT, \
1905 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1906#define TSIF_0_DATA GPIO_CFG(95, 1, GPIO_CFG_INPUT, \
1907 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1908#define TSIF_0_SYNC GPIO_CFG(96, 1, GPIO_CFG_INPUT, \
1909 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1910#define TSIF_1_CLK GPIO_CFG(97, 1, GPIO_CFG_INPUT, \
1911 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1912#define TSIF_1_EN GPIO_CFG(98, 1, GPIO_CFG_INPUT, \
1913 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1914#define TSIF_1_DATA GPIO_CFG(99, 1, GPIO_CFG_INPUT, \
1915 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1916#define TSIF_1_SYNC GPIO_CFG(100, 1, GPIO_CFG_INPUT, \
1917 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1918
1919static const struct msm_gpio tsif0_gpios[] = {
1920 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1921 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1922 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1923 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1924};
1925
1926static const struct msm_gpio tsif1_gpios[] = {
1927 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1928 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1929 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1930 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1931};
1932
1933static void tsif_release(struct device *dev)
1934{
1935}
1936
1937static void tsif_init1(struct msm_tsif_platform_data *data)
1938{
1939 int val;
1940
1941 /* configure mux to use correct tsif instance */
1942 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1943 val |= 0x80000000;
1944 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1945}
1946
1947struct msm_tsif_platform_data tsif1_platform_data = {
1948 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1949 .gpios = tsif1_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001950 .tsif_pclk = "iface_clk",
1951 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001952 .init = tsif_init1
1953};
1954
1955struct resource tsif1_resources[] = {
1956 [0] = {
1957 .flags = IORESOURCE_IRQ,
1958 .start = TSIF2_IRQ,
1959 .end = TSIF2_IRQ,
1960 },
1961 [1] = {
1962 .flags = IORESOURCE_MEM,
1963 .start = MSM_TSIF1_PHYS,
1964 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1965 },
1966 [2] = {
1967 .flags = IORESOURCE_DMA,
1968 .start = DMOV_TSIF_CHAN,
1969 .end = DMOV_TSIF_CRCI,
1970 },
1971};
1972
1973static void tsif_init0(struct msm_tsif_platform_data *data)
1974{
1975 int val;
1976
1977 /* configure mux to use correct tsif instance */
1978 val = secure_readl(MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1979 val &= 0x7FFFFFFF;
1980 secure_writel(val, MSM_TCSR_BASE + TCSR_ADM_0_A_CRCI_MUX_SEL);
1981}
1982
1983struct msm_tsif_platform_data tsif0_platform_data = {
1984 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1985 .gpios = tsif0_gpios,
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001986 .tsif_pclk = "iface_clk",
1987 .tsif_ref_clk = "ref_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001988 .init = tsif_init0
1989};
1990struct resource tsif0_resources[] = {
1991 [0] = {
1992 .flags = IORESOURCE_IRQ,
1993 .start = TSIF1_IRQ,
1994 .end = TSIF1_IRQ,
1995 },
1996 [1] = {
1997 .flags = IORESOURCE_MEM,
1998 .start = MSM_TSIF0_PHYS,
1999 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
2000 },
2001 [2] = {
2002 .flags = IORESOURCE_DMA,
2003 .start = DMOV_TSIF_CHAN,
2004 .end = DMOV_TSIF_CRCI,
2005 },
2006};
2007
2008struct platform_device msm_device_tsif[2] = {
2009 {
2010 .name = "msm_tsif",
2011 .id = 0,
2012 .num_resources = ARRAY_SIZE(tsif0_resources),
2013 .resource = tsif0_resources,
2014 .dev = {
2015 .release = tsif_release,
2016 .platform_data = &tsif0_platform_data
2017 },
2018 },
2019 {
2020 .name = "msm_tsif",
2021 .id = 1,
2022 .num_resources = ARRAY_SIZE(tsif1_resources),
2023 .resource = tsif1_resources,
2024 .dev = {
2025 .release = tsif_release,
2026 .platform_data = &tsif1_platform_data
2027 },
2028 }
2029};
2030
2031struct platform_device msm_device_smd = {
2032 .name = "msm_smd",
2033 .id = -1,
2034};
2035
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002036static struct msm_watchdog_pdata msm_watchdog_pdata = {
2037 .pet_time = 10000,
2038 .bark_time = 11000,
2039 .has_secure = true,
Rohit Vaswanic77e4a62012-08-09 18:10:28 -07002040 .base = MSM_TMR0_BASE + WDT0_OFFSET,
2041};
2042
2043static struct resource msm_watchdog_resources[] = {
2044 {
2045 .start = WDT0_ACCSCSSNBARK_INT,
2046 .end = WDT0_ACCSCSSNBARK_INT,
2047 .flags = IORESOURCE_IRQ,
2048 },
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002049};
2050
2051struct platform_device msm8660_device_watchdog = {
2052 .name = "msm_watchdog",
2053 .id = -1,
2054 .dev = {
2055 .platform_data = &msm_watchdog_pdata,
2056 },
Rohit Vaswanic77e4a62012-08-09 18:10:28 -07002057 .num_resources = ARRAY_SIZE(msm_watchdog_resources),
2058 .resource = msm_watchdog_resources,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002059};
2060
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002061static struct resource msm_dmov_resource_adm0[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002062 {
2063 .start = INT_ADM0_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002064 .flags = IORESOURCE_IRQ,
2065 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002066 {
2067 .start = 0x18320000,
2068 .end = 0x18320000 + SZ_1M - 1,
2069 .flags = IORESOURCE_MEM,
2070 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002071};
2072
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002073static struct resource msm_dmov_resource_adm1[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002074 {
2075 .start = INT_ADM1_AARM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002076 .flags = IORESOURCE_IRQ,
2077 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002078 {
2079 .start = 0x18420000,
2080 .end = 0x18420000 + SZ_1M - 1,
2081 .flags = IORESOURCE_MEM,
2082 },
2083};
2084
2085static struct msm_dmov_pdata msm_dmov_pdata_adm0 = {
2086 .sd = 1,
2087 .sd_size = 0x800,
2088};
2089
2090static struct msm_dmov_pdata msm_dmov_pdata_adm1 = {
2091 .sd = 1,
2092 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002093};
2094
2095struct platform_device msm_device_dmov_adm0 = {
2096 .name = "msm_dmov",
2097 .id = 0,
2098 .resource = msm_dmov_resource_adm0,
2099 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm0),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002100 .dev = {
2101 .platform_data = &msm_dmov_pdata_adm0,
2102 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002103};
2104
2105struct platform_device msm_device_dmov_adm1 = {
2106 .name = "msm_dmov",
2107 .id = 1,
2108 .resource = msm_dmov_resource_adm1,
2109 .num_resources = ARRAY_SIZE(msm_dmov_resource_adm1),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07002110 .dev = {
2111 .platform_data = &msm_dmov_pdata_adm1,
2112 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002113};
2114
2115/* MSM Video core device */
2116#ifdef CONFIG_MSM_BUS_SCALING
2117static struct msm_bus_vectors vidc_init_vectors[] = {
2118 {
2119 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2120 .dst = MSM_BUS_SLAVE_SMI,
2121 .ab = 0,
2122 .ib = 0,
2123 },
2124 {
2125 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2126 .dst = MSM_BUS_SLAVE_SMI,
2127 .ab = 0,
2128 .ib = 0,
2129 },
2130 {
2131 .src = MSM_BUS_MASTER_AMPSS_M0,
2132 .dst = MSM_BUS_SLAVE_EBI_CH0,
2133 .ab = 0,
2134 .ib = 0,
2135 },
2136 {
2137 .src = MSM_BUS_MASTER_AMPSS_M0,
2138 .dst = MSM_BUS_SLAVE_SMI,
2139 .ab = 0,
2140 .ib = 0,
2141 },
2142};
2143static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
2144 {
2145 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2146 .dst = MSM_BUS_SLAVE_SMI,
2147 .ab = 54525952,
2148 .ib = 436207616,
2149 },
2150 {
2151 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2152 .dst = MSM_BUS_SLAVE_SMI,
2153 .ab = 72351744,
2154 .ib = 289406976,
2155 },
2156 {
2157 .src = MSM_BUS_MASTER_AMPSS_M0,
2158 .dst = MSM_BUS_SLAVE_EBI_CH0,
2159 .ab = 500000,
2160 .ib = 1000000,
2161 },
2162 {
2163 .src = MSM_BUS_MASTER_AMPSS_M0,
2164 .dst = MSM_BUS_SLAVE_SMI,
2165 .ab = 500000,
2166 .ib = 1000000,
2167 },
2168};
2169static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
2170 {
2171 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2172 .dst = MSM_BUS_SLAVE_SMI,
2173 .ab = 40894464,
2174 .ib = 327155712,
2175 },
2176 {
2177 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2178 .dst = MSM_BUS_SLAVE_SMI,
2179 .ab = 48234496,
2180 .ib = 192937984,
2181 },
2182 {
2183 .src = MSM_BUS_MASTER_AMPSS_M0,
2184 .dst = MSM_BUS_SLAVE_EBI_CH0,
2185 .ab = 500000,
2186 .ib = 2000000,
2187 },
2188 {
2189 .src = MSM_BUS_MASTER_AMPSS_M0,
2190 .dst = MSM_BUS_SLAVE_SMI,
2191 .ab = 500000,
2192 .ib = 2000000,
2193 },
2194};
2195static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
2196 {
2197 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2198 .dst = MSM_BUS_SLAVE_SMI,
2199 .ab = 163577856,
2200 .ib = 1308622848,
2201 },
2202 {
2203 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2204 .dst = MSM_BUS_SLAVE_SMI,
2205 .ab = 219152384,
2206 .ib = 876609536,
2207 },
2208 {
2209 .src = MSM_BUS_MASTER_AMPSS_M0,
2210 .dst = MSM_BUS_SLAVE_EBI_CH0,
2211 .ab = 1750000,
2212 .ib = 3500000,
2213 },
2214 {
2215 .src = MSM_BUS_MASTER_AMPSS_M0,
2216 .dst = MSM_BUS_SLAVE_SMI,
2217 .ab = 1750000,
2218 .ib = 3500000,
2219 },
2220};
2221static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
2222 {
2223 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2224 .dst = MSM_BUS_SLAVE_SMI,
2225 .ab = 121634816,
2226 .ib = 973078528,
2227 },
2228 {
2229 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2230 .dst = MSM_BUS_SLAVE_SMI,
2231 .ab = 155189248,
2232 .ib = 620756992,
2233 },
2234 {
2235 .src = MSM_BUS_MASTER_AMPSS_M0,
2236 .dst = MSM_BUS_SLAVE_EBI_CH0,
2237 .ab = 1750000,
2238 .ib = 7000000,
2239 },
2240 {
2241 .src = MSM_BUS_MASTER_AMPSS_M0,
2242 .dst = MSM_BUS_SLAVE_SMI,
2243 .ab = 1750000,
2244 .ib = 7000000,
2245 },
2246};
2247static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
2248 {
2249 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2250 .dst = MSM_BUS_SLAVE_SMI,
2251 .ab = 372244480,
2252 .ib = 1861222400,
2253 },
2254 {
2255 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2256 .dst = MSM_BUS_SLAVE_SMI,
2257 .ab = 501219328,
2258 .ib = 2004877312,
2259 },
2260 {
2261 .src = MSM_BUS_MASTER_AMPSS_M0,
2262 .dst = MSM_BUS_SLAVE_EBI_CH0,
2263 .ab = 2500000,
2264 .ib = 5000000,
2265 },
2266 {
2267 .src = MSM_BUS_MASTER_AMPSS_M0,
2268 .dst = MSM_BUS_SLAVE_SMI,
2269 .ab = 2500000,
2270 .ib = 5000000,
2271 },
2272};
2273static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
2274 {
2275 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
2276 .dst = MSM_BUS_SLAVE_SMI,
2277 .ab = 222298112,
2278 .ib = 1778384896,
2279 },
2280 {
2281 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
2282 .dst = MSM_BUS_SLAVE_SMI,
2283 .ab = 330301440,
2284 .ib = 1321205760,
2285 },
2286 {
2287 .src = MSM_BUS_MASTER_AMPSS_M0,
2288 .dst = MSM_BUS_SLAVE_EBI_CH0,
2289 .ab = 2500000,
2290 .ib = 700000000,
2291 },
2292 {
2293 .src = MSM_BUS_MASTER_AMPSS_M0,
2294 .dst = MSM_BUS_SLAVE_SMI,
2295 .ab = 2500000,
2296 .ib = 10000000,
2297 },
2298};
2299
2300static struct msm_bus_paths vidc_bus_client_config[] = {
2301 {
2302 ARRAY_SIZE(vidc_init_vectors),
2303 vidc_init_vectors,
2304 },
2305 {
2306 ARRAY_SIZE(vidc_venc_vga_vectors),
2307 vidc_venc_vga_vectors,
2308 },
2309 {
2310 ARRAY_SIZE(vidc_vdec_vga_vectors),
2311 vidc_vdec_vga_vectors,
2312 },
2313 {
2314 ARRAY_SIZE(vidc_venc_720p_vectors),
2315 vidc_venc_720p_vectors,
2316 },
2317 {
2318 ARRAY_SIZE(vidc_vdec_720p_vectors),
2319 vidc_vdec_720p_vectors,
2320 },
2321 {
2322 ARRAY_SIZE(vidc_venc_1080p_vectors),
2323 vidc_venc_1080p_vectors,
2324 },
2325 {
2326 ARRAY_SIZE(vidc_vdec_1080p_vectors),
2327 vidc_vdec_1080p_vectors,
2328 },
2329};
2330
2331static struct msm_bus_scale_pdata vidc_bus_client_data = {
2332 vidc_bus_client_config,
2333 ARRAY_SIZE(vidc_bus_client_config),
2334 .name = "vidc",
2335};
2336
2337#endif
2338
2339#define MSM_VIDC_BASE_PHYS 0x04400000
2340#define MSM_VIDC_BASE_SIZE 0x00100000
2341
2342static struct resource msm_device_vidc_resources[] = {
2343 {
2344 .start = MSM_VIDC_BASE_PHYS,
2345 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
2346 .flags = IORESOURCE_MEM,
2347 },
2348 {
2349 .start = VCODEC_IRQ,
2350 .end = VCODEC_IRQ,
2351 .flags = IORESOURCE_IRQ,
2352 },
2353};
2354
2355struct msm_vidc_platform_data vidc_platform_data = {
2356#ifdef CONFIG_MSM_BUS_SCALING
2357 .vidc_bus_client_pdata = &vidc_bus_client_data,
2358#endif
Riaz Rahamanca0b72b2012-07-23 14:28:50 +05302359#ifdef CONFIG_MSM_VIDC_CONTENT_PROTECTION
2360 .cp_enabled = 1,
2361#else
2362 .cp_enabled = 0,
2363#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -07002364#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Deepak Kotur59955cb2011-12-08 10:23:01 -08002365 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002366 .enable_ion = 1,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302367 .secure_wb_heap = 1,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002368#else
Deepak Kotur12301a72011-11-09 18:30:29 -08002369 .memtype = MEMTYPE_SMI_KERNEL,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002370 .enable_ion = 0,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302371 .secure_wb_heap = 0,
Deepak Koturcb4f6722011-10-31 14:06:57 -07002372#endif
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05302373 .disable_dmx = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08002374 .disable_fullhd = 0,
Deva Ramasubramanian837ae362012-05-12 23:26:53 -07002375 .cont_mode_dpb_count = 8,
2376 .disable_turbo = 1,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05302377 .fw_addr = 0x38000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002378};
2379
2380struct platform_device msm_device_vidc = {
2381 .name = "msm_vidc",
2382 .id = 0,
2383 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
2384 .resource = msm_device_vidc_resources,
2385 .dev = {
2386 .platform_data = &vidc_platform_data,
2387 },
2388};
2389
Praveen Chidambaram78499012011-11-01 17:15:17 -06002390#if defined(CONFIG_MSM_RPM_LOG) || defined(CONFIG_MSM_RPM_LOG_MODULE)
2391static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2392 .phys_addr_base = 0x00106000,
2393 .reg_offsets = {
2394 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000C80,
2395 [MSM_RPM_LOG_PAGE_BUFFER] = 0x00000CA0,
2396 },
2397 .phys_size = SZ_8K,
2398 .log_len = 4096, /* log's buffer length in bytes */
2399 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2400};
2401
2402struct platform_device msm8660_rpm_log_device = {
2403 .name = "msm_rpm_log",
2404 .id = -1,
2405 .dev = {
2406 .platform_data = &msm_rpm_log_pdata,
2407 },
2408};
2409#endif
2410
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002411#if defined(CONFIG_MSM_RPM_STATS_LOG)
2412static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2413 .phys_addr_base = 0x00107E04,
2414 .phys_size = SZ_8K,
2415};
2416
Praveen Chidambaram78499012011-11-01 17:15:17 -06002417struct platform_device msm8660_rpm_stat_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002418 .name = "msm_rpm_stat",
2419 .id = -1,
2420 .dev = {
2421 .platform_data = &msm_rpm_stat_pdata,
2422 },
2423};
2424#endif
2425
Mona Hossainceca6152012-04-10 09:55:41 -07002426#define SHARED_IMEM_TZ_BASE 0x2a05f720
2427static struct resource tzlog_resources[] = {
2428 {
2429 .start = SHARED_IMEM_TZ_BASE,
2430 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
2431 .flags = IORESOURCE_MEM,
2432 },
2433};
2434
2435struct platform_device msm_device_tz_log = {
2436 .name = "tz_log",
2437 .id = 0,
2438 .num_resources = ARRAY_SIZE(tzlog_resources),
2439 .resource = tzlog_resources,
2440};
2441
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002442#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002443static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002444 [1] = MSM_GPIO_TO_INT(61),
2445 [4] = MSM_GPIO_TO_INT(87),
2446 [5] = MSM_GPIO_TO_INT(88),
2447 [6] = MSM_GPIO_TO_INT(89),
2448 [7] = MSM_GPIO_TO_INT(90),
2449 [8] = MSM_GPIO_TO_INT(91),
2450 [9] = MSM_GPIO_TO_INT(34),
2451 [10] = MSM_GPIO_TO_INT(38),
2452 [11] = MSM_GPIO_TO_INT(42),
2453 [12] = MSM_GPIO_TO_INT(46),
2454 [13] = MSM_GPIO_TO_INT(50),
2455 [14] = MSM_GPIO_TO_INT(54),
2456 [15] = MSM_GPIO_TO_INT(58),
2457 [16] = MSM_GPIO_TO_INT(63),
2458 [17] = MSM_GPIO_TO_INT(160),
2459 [18] = MSM_GPIO_TO_INT(162),
2460 [19] = MSM_GPIO_TO_INT(144),
2461 [20] = MSM_GPIO_TO_INT(146),
2462 [25] = USB1_HS_IRQ,
2463 [26] = TV_ENC_IRQ,
2464 [27] = HDMI_IRQ,
2465 [29] = MSM_GPIO_TO_INT(123),
2466 [30] = MSM_GPIO_TO_INT(172),
2467 [31] = MSM_GPIO_TO_INT(99),
2468 [32] = MSM_GPIO_TO_INT(96),
2469 [33] = MSM_GPIO_TO_INT(67),
2470 [34] = MSM_GPIO_TO_INT(71),
2471 [35] = MSM_GPIO_TO_INT(105),
2472 [36] = MSM_GPIO_TO_INT(117),
2473 [37] = MSM_GPIO_TO_INT(29),
2474 [38] = MSM_GPIO_TO_INT(30),
2475 [39] = MSM_GPIO_TO_INT(31),
2476 [40] = MSM_GPIO_TO_INT(37),
2477 [41] = MSM_GPIO_TO_INT(40),
2478 [42] = MSM_GPIO_TO_INT(41),
2479 [43] = MSM_GPIO_TO_INT(45),
2480 [44] = MSM_GPIO_TO_INT(51),
2481 [45] = MSM_GPIO_TO_INT(52),
2482 [46] = MSM_GPIO_TO_INT(57),
2483 [47] = MSM_GPIO_TO_INT(73),
2484 [48] = MSM_GPIO_TO_INT(93),
2485 [49] = MSM_GPIO_TO_INT(94),
2486 [50] = MSM_GPIO_TO_INT(103),
2487 [51] = MSM_GPIO_TO_INT(104),
2488 [52] = MSM_GPIO_TO_INT(106),
2489 [53] = MSM_GPIO_TO_INT(115),
2490 [54] = MSM_GPIO_TO_INT(124),
2491 [55] = MSM_GPIO_TO_INT(125),
2492 [56] = MSM_GPIO_TO_INT(126),
2493 [57] = MSM_GPIO_TO_INT(127),
2494 [58] = MSM_GPIO_TO_INT(128),
2495 [59] = MSM_GPIO_TO_INT(129),
2496};
2497
Praveen Chidambaram78499012011-11-01 17:15:17 -06002498static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002499 TLMM_MSM_SUMMARY_IRQ,
2500 RPM_SCSS_CPU0_GP_HIGH_IRQ,
2501 RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2502 RPM_SCSS_CPU0_GP_LOW_IRQ,
2503 RPM_SCSS_CPU0_WAKE_UP_IRQ,
2504 RPM_SCSS_CPU1_GP_HIGH_IRQ,
2505 RPM_SCSS_CPU1_GP_MEDIUM_IRQ,
2506 RPM_SCSS_CPU1_GP_LOW_IRQ,
2507 RPM_SCSS_CPU1_WAKE_UP_IRQ,
2508 MARM_SCSS_GP_IRQ_0,
2509 MARM_SCSS_GP_IRQ_1,
2510 MARM_SCSS_GP_IRQ_2,
2511 MARM_SCSS_GP_IRQ_3,
2512 MARM_SCSS_GP_IRQ_4,
2513 MARM_SCSS_GP_IRQ_5,
2514 MARM_SCSS_GP_IRQ_6,
2515 MARM_SCSS_GP_IRQ_7,
2516 MARM_SCSS_GP_IRQ_8,
2517 MARM_SCSS_GP_IRQ_9,
2518 LPASS_SCSS_GP_LOW_IRQ,
2519 LPASS_SCSS_GP_MEDIUM_IRQ,
2520 LPASS_SCSS_GP_HIGH_IRQ,
2521 SDC4_IRQ_0,
2522 SPS_MTI_31,
2523};
2524
Praveen Chidambaram78499012011-11-01 17:15:17 -06002525struct msm_mpm_device_data msm8660_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002526 .irqs_m2a = msm_mpm_irqs_m2a,
2527 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2528 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2529 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2530 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2531 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2532 .mpm_apps_ipc_reg = MSM_GCC_BASE + 0x008,
2533 .mpm_apps_ipc_val = BIT(1),
2534 .mpm_ipc_irq = RPM_SCSS_CPU0_GP_MEDIUM_IRQ,
2535
2536};
2537#endif
2538
2539
2540#ifdef CONFIG_MSM_BUS_SCALING
2541struct platform_device msm_bus_sys_fabric = {
2542 .name = "msm_bus_fabric",
2543 .id = MSM_BUS_FAB_SYSTEM,
2544};
2545struct platform_device msm_bus_apps_fabric = {
2546 .name = "msm_bus_fabric",
2547 .id = MSM_BUS_FAB_APPSS,
2548};
2549struct platform_device msm_bus_mm_fabric = {
2550 .name = "msm_bus_fabric",
2551 .id = MSM_BUS_FAB_MMSS,
2552};
2553struct platform_device msm_bus_sys_fpb = {
2554 .name = "msm_bus_fabric",
2555 .id = MSM_BUS_FAB_SYSTEM_FPB,
2556};
2557struct platform_device msm_bus_cpss_fpb = {
2558 .name = "msm_bus_fabric",
2559 .id = MSM_BUS_FAB_CPSS_FPB,
2560};
2561#endif
2562
Lei Zhou01366a42011-08-19 13:12:00 -04002563#ifdef CONFIG_SND_SOC_MSM8660_APQ
2564struct platform_device msm_pcm = {
2565 .name = "msm-pcm-dsp",
2566 .id = -1,
2567};
2568
2569struct platform_device msm_pcm_routing = {
2570 .name = "msm-pcm-routing",
2571 .id = -1,
2572};
2573
2574struct platform_device msm_cpudai0 = {
2575 .name = "msm-dai-q6",
2576 .id = PRIMARY_I2S_RX,
2577};
2578
2579struct platform_device msm_cpudai1 = {
2580 .name = "msm-dai-q6",
2581 .id = PRIMARY_I2S_TX,
2582};
2583
2584struct platform_device msm_cpudai_hdmi_rx = {
2585 .name = "msm-dai-q6",
2586 .id = HDMI_RX,
2587};
2588
2589struct platform_device msm_cpudai_bt_rx = {
2590 .name = "msm-dai-q6",
2591 .id = INT_BT_SCO_RX,
2592};
2593
2594struct platform_device msm_cpudai_bt_tx = {
2595 .name = "msm-dai-q6",
2596 .id = INT_BT_SCO_TX,
2597};
2598
2599struct platform_device msm_cpudai_fm_rx = {
2600 .name = "msm-dai-q6",
2601 .id = INT_FM_RX,
2602};
2603
2604struct platform_device msm_cpudai_fm_tx = {
2605 .name = "msm-dai-q6",
2606 .id = INT_FM_TX,
2607};
2608
2609struct platform_device msm_cpu_fe = {
2610 .name = "msm-dai-fe",
2611 .id = -1,
2612};
2613
2614struct platform_device msm_stub_codec = {
2615 .name = "msm-stub-codec",
2616 .id = 1,
2617};
2618
2619struct platform_device msm_voice = {
2620 .name = "msm-pcm-voice",
2621 .id = -1,
2622};
2623
2624struct platform_device msm_voip = {
2625 .name = "msm-voip-dsp",
2626 .id = -1,
2627};
2628
2629struct platform_device msm_lpa_pcm = {
2630 .name = "msm-pcm-lpa",
2631 .id = -1,
2632};
2633
2634struct platform_device msm_pcm_hostless = {
2635 .name = "msm-pcm-hostless",
2636 .id = -1,
2637};
2638#endif
2639
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002640struct platform_device asoc_msm_pcm = {
2641 .name = "msm-dsp-audio",
2642 .id = 0,
2643};
2644
2645struct platform_device asoc_msm_dai0 = {
2646 .name = "msm-codec-dai",
2647 .id = 0,
2648};
2649
2650struct platform_device asoc_msm_dai1 = {
2651 .name = "msm-cpu-dai",
2652 .id = 0,
2653};
2654
2655#if defined (CONFIG_MSM_8x60_VOIP)
2656struct platform_device asoc_msm_mvs = {
2657 .name = "msm-mvs-audio",
2658 .id = 0,
2659};
2660
2661struct platform_device asoc_mvs_dai0 = {
2662 .name = "mvs-codec-dai",
2663 .id = 0,
2664};
2665
2666struct platform_device asoc_mvs_dai1 = {
2667 .name = "mvs-cpu-dai",
2668 .id = 0,
2669};
2670#endif
2671
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002672static struct fs_driver_data gfx2d0_fs_data = {
2673 .clks = (struct fs_clk_data[]){
2674 { .name = "core_clk" },
2675 { .name = "iface_clk" },
2676 { 0 }
2677 },
2678 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002679};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002680
2681static struct fs_driver_data gfx2d1_fs_data = {
2682 .clks = (struct fs_clk_data[]){
2683 { .name = "core_clk" },
2684 { .name = "iface_clk" },
2685 { 0 }
2686 },
2687 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2688};
2689
2690static struct fs_driver_data gfx3d_fs_data = {
2691 .clks = (struct fs_clk_data[]){
2692 { .name = "core_clk", .reset_rate = 27000000 },
2693 { .name = "iface_clk" },
2694 { 0 }
2695 },
2696 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2697};
2698
2699static struct fs_driver_data ijpeg_fs_data = {
2700 .clks = (struct fs_clk_data[]){
2701 { .name = "core_clk" },
2702 { .name = "iface_clk" },
2703 { .name = "bus_clk" },
2704 { 0 }
2705 },
2706 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2707};
2708
2709static struct fs_driver_data mdp_fs_data = {
2710 .clks = (struct fs_clk_data[]){
2711 { .name = "core_clk" },
2712 { .name = "iface_clk" },
2713 { .name = "bus_clk" },
2714 { .name = "vsync_clk" },
2715 { .name = "tv_src_clk" },
2716 { .name = "tv_clk" },
2717 { .name = "pixel_mdp_clk" },
2718 { .name = "pixel_lcdc_clk" },
2719 { 0 }
2720 },
2721 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2722 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2723};
2724
2725static struct fs_driver_data rot_fs_data = {
2726 .clks = (struct fs_clk_data[]){
2727 { .name = "core_clk" },
2728 { .name = "iface_clk" },
2729 { .name = "bus_clk" },
2730 { 0 }
2731 },
2732 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2733};
2734
2735static struct fs_driver_data ved_fs_data = {
2736 .clks = (struct fs_clk_data[]){
2737 { .name = "core_clk" },
2738 { .name = "iface_clk" },
2739 { .name = "bus_clk" },
2740 { 0 }
2741 },
2742 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
2743 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
2744};
2745
2746static struct fs_driver_data vfe_fs_data = {
2747 .clks = (struct fs_clk_data[]){
2748 { .name = "core_clk" },
2749 { .name = "iface_clk" },
2750 { .name = "bus_clk" },
2751 { 0 }
2752 },
2753 .bus_port0 = MSM_BUS_MASTER_VFE,
2754};
2755
2756static struct fs_driver_data vpe_fs_data = {
2757 .clks = (struct fs_clk_data[]){
2758 { .name = "core_clk" },
2759 { .name = "iface_clk" },
2760 { .name = "bus_clk" },
2761 { 0 }
2762 },
2763 .bus_port0 = MSM_BUS_MASTER_VPE,
2764};
2765
2766struct platform_device *msm8660_footswitch[] __initdata = {
Matt Wagantalle4454b82012-05-03 20:48:01 -07002767 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Matt Wagantalld4aab1e2012-05-03 20:26:56 -07002768 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07002769 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002770 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07002771 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
2772 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002773 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
2774 FS_8X60(FS_GFX2D0, "vdd", "kgsl-2d0.0", &gfx2d0_fs_data),
2775 FS_8X60(FS_GFX2D1, "vdd", "kgsl-2d1.1", &gfx2d1_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002776};
2777unsigned msm8660_num_footswitch __initdata = ARRAY_SIZE(msm8660_footswitch);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002778
Praveen Chidambaram78499012011-11-01 17:15:17 -06002779struct msm_rpm_platform_data msm8660_rpm_data __initdata = {
2780 .reg_base_addrs = {
2781 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2782 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2783 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2784 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2785 },
2786 .irq_ack = RPM_SCSS_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002787 .irq_err = RPM_SCSS_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06002788 .irq_wakeup = RPM_SCSS_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002789 .ipc_rpm_reg = MSM_GCC_BASE + 0x008,
2790 .ipc_rpm_val = 4,
2791 .target_id = {
2792 MSM_RPM_MAP(8660, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 8),
2793 MSM_RPM_MAP(8660, NOTIFICATION_REGISTERED_0, NOTIFICATION, 8),
2794 MSM_RPM_MAP(8660, INVALIDATE_0, INVALIDATE, 8),
2795 MSM_RPM_MAP(8660, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2796 MSM_RPM_MAP(8660, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2797 MSM_RPM_MAP(8660, TRIGGER_SET_FROM, TRIGGER_SET, 1),
2798 MSM_RPM_MAP(8660, TRIGGER_SET_TO, TRIGGER_SET, 1),
2799 MSM_RPM_MAP(8660, TRIGGER_SET_TRIGGER, TRIGGER_SET, 1),
2800 MSM_RPM_MAP(8660, TRIGGER_CLEAR_FROM, TRIGGER_CLEAR, 1),
2801 MSM_RPM_MAP(8660, TRIGGER_CLEAR_TO, TRIGGER_CLEAR, 1),
2802 MSM_RPM_MAP(8660, TRIGGER_CLEAR_TRIGGER, TRIGGER_CLEAR, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002803
Praveen Chidambaram78499012011-11-01 17:15:17 -06002804 MSM_RPM_MAP(8660, CXO_CLK, CXO_CLK, 1),
2805 MSM_RPM_MAP(8660, PXO_CLK, PXO_CLK, 1),
2806 MSM_RPM_MAP(8660, PLL_4, PLL_4, 1),
2807 MSM_RPM_MAP(8660, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2808 MSM_RPM_MAP(8660, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2809 MSM_RPM_MAP(8660, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2810 MSM_RPM_MAP(8660, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2811 MSM_RPM_MAP(8660, SFPB_CLK, SFPB_CLK, 1),
2812 MSM_RPM_MAP(8660, CFPB_CLK, CFPB_CLK, 1),
2813 MSM_RPM_MAP(8660, MMFPB_CLK, MMFPB_CLK, 1),
2814 MSM_RPM_MAP(8660, SMI_CLK, SMI_CLK, 1),
2815 MSM_RPM_MAP(8660, EBI1_CLK, EBI1_CLK, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002816
Praveen Chidambaram78499012011-11-01 17:15:17 -06002817 MSM_RPM_MAP(8660, APPS_L2_CACHE_CTL, APPS_L2_CACHE_CTL, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002818
Praveen Chidambaram78499012011-11-01 17:15:17 -06002819 MSM_RPM_MAP(8660, APPS_FABRIC_HALT_0, APPS_FABRIC_HALT, 2),
2820 MSM_RPM_MAP(8660, APPS_FABRIC_CLOCK_MODE_0,
2821 APPS_FABRIC_CLOCK_MODE, 3),
2822 MSM_RPM_MAP(8660, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002823
Praveen Chidambaram78499012011-11-01 17:15:17 -06002824 MSM_RPM_MAP(8660, SYSTEM_FABRIC_HALT_0, SYSTEM_FABRIC_HALT, 2),
2825 MSM_RPM_MAP(8660, SYSTEM_FABRIC_CLOCK_MODE_0,
2826 SYSTEM_FABRIC_CLOCK_MODE, 3),
2827 MSM_RPM_MAP(8660, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 22),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002828
Praveen Chidambaram78499012011-11-01 17:15:17 -06002829 MSM_RPM_MAP(8660, MM_FABRIC_HALT_0, MM_FABRIC_HALT, 2),
2830 MSM_RPM_MAP(8660, MM_FABRIC_CLOCK_MODE_0,
2831 MM_FABRIC_CLOCK_MODE, 3),
2832 MSM_RPM_MAP(8660, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002833
Praveen Chidambaram78499012011-11-01 17:15:17 -06002834 MSM_RPM_MAP(8660, SMPS0B_0, SMPS0B, 2),
2835 MSM_RPM_MAP(8660, SMPS1B_0, SMPS1B, 2),
2836 MSM_RPM_MAP(8660, SMPS2B_0, SMPS2B, 2),
2837 MSM_RPM_MAP(8660, SMPS3B_0, SMPS3B, 2),
2838 MSM_RPM_MAP(8660, SMPS4B_0, SMPS4B, 2),
2839 MSM_RPM_MAP(8660, LDO0B_0, LDO0B, 2),
2840 MSM_RPM_MAP(8660, LDO1B_0, LDO1B, 2),
2841 MSM_RPM_MAP(8660, LDO2B_0, LDO2B, 2),
2842 MSM_RPM_MAP(8660, LDO3B_0, LDO3B, 2),
2843 MSM_RPM_MAP(8660, LDO4B_0, LDO4B, 2),
2844 MSM_RPM_MAP(8660, LDO5B_0, LDO5B, 2),
2845 MSM_RPM_MAP(8660, LDO6B_0, LDO6B, 2),
2846 MSM_RPM_MAP(8660, LVS0B, LVS0B, 1),
2847 MSM_RPM_MAP(8660, LVS1B, LVS1B, 1),
2848 MSM_RPM_MAP(8660, LVS2B, LVS2B, 1),
2849 MSM_RPM_MAP(8660, LVS3B, LVS3B, 1),
2850 MSM_RPM_MAP(8660, MVS, MVS, 1),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002851
Praveen Chidambaram78499012011-11-01 17:15:17 -06002852 MSM_RPM_MAP(8660, SMPS0_0, SMPS0, 2),
2853 MSM_RPM_MAP(8660, SMPS1_0, SMPS1, 2),
2854 MSM_RPM_MAP(8660, SMPS2_0, SMPS2, 2),
2855 MSM_RPM_MAP(8660, SMPS3_0, SMPS3, 2),
2856 MSM_RPM_MAP(8660, SMPS4_0, SMPS4, 2),
2857 MSM_RPM_MAP(8660, LDO0_0, LDO0, 2),
2858 MSM_RPM_MAP(8660, LDO1_0, LDO1, 2),
2859 MSM_RPM_MAP(8660, LDO2_0, LDO2, 2),
2860 MSM_RPM_MAP(8660, LDO3_0, LDO3, 2),
2861 MSM_RPM_MAP(8660, LDO4_0, LDO4, 2),
2862 MSM_RPM_MAP(8660, LDO5_0, LDO5, 2),
2863 MSM_RPM_MAP(8660, LDO6_0, LDO6, 2),
2864 MSM_RPM_MAP(8660, LDO7_0, LDO7, 2),
2865 MSM_RPM_MAP(8660, LDO8_0, LDO8, 2),
2866 MSM_RPM_MAP(8660, LDO9_0, LDO9, 2),
2867 MSM_RPM_MAP(8660, LDO10_0, LDO10, 2),
2868 MSM_RPM_MAP(8660, LDO11_0, LDO11, 2),
2869 MSM_RPM_MAP(8660, LDO12_0, LDO12, 2),
2870 MSM_RPM_MAP(8660, LDO13_0, LDO13, 2),
2871 MSM_RPM_MAP(8660, LDO14_0, LDO14, 2),
2872 MSM_RPM_MAP(8660, LDO15_0, LDO15, 2),
2873 MSM_RPM_MAP(8660, LDO16_0, LDO16, 2),
2874 MSM_RPM_MAP(8660, LDO17_0, LDO17, 2),
2875 MSM_RPM_MAP(8660, LDO18_0, LDO18, 2),
2876 MSM_RPM_MAP(8660, LDO19_0, LDO19, 2),
2877 MSM_RPM_MAP(8660, LDO20_0, LDO20, 2),
2878 MSM_RPM_MAP(8660, LDO21_0, LDO21, 2),
2879 MSM_RPM_MAP(8660, LDO22_0, LDO22, 2),
2880 MSM_RPM_MAP(8660, LDO23_0, LDO23, 2),
2881 MSM_RPM_MAP(8660, LDO24_0, LDO24, 2),
2882 MSM_RPM_MAP(8660, LDO25_0, LDO25, 2),
2883 MSM_RPM_MAP(8660, LVS0, LVS0, 1),
2884 MSM_RPM_MAP(8660, LVS1, LVS1, 1),
2885 MSM_RPM_MAP(8660, NCP_0, NCP, 2),
2886 MSM_RPM_MAP(8660, CXO_BUFFERS, CXO_BUFFERS, 1),
2887 },
2888 .target_status = {
2889 MSM_RPM_STATUS_ID_MAP(8660, VERSION_MAJOR),
2890 MSM_RPM_STATUS_ID_MAP(8660, VERSION_MINOR),
2891 MSM_RPM_STATUS_ID_MAP(8660, VERSION_BUILD),
2892 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_0),
2893 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_1),
2894 MSM_RPM_STATUS_ID_MAP(8660, SUPPORTED_RESOURCES_2),
2895 MSM_RPM_STATUS_ID_MAP(8660, SEQUENCE),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002896
Praveen Chidambaram78499012011-11-01 17:15:17 -06002897 MSM_RPM_STATUS_ID_MAP(8660, CXO_CLK),
2898 MSM_RPM_STATUS_ID_MAP(8660, PXO_CLK),
2899 MSM_RPM_STATUS_ID_MAP(8660, PLL_4),
2900 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_CLK),
2901 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_CLK),
2902 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_CLK),
2903 MSM_RPM_STATUS_ID_MAP(8660, DAYTONA_FABRIC_CLK),
2904 MSM_RPM_STATUS_ID_MAP(8660, SFPB_CLK),
2905 MSM_RPM_STATUS_ID_MAP(8660, CFPB_CLK),
2906 MSM_RPM_STATUS_ID_MAP(8660, MMFPB_CLK),
2907 MSM_RPM_STATUS_ID_MAP(8660, SMI_CLK),
2908 MSM_RPM_STATUS_ID_MAP(8660, EBI1_CLK),
2909
2910 MSM_RPM_STATUS_ID_MAP(8660, APPS_L2_CACHE_CTL),
2911
2912 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_HALT),
2913 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_CLOCK_MODE),
2914 MSM_RPM_STATUS_ID_MAP(8660, APPS_FABRIC_ARB),
2915
2916 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_HALT),
2917 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_CLOCK_MODE),
2918 MSM_RPM_STATUS_ID_MAP(8660, SYSTEM_FABRIC_ARB),
2919
2920 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_HALT),
2921 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_CLOCK_MODE),
2922 MSM_RPM_STATUS_ID_MAP(8660, MM_FABRIC_ARB),
2923
2924
2925 MSM_RPM_STATUS_ID_MAP(8660, SMPS0B_0),
2926 MSM_RPM_STATUS_ID_MAP(8660, SMPS0B_1),
2927 MSM_RPM_STATUS_ID_MAP(8660, SMPS1B_0),
2928 MSM_RPM_STATUS_ID_MAP(8660, SMPS1B_1),
2929 MSM_RPM_STATUS_ID_MAP(8660, SMPS2B_0),
2930 MSM_RPM_STATUS_ID_MAP(8660, SMPS2B_1),
2931 MSM_RPM_STATUS_ID_MAP(8660, SMPS3B_0),
2932 MSM_RPM_STATUS_ID_MAP(8660, SMPS3B_1),
2933 MSM_RPM_STATUS_ID_MAP(8660, SMPS4B_0),
2934 MSM_RPM_STATUS_ID_MAP(8660, SMPS4B_1),
2935 MSM_RPM_STATUS_ID_MAP(8660, LDO0B_0),
2936 MSM_RPM_STATUS_ID_MAP(8660, LDO0B_1),
2937 MSM_RPM_STATUS_ID_MAP(8660, LDO1B_0),
2938 MSM_RPM_STATUS_ID_MAP(8660, LDO1B_1),
2939 MSM_RPM_STATUS_ID_MAP(8660, LDO2B_0),
2940 MSM_RPM_STATUS_ID_MAP(8660, LDO2B_1),
2941 MSM_RPM_STATUS_ID_MAP(8660, LDO3B_0),
2942 MSM_RPM_STATUS_ID_MAP(8660, LDO3B_1),
2943 MSM_RPM_STATUS_ID_MAP(8660, LDO4B_0),
2944 MSM_RPM_STATUS_ID_MAP(8660, LDO4B_1),
2945 MSM_RPM_STATUS_ID_MAP(8660, LDO5B_0),
2946 MSM_RPM_STATUS_ID_MAP(8660, LDO5B_1),
2947 MSM_RPM_STATUS_ID_MAP(8660, LDO6B_0),
2948 MSM_RPM_STATUS_ID_MAP(8660, LDO6B_1),
2949 MSM_RPM_STATUS_ID_MAP(8660, LVS0B),
2950 MSM_RPM_STATUS_ID_MAP(8660, LVS1B),
2951 MSM_RPM_STATUS_ID_MAP(8660, LVS2B),
2952 MSM_RPM_STATUS_ID_MAP(8660, LVS3B),
2953 MSM_RPM_STATUS_ID_MAP(8660, MVS),
2954
2955
2956 MSM_RPM_STATUS_ID_MAP(8660, SMPS0_0),
2957 MSM_RPM_STATUS_ID_MAP(8660, SMPS0_1),
2958 MSM_RPM_STATUS_ID_MAP(8660, SMPS1_0),
2959 MSM_RPM_STATUS_ID_MAP(8660, SMPS1_1),
2960 MSM_RPM_STATUS_ID_MAP(8660, SMPS2_0),
2961 MSM_RPM_STATUS_ID_MAP(8660, SMPS2_1),
2962 MSM_RPM_STATUS_ID_MAP(8660, SMPS3_0),
2963 MSM_RPM_STATUS_ID_MAP(8660, SMPS3_1),
2964 MSM_RPM_STATUS_ID_MAP(8660, SMPS4_0),
2965 MSM_RPM_STATUS_ID_MAP(8660, SMPS4_1),
2966 MSM_RPM_STATUS_ID_MAP(8660, LDO0_0),
2967 MSM_RPM_STATUS_ID_MAP(8660, LDO0_1),
2968 MSM_RPM_STATUS_ID_MAP(8660, LDO1_0),
2969 MSM_RPM_STATUS_ID_MAP(8660, LDO1_1),
2970 MSM_RPM_STATUS_ID_MAP(8660, LDO2_0),
2971 MSM_RPM_STATUS_ID_MAP(8660, LDO2_1),
2972 MSM_RPM_STATUS_ID_MAP(8660, LDO3_0),
2973 MSM_RPM_STATUS_ID_MAP(8660, LDO3_1),
2974 MSM_RPM_STATUS_ID_MAP(8660, LDO4_0),
2975 MSM_RPM_STATUS_ID_MAP(8660, LDO4_1),
2976 MSM_RPM_STATUS_ID_MAP(8660, LDO5_0),
2977 MSM_RPM_STATUS_ID_MAP(8660, LDO5_1),
2978 MSM_RPM_STATUS_ID_MAP(8660, LDO6_0),
2979 MSM_RPM_STATUS_ID_MAP(8660, LDO6_1),
2980 MSM_RPM_STATUS_ID_MAP(8660, LDO7_0),
2981 MSM_RPM_STATUS_ID_MAP(8660, LDO7_1),
2982 MSM_RPM_STATUS_ID_MAP(8660, LDO8_0),
2983 MSM_RPM_STATUS_ID_MAP(8660, LDO8_1),
2984 MSM_RPM_STATUS_ID_MAP(8660, LDO9_0),
2985 MSM_RPM_STATUS_ID_MAP(8660, LDO9_1),
2986 MSM_RPM_STATUS_ID_MAP(8660, LDO10_0),
2987 MSM_RPM_STATUS_ID_MAP(8660, LDO10_1),
2988 MSM_RPM_STATUS_ID_MAP(8660, LDO11_0),
2989 MSM_RPM_STATUS_ID_MAP(8660, LDO11_1),
2990 MSM_RPM_STATUS_ID_MAP(8660, LDO12_0),
2991 MSM_RPM_STATUS_ID_MAP(8660, LDO12_1),
2992 MSM_RPM_STATUS_ID_MAP(8660, LDO13_0),
2993 MSM_RPM_STATUS_ID_MAP(8660, LDO13_1),
2994 MSM_RPM_STATUS_ID_MAP(8660, LDO14_0),
2995 MSM_RPM_STATUS_ID_MAP(8660, LDO14_1),
2996 MSM_RPM_STATUS_ID_MAP(8660, LDO15_0),
2997 MSM_RPM_STATUS_ID_MAP(8660, LDO15_1),
2998 MSM_RPM_STATUS_ID_MAP(8660, LDO16_0),
2999 MSM_RPM_STATUS_ID_MAP(8660, LDO16_1),
3000 MSM_RPM_STATUS_ID_MAP(8660, LDO17_0),
3001 MSM_RPM_STATUS_ID_MAP(8660, LDO17_1),
3002 MSM_RPM_STATUS_ID_MAP(8660, LDO18_0),
3003 MSM_RPM_STATUS_ID_MAP(8660, LDO18_1),
3004 MSM_RPM_STATUS_ID_MAP(8660, LDO19_0),
3005 MSM_RPM_STATUS_ID_MAP(8660, LDO19_1),
3006 MSM_RPM_STATUS_ID_MAP(8660, LDO20_0),
3007 MSM_RPM_STATUS_ID_MAP(8660, LDO20_1),
3008 MSM_RPM_STATUS_ID_MAP(8660, LDO21_0),
3009 MSM_RPM_STATUS_ID_MAP(8660, LDO21_1),
3010 MSM_RPM_STATUS_ID_MAP(8660, LDO22_0),
3011 MSM_RPM_STATUS_ID_MAP(8660, LDO22_1),
3012 MSM_RPM_STATUS_ID_MAP(8660, LDO23_0),
3013 MSM_RPM_STATUS_ID_MAP(8660, LDO23_1),
3014 MSM_RPM_STATUS_ID_MAP(8660, LDO24_0),
3015 MSM_RPM_STATUS_ID_MAP(8660, LDO24_1),
3016 MSM_RPM_STATUS_ID_MAP(8660, LDO25_0),
3017 MSM_RPM_STATUS_ID_MAP(8660, LDO25_1),
3018 MSM_RPM_STATUS_ID_MAP(8660, LVS0),
3019 MSM_RPM_STATUS_ID_MAP(8660, LVS1),
3020 MSM_RPM_STATUS_ID_MAP(8660, NCP_0),
3021 MSM_RPM_STATUS_ID_MAP(8660, NCP_1),
3022 MSM_RPM_STATUS_ID_MAP(8660, CXO_BUFFERS),
3023 },
3024 .target_ctrl_id = {
3025 MSM_RPM_CTRL_MAP(8660, VERSION_MAJOR),
3026 MSM_RPM_CTRL_MAP(8660, VERSION_MINOR),
3027 MSM_RPM_CTRL_MAP(8660, VERSION_BUILD),
3028 MSM_RPM_CTRL_MAP(8660, REQ_CTX_0),
3029 MSM_RPM_CTRL_MAP(8660, REQ_SEL_0),
3030 MSM_RPM_CTRL_MAP(8660, ACK_CTX_0),
3031 MSM_RPM_CTRL_MAP(8660, ACK_SEL_0),
3032 },
3033 .sel_invalidate = MSM_RPM_8660_SEL_INVALIDATE,
3034 .sel_notification = MSM_RPM_8660_SEL_NOTIFICATION,
3035 .sel_last = MSM_RPM_8660_SEL_LAST,
3036 .ver = {2, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003037};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003038
Praveen Chidambaram78499012011-11-01 17:15:17 -06003039struct platform_device msm8660_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003040 .name = "msm_rpm",
3041 .id = -1,
3042};
Laura Abbottd92be422012-06-04 15:11:09 -07003043
3044struct msm_iommu_domain_name msm8660_iommu_ctx_names[] = {
3045 /* Camera */
3046 {
Laura Abbottd92be422012-06-04 15:11:09 -07003047 .name = "ijpeg_src",
3048 .domain = CAMERA_DOMAIN,
3049 },
3050 /* Camera */
3051 {
3052 .name = "ijpeg_dst",
3053 .domain = CAMERA_DOMAIN,
3054 },
3055 /* Camera */
3056 {
3057 .name = "jpegd_src",
3058 .domain = CAMERA_DOMAIN,
3059 },
3060 /* Camera */
3061 {
3062 .name = "jpegd_dst",
3063 .domain = CAMERA_DOMAIN,
3064 },
3065 /* Rotator */
3066 {
3067 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07003068 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbottd92be422012-06-04 15:11:09 -07003069 },
3070 /* Rotator */
3071 {
3072 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07003073 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbottd92be422012-06-04 15:11:09 -07003074 },
3075 /* Video */
3076 {
3077 .name = "vcodec_a_mm1",
3078 .domain = VIDEO_DOMAIN,
3079 },
3080 /* Video */
3081 {
3082 .name = "vcodec_b_mm2",
3083 .domain = VIDEO_DOMAIN,
3084 },
3085 /* Video */
3086 {
3087 .name = "vcodec_a_stream",
3088 .domain = VIDEO_DOMAIN,
3089 },
3090};
3091
3092static struct mem_pool msm8660_video_pools[] = {
3093 /*
3094 * Video hardware has the following requirements:
3095 * 1. All video addresses used by the video hardware must be at a higher
3096 * address than video firmware address.
3097 * 2. Video hardware can only access a range of 256MB from the base of
3098 * the video firmware.
3099 */
3100 [VIDEO_FIRMWARE_POOL] =
3101 /* Low addresses, intended for video firmware */
3102 {
3103 .paddr = SZ_128K,
3104 .size = SZ_16M - SZ_128K,
3105 },
3106 [VIDEO_MAIN_POOL] =
3107 /* Main video pool */
3108 {
3109 .paddr = SZ_16M,
3110 .size = SZ_256M - SZ_16M,
3111 },
3112 [GEN_POOL] =
3113 /* Remaining address space up to 2G */
3114 {
3115 .paddr = SZ_256M,
3116 .size = SZ_2G - SZ_256M,
3117 },
3118};
3119
3120static struct mem_pool msm8660_camera_pools[] = {
3121 [GEN_POOL] =
3122 /* One address space for camera */
3123 {
3124 .paddr = SZ_128K,
3125 .size = SZ_2G - SZ_128K,
3126 },
3127};
3128
3129static struct mem_pool msm8660_display_pools[] = {
3130 [GEN_POOL] =
3131 /* One address space for display */
3132 {
3133 .paddr = SZ_128K,
3134 .size = SZ_2G - SZ_128K,
3135 },
3136};
3137
3138static struct mem_pool msm8660_rotator_pools[] = {
3139 [GEN_POOL] =
3140 /* One address space for rotator */
3141 {
3142 .paddr = SZ_128K,
3143 .size = SZ_2G - SZ_128K,
3144 },
3145};
3146
3147static struct msm_iommu_domain msm8660_iommu_domains[] = {
3148 [VIDEO_DOMAIN] = {
3149 .iova_pools = msm8660_video_pools,
3150 .npools = ARRAY_SIZE(msm8660_video_pools),
3151 },
3152 [CAMERA_DOMAIN] = {
3153 .iova_pools = msm8660_camera_pools,
3154 .npools = ARRAY_SIZE(msm8660_camera_pools),
3155 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003156 [DISPLAY_READ_DOMAIN] = {
Laura Abbottd92be422012-06-04 15:11:09 -07003157 .iova_pools = msm8660_display_pools,
3158 .npools = ARRAY_SIZE(msm8660_display_pools),
3159 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003160 [ROTATOR_SRC_DOMAIN] = {
Laura Abbottd92be422012-06-04 15:11:09 -07003161 .iova_pools = msm8660_rotator_pools,
3162 .npools = ARRAY_SIZE(msm8660_rotator_pools),
3163 },
3164};
3165
3166struct iommu_domains_pdata msm8660_iommu_domain_pdata = {
3167 .domains = msm8660_iommu_domains,
3168 .ndomains = ARRAY_SIZE(msm8660_iommu_domains),
3169 .domain_names = msm8660_iommu_ctx_names,
3170 .nnames = ARRAY_SIZE(msm8660_iommu_ctx_names),
3171 .domain_alloc_flags = 0,
3172};
3173
3174struct platform_device msm8660_iommu_domain_device = {
3175 .name = "iommu_domains",
3176 .id = -1,
3177 .dev = {
3178 .platform_data = &msm8660_iommu_domain_pdata,
3179 }
3180};
Praveen Chidambaramf27a5152013-02-01 11:44:53 -07003181
3182struct platform_device msm8660_pm_8x60 = {
3183 .name = "pm-8x60",
3184 .id = -1,
3185};
3186