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