blob: db55d1434348038d7530822e18cadd7a4f55e90c [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>
Laura Abbott2ae8f362012-04-12 11:03:04 -070036#include <mach/msm_cache_dump.h>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070037#include <sound/msm-dai-q6.h>
38#include <sound/apr_audio.h>
Joel Nidera1261942011-09-12 16:30:09 +030039#include <mach/msm_tsif.h>
Pratik Patel1403f2a2012-03-21 10:10:00 -070040#include <mach/qdss.h>
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070041#include <mach/msm_serial_hs_lite.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042#include "clock.h"
43#include "devices.h"
44#include "devices-msm8x60.h"
45#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070046#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060047#include "rpm_log.h"
Praveen Chidambaram7a712232011-10-28 13:39:45 -060048#include "rpm_stats.h"
Stephen Boydeb819882011-08-29 14:46:30 -070049#include "pil-q6v4.h"
50#include "scm-pas.h"
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070051#include <mach/msm_dcvs.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070052#include <mach/iommu_domains.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053
54#ifdef CONFIG_MSM_MPM
Subhash Jadavani909e04f2012-04-12 10:52:50 +053055#include <mach/mpm.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#endif
57#ifdef CONFIG_MSM_DSPS
58#include <mach/msm_dsps.h>
59#endif
60
61
62/* Address of GSBI blocks */
63#define MSM_GSBI1_PHYS 0x16000000
64#define MSM_GSBI2_PHYS 0x16100000
65#define MSM_GSBI3_PHYS 0x16200000
66#define MSM_GSBI4_PHYS 0x16300000
67#define MSM_GSBI5_PHYS 0x16400000
68#define MSM_GSBI6_PHYS 0x16500000
69#define MSM_GSBI7_PHYS 0x16600000
70#define MSM_GSBI8_PHYS 0x1A000000
71#define MSM_GSBI9_PHYS 0x1A100000
72#define MSM_GSBI10_PHYS 0x1A200000
73#define MSM_GSBI11_PHYS 0x12440000
74#define MSM_GSBI12_PHYS 0x12480000
75
76#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
77#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053078#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070079#define MSM_UART8DM_PHYS (MSM_GSBI8_PHYS + 0x40000)
Mayank Ranae009c922012-03-22 03:02:06 +053080#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070081
82/* GSBI QUP devices */
83#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
84#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
85#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
86#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
87#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
88#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
89#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
90#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
91#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
92#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
93#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
94#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
95#define MSM_QUP_SIZE SZ_4K
96
97#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
98#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
99#define MSM_PMIC_SSBI_SIZE SZ_4K
100
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -0700101#define MSM8960_HSUSB_PHYS 0x12500000
102#define MSM8960_HSUSB_SIZE SZ_4K
103
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700104static struct resource resources_otg[] = {
105 {
106 .start = MSM8960_HSUSB_PHYS,
107 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
108 .flags = IORESOURCE_MEM,
109 },
110 {
111 .start = USB1_HS_IRQ,
112 .end = USB1_HS_IRQ,
113 .flags = IORESOURCE_IRQ,
114 },
115};
116
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700117struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700118 .name = "msm_otg",
119 .id = -1,
120 .num_resources = ARRAY_SIZE(resources_otg),
121 .resource = resources_otg,
122 .dev = {
123 .coherent_dma_mask = 0xffffffff,
124 },
125};
126
127static struct resource resources_hsusb[] = {
128 {
129 .start = MSM8960_HSUSB_PHYS,
130 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
131 .flags = IORESOURCE_MEM,
132 },
133 {
134 .start = USB1_HS_IRQ,
135 .end = USB1_HS_IRQ,
136 .flags = IORESOURCE_IRQ,
137 },
138};
139
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700140struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700141 .name = "msm_hsusb",
142 .id = -1,
143 .num_resources = ARRAY_SIZE(resources_hsusb),
144 .resource = resources_hsusb,
145 .dev = {
146 .coherent_dma_mask = 0xffffffff,
147 },
148};
149
150static struct resource resources_hsusb_host[] = {
151 {
152 .start = MSM8960_HSUSB_PHYS,
153 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
154 .flags = IORESOURCE_MEM,
155 },
156 {
157 .start = USB1_HS_IRQ,
158 .end = USB1_HS_IRQ,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530163static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700164struct platform_device msm_device_hsusb_host = {
165 .name = "msm_hsusb_host",
166 .id = -1,
167 .num_resources = ARRAY_SIZE(resources_hsusb_host),
168 .resource = resources_hsusb_host,
169 .dev = {
170 .dma_mask = &dma_mask,
171 .coherent_dma_mask = 0xffffffff,
172 },
173};
174
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530175static struct resource resources_hsic_host[] = {
176 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700177 .start = 0x12520000,
178 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530179 .flags = IORESOURCE_MEM,
180 },
181 {
182 .start = USB_HSIC_IRQ,
183 .end = USB_HSIC_IRQ,
184 .flags = IORESOURCE_IRQ,
185 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800186 {
187 .start = MSM_GPIO_TO_INT(69),
188 .end = MSM_GPIO_TO_INT(69),
189 .name = "peripheral_status_irq",
190 .flags = IORESOURCE_IRQ,
191 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530192};
193
194struct platform_device msm_device_hsic_host = {
195 .name = "msm_hsic_host",
196 .id = -1,
197 .num_resources = ARRAY_SIZE(resources_hsic_host),
198 .resource = resources_hsic_host,
199 .dev = {
200 .dma_mask = &dma_mask,
201 .coherent_dma_mask = DMA_BIT_MASK(32),
202 },
203};
204
Mona Hossain11c03ac2011-10-26 12:42:10 -0700205#define SHARED_IMEM_TZ_BASE 0x2a03f720
206static struct resource tzlog_resources[] = {
207 {
208 .start = SHARED_IMEM_TZ_BASE,
209 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
210 .flags = IORESOURCE_MEM,
211 },
212};
213
214struct platform_device msm_device_tz_log = {
215 .name = "tz_log",
216 .id = 0,
217 .num_resources = ARRAY_SIZE(tzlog_resources),
218 .resource = tzlog_resources,
219};
220
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700221static struct resource resources_uart_gsbi2[] = {
222 {
223 .start = MSM8960_GSBI2_UARTDM_IRQ,
224 .end = MSM8960_GSBI2_UARTDM_IRQ,
225 .flags = IORESOURCE_IRQ,
226 },
227 {
228 .start = MSM_UART2DM_PHYS,
229 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
230 .name = "uartdm_resource",
231 .flags = IORESOURCE_MEM,
232 },
233 {
234 .start = MSM_GSBI2_PHYS,
235 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
236 .name = "gsbi_resource",
237 .flags = IORESOURCE_MEM,
238 },
239};
240
241struct platform_device msm8960_device_uart_gsbi2 = {
242 .name = "msm_serial_hsl",
243 .id = 0,
244 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
245 .resource = resources_uart_gsbi2,
246};
Mayank Rana9f51f582011-08-04 18:35:59 +0530247/* GSBI 6 used into UARTDM Mode */
248static struct resource msm_uart_dm6_resources[] = {
249 {
250 .start = MSM_UART6DM_PHYS,
251 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
252 .name = "uartdm_resource",
253 .flags = IORESOURCE_MEM,
254 },
255 {
256 .start = GSBI6_UARTDM_IRQ,
257 .end = GSBI6_UARTDM_IRQ,
258 .flags = IORESOURCE_IRQ,
259 },
260 {
261 .start = MSM_GSBI6_PHYS,
262 .end = MSM_GSBI6_PHYS + 4 - 1,
263 .name = "gsbi_resource",
264 .flags = IORESOURCE_MEM,
265 },
266 {
267 .start = DMOV_HSUART_GSBI6_TX_CHAN,
268 .end = DMOV_HSUART_GSBI6_RX_CHAN,
269 .name = "uartdm_channels",
270 .flags = IORESOURCE_DMA,
271 },
272 {
273 .start = DMOV_HSUART_GSBI6_TX_CRCI,
274 .end = DMOV_HSUART_GSBI6_RX_CRCI,
275 .name = "uartdm_crci",
276 .flags = IORESOURCE_DMA,
277 },
278};
279static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
280struct platform_device msm_device_uart_dm6 = {
281 .name = "msm_serial_hs",
282 .id = 0,
283 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
284 .resource = msm_uart_dm6_resources,
285 .dev = {
286 .dma_mask = &msm_uart_dm6_dma_mask,
287 .coherent_dma_mask = DMA_BIT_MASK(32),
288 },
289};
Mayank Ranae009c922012-03-22 03:02:06 +0530290/*
291 * GSBI 9 used into UARTDM Mode
292 * For 8960 Fusion 2.2 Primary IPC
293 */
294static struct resource msm_uart_dm9_resources[] = {
295 {
296 .start = MSM_UART9DM_PHYS,
297 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
298 .name = "uartdm_resource",
299 .flags = IORESOURCE_MEM,
300 },
301 {
302 .start = GSBI9_UARTDM_IRQ,
303 .end = GSBI9_UARTDM_IRQ,
304 .flags = IORESOURCE_IRQ,
305 },
306 {
307 .start = MSM_GSBI9_PHYS,
308 .end = MSM_GSBI9_PHYS + 4 - 1,
309 .name = "gsbi_resource",
310 .flags = IORESOURCE_MEM,
311 },
312 {
313 .start = DMOV_HSUART_GSBI9_TX_CHAN,
314 .end = DMOV_HSUART_GSBI9_RX_CHAN,
315 .name = "uartdm_channels",
316 .flags = IORESOURCE_DMA,
317 },
318 {
319 .start = DMOV_HSUART_GSBI9_TX_CRCI,
320 .end = DMOV_HSUART_GSBI9_RX_CRCI,
321 .name = "uartdm_crci",
322 .flags = IORESOURCE_DMA,
323 },
324};
325static u64 msm_uart_dm9_dma_mask = DMA_BIT_MASK(32);
326struct platform_device msm_device_uart_dm9 = {
327 .name = "msm_serial_hs",
328 .id = 1,
329 .num_resources = ARRAY_SIZE(msm_uart_dm9_resources),
330 .resource = msm_uart_dm9_resources,
331 .dev = {
332 .dma_mask = &msm_uart_dm9_dma_mask,
333 .coherent_dma_mask = DMA_BIT_MASK(32),
334 },
335};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700336
337static struct resource resources_uart_gsbi5[] = {
338 {
339 .start = GSBI5_UARTDM_IRQ,
340 .end = GSBI5_UARTDM_IRQ,
341 .flags = IORESOURCE_IRQ,
342 },
343 {
344 .start = MSM_UART5DM_PHYS,
345 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
346 .name = "uartdm_resource",
347 .flags = IORESOURCE_MEM,
348 },
349 {
350 .start = MSM_GSBI5_PHYS,
351 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
352 .name = "gsbi_resource",
353 .flags = IORESOURCE_MEM,
354 },
355};
356
357struct platform_device msm8960_device_uart_gsbi5 = {
358 .name = "msm_serial_hsl",
359 .id = 0,
360 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
361 .resource = resources_uart_gsbi5,
362};
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700363
364static struct msm_serial_hslite_platform_data uart_gsbi8_pdata = {
365 .line = 0,
366};
367
368static struct resource resources_uart_gsbi8[] = {
369 {
370 .start = GSBI8_UARTDM_IRQ,
371 .end = GSBI8_UARTDM_IRQ,
372 .flags = IORESOURCE_IRQ,
373 },
374 {
375 .start = MSM_UART8DM_PHYS,
376 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
377 .name = "uartdm_resource",
378 .flags = IORESOURCE_MEM,
379 },
380 {
381 .start = MSM_GSBI8_PHYS,
382 .end = MSM_GSBI8_PHYS + PAGE_SIZE - 1,
383 .name = "gsbi_resource",
384 .flags = IORESOURCE_MEM,
385 },
386};
387
388struct platform_device msm8960_device_uart_gsbi8 = {
389 .name = "msm_serial_hsl",
390 .id = 1,
391 .num_resources = ARRAY_SIZE(resources_uart_gsbi8),
392 .resource = resources_uart_gsbi8,
393 .dev.platform_data = &uart_gsbi8_pdata,
394};
395
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700396/* MSM Video core device */
397#ifdef CONFIG_MSM_BUS_SCALING
398static struct msm_bus_vectors vidc_init_vectors[] = {
399 {
400 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
401 .dst = MSM_BUS_SLAVE_EBI_CH0,
402 .ab = 0,
403 .ib = 0,
404 },
405 {
406 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
407 .dst = MSM_BUS_SLAVE_EBI_CH0,
408 .ab = 0,
409 .ib = 0,
410 },
411 {
412 .src = MSM_BUS_MASTER_AMPSS_M0,
413 .dst = MSM_BUS_SLAVE_EBI_CH0,
414 .ab = 0,
415 .ib = 0,
416 },
417 {
418 .src = MSM_BUS_MASTER_AMPSS_M0,
419 .dst = MSM_BUS_SLAVE_EBI_CH0,
420 .ab = 0,
421 .ib = 0,
422 },
423};
424static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
425 {
426 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
427 .dst = MSM_BUS_SLAVE_EBI_CH0,
428 .ab = 54525952,
429 .ib = 436207616,
430 },
431 {
432 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
433 .dst = MSM_BUS_SLAVE_EBI_CH0,
434 .ab = 72351744,
435 .ib = 289406976,
436 },
437 {
438 .src = MSM_BUS_MASTER_AMPSS_M0,
439 .dst = MSM_BUS_SLAVE_EBI_CH0,
440 .ab = 500000,
441 .ib = 1000000,
442 },
443 {
444 .src = MSM_BUS_MASTER_AMPSS_M0,
445 .dst = MSM_BUS_SLAVE_EBI_CH0,
446 .ab = 500000,
447 .ib = 1000000,
448 },
449};
450static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
451 {
452 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
453 .dst = MSM_BUS_SLAVE_EBI_CH0,
454 .ab = 40894464,
455 .ib = 327155712,
456 },
457 {
458 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
459 .dst = MSM_BUS_SLAVE_EBI_CH0,
460 .ab = 48234496,
461 .ib = 192937984,
462 },
463 {
464 .src = MSM_BUS_MASTER_AMPSS_M0,
465 .dst = MSM_BUS_SLAVE_EBI_CH0,
466 .ab = 500000,
467 .ib = 2000000,
468 },
469 {
470 .src = MSM_BUS_MASTER_AMPSS_M0,
471 .dst = MSM_BUS_SLAVE_EBI_CH0,
472 .ab = 500000,
473 .ib = 2000000,
474 },
475};
476static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
477 {
478 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
479 .dst = MSM_BUS_SLAVE_EBI_CH0,
480 .ab = 163577856,
481 .ib = 1308622848,
482 },
483 {
484 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
485 .dst = MSM_BUS_SLAVE_EBI_CH0,
486 .ab = 219152384,
487 .ib = 876609536,
488 },
489 {
490 .src = MSM_BUS_MASTER_AMPSS_M0,
491 .dst = MSM_BUS_SLAVE_EBI_CH0,
492 .ab = 1750000,
493 .ib = 3500000,
494 },
495 {
496 .src = MSM_BUS_MASTER_AMPSS_M0,
497 .dst = MSM_BUS_SLAVE_EBI_CH0,
498 .ab = 1750000,
499 .ib = 3500000,
500 },
501};
502static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
503 {
504 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
505 .dst = MSM_BUS_SLAVE_EBI_CH0,
506 .ab = 121634816,
507 .ib = 973078528,
508 },
509 {
510 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
511 .dst = MSM_BUS_SLAVE_EBI_CH0,
512 .ab = 155189248,
513 .ib = 620756992,
514 },
515 {
516 .src = MSM_BUS_MASTER_AMPSS_M0,
517 .dst = MSM_BUS_SLAVE_EBI_CH0,
518 .ab = 1750000,
519 .ib = 7000000,
520 },
521 {
522 .src = MSM_BUS_MASTER_AMPSS_M0,
523 .dst = MSM_BUS_SLAVE_EBI_CH0,
524 .ab = 1750000,
525 .ib = 7000000,
526 },
527};
528static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
529 {
530 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
531 .dst = MSM_BUS_SLAVE_EBI_CH0,
532 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700533 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700534 },
535 {
536 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
537 .dst = MSM_BUS_SLAVE_EBI_CH0,
538 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700539 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700540 },
541 {
542 .src = MSM_BUS_MASTER_AMPSS_M0,
543 .dst = MSM_BUS_SLAVE_EBI_CH0,
544 .ab = 2500000,
545 .ib = 5000000,
546 },
547 {
548 .src = MSM_BUS_MASTER_AMPSS_M0,
549 .dst = MSM_BUS_SLAVE_EBI_CH0,
550 .ab = 2500000,
551 .ib = 5000000,
552 },
553};
554static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
555 {
556 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
557 .dst = MSM_BUS_SLAVE_EBI_CH0,
558 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700559 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700560 },
561 {
562 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
563 .dst = MSM_BUS_SLAVE_EBI_CH0,
564 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700565 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700566 },
567 {
568 .src = MSM_BUS_MASTER_AMPSS_M0,
569 .dst = MSM_BUS_SLAVE_EBI_CH0,
570 .ab = 2500000,
571 .ib = 700000000,
572 },
573 {
574 .src = MSM_BUS_MASTER_AMPSS_M0,
575 .dst = MSM_BUS_SLAVE_EBI_CH0,
576 .ab = 2500000,
577 .ib = 10000000,
578 },
579};
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700580static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
581 {
582 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
583 .dst = MSM_BUS_SLAVE_EBI_CH0,
584 .ab = 222298112,
585 .ib = 3522000000U,
586 },
587 {
588 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
589 .dst = MSM_BUS_SLAVE_EBI_CH0,
590 .ab = 330301440,
591 .ib = 3522000000U,
592 },
593 {
594 .src = MSM_BUS_MASTER_AMPSS_M0,
595 .dst = MSM_BUS_SLAVE_EBI_CH0,
596 .ab = 2500000,
597 .ib = 700000000,
598 },
599 {
600 .src = MSM_BUS_MASTER_AMPSS_M0,
601 .dst = MSM_BUS_SLAVE_EBI_CH0,
602 .ab = 2500000,
603 .ib = 10000000,
604 },
605};
606static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
607 {
608 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
609 .dst = MSM_BUS_SLAVE_EBI_CH0,
610 .ab = 222298112,
611 .ib = 3522000000U,
612 },
613 {
614 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
615 .dst = MSM_BUS_SLAVE_EBI_CH0,
616 .ab = 330301440,
617 .ib = 3522000000U,
618 },
619 {
620 .src = MSM_BUS_MASTER_AMPSS_M0,
621 .dst = MSM_BUS_SLAVE_EBI_CH0,
622 .ab = 2500000,
623 .ib = 700000000,
624 },
625 {
626 .src = MSM_BUS_MASTER_AMPSS_M0,
627 .dst = MSM_BUS_SLAVE_EBI_CH0,
628 .ab = 2500000,
629 .ib = 10000000,
630 },
631};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700632
633static struct msm_bus_paths vidc_bus_client_config[] = {
634 {
635 ARRAY_SIZE(vidc_init_vectors),
636 vidc_init_vectors,
637 },
638 {
639 ARRAY_SIZE(vidc_venc_vga_vectors),
640 vidc_venc_vga_vectors,
641 },
642 {
643 ARRAY_SIZE(vidc_vdec_vga_vectors),
644 vidc_vdec_vga_vectors,
645 },
646 {
647 ARRAY_SIZE(vidc_venc_720p_vectors),
648 vidc_venc_720p_vectors,
649 },
650 {
651 ARRAY_SIZE(vidc_vdec_720p_vectors),
652 vidc_vdec_720p_vectors,
653 },
654 {
655 ARRAY_SIZE(vidc_venc_1080p_vectors),
656 vidc_venc_1080p_vectors,
657 },
658 {
659 ARRAY_SIZE(vidc_vdec_1080p_vectors),
660 vidc_vdec_1080p_vectors,
661 },
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700662 {
663 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
664 vidc_vdec_1080p_turbo_vectors,
665 },
666 {
667 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
668 vidc_vdec_1080p_turbo_vectors,
669 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700670};
671
672static struct msm_bus_scale_pdata vidc_bus_client_data = {
673 vidc_bus_client_config,
674 ARRAY_SIZE(vidc_bus_client_config),
675 .name = "vidc",
676};
677#endif
678
Mona Hossain9c430e32011-07-27 11:04:47 -0700679#ifdef CONFIG_HW_RANDOM_MSM
680/* PRNG device */
681#define MSM_PRNG_PHYS 0x1A500000
682static struct resource rng_resources = {
683 .flags = IORESOURCE_MEM,
684 .start = MSM_PRNG_PHYS,
685 .end = MSM_PRNG_PHYS + SZ_512 - 1,
686};
687
688struct platform_device msm_device_rng = {
689 .name = "msm_rng",
690 .id = 0,
691 .num_resources = 1,
692 .resource = &rng_resources,
693};
694#endif
695
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700696#define MSM_VIDC_BASE_PHYS 0x04400000
697#define MSM_VIDC_BASE_SIZE 0x00100000
698
699static struct resource msm_device_vidc_resources[] = {
700 {
701 .start = MSM_VIDC_BASE_PHYS,
702 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
703 .flags = IORESOURCE_MEM,
704 },
705 {
706 .start = VCODEC_IRQ,
707 .end = VCODEC_IRQ,
708 .flags = IORESOURCE_IRQ,
709 },
710};
711
712struct msm_vidc_platform_data vidc_platform_data = {
713#ifdef CONFIG_MSM_BUS_SCALING
714 .vidc_bus_client_pdata = &vidc_bus_client_data,
715#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -0700716#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -0800717 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700718 .enable_ion = 1,
Deepak kotur5f10b272012-03-15 22:01:39 -0700719 .cp_enabled = 1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700720#else
Deepak Kotur12301a72011-11-09 18:30:29 -0800721 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700722 .enable_ion = 0,
723#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800724 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +0530725 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -0800726 .cont_mode_dpb_count = 18,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700727};
728
729struct platform_device msm_device_vidc = {
730 .name = "msm_vidc",
731 .id = 0,
732 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
733 .resource = msm_device_vidc_resources,
734 .dev = {
735 .platform_data = &vidc_platform_data,
736 },
737};
738
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700739#define MSM_SDC1_BASE 0x12400000
740#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
741#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
742#define MSM_SDC2_BASE 0x12140000
743#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
744#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700745#define MSM_SDC3_BASE 0x12180000
746#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
747#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
748#define MSM_SDC4_BASE 0x121C0000
749#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
750#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
751#define MSM_SDC5_BASE 0x12200000
752#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
753#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
754
755static struct resource resources_sdc1[] = {
756 {
757 .name = "core_mem",
758 .flags = IORESOURCE_MEM,
759 .start = MSM_SDC1_BASE,
760 .end = MSM_SDC1_DML_BASE - 1,
761 },
762 {
763 .name = "core_irq",
764 .flags = IORESOURCE_IRQ,
765 .start = SDC1_IRQ_0,
766 .end = SDC1_IRQ_0
767 },
768#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
769 {
770 .name = "sdcc_dml_addr",
771 .start = MSM_SDC1_DML_BASE,
772 .end = MSM_SDC1_BAM_BASE - 1,
773 .flags = IORESOURCE_MEM,
774 },
775 {
776 .name = "sdcc_bam_addr",
777 .start = MSM_SDC1_BAM_BASE,
778 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
779 .flags = IORESOURCE_MEM,
780 },
781 {
782 .name = "sdcc_bam_irq",
783 .start = SDC1_BAM_IRQ,
784 .end = SDC1_BAM_IRQ,
785 .flags = IORESOURCE_IRQ,
786 },
787#endif
788};
789
790static struct resource resources_sdc2[] = {
791 {
792 .name = "core_mem",
793 .flags = IORESOURCE_MEM,
794 .start = MSM_SDC2_BASE,
795 .end = MSM_SDC2_DML_BASE - 1,
796 },
797 {
798 .name = "core_irq",
799 .flags = IORESOURCE_IRQ,
800 .start = SDC2_IRQ_0,
801 .end = SDC2_IRQ_0
802 },
803#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
804 {
805 .name = "sdcc_dml_addr",
806 .start = MSM_SDC2_DML_BASE,
807 .end = MSM_SDC2_BAM_BASE - 1,
808 .flags = IORESOURCE_MEM,
809 },
810 {
811 .name = "sdcc_bam_addr",
812 .start = MSM_SDC2_BAM_BASE,
813 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
814 .flags = IORESOURCE_MEM,
815 },
816 {
817 .name = "sdcc_bam_irq",
818 .start = SDC2_BAM_IRQ,
819 .end = SDC2_BAM_IRQ,
820 .flags = IORESOURCE_IRQ,
821 },
822#endif
823};
824
825static struct resource resources_sdc3[] = {
826 {
827 .name = "core_mem",
828 .flags = IORESOURCE_MEM,
829 .start = MSM_SDC3_BASE,
830 .end = MSM_SDC3_DML_BASE - 1,
831 },
832 {
833 .name = "core_irq",
834 .flags = IORESOURCE_IRQ,
835 .start = SDC3_IRQ_0,
836 .end = SDC3_IRQ_0
837 },
838#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
839 {
840 .name = "sdcc_dml_addr",
841 .start = MSM_SDC3_DML_BASE,
842 .end = MSM_SDC3_BAM_BASE - 1,
843 .flags = IORESOURCE_MEM,
844 },
845 {
846 .name = "sdcc_bam_addr",
847 .start = MSM_SDC3_BAM_BASE,
848 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
849 .flags = IORESOURCE_MEM,
850 },
851 {
852 .name = "sdcc_bam_irq",
853 .start = SDC3_BAM_IRQ,
854 .end = SDC3_BAM_IRQ,
855 .flags = IORESOURCE_IRQ,
856 },
857#endif
858};
859
860static struct resource resources_sdc4[] = {
861 {
862 .name = "core_mem",
863 .flags = IORESOURCE_MEM,
864 .start = MSM_SDC4_BASE,
865 .end = MSM_SDC4_DML_BASE - 1,
866 },
867 {
868 .name = "core_irq",
869 .flags = IORESOURCE_IRQ,
870 .start = SDC4_IRQ_0,
871 .end = SDC4_IRQ_0
872 },
873#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
874 {
875 .name = "sdcc_dml_addr",
876 .start = MSM_SDC4_DML_BASE,
877 .end = MSM_SDC4_BAM_BASE - 1,
878 .flags = IORESOURCE_MEM,
879 },
880 {
881 .name = "sdcc_bam_addr",
882 .start = MSM_SDC4_BAM_BASE,
883 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
884 .flags = IORESOURCE_MEM,
885 },
886 {
887 .name = "sdcc_bam_irq",
888 .start = SDC4_BAM_IRQ,
889 .end = SDC4_BAM_IRQ,
890 .flags = IORESOURCE_IRQ,
891 },
892#endif
893};
894
895static struct resource resources_sdc5[] = {
896 {
897 .name = "core_mem",
898 .flags = IORESOURCE_MEM,
899 .start = MSM_SDC5_BASE,
900 .end = MSM_SDC5_DML_BASE - 1,
901 },
902 {
903 .name = "core_irq",
904 .flags = IORESOURCE_IRQ,
905 .start = SDC5_IRQ_0,
906 .end = SDC5_IRQ_0
907 },
908#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
909 {
910 .name = "sdcc_dml_addr",
911 .start = MSM_SDC5_DML_BASE,
912 .end = MSM_SDC5_BAM_BASE - 1,
913 .flags = IORESOURCE_MEM,
914 },
915 {
916 .name = "sdcc_bam_addr",
917 .start = MSM_SDC5_BAM_BASE,
918 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
919 .flags = IORESOURCE_MEM,
920 },
921 {
922 .name = "sdcc_bam_irq",
923 .start = SDC5_BAM_IRQ,
924 .end = SDC5_BAM_IRQ,
925 .flags = IORESOURCE_IRQ,
926 },
927#endif
928};
929
930struct platform_device msm_device_sdc1 = {
931 .name = "msm_sdcc",
932 .id = 1,
933 .num_resources = ARRAY_SIZE(resources_sdc1),
934 .resource = resources_sdc1,
935 .dev = {
936 .coherent_dma_mask = 0xffffffff,
937 },
938};
939
940struct platform_device msm_device_sdc2 = {
941 .name = "msm_sdcc",
942 .id = 2,
943 .num_resources = ARRAY_SIZE(resources_sdc2),
944 .resource = resources_sdc2,
945 .dev = {
946 .coherent_dma_mask = 0xffffffff,
947 },
948};
949
950struct platform_device msm_device_sdc3 = {
951 .name = "msm_sdcc",
952 .id = 3,
953 .num_resources = ARRAY_SIZE(resources_sdc3),
954 .resource = resources_sdc3,
955 .dev = {
956 .coherent_dma_mask = 0xffffffff,
957 },
958};
959
960struct platform_device msm_device_sdc4 = {
961 .name = "msm_sdcc",
962 .id = 4,
963 .num_resources = ARRAY_SIZE(resources_sdc4),
964 .resource = resources_sdc4,
965 .dev = {
966 .coherent_dma_mask = 0xffffffff,
967 },
968};
969
970struct platform_device msm_device_sdc5 = {
971 .name = "msm_sdcc",
972 .id = 5,
973 .num_resources = ARRAY_SIZE(resources_sdc5),
974 .resource = resources_sdc5,
975 .dev = {
976 .coherent_dma_mask = 0xffffffff,
977 },
978};
979
Stephen Boydeb819882011-08-29 14:46:30 -0700980#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
981#define SFAB_LPASS_Q6_ACLK_CTL (MSM_CLK_CTL_BASE + 0x23A0)
982
983static struct resource msm_8960_q6_lpass_resources[] = {
984 {
985 .start = MSM_LPASS_QDSP6SS_PHYS,
986 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
987 .flags = IORESOURCE_MEM,
988 },
989};
990
991static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
992 .strap_tcm_base = 0x01460000,
993 .strap_ahb_upper = 0x00290000,
994 .strap_ahb_lower = 0x00000280,
995 .aclk_reg = SFAB_LPASS_Q6_ACLK_CTL,
996 .name = "q6",
997 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700998 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700999};
1000
1001struct platform_device msm_8960_q6_lpass = {
1002 .name = "pil_qdsp6v4",
1003 .id = 0,
1004 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
1005 .resource = msm_8960_q6_lpass_resources,
1006 .dev.platform_data = &msm_8960_q6_lpass_data,
1007};
1008
1009#define MSM_MSS_ENABLE_PHYS 0x08B00000
1010#define MSM_FW_QDSP6SS_PHYS 0x08800000
1011#define MSS_Q6FW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C6C)
1012#define SFAB_MSS_Q6_FW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2044)
1013
1014static struct resource msm_8960_q6_mss_fw_resources[] = {
1015 {
1016 .start = MSM_FW_QDSP6SS_PHYS,
1017 .end = MSM_FW_QDSP6SS_PHYS + SZ_256 - 1,
1018 .flags = IORESOURCE_MEM,
1019 },
1020 {
1021 .start = MSM_MSS_ENABLE_PHYS,
1022 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
1023 .flags = IORESOURCE_MEM,
1024 },
1025};
1026
1027static struct pil_q6v4_pdata msm_8960_q6_mss_fw_data = {
1028 .strap_tcm_base = 0x00400000,
1029 .strap_ahb_upper = 0x00090000,
1030 .strap_ahb_lower = 0x00000080,
1031 .aclk_reg = SFAB_MSS_Q6_FW_ACLK_CTL,
1032 .jtag_clk_reg = MSS_Q6FW_JTAG_CLK_CTL,
1033 .name = "modem_fw",
1034 .depends = "q6",
1035 .pas_id = PAS_MODEM_FW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -07001036 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001037};
1038
1039struct platform_device msm_8960_q6_mss_fw = {
1040 .name = "pil_qdsp6v4",
1041 .id = 1,
1042 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_fw_resources),
1043 .resource = msm_8960_q6_mss_fw_resources,
1044 .dev.platform_data = &msm_8960_q6_mss_fw_data,
1045};
1046
1047#define MSM_SW_QDSP6SS_PHYS 0x08900000
1048#define SFAB_MSS_Q6_SW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2040)
1049#define MSS_Q6SW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C68)
1050
1051static struct resource msm_8960_q6_mss_sw_resources[] = {
1052 {
1053 .start = MSM_SW_QDSP6SS_PHYS,
1054 .end = MSM_SW_QDSP6SS_PHYS + SZ_256 - 1,
1055 .flags = IORESOURCE_MEM,
1056 },
1057 {
1058 .start = MSM_MSS_ENABLE_PHYS,
1059 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
1060 .flags = IORESOURCE_MEM,
1061 },
1062};
1063
1064static struct pil_q6v4_pdata msm_8960_q6_mss_sw_data = {
1065 .strap_tcm_base = 0x00420000,
1066 .strap_ahb_upper = 0x00090000,
1067 .strap_ahb_lower = 0x00000080,
1068 .aclk_reg = SFAB_MSS_Q6_SW_ACLK_CTL,
1069 .jtag_clk_reg = MSS_Q6SW_JTAG_CLK_CTL,
1070 .name = "modem",
1071 .depends = "modem_fw",
1072 .pas_id = PAS_MODEM_SW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -07001073 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001074};
1075
1076struct platform_device msm_8960_q6_mss_sw = {
1077 .name = "pil_qdsp6v4",
1078 .id = 2,
1079 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_sw_resources),
1080 .resource = msm_8960_q6_mss_sw_resources,
1081 .dev.platform_data = &msm_8960_q6_mss_sw_data,
1082};
1083
Stephen Boyd322a9922011-09-20 01:05:54 -07001084static struct resource msm_8960_riva_resources[] = {
1085 {
1086 .start = 0x03204000,
1087 .end = 0x03204000 + SZ_256 - 1,
1088 .flags = IORESOURCE_MEM,
1089 },
1090};
1091
1092struct platform_device msm_8960_riva = {
1093 .name = "pil_riva",
1094 .id = -1,
1095 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
1096 .resource = msm_8960_riva_resources,
1097};
1098
Stephen Boydd89eebe2011-09-28 23:28:11 -07001099struct platform_device msm_pil_tzapps = {
1100 .name = "pil_tzapps",
1101 .id = -1,
1102};
1103
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001104struct platform_device msm_pil_dsps = {
1105 .name = "pil_dsps",
1106 .id = -1,
1107 .dev.platform_data = "dsps",
1108};
1109
Stephen Boyd7b973de2012-03-09 12:26:16 -08001110struct platform_device msm_pil_vidc = {
1111 .name = "pil_vidc",
1112 .id = -1,
1113};
1114
Eric Holmberg023d25c2012-03-01 12:27:55 -07001115static struct resource smd_resource[] = {
1116 {
1117 .name = "a9_m2a_0",
1118 .start = INT_A9_M2A_0,
1119 .flags = IORESOURCE_IRQ,
1120 },
1121 {
1122 .name = "a9_m2a_5",
1123 .start = INT_A9_M2A_5,
1124 .flags = IORESOURCE_IRQ,
1125 },
1126 {
1127 .name = "adsp_a11",
1128 .start = INT_ADSP_A11,
1129 .flags = IORESOURCE_IRQ,
1130 },
1131 {
1132 .name = "adsp_a11_smsm",
1133 .start = INT_ADSP_A11_SMSM,
1134 .flags = IORESOURCE_IRQ,
1135 },
1136 {
1137 .name = "dsps_a11",
1138 .start = INT_DSPS_A11,
1139 .flags = IORESOURCE_IRQ,
1140 },
1141 {
1142 .name = "dsps_a11_smsm",
1143 .start = INT_DSPS_A11_SMSM,
1144 .flags = IORESOURCE_IRQ,
1145 },
1146 {
1147 .name = "wcnss_a11",
1148 .start = INT_WCNSS_A11,
1149 .flags = IORESOURCE_IRQ,
1150 },
1151 {
1152 .name = "wcnss_a11_smsm",
1153 .start = INT_WCNSS_A11_SMSM,
1154 .flags = IORESOURCE_IRQ,
1155 },
1156};
1157
1158static struct smd_subsystem_config smd_config_list[] = {
1159 {
1160 .irq_config_id = SMD_MODEM,
1161 .subsys_name = "modem",
1162 .edge = SMD_APPS_MODEM,
1163
1164 .smd_int.irq_name = "a9_m2a_0",
1165 .smd_int.flags = IRQF_TRIGGER_RISING,
1166 .smd_int.irq_id = -1,
1167 .smd_int.device_name = "smd_dev",
1168 .smd_int.dev_id = 0,
1169 .smd_int.out_bit_pos = 1 << 3,
1170 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1171 .smd_int.out_offset = 0x8,
1172
1173 .smsm_int.irq_name = "a9_m2a_5",
1174 .smsm_int.flags = IRQF_TRIGGER_RISING,
1175 .smsm_int.irq_id = -1,
1176 .smsm_int.device_name = "smd_smsm",
1177 .smsm_int.dev_id = 0,
1178 .smsm_int.out_bit_pos = 1 << 4,
1179 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1180 .smsm_int.out_offset = 0x8,
1181 },
1182 {
1183 .irq_config_id = SMD_Q6,
1184 .subsys_name = "q6",
1185 .edge = SMD_APPS_QDSP,
1186
1187 .smd_int.irq_name = "adsp_a11",
1188 .smd_int.flags = IRQF_TRIGGER_RISING,
1189 .smd_int.irq_id = -1,
1190 .smd_int.device_name = "smd_dev",
1191 .smd_int.dev_id = 0,
1192 .smd_int.out_bit_pos = 1 << 15,
1193 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1194 .smd_int.out_offset = 0x8,
1195
1196 .smsm_int.irq_name = "adsp_a11_smsm",
1197 .smsm_int.flags = IRQF_TRIGGER_RISING,
1198 .smsm_int.irq_id = -1,
1199 .smsm_int.device_name = "smd_smsm",
1200 .smsm_int.dev_id = 0,
1201 .smsm_int.out_bit_pos = 1 << 14,
1202 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1203 .smsm_int.out_offset = 0x8,
1204 },
1205 {
1206 .irq_config_id = SMD_DSPS,
1207 .subsys_name = "dsps",
1208 .edge = SMD_APPS_DSPS,
1209
1210 .smd_int.irq_name = "dsps_a11",
1211 .smd_int.flags = IRQF_TRIGGER_RISING,
1212 .smd_int.irq_id = -1,
1213 .smd_int.device_name = "smd_dev",
1214 .smd_int.dev_id = 0,
1215 .smd_int.out_bit_pos = 1,
1216 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1217 .smd_int.out_offset = 0x4080,
1218
1219 .smsm_int.irq_name = "dsps_a11_smsm",
1220 .smsm_int.flags = IRQF_TRIGGER_RISING,
1221 .smsm_int.irq_id = -1,
1222 .smsm_int.device_name = "smd_smsm",
1223 .smsm_int.dev_id = 0,
1224 .smsm_int.out_bit_pos = 1,
1225 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1226 .smsm_int.out_offset = 0x4094,
1227 },
1228 {
1229 .irq_config_id = SMD_WCNSS,
1230 .subsys_name = "wcnss",
1231 .edge = SMD_APPS_WCNSS,
1232
1233 .smd_int.irq_name = "wcnss_a11",
1234 .smd_int.flags = IRQF_TRIGGER_RISING,
1235 .smd_int.irq_id = -1,
1236 .smd_int.device_name = "smd_dev",
1237 .smd_int.dev_id = 0,
1238 .smd_int.out_bit_pos = 1 << 25,
1239 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1240 .smd_int.out_offset = 0x8,
1241
1242 .smsm_int.irq_name = "wcnss_a11_smsm",
1243 .smsm_int.flags = IRQF_TRIGGER_RISING,
1244 .smsm_int.irq_id = -1,
1245 .smsm_int.device_name = "smd_smsm",
1246 .smsm_int.dev_id = 0,
1247 .smsm_int.out_bit_pos = 1 << 23,
1248 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1249 .smsm_int.out_offset = 0x8,
1250 },
1251};
1252
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001253static struct smd_subsystem_restart_config smd_ssr_config = {
1254 .disable_smsm_reset_handshake = 1,
1255};
1256
Eric Holmberg023d25c2012-03-01 12:27:55 -07001257static struct smd_platform smd_platform_data = {
1258 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1259 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001260 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001261};
1262
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001263struct platform_device msm_device_smd = {
1264 .name = "msm_smd",
1265 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001266 .resource = smd_resource,
1267 .num_resources = ARRAY_SIZE(smd_resource),
1268 .dev = {
1269 .platform_data = &smd_platform_data,
1270 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001271};
1272
1273struct platform_device msm_device_bam_dmux = {
1274 .name = "BAM_RMNT",
1275 .id = -1,
1276};
1277
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001278static struct msm_watchdog_pdata msm_watchdog_pdata = {
1279 .pet_time = 10000,
1280 .bark_time = 11000,
1281 .has_secure = true,
1282};
1283
1284struct platform_device msm8960_device_watchdog = {
1285 .name = "msm_watchdog",
1286 .id = -1,
1287 .dev = {
1288 .platform_data = &msm_watchdog_pdata,
1289 },
1290};
1291
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001292static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001293 {
1294 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001295 .flags = IORESOURCE_IRQ,
1296 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001297 {
1298 .start = 0x18320000,
1299 .end = 0x18320000 + SZ_1M - 1,
1300 .flags = IORESOURCE_MEM,
1301 },
1302};
1303
1304static struct msm_dmov_pdata msm_dmov_pdata = {
1305 .sd = 1,
1306 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001307};
1308
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001309struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001310 .name = "msm_dmov",
1311 .id = -1,
1312 .resource = msm_dmov_resource,
1313 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001314 .dev = {
1315 .platform_data = &msm_dmov_pdata,
1316 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001317};
1318
1319static struct platform_device *msm_sdcc_devices[] __initdata = {
1320 &msm_device_sdc1,
1321 &msm_device_sdc2,
1322 &msm_device_sdc3,
1323 &msm_device_sdc4,
1324 &msm_device_sdc5,
1325};
1326
1327int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1328{
1329 struct platform_device *pdev;
1330
1331 if (controller < 1 || controller > 5)
1332 return -EINVAL;
1333
1334 pdev = msm_sdcc_devices[controller-1];
1335 pdev->dev.platform_data = plat;
1336 return platform_device_register(pdev);
1337}
1338
1339static struct resource resources_qup_i2c_gsbi4[] = {
1340 {
1341 .name = "gsbi_qup_i2c_addr",
1342 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001343 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001344 .flags = IORESOURCE_MEM,
1345 },
1346 {
1347 .name = "qup_phys_addr",
1348 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001349 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001350 .flags = IORESOURCE_MEM,
1351 },
1352 {
1353 .name = "qup_err_intr",
1354 .start = GSBI4_QUP_IRQ,
1355 .end = GSBI4_QUP_IRQ,
1356 .flags = IORESOURCE_IRQ,
1357 },
1358};
1359
1360struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1361 .name = "qup_i2c",
1362 .id = 4,
1363 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1364 .resource = resources_qup_i2c_gsbi4,
1365};
1366
1367static struct resource resources_qup_i2c_gsbi3[] = {
1368 {
1369 .name = "gsbi_qup_i2c_addr",
1370 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001371 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001372 .flags = IORESOURCE_MEM,
1373 },
1374 {
1375 .name = "qup_phys_addr",
1376 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001377 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001378 .flags = IORESOURCE_MEM,
1379 },
1380 {
1381 .name = "qup_err_intr",
1382 .start = GSBI3_QUP_IRQ,
1383 .end = GSBI3_QUP_IRQ,
1384 .flags = IORESOURCE_IRQ,
1385 },
1386};
1387
1388struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1389 .name = "qup_i2c",
1390 .id = 3,
1391 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1392 .resource = resources_qup_i2c_gsbi3,
1393};
1394
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06001395static struct resource resources_qup_i2c_gsbi9[] = {
1396 {
1397 .name = "gsbi_qup_i2c_addr",
1398 .start = MSM_GSBI9_PHYS,
1399 .end = MSM_GSBI9_PHYS + 4 - 1,
1400 .flags = IORESOURCE_MEM,
1401 },
1402 {
1403 .name = "qup_phys_addr",
1404 .start = MSM_GSBI9_QUP_PHYS,
1405 .end = MSM_GSBI9_QUP_PHYS + MSM_QUP_SIZE - 1,
1406 .flags = IORESOURCE_MEM,
1407 },
1408 {
1409 .name = "qup_err_intr",
1410 .start = GSBI9_QUP_IRQ,
1411 .end = GSBI9_QUP_IRQ,
1412 .flags = IORESOURCE_IRQ,
1413 },
1414};
1415
1416struct platform_device msm8960_device_qup_i2c_gsbi9 = {
1417 .name = "qup_i2c",
1418 .id = 0,
1419 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi9),
1420 .resource = resources_qup_i2c_gsbi9,
1421};
1422
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001423static struct resource resources_qup_i2c_gsbi10[] = {
1424 {
1425 .name = "gsbi_qup_i2c_addr",
1426 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001427 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001428 .flags = IORESOURCE_MEM,
1429 },
1430 {
1431 .name = "qup_phys_addr",
1432 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001433 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001434 .flags = IORESOURCE_MEM,
1435 },
1436 {
1437 .name = "qup_err_intr",
1438 .start = GSBI10_QUP_IRQ,
1439 .end = GSBI10_QUP_IRQ,
1440 .flags = IORESOURCE_IRQ,
1441 },
1442};
1443
1444struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1445 .name = "qup_i2c",
1446 .id = 10,
1447 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1448 .resource = resources_qup_i2c_gsbi10,
1449};
1450
1451static struct resource resources_qup_i2c_gsbi12[] = {
1452 {
1453 .name = "gsbi_qup_i2c_addr",
1454 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001455 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001456 .flags = IORESOURCE_MEM,
1457 },
1458 {
1459 .name = "qup_phys_addr",
1460 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001461 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001462 .flags = IORESOURCE_MEM,
1463 },
1464 {
1465 .name = "qup_err_intr",
1466 .start = GSBI12_QUP_IRQ,
1467 .end = GSBI12_QUP_IRQ,
1468 .flags = IORESOURCE_IRQ,
1469 },
1470};
1471
1472struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1473 .name = "qup_i2c",
1474 .id = 12,
1475 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1476 .resource = resources_qup_i2c_gsbi12,
1477};
1478
1479#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001480static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001481 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001482 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301483 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001484 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301485 .flags = IORESOURCE_MEM,
1486 },
1487 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001488 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301489 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001490 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301491 .flags = IORESOURCE_MEM,
1492 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001493};
1494
Kevin Chanbb8ef862012-02-14 13:03:04 -08001495struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1496 .name = "msm_cam_i2c_mux",
1497 .id = 0,
1498 .resource = msm_cam_gsbi4_i2c_mux_resources,
1499 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1500};
Kevin Chanf6216f22011-10-25 18:40:11 -07001501
1502static struct resource msm_csiphy0_resources[] = {
1503 {
1504 .name = "csiphy",
1505 .start = 0x04800C00,
1506 .end = 0x04800C00 + SZ_1K - 1,
1507 .flags = IORESOURCE_MEM,
1508 },
1509 {
1510 .name = "csiphy",
1511 .start = CSIPHY_4LN_IRQ,
1512 .end = CSIPHY_4LN_IRQ,
1513 .flags = IORESOURCE_IRQ,
1514 },
1515};
1516
1517static struct resource msm_csiphy1_resources[] = {
1518 {
1519 .name = "csiphy",
1520 .start = 0x04801000,
1521 .end = 0x04801000 + SZ_1K - 1,
1522 .flags = IORESOURCE_MEM,
1523 },
1524 {
1525 .name = "csiphy",
1526 .start = MSM8960_CSIPHY_2LN_IRQ,
1527 .end = MSM8960_CSIPHY_2LN_IRQ,
1528 .flags = IORESOURCE_IRQ,
1529 },
1530};
1531
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001532static struct resource msm_csiphy2_resources[] = {
1533 {
1534 .name = "csiphy",
1535 .start = 0x04801400,
1536 .end = 0x04801400 + SZ_1K - 1,
1537 .flags = IORESOURCE_MEM,
1538 },
1539 {
1540 .name = "csiphy",
1541 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1542 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1543 .flags = IORESOURCE_IRQ,
1544 },
1545};
1546
Kevin Chanf6216f22011-10-25 18:40:11 -07001547struct platform_device msm8960_device_csiphy0 = {
1548 .name = "msm_csiphy",
1549 .id = 0,
1550 .resource = msm_csiphy0_resources,
1551 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
1552};
1553
1554struct platform_device msm8960_device_csiphy1 = {
1555 .name = "msm_csiphy",
1556 .id = 1,
1557 .resource = msm_csiphy1_resources,
1558 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
1559};
Kevin Chanc8b52e82011-10-25 23:20:21 -07001560
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001561struct platform_device msm8960_device_csiphy2 = {
1562 .name = "msm_csiphy",
1563 .id = 2,
1564 .resource = msm_csiphy2_resources,
1565 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
1566};
1567
Kevin Chanc8b52e82011-10-25 23:20:21 -07001568static struct resource msm_csid0_resources[] = {
1569 {
1570 .name = "csid",
1571 .start = 0x04800000,
1572 .end = 0x04800000 + SZ_1K - 1,
1573 .flags = IORESOURCE_MEM,
1574 },
1575 {
1576 .name = "csid",
1577 .start = CSI_0_IRQ,
1578 .end = CSI_0_IRQ,
1579 .flags = IORESOURCE_IRQ,
1580 },
1581};
1582
1583static struct resource msm_csid1_resources[] = {
1584 {
1585 .name = "csid",
1586 .start = 0x04800400,
1587 .end = 0x04800400 + SZ_1K - 1,
1588 .flags = IORESOURCE_MEM,
1589 },
1590 {
1591 .name = "csid",
1592 .start = CSI_1_IRQ,
1593 .end = CSI_1_IRQ,
1594 .flags = IORESOURCE_IRQ,
1595 },
1596};
1597
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001598static struct resource msm_csid2_resources[] = {
1599 {
1600 .name = "csid",
1601 .start = 0x04801800,
1602 .end = 0x04801800 + SZ_1K - 1,
1603 .flags = IORESOURCE_MEM,
1604 },
1605 {
1606 .name = "csid",
1607 .start = CSI_2_IRQ,
1608 .end = CSI_2_IRQ,
1609 .flags = IORESOURCE_IRQ,
1610 },
1611};
1612
Kevin Chanc8b52e82011-10-25 23:20:21 -07001613struct platform_device msm8960_device_csid0 = {
1614 .name = "msm_csid",
1615 .id = 0,
1616 .resource = msm_csid0_resources,
1617 .num_resources = ARRAY_SIZE(msm_csid0_resources),
1618};
1619
1620struct platform_device msm8960_device_csid1 = {
1621 .name = "msm_csid",
1622 .id = 1,
1623 .resource = msm_csid1_resources,
1624 .num_resources = ARRAY_SIZE(msm_csid1_resources),
1625};
Kevin Chane12c6672011-10-26 11:55:26 -07001626
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001627struct platform_device msm8960_device_csid2 = {
1628 .name = "msm_csid",
1629 .id = 2,
1630 .resource = msm_csid2_resources,
1631 .num_resources = ARRAY_SIZE(msm_csid2_resources),
1632};
1633
Kevin Chane12c6672011-10-26 11:55:26 -07001634struct resource msm_ispif_resources[] = {
1635 {
1636 .name = "ispif",
1637 .start = 0x04800800,
1638 .end = 0x04800800 + SZ_1K - 1,
1639 .flags = IORESOURCE_MEM,
1640 },
1641 {
1642 .name = "ispif",
1643 .start = ISPIF_IRQ,
1644 .end = ISPIF_IRQ,
1645 .flags = IORESOURCE_IRQ,
1646 },
1647};
1648
1649struct platform_device msm8960_device_ispif = {
1650 .name = "msm_ispif",
1651 .id = 0,
1652 .resource = msm_ispif_resources,
1653 .num_resources = ARRAY_SIZE(msm_ispif_resources),
1654};
Kevin Chan5827c552011-10-28 18:36:32 -07001655
1656static struct resource msm_vfe_resources[] = {
1657 {
1658 .name = "vfe32",
1659 .start = 0x04500000,
1660 .end = 0x04500000 + SZ_1M - 1,
1661 .flags = IORESOURCE_MEM,
1662 },
1663 {
1664 .name = "vfe32",
1665 .start = VFE_IRQ,
1666 .end = VFE_IRQ,
1667 .flags = IORESOURCE_IRQ,
1668 },
1669};
1670
1671struct platform_device msm8960_device_vfe = {
1672 .name = "msm_vfe",
1673 .id = 0,
1674 .resource = msm_vfe_resources,
1675 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1676};
Kevin Chana0853122011-11-07 19:48:44 -08001677
1678static struct resource msm_vpe_resources[] = {
1679 {
1680 .name = "vpe",
1681 .start = 0x05300000,
1682 .end = 0x05300000 + SZ_1M - 1,
1683 .flags = IORESOURCE_MEM,
1684 },
1685 {
1686 .name = "vpe",
1687 .start = VPE_IRQ,
1688 .end = VPE_IRQ,
1689 .flags = IORESOURCE_IRQ,
1690 },
1691};
1692
1693struct platform_device msm8960_device_vpe = {
1694 .name = "msm_vpe",
1695 .id = 0,
1696 .resource = msm_vpe_resources,
1697 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1698};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001699#endif
1700
Joel Nidera1261942011-09-12 16:30:09 +03001701#define MSM_TSIF0_PHYS (0x18200000)
1702#define MSM_TSIF1_PHYS (0x18201000)
1703#define MSM_TSIF_SIZE (0x200)
1704
1705#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
1706 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1707#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
1708 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1709#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
1710 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1711#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
1712 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1713#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
1714 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1715#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
1716 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1717#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
1718 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1719#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
1720 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1721
1722static const struct msm_gpio tsif0_gpios[] = {
1723 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1724 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1725 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1726 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1727};
1728
1729static const struct msm_gpio tsif1_gpios[] = {
1730 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1731 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1732 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1733 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1734};
1735
1736struct msm_tsif_platform_data tsif1_platform_data = {
1737 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1738 .gpios = tsif1_gpios,
1739 .tsif_pclk = "tsif_pclk",
1740 .tsif_ref_clk = "tsif_ref_clk",
1741};
1742
1743struct resource tsif1_resources[] = {
1744 [0] = {
1745 .flags = IORESOURCE_IRQ,
1746 .start = TSIF2_IRQ,
1747 .end = TSIF2_IRQ,
1748 },
1749 [1] = {
1750 .flags = IORESOURCE_MEM,
1751 .start = MSM_TSIF1_PHYS,
1752 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1753 },
1754 [2] = {
1755 .flags = IORESOURCE_DMA,
1756 .start = DMOV_TSIF_CHAN,
1757 .end = DMOV_TSIF_CRCI,
1758 },
1759};
1760
1761struct msm_tsif_platform_data tsif0_platform_data = {
1762 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1763 .gpios = tsif0_gpios,
1764 .tsif_pclk = "tsif_pclk",
1765 .tsif_ref_clk = "tsif_ref_clk",
1766};
1767struct resource tsif0_resources[] = {
1768 [0] = {
1769 .flags = IORESOURCE_IRQ,
1770 .start = TSIF1_IRQ,
1771 .end = TSIF1_IRQ,
1772 },
1773 [1] = {
1774 .flags = IORESOURCE_MEM,
1775 .start = MSM_TSIF0_PHYS,
1776 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1777 },
1778 [2] = {
1779 .flags = IORESOURCE_DMA,
1780 .start = DMOV_TSIF_CHAN,
1781 .end = DMOV_TSIF_CRCI,
1782 },
1783};
1784
1785struct platform_device msm_device_tsif[2] = {
1786 {
1787 .name = "msm_tsif",
1788 .id = 0,
1789 .num_resources = ARRAY_SIZE(tsif0_resources),
1790 .resource = tsif0_resources,
1791 .dev = {
1792 .platform_data = &tsif0_platform_data
1793 },
1794 },
1795 {
1796 .name = "msm_tsif",
1797 .id = 1,
1798 .num_resources = ARRAY_SIZE(tsif1_resources),
1799 .resource = tsif1_resources,
1800 .dev = {
1801 .platform_data = &tsif1_platform_data
1802 },
1803 }
1804};
1805
Jay Chokshi33c044a2011-12-07 13:05:40 -08001806static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001807 {
1808 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1809 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1810 .flags = IORESOURCE_MEM,
1811 },
1812};
1813
Jay Chokshi33c044a2011-12-07 13:05:40 -08001814struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001815 .name = "msm_ssbi",
1816 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08001817 .resource = resources_ssbi_pmic,
1818 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001819};
1820
1821static struct resource resources_qup_spi_gsbi1[] = {
1822 {
1823 .name = "spi_base",
1824 .start = MSM_GSBI1_QUP_PHYS,
1825 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1826 .flags = IORESOURCE_MEM,
1827 },
1828 {
1829 .name = "gsbi_base",
1830 .start = MSM_GSBI1_PHYS,
1831 .end = MSM_GSBI1_PHYS + 4 - 1,
1832 .flags = IORESOURCE_MEM,
1833 },
1834 {
1835 .name = "spi_irq_in",
1836 .start = MSM8960_GSBI1_QUP_IRQ,
1837 .end = MSM8960_GSBI1_QUP_IRQ,
1838 .flags = IORESOURCE_IRQ,
1839 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001840 {
1841 .name = "spi_clk",
1842 .start = 9,
1843 .end = 9,
1844 .flags = IORESOURCE_IO,
1845 },
1846 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001847 .name = "spi_miso",
1848 .start = 7,
1849 .end = 7,
1850 .flags = IORESOURCE_IO,
1851 },
1852 {
1853 .name = "spi_mosi",
1854 .start = 6,
1855 .end = 6,
1856 .flags = IORESOURCE_IO,
1857 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07001858 {
1859 .name = "spi_cs",
1860 .start = 8,
1861 .end = 8,
1862 .flags = IORESOURCE_IO,
1863 },
1864 {
1865 .name = "spi_cs1",
1866 .start = 14,
1867 .end = 14,
1868 .flags = IORESOURCE_IO,
1869 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001870};
1871
1872struct platform_device msm8960_device_qup_spi_gsbi1 = {
1873 .name = "spi_qsd",
1874 .id = 0,
1875 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1876 .resource = resources_qup_spi_gsbi1,
1877};
1878
1879struct platform_device msm_pcm = {
1880 .name = "msm-pcm-dsp",
1881 .id = -1,
1882};
1883
Kiran Kandi5e809b02012-01-31 00:24:33 -08001884struct platform_device msm_multi_ch_pcm = {
1885 .name = "msm-multi-ch-pcm-dsp",
1886 .id = -1,
1887};
1888
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001889struct platform_device msm_pcm_routing = {
1890 .name = "msm-pcm-routing",
1891 .id = -1,
1892};
1893
1894struct platform_device msm_cpudai0 = {
1895 .name = "msm-dai-q6",
1896 .id = 0x4000,
1897};
1898
1899struct platform_device msm_cpudai1 = {
1900 .name = "msm-dai-q6",
1901 .id = 0x4001,
1902};
1903
Kiran Kandi97fe19d2012-05-20 22:34:04 -07001904struct platform_device msm8960_cpudai_slimbus_2_rx = {
1905 .name = "msm-dai-q6",
1906 .id = 0x4004,
1907};
1908
Kiran Kandi1e6371d2012-03-29 11:48:57 -07001909struct platform_device msm8960_cpudai_slimbus_2_tx = {
1910 .name = "msm-dai-q6",
1911 .id = 0x4005,
1912};
1913
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001914struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001915 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001916 .id = 8,
1917};
1918
1919struct platform_device msm_cpudai_bt_rx = {
1920 .name = "msm-dai-q6",
1921 .id = 0x3000,
1922};
1923
1924struct platform_device msm_cpudai_bt_tx = {
1925 .name = "msm-dai-q6",
1926 .id = 0x3001,
1927};
1928
1929struct platform_device msm_cpudai_fm_rx = {
1930 .name = "msm-dai-q6",
1931 .id = 0x3004,
1932};
1933
1934struct platform_device msm_cpudai_fm_tx = {
1935 .name = "msm-dai-q6",
1936 .id = 0x3005,
1937};
1938
Helen Zeng0705a5f2011-10-14 15:29:52 -07001939struct platform_device msm_cpudai_incall_music_rx = {
1940 .name = "msm-dai-q6",
1941 .id = 0x8005,
1942};
1943
Helen Zenge3d716a2011-10-14 16:32:16 -07001944struct platform_device msm_cpudai_incall_record_rx = {
1945 .name = "msm-dai-q6",
1946 .id = 0x8004,
1947};
1948
1949struct platform_device msm_cpudai_incall_record_tx = {
1950 .name = "msm-dai-q6",
1951 .id = 0x8003,
1952};
1953
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001954/*
1955 * Machine specific data for AUX PCM Interface
1956 * which the driver will be unware of.
1957 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001958struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001959 .clk = "pcm_clk",
Kuirong Wang547a9982012-05-04 18:29:11 -07001960 .mode_8k = {
1961 .mode = AFE_PCM_CFG_MODE_PCM,
1962 .sync = AFE_PCM_CFG_SYNC_INT,
1963 .frame = AFE_PCM_CFG_FRM_256BPF,
1964 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1965 .slot = 0,
1966 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1967 .pcm_clk_rate = 2048000,
1968 },
1969 .mode_16k = {
1970 .mode = AFE_PCM_CFG_MODE_PCM,
1971 .sync = AFE_PCM_CFG_SYNC_INT,
1972 .frame = AFE_PCM_CFG_FRM_256BPF,
1973 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1974 .slot = 0,
1975 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1976 .pcm_clk_rate = 4096000,
1977 }
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001978};
1979
1980struct platform_device msm_cpudai_auxpcm_rx = {
1981 .name = "msm-dai-q6",
1982 .id = 2,
1983 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001984 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001985 },
1986};
1987
1988struct platform_device msm_cpudai_auxpcm_tx = {
1989 .name = "msm-dai-q6",
1990 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001991 .dev = {
1992 .platform_data = &auxpcm_pdata,
1993 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001994};
1995
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001996struct platform_device msm_cpu_fe = {
1997 .name = "msm-dai-fe",
1998 .id = -1,
1999};
2000
2001struct platform_device msm_stub_codec = {
2002 .name = "msm-stub-codec",
2003 .id = 1,
2004};
2005
2006struct platform_device msm_voice = {
2007 .name = "msm-pcm-voice",
2008 .id = -1,
2009};
2010
2011struct platform_device msm_voip = {
2012 .name = "msm-voip-dsp",
2013 .id = -1,
2014};
2015
2016struct platform_device msm_lpa_pcm = {
2017 .name = "msm-pcm-lpa",
2018 .id = -1,
2019};
2020
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302021struct platform_device msm_compr_dsp = {
2022 .name = "msm-compr-dsp",
2023 .id = -1,
2024};
2025
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002026struct platform_device msm_pcm_hostless = {
2027 .name = "msm-pcm-hostless",
2028 .id = -1,
2029};
2030
Laxminath Kasamcee1d602011-08-01 19:26:57 +05302031struct platform_device msm_cpudai_afe_01_rx = {
2032 .name = "msm-dai-q6",
2033 .id = 0xE0,
2034};
2035
2036struct platform_device msm_cpudai_afe_01_tx = {
2037 .name = "msm-dai-q6",
2038 .id = 0xF0,
2039};
2040
2041struct platform_device msm_cpudai_afe_02_rx = {
2042 .name = "msm-dai-q6",
2043 .id = 0xF1,
2044};
2045
2046struct platform_device msm_cpudai_afe_02_tx = {
2047 .name = "msm-dai-q6",
2048 .id = 0xE1,
2049};
2050
2051struct platform_device msm_pcm_afe = {
2052 .name = "msm-pcm-afe",
2053 .id = -1,
2054};
2055
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002056static struct fs_driver_data gfx2d0_fs_data = {
2057 .clks = (struct fs_clk_data[]){
2058 { .name = "core_clk" },
2059 { .name = "iface_clk" },
2060 { 0 }
2061 },
2062 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002063};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002064
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002065static struct fs_driver_data gfx2d1_fs_data = {
2066 .clks = (struct fs_clk_data[]){
2067 { .name = "core_clk" },
2068 { .name = "iface_clk" },
2069 { 0 }
2070 },
2071 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2072};
2073
2074static struct fs_driver_data gfx3d_fs_data = {
2075 .clks = (struct fs_clk_data[]){
2076 { .name = "core_clk", .reset_rate = 27000000 },
2077 { .name = "iface_clk" },
2078 { 0 }
2079 },
2080 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2081};
2082
2083static struct fs_driver_data ijpeg_fs_data = {
2084 .clks = (struct fs_clk_data[]){
2085 { .name = "core_clk" },
2086 { .name = "iface_clk" },
2087 { .name = "bus_clk" },
2088 { 0 }
2089 },
2090 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2091};
2092
2093static struct fs_driver_data mdp_fs_data = {
2094 .clks = (struct fs_clk_data[]){
2095 { .name = "core_clk" },
2096 { .name = "iface_clk" },
2097 { .name = "bus_clk" },
2098 { .name = "vsync_clk" },
2099 { .name = "lut_clk" },
2100 { .name = "tv_src_clk" },
2101 { .name = "tv_clk" },
2102 { 0 }
2103 },
2104 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2105 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2106};
2107
2108static struct fs_driver_data rot_fs_data = {
2109 .clks = (struct fs_clk_data[]){
2110 { .name = "core_clk" },
2111 { .name = "iface_clk" },
2112 { .name = "bus_clk" },
2113 { 0 }
2114 },
2115 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2116};
2117
2118static struct fs_driver_data ved_fs_data = {
2119 .clks = (struct fs_clk_data[]){
2120 { .name = "core_clk" },
2121 { .name = "iface_clk" },
2122 { .name = "bus_clk" },
2123 { 0 }
2124 },
2125 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
2126 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
2127};
2128
2129static struct fs_driver_data vfe_fs_data = {
2130 .clks = (struct fs_clk_data[]){
2131 { .name = "core_clk" },
2132 { .name = "iface_clk" },
2133 { .name = "bus_clk" },
2134 { 0 }
2135 },
2136 .bus_port0 = MSM_BUS_MASTER_VFE,
2137};
2138
2139static struct fs_driver_data vpe_fs_data = {
2140 .clks = (struct fs_clk_data[]){
2141 { .name = "core_clk" },
2142 { .name = "iface_clk" },
2143 { .name = "bus_clk" },
2144 { 0 }
2145 },
2146 .bus_port0 = MSM_BUS_MASTER_VPE,
2147};
2148
2149struct platform_device *msm8960_footswitch[] __initdata = {
Matt Wagantalld4aab1e2012-05-03 20:26:56 -07002150 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07002151 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -07002152 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Matt Wagantall5c922112012-05-03 19:25:28 -07002153 FS_8X60(FS_VFE, "fs_vfe", NULL, &vfe_fs_data),
2154 FS_8X60(FS_VPE, "fs_vpe", NULL, &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002155 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
2156 FS_8X60(FS_GFX2D0, "vdd", "kgsl-2d0.0", &gfx2d0_fs_data),
2157 FS_8X60(FS_GFX2D1, "vdd", "kgsl-2d1.1", &gfx2d1_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002158 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002159};
2160unsigned msm8960_num_footswitch __initdata = ARRAY_SIZE(msm8960_footswitch);
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002161
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002162#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002163static struct msm_bus_vectors rotator_init_vectors[] = {
2164 {
2165 .src = MSM_BUS_MASTER_ROTATOR,
2166 .dst = MSM_BUS_SLAVE_EBI_CH0,
2167 .ab = 0,
2168 .ib = 0,
2169 },
2170};
2171
2172static struct msm_bus_vectors rotator_ui_vectors[] = {
2173 {
2174 .src = MSM_BUS_MASTER_ROTATOR,
2175 .dst = MSM_BUS_SLAVE_EBI_CH0,
2176 .ab = (1024 * 600 * 4 * 2 * 60),
2177 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
2178 },
2179};
2180
2181static struct msm_bus_vectors rotator_vga_vectors[] = {
2182 {
2183 .src = MSM_BUS_MASTER_ROTATOR,
2184 .dst = MSM_BUS_SLAVE_EBI_CH0,
2185 .ab = (640 * 480 * 2 * 2 * 30),
2186 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
2187 },
2188};
2189static struct msm_bus_vectors rotator_720p_vectors[] = {
2190 {
2191 .src = MSM_BUS_MASTER_ROTATOR,
2192 .dst = MSM_BUS_SLAVE_EBI_CH0,
2193 .ab = (1280 * 736 * 2 * 2 * 30),
2194 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
2195 },
2196};
2197
2198static struct msm_bus_vectors rotator_1080p_vectors[] = {
2199 {
2200 .src = MSM_BUS_MASTER_ROTATOR,
2201 .dst = MSM_BUS_SLAVE_EBI_CH0,
2202 .ab = (1920 * 1088 * 2 * 2 * 30),
2203 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
2204 },
2205};
2206
2207static struct msm_bus_paths rotator_bus_scale_usecases[] = {
2208 {
2209 ARRAY_SIZE(rotator_init_vectors),
2210 rotator_init_vectors,
2211 },
2212 {
2213 ARRAY_SIZE(rotator_ui_vectors),
2214 rotator_ui_vectors,
2215 },
2216 {
2217 ARRAY_SIZE(rotator_vga_vectors),
2218 rotator_vga_vectors,
2219 },
2220 {
2221 ARRAY_SIZE(rotator_720p_vectors),
2222 rotator_720p_vectors,
2223 },
2224 {
2225 ARRAY_SIZE(rotator_1080p_vectors),
2226 rotator_1080p_vectors,
2227 },
2228};
2229
2230struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2231 rotator_bus_scale_usecases,
2232 ARRAY_SIZE(rotator_bus_scale_usecases),
2233 .name = "rotator",
2234};
2235
2236void __init msm_rotator_update_bus_vectors(unsigned int xres,
2237 unsigned int yres)
2238{
2239 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2240 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2241}
2242
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002243#define ROTATOR_HW_BASE 0x04E00000
2244static struct resource resources_msm_rotator[] = {
2245 {
2246 .start = ROTATOR_HW_BASE,
2247 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2248 .flags = IORESOURCE_MEM,
2249 },
2250 {
2251 .start = ROT_IRQ,
2252 .end = ROT_IRQ,
2253 .flags = IORESOURCE_IRQ,
2254 },
2255};
2256
2257static struct msm_rot_clocks rotator_clocks[] = {
2258 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002259 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002260 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002261 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002262 },
2263 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002264 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002265 .clk_type = ROTATOR_PCLK,
2266 .clk_rate = 0,
2267 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002268};
2269
2270static struct msm_rotator_platform_data rotator_pdata = {
2271 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2272 .hardware_version_number = 0x01020309,
2273 .rotator_clks = rotator_clocks,
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002274#ifdef CONFIG_MSM_BUS_SCALING
2275 .bus_scale_table = &rotator_bus_scale_pdata,
2276#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002277};
2278
2279struct platform_device msm_rotator_device = {
2280 .name = "msm_rotator",
2281 .id = 0,
2282 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2283 .resource = resources_msm_rotator,
2284 .dev = {
2285 .platform_data = &rotator_pdata,
2286 },
2287};
2288#endif
2289
2290#define MIPI_DSI_HW_BASE 0x04700000
2291#define MDP_HW_BASE 0x05100000
2292
2293static struct resource msm_mipi_dsi1_resources[] = {
2294 {
2295 .name = "mipi_dsi",
2296 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002297 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002298 .flags = IORESOURCE_MEM,
2299 },
2300 {
2301 .start = DSI1_IRQ,
2302 .end = DSI1_IRQ,
2303 .flags = IORESOURCE_IRQ,
2304 },
2305};
2306
2307struct platform_device msm_mipi_dsi1_device = {
2308 .name = "mipi_dsi",
2309 .id = 1,
2310 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2311 .resource = msm_mipi_dsi1_resources,
2312};
2313
2314static struct resource msm_mdp_resources[] = {
2315 {
2316 .name = "mdp",
2317 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002318 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002319 .flags = IORESOURCE_MEM,
2320 },
2321 {
2322 .start = MDP_IRQ,
2323 .end = MDP_IRQ,
2324 .flags = IORESOURCE_IRQ,
2325 },
2326};
2327
2328static struct platform_device msm_mdp_device = {
2329 .name = "mdp",
2330 .id = 0,
2331 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2332 .resource = msm_mdp_resources,
2333};
2334
2335static void __init msm_register_device(struct platform_device *pdev, void *data)
2336{
2337 int ret;
2338
2339 pdev->dev.platform_data = data;
2340 ret = platform_device_register(pdev);
2341 if (ret)
2342 dev_err(&pdev->dev,
2343 "%s: platform_device_register() failed = %d\n",
2344 __func__, ret);
2345}
2346
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002347#ifdef CONFIG_MSM_BUS_SCALING
2348static struct platform_device msm_dtv_device = {
2349 .name = "dtv",
2350 .id = 0,
2351};
2352#endif
2353
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002354struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002355 .name = "lvds",
2356 .id = 0,
2357};
2358
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002359void __init msm_fb_register_device(char *name, void *data)
2360{
2361 if (!strncmp(name, "mdp", 3))
2362 msm_register_device(&msm_mdp_device, data);
2363 else if (!strncmp(name, "mipi_dsi", 8))
2364 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002365 else if (!strncmp(name, "lvds", 4))
2366 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002367#ifdef CONFIG_MSM_BUS_SCALING
2368 else if (!strncmp(name, "dtv", 3))
2369 msm_register_device(&msm_dtv_device, data);
2370#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002371 else
2372 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2373}
2374
2375static struct resource resources_sps[] = {
2376 {
2377 .name = "pipe_mem",
2378 .start = 0x12800000,
2379 .end = 0x12800000 + 0x4000 - 1,
2380 .flags = IORESOURCE_MEM,
2381 },
2382 {
2383 .name = "bamdma_dma",
2384 .start = 0x12240000,
2385 .end = 0x12240000 + 0x1000 - 1,
2386 .flags = IORESOURCE_MEM,
2387 },
2388 {
2389 .name = "bamdma_bam",
2390 .start = 0x12244000,
2391 .end = 0x12244000 + 0x4000 - 1,
2392 .flags = IORESOURCE_MEM,
2393 },
2394 {
2395 .name = "bamdma_irq",
2396 .start = SPS_BAM_DMA_IRQ,
2397 .end = SPS_BAM_DMA_IRQ,
2398 .flags = IORESOURCE_IRQ,
2399 },
2400};
2401
2402struct msm_sps_platform_data msm_sps_pdata = {
2403 .bamdma_restricted_pipes = 0x06,
2404};
2405
2406struct platform_device msm_device_sps = {
2407 .name = "msm_sps",
2408 .id = -1,
2409 .num_resources = ARRAY_SIZE(resources_sps),
2410 .resource = resources_sps,
2411 .dev.platform_data = &msm_sps_pdata,
2412};
2413
2414#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002415static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002416 [1] = MSM_GPIO_TO_INT(46),
2417 [2] = MSM_GPIO_TO_INT(150),
2418 [4] = MSM_GPIO_TO_INT(103),
2419 [5] = MSM_GPIO_TO_INT(104),
2420 [6] = MSM_GPIO_TO_INT(105),
2421 [7] = MSM_GPIO_TO_INT(106),
2422 [8] = MSM_GPIO_TO_INT(107),
2423 [9] = MSM_GPIO_TO_INT(7),
2424 [10] = MSM_GPIO_TO_INT(11),
2425 [11] = MSM_GPIO_TO_INT(15),
2426 [12] = MSM_GPIO_TO_INT(19),
2427 [13] = MSM_GPIO_TO_INT(23),
2428 [14] = MSM_GPIO_TO_INT(27),
2429 [15] = MSM_GPIO_TO_INT(31),
2430 [16] = MSM_GPIO_TO_INT(35),
2431 [19] = MSM_GPIO_TO_INT(90),
2432 [20] = MSM_GPIO_TO_INT(92),
2433 [23] = MSM_GPIO_TO_INT(85),
2434 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002435 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002436 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002437 [29] = MSM_GPIO_TO_INT(10),
2438 [30] = MSM_GPIO_TO_INT(102),
2439 [31] = MSM_GPIO_TO_INT(81),
2440 [32] = MSM_GPIO_TO_INT(78),
2441 [33] = MSM_GPIO_TO_INT(94),
2442 [34] = MSM_GPIO_TO_INT(72),
2443 [35] = MSM_GPIO_TO_INT(39),
2444 [36] = MSM_GPIO_TO_INT(43),
2445 [37] = MSM_GPIO_TO_INT(61),
2446 [38] = MSM_GPIO_TO_INT(50),
2447 [39] = MSM_GPIO_TO_INT(42),
2448 [41] = MSM_GPIO_TO_INT(62),
2449 [42] = MSM_GPIO_TO_INT(76),
2450 [43] = MSM_GPIO_TO_INT(75),
2451 [44] = MSM_GPIO_TO_INT(70),
2452 [45] = MSM_GPIO_TO_INT(69),
2453 [46] = MSM_GPIO_TO_INT(67),
2454 [47] = MSM_GPIO_TO_INT(65),
2455 [48] = MSM_GPIO_TO_INT(58),
2456 [49] = MSM_GPIO_TO_INT(54),
2457 [50] = MSM_GPIO_TO_INT(52),
2458 [51] = MSM_GPIO_TO_INT(49),
2459 [52] = MSM_GPIO_TO_INT(40),
2460 [53] = MSM_GPIO_TO_INT(37),
2461 [54] = MSM_GPIO_TO_INT(24),
2462 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002463};
2464
Praveen Chidambaram78499012011-11-01 17:15:17 -06002465static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002466 TLMM_MSM_SUMMARY_IRQ,
2467 RPM_APCC_CPU0_GP_HIGH_IRQ,
2468 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2469 RPM_APCC_CPU0_GP_LOW_IRQ,
2470 RPM_APCC_CPU0_WAKE_UP_IRQ,
2471 RPM_APCC_CPU1_GP_HIGH_IRQ,
2472 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2473 RPM_APCC_CPU1_GP_LOW_IRQ,
2474 RPM_APCC_CPU1_WAKE_UP_IRQ,
2475 MSS_TO_APPS_IRQ_0,
2476 MSS_TO_APPS_IRQ_1,
2477 MSS_TO_APPS_IRQ_2,
2478 MSS_TO_APPS_IRQ_3,
2479 MSS_TO_APPS_IRQ_4,
2480 MSS_TO_APPS_IRQ_5,
2481 MSS_TO_APPS_IRQ_6,
2482 MSS_TO_APPS_IRQ_7,
2483 MSS_TO_APPS_IRQ_8,
2484 MSS_TO_APPS_IRQ_9,
2485 LPASS_SCSS_GP_LOW_IRQ,
2486 LPASS_SCSS_GP_MEDIUM_IRQ,
2487 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002488 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002489 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002490 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002491 RIVA_APPS_WLAN_SMSM_IRQ,
2492 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2493 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002494};
2495
Praveen Chidambaram78499012011-11-01 17:15:17 -06002496struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002497 .irqs_m2a = msm_mpm_irqs_m2a,
2498 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2499 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2500 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2501 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2502 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2503 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2504 .mpm_apps_ipc_val = BIT(1),
2505 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2506
2507};
2508#endif
2509
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002510#define LPASS_SLIMBUS_PHYS 0x28080000
2511#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002512#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002513/* Board info for the slimbus slave device */
2514static struct resource slimbus_res[] = {
2515 {
2516 .start = LPASS_SLIMBUS_PHYS,
2517 .end = LPASS_SLIMBUS_PHYS + 8191,
2518 .flags = IORESOURCE_MEM,
2519 .name = "slimbus_physical",
2520 },
2521 {
2522 .start = LPASS_SLIMBUS_BAM_PHYS,
2523 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2524 .flags = IORESOURCE_MEM,
2525 .name = "slimbus_bam_physical",
2526 },
2527 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002528 .start = LPASS_SLIMBUS_SLEW,
2529 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2530 .flags = IORESOURCE_MEM,
2531 .name = "slimbus_slew_reg",
2532 },
2533 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002534 .start = SLIMBUS0_CORE_EE1_IRQ,
2535 .end = SLIMBUS0_CORE_EE1_IRQ,
2536 .flags = IORESOURCE_IRQ,
2537 .name = "slimbus_irq",
2538 },
2539 {
2540 .start = SLIMBUS0_BAM_EE1_IRQ,
2541 .end = SLIMBUS0_BAM_EE1_IRQ,
2542 .flags = IORESOURCE_IRQ,
2543 .name = "slimbus_bam_irq",
2544 },
2545};
2546
2547struct platform_device msm_slim_ctrl = {
2548 .name = "msm_slim_ctrl",
2549 .id = 1,
2550 .num_resources = ARRAY_SIZE(slimbus_res),
2551 .resource = slimbus_res,
2552 .dev = {
2553 .coherent_dma_mask = 0xffffffffULL,
2554 },
2555};
2556
Lucille Sylvester6e362412011-12-09 16:21:42 -07002557static struct msm_dcvs_freq_entry grp3d_freq[] = {
2558 {0, 0, 333932},
2559 {0, 0, 497532},
2560 {0, 0, 707610},
2561 {0, 0, 844545},
2562};
2563
2564static struct msm_dcvs_freq_entry grp2d_freq[] = {
2565 {0, 0, 86000},
2566 {0, 0, 200000},
2567};
2568
2569static struct msm_dcvs_core_info grp3d_core_info = {
2570 .freq_tbl = &grp3d_freq[0],
2571 .core_param = {
2572 .max_time_us = 100000,
2573 .num_freq = ARRAY_SIZE(grp3d_freq),
2574 },
2575 .algo_param = {
2576 .slack_time_us = 39000,
2577 .disable_pc_threshold = 86000,
2578 .ss_window_size = 1000000,
2579 .ss_util_pct = 95,
2580 .em_max_util_pct = 97,
2581 .ss_iobusy_conv = 100,
2582 },
2583};
2584
2585static struct msm_dcvs_core_info grp2d_core_info = {
2586 .freq_tbl = &grp2d_freq[0],
2587 .core_param = {
2588 .max_time_us = 100000,
2589 .num_freq = ARRAY_SIZE(grp2d_freq),
2590 },
2591 .algo_param = {
2592 .slack_time_us = 39000,
2593 .disable_pc_threshold = 90000,
2594 .ss_window_size = 1000000,
2595 .ss_util_pct = 90,
2596 .em_max_util_pct = 95,
2597 },
2598};
2599
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002600#ifdef CONFIG_MSM_BUS_SCALING
2601static struct msm_bus_vectors grp3d_init_vectors[] = {
2602 {
2603 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2604 .dst = MSM_BUS_SLAVE_EBI_CH0,
2605 .ab = 0,
2606 .ib = 0,
2607 },
2608};
2609
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002610static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002611 {
2612 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2613 .dst = MSM_BUS_SLAVE_EBI_CH0,
2614 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002615 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002616 },
2617};
2618
2619static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2620 {
2621 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2622 .dst = MSM_BUS_SLAVE_EBI_CH0,
2623 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002624 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002625 },
2626};
2627
2628static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2629 {
2630 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2631 .dst = MSM_BUS_SLAVE_EBI_CH0,
2632 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002633 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002634 },
2635};
2636
2637static struct msm_bus_vectors grp3d_max_vectors[] = {
2638 {
2639 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2640 .dst = MSM_BUS_SLAVE_EBI_CH0,
2641 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002642 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002643 },
2644};
2645
2646static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2647 {
2648 ARRAY_SIZE(grp3d_init_vectors),
2649 grp3d_init_vectors,
2650 },
2651 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002652 ARRAY_SIZE(grp3d_low_vectors),
2653 grp3d_low_vectors,
2654 },
2655 {
2656 ARRAY_SIZE(grp3d_nominal_low_vectors),
2657 grp3d_nominal_low_vectors,
2658 },
2659 {
2660 ARRAY_SIZE(grp3d_nominal_high_vectors),
2661 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002662 },
2663 {
2664 ARRAY_SIZE(grp3d_max_vectors),
2665 grp3d_max_vectors,
2666 },
2667};
2668
2669static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2670 grp3d_bus_scale_usecases,
2671 ARRAY_SIZE(grp3d_bus_scale_usecases),
2672 .name = "grp3d",
2673};
2674
2675static struct msm_bus_vectors grp2d0_init_vectors[] = {
2676 {
2677 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2678 .dst = MSM_BUS_SLAVE_EBI_CH0,
2679 .ab = 0,
2680 .ib = 0,
2681 },
2682};
2683
Lucille Sylvester808eca22011-11-03 10:26:29 -07002684static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002685 {
2686 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2687 .dst = MSM_BUS_SLAVE_EBI_CH0,
2688 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002689 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002690 },
2691};
2692
Lucille Sylvester808eca22011-11-03 10:26:29 -07002693static struct msm_bus_vectors grp2d0_max_vectors[] = {
2694 {
2695 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2696 .dst = MSM_BUS_SLAVE_EBI_CH0,
2697 .ab = 0,
2698 .ib = KGSL_CONVERT_TO_MBPS(2048),
2699 },
2700};
2701
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002702static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2703 {
2704 ARRAY_SIZE(grp2d0_init_vectors),
2705 grp2d0_init_vectors,
2706 },
2707 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002708 ARRAY_SIZE(grp2d0_nominal_vectors),
2709 grp2d0_nominal_vectors,
2710 },
2711 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002712 ARRAY_SIZE(grp2d0_max_vectors),
2713 grp2d0_max_vectors,
2714 },
2715};
2716
2717struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2718 grp2d0_bus_scale_usecases,
2719 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2720 .name = "grp2d0",
2721};
2722
2723static struct msm_bus_vectors grp2d1_init_vectors[] = {
2724 {
2725 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2726 .dst = MSM_BUS_SLAVE_EBI_CH0,
2727 .ab = 0,
2728 .ib = 0,
2729 },
2730};
2731
Lucille Sylvester808eca22011-11-03 10:26:29 -07002732static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002733 {
2734 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2735 .dst = MSM_BUS_SLAVE_EBI_CH0,
2736 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002737 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002738 },
2739};
2740
Lucille Sylvester808eca22011-11-03 10:26:29 -07002741static struct msm_bus_vectors grp2d1_max_vectors[] = {
2742 {
2743 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2744 .dst = MSM_BUS_SLAVE_EBI_CH0,
2745 .ab = 0,
2746 .ib = KGSL_CONVERT_TO_MBPS(2048),
2747 },
2748};
2749
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002750static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2751 {
2752 ARRAY_SIZE(grp2d1_init_vectors),
2753 grp2d1_init_vectors,
2754 },
2755 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002756 ARRAY_SIZE(grp2d1_nominal_vectors),
2757 grp2d1_nominal_vectors,
2758 },
2759 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002760 ARRAY_SIZE(grp2d1_max_vectors),
2761 grp2d1_max_vectors,
2762 },
2763};
2764
2765struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2766 grp2d1_bus_scale_usecases,
2767 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2768 .name = "grp2d1",
2769};
2770#endif
2771
2772static struct resource kgsl_3d0_resources[] = {
2773 {
2774 .name = KGSL_3D0_REG_MEMORY,
2775 .start = 0x04300000, /* GFX3D address */
2776 .end = 0x0431ffff,
2777 .flags = IORESOURCE_MEM,
2778 },
2779 {
2780 .name = KGSL_3D0_IRQ,
2781 .start = GFX3D_IRQ,
2782 .end = GFX3D_IRQ,
2783 .flags = IORESOURCE_IRQ,
2784 },
2785};
2786
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002787static const struct kgsl_iommu_ctx kgsl_3d0_iommu_ctxs[] = {
2788 { "gfx3d_user", 0 },
2789 { "gfx3d_priv", 1 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002790};
2791
2792static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2793 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002794 .iommu_ctxs = kgsl_3d0_iommu_ctxs,
2795 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002796 .physstart = 0x07C00000,
2797 .physend = 0x07C00000 + SZ_1M - 1,
2798 },
2799};
2800
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002801static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002802 .pwrlevel = {
2803 {
2804 .gpu_freq = 400000000,
2805 .bus_freq = 4,
2806 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002807 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002808 {
2809 .gpu_freq = 300000000,
2810 .bus_freq = 3,
2811 .io_fraction = 33,
2812 },
2813 {
2814 .gpu_freq = 200000000,
2815 .bus_freq = 2,
2816 .io_fraction = 100,
2817 },
2818 {
2819 .gpu_freq = 128000000,
2820 .bus_freq = 1,
2821 .io_fraction = 100,
2822 },
2823 {
2824 .gpu_freq = 27000000,
2825 .bus_freq = 0,
2826 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002827 },
Lucille Sylvester67b4c532012-02-08 11:24:31 -08002828 .init_level = 1,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002829 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002830 .set_grp_async = NULL,
Lucille Sylvester5dc67512012-03-27 15:07:58 -06002831 .idle_timeout = HZ/12,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002832 .nap_allowed = true,
2833 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002834#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002835 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002836#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002837 .iommu_data = kgsl_3d0_iommu_data,
2838 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002839 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002840};
2841
2842struct platform_device msm_kgsl_3d0 = {
2843 .name = "kgsl-3d0",
2844 .id = 0,
2845 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2846 .resource = kgsl_3d0_resources,
2847 .dev = {
2848 .platform_data = &kgsl_3d0_pdata,
2849 },
2850};
2851
2852static struct resource kgsl_2d0_resources[] = {
2853 {
2854 .name = KGSL_2D0_REG_MEMORY,
2855 .start = 0x04100000, /* Z180 base address */
2856 .end = 0x04100FFF,
2857 .flags = IORESOURCE_MEM,
2858 },
2859 {
2860 .name = KGSL_2D0_IRQ,
2861 .start = GFX2D0_IRQ,
2862 .end = GFX2D0_IRQ,
2863 .flags = IORESOURCE_IRQ,
2864 },
2865};
2866
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002867static const struct kgsl_iommu_ctx kgsl_2d0_iommu_ctxs[] = {
2868 { "gfx2d0_2d0", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002869};
2870
2871static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2872 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002873 .iommu_ctxs = kgsl_2d0_iommu_ctxs,
2874 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002875 .physstart = 0x07D00000,
2876 .physend = 0x07D00000 + SZ_1M - 1,
2877 },
2878};
2879
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002880static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002881 .pwrlevel = {
2882 {
2883 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002884 .bus_freq = 2,
2885 },
2886 {
2887 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002888 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002889 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002890 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002891 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002892 .bus_freq = 0,
2893 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002894 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002895 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002896 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002897 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002898 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002899 .nap_allowed = true,
2900 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002901#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002902 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002903#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002904 .iommu_data = kgsl_2d0_iommu_data,
2905 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002906 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002907};
2908
2909struct platform_device msm_kgsl_2d0 = {
2910 .name = "kgsl-2d0",
2911 .id = 0,
2912 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2913 .resource = kgsl_2d0_resources,
2914 .dev = {
2915 .platform_data = &kgsl_2d0_pdata,
2916 },
2917};
2918
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002919static const struct kgsl_iommu_ctx kgsl_2d1_iommu_ctxs[] = {
2920 { "gfx2d1_2d1", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002921};
2922
2923static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2924 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06002925 .iommu_ctxs = kgsl_2d1_iommu_ctxs,
2926 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002927 .physstart = 0x07E00000,
2928 .physend = 0x07E00000 + SZ_1M - 1,
2929 },
2930};
2931
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002932static struct resource kgsl_2d1_resources[] = {
2933 {
2934 .name = KGSL_2D1_REG_MEMORY,
2935 .start = 0x04200000, /* Z180 device 1 base address */
2936 .end = 0x04200FFF,
2937 .flags = IORESOURCE_MEM,
2938 },
2939 {
2940 .name = KGSL_2D1_IRQ,
2941 .start = GFX2D1_IRQ,
2942 .end = GFX2D1_IRQ,
2943 .flags = IORESOURCE_IRQ,
2944 },
2945};
2946
2947static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002948 .pwrlevel = {
2949 {
2950 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002951 .bus_freq = 2,
2952 },
2953 {
2954 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002955 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002956 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002957 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002958 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002959 .bus_freq = 0,
2960 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002961 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002962 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002963 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002964 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002965 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002966 .nap_allowed = true,
2967 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002968#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002969 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002970#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002971 .iommu_data = kgsl_2d1_iommu_data,
2972 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002973 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002974};
2975
2976struct platform_device msm_kgsl_2d1 = {
2977 .name = "kgsl-2d1",
2978 .id = 1,
2979 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2980 .resource = kgsl_2d1_resources,
2981 .dev = {
2982 .platform_data = &kgsl_2d1_pdata,
2983 },
2984};
2985
2986#ifdef CONFIG_MSM_GEMINI
2987static struct resource msm_gemini_resources[] = {
2988 {
2989 .start = 0x04600000,
2990 .end = 0x04600000 + SZ_1M - 1,
2991 .flags = IORESOURCE_MEM,
2992 },
2993 {
2994 .start = JPEG_IRQ,
2995 .end = JPEG_IRQ,
2996 .flags = IORESOURCE_IRQ,
2997 },
2998};
2999
3000struct platform_device msm8960_gemini_device = {
3001 .name = "msm_gemini",
3002 .resource = msm_gemini_resources,
3003 .num_resources = ARRAY_SIZE(msm_gemini_resources),
3004};
3005#endif
3006
Kalyani Oruganti465d1e12012-05-15 10:23:05 -07003007#ifdef CONFIG_MSM_MERCURY
3008static struct resource msm_mercury_resources[] = {
3009 {
3010 .start = 0x05000000,
3011 .end = 0x05000000 + SZ_1M - 1,
3012 .name = "mercury_resource_base",
3013 .flags = IORESOURCE_MEM,
3014 },
3015 {
3016 .start = JPEGD_IRQ,
3017 .end = JPEGD_IRQ,
3018 .flags = IORESOURCE_IRQ,
3019 },
3020};
3021struct platform_device msm8960_mercury_device = {
3022 .name = "msm_mercury",
3023 .resource = msm_mercury_resources,
3024 .num_resources = ARRAY_SIZE(msm_mercury_resources),
3025};
3026#endif
3027
Praveen Chidambaram78499012011-11-01 17:15:17 -06003028struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
3029 .reg_base_addrs = {
3030 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
3031 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
3032 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
3033 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
3034 },
3035 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08003036 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06003037 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06003038 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
3039 .ipc_rpm_val = 4,
3040 .target_id = {
3041 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
3042 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
3043 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
3044 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
3045 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
3046 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
3047 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
3048 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
3049 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
3050 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
3051 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
3052 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
3053 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
3054 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
3055 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
3056 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
3057 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
3058 APPS_FABRIC_CFG_HALT, 2),
3059 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
3060 APPS_FABRIC_CFG_CLKMOD, 3),
3061 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
3062 APPS_FABRIC_CFG_IOCTL, 1),
3063 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
3064 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
3065 SYS_FABRIC_CFG_HALT, 2),
3066 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
3067 SYS_FABRIC_CFG_CLKMOD, 3),
3068 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
3069 SYS_FABRIC_CFG_IOCTL, 1),
3070 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
3071 SYSTEM_FABRIC_ARB, 29),
3072 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
3073 MMSS_FABRIC_CFG_HALT, 2),
3074 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
3075 MMSS_FABRIC_CFG_CLKMOD, 3),
3076 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
3077 MMSS_FABRIC_CFG_IOCTL, 1),
3078 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
3079 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
3080 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
3081 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
3082 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
3083 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
3084 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
3085 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
3086 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
3087 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
3088 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
3089 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
3090 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
3091 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
3092 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
3093 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
3094 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
3095 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
3096 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
3097 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
3098 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
3099 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
3100 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
3101 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
3102 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
3103 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
3104 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
3105 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
3106 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
3107 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
3108 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
3109 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
3110 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
3111 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
3112 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
3113 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
3114 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
3115 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
3116 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
3117 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
3118 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
3119 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
3120 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
3121 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
3122 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
3123 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
3124 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
3125 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
3126 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
3127 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
3128 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
3129 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
3130 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
3131 },
3132 .target_status = {
3133 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
3134 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
3135 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
3136 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
3137 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
3138 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
3139 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
3140 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
3141 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
3142 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
3143 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
3144 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
3145 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
3146 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
3147 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
3148 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
3149 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
3150 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
3151 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
3152 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
3153 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
3154 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
3155 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
3156 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
3157 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
3158 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
3159 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
3160 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
3161 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
3162 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
3163 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
3164 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
3165 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
3166 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
3167 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
3168 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
3169 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
3170 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
3171 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
3172 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
3173 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
3174 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
3175 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
3176 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
3177 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
3178 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
3179 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
3180 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
3181 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
3182 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
3183 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
3184 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
3185 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
3186 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
3187 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
3188 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
3189 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
3190 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
3191 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3192 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3193 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3194 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3195 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3196 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3197 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3198 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3199 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3200 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3201 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3202 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3203 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3204 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3205 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3206 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3207 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3208 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3209 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3210 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3211 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3212 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3213 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3214 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3215 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3216 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3217 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3218 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3219 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3220 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3221 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3222 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3223 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3224 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3225 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3226 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3227 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3228 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3229 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3230 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3231 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3232 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3233 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3234 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3235 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3236 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3237 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3238 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3239 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3240 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3241 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3242 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3243 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3244 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3245 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3246 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3247 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3248 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3249 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3250 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3251 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3252 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3253 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3254 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3255 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3256 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3257 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3258 },
3259 .target_ctrl_id = {
3260 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3261 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3262 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3263 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3264 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3265 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3266 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3267 },
3268 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3269 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3270 .sel_last = MSM_RPM_8960_SEL_LAST,
3271 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003272};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003273
Praveen Chidambaram78499012011-11-01 17:15:17 -06003274struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003275 .name = "msm_rpm",
3276 .id = -1,
3277};
3278
Praveen Chidambaram78499012011-11-01 17:15:17 -06003279static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3280 .phys_addr_base = 0x0010C000,
3281 .reg_offsets = {
3282 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3283 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3284 },
3285 .phys_size = SZ_8K,
3286 .log_len = 4096, /* log's buffer length in bytes */
3287 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3288};
3289
3290struct platform_device msm8960_rpm_log_device = {
3291 .name = "msm_rpm_log",
3292 .id = -1,
3293 .dev = {
3294 .platform_data = &msm_rpm_log_pdata,
3295 },
3296};
3297
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003298static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
3299 .phys_addr_base = 0x0010D204,
3300 .phys_size = SZ_8K,
3301};
3302
Praveen Chidambaram78499012011-11-01 17:15:17 -06003303struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003304 .name = "msm_rpm_stat",
3305 .id = -1,
3306 .dev = {
3307 .platform_data = &msm_rpm_stat_pdata,
3308 },
3309};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003310
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003311struct platform_device msm_bus_sys_fabric = {
3312 .name = "msm_bus_fabric",
3313 .id = MSM_BUS_FAB_SYSTEM,
3314};
3315struct platform_device msm_bus_apps_fabric = {
3316 .name = "msm_bus_fabric",
3317 .id = MSM_BUS_FAB_APPSS,
3318};
3319struct platform_device msm_bus_mm_fabric = {
3320 .name = "msm_bus_fabric",
3321 .id = MSM_BUS_FAB_MMSS,
3322};
3323struct platform_device msm_bus_sys_fpb = {
3324 .name = "msm_bus_fabric",
3325 .id = MSM_BUS_FAB_SYSTEM_FPB,
3326};
3327struct platform_device msm_bus_cpss_fpb = {
3328 .name = "msm_bus_fabric",
3329 .id = MSM_BUS_FAB_CPSS_FPB,
3330};
3331
3332/* Sensors DSPS platform data */
3333#ifdef CONFIG_MSM_DSPS
3334
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07003335#define PPSS_DSPS_TCM_CODE_BASE 0x12000000
3336#define PPSS_DSPS_TCM_CODE_SIZE 0x28000
3337#define PPSS_DSPS_TCM_BUF_BASE 0x12040000
3338#define PPSS_DSPS_TCM_BUF_SIZE 0x4000
3339#define PPSS_DSPS_PIPE_BASE 0x12800000
3340#define PPSS_DSPS_PIPE_SIZE 0x4000
3341#define PPSS_DSPS_DDR_BASE 0x8fe00000
3342#define PPSS_DSPS_DDR_SIZE 0x100000
3343#define PPSS_SMEM_BASE 0x80000000
3344#define PPSS_SMEM_SIZE 0x200000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003345#define PPSS_REG_PHYS_BASE 0x12080000
3346
3347static struct dsps_clk_info dsps_clks[] = {};
3348static struct dsps_regulator_info dsps_regs[] = {};
3349
3350/*
3351 * Note: GPIOs field is intialized in run-time at the function
3352 * msm8960_init_dsps().
3353 */
3354
3355struct msm_dsps_platform_data msm_dsps_pdata = {
3356 .clks = dsps_clks,
3357 .clks_num = ARRAY_SIZE(dsps_clks),
3358 .gpios = NULL,
3359 .gpios_num = 0,
3360 .regs = dsps_regs,
3361 .regs_num = ARRAY_SIZE(dsps_regs),
3362 .dsps_pwr_ctl_en = 1,
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07003363 .tcm_code_start = PPSS_DSPS_TCM_CODE_BASE,
3364 .tcm_code_size = PPSS_DSPS_TCM_CODE_SIZE,
3365 .tcm_buf_start = PPSS_DSPS_TCM_BUF_BASE,
3366 .tcm_buf_size = PPSS_DSPS_TCM_BUF_SIZE,
3367 .pipe_start = PPSS_DSPS_PIPE_BASE,
3368 .pipe_size = PPSS_DSPS_PIPE_SIZE,
3369 .ddr_start = PPSS_DSPS_DDR_BASE,
3370 .ddr_size = PPSS_DSPS_DDR_SIZE,
3371 .smem_start = PPSS_SMEM_BASE,
3372 .smem_size = PPSS_SMEM_SIZE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003373 .signature = DSPS_SIGNATURE,
3374};
3375
3376static struct resource msm_dsps_resources[] = {
3377 {
3378 .start = PPSS_REG_PHYS_BASE,
3379 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
3380 .name = "ppss_reg",
3381 .flags = IORESOURCE_MEM,
3382 },
Wentao Xua55500b2011-08-16 18:15:04 -04003383 {
3384 .start = PPSS_WDOG_TIMER_IRQ,
3385 .end = PPSS_WDOG_TIMER_IRQ,
3386 .name = "ppss_wdog",
3387 .flags = IORESOURCE_IRQ,
3388 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003389};
3390
3391struct platform_device msm_dsps_device = {
3392 .name = "msm_dsps",
3393 .id = 0,
3394 .num_resources = ARRAY_SIZE(msm_dsps_resources),
3395 .resource = msm_dsps_resources,
3396 .dev.platform_data = &msm_dsps_pdata,
3397};
3398
3399#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07003400
3401#ifdef CONFIG_MSM_QDSS
3402
3403#define MSM_QDSS_PHYS_BASE 0x01A00000
3404#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
3405#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
3406#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
Pratik Patel492b3012012-03-06 14:22:30 -08003407#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
Pratik Patel7831c082011-06-08 21:44:37 -07003408
Pratik Patel1403f2a2012-03-21 10:10:00 -07003409#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
3410
3411static struct qdss_source msm_qdss_sources[] = {
3412 QDSS_SOURCE("msm_etm", 0x3),
3413};
3414
3415static struct msm_qdss_platform_data qdss_pdata = {
3416 .src_table = msm_qdss_sources,
3417 .size = ARRAY_SIZE(msm_qdss_sources),
3418 .afamily = 1,
3419};
3420
3421struct platform_device msm_qdss_device = {
3422 .name = "msm_qdss",
3423 .id = -1,
3424 .dev = {
3425 .platform_data = &qdss_pdata,
3426 },
3427};
3428
Pratik Patel7831c082011-06-08 21:44:37 -07003429static struct resource msm_etb_resources[] = {
3430 {
3431 .start = MSM_ETB_PHYS_BASE,
3432 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
3433 .flags = IORESOURCE_MEM,
3434 },
3435};
3436
3437struct platform_device msm_etb_device = {
3438 .name = "msm_etb",
3439 .id = 0,
3440 .num_resources = ARRAY_SIZE(msm_etb_resources),
3441 .resource = msm_etb_resources,
3442};
3443
3444static struct resource msm_tpiu_resources[] = {
3445 {
3446 .start = MSM_TPIU_PHYS_BASE,
3447 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
3448 .flags = IORESOURCE_MEM,
3449 },
3450};
3451
3452struct platform_device msm_tpiu_device = {
3453 .name = "msm_tpiu",
3454 .id = 0,
3455 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
3456 .resource = msm_tpiu_resources,
3457};
3458
3459static struct resource msm_funnel_resources[] = {
3460 {
3461 .start = MSM_FUNNEL_PHYS_BASE,
3462 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
3463 .flags = IORESOURCE_MEM,
3464 },
3465};
3466
3467struct platform_device msm_funnel_device = {
3468 .name = "msm_funnel",
3469 .id = 0,
3470 .num_resources = ARRAY_SIZE(msm_funnel_resources),
3471 .resource = msm_funnel_resources,
3472};
3473
Pratik Patel492b3012012-03-06 14:22:30 -08003474static struct resource msm_etm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07003475 {
Pratik Patel492b3012012-03-06 14:22:30 -08003476 .start = MSM_ETM_PHYS_BASE,
3477 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 2) - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07003478 .flags = IORESOURCE_MEM,
3479 },
3480};
3481
Pratik Patel492b3012012-03-06 14:22:30 -08003482struct platform_device msm_etm_device = {
3483 .name = "msm_etm",
Pratik Patel7831c082011-06-08 21:44:37 -07003484 .id = 0,
Pratik Patel492b3012012-03-06 14:22:30 -08003485 .num_resources = ARRAY_SIZE(msm_etm_resources),
3486 .resource = msm_etm_resources,
Pratik Patel7831c082011-06-08 21:44:37 -07003487};
3488
3489#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07003490
3491static int msm8960_LPM_latency = 1000; /* >100 usec for WFI */
3492
3493struct platform_device msm8960_cpu_idle_device = {
3494 .name = "msm_cpu_idle",
3495 .id = -1,
3496 .dev = {
3497 .platform_data = &msm8960_LPM_latency,
3498 },
3499};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07003500
3501static struct msm_dcvs_freq_entry msm8960_freq[] = {
3502 { 384000, 166981, 345600},
3503 { 702000, 213049, 632502},
3504 {1026000, 285712, 925613},
3505 {1242000, 383945, 1176550},
3506 {1458000, 419729, 1465478},
3507 {1512000, 434116, 1546674},
3508
3509};
3510
3511static struct msm_dcvs_core_info msm8960_core_info = {
3512 .freq_tbl = &msm8960_freq[0],
3513 .core_param = {
3514 .max_time_us = 100000,
3515 .num_freq = ARRAY_SIZE(msm8960_freq),
3516 },
3517 .algo_param = {
3518 .slack_time_us = 58000,
3519 .scale_slack_time = 0,
3520 .scale_slack_time_pct = 0,
3521 .disable_pc_threshold = 1458000,
3522 .em_window_size = 100000,
3523 .em_max_util_pct = 97,
3524 .ss_window_size = 1000000,
3525 .ss_util_pct = 95,
3526 .ss_iobusy_conv = 100,
3527 },
3528};
3529
3530struct platform_device msm8960_msm_gov_device = {
3531 .name = "msm_dcvs_gov",
3532 .id = -1,
3533 .dev = {
3534 .platform_data = &msm8960_core_info,
3535 },
3536};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003537
3538static struct resource msm_cache_erp_resources[] = {
3539 {
3540 .name = "l1_irq",
3541 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3542 .flags = IORESOURCE_IRQ,
3543 },
3544 {
3545 .name = "l2_irq",
3546 .start = APCC_QGICL2IRPTREQ,
3547 .flags = IORESOURCE_IRQ,
3548 }
3549};
3550
3551struct platform_device msm8960_device_cache_erp = {
3552 .name = "msm_cache_erp",
3553 .id = -1,
3554 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3555 .resource = msm_cache_erp_resources,
3556};
Laura Abbott0577d7b2012-04-17 11:14:30 -07003557
3558struct msm_iommu_domain_name msm8960_iommu_ctx_names[] = {
3559 /* Camera */
3560 {
3561 .name = "vpe_src",
3562 .domain = CAMERA_DOMAIN,
3563 },
3564 /* Camera */
3565 {
3566 .name = "vpe_dst",
3567 .domain = CAMERA_DOMAIN,
3568 },
3569 /* Camera */
3570 {
3571 .name = "vfe_imgwr",
3572 .domain = CAMERA_DOMAIN,
3573 },
3574 /* Camera */
3575 {
3576 .name = "vfe_misc",
3577 .domain = CAMERA_DOMAIN,
3578 },
3579 /* Camera */
3580 {
3581 .name = "ijpeg_src",
3582 .domain = CAMERA_DOMAIN,
3583 },
3584 /* Camera */
3585 {
3586 .name = "ijpeg_dst",
3587 .domain = CAMERA_DOMAIN,
3588 },
3589 /* Camera */
3590 {
3591 .name = "jpegd_src",
3592 .domain = CAMERA_DOMAIN,
3593 },
3594 /* Camera */
3595 {
3596 .name = "jpegd_dst",
3597 .domain = CAMERA_DOMAIN,
3598 },
3599 /* Rotator */
3600 {
3601 .name = "rot_src",
3602 .domain = ROTATOR_DOMAIN,
3603 },
3604 /* Rotator */
3605 {
3606 .name = "rot_dst",
3607 .domain = ROTATOR_DOMAIN,
3608 },
3609 /* Video */
3610 {
3611 .name = "vcodec_a_mm1",
3612 .domain = VIDEO_DOMAIN,
3613 },
3614 /* Video */
3615 {
3616 .name = "vcodec_b_mm2",
3617 .domain = VIDEO_DOMAIN,
3618 },
3619 /* Video */
3620 {
3621 .name = "vcodec_a_stream",
3622 .domain = VIDEO_DOMAIN,
3623 },
3624};
3625
3626static struct mem_pool msm8960_video_pools[] = {
3627 /*
3628 * Video hardware has the following requirements:
3629 * 1. All video addresses used by the video hardware must be at a higher
3630 * address than video firmware address.
3631 * 2. Video hardware can only access a range of 256MB from the base of
3632 * the video firmware.
3633 */
3634 [VIDEO_FIRMWARE_POOL] =
3635 /* Low addresses, intended for video firmware */
3636 {
3637 .paddr = SZ_128K,
3638 .size = SZ_16M - SZ_128K,
3639 },
3640 [VIDEO_MAIN_POOL] =
3641 /* Main video pool */
3642 {
3643 .paddr = SZ_16M,
3644 .size = SZ_256M - SZ_16M,
3645 },
3646 [GEN_POOL] =
3647 /* Remaining address space up to 2G */
3648 {
3649 .paddr = SZ_256M,
3650 .size = SZ_2G - SZ_256M,
3651 },
3652};
3653
3654static struct mem_pool msm8960_camera_pools[] = {
3655 [GEN_POOL] =
3656 /* One address space for camera */
3657 {
3658 .paddr = SZ_128K,
3659 .size = SZ_2G - SZ_128K,
3660 },
3661};
3662
3663static struct mem_pool msm8960_display_pools[] = {
3664 [GEN_POOL] =
3665 /* One address space for display */
3666 {
3667 .paddr = SZ_128K,
3668 .size = SZ_2G - SZ_128K,
3669 },
3670};
3671
3672static struct mem_pool msm8960_rotator_pools[] = {
3673 [GEN_POOL] =
3674 /* One address space for rotator */
3675 {
3676 .paddr = SZ_128K,
3677 .size = SZ_2G - SZ_128K,
3678 },
3679};
3680
3681static struct msm_iommu_domain msm8960_iommu_domains[] = {
3682 [VIDEO_DOMAIN] = {
3683 .iova_pools = msm8960_video_pools,
3684 .npools = ARRAY_SIZE(msm8960_video_pools),
3685 },
3686 [CAMERA_DOMAIN] = {
3687 .iova_pools = msm8960_camera_pools,
3688 .npools = ARRAY_SIZE(msm8960_camera_pools),
3689 },
3690 [DISPLAY_DOMAIN] = {
3691 .iova_pools = msm8960_display_pools,
3692 .npools = ARRAY_SIZE(msm8960_display_pools),
3693 },
3694 [ROTATOR_DOMAIN] = {
3695 .iova_pools = msm8960_rotator_pools,
3696 .npools = ARRAY_SIZE(msm8960_rotator_pools),
3697 },
3698};
3699
3700struct iommu_domains_pdata msm8960_iommu_domain_pdata = {
3701 .domains = msm8960_iommu_domains,
3702 .ndomains = ARRAY_SIZE(msm8960_iommu_domains),
3703 .domain_names = msm8960_iommu_ctx_names,
3704 .nnames = ARRAY_SIZE(msm8960_iommu_ctx_names),
3705 .domain_alloc_flags = 0,
3706};
3707
3708struct platform_device msm8960_iommu_domain_device = {
3709 .name = "iommu_domains",
3710 .id = -1,
3711 .dev = {
3712 .platform_data = &msm8960_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07003713 }
3714};
3715
3716struct msm_rtb_platform_data msm8960_rtb_pdata = {
3717 .size = SZ_1M,
3718};
3719
3720static int __init msm_rtb_set_buffer_size(char *p)
3721{
3722 int s;
3723
3724 s = memparse(p, NULL);
3725 msm8960_rtb_pdata.size = ALIGN(s, SZ_4K);
3726 return 0;
3727}
3728early_param("msm_rtb_size", msm_rtb_set_buffer_size);
3729
3730
3731struct platform_device msm8960_rtb_device = {
3732 .name = "msm_rtb",
3733 .id = -1,
3734 .dev = {
3735 .platform_data = &msm8960_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003736 },
3737};
Laura Abbott2ae8f362012-04-12 11:03:04 -07003738
Laura Abbott0a103cf2012-05-25 09:00:23 -07003739#define MSM_8960_L1_SIZE SZ_1M
3740/*
3741 * The actual L2 size is smaller but we need a larger buffer
3742 * size to store other dump information
3743 */
3744#define MSM_8960_L2_SIZE SZ_4M
3745
Laura Abbott2ae8f362012-04-12 11:03:04 -07003746struct msm_cache_dump_platform_data msm8960_cache_dump_pdata = {
Laura Abbott0a103cf2012-05-25 09:00:23 -07003747 .l2_size = MSM_8960_L2_SIZE,
3748 .l1_size = MSM_8960_L1_SIZE,
Laura Abbott2ae8f362012-04-12 11:03:04 -07003749};
3750
3751struct platform_device msm8960_cache_dump_device = {
3752 .name = "msm_cache_dump",
3753 .id = -1,
3754 .dev = {
3755 .platform_data = &msm8960_cache_dump_pdata,
3756 },
3757};
Joel King0cbf5d82012-05-24 15:21:38 -07003758
3759#define MDM2AP_ERRFATAL 40
3760#define AP2MDM_ERRFATAL 80
3761#define MDM2AP_STATUS 24
3762#define AP2MDM_STATUS 77
3763#define AP2MDM_PMIC_PWR_EN 22
3764#define AP2MDM_KPDPWR_N 79
3765#define AP2MDM_SOFT_RESET 78
3766
3767static struct resource sglte_resources[] = {
3768 {
3769 .start = MDM2AP_ERRFATAL,
3770 .end = MDM2AP_ERRFATAL,
3771 .name = "MDM2AP_ERRFATAL",
3772 .flags = IORESOURCE_IO,
3773 },
3774 {
3775 .start = AP2MDM_ERRFATAL,
3776 .end = AP2MDM_ERRFATAL,
3777 .name = "AP2MDM_ERRFATAL",
3778 .flags = IORESOURCE_IO,
3779 },
3780 {
3781 .start = MDM2AP_STATUS,
3782 .end = MDM2AP_STATUS,
3783 .name = "MDM2AP_STATUS",
3784 .flags = IORESOURCE_IO,
3785 },
3786 {
3787 .start = AP2MDM_STATUS,
3788 .end = AP2MDM_STATUS,
3789 .name = "AP2MDM_STATUS",
3790 .flags = IORESOURCE_IO,
3791 },
3792 {
3793 .start = AP2MDM_PMIC_PWR_EN,
3794 .end = AP2MDM_PMIC_PWR_EN,
3795 .name = "AP2MDM_PMIC_PWR_EN",
3796 .flags = IORESOURCE_IO,
3797 },
3798 {
3799 .start = AP2MDM_KPDPWR_N,
3800 .end = AP2MDM_KPDPWR_N,
3801 .name = "AP2MDM_KPDPWR_N",
3802 .flags = IORESOURCE_IO,
3803 },
3804 {
3805 .start = AP2MDM_SOFT_RESET,
3806 .end = AP2MDM_SOFT_RESET,
3807 .name = "AP2MDM_SOFT_RESET",
3808 .flags = IORESOURCE_IO,
3809 },
3810};
3811
3812struct platform_device mdm_sglte_device = {
3813 .name = "mdm2_modem",
3814 .id = -1,
3815 .num_resources = ARRAY_SIZE(sglte_resources),
3816 .resource = sglte_resources,
3817};