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