blob: 4e047c5e51bc2464b9539c7179f3d92f5bf701ad [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/platform_device.h>
17#include <linux/msm_rotator.h>
18#include <linux/gpio.h>
19#include <asm/clkdev.h>
20#include <linux/msm_kgsl.h>
21#include <linux/android_pmem.h>
22#include <mach/irqs-8960.h>
Mayank Rana9f51f582011-08-04 18:35:59 +053023#include <mach/dma.h>
24#include <linux/dma-mapping.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025#include <mach/board.h>
26#include <mach/msm_iomap.h>
27#include <mach/msm_hsusb.h>
28#include <mach/msm_sps.h>
29#include <mach/rpm.h>
30#include <mach/msm_bus_board.h>
31#include <mach/msm_memtypes.h>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070032#include <sound/msm-dai-q6.h>
33#include <sound/apr_audio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070034#include "clock.h"
35#include "devices.h"
36#include "devices-msm8x60.h"
37#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070038#include "msm_watchdog.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039
40#ifdef CONFIG_MSM_MPM
41#include "mpm.h"
42#endif
43#ifdef CONFIG_MSM_DSPS
44#include <mach/msm_dsps.h>
45#endif
46
47
48/* Address of GSBI blocks */
49#define MSM_GSBI1_PHYS 0x16000000
50#define MSM_GSBI2_PHYS 0x16100000
51#define MSM_GSBI3_PHYS 0x16200000
52#define MSM_GSBI4_PHYS 0x16300000
53#define MSM_GSBI5_PHYS 0x16400000
54#define MSM_GSBI6_PHYS 0x16500000
55#define MSM_GSBI7_PHYS 0x16600000
56#define MSM_GSBI8_PHYS 0x1A000000
57#define MSM_GSBI9_PHYS 0x1A100000
58#define MSM_GSBI10_PHYS 0x1A200000
59#define MSM_GSBI11_PHYS 0x12440000
60#define MSM_GSBI12_PHYS 0x12480000
61
62#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
63#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053064#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065
66/* GSBI QUP devices */
67#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
68#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
69#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
70#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
71#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
72#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
73#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
74#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
75#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
76#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
77#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
78#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
79#define MSM_QUP_SIZE SZ_4K
80
81#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
82#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
83#define MSM_PMIC_SSBI_SIZE SZ_4K
84
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -070085#define MSM8960_HSUSB_PHYS 0x12500000
86#define MSM8960_HSUSB_SIZE SZ_4K
87
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070088static struct resource resources_otg[] = {
89 {
90 .start = MSM8960_HSUSB_PHYS,
91 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
92 .flags = IORESOURCE_MEM,
93 },
94 {
95 .start = USB1_HS_IRQ,
96 .end = USB1_HS_IRQ,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700101struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700102 .name = "msm_otg",
103 .id = -1,
104 .num_resources = ARRAY_SIZE(resources_otg),
105 .resource = resources_otg,
106 .dev = {
107 .coherent_dma_mask = 0xffffffff,
108 },
109};
110
111static struct resource resources_hsusb[] = {
112 {
113 .start = MSM8960_HSUSB_PHYS,
114 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
115 .flags = IORESOURCE_MEM,
116 },
117 {
118 .start = USB1_HS_IRQ,
119 .end = USB1_HS_IRQ,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700124struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700125 .name = "msm_hsusb",
126 .id = -1,
127 .num_resources = ARRAY_SIZE(resources_hsusb),
128 .resource = resources_hsusb,
129 .dev = {
130 .coherent_dma_mask = 0xffffffff,
131 },
132};
133
134static struct resource resources_hsusb_host[] = {
135 {
136 .start = MSM8960_HSUSB_PHYS,
137 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
138 .flags = IORESOURCE_MEM,
139 },
140 {
141 .start = USB1_HS_IRQ,
142 .end = USB1_HS_IRQ,
143 .flags = IORESOURCE_IRQ,
144 },
145};
146
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530147static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700148struct platform_device msm_device_hsusb_host = {
149 .name = "msm_hsusb_host",
150 .id = -1,
151 .num_resources = ARRAY_SIZE(resources_hsusb_host),
152 .resource = resources_hsusb_host,
153 .dev = {
154 .dma_mask = &dma_mask,
155 .coherent_dma_mask = 0xffffffff,
156 },
157};
158
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530159static struct resource resources_hsic_host[] = {
160 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700161 .start = 0x12520000,
162 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530163 .flags = IORESOURCE_MEM,
164 },
165 {
166 .start = USB_HSIC_IRQ,
167 .end = USB_HSIC_IRQ,
168 .flags = IORESOURCE_IRQ,
169 },
170};
171
172struct platform_device msm_device_hsic_host = {
173 .name = "msm_hsic_host",
174 .id = -1,
175 .num_resources = ARRAY_SIZE(resources_hsic_host),
176 .resource = resources_hsic_host,
177 .dev = {
178 .dma_mask = &dma_mask,
179 .coherent_dma_mask = DMA_BIT_MASK(32),
180 },
181};
182
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700183static struct resource resources_uart_gsbi2[] = {
184 {
185 .start = MSM8960_GSBI2_UARTDM_IRQ,
186 .end = MSM8960_GSBI2_UARTDM_IRQ,
187 .flags = IORESOURCE_IRQ,
188 },
189 {
190 .start = MSM_UART2DM_PHYS,
191 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
192 .name = "uartdm_resource",
193 .flags = IORESOURCE_MEM,
194 },
195 {
196 .start = MSM_GSBI2_PHYS,
197 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
198 .name = "gsbi_resource",
199 .flags = IORESOURCE_MEM,
200 },
201};
202
203struct platform_device msm8960_device_uart_gsbi2 = {
204 .name = "msm_serial_hsl",
205 .id = 0,
206 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
207 .resource = resources_uart_gsbi2,
208};
Mayank Rana9f51f582011-08-04 18:35:59 +0530209/* GSBI 6 used into UARTDM Mode */
210static struct resource msm_uart_dm6_resources[] = {
211 {
212 .start = MSM_UART6DM_PHYS,
213 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
214 .name = "uartdm_resource",
215 .flags = IORESOURCE_MEM,
216 },
217 {
218 .start = GSBI6_UARTDM_IRQ,
219 .end = GSBI6_UARTDM_IRQ,
220 .flags = IORESOURCE_IRQ,
221 },
222 {
223 .start = MSM_GSBI6_PHYS,
224 .end = MSM_GSBI6_PHYS + 4 - 1,
225 .name = "gsbi_resource",
226 .flags = IORESOURCE_MEM,
227 },
228 {
229 .start = DMOV_HSUART_GSBI6_TX_CHAN,
230 .end = DMOV_HSUART_GSBI6_RX_CHAN,
231 .name = "uartdm_channels",
232 .flags = IORESOURCE_DMA,
233 },
234 {
235 .start = DMOV_HSUART_GSBI6_TX_CRCI,
236 .end = DMOV_HSUART_GSBI6_RX_CRCI,
237 .name = "uartdm_crci",
238 .flags = IORESOURCE_DMA,
239 },
240};
241static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
242struct platform_device msm_device_uart_dm6 = {
243 .name = "msm_serial_hs",
244 .id = 0,
245 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
246 .resource = msm_uart_dm6_resources,
247 .dev = {
248 .dma_mask = &msm_uart_dm6_dma_mask,
249 .coherent_dma_mask = DMA_BIT_MASK(32),
250 },
251};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700252
253static struct resource resources_uart_gsbi5[] = {
254 {
255 .start = GSBI5_UARTDM_IRQ,
256 .end = GSBI5_UARTDM_IRQ,
257 .flags = IORESOURCE_IRQ,
258 },
259 {
260 .start = MSM_UART5DM_PHYS,
261 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
262 .name = "uartdm_resource",
263 .flags = IORESOURCE_MEM,
264 },
265 {
266 .start = MSM_GSBI5_PHYS,
267 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
268 .name = "gsbi_resource",
269 .flags = IORESOURCE_MEM,
270 },
271};
272
273struct platform_device msm8960_device_uart_gsbi5 = {
274 .name = "msm_serial_hsl",
275 .id = 0,
276 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
277 .resource = resources_uart_gsbi5,
278};
279/* MSM Video core device */
280#ifdef CONFIG_MSM_BUS_SCALING
281static struct msm_bus_vectors vidc_init_vectors[] = {
282 {
283 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
284 .dst = MSM_BUS_SLAVE_EBI_CH0,
285 .ab = 0,
286 .ib = 0,
287 },
288 {
289 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
290 .dst = MSM_BUS_SLAVE_EBI_CH0,
291 .ab = 0,
292 .ib = 0,
293 },
294 {
295 .src = MSM_BUS_MASTER_AMPSS_M0,
296 .dst = MSM_BUS_SLAVE_EBI_CH0,
297 .ab = 0,
298 .ib = 0,
299 },
300 {
301 .src = MSM_BUS_MASTER_AMPSS_M0,
302 .dst = MSM_BUS_SLAVE_EBI_CH0,
303 .ab = 0,
304 .ib = 0,
305 },
306};
307static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
308 {
309 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
310 .dst = MSM_BUS_SLAVE_EBI_CH0,
311 .ab = 54525952,
312 .ib = 436207616,
313 },
314 {
315 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
316 .dst = MSM_BUS_SLAVE_EBI_CH0,
317 .ab = 72351744,
318 .ib = 289406976,
319 },
320 {
321 .src = MSM_BUS_MASTER_AMPSS_M0,
322 .dst = MSM_BUS_SLAVE_EBI_CH0,
323 .ab = 500000,
324 .ib = 1000000,
325 },
326 {
327 .src = MSM_BUS_MASTER_AMPSS_M0,
328 .dst = MSM_BUS_SLAVE_EBI_CH0,
329 .ab = 500000,
330 .ib = 1000000,
331 },
332};
333static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
334 {
335 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
336 .dst = MSM_BUS_SLAVE_EBI_CH0,
337 .ab = 40894464,
338 .ib = 327155712,
339 },
340 {
341 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
342 .dst = MSM_BUS_SLAVE_EBI_CH0,
343 .ab = 48234496,
344 .ib = 192937984,
345 },
346 {
347 .src = MSM_BUS_MASTER_AMPSS_M0,
348 .dst = MSM_BUS_SLAVE_EBI_CH0,
349 .ab = 500000,
350 .ib = 2000000,
351 },
352 {
353 .src = MSM_BUS_MASTER_AMPSS_M0,
354 .dst = MSM_BUS_SLAVE_EBI_CH0,
355 .ab = 500000,
356 .ib = 2000000,
357 },
358};
359static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
360 {
361 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
362 .dst = MSM_BUS_SLAVE_EBI_CH0,
363 .ab = 163577856,
364 .ib = 1308622848,
365 },
366 {
367 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
368 .dst = MSM_BUS_SLAVE_EBI_CH0,
369 .ab = 219152384,
370 .ib = 876609536,
371 },
372 {
373 .src = MSM_BUS_MASTER_AMPSS_M0,
374 .dst = MSM_BUS_SLAVE_EBI_CH0,
375 .ab = 1750000,
376 .ib = 3500000,
377 },
378 {
379 .src = MSM_BUS_MASTER_AMPSS_M0,
380 .dst = MSM_BUS_SLAVE_EBI_CH0,
381 .ab = 1750000,
382 .ib = 3500000,
383 },
384};
385static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
386 {
387 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
388 .dst = MSM_BUS_SLAVE_EBI_CH0,
389 .ab = 121634816,
390 .ib = 973078528,
391 },
392 {
393 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
394 .dst = MSM_BUS_SLAVE_EBI_CH0,
395 .ab = 155189248,
396 .ib = 620756992,
397 },
398 {
399 .src = MSM_BUS_MASTER_AMPSS_M0,
400 .dst = MSM_BUS_SLAVE_EBI_CH0,
401 .ab = 1750000,
402 .ib = 7000000,
403 },
404 {
405 .src = MSM_BUS_MASTER_AMPSS_M0,
406 .dst = MSM_BUS_SLAVE_EBI_CH0,
407 .ab = 1750000,
408 .ib = 7000000,
409 },
410};
411static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
412 {
413 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
414 .dst = MSM_BUS_SLAVE_EBI_CH0,
415 .ab = 372244480,
416 .ib = 1861222400,
417 },
418 {
419 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
420 .dst = MSM_BUS_SLAVE_EBI_CH0,
421 .ab = 501219328,
422 .ib = 2004877312,
423 },
424 {
425 .src = MSM_BUS_MASTER_AMPSS_M0,
426 .dst = MSM_BUS_SLAVE_EBI_CH0,
427 .ab = 2500000,
428 .ib = 5000000,
429 },
430 {
431 .src = MSM_BUS_MASTER_AMPSS_M0,
432 .dst = MSM_BUS_SLAVE_EBI_CH0,
433 .ab = 2500000,
434 .ib = 5000000,
435 },
436};
437static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
438 {
439 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
440 .dst = MSM_BUS_SLAVE_EBI_CH0,
441 .ab = 222298112,
442 .ib = 1778384896,
443 },
444 {
445 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
446 .dst = MSM_BUS_SLAVE_EBI_CH0,
447 .ab = 330301440,
448 .ib = 1321205760,
449 },
450 {
451 .src = MSM_BUS_MASTER_AMPSS_M0,
452 .dst = MSM_BUS_SLAVE_EBI_CH0,
453 .ab = 2500000,
454 .ib = 700000000,
455 },
456 {
457 .src = MSM_BUS_MASTER_AMPSS_M0,
458 .dst = MSM_BUS_SLAVE_EBI_CH0,
459 .ab = 2500000,
460 .ib = 10000000,
461 },
462};
463
464static struct msm_bus_paths vidc_bus_client_config[] = {
465 {
466 ARRAY_SIZE(vidc_init_vectors),
467 vidc_init_vectors,
468 },
469 {
470 ARRAY_SIZE(vidc_venc_vga_vectors),
471 vidc_venc_vga_vectors,
472 },
473 {
474 ARRAY_SIZE(vidc_vdec_vga_vectors),
475 vidc_vdec_vga_vectors,
476 },
477 {
478 ARRAY_SIZE(vidc_venc_720p_vectors),
479 vidc_venc_720p_vectors,
480 },
481 {
482 ARRAY_SIZE(vidc_vdec_720p_vectors),
483 vidc_vdec_720p_vectors,
484 },
485 {
486 ARRAY_SIZE(vidc_venc_1080p_vectors),
487 vidc_venc_1080p_vectors,
488 },
489 {
490 ARRAY_SIZE(vidc_vdec_1080p_vectors),
491 vidc_vdec_1080p_vectors,
492 },
493};
494
495static struct msm_bus_scale_pdata vidc_bus_client_data = {
496 vidc_bus_client_config,
497 ARRAY_SIZE(vidc_bus_client_config),
498 .name = "vidc",
499};
500#endif
501
Mona Hossain9c430e32011-07-27 11:04:47 -0700502#ifdef CONFIG_HW_RANDOM_MSM
503/* PRNG device */
504#define MSM_PRNG_PHYS 0x1A500000
505static struct resource rng_resources = {
506 .flags = IORESOURCE_MEM,
507 .start = MSM_PRNG_PHYS,
508 .end = MSM_PRNG_PHYS + SZ_512 - 1,
509};
510
511struct platform_device msm_device_rng = {
512 .name = "msm_rng",
513 .id = 0,
514 .num_resources = 1,
515 .resource = &rng_resources,
516};
517#endif
518
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700519#define MSM_VIDC_BASE_PHYS 0x04400000
520#define MSM_VIDC_BASE_SIZE 0x00100000
521
522static struct resource msm_device_vidc_resources[] = {
523 {
524 .start = MSM_VIDC_BASE_PHYS,
525 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
526 .flags = IORESOURCE_MEM,
527 },
528 {
529 .start = VCODEC_IRQ,
530 .end = VCODEC_IRQ,
531 .flags = IORESOURCE_IRQ,
532 },
533};
534
535struct msm_vidc_platform_data vidc_platform_data = {
536#ifdef CONFIG_MSM_BUS_SCALING
537 .vidc_bus_client_pdata = &vidc_bus_client_data,
538#endif
539 .memtype = MEMTYPE_EBI1
540};
541
542struct platform_device msm_device_vidc = {
543 .name = "msm_vidc",
544 .id = 0,
545 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
546 .resource = msm_device_vidc_resources,
547 .dev = {
548 .platform_data = &vidc_platform_data,
549 },
550};
551
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700552#define MSM_SDC1_BASE 0x12400000
553#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
554#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
555#define MSM_SDC2_BASE 0x12140000
556#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
557#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
558#define MSM_SDC2_BASE 0x12140000
559#define MSM_SDC3_BASE 0x12180000
560#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
561#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
562#define MSM_SDC4_BASE 0x121C0000
563#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
564#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
565#define MSM_SDC5_BASE 0x12200000
566#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
567#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
568
569static struct resource resources_sdc1[] = {
570 {
571 .name = "core_mem",
572 .flags = IORESOURCE_MEM,
573 .start = MSM_SDC1_BASE,
574 .end = MSM_SDC1_DML_BASE - 1,
575 },
576 {
577 .name = "core_irq",
578 .flags = IORESOURCE_IRQ,
579 .start = SDC1_IRQ_0,
580 .end = SDC1_IRQ_0
581 },
582#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
583 {
584 .name = "sdcc_dml_addr",
585 .start = MSM_SDC1_DML_BASE,
586 .end = MSM_SDC1_BAM_BASE - 1,
587 .flags = IORESOURCE_MEM,
588 },
589 {
590 .name = "sdcc_bam_addr",
591 .start = MSM_SDC1_BAM_BASE,
592 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
593 .flags = IORESOURCE_MEM,
594 },
595 {
596 .name = "sdcc_bam_irq",
597 .start = SDC1_BAM_IRQ,
598 .end = SDC1_BAM_IRQ,
599 .flags = IORESOURCE_IRQ,
600 },
601#endif
602};
603
604static struct resource resources_sdc2[] = {
605 {
606 .name = "core_mem",
607 .flags = IORESOURCE_MEM,
608 .start = MSM_SDC2_BASE,
609 .end = MSM_SDC2_DML_BASE - 1,
610 },
611 {
612 .name = "core_irq",
613 .flags = IORESOURCE_IRQ,
614 .start = SDC2_IRQ_0,
615 .end = SDC2_IRQ_0
616 },
617#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
618 {
619 .name = "sdcc_dml_addr",
620 .start = MSM_SDC2_DML_BASE,
621 .end = MSM_SDC2_BAM_BASE - 1,
622 .flags = IORESOURCE_MEM,
623 },
624 {
625 .name = "sdcc_bam_addr",
626 .start = MSM_SDC2_BAM_BASE,
627 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
628 .flags = IORESOURCE_MEM,
629 },
630 {
631 .name = "sdcc_bam_irq",
632 .start = SDC2_BAM_IRQ,
633 .end = SDC2_BAM_IRQ,
634 .flags = IORESOURCE_IRQ,
635 },
636#endif
637};
638
639static struct resource resources_sdc3[] = {
640 {
641 .name = "core_mem",
642 .flags = IORESOURCE_MEM,
643 .start = MSM_SDC3_BASE,
644 .end = MSM_SDC3_DML_BASE - 1,
645 },
646 {
647 .name = "core_irq",
648 .flags = IORESOURCE_IRQ,
649 .start = SDC3_IRQ_0,
650 .end = SDC3_IRQ_0
651 },
652#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
653 {
654 .name = "sdcc_dml_addr",
655 .start = MSM_SDC3_DML_BASE,
656 .end = MSM_SDC3_BAM_BASE - 1,
657 .flags = IORESOURCE_MEM,
658 },
659 {
660 .name = "sdcc_bam_addr",
661 .start = MSM_SDC3_BAM_BASE,
662 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
663 .flags = IORESOURCE_MEM,
664 },
665 {
666 .name = "sdcc_bam_irq",
667 .start = SDC3_BAM_IRQ,
668 .end = SDC3_BAM_IRQ,
669 .flags = IORESOURCE_IRQ,
670 },
671#endif
672};
673
674static struct resource resources_sdc4[] = {
675 {
676 .name = "core_mem",
677 .flags = IORESOURCE_MEM,
678 .start = MSM_SDC4_BASE,
679 .end = MSM_SDC4_DML_BASE - 1,
680 },
681 {
682 .name = "core_irq",
683 .flags = IORESOURCE_IRQ,
684 .start = SDC4_IRQ_0,
685 .end = SDC4_IRQ_0
686 },
687#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
688 {
689 .name = "sdcc_dml_addr",
690 .start = MSM_SDC4_DML_BASE,
691 .end = MSM_SDC4_BAM_BASE - 1,
692 .flags = IORESOURCE_MEM,
693 },
694 {
695 .name = "sdcc_bam_addr",
696 .start = MSM_SDC4_BAM_BASE,
697 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
698 .flags = IORESOURCE_MEM,
699 },
700 {
701 .name = "sdcc_bam_irq",
702 .start = SDC4_BAM_IRQ,
703 .end = SDC4_BAM_IRQ,
704 .flags = IORESOURCE_IRQ,
705 },
706#endif
707};
708
709static struct resource resources_sdc5[] = {
710 {
711 .name = "core_mem",
712 .flags = IORESOURCE_MEM,
713 .start = MSM_SDC5_BASE,
714 .end = MSM_SDC5_DML_BASE - 1,
715 },
716 {
717 .name = "core_irq",
718 .flags = IORESOURCE_IRQ,
719 .start = SDC5_IRQ_0,
720 .end = SDC5_IRQ_0
721 },
722#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
723 {
724 .name = "sdcc_dml_addr",
725 .start = MSM_SDC5_DML_BASE,
726 .end = MSM_SDC5_BAM_BASE - 1,
727 .flags = IORESOURCE_MEM,
728 },
729 {
730 .name = "sdcc_bam_addr",
731 .start = MSM_SDC5_BAM_BASE,
732 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
733 .flags = IORESOURCE_MEM,
734 },
735 {
736 .name = "sdcc_bam_irq",
737 .start = SDC5_BAM_IRQ,
738 .end = SDC5_BAM_IRQ,
739 .flags = IORESOURCE_IRQ,
740 },
741#endif
742};
743
744struct platform_device msm_device_sdc1 = {
745 .name = "msm_sdcc",
746 .id = 1,
747 .num_resources = ARRAY_SIZE(resources_sdc1),
748 .resource = resources_sdc1,
749 .dev = {
750 .coherent_dma_mask = 0xffffffff,
751 },
752};
753
754struct platform_device msm_device_sdc2 = {
755 .name = "msm_sdcc",
756 .id = 2,
757 .num_resources = ARRAY_SIZE(resources_sdc2),
758 .resource = resources_sdc2,
759 .dev = {
760 .coherent_dma_mask = 0xffffffff,
761 },
762};
763
764struct platform_device msm_device_sdc3 = {
765 .name = "msm_sdcc",
766 .id = 3,
767 .num_resources = ARRAY_SIZE(resources_sdc3),
768 .resource = resources_sdc3,
769 .dev = {
770 .coherent_dma_mask = 0xffffffff,
771 },
772};
773
774struct platform_device msm_device_sdc4 = {
775 .name = "msm_sdcc",
776 .id = 4,
777 .num_resources = ARRAY_SIZE(resources_sdc4),
778 .resource = resources_sdc4,
779 .dev = {
780 .coherent_dma_mask = 0xffffffff,
781 },
782};
783
784struct platform_device msm_device_sdc5 = {
785 .name = "msm_sdcc",
786 .id = 5,
787 .num_resources = ARRAY_SIZE(resources_sdc5),
788 .resource = resources_sdc5,
789 .dev = {
790 .coherent_dma_mask = 0xffffffff,
791 },
792};
793
794struct platform_device msm_device_smd = {
795 .name = "msm_smd",
796 .id = -1,
797};
798
799struct platform_device msm_device_bam_dmux = {
800 .name = "BAM_RMNT",
801 .id = -1,
802};
803
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700804static struct msm_watchdog_pdata msm_watchdog_pdata = {
805 .pet_time = 10000,
806 .bark_time = 11000,
807 .has_secure = true,
808};
809
810struct platform_device msm8960_device_watchdog = {
811 .name = "msm_watchdog",
812 .id = -1,
813 .dev = {
814 .platform_data = &msm_watchdog_pdata,
815 },
816};
817
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700818static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700819 {
820 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700821 .flags = IORESOURCE_IRQ,
822 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700823 {
824 .start = 0x18320000,
825 .end = 0x18320000 + SZ_1M - 1,
826 .flags = IORESOURCE_MEM,
827 },
828};
829
830static struct msm_dmov_pdata msm_dmov_pdata = {
831 .sd = 1,
832 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700833};
834
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700835struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700836 .name = "msm_dmov",
837 .id = -1,
838 .resource = msm_dmov_resource,
839 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700840 .dev = {
841 .platform_data = &msm_dmov_pdata,
842 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700843};
844
845static struct platform_device *msm_sdcc_devices[] __initdata = {
846 &msm_device_sdc1,
847 &msm_device_sdc2,
848 &msm_device_sdc3,
849 &msm_device_sdc4,
850 &msm_device_sdc5,
851};
852
853int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
854{
855 struct platform_device *pdev;
856
857 if (controller < 1 || controller > 5)
858 return -EINVAL;
859
860 pdev = msm_sdcc_devices[controller-1];
861 pdev->dev.platform_data = plat;
862 return platform_device_register(pdev);
863}
864
865static struct resource resources_qup_i2c_gsbi4[] = {
866 {
867 .name = "gsbi_qup_i2c_addr",
868 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600869 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700870 .flags = IORESOURCE_MEM,
871 },
872 {
873 .name = "qup_phys_addr",
874 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600875 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700876 .flags = IORESOURCE_MEM,
877 },
878 {
879 .name = "qup_err_intr",
880 .start = GSBI4_QUP_IRQ,
881 .end = GSBI4_QUP_IRQ,
882 .flags = IORESOURCE_IRQ,
883 },
884};
885
886struct platform_device msm8960_device_qup_i2c_gsbi4 = {
887 .name = "qup_i2c",
888 .id = 4,
889 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
890 .resource = resources_qup_i2c_gsbi4,
891};
892
893static struct resource resources_qup_i2c_gsbi3[] = {
894 {
895 .name = "gsbi_qup_i2c_addr",
896 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600897 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700898 .flags = IORESOURCE_MEM,
899 },
900 {
901 .name = "qup_phys_addr",
902 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600903 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700904 .flags = IORESOURCE_MEM,
905 },
906 {
907 .name = "qup_err_intr",
908 .start = GSBI3_QUP_IRQ,
909 .end = GSBI3_QUP_IRQ,
910 .flags = IORESOURCE_IRQ,
911 },
912};
913
914struct platform_device msm8960_device_qup_i2c_gsbi3 = {
915 .name = "qup_i2c",
916 .id = 3,
917 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
918 .resource = resources_qup_i2c_gsbi3,
919};
920
921static struct resource resources_qup_i2c_gsbi10[] = {
922 {
923 .name = "gsbi_qup_i2c_addr",
924 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600925 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700926 .flags = IORESOURCE_MEM,
927 },
928 {
929 .name = "qup_phys_addr",
930 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600931 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700932 .flags = IORESOURCE_MEM,
933 },
934 {
935 .name = "qup_err_intr",
936 .start = GSBI10_QUP_IRQ,
937 .end = GSBI10_QUP_IRQ,
938 .flags = IORESOURCE_IRQ,
939 },
940};
941
942struct platform_device msm8960_device_qup_i2c_gsbi10 = {
943 .name = "qup_i2c",
944 .id = 10,
945 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
946 .resource = resources_qup_i2c_gsbi10,
947};
948
949static struct resource resources_qup_i2c_gsbi12[] = {
950 {
951 .name = "gsbi_qup_i2c_addr",
952 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600953 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700954 .flags = IORESOURCE_MEM,
955 },
956 {
957 .name = "qup_phys_addr",
958 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600959 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700960 .flags = IORESOURCE_MEM,
961 },
962 {
963 .name = "qup_err_intr",
964 .start = GSBI12_QUP_IRQ,
965 .end = GSBI12_QUP_IRQ,
966 .flags = IORESOURCE_IRQ,
967 },
968};
969
970struct platform_device msm8960_device_qup_i2c_gsbi12 = {
971 .name = "qup_i2c",
972 .id = 12,
973 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
974 .resource = resources_qup_i2c_gsbi12,
975};
976
977#ifdef CONFIG_MSM_CAMERA
978struct resource msm_camera_resources[] = {
979 {
980 .name = "vfe",
981 .start = 0x04500000,
982 .end = 0x04500000 + SZ_1M - 1,
983 .flags = IORESOURCE_MEM,
984 },
985 {
986 .name = "vfe",
987 .start = VFE_IRQ,
988 .end = VFE_IRQ,
989 .flags = IORESOURCE_IRQ,
990 },
991 {
Mingcheng Zhu8e9f99e2011-08-26 16:33:32 -0700992 .name = "vpe",
993 .start = 0x05300000,
994 .end = 0x05300000 + SZ_1M - 1,
995 .flags = IORESOURCE_MEM,
996 },
997 {
998 .name = "vpe",
999 .start = VPE_IRQ,
1000 .end = VPE_IRQ,
1001 .flags = IORESOURCE_IRQ,
1002 },
1003 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001004 .name = "vid_buf",
1005 .flags = IORESOURCE_DMA,
1006 },
1007 {
1008 .name = "ispif",
1009 .start = 0x04800800,
1010 .end = 0x04800800 + SZ_1K - 1,
1011 .flags = IORESOURCE_MEM,
1012 },
1013 {
1014 .name = "ispif",
1015 .start = ISPIF_IRQ,
1016 .end = ISPIF_IRQ,
1017 .flags = IORESOURCE_IRQ,
1018 },
1019 {
1020 .name = "csid0",
1021 .start = 0x04800000,
1022 .end = 0x04800000 + SZ_1K - 1,
1023 .flags = IORESOURCE_MEM,
1024 },
1025 {
1026 .name = "csid0",
1027 .start = CSI_0_IRQ,
1028 .end = CSI_0_IRQ,
1029 .flags = IORESOURCE_IRQ,
1030 },
1031 {
1032 .name = "csiphy0",
1033 .start = 0x04800C00,
1034 .end = 0x04800C00 + SZ_1K - 1,
1035 .flags = IORESOURCE_MEM,
1036 },
1037 {
1038 .name = "csiphy0",
1039 .start = CSIPHY_4LN_IRQ,
1040 .end = CSIPHY_4LN_IRQ,
1041 .flags = IORESOURCE_IRQ,
1042 },
1043 {
1044 .name = "csid1",
1045 .start = 0x04800400,
1046 .end = 0x04800400 + SZ_1K - 1,
1047 .flags = IORESOURCE_MEM,
1048 },
1049 {
1050 .name = "csid1",
1051 .start = CSI_1_IRQ,
1052 .end = CSI_1_IRQ,
1053 .flags = IORESOURCE_IRQ,
1054 },
1055 {
1056 .name = "csiphy1",
1057 .start = 0x04801000,
1058 .end = 0x04801000 + SZ_1K - 1,
1059 .flags = IORESOURCE_MEM,
1060 },
1061 {
1062 .name = "csiphy1",
1063 .start = MSM8960_CSIPHY_2LN_IRQ,
1064 .end = MSM8960_CSIPHY_2LN_IRQ,
1065 .flags = IORESOURCE_IRQ,
1066 },
Nishant Pandit24153d82011-08-27 16:05:13 +05301067 {
1068 .name = "s3d_rw",
1069 .start = 0x008003E0,
1070 .end = 0x008003E0 + SZ_16 - 1,
1071 .flags = IORESOURCE_MEM,
1072 },
1073 {
1074 .name = "s3d_ctl",
1075 .start = 0x008020B8,
1076 .end = 0x008020B8 + SZ_16 - 1,
1077 .flags = IORESOURCE_MEM,
1078 },
1079
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001080};
1081
1082int __init msm_get_cam_resources(struct msm_camera_sensor_info *s_info)
1083{
1084 s_info->resource = msm_camera_resources;
1085 s_info->num_resources = ARRAY_SIZE(msm_camera_resources);
1086 return 0;
1087}
1088#endif
1089
1090static struct resource resources_ssbi_pm8921[] = {
1091 {
1092 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1093 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1094 .flags = IORESOURCE_MEM,
1095 },
1096};
1097
1098struct platform_device msm8960_device_ssbi_pm8921 = {
1099 .name = "msm_ssbi",
1100 .id = 0,
1101 .resource = resources_ssbi_pm8921,
1102 .num_resources = ARRAY_SIZE(resources_ssbi_pm8921),
1103};
1104
1105static struct resource resources_qup_spi_gsbi1[] = {
1106 {
1107 .name = "spi_base",
1108 .start = MSM_GSBI1_QUP_PHYS,
1109 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1110 .flags = IORESOURCE_MEM,
1111 },
1112 {
1113 .name = "gsbi_base",
1114 .start = MSM_GSBI1_PHYS,
1115 .end = MSM_GSBI1_PHYS + 4 - 1,
1116 .flags = IORESOURCE_MEM,
1117 },
1118 {
1119 .name = "spi_irq_in",
1120 .start = MSM8960_GSBI1_QUP_IRQ,
1121 .end = MSM8960_GSBI1_QUP_IRQ,
1122 .flags = IORESOURCE_IRQ,
1123 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001124 {
1125 .name = "spi_clk",
1126 .start = 9,
1127 .end = 9,
1128 .flags = IORESOURCE_IO,
1129 },
1130 {
1131 .name = "spi_cs",
1132 .start = 8,
1133 .end = 8,
1134 .flags = IORESOURCE_IO,
1135 },
1136 {
Chandan Uddaraju15e54b92011-09-12 10:52:36 -07001137 .name = "spi_cs1",
1138 .start = 14,
1139 .end = 14,
1140 .flags = IORESOURCE_IO,
1141 },
1142 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001143 .name = "spi_miso",
1144 .start = 7,
1145 .end = 7,
1146 .flags = IORESOURCE_IO,
1147 },
1148 {
1149 .name = "spi_mosi",
1150 .start = 6,
1151 .end = 6,
1152 .flags = IORESOURCE_IO,
1153 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001154};
1155
1156struct platform_device msm8960_device_qup_spi_gsbi1 = {
1157 .name = "spi_qsd",
1158 .id = 0,
1159 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1160 .resource = resources_qup_spi_gsbi1,
1161};
1162
1163struct platform_device msm_pcm = {
1164 .name = "msm-pcm-dsp",
1165 .id = -1,
1166};
1167
1168struct platform_device msm_pcm_routing = {
1169 .name = "msm-pcm-routing",
1170 .id = -1,
1171};
1172
1173struct platform_device msm_cpudai0 = {
1174 .name = "msm-dai-q6",
1175 .id = 0x4000,
1176};
1177
1178struct platform_device msm_cpudai1 = {
1179 .name = "msm-dai-q6",
1180 .id = 0x4001,
1181};
1182
1183struct platform_device msm_cpudai_hdmi_rx = {
1184 .name = "msm-dai-q6",
1185 .id = 8,
1186};
1187
1188struct platform_device msm_cpudai_bt_rx = {
1189 .name = "msm-dai-q6",
1190 .id = 0x3000,
1191};
1192
1193struct platform_device msm_cpudai_bt_tx = {
1194 .name = "msm-dai-q6",
1195 .id = 0x3001,
1196};
1197
1198struct platform_device msm_cpudai_fm_rx = {
1199 .name = "msm-dai-q6",
1200 .id = 0x3004,
1201};
1202
1203struct platform_device msm_cpudai_fm_tx = {
1204 .name = "msm-dai-q6",
1205 .id = 0x3005,
1206};
1207
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001208/*
1209 * Machine specific data for AUX PCM Interface
1210 * which the driver will be unware of.
1211 */
1212struct msm_dai_auxpcm_pdata auxpcm_rx_pdata = {
1213 .clk = "pcm_clk",
1214 .mode = AFE_PCM_CFG_MODE_PCM,
1215 .sync = AFE_PCM_CFG_SYNC_INT,
1216 .frame = AFE_PCM_CFG_FRM_256BPF,
1217 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1218 .slot = 0,
1219 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1220 .pcm_clk_rate = 2048000,
1221};
1222
1223struct platform_device msm_cpudai_auxpcm_rx = {
1224 .name = "msm-dai-q6",
1225 .id = 2,
1226 .dev = {
1227 .platform_data = &auxpcm_rx_pdata,
1228 },
1229};
1230
1231struct platform_device msm_cpudai_auxpcm_tx = {
1232 .name = "msm-dai-q6",
1233 .id = 3,
1234};
1235
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001236struct platform_device msm_cpu_fe = {
1237 .name = "msm-dai-fe",
1238 .id = -1,
1239};
1240
1241struct platform_device msm_stub_codec = {
1242 .name = "msm-stub-codec",
1243 .id = 1,
1244};
1245
1246struct platform_device msm_voice = {
1247 .name = "msm-pcm-voice",
1248 .id = -1,
1249};
1250
1251struct platform_device msm_voip = {
1252 .name = "msm-voip-dsp",
1253 .id = -1,
1254};
1255
1256struct platform_device msm_lpa_pcm = {
1257 .name = "msm-pcm-lpa",
1258 .id = -1,
1259};
1260
1261struct platform_device msm_pcm_hostless = {
1262 .name = "msm-pcm-hostless",
1263 .id = -1,
1264};
1265
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301266struct platform_device msm_cpudai_afe_01_rx = {
1267 .name = "msm-dai-q6",
1268 .id = 0xE0,
1269};
1270
1271struct platform_device msm_cpudai_afe_01_tx = {
1272 .name = "msm-dai-q6",
1273 .id = 0xF0,
1274};
1275
1276struct platform_device msm_cpudai_afe_02_rx = {
1277 .name = "msm-dai-q6",
1278 .id = 0xF1,
1279};
1280
1281struct platform_device msm_cpudai_afe_02_tx = {
1282 .name = "msm-dai-q6",
1283 .id = 0xE1,
1284};
1285
1286struct platform_device msm_pcm_afe = {
1287 .name = "msm-pcm-afe",
1288 .id = -1,
1289};
1290
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001291struct platform_device *msm_footswitch_devices[] = {
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001292 FS_8X60(FS_MDP, "fs_mdp"),
1293 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001294 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1295 FS_8X60(FS_VFE, "fs_vfe"),
1296 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001297 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1298 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1299 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001300 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001301};
1302unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1303
1304#ifdef CONFIG_MSM_ROTATOR
1305#define ROTATOR_HW_BASE 0x04E00000
1306static struct resource resources_msm_rotator[] = {
1307 {
1308 .start = ROTATOR_HW_BASE,
1309 .end = ROTATOR_HW_BASE + 0x100000 - 1,
1310 .flags = IORESOURCE_MEM,
1311 },
1312 {
1313 .start = ROT_IRQ,
1314 .end = ROT_IRQ,
1315 .flags = IORESOURCE_IRQ,
1316 },
1317};
1318
1319static struct msm_rot_clocks rotator_clocks[] = {
1320 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001321 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001322 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07001323 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001324 },
1325 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07001326 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001327 .clk_type = ROTATOR_PCLK,
1328 .clk_rate = 0,
1329 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001330};
1331
1332static struct msm_rotator_platform_data rotator_pdata = {
1333 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1334 .hardware_version_number = 0x01020309,
1335 .rotator_clks = rotator_clocks,
1336 .regulator_name = "fs_rot",
1337};
1338
1339struct platform_device msm_rotator_device = {
1340 .name = "msm_rotator",
1341 .id = 0,
1342 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1343 .resource = resources_msm_rotator,
1344 .dev = {
1345 .platform_data = &rotator_pdata,
1346 },
1347};
1348#endif
1349
1350#define MIPI_DSI_HW_BASE 0x04700000
1351#define MDP_HW_BASE 0x05100000
1352
1353static struct resource msm_mipi_dsi1_resources[] = {
1354 {
1355 .name = "mipi_dsi",
1356 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001357 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001358 .flags = IORESOURCE_MEM,
1359 },
1360 {
1361 .start = DSI1_IRQ,
1362 .end = DSI1_IRQ,
1363 .flags = IORESOURCE_IRQ,
1364 },
1365};
1366
1367struct platform_device msm_mipi_dsi1_device = {
1368 .name = "mipi_dsi",
1369 .id = 1,
1370 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
1371 .resource = msm_mipi_dsi1_resources,
1372};
1373
1374static struct resource msm_mdp_resources[] = {
1375 {
1376 .name = "mdp",
1377 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001378 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001379 .flags = IORESOURCE_MEM,
1380 },
1381 {
1382 .start = MDP_IRQ,
1383 .end = MDP_IRQ,
1384 .flags = IORESOURCE_IRQ,
1385 },
1386};
1387
1388static struct platform_device msm_mdp_device = {
1389 .name = "mdp",
1390 .id = 0,
1391 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1392 .resource = msm_mdp_resources,
1393};
1394
1395static void __init msm_register_device(struct platform_device *pdev, void *data)
1396{
1397 int ret;
1398
1399 pdev->dev.platform_data = data;
1400 ret = platform_device_register(pdev);
1401 if (ret)
1402 dev_err(&pdev->dev,
1403 "%s: platform_device_register() failed = %d\n",
1404 __func__, ret);
1405}
1406
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001407#ifdef CONFIG_MSM_BUS_SCALING
1408static struct platform_device msm_dtv_device = {
1409 .name = "dtv",
1410 .id = 0,
1411};
1412#endif
1413
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001414void __init msm_fb_register_device(char *name, void *data)
1415{
1416 if (!strncmp(name, "mdp", 3))
1417 msm_register_device(&msm_mdp_device, data);
1418 else if (!strncmp(name, "mipi_dsi", 8))
1419 msm_register_device(&msm_mipi_dsi1_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001420#ifdef CONFIG_MSM_BUS_SCALING
1421 else if (!strncmp(name, "dtv", 3))
1422 msm_register_device(&msm_dtv_device, data);
1423#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001424 else
1425 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1426}
1427
1428static struct resource resources_sps[] = {
1429 {
1430 .name = "pipe_mem",
1431 .start = 0x12800000,
1432 .end = 0x12800000 + 0x4000 - 1,
1433 .flags = IORESOURCE_MEM,
1434 },
1435 {
1436 .name = "bamdma_dma",
1437 .start = 0x12240000,
1438 .end = 0x12240000 + 0x1000 - 1,
1439 .flags = IORESOURCE_MEM,
1440 },
1441 {
1442 .name = "bamdma_bam",
1443 .start = 0x12244000,
1444 .end = 0x12244000 + 0x4000 - 1,
1445 .flags = IORESOURCE_MEM,
1446 },
1447 {
1448 .name = "bamdma_irq",
1449 .start = SPS_BAM_DMA_IRQ,
1450 .end = SPS_BAM_DMA_IRQ,
1451 .flags = IORESOURCE_IRQ,
1452 },
1453};
1454
1455struct msm_sps_platform_data msm_sps_pdata = {
1456 .bamdma_restricted_pipes = 0x06,
1457};
1458
1459struct platform_device msm_device_sps = {
1460 .name = "msm_sps",
1461 .id = -1,
1462 .num_resources = ARRAY_SIZE(resources_sps),
1463 .resource = resources_sps,
1464 .dev.platform_data = &msm_sps_pdata,
1465};
1466
1467#ifdef CONFIG_MSM_MPM
1468static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001469 [1] = MSM_GPIO_TO_INT(46),
1470 [2] = MSM_GPIO_TO_INT(150),
1471 [4] = MSM_GPIO_TO_INT(103),
1472 [5] = MSM_GPIO_TO_INT(104),
1473 [6] = MSM_GPIO_TO_INT(105),
1474 [7] = MSM_GPIO_TO_INT(106),
1475 [8] = MSM_GPIO_TO_INT(107),
1476 [9] = MSM_GPIO_TO_INT(7),
1477 [10] = MSM_GPIO_TO_INT(11),
1478 [11] = MSM_GPIO_TO_INT(15),
1479 [12] = MSM_GPIO_TO_INT(19),
1480 [13] = MSM_GPIO_TO_INT(23),
1481 [14] = MSM_GPIO_TO_INT(27),
1482 [15] = MSM_GPIO_TO_INT(31),
1483 [16] = MSM_GPIO_TO_INT(35),
1484 [19] = MSM_GPIO_TO_INT(90),
1485 [20] = MSM_GPIO_TO_INT(92),
1486 [23] = MSM_GPIO_TO_INT(85),
1487 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001488 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001489 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001490 [29] = MSM_GPIO_TO_INT(10),
1491 [30] = MSM_GPIO_TO_INT(102),
1492 [31] = MSM_GPIO_TO_INT(81),
1493 [32] = MSM_GPIO_TO_INT(78),
1494 [33] = MSM_GPIO_TO_INT(94),
1495 [34] = MSM_GPIO_TO_INT(72),
1496 [35] = MSM_GPIO_TO_INT(39),
1497 [36] = MSM_GPIO_TO_INT(43),
1498 [37] = MSM_GPIO_TO_INT(61),
1499 [38] = MSM_GPIO_TO_INT(50),
1500 [39] = MSM_GPIO_TO_INT(42),
1501 [41] = MSM_GPIO_TO_INT(62),
1502 [42] = MSM_GPIO_TO_INT(76),
1503 [43] = MSM_GPIO_TO_INT(75),
1504 [44] = MSM_GPIO_TO_INT(70),
1505 [45] = MSM_GPIO_TO_INT(69),
1506 [46] = MSM_GPIO_TO_INT(67),
1507 [47] = MSM_GPIO_TO_INT(65),
1508 [48] = MSM_GPIO_TO_INT(58),
1509 [49] = MSM_GPIO_TO_INT(54),
1510 [50] = MSM_GPIO_TO_INT(52),
1511 [51] = MSM_GPIO_TO_INT(49),
1512 [52] = MSM_GPIO_TO_INT(40),
1513 [53] = MSM_GPIO_TO_INT(37),
1514 [54] = MSM_GPIO_TO_INT(24),
1515 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001516};
1517
1518static uint16_t msm_mpm_bypassed_apps_irqs[] = {
1519 TLMM_MSM_SUMMARY_IRQ,
1520 RPM_APCC_CPU0_GP_HIGH_IRQ,
1521 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1522 RPM_APCC_CPU0_GP_LOW_IRQ,
1523 RPM_APCC_CPU0_WAKE_UP_IRQ,
1524 RPM_APCC_CPU1_GP_HIGH_IRQ,
1525 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1526 RPM_APCC_CPU1_GP_LOW_IRQ,
1527 RPM_APCC_CPU1_WAKE_UP_IRQ,
1528 MSS_TO_APPS_IRQ_0,
1529 MSS_TO_APPS_IRQ_1,
1530 MSS_TO_APPS_IRQ_2,
1531 MSS_TO_APPS_IRQ_3,
1532 MSS_TO_APPS_IRQ_4,
1533 MSS_TO_APPS_IRQ_5,
1534 MSS_TO_APPS_IRQ_6,
1535 MSS_TO_APPS_IRQ_7,
1536 MSS_TO_APPS_IRQ_8,
1537 MSS_TO_APPS_IRQ_9,
1538 LPASS_SCSS_GP_LOW_IRQ,
1539 LPASS_SCSS_GP_MEDIUM_IRQ,
1540 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07001541 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001542 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07001543 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07001544 RIVA_APPS_WLAN_SMSM_IRQ,
1545 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1546 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001547};
1548
1549struct msm_mpm_device_data msm_mpm_dev_data = {
1550 .irqs_m2a = msm_mpm_irqs_m2a,
1551 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1552 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1553 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1554 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1555 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1556 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1557 .mpm_apps_ipc_val = BIT(1),
1558 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1559
1560};
1561#endif
1562
Stephen Boydbb600ae2011-08-02 20:11:40 -07001563static struct clk_lookup msm_clocks_8960_dummy[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001564 CLK_DUMMY("pll2", PLL2, NULL, 0),
1565 CLK_DUMMY("pll8", PLL8, NULL, 0),
1566 CLK_DUMMY("pll4", PLL4, NULL, 0),
1567
1568 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1569 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1570 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1571 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1572 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1573 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1574 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1575 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1576 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1577 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1578 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1579 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1580 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1581 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1582 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1583 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1584
Matt Wagantalle2522372011-08-17 14:52:21 -07001585 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
1586 CLK_DUMMY("core_clk", GSBI2_UART_CLK, "msm_serial_hsl.0", OFF),
1587 CLK_DUMMY("core_clk", GSBI3_UART_CLK, NULL, OFF),
1588 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
1589 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
1590 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
1591 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
1592 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
1593 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
1594 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
1595 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
1596 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001597 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
1598 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
1599 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, NULL, OFF),
1600 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
1601 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, NULL, OFF),
1602 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
1603 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
1604 CLK_DUMMY("core_clk", GSBI8_QUP_CLK, NULL, OFF),
1605 CLK_DUMMY("core_clk", GSBI9_QUP_CLK, NULL, OFF),
1606 CLK_DUMMY("core_clk", GSBI10_QUP_CLK, NULL, OFF),
1607 CLK_DUMMY("core_clk", GSBI11_QUP_CLK, NULL, OFF),
1608 CLK_DUMMY("core_clk", GSBI12_QUP_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001609 CLK_DUMMY("core_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07001610 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Matt Wagantallc1205292011-08-11 17:19:31 -07001611 CLK_DUMMY("core_clk", PRNG_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001612 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
1613 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
1614 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
1615 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
1616 CLK_DUMMY("core_clk", SDC5_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001617 CLK_DUMMY("core_clk", TSIF_REF_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001618 CLK_DUMMY("core_clk", TSSC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001619 CLK_DUMMY("usb_hs_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1620 CLK_DUMMY("usb_phy_clk", USB_PHY0_CLK, NULL, OFF),
1621 CLK_DUMMY("usb_fs_src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1622 CLK_DUMMY("usb_fs_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1623 CLK_DUMMY("usb_fs_sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
1624 CLK_DUMMY("usb_fs_src_clk", USB_FS2_SRC_CLK, NULL, OFF),
1625 CLK_DUMMY("usb_fs_clk", USB_FS2_XCVR_CLK, NULL, OFF),
1626 CLK_DUMMY("usb_fs_sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07001627 CLK_DUMMY("iface_clk", CE2_CLK, "qce.0", OFF),
1628 CLK_DUMMY("core_clk", CE1_CORE_CLK, "qce.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001629 CLK_DUMMY("iface_clk", GSBI1_P_CLK, "spi_qsd.0", OFF),
1630 CLK_DUMMY("iface_clk", GSBI2_P_CLK,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001631 "msm_serial_hsl.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001632 CLK_DUMMY("iface_clk", GSBI3_P_CLK, NULL, OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07001633 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001634 CLK_DUMMY("iface_clk", GSBI5_P_CLK, NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07001635 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001636 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
1637 CLK_DUMMY("iface_clk", GSBI8_P_CLK, NULL, OFF),
1638 CLK_DUMMY("iface_clk", GSBI9_P_CLK, NULL, OFF),
1639 CLK_DUMMY("iface_clk", GSBI10_P_CLK, NULL, OFF),
1640 CLK_DUMMY("iface_clk", GSBI11_P_CLK, NULL, OFF),
1641 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
1642 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001643 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001644 CLK_DUMMY("usb_fs_pclk", USB_FS1_P_CLK, NULL, OFF),
1645 CLK_DUMMY("usb_fs_pclk", USB_FS2_P_CLK, NULL, OFF),
1646 CLK_DUMMY("usb_hs_pclk", USB_HS1_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001647 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
1648 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
1649 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
1650 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
1651 CLK_DUMMY("iface_clk", SDC5_P_CLK, NULL, OFF),
Matt Wagantalle1a86062011-08-18 17:46:10 -07001652 CLK_DUMMY("core_clk", ADM0_CLK, NULL, OFF),
1653 CLK_DUMMY("iface_clk", ADM0_P_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001654 CLK_DUMMY("iface_clk", PMIC_ARB0_P_CLK, NULL, OFF),
1655 CLK_DUMMY("iface_clk", PMIC_ARB1_P_CLK, NULL, OFF),
1656 CLK_DUMMY("core_clk", PMIC_SSBI2_CLK, NULL, OFF),
1657 CLK_DUMMY("mem_clk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1658 CLK_DUMMY("core_clk", AMP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001659 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1660 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1661 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1662 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1663 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1664 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1665 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1666 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1667 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1668 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1669 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1670 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
1671 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
1672 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
1673 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001674 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, OFF),
1675 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, OFF),
1676 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001677 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001678 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001679 CLK_DUMMY("core_clk", JPEGD_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001680 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1681 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1682 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001683 CLK_DUMMY("core_clk", ROT_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001684 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
1685 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
1686 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001687 CLK_DUMMY("core_clk", VCODEC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001688 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
1689 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
1690 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
1691 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1692 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1693 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1694 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1695 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1696 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001697 CLK_DUMMY("bus_clk", ROT_AXI_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001698 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
1699 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
1700 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
1701 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
1702 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
1703 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
1704 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
1705 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
1706 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
1707 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001708 CLK_DUMMY("iface_clk", GFX2D0_P_CLK, NULL, OFF),
1709 CLK_DUMMY("iface_clk", GFX2D1_P_CLK, NULL, OFF),
1710 CLK_DUMMY("iface_clk", GFX3D_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001711 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
1712 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
1713 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
1714 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001715 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001716 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07001717 CLK_DUMMY("iface_clk", SMMU_P_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001718 CLK_DUMMY("iface_clk", ROT_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001719 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
1720 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
1721 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
1722 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
1723 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
1724 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
1725 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
1726 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
1727 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
1728 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
1729 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
1730 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
1731 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
1732 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
1733 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07001734 CLK_DUMMY("core_clk", JPEGD_AXI_CLK, NULL, 0),
1735 CLK_DUMMY("core_clk", VFE_AXI_CLK, NULL, 0),
1736 CLK_DUMMY("core_clk", VCODEC_AXI_CLK, NULL, 0),
1737 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, 0),
1738 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, 0),
1739 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001740
1741 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
1742 CLK_DUMMY("dfab_usb_hs_clk", DFAB_USB_HS_CLK, NULL, 0),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001743 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
1744 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
1745 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
1746 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
1747 CLK_DUMMY("bus_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001748 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1749 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
1750};
1751
Stephen Boydbb600ae2011-08-02 20:11:40 -07001752struct clock_init_data msm8960_dummy_clock_init_data __initdata = {
1753 .table = msm_clocks_8960_dummy,
1754 .size = ARRAY_SIZE(msm_clocks_8960_dummy),
1755};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001756
1757#define LPASS_SLIMBUS_PHYS 0x28080000
1758#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06001759#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001760/* Board info for the slimbus slave device */
1761static struct resource slimbus_res[] = {
1762 {
1763 .start = LPASS_SLIMBUS_PHYS,
1764 .end = LPASS_SLIMBUS_PHYS + 8191,
1765 .flags = IORESOURCE_MEM,
1766 .name = "slimbus_physical",
1767 },
1768 {
1769 .start = LPASS_SLIMBUS_BAM_PHYS,
1770 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
1771 .flags = IORESOURCE_MEM,
1772 .name = "slimbus_bam_physical",
1773 },
1774 {
Sagar Dhariacc969452011-09-19 10:34:30 -06001775 .start = LPASS_SLIMBUS_SLEW,
1776 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
1777 .flags = IORESOURCE_MEM,
1778 .name = "slimbus_slew_reg",
1779 },
1780 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001781 .start = SLIMBUS0_CORE_EE1_IRQ,
1782 .end = SLIMBUS0_CORE_EE1_IRQ,
1783 .flags = IORESOURCE_IRQ,
1784 .name = "slimbus_irq",
1785 },
1786 {
1787 .start = SLIMBUS0_BAM_EE1_IRQ,
1788 .end = SLIMBUS0_BAM_EE1_IRQ,
1789 .flags = IORESOURCE_IRQ,
1790 .name = "slimbus_bam_irq",
1791 },
1792};
1793
1794struct platform_device msm_slim_ctrl = {
1795 .name = "msm_slim_ctrl",
1796 .id = 1,
1797 .num_resources = ARRAY_SIZE(slimbus_res),
1798 .resource = slimbus_res,
1799 .dev = {
1800 .coherent_dma_mask = 0xffffffffULL,
1801 },
1802};
1803
1804#ifdef CONFIG_MSM_BUS_SCALING
1805static struct msm_bus_vectors grp3d_init_vectors[] = {
1806 {
1807 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1808 .dst = MSM_BUS_SLAVE_EBI_CH0,
1809 .ab = 0,
1810 .ib = 0,
1811 },
1812};
1813
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001814static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001815 {
1816 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1817 .dst = MSM_BUS_SLAVE_EBI_CH0,
1818 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001819 .ib = KGSL_CONVERT_TO_MBPS(1200),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001820 },
1821};
1822
1823static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
1824 {
1825 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1826 .dst = MSM_BUS_SLAVE_EBI_CH0,
1827 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001828 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001829 },
1830};
1831
1832static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
1833 {
1834 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1835 .dst = MSM_BUS_SLAVE_EBI_CH0,
1836 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001837 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001838 },
1839};
1840
1841static struct msm_bus_vectors grp3d_max_vectors[] = {
1842 {
1843 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1844 .dst = MSM_BUS_SLAVE_EBI_CH0,
1845 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001846 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001847 },
1848};
1849
1850static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
1851 {
1852 ARRAY_SIZE(grp3d_init_vectors),
1853 grp3d_init_vectors,
1854 },
1855 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001856 ARRAY_SIZE(grp3d_low_vectors),
1857 grp3d_low_vectors,
1858 },
1859 {
1860 ARRAY_SIZE(grp3d_nominal_low_vectors),
1861 grp3d_nominal_low_vectors,
1862 },
1863 {
1864 ARRAY_SIZE(grp3d_nominal_high_vectors),
1865 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001866 },
1867 {
1868 ARRAY_SIZE(grp3d_max_vectors),
1869 grp3d_max_vectors,
1870 },
1871};
1872
1873static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
1874 grp3d_bus_scale_usecases,
1875 ARRAY_SIZE(grp3d_bus_scale_usecases),
1876 .name = "grp3d",
1877};
1878
1879static struct msm_bus_vectors grp2d0_init_vectors[] = {
1880 {
1881 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1882 .dst = MSM_BUS_SLAVE_EBI_CH0,
1883 .ab = 0,
1884 .ib = 0,
1885 },
1886};
1887
1888static struct msm_bus_vectors grp2d0_max_vectors[] = {
1889 {
1890 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1891 .dst = MSM_BUS_SLAVE_EBI_CH0,
1892 .ab = 0,
Suman Tatiraju903a0ef2011-09-30 16:53:57 -07001893 .ib = KGSL_CONVERT_TO_MBPS(1200),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001894 },
1895};
1896
1897static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
1898 {
1899 ARRAY_SIZE(grp2d0_init_vectors),
1900 grp2d0_init_vectors,
1901 },
1902 {
1903 ARRAY_SIZE(grp2d0_max_vectors),
1904 grp2d0_max_vectors,
1905 },
1906};
1907
1908struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
1909 grp2d0_bus_scale_usecases,
1910 ARRAY_SIZE(grp2d0_bus_scale_usecases),
1911 .name = "grp2d0",
1912};
1913
1914static struct msm_bus_vectors grp2d1_init_vectors[] = {
1915 {
1916 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1917 .dst = MSM_BUS_SLAVE_EBI_CH0,
1918 .ab = 0,
1919 .ib = 0,
1920 },
1921};
1922
1923static struct msm_bus_vectors grp2d1_max_vectors[] = {
1924 {
1925 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1926 .dst = MSM_BUS_SLAVE_EBI_CH0,
1927 .ab = 0,
Suman Tatiraju903a0ef2011-09-30 16:53:57 -07001928 .ib = KGSL_CONVERT_TO_MBPS(1200),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001929 },
1930};
1931
1932static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
1933 {
1934 ARRAY_SIZE(grp2d1_init_vectors),
1935 grp2d1_init_vectors,
1936 },
1937 {
1938 ARRAY_SIZE(grp2d1_max_vectors),
1939 grp2d1_max_vectors,
1940 },
1941};
1942
1943struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
1944 grp2d1_bus_scale_usecases,
1945 ARRAY_SIZE(grp2d1_bus_scale_usecases),
1946 .name = "grp2d1",
1947};
1948#endif
1949
1950static struct resource kgsl_3d0_resources[] = {
1951 {
1952 .name = KGSL_3D0_REG_MEMORY,
1953 .start = 0x04300000, /* GFX3D address */
1954 .end = 0x0431ffff,
1955 .flags = IORESOURCE_MEM,
1956 },
1957 {
1958 .name = KGSL_3D0_IRQ,
1959 .start = GFX3D_IRQ,
1960 .end = GFX3D_IRQ,
1961 .flags = IORESOURCE_IRQ,
1962 },
1963};
1964
1965static struct kgsl_device_platform_data kgsl_3d0_pdata = {
1966 .pwr_data = {
1967 .pwrlevel = {
1968 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001969 .gpu_freq = 400000000,
1970 .bus_freq = 4,
1971 },
1972 {
1973 .gpu_freq = 300000000,
1974 .bus_freq = 3,
1975 },
1976 {
1977 .gpu_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001978 .bus_freq = 2,
1979 },
1980 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001981 .gpu_freq = 128000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001982 .bus_freq = 1,
1983 },
1984 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001985 .gpu_freq = 27000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001986 .bus_freq = 0,
1987 },
1988 },
Lucille Sylvester5d0ac132011-09-21 10:15:01 -06001989 .init_level = 0,
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001990 .num_levels = 5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001991 .set_grp_async = NULL,
1992 .idle_timeout = HZ/5,
Jeremy Gebbend3342ee2011-10-18 09:53:17 -06001993 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001994 },
1995 .clk = {
1996 .name = {
Matt Wagantall9dc01632011-08-17 18:55:04 -07001997 .clk = "core_clk",
1998 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001999 },
2000#ifdef CONFIG_MSM_BUS_SCALING
2001 .bus_scale_table = &grp3d_bus_scale_pdata,
2002#endif
2003 },
2004 .imem_clk_name = {
2005 .clk = NULL,
Matt Wagantall9dc01632011-08-17 18:55:04 -07002006 .pclk = "mem_iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002007 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06002008 .iommu_user_ctx_name = "gfx3d_user",
2009 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002010};
2011
2012struct platform_device msm_kgsl_3d0 = {
2013 .name = "kgsl-3d0",
2014 .id = 0,
2015 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2016 .resource = kgsl_3d0_resources,
2017 .dev = {
2018 .platform_data = &kgsl_3d0_pdata,
2019 },
2020};
2021
2022static struct resource kgsl_2d0_resources[] = {
2023 {
2024 .name = KGSL_2D0_REG_MEMORY,
2025 .start = 0x04100000, /* Z180 base address */
2026 .end = 0x04100FFF,
2027 .flags = IORESOURCE_MEM,
2028 },
2029 {
2030 .name = KGSL_2D0_IRQ,
2031 .start = GFX2D0_IRQ,
2032 .end = GFX2D0_IRQ,
2033 .flags = IORESOURCE_IRQ,
2034 },
2035};
2036
2037static struct kgsl_device_platform_data kgsl_2d0_pdata = {
2038 .pwr_data = {
2039 .pwrlevel = {
2040 {
2041 .gpu_freq = 200000000,
2042 .bus_freq = 1,
2043 },
2044 {
2045 .gpu_freq = 200000000,
2046 .bus_freq = 0,
2047 },
2048 },
2049 .init_level = 0,
2050 .num_levels = 2,
2051 .set_grp_async = NULL,
2052 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002053 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002054 },
2055 .clk = {
2056 .name = {
2057 /* note: 2d clocks disabled on v1 */
Matt Wagantall9dc01632011-08-17 18:55:04 -07002058 .clk = "core_clk",
2059 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002060 },
2061#ifdef CONFIG_MSM_BUS_SCALING
2062 .bus_scale_table = &grp2d0_bus_scale_pdata,
2063#endif
2064 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06002065 .iommu_user_ctx_name = "gfx2d0_2d0",
2066 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002067};
2068
2069struct platform_device msm_kgsl_2d0 = {
2070 .name = "kgsl-2d0",
2071 .id = 0,
2072 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2073 .resource = kgsl_2d0_resources,
2074 .dev = {
2075 .platform_data = &kgsl_2d0_pdata,
2076 },
2077};
2078
2079static struct resource kgsl_2d1_resources[] = {
2080 {
2081 .name = KGSL_2D1_REG_MEMORY,
2082 .start = 0x04200000, /* Z180 device 1 base address */
2083 .end = 0x04200FFF,
2084 .flags = IORESOURCE_MEM,
2085 },
2086 {
2087 .name = KGSL_2D1_IRQ,
2088 .start = GFX2D1_IRQ,
2089 .end = GFX2D1_IRQ,
2090 .flags = IORESOURCE_IRQ,
2091 },
2092};
2093
2094static struct kgsl_device_platform_data kgsl_2d1_pdata = {
2095 .pwr_data = {
2096 .pwrlevel = {
2097 {
2098 .gpu_freq = 200000000,
2099 .bus_freq = 1,
2100 },
2101 {
2102 .gpu_freq = 200000000,
2103 .bus_freq = 0,
2104 },
2105 },
2106 .init_level = 0,
2107 .num_levels = 2,
2108 .set_grp_async = NULL,
2109 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002110 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002111 },
2112 .clk = {
2113 .name = {
Matt Wagantall9dc01632011-08-17 18:55:04 -07002114 .clk = "core_clk",
2115 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002116 },
2117#ifdef CONFIG_MSM_BUS_SCALING
2118 .bus_scale_table = &grp2d1_bus_scale_pdata,
2119#endif
2120 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06002121 .iommu_user_ctx_name = "gfx2d1_2d1",
2122 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002123};
2124
2125struct platform_device msm_kgsl_2d1 = {
2126 .name = "kgsl-2d1",
2127 .id = 1,
2128 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2129 .resource = kgsl_2d1_resources,
2130 .dev = {
2131 .platform_data = &kgsl_2d1_pdata,
2132 },
2133};
2134
2135#ifdef CONFIG_MSM_GEMINI
2136static struct resource msm_gemini_resources[] = {
2137 {
2138 .start = 0x04600000,
2139 .end = 0x04600000 + SZ_1M - 1,
2140 .flags = IORESOURCE_MEM,
2141 },
2142 {
2143 .start = JPEG_IRQ,
2144 .end = JPEG_IRQ,
2145 .flags = IORESOURCE_IRQ,
2146 },
2147};
2148
2149struct platform_device msm8960_gemini_device = {
2150 .name = "msm_gemini",
2151 .resource = msm_gemini_resources,
2152 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2153};
2154#endif
2155
2156struct msm_rpm_map_data rpm_map_data[] __initdata = {
2157 MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2158 MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2159
2160 MSM_RPM_MAP(RPM_CTL, RPM_CTL, 1),
2161
2162 MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1),
2163 MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1),
2164 MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2165 MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2166 MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2167 MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2168 MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1),
2169 MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1),
2170 MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1),
2171 MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1),
2172
2173 MSM_RPM_MAP(APPS_FABRIC_CFG_HALT_0, APPS_FABRIC_CFG_HALT, 2),
2174 MSM_RPM_MAP(APPS_FABRIC_CFG_CLKMOD_0, APPS_FABRIC_CFG_CLKMOD, 3),
2175 MSM_RPM_MAP(APPS_FABRIC_CFG_IOCTL, APPS_FABRIC_CFG_IOCTL, 1),
2176 MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2177
2178 MSM_RPM_MAP(SYS_FABRIC_CFG_HALT_0, SYS_FABRIC_CFG_HALT, 2),
2179 MSM_RPM_MAP(SYS_FABRIC_CFG_CLKMOD_0, SYS_FABRIC_CFG_CLKMOD, 3),
2180 MSM_RPM_MAP(SYS_FABRIC_CFG_IOCTL, SYS_FABRIC_CFG_IOCTL, 1),
Eugene Seahd9040ad2011-07-11 13:20:54 -06002181 MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 29),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002182
2183 MSM_RPM_MAP(MMSS_FABRIC_CFG_HALT_0, MMSS_FABRIC_CFG_HALT, 2),
2184 MSM_RPM_MAP(MMSS_FABRIC_CFG_CLKMOD_0, MMSS_FABRIC_CFG_CLKMOD, 3),
2185 MSM_RPM_MAP(MMSS_FABRIC_CFG_IOCTL, MMSS_FABRIC_CFG_IOCTL, 1),
2186 MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2187
2188 MSM_RPM_MAP(PM8921_S1_0, PM8921_S1, 2),
2189 MSM_RPM_MAP(PM8921_S2_0, PM8921_S2, 2),
2190 MSM_RPM_MAP(PM8921_S3_0, PM8921_S3, 2),
2191 MSM_RPM_MAP(PM8921_S4_0, PM8921_S4, 2),
2192 MSM_RPM_MAP(PM8921_S5_0, PM8921_S5, 2),
2193 MSM_RPM_MAP(PM8921_S6_0, PM8921_S6, 2),
2194 MSM_RPM_MAP(PM8921_S7_0, PM8921_S7, 2),
2195 MSM_RPM_MAP(PM8921_S8_0, PM8921_S8, 2),
2196 MSM_RPM_MAP(PM8921_L1_0, PM8921_L1, 2),
2197 MSM_RPM_MAP(PM8921_L2_0, PM8921_L2, 2),
2198 MSM_RPM_MAP(PM8921_L3_0, PM8921_L3, 2),
2199 MSM_RPM_MAP(PM8921_L4_0, PM8921_L4, 2),
2200 MSM_RPM_MAP(PM8921_L5_0, PM8921_L5, 2),
2201 MSM_RPM_MAP(PM8921_L6_0, PM8921_L6, 2),
2202 MSM_RPM_MAP(PM8921_L7_0, PM8921_L7, 2),
2203 MSM_RPM_MAP(PM8921_L8_0, PM8921_L8, 2),
2204 MSM_RPM_MAP(PM8921_L9_0, PM8921_L9, 2),
2205 MSM_RPM_MAP(PM8921_L10_0, PM8921_L10, 2),
2206 MSM_RPM_MAP(PM8921_L11_0, PM8921_L11, 2),
2207 MSM_RPM_MAP(PM8921_L12_0, PM8921_L12, 2),
2208 MSM_RPM_MAP(PM8921_L13_0, PM8921_L13, 2),
2209 MSM_RPM_MAP(PM8921_L14_0, PM8921_L14, 2),
2210 MSM_RPM_MAP(PM8921_L15_0, PM8921_L15, 2),
2211 MSM_RPM_MAP(PM8921_L16_0, PM8921_L16, 2),
2212 MSM_RPM_MAP(PM8921_L17_0, PM8921_L17, 2),
2213 MSM_RPM_MAP(PM8921_L18_0, PM8921_L18, 2),
2214 MSM_RPM_MAP(PM8921_L19_0, PM8921_L19, 2),
2215 MSM_RPM_MAP(PM8921_L20_0, PM8921_L20, 2),
2216 MSM_RPM_MAP(PM8921_L21_0, PM8921_L21, 2),
2217 MSM_RPM_MAP(PM8921_L22_0, PM8921_L22, 2),
2218 MSM_RPM_MAP(PM8921_L23_0, PM8921_L23, 2),
2219 MSM_RPM_MAP(PM8921_L24_0, PM8921_L24, 2),
2220 MSM_RPM_MAP(PM8921_L25_0, PM8921_L25, 2),
2221 MSM_RPM_MAP(PM8921_L26_0, PM8921_L26, 2),
2222 MSM_RPM_MAP(PM8921_L27_0, PM8921_L27, 2),
2223 MSM_RPM_MAP(PM8921_L28_0, PM8921_L28, 2),
2224 MSM_RPM_MAP(PM8921_L29_0, PM8921_L29, 2),
2225 MSM_RPM_MAP(PM8921_CLK1_0, PM8921_CLK1, 2),
2226 MSM_RPM_MAP(PM8921_CLK2_0, PM8921_CLK2, 2),
2227 MSM_RPM_MAP(PM8921_LVS1, PM8921_LVS1, 1),
2228 MSM_RPM_MAP(PM8921_LVS2, PM8921_LVS2, 1),
2229 MSM_RPM_MAP(PM8921_LVS3, PM8921_LVS3, 1),
2230 MSM_RPM_MAP(PM8921_LVS4, PM8921_LVS4, 1),
2231 MSM_RPM_MAP(PM8921_LVS5, PM8921_LVS5, 1),
2232 MSM_RPM_MAP(PM8921_LVS6, PM8921_LVS6, 1),
2233 MSM_RPM_MAP(PM8921_LVS7, PM8921_LVS7, 1),
2234 MSM_RPM_MAP(NCP_0, NCP, 2),
2235 MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1),
2236 MSM_RPM_MAP(USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2237 MSM_RPM_MAP(HDMI_SWITCH, HDMI_SWITCH, 1),
Praveen Chidambaram27658c22011-07-07 11:00:49 -06002238 MSM_RPM_MAP(DDR_DMM_0, DDR_DMM, 2),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002239
2240};
2241unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data);
2242
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002243struct platform_device msm_rpm_device = {
2244 .name = "msm_rpm",
2245 .id = -1,
2246};
2247
2248
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002249struct platform_device msm_bus_sys_fabric = {
2250 .name = "msm_bus_fabric",
2251 .id = MSM_BUS_FAB_SYSTEM,
2252};
2253struct platform_device msm_bus_apps_fabric = {
2254 .name = "msm_bus_fabric",
2255 .id = MSM_BUS_FAB_APPSS,
2256};
2257struct platform_device msm_bus_mm_fabric = {
2258 .name = "msm_bus_fabric",
2259 .id = MSM_BUS_FAB_MMSS,
2260};
2261struct platform_device msm_bus_sys_fpb = {
2262 .name = "msm_bus_fabric",
2263 .id = MSM_BUS_FAB_SYSTEM_FPB,
2264};
2265struct platform_device msm_bus_cpss_fpb = {
2266 .name = "msm_bus_fabric",
2267 .id = MSM_BUS_FAB_CPSS_FPB,
2268};
2269
2270/* Sensors DSPS platform data */
2271#ifdef CONFIG_MSM_DSPS
2272
2273#define PPSS_REG_PHYS_BASE 0x12080000
2274
2275static struct dsps_clk_info dsps_clks[] = {};
2276static struct dsps_regulator_info dsps_regs[] = {};
2277
2278/*
2279 * Note: GPIOs field is intialized in run-time at the function
2280 * msm8960_init_dsps().
2281 */
2282
2283struct msm_dsps_platform_data msm_dsps_pdata = {
2284 .clks = dsps_clks,
2285 .clks_num = ARRAY_SIZE(dsps_clks),
2286 .gpios = NULL,
2287 .gpios_num = 0,
2288 .regs = dsps_regs,
2289 .regs_num = ARRAY_SIZE(dsps_regs),
2290 .dsps_pwr_ctl_en = 1,
2291 .signature = DSPS_SIGNATURE,
2292};
2293
2294static struct resource msm_dsps_resources[] = {
2295 {
2296 .start = PPSS_REG_PHYS_BASE,
2297 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2298 .name = "ppss_reg",
2299 .flags = IORESOURCE_MEM,
2300 },
Wentao Xua55500b2011-08-16 18:15:04 -04002301
2302 {
2303 .start = PPSS_WDOG_TIMER_IRQ,
2304 .end = PPSS_WDOG_TIMER_IRQ,
2305 .name = "ppss_wdog",
2306 .flags = IORESOURCE_IRQ,
2307 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002308};
2309
2310struct platform_device msm_dsps_device = {
2311 .name = "msm_dsps",
2312 .id = 0,
2313 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2314 .resource = msm_dsps_resources,
2315 .dev.platform_data = &msm_dsps_pdata,
2316};
2317
2318#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07002319
2320#ifdef CONFIG_MSM_QDSS
2321
2322#define MSM_QDSS_PHYS_BASE 0x01A00000
2323#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
2324#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
2325#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
2326#define MSM_PTM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
2327
2328static struct resource msm_etb_resources[] = {
2329 {
2330 .start = MSM_ETB_PHYS_BASE,
2331 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
2332 .flags = IORESOURCE_MEM,
2333 },
2334};
2335
2336struct platform_device msm_etb_device = {
2337 .name = "msm_etb",
2338 .id = 0,
2339 .num_resources = ARRAY_SIZE(msm_etb_resources),
2340 .resource = msm_etb_resources,
2341};
2342
2343static struct resource msm_tpiu_resources[] = {
2344 {
2345 .start = MSM_TPIU_PHYS_BASE,
2346 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
2347 .flags = IORESOURCE_MEM,
2348 },
2349};
2350
2351struct platform_device msm_tpiu_device = {
2352 .name = "msm_tpiu",
2353 .id = 0,
2354 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
2355 .resource = msm_tpiu_resources,
2356};
2357
2358static struct resource msm_funnel_resources[] = {
2359 {
2360 .start = MSM_FUNNEL_PHYS_BASE,
2361 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
2362 .flags = IORESOURCE_MEM,
2363 },
2364};
2365
2366struct platform_device msm_funnel_device = {
2367 .name = "msm_funnel",
2368 .id = 0,
2369 .num_resources = ARRAY_SIZE(msm_funnel_resources),
2370 .resource = msm_funnel_resources,
2371};
2372
2373static struct resource msm_ptm_resources[] = {
2374 {
2375 .start = MSM_PTM_PHYS_BASE,
2376 .end = MSM_PTM_PHYS_BASE + (SZ_4K * 2) - 1,
2377 .flags = IORESOURCE_MEM,
2378 },
2379};
2380
2381struct platform_device msm_ptm_device = {
2382 .name = "msm_ptm",
2383 .id = 0,
2384 .num_resources = ARRAY_SIZE(msm_ptm_resources),
2385 .resource = msm_ptm_resources,
2386};
2387
2388#endif