blob: 0a9d1089794102c07dd49bf629f8a1b7629292ab [file] [log] [blame]
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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>
Deepak Kotur12301a72011-11-09 18:30:29 -080018#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/gpio.h>
20#include <asm/clkdev.h>
21#include <linux/msm_kgsl.h>
22#include <linux/android_pmem.h>
23#include <mach/irqs-8960.h>
Mayank Rana9f51f582011-08-04 18:35:59 +053024#include <mach/dma.h>
25#include <linux/dma-mapping.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070026#include <mach/board.h>
27#include <mach/msm_iomap.h>
28#include <mach/msm_hsusb.h>
29#include <mach/msm_sps.h>
30#include <mach/rpm.h>
31#include <mach/msm_bus_board.h>
32#include <mach/msm_memtypes.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070033#include <mach/msm_smd.h>
Lucille Sylvester6e362412011-12-09 16:21:42 -070034#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070035#include <mach/msm_rtb.h>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070036#include <sound/msm-dai-q6.h>
37#include <sound/apr_audio.h>
Joel Nidera1261942011-09-12 16:30:09 +030038#include <mach/msm_tsif.h>
Pratik Patel1403f2a2012-03-21 10:10:00 -070039#include <mach/qdss.h>
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070040#include <mach/msm_serial_hs_lite.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041#include "clock.h"
42#include "devices.h"
43#include "devices-msm8x60.h"
44#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070045#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060046#include "rpm_log.h"
Praveen Chidambaram7a712232011-10-28 13:39:45 -060047#include "rpm_stats.h"
Stephen Boydeb819882011-08-29 14:46:30 -070048#include "pil-q6v4.h"
49#include "scm-pas.h"
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070050#include <mach/msm_dcvs.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070051#include <mach/iommu_domains.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052
53#ifdef CONFIG_MSM_MPM
Subhash Jadavani909e04f2012-04-12 10:52:50 +053054#include <mach/mpm.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#endif
56#ifdef CONFIG_MSM_DSPS
57#include <mach/msm_dsps.h>
58#endif
59
60
61/* Address of GSBI blocks */
62#define MSM_GSBI1_PHYS 0x16000000
63#define MSM_GSBI2_PHYS 0x16100000
64#define MSM_GSBI3_PHYS 0x16200000
65#define MSM_GSBI4_PHYS 0x16300000
66#define MSM_GSBI5_PHYS 0x16400000
67#define MSM_GSBI6_PHYS 0x16500000
68#define MSM_GSBI7_PHYS 0x16600000
69#define MSM_GSBI8_PHYS 0x1A000000
70#define MSM_GSBI9_PHYS 0x1A100000
71#define MSM_GSBI10_PHYS 0x1A200000
72#define MSM_GSBI11_PHYS 0x12440000
73#define MSM_GSBI12_PHYS 0x12480000
74
75#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
76#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053077#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070078#define MSM_UART8DM_PHYS (MSM_GSBI8_PHYS + 0x40000)
Mayank Ranae009c922012-03-22 03:02:06 +053079#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070080
81/* GSBI QUP devices */
82#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
83#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
84#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
85#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
86#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
87#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
88#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
89#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
90#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
91#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
92#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
93#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
94#define MSM_QUP_SIZE SZ_4K
95
96#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
97#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
98#define MSM_PMIC_SSBI_SIZE SZ_4K
99
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -0700100#define MSM8960_HSUSB_PHYS 0x12500000
101#define MSM8960_HSUSB_SIZE SZ_4K
102
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700103static struct resource resources_otg[] = {
104 {
105 .start = MSM8960_HSUSB_PHYS,
106 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
107 .flags = IORESOURCE_MEM,
108 },
109 {
110 .start = USB1_HS_IRQ,
111 .end = USB1_HS_IRQ,
112 .flags = IORESOURCE_IRQ,
113 },
114};
115
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700116struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700117 .name = "msm_otg",
118 .id = -1,
119 .num_resources = ARRAY_SIZE(resources_otg),
120 .resource = resources_otg,
121 .dev = {
122 .coherent_dma_mask = 0xffffffff,
123 },
124};
125
126static struct resource resources_hsusb[] = {
127 {
128 .start = MSM8960_HSUSB_PHYS,
129 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
130 .flags = IORESOURCE_MEM,
131 },
132 {
133 .start = USB1_HS_IRQ,
134 .end = USB1_HS_IRQ,
135 .flags = IORESOURCE_IRQ,
136 },
137};
138
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700139struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700140 .name = "msm_hsusb",
141 .id = -1,
142 .num_resources = ARRAY_SIZE(resources_hsusb),
143 .resource = resources_hsusb,
144 .dev = {
145 .coherent_dma_mask = 0xffffffff,
146 },
147};
148
149static struct resource resources_hsusb_host[] = {
150 {
151 .start = MSM8960_HSUSB_PHYS,
152 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
153 .flags = IORESOURCE_MEM,
154 },
155 {
156 .start = USB1_HS_IRQ,
157 .end = USB1_HS_IRQ,
158 .flags = IORESOURCE_IRQ,
159 },
160};
161
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530162static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700163struct platform_device msm_device_hsusb_host = {
164 .name = "msm_hsusb_host",
165 .id = -1,
166 .num_resources = ARRAY_SIZE(resources_hsusb_host),
167 .resource = resources_hsusb_host,
168 .dev = {
169 .dma_mask = &dma_mask,
170 .coherent_dma_mask = 0xffffffff,
171 },
172};
173
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530174static struct resource resources_hsic_host[] = {
175 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700176 .start = 0x12520000,
177 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530178 .flags = IORESOURCE_MEM,
179 },
180 {
181 .start = USB_HSIC_IRQ,
182 .end = USB_HSIC_IRQ,
183 .flags = IORESOURCE_IRQ,
184 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800185 {
186 .start = MSM_GPIO_TO_INT(69),
187 .end = MSM_GPIO_TO_INT(69),
188 .name = "peripheral_status_irq",
189 .flags = IORESOURCE_IRQ,
190 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530191};
192
193struct platform_device msm_device_hsic_host = {
194 .name = "msm_hsic_host",
195 .id = -1,
196 .num_resources = ARRAY_SIZE(resources_hsic_host),
197 .resource = resources_hsic_host,
198 .dev = {
199 .dma_mask = &dma_mask,
200 .coherent_dma_mask = DMA_BIT_MASK(32),
201 },
202};
203
Mona Hossain11c03ac2011-10-26 12:42:10 -0700204#define SHARED_IMEM_TZ_BASE 0x2a03f720
205static struct resource tzlog_resources[] = {
206 {
207 .start = SHARED_IMEM_TZ_BASE,
208 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
209 .flags = IORESOURCE_MEM,
210 },
211};
212
213struct platform_device msm_device_tz_log = {
214 .name = "tz_log",
215 .id = 0,
216 .num_resources = ARRAY_SIZE(tzlog_resources),
217 .resource = tzlog_resources,
218};
219
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700220static struct resource resources_uart_gsbi2[] = {
221 {
222 .start = MSM8960_GSBI2_UARTDM_IRQ,
223 .end = MSM8960_GSBI2_UARTDM_IRQ,
224 .flags = IORESOURCE_IRQ,
225 },
226 {
227 .start = MSM_UART2DM_PHYS,
228 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
229 .name = "uartdm_resource",
230 .flags = IORESOURCE_MEM,
231 },
232 {
233 .start = MSM_GSBI2_PHYS,
234 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
235 .name = "gsbi_resource",
236 .flags = IORESOURCE_MEM,
237 },
238};
239
240struct platform_device msm8960_device_uart_gsbi2 = {
241 .name = "msm_serial_hsl",
242 .id = 0,
243 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
244 .resource = resources_uart_gsbi2,
245};
Mayank Rana9f51f582011-08-04 18:35:59 +0530246/* GSBI 6 used into UARTDM Mode */
247static struct resource msm_uart_dm6_resources[] = {
248 {
249 .start = MSM_UART6DM_PHYS,
250 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
251 .name = "uartdm_resource",
252 .flags = IORESOURCE_MEM,
253 },
254 {
255 .start = GSBI6_UARTDM_IRQ,
256 .end = GSBI6_UARTDM_IRQ,
257 .flags = IORESOURCE_IRQ,
258 },
259 {
260 .start = MSM_GSBI6_PHYS,
261 .end = MSM_GSBI6_PHYS + 4 - 1,
262 .name = "gsbi_resource",
263 .flags = IORESOURCE_MEM,
264 },
265 {
266 .start = DMOV_HSUART_GSBI6_TX_CHAN,
267 .end = DMOV_HSUART_GSBI6_RX_CHAN,
268 .name = "uartdm_channels",
269 .flags = IORESOURCE_DMA,
270 },
271 {
272 .start = DMOV_HSUART_GSBI6_TX_CRCI,
273 .end = DMOV_HSUART_GSBI6_RX_CRCI,
274 .name = "uartdm_crci",
275 .flags = IORESOURCE_DMA,
276 },
277};
278static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
279struct platform_device msm_device_uart_dm6 = {
280 .name = "msm_serial_hs",
281 .id = 0,
282 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
283 .resource = msm_uart_dm6_resources,
284 .dev = {
285 .dma_mask = &msm_uart_dm6_dma_mask,
286 .coherent_dma_mask = DMA_BIT_MASK(32),
287 },
288};
Mayank Ranae009c922012-03-22 03:02:06 +0530289/*
290 * GSBI 9 used into UARTDM Mode
291 * For 8960 Fusion 2.2 Primary IPC
292 */
293static struct resource msm_uart_dm9_resources[] = {
294 {
295 .start = MSM_UART9DM_PHYS,
296 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
297 .name = "uartdm_resource",
298 .flags = IORESOURCE_MEM,
299 },
300 {
301 .start = GSBI9_UARTDM_IRQ,
302 .end = GSBI9_UARTDM_IRQ,
303 .flags = IORESOURCE_IRQ,
304 },
305 {
306 .start = MSM_GSBI9_PHYS,
307 .end = MSM_GSBI9_PHYS + 4 - 1,
308 .name = "gsbi_resource",
309 .flags = IORESOURCE_MEM,
310 },
311 {
312 .start = DMOV_HSUART_GSBI9_TX_CHAN,
313 .end = DMOV_HSUART_GSBI9_RX_CHAN,
314 .name = "uartdm_channels",
315 .flags = IORESOURCE_DMA,
316 },
317 {
318 .start = DMOV_HSUART_GSBI9_TX_CRCI,
319 .end = DMOV_HSUART_GSBI9_RX_CRCI,
320 .name = "uartdm_crci",
321 .flags = IORESOURCE_DMA,
322 },
323};
324static u64 msm_uart_dm9_dma_mask = DMA_BIT_MASK(32);
325struct platform_device msm_device_uart_dm9 = {
326 .name = "msm_serial_hs",
327 .id = 1,
328 .num_resources = ARRAY_SIZE(msm_uart_dm9_resources),
329 .resource = msm_uart_dm9_resources,
330 .dev = {
331 .dma_mask = &msm_uart_dm9_dma_mask,
332 .coherent_dma_mask = DMA_BIT_MASK(32),
333 },
334};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700335
336static struct resource resources_uart_gsbi5[] = {
337 {
338 .start = GSBI5_UARTDM_IRQ,
339 .end = GSBI5_UARTDM_IRQ,
340 .flags = IORESOURCE_IRQ,
341 },
342 {
343 .start = MSM_UART5DM_PHYS,
344 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
345 .name = "uartdm_resource",
346 .flags = IORESOURCE_MEM,
347 },
348 {
349 .start = MSM_GSBI5_PHYS,
350 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
351 .name = "gsbi_resource",
352 .flags = IORESOURCE_MEM,
353 },
354};
355
356struct platform_device msm8960_device_uart_gsbi5 = {
357 .name = "msm_serial_hsl",
358 .id = 0,
359 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
360 .resource = resources_uart_gsbi5,
361};
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700362
363static struct msm_serial_hslite_platform_data uart_gsbi8_pdata = {
364 .line = 0,
365};
366
367static struct resource resources_uart_gsbi8[] = {
368 {
369 .start = GSBI8_UARTDM_IRQ,
370 .end = GSBI8_UARTDM_IRQ,
371 .flags = IORESOURCE_IRQ,
372 },
373 {
374 .start = MSM_UART8DM_PHYS,
375 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
376 .name = "uartdm_resource",
377 .flags = IORESOURCE_MEM,
378 },
379 {
380 .start = MSM_GSBI8_PHYS,
381 .end = MSM_GSBI8_PHYS + PAGE_SIZE - 1,
382 .name = "gsbi_resource",
383 .flags = IORESOURCE_MEM,
384 },
385};
386
387struct platform_device msm8960_device_uart_gsbi8 = {
388 .name = "msm_serial_hsl",
389 .id = 1,
390 .num_resources = ARRAY_SIZE(resources_uart_gsbi8),
391 .resource = resources_uart_gsbi8,
392 .dev.platform_data = &uart_gsbi8_pdata,
393};
394
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700395/* MSM Video core device */
396#ifdef CONFIG_MSM_BUS_SCALING
397static struct msm_bus_vectors vidc_init_vectors[] = {
398 {
399 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
400 .dst = MSM_BUS_SLAVE_EBI_CH0,
401 .ab = 0,
402 .ib = 0,
403 },
404 {
405 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
406 .dst = MSM_BUS_SLAVE_EBI_CH0,
407 .ab = 0,
408 .ib = 0,
409 },
410 {
411 .src = MSM_BUS_MASTER_AMPSS_M0,
412 .dst = MSM_BUS_SLAVE_EBI_CH0,
413 .ab = 0,
414 .ib = 0,
415 },
416 {
417 .src = MSM_BUS_MASTER_AMPSS_M0,
418 .dst = MSM_BUS_SLAVE_EBI_CH0,
419 .ab = 0,
420 .ib = 0,
421 },
422};
423static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
424 {
425 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
426 .dst = MSM_BUS_SLAVE_EBI_CH0,
427 .ab = 54525952,
428 .ib = 436207616,
429 },
430 {
431 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
432 .dst = MSM_BUS_SLAVE_EBI_CH0,
433 .ab = 72351744,
434 .ib = 289406976,
435 },
436 {
437 .src = MSM_BUS_MASTER_AMPSS_M0,
438 .dst = MSM_BUS_SLAVE_EBI_CH0,
439 .ab = 500000,
440 .ib = 1000000,
441 },
442 {
443 .src = MSM_BUS_MASTER_AMPSS_M0,
444 .dst = MSM_BUS_SLAVE_EBI_CH0,
445 .ab = 500000,
446 .ib = 1000000,
447 },
448};
449static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
450 {
451 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
452 .dst = MSM_BUS_SLAVE_EBI_CH0,
453 .ab = 40894464,
454 .ib = 327155712,
455 },
456 {
457 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
458 .dst = MSM_BUS_SLAVE_EBI_CH0,
459 .ab = 48234496,
460 .ib = 192937984,
461 },
462 {
463 .src = MSM_BUS_MASTER_AMPSS_M0,
464 .dst = MSM_BUS_SLAVE_EBI_CH0,
465 .ab = 500000,
466 .ib = 2000000,
467 },
468 {
469 .src = MSM_BUS_MASTER_AMPSS_M0,
470 .dst = MSM_BUS_SLAVE_EBI_CH0,
471 .ab = 500000,
472 .ib = 2000000,
473 },
474};
475static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
476 {
477 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
478 .dst = MSM_BUS_SLAVE_EBI_CH0,
479 .ab = 163577856,
480 .ib = 1308622848,
481 },
482 {
483 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
484 .dst = MSM_BUS_SLAVE_EBI_CH0,
485 .ab = 219152384,
486 .ib = 876609536,
487 },
488 {
489 .src = MSM_BUS_MASTER_AMPSS_M0,
490 .dst = MSM_BUS_SLAVE_EBI_CH0,
491 .ab = 1750000,
492 .ib = 3500000,
493 },
494 {
495 .src = MSM_BUS_MASTER_AMPSS_M0,
496 .dst = MSM_BUS_SLAVE_EBI_CH0,
497 .ab = 1750000,
498 .ib = 3500000,
499 },
500};
501static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
502 {
503 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
504 .dst = MSM_BUS_SLAVE_EBI_CH0,
505 .ab = 121634816,
506 .ib = 973078528,
507 },
508 {
509 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
510 .dst = MSM_BUS_SLAVE_EBI_CH0,
511 .ab = 155189248,
512 .ib = 620756992,
513 },
514 {
515 .src = MSM_BUS_MASTER_AMPSS_M0,
516 .dst = MSM_BUS_SLAVE_EBI_CH0,
517 .ab = 1750000,
518 .ib = 7000000,
519 },
520 {
521 .src = MSM_BUS_MASTER_AMPSS_M0,
522 .dst = MSM_BUS_SLAVE_EBI_CH0,
523 .ab = 1750000,
524 .ib = 7000000,
525 },
526};
527static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
528 {
529 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
530 .dst = MSM_BUS_SLAVE_EBI_CH0,
531 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700532 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700533 },
534 {
535 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
536 .dst = MSM_BUS_SLAVE_EBI_CH0,
537 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700538 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700539 },
540 {
541 .src = MSM_BUS_MASTER_AMPSS_M0,
542 .dst = MSM_BUS_SLAVE_EBI_CH0,
543 .ab = 2500000,
544 .ib = 5000000,
545 },
546 {
547 .src = MSM_BUS_MASTER_AMPSS_M0,
548 .dst = MSM_BUS_SLAVE_EBI_CH0,
549 .ab = 2500000,
550 .ib = 5000000,
551 },
552};
553static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
554 {
555 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
556 .dst = MSM_BUS_SLAVE_EBI_CH0,
557 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700558 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700559 },
560 {
561 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
562 .dst = MSM_BUS_SLAVE_EBI_CH0,
563 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700564 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700565 },
566 {
567 .src = MSM_BUS_MASTER_AMPSS_M0,
568 .dst = MSM_BUS_SLAVE_EBI_CH0,
569 .ab = 2500000,
570 .ib = 700000000,
571 },
572 {
573 .src = MSM_BUS_MASTER_AMPSS_M0,
574 .dst = MSM_BUS_SLAVE_EBI_CH0,
575 .ab = 2500000,
576 .ib = 10000000,
577 },
578};
579
580static struct msm_bus_paths vidc_bus_client_config[] = {
581 {
582 ARRAY_SIZE(vidc_init_vectors),
583 vidc_init_vectors,
584 },
585 {
586 ARRAY_SIZE(vidc_venc_vga_vectors),
587 vidc_venc_vga_vectors,
588 },
589 {
590 ARRAY_SIZE(vidc_vdec_vga_vectors),
591 vidc_vdec_vga_vectors,
592 },
593 {
594 ARRAY_SIZE(vidc_venc_720p_vectors),
595 vidc_venc_720p_vectors,
596 },
597 {
598 ARRAY_SIZE(vidc_vdec_720p_vectors),
599 vidc_vdec_720p_vectors,
600 },
601 {
602 ARRAY_SIZE(vidc_venc_1080p_vectors),
603 vidc_venc_1080p_vectors,
604 },
605 {
606 ARRAY_SIZE(vidc_vdec_1080p_vectors),
607 vidc_vdec_1080p_vectors,
608 },
609};
610
611static struct msm_bus_scale_pdata vidc_bus_client_data = {
612 vidc_bus_client_config,
613 ARRAY_SIZE(vidc_bus_client_config),
614 .name = "vidc",
615};
616#endif
617
Mona Hossain9c430e32011-07-27 11:04:47 -0700618#ifdef CONFIG_HW_RANDOM_MSM
619/* PRNG device */
620#define MSM_PRNG_PHYS 0x1A500000
621static struct resource rng_resources = {
622 .flags = IORESOURCE_MEM,
623 .start = MSM_PRNG_PHYS,
624 .end = MSM_PRNG_PHYS + SZ_512 - 1,
625};
626
627struct platform_device msm_device_rng = {
628 .name = "msm_rng",
629 .id = 0,
630 .num_resources = 1,
631 .resource = &rng_resources,
632};
633#endif
634
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700635#define MSM_VIDC_BASE_PHYS 0x04400000
636#define MSM_VIDC_BASE_SIZE 0x00100000
637
638static struct resource msm_device_vidc_resources[] = {
639 {
640 .start = MSM_VIDC_BASE_PHYS,
641 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
642 .flags = IORESOURCE_MEM,
643 },
644 {
645 .start = VCODEC_IRQ,
646 .end = VCODEC_IRQ,
647 .flags = IORESOURCE_IRQ,
648 },
649};
650
651struct msm_vidc_platform_data vidc_platform_data = {
652#ifdef CONFIG_MSM_BUS_SCALING
653 .vidc_bus_client_pdata = &vidc_bus_client_data,
654#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -0700655#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -0800656 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700657 .enable_ion = 1,
Deepak kotur5f10b272012-03-15 22:01:39 -0700658 .cp_enabled = 1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700659#else
Deepak Kotur12301a72011-11-09 18:30:29 -0800660 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700661 .enable_ion = 0,
662#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800663 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +0530664 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -0800665 .cont_mode_dpb_count = 18,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700666};
667
668struct platform_device msm_device_vidc = {
669 .name = "msm_vidc",
670 .id = 0,
671 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
672 .resource = msm_device_vidc_resources,
673 .dev = {
674 .platform_data = &vidc_platform_data,
675 },
676};
677
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700678#define MSM_SDC1_BASE 0x12400000
679#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
680#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
681#define MSM_SDC2_BASE 0x12140000
682#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
683#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
684#define MSM_SDC2_BASE 0x12140000
685#define MSM_SDC3_BASE 0x12180000
686#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
687#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
688#define MSM_SDC4_BASE 0x121C0000
689#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
690#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
691#define MSM_SDC5_BASE 0x12200000
692#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
693#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
694
695static struct resource resources_sdc1[] = {
696 {
697 .name = "core_mem",
698 .flags = IORESOURCE_MEM,
699 .start = MSM_SDC1_BASE,
700 .end = MSM_SDC1_DML_BASE - 1,
701 },
702 {
703 .name = "core_irq",
704 .flags = IORESOURCE_IRQ,
705 .start = SDC1_IRQ_0,
706 .end = SDC1_IRQ_0
707 },
708#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
709 {
710 .name = "sdcc_dml_addr",
711 .start = MSM_SDC1_DML_BASE,
712 .end = MSM_SDC1_BAM_BASE - 1,
713 .flags = IORESOURCE_MEM,
714 },
715 {
716 .name = "sdcc_bam_addr",
717 .start = MSM_SDC1_BAM_BASE,
718 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
719 .flags = IORESOURCE_MEM,
720 },
721 {
722 .name = "sdcc_bam_irq",
723 .start = SDC1_BAM_IRQ,
724 .end = SDC1_BAM_IRQ,
725 .flags = IORESOURCE_IRQ,
726 },
727#endif
728};
729
730static struct resource resources_sdc2[] = {
731 {
732 .name = "core_mem",
733 .flags = IORESOURCE_MEM,
734 .start = MSM_SDC2_BASE,
735 .end = MSM_SDC2_DML_BASE - 1,
736 },
737 {
738 .name = "core_irq",
739 .flags = IORESOURCE_IRQ,
740 .start = SDC2_IRQ_0,
741 .end = SDC2_IRQ_0
742 },
743#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
744 {
745 .name = "sdcc_dml_addr",
746 .start = MSM_SDC2_DML_BASE,
747 .end = MSM_SDC2_BAM_BASE - 1,
748 .flags = IORESOURCE_MEM,
749 },
750 {
751 .name = "sdcc_bam_addr",
752 .start = MSM_SDC2_BAM_BASE,
753 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
754 .flags = IORESOURCE_MEM,
755 },
756 {
757 .name = "sdcc_bam_irq",
758 .start = SDC2_BAM_IRQ,
759 .end = SDC2_BAM_IRQ,
760 .flags = IORESOURCE_IRQ,
761 },
762#endif
763};
764
765static struct resource resources_sdc3[] = {
766 {
767 .name = "core_mem",
768 .flags = IORESOURCE_MEM,
769 .start = MSM_SDC3_BASE,
770 .end = MSM_SDC3_DML_BASE - 1,
771 },
772 {
773 .name = "core_irq",
774 .flags = IORESOURCE_IRQ,
775 .start = SDC3_IRQ_0,
776 .end = SDC3_IRQ_0
777 },
778#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
779 {
780 .name = "sdcc_dml_addr",
781 .start = MSM_SDC3_DML_BASE,
782 .end = MSM_SDC3_BAM_BASE - 1,
783 .flags = IORESOURCE_MEM,
784 },
785 {
786 .name = "sdcc_bam_addr",
787 .start = MSM_SDC3_BAM_BASE,
788 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
789 .flags = IORESOURCE_MEM,
790 },
791 {
792 .name = "sdcc_bam_irq",
793 .start = SDC3_BAM_IRQ,
794 .end = SDC3_BAM_IRQ,
795 .flags = IORESOURCE_IRQ,
796 },
797#endif
798};
799
800static struct resource resources_sdc4[] = {
801 {
802 .name = "core_mem",
803 .flags = IORESOURCE_MEM,
804 .start = MSM_SDC4_BASE,
805 .end = MSM_SDC4_DML_BASE - 1,
806 },
807 {
808 .name = "core_irq",
809 .flags = IORESOURCE_IRQ,
810 .start = SDC4_IRQ_0,
811 .end = SDC4_IRQ_0
812 },
813#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
814 {
815 .name = "sdcc_dml_addr",
816 .start = MSM_SDC4_DML_BASE,
817 .end = MSM_SDC4_BAM_BASE - 1,
818 .flags = IORESOURCE_MEM,
819 },
820 {
821 .name = "sdcc_bam_addr",
822 .start = MSM_SDC4_BAM_BASE,
823 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
824 .flags = IORESOURCE_MEM,
825 },
826 {
827 .name = "sdcc_bam_irq",
828 .start = SDC4_BAM_IRQ,
829 .end = SDC4_BAM_IRQ,
830 .flags = IORESOURCE_IRQ,
831 },
832#endif
833};
834
835static struct resource resources_sdc5[] = {
836 {
837 .name = "core_mem",
838 .flags = IORESOURCE_MEM,
839 .start = MSM_SDC5_BASE,
840 .end = MSM_SDC5_DML_BASE - 1,
841 },
842 {
843 .name = "core_irq",
844 .flags = IORESOURCE_IRQ,
845 .start = SDC5_IRQ_0,
846 .end = SDC5_IRQ_0
847 },
848#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
849 {
850 .name = "sdcc_dml_addr",
851 .start = MSM_SDC5_DML_BASE,
852 .end = MSM_SDC5_BAM_BASE - 1,
853 .flags = IORESOURCE_MEM,
854 },
855 {
856 .name = "sdcc_bam_addr",
857 .start = MSM_SDC5_BAM_BASE,
858 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
859 .flags = IORESOURCE_MEM,
860 },
861 {
862 .name = "sdcc_bam_irq",
863 .start = SDC5_BAM_IRQ,
864 .end = SDC5_BAM_IRQ,
865 .flags = IORESOURCE_IRQ,
866 },
867#endif
868};
869
870struct platform_device msm_device_sdc1 = {
871 .name = "msm_sdcc",
872 .id = 1,
873 .num_resources = ARRAY_SIZE(resources_sdc1),
874 .resource = resources_sdc1,
875 .dev = {
876 .coherent_dma_mask = 0xffffffff,
877 },
878};
879
880struct platform_device msm_device_sdc2 = {
881 .name = "msm_sdcc",
882 .id = 2,
883 .num_resources = ARRAY_SIZE(resources_sdc2),
884 .resource = resources_sdc2,
885 .dev = {
886 .coherent_dma_mask = 0xffffffff,
887 },
888};
889
890struct platform_device msm_device_sdc3 = {
891 .name = "msm_sdcc",
892 .id = 3,
893 .num_resources = ARRAY_SIZE(resources_sdc3),
894 .resource = resources_sdc3,
895 .dev = {
896 .coherent_dma_mask = 0xffffffff,
897 },
898};
899
900struct platform_device msm_device_sdc4 = {
901 .name = "msm_sdcc",
902 .id = 4,
903 .num_resources = ARRAY_SIZE(resources_sdc4),
904 .resource = resources_sdc4,
905 .dev = {
906 .coherent_dma_mask = 0xffffffff,
907 },
908};
909
910struct platform_device msm_device_sdc5 = {
911 .name = "msm_sdcc",
912 .id = 5,
913 .num_resources = ARRAY_SIZE(resources_sdc5),
914 .resource = resources_sdc5,
915 .dev = {
916 .coherent_dma_mask = 0xffffffff,
917 },
918};
919
Stephen Boydeb819882011-08-29 14:46:30 -0700920#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
921#define SFAB_LPASS_Q6_ACLK_CTL (MSM_CLK_CTL_BASE + 0x23A0)
922
923static struct resource msm_8960_q6_lpass_resources[] = {
924 {
925 .start = MSM_LPASS_QDSP6SS_PHYS,
926 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
927 .flags = IORESOURCE_MEM,
928 },
929};
930
931static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
932 .strap_tcm_base = 0x01460000,
933 .strap_ahb_upper = 0x00290000,
934 .strap_ahb_lower = 0x00000280,
935 .aclk_reg = SFAB_LPASS_Q6_ACLK_CTL,
936 .name = "q6",
937 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700938 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700939};
940
941struct platform_device msm_8960_q6_lpass = {
942 .name = "pil_qdsp6v4",
943 .id = 0,
944 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
945 .resource = msm_8960_q6_lpass_resources,
946 .dev.platform_data = &msm_8960_q6_lpass_data,
947};
948
949#define MSM_MSS_ENABLE_PHYS 0x08B00000
950#define MSM_FW_QDSP6SS_PHYS 0x08800000
951#define MSS_Q6FW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C6C)
952#define SFAB_MSS_Q6_FW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2044)
953
954static struct resource msm_8960_q6_mss_fw_resources[] = {
955 {
956 .start = MSM_FW_QDSP6SS_PHYS,
957 .end = MSM_FW_QDSP6SS_PHYS + SZ_256 - 1,
958 .flags = IORESOURCE_MEM,
959 },
960 {
961 .start = MSM_MSS_ENABLE_PHYS,
962 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
963 .flags = IORESOURCE_MEM,
964 },
965};
966
967static struct pil_q6v4_pdata msm_8960_q6_mss_fw_data = {
968 .strap_tcm_base = 0x00400000,
969 .strap_ahb_upper = 0x00090000,
970 .strap_ahb_lower = 0x00000080,
971 .aclk_reg = SFAB_MSS_Q6_FW_ACLK_CTL,
972 .jtag_clk_reg = MSS_Q6FW_JTAG_CLK_CTL,
973 .name = "modem_fw",
974 .depends = "q6",
975 .pas_id = PAS_MODEM_FW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700976 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700977};
978
979struct platform_device msm_8960_q6_mss_fw = {
980 .name = "pil_qdsp6v4",
981 .id = 1,
982 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_fw_resources),
983 .resource = msm_8960_q6_mss_fw_resources,
984 .dev.platform_data = &msm_8960_q6_mss_fw_data,
985};
986
987#define MSM_SW_QDSP6SS_PHYS 0x08900000
988#define SFAB_MSS_Q6_SW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2040)
989#define MSS_Q6SW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C68)
990
991static struct resource msm_8960_q6_mss_sw_resources[] = {
992 {
993 .start = MSM_SW_QDSP6SS_PHYS,
994 .end = MSM_SW_QDSP6SS_PHYS + SZ_256 - 1,
995 .flags = IORESOURCE_MEM,
996 },
997 {
998 .start = MSM_MSS_ENABLE_PHYS,
999 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
1000 .flags = IORESOURCE_MEM,
1001 },
1002};
1003
1004static struct pil_q6v4_pdata msm_8960_q6_mss_sw_data = {
1005 .strap_tcm_base = 0x00420000,
1006 .strap_ahb_upper = 0x00090000,
1007 .strap_ahb_lower = 0x00000080,
1008 .aclk_reg = SFAB_MSS_Q6_SW_ACLK_CTL,
1009 .jtag_clk_reg = MSS_Q6SW_JTAG_CLK_CTL,
1010 .name = "modem",
1011 .depends = "modem_fw",
1012 .pas_id = PAS_MODEM_SW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -07001013 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001014};
1015
1016struct platform_device msm_8960_q6_mss_sw = {
1017 .name = "pil_qdsp6v4",
1018 .id = 2,
1019 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_sw_resources),
1020 .resource = msm_8960_q6_mss_sw_resources,
1021 .dev.platform_data = &msm_8960_q6_mss_sw_data,
1022};
1023
Stephen Boyd322a9922011-09-20 01:05:54 -07001024static struct resource msm_8960_riva_resources[] = {
1025 {
1026 .start = 0x03204000,
1027 .end = 0x03204000 + SZ_256 - 1,
1028 .flags = IORESOURCE_MEM,
1029 },
1030};
1031
1032struct platform_device msm_8960_riva = {
1033 .name = "pil_riva",
1034 .id = -1,
1035 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
1036 .resource = msm_8960_riva_resources,
1037};
1038
Stephen Boydd89eebe2011-09-28 23:28:11 -07001039struct platform_device msm_pil_tzapps = {
1040 .name = "pil_tzapps",
1041 .id = -1,
1042};
1043
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001044struct platform_device msm_pil_dsps = {
1045 .name = "pil_dsps",
1046 .id = -1,
1047 .dev.platform_data = "dsps",
1048};
1049
Stephen Boyd7b973de2012-03-09 12:26:16 -08001050struct platform_device msm_pil_vidc = {
1051 .name = "pil_vidc",
1052 .id = -1,
1053};
1054
Eric Holmberg023d25c2012-03-01 12:27:55 -07001055static struct resource smd_resource[] = {
1056 {
1057 .name = "a9_m2a_0",
1058 .start = INT_A9_M2A_0,
1059 .flags = IORESOURCE_IRQ,
1060 },
1061 {
1062 .name = "a9_m2a_5",
1063 .start = INT_A9_M2A_5,
1064 .flags = IORESOURCE_IRQ,
1065 },
1066 {
1067 .name = "adsp_a11",
1068 .start = INT_ADSP_A11,
1069 .flags = IORESOURCE_IRQ,
1070 },
1071 {
1072 .name = "adsp_a11_smsm",
1073 .start = INT_ADSP_A11_SMSM,
1074 .flags = IORESOURCE_IRQ,
1075 },
1076 {
1077 .name = "dsps_a11",
1078 .start = INT_DSPS_A11,
1079 .flags = IORESOURCE_IRQ,
1080 },
1081 {
1082 .name = "dsps_a11_smsm",
1083 .start = INT_DSPS_A11_SMSM,
1084 .flags = IORESOURCE_IRQ,
1085 },
1086 {
1087 .name = "wcnss_a11",
1088 .start = INT_WCNSS_A11,
1089 .flags = IORESOURCE_IRQ,
1090 },
1091 {
1092 .name = "wcnss_a11_smsm",
1093 .start = INT_WCNSS_A11_SMSM,
1094 .flags = IORESOURCE_IRQ,
1095 },
1096};
1097
1098static struct smd_subsystem_config smd_config_list[] = {
1099 {
1100 .irq_config_id = SMD_MODEM,
1101 .subsys_name = "modem",
1102 .edge = SMD_APPS_MODEM,
1103
1104 .smd_int.irq_name = "a9_m2a_0",
1105 .smd_int.flags = IRQF_TRIGGER_RISING,
1106 .smd_int.irq_id = -1,
1107 .smd_int.device_name = "smd_dev",
1108 .smd_int.dev_id = 0,
1109 .smd_int.out_bit_pos = 1 << 3,
1110 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1111 .smd_int.out_offset = 0x8,
1112
1113 .smsm_int.irq_name = "a9_m2a_5",
1114 .smsm_int.flags = IRQF_TRIGGER_RISING,
1115 .smsm_int.irq_id = -1,
1116 .smsm_int.device_name = "smd_smsm",
1117 .smsm_int.dev_id = 0,
1118 .smsm_int.out_bit_pos = 1 << 4,
1119 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1120 .smsm_int.out_offset = 0x8,
1121 },
1122 {
1123 .irq_config_id = SMD_Q6,
1124 .subsys_name = "q6",
1125 .edge = SMD_APPS_QDSP,
1126
1127 .smd_int.irq_name = "adsp_a11",
1128 .smd_int.flags = IRQF_TRIGGER_RISING,
1129 .smd_int.irq_id = -1,
1130 .smd_int.device_name = "smd_dev",
1131 .smd_int.dev_id = 0,
1132 .smd_int.out_bit_pos = 1 << 15,
1133 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1134 .smd_int.out_offset = 0x8,
1135
1136 .smsm_int.irq_name = "adsp_a11_smsm",
1137 .smsm_int.flags = IRQF_TRIGGER_RISING,
1138 .smsm_int.irq_id = -1,
1139 .smsm_int.device_name = "smd_smsm",
1140 .smsm_int.dev_id = 0,
1141 .smsm_int.out_bit_pos = 1 << 14,
1142 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1143 .smsm_int.out_offset = 0x8,
1144 },
1145 {
1146 .irq_config_id = SMD_DSPS,
1147 .subsys_name = "dsps",
1148 .edge = SMD_APPS_DSPS,
1149
1150 .smd_int.irq_name = "dsps_a11",
1151 .smd_int.flags = IRQF_TRIGGER_RISING,
1152 .smd_int.irq_id = -1,
1153 .smd_int.device_name = "smd_dev",
1154 .smd_int.dev_id = 0,
1155 .smd_int.out_bit_pos = 1,
1156 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1157 .smd_int.out_offset = 0x4080,
1158
1159 .smsm_int.irq_name = "dsps_a11_smsm",
1160 .smsm_int.flags = IRQF_TRIGGER_RISING,
1161 .smsm_int.irq_id = -1,
1162 .smsm_int.device_name = "smd_smsm",
1163 .smsm_int.dev_id = 0,
1164 .smsm_int.out_bit_pos = 1,
1165 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1166 .smsm_int.out_offset = 0x4094,
1167 },
1168 {
1169 .irq_config_id = SMD_WCNSS,
1170 .subsys_name = "wcnss",
1171 .edge = SMD_APPS_WCNSS,
1172
1173 .smd_int.irq_name = "wcnss_a11",
1174 .smd_int.flags = IRQF_TRIGGER_RISING,
1175 .smd_int.irq_id = -1,
1176 .smd_int.device_name = "smd_dev",
1177 .smd_int.dev_id = 0,
1178 .smd_int.out_bit_pos = 1 << 25,
1179 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1180 .smd_int.out_offset = 0x8,
1181
1182 .smsm_int.irq_name = "wcnss_a11_smsm",
1183 .smsm_int.flags = IRQF_TRIGGER_RISING,
1184 .smsm_int.irq_id = -1,
1185 .smsm_int.device_name = "smd_smsm",
1186 .smsm_int.dev_id = 0,
1187 .smsm_int.out_bit_pos = 1 << 23,
1188 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1189 .smsm_int.out_offset = 0x8,
1190 },
1191};
1192
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001193static struct smd_subsystem_restart_config smd_ssr_config = {
1194 .disable_smsm_reset_handshake = 1,
1195};
1196
Eric Holmberg023d25c2012-03-01 12:27:55 -07001197static struct smd_platform smd_platform_data = {
1198 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1199 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001200 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001201};
1202
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001203struct platform_device msm_device_smd = {
1204 .name = "msm_smd",
1205 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001206 .resource = smd_resource,
1207 .num_resources = ARRAY_SIZE(smd_resource),
1208 .dev = {
1209 .platform_data = &smd_platform_data,
1210 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001211};
1212
1213struct platform_device msm_device_bam_dmux = {
1214 .name = "BAM_RMNT",
1215 .id = -1,
1216};
1217
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001218static struct msm_watchdog_pdata msm_watchdog_pdata = {
1219 .pet_time = 10000,
1220 .bark_time = 11000,
1221 .has_secure = true,
1222};
1223
1224struct platform_device msm8960_device_watchdog = {
1225 .name = "msm_watchdog",
1226 .id = -1,
1227 .dev = {
1228 .platform_data = &msm_watchdog_pdata,
1229 },
1230};
1231
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001232static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001233 {
1234 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001235 .flags = IORESOURCE_IRQ,
1236 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001237 {
1238 .start = 0x18320000,
1239 .end = 0x18320000 + SZ_1M - 1,
1240 .flags = IORESOURCE_MEM,
1241 },
1242};
1243
1244static struct msm_dmov_pdata msm_dmov_pdata = {
1245 .sd = 1,
1246 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001247};
1248
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001249struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001250 .name = "msm_dmov",
1251 .id = -1,
1252 .resource = msm_dmov_resource,
1253 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001254 .dev = {
1255 .platform_data = &msm_dmov_pdata,
1256 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001257};
1258
1259static struct platform_device *msm_sdcc_devices[] __initdata = {
1260 &msm_device_sdc1,
1261 &msm_device_sdc2,
1262 &msm_device_sdc3,
1263 &msm_device_sdc4,
1264 &msm_device_sdc5,
1265};
1266
1267int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1268{
1269 struct platform_device *pdev;
1270
1271 if (controller < 1 || controller > 5)
1272 return -EINVAL;
1273
1274 pdev = msm_sdcc_devices[controller-1];
1275 pdev->dev.platform_data = plat;
1276 return platform_device_register(pdev);
1277}
1278
1279static struct resource resources_qup_i2c_gsbi4[] = {
1280 {
1281 .name = "gsbi_qup_i2c_addr",
1282 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001283 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001284 .flags = IORESOURCE_MEM,
1285 },
1286 {
1287 .name = "qup_phys_addr",
1288 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001289 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001290 .flags = IORESOURCE_MEM,
1291 },
1292 {
1293 .name = "qup_err_intr",
1294 .start = GSBI4_QUP_IRQ,
1295 .end = GSBI4_QUP_IRQ,
1296 .flags = IORESOURCE_IRQ,
1297 },
1298};
1299
1300struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1301 .name = "qup_i2c",
1302 .id = 4,
1303 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1304 .resource = resources_qup_i2c_gsbi4,
1305};
1306
1307static struct resource resources_qup_i2c_gsbi3[] = {
1308 {
1309 .name = "gsbi_qup_i2c_addr",
1310 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001311 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001312 .flags = IORESOURCE_MEM,
1313 },
1314 {
1315 .name = "qup_phys_addr",
1316 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001317 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001318 .flags = IORESOURCE_MEM,
1319 },
1320 {
1321 .name = "qup_err_intr",
1322 .start = GSBI3_QUP_IRQ,
1323 .end = GSBI3_QUP_IRQ,
1324 .flags = IORESOURCE_IRQ,
1325 },
1326};
1327
1328struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1329 .name = "qup_i2c",
1330 .id = 3,
1331 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1332 .resource = resources_qup_i2c_gsbi3,
1333};
1334
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06001335static struct resource resources_qup_i2c_gsbi9[] = {
1336 {
1337 .name = "gsbi_qup_i2c_addr",
1338 .start = MSM_GSBI9_PHYS,
1339 .end = MSM_GSBI9_PHYS + 4 - 1,
1340 .flags = IORESOURCE_MEM,
1341 },
1342 {
1343 .name = "qup_phys_addr",
1344 .start = MSM_GSBI9_QUP_PHYS,
1345 .end = MSM_GSBI9_QUP_PHYS + MSM_QUP_SIZE - 1,
1346 .flags = IORESOURCE_MEM,
1347 },
1348 {
1349 .name = "qup_err_intr",
1350 .start = GSBI9_QUP_IRQ,
1351 .end = GSBI9_QUP_IRQ,
1352 .flags = IORESOURCE_IRQ,
1353 },
1354};
1355
1356struct platform_device msm8960_device_qup_i2c_gsbi9 = {
1357 .name = "qup_i2c",
1358 .id = 0,
1359 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi9),
1360 .resource = resources_qup_i2c_gsbi9,
1361};
1362
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001363static struct resource resources_qup_i2c_gsbi10[] = {
1364 {
1365 .name = "gsbi_qup_i2c_addr",
1366 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001367 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001368 .flags = IORESOURCE_MEM,
1369 },
1370 {
1371 .name = "qup_phys_addr",
1372 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001373 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001374 .flags = IORESOURCE_MEM,
1375 },
1376 {
1377 .name = "qup_err_intr",
1378 .start = GSBI10_QUP_IRQ,
1379 .end = GSBI10_QUP_IRQ,
1380 .flags = IORESOURCE_IRQ,
1381 },
1382};
1383
1384struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1385 .name = "qup_i2c",
1386 .id = 10,
1387 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1388 .resource = resources_qup_i2c_gsbi10,
1389};
1390
1391static struct resource resources_qup_i2c_gsbi12[] = {
1392 {
1393 .name = "gsbi_qup_i2c_addr",
1394 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001395 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001396 .flags = IORESOURCE_MEM,
1397 },
1398 {
1399 .name = "qup_phys_addr",
1400 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001401 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001402 .flags = IORESOURCE_MEM,
1403 },
1404 {
1405 .name = "qup_err_intr",
1406 .start = GSBI12_QUP_IRQ,
1407 .end = GSBI12_QUP_IRQ,
1408 .flags = IORESOURCE_IRQ,
1409 },
1410};
1411
1412struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1413 .name = "qup_i2c",
1414 .id = 12,
1415 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1416 .resource = resources_qup_i2c_gsbi12,
1417};
1418
1419#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001420static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001421 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001422 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301423 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001424 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301425 .flags = IORESOURCE_MEM,
1426 },
1427 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001428 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301429 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001430 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301431 .flags = IORESOURCE_MEM,
1432 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001433};
1434
Kevin Chanbb8ef862012-02-14 13:03:04 -08001435struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1436 .name = "msm_cam_i2c_mux",
1437 .id = 0,
1438 .resource = msm_cam_gsbi4_i2c_mux_resources,
1439 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1440};
Kevin Chanf6216f22011-10-25 18:40:11 -07001441
1442static struct resource msm_csiphy0_resources[] = {
1443 {
1444 .name = "csiphy",
1445 .start = 0x04800C00,
1446 .end = 0x04800C00 + SZ_1K - 1,
1447 .flags = IORESOURCE_MEM,
1448 },
1449 {
1450 .name = "csiphy",
1451 .start = CSIPHY_4LN_IRQ,
1452 .end = CSIPHY_4LN_IRQ,
1453 .flags = IORESOURCE_IRQ,
1454 },
1455};
1456
1457static struct resource msm_csiphy1_resources[] = {
1458 {
1459 .name = "csiphy",
1460 .start = 0x04801000,
1461 .end = 0x04801000 + SZ_1K - 1,
1462 .flags = IORESOURCE_MEM,
1463 },
1464 {
1465 .name = "csiphy",
1466 .start = MSM8960_CSIPHY_2LN_IRQ,
1467 .end = MSM8960_CSIPHY_2LN_IRQ,
1468 .flags = IORESOURCE_IRQ,
1469 },
1470};
1471
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001472static struct resource msm_csiphy2_resources[] = {
1473 {
1474 .name = "csiphy",
1475 .start = 0x04801400,
1476 .end = 0x04801400 + SZ_1K - 1,
1477 .flags = IORESOURCE_MEM,
1478 },
1479 {
1480 .name = "csiphy",
1481 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1482 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1483 .flags = IORESOURCE_IRQ,
1484 },
1485};
1486
Kevin Chanf6216f22011-10-25 18:40:11 -07001487struct platform_device msm8960_device_csiphy0 = {
1488 .name = "msm_csiphy",
1489 .id = 0,
1490 .resource = msm_csiphy0_resources,
1491 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
1492};
1493
1494struct platform_device msm8960_device_csiphy1 = {
1495 .name = "msm_csiphy",
1496 .id = 1,
1497 .resource = msm_csiphy1_resources,
1498 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
1499};
Kevin Chanc8b52e82011-10-25 23:20:21 -07001500
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001501struct platform_device msm8960_device_csiphy2 = {
1502 .name = "msm_csiphy",
1503 .id = 2,
1504 .resource = msm_csiphy2_resources,
1505 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
1506};
1507
Kevin Chanc8b52e82011-10-25 23:20:21 -07001508static struct resource msm_csid0_resources[] = {
1509 {
1510 .name = "csid",
1511 .start = 0x04800000,
1512 .end = 0x04800000 + SZ_1K - 1,
1513 .flags = IORESOURCE_MEM,
1514 },
1515 {
1516 .name = "csid",
1517 .start = CSI_0_IRQ,
1518 .end = CSI_0_IRQ,
1519 .flags = IORESOURCE_IRQ,
1520 },
1521};
1522
1523static struct resource msm_csid1_resources[] = {
1524 {
1525 .name = "csid",
1526 .start = 0x04800400,
1527 .end = 0x04800400 + SZ_1K - 1,
1528 .flags = IORESOURCE_MEM,
1529 },
1530 {
1531 .name = "csid",
1532 .start = CSI_1_IRQ,
1533 .end = CSI_1_IRQ,
1534 .flags = IORESOURCE_IRQ,
1535 },
1536};
1537
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001538static struct resource msm_csid2_resources[] = {
1539 {
1540 .name = "csid",
1541 .start = 0x04801800,
1542 .end = 0x04801800 + SZ_1K - 1,
1543 .flags = IORESOURCE_MEM,
1544 },
1545 {
1546 .name = "csid",
1547 .start = CSI_2_IRQ,
1548 .end = CSI_2_IRQ,
1549 .flags = IORESOURCE_IRQ,
1550 },
1551};
1552
Kevin Chanc8b52e82011-10-25 23:20:21 -07001553struct platform_device msm8960_device_csid0 = {
1554 .name = "msm_csid",
1555 .id = 0,
1556 .resource = msm_csid0_resources,
1557 .num_resources = ARRAY_SIZE(msm_csid0_resources),
1558};
1559
1560struct platform_device msm8960_device_csid1 = {
1561 .name = "msm_csid",
1562 .id = 1,
1563 .resource = msm_csid1_resources,
1564 .num_resources = ARRAY_SIZE(msm_csid1_resources),
1565};
Kevin Chane12c6672011-10-26 11:55:26 -07001566
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001567struct platform_device msm8960_device_csid2 = {
1568 .name = "msm_csid",
1569 .id = 2,
1570 .resource = msm_csid2_resources,
1571 .num_resources = ARRAY_SIZE(msm_csid2_resources),
1572};
1573
Kevin Chane12c6672011-10-26 11:55:26 -07001574struct resource msm_ispif_resources[] = {
1575 {
1576 .name = "ispif",
1577 .start = 0x04800800,
1578 .end = 0x04800800 + SZ_1K - 1,
1579 .flags = IORESOURCE_MEM,
1580 },
1581 {
1582 .name = "ispif",
1583 .start = ISPIF_IRQ,
1584 .end = ISPIF_IRQ,
1585 .flags = IORESOURCE_IRQ,
1586 },
1587};
1588
1589struct platform_device msm8960_device_ispif = {
1590 .name = "msm_ispif",
1591 .id = 0,
1592 .resource = msm_ispif_resources,
1593 .num_resources = ARRAY_SIZE(msm_ispif_resources),
1594};
Kevin Chan5827c552011-10-28 18:36:32 -07001595
1596static struct resource msm_vfe_resources[] = {
1597 {
1598 .name = "vfe32",
1599 .start = 0x04500000,
1600 .end = 0x04500000 + SZ_1M - 1,
1601 .flags = IORESOURCE_MEM,
1602 },
1603 {
1604 .name = "vfe32",
1605 .start = VFE_IRQ,
1606 .end = VFE_IRQ,
1607 .flags = IORESOURCE_IRQ,
1608 },
1609};
1610
1611struct platform_device msm8960_device_vfe = {
1612 .name = "msm_vfe",
1613 .id = 0,
1614 .resource = msm_vfe_resources,
1615 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1616};
Kevin Chana0853122011-11-07 19:48:44 -08001617
1618static struct resource msm_vpe_resources[] = {
1619 {
1620 .name = "vpe",
1621 .start = 0x05300000,
1622 .end = 0x05300000 + SZ_1M - 1,
1623 .flags = IORESOURCE_MEM,
1624 },
1625 {
1626 .name = "vpe",
1627 .start = VPE_IRQ,
1628 .end = VPE_IRQ,
1629 .flags = IORESOURCE_IRQ,
1630 },
1631};
1632
1633struct platform_device msm8960_device_vpe = {
1634 .name = "msm_vpe",
1635 .id = 0,
1636 .resource = msm_vpe_resources,
1637 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1638};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001639#endif
1640
Joel Nidera1261942011-09-12 16:30:09 +03001641#define MSM_TSIF0_PHYS (0x18200000)
1642#define MSM_TSIF1_PHYS (0x18201000)
1643#define MSM_TSIF_SIZE (0x200)
1644
1645#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
1646 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1647#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
1648 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1649#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
1650 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1651#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
1652 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1653#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
1654 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1655#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
1656 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1657#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
1658 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1659#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
1660 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1661
1662static const struct msm_gpio tsif0_gpios[] = {
1663 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1664 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1665 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1666 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1667};
1668
1669static const struct msm_gpio tsif1_gpios[] = {
1670 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1671 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1672 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1673 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1674};
1675
1676struct msm_tsif_platform_data tsif1_platform_data = {
1677 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1678 .gpios = tsif1_gpios,
1679 .tsif_pclk = "tsif_pclk",
1680 .tsif_ref_clk = "tsif_ref_clk",
1681};
1682
1683struct resource tsif1_resources[] = {
1684 [0] = {
1685 .flags = IORESOURCE_IRQ,
1686 .start = TSIF2_IRQ,
1687 .end = TSIF2_IRQ,
1688 },
1689 [1] = {
1690 .flags = IORESOURCE_MEM,
1691 .start = MSM_TSIF1_PHYS,
1692 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1693 },
1694 [2] = {
1695 .flags = IORESOURCE_DMA,
1696 .start = DMOV_TSIF_CHAN,
1697 .end = DMOV_TSIF_CRCI,
1698 },
1699};
1700
1701struct msm_tsif_platform_data tsif0_platform_data = {
1702 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1703 .gpios = tsif0_gpios,
1704 .tsif_pclk = "tsif_pclk",
1705 .tsif_ref_clk = "tsif_ref_clk",
1706};
1707struct resource tsif0_resources[] = {
1708 [0] = {
1709 .flags = IORESOURCE_IRQ,
1710 .start = TSIF1_IRQ,
1711 .end = TSIF1_IRQ,
1712 },
1713 [1] = {
1714 .flags = IORESOURCE_MEM,
1715 .start = MSM_TSIF0_PHYS,
1716 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1717 },
1718 [2] = {
1719 .flags = IORESOURCE_DMA,
1720 .start = DMOV_TSIF_CHAN,
1721 .end = DMOV_TSIF_CRCI,
1722 },
1723};
1724
1725struct platform_device msm_device_tsif[2] = {
1726 {
1727 .name = "msm_tsif",
1728 .id = 0,
1729 .num_resources = ARRAY_SIZE(tsif0_resources),
1730 .resource = tsif0_resources,
1731 .dev = {
1732 .platform_data = &tsif0_platform_data
1733 },
1734 },
1735 {
1736 .name = "msm_tsif",
1737 .id = 1,
1738 .num_resources = ARRAY_SIZE(tsif1_resources),
1739 .resource = tsif1_resources,
1740 .dev = {
1741 .platform_data = &tsif1_platform_data
1742 },
1743 }
1744};
1745
Jay Chokshi33c044a2011-12-07 13:05:40 -08001746static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001747 {
1748 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1749 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1750 .flags = IORESOURCE_MEM,
1751 },
1752};
1753
Jay Chokshi33c044a2011-12-07 13:05:40 -08001754struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001755 .name = "msm_ssbi",
1756 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08001757 .resource = resources_ssbi_pmic,
1758 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001759};
1760
1761static struct resource resources_qup_spi_gsbi1[] = {
1762 {
1763 .name = "spi_base",
1764 .start = MSM_GSBI1_QUP_PHYS,
1765 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1766 .flags = IORESOURCE_MEM,
1767 },
1768 {
1769 .name = "gsbi_base",
1770 .start = MSM_GSBI1_PHYS,
1771 .end = MSM_GSBI1_PHYS + 4 - 1,
1772 .flags = IORESOURCE_MEM,
1773 },
1774 {
1775 .name = "spi_irq_in",
1776 .start = MSM8960_GSBI1_QUP_IRQ,
1777 .end = MSM8960_GSBI1_QUP_IRQ,
1778 .flags = IORESOURCE_IRQ,
1779 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001780 {
1781 .name = "spi_clk",
1782 .start = 9,
1783 .end = 9,
1784 .flags = IORESOURCE_IO,
1785 },
1786 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001787 .name = "spi_miso",
1788 .start = 7,
1789 .end = 7,
1790 .flags = IORESOURCE_IO,
1791 },
1792 {
1793 .name = "spi_mosi",
1794 .start = 6,
1795 .end = 6,
1796 .flags = IORESOURCE_IO,
1797 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07001798 {
1799 .name = "spi_cs",
1800 .start = 8,
1801 .end = 8,
1802 .flags = IORESOURCE_IO,
1803 },
1804 {
1805 .name = "spi_cs1",
1806 .start = 14,
1807 .end = 14,
1808 .flags = IORESOURCE_IO,
1809 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001810};
1811
1812struct platform_device msm8960_device_qup_spi_gsbi1 = {
1813 .name = "spi_qsd",
1814 .id = 0,
1815 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1816 .resource = resources_qup_spi_gsbi1,
1817};
1818
1819struct platform_device msm_pcm = {
1820 .name = "msm-pcm-dsp",
1821 .id = -1,
1822};
1823
Kiran Kandi5e809b02012-01-31 00:24:33 -08001824struct platform_device msm_multi_ch_pcm = {
1825 .name = "msm-multi-ch-pcm-dsp",
1826 .id = -1,
1827};
1828
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001829struct platform_device msm_pcm_routing = {
1830 .name = "msm-pcm-routing",
1831 .id = -1,
1832};
1833
1834struct platform_device msm_cpudai0 = {
1835 .name = "msm-dai-q6",
1836 .id = 0x4000,
1837};
1838
1839struct platform_device msm_cpudai1 = {
1840 .name = "msm-dai-q6",
1841 .id = 0x4001,
1842};
1843
Kiran Kandi1e6371d2012-03-29 11:48:57 -07001844struct platform_device msm8960_cpudai_slimbus_2_tx = {
1845 .name = "msm-dai-q6",
1846 .id = 0x4005,
1847};
1848
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001849struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001850 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001851 .id = 8,
1852};
1853
1854struct platform_device msm_cpudai_bt_rx = {
1855 .name = "msm-dai-q6",
1856 .id = 0x3000,
1857};
1858
1859struct platform_device msm_cpudai_bt_tx = {
1860 .name = "msm-dai-q6",
1861 .id = 0x3001,
1862};
1863
1864struct platform_device msm_cpudai_fm_rx = {
1865 .name = "msm-dai-q6",
1866 .id = 0x3004,
1867};
1868
1869struct platform_device msm_cpudai_fm_tx = {
1870 .name = "msm-dai-q6",
1871 .id = 0x3005,
1872};
1873
Helen Zeng0705a5f2011-10-14 15:29:52 -07001874struct platform_device msm_cpudai_incall_music_rx = {
1875 .name = "msm-dai-q6",
1876 .id = 0x8005,
1877};
1878
Helen Zenge3d716a2011-10-14 16:32:16 -07001879struct platform_device msm_cpudai_incall_record_rx = {
1880 .name = "msm-dai-q6",
1881 .id = 0x8004,
1882};
1883
1884struct platform_device msm_cpudai_incall_record_tx = {
1885 .name = "msm-dai-q6",
1886 .id = 0x8003,
1887};
1888
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001889/*
1890 * Machine specific data for AUX PCM Interface
1891 * which the driver will be unware of.
1892 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001893struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001894 .clk = "pcm_clk",
1895 .mode = AFE_PCM_CFG_MODE_PCM,
1896 .sync = AFE_PCM_CFG_SYNC_INT,
1897 .frame = AFE_PCM_CFG_FRM_256BPF,
1898 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1899 .slot = 0,
1900 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1901 .pcm_clk_rate = 2048000,
1902};
1903
1904struct platform_device msm_cpudai_auxpcm_rx = {
1905 .name = "msm-dai-q6",
1906 .id = 2,
1907 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001908 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001909 },
1910};
1911
1912struct platform_device msm_cpudai_auxpcm_tx = {
1913 .name = "msm-dai-q6",
1914 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001915 .dev = {
1916 .platform_data = &auxpcm_pdata,
1917 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001918};
1919
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001920struct platform_device msm_cpu_fe = {
1921 .name = "msm-dai-fe",
1922 .id = -1,
1923};
1924
1925struct platform_device msm_stub_codec = {
1926 .name = "msm-stub-codec",
1927 .id = 1,
1928};
1929
1930struct platform_device msm_voice = {
1931 .name = "msm-pcm-voice",
1932 .id = -1,
1933};
1934
1935struct platform_device msm_voip = {
1936 .name = "msm-voip-dsp",
1937 .id = -1,
1938};
1939
1940struct platform_device msm_lpa_pcm = {
1941 .name = "msm-pcm-lpa",
1942 .id = -1,
1943};
1944
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301945struct platform_device msm_compr_dsp = {
1946 .name = "msm-compr-dsp",
1947 .id = -1,
1948};
1949
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001950struct platform_device msm_pcm_hostless = {
1951 .name = "msm-pcm-hostless",
1952 .id = -1,
1953};
1954
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301955struct platform_device msm_cpudai_afe_01_rx = {
1956 .name = "msm-dai-q6",
1957 .id = 0xE0,
1958};
1959
1960struct platform_device msm_cpudai_afe_01_tx = {
1961 .name = "msm-dai-q6",
1962 .id = 0xF0,
1963};
1964
1965struct platform_device msm_cpudai_afe_02_rx = {
1966 .name = "msm-dai-q6",
1967 .id = 0xF1,
1968};
1969
1970struct platform_device msm_cpudai_afe_02_tx = {
1971 .name = "msm-dai-q6",
1972 .id = 0xE1,
1973};
1974
1975struct platform_device msm_pcm_afe = {
1976 .name = "msm-pcm-afe",
1977 .id = -1,
1978};
1979
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001980static struct fs_driver_data gfx2d0_fs_data = {
1981 .clks = (struct fs_clk_data[]){
1982 { .name = "core_clk" },
1983 { .name = "iface_clk" },
1984 { 0 }
1985 },
1986 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001987};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001988
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001989static struct fs_driver_data gfx2d1_fs_data = {
1990 .clks = (struct fs_clk_data[]){
1991 { .name = "core_clk" },
1992 { .name = "iface_clk" },
1993 { 0 }
1994 },
1995 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
1996};
1997
1998static struct fs_driver_data gfx3d_fs_data = {
1999 .clks = (struct fs_clk_data[]){
2000 { .name = "core_clk", .reset_rate = 27000000 },
2001 { .name = "iface_clk" },
2002 { 0 }
2003 },
2004 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2005};
2006
2007static struct fs_driver_data ijpeg_fs_data = {
2008 .clks = (struct fs_clk_data[]){
2009 { .name = "core_clk" },
2010 { .name = "iface_clk" },
2011 { .name = "bus_clk" },
2012 { 0 }
2013 },
2014 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2015};
2016
2017static struct fs_driver_data mdp_fs_data = {
2018 .clks = (struct fs_clk_data[]){
2019 { .name = "core_clk" },
2020 { .name = "iface_clk" },
2021 { .name = "bus_clk" },
2022 { .name = "vsync_clk" },
2023 { .name = "lut_clk" },
2024 { .name = "tv_src_clk" },
2025 { .name = "tv_clk" },
2026 { 0 }
2027 },
2028 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2029 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2030};
2031
2032static struct fs_driver_data rot_fs_data = {
2033 .clks = (struct fs_clk_data[]){
2034 { .name = "core_clk" },
2035 { .name = "iface_clk" },
2036 { .name = "bus_clk" },
2037 { 0 }
2038 },
2039 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2040};
2041
2042static struct fs_driver_data ved_fs_data = {
2043 .clks = (struct fs_clk_data[]){
2044 { .name = "core_clk" },
2045 { .name = "iface_clk" },
2046 { .name = "bus_clk" },
2047 { 0 }
2048 },
2049 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
2050 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
2051};
2052
2053static struct fs_driver_data vfe_fs_data = {
2054 .clks = (struct fs_clk_data[]){
2055 { .name = "core_clk" },
2056 { .name = "iface_clk" },
2057 { .name = "bus_clk" },
2058 { 0 }
2059 },
2060 .bus_port0 = MSM_BUS_MASTER_VFE,
2061};
2062
2063static struct fs_driver_data vpe_fs_data = {
2064 .clks = (struct fs_clk_data[]){
2065 { .name = "core_clk" },
2066 { .name = "iface_clk" },
2067 { .name = "bus_clk" },
2068 { 0 }
2069 },
2070 .bus_port0 = MSM_BUS_MASTER_VPE,
2071};
2072
2073struct platform_device *msm8960_footswitch[] __initdata = {
Matt Wagantall5c922112012-05-03 19:25:28 -07002074 FS_8X60(FS_MDP, "fs_mdp", NULL, &mdp_fs_data),
2075 FS_8X60(FS_ROT, "fs_rot", NULL, &rot_fs_data),
2076 FS_8X60(FS_IJPEG, "fs_ijpeg", NULL, &ijpeg_fs_data),
2077 FS_8X60(FS_VFE, "fs_vfe", NULL, &vfe_fs_data),
2078 FS_8X60(FS_VPE, "fs_vpe", NULL, &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002079 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
2080 FS_8X60(FS_GFX2D0, "vdd", "kgsl-2d0.0", &gfx2d0_fs_data),
2081 FS_8X60(FS_GFX2D1, "vdd", "kgsl-2d1.1", &gfx2d1_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002082 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002083};
2084unsigned msm8960_num_footswitch __initdata = ARRAY_SIZE(msm8960_footswitch);
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002085
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002086#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002087static struct msm_bus_vectors rotator_init_vectors[] = {
2088 {
2089 .src = MSM_BUS_MASTER_ROTATOR,
2090 .dst = MSM_BUS_SLAVE_EBI_CH0,
2091 .ab = 0,
2092 .ib = 0,
2093 },
2094};
2095
2096static struct msm_bus_vectors rotator_ui_vectors[] = {
2097 {
2098 .src = MSM_BUS_MASTER_ROTATOR,
2099 .dst = MSM_BUS_SLAVE_EBI_CH0,
2100 .ab = (1024 * 600 * 4 * 2 * 60),
2101 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
2102 },
2103};
2104
2105static struct msm_bus_vectors rotator_vga_vectors[] = {
2106 {
2107 .src = MSM_BUS_MASTER_ROTATOR,
2108 .dst = MSM_BUS_SLAVE_EBI_CH0,
2109 .ab = (640 * 480 * 2 * 2 * 30),
2110 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
2111 },
2112};
2113static struct msm_bus_vectors rotator_720p_vectors[] = {
2114 {
2115 .src = MSM_BUS_MASTER_ROTATOR,
2116 .dst = MSM_BUS_SLAVE_EBI_CH0,
2117 .ab = (1280 * 736 * 2 * 2 * 30),
2118 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
2119 },
2120};
2121
2122static struct msm_bus_vectors rotator_1080p_vectors[] = {
2123 {
2124 .src = MSM_BUS_MASTER_ROTATOR,
2125 .dst = MSM_BUS_SLAVE_EBI_CH0,
2126 .ab = (1920 * 1088 * 2 * 2 * 30),
2127 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
2128 },
2129};
2130
2131static struct msm_bus_paths rotator_bus_scale_usecases[] = {
2132 {
2133 ARRAY_SIZE(rotator_init_vectors),
2134 rotator_init_vectors,
2135 },
2136 {
2137 ARRAY_SIZE(rotator_ui_vectors),
2138 rotator_ui_vectors,
2139 },
2140 {
2141 ARRAY_SIZE(rotator_vga_vectors),
2142 rotator_vga_vectors,
2143 },
2144 {
2145 ARRAY_SIZE(rotator_720p_vectors),
2146 rotator_720p_vectors,
2147 },
2148 {
2149 ARRAY_SIZE(rotator_1080p_vectors),
2150 rotator_1080p_vectors,
2151 },
2152};
2153
2154struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2155 rotator_bus_scale_usecases,
2156 ARRAY_SIZE(rotator_bus_scale_usecases),
2157 .name = "rotator",
2158};
2159
2160void __init msm_rotator_update_bus_vectors(unsigned int xres,
2161 unsigned int yres)
2162{
2163 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2164 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2165}
2166
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002167#define ROTATOR_HW_BASE 0x04E00000
2168static struct resource resources_msm_rotator[] = {
2169 {
2170 .start = ROTATOR_HW_BASE,
2171 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2172 .flags = IORESOURCE_MEM,
2173 },
2174 {
2175 .start = ROT_IRQ,
2176 .end = ROT_IRQ,
2177 .flags = IORESOURCE_IRQ,
2178 },
2179};
2180
2181static struct msm_rot_clocks rotator_clocks[] = {
2182 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002183 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002184 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002185 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002186 },
2187 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002188 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002189 .clk_type = ROTATOR_PCLK,
2190 .clk_rate = 0,
2191 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002192};
2193
2194static struct msm_rotator_platform_data rotator_pdata = {
2195 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2196 .hardware_version_number = 0x01020309,
2197 .rotator_clks = rotator_clocks,
2198 .regulator_name = "fs_rot",
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002199#ifdef CONFIG_MSM_BUS_SCALING
2200 .bus_scale_table = &rotator_bus_scale_pdata,
2201#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002202};
2203
2204struct platform_device msm_rotator_device = {
2205 .name = "msm_rotator",
2206 .id = 0,
2207 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2208 .resource = resources_msm_rotator,
2209 .dev = {
2210 .platform_data = &rotator_pdata,
2211 },
2212};
2213#endif
2214
2215#define MIPI_DSI_HW_BASE 0x04700000
2216#define MDP_HW_BASE 0x05100000
2217
2218static struct resource msm_mipi_dsi1_resources[] = {
2219 {
2220 .name = "mipi_dsi",
2221 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002222 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002223 .flags = IORESOURCE_MEM,
2224 },
2225 {
2226 .start = DSI1_IRQ,
2227 .end = DSI1_IRQ,
2228 .flags = IORESOURCE_IRQ,
2229 },
2230};
2231
2232struct platform_device msm_mipi_dsi1_device = {
2233 .name = "mipi_dsi",
2234 .id = 1,
2235 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2236 .resource = msm_mipi_dsi1_resources,
2237};
2238
2239static struct resource msm_mdp_resources[] = {
2240 {
2241 .name = "mdp",
2242 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002243 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002244 .flags = IORESOURCE_MEM,
2245 },
2246 {
2247 .start = MDP_IRQ,
2248 .end = MDP_IRQ,
2249 .flags = IORESOURCE_IRQ,
2250 },
2251};
2252
2253static struct platform_device msm_mdp_device = {
2254 .name = "mdp",
2255 .id = 0,
2256 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2257 .resource = msm_mdp_resources,
2258};
2259
2260static void __init msm_register_device(struct platform_device *pdev, void *data)
2261{
2262 int ret;
2263
2264 pdev->dev.platform_data = data;
2265 ret = platform_device_register(pdev);
2266 if (ret)
2267 dev_err(&pdev->dev,
2268 "%s: platform_device_register() failed = %d\n",
2269 __func__, ret);
2270}
2271
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002272#ifdef CONFIG_MSM_BUS_SCALING
2273static struct platform_device msm_dtv_device = {
2274 .name = "dtv",
2275 .id = 0,
2276};
2277#endif
2278
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002279struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002280 .name = "lvds",
2281 .id = 0,
2282};
2283
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002284void __init msm_fb_register_device(char *name, void *data)
2285{
2286 if (!strncmp(name, "mdp", 3))
2287 msm_register_device(&msm_mdp_device, data);
2288 else if (!strncmp(name, "mipi_dsi", 8))
2289 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002290 else if (!strncmp(name, "lvds", 4))
2291 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002292#ifdef CONFIG_MSM_BUS_SCALING
2293 else if (!strncmp(name, "dtv", 3))
2294 msm_register_device(&msm_dtv_device, data);
2295#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002296 else
2297 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2298}
2299
2300static struct resource resources_sps[] = {
2301 {
2302 .name = "pipe_mem",
2303 .start = 0x12800000,
2304 .end = 0x12800000 + 0x4000 - 1,
2305 .flags = IORESOURCE_MEM,
2306 },
2307 {
2308 .name = "bamdma_dma",
2309 .start = 0x12240000,
2310 .end = 0x12240000 + 0x1000 - 1,
2311 .flags = IORESOURCE_MEM,
2312 },
2313 {
2314 .name = "bamdma_bam",
2315 .start = 0x12244000,
2316 .end = 0x12244000 + 0x4000 - 1,
2317 .flags = IORESOURCE_MEM,
2318 },
2319 {
2320 .name = "bamdma_irq",
2321 .start = SPS_BAM_DMA_IRQ,
2322 .end = SPS_BAM_DMA_IRQ,
2323 .flags = IORESOURCE_IRQ,
2324 },
2325};
2326
2327struct msm_sps_platform_data msm_sps_pdata = {
2328 .bamdma_restricted_pipes = 0x06,
2329};
2330
2331struct platform_device msm_device_sps = {
2332 .name = "msm_sps",
2333 .id = -1,
2334 .num_resources = ARRAY_SIZE(resources_sps),
2335 .resource = resources_sps,
2336 .dev.platform_data = &msm_sps_pdata,
2337};
2338
2339#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002340static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002341 [1] = MSM_GPIO_TO_INT(46),
2342 [2] = MSM_GPIO_TO_INT(150),
2343 [4] = MSM_GPIO_TO_INT(103),
2344 [5] = MSM_GPIO_TO_INT(104),
2345 [6] = MSM_GPIO_TO_INT(105),
2346 [7] = MSM_GPIO_TO_INT(106),
2347 [8] = MSM_GPIO_TO_INT(107),
2348 [9] = MSM_GPIO_TO_INT(7),
2349 [10] = MSM_GPIO_TO_INT(11),
2350 [11] = MSM_GPIO_TO_INT(15),
2351 [12] = MSM_GPIO_TO_INT(19),
2352 [13] = MSM_GPIO_TO_INT(23),
2353 [14] = MSM_GPIO_TO_INT(27),
2354 [15] = MSM_GPIO_TO_INT(31),
2355 [16] = MSM_GPIO_TO_INT(35),
2356 [19] = MSM_GPIO_TO_INT(90),
2357 [20] = MSM_GPIO_TO_INT(92),
2358 [23] = MSM_GPIO_TO_INT(85),
2359 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002360 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002361 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002362 [29] = MSM_GPIO_TO_INT(10),
2363 [30] = MSM_GPIO_TO_INT(102),
2364 [31] = MSM_GPIO_TO_INT(81),
2365 [32] = MSM_GPIO_TO_INT(78),
2366 [33] = MSM_GPIO_TO_INT(94),
2367 [34] = MSM_GPIO_TO_INT(72),
2368 [35] = MSM_GPIO_TO_INT(39),
2369 [36] = MSM_GPIO_TO_INT(43),
2370 [37] = MSM_GPIO_TO_INT(61),
2371 [38] = MSM_GPIO_TO_INT(50),
2372 [39] = MSM_GPIO_TO_INT(42),
2373 [41] = MSM_GPIO_TO_INT(62),
2374 [42] = MSM_GPIO_TO_INT(76),
2375 [43] = MSM_GPIO_TO_INT(75),
2376 [44] = MSM_GPIO_TO_INT(70),
2377 [45] = MSM_GPIO_TO_INT(69),
2378 [46] = MSM_GPIO_TO_INT(67),
2379 [47] = MSM_GPIO_TO_INT(65),
2380 [48] = MSM_GPIO_TO_INT(58),
2381 [49] = MSM_GPIO_TO_INT(54),
2382 [50] = MSM_GPIO_TO_INT(52),
2383 [51] = MSM_GPIO_TO_INT(49),
2384 [52] = MSM_GPIO_TO_INT(40),
2385 [53] = MSM_GPIO_TO_INT(37),
2386 [54] = MSM_GPIO_TO_INT(24),
2387 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002388};
2389
Praveen Chidambaram78499012011-11-01 17:15:17 -06002390static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002391 TLMM_MSM_SUMMARY_IRQ,
2392 RPM_APCC_CPU0_GP_HIGH_IRQ,
2393 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2394 RPM_APCC_CPU0_GP_LOW_IRQ,
2395 RPM_APCC_CPU0_WAKE_UP_IRQ,
2396 RPM_APCC_CPU1_GP_HIGH_IRQ,
2397 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2398 RPM_APCC_CPU1_GP_LOW_IRQ,
2399 RPM_APCC_CPU1_WAKE_UP_IRQ,
2400 MSS_TO_APPS_IRQ_0,
2401 MSS_TO_APPS_IRQ_1,
2402 MSS_TO_APPS_IRQ_2,
2403 MSS_TO_APPS_IRQ_3,
2404 MSS_TO_APPS_IRQ_4,
2405 MSS_TO_APPS_IRQ_5,
2406 MSS_TO_APPS_IRQ_6,
2407 MSS_TO_APPS_IRQ_7,
2408 MSS_TO_APPS_IRQ_8,
2409 MSS_TO_APPS_IRQ_9,
2410 LPASS_SCSS_GP_LOW_IRQ,
2411 LPASS_SCSS_GP_MEDIUM_IRQ,
2412 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002413 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002414 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002415 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002416 RIVA_APPS_WLAN_SMSM_IRQ,
2417 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2418 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002419};
2420
Praveen Chidambaram78499012011-11-01 17:15:17 -06002421struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002422 .irqs_m2a = msm_mpm_irqs_m2a,
2423 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2424 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2425 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2426 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2427 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2428 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2429 .mpm_apps_ipc_val = BIT(1),
2430 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2431
2432};
2433#endif
2434
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002435#define LPASS_SLIMBUS_PHYS 0x28080000
2436#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002437#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002438/* Board info for the slimbus slave device */
2439static struct resource slimbus_res[] = {
2440 {
2441 .start = LPASS_SLIMBUS_PHYS,
2442 .end = LPASS_SLIMBUS_PHYS + 8191,
2443 .flags = IORESOURCE_MEM,
2444 .name = "slimbus_physical",
2445 },
2446 {
2447 .start = LPASS_SLIMBUS_BAM_PHYS,
2448 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2449 .flags = IORESOURCE_MEM,
2450 .name = "slimbus_bam_physical",
2451 },
2452 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002453 .start = LPASS_SLIMBUS_SLEW,
2454 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2455 .flags = IORESOURCE_MEM,
2456 .name = "slimbus_slew_reg",
2457 },
2458 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002459 .start = SLIMBUS0_CORE_EE1_IRQ,
2460 .end = SLIMBUS0_CORE_EE1_IRQ,
2461 .flags = IORESOURCE_IRQ,
2462 .name = "slimbus_irq",
2463 },
2464 {
2465 .start = SLIMBUS0_BAM_EE1_IRQ,
2466 .end = SLIMBUS0_BAM_EE1_IRQ,
2467 .flags = IORESOURCE_IRQ,
2468 .name = "slimbus_bam_irq",
2469 },
2470};
2471
2472struct platform_device msm_slim_ctrl = {
2473 .name = "msm_slim_ctrl",
2474 .id = 1,
2475 .num_resources = ARRAY_SIZE(slimbus_res),
2476 .resource = slimbus_res,
2477 .dev = {
2478 .coherent_dma_mask = 0xffffffffULL,
2479 },
2480};
2481
Lucille Sylvester6e362412011-12-09 16:21:42 -07002482static struct msm_dcvs_freq_entry grp3d_freq[] = {
2483 {0, 0, 333932},
2484 {0, 0, 497532},
2485 {0, 0, 707610},
2486 {0, 0, 844545},
2487};
2488
2489static struct msm_dcvs_freq_entry grp2d_freq[] = {
2490 {0, 0, 86000},
2491 {0, 0, 200000},
2492};
2493
2494static struct msm_dcvs_core_info grp3d_core_info = {
2495 .freq_tbl = &grp3d_freq[0],
2496 .core_param = {
2497 .max_time_us = 100000,
2498 .num_freq = ARRAY_SIZE(grp3d_freq),
2499 },
2500 .algo_param = {
2501 .slack_time_us = 39000,
2502 .disable_pc_threshold = 86000,
2503 .ss_window_size = 1000000,
2504 .ss_util_pct = 95,
2505 .em_max_util_pct = 97,
2506 .ss_iobusy_conv = 100,
2507 },
2508};
2509
2510static struct msm_dcvs_core_info grp2d_core_info = {
2511 .freq_tbl = &grp2d_freq[0],
2512 .core_param = {
2513 .max_time_us = 100000,
2514 .num_freq = ARRAY_SIZE(grp2d_freq),
2515 },
2516 .algo_param = {
2517 .slack_time_us = 39000,
2518 .disable_pc_threshold = 90000,
2519 .ss_window_size = 1000000,
2520 .ss_util_pct = 90,
2521 .em_max_util_pct = 95,
2522 },
2523};
2524
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002525#ifdef CONFIG_MSM_BUS_SCALING
2526static struct msm_bus_vectors grp3d_init_vectors[] = {
2527 {
2528 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2529 .dst = MSM_BUS_SLAVE_EBI_CH0,
2530 .ab = 0,
2531 .ib = 0,
2532 },
2533};
2534
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002535static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002536 {
2537 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2538 .dst = MSM_BUS_SLAVE_EBI_CH0,
2539 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002540 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002541 },
2542};
2543
2544static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2545 {
2546 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2547 .dst = MSM_BUS_SLAVE_EBI_CH0,
2548 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002549 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002550 },
2551};
2552
2553static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2554 {
2555 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2556 .dst = MSM_BUS_SLAVE_EBI_CH0,
2557 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002558 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002559 },
2560};
2561
2562static struct msm_bus_vectors grp3d_max_vectors[] = {
2563 {
2564 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2565 .dst = MSM_BUS_SLAVE_EBI_CH0,
2566 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002567 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002568 },
2569};
2570
2571static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2572 {
2573 ARRAY_SIZE(grp3d_init_vectors),
2574 grp3d_init_vectors,
2575 },
2576 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002577 ARRAY_SIZE(grp3d_low_vectors),
2578 grp3d_low_vectors,
2579 },
2580 {
2581 ARRAY_SIZE(grp3d_nominal_low_vectors),
2582 grp3d_nominal_low_vectors,
2583 },
2584 {
2585 ARRAY_SIZE(grp3d_nominal_high_vectors),
2586 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002587 },
2588 {
2589 ARRAY_SIZE(grp3d_max_vectors),
2590 grp3d_max_vectors,
2591 },
2592};
2593
2594static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2595 grp3d_bus_scale_usecases,
2596 ARRAY_SIZE(grp3d_bus_scale_usecases),
2597 .name = "grp3d",
2598};
2599
2600static struct msm_bus_vectors grp2d0_init_vectors[] = {
2601 {
2602 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2603 .dst = MSM_BUS_SLAVE_EBI_CH0,
2604 .ab = 0,
2605 .ib = 0,
2606 },
2607};
2608
Lucille Sylvester808eca22011-11-03 10:26:29 -07002609static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002610 {
2611 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2612 .dst = MSM_BUS_SLAVE_EBI_CH0,
2613 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002614 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002615 },
2616};
2617
Lucille Sylvester808eca22011-11-03 10:26:29 -07002618static struct msm_bus_vectors grp2d0_max_vectors[] = {
2619 {
2620 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2621 .dst = MSM_BUS_SLAVE_EBI_CH0,
2622 .ab = 0,
2623 .ib = KGSL_CONVERT_TO_MBPS(2048),
2624 },
2625};
2626
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002627static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2628 {
2629 ARRAY_SIZE(grp2d0_init_vectors),
2630 grp2d0_init_vectors,
2631 },
2632 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002633 ARRAY_SIZE(grp2d0_nominal_vectors),
2634 grp2d0_nominal_vectors,
2635 },
2636 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002637 ARRAY_SIZE(grp2d0_max_vectors),
2638 grp2d0_max_vectors,
2639 },
2640};
2641
2642struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2643 grp2d0_bus_scale_usecases,
2644 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2645 .name = "grp2d0",
2646};
2647
2648static struct msm_bus_vectors grp2d1_init_vectors[] = {
2649 {
2650 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2651 .dst = MSM_BUS_SLAVE_EBI_CH0,
2652 .ab = 0,
2653 .ib = 0,
2654 },
2655};
2656
Lucille Sylvester808eca22011-11-03 10:26:29 -07002657static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002658 {
2659 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2660 .dst = MSM_BUS_SLAVE_EBI_CH0,
2661 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002662 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002663 },
2664};
2665
Lucille Sylvester808eca22011-11-03 10:26:29 -07002666static struct msm_bus_vectors grp2d1_max_vectors[] = {
2667 {
2668 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2669 .dst = MSM_BUS_SLAVE_EBI_CH0,
2670 .ab = 0,
2671 .ib = KGSL_CONVERT_TO_MBPS(2048),
2672 },
2673};
2674
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002675static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2676 {
2677 ARRAY_SIZE(grp2d1_init_vectors),
2678 grp2d1_init_vectors,
2679 },
2680 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002681 ARRAY_SIZE(grp2d1_nominal_vectors),
2682 grp2d1_nominal_vectors,
2683 },
2684 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002685 ARRAY_SIZE(grp2d1_max_vectors),
2686 grp2d1_max_vectors,
2687 },
2688};
2689
2690struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2691 grp2d1_bus_scale_usecases,
2692 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2693 .name = "grp2d1",
2694};
2695#endif
2696
2697static struct resource kgsl_3d0_resources[] = {
2698 {
2699 .name = KGSL_3D0_REG_MEMORY,
2700 .start = 0x04300000, /* GFX3D address */
2701 .end = 0x0431ffff,
2702 .flags = IORESOURCE_MEM,
2703 },
2704 {
2705 .name = KGSL_3D0_IRQ,
2706 .start = GFX3D_IRQ,
2707 .end = GFX3D_IRQ,
2708 .flags = IORESOURCE_IRQ,
2709 },
2710};
2711
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002712static const struct kgsl_iommu_ctx kgsl_3d0_iommu_ctxs[] = {
2713 { "gfx3d_user", 0 },
2714 { "gfx3d_priv", 1 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002715};
2716
2717static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2718 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002719 .iommu_ctxs = kgsl_3d0_iommu_ctxs,
2720 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002721 .physstart = 0x07C00000,
2722 .physend = 0x07C00000 + SZ_1M - 1,
2723 },
2724};
2725
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002726static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002727 .pwrlevel = {
2728 {
2729 .gpu_freq = 400000000,
2730 .bus_freq = 4,
2731 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002732 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002733 {
2734 .gpu_freq = 300000000,
2735 .bus_freq = 3,
2736 .io_fraction = 33,
2737 },
2738 {
2739 .gpu_freq = 200000000,
2740 .bus_freq = 2,
2741 .io_fraction = 100,
2742 },
2743 {
2744 .gpu_freq = 128000000,
2745 .bus_freq = 1,
2746 .io_fraction = 100,
2747 },
2748 {
2749 .gpu_freq = 27000000,
2750 .bus_freq = 0,
2751 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002752 },
Lucille Sylvester67b4c532012-02-08 11:24:31 -08002753 .init_level = 1,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002754 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002755 .set_grp_async = NULL,
Lucille Sylvester5dc67512012-03-27 15:07:58 -06002756 .idle_timeout = HZ/12,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002757 .nap_allowed = true,
2758 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002759#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002760 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002761#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002762 .iommu_data = kgsl_3d0_iommu_data,
2763 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002764 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002765};
2766
2767struct platform_device msm_kgsl_3d0 = {
2768 .name = "kgsl-3d0",
2769 .id = 0,
2770 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2771 .resource = kgsl_3d0_resources,
2772 .dev = {
2773 .platform_data = &kgsl_3d0_pdata,
2774 },
2775};
2776
2777static struct resource kgsl_2d0_resources[] = {
2778 {
2779 .name = KGSL_2D0_REG_MEMORY,
2780 .start = 0x04100000, /* Z180 base address */
2781 .end = 0x04100FFF,
2782 .flags = IORESOURCE_MEM,
2783 },
2784 {
2785 .name = KGSL_2D0_IRQ,
2786 .start = GFX2D0_IRQ,
2787 .end = GFX2D0_IRQ,
2788 .flags = IORESOURCE_IRQ,
2789 },
2790};
2791
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002792static const struct kgsl_iommu_ctx kgsl_2d0_iommu_ctxs[] = {
2793 { "gfx2d0_2d0", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002794};
2795
2796static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2797 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002798 .iommu_ctxs = kgsl_2d0_iommu_ctxs,
2799 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002800 .physstart = 0x07D00000,
2801 .physend = 0x07D00000 + SZ_1M - 1,
2802 },
2803};
2804
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002805static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002806 .pwrlevel = {
2807 {
2808 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002809 .bus_freq = 2,
2810 },
2811 {
2812 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002813 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002814 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002815 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002816 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002817 .bus_freq = 0,
2818 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002819 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002820 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002821 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002822 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002823 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002824 .nap_allowed = true,
2825 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002826#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002827 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002828#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002829 .iommu_data = kgsl_2d0_iommu_data,
2830 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002831 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002832};
2833
2834struct platform_device msm_kgsl_2d0 = {
2835 .name = "kgsl-2d0",
2836 .id = 0,
2837 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2838 .resource = kgsl_2d0_resources,
2839 .dev = {
2840 .platform_data = &kgsl_2d0_pdata,
2841 },
2842};
2843
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002844static const struct kgsl_iommu_ctx kgsl_2d1_iommu_ctxs[] = {
2845 { "gfx2d1_2d1", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002846};
2847
2848static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2849 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002850 .iommu_ctxs = kgsl_2d1_iommu_ctxs,
2851 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002852 .physstart = 0x07E00000,
2853 .physend = 0x07E00000 + SZ_1M - 1,
2854 },
2855};
2856
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002857static struct resource kgsl_2d1_resources[] = {
2858 {
2859 .name = KGSL_2D1_REG_MEMORY,
2860 .start = 0x04200000, /* Z180 device 1 base address */
2861 .end = 0x04200FFF,
2862 .flags = IORESOURCE_MEM,
2863 },
2864 {
2865 .name = KGSL_2D1_IRQ,
2866 .start = GFX2D1_IRQ,
2867 .end = GFX2D1_IRQ,
2868 .flags = IORESOURCE_IRQ,
2869 },
2870};
2871
2872static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002873 .pwrlevel = {
2874 {
2875 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002876 .bus_freq = 2,
2877 },
2878 {
2879 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002880 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002881 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002882 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002883 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002884 .bus_freq = 0,
2885 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002886 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002887 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002888 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002889 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002890 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002891 .nap_allowed = true,
2892 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002893#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002894 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002895#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002896 .iommu_data = kgsl_2d1_iommu_data,
2897 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002898 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002899};
2900
2901struct platform_device msm_kgsl_2d1 = {
2902 .name = "kgsl-2d1",
2903 .id = 1,
2904 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2905 .resource = kgsl_2d1_resources,
2906 .dev = {
2907 .platform_data = &kgsl_2d1_pdata,
2908 },
2909};
2910
2911#ifdef CONFIG_MSM_GEMINI
2912static struct resource msm_gemini_resources[] = {
2913 {
2914 .start = 0x04600000,
2915 .end = 0x04600000 + SZ_1M - 1,
2916 .flags = IORESOURCE_MEM,
2917 },
2918 {
2919 .start = JPEG_IRQ,
2920 .end = JPEG_IRQ,
2921 .flags = IORESOURCE_IRQ,
2922 },
2923};
2924
2925struct platform_device msm8960_gemini_device = {
2926 .name = "msm_gemini",
2927 .resource = msm_gemini_resources,
2928 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2929};
2930#endif
2931
Praveen Chidambaram78499012011-11-01 17:15:17 -06002932struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
2933 .reg_base_addrs = {
2934 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2935 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2936 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2937 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2938 },
2939 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002940 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06002941 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002942 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2943 .ipc_rpm_val = 4,
2944 .target_id = {
2945 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2946 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2947 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
2948 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2949 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2950 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
2951 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
2952 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
2953 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2954 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2955 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2956 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2957 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
2958 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
2959 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
2960 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
2961 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
2962 APPS_FABRIC_CFG_HALT, 2),
2963 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
2964 APPS_FABRIC_CFG_CLKMOD, 3),
2965 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
2966 APPS_FABRIC_CFG_IOCTL, 1),
2967 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2968 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
2969 SYS_FABRIC_CFG_HALT, 2),
2970 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
2971 SYS_FABRIC_CFG_CLKMOD, 3),
2972 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
2973 SYS_FABRIC_CFG_IOCTL, 1),
2974 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
2975 SYSTEM_FABRIC_ARB, 29),
2976 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
2977 MMSS_FABRIC_CFG_HALT, 2),
2978 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
2979 MMSS_FABRIC_CFG_CLKMOD, 3),
2980 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
2981 MMSS_FABRIC_CFG_IOCTL, 1),
2982 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2983 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
2984 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
2985 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
2986 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
2987 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
2988 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
2989 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
2990 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
2991 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
2992 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
2993 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
2994 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
2995 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
2996 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
2997 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
2998 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
2999 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
3000 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
3001 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
3002 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
3003 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
3004 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
3005 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
3006 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
3007 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
3008 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
3009 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
3010 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
3011 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
3012 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
3013 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
3014 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
3015 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
3016 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
3017 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
3018 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
3019 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
3020 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
3021 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
3022 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
3023 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
3024 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
3025 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
3026 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
3027 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
3028 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
3029 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
3030 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
3031 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
3032 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
3033 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
3034 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
3035 },
3036 .target_status = {
3037 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
3038 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
3039 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
3040 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
3041 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
3042 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
3043 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
3044 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
3045 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
3046 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
3047 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
3048 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
3049 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
3050 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
3051 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
3052 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
3053 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
3054 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
3055 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
3056 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
3057 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
3058 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
3059 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
3060 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
3061 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
3062 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
3063 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
3064 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
3065 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
3066 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
3067 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
3068 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
3069 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
3070 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
3071 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
3072 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
3073 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
3074 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
3075 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
3076 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
3077 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
3078 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
3079 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
3080 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
3081 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
3082 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
3083 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
3084 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
3085 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
3086 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
3087 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
3088 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
3089 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
3090 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
3091 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
3092 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
3093 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
3094 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
3095 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3096 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3097 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3098 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3099 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3100 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3101 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3102 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3103 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3104 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3105 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3106 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3107 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3108 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3109 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3110 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3111 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3112 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3113 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3114 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3115 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3116 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3117 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3118 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3119 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3120 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3121 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3122 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3123 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3124 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3125 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3126 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3127 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3128 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3129 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3130 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3131 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3132 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3133 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3134 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3135 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3136 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3137 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3138 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3139 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3140 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3141 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3142 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3143 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3144 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3145 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3146 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3147 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3148 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3149 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3150 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3151 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3152 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3153 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3154 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3155 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3156 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3157 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3158 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3159 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3160 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3161 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3162 },
3163 .target_ctrl_id = {
3164 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3165 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3166 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3167 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3168 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3169 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3170 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3171 },
3172 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3173 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3174 .sel_last = MSM_RPM_8960_SEL_LAST,
3175 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003176};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003177
Praveen Chidambaram78499012011-11-01 17:15:17 -06003178struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003179 .name = "msm_rpm",
3180 .id = -1,
3181};
3182
Praveen Chidambaram78499012011-11-01 17:15:17 -06003183static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3184 .phys_addr_base = 0x0010C000,
3185 .reg_offsets = {
3186 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3187 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3188 },
3189 .phys_size = SZ_8K,
3190 .log_len = 4096, /* log's buffer length in bytes */
3191 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3192};
3193
3194struct platform_device msm8960_rpm_log_device = {
3195 .name = "msm_rpm_log",
3196 .id = -1,
3197 .dev = {
3198 .platform_data = &msm_rpm_log_pdata,
3199 },
3200};
3201
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003202static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
3203 .phys_addr_base = 0x0010D204,
3204 .phys_size = SZ_8K,
3205};
3206
Praveen Chidambaram78499012011-11-01 17:15:17 -06003207struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003208 .name = "msm_rpm_stat",
3209 .id = -1,
3210 .dev = {
3211 .platform_data = &msm_rpm_stat_pdata,
3212 },
3213};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003214
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003215struct platform_device msm_bus_sys_fabric = {
3216 .name = "msm_bus_fabric",
3217 .id = MSM_BUS_FAB_SYSTEM,
3218};
3219struct platform_device msm_bus_apps_fabric = {
3220 .name = "msm_bus_fabric",
3221 .id = MSM_BUS_FAB_APPSS,
3222};
3223struct platform_device msm_bus_mm_fabric = {
3224 .name = "msm_bus_fabric",
3225 .id = MSM_BUS_FAB_MMSS,
3226};
3227struct platform_device msm_bus_sys_fpb = {
3228 .name = "msm_bus_fabric",
3229 .id = MSM_BUS_FAB_SYSTEM_FPB,
3230};
3231struct platform_device msm_bus_cpss_fpb = {
3232 .name = "msm_bus_fabric",
3233 .id = MSM_BUS_FAB_CPSS_FPB,
3234};
3235
3236/* Sensors DSPS platform data */
3237#ifdef CONFIG_MSM_DSPS
3238
3239#define PPSS_REG_PHYS_BASE 0x12080000
3240
3241static struct dsps_clk_info dsps_clks[] = {};
3242static struct dsps_regulator_info dsps_regs[] = {};
3243
3244/*
3245 * Note: GPIOs field is intialized in run-time at the function
3246 * msm8960_init_dsps().
3247 */
3248
3249struct msm_dsps_platform_data msm_dsps_pdata = {
3250 .clks = dsps_clks,
3251 .clks_num = ARRAY_SIZE(dsps_clks),
3252 .gpios = NULL,
3253 .gpios_num = 0,
3254 .regs = dsps_regs,
3255 .regs_num = ARRAY_SIZE(dsps_regs),
3256 .dsps_pwr_ctl_en = 1,
3257 .signature = DSPS_SIGNATURE,
3258};
3259
3260static struct resource msm_dsps_resources[] = {
3261 {
3262 .start = PPSS_REG_PHYS_BASE,
3263 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
3264 .name = "ppss_reg",
3265 .flags = IORESOURCE_MEM,
3266 },
Wentao Xua55500b2011-08-16 18:15:04 -04003267
3268 {
3269 .start = PPSS_WDOG_TIMER_IRQ,
3270 .end = PPSS_WDOG_TIMER_IRQ,
3271 .name = "ppss_wdog",
3272 .flags = IORESOURCE_IRQ,
3273 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003274};
3275
3276struct platform_device msm_dsps_device = {
3277 .name = "msm_dsps",
3278 .id = 0,
3279 .num_resources = ARRAY_SIZE(msm_dsps_resources),
3280 .resource = msm_dsps_resources,
3281 .dev.platform_data = &msm_dsps_pdata,
3282};
3283
3284#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07003285
3286#ifdef CONFIG_MSM_QDSS
3287
3288#define MSM_QDSS_PHYS_BASE 0x01A00000
3289#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
3290#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
3291#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
Pratik Patel492b3012012-03-06 14:22:30 -08003292#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
Pratik Patel7831c082011-06-08 21:44:37 -07003293
Pratik Patel1403f2a2012-03-21 10:10:00 -07003294#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
3295
3296static struct qdss_source msm_qdss_sources[] = {
3297 QDSS_SOURCE("msm_etm", 0x3),
3298};
3299
3300static struct msm_qdss_platform_data qdss_pdata = {
3301 .src_table = msm_qdss_sources,
3302 .size = ARRAY_SIZE(msm_qdss_sources),
3303 .afamily = 1,
3304};
3305
3306struct platform_device msm_qdss_device = {
3307 .name = "msm_qdss",
3308 .id = -1,
3309 .dev = {
3310 .platform_data = &qdss_pdata,
3311 },
3312};
3313
Pratik Patel7831c082011-06-08 21:44:37 -07003314static struct resource msm_etb_resources[] = {
3315 {
3316 .start = MSM_ETB_PHYS_BASE,
3317 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
3318 .flags = IORESOURCE_MEM,
3319 },
3320};
3321
3322struct platform_device msm_etb_device = {
3323 .name = "msm_etb",
3324 .id = 0,
3325 .num_resources = ARRAY_SIZE(msm_etb_resources),
3326 .resource = msm_etb_resources,
3327};
3328
3329static struct resource msm_tpiu_resources[] = {
3330 {
3331 .start = MSM_TPIU_PHYS_BASE,
3332 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
3333 .flags = IORESOURCE_MEM,
3334 },
3335};
3336
3337struct platform_device msm_tpiu_device = {
3338 .name = "msm_tpiu",
3339 .id = 0,
3340 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
3341 .resource = msm_tpiu_resources,
3342};
3343
3344static struct resource msm_funnel_resources[] = {
3345 {
3346 .start = MSM_FUNNEL_PHYS_BASE,
3347 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
3348 .flags = IORESOURCE_MEM,
3349 },
3350};
3351
3352struct platform_device msm_funnel_device = {
3353 .name = "msm_funnel",
3354 .id = 0,
3355 .num_resources = ARRAY_SIZE(msm_funnel_resources),
3356 .resource = msm_funnel_resources,
3357};
3358
Pratik Patel492b3012012-03-06 14:22:30 -08003359static struct resource msm_etm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07003360 {
Pratik Patel492b3012012-03-06 14:22:30 -08003361 .start = MSM_ETM_PHYS_BASE,
3362 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 2) - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07003363 .flags = IORESOURCE_MEM,
3364 },
3365};
3366
Pratik Patel492b3012012-03-06 14:22:30 -08003367struct platform_device msm_etm_device = {
3368 .name = "msm_etm",
Pratik Patel7831c082011-06-08 21:44:37 -07003369 .id = 0,
Pratik Patel492b3012012-03-06 14:22:30 -08003370 .num_resources = ARRAY_SIZE(msm_etm_resources),
3371 .resource = msm_etm_resources,
Pratik Patel7831c082011-06-08 21:44:37 -07003372};
3373
3374#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07003375
3376static int msm8960_LPM_latency = 1000; /* >100 usec for WFI */
3377
3378struct platform_device msm8960_cpu_idle_device = {
3379 .name = "msm_cpu_idle",
3380 .id = -1,
3381 .dev = {
3382 .platform_data = &msm8960_LPM_latency,
3383 },
3384};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07003385
3386static struct msm_dcvs_freq_entry msm8960_freq[] = {
3387 { 384000, 166981, 345600},
3388 { 702000, 213049, 632502},
3389 {1026000, 285712, 925613},
3390 {1242000, 383945, 1176550},
3391 {1458000, 419729, 1465478},
3392 {1512000, 434116, 1546674},
3393
3394};
3395
3396static struct msm_dcvs_core_info msm8960_core_info = {
3397 .freq_tbl = &msm8960_freq[0],
3398 .core_param = {
3399 .max_time_us = 100000,
3400 .num_freq = ARRAY_SIZE(msm8960_freq),
3401 },
3402 .algo_param = {
3403 .slack_time_us = 58000,
3404 .scale_slack_time = 0,
3405 .scale_slack_time_pct = 0,
3406 .disable_pc_threshold = 1458000,
3407 .em_window_size = 100000,
3408 .em_max_util_pct = 97,
3409 .ss_window_size = 1000000,
3410 .ss_util_pct = 95,
3411 .ss_iobusy_conv = 100,
3412 },
3413};
3414
3415struct platform_device msm8960_msm_gov_device = {
3416 .name = "msm_dcvs_gov",
3417 .id = -1,
3418 .dev = {
3419 .platform_data = &msm8960_core_info,
3420 },
3421};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003422
3423static struct resource msm_cache_erp_resources[] = {
3424 {
3425 .name = "l1_irq",
3426 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3427 .flags = IORESOURCE_IRQ,
3428 },
3429 {
3430 .name = "l2_irq",
3431 .start = APCC_QGICL2IRPTREQ,
3432 .flags = IORESOURCE_IRQ,
3433 }
3434};
3435
3436struct platform_device msm8960_device_cache_erp = {
3437 .name = "msm_cache_erp",
3438 .id = -1,
3439 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3440 .resource = msm_cache_erp_resources,
3441};
Laura Abbott0577d7b2012-04-17 11:14:30 -07003442
3443struct msm_iommu_domain_name msm8960_iommu_ctx_names[] = {
3444 /* Camera */
3445 {
3446 .name = "vpe_src",
3447 .domain = CAMERA_DOMAIN,
3448 },
3449 /* Camera */
3450 {
3451 .name = "vpe_dst",
3452 .domain = CAMERA_DOMAIN,
3453 },
3454 /* Camera */
3455 {
3456 .name = "vfe_imgwr",
3457 .domain = CAMERA_DOMAIN,
3458 },
3459 /* Camera */
3460 {
3461 .name = "vfe_misc",
3462 .domain = CAMERA_DOMAIN,
3463 },
3464 /* Camera */
3465 {
3466 .name = "ijpeg_src",
3467 .domain = CAMERA_DOMAIN,
3468 },
3469 /* Camera */
3470 {
3471 .name = "ijpeg_dst",
3472 .domain = CAMERA_DOMAIN,
3473 },
3474 /* Camera */
3475 {
3476 .name = "jpegd_src",
3477 .domain = CAMERA_DOMAIN,
3478 },
3479 /* Camera */
3480 {
3481 .name = "jpegd_dst",
3482 .domain = CAMERA_DOMAIN,
3483 },
3484 /* Rotator */
3485 {
3486 .name = "rot_src",
3487 .domain = ROTATOR_DOMAIN,
3488 },
3489 /* Rotator */
3490 {
3491 .name = "rot_dst",
3492 .domain = ROTATOR_DOMAIN,
3493 },
3494 /* Video */
3495 {
3496 .name = "vcodec_a_mm1",
3497 .domain = VIDEO_DOMAIN,
3498 },
3499 /* Video */
3500 {
3501 .name = "vcodec_b_mm2",
3502 .domain = VIDEO_DOMAIN,
3503 },
3504 /* Video */
3505 {
3506 .name = "vcodec_a_stream",
3507 .domain = VIDEO_DOMAIN,
3508 },
3509};
3510
3511static struct mem_pool msm8960_video_pools[] = {
3512 /*
3513 * Video hardware has the following requirements:
3514 * 1. All video addresses used by the video hardware must be at a higher
3515 * address than video firmware address.
3516 * 2. Video hardware can only access a range of 256MB from the base of
3517 * the video firmware.
3518 */
3519 [VIDEO_FIRMWARE_POOL] =
3520 /* Low addresses, intended for video firmware */
3521 {
3522 .paddr = SZ_128K,
3523 .size = SZ_16M - SZ_128K,
3524 },
3525 [VIDEO_MAIN_POOL] =
3526 /* Main video pool */
3527 {
3528 .paddr = SZ_16M,
3529 .size = SZ_256M - SZ_16M,
3530 },
3531 [GEN_POOL] =
3532 /* Remaining address space up to 2G */
3533 {
3534 .paddr = SZ_256M,
3535 .size = SZ_2G - SZ_256M,
3536 },
3537};
3538
3539static struct mem_pool msm8960_camera_pools[] = {
3540 [GEN_POOL] =
3541 /* One address space for camera */
3542 {
3543 .paddr = SZ_128K,
3544 .size = SZ_2G - SZ_128K,
3545 },
3546};
3547
3548static struct mem_pool msm8960_display_pools[] = {
3549 [GEN_POOL] =
3550 /* One address space for display */
3551 {
3552 .paddr = SZ_128K,
3553 .size = SZ_2G - SZ_128K,
3554 },
3555};
3556
3557static struct mem_pool msm8960_rotator_pools[] = {
3558 [GEN_POOL] =
3559 /* One address space for rotator */
3560 {
3561 .paddr = SZ_128K,
3562 .size = SZ_2G - SZ_128K,
3563 },
3564};
3565
3566static struct msm_iommu_domain msm8960_iommu_domains[] = {
3567 [VIDEO_DOMAIN] = {
3568 .iova_pools = msm8960_video_pools,
3569 .npools = ARRAY_SIZE(msm8960_video_pools),
3570 },
3571 [CAMERA_DOMAIN] = {
3572 .iova_pools = msm8960_camera_pools,
3573 .npools = ARRAY_SIZE(msm8960_camera_pools),
3574 },
3575 [DISPLAY_DOMAIN] = {
3576 .iova_pools = msm8960_display_pools,
3577 .npools = ARRAY_SIZE(msm8960_display_pools),
3578 },
3579 [ROTATOR_DOMAIN] = {
3580 .iova_pools = msm8960_rotator_pools,
3581 .npools = ARRAY_SIZE(msm8960_rotator_pools),
3582 },
3583};
3584
3585struct iommu_domains_pdata msm8960_iommu_domain_pdata = {
3586 .domains = msm8960_iommu_domains,
3587 .ndomains = ARRAY_SIZE(msm8960_iommu_domains),
3588 .domain_names = msm8960_iommu_ctx_names,
3589 .nnames = ARRAY_SIZE(msm8960_iommu_ctx_names),
3590 .domain_alloc_flags = 0,
3591};
3592
3593struct platform_device msm8960_iommu_domain_device = {
3594 .name = "iommu_domains",
3595 .id = -1,
3596 .dev = {
3597 .platform_data = &msm8960_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07003598 }
3599};
3600
3601struct msm_rtb_platform_data msm8960_rtb_pdata = {
3602 .size = SZ_1M,
3603};
3604
3605static int __init msm_rtb_set_buffer_size(char *p)
3606{
3607 int s;
3608
3609 s = memparse(p, NULL);
3610 msm8960_rtb_pdata.size = ALIGN(s, SZ_4K);
3611 return 0;
3612}
3613early_param("msm_rtb_size", msm_rtb_set_buffer_size);
3614
3615
3616struct platform_device msm8960_rtb_device = {
3617 .name = "msm_rtb",
3618 .id = -1,
3619 .dev = {
3620 .platform_data = &msm8960_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003621 },
3622};