blob: 8ec4633a66705de5bcbfad217a0fd73bc1c5dac7 [file] [log] [blame]
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/platform_device.h>
17#include <linux/msm_rotator.h>
Deepak Kotur12301a72011-11-09 18:30:29 -080018#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/gpio.h>
20#include <asm/clkdev.h>
21#include <linux/msm_kgsl.h>
22#include <linux/android_pmem.h>
23#include <mach/irqs-8960.h>
Mayank Rana9f51f582011-08-04 18:35:59 +053024#include <mach/dma.h>
25#include <linux/dma-mapping.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070026#include <mach/board.h>
27#include <mach/msm_iomap.h>
28#include <mach/msm_hsusb.h>
29#include <mach/msm_sps.h>
30#include <mach/rpm.h>
31#include <mach/msm_bus_board.h>
32#include <mach/msm_memtypes.h>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070033#include <sound/msm-dai-q6.h>
34#include <sound/apr_audio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035#include "clock.h"
36#include "devices.h"
37#include "devices-msm8x60.h"
38#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070039#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060040#include "rpm_log.h"
Praveen Chidambaram7a712232011-10-28 13:39:45 -060041#include "rpm_stats.h"
Stephen Boydeb819882011-08-29 14:46:30 -070042#include "pil-q6v4.h"
43#include "scm-pas.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044
45#ifdef CONFIG_MSM_MPM
46#include "mpm.h"
47#endif
48#ifdef CONFIG_MSM_DSPS
49#include <mach/msm_dsps.h>
50#endif
51
52
53/* Address of GSBI blocks */
54#define MSM_GSBI1_PHYS 0x16000000
55#define MSM_GSBI2_PHYS 0x16100000
56#define MSM_GSBI3_PHYS 0x16200000
57#define MSM_GSBI4_PHYS 0x16300000
58#define MSM_GSBI5_PHYS 0x16400000
59#define MSM_GSBI6_PHYS 0x16500000
60#define MSM_GSBI7_PHYS 0x16600000
61#define MSM_GSBI8_PHYS 0x1A000000
62#define MSM_GSBI9_PHYS 0x1A100000
63#define MSM_GSBI10_PHYS 0x1A200000
64#define MSM_GSBI11_PHYS 0x12440000
65#define MSM_GSBI12_PHYS 0x12480000
66
67#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
68#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053069#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070070
71/* GSBI QUP devices */
72#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
73#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
74#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
75#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
76#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
77#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
78#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
79#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
80#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
81#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
82#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
83#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
84#define MSM_QUP_SIZE SZ_4K
85
86#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
87#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
88#define MSM_PMIC_SSBI_SIZE SZ_4K
89
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -070090#define MSM8960_HSUSB_PHYS 0x12500000
91#define MSM8960_HSUSB_SIZE SZ_4K
92
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070093static struct resource resources_otg[] = {
94 {
95 .start = MSM8960_HSUSB_PHYS,
96 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
97 .flags = IORESOURCE_MEM,
98 },
99 {
100 .start = USB1_HS_IRQ,
101 .end = USB1_HS_IRQ,
102 .flags = IORESOURCE_IRQ,
103 },
104};
105
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700106struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700107 .name = "msm_otg",
108 .id = -1,
109 .num_resources = ARRAY_SIZE(resources_otg),
110 .resource = resources_otg,
111 .dev = {
112 .coherent_dma_mask = 0xffffffff,
113 },
114};
115
116static struct resource resources_hsusb[] = {
117 {
118 .start = MSM8960_HSUSB_PHYS,
119 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
120 .flags = IORESOURCE_MEM,
121 },
122 {
123 .start = USB1_HS_IRQ,
124 .end = USB1_HS_IRQ,
125 .flags = IORESOURCE_IRQ,
126 },
127};
128
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700129struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700130 .name = "msm_hsusb",
131 .id = -1,
132 .num_resources = ARRAY_SIZE(resources_hsusb),
133 .resource = resources_hsusb,
134 .dev = {
135 .coherent_dma_mask = 0xffffffff,
136 },
137};
138
139static struct resource resources_hsusb_host[] = {
140 {
141 .start = MSM8960_HSUSB_PHYS,
142 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
143 .flags = IORESOURCE_MEM,
144 },
145 {
146 .start = USB1_HS_IRQ,
147 .end = USB1_HS_IRQ,
148 .flags = IORESOURCE_IRQ,
149 },
150};
151
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530152static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700153struct platform_device msm_device_hsusb_host = {
154 .name = "msm_hsusb_host",
155 .id = -1,
156 .num_resources = ARRAY_SIZE(resources_hsusb_host),
157 .resource = resources_hsusb_host,
158 .dev = {
159 .dma_mask = &dma_mask,
160 .coherent_dma_mask = 0xffffffff,
161 },
162};
163
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530164static struct resource resources_hsic_host[] = {
165 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700166 .start = 0x12520000,
167 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530168 .flags = IORESOURCE_MEM,
169 },
170 {
171 .start = USB_HSIC_IRQ,
172 .end = USB_HSIC_IRQ,
173 .flags = IORESOURCE_IRQ,
174 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800175 {
176 .start = MSM_GPIO_TO_INT(69),
177 .end = MSM_GPIO_TO_INT(69),
178 .name = "peripheral_status_irq",
179 .flags = IORESOURCE_IRQ,
180 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530181};
182
183struct platform_device msm_device_hsic_host = {
184 .name = "msm_hsic_host",
185 .id = -1,
186 .num_resources = ARRAY_SIZE(resources_hsic_host),
187 .resource = resources_hsic_host,
188 .dev = {
189 .dma_mask = &dma_mask,
190 .coherent_dma_mask = DMA_BIT_MASK(32),
191 },
192};
193
Mona Hossain11c03ac2011-10-26 12:42:10 -0700194#define SHARED_IMEM_TZ_BASE 0x2a03f720
195static struct resource tzlog_resources[] = {
196 {
197 .start = SHARED_IMEM_TZ_BASE,
198 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
199 .flags = IORESOURCE_MEM,
200 },
201};
202
203struct platform_device msm_device_tz_log = {
204 .name = "tz_log",
205 .id = 0,
206 .num_resources = ARRAY_SIZE(tzlog_resources),
207 .resource = tzlog_resources,
208};
209
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700210static struct resource resources_uart_gsbi2[] = {
211 {
212 .start = MSM8960_GSBI2_UARTDM_IRQ,
213 .end = MSM8960_GSBI2_UARTDM_IRQ,
214 .flags = IORESOURCE_IRQ,
215 },
216 {
217 .start = MSM_UART2DM_PHYS,
218 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
219 .name = "uartdm_resource",
220 .flags = IORESOURCE_MEM,
221 },
222 {
223 .start = MSM_GSBI2_PHYS,
224 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
225 .name = "gsbi_resource",
226 .flags = IORESOURCE_MEM,
227 },
228};
229
230struct platform_device msm8960_device_uart_gsbi2 = {
231 .name = "msm_serial_hsl",
232 .id = 0,
233 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
234 .resource = resources_uart_gsbi2,
235};
Mayank Rana9f51f582011-08-04 18:35:59 +0530236/* GSBI 6 used into UARTDM Mode */
237static struct resource msm_uart_dm6_resources[] = {
238 {
239 .start = MSM_UART6DM_PHYS,
240 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
241 .name = "uartdm_resource",
242 .flags = IORESOURCE_MEM,
243 },
244 {
245 .start = GSBI6_UARTDM_IRQ,
246 .end = GSBI6_UARTDM_IRQ,
247 .flags = IORESOURCE_IRQ,
248 },
249 {
250 .start = MSM_GSBI6_PHYS,
251 .end = MSM_GSBI6_PHYS + 4 - 1,
252 .name = "gsbi_resource",
253 .flags = IORESOURCE_MEM,
254 },
255 {
256 .start = DMOV_HSUART_GSBI6_TX_CHAN,
257 .end = DMOV_HSUART_GSBI6_RX_CHAN,
258 .name = "uartdm_channels",
259 .flags = IORESOURCE_DMA,
260 },
261 {
262 .start = DMOV_HSUART_GSBI6_TX_CRCI,
263 .end = DMOV_HSUART_GSBI6_RX_CRCI,
264 .name = "uartdm_crci",
265 .flags = IORESOURCE_DMA,
266 },
267};
268static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
269struct platform_device msm_device_uart_dm6 = {
270 .name = "msm_serial_hs",
271 .id = 0,
272 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
273 .resource = msm_uart_dm6_resources,
274 .dev = {
275 .dma_mask = &msm_uart_dm6_dma_mask,
276 .coherent_dma_mask = DMA_BIT_MASK(32),
277 },
278};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700279
280static struct resource resources_uart_gsbi5[] = {
281 {
282 .start = GSBI5_UARTDM_IRQ,
283 .end = GSBI5_UARTDM_IRQ,
284 .flags = IORESOURCE_IRQ,
285 },
286 {
287 .start = MSM_UART5DM_PHYS,
288 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
289 .name = "uartdm_resource",
290 .flags = IORESOURCE_MEM,
291 },
292 {
293 .start = MSM_GSBI5_PHYS,
294 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
295 .name = "gsbi_resource",
296 .flags = IORESOURCE_MEM,
297 },
298};
299
300struct platform_device msm8960_device_uart_gsbi5 = {
301 .name = "msm_serial_hsl",
302 .id = 0,
303 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
304 .resource = resources_uart_gsbi5,
305};
306/* MSM Video core device */
307#ifdef CONFIG_MSM_BUS_SCALING
308static struct msm_bus_vectors vidc_init_vectors[] = {
309 {
310 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
311 .dst = MSM_BUS_SLAVE_EBI_CH0,
312 .ab = 0,
313 .ib = 0,
314 },
315 {
316 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
317 .dst = MSM_BUS_SLAVE_EBI_CH0,
318 .ab = 0,
319 .ib = 0,
320 },
321 {
322 .src = MSM_BUS_MASTER_AMPSS_M0,
323 .dst = MSM_BUS_SLAVE_EBI_CH0,
324 .ab = 0,
325 .ib = 0,
326 },
327 {
328 .src = MSM_BUS_MASTER_AMPSS_M0,
329 .dst = MSM_BUS_SLAVE_EBI_CH0,
330 .ab = 0,
331 .ib = 0,
332 },
333};
334static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
335 {
336 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
337 .dst = MSM_BUS_SLAVE_EBI_CH0,
338 .ab = 54525952,
339 .ib = 436207616,
340 },
341 {
342 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
343 .dst = MSM_BUS_SLAVE_EBI_CH0,
344 .ab = 72351744,
345 .ib = 289406976,
346 },
347 {
348 .src = MSM_BUS_MASTER_AMPSS_M0,
349 .dst = MSM_BUS_SLAVE_EBI_CH0,
350 .ab = 500000,
351 .ib = 1000000,
352 },
353 {
354 .src = MSM_BUS_MASTER_AMPSS_M0,
355 .dst = MSM_BUS_SLAVE_EBI_CH0,
356 .ab = 500000,
357 .ib = 1000000,
358 },
359};
360static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
361 {
362 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
363 .dst = MSM_BUS_SLAVE_EBI_CH0,
364 .ab = 40894464,
365 .ib = 327155712,
366 },
367 {
368 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
369 .dst = MSM_BUS_SLAVE_EBI_CH0,
370 .ab = 48234496,
371 .ib = 192937984,
372 },
373 {
374 .src = MSM_BUS_MASTER_AMPSS_M0,
375 .dst = MSM_BUS_SLAVE_EBI_CH0,
376 .ab = 500000,
377 .ib = 2000000,
378 },
379 {
380 .src = MSM_BUS_MASTER_AMPSS_M0,
381 .dst = MSM_BUS_SLAVE_EBI_CH0,
382 .ab = 500000,
383 .ib = 2000000,
384 },
385};
386static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
387 {
388 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
389 .dst = MSM_BUS_SLAVE_EBI_CH0,
390 .ab = 163577856,
391 .ib = 1308622848,
392 },
393 {
394 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
395 .dst = MSM_BUS_SLAVE_EBI_CH0,
396 .ab = 219152384,
397 .ib = 876609536,
398 },
399 {
400 .src = MSM_BUS_MASTER_AMPSS_M0,
401 .dst = MSM_BUS_SLAVE_EBI_CH0,
402 .ab = 1750000,
403 .ib = 3500000,
404 },
405 {
406 .src = MSM_BUS_MASTER_AMPSS_M0,
407 .dst = MSM_BUS_SLAVE_EBI_CH0,
408 .ab = 1750000,
409 .ib = 3500000,
410 },
411};
412static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
413 {
414 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
415 .dst = MSM_BUS_SLAVE_EBI_CH0,
416 .ab = 121634816,
417 .ib = 973078528,
418 },
419 {
420 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
421 .dst = MSM_BUS_SLAVE_EBI_CH0,
422 .ab = 155189248,
423 .ib = 620756992,
424 },
425 {
426 .src = MSM_BUS_MASTER_AMPSS_M0,
427 .dst = MSM_BUS_SLAVE_EBI_CH0,
428 .ab = 1750000,
429 .ib = 7000000,
430 },
431 {
432 .src = MSM_BUS_MASTER_AMPSS_M0,
433 .dst = MSM_BUS_SLAVE_EBI_CH0,
434 .ab = 1750000,
435 .ib = 7000000,
436 },
437};
438static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
439 {
440 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
441 .dst = MSM_BUS_SLAVE_EBI_CH0,
442 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700443 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700444 },
445 {
446 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
447 .dst = MSM_BUS_SLAVE_EBI_CH0,
448 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700449 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700450 },
451 {
452 .src = MSM_BUS_MASTER_AMPSS_M0,
453 .dst = MSM_BUS_SLAVE_EBI_CH0,
454 .ab = 2500000,
455 .ib = 5000000,
456 },
457 {
458 .src = MSM_BUS_MASTER_AMPSS_M0,
459 .dst = MSM_BUS_SLAVE_EBI_CH0,
460 .ab = 2500000,
461 .ib = 5000000,
462 },
463};
464static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
465 {
466 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
467 .dst = MSM_BUS_SLAVE_EBI_CH0,
468 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700469 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700470 },
471 {
472 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
473 .dst = MSM_BUS_SLAVE_EBI_CH0,
474 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700475 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700476 },
477 {
478 .src = MSM_BUS_MASTER_AMPSS_M0,
479 .dst = MSM_BUS_SLAVE_EBI_CH0,
480 .ab = 2500000,
481 .ib = 700000000,
482 },
483 {
484 .src = MSM_BUS_MASTER_AMPSS_M0,
485 .dst = MSM_BUS_SLAVE_EBI_CH0,
486 .ab = 2500000,
487 .ib = 10000000,
488 },
489};
490
491static struct msm_bus_paths vidc_bus_client_config[] = {
492 {
493 ARRAY_SIZE(vidc_init_vectors),
494 vidc_init_vectors,
495 },
496 {
497 ARRAY_SIZE(vidc_venc_vga_vectors),
498 vidc_venc_vga_vectors,
499 },
500 {
501 ARRAY_SIZE(vidc_vdec_vga_vectors),
502 vidc_vdec_vga_vectors,
503 },
504 {
505 ARRAY_SIZE(vidc_venc_720p_vectors),
506 vidc_venc_720p_vectors,
507 },
508 {
509 ARRAY_SIZE(vidc_vdec_720p_vectors),
510 vidc_vdec_720p_vectors,
511 },
512 {
513 ARRAY_SIZE(vidc_venc_1080p_vectors),
514 vidc_venc_1080p_vectors,
515 },
516 {
517 ARRAY_SIZE(vidc_vdec_1080p_vectors),
518 vidc_vdec_1080p_vectors,
519 },
520};
521
522static struct msm_bus_scale_pdata vidc_bus_client_data = {
523 vidc_bus_client_config,
524 ARRAY_SIZE(vidc_bus_client_config),
525 .name = "vidc",
526};
527#endif
528
Mona Hossain9c430e32011-07-27 11:04:47 -0700529#ifdef CONFIG_HW_RANDOM_MSM
530/* PRNG device */
531#define MSM_PRNG_PHYS 0x1A500000
532static struct resource rng_resources = {
533 .flags = IORESOURCE_MEM,
534 .start = MSM_PRNG_PHYS,
535 .end = MSM_PRNG_PHYS + SZ_512 - 1,
536};
537
538struct platform_device msm_device_rng = {
539 .name = "msm_rng",
540 .id = 0,
541 .num_resources = 1,
542 .resource = &rng_resources,
543};
544#endif
545
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546#define MSM_VIDC_BASE_PHYS 0x04400000
547#define MSM_VIDC_BASE_SIZE 0x00100000
548
549static struct resource msm_device_vidc_resources[] = {
550 {
551 .start = MSM_VIDC_BASE_PHYS,
552 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
553 .flags = IORESOURCE_MEM,
554 },
555 {
556 .start = VCODEC_IRQ,
557 .end = VCODEC_IRQ,
558 .flags = IORESOURCE_IRQ,
559 },
560};
561
562struct msm_vidc_platform_data vidc_platform_data = {
563#ifdef CONFIG_MSM_BUS_SCALING
564 .vidc_bus_client_pdata = &vidc_bus_client_data,
565#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -0700566#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -0800567 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700568 .enable_ion = 1,
569#else
Deepak Kotur12301a72011-11-09 18:30:29 -0800570 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700571 .enable_ion = 0,
572#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800573 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +0530574 .disable_fullhd = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700575};
576
577struct platform_device msm_device_vidc = {
578 .name = "msm_vidc",
579 .id = 0,
580 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
581 .resource = msm_device_vidc_resources,
582 .dev = {
583 .platform_data = &vidc_platform_data,
584 },
585};
586
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700587#define MSM_SDC1_BASE 0x12400000
588#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
589#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
590#define MSM_SDC2_BASE 0x12140000
591#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
592#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
593#define MSM_SDC2_BASE 0x12140000
594#define MSM_SDC3_BASE 0x12180000
595#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
596#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
597#define MSM_SDC4_BASE 0x121C0000
598#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
599#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
600#define MSM_SDC5_BASE 0x12200000
601#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
602#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
603
604static struct resource resources_sdc1[] = {
605 {
606 .name = "core_mem",
607 .flags = IORESOURCE_MEM,
608 .start = MSM_SDC1_BASE,
609 .end = MSM_SDC1_DML_BASE - 1,
610 },
611 {
612 .name = "core_irq",
613 .flags = IORESOURCE_IRQ,
614 .start = SDC1_IRQ_0,
615 .end = SDC1_IRQ_0
616 },
617#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
618 {
619 .name = "sdcc_dml_addr",
620 .start = MSM_SDC1_DML_BASE,
621 .end = MSM_SDC1_BAM_BASE - 1,
622 .flags = IORESOURCE_MEM,
623 },
624 {
625 .name = "sdcc_bam_addr",
626 .start = MSM_SDC1_BAM_BASE,
627 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
628 .flags = IORESOURCE_MEM,
629 },
630 {
631 .name = "sdcc_bam_irq",
632 .start = SDC1_BAM_IRQ,
633 .end = SDC1_BAM_IRQ,
634 .flags = IORESOURCE_IRQ,
635 },
636#endif
637};
638
639static struct resource resources_sdc2[] = {
640 {
641 .name = "core_mem",
642 .flags = IORESOURCE_MEM,
643 .start = MSM_SDC2_BASE,
644 .end = MSM_SDC2_DML_BASE - 1,
645 },
646 {
647 .name = "core_irq",
648 .flags = IORESOURCE_IRQ,
649 .start = SDC2_IRQ_0,
650 .end = SDC2_IRQ_0
651 },
652#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
653 {
654 .name = "sdcc_dml_addr",
655 .start = MSM_SDC2_DML_BASE,
656 .end = MSM_SDC2_BAM_BASE - 1,
657 .flags = IORESOURCE_MEM,
658 },
659 {
660 .name = "sdcc_bam_addr",
661 .start = MSM_SDC2_BAM_BASE,
662 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
663 .flags = IORESOURCE_MEM,
664 },
665 {
666 .name = "sdcc_bam_irq",
667 .start = SDC2_BAM_IRQ,
668 .end = SDC2_BAM_IRQ,
669 .flags = IORESOURCE_IRQ,
670 },
671#endif
672};
673
674static struct resource resources_sdc3[] = {
675 {
676 .name = "core_mem",
677 .flags = IORESOURCE_MEM,
678 .start = MSM_SDC3_BASE,
679 .end = MSM_SDC3_DML_BASE - 1,
680 },
681 {
682 .name = "core_irq",
683 .flags = IORESOURCE_IRQ,
684 .start = SDC3_IRQ_0,
685 .end = SDC3_IRQ_0
686 },
687#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
688 {
689 .name = "sdcc_dml_addr",
690 .start = MSM_SDC3_DML_BASE,
691 .end = MSM_SDC3_BAM_BASE - 1,
692 .flags = IORESOURCE_MEM,
693 },
694 {
695 .name = "sdcc_bam_addr",
696 .start = MSM_SDC3_BAM_BASE,
697 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
698 .flags = IORESOURCE_MEM,
699 },
700 {
701 .name = "sdcc_bam_irq",
702 .start = SDC3_BAM_IRQ,
703 .end = SDC3_BAM_IRQ,
704 .flags = IORESOURCE_IRQ,
705 },
706#endif
707};
708
709static struct resource resources_sdc4[] = {
710 {
711 .name = "core_mem",
712 .flags = IORESOURCE_MEM,
713 .start = MSM_SDC4_BASE,
714 .end = MSM_SDC4_DML_BASE - 1,
715 },
716 {
717 .name = "core_irq",
718 .flags = IORESOURCE_IRQ,
719 .start = SDC4_IRQ_0,
720 .end = SDC4_IRQ_0
721 },
722#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
723 {
724 .name = "sdcc_dml_addr",
725 .start = MSM_SDC4_DML_BASE,
726 .end = MSM_SDC4_BAM_BASE - 1,
727 .flags = IORESOURCE_MEM,
728 },
729 {
730 .name = "sdcc_bam_addr",
731 .start = MSM_SDC4_BAM_BASE,
732 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
733 .flags = IORESOURCE_MEM,
734 },
735 {
736 .name = "sdcc_bam_irq",
737 .start = SDC4_BAM_IRQ,
738 .end = SDC4_BAM_IRQ,
739 .flags = IORESOURCE_IRQ,
740 },
741#endif
742};
743
744static struct resource resources_sdc5[] = {
745 {
746 .name = "core_mem",
747 .flags = IORESOURCE_MEM,
748 .start = MSM_SDC5_BASE,
749 .end = MSM_SDC5_DML_BASE - 1,
750 },
751 {
752 .name = "core_irq",
753 .flags = IORESOURCE_IRQ,
754 .start = SDC5_IRQ_0,
755 .end = SDC5_IRQ_0
756 },
757#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
758 {
759 .name = "sdcc_dml_addr",
760 .start = MSM_SDC5_DML_BASE,
761 .end = MSM_SDC5_BAM_BASE - 1,
762 .flags = IORESOURCE_MEM,
763 },
764 {
765 .name = "sdcc_bam_addr",
766 .start = MSM_SDC5_BAM_BASE,
767 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
768 .flags = IORESOURCE_MEM,
769 },
770 {
771 .name = "sdcc_bam_irq",
772 .start = SDC5_BAM_IRQ,
773 .end = SDC5_BAM_IRQ,
774 .flags = IORESOURCE_IRQ,
775 },
776#endif
777};
778
779struct platform_device msm_device_sdc1 = {
780 .name = "msm_sdcc",
781 .id = 1,
782 .num_resources = ARRAY_SIZE(resources_sdc1),
783 .resource = resources_sdc1,
784 .dev = {
785 .coherent_dma_mask = 0xffffffff,
786 },
787};
788
789struct platform_device msm_device_sdc2 = {
790 .name = "msm_sdcc",
791 .id = 2,
792 .num_resources = ARRAY_SIZE(resources_sdc2),
793 .resource = resources_sdc2,
794 .dev = {
795 .coherent_dma_mask = 0xffffffff,
796 },
797};
798
799struct platform_device msm_device_sdc3 = {
800 .name = "msm_sdcc",
801 .id = 3,
802 .num_resources = ARRAY_SIZE(resources_sdc3),
803 .resource = resources_sdc3,
804 .dev = {
805 .coherent_dma_mask = 0xffffffff,
806 },
807};
808
809struct platform_device msm_device_sdc4 = {
810 .name = "msm_sdcc",
811 .id = 4,
812 .num_resources = ARRAY_SIZE(resources_sdc4),
813 .resource = resources_sdc4,
814 .dev = {
815 .coherent_dma_mask = 0xffffffff,
816 },
817};
818
819struct platform_device msm_device_sdc5 = {
820 .name = "msm_sdcc",
821 .id = 5,
822 .num_resources = ARRAY_SIZE(resources_sdc5),
823 .resource = resources_sdc5,
824 .dev = {
825 .coherent_dma_mask = 0xffffffff,
826 },
827};
828
Stephen Boydeb819882011-08-29 14:46:30 -0700829#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
830#define SFAB_LPASS_Q6_ACLK_CTL (MSM_CLK_CTL_BASE + 0x23A0)
831
832static struct resource msm_8960_q6_lpass_resources[] = {
833 {
834 .start = MSM_LPASS_QDSP6SS_PHYS,
835 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
836 .flags = IORESOURCE_MEM,
837 },
838};
839
840static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
841 .strap_tcm_base = 0x01460000,
842 .strap_ahb_upper = 0x00290000,
843 .strap_ahb_lower = 0x00000280,
844 .aclk_reg = SFAB_LPASS_Q6_ACLK_CTL,
845 .name = "q6",
846 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700847 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700848};
849
850struct platform_device msm_8960_q6_lpass = {
851 .name = "pil_qdsp6v4",
852 .id = 0,
853 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
854 .resource = msm_8960_q6_lpass_resources,
855 .dev.platform_data = &msm_8960_q6_lpass_data,
856};
857
858#define MSM_MSS_ENABLE_PHYS 0x08B00000
859#define MSM_FW_QDSP6SS_PHYS 0x08800000
860#define MSS_Q6FW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C6C)
861#define SFAB_MSS_Q6_FW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2044)
862
863static struct resource msm_8960_q6_mss_fw_resources[] = {
864 {
865 .start = MSM_FW_QDSP6SS_PHYS,
866 .end = MSM_FW_QDSP6SS_PHYS + SZ_256 - 1,
867 .flags = IORESOURCE_MEM,
868 },
869 {
870 .start = MSM_MSS_ENABLE_PHYS,
871 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
872 .flags = IORESOURCE_MEM,
873 },
874};
875
876static struct pil_q6v4_pdata msm_8960_q6_mss_fw_data = {
877 .strap_tcm_base = 0x00400000,
878 .strap_ahb_upper = 0x00090000,
879 .strap_ahb_lower = 0x00000080,
880 .aclk_reg = SFAB_MSS_Q6_FW_ACLK_CTL,
881 .jtag_clk_reg = MSS_Q6FW_JTAG_CLK_CTL,
882 .name = "modem_fw",
883 .depends = "q6",
884 .pas_id = PAS_MODEM_FW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700885 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700886};
887
888struct platform_device msm_8960_q6_mss_fw = {
889 .name = "pil_qdsp6v4",
890 .id = 1,
891 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_fw_resources),
892 .resource = msm_8960_q6_mss_fw_resources,
893 .dev.platform_data = &msm_8960_q6_mss_fw_data,
894};
895
896#define MSM_SW_QDSP6SS_PHYS 0x08900000
897#define SFAB_MSS_Q6_SW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2040)
898#define MSS_Q6SW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C68)
899
900static struct resource msm_8960_q6_mss_sw_resources[] = {
901 {
902 .start = MSM_SW_QDSP6SS_PHYS,
903 .end = MSM_SW_QDSP6SS_PHYS + SZ_256 - 1,
904 .flags = IORESOURCE_MEM,
905 },
906 {
907 .start = MSM_MSS_ENABLE_PHYS,
908 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
909 .flags = IORESOURCE_MEM,
910 },
911};
912
913static struct pil_q6v4_pdata msm_8960_q6_mss_sw_data = {
914 .strap_tcm_base = 0x00420000,
915 .strap_ahb_upper = 0x00090000,
916 .strap_ahb_lower = 0x00000080,
917 .aclk_reg = SFAB_MSS_Q6_SW_ACLK_CTL,
918 .jtag_clk_reg = MSS_Q6SW_JTAG_CLK_CTL,
919 .name = "modem",
920 .depends = "modem_fw",
921 .pas_id = PAS_MODEM_SW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700922 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700923};
924
925struct platform_device msm_8960_q6_mss_sw = {
926 .name = "pil_qdsp6v4",
927 .id = 2,
928 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_sw_resources),
929 .resource = msm_8960_q6_mss_sw_resources,
930 .dev.platform_data = &msm_8960_q6_mss_sw_data,
931};
932
Stephen Boyd322a9922011-09-20 01:05:54 -0700933static struct resource msm_8960_riva_resources[] = {
934 {
935 .start = 0x03204000,
936 .end = 0x03204000 + SZ_256 - 1,
937 .flags = IORESOURCE_MEM,
938 },
939};
940
941struct platform_device msm_8960_riva = {
942 .name = "pil_riva",
943 .id = -1,
944 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
945 .resource = msm_8960_riva_resources,
946};
947
Stephen Boydd89eebe2011-09-28 23:28:11 -0700948struct platform_device msm_pil_tzapps = {
949 .name = "pil_tzapps",
950 .id = -1,
951};
952
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700953struct platform_device msm_device_smd = {
954 .name = "msm_smd",
955 .id = -1,
956};
957
958struct platform_device msm_device_bam_dmux = {
959 .name = "BAM_RMNT",
960 .id = -1,
961};
962
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700963static struct msm_watchdog_pdata msm_watchdog_pdata = {
964 .pet_time = 10000,
965 .bark_time = 11000,
966 .has_secure = true,
967};
968
969struct platform_device msm8960_device_watchdog = {
970 .name = "msm_watchdog",
971 .id = -1,
972 .dev = {
973 .platform_data = &msm_watchdog_pdata,
974 },
975};
976
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700977static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700978 {
979 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700980 .flags = IORESOURCE_IRQ,
981 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700982 {
983 .start = 0x18320000,
984 .end = 0x18320000 + SZ_1M - 1,
985 .flags = IORESOURCE_MEM,
986 },
987};
988
989static struct msm_dmov_pdata msm_dmov_pdata = {
990 .sd = 1,
991 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992};
993
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700994struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700995 .name = "msm_dmov",
996 .id = -1,
997 .resource = msm_dmov_resource,
998 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700999 .dev = {
1000 .platform_data = &msm_dmov_pdata,
1001 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001002};
1003
1004static struct platform_device *msm_sdcc_devices[] __initdata = {
1005 &msm_device_sdc1,
1006 &msm_device_sdc2,
1007 &msm_device_sdc3,
1008 &msm_device_sdc4,
1009 &msm_device_sdc5,
1010};
1011
1012int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1013{
1014 struct platform_device *pdev;
1015
1016 if (controller < 1 || controller > 5)
1017 return -EINVAL;
1018
1019 pdev = msm_sdcc_devices[controller-1];
1020 pdev->dev.platform_data = plat;
1021 return platform_device_register(pdev);
1022}
1023
1024static struct resource resources_qup_i2c_gsbi4[] = {
1025 {
1026 .name = "gsbi_qup_i2c_addr",
1027 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001028 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001029 .flags = IORESOURCE_MEM,
1030 },
1031 {
1032 .name = "qup_phys_addr",
1033 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001034 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001035 .flags = IORESOURCE_MEM,
1036 },
1037 {
1038 .name = "qup_err_intr",
1039 .start = GSBI4_QUP_IRQ,
1040 .end = GSBI4_QUP_IRQ,
1041 .flags = IORESOURCE_IRQ,
1042 },
1043};
1044
1045struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1046 .name = "qup_i2c",
1047 .id = 4,
1048 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1049 .resource = resources_qup_i2c_gsbi4,
1050};
1051
1052static struct resource resources_qup_i2c_gsbi3[] = {
1053 {
1054 .name = "gsbi_qup_i2c_addr",
1055 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001056 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001057 .flags = IORESOURCE_MEM,
1058 },
1059 {
1060 .name = "qup_phys_addr",
1061 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001062 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001063 .flags = IORESOURCE_MEM,
1064 },
1065 {
1066 .name = "qup_err_intr",
1067 .start = GSBI3_QUP_IRQ,
1068 .end = GSBI3_QUP_IRQ,
1069 .flags = IORESOURCE_IRQ,
1070 },
1071};
1072
1073struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1074 .name = "qup_i2c",
1075 .id = 3,
1076 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1077 .resource = resources_qup_i2c_gsbi3,
1078};
1079
1080static struct resource resources_qup_i2c_gsbi10[] = {
1081 {
1082 .name = "gsbi_qup_i2c_addr",
1083 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001084 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001085 .flags = IORESOURCE_MEM,
1086 },
1087 {
1088 .name = "qup_phys_addr",
1089 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001090 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001091 .flags = IORESOURCE_MEM,
1092 },
1093 {
1094 .name = "qup_err_intr",
1095 .start = GSBI10_QUP_IRQ,
1096 .end = GSBI10_QUP_IRQ,
1097 .flags = IORESOURCE_IRQ,
1098 },
1099};
1100
1101struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1102 .name = "qup_i2c",
1103 .id = 10,
1104 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1105 .resource = resources_qup_i2c_gsbi10,
1106};
1107
1108static struct resource resources_qup_i2c_gsbi12[] = {
1109 {
1110 .name = "gsbi_qup_i2c_addr",
1111 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001112 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001113 .flags = IORESOURCE_MEM,
1114 },
1115 {
1116 .name = "qup_phys_addr",
1117 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001118 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001119 .flags = IORESOURCE_MEM,
1120 },
1121 {
1122 .name = "qup_err_intr",
1123 .start = GSBI12_QUP_IRQ,
1124 .end = GSBI12_QUP_IRQ,
1125 .flags = IORESOURCE_IRQ,
1126 },
1127};
1128
1129struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1130 .name = "qup_i2c",
1131 .id = 12,
1132 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1133 .resource = resources_qup_i2c_gsbi12,
1134};
1135
1136#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001137static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001138 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001139 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301140 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001141 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301142 .flags = IORESOURCE_MEM,
1143 },
1144 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001145 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301146 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001147 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301148 .flags = IORESOURCE_MEM,
1149 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001150};
1151
Kevin Chanbb8ef862012-02-14 13:03:04 -08001152struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1153 .name = "msm_cam_i2c_mux",
1154 .id = 0,
1155 .resource = msm_cam_gsbi4_i2c_mux_resources,
1156 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1157};
Kevin Chanf6216f22011-10-25 18:40:11 -07001158
1159static struct resource msm_csiphy0_resources[] = {
1160 {
1161 .name = "csiphy",
1162 .start = 0x04800C00,
1163 .end = 0x04800C00 + SZ_1K - 1,
1164 .flags = IORESOURCE_MEM,
1165 },
1166 {
1167 .name = "csiphy",
1168 .start = CSIPHY_4LN_IRQ,
1169 .end = CSIPHY_4LN_IRQ,
1170 .flags = IORESOURCE_IRQ,
1171 },
1172};
1173
1174static struct resource msm_csiphy1_resources[] = {
1175 {
1176 .name = "csiphy",
1177 .start = 0x04801000,
1178 .end = 0x04801000 + SZ_1K - 1,
1179 .flags = IORESOURCE_MEM,
1180 },
1181 {
1182 .name = "csiphy",
1183 .start = MSM8960_CSIPHY_2LN_IRQ,
1184 .end = MSM8960_CSIPHY_2LN_IRQ,
1185 .flags = IORESOURCE_IRQ,
1186 },
1187};
1188
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001189static struct resource msm_csiphy2_resources[] = {
1190 {
1191 .name = "csiphy",
1192 .start = 0x04801400,
1193 .end = 0x04801400 + SZ_1K - 1,
1194 .flags = IORESOURCE_MEM,
1195 },
1196 {
1197 .name = "csiphy",
1198 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1199 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1200 .flags = IORESOURCE_IRQ,
1201 },
1202};
1203
Kevin Chanf6216f22011-10-25 18:40:11 -07001204struct platform_device msm8960_device_csiphy0 = {
1205 .name = "msm_csiphy",
1206 .id = 0,
1207 .resource = msm_csiphy0_resources,
1208 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
1209};
1210
1211struct platform_device msm8960_device_csiphy1 = {
1212 .name = "msm_csiphy",
1213 .id = 1,
1214 .resource = msm_csiphy1_resources,
1215 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
1216};
Kevin Chanc8b52e82011-10-25 23:20:21 -07001217
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001218struct platform_device msm8960_device_csiphy2 = {
1219 .name = "msm_csiphy",
1220 .id = 2,
1221 .resource = msm_csiphy2_resources,
1222 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
1223};
1224
Kevin Chanc8b52e82011-10-25 23:20:21 -07001225static struct resource msm_csid0_resources[] = {
1226 {
1227 .name = "csid",
1228 .start = 0x04800000,
1229 .end = 0x04800000 + SZ_1K - 1,
1230 .flags = IORESOURCE_MEM,
1231 },
1232 {
1233 .name = "csid",
1234 .start = CSI_0_IRQ,
1235 .end = CSI_0_IRQ,
1236 .flags = IORESOURCE_IRQ,
1237 },
1238};
1239
1240static struct resource msm_csid1_resources[] = {
1241 {
1242 .name = "csid",
1243 .start = 0x04800400,
1244 .end = 0x04800400 + SZ_1K - 1,
1245 .flags = IORESOURCE_MEM,
1246 },
1247 {
1248 .name = "csid",
1249 .start = CSI_1_IRQ,
1250 .end = CSI_1_IRQ,
1251 .flags = IORESOURCE_IRQ,
1252 },
1253};
1254
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001255static struct resource msm_csid2_resources[] = {
1256 {
1257 .name = "csid",
1258 .start = 0x04801800,
1259 .end = 0x04801800 + SZ_1K - 1,
1260 .flags = IORESOURCE_MEM,
1261 },
1262 {
1263 .name = "csid",
1264 .start = CSI_2_IRQ,
1265 .end = CSI_2_IRQ,
1266 .flags = IORESOURCE_IRQ,
1267 },
1268};
1269
Kevin Chanc8b52e82011-10-25 23:20:21 -07001270struct platform_device msm8960_device_csid0 = {
1271 .name = "msm_csid",
1272 .id = 0,
1273 .resource = msm_csid0_resources,
1274 .num_resources = ARRAY_SIZE(msm_csid0_resources),
1275};
1276
1277struct platform_device msm8960_device_csid1 = {
1278 .name = "msm_csid",
1279 .id = 1,
1280 .resource = msm_csid1_resources,
1281 .num_resources = ARRAY_SIZE(msm_csid1_resources),
1282};
Kevin Chane12c6672011-10-26 11:55:26 -07001283
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001284struct platform_device msm8960_device_csid2 = {
1285 .name = "msm_csid",
1286 .id = 2,
1287 .resource = msm_csid2_resources,
1288 .num_resources = ARRAY_SIZE(msm_csid2_resources),
1289};
1290
Kevin Chane12c6672011-10-26 11:55:26 -07001291struct resource msm_ispif_resources[] = {
1292 {
1293 .name = "ispif",
1294 .start = 0x04800800,
1295 .end = 0x04800800 + SZ_1K - 1,
1296 .flags = IORESOURCE_MEM,
1297 },
1298 {
1299 .name = "ispif",
1300 .start = ISPIF_IRQ,
1301 .end = ISPIF_IRQ,
1302 .flags = IORESOURCE_IRQ,
1303 },
1304};
1305
1306struct platform_device msm8960_device_ispif = {
1307 .name = "msm_ispif",
1308 .id = 0,
1309 .resource = msm_ispif_resources,
1310 .num_resources = ARRAY_SIZE(msm_ispif_resources),
1311};
Kevin Chan5827c552011-10-28 18:36:32 -07001312
1313static struct resource msm_vfe_resources[] = {
1314 {
1315 .name = "vfe32",
1316 .start = 0x04500000,
1317 .end = 0x04500000 + SZ_1M - 1,
1318 .flags = IORESOURCE_MEM,
1319 },
1320 {
1321 .name = "vfe32",
1322 .start = VFE_IRQ,
1323 .end = VFE_IRQ,
1324 .flags = IORESOURCE_IRQ,
1325 },
1326};
1327
1328struct platform_device msm8960_device_vfe = {
1329 .name = "msm_vfe",
1330 .id = 0,
1331 .resource = msm_vfe_resources,
1332 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1333};
Kevin Chana0853122011-11-07 19:48:44 -08001334
1335static struct resource msm_vpe_resources[] = {
1336 {
1337 .name = "vpe",
1338 .start = 0x05300000,
1339 .end = 0x05300000 + SZ_1M - 1,
1340 .flags = IORESOURCE_MEM,
1341 },
1342 {
1343 .name = "vpe",
1344 .start = VPE_IRQ,
1345 .end = VPE_IRQ,
1346 .flags = IORESOURCE_IRQ,
1347 },
1348};
1349
1350struct platform_device msm8960_device_vpe = {
1351 .name = "msm_vpe",
1352 .id = 0,
1353 .resource = msm_vpe_resources,
1354 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1355};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001356#endif
1357
Jay Chokshi33c044a2011-12-07 13:05:40 -08001358static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001359 {
1360 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1361 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1362 .flags = IORESOURCE_MEM,
1363 },
1364};
1365
Jay Chokshi33c044a2011-12-07 13:05:40 -08001366struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001367 .name = "msm_ssbi",
1368 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08001369 .resource = resources_ssbi_pmic,
1370 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001371};
1372
1373static struct resource resources_qup_spi_gsbi1[] = {
1374 {
1375 .name = "spi_base",
1376 .start = MSM_GSBI1_QUP_PHYS,
1377 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1378 .flags = IORESOURCE_MEM,
1379 },
1380 {
1381 .name = "gsbi_base",
1382 .start = MSM_GSBI1_PHYS,
1383 .end = MSM_GSBI1_PHYS + 4 - 1,
1384 .flags = IORESOURCE_MEM,
1385 },
1386 {
1387 .name = "spi_irq_in",
1388 .start = MSM8960_GSBI1_QUP_IRQ,
1389 .end = MSM8960_GSBI1_QUP_IRQ,
1390 .flags = IORESOURCE_IRQ,
1391 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001392 {
1393 .name = "spi_clk",
1394 .start = 9,
1395 .end = 9,
1396 .flags = IORESOURCE_IO,
1397 },
1398 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001399 .name = "spi_miso",
1400 .start = 7,
1401 .end = 7,
1402 .flags = IORESOURCE_IO,
1403 },
1404 {
1405 .name = "spi_mosi",
1406 .start = 6,
1407 .end = 6,
1408 .flags = IORESOURCE_IO,
1409 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07001410 {
1411 .name = "spi_cs",
1412 .start = 8,
1413 .end = 8,
1414 .flags = IORESOURCE_IO,
1415 },
1416 {
1417 .name = "spi_cs1",
1418 .start = 14,
1419 .end = 14,
1420 .flags = IORESOURCE_IO,
1421 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001422};
1423
1424struct platform_device msm8960_device_qup_spi_gsbi1 = {
1425 .name = "spi_qsd",
1426 .id = 0,
1427 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1428 .resource = resources_qup_spi_gsbi1,
1429};
1430
1431struct platform_device msm_pcm = {
1432 .name = "msm-pcm-dsp",
1433 .id = -1,
1434};
1435
Kiran Kandi5e809b02012-01-31 00:24:33 -08001436struct platform_device msm_multi_ch_pcm = {
1437 .name = "msm-multi-ch-pcm-dsp",
1438 .id = -1,
1439};
1440
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001441struct platform_device msm_pcm_routing = {
1442 .name = "msm-pcm-routing",
1443 .id = -1,
1444};
1445
1446struct platform_device msm_cpudai0 = {
1447 .name = "msm-dai-q6",
1448 .id = 0x4000,
1449};
1450
1451struct platform_device msm_cpudai1 = {
1452 .name = "msm-dai-q6",
1453 .id = 0x4001,
1454};
1455
1456struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001457 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001458 .id = 8,
1459};
1460
1461struct platform_device msm_cpudai_bt_rx = {
1462 .name = "msm-dai-q6",
1463 .id = 0x3000,
1464};
1465
1466struct platform_device msm_cpudai_bt_tx = {
1467 .name = "msm-dai-q6",
1468 .id = 0x3001,
1469};
1470
1471struct platform_device msm_cpudai_fm_rx = {
1472 .name = "msm-dai-q6",
1473 .id = 0x3004,
1474};
1475
1476struct platform_device msm_cpudai_fm_tx = {
1477 .name = "msm-dai-q6",
1478 .id = 0x3005,
1479};
1480
Helen Zeng0705a5f2011-10-14 15:29:52 -07001481struct platform_device msm_cpudai_incall_music_rx = {
1482 .name = "msm-dai-q6",
1483 .id = 0x8005,
1484};
1485
Helen Zenge3d716a2011-10-14 16:32:16 -07001486struct platform_device msm_cpudai_incall_record_rx = {
1487 .name = "msm-dai-q6",
1488 .id = 0x8004,
1489};
1490
1491struct platform_device msm_cpudai_incall_record_tx = {
1492 .name = "msm-dai-q6",
1493 .id = 0x8003,
1494};
1495
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001496/*
1497 * Machine specific data for AUX PCM Interface
1498 * which the driver will be unware of.
1499 */
1500struct msm_dai_auxpcm_pdata auxpcm_rx_pdata = {
1501 .clk = "pcm_clk",
1502 .mode = AFE_PCM_CFG_MODE_PCM,
1503 .sync = AFE_PCM_CFG_SYNC_INT,
1504 .frame = AFE_PCM_CFG_FRM_256BPF,
1505 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1506 .slot = 0,
1507 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1508 .pcm_clk_rate = 2048000,
1509};
1510
1511struct platform_device msm_cpudai_auxpcm_rx = {
1512 .name = "msm-dai-q6",
1513 .id = 2,
1514 .dev = {
1515 .platform_data = &auxpcm_rx_pdata,
1516 },
1517};
1518
1519struct platform_device msm_cpudai_auxpcm_tx = {
1520 .name = "msm-dai-q6",
1521 .id = 3,
1522};
1523
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001524struct platform_device msm_cpu_fe = {
1525 .name = "msm-dai-fe",
1526 .id = -1,
1527};
1528
1529struct platform_device msm_stub_codec = {
1530 .name = "msm-stub-codec",
1531 .id = 1,
1532};
1533
1534struct platform_device msm_voice = {
1535 .name = "msm-pcm-voice",
1536 .id = -1,
1537};
1538
1539struct platform_device msm_voip = {
1540 .name = "msm-voip-dsp",
1541 .id = -1,
1542};
1543
1544struct platform_device msm_lpa_pcm = {
1545 .name = "msm-pcm-lpa",
1546 .id = -1,
1547};
1548
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301549struct platform_device msm_compr_dsp = {
1550 .name = "msm-compr-dsp",
1551 .id = -1,
1552};
1553
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001554struct platform_device msm_pcm_hostless = {
1555 .name = "msm-pcm-hostless",
1556 .id = -1,
1557};
1558
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301559struct platform_device msm_cpudai_afe_01_rx = {
1560 .name = "msm-dai-q6",
1561 .id = 0xE0,
1562};
1563
1564struct platform_device msm_cpudai_afe_01_tx = {
1565 .name = "msm-dai-q6",
1566 .id = 0xF0,
1567};
1568
1569struct platform_device msm_cpudai_afe_02_rx = {
1570 .name = "msm-dai-q6",
1571 .id = 0xF1,
1572};
1573
1574struct platform_device msm_cpudai_afe_02_tx = {
1575 .name = "msm-dai-q6",
1576 .id = 0xE1,
1577};
1578
1579struct platform_device msm_pcm_afe = {
1580 .name = "msm-pcm-afe",
1581 .id = -1,
1582};
1583
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001584struct platform_device *msm_footswitch_devices[] = {
Ravishangar Kalyanamb31a0e42012-01-19 16:02:34 -08001585 FS_8X60(FS_MDP, "fs_mdp"),
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001586 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001587 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1588 FS_8X60(FS_VFE, "fs_vfe"),
1589 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001590 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1591 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1592 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001593 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001594};
1595unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1596
1597#ifdef CONFIG_MSM_ROTATOR
1598#define ROTATOR_HW_BASE 0x04E00000
1599static struct resource resources_msm_rotator[] = {
1600 {
1601 .start = ROTATOR_HW_BASE,
1602 .end = ROTATOR_HW_BASE + 0x100000 - 1,
1603 .flags = IORESOURCE_MEM,
1604 },
1605 {
1606 .start = ROT_IRQ,
1607 .end = ROT_IRQ,
1608 .flags = IORESOURCE_IRQ,
1609 },
1610};
1611
1612static struct msm_rot_clocks rotator_clocks[] = {
1613 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001614 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001615 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07001616 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001617 },
1618 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001619 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001620 .clk_type = ROTATOR_PCLK,
1621 .clk_rate = 0,
1622 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001623};
1624
1625static struct msm_rotator_platform_data rotator_pdata = {
1626 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1627 .hardware_version_number = 0x01020309,
1628 .rotator_clks = rotator_clocks,
1629 .regulator_name = "fs_rot",
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08001630#ifdef CONFIG_MSM_BUS_SCALING
1631 .bus_scale_table = &rotator_bus_scale_pdata,
1632#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001633};
1634
1635struct platform_device msm_rotator_device = {
1636 .name = "msm_rotator",
1637 .id = 0,
1638 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1639 .resource = resources_msm_rotator,
1640 .dev = {
1641 .platform_data = &rotator_pdata,
1642 },
1643};
1644#endif
1645
1646#define MIPI_DSI_HW_BASE 0x04700000
1647#define MDP_HW_BASE 0x05100000
1648
1649static struct resource msm_mipi_dsi1_resources[] = {
1650 {
1651 .name = "mipi_dsi",
1652 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001653 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001654 .flags = IORESOURCE_MEM,
1655 },
1656 {
1657 .start = DSI1_IRQ,
1658 .end = DSI1_IRQ,
1659 .flags = IORESOURCE_IRQ,
1660 },
1661};
1662
1663struct platform_device msm_mipi_dsi1_device = {
1664 .name = "mipi_dsi",
1665 .id = 1,
1666 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
1667 .resource = msm_mipi_dsi1_resources,
1668};
1669
1670static struct resource msm_mdp_resources[] = {
1671 {
1672 .name = "mdp",
1673 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001674 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001675 .flags = IORESOURCE_MEM,
1676 },
1677 {
1678 .start = MDP_IRQ,
1679 .end = MDP_IRQ,
1680 .flags = IORESOURCE_IRQ,
1681 },
1682};
1683
1684static struct platform_device msm_mdp_device = {
1685 .name = "mdp",
1686 .id = 0,
1687 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1688 .resource = msm_mdp_resources,
1689};
1690
1691static void __init msm_register_device(struct platform_device *pdev, void *data)
1692{
1693 int ret;
1694
1695 pdev->dev.platform_data = data;
1696 ret = platform_device_register(pdev);
1697 if (ret)
1698 dev_err(&pdev->dev,
1699 "%s: platform_device_register() failed = %d\n",
1700 __func__, ret);
1701}
1702
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001703#ifdef CONFIG_MSM_BUS_SCALING
1704static struct platform_device msm_dtv_device = {
1705 .name = "dtv",
1706 .id = 0,
1707};
1708#endif
1709
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08001710struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08001711 .name = "lvds",
1712 .id = 0,
1713};
1714
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001715void __init msm_fb_register_device(char *name, void *data)
1716{
1717 if (!strncmp(name, "mdp", 3))
1718 msm_register_device(&msm_mdp_device, data);
1719 else if (!strncmp(name, "mipi_dsi", 8))
1720 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08001721 else if (!strncmp(name, "lvds", 4))
1722 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001723#ifdef CONFIG_MSM_BUS_SCALING
1724 else if (!strncmp(name, "dtv", 3))
1725 msm_register_device(&msm_dtv_device, data);
1726#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001727 else
1728 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1729}
1730
1731static struct resource resources_sps[] = {
1732 {
1733 .name = "pipe_mem",
1734 .start = 0x12800000,
1735 .end = 0x12800000 + 0x4000 - 1,
1736 .flags = IORESOURCE_MEM,
1737 },
1738 {
1739 .name = "bamdma_dma",
1740 .start = 0x12240000,
1741 .end = 0x12240000 + 0x1000 - 1,
1742 .flags = IORESOURCE_MEM,
1743 },
1744 {
1745 .name = "bamdma_bam",
1746 .start = 0x12244000,
1747 .end = 0x12244000 + 0x4000 - 1,
1748 .flags = IORESOURCE_MEM,
1749 },
1750 {
1751 .name = "bamdma_irq",
1752 .start = SPS_BAM_DMA_IRQ,
1753 .end = SPS_BAM_DMA_IRQ,
1754 .flags = IORESOURCE_IRQ,
1755 },
1756};
1757
1758struct msm_sps_platform_data msm_sps_pdata = {
1759 .bamdma_restricted_pipes = 0x06,
1760};
1761
1762struct platform_device msm_device_sps = {
1763 .name = "msm_sps",
1764 .id = -1,
1765 .num_resources = ARRAY_SIZE(resources_sps),
1766 .resource = resources_sps,
1767 .dev.platform_data = &msm_sps_pdata,
1768};
1769
1770#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06001771static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001772 [1] = MSM_GPIO_TO_INT(46),
1773 [2] = MSM_GPIO_TO_INT(150),
1774 [4] = MSM_GPIO_TO_INT(103),
1775 [5] = MSM_GPIO_TO_INT(104),
1776 [6] = MSM_GPIO_TO_INT(105),
1777 [7] = MSM_GPIO_TO_INT(106),
1778 [8] = MSM_GPIO_TO_INT(107),
1779 [9] = MSM_GPIO_TO_INT(7),
1780 [10] = MSM_GPIO_TO_INT(11),
1781 [11] = MSM_GPIO_TO_INT(15),
1782 [12] = MSM_GPIO_TO_INT(19),
1783 [13] = MSM_GPIO_TO_INT(23),
1784 [14] = MSM_GPIO_TO_INT(27),
1785 [15] = MSM_GPIO_TO_INT(31),
1786 [16] = MSM_GPIO_TO_INT(35),
1787 [19] = MSM_GPIO_TO_INT(90),
1788 [20] = MSM_GPIO_TO_INT(92),
1789 [23] = MSM_GPIO_TO_INT(85),
1790 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001791 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001792 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001793 [29] = MSM_GPIO_TO_INT(10),
1794 [30] = MSM_GPIO_TO_INT(102),
1795 [31] = MSM_GPIO_TO_INT(81),
1796 [32] = MSM_GPIO_TO_INT(78),
1797 [33] = MSM_GPIO_TO_INT(94),
1798 [34] = MSM_GPIO_TO_INT(72),
1799 [35] = MSM_GPIO_TO_INT(39),
1800 [36] = MSM_GPIO_TO_INT(43),
1801 [37] = MSM_GPIO_TO_INT(61),
1802 [38] = MSM_GPIO_TO_INT(50),
1803 [39] = MSM_GPIO_TO_INT(42),
1804 [41] = MSM_GPIO_TO_INT(62),
1805 [42] = MSM_GPIO_TO_INT(76),
1806 [43] = MSM_GPIO_TO_INT(75),
1807 [44] = MSM_GPIO_TO_INT(70),
1808 [45] = MSM_GPIO_TO_INT(69),
1809 [46] = MSM_GPIO_TO_INT(67),
1810 [47] = MSM_GPIO_TO_INT(65),
1811 [48] = MSM_GPIO_TO_INT(58),
1812 [49] = MSM_GPIO_TO_INT(54),
1813 [50] = MSM_GPIO_TO_INT(52),
1814 [51] = MSM_GPIO_TO_INT(49),
1815 [52] = MSM_GPIO_TO_INT(40),
1816 [53] = MSM_GPIO_TO_INT(37),
1817 [54] = MSM_GPIO_TO_INT(24),
1818 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001819};
1820
Praveen Chidambaram78499012011-11-01 17:15:17 -06001821static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001822 TLMM_MSM_SUMMARY_IRQ,
1823 RPM_APCC_CPU0_GP_HIGH_IRQ,
1824 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1825 RPM_APCC_CPU0_GP_LOW_IRQ,
1826 RPM_APCC_CPU0_WAKE_UP_IRQ,
1827 RPM_APCC_CPU1_GP_HIGH_IRQ,
1828 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1829 RPM_APCC_CPU1_GP_LOW_IRQ,
1830 RPM_APCC_CPU1_WAKE_UP_IRQ,
1831 MSS_TO_APPS_IRQ_0,
1832 MSS_TO_APPS_IRQ_1,
1833 MSS_TO_APPS_IRQ_2,
1834 MSS_TO_APPS_IRQ_3,
1835 MSS_TO_APPS_IRQ_4,
1836 MSS_TO_APPS_IRQ_5,
1837 MSS_TO_APPS_IRQ_6,
1838 MSS_TO_APPS_IRQ_7,
1839 MSS_TO_APPS_IRQ_8,
1840 MSS_TO_APPS_IRQ_9,
1841 LPASS_SCSS_GP_LOW_IRQ,
1842 LPASS_SCSS_GP_MEDIUM_IRQ,
1843 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07001844 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001845 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07001846 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07001847 RIVA_APPS_WLAN_SMSM_IRQ,
1848 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1849 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001850};
1851
Praveen Chidambaram78499012011-11-01 17:15:17 -06001852struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001853 .irqs_m2a = msm_mpm_irqs_m2a,
1854 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1855 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1856 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1857 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1858 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1859 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1860 .mpm_apps_ipc_val = BIT(1),
1861 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1862
1863};
1864#endif
1865
Stephen Boydbb600ae2011-08-02 20:11:40 -07001866static struct clk_lookup msm_clocks_8960_dummy[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001867 CLK_DUMMY("pll2", PLL2, NULL, 0),
1868 CLK_DUMMY("pll8", PLL8, NULL, 0),
1869 CLK_DUMMY("pll4", PLL4, NULL, 0),
1870
1871 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1872 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1873 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1874 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1875 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1876 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1877 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1878 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1879 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1880 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1881 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1882 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1883 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1884 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1885 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1886 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1887
Matt Wagantalle2522372011-08-17 14:52:21 -07001888 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
1889 CLK_DUMMY("core_clk", GSBI2_UART_CLK, "msm_serial_hsl.0", OFF),
1890 CLK_DUMMY("core_clk", GSBI3_UART_CLK, NULL, OFF),
1891 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
1892 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
1893 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
1894 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
1895 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
1896 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
1897 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
1898 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
1899 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001900 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
1901 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
1902 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, NULL, OFF),
1903 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
1904 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, NULL, OFF),
1905 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
1906 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
1907 CLK_DUMMY("core_clk", GSBI8_QUP_CLK, NULL, OFF),
1908 CLK_DUMMY("core_clk", GSBI9_QUP_CLK, NULL, OFF),
1909 CLK_DUMMY("core_clk", GSBI10_QUP_CLK, NULL, OFF),
1910 CLK_DUMMY("core_clk", GSBI11_QUP_CLK, NULL, OFF),
1911 CLK_DUMMY("core_clk", GSBI12_QUP_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001912 CLK_DUMMY("core_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07001913 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Matt Wagantallc1205292011-08-11 17:19:31 -07001914 CLK_DUMMY("core_clk", PRNG_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001915 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
1916 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
1917 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
1918 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
1919 CLK_DUMMY("core_clk", SDC5_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001920 CLK_DUMMY("core_clk", TSIF_REF_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001921 CLK_DUMMY("core_clk", TSSC_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08001922 CLK_DUMMY("alt_core_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1923 CLK_DUMMY("phy_clk", USB_PHY0_CLK, NULL, OFF),
1924 CLK_DUMMY("src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1925 CLK_DUMMY("alt_core_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1926 CLK_DUMMY("sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
1927 CLK_DUMMY("src_clk", USB_FS2_SRC_CLK, NULL, OFF),
1928 CLK_DUMMY("alt_core_clk", USB_FS2_XCVR_CLK, NULL, OFF),
1929 CLK_DUMMY("sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07001930 CLK_DUMMY("iface_clk", CE2_CLK, "qce.0", OFF),
1931 CLK_DUMMY("core_clk", CE1_CORE_CLK, "qce.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001932 CLK_DUMMY("iface_clk", GSBI1_P_CLK, "spi_qsd.0", OFF),
1933 CLK_DUMMY("iface_clk", GSBI2_P_CLK,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001934 "msm_serial_hsl.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001935 CLK_DUMMY("iface_clk", GSBI3_P_CLK, NULL, OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07001936 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001937 CLK_DUMMY("iface_clk", GSBI5_P_CLK, NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07001938 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001939 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
1940 CLK_DUMMY("iface_clk", GSBI8_P_CLK, NULL, OFF),
1941 CLK_DUMMY("iface_clk", GSBI9_P_CLK, NULL, OFF),
1942 CLK_DUMMY("iface_clk", GSBI10_P_CLK, NULL, OFF),
1943 CLK_DUMMY("iface_clk", GSBI11_P_CLK, NULL, OFF),
1944 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
1945 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001946 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08001947 CLK_DUMMY("iface_clk", USB_FS1_P_CLK, NULL, OFF),
1948 CLK_DUMMY("iface_clk", USB_FS2_P_CLK, NULL, OFF),
1949 CLK_DUMMY("iface_clk", USB_HS1_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001950 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
1951 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
1952 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
1953 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
1954 CLK_DUMMY("iface_clk", SDC5_P_CLK, NULL, OFF),
Matt Wagantalle1a86062011-08-18 17:46:10 -07001955 CLK_DUMMY("core_clk", ADM0_CLK, NULL, OFF),
1956 CLK_DUMMY("iface_clk", ADM0_P_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001957 CLK_DUMMY("iface_clk", PMIC_ARB0_P_CLK, NULL, OFF),
1958 CLK_DUMMY("iface_clk", PMIC_ARB1_P_CLK, NULL, OFF),
1959 CLK_DUMMY("core_clk", PMIC_SSBI2_CLK, NULL, OFF),
1960 CLK_DUMMY("mem_clk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1961 CLK_DUMMY("core_clk", AMP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001962 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1963 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1964 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1965 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1966 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1967 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1968 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1969 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1970 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1971 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1972 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1973 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
1974 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
1975 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
1976 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001977 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, OFF),
1978 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, OFF),
1979 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001980 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001981 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001982 CLK_DUMMY("core_clk", JPEGD_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001983 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1984 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1985 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001986 CLK_DUMMY("core_clk", ROT_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001987 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
1988 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
1989 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001990 CLK_DUMMY("core_clk", VCODEC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001991 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
1992 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
1993 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
1994 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1995 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1996 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1997 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1998 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1999 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002000 CLK_DUMMY("bus_clk", ROT_AXI_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002001 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
2002 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
2003 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
2004 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
2005 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
2006 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
2007 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
2008 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
2009 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
2010 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002011 CLK_DUMMY("iface_clk", GFX2D0_P_CLK, NULL, OFF),
2012 CLK_DUMMY("iface_clk", GFX2D1_P_CLK, NULL, OFF),
2013 CLK_DUMMY("iface_clk", GFX3D_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002014 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
2015 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
2016 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
2017 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002018 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002019 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002020 CLK_DUMMY("iface_clk", SMMU_P_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002021 CLK_DUMMY("iface_clk", ROT_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002022 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
2023 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
2024 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
2025 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
2026 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
2027 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
2028 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
2029 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
2030 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
2031 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
2032 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
2033 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
2034 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
2035 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
2036 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002037 CLK_DUMMY("core_clk", JPEGD_AXI_CLK, NULL, 0),
2038 CLK_DUMMY("core_clk", VFE_AXI_CLK, NULL, 0),
2039 CLK_DUMMY("core_clk", VCODEC_AXI_CLK, NULL, 0),
2040 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, 0),
2041 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, 0),
2042 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002043
2044 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
Manu Gautam5143b252012-01-05 19:25:23 -08002045 CLK_DUMMY("core_clk", DFAB_USB_HS_CLK, "msm_otg", NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002046 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
2047 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
2048 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
2049 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
2050 CLK_DUMMY("bus_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002051 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
2052 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
2053};
2054
Stephen Boydbb600ae2011-08-02 20:11:40 -07002055struct clock_init_data msm8960_dummy_clock_init_data __initdata = {
2056 .table = msm_clocks_8960_dummy,
2057 .size = ARRAY_SIZE(msm_clocks_8960_dummy),
2058};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002059
2060#define LPASS_SLIMBUS_PHYS 0x28080000
2061#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002062#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002063/* Board info for the slimbus slave device */
2064static struct resource slimbus_res[] = {
2065 {
2066 .start = LPASS_SLIMBUS_PHYS,
2067 .end = LPASS_SLIMBUS_PHYS + 8191,
2068 .flags = IORESOURCE_MEM,
2069 .name = "slimbus_physical",
2070 },
2071 {
2072 .start = LPASS_SLIMBUS_BAM_PHYS,
2073 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2074 .flags = IORESOURCE_MEM,
2075 .name = "slimbus_bam_physical",
2076 },
2077 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002078 .start = LPASS_SLIMBUS_SLEW,
2079 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2080 .flags = IORESOURCE_MEM,
2081 .name = "slimbus_slew_reg",
2082 },
2083 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002084 .start = SLIMBUS0_CORE_EE1_IRQ,
2085 .end = SLIMBUS0_CORE_EE1_IRQ,
2086 .flags = IORESOURCE_IRQ,
2087 .name = "slimbus_irq",
2088 },
2089 {
2090 .start = SLIMBUS0_BAM_EE1_IRQ,
2091 .end = SLIMBUS0_BAM_EE1_IRQ,
2092 .flags = IORESOURCE_IRQ,
2093 .name = "slimbus_bam_irq",
2094 },
2095};
2096
2097struct platform_device msm_slim_ctrl = {
2098 .name = "msm_slim_ctrl",
2099 .id = 1,
2100 .num_resources = ARRAY_SIZE(slimbus_res),
2101 .resource = slimbus_res,
2102 .dev = {
2103 .coherent_dma_mask = 0xffffffffULL,
2104 },
2105};
2106
2107#ifdef CONFIG_MSM_BUS_SCALING
2108static struct msm_bus_vectors grp3d_init_vectors[] = {
2109 {
2110 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2111 .dst = MSM_BUS_SLAVE_EBI_CH0,
2112 .ab = 0,
2113 .ib = 0,
2114 },
2115};
2116
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002117static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002118 {
2119 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2120 .dst = MSM_BUS_SLAVE_EBI_CH0,
2121 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002122 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002123 },
2124};
2125
2126static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2127 {
2128 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2129 .dst = MSM_BUS_SLAVE_EBI_CH0,
2130 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002131 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002132 },
2133};
2134
2135static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2136 {
2137 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2138 .dst = MSM_BUS_SLAVE_EBI_CH0,
2139 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002140 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002141 },
2142};
2143
2144static struct msm_bus_vectors grp3d_max_vectors[] = {
2145 {
2146 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2147 .dst = MSM_BUS_SLAVE_EBI_CH0,
2148 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002149 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002150 },
2151};
2152
2153static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2154 {
2155 ARRAY_SIZE(grp3d_init_vectors),
2156 grp3d_init_vectors,
2157 },
2158 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002159 ARRAY_SIZE(grp3d_low_vectors),
2160 grp3d_low_vectors,
2161 },
2162 {
2163 ARRAY_SIZE(grp3d_nominal_low_vectors),
2164 grp3d_nominal_low_vectors,
2165 },
2166 {
2167 ARRAY_SIZE(grp3d_nominal_high_vectors),
2168 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002169 },
2170 {
2171 ARRAY_SIZE(grp3d_max_vectors),
2172 grp3d_max_vectors,
2173 },
2174};
2175
2176static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2177 grp3d_bus_scale_usecases,
2178 ARRAY_SIZE(grp3d_bus_scale_usecases),
2179 .name = "grp3d",
2180};
2181
2182static struct msm_bus_vectors grp2d0_init_vectors[] = {
2183 {
2184 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2185 .dst = MSM_BUS_SLAVE_EBI_CH0,
2186 .ab = 0,
2187 .ib = 0,
2188 },
2189};
2190
Lucille Sylvester808eca22011-11-03 10:26:29 -07002191static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002192 {
2193 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2194 .dst = MSM_BUS_SLAVE_EBI_CH0,
2195 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002196 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002197 },
2198};
2199
Lucille Sylvester808eca22011-11-03 10:26:29 -07002200static struct msm_bus_vectors grp2d0_max_vectors[] = {
2201 {
2202 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2203 .dst = MSM_BUS_SLAVE_EBI_CH0,
2204 .ab = 0,
2205 .ib = KGSL_CONVERT_TO_MBPS(2048),
2206 },
2207};
2208
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002209static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2210 {
2211 ARRAY_SIZE(grp2d0_init_vectors),
2212 grp2d0_init_vectors,
2213 },
2214 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002215 ARRAY_SIZE(grp2d0_nominal_vectors),
2216 grp2d0_nominal_vectors,
2217 },
2218 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002219 ARRAY_SIZE(grp2d0_max_vectors),
2220 grp2d0_max_vectors,
2221 },
2222};
2223
2224struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2225 grp2d0_bus_scale_usecases,
2226 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2227 .name = "grp2d0",
2228};
2229
2230static struct msm_bus_vectors grp2d1_init_vectors[] = {
2231 {
2232 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2233 .dst = MSM_BUS_SLAVE_EBI_CH0,
2234 .ab = 0,
2235 .ib = 0,
2236 },
2237};
2238
Lucille Sylvester808eca22011-11-03 10:26:29 -07002239static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002240 {
2241 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2242 .dst = MSM_BUS_SLAVE_EBI_CH0,
2243 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002244 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002245 },
2246};
2247
Lucille Sylvester808eca22011-11-03 10:26:29 -07002248static struct msm_bus_vectors grp2d1_max_vectors[] = {
2249 {
2250 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2251 .dst = MSM_BUS_SLAVE_EBI_CH0,
2252 .ab = 0,
2253 .ib = KGSL_CONVERT_TO_MBPS(2048),
2254 },
2255};
2256
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002257static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2258 {
2259 ARRAY_SIZE(grp2d1_init_vectors),
2260 grp2d1_init_vectors,
2261 },
2262 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002263 ARRAY_SIZE(grp2d1_nominal_vectors),
2264 grp2d1_nominal_vectors,
2265 },
2266 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002267 ARRAY_SIZE(grp2d1_max_vectors),
2268 grp2d1_max_vectors,
2269 },
2270};
2271
2272struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2273 grp2d1_bus_scale_usecases,
2274 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2275 .name = "grp2d1",
2276};
2277#endif
2278
2279static struct resource kgsl_3d0_resources[] = {
2280 {
2281 .name = KGSL_3D0_REG_MEMORY,
2282 .start = 0x04300000, /* GFX3D address */
2283 .end = 0x0431ffff,
2284 .flags = IORESOURCE_MEM,
2285 },
2286 {
2287 .name = KGSL_3D0_IRQ,
2288 .start = GFX3D_IRQ,
2289 .end = GFX3D_IRQ,
2290 .flags = IORESOURCE_IRQ,
2291 },
2292};
2293
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002294static const char *kgsl_3d0_iommu_ctx_names[] = {
2295 "gfx3d_user",
2296 /* priv_ctx goes here */
2297};
2298
2299static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2300 {
2301 .iommu_ctx_names = kgsl_3d0_iommu_ctx_names,
2302 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctx_names),
2303 .physstart = 0x07C00000,
2304 .physend = 0x07C00000 + SZ_1M - 1,
2305 },
2306};
2307
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002308static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002309 .pwrlevel = {
2310 {
2311 .gpu_freq = 400000000,
2312 .bus_freq = 4,
2313 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002314 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002315 {
2316 .gpu_freq = 300000000,
2317 .bus_freq = 3,
2318 .io_fraction = 33,
2319 },
2320 {
2321 .gpu_freq = 200000000,
2322 .bus_freq = 2,
2323 .io_fraction = 100,
2324 },
2325 {
2326 .gpu_freq = 128000000,
2327 .bus_freq = 1,
2328 .io_fraction = 100,
2329 },
2330 {
2331 .gpu_freq = 27000000,
2332 .bus_freq = 0,
2333 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002334 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002335 .init_level = 0,
2336 .num_levels = 5,
2337 .set_grp_async = NULL,
Lucille Sylvester93650bb2011-11-02 14:37:10 -07002338 .idle_timeout = HZ/20,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002339 .nap_allowed = true,
2340 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002341#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002342 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002343#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002344 .iommu_data = kgsl_3d0_iommu_data,
2345 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002346};
2347
2348struct platform_device msm_kgsl_3d0 = {
2349 .name = "kgsl-3d0",
2350 .id = 0,
2351 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2352 .resource = kgsl_3d0_resources,
2353 .dev = {
2354 .platform_data = &kgsl_3d0_pdata,
2355 },
2356};
2357
2358static struct resource kgsl_2d0_resources[] = {
2359 {
2360 .name = KGSL_2D0_REG_MEMORY,
2361 .start = 0x04100000, /* Z180 base address */
2362 .end = 0x04100FFF,
2363 .flags = IORESOURCE_MEM,
2364 },
2365 {
2366 .name = KGSL_2D0_IRQ,
2367 .start = GFX2D0_IRQ,
2368 .end = GFX2D0_IRQ,
2369 .flags = IORESOURCE_IRQ,
2370 },
2371};
2372
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002373static const char *kgsl_2d0_iommu_ctx_names[] = {
2374 "gfx2d0_2d0",
2375};
2376
2377static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2378 {
2379 .iommu_ctx_names = kgsl_2d0_iommu_ctx_names,
2380 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctx_names),
2381 .physstart = 0x07D00000,
2382 .physend = 0x07D00000 + SZ_1M - 1,
2383 },
2384};
2385
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002386static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002387 .pwrlevel = {
2388 {
2389 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002390 .bus_freq = 2,
2391 },
2392 {
2393 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002394 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002395 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002396 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002397 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002398 .bus_freq = 0,
2399 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002400 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002401 .init_level = 0,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002402 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002403 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002404 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002405 .nap_allowed = true,
2406 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002407#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002408 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002409#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002410 .iommu_data = kgsl_2d0_iommu_data,
2411 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002412};
2413
2414struct platform_device msm_kgsl_2d0 = {
2415 .name = "kgsl-2d0",
2416 .id = 0,
2417 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2418 .resource = kgsl_2d0_resources,
2419 .dev = {
2420 .platform_data = &kgsl_2d0_pdata,
2421 },
2422};
2423
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002424static const char *kgsl_2d1_iommu_ctx_names[] = {
2425 "gfx2d0_2d1",
2426};
2427
2428static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2429 {
2430 .iommu_ctx_names = kgsl_2d1_iommu_ctx_names,
2431 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctx_names),
2432 .physstart = 0x07E00000,
2433 .physend = 0x07E00000 + SZ_1M - 1,
2434 },
2435};
2436
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002437static struct resource kgsl_2d1_resources[] = {
2438 {
2439 .name = KGSL_2D1_REG_MEMORY,
2440 .start = 0x04200000, /* Z180 device 1 base address */
2441 .end = 0x04200FFF,
2442 .flags = IORESOURCE_MEM,
2443 },
2444 {
2445 .name = KGSL_2D1_IRQ,
2446 .start = GFX2D1_IRQ,
2447 .end = GFX2D1_IRQ,
2448 .flags = IORESOURCE_IRQ,
2449 },
2450};
2451
2452static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002453 .pwrlevel = {
2454 {
2455 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002456 .bus_freq = 2,
2457 },
2458 {
2459 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002460 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002461 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002462 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002463 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002464 .bus_freq = 0,
2465 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002466 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002467 .init_level = 0,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002468 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002469 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002470 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002471 .nap_allowed = true,
2472 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002473#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002474 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002475#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002476 .iommu_data = kgsl_2d1_iommu_data,
2477 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002478};
2479
2480struct platform_device msm_kgsl_2d1 = {
2481 .name = "kgsl-2d1",
2482 .id = 1,
2483 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2484 .resource = kgsl_2d1_resources,
2485 .dev = {
2486 .platform_data = &kgsl_2d1_pdata,
2487 },
2488};
2489
2490#ifdef CONFIG_MSM_GEMINI
2491static struct resource msm_gemini_resources[] = {
2492 {
2493 .start = 0x04600000,
2494 .end = 0x04600000 + SZ_1M - 1,
2495 .flags = IORESOURCE_MEM,
2496 },
2497 {
2498 .start = JPEG_IRQ,
2499 .end = JPEG_IRQ,
2500 .flags = IORESOURCE_IRQ,
2501 },
2502};
2503
2504struct platform_device msm8960_gemini_device = {
2505 .name = "msm_gemini",
2506 .resource = msm_gemini_resources,
2507 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2508};
2509#endif
2510
Praveen Chidambaram78499012011-11-01 17:15:17 -06002511struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
2512 .reg_base_addrs = {
2513 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2514 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2515 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2516 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2517 },
2518 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
2519 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2520 .ipc_rpm_val = 4,
2521 .target_id = {
2522 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2523 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2524 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
2525 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2526 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2527 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
2528 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
2529 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
2530 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2531 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2532 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2533 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2534 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
2535 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
2536 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
2537 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
2538 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
2539 APPS_FABRIC_CFG_HALT, 2),
2540 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
2541 APPS_FABRIC_CFG_CLKMOD, 3),
2542 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
2543 APPS_FABRIC_CFG_IOCTL, 1),
2544 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2545 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
2546 SYS_FABRIC_CFG_HALT, 2),
2547 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
2548 SYS_FABRIC_CFG_CLKMOD, 3),
2549 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
2550 SYS_FABRIC_CFG_IOCTL, 1),
2551 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
2552 SYSTEM_FABRIC_ARB, 29),
2553 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
2554 MMSS_FABRIC_CFG_HALT, 2),
2555 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
2556 MMSS_FABRIC_CFG_CLKMOD, 3),
2557 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
2558 MMSS_FABRIC_CFG_IOCTL, 1),
2559 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2560 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
2561 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
2562 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
2563 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
2564 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
2565 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
2566 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
2567 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
2568 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
2569 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
2570 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
2571 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
2572 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
2573 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
2574 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
2575 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
2576 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
2577 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
2578 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
2579 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
2580 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
2581 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
2582 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
2583 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
2584 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
2585 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
2586 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
2587 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
2588 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
2589 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
2590 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
2591 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
2592 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
2593 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
2594 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
2595 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
2596 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
2597 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
2598 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
2599 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
2600 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
2601 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
2602 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
2603 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
2604 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
2605 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
2606 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
2607 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
2608 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2609 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
2610 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
2611 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
2612 },
2613 .target_status = {
2614 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
2615 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
2616 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
2617 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
2618 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
2619 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
2620 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
2621 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
2622 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
2623 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
2624 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
2625 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
2626 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
2627 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
2628 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
2629 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
2630 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
2631 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
2632 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
2633 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
2634 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
2635 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
2636 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
2637 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
2638 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
2639 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
2640 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
2641 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
2642 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
2643 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
2644 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
2645 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
2646 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
2647 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
2648 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
2649 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
2650 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
2651 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
2652 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
2653 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
2654 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
2655 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
2656 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
2657 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
2658 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
2659 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
2660 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
2661 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
2662 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
2663 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
2664 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
2665 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
2666 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
2667 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
2668 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
2669 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
2670 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
2671 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
2672 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
2673 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
2674 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
2675 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
2676 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
2677 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
2678 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
2679 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
2680 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
2681 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
2682 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
2683 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
2684 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
2685 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
2686 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
2687 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
2688 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
2689 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
2690 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
2691 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
2692 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
2693 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
2694 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
2695 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
2696 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
2697 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
2698 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
2699 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
2700 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
2701 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
2702 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
2703 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
2704 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
2705 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
2706 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
2707 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
2708 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
2709 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
2710 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
2711 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
2712 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
2713 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
2714 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
2715 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
2716 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
2717 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
2718 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
2719 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
2720 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
2721 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
2722 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
2723 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
2724 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
2725 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
2726 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
2727 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
2728 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
2729 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
2730 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
2731 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
2732 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
2733 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
2734 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
2735 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
2736 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
2737 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
2738 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
2739 },
2740 .target_ctrl_id = {
2741 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
2742 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
2743 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
2744 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
2745 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
2746 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
2747 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
2748 },
2749 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
2750 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
2751 .sel_last = MSM_RPM_8960_SEL_LAST,
2752 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002753};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07002754
Praveen Chidambaram78499012011-11-01 17:15:17 -06002755struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002756 .name = "msm_rpm",
2757 .id = -1,
2758};
2759
Praveen Chidambaram78499012011-11-01 17:15:17 -06002760static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2761 .phys_addr_base = 0x0010C000,
2762 .reg_offsets = {
2763 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
2764 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
2765 },
2766 .phys_size = SZ_8K,
2767 .log_len = 4096, /* log's buffer length in bytes */
2768 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2769};
2770
2771struct platform_device msm8960_rpm_log_device = {
2772 .name = "msm_rpm_log",
2773 .id = -1,
2774 .dev = {
2775 .platform_data = &msm_rpm_log_pdata,
2776 },
2777};
2778
Praveen Chidambaram7a712232011-10-28 13:39:45 -06002779static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2780 .phys_addr_base = 0x0010D204,
2781 .phys_size = SZ_8K,
2782};
2783
Praveen Chidambaram78499012011-11-01 17:15:17 -06002784struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06002785 .name = "msm_rpm_stat",
2786 .id = -1,
2787 .dev = {
2788 .platform_data = &msm_rpm_stat_pdata,
2789 },
2790};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002791
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002792struct platform_device msm_bus_sys_fabric = {
2793 .name = "msm_bus_fabric",
2794 .id = MSM_BUS_FAB_SYSTEM,
2795};
2796struct platform_device msm_bus_apps_fabric = {
2797 .name = "msm_bus_fabric",
2798 .id = MSM_BUS_FAB_APPSS,
2799};
2800struct platform_device msm_bus_mm_fabric = {
2801 .name = "msm_bus_fabric",
2802 .id = MSM_BUS_FAB_MMSS,
2803};
2804struct platform_device msm_bus_sys_fpb = {
2805 .name = "msm_bus_fabric",
2806 .id = MSM_BUS_FAB_SYSTEM_FPB,
2807};
2808struct platform_device msm_bus_cpss_fpb = {
2809 .name = "msm_bus_fabric",
2810 .id = MSM_BUS_FAB_CPSS_FPB,
2811};
2812
2813/* Sensors DSPS platform data */
2814#ifdef CONFIG_MSM_DSPS
2815
2816#define PPSS_REG_PHYS_BASE 0x12080000
2817
2818static struct dsps_clk_info dsps_clks[] = {};
2819static struct dsps_regulator_info dsps_regs[] = {};
2820
2821/*
2822 * Note: GPIOs field is intialized in run-time at the function
2823 * msm8960_init_dsps().
2824 */
2825
2826struct msm_dsps_platform_data msm_dsps_pdata = {
2827 .clks = dsps_clks,
2828 .clks_num = ARRAY_SIZE(dsps_clks),
2829 .gpios = NULL,
2830 .gpios_num = 0,
2831 .regs = dsps_regs,
2832 .regs_num = ARRAY_SIZE(dsps_regs),
2833 .dsps_pwr_ctl_en = 1,
2834 .signature = DSPS_SIGNATURE,
2835};
2836
2837static struct resource msm_dsps_resources[] = {
2838 {
2839 .start = PPSS_REG_PHYS_BASE,
2840 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2841 .name = "ppss_reg",
2842 .flags = IORESOURCE_MEM,
2843 },
Wentao Xua55500b2011-08-16 18:15:04 -04002844
2845 {
2846 .start = PPSS_WDOG_TIMER_IRQ,
2847 .end = PPSS_WDOG_TIMER_IRQ,
2848 .name = "ppss_wdog",
2849 .flags = IORESOURCE_IRQ,
2850 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002851};
2852
2853struct platform_device msm_dsps_device = {
2854 .name = "msm_dsps",
2855 .id = 0,
2856 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2857 .resource = msm_dsps_resources,
2858 .dev.platform_data = &msm_dsps_pdata,
2859};
2860
2861#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07002862
2863#ifdef CONFIG_MSM_QDSS
2864
2865#define MSM_QDSS_PHYS_BASE 0x01A00000
2866#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
2867#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
2868#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
2869#define MSM_PTM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
2870
2871static struct resource msm_etb_resources[] = {
2872 {
2873 .start = MSM_ETB_PHYS_BASE,
2874 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
2875 .flags = IORESOURCE_MEM,
2876 },
2877};
2878
2879struct platform_device msm_etb_device = {
2880 .name = "msm_etb",
2881 .id = 0,
2882 .num_resources = ARRAY_SIZE(msm_etb_resources),
2883 .resource = msm_etb_resources,
2884};
2885
2886static struct resource msm_tpiu_resources[] = {
2887 {
2888 .start = MSM_TPIU_PHYS_BASE,
2889 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
2890 .flags = IORESOURCE_MEM,
2891 },
2892};
2893
2894struct platform_device msm_tpiu_device = {
2895 .name = "msm_tpiu",
2896 .id = 0,
2897 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
2898 .resource = msm_tpiu_resources,
2899};
2900
2901static struct resource msm_funnel_resources[] = {
2902 {
2903 .start = MSM_FUNNEL_PHYS_BASE,
2904 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
2905 .flags = IORESOURCE_MEM,
2906 },
2907};
2908
2909struct platform_device msm_funnel_device = {
2910 .name = "msm_funnel",
2911 .id = 0,
2912 .num_resources = ARRAY_SIZE(msm_funnel_resources),
2913 .resource = msm_funnel_resources,
2914};
2915
2916static struct resource msm_ptm_resources[] = {
2917 {
2918 .start = MSM_PTM_PHYS_BASE,
2919 .end = MSM_PTM_PHYS_BASE + (SZ_4K * 2) - 1,
2920 .flags = IORESOURCE_MEM,
2921 },
2922};
2923
2924struct platform_device msm_ptm_device = {
2925 .name = "msm_ptm",
2926 .id = 0,
2927 .num_resources = ARRAY_SIZE(msm_ptm_resources),
2928 .resource = msm_ptm_resources,
2929};
2930
2931#endif