blob: ffc6a3023ef0f3e39ba2f660846b831f9ec15ca8 [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>
32#include "clock.h"
33#include "devices.h"
34#include "devices-msm8x60.h"
35#include "footswitch.h"
36
37#ifdef CONFIG_MSM_MPM
38#include "mpm.h"
39#endif
40#ifdef CONFIG_MSM_DSPS
41#include <mach/msm_dsps.h>
42#endif
43
44
45/* Address of GSBI blocks */
46#define MSM_GSBI1_PHYS 0x16000000
47#define MSM_GSBI2_PHYS 0x16100000
48#define MSM_GSBI3_PHYS 0x16200000
49#define MSM_GSBI4_PHYS 0x16300000
50#define MSM_GSBI5_PHYS 0x16400000
51#define MSM_GSBI6_PHYS 0x16500000
52#define MSM_GSBI7_PHYS 0x16600000
53#define MSM_GSBI8_PHYS 0x1A000000
54#define MSM_GSBI9_PHYS 0x1A100000
55#define MSM_GSBI10_PHYS 0x1A200000
56#define MSM_GSBI11_PHYS 0x12440000
57#define MSM_GSBI12_PHYS 0x12480000
58
59#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
60#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053061#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062
63/* GSBI QUP devices */
64#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
65#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
66#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
67#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
68#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
69#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
70#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
71#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
72#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
73#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
74#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
75#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
76#define MSM_QUP_SIZE SZ_4K
77
78#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
79#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
80#define MSM_PMIC_SSBI_SIZE SZ_4K
81
82static struct resource resources_otg[] = {
83 {
84 .start = MSM8960_HSUSB_PHYS,
85 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
86 .flags = IORESOURCE_MEM,
87 },
88 {
89 .start = USB1_HS_IRQ,
90 .end = USB1_HS_IRQ,
91 .flags = IORESOURCE_IRQ,
92 },
93};
94
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -070095struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070096 .name = "msm_otg",
97 .id = -1,
98 .num_resources = ARRAY_SIZE(resources_otg),
99 .resource = resources_otg,
100 .dev = {
101 .coherent_dma_mask = 0xffffffff,
102 },
103};
104
105static struct resource resources_hsusb[] = {
106 {
107 .start = MSM8960_HSUSB_PHYS,
108 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
109 .flags = IORESOURCE_MEM,
110 },
111 {
112 .start = USB1_HS_IRQ,
113 .end = USB1_HS_IRQ,
114 .flags = IORESOURCE_IRQ,
115 },
116};
117
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700118struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700119 .name = "msm_hsusb",
120 .id = -1,
121 .num_resources = ARRAY_SIZE(resources_hsusb),
122 .resource = resources_hsusb,
123 .dev = {
124 .coherent_dma_mask = 0xffffffff,
125 },
126};
127
128static struct resource resources_hsusb_host[] = {
129 {
130 .start = MSM8960_HSUSB_PHYS,
131 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
132 .flags = IORESOURCE_MEM,
133 },
134 {
135 .start = USB1_HS_IRQ,
136 .end = USB1_HS_IRQ,
137 .flags = IORESOURCE_IRQ,
138 },
139};
140
141static u64 dma_mask = 0xffffffffULL;
142struct platform_device msm_device_hsusb_host = {
143 .name = "msm_hsusb_host",
144 .id = -1,
145 .num_resources = ARRAY_SIZE(resources_hsusb_host),
146 .resource = resources_hsusb_host,
147 .dev = {
148 .dma_mask = &dma_mask,
149 .coherent_dma_mask = 0xffffffff,
150 },
151};
152
153static struct resource resources_uart_gsbi2[] = {
154 {
155 .start = MSM8960_GSBI2_UARTDM_IRQ,
156 .end = MSM8960_GSBI2_UARTDM_IRQ,
157 .flags = IORESOURCE_IRQ,
158 },
159 {
160 .start = MSM_UART2DM_PHYS,
161 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
162 .name = "uartdm_resource",
163 .flags = IORESOURCE_MEM,
164 },
165 {
166 .start = MSM_GSBI2_PHYS,
167 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
168 .name = "gsbi_resource",
169 .flags = IORESOURCE_MEM,
170 },
171};
172
173struct platform_device msm8960_device_uart_gsbi2 = {
174 .name = "msm_serial_hsl",
175 .id = 0,
176 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
177 .resource = resources_uart_gsbi2,
178};
Mayank Rana9f51f582011-08-04 18:35:59 +0530179/* GSBI 6 used into UARTDM Mode */
180static struct resource msm_uart_dm6_resources[] = {
181 {
182 .start = MSM_UART6DM_PHYS,
183 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
184 .name = "uartdm_resource",
185 .flags = IORESOURCE_MEM,
186 },
187 {
188 .start = GSBI6_UARTDM_IRQ,
189 .end = GSBI6_UARTDM_IRQ,
190 .flags = IORESOURCE_IRQ,
191 },
192 {
193 .start = MSM_GSBI6_PHYS,
194 .end = MSM_GSBI6_PHYS + 4 - 1,
195 .name = "gsbi_resource",
196 .flags = IORESOURCE_MEM,
197 },
198 {
199 .start = DMOV_HSUART_GSBI6_TX_CHAN,
200 .end = DMOV_HSUART_GSBI6_RX_CHAN,
201 .name = "uartdm_channels",
202 .flags = IORESOURCE_DMA,
203 },
204 {
205 .start = DMOV_HSUART_GSBI6_TX_CRCI,
206 .end = DMOV_HSUART_GSBI6_RX_CRCI,
207 .name = "uartdm_crci",
208 .flags = IORESOURCE_DMA,
209 },
210};
211static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
212struct platform_device msm_device_uart_dm6 = {
213 .name = "msm_serial_hs",
214 .id = 0,
215 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
216 .resource = msm_uart_dm6_resources,
217 .dev = {
218 .dma_mask = &msm_uart_dm6_dma_mask,
219 .coherent_dma_mask = DMA_BIT_MASK(32),
220 },
221};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700222
223static struct resource resources_uart_gsbi5[] = {
224 {
225 .start = GSBI5_UARTDM_IRQ,
226 .end = GSBI5_UARTDM_IRQ,
227 .flags = IORESOURCE_IRQ,
228 },
229 {
230 .start = MSM_UART5DM_PHYS,
231 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
232 .name = "uartdm_resource",
233 .flags = IORESOURCE_MEM,
234 },
235 {
236 .start = MSM_GSBI5_PHYS,
237 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
238 .name = "gsbi_resource",
239 .flags = IORESOURCE_MEM,
240 },
241};
242
243struct platform_device msm8960_device_uart_gsbi5 = {
244 .name = "msm_serial_hsl",
245 .id = 0,
246 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
247 .resource = resources_uart_gsbi5,
248};
249/* MSM Video core device */
250#ifdef CONFIG_MSM_BUS_SCALING
251static struct msm_bus_vectors vidc_init_vectors[] = {
252 {
253 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
254 .dst = MSM_BUS_SLAVE_EBI_CH0,
255 .ab = 0,
256 .ib = 0,
257 },
258 {
259 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
260 .dst = MSM_BUS_SLAVE_EBI_CH0,
261 .ab = 0,
262 .ib = 0,
263 },
264 {
265 .src = MSM_BUS_MASTER_AMPSS_M0,
266 .dst = MSM_BUS_SLAVE_EBI_CH0,
267 .ab = 0,
268 .ib = 0,
269 },
270 {
271 .src = MSM_BUS_MASTER_AMPSS_M0,
272 .dst = MSM_BUS_SLAVE_EBI_CH0,
273 .ab = 0,
274 .ib = 0,
275 },
276};
277static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
278 {
279 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
280 .dst = MSM_BUS_SLAVE_EBI_CH0,
281 .ab = 54525952,
282 .ib = 436207616,
283 },
284 {
285 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
286 .dst = MSM_BUS_SLAVE_EBI_CH0,
287 .ab = 72351744,
288 .ib = 289406976,
289 },
290 {
291 .src = MSM_BUS_MASTER_AMPSS_M0,
292 .dst = MSM_BUS_SLAVE_EBI_CH0,
293 .ab = 500000,
294 .ib = 1000000,
295 },
296 {
297 .src = MSM_BUS_MASTER_AMPSS_M0,
298 .dst = MSM_BUS_SLAVE_EBI_CH0,
299 .ab = 500000,
300 .ib = 1000000,
301 },
302};
303static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
304 {
305 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
306 .dst = MSM_BUS_SLAVE_EBI_CH0,
307 .ab = 40894464,
308 .ib = 327155712,
309 },
310 {
311 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
312 .dst = MSM_BUS_SLAVE_EBI_CH0,
313 .ab = 48234496,
314 .ib = 192937984,
315 },
316 {
317 .src = MSM_BUS_MASTER_AMPSS_M0,
318 .dst = MSM_BUS_SLAVE_EBI_CH0,
319 .ab = 500000,
320 .ib = 2000000,
321 },
322 {
323 .src = MSM_BUS_MASTER_AMPSS_M0,
324 .dst = MSM_BUS_SLAVE_EBI_CH0,
325 .ab = 500000,
326 .ib = 2000000,
327 },
328};
329static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
330 {
331 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
332 .dst = MSM_BUS_SLAVE_EBI_CH0,
333 .ab = 163577856,
334 .ib = 1308622848,
335 },
336 {
337 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
338 .dst = MSM_BUS_SLAVE_EBI_CH0,
339 .ab = 219152384,
340 .ib = 876609536,
341 },
342 {
343 .src = MSM_BUS_MASTER_AMPSS_M0,
344 .dst = MSM_BUS_SLAVE_EBI_CH0,
345 .ab = 1750000,
346 .ib = 3500000,
347 },
348 {
349 .src = MSM_BUS_MASTER_AMPSS_M0,
350 .dst = MSM_BUS_SLAVE_EBI_CH0,
351 .ab = 1750000,
352 .ib = 3500000,
353 },
354};
355static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
356 {
357 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
358 .dst = MSM_BUS_SLAVE_EBI_CH0,
359 .ab = 121634816,
360 .ib = 973078528,
361 },
362 {
363 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
364 .dst = MSM_BUS_SLAVE_EBI_CH0,
365 .ab = 155189248,
366 .ib = 620756992,
367 },
368 {
369 .src = MSM_BUS_MASTER_AMPSS_M0,
370 .dst = MSM_BUS_SLAVE_EBI_CH0,
371 .ab = 1750000,
372 .ib = 7000000,
373 },
374 {
375 .src = MSM_BUS_MASTER_AMPSS_M0,
376 .dst = MSM_BUS_SLAVE_EBI_CH0,
377 .ab = 1750000,
378 .ib = 7000000,
379 },
380};
381static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
382 {
383 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
384 .dst = MSM_BUS_SLAVE_EBI_CH0,
385 .ab = 372244480,
386 .ib = 1861222400,
387 },
388 {
389 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
390 .dst = MSM_BUS_SLAVE_EBI_CH0,
391 .ab = 501219328,
392 .ib = 2004877312,
393 },
394 {
395 .src = MSM_BUS_MASTER_AMPSS_M0,
396 .dst = MSM_BUS_SLAVE_EBI_CH0,
397 .ab = 2500000,
398 .ib = 5000000,
399 },
400 {
401 .src = MSM_BUS_MASTER_AMPSS_M0,
402 .dst = MSM_BUS_SLAVE_EBI_CH0,
403 .ab = 2500000,
404 .ib = 5000000,
405 },
406};
407static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
408 {
409 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
410 .dst = MSM_BUS_SLAVE_EBI_CH0,
411 .ab = 222298112,
412 .ib = 1778384896,
413 },
414 {
415 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
416 .dst = MSM_BUS_SLAVE_EBI_CH0,
417 .ab = 330301440,
418 .ib = 1321205760,
419 },
420 {
421 .src = MSM_BUS_MASTER_AMPSS_M0,
422 .dst = MSM_BUS_SLAVE_EBI_CH0,
423 .ab = 2500000,
424 .ib = 700000000,
425 },
426 {
427 .src = MSM_BUS_MASTER_AMPSS_M0,
428 .dst = MSM_BUS_SLAVE_EBI_CH0,
429 .ab = 2500000,
430 .ib = 10000000,
431 },
432};
433
434static struct msm_bus_paths vidc_bus_client_config[] = {
435 {
436 ARRAY_SIZE(vidc_init_vectors),
437 vidc_init_vectors,
438 },
439 {
440 ARRAY_SIZE(vidc_venc_vga_vectors),
441 vidc_venc_vga_vectors,
442 },
443 {
444 ARRAY_SIZE(vidc_vdec_vga_vectors),
445 vidc_vdec_vga_vectors,
446 },
447 {
448 ARRAY_SIZE(vidc_venc_720p_vectors),
449 vidc_venc_720p_vectors,
450 },
451 {
452 ARRAY_SIZE(vidc_vdec_720p_vectors),
453 vidc_vdec_720p_vectors,
454 },
455 {
456 ARRAY_SIZE(vidc_venc_1080p_vectors),
457 vidc_venc_1080p_vectors,
458 },
459 {
460 ARRAY_SIZE(vidc_vdec_1080p_vectors),
461 vidc_vdec_1080p_vectors,
462 },
463};
464
465static struct msm_bus_scale_pdata vidc_bus_client_data = {
466 vidc_bus_client_config,
467 ARRAY_SIZE(vidc_bus_client_config),
468 .name = "vidc",
469};
470#endif
471
Mona Hossain9c430e32011-07-27 11:04:47 -0700472#ifdef CONFIG_HW_RANDOM_MSM
473/* PRNG device */
474#define MSM_PRNG_PHYS 0x1A500000
475static struct resource rng_resources = {
476 .flags = IORESOURCE_MEM,
477 .start = MSM_PRNG_PHYS,
478 .end = MSM_PRNG_PHYS + SZ_512 - 1,
479};
480
481struct platform_device msm_device_rng = {
482 .name = "msm_rng",
483 .id = 0,
484 .num_resources = 1,
485 .resource = &rng_resources,
486};
487#endif
488
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700489#define MSM_VIDC_BASE_PHYS 0x04400000
490#define MSM_VIDC_BASE_SIZE 0x00100000
491
492static struct resource msm_device_vidc_resources[] = {
493 {
494 .start = MSM_VIDC_BASE_PHYS,
495 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
496 .flags = IORESOURCE_MEM,
497 },
498 {
499 .start = VCODEC_IRQ,
500 .end = VCODEC_IRQ,
501 .flags = IORESOURCE_IRQ,
502 },
503};
504
505struct msm_vidc_platform_data vidc_platform_data = {
506#ifdef CONFIG_MSM_BUS_SCALING
507 .vidc_bus_client_pdata = &vidc_bus_client_data,
508#endif
509 .memtype = MEMTYPE_EBI1
510};
511
512struct platform_device msm_device_vidc = {
513 .name = "msm_vidc",
514 .id = 0,
515 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
516 .resource = msm_device_vidc_resources,
517 .dev = {
518 .platform_data = &vidc_platform_data,
519 },
520};
521
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700522#define MSM_SDC1_BASE 0x12400000
523#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
524#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
525#define MSM_SDC2_BASE 0x12140000
526#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
527#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
528#define MSM_SDC2_BASE 0x12140000
529#define MSM_SDC3_BASE 0x12180000
530#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
531#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
532#define MSM_SDC4_BASE 0x121C0000
533#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
534#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
535#define MSM_SDC5_BASE 0x12200000
536#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
537#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
538
539static struct resource resources_sdc1[] = {
540 {
541 .name = "core_mem",
542 .flags = IORESOURCE_MEM,
543 .start = MSM_SDC1_BASE,
544 .end = MSM_SDC1_DML_BASE - 1,
545 },
546 {
547 .name = "core_irq",
548 .flags = IORESOURCE_IRQ,
549 .start = SDC1_IRQ_0,
550 .end = SDC1_IRQ_0
551 },
552#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
553 {
554 .name = "sdcc_dml_addr",
555 .start = MSM_SDC1_DML_BASE,
556 .end = MSM_SDC1_BAM_BASE - 1,
557 .flags = IORESOURCE_MEM,
558 },
559 {
560 .name = "sdcc_bam_addr",
561 .start = MSM_SDC1_BAM_BASE,
562 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
563 .flags = IORESOURCE_MEM,
564 },
565 {
566 .name = "sdcc_bam_irq",
567 .start = SDC1_BAM_IRQ,
568 .end = SDC1_BAM_IRQ,
569 .flags = IORESOURCE_IRQ,
570 },
571#endif
572};
573
574static struct resource resources_sdc2[] = {
575 {
576 .name = "core_mem",
577 .flags = IORESOURCE_MEM,
578 .start = MSM_SDC2_BASE,
579 .end = MSM_SDC2_DML_BASE - 1,
580 },
581 {
582 .name = "core_irq",
583 .flags = IORESOURCE_IRQ,
584 .start = SDC2_IRQ_0,
585 .end = SDC2_IRQ_0
586 },
587#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
588 {
589 .name = "sdcc_dml_addr",
590 .start = MSM_SDC2_DML_BASE,
591 .end = MSM_SDC2_BAM_BASE - 1,
592 .flags = IORESOURCE_MEM,
593 },
594 {
595 .name = "sdcc_bam_addr",
596 .start = MSM_SDC2_BAM_BASE,
597 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
598 .flags = IORESOURCE_MEM,
599 },
600 {
601 .name = "sdcc_bam_irq",
602 .start = SDC2_BAM_IRQ,
603 .end = SDC2_BAM_IRQ,
604 .flags = IORESOURCE_IRQ,
605 },
606#endif
607};
608
609static struct resource resources_sdc3[] = {
610 {
611 .name = "core_mem",
612 .flags = IORESOURCE_MEM,
613 .start = MSM_SDC3_BASE,
614 .end = MSM_SDC3_DML_BASE - 1,
615 },
616 {
617 .name = "core_irq",
618 .flags = IORESOURCE_IRQ,
619 .start = SDC3_IRQ_0,
620 .end = SDC3_IRQ_0
621 },
622#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
623 {
624 .name = "sdcc_dml_addr",
625 .start = MSM_SDC3_DML_BASE,
626 .end = MSM_SDC3_BAM_BASE - 1,
627 .flags = IORESOURCE_MEM,
628 },
629 {
630 .name = "sdcc_bam_addr",
631 .start = MSM_SDC3_BAM_BASE,
632 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
633 .flags = IORESOURCE_MEM,
634 },
635 {
636 .name = "sdcc_bam_irq",
637 .start = SDC3_BAM_IRQ,
638 .end = SDC3_BAM_IRQ,
639 .flags = IORESOURCE_IRQ,
640 },
641#endif
642};
643
644static struct resource resources_sdc4[] = {
645 {
646 .name = "core_mem",
647 .flags = IORESOURCE_MEM,
648 .start = MSM_SDC4_BASE,
649 .end = MSM_SDC4_DML_BASE - 1,
650 },
651 {
652 .name = "core_irq",
653 .flags = IORESOURCE_IRQ,
654 .start = SDC4_IRQ_0,
655 .end = SDC4_IRQ_0
656 },
657#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
658 {
659 .name = "sdcc_dml_addr",
660 .start = MSM_SDC4_DML_BASE,
661 .end = MSM_SDC4_BAM_BASE - 1,
662 .flags = IORESOURCE_MEM,
663 },
664 {
665 .name = "sdcc_bam_addr",
666 .start = MSM_SDC4_BAM_BASE,
667 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
668 .flags = IORESOURCE_MEM,
669 },
670 {
671 .name = "sdcc_bam_irq",
672 .start = SDC4_BAM_IRQ,
673 .end = SDC4_BAM_IRQ,
674 .flags = IORESOURCE_IRQ,
675 },
676#endif
677};
678
679static struct resource resources_sdc5[] = {
680 {
681 .name = "core_mem",
682 .flags = IORESOURCE_MEM,
683 .start = MSM_SDC5_BASE,
684 .end = MSM_SDC5_DML_BASE - 1,
685 },
686 {
687 .name = "core_irq",
688 .flags = IORESOURCE_IRQ,
689 .start = SDC5_IRQ_0,
690 .end = SDC5_IRQ_0
691 },
692#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
693 {
694 .name = "sdcc_dml_addr",
695 .start = MSM_SDC5_DML_BASE,
696 .end = MSM_SDC5_BAM_BASE - 1,
697 .flags = IORESOURCE_MEM,
698 },
699 {
700 .name = "sdcc_bam_addr",
701 .start = MSM_SDC5_BAM_BASE,
702 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
703 .flags = IORESOURCE_MEM,
704 },
705 {
706 .name = "sdcc_bam_irq",
707 .start = SDC5_BAM_IRQ,
708 .end = SDC5_BAM_IRQ,
709 .flags = IORESOURCE_IRQ,
710 },
711#endif
712};
713
714struct platform_device msm_device_sdc1 = {
715 .name = "msm_sdcc",
716 .id = 1,
717 .num_resources = ARRAY_SIZE(resources_sdc1),
718 .resource = resources_sdc1,
719 .dev = {
720 .coherent_dma_mask = 0xffffffff,
721 },
722};
723
724struct platform_device msm_device_sdc2 = {
725 .name = "msm_sdcc",
726 .id = 2,
727 .num_resources = ARRAY_SIZE(resources_sdc2),
728 .resource = resources_sdc2,
729 .dev = {
730 .coherent_dma_mask = 0xffffffff,
731 },
732};
733
734struct platform_device msm_device_sdc3 = {
735 .name = "msm_sdcc",
736 .id = 3,
737 .num_resources = ARRAY_SIZE(resources_sdc3),
738 .resource = resources_sdc3,
739 .dev = {
740 .coherent_dma_mask = 0xffffffff,
741 },
742};
743
744struct platform_device msm_device_sdc4 = {
745 .name = "msm_sdcc",
746 .id = 4,
747 .num_resources = ARRAY_SIZE(resources_sdc4),
748 .resource = resources_sdc4,
749 .dev = {
750 .coherent_dma_mask = 0xffffffff,
751 },
752};
753
754struct platform_device msm_device_sdc5 = {
755 .name = "msm_sdcc",
756 .id = 5,
757 .num_resources = ARRAY_SIZE(resources_sdc5),
758 .resource = resources_sdc5,
759 .dev = {
760 .coherent_dma_mask = 0xffffffff,
761 },
762};
763
764struct platform_device msm_device_smd = {
765 .name = "msm_smd",
766 .id = -1,
767};
768
769struct platform_device msm_device_bam_dmux = {
770 .name = "BAM_RMNT",
771 .id = -1,
772};
773
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700774static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700775 {
776 .start = ADM_0_SCSS_1_IRQ,
777 .end = (resource_size_t)MSM_DMOV_BASE,
778 .flags = IORESOURCE_IRQ,
779 },
780};
781
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700782struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700783 .name = "msm_dmov",
784 .id = -1,
785 .resource = msm_dmov_resource,
786 .num_resources = ARRAY_SIZE(msm_dmov_resource),
787};
788
789static struct platform_device *msm_sdcc_devices[] __initdata = {
790 &msm_device_sdc1,
791 &msm_device_sdc2,
792 &msm_device_sdc3,
793 &msm_device_sdc4,
794 &msm_device_sdc5,
795};
796
797int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
798{
799 struct platform_device *pdev;
800
801 if (controller < 1 || controller > 5)
802 return -EINVAL;
803
804 pdev = msm_sdcc_devices[controller-1];
805 pdev->dev.platform_data = plat;
806 return platform_device_register(pdev);
807}
808
809static struct resource resources_qup_i2c_gsbi4[] = {
810 {
811 .name = "gsbi_qup_i2c_addr",
812 .start = MSM_GSBI4_PHYS,
813 .end = MSM_GSBI4_PHYS + MSM_QUP_SIZE - 1,
814 .flags = IORESOURCE_MEM,
815 },
816 {
817 .name = "qup_phys_addr",
818 .start = MSM_GSBI4_QUP_PHYS,
819 .end = MSM_GSBI4_QUP_PHYS + 4 - 1,
820 .flags = IORESOURCE_MEM,
821 },
822 {
823 .name = "qup_err_intr",
824 .start = GSBI4_QUP_IRQ,
825 .end = GSBI4_QUP_IRQ,
826 .flags = IORESOURCE_IRQ,
827 },
828};
829
830struct platform_device msm8960_device_qup_i2c_gsbi4 = {
831 .name = "qup_i2c",
832 .id = 4,
833 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
834 .resource = resources_qup_i2c_gsbi4,
835};
836
837static struct resource resources_qup_i2c_gsbi3[] = {
838 {
839 .name = "gsbi_qup_i2c_addr",
840 .start = MSM_GSBI3_PHYS,
841 .end = MSM_GSBI3_PHYS + MSM_QUP_SIZE - 1,
842 .flags = IORESOURCE_MEM,
843 },
844 {
845 .name = "qup_phys_addr",
846 .start = MSM_GSBI3_QUP_PHYS,
847 .end = MSM_GSBI3_QUP_PHYS + 4 - 1,
848 .flags = IORESOURCE_MEM,
849 },
850 {
851 .name = "qup_err_intr",
852 .start = GSBI3_QUP_IRQ,
853 .end = GSBI3_QUP_IRQ,
854 .flags = IORESOURCE_IRQ,
855 },
856};
857
858struct platform_device msm8960_device_qup_i2c_gsbi3 = {
859 .name = "qup_i2c",
860 .id = 3,
861 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
862 .resource = resources_qup_i2c_gsbi3,
863};
864
865static struct resource resources_qup_i2c_gsbi10[] = {
866 {
867 .name = "gsbi_qup_i2c_addr",
868 .start = MSM_GSBI10_PHYS,
869 .end = MSM_GSBI10_PHYS + MSM_QUP_SIZE - 1,
870 .flags = IORESOURCE_MEM,
871 },
872 {
873 .name = "qup_phys_addr",
874 .start = MSM_GSBI10_QUP_PHYS,
875 .end = MSM_GSBI10_QUP_PHYS + 4 - 1,
876 .flags = IORESOURCE_MEM,
877 },
878 {
879 .name = "qup_err_intr",
880 .start = GSBI10_QUP_IRQ,
881 .end = GSBI10_QUP_IRQ,
882 .flags = IORESOURCE_IRQ,
883 },
884};
885
886struct platform_device msm8960_device_qup_i2c_gsbi10 = {
887 .name = "qup_i2c",
888 .id = 10,
889 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
890 .resource = resources_qup_i2c_gsbi10,
891};
892
893static struct resource resources_qup_i2c_gsbi12[] = {
894 {
895 .name = "gsbi_qup_i2c_addr",
896 .start = MSM_GSBI12_PHYS,
897 .end = MSM_GSBI12_PHYS + MSM_QUP_SIZE - 1,
898 .flags = IORESOURCE_MEM,
899 },
900 {
901 .name = "qup_phys_addr",
902 .start = MSM_GSBI12_QUP_PHYS,
903 .end = MSM_GSBI12_QUP_PHYS + 4 - 1,
904 .flags = IORESOURCE_MEM,
905 },
906 {
907 .name = "qup_err_intr",
908 .start = GSBI12_QUP_IRQ,
909 .end = GSBI12_QUP_IRQ,
910 .flags = IORESOURCE_IRQ,
911 },
912};
913
914struct platform_device msm8960_device_qup_i2c_gsbi12 = {
915 .name = "qup_i2c",
916 .id = 12,
917 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
918 .resource = resources_qup_i2c_gsbi12,
919};
920
921#ifdef CONFIG_MSM_CAMERA
922struct resource msm_camera_resources[] = {
923 {
924 .name = "vfe",
925 .start = 0x04500000,
926 .end = 0x04500000 + SZ_1M - 1,
927 .flags = IORESOURCE_MEM,
928 },
929 {
930 .name = "vfe",
931 .start = VFE_IRQ,
932 .end = VFE_IRQ,
933 .flags = IORESOURCE_IRQ,
934 },
935 {
936 .name = "vid_buf",
937 .flags = IORESOURCE_DMA,
938 },
939 {
940 .name = "ispif",
941 .start = 0x04800800,
942 .end = 0x04800800 + SZ_1K - 1,
943 .flags = IORESOURCE_MEM,
944 },
945 {
946 .name = "ispif",
947 .start = ISPIF_IRQ,
948 .end = ISPIF_IRQ,
949 .flags = IORESOURCE_IRQ,
950 },
951 {
952 .name = "csid0",
953 .start = 0x04800000,
954 .end = 0x04800000 + SZ_1K - 1,
955 .flags = IORESOURCE_MEM,
956 },
957 {
958 .name = "csid0",
959 .start = CSI_0_IRQ,
960 .end = CSI_0_IRQ,
961 .flags = IORESOURCE_IRQ,
962 },
963 {
964 .name = "csiphy0",
965 .start = 0x04800C00,
966 .end = 0x04800C00 + SZ_1K - 1,
967 .flags = IORESOURCE_MEM,
968 },
969 {
970 .name = "csiphy0",
971 .start = CSIPHY_4LN_IRQ,
972 .end = CSIPHY_4LN_IRQ,
973 .flags = IORESOURCE_IRQ,
974 },
975 {
976 .name = "csid1",
977 .start = 0x04800400,
978 .end = 0x04800400 + SZ_1K - 1,
979 .flags = IORESOURCE_MEM,
980 },
981 {
982 .name = "csid1",
983 .start = CSI_1_IRQ,
984 .end = CSI_1_IRQ,
985 .flags = IORESOURCE_IRQ,
986 },
987 {
988 .name = "csiphy1",
989 .start = 0x04801000,
990 .end = 0x04801000 + SZ_1K - 1,
991 .flags = IORESOURCE_MEM,
992 },
993 {
994 .name = "csiphy1",
995 .start = MSM8960_CSIPHY_2LN_IRQ,
996 .end = MSM8960_CSIPHY_2LN_IRQ,
997 .flags = IORESOURCE_IRQ,
998 },
999};
1000
1001int __init msm_get_cam_resources(struct msm_camera_sensor_info *s_info)
1002{
1003 s_info->resource = msm_camera_resources;
1004 s_info->num_resources = ARRAY_SIZE(msm_camera_resources);
1005 return 0;
1006}
1007#endif
1008
1009static struct resource resources_ssbi_pm8921[] = {
1010 {
1011 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1012 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1013 .flags = IORESOURCE_MEM,
1014 },
1015};
1016
1017struct platform_device msm8960_device_ssbi_pm8921 = {
1018 .name = "msm_ssbi",
1019 .id = 0,
1020 .resource = resources_ssbi_pm8921,
1021 .num_resources = ARRAY_SIZE(resources_ssbi_pm8921),
1022};
1023
1024static struct resource resources_qup_spi_gsbi1[] = {
1025 {
1026 .name = "spi_base",
1027 .start = MSM_GSBI1_QUP_PHYS,
1028 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1029 .flags = IORESOURCE_MEM,
1030 },
1031 {
1032 .name = "gsbi_base",
1033 .start = MSM_GSBI1_PHYS,
1034 .end = MSM_GSBI1_PHYS + 4 - 1,
1035 .flags = IORESOURCE_MEM,
1036 },
1037 {
1038 .name = "spi_irq_in",
1039 .start = MSM8960_GSBI1_QUP_IRQ,
1040 .end = MSM8960_GSBI1_QUP_IRQ,
1041 .flags = IORESOURCE_IRQ,
1042 },
1043};
1044
1045struct platform_device msm8960_device_qup_spi_gsbi1 = {
1046 .name = "spi_qsd",
1047 .id = 0,
1048 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1049 .resource = resources_qup_spi_gsbi1,
1050};
1051
1052struct platform_device msm_pcm = {
1053 .name = "msm-pcm-dsp",
1054 .id = -1,
1055};
1056
1057struct platform_device msm_pcm_routing = {
1058 .name = "msm-pcm-routing",
1059 .id = -1,
1060};
1061
1062struct platform_device msm_cpudai0 = {
1063 .name = "msm-dai-q6",
1064 .id = 0x4000,
1065};
1066
1067struct platform_device msm_cpudai1 = {
1068 .name = "msm-dai-q6",
1069 .id = 0x4001,
1070};
1071
1072struct platform_device msm_cpudai_hdmi_rx = {
1073 .name = "msm-dai-q6",
1074 .id = 8,
1075};
1076
1077struct platform_device msm_cpudai_bt_rx = {
1078 .name = "msm-dai-q6",
1079 .id = 0x3000,
1080};
1081
1082struct platform_device msm_cpudai_bt_tx = {
1083 .name = "msm-dai-q6",
1084 .id = 0x3001,
1085};
1086
1087struct platform_device msm_cpudai_fm_rx = {
1088 .name = "msm-dai-q6",
1089 .id = 0x3004,
1090};
1091
1092struct platform_device msm_cpudai_fm_tx = {
1093 .name = "msm-dai-q6",
1094 .id = 0x3005,
1095};
1096
1097struct platform_device msm_cpu_fe = {
1098 .name = "msm-dai-fe",
1099 .id = -1,
1100};
1101
1102struct platform_device msm_stub_codec = {
1103 .name = "msm-stub-codec",
1104 .id = 1,
1105};
1106
1107struct platform_device msm_voice = {
1108 .name = "msm-pcm-voice",
1109 .id = -1,
1110};
1111
1112struct platform_device msm_voip = {
1113 .name = "msm-voip-dsp",
1114 .id = -1,
1115};
1116
1117struct platform_device msm_lpa_pcm = {
1118 .name = "msm-pcm-lpa",
1119 .id = -1,
1120};
1121
1122struct platform_device msm_pcm_hostless = {
1123 .name = "msm-pcm-hostless",
1124 .id = -1,
1125};
1126
1127struct platform_device *msm_footswitch_devices[] = {
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001128 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1129 FS_8X60(FS_VFE, "fs_vfe"),
1130 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001131 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1132 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1133 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001134 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001135};
1136unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1137
1138#ifdef CONFIG_MSM_ROTATOR
1139#define ROTATOR_HW_BASE 0x04E00000
1140static struct resource resources_msm_rotator[] = {
1141 {
1142 .start = ROTATOR_HW_BASE,
1143 .end = ROTATOR_HW_BASE + 0x100000 - 1,
1144 .flags = IORESOURCE_MEM,
1145 },
1146 {
1147 .start = ROT_IRQ,
1148 .end = ROT_IRQ,
1149 .flags = IORESOURCE_IRQ,
1150 },
1151};
1152
1153static struct msm_rot_clocks rotator_clocks[] = {
1154 {
1155 .clk_name = "rot_clk",
1156 .clk_type = ROTATOR_CORE_CLK,
1157 .clk_rate = 160 * 1000 * 1000,
1158 },
1159 {
1160 .clk_name = "rotator_pclk",
1161 .clk_type = ROTATOR_PCLK,
1162 .clk_rate = 0,
1163 },
1164 {
1165 .clk_name = "rot_axi_clk",
1166 .clk_type = ROTATOR_AXI_CLK,
1167 .clk_rate = 0,
1168 },
1169};
1170
1171static struct msm_rotator_platform_data rotator_pdata = {
1172 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1173 .hardware_version_number = 0x01020309,
1174 .rotator_clks = rotator_clocks,
1175 .regulator_name = "fs_rot",
1176};
1177
1178struct platform_device msm_rotator_device = {
1179 .name = "msm_rotator",
1180 .id = 0,
1181 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1182 .resource = resources_msm_rotator,
1183 .dev = {
1184 .platform_data = &rotator_pdata,
1185 },
1186};
1187#endif
1188
1189#define MIPI_DSI_HW_BASE 0x04700000
1190#define MDP_HW_BASE 0x05100000
1191
1192static struct resource msm_mipi_dsi1_resources[] = {
1193 {
1194 .name = "mipi_dsi",
1195 .start = MIPI_DSI_HW_BASE,
1196 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1197 .flags = IORESOURCE_MEM,
1198 },
1199 {
1200 .start = DSI1_IRQ,
1201 .end = DSI1_IRQ,
1202 .flags = IORESOURCE_IRQ,
1203 },
1204};
1205
1206struct platform_device msm_mipi_dsi1_device = {
1207 .name = "mipi_dsi",
1208 .id = 1,
1209 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
1210 .resource = msm_mipi_dsi1_resources,
1211};
1212
1213static struct resource msm_mdp_resources[] = {
1214 {
1215 .name = "mdp",
1216 .start = MDP_HW_BASE,
1217 .end = MDP_HW_BASE + 0x000F0000 - 1,
1218 .flags = IORESOURCE_MEM,
1219 },
1220 {
1221 .start = MDP_IRQ,
1222 .end = MDP_IRQ,
1223 .flags = IORESOURCE_IRQ,
1224 },
1225};
1226
1227static struct platform_device msm_mdp_device = {
1228 .name = "mdp",
1229 .id = 0,
1230 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1231 .resource = msm_mdp_resources,
1232};
1233
1234static void __init msm_register_device(struct platform_device *pdev, void *data)
1235{
1236 int ret;
1237
1238 pdev->dev.platform_data = data;
1239 ret = platform_device_register(pdev);
1240 if (ret)
1241 dev_err(&pdev->dev,
1242 "%s: platform_device_register() failed = %d\n",
1243 __func__, ret);
1244}
1245
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001246#ifdef CONFIG_MSM_BUS_SCALING
1247static struct platform_device msm_dtv_device = {
1248 .name = "dtv",
1249 .id = 0,
1250};
1251#endif
1252
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001253void __init msm_fb_register_device(char *name, void *data)
1254{
1255 if (!strncmp(name, "mdp", 3))
1256 msm_register_device(&msm_mdp_device, data);
1257 else if (!strncmp(name, "mipi_dsi", 8))
1258 msm_register_device(&msm_mipi_dsi1_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001259#ifdef CONFIG_MSM_BUS_SCALING
1260 else if (!strncmp(name, "dtv", 3))
1261 msm_register_device(&msm_dtv_device, data);
1262#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001263 else
1264 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1265}
1266
1267static struct resource resources_sps[] = {
1268 {
1269 .name = "pipe_mem",
1270 .start = 0x12800000,
1271 .end = 0x12800000 + 0x4000 - 1,
1272 .flags = IORESOURCE_MEM,
1273 },
1274 {
1275 .name = "bamdma_dma",
1276 .start = 0x12240000,
1277 .end = 0x12240000 + 0x1000 - 1,
1278 .flags = IORESOURCE_MEM,
1279 },
1280 {
1281 .name = "bamdma_bam",
1282 .start = 0x12244000,
1283 .end = 0x12244000 + 0x4000 - 1,
1284 .flags = IORESOURCE_MEM,
1285 },
1286 {
1287 .name = "bamdma_irq",
1288 .start = SPS_BAM_DMA_IRQ,
1289 .end = SPS_BAM_DMA_IRQ,
1290 .flags = IORESOURCE_IRQ,
1291 },
1292};
1293
1294struct msm_sps_platform_data msm_sps_pdata = {
1295 .bamdma_restricted_pipes = 0x06,
1296};
1297
1298struct platform_device msm_device_sps = {
1299 .name = "msm_sps",
1300 .id = -1,
1301 .num_resources = ARRAY_SIZE(resources_sps),
1302 .resource = resources_sps,
1303 .dev.platform_data = &msm_sps_pdata,
1304};
1305
1306#ifdef CONFIG_MSM_MPM
1307static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001308 [1] = MSM_GPIO_TO_INT(46),
1309 [2] = MSM_GPIO_TO_INT(150),
1310 [4] = MSM_GPIO_TO_INT(103),
1311 [5] = MSM_GPIO_TO_INT(104),
1312 [6] = MSM_GPIO_TO_INT(105),
1313 [7] = MSM_GPIO_TO_INT(106),
1314 [8] = MSM_GPIO_TO_INT(107),
1315 [9] = MSM_GPIO_TO_INT(7),
1316 [10] = MSM_GPIO_TO_INT(11),
1317 [11] = MSM_GPIO_TO_INT(15),
1318 [12] = MSM_GPIO_TO_INT(19),
1319 [13] = MSM_GPIO_TO_INT(23),
1320 [14] = MSM_GPIO_TO_INT(27),
1321 [15] = MSM_GPIO_TO_INT(31),
1322 [16] = MSM_GPIO_TO_INT(35),
1323 [19] = MSM_GPIO_TO_INT(90),
1324 [20] = MSM_GPIO_TO_INT(92),
1325 [23] = MSM_GPIO_TO_INT(85),
1326 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001327 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001328 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001329 [29] = MSM_GPIO_TO_INT(10),
1330 [30] = MSM_GPIO_TO_INT(102),
1331 [31] = MSM_GPIO_TO_INT(81),
1332 [32] = MSM_GPIO_TO_INT(78),
1333 [33] = MSM_GPIO_TO_INT(94),
1334 [34] = MSM_GPIO_TO_INT(72),
1335 [35] = MSM_GPIO_TO_INT(39),
1336 [36] = MSM_GPIO_TO_INT(43),
1337 [37] = MSM_GPIO_TO_INT(61),
1338 [38] = MSM_GPIO_TO_INT(50),
1339 [39] = MSM_GPIO_TO_INT(42),
1340 [41] = MSM_GPIO_TO_INT(62),
1341 [42] = MSM_GPIO_TO_INT(76),
1342 [43] = MSM_GPIO_TO_INT(75),
1343 [44] = MSM_GPIO_TO_INT(70),
1344 [45] = MSM_GPIO_TO_INT(69),
1345 [46] = MSM_GPIO_TO_INT(67),
1346 [47] = MSM_GPIO_TO_INT(65),
1347 [48] = MSM_GPIO_TO_INT(58),
1348 [49] = MSM_GPIO_TO_INT(54),
1349 [50] = MSM_GPIO_TO_INT(52),
1350 [51] = MSM_GPIO_TO_INT(49),
1351 [52] = MSM_GPIO_TO_INT(40),
1352 [53] = MSM_GPIO_TO_INT(37),
1353 [54] = MSM_GPIO_TO_INT(24),
1354 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001355};
1356
1357static uint16_t msm_mpm_bypassed_apps_irqs[] = {
1358 TLMM_MSM_SUMMARY_IRQ,
1359 RPM_APCC_CPU0_GP_HIGH_IRQ,
1360 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1361 RPM_APCC_CPU0_GP_LOW_IRQ,
1362 RPM_APCC_CPU0_WAKE_UP_IRQ,
1363 RPM_APCC_CPU1_GP_HIGH_IRQ,
1364 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1365 RPM_APCC_CPU1_GP_LOW_IRQ,
1366 RPM_APCC_CPU1_WAKE_UP_IRQ,
1367 MSS_TO_APPS_IRQ_0,
1368 MSS_TO_APPS_IRQ_1,
1369 MSS_TO_APPS_IRQ_2,
1370 MSS_TO_APPS_IRQ_3,
1371 MSS_TO_APPS_IRQ_4,
1372 MSS_TO_APPS_IRQ_5,
1373 MSS_TO_APPS_IRQ_6,
1374 MSS_TO_APPS_IRQ_7,
1375 MSS_TO_APPS_IRQ_8,
1376 MSS_TO_APPS_IRQ_9,
1377 LPASS_SCSS_GP_LOW_IRQ,
1378 LPASS_SCSS_GP_MEDIUM_IRQ,
1379 LPASS_SCSS_GP_HIGH_IRQ,
1380 SPS_MTI_31,
1381};
1382
1383struct msm_mpm_device_data msm_mpm_dev_data = {
1384 .irqs_m2a = msm_mpm_irqs_m2a,
1385 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1386 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1387 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1388 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1389 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1390 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1391 .mpm_apps_ipc_val = BIT(1),
1392 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1393
1394};
1395#endif
1396
1397struct clk_lookup msm_clocks_8960_dummy[] = {
1398 CLK_DUMMY("pll2", PLL2, NULL, 0),
1399 CLK_DUMMY("pll8", PLL8, NULL, 0),
1400 CLK_DUMMY("pll4", PLL4, NULL, 0),
1401
1402 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1403 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1404 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1405 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1406 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1407 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1408 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1409 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1410 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1411 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1412 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1413 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1414 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1415 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1416 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1417 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1418
1419 CLK_DUMMY("gsbi_uart_clk", GSBI1_UART_CLK, NULL, OFF),
1420 CLK_DUMMY("gsbi_uart_clk", GSBI2_UART_CLK,
1421 "msm_serial_hsl.0", OFF),
1422 CLK_DUMMY("gsbi_uart_clk", GSBI3_UART_CLK, NULL, OFF),
1423 CLK_DUMMY("gsbi_uart_clk", GSBI4_UART_CLK, NULL, OFF),
1424 CLK_DUMMY("gsbi_uart_clk", GSBI5_UART_CLK, NULL, OFF),
1425 CLK_DUMMY("uartdm_clk", GSBI6_UART_CLK, NULL, OFF),
1426 CLK_DUMMY("gsbi_uart_clk", GSBI7_UART_CLK, NULL, OFF),
1427 CLK_DUMMY("gsbi_uart_clk", GSBI8_UART_CLK, NULL, OFF),
1428 CLK_DUMMY("gsbi_uart_clk", GSBI9_UART_CLK, NULL, OFF),
1429 CLK_DUMMY("gsbi_uart_clk", GSBI10_UART_CLK, NULL, OFF),
1430 CLK_DUMMY("gsbi_uart_clk", GSBI11_UART_CLK, NULL, OFF),
1431 CLK_DUMMY("gsbi_uart_clk", GSBI12_UART_CLK, NULL, OFF),
1432 CLK_DUMMY("spi_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
1433 CLK_DUMMY("gsbi_qup_clk", GSBI2_QUP_CLK, NULL, OFF),
1434 CLK_DUMMY("gsbi_qup_clk", GSBI3_QUP_CLK, NULL, OFF),
1435 CLK_DUMMY("gsbi_qup_clk", GSBI4_QUP_CLK,
1436 "qup_i2c.4", OFF),
1437 CLK_DUMMY("gsbi_qup_clk", GSBI5_QUP_CLK, NULL, OFF),
1438 CLK_DUMMY("gsbi_qup_clk", GSBI6_QUP_CLK, NULL, OFF),
1439 CLK_DUMMY("gsbi_qup_clk", GSBI7_QUP_CLK, NULL, OFF),
1440 CLK_DUMMY("gsbi_qup_clk", GSBI8_QUP_CLK, NULL, OFF),
1441 CLK_DUMMY("gsbi_qup_clk", GSBI9_QUP_CLK, NULL, OFF),
1442 CLK_DUMMY("gsbi_qup_clk", GSBI10_QUP_CLK, NULL, OFF),
1443 CLK_DUMMY("gsbi_qup_clk", GSBI11_QUP_CLK, NULL, OFF),
1444 CLK_DUMMY("gsbi_qup_clk", GSBI12_QUP_CLK, NULL, OFF),
1445 CLK_DUMMY("pdm_clk", PDM_CLK, NULL, OFF),
1446 CLK_DUMMY("pmem_clk", PMEM_CLK, NULL, OFF),
1447 CLK_DUMMY("prng_clk", PRNG_CLK, NULL, OFF),
1448 CLK_DUMMY("sdc_clk", SDC1_CLK, NULL, OFF),
1449 CLK_DUMMY("sdc_clk", SDC2_CLK, NULL, OFF),
1450 CLK_DUMMY("sdc_clk", SDC3_CLK, NULL, OFF),
1451 CLK_DUMMY("sdc_clk", SDC4_CLK, NULL, OFF),
1452 CLK_DUMMY("sdc_clk", SDC5_CLK, NULL, OFF),
1453 CLK_DUMMY("tsif_ref_clk", TSIF_REF_CLK, NULL, OFF),
1454 CLK_DUMMY("tssc_clk", TSSC_CLK, NULL, OFF),
1455 CLK_DUMMY("usb_hs_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1456 CLK_DUMMY("usb_phy_clk", USB_PHY0_CLK, NULL, OFF),
1457 CLK_DUMMY("usb_fs_src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1458 CLK_DUMMY("usb_fs_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1459 CLK_DUMMY("usb_fs_sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
1460 CLK_DUMMY("usb_fs_src_clk", USB_FS2_SRC_CLK, NULL, OFF),
1461 CLK_DUMMY("usb_fs_clk", USB_FS2_XCVR_CLK, NULL, OFF),
1462 CLK_DUMMY("usb_fs_sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
1463 CLK_DUMMY("ce_pclk", CE2_CLK, NULL, OFF),
1464 CLK_DUMMY("ce_clk", CE1_CORE_CLK, NULL, OFF),
1465 CLK_DUMMY("spi_pclk", GSBI1_P_CLK, "spi_qsd.0", OFF),
1466 CLK_DUMMY("gsbi_pclk", GSBI2_P_CLK,
1467 "msm_serial_hsl.0", OFF),
1468 CLK_DUMMY("gsbi_pclk", GSBI3_P_CLK, NULL, OFF),
1469 CLK_DUMMY("gsbi_pclk", GSBI4_P_CLK,
1470 "qup_i2c.4", OFF),
1471 CLK_DUMMY("gsbi_pclk", GSBI5_P_CLK, NULL, OFF),
1472 CLK_DUMMY("uartdm_pclk", GSBI6_P_CLK, NULL, OFF),
1473 CLK_DUMMY("gsbi_pclk", GSBI7_P_CLK, NULL, OFF),
1474 CLK_DUMMY("gsbi_pclk", GSBI8_P_CLK, NULL, OFF),
1475 CLK_DUMMY("gsbi_pclk", GSBI9_P_CLK, NULL, OFF),
1476 CLK_DUMMY("gsbi_pclk", GSBI10_P_CLK, NULL, OFF),
1477 CLK_DUMMY("gsbi_pclk", GSBI11_P_CLK, NULL, OFF),
1478 CLK_DUMMY("gsbi_pclk", GSBI12_P_CLK, NULL, OFF),
1479 CLK_DUMMY("gsbi_pclk", GSBI12_P_CLK, NULL, OFF),
1480 CLK_DUMMY("tsif_pclk", TSIF_P_CLK, NULL, OFF),
1481 CLK_DUMMY("usb_fs_pclk", USB_FS1_P_CLK, NULL, OFF),
1482 CLK_DUMMY("usb_fs_pclk", USB_FS2_P_CLK, NULL, OFF),
1483 CLK_DUMMY("usb_hs_pclk", USB_HS1_P_CLK, NULL, OFF),
1484 CLK_DUMMY("sdc_pclk", SDC1_P_CLK, NULL, OFF),
1485 CLK_DUMMY("sdc_pclk", SDC2_P_CLK, NULL, OFF),
1486 CLK_DUMMY("sdc_pclk", SDC3_P_CLK, NULL, OFF),
1487 CLK_DUMMY("sdc_pclk", SDC4_P_CLK, NULL, OFF),
1488 CLK_DUMMY("sdc_pclk", SDC5_P_CLK, NULL, OFF),
1489 CLK_DUMMY("adm_clk", ADM0_CLK, NULL, OFF),
1490 CLK_DUMMY("adm_pclk", ADM0_P_CLK, NULL, OFF),
1491 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB0_P_CLK, NULL, OFF),
1492 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB1_P_CLK, NULL, OFF),
1493 CLK_DUMMY("pmic_ssbi2", PMIC_SSBI2_CLK, NULL, OFF),
1494 CLK_DUMMY("rpm_msg_ram_pclk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1495 CLK_DUMMY("amp_clk", AMP_CLK, NULL, OFF),
1496 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1497 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1498 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1499 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1500 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1501 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1502 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1503 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1504 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1505 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1506 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1507 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
1508 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
1509 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
1510 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
1511 CLK_DUMMY("gfx2d0_clk", GFX2D0_CLK, NULL, OFF),
1512 CLK_DUMMY("gfx2d1_clk", GFX2D1_CLK, NULL, OFF),
1513 CLK_DUMMY("gfx3d_clk", GFX3D_CLK, NULL, OFF),
1514 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
1515 CLK_DUMMY("imem_clk", IMEM_CLK, NULL, OFF),
1516 CLK_DUMMY("jpegd_clk", JPEGD_CLK, NULL, OFF),
1517 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1518 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1519 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
1520 CLK_DUMMY("rot_clk", ROT_CLK, NULL, OFF),
1521 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
1522 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
1523 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
1524 CLK_DUMMY("vcodec_clk", VCODEC_CLK, NULL, OFF),
1525 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
1526 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
1527 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
1528 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1529 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1530 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1531 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1532 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1533 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
1534 CLK_DUMMY("rot_axi_clk", ROT_AXI_CLK, NULL, OFF),
1535 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
1536 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
1537 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
1538 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
1539 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
1540 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
1541 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
1542 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
1543 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
1544 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
1545 CLK_DUMMY("gfx2d0_pclk", GFX2D0_P_CLK, NULL, OFF),
1546 CLK_DUMMY("gfx2d1_pclk", GFX2D1_P_CLK, NULL, OFF),
1547 CLK_DUMMY("gfx3d_pclk", GFX3D_P_CLK, NULL, OFF),
1548 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
1549 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
1550 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
1551 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
1552 CLK_DUMMY("imem_pclk", IMEM_P_CLK, NULL, OFF),
1553 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
1554 CLK_DUMMY("smmu_pclk", SMMU_P_CLK, NULL, OFF),
1555 CLK_DUMMY("rotator_pclk", ROT_P_CLK, NULL, OFF),
1556 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
1557 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
1558 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
1559 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
1560 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
1561 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
1562 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
1563 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
1564 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
1565 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
1566 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
1567 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
1568 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
1569 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
1570 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
1571 CLK_DUMMY("iommu_clk", JPEGD_AXI_CLK, NULL, 0),
1572 CLK_DUMMY("iommu_clk", VFE_AXI_CLK, NULL, 0),
1573 CLK_DUMMY("iommu_clk", VCODEC_AXI_CLK, NULL, 0),
1574 CLK_DUMMY("iommu_clk", GFX3D_CLK, NULL, 0),
1575 CLK_DUMMY("iommu_clk", GFX2D0_CLK, NULL, 0),
1576 CLK_DUMMY("iommu_clk", GFX2D1_CLK, NULL, 0),
1577
1578 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
1579 CLK_DUMMY("dfab_usb_hs_clk", DFAB_USB_HS_CLK, NULL, 0),
1580 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
1581 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
1582 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
1583 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
1584 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
1585 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1586 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
1587};
1588
1589unsigned msm_num_clocks_8960_dummy = ARRAY_SIZE(msm_clocks_8960_dummy);
1590
1591#define LPASS_SLIMBUS_PHYS 0x28080000
1592#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
1593/* Board info for the slimbus slave device */
1594static struct resource slimbus_res[] = {
1595 {
1596 .start = LPASS_SLIMBUS_PHYS,
1597 .end = LPASS_SLIMBUS_PHYS + 8191,
1598 .flags = IORESOURCE_MEM,
1599 .name = "slimbus_physical",
1600 },
1601 {
1602 .start = LPASS_SLIMBUS_BAM_PHYS,
1603 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
1604 .flags = IORESOURCE_MEM,
1605 .name = "slimbus_bam_physical",
1606 },
1607 {
1608 .start = SLIMBUS0_CORE_EE1_IRQ,
1609 .end = SLIMBUS0_CORE_EE1_IRQ,
1610 .flags = IORESOURCE_IRQ,
1611 .name = "slimbus_irq",
1612 },
1613 {
1614 .start = SLIMBUS0_BAM_EE1_IRQ,
1615 .end = SLIMBUS0_BAM_EE1_IRQ,
1616 .flags = IORESOURCE_IRQ,
1617 .name = "slimbus_bam_irq",
1618 },
1619};
1620
1621struct platform_device msm_slim_ctrl = {
1622 .name = "msm_slim_ctrl",
1623 .id = 1,
1624 .num_resources = ARRAY_SIZE(slimbus_res),
1625 .resource = slimbus_res,
1626 .dev = {
1627 .coherent_dma_mask = 0xffffffffULL,
1628 },
1629};
1630
1631#ifdef CONFIG_MSM_BUS_SCALING
1632static struct msm_bus_vectors grp3d_init_vectors[] = {
1633 {
1634 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1635 .dst = MSM_BUS_SLAVE_EBI_CH0,
1636 .ab = 0,
1637 .ib = 0,
1638 },
1639};
1640
1641static struct msm_bus_vectors grp3d_nominal_vectors[] = {
1642 {
1643 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1644 .dst = MSM_BUS_SLAVE_EBI_CH0,
1645 .ab = 0,
1646 .ib = 200800000U,
1647 },
1648};
1649
1650static struct msm_bus_vectors grp3d_max_vectors[] = {
1651 {
1652 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1653 .dst = MSM_BUS_SLAVE_EBI_CH0,
1654 .ab = 0,
1655 .ib = 2096000000U,
1656 },
1657};
1658
1659static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
1660 {
1661 ARRAY_SIZE(grp3d_init_vectors),
1662 grp3d_init_vectors,
1663 },
1664 {
1665 ARRAY_SIZE(grp3d_nominal_vectors),
1666 grp3d_nominal_vectors,
1667 },
1668 {
1669 ARRAY_SIZE(grp3d_max_vectors),
1670 grp3d_max_vectors,
1671 },
1672};
1673
1674static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
1675 grp3d_bus_scale_usecases,
1676 ARRAY_SIZE(grp3d_bus_scale_usecases),
1677 .name = "grp3d",
1678};
1679
1680static struct msm_bus_vectors grp2d0_init_vectors[] = {
1681 {
1682 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1683 .dst = MSM_BUS_SLAVE_EBI_CH0,
1684 .ab = 0,
1685 .ib = 0,
1686 },
1687};
1688
1689static struct msm_bus_vectors grp2d0_max_vectors[] = {
1690 {
1691 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1692 .dst = MSM_BUS_SLAVE_EBI_CH0,
1693 .ab = 0,
1694 .ib = 248000000,
1695 },
1696};
1697
1698static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
1699 {
1700 ARRAY_SIZE(grp2d0_init_vectors),
1701 grp2d0_init_vectors,
1702 },
1703 {
1704 ARRAY_SIZE(grp2d0_max_vectors),
1705 grp2d0_max_vectors,
1706 },
1707};
1708
1709struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
1710 grp2d0_bus_scale_usecases,
1711 ARRAY_SIZE(grp2d0_bus_scale_usecases),
1712 .name = "grp2d0",
1713};
1714
1715static struct msm_bus_vectors grp2d1_init_vectors[] = {
1716 {
1717 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1718 .dst = MSM_BUS_SLAVE_EBI_CH0,
1719 .ab = 0,
1720 .ib = 0,
1721 },
1722};
1723
1724static struct msm_bus_vectors grp2d1_max_vectors[] = {
1725 {
1726 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1727 .dst = MSM_BUS_SLAVE_EBI_CH0,
1728 .ab = 0,
1729 .ib = 248000000,
1730 },
1731};
1732
1733static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
1734 {
1735 ARRAY_SIZE(grp2d1_init_vectors),
1736 grp2d1_init_vectors,
1737 },
1738 {
1739 ARRAY_SIZE(grp2d1_max_vectors),
1740 grp2d1_max_vectors,
1741 },
1742};
1743
1744struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
1745 grp2d1_bus_scale_usecases,
1746 ARRAY_SIZE(grp2d1_bus_scale_usecases),
1747 .name = "grp2d1",
1748};
1749#endif
1750
1751static struct resource kgsl_3d0_resources[] = {
1752 {
1753 .name = KGSL_3D0_REG_MEMORY,
1754 .start = 0x04300000, /* GFX3D address */
1755 .end = 0x0431ffff,
1756 .flags = IORESOURCE_MEM,
1757 },
1758 {
1759 .name = KGSL_3D0_IRQ,
1760 .start = GFX3D_IRQ,
1761 .end = GFX3D_IRQ,
1762 .flags = IORESOURCE_IRQ,
1763 },
1764};
1765
1766static struct kgsl_device_platform_data kgsl_3d0_pdata = {
1767 .pwr_data = {
1768 .pwrlevel = {
1769 {
1770 .gpu_freq = 266667000,
1771 .bus_freq = 2,
1772 },
1773 {
1774 .gpu_freq = 228571000,
1775 .bus_freq = 1,
1776 },
1777 {
1778 .gpu_freq = 266667000,
1779 .bus_freq = 0,
1780 },
1781 },
1782 .init_level = 0,
1783 .num_levels = 3,
1784 .set_grp_async = NULL,
1785 .idle_timeout = HZ/5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001786 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001787 },
1788 .clk = {
1789 .name = {
1790 .clk = "gfx3d_clk",
1791 .pclk = "gfx3d_pclk",
1792 },
1793#ifdef CONFIG_MSM_BUS_SCALING
1794 .bus_scale_table = &grp3d_bus_scale_pdata,
1795#endif
1796 },
1797 .imem_clk_name = {
1798 .clk = NULL,
1799 .pclk = "imem_pclk",
1800 },
1801};
1802
1803struct platform_device msm_kgsl_3d0 = {
1804 .name = "kgsl-3d0",
1805 .id = 0,
1806 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1807 .resource = kgsl_3d0_resources,
1808 .dev = {
1809 .platform_data = &kgsl_3d0_pdata,
1810 },
1811};
1812
1813static struct resource kgsl_2d0_resources[] = {
1814 {
1815 .name = KGSL_2D0_REG_MEMORY,
1816 .start = 0x04100000, /* Z180 base address */
1817 .end = 0x04100FFF,
1818 .flags = IORESOURCE_MEM,
1819 },
1820 {
1821 .name = KGSL_2D0_IRQ,
1822 .start = GFX2D0_IRQ,
1823 .end = GFX2D0_IRQ,
1824 .flags = IORESOURCE_IRQ,
1825 },
1826};
1827
1828static struct kgsl_device_platform_data kgsl_2d0_pdata = {
1829 .pwr_data = {
1830 .pwrlevel = {
1831 {
1832 .gpu_freq = 200000000,
1833 .bus_freq = 1,
1834 },
1835 {
1836 .gpu_freq = 200000000,
1837 .bus_freq = 0,
1838 },
1839 },
1840 .init_level = 0,
1841 .num_levels = 2,
1842 .set_grp_async = NULL,
1843 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001844 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001845 },
1846 .clk = {
1847 .name = {
1848 /* note: 2d clocks disabled on v1 */
1849 .clk = "gfx2d0_clk",
1850 .pclk = "gfx2d0_pclk",
1851 },
1852#ifdef CONFIG_MSM_BUS_SCALING
1853 .bus_scale_table = &grp2d0_bus_scale_pdata,
1854#endif
1855 },
1856};
1857
1858struct platform_device msm_kgsl_2d0 = {
1859 .name = "kgsl-2d0",
1860 .id = 0,
1861 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
1862 .resource = kgsl_2d0_resources,
1863 .dev = {
1864 .platform_data = &kgsl_2d0_pdata,
1865 },
1866};
1867
1868static struct resource kgsl_2d1_resources[] = {
1869 {
1870 .name = KGSL_2D1_REG_MEMORY,
1871 .start = 0x04200000, /* Z180 device 1 base address */
1872 .end = 0x04200FFF,
1873 .flags = IORESOURCE_MEM,
1874 },
1875 {
1876 .name = KGSL_2D1_IRQ,
1877 .start = GFX2D1_IRQ,
1878 .end = GFX2D1_IRQ,
1879 .flags = IORESOURCE_IRQ,
1880 },
1881};
1882
1883static struct kgsl_device_platform_data kgsl_2d1_pdata = {
1884 .pwr_data = {
1885 .pwrlevel = {
1886 {
1887 .gpu_freq = 200000000,
1888 .bus_freq = 1,
1889 },
1890 {
1891 .gpu_freq = 200000000,
1892 .bus_freq = 0,
1893 },
1894 },
1895 .init_level = 0,
1896 .num_levels = 2,
1897 .set_grp_async = NULL,
1898 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001899 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001900 },
1901 .clk = {
1902 .name = {
1903 .clk = "gfx2d1_clk",
1904 .pclk = "gfx2d1_pclk",
1905 },
1906#ifdef CONFIG_MSM_BUS_SCALING
1907 .bus_scale_table = &grp2d1_bus_scale_pdata,
1908#endif
1909 },
1910};
1911
1912struct platform_device msm_kgsl_2d1 = {
1913 .name = "kgsl-2d1",
1914 .id = 1,
1915 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
1916 .resource = kgsl_2d1_resources,
1917 .dev = {
1918 .platform_data = &kgsl_2d1_pdata,
1919 },
1920};
1921
1922#ifdef CONFIG_MSM_GEMINI
1923static struct resource msm_gemini_resources[] = {
1924 {
1925 .start = 0x04600000,
1926 .end = 0x04600000 + SZ_1M - 1,
1927 .flags = IORESOURCE_MEM,
1928 },
1929 {
1930 .start = JPEG_IRQ,
1931 .end = JPEG_IRQ,
1932 .flags = IORESOURCE_IRQ,
1933 },
1934};
1935
1936struct platform_device msm8960_gemini_device = {
1937 .name = "msm_gemini",
1938 .resource = msm_gemini_resources,
1939 .num_resources = ARRAY_SIZE(msm_gemini_resources),
1940};
1941#endif
1942
1943struct msm_rpm_map_data rpm_map_data[] __initdata = {
1944 MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
1945 MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
1946
1947 MSM_RPM_MAP(RPM_CTL, RPM_CTL, 1),
1948
1949 MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1),
1950 MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1),
1951 MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
1952 MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
1953 MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
1954 MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
1955 MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1),
1956 MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1),
1957 MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1),
1958 MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1),
1959
1960 MSM_RPM_MAP(APPS_FABRIC_CFG_HALT_0, APPS_FABRIC_CFG_HALT, 2),
1961 MSM_RPM_MAP(APPS_FABRIC_CFG_CLKMOD_0, APPS_FABRIC_CFG_CLKMOD, 3),
1962 MSM_RPM_MAP(APPS_FABRIC_CFG_IOCTL, APPS_FABRIC_CFG_IOCTL, 1),
1963 MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
1964
1965 MSM_RPM_MAP(SYS_FABRIC_CFG_HALT_0, SYS_FABRIC_CFG_HALT, 2),
1966 MSM_RPM_MAP(SYS_FABRIC_CFG_CLKMOD_0, SYS_FABRIC_CFG_CLKMOD, 3),
1967 MSM_RPM_MAP(SYS_FABRIC_CFG_IOCTL, SYS_FABRIC_CFG_IOCTL, 1),
Eugene Seahd9040ad2011-07-11 13:20:54 -06001968 MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 29),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001969
1970 MSM_RPM_MAP(MMSS_FABRIC_CFG_HALT_0, MMSS_FABRIC_CFG_HALT, 2),
1971 MSM_RPM_MAP(MMSS_FABRIC_CFG_CLKMOD_0, MMSS_FABRIC_CFG_CLKMOD, 3),
1972 MSM_RPM_MAP(MMSS_FABRIC_CFG_IOCTL, MMSS_FABRIC_CFG_IOCTL, 1),
1973 MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
1974
1975 MSM_RPM_MAP(PM8921_S1_0, PM8921_S1, 2),
1976 MSM_RPM_MAP(PM8921_S2_0, PM8921_S2, 2),
1977 MSM_RPM_MAP(PM8921_S3_0, PM8921_S3, 2),
1978 MSM_RPM_MAP(PM8921_S4_0, PM8921_S4, 2),
1979 MSM_RPM_MAP(PM8921_S5_0, PM8921_S5, 2),
1980 MSM_RPM_MAP(PM8921_S6_0, PM8921_S6, 2),
1981 MSM_RPM_MAP(PM8921_S7_0, PM8921_S7, 2),
1982 MSM_RPM_MAP(PM8921_S8_0, PM8921_S8, 2),
1983 MSM_RPM_MAP(PM8921_L1_0, PM8921_L1, 2),
1984 MSM_RPM_MAP(PM8921_L2_0, PM8921_L2, 2),
1985 MSM_RPM_MAP(PM8921_L3_0, PM8921_L3, 2),
1986 MSM_RPM_MAP(PM8921_L4_0, PM8921_L4, 2),
1987 MSM_RPM_MAP(PM8921_L5_0, PM8921_L5, 2),
1988 MSM_RPM_MAP(PM8921_L6_0, PM8921_L6, 2),
1989 MSM_RPM_MAP(PM8921_L7_0, PM8921_L7, 2),
1990 MSM_RPM_MAP(PM8921_L8_0, PM8921_L8, 2),
1991 MSM_RPM_MAP(PM8921_L9_0, PM8921_L9, 2),
1992 MSM_RPM_MAP(PM8921_L10_0, PM8921_L10, 2),
1993 MSM_RPM_MAP(PM8921_L11_0, PM8921_L11, 2),
1994 MSM_RPM_MAP(PM8921_L12_0, PM8921_L12, 2),
1995 MSM_RPM_MAP(PM8921_L13_0, PM8921_L13, 2),
1996 MSM_RPM_MAP(PM8921_L14_0, PM8921_L14, 2),
1997 MSM_RPM_MAP(PM8921_L15_0, PM8921_L15, 2),
1998 MSM_RPM_MAP(PM8921_L16_0, PM8921_L16, 2),
1999 MSM_RPM_MAP(PM8921_L17_0, PM8921_L17, 2),
2000 MSM_RPM_MAP(PM8921_L18_0, PM8921_L18, 2),
2001 MSM_RPM_MAP(PM8921_L19_0, PM8921_L19, 2),
2002 MSM_RPM_MAP(PM8921_L20_0, PM8921_L20, 2),
2003 MSM_RPM_MAP(PM8921_L21_0, PM8921_L21, 2),
2004 MSM_RPM_MAP(PM8921_L22_0, PM8921_L22, 2),
2005 MSM_RPM_MAP(PM8921_L23_0, PM8921_L23, 2),
2006 MSM_RPM_MAP(PM8921_L24_0, PM8921_L24, 2),
2007 MSM_RPM_MAP(PM8921_L25_0, PM8921_L25, 2),
2008 MSM_RPM_MAP(PM8921_L26_0, PM8921_L26, 2),
2009 MSM_RPM_MAP(PM8921_L27_0, PM8921_L27, 2),
2010 MSM_RPM_MAP(PM8921_L28_0, PM8921_L28, 2),
2011 MSM_RPM_MAP(PM8921_L29_0, PM8921_L29, 2),
2012 MSM_RPM_MAP(PM8921_CLK1_0, PM8921_CLK1, 2),
2013 MSM_RPM_MAP(PM8921_CLK2_0, PM8921_CLK2, 2),
2014 MSM_RPM_MAP(PM8921_LVS1, PM8921_LVS1, 1),
2015 MSM_RPM_MAP(PM8921_LVS2, PM8921_LVS2, 1),
2016 MSM_RPM_MAP(PM8921_LVS3, PM8921_LVS3, 1),
2017 MSM_RPM_MAP(PM8921_LVS4, PM8921_LVS4, 1),
2018 MSM_RPM_MAP(PM8921_LVS5, PM8921_LVS5, 1),
2019 MSM_RPM_MAP(PM8921_LVS6, PM8921_LVS6, 1),
2020 MSM_RPM_MAP(PM8921_LVS7, PM8921_LVS7, 1),
2021 MSM_RPM_MAP(NCP_0, NCP, 2),
2022 MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1),
2023 MSM_RPM_MAP(USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2024 MSM_RPM_MAP(HDMI_SWITCH, HDMI_SWITCH, 1),
2025
2026};
2027unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data);
2028
2029struct platform_device msm_bus_sys_fabric = {
2030 .name = "msm_bus_fabric",
2031 .id = MSM_BUS_FAB_SYSTEM,
2032};
2033struct platform_device msm_bus_apps_fabric = {
2034 .name = "msm_bus_fabric",
2035 .id = MSM_BUS_FAB_APPSS,
2036};
2037struct platform_device msm_bus_mm_fabric = {
2038 .name = "msm_bus_fabric",
2039 .id = MSM_BUS_FAB_MMSS,
2040};
2041struct platform_device msm_bus_sys_fpb = {
2042 .name = "msm_bus_fabric",
2043 .id = MSM_BUS_FAB_SYSTEM_FPB,
2044};
2045struct platform_device msm_bus_cpss_fpb = {
2046 .name = "msm_bus_fabric",
2047 .id = MSM_BUS_FAB_CPSS_FPB,
2048};
2049
2050/* Sensors DSPS platform data */
2051#ifdef CONFIG_MSM_DSPS
2052
2053#define PPSS_REG_PHYS_BASE 0x12080000
2054
2055static struct dsps_clk_info dsps_clks[] = {};
2056static struct dsps_regulator_info dsps_regs[] = {};
2057
2058/*
2059 * Note: GPIOs field is intialized in run-time at the function
2060 * msm8960_init_dsps().
2061 */
2062
2063struct msm_dsps_platform_data msm_dsps_pdata = {
2064 .clks = dsps_clks,
2065 .clks_num = ARRAY_SIZE(dsps_clks),
2066 .gpios = NULL,
2067 .gpios_num = 0,
2068 .regs = dsps_regs,
2069 .regs_num = ARRAY_SIZE(dsps_regs),
2070 .dsps_pwr_ctl_en = 1,
2071 .signature = DSPS_SIGNATURE,
2072};
2073
2074static struct resource msm_dsps_resources[] = {
2075 {
2076 .start = PPSS_REG_PHYS_BASE,
2077 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2078 .name = "ppss_reg",
2079 .flags = IORESOURCE_MEM,
2080 },
2081};
2082
2083struct platform_device msm_dsps_device = {
2084 .name = "msm_dsps",
2085 .id = 0,
2086 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2087 .resource = msm_dsps_resources,
2088 .dev.platform_data = &msm_dsps_pdata,
2089};
2090
2091#endif /* CONFIG_MSM_DSPS */