blob: 894c13f10568fc55444621544419008f26f6fefc [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>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070035#include <sound/msm-dai-q6.h>
36#include <sound/apr_audio.h>
Joel Nidera1261942011-09-12 16:30:09 +030037#include <mach/msm_tsif.h>
Pratik Patel1403f2a2012-03-21 10:10:00 -070038#include <mach/qdss.h>
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070039#include <mach/msm_serial_hs_lite.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#include "clock.h"
41#include "devices.h"
42#include "devices-msm8x60.h"
43#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070044#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060045#include "rpm_log.h"
Praveen Chidambaram7a712232011-10-28 13:39:45 -060046#include "rpm_stats.h"
Stephen Boydeb819882011-08-29 14:46:30 -070047#include "pil-q6v4.h"
48#include "scm-pas.h"
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070049#include <mach/msm_dcvs.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070050
51#ifdef CONFIG_MSM_MPM
Subhash Jadavani909e04f2012-04-12 10:52:50 +053052#include <mach/mpm.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#endif
54#ifdef CONFIG_MSM_DSPS
55#include <mach/msm_dsps.h>
56#endif
57
58
59/* Address of GSBI blocks */
60#define MSM_GSBI1_PHYS 0x16000000
61#define MSM_GSBI2_PHYS 0x16100000
62#define MSM_GSBI3_PHYS 0x16200000
63#define MSM_GSBI4_PHYS 0x16300000
64#define MSM_GSBI5_PHYS 0x16400000
65#define MSM_GSBI6_PHYS 0x16500000
66#define MSM_GSBI7_PHYS 0x16600000
67#define MSM_GSBI8_PHYS 0x1A000000
68#define MSM_GSBI9_PHYS 0x1A100000
69#define MSM_GSBI10_PHYS 0x1A200000
70#define MSM_GSBI11_PHYS 0x12440000
71#define MSM_GSBI12_PHYS 0x12480000
72
73#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
74#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053075#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070076#define MSM_UART8DM_PHYS (MSM_GSBI8_PHYS + 0x40000)
Mayank Ranae009c922012-03-22 03:02:06 +053077#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078
79/* GSBI QUP devices */
80#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
81#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
82#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
83#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
84#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
85#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
86#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
87#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
88#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
89#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
90#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
91#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
92#define MSM_QUP_SIZE SZ_4K
93
94#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
95#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
96#define MSM_PMIC_SSBI_SIZE SZ_4K
97
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -070098#define MSM8960_HSUSB_PHYS 0x12500000
99#define MSM8960_HSUSB_SIZE SZ_4K
100
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700101static struct resource resources_otg[] = {
102 {
103 .start = MSM8960_HSUSB_PHYS,
104 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
105 .flags = IORESOURCE_MEM,
106 },
107 {
108 .start = USB1_HS_IRQ,
109 .end = USB1_HS_IRQ,
110 .flags = IORESOURCE_IRQ,
111 },
112};
113
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700114struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700115 .name = "msm_otg",
116 .id = -1,
117 .num_resources = ARRAY_SIZE(resources_otg),
118 .resource = resources_otg,
119 .dev = {
120 .coherent_dma_mask = 0xffffffff,
121 },
122};
123
124static struct resource resources_hsusb[] = {
125 {
126 .start = MSM8960_HSUSB_PHYS,
127 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
128 .flags = IORESOURCE_MEM,
129 },
130 {
131 .start = USB1_HS_IRQ,
132 .end = USB1_HS_IRQ,
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700137struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700138 .name = "msm_hsusb",
139 .id = -1,
140 .num_resources = ARRAY_SIZE(resources_hsusb),
141 .resource = resources_hsusb,
142 .dev = {
143 .coherent_dma_mask = 0xffffffff,
144 },
145};
146
147static struct resource resources_hsusb_host[] = {
148 {
149 .start = MSM8960_HSUSB_PHYS,
150 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
151 .flags = IORESOURCE_MEM,
152 },
153 {
154 .start = USB1_HS_IRQ,
155 .end = USB1_HS_IRQ,
156 .flags = IORESOURCE_IRQ,
157 },
158};
159
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530160static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700161struct platform_device msm_device_hsusb_host = {
162 .name = "msm_hsusb_host",
163 .id = -1,
164 .num_resources = ARRAY_SIZE(resources_hsusb_host),
165 .resource = resources_hsusb_host,
166 .dev = {
167 .dma_mask = &dma_mask,
168 .coherent_dma_mask = 0xffffffff,
169 },
170};
171
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530172static struct resource resources_hsic_host[] = {
173 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700174 .start = 0x12520000,
175 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530176 .flags = IORESOURCE_MEM,
177 },
178 {
179 .start = USB_HSIC_IRQ,
180 .end = USB_HSIC_IRQ,
181 .flags = IORESOURCE_IRQ,
182 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800183 {
184 .start = MSM_GPIO_TO_INT(69),
185 .end = MSM_GPIO_TO_INT(69),
186 .name = "peripheral_status_irq",
187 .flags = IORESOURCE_IRQ,
188 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530189};
190
191struct platform_device msm_device_hsic_host = {
192 .name = "msm_hsic_host",
193 .id = -1,
194 .num_resources = ARRAY_SIZE(resources_hsic_host),
195 .resource = resources_hsic_host,
196 .dev = {
197 .dma_mask = &dma_mask,
198 .coherent_dma_mask = DMA_BIT_MASK(32),
199 },
200};
201
Mona Hossain11c03ac2011-10-26 12:42:10 -0700202#define SHARED_IMEM_TZ_BASE 0x2a03f720
203static struct resource tzlog_resources[] = {
204 {
205 .start = SHARED_IMEM_TZ_BASE,
206 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
207 .flags = IORESOURCE_MEM,
208 },
209};
210
211struct platform_device msm_device_tz_log = {
212 .name = "tz_log",
213 .id = 0,
214 .num_resources = ARRAY_SIZE(tzlog_resources),
215 .resource = tzlog_resources,
216};
217
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700218static struct resource resources_uart_gsbi2[] = {
219 {
220 .start = MSM8960_GSBI2_UARTDM_IRQ,
221 .end = MSM8960_GSBI2_UARTDM_IRQ,
222 .flags = IORESOURCE_IRQ,
223 },
224 {
225 .start = MSM_UART2DM_PHYS,
226 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
227 .name = "uartdm_resource",
228 .flags = IORESOURCE_MEM,
229 },
230 {
231 .start = MSM_GSBI2_PHYS,
232 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
233 .name = "gsbi_resource",
234 .flags = IORESOURCE_MEM,
235 },
236};
237
238struct platform_device msm8960_device_uart_gsbi2 = {
239 .name = "msm_serial_hsl",
240 .id = 0,
241 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
242 .resource = resources_uart_gsbi2,
243};
Mayank Rana9f51f582011-08-04 18:35:59 +0530244/* GSBI 6 used into UARTDM Mode */
245static struct resource msm_uart_dm6_resources[] = {
246 {
247 .start = MSM_UART6DM_PHYS,
248 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
249 .name = "uartdm_resource",
250 .flags = IORESOURCE_MEM,
251 },
252 {
253 .start = GSBI6_UARTDM_IRQ,
254 .end = GSBI6_UARTDM_IRQ,
255 .flags = IORESOURCE_IRQ,
256 },
257 {
258 .start = MSM_GSBI6_PHYS,
259 .end = MSM_GSBI6_PHYS + 4 - 1,
260 .name = "gsbi_resource",
261 .flags = IORESOURCE_MEM,
262 },
263 {
264 .start = DMOV_HSUART_GSBI6_TX_CHAN,
265 .end = DMOV_HSUART_GSBI6_RX_CHAN,
266 .name = "uartdm_channels",
267 .flags = IORESOURCE_DMA,
268 },
269 {
270 .start = DMOV_HSUART_GSBI6_TX_CRCI,
271 .end = DMOV_HSUART_GSBI6_RX_CRCI,
272 .name = "uartdm_crci",
273 .flags = IORESOURCE_DMA,
274 },
275};
276static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
277struct platform_device msm_device_uart_dm6 = {
278 .name = "msm_serial_hs",
279 .id = 0,
280 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
281 .resource = msm_uart_dm6_resources,
282 .dev = {
283 .dma_mask = &msm_uart_dm6_dma_mask,
284 .coherent_dma_mask = DMA_BIT_MASK(32),
285 },
286};
Mayank Ranae009c922012-03-22 03:02:06 +0530287/*
288 * GSBI 9 used into UARTDM Mode
289 * For 8960 Fusion 2.2 Primary IPC
290 */
291static struct resource msm_uart_dm9_resources[] = {
292 {
293 .start = MSM_UART9DM_PHYS,
294 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
295 .name = "uartdm_resource",
296 .flags = IORESOURCE_MEM,
297 },
298 {
299 .start = GSBI9_UARTDM_IRQ,
300 .end = GSBI9_UARTDM_IRQ,
301 .flags = IORESOURCE_IRQ,
302 },
303 {
304 .start = MSM_GSBI9_PHYS,
305 .end = MSM_GSBI9_PHYS + 4 - 1,
306 .name = "gsbi_resource",
307 .flags = IORESOURCE_MEM,
308 },
309 {
310 .start = DMOV_HSUART_GSBI9_TX_CHAN,
311 .end = DMOV_HSUART_GSBI9_RX_CHAN,
312 .name = "uartdm_channels",
313 .flags = IORESOURCE_DMA,
314 },
315 {
316 .start = DMOV_HSUART_GSBI9_TX_CRCI,
317 .end = DMOV_HSUART_GSBI9_RX_CRCI,
318 .name = "uartdm_crci",
319 .flags = IORESOURCE_DMA,
320 },
321};
322static u64 msm_uart_dm9_dma_mask = DMA_BIT_MASK(32);
323struct platform_device msm_device_uart_dm9 = {
324 .name = "msm_serial_hs",
325 .id = 1,
326 .num_resources = ARRAY_SIZE(msm_uart_dm9_resources),
327 .resource = msm_uart_dm9_resources,
328 .dev = {
329 .dma_mask = &msm_uart_dm9_dma_mask,
330 .coherent_dma_mask = DMA_BIT_MASK(32),
331 },
332};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700333
334static struct resource resources_uart_gsbi5[] = {
335 {
336 .start = GSBI5_UARTDM_IRQ,
337 .end = GSBI5_UARTDM_IRQ,
338 .flags = IORESOURCE_IRQ,
339 },
340 {
341 .start = MSM_UART5DM_PHYS,
342 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
343 .name = "uartdm_resource",
344 .flags = IORESOURCE_MEM,
345 },
346 {
347 .start = MSM_GSBI5_PHYS,
348 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
349 .name = "gsbi_resource",
350 .flags = IORESOURCE_MEM,
351 },
352};
353
354struct platform_device msm8960_device_uart_gsbi5 = {
355 .name = "msm_serial_hsl",
356 .id = 0,
357 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
358 .resource = resources_uart_gsbi5,
359};
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700360
361static struct msm_serial_hslite_platform_data uart_gsbi8_pdata = {
362 .line = 0,
363};
364
365static struct resource resources_uart_gsbi8[] = {
366 {
367 .start = GSBI8_UARTDM_IRQ,
368 .end = GSBI8_UARTDM_IRQ,
369 .flags = IORESOURCE_IRQ,
370 },
371 {
372 .start = MSM_UART8DM_PHYS,
373 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
374 .name = "uartdm_resource",
375 .flags = IORESOURCE_MEM,
376 },
377 {
378 .start = MSM_GSBI8_PHYS,
379 .end = MSM_GSBI8_PHYS + PAGE_SIZE - 1,
380 .name = "gsbi_resource",
381 .flags = IORESOURCE_MEM,
382 },
383};
384
385struct platform_device msm8960_device_uart_gsbi8 = {
386 .name = "msm_serial_hsl",
387 .id = 1,
388 .num_resources = ARRAY_SIZE(resources_uart_gsbi8),
389 .resource = resources_uart_gsbi8,
390 .dev.platform_data = &uart_gsbi8_pdata,
391};
392
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700393/* MSM Video core device */
394#ifdef CONFIG_MSM_BUS_SCALING
395static struct msm_bus_vectors vidc_init_vectors[] = {
396 {
397 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
398 .dst = MSM_BUS_SLAVE_EBI_CH0,
399 .ab = 0,
400 .ib = 0,
401 },
402 {
403 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
404 .dst = MSM_BUS_SLAVE_EBI_CH0,
405 .ab = 0,
406 .ib = 0,
407 },
408 {
409 .src = MSM_BUS_MASTER_AMPSS_M0,
410 .dst = MSM_BUS_SLAVE_EBI_CH0,
411 .ab = 0,
412 .ib = 0,
413 },
414 {
415 .src = MSM_BUS_MASTER_AMPSS_M0,
416 .dst = MSM_BUS_SLAVE_EBI_CH0,
417 .ab = 0,
418 .ib = 0,
419 },
420};
421static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
422 {
423 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
424 .dst = MSM_BUS_SLAVE_EBI_CH0,
425 .ab = 54525952,
426 .ib = 436207616,
427 },
428 {
429 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
430 .dst = MSM_BUS_SLAVE_EBI_CH0,
431 .ab = 72351744,
432 .ib = 289406976,
433 },
434 {
435 .src = MSM_BUS_MASTER_AMPSS_M0,
436 .dst = MSM_BUS_SLAVE_EBI_CH0,
437 .ab = 500000,
438 .ib = 1000000,
439 },
440 {
441 .src = MSM_BUS_MASTER_AMPSS_M0,
442 .dst = MSM_BUS_SLAVE_EBI_CH0,
443 .ab = 500000,
444 .ib = 1000000,
445 },
446};
447static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
448 {
449 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
450 .dst = MSM_BUS_SLAVE_EBI_CH0,
451 .ab = 40894464,
452 .ib = 327155712,
453 },
454 {
455 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
456 .dst = MSM_BUS_SLAVE_EBI_CH0,
457 .ab = 48234496,
458 .ib = 192937984,
459 },
460 {
461 .src = MSM_BUS_MASTER_AMPSS_M0,
462 .dst = MSM_BUS_SLAVE_EBI_CH0,
463 .ab = 500000,
464 .ib = 2000000,
465 },
466 {
467 .src = MSM_BUS_MASTER_AMPSS_M0,
468 .dst = MSM_BUS_SLAVE_EBI_CH0,
469 .ab = 500000,
470 .ib = 2000000,
471 },
472};
473static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
474 {
475 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
476 .dst = MSM_BUS_SLAVE_EBI_CH0,
477 .ab = 163577856,
478 .ib = 1308622848,
479 },
480 {
481 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
482 .dst = MSM_BUS_SLAVE_EBI_CH0,
483 .ab = 219152384,
484 .ib = 876609536,
485 },
486 {
487 .src = MSM_BUS_MASTER_AMPSS_M0,
488 .dst = MSM_BUS_SLAVE_EBI_CH0,
489 .ab = 1750000,
490 .ib = 3500000,
491 },
492 {
493 .src = MSM_BUS_MASTER_AMPSS_M0,
494 .dst = MSM_BUS_SLAVE_EBI_CH0,
495 .ab = 1750000,
496 .ib = 3500000,
497 },
498};
499static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
500 {
501 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
502 .dst = MSM_BUS_SLAVE_EBI_CH0,
503 .ab = 121634816,
504 .ib = 973078528,
505 },
506 {
507 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
508 .dst = MSM_BUS_SLAVE_EBI_CH0,
509 .ab = 155189248,
510 .ib = 620756992,
511 },
512 {
513 .src = MSM_BUS_MASTER_AMPSS_M0,
514 .dst = MSM_BUS_SLAVE_EBI_CH0,
515 .ab = 1750000,
516 .ib = 7000000,
517 },
518 {
519 .src = MSM_BUS_MASTER_AMPSS_M0,
520 .dst = MSM_BUS_SLAVE_EBI_CH0,
521 .ab = 1750000,
522 .ib = 7000000,
523 },
524};
525static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
526 {
527 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
528 .dst = MSM_BUS_SLAVE_EBI_CH0,
529 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700530 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700531 },
532 {
533 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
534 .dst = MSM_BUS_SLAVE_EBI_CH0,
535 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700536 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700537 },
538 {
539 .src = MSM_BUS_MASTER_AMPSS_M0,
540 .dst = MSM_BUS_SLAVE_EBI_CH0,
541 .ab = 2500000,
542 .ib = 5000000,
543 },
544 {
545 .src = MSM_BUS_MASTER_AMPSS_M0,
546 .dst = MSM_BUS_SLAVE_EBI_CH0,
547 .ab = 2500000,
548 .ib = 5000000,
549 },
550};
551static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
552 {
553 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
554 .dst = MSM_BUS_SLAVE_EBI_CH0,
555 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700556 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700557 },
558 {
559 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
560 .dst = MSM_BUS_SLAVE_EBI_CH0,
561 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700562 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700563 },
564 {
565 .src = MSM_BUS_MASTER_AMPSS_M0,
566 .dst = MSM_BUS_SLAVE_EBI_CH0,
567 .ab = 2500000,
568 .ib = 700000000,
569 },
570 {
571 .src = MSM_BUS_MASTER_AMPSS_M0,
572 .dst = MSM_BUS_SLAVE_EBI_CH0,
573 .ab = 2500000,
574 .ib = 10000000,
575 },
576};
577
578static struct msm_bus_paths vidc_bus_client_config[] = {
579 {
580 ARRAY_SIZE(vidc_init_vectors),
581 vidc_init_vectors,
582 },
583 {
584 ARRAY_SIZE(vidc_venc_vga_vectors),
585 vidc_venc_vga_vectors,
586 },
587 {
588 ARRAY_SIZE(vidc_vdec_vga_vectors),
589 vidc_vdec_vga_vectors,
590 },
591 {
592 ARRAY_SIZE(vidc_venc_720p_vectors),
593 vidc_venc_720p_vectors,
594 },
595 {
596 ARRAY_SIZE(vidc_vdec_720p_vectors),
597 vidc_vdec_720p_vectors,
598 },
599 {
600 ARRAY_SIZE(vidc_venc_1080p_vectors),
601 vidc_venc_1080p_vectors,
602 },
603 {
604 ARRAY_SIZE(vidc_vdec_1080p_vectors),
605 vidc_vdec_1080p_vectors,
606 },
607};
608
609static struct msm_bus_scale_pdata vidc_bus_client_data = {
610 vidc_bus_client_config,
611 ARRAY_SIZE(vidc_bus_client_config),
612 .name = "vidc",
613};
614#endif
615
Mona Hossain9c430e32011-07-27 11:04:47 -0700616#ifdef CONFIG_HW_RANDOM_MSM
617/* PRNG device */
618#define MSM_PRNG_PHYS 0x1A500000
619static struct resource rng_resources = {
620 .flags = IORESOURCE_MEM,
621 .start = MSM_PRNG_PHYS,
622 .end = MSM_PRNG_PHYS + SZ_512 - 1,
623};
624
625struct platform_device msm_device_rng = {
626 .name = "msm_rng",
627 .id = 0,
628 .num_resources = 1,
629 .resource = &rng_resources,
630};
631#endif
632
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700633#define MSM_VIDC_BASE_PHYS 0x04400000
634#define MSM_VIDC_BASE_SIZE 0x00100000
635
636static struct resource msm_device_vidc_resources[] = {
637 {
638 .start = MSM_VIDC_BASE_PHYS,
639 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
640 .flags = IORESOURCE_MEM,
641 },
642 {
643 .start = VCODEC_IRQ,
644 .end = VCODEC_IRQ,
645 .flags = IORESOURCE_IRQ,
646 },
647};
648
649struct msm_vidc_platform_data vidc_platform_data = {
650#ifdef CONFIG_MSM_BUS_SCALING
651 .vidc_bus_client_pdata = &vidc_bus_client_data,
652#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -0700653#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -0800654 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700655 .enable_ion = 1,
656#else
Deepak Kotur12301a72011-11-09 18:30:29 -0800657 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700658 .enable_ion = 0,
659#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800660 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +0530661 .disable_fullhd = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700662};
663
664struct platform_device msm_device_vidc = {
665 .name = "msm_vidc",
666 .id = 0,
667 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
668 .resource = msm_device_vidc_resources,
669 .dev = {
670 .platform_data = &vidc_platform_data,
671 },
672};
673
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700674#define MSM_SDC1_BASE 0x12400000
675#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
676#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
677#define MSM_SDC2_BASE 0x12140000
678#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
679#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
680#define MSM_SDC2_BASE 0x12140000
681#define MSM_SDC3_BASE 0x12180000
682#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
683#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
684#define MSM_SDC4_BASE 0x121C0000
685#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
686#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
687#define MSM_SDC5_BASE 0x12200000
688#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
689#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
690
691static struct resource resources_sdc1[] = {
692 {
693 .name = "core_mem",
694 .flags = IORESOURCE_MEM,
695 .start = MSM_SDC1_BASE,
696 .end = MSM_SDC1_DML_BASE - 1,
697 },
698 {
699 .name = "core_irq",
700 .flags = IORESOURCE_IRQ,
701 .start = SDC1_IRQ_0,
702 .end = SDC1_IRQ_0
703 },
704#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
705 {
706 .name = "sdcc_dml_addr",
707 .start = MSM_SDC1_DML_BASE,
708 .end = MSM_SDC1_BAM_BASE - 1,
709 .flags = IORESOURCE_MEM,
710 },
711 {
712 .name = "sdcc_bam_addr",
713 .start = MSM_SDC1_BAM_BASE,
714 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
715 .flags = IORESOURCE_MEM,
716 },
717 {
718 .name = "sdcc_bam_irq",
719 .start = SDC1_BAM_IRQ,
720 .end = SDC1_BAM_IRQ,
721 .flags = IORESOURCE_IRQ,
722 },
723#endif
724};
725
726static struct resource resources_sdc2[] = {
727 {
728 .name = "core_mem",
729 .flags = IORESOURCE_MEM,
730 .start = MSM_SDC2_BASE,
731 .end = MSM_SDC2_DML_BASE - 1,
732 },
733 {
734 .name = "core_irq",
735 .flags = IORESOURCE_IRQ,
736 .start = SDC2_IRQ_0,
737 .end = SDC2_IRQ_0
738 },
739#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
740 {
741 .name = "sdcc_dml_addr",
742 .start = MSM_SDC2_DML_BASE,
743 .end = MSM_SDC2_BAM_BASE - 1,
744 .flags = IORESOURCE_MEM,
745 },
746 {
747 .name = "sdcc_bam_addr",
748 .start = MSM_SDC2_BAM_BASE,
749 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
750 .flags = IORESOURCE_MEM,
751 },
752 {
753 .name = "sdcc_bam_irq",
754 .start = SDC2_BAM_IRQ,
755 .end = SDC2_BAM_IRQ,
756 .flags = IORESOURCE_IRQ,
757 },
758#endif
759};
760
761static struct resource resources_sdc3[] = {
762 {
763 .name = "core_mem",
764 .flags = IORESOURCE_MEM,
765 .start = MSM_SDC3_BASE,
766 .end = MSM_SDC3_DML_BASE - 1,
767 },
768 {
769 .name = "core_irq",
770 .flags = IORESOURCE_IRQ,
771 .start = SDC3_IRQ_0,
772 .end = SDC3_IRQ_0
773 },
774#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
775 {
776 .name = "sdcc_dml_addr",
777 .start = MSM_SDC3_DML_BASE,
778 .end = MSM_SDC3_BAM_BASE - 1,
779 .flags = IORESOURCE_MEM,
780 },
781 {
782 .name = "sdcc_bam_addr",
783 .start = MSM_SDC3_BAM_BASE,
784 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
785 .flags = IORESOURCE_MEM,
786 },
787 {
788 .name = "sdcc_bam_irq",
789 .start = SDC3_BAM_IRQ,
790 .end = SDC3_BAM_IRQ,
791 .flags = IORESOURCE_IRQ,
792 },
793#endif
794};
795
796static struct resource resources_sdc4[] = {
797 {
798 .name = "core_mem",
799 .flags = IORESOURCE_MEM,
800 .start = MSM_SDC4_BASE,
801 .end = MSM_SDC4_DML_BASE - 1,
802 },
803 {
804 .name = "core_irq",
805 .flags = IORESOURCE_IRQ,
806 .start = SDC4_IRQ_0,
807 .end = SDC4_IRQ_0
808 },
809#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
810 {
811 .name = "sdcc_dml_addr",
812 .start = MSM_SDC4_DML_BASE,
813 .end = MSM_SDC4_BAM_BASE - 1,
814 .flags = IORESOURCE_MEM,
815 },
816 {
817 .name = "sdcc_bam_addr",
818 .start = MSM_SDC4_BAM_BASE,
819 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
820 .flags = IORESOURCE_MEM,
821 },
822 {
823 .name = "sdcc_bam_irq",
824 .start = SDC4_BAM_IRQ,
825 .end = SDC4_BAM_IRQ,
826 .flags = IORESOURCE_IRQ,
827 },
828#endif
829};
830
831static struct resource resources_sdc5[] = {
832 {
833 .name = "core_mem",
834 .flags = IORESOURCE_MEM,
835 .start = MSM_SDC5_BASE,
836 .end = MSM_SDC5_DML_BASE - 1,
837 },
838 {
839 .name = "core_irq",
840 .flags = IORESOURCE_IRQ,
841 .start = SDC5_IRQ_0,
842 .end = SDC5_IRQ_0
843 },
844#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
845 {
846 .name = "sdcc_dml_addr",
847 .start = MSM_SDC5_DML_BASE,
848 .end = MSM_SDC5_BAM_BASE - 1,
849 .flags = IORESOURCE_MEM,
850 },
851 {
852 .name = "sdcc_bam_addr",
853 .start = MSM_SDC5_BAM_BASE,
854 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
855 .flags = IORESOURCE_MEM,
856 },
857 {
858 .name = "sdcc_bam_irq",
859 .start = SDC5_BAM_IRQ,
860 .end = SDC5_BAM_IRQ,
861 .flags = IORESOURCE_IRQ,
862 },
863#endif
864};
865
866struct platform_device msm_device_sdc1 = {
867 .name = "msm_sdcc",
868 .id = 1,
869 .num_resources = ARRAY_SIZE(resources_sdc1),
870 .resource = resources_sdc1,
871 .dev = {
872 .coherent_dma_mask = 0xffffffff,
873 },
874};
875
876struct platform_device msm_device_sdc2 = {
877 .name = "msm_sdcc",
878 .id = 2,
879 .num_resources = ARRAY_SIZE(resources_sdc2),
880 .resource = resources_sdc2,
881 .dev = {
882 .coherent_dma_mask = 0xffffffff,
883 },
884};
885
886struct platform_device msm_device_sdc3 = {
887 .name = "msm_sdcc",
888 .id = 3,
889 .num_resources = ARRAY_SIZE(resources_sdc3),
890 .resource = resources_sdc3,
891 .dev = {
892 .coherent_dma_mask = 0xffffffff,
893 },
894};
895
896struct platform_device msm_device_sdc4 = {
897 .name = "msm_sdcc",
898 .id = 4,
899 .num_resources = ARRAY_SIZE(resources_sdc4),
900 .resource = resources_sdc4,
901 .dev = {
902 .coherent_dma_mask = 0xffffffff,
903 },
904};
905
906struct platform_device msm_device_sdc5 = {
907 .name = "msm_sdcc",
908 .id = 5,
909 .num_resources = ARRAY_SIZE(resources_sdc5),
910 .resource = resources_sdc5,
911 .dev = {
912 .coherent_dma_mask = 0xffffffff,
913 },
914};
915
Stephen Boydeb819882011-08-29 14:46:30 -0700916#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
917#define SFAB_LPASS_Q6_ACLK_CTL (MSM_CLK_CTL_BASE + 0x23A0)
918
919static struct resource msm_8960_q6_lpass_resources[] = {
920 {
921 .start = MSM_LPASS_QDSP6SS_PHYS,
922 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
923 .flags = IORESOURCE_MEM,
924 },
925};
926
927static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
928 .strap_tcm_base = 0x01460000,
929 .strap_ahb_upper = 0x00290000,
930 .strap_ahb_lower = 0x00000280,
931 .aclk_reg = SFAB_LPASS_Q6_ACLK_CTL,
932 .name = "q6",
933 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700934 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700935};
936
937struct platform_device msm_8960_q6_lpass = {
938 .name = "pil_qdsp6v4",
939 .id = 0,
940 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
941 .resource = msm_8960_q6_lpass_resources,
942 .dev.platform_data = &msm_8960_q6_lpass_data,
943};
944
945#define MSM_MSS_ENABLE_PHYS 0x08B00000
946#define MSM_FW_QDSP6SS_PHYS 0x08800000
947#define MSS_Q6FW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C6C)
948#define SFAB_MSS_Q6_FW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2044)
949
950static struct resource msm_8960_q6_mss_fw_resources[] = {
951 {
952 .start = MSM_FW_QDSP6SS_PHYS,
953 .end = MSM_FW_QDSP6SS_PHYS + SZ_256 - 1,
954 .flags = IORESOURCE_MEM,
955 },
956 {
957 .start = MSM_MSS_ENABLE_PHYS,
958 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
959 .flags = IORESOURCE_MEM,
960 },
961};
962
963static struct pil_q6v4_pdata msm_8960_q6_mss_fw_data = {
964 .strap_tcm_base = 0x00400000,
965 .strap_ahb_upper = 0x00090000,
966 .strap_ahb_lower = 0x00000080,
967 .aclk_reg = SFAB_MSS_Q6_FW_ACLK_CTL,
968 .jtag_clk_reg = MSS_Q6FW_JTAG_CLK_CTL,
969 .name = "modem_fw",
970 .depends = "q6",
971 .pas_id = PAS_MODEM_FW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700972 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700973};
974
975struct platform_device msm_8960_q6_mss_fw = {
976 .name = "pil_qdsp6v4",
977 .id = 1,
978 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_fw_resources),
979 .resource = msm_8960_q6_mss_fw_resources,
980 .dev.platform_data = &msm_8960_q6_mss_fw_data,
981};
982
983#define MSM_SW_QDSP6SS_PHYS 0x08900000
984#define SFAB_MSS_Q6_SW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2040)
985#define MSS_Q6SW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C68)
986
987static struct resource msm_8960_q6_mss_sw_resources[] = {
988 {
989 .start = MSM_SW_QDSP6SS_PHYS,
990 .end = MSM_SW_QDSP6SS_PHYS + SZ_256 - 1,
991 .flags = IORESOURCE_MEM,
992 },
993 {
994 .start = MSM_MSS_ENABLE_PHYS,
995 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
996 .flags = IORESOURCE_MEM,
997 },
998};
999
1000static struct pil_q6v4_pdata msm_8960_q6_mss_sw_data = {
1001 .strap_tcm_base = 0x00420000,
1002 .strap_ahb_upper = 0x00090000,
1003 .strap_ahb_lower = 0x00000080,
1004 .aclk_reg = SFAB_MSS_Q6_SW_ACLK_CTL,
1005 .jtag_clk_reg = MSS_Q6SW_JTAG_CLK_CTL,
1006 .name = "modem",
1007 .depends = "modem_fw",
1008 .pas_id = PAS_MODEM_SW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -07001009 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001010};
1011
1012struct platform_device msm_8960_q6_mss_sw = {
1013 .name = "pil_qdsp6v4",
1014 .id = 2,
1015 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_sw_resources),
1016 .resource = msm_8960_q6_mss_sw_resources,
1017 .dev.platform_data = &msm_8960_q6_mss_sw_data,
1018};
1019
Stephen Boyd322a9922011-09-20 01:05:54 -07001020static struct resource msm_8960_riva_resources[] = {
1021 {
1022 .start = 0x03204000,
1023 .end = 0x03204000 + SZ_256 - 1,
1024 .flags = IORESOURCE_MEM,
1025 },
1026};
1027
1028struct platform_device msm_8960_riva = {
1029 .name = "pil_riva",
1030 .id = -1,
1031 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
1032 .resource = msm_8960_riva_resources,
1033};
1034
Stephen Boydd89eebe2011-09-28 23:28:11 -07001035struct platform_device msm_pil_tzapps = {
1036 .name = "pil_tzapps",
1037 .id = -1,
1038};
1039
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001040struct platform_device msm_pil_dsps = {
1041 .name = "pil_dsps",
1042 .id = -1,
1043 .dev.platform_data = "dsps",
1044};
1045
Stephen Boyd7b973de2012-03-09 12:26:16 -08001046struct platform_device msm_pil_vidc = {
1047 .name = "pil_vidc",
1048 .id = -1,
1049};
1050
Eric Holmberg023d25c2012-03-01 12:27:55 -07001051static struct resource smd_resource[] = {
1052 {
1053 .name = "a9_m2a_0",
1054 .start = INT_A9_M2A_0,
1055 .flags = IORESOURCE_IRQ,
1056 },
1057 {
1058 .name = "a9_m2a_5",
1059 .start = INT_A9_M2A_5,
1060 .flags = IORESOURCE_IRQ,
1061 },
1062 {
1063 .name = "adsp_a11",
1064 .start = INT_ADSP_A11,
1065 .flags = IORESOURCE_IRQ,
1066 },
1067 {
1068 .name = "adsp_a11_smsm",
1069 .start = INT_ADSP_A11_SMSM,
1070 .flags = IORESOURCE_IRQ,
1071 },
1072 {
1073 .name = "dsps_a11",
1074 .start = INT_DSPS_A11,
1075 .flags = IORESOURCE_IRQ,
1076 },
1077 {
1078 .name = "dsps_a11_smsm",
1079 .start = INT_DSPS_A11_SMSM,
1080 .flags = IORESOURCE_IRQ,
1081 },
1082 {
1083 .name = "wcnss_a11",
1084 .start = INT_WCNSS_A11,
1085 .flags = IORESOURCE_IRQ,
1086 },
1087 {
1088 .name = "wcnss_a11_smsm",
1089 .start = INT_WCNSS_A11_SMSM,
1090 .flags = IORESOURCE_IRQ,
1091 },
1092};
1093
1094static struct smd_subsystem_config smd_config_list[] = {
1095 {
1096 .irq_config_id = SMD_MODEM,
1097 .subsys_name = "modem",
1098 .edge = SMD_APPS_MODEM,
1099
1100 .smd_int.irq_name = "a9_m2a_0",
1101 .smd_int.flags = IRQF_TRIGGER_RISING,
1102 .smd_int.irq_id = -1,
1103 .smd_int.device_name = "smd_dev",
1104 .smd_int.dev_id = 0,
1105 .smd_int.out_bit_pos = 1 << 3,
1106 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1107 .smd_int.out_offset = 0x8,
1108
1109 .smsm_int.irq_name = "a9_m2a_5",
1110 .smsm_int.flags = IRQF_TRIGGER_RISING,
1111 .smsm_int.irq_id = -1,
1112 .smsm_int.device_name = "smd_smsm",
1113 .smsm_int.dev_id = 0,
1114 .smsm_int.out_bit_pos = 1 << 4,
1115 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1116 .smsm_int.out_offset = 0x8,
1117 },
1118 {
1119 .irq_config_id = SMD_Q6,
1120 .subsys_name = "q6",
1121 .edge = SMD_APPS_QDSP,
1122
1123 .smd_int.irq_name = "adsp_a11",
1124 .smd_int.flags = IRQF_TRIGGER_RISING,
1125 .smd_int.irq_id = -1,
1126 .smd_int.device_name = "smd_dev",
1127 .smd_int.dev_id = 0,
1128 .smd_int.out_bit_pos = 1 << 15,
1129 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1130 .smd_int.out_offset = 0x8,
1131
1132 .smsm_int.irq_name = "adsp_a11_smsm",
1133 .smsm_int.flags = IRQF_TRIGGER_RISING,
1134 .smsm_int.irq_id = -1,
1135 .smsm_int.device_name = "smd_smsm",
1136 .smsm_int.dev_id = 0,
1137 .smsm_int.out_bit_pos = 1 << 14,
1138 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1139 .smsm_int.out_offset = 0x8,
1140 },
1141 {
1142 .irq_config_id = SMD_DSPS,
1143 .subsys_name = "dsps",
1144 .edge = SMD_APPS_DSPS,
1145
1146 .smd_int.irq_name = "dsps_a11",
1147 .smd_int.flags = IRQF_TRIGGER_RISING,
1148 .smd_int.irq_id = -1,
1149 .smd_int.device_name = "smd_dev",
1150 .smd_int.dev_id = 0,
1151 .smd_int.out_bit_pos = 1,
1152 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1153 .smd_int.out_offset = 0x4080,
1154
1155 .smsm_int.irq_name = "dsps_a11_smsm",
1156 .smsm_int.flags = IRQF_TRIGGER_RISING,
1157 .smsm_int.irq_id = -1,
1158 .smsm_int.device_name = "smd_smsm",
1159 .smsm_int.dev_id = 0,
1160 .smsm_int.out_bit_pos = 1,
1161 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1162 .smsm_int.out_offset = 0x4094,
1163 },
1164 {
1165 .irq_config_id = SMD_WCNSS,
1166 .subsys_name = "wcnss",
1167 .edge = SMD_APPS_WCNSS,
1168
1169 .smd_int.irq_name = "wcnss_a11",
1170 .smd_int.flags = IRQF_TRIGGER_RISING,
1171 .smd_int.irq_id = -1,
1172 .smd_int.device_name = "smd_dev",
1173 .smd_int.dev_id = 0,
1174 .smd_int.out_bit_pos = 1 << 25,
1175 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1176 .smd_int.out_offset = 0x8,
1177
1178 .smsm_int.irq_name = "wcnss_a11_smsm",
1179 .smsm_int.flags = IRQF_TRIGGER_RISING,
1180 .smsm_int.irq_id = -1,
1181 .smsm_int.device_name = "smd_smsm",
1182 .smsm_int.dev_id = 0,
1183 .smsm_int.out_bit_pos = 1 << 23,
1184 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1185 .smsm_int.out_offset = 0x8,
1186 },
1187};
1188
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001189static struct smd_subsystem_restart_config smd_ssr_config = {
1190 .disable_smsm_reset_handshake = 1,
1191};
1192
Eric Holmberg023d25c2012-03-01 12:27:55 -07001193static struct smd_platform smd_platform_data = {
1194 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1195 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001196 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001197};
1198
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001199struct platform_device msm_device_smd = {
1200 .name = "msm_smd",
1201 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001202 .resource = smd_resource,
1203 .num_resources = ARRAY_SIZE(smd_resource),
1204 .dev = {
1205 .platform_data = &smd_platform_data,
1206 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001207};
1208
1209struct platform_device msm_device_bam_dmux = {
1210 .name = "BAM_RMNT",
1211 .id = -1,
1212};
1213
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001214static struct msm_watchdog_pdata msm_watchdog_pdata = {
1215 .pet_time = 10000,
1216 .bark_time = 11000,
1217 .has_secure = true,
1218};
1219
1220struct platform_device msm8960_device_watchdog = {
1221 .name = "msm_watchdog",
1222 .id = -1,
1223 .dev = {
1224 .platform_data = &msm_watchdog_pdata,
1225 },
1226};
1227
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001228static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001229 {
1230 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001231 .flags = IORESOURCE_IRQ,
1232 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001233 {
1234 .start = 0x18320000,
1235 .end = 0x18320000 + SZ_1M - 1,
1236 .flags = IORESOURCE_MEM,
1237 },
1238};
1239
1240static struct msm_dmov_pdata msm_dmov_pdata = {
1241 .sd = 1,
1242 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001243};
1244
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001245struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001246 .name = "msm_dmov",
1247 .id = -1,
1248 .resource = msm_dmov_resource,
1249 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001250 .dev = {
1251 .platform_data = &msm_dmov_pdata,
1252 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001253};
1254
1255static struct platform_device *msm_sdcc_devices[] __initdata = {
1256 &msm_device_sdc1,
1257 &msm_device_sdc2,
1258 &msm_device_sdc3,
1259 &msm_device_sdc4,
1260 &msm_device_sdc5,
1261};
1262
1263int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1264{
1265 struct platform_device *pdev;
1266
1267 if (controller < 1 || controller > 5)
1268 return -EINVAL;
1269
1270 pdev = msm_sdcc_devices[controller-1];
1271 pdev->dev.platform_data = plat;
1272 return platform_device_register(pdev);
1273}
1274
1275static struct resource resources_qup_i2c_gsbi4[] = {
1276 {
1277 .name = "gsbi_qup_i2c_addr",
1278 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001279 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001280 .flags = IORESOURCE_MEM,
1281 },
1282 {
1283 .name = "qup_phys_addr",
1284 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001285 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001286 .flags = IORESOURCE_MEM,
1287 },
1288 {
1289 .name = "qup_err_intr",
1290 .start = GSBI4_QUP_IRQ,
1291 .end = GSBI4_QUP_IRQ,
1292 .flags = IORESOURCE_IRQ,
1293 },
1294};
1295
1296struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1297 .name = "qup_i2c",
1298 .id = 4,
1299 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1300 .resource = resources_qup_i2c_gsbi4,
1301};
1302
1303static struct resource resources_qup_i2c_gsbi3[] = {
1304 {
1305 .name = "gsbi_qup_i2c_addr",
1306 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001307 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001308 .flags = IORESOURCE_MEM,
1309 },
1310 {
1311 .name = "qup_phys_addr",
1312 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001313 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001314 .flags = IORESOURCE_MEM,
1315 },
1316 {
1317 .name = "qup_err_intr",
1318 .start = GSBI3_QUP_IRQ,
1319 .end = GSBI3_QUP_IRQ,
1320 .flags = IORESOURCE_IRQ,
1321 },
1322};
1323
1324struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1325 .name = "qup_i2c",
1326 .id = 3,
1327 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1328 .resource = resources_qup_i2c_gsbi3,
1329};
1330
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06001331static struct resource resources_qup_i2c_gsbi9[] = {
1332 {
1333 .name = "gsbi_qup_i2c_addr",
1334 .start = MSM_GSBI9_PHYS,
1335 .end = MSM_GSBI9_PHYS + 4 - 1,
1336 .flags = IORESOURCE_MEM,
1337 },
1338 {
1339 .name = "qup_phys_addr",
1340 .start = MSM_GSBI9_QUP_PHYS,
1341 .end = MSM_GSBI9_QUP_PHYS + MSM_QUP_SIZE - 1,
1342 .flags = IORESOURCE_MEM,
1343 },
1344 {
1345 .name = "qup_err_intr",
1346 .start = GSBI9_QUP_IRQ,
1347 .end = GSBI9_QUP_IRQ,
1348 .flags = IORESOURCE_IRQ,
1349 },
1350};
1351
1352struct platform_device msm8960_device_qup_i2c_gsbi9 = {
1353 .name = "qup_i2c",
1354 .id = 0,
1355 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi9),
1356 .resource = resources_qup_i2c_gsbi9,
1357};
1358
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001359static struct resource resources_qup_i2c_gsbi10[] = {
1360 {
1361 .name = "gsbi_qup_i2c_addr",
1362 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001363 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001364 .flags = IORESOURCE_MEM,
1365 },
1366 {
1367 .name = "qup_phys_addr",
1368 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001369 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001370 .flags = IORESOURCE_MEM,
1371 },
1372 {
1373 .name = "qup_err_intr",
1374 .start = GSBI10_QUP_IRQ,
1375 .end = GSBI10_QUP_IRQ,
1376 .flags = IORESOURCE_IRQ,
1377 },
1378};
1379
1380struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1381 .name = "qup_i2c",
1382 .id = 10,
1383 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1384 .resource = resources_qup_i2c_gsbi10,
1385};
1386
1387static struct resource resources_qup_i2c_gsbi12[] = {
1388 {
1389 .name = "gsbi_qup_i2c_addr",
1390 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001391 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001392 .flags = IORESOURCE_MEM,
1393 },
1394 {
1395 .name = "qup_phys_addr",
1396 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001397 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001398 .flags = IORESOURCE_MEM,
1399 },
1400 {
1401 .name = "qup_err_intr",
1402 .start = GSBI12_QUP_IRQ,
1403 .end = GSBI12_QUP_IRQ,
1404 .flags = IORESOURCE_IRQ,
1405 },
1406};
1407
1408struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1409 .name = "qup_i2c",
1410 .id = 12,
1411 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1412 .resource = resources_qup_i2c_gsbi12,
1413};
1414
1415#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001416static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001417 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001418 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301419 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001420 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301421 .flags = IORESOURCE_MEM,
1422 },
1423 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001424 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301425 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001426 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301427 .flags = IORESOURCE_MEM,
1428 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001429};
1430
Kevin Chanbb8ef862012-02-14 13:03:04 -08001431struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1432 .name = "msm_cam_i2c_mux",
1433 .id = 0,
1434 .resource = msm_cam_gsbi4_i2c_mux_resources,
1435 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1436};
Kevin Chanf6216f22011-10-25 18:40:11 -07001437
1438static struct resource msm_csiphy0_resources[] = {
1439 {
1440 .name = "csiphy",
1441 .start = 0x04800C00,
1442 .end = 0x04800C00 + SZ_1K - 1,
1443 .flags = IORESOURCE_MEM,
1444 },
1445 {
1446 .name = "csiphy",
1447 .start = CSIPHY_4LN_IRQ,
1448 .end = CSIPHY_4LN_IRQ,
1449 .flags = IORESOURCE_IRQ,
1450 },
1451};
1452
1453static struct resource msm_csiphy1_resources[] = {
1454 {
1455 .name = "csiphy",
1456 .start = 0x04801000,
1457 .end = 0x04801000 + SZ_1K - 1,
1458 .flags = IORESOURCE_MEM,
1459 },
1460 {
1461 .name = "csiphy",
1462 .start = MSM8960_CSIPHY_2LN_IRQ,
1463 .end = MSM8960_CSIPHY_2LN_IRQ,
1464 .flags = IORESOURCE_IRQ,
1465 },
1466};
1467
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001468static struct resource msm_csiphy2_resources[] = {
1469 {
1470 .name = "csiphy",
1471 .start = 0x04801400,
1472 .end = 0x04801400 + SZ_1K - 1,
1473 .flags = IORESOURCE_MEM,
1474 },
1475 {
1476 .name = "csiphy",
1477 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1478 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1479 .flags = IORESOURCE_IRQ,
1480 },
1481};
1482
Kevin Chanf6216f22011-10-25 18:40:11 -07001483struct platform_device msm8960_device_csiphy0 = {
1484 .name = "msm_csiphy",
1485 .id = 0,
1486 .resource = msm_csiphy0_resources,
1487 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
1488};
1489
1490struct platform_device msm8960_device_csiphy1 = {
1491 .name = "msm_csiphy",
1492 .id = 1,
1493 .resource = msm_csiphy1_resources,
1494 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
1495};
Kevin Chanc8b52e82011-10-25 23:20:21 -07001496
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001497struct platform_device msm8960_device_csiphy2 = {
1498 .name = "msm_csiphy",
1499 .id = 2,
1500 .resource = msm_csiphy2_resources,
1501 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
1502};
1503
Kevin Chanc8b52e82011-10-25 23:20:21 -07001504static struct resource msm_csid0_resources[] = {
1505 {
1506 .name = "csid",
1507 .start = 0x04800000,
1508 .end = 0x04800000 + SZ_1K - 1,
1509 .flags = IORESOURCE_MEM,
1510 },
1511 {
1512 .name = "csid",
1513 .start = CSI_0_IRQ,
1514 .end = CSI_0_IRQ,
1515 .flags = IORESOURCE_IRQ,
1516 },
1517};
1518
1519static struct resource msm_csid1_resources[] = {
1520 {
1521 .name = "csid",
1522 .start = 0x04800400,
1523 .end = 0x04800400 + SZ_1K - 1,
1524 .flags = IORESOURCE_MEM,
1525 },
1526 {
1527 .name = "csid",
1528 .start = CSI_1_IRQ,
1529 .end = CSI_1_IRQ,
1530 .flags = IORESOURCE_IRQ,
1531 },
1532};
1533
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001534static struct resource msm_csid2_resources[] = {
1535 {
1536 .name = "csid",
1537 .start = 0x04801800,
1538 .end = 0x04801800 + SZ_1K - 1,
1539 .flags = IORESOURCE_MEM,
1540 },
1541 {
1542 .name = "csid",
1543 .start = CSI_2_IRQ,
1544 .end = CSI_2_IRQ,
1545 .flags = IORESOURCE_IRQ,
1546 },
1547};
1548
Kevin Chanc8b52e82011-10-25 23:20:21 -07001549struct platform_device msm8960_device_csid0 = {
1550 .name = "msm_csid",
1551 .id = 0,
1552 .resource = msm_csid0_resources,
1553 .num_resources = ARRAY_SIZE(msm_csid0_resources),
1554};
1555
1556struct platform_device msm8960_device_csid1 = {
1557 .name = "msm_csid",
1558 .id = 1,
1559 .resource = msm_csid1_resources,
1560 .num_resources = ARRAY_SIZE(msm_csid1_resources),
1561};
Kevin Chane12c6672011-10-26 11:55:26 -07001562
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001563struct platform_device msm8960_device_csid2 = {
1564 .name = "msm_csid",
1565 .id = 2,
1566 .resource = msm_csid2_resources,
1567 .num_resources = ARRAY_SIZE(msm_csid2_resources),
1568};
1569
Kevin Chane12c6672011-10-26 11:55:26 -07001570struct resource msm_ispif_resources[] = {
1571 {
1572 .name = "ispif",
1573 .start = 0x04800800,
1574 .end = 0x04800800 + SZ_1K - 1,
1575 .flags = IORESOURCE_MEM,
1576 },
1577 {
1578 .name = "ispif",
1579 .start = ISPIF_IRQ,
1580 .end = ISPIF_IRQ,
1581 .flags = IORESOURCE_IRQ,
1582 },
1583};
1584
1585struct platform_device msm8960_device_ispif = {
1586 .name = "msm_ispif",
1587 .id = 0,
1588 .resource = msm_ispif_resources,
1589 .num_resources = ARRAY_SIZE(msm_ispif_resources),
1590};
Kevin Chan5827c552011-10-28 18:36:32 -07001591
1592static struct resource msm_vfe_resources[] = {
1593 {
1594 .name = "vfe32",
1595 .start = 0x04500000,
1596 .end = 0x04500000 + SZ_1M - 1,
1597 .flags = IORESOURCE_MEM,
1598 },
1599 {
1600 .name = "vfe32",
1601 .start = VFE_IRQ,
1602 .end = VFE_IRQ,
1603 .flags = IORESOURCE_IRQ,
1604 },
1605};
1606
1607struct platform_device msm8960_device_vfe = {
1608 .name = "msm_vfe",
1609 .id = 0,
1610 .resource = msm_vfe_resources,
1611 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1612};
Kevin Chana0853122011-11-07 19:48:44 -08001613
1614static struct resource msm_vpe_resources[] = {
1615 {
1616 .name = "vpe",
1617 .start = 0x05300000,
1618 .end = 0x05300000 + SZ_1M - 1,
1619 .flags = IORESOURCE_MEM,
1620 },
1621 {
1622 .name = "vpe",
1623 .start = VPE_IRQ,
1624 .end = VPE_IRQ,
1625 .flags = IORESOURCE_IRQ,
1626 },
1627};
1628
1629struct platform_device msm8960_device_vpe = {
1630 .name = "msm_vpe",
1631 .id = 0,
1632 .resource = msm_vpe_resources,
1633 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1634};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001635#endif
1636
Joel Nidera1261942011-09-12 16:30:09 +03001637#define MSM_TSIF0_PHYS (0x18200000)
1638#define MSM_TSIF1_PHYS (0x18201000)
1639#define MSM_TSIF_SIZE (0x200)
1640
1641#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
1642 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1643#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
1644 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1645#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
1646 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1647#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
1648 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1649#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
1650 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1651#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
1652 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1653#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
1654 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1655#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
1656 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1657
1658static const struct msm_gpio tsif0_gpios[] = {
1659 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1660 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1661 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1662 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1663};
1664
1665static const struct msm_gpio tsif1_gpios[] = {
1666 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1667 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1668 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1669 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1670};
1671
1672struct msm_tsif_platform_data tsif1_platform_data = {
1673 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1674 .gpios = tsif1_gpios,
1675 .tsif_pclk = "tsif_pclk",
1676 .tsif_ref_clk = "tsif_ref_clk",
1677};
1678
1679struct resource tsif1_resources[] = {
1680 [0] = {
1681 .flags = IORESOURCE_IRQ,
1682 .start = TSIF2_IRQ,
1683 .end = TSIF2_IRQ,
1684 },
1685 [1] = {
1686 .flags = IORESOURCE_MEM,
1687 .start = MSM_TSIF1_PHYS,
1688 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1689 },
1690 [2] = {
1691 .flags = IORESOURCE_DMA,
1692 .start = DMOV_TSIF_CHAN,
1693 .end = DMOV_TSIF_CRCI,
1694 },
1695};
1696
1697struct msm_tsif_platform_data tsif0_platform_data = {
1698 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1699 .gpios = tsif0_gpios,
1700 .tsif_pclk = "tsif_pclk",
1701 .tsif_ref_clk = "tsif_ref_clk",
1702};
1703struct resource tsif0_resources[] = {
1704 [0] = {
1705 .flags = IORESOURCE_IRQ,
1706 .start = TSIF1_IRQ,
1707 .end = TSIF1_IRQ,
1708 },
1709 [1] = {
1710 .flags = IORESOURCE_MEM,
1711 .start = MSM_TSIF0_PHYS,
1712 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1713 },
1714 [2] = {
1715 .flags = IORESOURCE_DMA,
1716 .start = DMOV_TSIF_CHAN,
1717 .end = DMOV_TSIF_CRCI,
1718 },
1719};
1720
1721struct platform_device msm_device_tsif[2] = {
1722 {
1723 .name = "msm_tsif",
1724 .id = 0,
1725 .num_resources = ARRAY_SIZE(tsif0_resources),
1726 .resource = tsif0_resources,
1727 .dev = {
1728 .platform_data = &tsif0_platform_data
1729 },
1730 },
1731 {
1732 .name = "msm_tsif",
1733 .id = 1,
1734 .num_resources = ARRAY_SIZE(tsif1_resources),
1735 .resource = tsif1_resources,
1736 .dev = {
1737 .platform_data = &tsif1_platform_data
1738 },
1739 }
1740};
1741
Jay Chokshi33c044a2011-12-07 13:05:40 -08001742static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001743 {
1744 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1745 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1746 .flags = IORESOURCE_MEM,
1747 },
1748};
1749
Jay Chokshi33c044a2011-12-07 13:05:40 -08001750struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001751 .name = "msm_ssbi",
1752 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08001753 .resource = resources_ssbi_pmic,
1754 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001755};
1756
1757static struct resource resources_qup_spi_gsbi1[] = {
1758 {
1759 .name = "spi_base",
1760 .start = MSM_GSBI1_QUP_PHYS,
1761 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1762 .flags = IORESOURCE_MEM,
1763 },
1764 {
1765 .name = "gsbi_base",
1766 .start = MSM_GSBI1_PHYS,
1767 .end = MSM_GSBI1_PHYS + 4 - 1,
1768 .flags = IORESOURCE_MEM,
1769 },
1770 {
1771 .name = "spi_irq_in",
1772 .start = MSM8960_GSBI1_QUP_IRQ,
1773 .end = MSM8960_GSBI1_QUP_IRQ,
1774 .flags = IORESOURCE_IRQ,
1775 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001776 {
1777 .name = "spi_clk",
1778 .start = 9,
1779 .end = 9,
1780 .flags = IORESOURCE_IO,
1781 },
1782 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001783 .name = "spi_miso",
1784 .start = 7,
1785 .end = 7,
1786 .flags = IORESOURCE_IO,
1787 },
1788 {
1789 .name = "spi_mosi",
1790 .start = 6,
1791 .end = 6,
1792 .flags = IORESOURCE_IO,
1793 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07001794 {
1795 .name = "spi_cs",
1796 .start = 8,
1797 .end = 8,
1798 .flags = IORESOURCE_IO,
1799 },
1800 {
1801 .name = "spi_cs1",
1802 .start = 14,
1803 .end = 14,
1804 .flags = IORESOURCE_IO,
1805 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001806};
1807
1808struct platform_device msm8960_device_qup_spi_gsbi1 = {
1809 .name = "spi_qsd",
1810 .id = 0,
1811 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1812 .resource = resources_qup_spi_gsbi1,
1813};
1814
1815struct platform_device msm_pcm = {
1816 .name = "msm-pcm-dsp",
1817 .id = -1,
1818};
1819
Kiran Kandi5e809b02012-01-31 00:24:33 -08001820struct platform_device msm_multi_ch_pcm = {
1821 .name = "msm-multi-ch-pcm-dsp",
1822 .id = -1,
1823};
1824
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001825struct platform_device msm_pcm_routing = {
1826 .name = "msm-pcm-routing",
1827 .id = -1,
1828};
1829
1830struct platform_device msm_cpudai0 = {
1831 .name = "msm-dai-q6",
1832 .id = 0x4000,
1833};
1834
1835struct platform_device msm_cpudai1 = {
1836 .name = "msm-dai-q6",
1837 .id = 0x4001,
1838};
1839
Kiran Kandi1e6371d2012-03-29 11:48:57 -07001840struct platform_device msm8960_cpudai_slimbus_2_tx = {
1841 .name = "msm-dai-q6",
1842 .id = 0x4005,
1843};
1844
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001845struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001846 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001847 .id = 8,
1848};
1849
1850struct platform_device msm_cpudai_bt_rx = {
1851 .name = "msm-dai-q6",
1852 .id = 0x3000,
1853};
1854
1855struct platform_device msm_cpudai_bt_tx = {
1856 .name = "msm-dai-q6",
1857 .id = 0x3001,
1858};
1859
1860struct platform_device msm_cpudai_fm_rx = {
1861 .name = "msm-dai-q6",
1862 .id = 0x3004,
1863};
1864
1865struct platform_device msm_cpudai_fm_tx = {
1866 .name = "msm-dai-q6",
1867 .id = 0x3005,
1868};
1869
Helen Zeng0705a5f2011-10-14 15:29:52 -07001870struct platform_device msm_cpudai_incall_music_rx = {
1871 .name = "msm-dai-q6",
1872 .id = 0x8005,
1873};
1874
Helen Zenge3d716a2011-10-14 16:32:16 -07001875struct platform_device msm_cpudai_incall_record_rx = {
1876 .name = "msm-dai-q6",
1877 .id = 0x8004,
1878};
1879
1880struct platform_device msm_cpudai_incall_record_tx = {
1881 .name = "msm-dai-q6",
1882 .id = 0x8003,
1883};
1884
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001885/*
1886 * Machine specific data for AUX PCM Interface
1887 * which the driver will be unware of.
1888 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001889struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001890 .clk = "pcm_clk",
1891 .mode = AFE_PCM_CFG_MODE_PCM,
1892 .sync = AFE_PCM_CFG_SYNC_INT,
1893 .frame = AFE_PCM_CFG_FRM_256BPF,
1894 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1895 .slot = 0,
1896 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1897 .pcm_clk_rate = 2048000,
1898};
1899
1900struct platform_device msm_cpudai_auxpcm_rx = {
1901 .name = "msm-dai-q6",
1902 .id = 2,
1903 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001904 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001905 },
1906};
1907
1908struct platform_device msm_cpudai_auxpcm_tx = {
1909 .name = "msm-dai-q6",
1910 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001911 .dev = {
1912 .platform_data = &auxpcm_pdata,
1913 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001914};
1915
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001916struct platform_device msm_cpu_fe = {
1917 .name = "msm-dai-fe",
1918 .id = -1,
1919};
1920
1921struct platform_device msm_stub_codec = {
1922 .name = "msm-stub-codec",
1923 .id = 1,
1924};
1925
1926struct platform_device msm_voice = {
1927 .name = "msm-pcm-voice",
1928 .id = -1,
1929};
1930
1931struct platform_device msm_voip = {
1932 .name = "msm-voip-dsp",
1933 .id = -1,
1934};
1935
1936struct platform_device msm_lpa_pcm = {
1937 .name = "msm-pcm-lpa",
1938 .id = -1,
1939};
1940
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301941struct platform_device msm_compr_dsp = {
1942 .name = "msm-compr-dsp",
1943 .id = -1,
1944};
1945
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001946struct platform_device msm_pcm_hostless = {
1947 .name = "msm-pcm-hostless",
1948 .id = -1,
1949};
1950
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301951struct platform_device msm_cpudai_afe_01_rx = {
1952 .name = "msm-dai-q6",
1953 .id = 0xE0,
1954};
1955
1956struct platform_device msm_cpudai_afe_01_tx = {
1957 .name = "msm-dai-q6",
1958 .id = 0xF0,
1959};
1960
1961struct platform_device msm_cpudai_afe_02_rx = {
1962 .name = "msm-dai-q6",
1963 .id = 0xF1,
1964};
1965
1966struct platform_device msm_cpudai_afe_02_tx = {
1967 .name = "msm-dai-q6",
1968 .id = 0xE1,
1969};
1970
1971struct platform_device msm_pcm_afe = {
1972 .name = "msm-pcm-afe",
1973 .id = -1,
1974};
1975
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001976struct platform_device *msm_footswitch_devices[] = {
Ravishangar Kalyanamb31a0e42012-01-19 16:02:34 -08001977 FS_8X60(FS_MDP, "fs_mdp"),
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001978 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001979 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1980 FS_8X60(FS_VFE, "fs_vfe"),
1981 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001982 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1983 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1984 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001985 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001986};
1987unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1988
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001989
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001990#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001991static struct msm_bus_vectors rotator_init_vectors[] = {
1992 {
1993 .src = MSM_BUS_MASTER_ROTATOR,
1994 .dst = MSM_BUS_SLAVE_EBI_CH0,
1995 .ab = 0,
1996 .ib = 0,
1997 },
1998};
1999
2000static struct msm_bus_vectors rotator_ui_vectors[] = {
2001 {
2002 .src = MSM_BUS_MASTER_ROTATOR,
2003 .dst = MSM_BUS_SLAVE_EBI_CH0,
2004 .ab = (1024 * 600 * 4 * 2 * 60),
2005 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
2006 },
2007};
2008
2009static struct msm_bus_vectors rotator_vga_vectors[] = {
2010 {
2011 .src = MSM_BUS_MASTER_ROTATOR,
2012 .dst = MSM_BUS_SLAVE_EBI_CH0,
2013 .ab = (640 * 480 * 2 * 2 * 30),
2014 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
2015 },
2016};
2017static struct msm_bus_vectors rotator_720p_vectors[] = {
2018 {
2019 .src = MSM_BUS_MASTER_ROTATOR,
2020 .dst = MSM_BUS_SLAVE_EBI_CH0,
2021 .ab = (1280 * 736 * 2 * 2 * 30),
2022 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
2023 },
2024};
2025
2026static struct msm_bus_vectors rotator_1080p_vectors[] = {
2027 {
2028 .src = MSM_BUS_MASTER_ROTATOR,
2029 .dst = MSM_BUS_SLAVE_EBI_CH0,
2030 .ab = (1920 * 1088 * 2 * 2 * 30),
2031 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
2032 },
2033};
2034
2035static struct msm_bus_paths rotator_bus_scale_usecases[] = {
2036 {
2037 ARRAY_SIZE(rotator_init_vectors),
2038 rotator_init_vectors,
2039 },
2040 {
2041 ARRAY_SIZE(rotator_ui_vectors),
2042 rotator_ui_vectors,
2043 },
2044 {
2045 ARRAY_SIZE(rotator_vga_vectors),
2046 rotator_vga_vectors,
2047 },
2048 {
2049 ARRAY_SIZE(rotator_720p_vectors),
2050 rotator_720p_vectors,
2051 },
2052 {
2053 ARRAY_SIZE(rotator_1080p_vectors),
2054 rotator_1080p_vectors,
2055 },
2056};
2057
2058struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2059 rotator_bus_scale_usecases,
2060 ARRAY_SIZE(rotator_bus_scale_usecases),
2061 .name = "rotator",
2062};
2063
2064void __init msm_rotator_update_bus_vectors(unsigned int xres,
2065 unsigned int yres)
2066{
2067 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2068 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2069}
2070
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002071#define ROTATOR_HW_BASE 0x04E00000
2072static struct resource resources_msm_rotator[] = {
2073 {
2074 .start = ROTATOR_HW_BASE,
2075 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2076 .flags = IORESOURCE_MEM,
2077 },
2078 {
2079 .start = ROT_IRQ,
2080 .end = ROT_IRQ,
2081 .flags = IORESOURCE_IRQ,
2082 },
2083};
2084
2085static struct msm_rot_clocks rotator_clocks[] = {
2086 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002087 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002088 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002089 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002090 },
2091 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002092 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002093 .clk_type = ROTATOR_PCLK,
2094 .clk_rate = 0,
2095 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002096};
2097
2098static struct msm_rotator_platform_data rotator_pdata = {
2099 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2100 .hardware_version_number = 0x01020309,
2101 .rotator_clks = rotator_clocks,
2102 .regulator_name = "fs_rot",
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002103#ifdef CONFIG_MSM_BUS_SCALING
2104 .bus_scale_table = &rotator_bus_scale_pdata,
2105#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002106};
2107
2108struct platform_device msm_rotator_device = {
2109 .name = "msm_rotator",
2110 .id = 0,
2111 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2112 .resource = resources_msm_rotator,
2113 .dev = {
2114 .platform_data = &rotator_pdata,
2115 },
2116};
2117#endif
2118
2119#define MIPI_DSI_HW_BASE 0x04700000
2120#define MDP_HW_BASE 0x05100000
2121
2122static struct resource msm_mipi_dsi1_resources[] = {
2123 {
2124 .name = "mipi_dsi",
2125 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002126 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002127 .flags = IORESOURCE_MEM,
2128 },
2129 {
2130 .start = DSI1_IRQ,
2131 .end = DSI1_IRQ,
2132 .flags = IORESOURCE_IRQ,
2133 },
2134};
2135
2136struct platform_device msm_mipi_dsi1_device = {
2137 .name = "mipi_dsi",
2138 .id = 1,
2139 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2140 .resource = msm_mipi_dsi1_resources,
2141};
2142
2143static struct resource msm_mdp_resources[] = {
2144 {
2145 .name = "mdp",
2146 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002147 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002148 .flags = IORESOURCE_MEM,
2149 },
2150 {
2151 .start = MDP_IRQ,
2152 .end = MDP_IRQ,
2153 .flags = IORESOURCE_IRQ,
2154 },
2155};
2156
2157static struct platform_device msm_mdp_device = {
2158 .name = "mdp",
2159 .id = 0,
2160 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2161 .resource = msm_mdp_resources,
2162};
2163
2164static void __init msm_register_device(struct platform_device *pdev, void *data)
2165{
2166 int ret;
2167
2168 pdev->dev.platform_data = data;
2169 ret = platform_device_register(pdev);
2170 if (ret)
2171 dev_err(&pdev->dev,
2172 "%s: platform_device_register() failed = %d\n",
2173 __func__, ret);
2174}
2175
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002176#ifdef CONFIG_MSM_BUS_SCALING
2177static struct platform_device msm_dtv_device = {
2178 .name = "dtv",
2179 .id = 0,
2180};
2181#endif
2182
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002183struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002184 .name = "lvds",
2185 .id = 0,
2186};
2187
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002188void __init msm_fb_register_device(char *name, void *data)
2189{
2190 if (!strncmp(name, "mdp", 3))
2191 msm_register_device(&msm_mdp_device, data);
2192 else if (!strncmp(name, "mipi_dsi", 8))
2193 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002194 else if (!strncmp(name, "lvds", 4))
2195 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002196#ifdef CONFIG_MSM_BUS_SCALING
2197 else if (!strncmp(name, "dtv", 3))
2198 msm_register_device(&msm_dtv_device, data);
2199#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002200 else
2201 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2202}
2203
2204static struct resource resources_sps[] = {
2205 {
2206 .name = "pipe_mem",
2207 .start = 0x12800000,
2208 .end = 0x12800000 + 0x4000 - 1,
2209 .flags = IORESOURCE_MEM,
2210 },
2211 {
2212 .name = "bamdma_dma",
2213 .start = 0x12240000,
2214 .end = 0x12240000 + 0x1000 - 1,
2215 .flags = IORESOURCE_MEM,
2216 },
2217 {
2218 .name = "bamdma_bam",
2219 .start = 0x12244000,
2220 .end = 0x12244000 + 0x4000 - 1,
2221 .flags = IORESOURCE_MEM,
2222 },
2223 {
2224 .name = "bamdma_irq",
2225 .start = SPS_BAM_DMA_IRQ,
2226 .end = SPS_BAM_DMA_IRQ,
2227 .flags = IORESOURCE_IRQ,
2228 },
2229};
2230
2231struct msm_sps_platform_data msm_sps_pdata = {
2232 .bamdma_restricted_pipes = 0x06,
2233};
2234
2235struct platform_device msm_device_sps = {
2236 .name = "msm_sps",
2237 .id = -1,
2238 .num_resources = ARRAY_SIZE(resources_sps),
2239 .resource = resources_sps,
2240 .dev.platform_data = &msm_sps_pdata,
2241};
2242
2243#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002244static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002245 [1] = MSM_GPIO_TO_INT(46),
2246 [2] = MSM_GPIO_TO_INT(150),
2247 [4] = MSM_GPIO_TO_INT(103),
2248 [5] = MSM_GPIO_TO_INT(104),
2249 [6] = MSM_GPIO_TO_INT(105),
2250 [7] = MSM_GPIO_TO_INT(106),
2251 [8] = MSM_GPIO_TO_INT(107),
2252 [9] = MSM_GPIO_TO_INT(7),
2253 [10] = MSM_GPIO_TO_INT(11),
2254 [11] = MSM_GPIO_TO_INT(15),
2255 [12] = MSM_GPIO_TO_INT(19),
2256 [13] = MSM_GPIO_TO_INT(23),
2257 [14] = MSM_GPIO_TO_INT(27),
2258 [15] = MSM_GPIO_TO_INT(31),
2259 [16] = MSM_GPIO_TO_INT(35),
2260 [19] = MSM_GPIO_TO_INT(90),
2261 [20] = MSM_GPIO_TO_INT(92),
2262 [23] = MSM_GPIO_TO_INT(85),
2263 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002264 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002265 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002266 [29] = MSM_GPIO_TO_INT(10),
2267 [30] = MSM_GPIO_TO_INT(102),
2268 [31] = MSM_GPIO_TO_INT(81),
2269 [32] = MSM_GPIO_TO_INT(78),
2270 [33] = MSM_GPIO_TO_INT(94),
2271 [34] = MSM_GPIO_TO_INT(72),
2272 [35] = MSM_GPIO_TO_INT(39),
2273 [36] = MSM_GPIO_TO_INT(43),
2274 [37] = MSM_GPIO_TO_INT(61),
2275 [38] = MSM_GPIO_TO_INT(50),
2276 [39] = MSM_GPIO_TO_INT(42),
2277 [41] = MSM_GPIO_TO_INT(62),
2278 [42] = MSM_GPIO_TO_INT(76),
2279 [43] = MSM_GPIO_TO_INT(75),
2280 [44] = MSM_GPIO_TO_INT(70),
2281 [45] = MSM_GPIO_TO_INT(69),
2282 [46] = MSM_GPIO_TO_INT(67),
2283 [47] = MSM_GPIO_TO_INT(65),
2284 [48] = MSM_GPIO_TO_INT(58),
2285 [49] = MSM_GPIO_TO_INT(54),
2286 [50] = MSM_GPIO_TO_INT(52),
2287 [51] = MSM_GPIO_TO_INT(49),
2288 [52] = MSM_GPIO_TO_INT(40),
2289 [53] = MSM_GPIO_TO_INT(37),
2290 [54] = MSM_GPIO_TO_INT(24),
2291 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002292};
2293
Praveen Chidambaram78499012011-11-01 17:15:17 -06002294static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002295 TLMM_MSM_SUMMARY_IRQ,
2296 RPM_APCC_CPU0_GP_HIGH_IRQ,
2297 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2298 RPM_APCC_CPU0_GP_LOW_IRQ,
2299 RPM_APCC_CPU0_WAKE_UP_IRQ,
2300 RPM_APCC_CPU1_GP_HIGH_IRQ,
2301 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2302 RPM_APCC_CPU1_GP_LOW_IRQ,
2303 RPM_APCC_CPU1_WAKE_UP_IRQ,
2304 MSS_TO_APPS_IRQ_0,
2305 MSS_TO_APPS_IRQ_1,
2306 MSS_TO_APPS_IRQ_2,
2307 MSS_TO_APPS_IRQ_3,
2308 MSS_TO_APPS_IRQ_4,
2309 MSS_TO_APPS_IRQ_5,
2310 MSS_TO_APPS_IRQ_6,
2311 MSS_TO_APPS_IRQ_7,
2312 MSS_TO_APPS_IRQ_8,
2313 MSS_TO_APPS_IRQ_9,
2314 LPASS_SCSS_GP_LOW_IRQ,
2315 LPASS_SCSS_GP_MEDIUM_IRQ,
2316 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002317 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002318 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002319 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002320 RIVA_APPS_WLAN_SMSM_IRQ,
2321 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2322 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002323};
2324
Praveen Chidambaram78499012011-11-01 17:15:17 -06002325struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002326 .irqs_m2a = msm_mpm_irqs_m2a,
2327 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2328 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2329 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2330 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2331 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2332 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2333 .mpm_apps_ipc_val = BIT(1),
2334 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2335
2336};
2337#endif
2338
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002339#define LPASS_SLIMBUS_PHYS 0x28080000
2340#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002341#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002342/* Board info for the slimbus slave device */
2343static struct resource slimbus_res[] = {
2344 {
2345 .start = LPASS_SLIMBUS_PHYS,
2346 .end = LPASS_SLIMBUS_PHYS + 8191,
2347 .flags = IORESOURCE_MEM,
2348 .name = "slimbus_physical",
2349 },
2350 {
2351 .start = LPASS_SLIMBUS_BAM_PHYS,
2352 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2353 .flags = IORESOURCE_MEM,
2354 .name = "slimbus_bam_physical",
2355 },
2356 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002357 .start = LPASS_SLIMBUS_SLEW,
2358 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2359 .flags = IORESOURCE_MEM,
2360 .name = "slimbus_slew_reg",
2361 },
2362 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002363 .start = SLIMBUS0_CORE_EE1_IRQ,
2364 .end = SLIMBUS0_CORE_EE1_IRQ,
2365 .flags = IORESOURCE_IRQ,
2366 .name = "slimbus_irq",
2367 },
2368 {
2369 .start = SLIMBUS0_BAM_EE1_IRQ,
2370 .end = SLIMBUS0_BAM_EE1_IRQ,
2371 .flags = IORESOURCE_IRQ,
2372 .name = "slimbus_bam_irq",
2373 },
2374};
2375
2376struct platform_device msm_slim_ctrl = {
2377 .name = "msm_slim_ctrl",
2378 .id = 1,
2379 .num_resources = ARRAY_SIZE(slimbus_res),
2380 .resource = slimbus_res,
2381 .dev = {
2382 .coherent_dma_mask = 0xffffffffULL,
2383 },
2384};
2385
Lucille Sylvester6e362412011-12-09 16:21:42 -07002386static struct msm_dcvs_freq_entry grp3d_freq[] = {
2387 {0, 0, 333932},
2388 {0, 0, 497532},
2389 {0, 0, 707610},
2390 {0, 0, 844545},
2391};
2392
2393static struct msm_dcvs_freq_entry grp2d_freq[] = {
2394 {0, 0, 86000},
2395 {0, 0, 200000},
2396};
2397
2398static struct msm_dcvs_core_info grp3d_core_info = {
2399 .freq_tbl = &grp3d_freq[0],
2400 .core_param = {
2401 .max_time_us = 100000,
2402 .num_freq = ARRAY_SIZE(grp3d_freq),
2403 },
2404 .algo_param = {
2405 .slack_time_us = 39000,
2406 .disable_pc_threshold = 86000,
2407 .ss_window_size = 1000000,
2408 .ss_util_pct = 95,
2409 .em_max_util_pct = 97,
2410 .ss_iobusy_conv = 100,
2411 },
2412};
2413
2414static struct msm_dcvs_core_info grp2d_core_info = {
2415 .freq_tbl = &grp2d_freq[0],
2416 .core_param = {
2417 .max_time_us = 100000,
2418 .num_freq = ARRAY_SIZE(grp2d_freq),
2419 },
2420 .algo_param = {
2421 .slack_time_us = 39000,
2422 .disable_pc_threshold = 90000,
2423 .ss_window_size = 1000000,
2424 .ss_util_pct = 90,
2425 .em_max_util_pct = 95,
2426 },
2427};
2428
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002429#ifdef CONFIG_MSM_BUS_SCALING
2430static struct msm_bus_vectors grp3d_init_vectors[] = {
2431 {
2432 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2433 .dst = MSM_BUS_SLAVE_EBI_CH0,
2434 .ab = 0,
2435 .ib = 0,
2436 },
2437};
2438
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002439static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002440 {
2441 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2442 .dst = MSM_BUS_SLAVE_EBI_CH0,
2443 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002444 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002445 },
2446};
2447
2448static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2449 {
2450 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2451 .dst = MSM_BUS_SLAVE_EBI_CH0,
2452 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002453 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002454 },
2455};
2456
2457static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2458 {
2459 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2460 .dst = MSM_BUS_SLAVE_EBI_CH0,
2461 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002462 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002463 },
2464};
2465
2466static struct msm_bus_vectors grp3d_max_vectors[] = {
2467 {
2468 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2469 .dst = MSM_BUS_SLAVE_EBI_CH0,
2470 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002471 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002472 },
2473};
2474
2475static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2476 {
2477 ARRAY_SIZE(grp3d_init_vectors),
2478 grp3d_init_vectors,
2479 },
2480 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002481 ARRAY_SIZE(grp3d_low_vectors),
2482 grp3d_low_vectors,
2483 },
2484 {
2485 ARRAY_SIZE(grp3d_nominal_low_vectors),
2486 grp3d_nominal_low_vectors,
2487 },
2488 {
2489 ARRAY_SIZE(grp3d_nominal_high_vectors),
2490 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002491 },
2492 {
2493 ARRAY_SIZE(grp3d_max_vectors),
2494 grp3d_max_vectors,
2495 },
2496};
2497
2498static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2499 grp3d_bus_scale_usecases,
2500 ARRAY_SIZE(grp3d_bus_scale_usecases),
2501 .name = "grp3d",
2502};
2503
2504static struct msm_bus_vectors grp2d0_init_vectors[] = {
2505 {
2506 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2507 .dst = MSM_BUS_SLAVE_EBI_CH0,
2508 .ab = 0,
2509 .ib = 0,
2510 },
2511};
2512
Lucille Sylvester808eca22011-11-03 10:26:29 -07002513static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002514 {
2515 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2516 .dst = MSM_BUS_SLAVE_EBI_CH0,
2517 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002518 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002519 },
2520};
2521
Lucille Sylvester808eca22011-11-03 10:26:29 -07002522static struct msm_bus_vectors grp2d0_max_vectors[] = {
2523 {
2524 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2525 .dst = MSM_BUS_SLAVE_EBI_CH0,
2526 .ab = 0,
2527 .ib = KGSL_CONVERT_TO_MBPS(2048),
2528 },
2529};
2530
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002531static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2532 {
2533 ARRAY_SIZE(grp2d0_init_vectors),
2534 grp2d0_init_vectors,
2535 },
2536 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002537 ARRAY_SIZE(grp2d0_nominal_vectors),
2538 grp2d0_nominal_vectors,
2539 },
2540 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002541 ARRAY_SIZE(grp2d0_max_vectors),
2542 grp2d0_max_vectors,
2543 },
2544};
2545
2546struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2547 grp2d0_bus_scale_usecases,
2548 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2549 .name = "grp2d0",
2550};
2551
2552static struct msm_bus_vectors grp2d1_init_vectors[] = {
2553 {
2554 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2555 .dst = MSM_BUS_SLAVE_EBI_CH0,
2556 .ab = 0,
2557 .ib = 0,
2558 },
2559};
2560
Lucille Sylvester808eca22011-11-03 10:26:29 -07002561static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002562 {
2563 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2564 .dst = MSM_BUS_SLAVE_EBI_CH0,
2565 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002566 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002567 },
2568};
2569
Lucille Sylvester808eca22011-11-03 10:26:29 -07002570static struct msm_bus_vectors grp2d1_max_vectors[] = {
2571 {
2572 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2573 .dst = MSM_BUS_SLAVE_EBI_CH0,
2574 .ab = 0,
2575 .ib = KGSL_CONVERT_TO_MBPS(2048),
2576 },
2577};
2578
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002579static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2580 {
2581 ARRAY_SIZE(grp2d1_init_vectors),
2582 grp2d1_init_vectors,
2583 },
2584 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002585 ARRAY_SIZE(grp2d1_nominal_vectors),
2586 grp2d1_nominal_vectors,
2587 },
2588 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002589 ARRAY_SIZE(grp2d1_max_vectors),
2590 grp2d1_max_vectors,
2591 },
2592};
2593
2594struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2595 grp2d1_bus_scale_usecases,
2596 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2597 .name = "grp2d1",
2598};
2599#endif
2600
2601static struct resource kgsl_3d0_resources[] = {
2602 {
2603 .name = KGSL_3D0_REG_MEMORY,
2604 .start = 0x04300000, /* GFX3D address */
2605 .end = 0x0431ffff,
2606 .flags = IORESOURCE_MEM,
2607 },
2608 {
2609 .name = KGSL_3D0_IRQ,
2610 .start = GFX3D_IRQ,
2611 .end = GFX3D_IRQ,
2612 .flags = IORESOURCE_IRQ,
2613 },
2614};
2615
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002616static const char *kgsl_3d0_iommu_ctx_names[] = {
2617 "gfx3d_user",
2618 /* priv_ctx goes here */
2619};
2620
2621static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2622 {
2623 .iommu_ctx_names = kgsl_3d0_iommu_ctx_names,
2624 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctx_names),
2625 .physstart = 0x07C00000,
2626 .physend = 0x07C00000 + SZ_1M - 1,
2627 },
2628};
2629
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002630static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002631 .pwrlevel = {
2632 {
2633 .gpu_freq = 400000000,
2634 .bus_freq = 4,
2635 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002636 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002637 {
2638 .gpu_freq = 300000000,
2639 .bus_freq = 3,
2640 .io_fraction = 33,
2641 },
2642 {
2643 .gpu_freq = 200000000,
2644 .bus_freq = 2,
2645 .io_fraction = 100,
2646 },
2647 {
2648 .gpu_freq = 128000000,
2649 .bus_freq = 1,
2650 .io_fraction = 100,
2651 },
2652 {
2653 .gpu_freq = 27000000,
2654 .bus_freq = 0,
2655 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002656 },
Lucille Sylvester67b4c532012-02-08 11:24:31 -08002657 .init_level = 1,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002658 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002659 .set_grp_async = NULL,
Lucille Sylvester5dc67512012-03-27 15:07:58 -06002660 .idle_timeout = HZ/12,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002661 .nap_allowed = true,
2662 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002663#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002664 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002665#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002666 .iommu_data = kgsl_3d0_iommu_data,
2667 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002668 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002669};
2670
2671struct platform_device msm_kgsl_3d0 = {
2672 .name = "kgsl-3d0",
2673 .id = 0,
2674 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2675 .resource = kgsl_3d0_resources,
2676 .dev = {
2677 .platform_data = &kgsl_3d0_pdata,
2678 },
2679};
2680
2681static struct resource kgsl_2d0_resources[] = {
2682 {
2683 .name = KGSL_2D0_REG_MEMORY,
2684 .start = 0x04100000, /* Z180 base address */
2685 .end = 0x04100FFF,
2686 .flags = IORESOURCE_MEM,
2687 },
2688 {
2689 .name = KGSL_2D0_IRQ,
2690 .start = GFX2D0_IRQ,
2691 .end = GFX2D0_IRQ,
2692 .flags = IORESOURCE_IRQ,
2693 },
2694};
2695
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002696static const char *kgsl_2d0_iommu_ctx_names[] = {
2697 "gfx2d0_2d0",
2698};
2699
2700static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2701 {
2702 .iommu_ctx_names = kgsl_2d0_iommu_ctx_names,
2703 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctx_names),
2704 .physstart = 0x07D00000,
2705 .physend = 0x07D00000 + SZ_1M - 1,
2706 },
2707};
2708
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002709static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002710 .pwrlevel = {
2711 {
2712 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002713 .bus_freq = 2,
2714 },
2715 {
2716 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002717 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002718 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002719 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002720 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002721 .bus_freq = 0,
2722 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002723 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002724 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002725 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002726 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002727 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002728 .nap_allowed = true,
2729 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002730#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002731 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002732#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002733 .iommu_data = kgsl_2d0_iommu_data,
2734 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002735 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002736};
2737
2738struct platform_device msm_kgsl_2d0 = {
2739 .name = "kgsl-2d0",
2740 .id = 0,
2741 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2742 .resource = kgsl_2d0_resources,
2743 .dev = {
2744 .platform_data = &kgsl_2d0_pdata,
2745 },
2746};
2747
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002748static const char *kgsl_2d1_iommu_ctx_names[] = {
Jeremy Gebben5c4c1132012-02-27 11:26:49 -07002749 "gfx2d1_2d1",
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002750};
2751
2752static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2753 {
2754 .iommu_ctx_names = kgsl_2d1_iommu_ctx_names,
2755 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctx_names),
2756 .physstart = 0x07E00000,
2757 .physend = 0x07E00000 + SZ_1M - 1,
2758 },
2759};
2760
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002761static struct resource kgsl_2d1_resources[] = {
2762 {
2763 .name = KGSL_2D1_REG_MEMORY,
2764 .start = 0x04200000, /* Z180 device 1 base address */
2765 .end = 0x04200FFF,
2766 .flags = IORESOURCE_MEM,
2767 },
2768 {
2769 .name = KGSL_2D1_IRQ,
2770 .start = GFX2D1_IRQ,
2771 .end = GFX2D1_IRQ,
2772 .flags = IORESOURCE_IRQ,
2773 },
2774};
2775
2776static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002777 .pwrlevel = {
2778 {
2779 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002780 .bus_freq = 2,
2781 },
2782 {
2783 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002784 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002785 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002786 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002787 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002788 .bus_freq = 0,
2789 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002790 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002791 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002792 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002793 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002794 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002795 .nap_allowed = true,
2796 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002797#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002798 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002799#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002800 .iommu_data = kgsl_2d1_iommu_data,
2801 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002802 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002803};
2804
2805struct platform_device msm_kgsl_2d1 = {
2806 .name = "kgsl-2d1",
2807 .id = 1,
2808 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2809 .resource = kgsl_2d1_resources,
2810 .dev = {
2811 .platform_data = &kgsl_2d1_pdata,
2812 },
2813};
2814
2815#ifdef CONFIG_MSM_GEMINI
2816static struct resource msm_gemini_resources[] = {
2817 {
2818 .start = 0x04600000,
2819 .end = 0x04600000 + SZ_1M - 1,
2820 .flags = IORESOURCE_MEM,
2821 },
2822 {
2823 .start = JPEG_IRQ,
2824 .end = JPEG_IRQ,
2825 .flags = IORESOURCE_IRQ,
2826 },
2827};
2828
2829struct platform_device msm8960_gemini_device = {
2830 .name = "msm_gemini",
2831 .resource = msm_gemini_resources,
2832 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2833};
2834#endif
2835
Praveen Chidambaram78499012011-11-01 17:15:17 -06002836struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
2837 .reg_base_addrs = {
2838 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2839 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2840 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2841 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2842 },
2843 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002844 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06002845 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002846 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2847 .ipc_rpm_val = 4,
2848 .target_id = {
2849 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2850 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2851 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
2852 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2853 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2854 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
2855 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
2856 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
2857 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2858 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2859 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2860 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2861 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
2862 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
2863 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
2864 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
2865 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
2866 APPS_FABRIC_CFG_HALT, 2),
2867 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
2868 APPS_FABRIC_CFG_CLKMOD, 3),
2869 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
2870 APPS_FABRIC_CFG_IOCTL, 1),
2871 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2872 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
2873 SYS_FABRIC_CFG_HALT, 2),
2874 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
2875 SYS_FABRIC_CFG_CLKMOD, 3),
2876 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
2877 SYS_FABRIC_CFG_IOCTL, 1),
2878 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
2879 SYSTEM_FABRIC_ARB, 29),
2880 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
2881 MMSS_FABRIC_CFG_HALT, 2),
2882 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
2883 MMSS_FABRIC_CFG_CLKMOD, 3),
2884 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
2885 MMSS_FABRIC_CFG_IOCTL, 1),
2886 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
2887 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
2888 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
2889 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
2890 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
2891 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
2892 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
2893 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
2894 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
2895 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
2896 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
2897 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
2898 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
2899 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
2900 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
2901 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
2902 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
2903 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
2904 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
2905 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
2906 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
2907 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
2908 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
2909 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
2910 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
2911 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
2912 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
2913 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
2914 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
2915 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
2916 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
2917 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
2918 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
2919 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
2920 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
2921 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
2922 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
2923 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
2924 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
2925 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
2926 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
2927 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
2928 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
2929 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
2930 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
2931 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
2932 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
2933 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
2934 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
2935 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2936 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
2937 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
2938 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
2939 },
2940 .target_status = {
2941 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
2942 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
2943 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
2944 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
2945 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
2946 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
2947 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
2948 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
2949 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
2950 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
2951 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
2952 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
2953 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
2954 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
2955 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
2956 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
2957 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
2958 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
2959 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
2960 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
2961 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
2962 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
2963 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
2964 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
2965 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
2966 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
2967 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
2968 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
2969 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
2970 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
2971 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
2972 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
2973 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
2974 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
2975 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
2976 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
2977 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
2978 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
2979 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
2980 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
2981 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
2982 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
2983 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
2984 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
2985 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
2986 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
2987 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
2988 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
2989 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
2990 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
2991 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
2992 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
2993 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
2994 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
2995 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
2996 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
2997 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
2998 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
2999 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3000 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3001 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3002 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3003 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3004 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3005 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3006 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3007 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3008 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3009 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3010 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3011 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3012 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3013 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3014 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3015 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3016 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3017 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3018 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3019 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3020 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3021 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3022 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3023 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3024 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3025 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3026 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3027 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3028 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3029 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3030 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3031 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3032 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3033 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3034 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3035 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3036 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3037 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3038 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3039 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3040 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3041 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3042 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3043 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3044 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3045 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3046 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3047 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3048 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3049 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3050 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3051 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3052 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3053 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3054 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3055 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3056 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3057 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3058 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3059 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3060 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3061 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3062 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3063 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3064 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3065 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3066 },
3067 .target_ctrl_id = {
3068 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3069 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3070 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3071 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3072 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3073 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3074 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3075 },
3076 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3077 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3078 .sel_last = MSM_RPM_8960_SEL_LAST,
3079 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003080};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003081
Praveen Chidambaram78499012011-11-01 17:15:17 -06003082struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003083 .name = "msm_rpm",
3084 .id = -1,
3085};
3086
Praveen Chidambaram78499012011-11-01 17:15:17 -06003087static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3088 .phys_addr_base = 0x0010C000,
3089 .reg_offsets = {
3090 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3091 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3092 },
3093 .phys_size = SZ_8K,
3094 .log_len = 4096, /* log's buffer length in bytes */
3095 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3096};
3097
3098struct platform_device msm8960_rpm_log_device = {
3099 .name = "msm_rpm_log",
3100 .id = -1,
3101 .dev = {
3102 .platform_data = &msm_rpm_log_pdata,
3103 },
3104};
3105
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003106static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
3107 .phys_addr_base = 0x0010D204,
3108 .phys_size = SZ_8K,
3109};
3110
Praveen Chidambaram78499012011-11-01 17:15:17 -06003111struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003112 .name = "msm_rpm_stat",
3113 .id = -1,
3114 .dev = {
3115 .platform_data = &msm_rpm_stat_pdata,
3116 },
3117};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003118
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003119struct platform_device msm_bus_sys_fabric = {
3120 .name = "msm_bus_fabric",
3121 .id = MSM_BUS_FAB_SYSTEM,
3122};
3123struct platform_device msm_bus_apps_fabric = {
3124 .name = "msm_bus_fabric",
3125 .id = MSM_BUS_FAB_APPSS,
3126};
3127struct platform_device msm_bus_mm_fabric = {
3128 .name = "msm_bus_fabric",
3129 .id = MSM_BUS_FAB_MMSS,
3130};
3131struct platform_device msm_bus_sys_fpb = {
3132 .name = "msm_bus_fabric",
3133 .id = MSM_BUS_FAB_SYSTEM_FPB,
3134};
3135struct platform_device msm_bus_cpss_fpb = {
3136 .name = "msm_bus_fabric",
3137 .id = MSM_BUS_FAB_CPSS_FPB,
3138};
3139
3140/* Sensors DSPS platform data */
3141#ifdef CONFIG_MSM_DSPS
3142
3143#define PPSS_REG_PHYS_BASE 0x12080000
3144
3145static struct dsps_clk_info dsps_clks[] = {};
3146static struct dsps_regulator_info dsps_regs[] = {};
3147
3148/*
3149 * Note: GPIOs field is intialized in run-time at the function
3150 * msm8960_init_dsps().
3151 */
3152
3153struct msm_dsps_platform_data msm_dsps_pdata = {
3154 .clks = dsps_clks,
3155 .clks_num = ARRAY_SIZE(dsps_clks),
3156 .gpios = NULL,
3157 .gpios_num = 0,
3158 .regs = dsps_regs,
3159 .regs_num = ARRAY_SIZE(dsps_regs),
3160 .dsps_pwr_ctl_en = 1,
3161 .signature = DSPS_SIGNATURE,
3162};
3163
3164static struct resource msm_dsps_resources[] = {
3165 {
3166 .start = PPSS_REG_PHYS_BASE,
3167 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
3168 .name = "ppss_reg",
3169 .flags = IORESOURCE_MEM,
3170 },
Wentao Xua55500b2011-08-16 18:15:04 -04003171
3172 {
3173 .start = PPSS_WDOG_TIMER_IRQ,
3174 .end = PPSS_WDOG_TIMER_IRQ,
3175 .name = "ppss_wdog",
3176 .flags = IORESOURCE_IRQ,
3177 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003178};
3179
3180struct platform_device msm_dsps_device = {
3181 .name = "msm_dsps",
3182 .id = 0,
3183 .num_resources = ARRAY_SIZE(msm_dsps_resources),
3184 .resource = msm_dsps_resources,
3185 .dev.platform_data = &msm_dsps_pdata,
3186};
3187
3188#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07003189
3190#ifdef CONFIG_MSM_QDSS
3191
3192#define MSM_QDSS_PHYS_BASE 0x01A00000
3193#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
3194#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
3195#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
Pratik Patel492b3012012-03-06 14:22:30 -08003196#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
Pratik Patel7831c082011-06-08 21:44:37 -07003197
Pratik Patel1403f2a2012-03-21 10:10:00 -07003198#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
3199
3200static struct qdss_source msm_qdss_sources[] = {
3201 QDSS_SOURCE("msm_etm", 0x3),
3202};
3203
3204static struct msm_qdss_platform_data qdss_pdata = {
3205 .src_table = msm_qdss_sources,
3206 .size = ARRAY_SIZE(msm_qdss_sources),
3207 .afamily = 1,
3208};
3209
3210struct platform_device msm_qdss_device = {
3211 .name = "msm_qdss",
3212 .id = -1,
3213 .dev = {
3214 .platform_data = &qdss_pdata,
3215 },
3216};
3217
Pratik Patel7831c082011-06-08 21:44:37 -07003218static struct resource msm_etb_resources[] = {
3219 {
3220 .start = MSM_ETB_PHYS_BASE,
3221 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
3222 .flags = IORESOURCE_MEM,
3223 },
3224};
3225
3226struct platform_device msm_etb_device = {
3227 .name = "msm_etb",
3228 .id = 0,
3229 .num_resources = ARRAY_SIZE(msm_etb_resources),
3230 .resource = msm_etb_resources,
3231};
3232
3233static struct resource msm_tpiu_resources[] = {
3234 {
3235 .start = MSM_TPIU_PHYS_BASE,
3236 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
3237 .flags = IORESOURCE_MEM,
3238 },
3239};
3240
3241struct platform_device msm_tpiu_device = {
3242 .name = "msm_tpiu",
3243 .id = 0,
3244 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
3245 .resource = msm_tpiu_resources,
3246};
3247
3248static struct resource msm_funnel_resources[] = {
3249 {
3250 .start = MSM_FUNNEL_PHYS_BASE,
3251 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
3252 .flags = IORESOURCE_MEM,
3253 },
3254};
3255
3256struct platform_device msm_funnel_device = {
3257 .name = "msm_funnel",
3258 .id = 0,
3259 .num_resources = ARRAY_SIZE(msm_funnel_resources),
3260 .resource = msm_funnel_resources,
3261};
3262
Pratik Patel492b3012012-03-06 14:22:30 -08003263static struct resource msm_etm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07003264 {
Pratik Patel492b3012012-03-06 14:22:30 -08003265 .start = MSM_ETM_PHYS_BASE,
3266 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 2) - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07003267 .flags = IORESOURCE_MEM,
3268 },
3269};
3270
Pratik Patel492b3012012-03-06 14:22:30 -08003271struct platform_device msm_etm_device = {
3272 .name = "msm_etm",
Pratik Patel7831c082011-06-08 21:44:37 -07003273 .id = 0,
Pratik Patel492b3012012-03-06 14:22:30 -08003274 .num_resources = ARRAY_SIZE(msm_etm_resources),
3275 .resource = msm_etm_resources,
Pratik Patel7831c082011-06-08 21:44:37 -07003276};
3277
3278#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07003279
3280static int msm8960_LPM_latency = 1000; /* >100 usec for WFI */
3281
3282struct platform_device msm8960_cpu_idle_device = {
3283 .name = "msm_cpu_idle",
3284 .id = -1,
3285 .dev = {
3286 .platform_data = &msm8960_LPM_latency,
3287 },
3288};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07003289
3290static struct msm_dcvs_freq_entry msm8960_freq[] = {
3291 { 384000, 166981, 345600},
3292 { 702000, 213049, 632502},
3293 {1026000, 285712, 925613},
3294 {1242000, 383945, 1176550},
3295 {1458000, 419729, 1465478},
3296 {1512000, 434116, 1546674},
3297
3298};
3299
3300static struct msm_dcvs_core_info msm8960_core_info = {
3301 .freq_tbl = &msm8960_freq[0],
3302 .core_param = {
3303 .max_time_us = 100000,
3304 .num_freq = ARRAY_SIZE(msm8960_freq),
3305 },
3306 .algo_param = {
3307 .slack_time_us = 58000,
3308 .scale_slack_time = 0,
3309 .scale_slack_time_pct = 0,
3310 .disable_pc_threshold = 1458000,
3311 .em_window_size = 100000,
3312 .em_max_util_pct = 97,
3313 .ss_window_size = 1000000,
3314 .ss_util_pct = 95,
3315 .ss_iobusy_conv = 100,
3316 },
3317};
3318
3319struct platform_device msm8960_msm_gov_device = {
3320 .name = "msm_dcvs_gov",
3321 .id = -1,
3322 .dev = {
3323 .platform_data = &msm8960_core_info,
3324 },
3325};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003326
3327static struct resource msm_cache_erp_resources[] = {
3328 {
3329 .name = "l1_irq",
3330 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3331 .flags = IORESOURCE_IRQ,
3332 },
3333 {
3334 .name = "l2_irq",
3335 .start = APCC_QGICL2IRPTREQ,
3336 .flags = IORESOURCE_IRQ,
3337 }
3338};
3339
3340struct platform_device msm8960_device_cache_erp = {
3341 .name = "msm_cache_erp",
3342 .id = -1,
3343 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3344 .resource = msm_cache_erp_resources,
3345};