blob: d856ac6f7e08e477a97142af0701e5de37ce17ca [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[] = {
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001082 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1083 FS_8X60(FS_VFE, "fs_vfe"),
1084 FS_8X60(FS_VPE, "fs_vpe"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001085};
1086unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1087
1088#ifdef CONFIG_MSM_ROTATOR
1089#define ROTATOR_HW_BASE 0x04E00000
1090static struct resource resources_msm_rotator[] = {
1091 {
1092 .start = ROTATOR_HW_BASE,
1093 .end = ROTATOR_HW_BASE + 0x100000 - 1,
1094 .flags = IORESOURCE_MEM,
1095 },
1096 {
1097 .start = ROT_IRQ,
1098 .end = ROT_IRQ,
1099 .flags = IORESOURCE_IRQ,
1100 },
1101};
1102
1103static struct msm_rot_clocks rotator_clocks[] = {
1104 {
1105 .clk_name = "rot_clk",
1106 .clk_type = ROTATOR_CORE_CLK,
1107 .clk_rate = 160 * 1000 * 1000,
1108 },
1109 {
1110 .clk_name = "rotator_pclk",
1111 .clk_type = ROTATOR_PCLK,
1112 .clk_rate = 0,
1113 },
1114 {
1115 .clk_name = "rot_axi_clk",
1116 .clk_type = ROTATOR_AXI_CLK,
1117 .clk_rate = 0,
1118 },
1119};
1120
1121static struct msm_rotator_platform_data rotator_pdata = {
1122 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
1123 .hardware_version_number = 0x01020309,
1124 .rotator_clks = rotator_clocks,
1125 .regulator_name = "fs_rot",
1126};
1127
1128struct platform_device msm_rotator_device = {
1129 .name = "msm_rotator",
1130 .id = 0,
1131 .num_resources = ARRAY_SIZE(resources_msm_rotator),
1132 .resource = resources_msm_rotator,
1133 .dev = {
1134 .platform_data = &rotator_pdata,
1135 },
1136};
1137#endif
1138
1139#define MIPI_DSI_HW_BASE 0x04700000
1140#define MDP_HW_BASE 0x05100000
1141
1142static struct resource msm_mipi_dsi1_resources[] = {
1143 {
1144 .name = "mipi_dsi",
1145 .start = MIPI_DSI_HW_BASE,
1146 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1147 .flags = IORESOURCE_MEM,
1148 },
1149 {
1150 .start = DSI1_IRQ,
1151 .end = DSI1_IRQ,
1152 .flags = IORESOURCE_IRQ,
1153 },
1154};
1155
1156struct platform_device msm_mipi_dsi1_device = {
1157 .name = "mipi_dsi",
1158 .id = 1,
1159 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
1160 .resource = msm_mipi_dsi1_resources,
1161};
1162
1163static struct resource msm_mdp_resources[] = {
1164 {
1165 .name = "mdp",
1166 .start = MDP_HW_BASE,
1167 .end = MDP_HW_BASE + 0x000F0000 - 1,
1168 .flags = IORESOURCE_MEM,
1169 },
1170 {
1171 .start = MDP_IRQ,
1172 .end = MDP_IRQ,
1173 .flags = IORESOURCE_IRQ,
1174 },
1175};
1176
1177static struct platform_device msm_mdp_device = {
1178 .name = "mdp",
1179 .id = 0,
1180 .num_resources = ARRAY_SIZE(msm_mdp_resources),
1181 .resource = msm_mdp_resources,
1182};
1183
1184static void __init msm_register_device(struct platform_device *pdev, void *data)
1185{
1186 int ret;
1187
1188 pdev->dev.platform_data = data;
1189 ret = platform_device_register(pdev);
1190 if (ret)
1191 dev_err(&pdev->dev,
1192 "%s: platform_device_register() failed = %d\n",
1193 __func__, ret);
1194}
1195
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001196#ifdef CONFIG_MSM_BUS_SCALING
1197static struct platform_device msm_dtv_device = {
1198 .name = "dtv",
1199 .id = 0,
1200};
1201#endif
1202
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001203void __init msm_fb_register_device(char *name, void *data)
1204{
1205 if (!strncmp(name, "mdp", 3))
1206 msm_register_device(&msm_mdp_device, data);
1207 else if (!strncmp(name, "mipi_dsi", 8))
1208 msm_register_device(&msm_mipi_dsi1_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07001209#ifdef CONFIG_MSM_BUS_SCALING
1210 else if (!strncmp(name, "dtv", 3))
1211 msm_register_device(&msm_dtv_device, data);
1212#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001213 else
1214 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1215}
1216
1217static struct resource resources_sps[] = {
1218 {
1219 .name = "pipe_mem",
1220 .start = 0x12800000,
1221 .end = 0x12800000 + 0x4000 - 1,
1222 .flags = IORESOURCE_MEM,
1223 },
1224 {
1225 .name = "bamdma_dma",
1226 .start = 0x12240000,
1227 .end = 0x12240000 + 0x1000 - 1,
1228 .flags = IORESOURCE_MEM,
1229 },
1230 {
1231 .name = "bamdma_bam",
1232 .start = 0x12244000,
1233 .end = 0x12244000 + 0x4000 - 1,
1234 .flags = IORESOURCE_MEM,
1235 },
1236 {
1237 .name = "bamdma_irq",
1238 .start = SPS_BAM_DMA_IRQ,
1239 .end = SPS_BAM_DMA_IRQ,
1240 .flags = IORESOURCE_IRQ,
1241 },
1242};
1243
1244struct msm_sps_platform_data msm_sps_pdata = {
1245 .bamdma_restricted_pipes = 0x06,
1246};
1247
1248struct platform_device msm_device_sps = {
1249 .name = "msm_sps",
1250 .id = -1,
1251 .num_resources = ARRAY_SIZE(resources_sps),
1252 .resource = resources_sps,
1253 .dev.platform_data = &msm_sps_pdata,
1254};
1255
1256#ifdef CONFIG_MSM_MPM
1257static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001258 [1] = MSM_GPIO_TO_INT(46),
1259 [2] = MSM_GPIO_TO_INT(150),
1260 [4] = MSM_GPIO_TO_INT(103),
1261 [5] = MSM_GPIO_TO_INT(104),
1262 [6] = MSM_GPIO_TO_INT(105),
1263 [7] = MSM_GPIO_TO_INT(106),
1264 [8] = MSM_GPIO_TO_INT(107),
1265 [9] = MSM_GPIO_TO_INT(7),
1266 [10] = MSM_GPIO_TO_INT(11),
1267 [11] = MSM_GPIO_TO_INT(15),
1268 [12] = MSM_GPIO_TO_INT(19),
1269 [13] = MSM_GPIO_TO_INT(23),
1270 [14] = MSM_GPIO_TO_INT(27),
1271 [15] = MSM_GPIO_TO_INT(31),
1272 [16] = MSM_GPIO_TO_INT(35),
1273 [19] = MSM_GPIO_TO_INT(90),
1274 [20] = MSM_GPIO_TO_INT(92),
1275 [23] = MSM_GPIO_TO_INT(85),
1276 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001277 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001278 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06001279 [29] = MSM_GPIO_TO_INT(10),
1280 [30] = MSM_GPIO_TO_INT(102),
1281 [31] = MSM_GPIO_TO_INT(81),
1282 [32] = MSM_GPIO_TO_INT(78),
1283 [33] = MSM_GPIO_TO_INT(94),
1284 [34] = MSM_GPIO_TO_INT(72),
1285 [35] = MSM_GPIO_TO_INT(39),
1286 [36] = MSM_GPIO_TO_INT(43),
1287 [37] = MSM_GPIO_TO_INT(61),
1288 [38] = MSM_GPIO_TO_INT(50),
1289 [39] = MSM_GPIO_TO_INT(42),
1290 [41] = MSM_GPIO_TO_INT(62),
1291 [42] = MSM_GPIO_TO_INT(76),
1292 [43] = MSM_GPIO_TO_INT(75),
1293 [44] = MSM_GPIO_TO_INT(70),
1294 [45] = MSM_GPIO_TO_INT(69),
1295 [46] = MSM_GPIO_TO_INT(67),
1296 [47] = MSM_GPIO_TO_INT(65),
1297 [48] = MSM_GPIO_TO_INT(58),
1298 [49] = MSM_GPIO_TO_INT(54),
1299 [50] = MSM_GPIO_TO_INT(52),
1300 [51] = MSM_GPIO_TO_INT(49),
1301 [52] = MSM_GPIO_TO_INT(40),
1302 [53] = MSM_GPIO_TO_INT(37),
1303 [54] = MSM_GPIO_TO_INT(24),
1304 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001305};
1306
1307static uint16_t msm_mpm_bypassed_apps_irqs[] = {
1308 TLMM_MSM_SUMMARY_IRQ,
1309 RPM_APCC_CPU0_GP_HIGH_IRQ,
1310 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1311 RPM_APCC_CPU0_GP_LOW_IRQ,
1312 RPM_APCC_CPU0_WAKE_UP_IRQ,
1313 RPM_APCC_CPU1_GP_HIGH_IRQ,
1314 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1315 RPM_APCC_CPU1_GP_LOW_IRQ,
1316 RPM_APCC_CPU1_WAKE_UP_IRQ,
1317 MSS_TO_APPS_IRQ_0,
1318 MSS_TO_APPS_IRQ_1,
1319 MSS_TO_APPS_IRQ_2,
1320 MSS_TO_APPS_IRQ_3,
1321 MSS_TO_APPS_IRQ_4,
1322 MSS_TO_APPS_IRQ_5,
1323 MSS_TO_APPS_IRQ_6,
1324 MSS_TO_APPS_IRQ_7,
1325 MSS_TO_APPS_IRQ_8,
1326 MSS_TO_APPS_IRQ_9,
1327 LPASS_SCSS_GP_LOW_IRQ,
1328 LPASS_SCSS_GP_MEDIUM_IRQ,
1329 LPASS_SCSS_GP_HIGH_IRQ,
1330 SPS_MTI_31,
1331};
1332
1333struct msm_mpm_device_data msm_mpm_dev_data = {
1334 .irqs_m2a = msm_mpm_irqs_m2a,
1335 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1336 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1337 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1338 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1339 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1340 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1341 .mpm_apps_ipc_val = BIT(1),
1342 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1343
1344};
1345#endif
1346
1347struct clk_lookup msm_clocks_8960_dummy[] = {
1348 CLK_DUMMY("pll2", PLL2, NULL, 0),
1349 CLK_DUMMY("pll8", PLL8, NULL, 0),
1350 CLK_DUMMY("pll4", PLL4, NULL, 0),
1351
1352 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1353 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1354 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1355 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1356 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1357 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1358 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1359 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1360 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1361 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1362 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1363 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1364 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1365 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1366 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1367 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1368
1369 CLK_DUMMY("gsbi_uart_clk", GSBI1_UART_CLK, NULL, OFF),
1370 CLK_DUMMY("gsbi_uart_clk", GSBI2_UART_CLK,
1371 "msm_serial_hsl.0", OFF),
1372 CLK_DUMMY("gsbi_uart_clk", GSBI3_UART_CLK, NULL, OFF),
1373 CLK_DUMMY("gsbi_uart_clk", GSBI4_UART_CLK, NULL, OFF),
1374 CLK_DUMMY("gsbi_uart_clk", GSBI5_UART_CLK, NULL, OFF),
1375 CLK_DUMMY("uartdm_clk", GSBI6_UART_CLK, NULL, OFF),
1376 CLK_DUMMY("gsbi_uart_clk", GSBI7_UART_CLK, NULL, OFF),
1377 CLK_DUMMY("gsbi_uart_clk", GSBI8_UART_CLK, NULL, OFF),
1378 CLK_DUMMY("gsbi_uart_clk", GSBI9_UART_CLK, NULL, OFF),
1379 CLK_DUMMY("gsbi_uart_clk", GSBI10_UART_CLK, NULL, OFF),
1380 CLK_DUMMY("gsbi_uart_clk", GSBI11_UART_CLK, NULL, OFF),
1381 CLK_DUMMY("gsbi_uart_clk", GSBI12_UART_CLK, NULL, OFF),
1382 CLK_DUMMY("spi_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
1383 CLK_DUMMY("gsbi_qup_clk", GSBI2_QUP_CLK, NULL, OFF),
1384 CLK_DUMMY("gsbi_qup_clk", GSBI3_QUP_CLK, NULL, OFF),
1385 CLK_DUMMY("gsbi_qup_clk", GSBI4_QUP_CLK,
1386 "qup_i2c.4", OFF),
1387 CLK_DUMMY("gsbi_qup_clk", GSBI5_QUP_CLK, NULL, OFF),
1388 CLK_DUMMY("gsbi_qup_clk", GSBI6_QUP_CLK, NULL, OFF),
1389 CLK_DUMMY("gsbi_qup_clk", GSBI7_QUP_CLK, NULL, OFF),
1390 CLK_DUMMY("gsbi_qup_clk", GSBI8_QUP_CLK, NULL, OFF),
1391 CLK_DUMMY("gsbi_qup_clk", GSBI9_QUP_CLK, NULL, OFF),
1392 CLK_DUMMY("gsbi_qup_clk", GSBI10_QUP_CLK, NULL, OFF),
1393 CLK_DUMMY("gsbi_qup_clk", GSBI11_QUP_CLK, NULL, OFF),
1394 CLK_DUMMY("gsbi_qup_clk", GSBI12_QUP_CLK, NULL, OFF),
1395 CLK_DUMMY("pdm_clk", PDM_CLK, NULL, OFF),
1396 CLK_DUMMY("pmem_clk", PMEM_CLK, NULL, OFF),
1397 CLK_DUMMY("prng_clk", PRNG_CLK, NULL, OFF),
1398 CLK_DUMMY("sdc_clk", SDC1_CLK, NULL, OFF),
1399 CLK_DUMMY("sdc_clk", SDC2_CLK, NULL, OFF),
1400 CLK_DUMMY("sdc_clk", SDC3_CLK, NULL, OFF),
1401 CLK_DUMMY("sdc_clk", SDC4_CLK, NULL, OFF),
1402 CLK_DUMMY("sdc_clk", SDC5_CLK, NULL, OFF),
1403 CLK_DUMMY("tsif_ref_clk", TSIF_REF_CLK, NULL, OFF),
1404 CLK_DUMMY("tssc_clk", TSSC_CLK, NULL, OFF),
1405 CLK_DUMMY("usb_hs_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1406 CLK_DUMMY("usb_phy_clk", USB_PHY0_CLK, NULL, OFF),
1407 CLK_DUMMY("usb_fs_src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1408 CLK_DUMMY("usb_fs_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1409 CLK_DUMMY("usb_fs_sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
1410 CLK_DUMMY("usb_fs_src_clk", USB_FS2_SRC_CLK, NULL, OFF),
1411 CLK_DUMMY("usb_fs_clk", USB_FS2_XCVR_CLK, NULL, OFF),
1412 CLK_DUMMY("usb_fs_sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
1413 CLK_DUMMY("ce_pclk", CE2_CLK, NULL, OFF),
1414 CLK_DUMMY("ce_clk", CE1_CORE_CLK, NULL, OFF),
1415 CLK_DUMMY("spi_pclk", GSBI1_P_CLK, "spi_qsd.0", OFF),
1416 CLK_DUMMY("gsbi_pclk", GSBI2_P_CLK,
1417 "msm_serial_hsl.0", OFF),
1418 CLK_DUMMY("gsbi_pclk", GSBI3_P_CLK, NULL, OFF),
1419 CLK_DUMMY("gsbi_pclk", GSBI4_P_CLK,
1420 "qup_i2c.4", OFF),
1421 CLK_DUMMY("gsbi_pclk", GSBI5_P_CLK, NULL, OFF),
1422 CLK_DUMMY("uartdm_pclk", GSBI6_P_CLK, NULL, OFF),
1423 CLK_DUMMY("gsbi_pclk", GSBI7_P_CLK, NULL, OFF),
1424 CLK_DUMMY("gsbi_pclk", GSBI8_P_CLK, NULL, OFF),
1425 CLK_DUMMY("gsbi_pclk", GSBI9_P_CLK, NULL, OFF),
1426 CLK_DUMMY("gsbi_pclk", GSBI10_P_CLK, NULL, OFF),
1427 CLK_DUMMY("gsbi_pclk", GSBI11_P_CLK, NULL, OFF),
1428 CLK_DUMMY("gsbi_pclk", GSBI12_P_CLK, NULL, OFF),
1429 CLK_DUMMY("gsbi_pclk", GSBI12_P_CLK, NULL, OFF),
1430 CLK_DUMMY("tsif_pclk", TSIF_P_CLK, NULL, OFF),
1431 CLK_DUMMY("usb_fs_pclk", USB_FS1_P_CLK, NULL, OFF),
1432 CLK_DUMMY("usb_fs_pclk", USB_FS2_P_CLK, NULL, OFF),
1433 CLK_DUMMY("usb_hs_pclk", USB_HS1_P_CLK, NULL, OFF),
1434 CLK_DUMMY("sdc_pclk", SDC1_P_CLK, NULL, OFF),
1435 CLK_DUMMY("sdc_pclk", SDC2_P_CLK, NULL, OFF),
1436 CLK_DUMMY("sdc_pclk", SDC3_P_CLK, NULL, OFF),
1437 CLK_DUMMY("sdc_pclk", SDC4_P_CLK, NULL, OFF),
1438 CLK_DUMMY("sdc_pclk", SDC5_P_CLK, NULL, OFF),
1439 CLK_DUMMY("adm_clk", ADM0_CLK, NULL, OFF),
1440 CLK_DUMMY("adm_pclk", ADM0_P_CLK, NULL, OFF),
1441 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB0_P_CLK, NULL, OFF),
1442 CLK_DUMMY("pmic_arb_pclk", PMIC_ARB1_P_CLK, NULL, OFF),
1443 CLK_DUMMY("pmic_ssbi2", PMIC_SSBI2_CLK, NULL, OFF),
1444 CLK_DUMMY("rpm_msg_ram_pclk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1445 CLK_DUMMY("amp_clk", AMP_CLK, NULL, OFF),
1446 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1447 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1448 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1449 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1450 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1451 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1452 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1453 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1454 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1455 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1456 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1457 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
1458 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
1459 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
1460 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
1461 CLK_DUMMY("gfx2d0_clk", GFX2D0_CLK, NULL, OFF),
1462 CLK_DUMMY("gfx2d1_clk", GFX2D1_CLK, NULL, OFF),
1463 CLK_DUMMY("gfx3d_clk", GFX3D_CLK, NULL, OFF),
1464 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
1465 CLK_DUMMY("imem_clk", IMEM_CLK, NULL, OFF),
1466 CLK_DUMMY("jpegd_clk", JPEGD_CLK, NULL, OFF),
1467 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1468 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1469 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
1470 CLK_DUMMY("rot_clk", ROT_CLK, NULL, OFF),
1471 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
1472 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
1473 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
1474 CLK_DUMMY("vcodec_clk", VCODEC_CLK, NULL, OFF),
1475 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
1476 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
1477 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
1478 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1479 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1480 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1481 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1482 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1483 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
1484 CLK_DUMMY("rot_axi_clk", ROT_AXI_CLK, NULL, OFF),
1485 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
1486 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
1487 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
1488 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
1489 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
1490 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
1491 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
1492 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
1493 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
1494 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
1495 CLK_DUMMY("gfx2d0_pclk", GFX2D0_P_CLK, NULL, OFF),
1496 CLK_DUMMY("gfx2d1_pclk", GFX2D1_P_CLK, NULL, OFF),
1497 CLK_DUMMY("gfx3d_pclk", GFX3D_P_CLK, NULL, OFF),
1498 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
1499 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
1500 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
1501 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
1502 CLK_DUMMY("imem_pclk", IMEM_P_CLK, NULL, OFF),
1503 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
1504 CLK_DUMMY("smmu_pclk", SMMU_P_CLK, NULL, OFF),
1505 CLK_DUMMY("rotator_pclk", ROT_P_CLK, NULL, OFF),
1506 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
1507 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
1508 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
1509 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
1510 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
1511 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
1512 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
1513 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
1514 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
1515 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
1516 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
1517 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
1518 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
1519 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
1520 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
1521 CLK_DUMMY("iommu_clk", JPEGD_AXI_CLK, NULL, 0),
1522 CLK_DUMMY("iommu_clk", VFE_AXI_CLK, NULL, 0),
1523 CLK_DUMMY("iommu_clk", VCODEC_AXI_CLK, NULL, 0),
1524 CLK_DUMMY("iommu_clk", GFX3D_CLK, NULL, 0),
1525 CLK_DUMMY("iommu_clk", GFX2D0_CLK, NULL, 0),
1526 CLK_DUMMY("iommu_clk", GFX2D1_CLK, NULL, 0),
1527
1528 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
1529 CLK_DUMMY("dfab_usb_hs_clk", DFAB_USB_HS_CLK, NULL, 0),
1530 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
1531 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
1532 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
1533 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
1534 CLK_DUMMY("dfab_sdc_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
1535 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1536 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
1537};
1538
1539unsigned msm_num_clocks_8960_dummy = ARRAY_SIZE(msm_clocks_8960_dummy);
1540
1541#define LPASS_SLIMBUS_PHYS 0x28080000
1542#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
1543/* Board info for the slimbus slave device */
1544static struct resource slimbus_res[] = {
1545 {
1546 .start = LPASS_SLIMBUS_PHYS,
1547 .end = LPASS_SLIMBUS_PHYS + 8191,
1548 .flags = IORESOURCE_MEM,
1549 .name = "slimbus_physical",
1550 },
1551 {
1552 .start = LPASS_SLIMBUS_BAM_PHYS,
1553 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
1554 .flags = IORESOURCE_MEM,
1555 .name = "slimbus_bam_physical",
1556 },
1557 {
1558 .start = SLIMBUS0_CORE_EE1_IRQ,
1559 .end = SLIMBUS0_CORE_EE1_IRQ,
1560 .flags = IORESOURCE_IRQ,
1561 .name = "slimbus_irq",
1562 },
1563 {
1564 .start = SLIMBUS0_BAM_EE1_IRQ,
1565 .end = SLIMBUS0_BAM_EE1_IRQ,
1566 .flags = IORESOURCE_IRQ,
1567 .name = "slimbus_bam_irq",
1568 },
1569};
1570
1571struct platform_device msm_slim_ctrl = {
1572 .name = "msm_slim_ctrl",
1573 .id = 1,
1574 .num_resources = ARRAY_SIZE(slimbus_res),
1575 .resource = slimbus_res,
1576 .dev = {
1577 .coherent_dma_mask = 0xffffffffULL,
1578 },
1579};
1580
1581#ifdef CONFIG_MSM_BUS_SCALING
1582static struct msm_bus_vectors grp3d_init_vectors[] = {
1583 {
1584 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1585 .dst = MSM_BUS_SLAVE_EBI_CH0,
1586 .ab = 0,
1587 .ib = 0,
1588 },
1589};
1590
1591static struct msm_bus_vectors grp3d_nominal_vectors[] = {
1592 {
1593 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1594 .dst = MSM_BUS_SLAVE_EBI_CH0,
1595 .ab = 0,
1596 .ib = 200800000U,
1597 },
1598};
1599
1600static struct msm_bus_vectors grp3d_max_vectors[] = {
1601 {
1602 .src = MSM_BUS_MASTER_GRAPHICS_3D,
1603 .dst = MSM_BUS_SLAVE_EBI_CH0,
1604 .ab = 0,
1605 .ib = 2096000000U,
1606 },
1607};
1608
1609static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
1610 {
1611 ARRAY_SIZE(grp3d_init_vectors),
1612 grp3d_init_vectors,
1613 },
1614 {
1615 ARRAY_SIZE(grp3d_nominal_vectors),
1616 grp3d_nominal_vectors,
1617 },
1618 {
1619 ARRAY_SIZE(grp3d_max_vectors),
1620 grp3d_max_vectors,
1621 },
1622};
1623
1624static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
1625 grp3d_bus_scale_usecases,
1626 ARRAY_SIZE(grp3d_bus_scale_usecases),
1627 .name = "grp3d",
1628};
1629
1630static struct msm_bus_vectors grp2d0_init_vectors[] = {
1631 {
1632 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1633 .dst = MSM_BUS_SLAVE_EBI_CH0,
1634 .ab = 0,
1635 .ib = 0,
1636 },
1637};
1638
1639static struct msm_bus_vectors grp2d0_max_vectors[] = {
1640 {
1641 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
1642 .dst = MSM_BUS_SLAVE_EBI_CH0,
1643 .ab = 0,
1644 .ib = 248000000,
1645 },
1646};
1647
1648static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
1649 {
1650 ARRAY_SIZE(grp2d0_init_vectors),
1651 grp2d0_init_vectors,
1652 },
1653 {
1654 ARRAY_SIZE(grp2d0_max_vectors),
1655 grp2d0_max_vectors,
1656 },
1657};
1658
1659struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
1660 grp2d0_bus_scale_usecases,
1661 ARRAY_SIZE(grp2d0_bus_scale_usecases),
1662 .name = "grp2d0",
1663};
1664
1665static struct msm_bus_vectors grp2d1_init_vectors[] = {
1666 {
1667 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1668 .dst = MSM_BUS_SLAVE_EBI_CH0,
1669 .ab = 0,
1670 .ib = 0,
1671 },
1672};
1673
1674static struct msm_bus_vectors grp2d1_max_vectors[] = {
1675 {
1676 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1677 .dst = MSM_BUS_SLAVE_EBI_CH0,
1678 .ab = 0,
1679 .ib = 248000000,
1680 },
1681};
1682
1683static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
1684 {
1685 ARRAY_SIZE(grp2d1_init_vectors),
1686 grp2d1_init_vectors,
1687 },
1688 {
1689 ARRAY_SIZE(grp2d1_max_vectors),
1690 grp2d1_max_vectors,
1691 },
1692};
1693
1694struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
1695 grp2d1_bus_scale_usecases,
1696 ARRAY_SIZE(grp2d1_bus_scale_usecases),
1697 .name = "grp2d1",
1698};
1699#endif
1700
1701static struct resource kgsl_3d0_resources[] = {
1702 {
1703 .name = KGSL_3D0_REG_MEMORY,
1704 .start = 0x04300000, /* GFX3D address */
1705 .end = 0x0431ffff,
1706 .flags = IORESOURCE_MEM,
1707 },
1708 {
1709 .name = KGSL_3D0_IRQ,
1710 .start = GFX3D_IRQ,
1711 .end = GFX3D_IRQ,
1712 .flags = IORESOURCE_IRQ,
1713 },
1714};
1715
1716static struct kgsl_device_platform_data kgsl_3d0_pdata = {
1717 .pwr_data = {
1718 .pwrlevel = {
1719 {
1720 .gpu_freq = 266667000,
1721 .bus_freq = 2,
1722 },
1723 {
1724 .gpu_freq = 228571000,
1725 .bus_freq = 1,
1726 },
1727 {
1728 .gpu_freq = 266667000,
1729 .bus_freq = 0,
1730 },
1731 },
1732 .init_level = 0,
1733 .num_levels = 3,
1734 .set_grp_async = NULL,
1735 .idle_timeout = HZ/5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001736 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001737 },
1738 .clk = {
1739 .name = {
1740 .clk = "gfx3d_clk",
1741 .pclk = "gfx3d_pclk",
1742 },
1743#ifdef CONFIG_MSM_BUS_SCALING
1744 .bus_scale_table = &grp3d_bus_scale_pdata,
1745#endif
1746 },
1747 .imem_clk_name = {
1748 .clk = NULL,
1749 .pclk = "imem_pclk",
1750 },
1751};
1752
1753struct platform_device msm_kgsl_3d0 = {
1754 .name = "kgsl-3d0",
1755 .id = 0,
1756 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
1757 .resource = kgsl_3d0_resources,
1758 .dev = {
1759 .platform_data = &kgsl_3d0_pdata,
1760 },
1761};
1762
1763static struct resource kgsl_2d0_resources[] = {
1764 {
1765 .name = KGSL_2D0_REG_MEMORY,
1766 .start = 0x04100000, /* Z180 base address */
1767 .end = 0x04100FFF,
1768 .flags = IORESOURCE_MEM,
1769 },
1770 {
1771 .name = KGSL_2D0_IRQ,
1772 .start = GFX2D0_IRQ,
1773 .end = GFX2D0_IRQ,
1774 .flags = IORESOURCE_IRQ,
1775 },
1776};
1777
1778static struct kgsl_device_platform_data kgsl_2d0_pdata = {
1779 .pwr_data = {
1780 .pwrlevel = {
1781 {
1782 .gpu_freq = 200000000,
1783 .bus_freq = 1,
1784 },
1785 {
1786 .gpu_freq = 200000000,
1787 .bus_freq = 0,
1788 },
1789 },
1790 .init_level = 0,
1791 .num_levels = 2,
1792 .set_grp_async = NULL,
1793 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001794 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001795 },
1796 .clk = {
1797 .name = {
1798 /* note: 2d clocks disabled on v1 */
1799 .clk = "gfx2d0_clk",
1800 .pclk = "gfx2d0_pclk",
1801 },
1802#ifdef CONFIG_MSM_BUS_SCALING
1803 .bus_scale_table = &grp2d0_bus_scale_pdata,
1804#endif
1805 },
1806};
1807
1808struct platform_device msm_kgsl_2d0 = {
1809 .name = "kgsl-2d0",
1810 .id = 0,
1811 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
1812 .resource = kgsl_2d0_resources,
1813 .dev = {
1814 .platform_data = &kgsl_2d0_pdata,
1815 },
1816};
1817
1818static struct resource kgsl_2d1_resources[] = {
1819 {
1820 .name = KGSL_2D1_REG_MEMORY,
1821 .start = 0x04200000, /* Z180 device 1 base address */
1822 .end = 0x04200FFF,
1823 .flags = IORESOURCE_MEM,
1824 },
1825 {
1826 .name = KGSL_2D1_IRQ,
1827 .start = GFX2D1_IRQ,
1828 .end = GFX2D1_IRQ,
1829 .flags = IORESOURCE_IRQ,
1830 },
1831};
1832
1833static struct kgsl_device_platform_data kgsl_2d1_pdata = {
1834 .pwr_data = {
1835 .pwrlevel = {
1836 {
1837 .gpu_freq = 200000000,
1838 .bus_freq = 1,
1839 },
1840 {
1841 .gpu_freq = 200000000,
1842 .bus_freq = 0,
1843 },
1844 },
1845 .init_level = 0,
1846 .num_levels = 2,
1847 .set_grp_async = NULL,
1848 .idle_timeout = HZ/10,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001849 .nap_allowed = true,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001850 },
1851 .clk = {
1852 .name = {
1853 .clk = "gfx2d1_clk",
1854 .pclk = "gfx2d1_pclk",
1855 },
1856#ifdef CONFIG_MSM_BUS_SCALING
1857 .bus_scale_table = &grp2d1_bus_scale_pdata,
1858#endif
1859 },
1860};
1861
1862struct platform_device msm_kgsl_2d1 = {
1863 .name = "kgsl-2d1",
1864 .id = 1,
1865 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
1866 .resource = kgsl_2d1_resources,
1867 .dev = {
1868 .platform_data = &kgsl_2d1_pdata,
1869 },
1870};
1871
1872#ifdef CONFIG_MSM_GEMINI
1873static struct resource msm_gemini_resources[] = {
1874 {
1875 .start = 0x04600000,
1876 .end = 0x04600000 + SZ_1M - 1,
1877 .flags = IORESOURCE_MEM,
1878 },
1879 {
1880 .start = JPEG_IRQ,
1881 .end = JPEG_IRQ,
1882 .flags = IORESOURCE_IRQ,
1883 },
1884};
1885
1886struct platform_device msm8960_gemini_device = {
1887 .name = "msm_gemini",
1888 .resource = msm_gemini_resources,
1889 .num_resources = ARRAY_SIZE(msm_gemini_resources),
1890};
1891#endif
1892
1893struct msm_rpm_map_data rpm_map_data[] __initdata = {
1894 MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
1895 MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
1896
1897 MSM_RPM_MAP(RPM_CTL, RPM_CTL, 1),
1898
1899 MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1),
1900 MSM_RPM_MAP(PXO_CLK, PXO_CLK, 1),
1901 MSM_RPM_MAP(APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
1902 MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
1903 MSM_RPM_MAP(MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
1904 MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
1905 MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1),
1906 MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1),
1907 MSM_RPM_MAP(MMFPB_CLK, MMFPB_CLK, 1),
1908 MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1),
1909
1910 MSM_RPM_MAP(APPS_FABRIC_CFG_HALT_0, APPS_FABRIC_CFG_HALT, 2),
1911 MSM_RPM_MAP(APPS_FABRIC_CFG_CLKMOD_0, APPS_FABRIC_CFG_CLKMOD, 3),
1912 MSM_RPM_MAP(APPS_FABRIC_CFG_IOCTL, APPS_FABRIC_CFG_IOCTL, 1),
1913 MSM_RPM_MAP(APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
1914
1915 MSM_RPM_MAP(SYS_FABRIC_CFG_HALT_0, SYS_FABRIC_CFG_HALT, 2),
1916 MSM_RPM_MAP(SYS_FABRIC_CFG_CLKMOD_0, SYS_FABRIC_CFG_CLKMOD, 3),
1917 MSM_RPM_MAP(SYS_FABRIC_CFG_IOCTL, SYS_FABRIC_CFG_IOCTL, 1),
Eugene Seahd9040ad2011-07-11 13:20:54 -06001918 MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 29),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001919
1920 MSM_RPM_MAP(MMSS_FABRIC_CFG_HALT_0, MMSS_FABRIC_CFG_HALT, 2),
1921 MSM_RPM_MAP(MMSS_FABRIC_CFG_CLKMOD_0, MMSS_FABRIC_CFG_CLKMOD, 3),
1922 MSM_RPM_MAP(MMSS_FABRIC_CFG_IOCTL, MMSS_FABRIC_CFG_IOCTL, 1),
1923 MSM_RPM_MAP(MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
1924
1925 MSM_RPM_MAP(PM8921_S1_0, PM8921_S1, 2),
1926 MSM_RPM_MAP(PM8921_S2_0, PM8921_S2, 2),
1927 MSM_RPM_MAP(PM8921_S3_0, PM8921_S3, 2),
1928 MSM_RPM_MAP(PM8921_S4_0, PM8921_S4, 2),
1929 MSM_RPM_MAP(PM8921_S5_0, PM8921_S5, 2),
1930 MSM_RPM_MAP(PM8921_S6_0, PM8921_S6, 2),
1931 MSM_RPM_MAP(PM8921_S7_0, PM8921_S7, 2),
1932 MSM_RPM_MAP(PM8921_S8_0, PM8921_S8, 2),
1933 MSM_RPM_MAP(PM8921_L1_0, PM8921_L1, 2),
1934 MSM_RPM_MAP(PM8921_L2_0, PM8921_L2, 2),
1935 MSM_RPM_MAP(PM8921_L3_0, PM8921_L3, 2),
1936 MSM_RPM_MAP(PM8921_L4_0, PM8921_L4, 2),
1937 MSM_RPM_MAP(PM8921_L5_0, PM8921_L5, 2),
1938 MSM_RPM_MAP(PM8921_L6_0, PM8921_L6, 2),
1939 MSM_RPM_MAP(PM8921_L7_0, PM8921_L7, 2),
1940 MSM_RPM_MAP(PM8921_L8_0, PM8921_L8, 2),
1941 MSM_RPM_MAP(PM8921_L9_0, PM8921_L9, 2),
1942 MSM_RPM_MAP(PM8921_L10_0, PM8921_L10, 2),
1943 MSM_RPM_MAP(PM8921_L11_0, PM8921_L11, 2),
1944 MSM_RPM_MAP(PM8921_L12_0, PM8921_L12, 2),
1945 MSM_RPM_MAP(PM8921_L13_0, PM8921_L13, 2),
1946 MSM_RPM_MAP(PM8921_L14_0, PM8921_L14, 2),
1947 MSM_RPM_MAP(PM8921_L15_0, PM8921_L15, 2),
1948 MSM_RPM_MAP(PM8921_L16_0, PM8921_L16, 2),
1949 MSM_RPM_MAP(PM8921_L17_0, PM8921_L17, 2),
1950 MSM_RPM_MAP(PM8921_L18_0, PM8921_L18, 2),
1951 MSM_RPM_MAP(PM8921_L19_0, PM8921_L19, 2),
1952 MSM_RPM_MAP(PM8921_L20_0, PM8921_L20, 2),
1953 MSM_RPM_MAP(PM8921_L21_0, PM8921_L21, 2),
1954 MSM_RPM_MAP(PM8921_L22_0, PM8921_L22, 2),
1955 MSM_RPM_MAP(PM8921_L23_0, PM8921_L23, 2),
1956 MSM_RPM_MAP(PM8921_L24_0, PM8921_L24, 2),
1957 MSM_RPM_MAP(PM8921_L25_0, PM8921_L25, 2),
1958 MSM_RPM_MAP(PM8921_L26_0, PM8921_L26, 2),
1959 MSM_RPM_MAP(PM8921_L27_0, PM8921_L27, 2),
1960 MSM_RPM_MAP(PM8921_L28_0, PM8921_L28, 2),
1961 MSM_RPM_MAP(PM8921_L29_0, PM8921_L29, 2),
1962 MSM_RPM_MAP(PM8921_CLK1_0, PM8921_CLK1, 2),
1963 MSM_RPM_MAP(PM8921_CLK2_0, PM8921_CLK2, 2),
1964 MSM_RPM_MAP(PM8921_LVS1, PM8921_LVS1, 1),
1965 MSM_RPM_MAP(PM8921_LVS2, PM8921_LVS2, 1),
1966 MSM_RPM_MAP(PM8921_LVS3, PM8921_LVS3, 1),
1967 MSM_RPM_MAP(PM8921_LVS4, PM8921_LVS4, 1),
1968 MSM_RPM_MAP(PM8921_LVS5, PM8921_LVS5, 1),
1969 MSM_RPM_MAP(PM8921_LVS6, PM8921_LVS6, 1),
1970 MSM_RPM_MAP(PM8921_LVS7, PM8921_LVS7, 1),
1971 MSM_RPM_MAP(NCP_0, NCP, 2),
1972 MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1),
1973 MSM_RPM_MAP(USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
1974 MSM_RPM_MAP(HDMI_SWITCH, HDMI_SWITCH, 1),
1975
1976};
1977unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data);
1978
1979struct platform_device msm_bus_sys_fabric = {
1980 .name = "msm_bus_fabric",
1981 .id = MSM_BUS_FAB_SYSTEM,
1982};
1983struct platform_device msm_bus_apps_fabric = {
1984 .name = "msm_bus_fabric",
1985 .id = MSM_BUS_FAB_APPSS,
1986};
1987struct platform_device msm_bus_mm_fabric = {
1988 .name = "msm_bus_fabric",
1989 .id = MSM_BUS_FAB_MMSS,
1990};
1991struct platform_device msm_bus_sys_fpb = {
1992 .name = "msm_bus_fabric",
1993 .id = MSM_BUS_FAB_SYSTEM_FPB,
1994};
1995struct platform_device msm_bus_cpss_fpb = {
1996 .name = "msm_bus_fabric",
1997 .id = MSM_BUS_FAB_CPSS_FPB,
1998};
1999
2000/* Sensors DSPS platform data */
2001#ifdef CONFIG_MSM_DSPS
2002
2003#define PPSS_REG_PHYS_BASE 0x12080000
2004
2005static struct dsps_clk_info dsps_clks[] = {};
2006static struct dsps_regulator_info dsps_regs[] = {};
2007
2008/*
2009 * Note: GPIOs field is intialized in run-time at the function
2010 * msm8960_init_dsps().
2011 */
2012
2013struct msm_dsps_platform_data msm_dsps_pdata = {
2014 .clks = dsps_clks,
2015 .clks_num = ARRAY_SIZE(dsps_clks),
2016 .gpios = NULL,
2017 .gpios_num = 0,
2018 .regs = dsps_regs,
2019 .regs_num = ARRAY_SIZE(dsps_regs),
2020 .dsps_pwr_ctl_en = 1,
2021 .signature = DSPS_SIGNATURE,
2022};
2023
2024static struct resource msm_dsps_resources[] = {
2025 {
2026 .start = PPSS_REG_PHYS_BASE,
2027 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2028 .name = "ppss_reg",
2029 .flags = IORESOURCE_MEM,
2030 },
2031};
2032
2033struct platform_device msm_dsps_device = {
2034 .name = "msm_dsps",
2035 .id = 0,
2036 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2037 .resource = msm_dsps_resources,
2038 .dev.platform_data = &msm_dsps_pdata,
2039};
2040
2041#endif /* CONFIG_MSM_DSPS */