blob: 99f778104d162a448bf8b032258c12e1a787fa3d [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
1840struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001841 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001842 .id = 8,
1843};
1844
1845struct platform_device msm_cpudai_bt_rx = {
1846 .name = "msm-dai-q6",
1847 .id = 0x3000,
1848};
1849
1850struct platform_device msm_cpudai_bt_tx = {
1851 .name = "msm-dai-q6",
1852 .id = 0x3001,
1853};
1854
1855struct platform_device msm_cpudai_fm_rx = {
1856 .name = "msm-dai-q6",
1857 .id = 0x3004,
1858};
1859
1860struct platform_device msm_cpudai_fm_tx = {
1861 .name = "msm-dai-q6",
1862 .id = 0x3005,
1863};
1864
Helen Zeng0705a5f2011-10-14 15:29:52 -07001865struct platform_device msm_cpudai_incall_music_rx = {
1866 .name = "msm-dai-q6",
1867 .id = 0x8005,
1868};
1869
Helen Zenge3d716a2011-10-14 16:32:16 -07001870struct platform_device msm_cpudai_incall_record_rx = {
1871 .name = "msm-dai-q6",
1872 .id = 0x8004,
1873};
1874
1875struct platform_device msm_cpudai_incall_record_tx = {
1876 .name = "msm-dai-q6",
1877 .id = 0x8003,
1878};
1879
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001880/*
1881 * Machine specific data for AUX PCM Interface
1882 * which the driver will be unware of.
1883 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001884struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001885 .clk = "pcm_clk",
1886 .mode = AFE_PCM_CFG_MODE_PCM,
1887 .sync = AFE_PCM_CFG_SYNC_INT,
1888 .frame = AFE_PCM_CFG_FRM_256BPF,
1889 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1890 .slot = 0,
1891 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1892 .pcm_clk_rate = 2048000,
1893};
1894
1895struct platform_device msm_cpudai_auxpcm_rx = {
1896 .name = "msm-dai-q6",
1897 .id = 2,
1898 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001899 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001900 },
1901};
1902
1903struct platform_device msm_cpudai_auxpcm_tx = {
1904 .name = "msm-dai-q6",
1905 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001906 .dev = {
1907 .platform_data = &auxpcm_pdata,
1908 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001909};
1910
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001911struct platform_device msm_cpu_fe = {
1912 .name = "msm-dai-fe",
1913 .id = -1,
1914};
1915
1916struct platform_device msm_stub_codec = {
1917 .name = "msm-stub-codec",
1918 .id = 1,
1919};
1920
1921struct platform_device msm_voice = {
1922 .name = "msm-pcm-voice",
1923 .id = -1,
1924};
1925
1926struct platform_device msm_voip = {
1927 .name = "msm-voip-dsp",
1928 .id = -1,
1929};
1930
1931struct platform_device msm_lpa_pcm = {
1932 .name = "msm-pcm-lpa",
1933 .id = -1,
1934};
1935
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301936struct platform_device msm_compr_dsp = {
1937 .name = "msm-compr-dsp",
1938 .id = -1,
1939};
1940
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001941struct platform_device msm_pcm_hostless = {
1942 .name = "msm-pcm-hostless",
1943 .id = -1,
1944};
1945
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301946struct platform_device msm_cpudai_afe_01_rx = {
1947 .name = "msm-dai-q6",
1948 .id = 0xE0,
1949};
1950
1951struct platform_device msm_cpudai_afe_01_tx = {
1952 .name = "msm-dai-q6",
1953 .id = 0xF0,
1954};
1955
1956struct platform_device msm_cpudai_afe_02_rx = {
1957 .name = "msm-dai-q6",
1958 .id = 0xF1,
1959};
1960
1961struct platform_device msm_cpudai_afe_02_tx = {
1962 .name = "msm-dai-q6",
1963 .id = 0xE1,
1964};
1965
1966struct platform_device msm_pcm_afe = {
1967 .name = "msm-pcm-afe",
1968 .id = -1,
1969};
1970
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001971struct platform_device *msm_footswitch_devices[] = {
Ravishangar Kalyanamb31a0e42012-01-19 16:02:34 -08001972 FS_8X60(FS_MDP, "fs_mdp"),
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001973 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001974 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1975 FS_8X60(FS_VFE, "fs_vfe"),
1976 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001977 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1978 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1979 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001980 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001981};
1982unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1983
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001984
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001985#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001986static struct msm_bus_vectors rotator_init_vectors[] = {
1987 {
1988 .src = MSM_BUS_MASTER_ROTATOR,
1989 .dst = MSM_BUS_SLAVE_EBI_CH0,
1990 .ab = 0,
1991 .ib = 0,
1992 },
1993};
1994
1995static struct msm_bus_vectors rotator_ui_vectors[] = {
1996 {
1997 .src = MSM_BUS_MASTER_ROTATOR,
1998 .dst = MSM_BUS_SLAVE_EBI_CH0,
1999 .ab = (1024 * 600 * 4 * 2 * 60),
2000 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
2001 },
2002};
2003
2004static struct msm_bus_vectors rotator_vga_vectors[] = {
2005 {
2006 .src = MSM_BUS_MASTER_ROTATOR,
2007 .dst = MSM_BUS_SLAVE_EBI_CH0,
2008 .ab = (640 * 480 * 2 * 2 * 30),
2009 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
2010 },
2011};
2012static struct msm_bus_vectors rotator_720p_vectors[] = {
2013 {
2014 .src = MSM_BUS_MASTER_ROTATOR,
2015 .dst = MSM_BUS_SLAVE_EBI_CH0,
2016 .ab = (1280 * 736 * 2 * 2 * 30),
2017 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
2018 },
2019};
2020
2021static struct msm_bus_vectors rotator_1080p_vectors[] = {
2022 {
2023 .src = MSM_BUS_MASTER_ROTATOR,
2024 .dst = MSM_BUS_SLAVE_EBI_CH0,
2025 .ab = (1920 * 1088 * 2 * 2 * 30),
2026 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
2027 },
2028};
2029
2030static struct msm_bus_paths rotator_bus_scale_usecases[] = {
2031 {
2032 ARRAY_SIZE(rotator_init_vectors),
2033 rotator_init_vectors,
2034 },
2035 {
2036 ARRAY_SIZE(rotator_ui_vectors),
2037 rotator_ui_vectors,
2038 },
2039 {
2040 ARRAY_SIZE(rotator_vga_vectors),
2041 rotator_vga_vectors,
2042 },
2043 {
2044 ARRAY_SIZE(rotator_720p_vectors),
2045 rotator_720p_vectors,
2046 },
2047 {
2048 ARRAY_SIZE(rotator_1080p_vectors),
2049 rotator_1080p_vectors,
2050 },
2051};
2052
2053struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2054 rotator_bus_scale_usecases,
2055 ARRAY_SIZE(rotator_bus_scale_usecases),
2056 .name = "rotator",
2057};
2058
2059void __init msm_rotator_update_bus_vectors(unsigned int xres,
2060 unsigned int yres)
2061{
2062 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2063 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2064}
2065
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002066#define ROTATOR_HW_BASE 0x04E00000
2067static struct resource resources_msm_rotator[] = {
2068 {
2069 .start = ROTATOR_HW_BASE,
2070 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2071 .flags = IORESOURCE_MEM,
2072 },
2073 {
2074 .start = ROT_IRQ,
2075 .end = ROT_IRQ,
2076 .flags = IORESOURCE_IRQ,
2077 },
2078};
2079
2080static struct msm_rot_clocks rotator_clocks[] = {
2081 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002082 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002083 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002084 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002085 },
2086 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002087 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002088 .clk_type = ROTATOR_PCLK,
2089 .clk_rate = 0,
2090 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002091};
2092
2093static struct msm_rotator_platform_data rotator_pdata = {
2094 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2095 .hardware_version_number = 0x01020309,
2096 .rotator_clks = rotator_clocks,
2097 .regulator_name = "fs_rot",
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002098#ifdef CONFIG_MSM_BUS_SCALING
2099 .bus_scale_table = &rotator_bus_scale_pdata,
2100#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002101};
2102
2103struct platform_device msm_rotator_device = {
2104 .name = "msm_rotator",
2105 .id = 0,
2106 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2107 .resource = resources_msm_rotator,
2108 .dev = {
2109 .platform_data = &rotator_pdata,
2110 },
2111};
2112#endif
2113
2114#define MIPI_DSI_HW_BASE 0x04700000
2115#define MDP_HW_BASE 0x05100000
2116
2117static struct resource msm_mipi_dsi1_resources[] = {
2118 {
2119 .name = "mipi_dsi",
2120 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002121 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002122 .flags = IORESOURCE_MEM,
2123 },
2124 {
2125 .start = DSI1_IRQ,
2126 .end = DSI1_IRQ,
2127 .flags = IORESOURCE_IRQ,
2128 },
2129};
2130
2131struct platform_device msm_mipi_dsi1_device = {
2132 .name = "mipi_dsi",
2133 .id = 1,
2134 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2135 .resource = msm_mipi_dsi1_resources,
2136};
2137
2138static struct resource msm_mdp_resources[] = {
2139 {
2140 .name = "mdp",
2141 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002142 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002143 .flags = IORESOURCE_MEM,
2144 },
2145 {
2146 .start = MDP_IRQ,
2147 .end = MDP_IRQ,
2148 .flags = IORESOURCE_IRQ,
2149 },
2150};
2151
2152static struct platform_device msm_mdp_device = {
2153 .name = "mdp",
2154 .id = 0,
2155 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2156 .resource = msm_mdp_resources,
2157};
2158
2159static void __init msm_register_device(struct platform_device *pdev, void *data)
2160{
2161 int ret;
2162
2163 pdev->dev.platform_data = data;
2164 ret = platform_device_register(pdev);
2165 if (ret)
2166 dev_err(&pdev->dev,
2167 "%s: platform_device_register() failed = %d\n",
2168 __func__, ret);
2169}
2170
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002171#ifdef CONFIG_MSM_BUS_SCALING
2172static struct platform_device msm_dtv_device = {
2173 .name = "dtv",
2174 .id = 0,
2175};
2176#endif
2177
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002178struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002179 .name = "lvds",
2180 .id = 0,
2181};
2182
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002183void __init msm_fb_register_device(char *name, void *data)
2184{
2185 if (!strncmp(name, "mdp", 3))
2186 msm_register_device(&msm_mdp_device, data);
2187 else if (!strncmp(name, "mipi_dsi", 8))
2188 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002189 else if (!strncmp(name, "lvds", 4))
2190 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002191#ifdef CONFIG_MSM_BUS_SCALING
2192 else if (!strncmp(name, "dtv", 3))
2193 msm_register_device(&msm_dtv_device, data);
2194#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002195 else
2196 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2197}
2198
2199static struct resource resources_sps[] = {
2200 {
2201 .name = "pipe_mem",
2202 .start = 0x12800000,
2203 .end = 0x12800000 + 0x4000 - 1,
2204 .flags = IORESOURCE_MEM,
2205 },
2206 {
2207 .name = "bamdma_dma",
2208 .start = 0x12240000,
2209 .end = 0x12240000 + 0x1000 - 1,
2210 .flags = IORESOURCE_MEM,
2211 },
2212 {
2213 .name = "bamdma_bam",
2214 .start = 0x12244000,
2215 .end = 0x12244000 + 0x4000 - 1,
2216 .flags = IORESOURCE_MEM,
2217 },
2218 {
2219 .name = "bamdma_irq",
2220 .start = SPS_BAM_DMA_IRQ,
2221 .end = SPS_BAM_DMA_IRQ,
2222 .flags = IORESOURCE_IRQ,
2223 },
2224};
2225
2226struct msm_sps_platform_data msm_sps_pdata = {
2227 .bamdma_restricted_pipes = 0x06,
2228};
2229
2230struct platform_device msm_device_sps = {
2231 .name = "msm_sps",
2232 .id = -1,
2233 .num_resources = ARRAY_SIZE(resources_sps),
2234 .resource = resources_sps,
2235 .dev.platform_data = &msm_sps_pdata,
2236};
2237
2238#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002239static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002240 [1] = MSM_GPIO_TO_INT(46),
2241 [2] = MSM_GPIO_TO_INT(150),
2242 [4] = MSM_GPIO_TO_INT(103),
2243 [5] = MSM_GPIO_TO_INT(104),
2244 [6] = MSM_GPIO_TO_INT(105),
2245 [7] = MSM_GPIO_TO_INT(106),
2246 [8] = MSM_GPIO_TO_INT(107),
2247 [9] = MSM_GPIO_TO_INT(7),
2248 [10] = MSM_GPIO_TO_INT(11),
2249 [11] = MSM_GPIO_TO_INT(15),
2250 [12] = MSM_GPIO_TO_INT(19),
2251 [13] = MSM_GPIO_TO_INT(23),
2252 [14] = MSM_GPIO_TO_INT(27),
2253 [15] = MSM_GPIO_TO_INT(31),
2254 [16] = MSM_GPIO_TO_INT(35),
2255 [19] = MSM_GPIO_TO_INT(90),
2256 [20] = MSM_GPIO_TO_INT(92),
2257 [23] = MSM_GPIO_TO_INT(85),
2258 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002259 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002260 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002261 [29] = MSM_GPIO_TO_INT(10),
2262 [30] = MSM_GPIO_TO_INT(102),
2263 [31] = MSM_GPIO_TO_INT(81),
2264 [32] = MSM_GPIO_TO_INT(78),
2265 [33] = MSM_GPIO_TO_INT(94),
2266 [34] = MSM_GPIO_TO_INT(72),
2267 [35] = MSM_GPIO_TO_INT(39),
2268 [36] = MSM_GPIO_TO_INT(43),
2269 [37] = MSM_GPIO_TO_INT(61),
2270 [38] = MSM_GPIO_TO_INT(50),
2271 [39] = MSM_GPIO_TO_INT(42),
2272 [41] = MSM_GPIO_TO_INT(62),
2273 [42] = MSM_GPIO_TO_INT(76),
2274 [43] = MSM_GPIO_TO_INT(75),
2275 [44] = MSM_GPIO_TO_INT(70),
2276 [45] = MSM_GPIO_TO_INT(69),
2277 [46] = MSM_GPIO_TO_INT(67),
2278 [47] = MSM_GPIO_TO_INT(65),
2279 [48] = MSM_GPIO_TO_INT(58),
2280 [49] = MSM_GPIO_TO_INT(54),
2281 [50] = MSM_GPIO_TO_INT(52),
2282 [51] = MSM_GPIO_TO_INT(49),
2283 [52] = MSM_GPIO_TO_INT(40),
2284 [53] = MSM_GPIO_TO_INT(37),
2285 [54] = MSM_GPIO_TO_INT(24),
2286 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002287};
2288
Praveen Chidambaram78499012011-11-01 17:15:17 -06002289static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002290 TLMM_MSM_SUMMARY_IRQ,
2291 RPM_APCC_CPU0_GP_HIGH_IRQ,
2292 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2293 RPM_APCC_CPU0_GP_LOW_IRQ,
2294 RPM_APCC_CPU0_WAKE_UP_IRQ,
2295 RPM_APCC_CPU1_GP_HIGH_IRQ,
2296 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2297 RPM_APCC_CPU1_GP_LOW_IRQ,
2298 RPM_APCC_CPU1_WAKE_UP_IRQ,
2299 MSS_TO_APPS_IRQ_0,
2300 MSS_TO_APPS_IRQ_1,
2301 MSS_TO_APPS_IRQ_2,
2302 MSS_TO_APPS_IRQ_3,
2303 MSS_TO_APPS_IRQ_4,
2304 MSS_TO_APPS_IRQ_5,
2305 MSS_TO_APPS_IRQ_6,
2306 MSS_TO_APPS_IRQ_7,
2307 MSS_TO_APPS_IRQ_8,
2308 MSS_TO_APPS_IRQ_9,
2309 LPASS_SCSS_GP_LOW_IRQ,
2310 LPASS_SCSS_GP_MEDIUM_IRQ,
2311 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002312 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002313 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002314 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002315 RIVA_APPS_WLAN_SMSM_IRQ,
2316 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2317 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002318};
2319
Praveen Chidambaram78499012011-11-01 17:15:17 -06002320struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002321 .irqs_m2a = msm_mpm_irqs_m2a,
2322 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2323 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2324 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2325 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2326 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2327 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2328 .mpm_apps_ipc_val = BIT(1),
2329 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2330
2331};
2332#endif
2333
Stephen Boydbb600ae2011-08-02 20:11:40 -07002334static struct clk_lookup msm_clocks_8960_dummy[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002335 CLK_DUMMY("pll2", PLL2, NULL, 0),
2336 CLK_DUMMY("pll8", PLL8, NULL, 0),
2337 CLK_DUMMY("pll4", PLL4, NULL, 0),
2338
2339 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
2340 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
2341 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
2342 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
2343 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
2344 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
2345 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
2346 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
2347 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
2348 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
2349 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
2350 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
2351 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
2352 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
2353 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
2354 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
2355
Matt Wagantalle2522372011-08-17 14:52:21 -07002356 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
2357 CLK_DUMMY("core_clk", GSBI2_UART_CLK, "msm_serial_hsl.0", OFF),
2358 CLK_DUMMY("core_clk", GSBI3_UART_CLK, NULL, OFF),
2359 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
2360 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
2361 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
2362 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
2363 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
2364 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
2365 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
2366 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
2367 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002368 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
2369 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
2370 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, NULL, OFF),
2371 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
2372 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, NULL, OFF),
2373 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
2374 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
2375 CLK_DUMMY("core_clk", GSBI8_QUP_CLK, NULL, OFF),
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002376 CLK_DUMMY("core_clk", GSBI9_QUP_CLK, "qup_i2c.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002377 CLK_DUMMY("core_clk", GSBI10_QUP_CLK, NULL, OFF),
2378 CLK_DUMMY("core_clk", GSBI11_QUP_CLK, NULL, OFF),
2379 CLK_DUMMY("core_clk", GSBI12_QUP_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002380 CLK_DUMMY("core_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07002381 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Matt Wagantallc1205292011-08-11 17:19:31 -07002382 CLK_DUMMY("core_clk", PRNG_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002383 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
2384 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
2385 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
2386 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
2387 CLK_DUMMY("core_clk", SDC5_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07002388 CLK_DUMMY("core_clk", TSIF_REF_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002389 CLK_DUMMY("core_clk", TSSC_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08002390 CLK_DUMMY("alt_core_clk", USB_HS1_XCVR_CLK, NULL, OFF),
2391 CLK_DUMMY("phy_clk", USB_PHY0_CLK, NULL, OFF),
2392 CLK_DUMMY("src_clk", USB_FS1_SRC_CLK, NULL, OFF),
2393 CLK_DUMMY("alt_core_clk", USB_FS1_XCVR_CLK, NULL, OFF),
2394 CLK_DUMMY("sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
2395 CLK_DUMMY("src_clk", USB_FS2_SRC_CLK, NULL, OFF),
2396 CLK_DUMMY("alt_core_clk", USB_FS2_XCVR_CLK, NULL, OFF),
2397 CLK_DUMMY("sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07002398 CLK_DUMMY("iface_clk", CE2_CLK, "qce.0", OFF),
2399 CLK_DUMMY("core_clk", CE1_CORE_CLK, "qce.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002400 CLK_DUMMY("iface_clk", GSBI1_P_CLK, "spi_qsd.0", OFF),
2401 CLK_DUMMY("iface_clk", GSBI2_P_CLK,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002402 "msm_serial_hsl.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002403 CLK_DUMMY("iface_clk", GSBI3_P_CLK, NULL, OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07002404 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002405 CLK_DUMMY("iface_clk", GSBI5_P_CLK, NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07002406 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002407 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
2408 CLK_DUMMY("iface_clk", GSBI8_P_CLK, NULL, OFF),
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002409 CLK_DUMMY("iface_clk", GSBI9_P_CLK, "qup_i2c.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002410 CLK_DUMMY("iface_clk", GSBI10_P_CLK, NULL, OFF),
2411 CLK_DUMMY("iface_clk", GSBI11_P_CLK, NULL, OFF),
2412 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
2413 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07002414 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08002415 CLK_DUMMY("iface_clk", USB_FS1_P_CLK, NULL, OFF),
2416 CLK_DUMMY("iface_clk", USB_FS2_P_CLK, NULL, OFF),
2417 CLK_DUMMY("iface_clk", USB_HS1_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002418 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
2419 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
2420 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
2421 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
2422 CLK_DUMMY("iface_clk", SDC5_P_CLK, NULL, OFF),
Matt Wagantalle1a86062011-08-18 17:46:10 -07002423 CLK_DUMMY("core_clk", ADM0_CLK, NULL, OFF),
2424 CLK_DUMMY("iface_clk", ADM0_P_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002425 CLK_DUMMY("iface_clk", PMIC_ARB0_P_CLK, NULL, OFF),
2426 CLK_DUMMY("iface_clk", PMIC_ARB1_P_CLK, NULL, OFF),
2427 CLK_DUMMY("core_clk", PMIC_SSBI2_CLK, NULL, OFF),
2428 CLK_DUMMY("mem_clk", RPM_MSG_RAM_P_CLK, NULL, OFF),
2429 CLK_DUMMY("core_clk", AMP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002430 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
2431 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
2432 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
2433 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
2434 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
2435 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
2436 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
2437 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
2438 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
2439 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
2440 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
2441 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
2442 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
2443 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
2444 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002445 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, OFF),
2446 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, OFF),
2447 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002448 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002449 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002450 CLK_DUMMY("core_clk", JPEGD_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002451 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
2452 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
2453 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002454 CLK_DUMMY("core_clk", ROT_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002455 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
2456 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
2457 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002458 CLK_DUMMY("core_clk", VCODEC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002459 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
2460 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
2461 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
2462 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
2463 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
2464 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
2465 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
2466 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
2467 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002468 CLK_DUMMY("bus_clk", ROT_AXI_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002469 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
2470 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
2471 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
2472 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
2473 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
2474 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
2475 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
2476 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
2477 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
2478 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002479 CLK_DUMMY("iface_clk", GFX2D0_P_CLK, NULL, OFF),
2480 CLK_DUMMY("iface_clk", GFX2D1_P_CLK, NULL, OFF),
2481 CLK_DUMMY("iface_clk", GFX3D_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002482 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
2483 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
2484 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
2485 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002486 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002487 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002488 CLK_DUMMY("iface_clk", SMMU_P_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002489 CLK_DUMMY("iface_clk", ROT_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002490 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
2491 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
2492 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
2493 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
2494 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
2495 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
2496 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
2497 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
2498 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
2499 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
2500 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
2501 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
2502 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
2503 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
2504 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002505 CLK_DUMMY("core_clk", JPEGD_AXI_CLK, NULL, 0),
2506 CLK_DUMMY("core_clk", VFE_AXI_CLK, NULL, 0),
2507 CLK_DUMMY("core_clk", VCODEC_AXI_CLK, NULL, 0),
2508 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, 0),
2509 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, 0),
2510 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002511
2512 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
Manu Gautam5143b252012-01-05 19:25:23 -08002513 CLK_DUMMY("core_clk", DFAB_USB_HS_CLK, "msm_otg", NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002514 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
2515 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
2516 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
2517 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
2518 CLK_DUMMY("bus_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002519 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
2520 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
2521};
2522
Stephen Boydbb600ae2011-08-02 20:11:40 -07002523struct clock_init_data msm8960_dummy_clock_init_data __initdata = {
2524 .table = msm_clocks_8960_dummy,
2525 .size = ARRAY_SIZE(msm_clocks_8960_dummy),
2526};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002527
2528#define LPASS_SLIMBUS_PHYS 0x28080000
2529#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002530#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002531/* Board info for the slimbus slave device */
2532static struct resource slimbus_res[] = {
2533 {
2534 .start = LPASS_SLIMBUS_PHYS,
2535 .end = LPASS_SLIMBUS_PHYS + 8191,
2536 .flags = IORESOURCE_MEM,
2537 .name = "slimbus_physical",
2538 },
2539 {
2540 .start = LPASS_SLIMBUS_BAM_PHYS,
2541 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2542 .flags = IORESOURCE_MEM,
2543 .name = "slimbus_bam_physical",
2544 },
2545 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002546 .start = LPASS_SLIMBUS_SLEW,
2547 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2548 .flags = IORESOURCE_MEM,
2549 .name = "slimbus_slew_reg",
2550 },
2551 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002552 .start = SLIMBUS0_CORE_EE1_IRQ,
2553 .end = SLIMBUS0_CORE_EE1_IRQ,
2554 .flags = IORESOURCE_IRQ,
2555 .name = "slimbus_irq",
2556 },
2557 {
2558 .start = SLIMBUS0_BAM_EE1_IRQ,
2559 .end = SLIMBUS0_BAM_EE1_IRQ,
2560 .flags = IORESOURCE_IRQ,
2561 .name = "slimbus_bam_irq",
2562 },
2563};
2564
2565struct platform_device msm_slim_ctrl = {
2566 .name = "msm_slim_ctrl",
2567 .id = 1,
2568 .num_resources = ARRAY_SIZE(slimbus_res),
2569 .resource = slimbus_res,
2570 .dev = {
2571 .coherent_dma_mask = 0xffffffffULL,
2572 },
2573};
2574
Lucille Sylvester6e362412011-12-09 16:21:42 -07002575static struct msm_dcvs_freq_entry grp3d_freq[] = {
2576 {0, 0, 333932},
2577 {0, 0, 497532},
2578 {0, 0, 707610},
2579 {0, 0, 844545},
2580};
2581
2582static struct msm_dcvs_freq_entry grp2d_freq[] = {
2583 {0, 0, 86000},
2584 {0, 0, 200000},
2585};
2586
2587static struct msm_dcvs_core_info grp3d_core_info = {
2588 .freq_tbl = &grp3d_freq[0],
2589 .core_param = {
2590 .max_time_us = 100000,
2591 .num_freq = ARRAY_SIZE(grp3d_freq),
2592 },
2593 .algo_param = {
2594 .slack_time_us = 39000,
2595 .disable_pc_threshold = 86000,
2596 .ss_window_size = 1000000,
2597 .ss_util_pct = 95,
2598 .em_max_util_pct = 97,
2599 .ss_iobusy_conv = 100,
2600 },
2601};
2602
2603static struct msm_dcvs_core_info grp2d_core_info = {
2604 .freq_tbl = &grp2d_freq[0],
2605 .core_param = {
2606 .max_time_us = 100000,
2607 .num_freq = ARRAY_SIZE(grp2d_freq),
2608 },
2609 .algo_param = {
2610 .slack_time_us = 39000,
2611 .disable_pc_threshold = 90000,
2612 .ss_window_size = 1000000,
2613 .ss_util_pct = 90,
2614 .em_max_util_pct = 95,
2615 },
2616};
2617
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002618#ifdef CONFIG_MSM_BUS_SCALING
2619static struct msm_bus_vectors grp3d_init_vectors[] = {
2620 {
2621 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2622 .dst = MSM_BUS_SLAVE_EBI_CH0,
2623 .ab = 0,
2624 .ib = 0,
2625 },
2626};
2627
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002628static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002629 {
2630 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2631 .dst = MSM_BUS_SLAVE_EBI_CH0,
2632 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002633 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002634 },
2635};
2636
2637static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2638 {
2639 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2640 .dst = MSM_BUS_SLAVE_EBI_CH0,
2641 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002642 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002643 },
2644};
2645
2646static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2647 {
2648 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2649 .dst = MSM_BUS_SLAVE_EBI_CH0,
2650 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002651 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002652 },
2653};
2654
2655static struct msm_bus_vectors grp3d_max_vectors[] = {
2656 {
2657 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2658 .dst = MSM_BUS_SLAVE_EBI_CH0,
2659 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002660 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002661 },
2662};
2663
2664static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2665 {
2666 ARRAY_SIZE(grp3d_init_vectors),
2667 grp3d_init_vectors,
2668 },
2669 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002670 ARRAY_SIZE(grp3d_low_vectors),
2671 grp3d_low_vectors,
2672 },
2673 {
2674 ARRAY_SIZE(grp3d_nominal_low_vectors),
2675 grp3d_nominal_low_vectors,
2676 },
2677 {
2678 ARRAY_SIZE(grp3d_nominal_high_vectors),
2679 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002680 },
2681 {
2682 ARRAY_SIZE(grp3d_max_vectors),
2683 grp3d_max_vectors,
2684 },
2685};
2686
2687static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2688 grp3d_bus_scale_usecases,
2689 ARRAY_SIZE(grp3d_bus_scale_usecases),
2690 .name = "grp3d",
2691};
2692
2693static struct msm_bus_vectors grp2d0_init_vectors[] = {
2694 {
2695 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2696 .dst = MSM_BUS_SLAVE_EBI_CH0,
2697 .ab = 0,
2698 .ib = 0,
2699 },
2700};
2701
Lucille Sylvester808eca22011-11-03 10:26:29 -07002702static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002703 {
2704 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2705 .dst = MSM_BUS_SLAVE_EBI_CH0,
2706 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002707 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002708 },
2709};
2710
Lucille Sylvester808eca22011-11-03 10:26:29 -07002711static struct msm_bus_vectors grp2d0_max_vectors[] = {
2712 {
2713 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2714 .dst = MSM_BUS_SLAVE_EBI_CH0,
2715 .ab = 0,
2716 .ib = KGSL_CONVERT_TO_MBPS(2048),
2717 },
2718};
2719
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002720static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2721 {
2722 ARRAY_SIZE(grp2d0_init_vectors),
2723 grp2d0_init_vectors,
2724 },
2725 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002726 ARRAY_SIZE(grp2d0_nominal_vectors),
2727 grp2d0_nominal_vectors,
2728 },
2729 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002730 ARRAY_SIZE(grp2d0_max_vectors),
2731 grp2d0_max_vectors,
2732 },
2733};
2734
2735struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2736 grp2d0_bus_scale_usecases,
2737 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2738 .name = "grp2d0",
2739};
2740
2741static struct msm_bus_vectors grp2d1_init_vectors[] = {
2742 {
2743 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2744 .dst = MSM_BUS_SLAVE_EBI_CH0,
2745 .ab = 0,
2746 .ib = 0,
2747 },
2748};
2749
Lucille Sylvester808eca22011-11-03 10:26:29 -07002750static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002751 {
2752 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2753 .dst = MSM_BUS_SLAVE_EBI_CH0,
2754 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002755 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002756 },
2757};
2758
Lucille Sylvester808eca22011-11-03 10:26:29 -07002759static struct msm_bus_vectors grp2d1_max_vectors[] = {
2760 {
2761 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2762 .dst = MSM_BUS_SLAVE_EBI_CH0,
2763 .ab = 0,
2764 .ib = KGSL_CONVERT_TO_MBPS(2048),
2765 },
2766};
2767
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002768static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2769 {
2770 ARRAY_SIZE(grp2d1_init_vectors),
2771 grp2d1_init_vectors,
2772 },
2773 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002774 ARRAY_SIZE(grp2d1_nominal_vectors),
2775 grp2d1_nominal_vectors,
2776 },
2777 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002778 ARRAY_SIZE(grp2d1_max_vectors),
2779 grp2d1_max_vectors,
2780 },
2781};
2782
2783struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2784 grp2d1_bus_scale_usecases,
2785 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2786 .name = "grp2d1",
2787};
2788#endif
2789
2790static struct resource kgsl_3d0_resources[] = {
2791 {
2792 .name = KGSL_3D0_REG_MEMORY,
2793 .start = 0x04300000, /* GFX3D address */
2794 .end = 0x0431ffff,
2795 .flags = IORESOURCE_MEM,
2796 },
2797 {
2798 .name = KGSL_3D0_IRQ,
2799 .start = GFX3D_IRQ,
2800 .end = GFX3D_IRQ,
2801 .flags = IORESOURCE_IRQ,
2802 },
2803};
2804
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002805static const char *kgsl_3d0_iommu_ctx_names[] = {
2806 "gfx3d_user",
2807 /* priv_ctx goes here */
2808};
2809
2810static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2811 {
2812 .iommu_ctx_names = kgsl_3d0_iommu_ctx_names,
2813 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctx_names),
2814 .physstart = 0x07C00000,
2815 .physend = 0x07C00000 + SZ_1M - 1,
2816 },
2817};
2818
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002819static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002820 .pwrlevel = {
2821 {
2822 .gpu_freq = 400000000,
2823 .bus_freq = 4,
2824 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002825 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002826 {
2827 .gpu_freq = 300000000,
2828 .bus_freq = 3,
2829 .io_fraction = 33,
2830 },
2831 {
2832 .gpu_freq = 200000000,
2833 .bus_freq = 2,
2834 .io_fraction = 100,
2835 },
2836 {
2837 .gpu_freq = 128000000,
2838 .bus_freq = 1,
2839 .io_fraction = 100,
2840 },
2841 {
2842 .gpu_freq = 27000000,
2843 .bus_freq = 0,
2844 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002845 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002846 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002847 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002848 .set_grp_async = NULL,
Lucille Sylvester5dc67512012-03-27 15:07:58 -06002849 .idle_timeout = HZ/12,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002850 .nap_allowed = true,
2851 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002852#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002853 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002854#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002855 .iommu_data = kgsl_3d0_iommu_data,
2856 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002857 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002858};
2859
2860struct platform_device msm_kgsl_3d0 = {
2861 .name = "kgsl-3d0",
2862 .id = 0,
2863 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2864 .resource = kgsl_3d0_resources,
2865 .dev = {
2866 .platform_data = &kgsl_3d0_pdata,
2867 },
2868};
2869
2870static struct resource kgsl_2d0_resources[] = {
2871 {
2872 .name = KGSL_2D0_REG_MEMORY,
2873 .start = 0x04100000, /* Z180 base address */
2874 .end = 0x04100FFF,
2875 .flags = IORESOURCE_MEM,
2876 },
2877 {
2878 .name = KGSL_2D0_IRQ,
2879 .start = GFX2D0_IRQ,
2880 .end = GFX2D0_IRQ,
2881 .flags = IORESOURCE_IRQ,
2882 },
2883};
2884
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002885static const char *kgsl_2d0_iommu_ctx_names[] = {
2886 "gfx2d0_2d0",
2887};
2888
2889static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2890 {
2891 .iommu_ctx_names = kgsl_2d0_iommu_ctx_names,
2892 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctx_names),
2893 .physstart = 0x07D00000,
2894 .physend = 0x07D00000 + SZ_1M - 1,
2895 },
2896};
2897
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002898static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002899 .pwrlevel = {
2900 {
2901 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002902 .bus_freq = 2,
2903 },
2904 {
2905 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002906 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002907 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002908 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002909 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002910 .bus_freq = 0,
2911 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002912 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002913 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002914 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002915 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002916 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002917 .nap_allowed = true,
2918 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002919#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002920 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002921#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002922 .iommu_data = kgsl_2d0_iommu_data,
2923 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002924 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002925};
2926
2927struct platform_device msm_kgsl_2d0 = {
2928 .name = "kgsl-2d0",
2929 .id = 0,
2930 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2931 .resource = kgsl_2d0_resources,
2932 .dev = {
2933 .platform_data = &kgsl_2d0_pdata,
2934 },
2935};
2936
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002937static const char *kgsl_2d1_iommu_ctx_names[] = {
Jeremy Gebben5c4c1132012-02-27 11:26:49 -07002938 "gfx2d1_2d1",
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002939};
2940
2941static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2942 {
2943 .iommu_ctx_names = kgsl_2d1_iommu_ctx_names,
2944 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctx_names),
2945 .physstart = 0x07E00000,
2946 .physend = 0x07E00000 + SZ_1M - 1,
2947 },
2948};
2949
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002950static struct resource kgsl_2d1_resources[] = {
2951 {
2952 .name = KGSL_2D1_REG_MEMORY,
2953 .start = 0x04200000, /* Z180 device 1 base address */
2954 .end = 0x04200FFF,
2955 .flags = IORESOURCE_MEM,
2956 },
2957 {
2958 .name = KGSL_2D1_IRQ,
2959 .start = GFX2D1_IRQ,
2960 .end = GFX2D1_IRQ,
2961 .flags = IORESOURCE_IRQ,
2962 },
2963};
2964
2965static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002966 .pwrlevel = {
2967 {
2968 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002969 .bus_freq = 2,
2970 },
2971 {
2972 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002973 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002974 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002975 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002976 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002977 .bus_freq = 0,
2978 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002979 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002980 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002981 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002982 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002983 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002984 .nap_allowed = true,
2985 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002986#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002987 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002988#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002989 .iommu_data = kgsl_2d1_iommu_data,
2990 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002991 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002992};
2993
2994struct platform_device msm_kgsl_2d1 = {
2995 .name = "kgsl-2d1",
2996 .id = 1,
2997 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2998 .resource = kgsl_2d1_resources,
2999 .dev = {
3000 .platform_data = &kgsl_2d1_pdata,
3001 },
3002};
3003
3004#ifdef CONFIG_MSM_GEMINI
3005static struct resource msm_gemini_resources[] = {
3006 {
3007 .start = 0x04600000,
3008 .end = 0x04600000 + SZ_1M - 1,
3009 .flags = IORESOURCE_MEM,
3010 },
3011 {
3012 .start = JPEG_IRQ,
3013 .end = JPEG_IRQ,
3014 .flags = IORESOURCE_IRQ,
3015 },
3016};
3017
3018struct platform_device msm8960_gemini_device = {
3019 .name = "msm_gemini",
3020 .resource = msm_gemini_resources,
3021 .num_resources = ARRAY_SIZE(msm_gemini_resources),
3022};
3023#endif
3024
Praveen Chidambaram78499012011-11-01 17:15:17 -06003025struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
3026 .reg_base_addrs = {
3027 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
3028 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
3029 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
3030 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
3031 },
3032 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08003033 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06003034 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06003035 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
3036 .ipc_rpm_val = 4,
3037 .target_id = {
3038 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
3039 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
3040 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
3041 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
3042 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
3043 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
3044 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
3045 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
3046 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
3047 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
3048 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
3049 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
3050 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
3051 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
3052 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
3053 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
3054 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
3055 APPS_FABRIC_CFG_HALT, 2),
3056 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
3057 APPS_FABRIC_CFG_CLKMOD, 3),
3058 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
3059 APPS_FABRIC_CFG_IOCTL, 1),
3060 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
3061 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
3062 SYS_FABRIC_CFG_HALT, 2),
3063 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
3064 SYS_FABRIC_CFG_CLKMOD, 3),
3065 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
3066 SYS_FABRIC_CFG_IOCTL, 1),
3067 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
3068 SYSTEM_FABRIC_ARB, 29),
3069 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
3070 MMSS_FABRIC_CFG_HALT, 2),
3071 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
3072 MMSS_FABRIC_CFG_CLKMOD, 3),
3073 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
3074 MMSS_FABRIC_CFG_IOCTL, 1),
3075 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
3076 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
3077 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
3078 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
3079 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
3080 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
3081 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
3082 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
3083 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
3084 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
3085 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
3086 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
3087 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
3088 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
3089 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
3090 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
3091 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
3092 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
3093 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
3094 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
3095 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
3096 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
3097 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
3098 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
3099 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
3100 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
3101 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
3102 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
3103 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
3104 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
3105 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
3106 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
3107 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
3108 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
3109 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
3110 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
3111 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
3112 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
3113 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
3114 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
3115 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
3116 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
3117 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
3118 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
3119 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
3120 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
3121 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
3122 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
3123 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
3124 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
3125 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
3126 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
3127 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
3128 },
3129 .target_status = {
3130 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
3131 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
3132 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
3133 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
3134 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
3135 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
3136 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
3137 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
3138 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
3139 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
3140 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
3141 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
3142 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
3143 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
3144 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
3145 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
3146 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
3147 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
3148 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
3149 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
3150 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
3151 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
3152 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
3153 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
3154 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
3155 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
3156 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
3157 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
3158 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
3159 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
3160 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
3161 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
3162 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
3163 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
3164 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
3165 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
3166 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
3167 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
3168 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
3169 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
3170 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
3171 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
3172 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
3173 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
3174 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
3175 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
3176 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
3177 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
3178 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
3179 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
3180 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
3181 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
3182 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
3183 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
3184 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
3185 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
3186 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
3187 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
3188 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3189 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3190 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3191 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3192 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3193 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3194 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3195 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3196 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3197 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3198 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3199 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3200 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3201 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3202 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3203 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3204 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3205 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3206 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3207 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3208 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3209 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3210 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3211 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3212 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3213 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3214 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3215 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3216 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3217 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3218 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3219 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3220 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3221 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3222 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3223 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3224 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3225 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3226 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3227 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3228 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3229 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3230 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3231 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3232 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3233 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3234 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3235 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3236 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3237 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3238 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3239 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3240 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3241 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3242 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3243 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3244 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3245 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3246 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3247 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3248 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3249 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3250 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3251 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3252 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3253 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3254 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3255 },
3256 .target_ctrl_id = {
3257 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3258 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3259 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3260 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3261 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3262 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3263 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3264 },
3265 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3266 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3267 .sel_last = MSM_RPM_8960_SEL_LAST,
3268 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003269};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003270
Praveen Chidambaram78499012011-11-01 17:15:17 -06003271struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003272 .name = "msm_rpm",
3273 .id = -1,
3274};
3275
Praveen Chidambaram78499012011-11-01 17:15:17 -06003276static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3277 .phys_addr_base = 0x0010C000,
3278 .reg_offsets = {
3279 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3280 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3281 },
3282 .phys_size = SZ_8K,
3283 .log_len = 4096, /* log's buffer length in bytes */
3284 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3285};
3286
3287struct platform_device msm8960_rpm_log_device = {
3288 .name = "msm_rpm_log",
3289 .id = -1,
3290 .dev = {
3291 .platform_data = &msm_rpm_log_pdata,
3292 },
3293};
3294
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003295static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
3296 .phys_addr_base = 0x0010D204,
3297 .phys_size = SZ_8K,
3298};
3299
Praveen Chidambaram78499012011-11-01 17:15:17 -06003300struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003301 .name = "msm_rpm_stat",
3302 .id = -1,
3303 .dev = {
3304 .platform_data = &msm_rpm_stat_pdata,
3305 },
3306};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003307
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003308struct platform_device msm_bus_sys_fabric = {
3309 .name = "msm_bus_fabric",
3310 .id = MSM_BUS_FAB_SYSTEM,
3311};
3312struct platform_device msm_bus_apps_fabric = {
3313 .name = "msm_bus_fabric",
3314 .id = MSM_BUS_FAB_APPSS,
3315};
3316struct platform_device msm_bus_mm_fabric = {
3317 .name = "msm_bus_fabric",
3318 .id = MSM_BUS_FAB_MMSS,
3319};
3320struct platform_device msm_bus_sys_fpb = {
3321 .name = "msm_bus_fabric",
3322 .id = MSM_BUS_FAB_SYSTEM_FPB,
3323};
3324struct platform_device msm_bus_cpss_fpb = {
3325 .name = "msm_bus_fabric",
3326 .id = MSM_BUS_FAB_CPSS_FPB,
3327};
3328
3329/* Sensors DSPS platform data */
3330#ifdef CONFIG_MSM_DSPS
3331
3332#define PPSS_REG_PHYS_BASE 0x12080000
3333
3334static struct dsps_clk_info dsps_clks[] = {};
3335static struct dsps_regulator_info dsps_regs[] = {};
3336
3337/*
3338 * Note: GPIOs field is intialized in run-time at the function
3339 * msm8960_init_dsps().
3340 */
3341
3342struct msm_dsps_platform_data msm_dsps_pdata = {
3343 .clks = dsps_clks,
3344 .clks_num = ARRAY_SIZE(dsps_clks),
3345 .gpios = NULL,
3346 .gpios_num = 0,
3347 .regs = dsps_regs,
3348 .regs_num = ARRAY_SIZE(dsps_regs),
3349 .dsps_pwr_ctl_en = 1,
3350 .signature = DSPS_SIGNATURE,
3351};
3352
3353static struct resource msm_dsps_resources[] = {
3354 {
3355 .start = PPSS_REG_PHYS_BASE,
3356 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
3357 .name = "ppss_reg",
3358 .flags = IORESOURCE_MEM,
3359 },
Wentao Xua55500b2011-08-16 18:15:04 -04003360
3361 {
3362 .start = PPSS_WDOG_TIMER_IRQ,
3363 .end = PPSS_WDOG_TIMER_IRQ,
3364 .name = "ppss_wdog",
3365 .flags = IORESOURCE_IRQ,
3366 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003367};
3368
3369struct platform_device msm_dsps_device = {
3370 .name = "msm_dsps",
3371 .id = 0,
3372 .num_resources = ARRAY_SIZE(msm_dsps_resources),
3373 .resource = msm_dsps_resources,
3374 .dev.platform_data = &msm_dsps_pdata,
3375};
3376
3377#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07003378
3379#ifdef CONFIG_MSM_QDSS
3380
3381#define MSM_QDSS_PHYS_BASE 0x01A00000
3382#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
3383#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
3384#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
Pratik Patel492b3012012-03-06 14:22:30 -08003385#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
Pratik Patel7831c082011-06-08 21:44:37 -07003386
Pratik Patel1403f2a2012-03-21 10:10:00 -07003387#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
3388
3389static struct qdss_source msm_qdss_sources[] = {
3390 QDSS_SOURCE("msm_etm", 0x3),
3391};
3392
3393static struct msm_qdss_platform_data qdss_pdata = {
3394 .src_table = msm_qdss_sources,
3395 .size = ARRAY_SIZE(msm_qdss_sources),
3396 .afamily = 1,
3397};
3398
3399struct platform_device msm_qdss_device = {
3400 .name = "msm_qdss",
3401 .id = -1,
3402 .dev = {
3403 .platform_data = &qdss_pdata,
3404 },
3405};
3406
Pratik Patel7831c082011-06-08 21:44:37 -07003407static struct resource msm_etb_resources[] = {
3408 {
3409 .start = MSM_ETB_PHYS_BASE,
3410 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
3411 .flags = IORESOURCE_MEM,
3412 },
3413};
3414
3415struct platform_device msm_etb_device = {
3416 .name = "msm_etb",
3417 .id = 0,
3418 .num_resources = ARRAY_SIZE(msm_etb_resources),
3419 .resource = msm_etb_resources,
3420};
3421
3422static struct resource msm_tpiu_resources[] = {
3423 {
3424 .start = MSM_TPIU_PHYS_BASE,
3425 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
3426 .flags = IORESOURCE_MEM,
3427 },
3428};
3429
3430struct platform_device msm_tpiu_device = {
3431 .name = "msm_tpiu",
3432 .id = 0,
3433 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
3434 .resource = msm_tpiu_resources,
3435};
3436
3437static struct resource msm_funnel_resources[] = {
3438 {
3439 .start = MSM_FUNNEL_PHYS_BASE,
3440 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
3441 .flags = IORESOURCE_MEM,
3442 },
3443};
3444
3445struct platform_device msm_funnel_device = {
3446 .name = "msm_funnel",
3447 .id = 0,
3448 .num_resources = ARRAY_SIZE(msm_funnel_resources),
3449 .resource = msm_funnel_resources,
3450};
3451
Pratik Patel492b3012012-03-06 14:22:30 -08003452static struct resource msm_etm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07003453 {
Pratik Patel492b3012012-03-06 14:22:30 -08003454 .start = MSM_ETM_PHYS_BASE,
3455 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 2) - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07003456 .flags = IORESOURCE_MEM,
3457 },
3458};
3459
Pratik Patel492b3012012-03-06 14:22:30 -08003460struct platform_device msm_etm_device = {
3461 .name = "msm_etm",
Pratik Patel7831c082011-06-08 21:44:37 -07003462 .id = 0,
Pratik Patel492b3012012-03-06 14:22:30 -08003463 .num_resources = ARRAY_SIZE(msm_etm_resources),
3464 .resource = msm_etm_resources,
Pratik Patel7831c082011-06-08 21:44:37 -07003465};
3466
3467#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07003468
3469static int msm8960_LPM_latency = 1000; /* >100 usec for WFI */
3470
3471struct platform_device msm8960_cpu_idle_device = {
3472 .name = "msm_cpu_idle",
3473 .id = -1,
3474 .dev = {
3475 .platform_data = &msm8960_LPM_latency,
3476 },
3477};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07003478
3479static struct msm_dcvs_freq_entry msm8960_freq[] = {
3480 { 384000, 166981, 345600},
3481 { 702000, 213049, 632502},
3482 {1026000, 285712, 925613},
3483 {1242000, 383945, 1176550},
3484 {1458000, 419729, 1465478},
3485 {1512000, 434116, 1546674},
3486
3487};
3488
3489static struct msm_dcvs_core_info msm8960_core_info = {
3490 .freq_tbl = &msm8960_freq[0],
3491 .core_param = {
3492 .max_time_us = 100000,
3493 .num_freq = ARRAY_SIZE(msm8960_freq),
3494 },
3495 .algo_param = {
3496 .slack_time_us = 58000,
3497 .scale_slack_time = 0,
3498 .scale_slack_time_pct = 0,
3499 .disable_pc_threshold = 1458000,
3500 .em_window_size = 100000,
3501 .em_max_util_pct = 97,
3502 .ss_window_size = 1000000,
3503 .ss_util_pct = 95,
3504 .ss_iobusy_conv = 100,
3505 },
3506};
3507
3508struct platform_device msm8960_msm_gov_device = {
3509 .name = "msm_dcvs_gov",
3510 .id = -1,
3511 .dev = {
3512 .platform_data = &msm8960_core_info,
3513 },
3514};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003515
3516static struct resource msm_cache_erp_resources[] = {
3517 {
3518 .name = "l1_irq",
3519 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3520 .flags = IORESOURCE_IRQ,
3521 },
3522 {
3523 .name = "l2_irq",
3524 .start = APCC_QGICL2IRPTREQ,
3525 .flags = IORESOURCE_IRQ,
3526 }
3527};
3528
3529struct platform_device msm8960_device_cache_erp = {
3530 .name = "msm_cache_erp",
3531 .id = -1,
3532 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3533 .resource = msm_cache_erp_resources,
3534};