blob: d3afac077e10d39e39af12c78e94eeb4b797c39a [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"
38
39#ifdef CONFIG_MSM_MPM
40#include "mpm.h"
41#endif
42#ifdef CONFIG_MSM_DSPS
43#include <mach/msm_dsps.h>
44#endif
45
46
47/* Address of GSBI blocks */
48#define MSM_GSBI1_PHYS 0x16000000
49#define MSM_GSBI2_PHYS 0x16100000
50#define MSM_GSBI3_PHYS 0x16200000
51#define MSM_GSBI4_PHYS 0x16300000
52#define MSM_GSBI5_PHYS 0x16400000
53#define MSM_GSBI6_PHYS 0x16500000
54#define MSM_GSBI7_PHYS 0x16600000
55#define MSM_GSBI8_PHYS 0x1A000000
56#define MSM_GSBI9_PHYS 0x1A100000
57#define MSM_GSBI10_PHYS 0x1A200000
58#define MSM_GSBI11_PHYS 0x12440000
59#define MSM_GSBI12_PHYS 0x12480000
60
61#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
62#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053063#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070064
65/* GSBI QUP devices */
66#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
67#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
68#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
69#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
70#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
71#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
72#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
73#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
74#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
75#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
76#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
77#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
78#define MSM_QUP_SIZE SZ_4K
79
80#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
81#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
82#define MSM_PMIC_SSBI_SIZE SZ_4K
83
84static struct resource resources_otg[] = {
85 {
86 .start = MSM8960_HSUSB_PHYS,
87 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
88 .flags = IORESOURCE_MEM,
89 },
90 {
91 .start = USB1_HS_IRQ,
92 .end = USB1_HS_IRQ,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -070097struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070098 .name = "msm_otg",
99 .id = -1,
100 .num_resources = ARRAY_SIZE(resources_otg),
101 .resource = resources_otg,
102 .dev = {
103 .coherent_dma_mask = 0xffffffff,
104 },
105};
106
107static struct resource resources_hsusb[] = {
108 {
109 .start = MSM8960_HSUSB_PHYS,
110 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
111 .flags = IORESOURCE_MEM,
112 },
113 {
114 .start = USB1_HS_IRQ,
115 .end = USB1_HS_IRQ,
116 .flags = IORESOURCE_IRQ,
117 },
118};
119
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700120struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700121 .name = "msm_hsusb",
122 .id = -1,
123 .num_resources = ARRAY_SIZE(resources_hsusb),
124 .resource = resources_hsusb,
125 .dev = {
126 .coherent_dma_mask = 0xffffffff,
127 },
128};
129
130static struct resource resources_hsusb_host[] = {
131 {
132 .start = MSM8960_HSUSB_PHYS,
133 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = USB1_HS_IRQ,
138 .end = USB1_HS_IRQ,
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530143static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700144struct platform_device msm_device_hsusb_host = {
145 .name = "msm_hsusb_host",
146 .id = -1,
147 .num_resources = ARRAY_SIZE(resources_hsusb_host),
148 .resource = resources_hsusb_host,
149 .dev = {
150 .dma_mask = &dma_mask,
151 .coherent_dma_mask = 0xffffffff,
152 },
153};
154
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530155static struct resource resources_hsic_host[] = {
156 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700157 .start = 0x12520000,
158 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530159 .flags = IORESOURCE_MEM,
160 },
161 {
162 .start = USB_HSIC_IRQ,
163 .end = USB_HSIC_IRQ,
164 .flags = IORESOURCE_IRQ,
165 },
166};
167
168struct platform_device msm_device_hsic_host = {
169 .name = "msm_hsic_host",
170 .id = -1,
171 .num_resources = ARRAY_SIZE(resources_hsic_host),
172 .resource = resources_hsic_host,
173 .dev = {
174 .dma_mask = &dma_mask,
175 .coherent_dma_mask = DMA_BIT_MASK(32),
176 },
177};
178
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700179static struct resource resources_uart_gsbi2[] = {
180 {
181 .start = MSM8960_GSBI2_UARTDM_IRQ,
182 .end = MSM8960_GSBI2_UARTDM_IRQ,
183 .flags = IORESOURCE_IRQ,
184 },
185 {
186 .start = MSM_UART2DM_PHYS,
187 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
188 .name = "uartdm_resource",
189 .flags = IORESOURCE_MEM,
190 },
191 {
192 .start = MSM_GSBI2_PHYS,
193 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
194 .name = "gsbi_resource",
195 .flags = IORESOURCE_MEM,
196 },
197};
198
199struct platform_device msm8960_device_uart_gsbi2 = {
200 .name = "msm_serial_hsl",
201 .id = 0,
202 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
203 .resource = resources_uart_gsbi2,
204};
Mayank Rana9f51f582011-08-04 18:35:59 +0530205/* GSBI 6 used into UARTDM Mode */
206static struct resource msm_uart_dm6_resources[] = {
207 {
208 .start = MSM_UART6DM_PHYS,
209 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
210 .name = "uartdm_resource",
211 .flags = IORESOURCE_MEM,
212 },
213 {
214 .start = GSBI6_UARTDM_IRQ,
215 .end = GSBI6_UARTDM_IRQ,
216 .flags = IORESOURCE_IRQ,
217 },
218 {
219 .start = MSM_GSBI6_PHYS,
220 .end = MSM_GSBI6_PHYS + 4 - 1,
221 .name = "gsbi_resource",
222 .flags = IORESOURCE_MEM,
223 },
224 {
225 .start = DMOV_HSUART_GSBI6_TX_CHAN,
226 .end = DMOV_HSUART_GSBI6_RX_CHAN,
227 .name = "uartdm_channels",
228 .flags = IORESOURCE_DMA,
229 },
230 {
231 .start = DMOV_HSUART_GSBI6_TX_CRCI,
232 .end = DMOV_HSUART_GSBI6_RX_CRCI,
233 .name = "uartdm_crci",
234 .flags = IORESOURCE_DMA,
235 },
236};
237static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
238struct platform_device msm_device_uart_dm6 = {
239 .name = "msm_serial_hs",
240 .id = 0,
241 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
242 .resource = msm_uart_dm6_resources,
243 .dev = {
244 .dma_mask = &msm_uart_dm6_dma_mask,
245 .coherent_dma_mask = DMA_BIT_MASK(32),
246 },
247};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700248
249static struct resource resources_uart_gsbi5[] = {
250 {
251 .start = GSBI5_UARTDM_IRQ,
252 .end = GSBI5_UARTDM_IRQ,
253 .flags = IORESOURCE_IRQ,
254 },
255 {
256 .start = MSM_UART5DM_PHYS,
257 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
258 .name = "uartdm_resource",
259 .flags = IORESOURCE_MEM,
260 },
261 {
262 .start = MSM_GSBI5_PHYS,
263 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
264 .name = "gsbi_resource",
265 .flags = IORESOURCE_MEM,
266 },
267};
268
269struct platform_device msm8960_device_uart_gsbi5 = {
270 .name = "msm_serial_hsl",
271 .id = 0,
272 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
273 .resource = resources_uart_gsbi5,
274};
275/* MSM Video core device */
276#ifdef CONFIG_MSM_BUS_SCALING
277static struct msm_bus_vectors vidc_init_vectors[] = {
278 {
279 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
280 .dst = MSM_BUS_SLAVE_EBI_CH0,
281 .ab = 0,
282 .ib = 0,
283 },
284 {
285 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
286 .dst = MSM_BUS_SLAVE_EBI_CH0,
287 .ab = 0,
288 .ib = 0,
289 },
290 {
291 .src = MSM_BUS_MASTER_AMPSS_M0,
292 .dst = MSM_BUS_SLAVE_EBI_CH0,
293 .ab = 0,
294 .ib = 0,
295 },
296 {
297 .src = MSM_BUS_MASTER_AMPSS_M0,
298 .dst = MSM_BUS_SLAVE_EBI_CH0,
299 .ab = 0,
300 .ib = 0,
301 },
302};
303static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
304 {
305 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
306 .dst = MSM_BUS_SLAVE_EBI_CH0,
307 .ab = 54525952,
308 .ib = 436207616,
309 },
310 {
311 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
312 .dst = MSM_BUS_SLAVE_EBI_CH0,
313 .ab = 72351744,
314 .ib = 289406976,
315 },
316 {
317 .src = MSM_BUS_MASTER_AMPSS_M0,
318 .dst = MSM_BUS_SLAVE_EBI_CH0,
319 .ab = 500000,
320 .ib = 1000000,
321 },
322 {
323 .src = MSM_BUS_MASTER_AMPSS_M0,
324 .dst = MSM_BUS_SLAVE_EBI_CH0,
325 .ab = 500000,
326 .ib = 1000000,
327 },
328};
329static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
330 {
331 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
332 .dst = MSM_BUS_SLAVE_EBI_CH0,
333 .ab = 40894464,
334 .ib = 327155712,
335 },
336 {
337 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
338 .dst = MSM_BUS_SLAVE_EBI_CH0,
339 .ab = 48234496,
340 .ib = 192937984,
341 },
342 {
343 .src = MSM_BUS_MASTER_AMPSS_M0,
344 .dst = MSM_BUS_SLAVE_EBI_CH0,
345 .ab = 500000,
346 .ib = 2000000,
347 },
348 {
349 .src = MSM_BUS_MASTER_AMPSS_M0,
350 .dst = MSM_BUS_SLAVE_EBI_CH0,
351 .ab = 500000,
352 .ib = 2000000,
353 },
354};
355static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
356 {
357 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
358 .dst = MSM_BUS_SLAVE_EBI_CH0,
359 .ab = 163577856,
360 .ib = 1308622848,
361 },
362 {
363 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
364 .dst = MSM_BUS_SLAVE_EBI_CH0,
365 .ab = 219152384,
366 .ib = 876609536,
367 },
368 {
369 .src = MSM_BUS_MASTER_AMPSS_M0,
370 .dst = MSM_BUS_SLAVE_EBI_CH0,
371 .ab = 1750000,
372 .ib = 3500000,
373 },
374 {
375 .src = MSM_BUS_MASTER_AMPSS_M0,
376 .dst = MSM_BUS_SLAVE_EBI_CH0,
377 .ab = 1750000,
378 .ib = 3500000,
379 },
380};
381static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
382 {
383 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
384 .dst = MSM_BUS_SLAVE_EBI_CH0,
385 .ab = 121634816,
386 .ib = 973078528,
387 },
388 {
389 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
390 .dst = MSM_BUS_SLAVE_EBI_CH0,
391 .ab = 155189248,
392 .ib = 620756992,
393 },
394 {
395 .src = MSM_BUS_MASTER_AMPSS_M0,
396 .dst = MSM_BUS_SLAVE_EBI_CH0,
397 .ab = 1750000,
398 .ib = 7000000,
399 },
400 {
401 .src = MSM_BUS_MASTER_AMPSS_M0,
402 .dst = MSM_BUS_SLAVE_EBI_CH0,
403 .ab = 1750000,
404 .ib = 7000000,
405 },
406};
407static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
408 {
409 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
410 .dst = MSM_BUS_SLAVE_EBI_CH0,
411 .ab = 372244480,
412 .ib = 1861222400,
413 },
414 {
415 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
416 .dst = MSM_BUS_SLAVE_EBI_CH0,
417 .ab = 501219328,
418 .ib = 2004877312,
419 },
420 {
421 .src = MSM_BUS_MASTER_AMPSS_M0,
422 .dst = MSM_BUS_SLAVE_EBI_CH0,
423 .ab = 2500000,
424 .ib = 5000000,
425 },
426 {
427 .src = MSM_BUS_MASTER_AMPSS_M0,
428 .dst = MSM_BUS_SLAVE_EBI_CH0,
429 .ab = 2500000,
430 .ib = 5000000,
431 },
432};
433static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
434 {
435 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
436 .dst = MSM_BUS_SLAVE_EBI_CH0,
437 .ab = 222298112,
438 .ib = 1778384896,
439 },
440 {
441 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
442 .dst = MSM_BUS_SLAVE_EBI_CH0,
443 .ab = 330301440,
444 .ib = 1321205760,
445 },
446 {
447 .src = MSM_BUS_MASTER_AMPSS_M0,
448 .dst = MSM_BUS_SLAVE_EBI_CH0,
449 .ab = 2500000,
450 .ib = 700000000,
451 },
452 {
453 .src = MSM_BUS_MASTER_AMPSS_M0,
454 .dst = MSM_BUS_SLAVE_EBI_CH0,
455 .ab = 2500000,
456 .ib = 10000000,
457 },
458};
459
460static struct msm_bus_paths vidc_bus_client_config[] = {
461 {
462 ARRAY_SIZE(vidc_init_vectors),
463 vidc_init_vectors,
464 },
465 {
466 ARRAY_SIZE(vidc_venc_vga_vectors),
467 vidc_venc_vga_vectors,
468 },
469 {
470 ARRAY_SIZE(vidc_vdec_vga_vectors),
471 vidc_vdec_vga_vectors,
472 },
473 {
474 ARRAY_SIZE(vidc_venc_720p_vectors),
475 vidc_venc_720p_vectors,
476 },
477 {
478 ARRAY_SIZE(vidc_vdec_720p_vectors),
479 vidc_vdec_720p_vectors,
480 },
481 {
482 ARRAY_SIZE(vidc_venc_1080p_vectors),
483 vidc_venc_1080p_vectors,
484 },
485 {
486 ARRAY_SIZE(vidc_vdec_1080p_vectors),
487 vidc_vdec_1080p_vectors,
488 },
489};
490
491static struct msm_bus_scale_pdata vidc_bus_client_data = {
492 vidc_bus_client_config,
493 ARRAY_SIZE(vidc_bus_client_config),
494 .name = "vidc",
495};
496#endif
497
Mona Hossain9c430e32011-07-27 11:04:47 -0700498#ifdef CONFIG_HW_RANDOM_MSM
499/* PRNG device */
500#define MSM_PRNG_PHYS 0x1A500000
501static struct resource rng_resources = {
502 .flags = IORESOURCE_MEM,
503 .start = MSM_PRNG_PHYS,
504 .end = MSM_PRNG_PHYS + SZ_512 - 1,
505};
506
507struct platform_device msm_device_rng = {
508 .name = "msm_rng",
509 .id = 0,
510 .num_resources = 1,
511 .resource = &rng_resources,
512};
513#endif
514
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700515#define MSM_VIDC_BASE_PHYS 0x04400000
516#define MSM_VIDC_BASE_SIZE 0x00100000
517
518static struct resource msm_device_vidc_resources[] = {
519 {
520 .start = MSM_VIDC_BASE_PHYS,
521 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
522 .flags = IORESOURCE_MEM,
523 },
524 {
525 .start = VCODEC_IRQ,
526 .end = VCODEC_IRQ,
527 .flags = IORESOURCE_IRQ,
528 },
529};
530
531struct msm_vidc_platform_data vidc_platform_data = {
532#ifdef CONFIG_MSM_BUS_SCALING
533 .vidc_bus_client_pdata = &vidc_bus_client_data,
534#endif
535 .memtype = MEMTYPE_EBI1
536};
537
538struct platform_device msm_device_vidc = {
539 .name = "msm_vidc",
540 .id = 0,
541 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
542 .resource = msm_device_vidc_resources,
543 .dev = {
544 .platform_data = &vidc_platform_data,
545 },
546};
547
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700548#define MSM_SDC1_BASE 0x12400000
549#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
550#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
551#define MSM_SDC2_BASE 0x12140000
552#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
553#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
554#define MSM_SDC2_BASE 0x12140000
555#define MSM_SDC3_BASE 0x12180000
556#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
557#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
558#define MSM_SDC4_BASE 0x121C0000
559#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
560#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
561#define MSM_SDC5_BASE 0x12200000
562#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
563#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
564
565static struct resource resources_sdc1[] = {
566 {
567 .name = "core_mem",
568 .flags = IORESOURCE_MEM,
569 .start = MSM_SDC1_BASE,
570 .end = MSM_SDC1_DML_BASE - 1,
571 },
572 {
573 .name = "core_irq",
574 .flags = IORESOURCE_IRQ,
575 .start = SDC1_IRQ_0,
576 .end = SDC1_IRQ_0
577 },
578#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
579 {
580 .name = "sdcc_dml_addr",
581 .start = MSM_SDC1_DML_BASE,
582 .end = MSM_SDC1_BAM_BASE - 1,
583 .flags = IORESOURCE_MEM,
584 },
585 {
586 .name = "sdcc_bam_addr",
587 .start = MSM_SDC1_BAM_BASE,
588 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
589 .flags = IORESOURCE_MEM,
590 },
591 {
592 .name = "sdcc_bam_irq",
593 .start = SDC1_BAM_IRQ,
594 .end = SDC1_BAM_IRQ,
595 .flags = IORESOURCE_IRQ,
596 },
597#endif
598};
599
600static struct resource resources_sdc2[] = {
601 {
602 .name = "core_mem",
603 .flags = IORESOURCE_MEM,
604 .start = MSM_SDC2_BASE,
605 .end = MSM_SDC2_DML_BASE - 1,
606 },
607 {
608 .name = "core_irq",
609 .flags = IORESOURCE_IRQ,
610 .start = SDC2_IRQ_0,
611 .end = SDC2_IRQ_0
612 },
613#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
614 {
615 .name = "sdcc_dml_addr",
616 .start = MSM_SDC2_DML_BASE,
617 .end = MSM_SDC2_BAM_BASE - 1,
618 .flags = IORESOURCE_MEM,
619 },
620 {
621 .name = "sdcc_bam_addr",
622 .start = MSM_SDC2_BAM_BASE,
623 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
624 .flags = IORESOURCE_MEM,
625 },
626 {
627 .name = "sdcc_bam_irq",
628 .start = SDC2_BAM_IRQ,
629 .end = SDC2_BAM_IRQ,
630 .flags = IORESOURCE_IRQ,
631 },
632#endif
633};
634
635static struct resource resources_sdc3[] = {
636 {
637 .name = "core_mem",
638 .flags = IORESOURCE_MEM,
639 .start = MSM_SDC3_BASE,
640 .end = MSM_SDC3_DML_BASE - 1,
641 },
642 {
643 .name = "core_irq",
644 .flags = IORESOURCE_IRQ,
645 .start = SDC3_IRQ_0,
646 .end = SDC3_IRQ_0
647 },
648#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
649 {
650 .name = "sdcc_dml_addr",
651 .start = MSM_SDC3_DML_BASE,
652 .end = MSM_SDC3_BAM_BASE - 1,
653 .flags = IORESOURCE_MEM,
654 },
655 {
656 .name = "sdcc_bam_addr",
657 .start = MSM_SDC3_BAM_BASE,
658 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
659 .flags = IORESOURCE_MEM,
660 },
661 {
662 .name = "sdcc_bam_irq",
663 .start = SDC3_BAM_IRQ,
664 .end = SDC3_BAM_IRQ,
665 .flags = IORESOURCE_IRQ,
666 },
667#endif
668};
669
670static struct resource resources_sdc4[] = {
671 {
672 .name = "core_mem",
673 .flags = IORESOURCE_MEM,
674 .start = MSM_SDC4_BASE,
675 .end = MSM_SDC4_DML_BASE - 1,
676 },
677 {
678 .name = "core_irq",
679 .flags = IORESOURCE_IRQ,
680 .start = SDC4_IRQ_0,
681 .end = SDC4_IRQ_0
682 },
683#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
684 {
685 .name = "sdcc_dml_addr",
686 .start = MSM_SDC4_DML_BASE,
687 .end = MSM_SDC4_BAM_BASE - 1,
688 .flags = IORESOURCE_MEM,
689 },
690 {
691 .name = "sdcc_bam_addr",
692 .start = MSM_SDC4_BAM_BASE,
693 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
694 .flags = IORESOURCE_MEM,
695 },
696 {
697 .name = "sdcc_bam_irq",
698 .start = SDC4_BAM_IRQ,
699 .end = SDC4_BAM_IRQ,
700 .flags = IORESOURCE_IRQ,
701 },
702#endif
703};
704
705static struct resource resources_sdc5[] = {
706 {
707 .name = "core_mem",
708 .flags = IORESOURCE_MEM,
709 .start = MSM_SDC5_BASE,
710 .end = MSM_SDC5_DML_BASE - 1,
711 },
712 {
713 .name = "core_irq",
714 .flags = IORESOURCE_IRQ,
715 .start = SDC5_IRQ_0,
716 .end = SDC5_IRQ_0
717 },
718#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
719 {
720 .name = "sdcc_dml_addr",
721 .start = MSM_SDC5_DML_BASE,
722 .end = MSM_SDC5_BAM_BASE - 1,
723 .flags = IORESOURCE_MEM,
724 },
725 {
726 .name = "sdcc_bam_addr",
727 .start = MSM_SDC5_BAM_BASE,
728 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
729 .flags = IORESOURCE_MEM,
730 },
731 {
732 .name = "sdcc_bam_irq",
733 .start = SDC5_BAM_IRQ,
734 .end = SDC5_BAM_IRQ,
735 .flags = IORESOURCE_IRQ,
736 },
737#endif
738};
739
740struct platform_device msm_device_sdc1 = {
741 .name = "msm_sdcc",
742 .id = 1,
743 .num_resources = ARRAY_SIZE(resources_sdc1),
744 .resource = resources_sdc1,
745 .dev = {
746 .coherent_dma_mask = 0xffffffff,
747 },
748};
749
750struct platform_device msm_device_sdc2 = {
751 .name = "msm_sdcc",
752 .id = 2,
753 .num_resources = ARRAY_SIZE(resources_sdc2),
754 .resource = resources_sdc2,
755 .dev = {
756 .coherent_dma_mask = 0xffffffff,
757 },
758};
759
760struct platform_device msm_device_sdc3 = {
761 .name = "msm_sdcc",
762 .id = 3,
763 .num_resources = ARRAY_SIZE(resources_sdc3),
764 .resource = resources_sdc3,
765 .dev = {
766 .coherent_dma_mask = 0xffffffff,
767 },
768};
769
770struct platform_device msm_device_sdc4 = {
771 .name = "msm_sdcc",
772 .id = 4,
773 .num_resources = ARRAY_SIZE(resources_sdc4),
774 .resource = resources_sdc4,
775 .dev = {
776 .coherent_dma_mask = 0xffffffff,
777 },
778};
779
780struct platform_device msm_device_sdc5 = {
781 .name = "msm_sdcc",
782 .id = 5,
783 .num_resources = ARRAY_SIZE(resources_sdc5),
784 .resource = resources_sdc5,
785 .dev = {
786 .coherent_dma_mask = 0xffffffff,
787 },
788};
789
790struct platform_device msm_device_smd = {
791 .name = "msm_smd",
792 .id = -1,
793};
794
795struct platform_device msm_device_bam_dmux = {
796 .name = "BAM_RMNT",
797 .id = -1,
798};
799
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700800static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700801 {
802 .start = ADM_0_SCSS_1_IRQ,
803 .end = (resource_size_t)MSM_DMOV_BASE,
804 .flags = IORESOURCE_IRQ,
805 },
806};
807
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700808struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700809 .name = "msm_dmov",
810 .id = -1,
811 .resource = msm_dmov_resource,
812 .num_resources = ARRAY_SIZE(msm_dmov_resource),
813};
814
815static struct platform_device *msm_sdcc_devices[] __initdata = {
816 &msm_device_sdc1,
817 &msm_device_sdc2,
818 &msm_device_sdc3,
819 &msm_device_sdc4,
820 &msm_device_sdc5,
821};
822
823int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
824{
825 struct platform_device *pdev;
826
827 if (controller < 1 || controller > 5)
828 return -EINVAL;
829
830 pdev = msm_sdcc_devices[controller-1];
831 pdev->dev.platform_data = plat;
832 return platform_device_register(pdev);
833}
834
835static struct resource resources_qup_i2c_gsbi4[] = {
836 {
837 .name = "gsbi_qup_i2c_addr",
838 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600839 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700840 .flags = IORESOURCE_MEM,
841 },
842 {
843 .name = "qup_phys_addr",
844 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600845 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700846 .flags = IORESOURCE_MEM,
847 },
848 {
849 .name = "qup_err_intr",
850 .start = GSBI4_QUP_IRQ,
851 .end = GSBI4_QUP_IRQ,
852 .flags = IORESOURCE_IRQ,
853 },
854};
855
856struct platform_device msm8960_device_qup_i2c_gsbi4 = {
857 .name = "qup_i2c",
858 .id = 4,
859 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
860 .resource = resources_qup_i2c_gsbi4,
861};
862
863static struct resource resources_qup_i2c_gsbi3[] = {
864 {
865 .name = "gsbi_qup_i2c_addr",
866 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600867 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700868 .flags = IORESOURCE_MEM,
869 },
870 {
871 .name = "qup_phys_addr",
872 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600873 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700874 .flags = IORESOURCE_MEM,
875 },
876 {
877 .name = "qup_err_intr",
878 .start = GSBI3_QUP_IRQ,
879 .end = GSBI3_QUP_IRQ,
880 .flags = IORESOURCE_IRQ,
881 },
882};
883
884struct platform_device msm8960_device_qup_i2c_gsbi3 = {
885 .name = "qup_i2c",
886 .id = 3,
887 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
888 .resource = resources_qup_i2c_gsbi3,
889};
890
891static struct resource resources_qup_i2c_gsbi10[] = {
892 {
893 .name = "gsbi_qup_i2c_addr",
894 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600895 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700896 .flags = IORESOURCE_MEM,
897 },
898 {
899 .name = "qup_phys_addr",
900 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600901 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700902 .flags = IORESOURCE_MEM,
903 },
904 {
905 .name = "qup_err_intr",
906 .start = GSBI10_QUP_IRQ,
907 .end = GSBI10_QUP_IRQ,
908 .flags = IORESOURCE_IRQ,
909 },
910};
911
912struct platform_device msm8960_device_qup_i2c_gsbi10 = {
913 .name = "qup_i2c",
914 .id = 10,
915 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
916 .resource = resources_qup_i2c_gsbi10,
917};
918
919static struct resource resources_qup_i2c_gsbi12[] = {
920 {
921 .name = "gsbi_qup_i2c_addr",
922 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600923 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700924 .flags = IORESOURCE_MEM,
925 },
926 {
927 .name = "qup_phys_addr",
928 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -0600929 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700930 .flags = IORESOURCE_MEM,
931 },
932 {
933 .name = "qup_err_intr",
934 .start = GSBI12_QUP_IRQ,
935 .end = GSBI12_QUP_IRQ,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940struct platform_device msm8960_device_qup_i2c_gsbi12 = {
941 .name = "qup_i2c",
942 .id = 12,
943 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
944 .resource = resources_qup_i2c_gsbi12,
945};
946
947#ifdef CONFIG_MSM_CAMERA
948struct resource msm_camera_resources[] = {
949 {
950 .name = "vfe",
951 .start = 0x04500000,
952 .end = 0x04500000 + SZ_1M - 1,
953 .flags = IORESOURCE_MEM,
954 },
955 {
956 .name = "vfe",
957 .start = VFE_IRQ,
958 .end = VFE_IRQ,
959 .flags = IORESOURCE_IRQ,
960 },
961 {
Mingcheng Zhu8e9f99e2011-08-26 16:33:32 -0700962 .name = "vpe",
963 .start = 0x05300000,
964 .end = 0x05300000 + SZ_1M - 1,
965 .flags = IORESOURCE_MEM,
966 },
967 {
968 .name = "vpe",
969 .start = VPE_IRQ,
970 .end = VPE_IRQ,
971 .flags = IORESOURCE_IRQ,
972 },
973 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700974 .name = "vid_buf",
975 .flags = IORESOURCE_DMA,
976 },
977 {
978 .name = "ispif",
979 .start = 0x04800800,
980 .end = 0x04800800 + SZ_1K - 1,
981 .flags = IORESOURCE_MEM,
982 },
983 {
984 .name = "ispif",
985 .start = ISPIF_IRQ,
986 .end = ISPIF_IRQ,
987 .flags = IORESOURCE_IRQ,
988 },
989 {
990 .name = "csid0",
991 .start = 0x04800000,
992 .end = 0x04800000 + SZ_1K - 1,
993 .flags = IORESOURCE_MEM,
994 },
995 {
996 .name = "csid0",
997 .start = CSI_0_IRQ,
998 .end = CSI_0_IRQ,
999 .flags = IORESOURCE_IRQ,
1000 },
1001 {
1002 .name = "csiphy0",
1003 .start = 0x04800C00,
1004 .end = 0x04800C00 + SZ_1K - 1,
1005 .flags = IORESOURCE_MEM,
1006 },
1007 {
1008 .name = "csiphy0",
1009 .start = CSIPHY_4LN_IRQ,
1010 .end = CSIPHY_4LN_IRQ,
1011 .flags = IORESOURCE_IRQ,
1012 },
1013 {
1014 .name = "csid1",
1015 .start = 0x04800400,
1016 .end = 0x04800400 + SZ_1K - 1,
1017 .flags = IORESOURCE_MEM,
1018 },
1019 {
1020 .name = "csid1",
1021 .start = CSI_1_IRQ,
1022 .end = CSI_1_IRQ,
1023 .flags = IORESOURCE_IRQ,
1024 },
1025 {
1026 .name = "csiphy1",
1027 .start = 0x04801000,
1028 .end = 0x04801000 + SZ_1K - 1,
1029 .flags = IORESOURCE_MEM,
1030 },
1031 {
1032 .name = "csiphy1",
1033 .start = MSM8960_CSIPHY_2LN_IRQ,
1034 .end = MSM8960_CSIPHY_2LN_IRQ,
1035 .flags = IORESOURCE_IRQ,
1036 },
Nishant Pandit24153d82011-08-27 16:05:13 +05301037 {
1038 .name = "s3d_rw",
1039 .start = 0x008003E0,
1040 .end = 0x008003E0 + SZ_16 - 1,
1041 .flags = IORESOURCE_MEM,
1042 },
1043 {
1044 .name = "s3d_ctl",
1045 .start = 0x008020B8,
1046 .end = 0x008020B8 + SZ_16 - 1,
1047 .flags = IORESOURCE_MEM,
1048 },
1049
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001050};
1051
1052int __init msm_get_cam_resources(struct msm_camera_sensor_info *s_info)
1053{
1054 s_info->resource = msm_camera_resources;
1055 s_info->num_resources = ARRAY_SIZE(msm_camera_resources);
1056 return 0;
1057}
1058#endif
1059
1060static struct resource resources_ssbi_pm8921[] = {
1061 {
1062 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1063 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1064 .flags = IORESOURCE_MEM,
1065 },
1066};
1067
1068struct platform_device msm8960_device_ssbi_pm8921 = {
1069 .name = "msm_ssbi",
1070 .id = 0,
1071 .resource = resources_ssbi_pm8921,
1072 .num_resources = ARRAY_SIZE(resources_ssbi_pm8921),
1073};
1074
1075static struct resource resources_qup_spi_gsbi1[] = {
1076 {
1077 .name = "spi_base",
1078 .start = MSM_GSBI1_QUP_PHYS,
1079 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1080 .flags = IORESOURCE_MEM,
1081 },
1082 {
1083 .name = "gsbi_base",
1084 .start = MSM_GSBI1_PHYS,
1085 .end = MSM_GSBI1_PHYS + 4 - 1,
1086 .flags = IORESOURCE_MEM,
1087 },
1088 {
1089 .name = "spi_irq_in",
1090 .start = MSM8960_GSBI1_QUP_IRQ,
1091 .end = MSM8960_GSBI1_QUP_IRQ,
1092 .flags = IORESOURCE_IRQ,
1093 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001094 {
1095 .name = "spi_clk",
1096 .start = 9,
1097 .end = 9,
1098 .flags = IORESOURCE_IO,
1099 },
1100 {
1101 .name = "spi_cs",
1102 .start = 8,
1103 .end = 8,
1104 .flags = IORESOURCE_IO,
1105 },
1106 {
1107 .name = "spi_miso",
1108 .start = 7,
1109 .end = 7,
1110 .flags = IORESOURCE_IO,
1111 },
1112 {
1113 .name = "spi_mosi",
1114 .start = 6,
1115 .end = 6,
1116 .flags = IORESOURCE_IO,
1117 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001118};
1119
1120struct platform_device msm8960_device_qup_spi_gsbi1 = {
1121 .name = "spi_qsd",
1122 .id = 0,
1123 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1124 .resource = resources_qup_spi_gsbi1,
1125};
1126
1127struct platform_device msm_pcm = {
1128 .name = "msm-pcm-dsp",
1129 .id = -1,
1130};
1131
1132struct platform_device msm_pcm_routing = {
1133 .name = "msm-pcm-routing",
1134 .id = -1,
1135};
1136
1137struct platform_device msm_cpudai0 = {
1138 .name = "msm-dai-q6",
1139 .id = 0x4000,
1140};
1141
1142struct platform_device msm_cpudai1 = {
1143 .name = "msm-dai-q6",
1144 .id = 0x4001,
1145};
1146
1147struct platform_device msm_cpudai_hdmi_rx = {
1148 .name = "msm-dai-q6",
1149 .id = 8,
1150};
1151
1152struct platform_device msm_cpudai_bt_rx = {
1153 .name = "msm-dai-q6",
1154 .id = 0x3000,
1155};
1156
1157struct platform_device msm_cpudai_bt_tx = {
1158 .name = "msm-dai-q6",
1159 .id = 0x3001,
1160};
1161
1162struct platform_device msm_cpudai_fm_rx = {
1163 .name = "msm-dai-q6",
1164 .id = 0x3004,
1165};
1166
1167struct platform_device msm_cpudai_fm_tx = {
1168 .name = "msm-dai-q6",
1169 .id = 0x3005,
1170};
1171
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001172/*
1173 * Machine specific data for AUX PCM Interface
1174 * which the driver will be unware of.
1175 */
1176struct msm_dai_auxpcm_pdata auxpcm_rx_pdata = {
1177 .clk = "pcm_clk",
1178 .mode = AFE_PCM_CFG_MODE_PCM,
1179 .sync = AFE_PCM_CFG_SYNC_INT,
1180 .frame = AFE_PCM_CFG_FRM_256BPF,
1181 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1182 .slot = 0,
1183 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1184 .pcm_clk_rate = 2048000,
1185};
1186
1187struct platform_device msm_cpudai_auxpcm_rx = {
1188 .name = "msm-dai-q6",
1189 .id = 2,
1190 .dev = {
1191 .platform_data = &auxpcm_rx_pdata,
1192 },
1193};
1194
1195struct platform_device msm_cpudai_auxpcm_tx = {
1196 .name = "msm-dai-q6",
1197 .id = 3,
1198};
1199
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001200struct platform_device msm_cpu_fe = {
1201 .name = "msm-dai-fe",
1202 .id = -1,
1203};
1204
1205struct platform_device msm_stub_codec = {
1206 .name = "msm-stub-codec",
1207 .id = 1,
1208};
1209
1210struct platform_device msm_voice = {
1211 .name = "msm-pcm-voice",
1212 .id = -1,
1213};
1214
1215struct platform_device msm_voip = {
1216 .name = "msm-voip-dsp",
1217 .id = -1,
1218};
1219
1220struct platform_device msm_lpa_pcm = {
1221 .name = "msm-pcm-lpa",
1222 .id = -1,
1223};
1224
1225struct platform_device msm_pcm_hostless = {
1226 .name = "msm-pcm-hostless",
1227 .id = -1,
1228};
1229
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301230struct platform_device msm_cpudai_afe_01_rx = {
1231 .name = "msm-dai-q6",
1232 .id = 0xE0,
1233};
1234
1235struct platform_device msm_cpudai_afe_01_tx = {
1236 .name = "msm-dai-q6",
1237 .id = 0xF0,
1238};
1239
1240struct platform_device msm_cpudai_afe_02_rx = {
1241 .name = "msm-dai-q6",
1242 .id = 0xF1,
1243};
1244
1245struct platform_device msm_cpudai_afe_02_tx = {
1246 .name = "msm-dai-q6",
1247 .id = 0xE1,
1248};
1249
1250struct platform_device msm_pcm_afe = {
1251 .name = "msm-pcm-afe",
1252 .id = -1,
1253};
1254
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001255struct platform_device *msm_footswitch_devices[] = {
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001256 FS_8X60(FS_MDP, "fs_mdp"),
1257 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001258 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1259 FS_8X60(FS_VFE, "fs_vfe"),
1260 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001261 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1262 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1263 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001264 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001265};
1266unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1267
1268#ifdef CONFIG_MSM_ROTATOR
1269#define ROTATOR_HW_BASE 0x04E00000
1270static struct resource resources_msm_rotator[] = {
1271 {
1272 .start = ROTATOR_HW_BASE,
1273 .end = ROTATOR_HW_BASE + 0x100000 - 1,
1274 .flags = IORESOURCE_MEM,
1275 },
1276 {
1277 .start = ROT_IRQ,
1278 .end = ROT_IRQ,
1279 .flags = IORESOURCE_IRQ,
1280 },
1281};
1282
1283static struct msm_rot_clocks rotator_clocks[] = {
1284 {
1285 .clk_name = "rot_clk",
1286 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07001287 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001288 },
1289 {
1290 .clk_name = "rotator_pclk",
1291 .clk_type = ROTATOR_PCLK,
1292 .clk_rate = 0,
1293 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001294};
1295
1296static struct msm_rotator_platform_data rotator_pdata = {
1297 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1298 .hardware_version_number = 0x01020309,
1299 .rotator_clks = rotator_clocks,
1300 .regulator_name = "fs_rot",
1301};
1302
1303struct platform_device msm_rotator_device = {
1304 .name = "msm_rotator",
1305 .id = 0,
1306 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1307 .resource = resources_msm_rotator,
1308 .dev = {
1309 .platform_data = &rotator_pdata,
1310 },
1311};
1312#endif
1313
1314#define MIPI_DSI_HW_BASE 0x04700000
1315#define MDP_HW_BASE 0x05100000
1316
1317static struct resource msm_mipi_dsi1_resources[] = {
1318 {
1319 .name = "mipi_dsi",
1320 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001321 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001322 .flags = IORESOURCE_MEM,
1323 },
1324 {
1325 .start = DSI1_IRQ,
1326 .end = DSI1_IRQ,
1327 .flags = IORESOURCE_IRQ,
1328 },
1329};
1330
1331struct platform_device msm_mipi_dsi1_device = {
1332 .name = "mipi_dsi",
1333 .id = 1,
1334 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
1335 .resource = msm_mipi_dsi1_resources,
1336};
1337
1338static struct resource msm_mdp_resources[] = {
1339 {
1340 .name = "mdp",
1341 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07001342 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001343 .flags = IORESOURCE_MEM,
1344 },
1345 {
1346 .start = MDP_IRQ,
1347 .end = MDP_IRQ,
1348 .flags = IORESOURCE_IRQ,
1349 },
1350};
1351
1352static struct platform_device msm_mdp_device = {
1353 .name = "mdp",
1354 .id = 0,
1355 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1356 .resource = msm_mdp_resources,
1357};
1358
1359static void __init msm_register_device(struct platform_device *pdev, void *data)
1360{
1361 int ret;
1362
1363 pdev->dev.platform_data = data;
1364 ret = platform_device_register(pdev);
1365 if (ret)
1366 dev_err(&pdev->dev,
1367 "%s: platform_device_register() failed = %d\n",
1368 __func__, ret);
1369}
1370
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001371#ifdef CONFIG_MSM_BUS_SCALING
1372static struct platform_device msm_dtv_device = {
1373 .name = "dtv",
1374 .id = 0,
1375};
1376#endif
1377
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001378void __init msm_fb_register_device(char *name, void *data)
1379{
1380 if (!strncmp(name, "mdp", 3))
1381 msm_register_device(&msm_mdp_device, data);
1382 else if (!strncmp(name, "mipi_dsi", 8))
1383 msm_register_device(&msm_mipi_dsi1_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001384#ifdef CONFIG_MSM_BUS_SCALING
1385 else if (!strncmp(name, "dtv", 3))
1386 msm_register_device(&msm_dtv_device, data);
1387#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001388 else
1389 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1390}
1391
1392static struct resource resources_sps[] = {
1393 {
1394 .name = "pipe_mem",
1395 .start = 0x12800000,
1396 .end = 0x12800000 + 0x4000 - 1,
1397 .flags = IORESOURCE_MEM,
1398 },
1399 {
1400 .name = "bamdma_dma",
1401 .start = 0x12240000,
1402 .end = 0x12240000 + 0x1000 - 1,
1403 .flags = IORESOURCE_MEM,
1404 },
1405 {
1406 .name = "bamdma_bam",
1407 .start = 0x12244000,
1408 .end = 0x12244000 + 0x4000 - 1,
1409 .flags = IORESOURCE_MEM,
1410 },
1411 {
1412 .name = "bamdma_irq",
1413 .start = SPS_BAM_DMA_IRQ,
1414 .end = SPS_BAM_DMA_IRQ,
1415 .flags = IORESOURCE_IRQ,
1416 },
1417};
1418
1419struct msm_sps_platform_data msm_sps_pdata = {
1420 .bamdma_restricted_pipes = 0x06,
1421};
1422
1423struct platform_device msm_device_sps = {
1424 .name = "msm_sps",
1425 .id = -1,
1426 .num_resources = ARRAY_SIZE(resources_sps),
1427 .resource = resources_sps,
1428 .dev.platform_data = &msm_sps_pdata,
1429};
1430
1431#ifdef CONFIG_MSM_MPM
1432static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001433 [1] = MSM_GPIO_TO_INT(46),
1434 [2] = MSM_GPIO_TO_INT(150),
1435 [4] = MSM_GPIO_TO_INT(103),
1436 [5] = MSM_GPIO_TO_INT(104),
1437 [6] = MSM_GPIO_TO_INT(105),
1438 [7] = MSM_GPIO_TO_INT(106),
1439 [8] = MSM_GPIO_TO_INT(107),
1440 [9] = MSM_GPIO_TO_INT(7),
1441 [10] = MSM_GPIO_TO_INT(11),
1442 [11] = MSM_GPIO_TO_INT(15),
1443 [12] = MSM_GPIO_TO_INT(19),
1444 [13] = MSM_GPIO_TO_INT(23),
1445 [14] = MSM_GPIO_TO_INT(27),
1446 [15] = MSM_GPIO_TO_INT(31),
1447 [16] = MSM_GPIO_TO_INT(35),
1448 [19] = MSM_GPIO_TO_INT(90),
1449 [20] = MSM_GPIO_TO_INT(92),
1450 [23] = MSM_GPIO_TO_INT(85),
1451 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001452 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001453 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001454 [29] = MSM_GPIO_TO_INT(10),
1455 [30] = MSM_GPIO_TO_INT(102),
1456 [31] = MSM_GPIO_TO_INT(81),
1457 [32] = MSM_GPIO_TO_INT(78),
1458 [33] = MSM_GPIO_TO_INT(94),
1459 [34] = MSM_GPIO_TO_INT(72),
1460 [35] = MSM_GPIO_TO_INT(39),
1461 [36] = MSM_GPIO_TO_INT(43),
1462 [37] = MSM_GPIO_TO_INT(61),
1463 [38] = MSM_GPIO_TO_INT(50),
1464 [39] = MSM_GPIO_TO_INT(42),
1465 [41] = MSM_GPIO_TO_INT(62),
1466 [42] = MSM_GPIO_TO_INT(76),
1467 [43] = MSM_GPIO_TO_INT(75),
1468 [44] = MSM_GPIO_TO_INT(70),
1469 [45] = MSM_GPIO_TO_INT(69),
1470 [46] = MSM_GPIO_TO_INT(67),
1471 [47] = MSM_GPIO_TO_INT(65),
1472 [48] = MSM_GPIO_TO_INT(58),
1473 [49] = MSM_GPIO_TO_INT(54),
1474 [50] = MSM_GPIO_TO_INT(52),
1475 [51] = MSM_GPIO_TO_INT(49),
1476 [52] = MSM_GPIO_TO_INT(40),
1477 [53] = MSM_GPIO_TO_INT(37),
1478 [54] = MSM_GPIO_TO_INT(24),
1479 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001480};
1481
1482static uint16_t msm_mpm_bypassed_apps_irqs[] = {
1483 TLMM_MSM_SUMMARY_IRQ,
1484 RPM_APCC_CPU0_GP_HIGH_IRQ,
1485 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1486 RPM_APCC_CPU0_GP_LOW_IRQ,
1487 RPM_APCC_CPU0_WAKE_UP_IRQ,
1488 RPM_APCC_CPU1_GP_HIGH_IRQ,
1489 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1490 RPM_APCC_CPU1_GP_LOW_IRQ,
1491 RPM_APCC_CPU1_WAKE_UP_IRQ,
1492 MSS_TO_APPS_IRQ_0,
1493 MSS_TO_APPS_IRQ_1,
1494 MSS_TO_APPS_IRQ_2,
1495 MSS_TO_APPS_IRQ_3,
1496 MSS_TO_APPS_IRQ_4,
1497 MSS_TO_APPS_IRQ_5,
1498 MSS_TO_APPS_IRQ_6,
1499 MSS_TO_APPS_IRQ_7,
1500 MSS_TO_APPS_IRQ_8,
1501 MSS_TO_APPS_IRQ_9,
1502 LPASS_SCSS_GP_LOW_IRQ,
1503 LPASS_SCSS_GP_MEDIUM_IRQ,
1504 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07001505 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001506 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07001507 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07001508 RIVA_APPS_WLAN_SMSM_IRQ,
1509 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1510 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001511};
1512
1513struct msm_mpm_device_data msm_mpm_dev_data = {
1514 .irqs_m2a = msm_mpm_irqs_m2a,
1515 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1516 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1517 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1518 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1519 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1520 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1521 .mpm_apps_ipc_val = BIT(1),
1522 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1523
1524};
1525#endif
1526
Stephen Boydbb600ae2011-08-02 20:11:40 -07001527static struct clk_lookup msm_clocks_8960_dummy[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001528 CLK_DUMMY("pll2", PLL2, NULL, 0),
1529 CLK_DUMMY("pll8", PLL8, NULL, 0),
1530 CLK_DUMMY("pll4", PLL4, NULL, 0),
1531
1532 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1533 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1534 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1535 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1536 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1537 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1538 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1539 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1540 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1541 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1542 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1543 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1544 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1545 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1546 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1547 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1548
Matt Wagantalle2522372011-08-17 14:52:21 -07001549 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
1550 CLK_DUMMY("core_clk", GSBI2_UART_CLK, "msm_serial_hsl.0", OFF),
1551 CLK_DUMMY("core_clk", GSBI3_UART_CLK, NULL, OFF),
1552 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
1553 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
1554 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
1555 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
1556 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
1557 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
1558 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
1559 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
1560 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001561 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
1562 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
1563 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, NULL, OFF),
1564 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
1565 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, NULL, OFF),
1566 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
1567 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
1568 CLK_DUMMY("core_clk", GSBI8_QUP_CLK, NULL, OFF),
1569 CLK_DUMMY("core_clk", GSBI9_QUP_CLK, NULL, OFF),
1570 CLK_DUMMY("core_clk", GSBI10_QUP_CLK, NULL, OFF),
1571 CLK_DUMMY("core_clk", GSBI11_QUP_CLK, NULL, OFF),
1572 CLK_DUMMY("core_clk", GSBI12_QUP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001573 CLK_DUMMY("pdm_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07001574 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Matt Wagantallc1205292011-08-11 17:19:31 -07001575 CLK_DUMMY("core_clk", PRNG_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001576 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
1577 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
1578 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
1579 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
1580 CLK_DUMMY("core_clk", SDC5_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001581 CLK_DUMMY("core_clk", TSIF_REF_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001582 CLK_DUMMY("tssc_clk", TSSC_CLK, NULL, OFF),
1583 CLK_DUMMY("usb_hs_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1584 CLK_DUMMY("usb_phy_clk", USB_PHY0_CLK, NULL, OFF),
1585 CLK_DUMMY("usb_fs_src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1586 CLK_DUMMY("usb_fs_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1587 CLK_DUMMY("usb_fs_sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
1588 CLK_DUMMY("usb_fs_src_clk", USB_FS2_SRC_CLK, NULL, OFF),
1589 CLK_DUMMY("usb_fs_clk", USB_FS2_XCVR_CLK, NULL, OFF),
1590 CLK_DUMMY("usb_fs_sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07001591 CLK_DUMMY("iface_clk", CE2_CLK, "qce.0", OFF),
1592 CLK_DUMMY("core_clk", CE1_CORE_CLK, "qce.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001593 CLK_DUMMY("iface_clk", GSBI1_P_CLK, "spi_qsd.0", OFF),
1594 CLK_DUMMY("iface_clk", GSBI2_P_CLK,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001595 "msm_serial_hsl.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001596 CLK_DUMMY("iface_clk", GSBI3_P_CLK, NULL, OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07001597 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001598 CLK_DUMMY("iface_clk", GSBI5_P_CLK, NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07001599 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001600 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
1601 CLK_DUMMY("iface_clk", GSBI8_P_CLK, NULL, OFF),
1602 CLK_DUMMY("iface_clk", GSBI9_P_CLK, NULL, OFF),
1603 CLK_DUMMY("iface_clk", GSBI10_P_CLK, NULL, OFF),
1604 CLK_DUMMY("iface_clk", GSBI11_P_CLK, NULL, OFF),
1605 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
1606 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001607 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001608 CLK_DUMMY("usb_fs_pclk", USB_FS1_P_CLK, NULL, OFF),
1609 CLK_DUMMY("usb_fs_pclk", USB_FS2_P_CLK, NULL, OFF),
1610 CLK_DUMMY("usb_hs_pclk", USB_HS1_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001611 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
1612 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
1613 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
1614 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
1615 CLK_DUMMY("iface_clk", SDC5_P_CLK, NULL, OFF),
Matt Wagantalle1a86062011-08-18 17:46:10 -07001616 CLK_DUMMY("core_clk", ADM0_CLK, NULL, OFF),
1617 CLK_DUMMY("iface_clk", ADM0_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001618 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB0_P_CLK, NULL, OFF),
1619 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB1_P_CLK, NULL, OFF),
1620 CLK_DUMMY("pmic_ssbi2", PMIC_SSBI2_CLK, NULL, OFF),
1621 CLK_DUMMY("rpm_msg_ram_pclk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1622 CLK_DUMMY("amp_clk", AMP_CLK, NULL, OFF),
1623 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1624 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1625 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1626 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1627 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1628 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1629 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1630 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1631 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1632 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1633 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1634 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
1635 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
1636 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
1637 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001638 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, OFF),
1639 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, OFF),
1640 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001641 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001642 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001643 CLK_DUMMY("jpegd_clk", JPEGD_CLK, NULL, OFF),
1644 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1645 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1646 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
1647 CLK_DUMMY("rot_clk", ROT_CLK, NULL, OFF),
1648 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
1649 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
1650 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
1651 CLK_DUMMY("vcodec_clk", VCODEC_CLK, NULL, OFF),
1652 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
1653 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
1654 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
1655 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1656 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1657 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1658 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1659 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1660 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
1661 CLK_DUMMY("rot_axi_clk", ROT_AXI_CLK, NULL, OFF),
1662 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
1663 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
1664 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
1665 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
1666 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
1667 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
1668 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
1669 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
1670 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
1671 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001672 CLK_DUMMY("iface_clk", GFX2D0_P_CLK, NULL, OFF),
1673 CLK_DUMMY("iface_clk", GFX2D1_P_CLK, NULL, OFF),
1674 CLK_DUMMY("iface_clk", GFX3D_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001675 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
1676 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
1677 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
1678 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001679 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001680 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
1681 CLK_DUMMY("smmu_pclk", SMMU_P_CLK, NULL, OFF),
1682 CLK_DUMMY("rotator_pclk", ROT_P_CLK, NULL, OFF),
1683 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
1684 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
1685 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
1686 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
1687 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
1688 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
1689 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
1690 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
1691 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
1692 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
1693 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
1694 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
1695 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
1696 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
1697 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
1698 CLK_DUMMY("iommu_clk", JPEGD_AXI_CLK, NULL, 0),
1699 CLK_DUMMY("iommu_clk", VFE_AXI_CLK, NULL, 0),
1700 CLK_DUMMY("iommu_clk", VCODEC_AXI_CLK, NULL, 0),
1701 CLK_DUMMY("iommu_clk", GFX3D_CLK, NULL, 0),
1702 CLK_DUMMY("iommu_clk", GFX2D0_CLK, NULL, 0),
1703 CLK_DUMMY("iommu_clk", GFX2D1_CLK, NULL, 0),
1704
1705 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
1706 CLK_DUMMY("dfab_usb_hs_clk", DFAB_USB_HS_CLK, NULL, 0),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001707 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
1708 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
1709 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
1710 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
1711 CLK_DUMMY("bus_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001712 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1713 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
1714};
1715
Stephen Boydbb600ae2011-08-02 20:11:40 -07001716struct clock_init_data msm8960_dummy_clock_init_data __initdata = {
1717 .table = msm_clocks_8960_dummy,
1718 .size = ARRAY_SIZE(msm_clocks_8960_dummy),
1719};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001720
1721#define LPASS_SLIMBUS_PHYS 0x28080000
1722#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06001723#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001724/* Board info for the slimbus slave device */
1725static struct resource slimbus_res[] = {
1726 {
1727 .start = LPASS_SLIMBUS_PHYS,
1728 .end = LPASS_SLIMBUS_PHYS + 8191,
1729 .flags = IORESOURCE_MEM,
1730 .name = "slimbus_physical",
1731 },
1732 {
1733 .start = LPASS_SLIMBUS_BAM_PHYS,
1734 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
1735 .flags = IORESOURCE_MEM,
1736 .name = "slimbus_bam_physical",
1737 },
1738 {
Sagar Dhariacc969452011-09-19 10:34:30 -06001739 .start = LPASS_SLIMBUS_SLEW,
1740 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
1741 .flags = IORESOURCE_MEM,
1742 .name = "slimbus_slew_reg",
1743 },
1744 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001745 .start = SLIMBUS0_CORE_EE1_IRQ,
1746 .end = SLIMBUS0_CORE_EE1_IRQ,
1747 .flags = IORESOURCE_IRQ,
1748 .name = "slimbus_irq",
1749 },
1750 {
1751 .start = SLIMBUS0_BAM_EE1_IRQ,
1752 .end = SLIMBUS0_BAM_EE1_IRQ,
1753 .flags = IORESOURCE_IRQ,
1754 .name = "slimbus_bam_irq",
1755 },
1756};
1757
1758struct platform_device msm_slim_ctrl = {
1759 .name = "msm_slim_ctrl",
1760 .id = 1,
1761 .num_resources = ARRAY_SIZE(slimbus_res),
1762 .resource = slimbus_res,
1763 .dev = {
1764 .coherent_dma_mask = 0xffffffffULL,
1765 },
1766};
1767
1768#ifdef CONFIG_MSM_BUS_SCALING
1769static struct msm_bus_vectors grp3d_init_vectors[] = {
1770 {
1771 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1772 .dst = MSM_BUS_SLAVE_EBI_CH0,
1773 .ab = 0,
1774 .ib = 0,
1775 },
1776};
1777
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001778static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001779 {
1780 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1781 .dst = MSM_BUS_SLAVE_EBI_CH0,
1782 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001783 .ib = KGSL_CONVERT_TO_MBPS(1200),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001784 },
1785};
1786
1787static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
1788 {
1789 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1790 .dst = MSM_BUS_SLAVE_EBI_CH0,
1791 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001792 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001793 },
1794};
1795
1796static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
1797 {
1798 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1799 .dst = MSM_BUS_SLAVE_EBI_CH0,
1800 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001801 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001802 },
1803};
1804
1805static struct msm_bus_vectors grp3d_max_vectors[] = {
1806 {
1807 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1808 .dst = MSM_BUS_SLAVE_EBI_CH0,
1809 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07001810 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001811 },
1812};
1813
1814static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
1815 {
1816 ARRAY_SIZE(grp3d_init_vectors),
1817 grp3d_init_vectors,
1818 },
1819 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001820 ARRAY_SIZE(grp3d_low_vectors),
1821 grp3d_low_vectors,
1822 },
1823 {
1824 ARRAY_SIZE(grp3d_nominal_low_vectors),
1825 grp3d_nominal_low_vectors,
1826 },
1827 {
1828 ARRAY_SIZE(grp3d_nominal_high_vectors),
1829 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001830 },
1831 {
1832 ARRAY_SIZE(grp3d_max_vectors),
1833 grp3d_max_vectors,
1834 },
1835};
1836
1837static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
1838 grp3d_bus_scale_usecases,
1839 ARRAY_SIZE(grp3d_bus_scale_usecases),
1840 .name = "grp3d",
1841};
1842
1843static struct msm_bus_vectors grp2d0_init_vectors[] = {
1844 {
1845 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1846 .dst = MSM_BUS_SLAVE_EBI_CH0,
1847 .ab = 0,
1848 .ib = 0,
1849 },
1850};
1851
1852static struct msm_bus_vectors grp2d0_max_vectors[] = {
1853 {
1854 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1855 .dst = MSM_BUS_SLAVE_EBI_CH0,
1856 .ab = 0,
Suman Tatiraju903a0ef2011-09-30 16:53:57 -07001857 .ib = KGSL_CONVERT_TO_MBPS(1200),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001858 },
1859};
1860
1861static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
1862 {
1863 ARRAY_SIZE(grp2d0_init_vectors),
1864 grp2d0_init_vectors,
1865 },
1866 {
1867 ARRAY_SIZE(grp2d0_max_vectors),
1868 grp2d0_max_vectors,
1869 },
1870};
1871
1872struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
1873 grp2d0_bus_scale_usecases,
1874 ARRAY_SIZE(grp2d0_bus_scale_usecases),
1875 .name = "grp2d0",
1876};
1877
1878static struct msm_bus_vectors grp2d1_init_vectors[] = {
1879 {
1880 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1881 .dst = MSM_BUS_SLAVE_EBI_CH0,
1882 .ab = 0,
1883 .ib = 0,
1884 },
1885};
1886
1887static struct msm_bus_vectors grp2d1_max_vectors[] = {
1888 {
1889 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1890 .dst = MSM_BUS_SLAVE_EBI_CH0,
1891 .ab = 0,
Suman Tatiraju903a0ef2011-09-30 16:53:57 -07001892 .ib = KGSL_CONVERT_TO_MBPS(1200),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001893 },
1894};
1895
1896static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
1897 {
1898 ARRAY_SIZE(grp2d1_init_vectors),
1899 grp2d1_init_vectors,
1900 },
1901 {
1902 ARRAY_SIZE(grp2d1_max_vectors),
1903 grp2d1_max_vectors,
1904 },
1905};
1906
1907struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
1908 grp2d1_bus_scale_usecases,
1909 ARRAY_SIZE(grp2d1_bus_scale_usecases),
1910 .name = "grp2d1",
1911};
1912#endif
1913
1914static struct resource kgsl_3d0_resources[] = {
1915 {
1916 .name = KGSL_3D0_REG_MEMORY,
1917 .start = 0x04300000, /* GFX3D address */
1918 .end = 0x0431ffff,
1919 .flags = IORESOURCE_MEM,
1920 },
1921 {
1922 .name = KGSL_3D0_IRQ,
1923 .start = GFX3D_IRQ,
1924 .end = GFX3D_IRQ,
1925 .flags = IORESOURCE_IRQ,
1926 },
1927};
1928
1929static struct kgsl_device_platform_data kgsl_3d0_pdata = {
1930 .pwr_data = {
1931 .pwrlevel = {
1932 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001933 .gpu_freq = 400000000,
1934 .bus_freq = 4,
1935 },
1936 {
1937 .gpu_freq = 300000000,
1938 .bus_freq = 3,
1939 },
1940 {
1941 .gpu_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001942 .bus_freq = 2,
1943 },
1944 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001945 .gpu_freq = 128000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001946 .bus_freq = 1,
1947 },
1948 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001949 .gpu_freq = 27000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001950 .bus_freq = 0,
1951 },
1952 },
Lucille Sylvester5d0ac132011-09-21 10:15:01 -06001953 .init_level = 0,
Lucille Sylvester34ec3692011-08-16 16:28:04 -06001954 .num_levels = 5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001955 .set_grp_async = NULL,
1956 .idle_timeout = HZ/5,
Lucille Sylvester0a98de92011-09-13 17:20:55 -06001957 .nap_allowed = false,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001958 },
1959 .clk = {
1960 .name = {
Matt Wagantall9dc01632011-08-17 18:55:04 -07001961 .clk = "core_clk",
1962 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001963 },
1964#ifdef CONFIG_MSM_BUS_SCALING
1965 .bus_scale_table = &grp3d_bus_scale_pdata,
1966#endif
1967 },
1968 .imem_clk_name = {
1969 .clk = NULL,
Matt Wagantall9dc01632011-08-17 18:55:04 -07001970 .pclk = "mem_iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001971 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06001972 .iommu_user_ctx_name = "gfx3d_user",
1973 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001974};
1975
1976struct platform_device msm_kgsl_3d0 = {
1977 .name = "kgsl-3d0",
1978 .id = 0,
1979 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1980 .resource = kgsl_3d0_resources,
1981 .dev = {
1982 .platform_data = &kgsl_3d0_pdata,
1983 },
1984};
1985
1986static struct resource kgsl_2d0_resources[] = {
1987 {
1988 .name = KGSL_2D0_REG_MEMORY,
1989 .start = 0x04100000, /* Z180 base address */
1990 .end = 0x04100FFF,
1991 .flags = IORESOURCE_MEM,
1992 },
1993 {
1994 .name = KGSL_2D0_IRQ,
1995 .start = GFX2D0_IRQ,
1996 .end = GFX2D0_IRQ,
1997 .flags = IORESOURCE_IRQ,
1998 },
1999};
2000
2001static struct kgsl_device_platform_data kgsl_2d0_pdata = {
2002 .pwr_data = {
2003 .pwrlevel = {
2004 {
2005 .gpu_freq = 200000000,
2006 .bus_freq = 1,
2007 },
2008 {
2009 .gpu_freq = 200000000,
2010 .bus_freq = 0,
2011 },
2012 },
2013 .init_level = 0,
2014 .num_levels = 2,
2015 .set_grp_async = NULL,
2016 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002017 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002018 },
2019 .clk = {
2020 .name = {
2021 /* note: 2d clocks disabled on v1 */
Matt Wagantall9dc01632011-08-17 18:55:04 -07002022 .clk = "core_clk",
2023 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002024 },
2025#ifdef CONFIG_MSM_BUS_SCALING
2026 .bus_scale_table = &grp2d0_bus_scale_pdata,
2027#endif
2028 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06002029 .iommu_user_ctx_name = "gfx2d0_2d0",
2030 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002031};
2032
2033struct platform_device msm_kgsl_2d0 = {
2034 .name = "kgsl-2d0",
2035 .id = 0,
2036 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2037 .resource = kgsl_2d0_resources,
2038 .dev = {
2039 .platform_data = &kgsl_2d0_pdata,
2040 },
2041};
2042
2043static struct resource kgsl_2d1_resources[] = {
2044 {
2045 .name = KGSL_2D1_REG_MEMORY,
2046 .start = 0x04200000, /* Z180 device 1 base address */
2047 .end = 0x04200FFF,
2048 .flags = IORESOURCE_MEM,
2049 },
2050 {
2051 .name = KGSL_2D1_IRQ,
2052 .start = GFX2D1_IRQ,
2053 .end = GFX2D1_IRQ,
2054 .flags = IORESOURCE_IRQ,
2055 },
2056};
2057
2058static struct kgsl_device_platform_data kgsl_2d1_pdata = {
2059 .pwr_data = {
2060 .pwrlevel = {
2061 {
2062 .gpu_freq = 200000000,
2063 .bus_freq = 1,
2064 },
2065 {
2066 .gpu_freq = 200000000,
2067 .bus_freq = 0,
2068 },
2069 },
2070 .init_level = 0,
2071 .num_levels = 2,
2072 .set_grp_async = NULL,
2073 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002074 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002075 },
2076 .clk = {
2077 .name = {
Matt Wagantall9dc01632011-08-17 18:55:04 -07002078 .clk = "core_clk",
2079 .pclk = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002080 },
2081#ifdef CONFIG_MSM_BUS_SCALING
2082 .bus_scale_table = &grp2d1_bus_scale_pdata,
2083#endif
2084 },
Shubhraprakash Das767fdda2011-08-15 15:49:45 -06002085 .iommu_user_ctx_name = "gfx2d1_2d1",
2086 .iommu_priv_ctx_name = NULL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002087};
2088
2089struct platform_device msm_kgsl_2d1 = {
2090 .name = "kgsl-2d1",
2091 .id = 1,
2092 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2093 .resource = kgsl_2d1_resources,
2094 .dev = {
2095 .platform_data = &kgsl_2d1_pdata,
2096 },
2097};
2098
2099#ifdef CONFIG_MSM_GEMINI
2100static struct resource msm_gemini_resources[] = {
2101 {
2102 .start = 0x04600000,
2103 .end = 0x04600000 + SZ_1M - 1,
2104 .flags = IORESOURCE_MEM,
2105 },
2106 {
2107 .start = JPEG_IRQ,
2108 .end = JPEG_IRQ,
2109 .flags = IORESOURCE_IRQ,
2110 },
2111};
2112
2113struct platform_device msm8960_gemini_device = {
2114 .name = "msm_gemini",
2115 .resource = msm_gemini_resources,
2116 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2117};
2118#endif
2119
2120struct msm_rpm_map_data rpm_map_data[] __initdata = {
2121 MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2122 MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2123
2124 MSM_RPM_MAP(RPM_CTL, RPM_CTL, 1),
2125
2126 MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1),
2127 MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1),
2128 MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2129 MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2130 MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2131 MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2132 MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1),
2133 MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1),
2134 MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1),
2135 MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1),
2136
2137 MSM_RPM_MAP(APPS_FABRIC_CFG_HALT_0, APPS_FABRIC_CFG_HALT, 2),
2138 MSM_RPM_MAP(APPS_FABRIC_CFG_CLKMOD_0, APPS_FABRIC_CFG_CLKMOD, 3),
2139 MSM_RPM_MAP(APPS_FABRIC_CFG_IOCTL, APPS_FABRIC_CFG_IOCTL, 1),
2140 MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2141
2142 MSM_RPM_MAP(SYS_FABRIC_CFG_HALT_0, SYS_FABRIC_CFG_HALT, 2),
2143 MSM_RPM_MAP(SYS_FABRIC_CFG_CLKMOD_0, SYS_FABRIC_CFG_CLKMOD, 3),
2144 MSM_RPM_MAP(SYS_FABRIC_CFG_IOCTL, SYS_FABRIC_CFG_IOCTL, 1),
Eugene Seahd9040ad2011-07-11 13:20:54 -06002145 MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 29),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002146
2147 MSM_RPM_MAP(MMSS_FABRIC_CFG_HALT_0, MMSS_FABRIC_CFG_HALT, 2),
2148 MSM_RPM_MAP(MMSS_FABRIC_CFG_CLKMOD_0, MMSS_FABRIC_CFG_CLKMOD, 3),
2149 MSM_RPM_MAP(MMSS_FABRIC_CFG_IOCTL, MMSS_FABRIC_CFG_IOCTL, 1),
2150 MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2151
2152 MSM_RPM_MAP(PM8921_S1_0, PM8921_S1, 2),
2153 MSM_RPM_MAP(PM8921_S2_0, PM8921_S2, 2),
2154 MSM_RPM_MAP(PM8921_S3_0, PM8921_S3, 2),
2155 MSM_RPM_MAP(PM8921_S4_0, PM8921_S4, 2),
2156 MSM_RPM_MAP(PM8921_S5_0, PM8921_S5, 2),
2157 MSM_RPM_MAP(PM8921_S6_0, PM8921_S6, 2),
2158 MSM_RPM_MAP(PM8921_S7_0, PM8921_S7, 2),
2159 MSM_RPM_MAP(PM8921_S8_0, PM8921_S8, 2),
2160 MSM_RPM_MAP(PM8921_L1_0, PM8921_L1, 2),
2161 MSM_RPM_MAP(PM8921_L2_0, PM8921_L2, 2),
2162 MSM_RPM_MAP(PM8921_L3_0, PM8921_L3, 2),
2163 MSM_RPM_MAP(PM8921_L4_0, PM8921_L4, 2),
2164 MSM_RPM_MAP(PM8921_L5_0, PM8921_L5, 2),
2165 MSM_RPM_MAP(PM8921_L6_0, PM8921_L6, 2),
2166 MSM_RPM_MAP(PM8921_L7_0, PM8921_L7, 2),
2167 MSM_RPM_MAP(PM8921_L8_0, PM8921_L8, 2),
2168 MSM_RPM_MAP(PM8921_L9_0, PM8921_L9, 2),
2169 MSM_RPM_MAP(PM8921_L10_0, PM8921_L10, 2),
2170 MSM_RPM_MAP(PM8921_L11_0, PM8921_L11, 2),
2171 MSM_RPM_MAP(PM8921_L12_0, PM8921_L12, 2),
2172 MSM_RPM_MAP(PM8921_L13_0, PM8921_L13, 2),
2173 MSM_RPM_MAP(PM8921_L14_0, PM8921_L14, 2),
2174 MSM_RPM_MAP(PM8921_L15_0, PM8921_L15, 2),
2175 MSM_RPM_MAP(PM8921_L16_0, PM8921_L16, 2),
2176 MSM_RPM_MAP(PM8921_L17_0, PM8921_L17, 2),
2177 MSM_RPM_MAP(PM8921_L18_0, PM8921_L18, 2),
2178 MSM_RPM_MAP(PM8921_L19_0, PM8921_L19, 2),
2179 MSM_RPM_MAP(PM8921_L20_0, PM8921_L20, 2),
2180 MSM_RPM_MAP(PM8921_L21_0, PM8921_L21, 2),
2181 MSM_RPM_MAP(PM8921_L22_0, PM8921_L22, 2),
2182 MSM_RPM_MAP(PM8921_L23_0, PM8921_L23, 2),
2183 MSM_RPM_MAP(PM8921_L24_0, PM8921_L24, 2),
2184 MSM_RPM_MAP(PM8921_L25_0, PM8921_L25, 2),
2185 MSM_RPM_MAP(PM8921_L26_0, PM8921_L26, 2),
2186 MSM_RPM_MAP(PM8921_L27_0, PM8921_L27, 2),
2187 MSM_RPM_MAP(PM8921_L28_0, PM8921_L28, 2),
2188 MSM_RPM_MAP(PM8921_L29_0, PM8921_L29, 2),
2189 MSM_RPM_MAP(PM8921_CLK1_0, PM8921_CLK1, 2),
2190 MSM_RPM_MAP(PM8921_CLK2_0, PM8921_CLK2, 2),
2191 MSM_RPM_MAP(PM8921_LVS1, PM8921_LVS1, 1),
2192 MSM_RPM_MAP(PM8921_LVS2, PM8921_LVS2, 1),
2193 MSM_RPM_MAP(PM8921_LVS3, PM8921_LVS3, 1),
2194 MSM_RPM_MAP(PM8921_LVS4, PM8921_LVS4, 1),
2195 MSM_RPM_MAP(PM8921_LVS5, PM8921_LVS5, 1),
2196 MSM_RPM_MAP(PM8921_LVS6, PM8921_LVS6, 1),
2197 MSM_RPM_MAP(PM8921_LVS7, PM8921_LVS7, 1),
2198 MSM_RPM_MAP(NCP_0, NCP, 2),
2199 MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1),
2200 MSM_RPM_MAP(USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2201 MSM_RPM_MAP(HDMI_SWITCH, HDMI_SWITCH, 1),
Praveen Chidambaram27658c22011-07-07 11:00:49 -06002202 MSM_RPM_MAP(DDR_DMM_0, DDR_DMM, 2),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002203
2204};
2205unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data);
2206
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06002207struct platform_device msm_rpm_device = {
2208 .name = "msm_rpm",
2209 .id = -1,
2210};
2211
2212
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002213struct platform_device msm_bus_sys_fabric = {
2214 .name = "msm_bus_fabric",
2215 .id = MSM_BUS_FAB_SYSTEM,
2216};
2217struct platform_device msm_bus_apps_fabric = {
2218 .name = "msm_bus_fabric",
2219 .id = MSM_BUS_FAB_APPSS,
2220};
2221struct platform_device msm_bus_mm_fabric = {
2222 .name = "msm_bus_fabric",
2223 .id = MSM_BUS_FAB_MMSS,
2224};
2225struct platform_device msm_bus_sys_fpb = {
2226 .name = "msm_bus_fabric",
2227 .id = MSM_BUS_FAB_SYSTEM_FPB,
2228};
2229struct platform_device msm_bus_cpss_fpb = {
2230 .name = "msm_bus_fabric",
2231 .id = MSM_BUS_FAB_CPSS_FPB,
2232};
2233
2234/* Sensors DSPS platform data */
2235#ifdef CONFIG_MSM_DSPS
2236
2237#define PPSS_REG_PHYS_BASE 0x12080000
2238
2239static struct dsps_clk_info dsps_clks[] = {};
2240static struct dsps_regulator_info dsps_regs[] = {};
2241
2242/*
2243 * Note: GPIOs field is intialized in run-time at the function
2244 * msm8960_init_dsps().
2245 */
2246
2247struct msm_dsps_platform_data msm_dsps_pdata = {
2248 .clks = dsps_clks,
2249 .clks_num = ARRAY_SIZE(dsps_clks),
2250 .gpios = NULL,
2251 .gpios_num = 0,
2252 .regs = dsps_regs,
2253 .regs_num = ARRAY_SIZE(dsps_regs),
2254 .dsps_pwr_ctl_en = 1,
2255 .signature = DSPS_SIGNATURE,
2256};
2257
2258static struct resource msm_dsps_resources[] = {
2259 {
2260 .start = PPSS_REG_PHYS_BASE,
2261 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2262 .name = "ppss_reg",
2263 .flags = IORESOURCE_MEM,
2264 },
Wentao Xua55500b2011-08-16 18:15:04 -04002265
2266 {
2267 .start = PPSS_WDOG_TIMER_IRQ,
2268 .end = PPSS_WDOG_TIMER_IRQ,
2269 .name = "ppss_wdog",
2270 .flags = IORESOURCE_IRQ,
2271 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002272};
2273
2274struct platform_device msm_dsps_device = {
2275 .name = "msm_dsps",
2276 .id = 0,
2277 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2278 .resource = msm_dsps_resources,
2279 .dev.platform_data = &msm_dsps_pdata,
2280};
2281
2282#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07002283
2284#ifdef CONFIG_MSM_QDSS
2285
2286#define MSM_QDSS_PHYS_BASE 0x01A00000
2287#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
2288#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
2289#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
2290#define MSM_PTM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
2291
2292static struct resource msm_etb_resources[] = {
2293 {
2294 .start = MSM_ETB_PHYS_BASE,
2295 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
2296 .flags = IORESOURCE_MEM,
2297 },
2298};
2299
2300struct platform_device msm_etb_device = {
2301 .name = "msm_etb",
2302 .id = 0,
2303 .num_resources = ARRAY_SIZE(msm_etb_resources),
2304 .resource = msm_etb_resources,
2305};
2306
2307static struct resource msm_tpiu_resources[] = {
2308 {
2309 .start = MSM_TPIU_PHYS_BASE,
2310 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
2311 .flags = IORESOURCE_MEM,
2312 },
2313};
2314
2315struct platform_device msm_tpiu_device = {
2316 .name = "msm_tpiu",
2317 .id = 0,
2318 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
2319 .resource = msm_tpiu_resources,
2320};
2321
2322static struct resource msm_funnel_resources[] = {
2323 {
2324 .start = MSM_FUNNEL_PHYS_BASE,
2325 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
2326 .flags = IORESOURCE_MEM,
2327 },
2328};
2329
2330struct platform_device msm_funnel_device = {
2331 .name = "msm_funnel",
2332 .id = 0,
2333 .num_resources = ARRAY_SIZE(msm_funnel_resources),
2334 .resource = msm_funnel_resources,
2335};
2336
2337static struct resource msm_ptm_resources[] = {
2338 {
2339 .start = MSM_PTM_PHYS_BASE,
2340 .end = MSM_PTM_PHYS_BASE + (SZ_4K * 2) - 1,
2341 .flags = IORESOURCE_MEM,
2342 },
2343};
2344
2345struct platform_device msm_ptm_device = {
2346 .name = "msm_ptm",
2347 .id = 0,
2348 .num_resources = ARRAY_SIZE(msm_ptm_resources),
2349 .resource = msm_ptm_resources,
2350};
2351
2352#endif