blob: 3255248ee7e50424f3b6d43dc2d5867d3154dd99 [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
52#include "mpm.h"
53#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)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070077
78/* GSBI QUP devices */
79#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
80#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
81#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
82#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
83#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
84#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
85#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
86#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
87#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
88#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
89#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
90#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
91#define MSM_QUP_SIZE SZ_4K
92
93#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
94#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
95#define MSM_PMIC_SSBI_SIZE SZ_4K
96
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -070097#define MSM8960_HSUSB_PHYS 0x12500000
98#define MSM8960_HSUSB_SIZE SZ_4K
99
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700100static struct resource resources_otg[] = {
101 {
102 .start = MSM8960_HSUSB_PHYS,
103 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
104 .flags = IORESOURCE_MEM,
105 },
106 {
107 .start = USB1_HS_IRQ,
108 .end = USB1_HS_IRQ,
109 .flags = IORESOURCE_IRQ,
110 },
111};
112
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700113struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700114 .name = "msm_otg",
115 .id = -1,
116 .num_resources = ARRAY_SIZE(resources_otg),
117 .resource = resources_otg,
118 .dev = {
119 .coherent_dma_mask = 0xffffffff,
120 },
121};
122
123static struct resource resources_hsusb[] = {
124 {
125 .start = MSM8960_HSUSB_PHYS,
126 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
127 .flags = IORESOURCE_MEM,
128 },
129 {
130 .start = USB1_HS_IRQ,
131 .end = USB1_HS_IRQ,
132 .flags = IORESOURCE_IRQ,
133 },
134};
135
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700136struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700137 .name = "msm_hsusb",
138 .id = -1,
139 .num_resources = ARRAY_SIZE(resources_hsusb),
140 .resource = resources_hsusb,
141 .dev = {
142 .coherent_dma_mask = 0xffffffff,
143 },
144};
145
146static struct resource resources_hsusb_host[] = {
147 {
148 .start = MSM8960_HSUSB_PHYS,
149 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
150 .flags = IORESOURCE_MEM,
151 },
152 {
153 .start = USB1_HS_IRQ,
154 .end = USB1_HS_IRQ,
155 .flags = IORESOURCE_IRQ,
156 },
157};
158
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530159static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700160struct platform_device msm_device_hsusb_host = {
161 .name = "msm_hsusb_host",
162 .id = -1,
163 .num_resources = ARRAY_SIZE(resources_hsusb_host),
164 .resource = resources_hsusb_host,
165 .dev = {
166 .dma_mask = &dma_mask,
167 .coherent_dma_mask = 0xffffffff,
168 },
169};
170
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530171static struct resource resources_hsic_host[] = {
172 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700173 .start = 0x12520000,
174 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530175 .flags = IORESOURCE_MEM,
176 },
177 {
178 .start = USB_HSIC_IRQ,
179 .end = USB_HSIC_IRQ,
180 .flags = IORESOURCE_IRQ,
181 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800182 {
183 .start = MSM_GPIO_TO_INT(69),
184 .end = MSM_GPIO_TO_INT(69),
185 .name = "peripheral_status_irq",
186 .flags = IORESOURCE_IRQ,
187 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530188};
189
190struct platform_device msm_device_hsic_host = {
191 .name = "msm_hsic_host",
192 .id = -1,
193 .num_resources = ARRAY_SIZE(resources_hsic_host),
194 .resource = resources_hsic_host,
195 .dev = {
196 .dma_mask = &dma_mask,
197 .coherent_dma_mask = DMA_BIT_MASK(32),
198 },
199};
200
Mona Hossain11c03ac2011-10-26 12:42:10 -0700201#define SHARED_IMEM_TZ_BASE 0x2a03f720
202static struct resource tzlog_resources[] = {
203 {
204 .start = SHARED_IMEM_TZ_BASE,
205 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
206 .flags = IORESOURCE_MEM,
207 },
208};
209
210struct platform_device msm_device_tz_log = {
211 .name = "tz_log",
212 .id = 0,
213 .num_resources = ARRAY_SIZE(tzlog_resources),
214 .resource = tzlog_resources,
215};
216
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217static struct resource resources_uart_gsbi2[] = {
218 {
219 .start = MSM8960_GSBI2_UARTDM_IRQ,
220 .end = MSM8960_GSBI2_UARTDM_IRQ,
221 .flags = IORESOURCE_IRQ,
222 },
223 {
224 .start = MSM_UART2DM_PHYS,
225 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
226 .name = "uartdm_resource",
227 .flags = IORESOURCE_MEM,
228 },
229 {
230 .start = MSM_GSBI2_PHYS,
231 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
232 .name = "gsbi_resource",
233 .flags = IORESOURCE_MEM,
234 },
235};
236
237struct platform_device msm8960_device_uart_gsbi2 = {
238 .name = "msm_serial_hsl",
239 .id = 0,
240 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
241 .resource = resources_uart_gsbi2,
242};
Mayank Rana9f51f582011-08-04 18:35:59 +0530243/* GSBI 6 used into UARTDM Mode */
244static struct resource msm_uart_dm6_resources[] = {
245 {
246 .start = MSM_UART6DM_PHYS,
247 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
248 .name = "uartdm_resource",
249 .flags = IORESOURCE_MEM,
250 },
251 {
252 .start = GSBI6_UARTDM_IRQ,
253 .end = GSBI6_UARTDM_IRQ,
254 .flags = IORESOURCE_IRQ,
255 },
256 {
257 .start = MSM_GSBI6_PHYS,
258 .end = MSM_GSBI6_PHYS + 4 - 1,
259 .name = "gsbi_resource",
260 .flags = IORESOURCE_MEM,
261 },
262 {
263 .start = DMOV_HSUART_GSBI6_TX_CHAN,
264 .end = DMOV_HSUART_GSBI6_RX_CHAN,
265 .name = "uartdm_channels",
266 .flags = IORESOURCE_DMA,
267 },
268 {
269 .start = DMOV_HSUART_GSBI6_TX_CRCI,
270 .end = DMOV_HSUART_GSBI6_RX_CRCI,
271 .name = "uartdm_crci",
272 .flags = IORESOURCE_DMA,
273 },
274};
275static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
276struct platform_device msm_device_uart_dm6 = {
277 .name = "msm_serial_hs",
278 .id = 0,
279 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
280 .resource = msm_uart_dm6_resources,
281 .dev = {
282 .dma_mask = &msm_uart_dm6_dma_mask,
283 .coherent_dma_mask = DMA_BIT_MASK(32),
284 },
285};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700286
287static struct resource resources_uart_gsbi5[] = {
288 {
289 .start = GSBI5_UARTDM_IRQ,
290 .end = GSBI5_UARTDM_IRQ,
291 .flags = IORESOURCE_IRQ,
292 },
293 {
294 .start = MSM_UART5DM_PHYS,
295 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
296 .name = "uartdm_resource",
297 .flags = IORESOURCE_MEM,
298 },
299 {
300 .start = MSM_GSBI5_PHYS,
301 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
302 .name = "gsbi_resource",
303 .flags = IORESOURCE_MEM,
304 },
305};
306
307struct platform_device msm8960_device_uart_gsbi5 = {
308 .name = "msm_serial_hsl",
309 .id = 0,
310 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
311 .resource = resources_uart_gsbi5,
312};
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700313
314static struct msm_serial_hslite_platform_data uart_gsbi8_pdata = {
315 .line = 0,
316};
317
318static struct resource resources_uart_gsbi8[] = {
319 {
320 .start = GSBI8_UARTDM_IRQ,
321 .end = GSBI8_UARTDM_IRQ,
322 .flags = IORESOURCE_IRQ,
323 },
324 {
325 .start = MSM_UART8DM_PHYS,
326 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
327 .name = "uartdm_resource",
328 .flags = IORESOURCE_MEM,
329 },
330 {
331 .start = MSM_GSBI8_PHYS,
332 .end = MSM_GSBI8_PHYS + PAGE_SIZE - 1,
333 .name = "gsbi_resource",
334 .flags = IORESOURCE_MEM,
335 },
336};
337
338struct platform_device msm8960_device_uart_gsbi8 = {
339 .name = "msm_serial_hsl",
340 .id = 1,
341 .num_resources = ARRAY_SIZE(resources_uart_gsbi8),
342 .resource = resources_uart_gsbi8,
343 .dev.platform_data = &uart_gsbi8_pdata,
344};
345
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346/* MSM Video core device */
347#ifdef CONFIG_MSM_BUS_SCALING
348static struct msm_bus_vectors vidc_init_vectors[] = {
349 {
350 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
351 .dst = MSM_BUS_SLAVE_EBI_CH0,
352 .ab = 0,
353 .ib = 0,
354 },
355 {
356 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
357 .dst = MSM_BUS_SLAVE_EBI_CH0,
358 .ab = 0,
359 .ib = 0,
360 },
361 {
362 .src = MSM_BUS_MASTER_AMPSS_M0,
363 .dst = MSM_BUS_SLAVE_EBI_CH0,
364 .ab = 0,
365 .ib = 0,
366 },
367 {
368 .src = MSM_BUS_MASTER_AMPSS_M0,
369 .dst = MSM_BUS_SLAVE_EBI_CH0,
370 .ab = 0,
371 .ib = 0,
372 },
373};
374static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
375 {
376 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
377 .dst = MSM_BUS_SLAVE_EBI_CH0,
378 .ab = 54525952,
379 .ib = 436207616,
380 },
381 {
382 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
383 .dst = MSM_BUS_SLAVE_EBI_CH0,
384 .ab = 72351744,
385 .ib = 289406976,
386 },
387 {
388 .src = MSM_BUS_MASTER_AMPSS_M0,
389 .dst = MSM_BUS_SLAVE_EBI_CH0,
390 .ab = 500000,
391 .ib = 1000000,
392 },
393 {
394 .src = MSM_BUS_MASTER_AMPSS_M0,
395 .dst = MSM_BUS_SLAVE_EBI_CH0,
396 .ab = 500000,
397 .ib = 1000000,
398 },
399};
400static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
401 {
402 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
403 .dst = MSM_BUS_SLAVE_EBI_CH0,
404 .ab = 40894464,
405 .ib = 327155712,
406 },
407 {
408 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
409 .dst = MSM_BUS_SLAVE_EBI_CH0,
410 .ab = 48234496,
411 .ib = 192937984,
412 },
413 {
414 .src = MSM_BUS_MASTER_AMPSS_M0,
415 .dst = MSM_BUS_SLAVE_EBI_CH0,
416 .ab = 500000,
417 .ib = 2000000,
418 },
419 {
420 .src = MSM_BUS_MASTER_AMPSS_M0,
421 .dst = MSM_BUS_SLAVE_EBI_CH0,
422 .ab = 500000,
423 .ib = 2000000,
424 },
425};
426static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
427 {
428 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
429 .dst = MSM_BUS_SLAVE_EBI_CH0,
430 .ab = 163577856,
431 .ib = 1308622848,
432 },
433 {
434 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
435 .dst = MSM_BUS_SLAVE_EBI_CH0,
436 .ab = 219152384,
437 .ib = 876609536,
438 },
439 {
440 .src = MSM_BUS_MASTER_AMPSS_M0,
441 .dst = MSM_BUS_SLAVE_EBI_CH0,
442 .ab = 1750000,
443 .ib = 3500000,
444 },
445 {
446 .src = MSM_BUS_MASTER_AMPSS_M0,
447 .dst = MSM_BUS_SLAVE_EBI_CH0,
448 .ab = 1750000,
449 .ib = 3500000,
450 },
451};
452static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
453 {
454 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
455 .dst = MSM_BUS_SLAVE_EBI_CH0,
456 .ab = 121634816,
457 .ib = 973078528,
458 },
459 {
460 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
461 .dst = MSM_BUS_SLAVE_EBI_CH0,
462 .ab = 155189248,
463 .ib = 620756992,
464 },
465 {
466 .src = MSM_BUS_MASTER_AMPSS_M0,
467 .dst = MSM_BUS_SLAVE_EBI_CH0,
468 .ab = 1750000,
469 .ib = 7000000,
470 },
471 {
472 .src = MSM_BUS_MASTER_AMPSS_M0,
473 .dst = MSM_BUS_SLAVE_EBI_CH0,
474 .ab = 1750000,
475 .ib = 7000000,
476 },
477};
478static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
479 {
480 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
481 .dst = MSM_BUS_SLAVE_EBI_CH0,
482 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700483 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700484 },
485 {
486 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
487 .dst = MSM_BUS_SLAVE_EBI_CH0,
488 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700489 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700490 },
491 {
492 .src = MSM_BUS_MASTER_AMPSS_M0,
493 .dst = MSM_BUS_SLAVE_EBI_CH0,
494 .ab = 2500000,
495 .ib = 5000000,
496 },
497 {
498 .src = MSM_BUS_MASTER_AMPSS_M0,
499 .dst = MSM_BUS_SLAVE_EBI_CH0,
500 .ab = 2500000,
501 .ib = 5000000,
502 },
503};
504static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
505 {
506 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
507 .dst = MSM_BUS_SLAVE_EBI_CH0,
508 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700509 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700510 },
511 {
512 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
513 .dst = MSM_BUS_SLAVE_EBI_CH0,
514 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700515 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700516 },
517 {
518 .src = MSM_BUS_MASTER_AMPSS_M0,
519 .dst = MSM_BUS_SLAVE_EBI_CH0,
520 .ab = 2500000,
521 .ib = 700000000,
522 },
523 {
524 .src = MSM_BUS_MASTER_AMPSS_M0,
525 .dst = MSM_BUS_SLAVE_EBI_CH0,
526 .ab = 2500000,
527 .ib = 10000000,
528 },
529};
530
531static struct msm_bus_paths vidc_bus_client_config[] = {
532 {
533 ARRAY_SIZE(vidc_init_vectors),
534 vidc_init_vectors,
535 },
536 {
537 ARRAY_SIZE(vidc_venc_vga_vectors),
538 vidc_venc_vga_vectors,
539 },
540 {
541 ARRAY_SIZE(vidc_vdec_vga_vectors),
542 vidc_vdec_vga_vectors,
543 },
544 {
545 ARRAY_SIZE(vidc_venc_720p_vectors),
546 vidc_venc_720p_vectors,
547 },
548 {
549 ARRAY_SIZE(vidc_vdec_720p_vectors),
550 vidc_vdec_720p_vectors,
551 },
552 {
553 ARRAY_SIZE(vidc_venc_1080p_vectors),
554 vidc_venc_1080p_vectors,
555 },
556 {
557 ARRAY_SIZE(vidc_vdec_1080p_vectors),
558 vidc_vdec_1080p_vectors,
559 },
560};
561
562static struct msm_bus_scale_pdata vidc_bus_client_data = {
563 vidc_bus_client_config,
564 ARRAY_SIZE(vidc_bus_client_config),
565 .name = "vidc",
566};
567#endif
568
Mona Hossain9c430e32011-07-27 11:04:47 -0700569#ifdef CONFIG_HW_RANDOM_MSM
570/* PRNG device */
571#define MSM_PRNG_PHYS 0x1A500000
572static struct resource rng_resources = {
573 .flags = IORESOURCE_MEM,
574 .start = MSM_PRNG_PHYS,
575 .end = MSM_PRNG_PHYS + SZ_512 - 1,
576};
577
578struct platform_device msm_device_rng = {
579 .name = "msm_rng",
580 .id = 0,
581 .num_resources = 1,
582 .resource = &rng_resources,
583};
584#endif
585
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700586#define MSM_VIDC_BASE_PHYS 0x04400000
587#define MSM_VIDC_BASE_SIZE 0x00100000
588
589static struct resource msm_device_vidc_resources[] = {
590 {
591 .start = MSM_VIDC_BASE_PHYS,
592 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
593 .flags = IORESOURCE_MEM,
594 },
595 {
596 .start = VCODEC_IRQ,
597 .end = VCODEC_IRQ,
598 .flags = IORESOURCE_IRQ,
599 },
600};
601
602struct msm_vidc_platform_data vidc_platform_data = {
603#ifdef CONFIG_MSM_BUS_SCALING
604 .vidc_bus_client_pdata = &vidc_bus_client_data,
605#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -0700606#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -0800607 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700608 .enable_ion = 1,
609#else
Deepak Kotur12301a72011-11-09 18:30:29 -0800610 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -0700611 .enable_ion = 0,
612#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -0800613 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +0530614 .disable_fullhd = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700615};
616
617struct platform_device msm_device_vidc = {
618 .name = "msm_vidc",
619 .id = 0,
620 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
621 .resource = msm_device_vidc_resources,
622 .dev = {
623 .platform_data = &vidc_platform_data,
624 },
625};
626
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700627#define MSM_SDC1_BASE 0x12400000
628#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
629#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
630#define MSM_SDC2_BASE 0x12140000
631#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
632#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
633#define MSM_SDC2_BASE 0x12140000
634#define MSM_SDC3_BASE 0x12180000
635#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
636#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
637#define MSM_SDC4_BASE 0x121C0000
638#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
639#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
640#define MSM_SDC5_BASE 0x12200000
641#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
642#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
643
644static struct resource resources_sdc1[] = {
645 {
646 .name = "core_mem",
647 .flags = IORESOURCE_MEM,
648 .start = MSM_SDC1_BASE,
649 .end = MSM_SDC1_DML_BASE - 1,
650 },
651 {
652 .name = "core_irq",
653 .flags = IORESOURCE_IRQ,
654 .start = SDC1_IRQ_0,
655 .end = SDC1_IRQ_0
656 },
657#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
658 {
659 .name = "sdcc_dml_addr",
660 .start = MSM_SDC1_DML_BASE,
661 .end = MSM_SDC1_BAM_BASE - 1,
662 .flags = IORESOURCE_MEM,
663 },
664 {
665 .name = "sdcc_bam_addr",
666 .start = MSM_SDC1_BAM_BASE,
667 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
668 .flags = IORESOURCE_MEM,
669 },
670 {
671 .name = "sdcc_bam_irq",
672 .start = SDC1_BAM_IRQ,
673 .end = SDC1_BAM_IRQ,
674 .flags = IORESOURCE_IRQ,
675 },
676#endif
677};
678
679static struct resource resources_sdc2[] = {
680 {
681 .name = "core_mem",
682 .flags = IORESOURCE_MEM,
683 .start = MSM_SDC2_BASE,
684 .end = MSM_SDC2_DML_BASE - 1,
685 },
686 {
687 .name = "core_irq",
688 .flags = IORESOURCE_IRQ,
689 .start = SDC2_IRQ_0,
690 .end = SDC2_IRQ_0
691 },
692#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
693 {
694 .name = "sdcc_dml_addr",
695 .start = MSM_SDC2_DML_BASE,
696 .end = MSM_SDC2_BAM_BASE - 1,
697 .flags = IORESOURCE_MEM,
698 },
699 {
700 .name = "sdcc_bam_addr",
701 .start = MSM_SDC2_BAM_BASE,
702 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
703 .flags = IORESOURCE_MEM,
704 },
705 {
706 .name = "sdcc_bam_irq",
707 .start = SDC2_BAM_IRQ,
708 .end = SDC2_BAM_IRQ,
709 .flags = IORESOURCE_IRQ,
710 },
711#endif
712};
713
714static struct resource resources_sdc3[] = {
715 {
716 .name = "core_mem",
717 .flags = IORESOURCE_MEM,
718 .start = MSM_SDC3_BASE,
719 .end = MSM_SDC3_DML_BASE - 1,
720 },
721 {
722 .name = "core_irq",
723 .flags = IORESOURCE_IRQ,
724 .start = SDC3_IRQ_0,
725 .end = SDC3_IRQ_0
726 },
727#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
728 {
729 .name = "sdcc_dml_addr",
730 .start = MSM_SDC3_DML_BASE,
731 .end = MSM_SDC3_BAM_BASE - 1,
732 .flags = IORESOURCE_MEM,
733 },
734 {
735 .name = "sdcc_bam_addr",
736 .start = MSM_SDC3_BAM_BASE,
737 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
738 .flags = IORESOURCE_MEM,
739 },
740 {
741 .name = "sdcc_bam_irq",
742 .start = SDC3_BAM_IRQ,
743 .end = SDC3_BAM_IRQ,
744 .flags = IORESOURCE_IRQ,
745 },
746#endif
747};
748
749static struct resource resources_sdc4[] = {
750 {
751 .name = "core_mem",
752 .flags = IORESOURCE_MEM,
753 .start = MSM_SDC4_BASE,
754 .end = MSM_SDC4_DML_BASE - 1,
755 },
756 {
757 .name = "core_irq",
758 .flags = IORESOURCE_IRQ,
759 .start = SDC4_IRQ_0,
760 .end = SDC4_IRQ_0
761 },
762#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
763 {
764 .name = "sdcc_dml_addr",
765 .start = MSM_SDC4_DML_BASE,
766 .end = MSM_SDC4_BAM_BASE - 1,
767 .flags = IORESOURCE_MEM,
768 },
769 {
770 .name = "sdcc_bam_addr",
771 .start = MSM_SDC4_BAM_BASE,
772 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
773 .flags = IORESOURCE_MEM,
774 },
775 {
776 .name = "sdcc_bam_irq",
777 .start = SDC4_BAM_IRQ,
778 .end = SDC4_BAM_IRQ,
779 .flags = IORESOURCE_IRQ,
780 },
781#endif
782};
783
784static struct resource resources_sdc5[] = {
785 {
786 .name = "core_mem",
787 .flags = IORESOURCE_MEM,
788 .start = MSM_SDC5_BASE,
789 .end = MSM_SDC5_DML_BASE - 1,
790 },
791 {
792 .name = "core_irq",
793 .flags = IORESOURCE_IRQ,
794 .start = SDC5_IRQ_0,
795 .end = SDC5_IRQ_0
796 },
797#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
798 {
799 .name = "sdcc_dml_addr",
800 .start = MSM_SDC5_DML_BASE,
801 .end = MSM_SDC5_BAM_BASE - 1,
802 .flags = IORESOURCE_MEM,
803 },
804 {
805 .name = "sdcc_bam_addr",
806 .start = MSM_SDC5_BAM_BASE,
807 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
808 .flags = IORESOURCE_MEM,
809 },
810 {
811 .name = "sdcc_bam_irq",
812 .start = SDC5_BAM_IRQ,
813 .end = SDC5_BAM_IRQ,
814 .flags = IORESOURCE_IRQ,
815 },
816#endif
817};
818
819struct platform_device msm_device_sdc1 = {
820 .name = "msm_sdcc",
821 .id = 1,
822 .num_resources = ARRAY_SIZE(resources_sdc1),
823 .resource = resources_sdc1,
824 .dev = {
825 .coherent_dma_mask = 0xffffffff,
826 },
827};
828
829struct platform_device msm_device_sdc2 = {
830 .name = "msm_sdcc",
831 .id = 2,
832 .num_resources = ARRAY_SIZE(resources_sdc2),
833 .resource = resources_sdc2,
834 .dev = {
835 .coherent_dma_mask = 0xffffffff,
836 },
837};
838
839struct platform_device msm_device_sdc3 = {
840 .name = "msm_sdcc",
841 .id = 3,
842 .num_resources = ARRAY_SIZE(resources_sdc3),
843 .resource = resources_sdc3,
844 .dev = {
845 .coherent_dma_mask = 0xffffffff,
846 },
847};
848
849struct platform_device msm_device_sdc4 = {
850 .name = "msm_sdcc",
851 .id = 4,
852 .num_resources = ARRAY_SIZE(resources_sdc4),
853 .resource = resources_sdc4,
854 .dev = {
855 .coherent_dma_mask = 0xffffffff,
856 },
857};
858
859struct platform_device msm_device_sdc5 = {
860 .name = "msm_sdcc",
861 .id = 5,
862 .num_resources = ARRAY_SIZE(resources_sdc5),
863 .resource = resources_sdc5,
864 .dev = {
865 .coherent_dma_mask = 0xffffffff,
866 },
867};
868
Stephen Boydeb819882011-08-29 14:46:30 -0700869#define MSM_LPASS_QDSP6SS_PHYS 0x28800000
870#define SFAB_LPASS_Q6_ACLK_CTL (MSM_CLK_CTL_BASE + 0x23A0)
871
872static struct resource msm_8960_q6_lpass_resources[] = {
873 {
874 .start = MSM_LPASS_QDSP6SS_PHYS,
875 .end = MSM_LPASS_QDSP6SS_PHYS + SZ_256 - 1,
876 .flags = IORESOURCE_MEM,
877 },
878};
879
880static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
881 .strap_tcm_base = 0x01460000,
882 .strap_ahb_upper = 0x00290000,
883 .strap_ahb_lower = 0x00000280,
884 .aclk_reg = SFAB_LPASS_Q6_ACLK_CTL,
885 .name = "q6",
886 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700887 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700888};
889
890struct platform_device msm_8960_q6_lpass = {
891 .name = "pil_qdsp6v4",
892 .id = 0,
893 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
894 .resource = msm_8960_q6_lpass_resources,
895 .dev.platform_data = &msm_8960_q6_lpass_data,
896};
897
898#define MSM_MSS_ENABLE_PHYS 0x08B00000
899#define MSM_FW_QDSP6SS_PHYS 0x08800000
900#define MSS_Q6FW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C6C)
901#define SFAB_MSS_Q6_FW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2044)
902
903static struct resource msm_8960_q6_mss_fw_resources[] = {
904 {
905 .start = MSM_FW_QDSP6SS_PHYS,
906 .end = MSM_FW_QDSP6SS_PHYS + SZ_256 - 1,
907 .flags = IORESOURCE_MEM,
908 },
909 {
910 .start = MSM_MSS_ENABLE_PHYS,
911 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
912 .flags = IORESOURCE_MEM,
913 },
914};
915
916static struct pil_q6v4_pdata msm_8960_q6_mss_fw_data = {
917 .strap_tcm_base = 0x00400000,
918 .strap_ahb_upper = 0x00090000,
919 .strap_ahb_lower = 0x00000080,
920 .aclk_reg = SFAB_MSS_Q6_FW_ACLK_CTL,
921 .jtag_clk_reg = MSS_Q6FW_JTAG_CLK_CTL,
922 .name = "modem_fw",
923 .depends = "q6",
924 .pas_id = PAS_MODEM_FW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700925 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700926};
927
928struct platform_device msm_8960_q6_mss_fw = {
929 .name = "pil_qdsp6v4",
930 .id = 1,
931 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_fw_resources),
932 .resource = msm_8960_q6_mss_fw_resources,
933 .dev.platform_data = &msm_8960_q6_mss_fw_data,
934};
935
936#define MSM_SW_QDSP6SS_PHYS 0x08900000
937#define SFAB_MSS_Q6_SW_ACLK_CTL (MSM_CLK_CTL_BASE + 0x2040)
938#define MSS_Q6SW_JTAG_CLK_CTL (MSM_CLK_CTL_BASE + 0x2C68)
939
940static struct resource msm_8960_q6_mss_sw_resources[] = {
941 {
942 .start = MSM_SW_QDSP6SS_PHYS,
943 .end = MSM_SW_QDSP6SS_PHYS + SZ_256 - 1,
944 .flags = IORESOURCE_MEM,
945 },
946 {
947 .start = MSM_MSS_ENABLE_PHYS,
948 .end = MSM_MSS_ENABLE_PHYS + 4 - 1,
949 .flags = IORESOURCE_MEM,
950 },
951};
952
953static struct pil_q6v4_pdata msm_8960_q6_mss_sw_data = {
954 .strap_tcm_base = 0x00420000,
955 .strap_ahb_upper = 0x00090000,
956 .strap_ahb_lower = 0x00000080,
957 .aclk_reg = SFAB_MSS_Q6_SW_ACLK_CTL,
958 .jtag_clk_reg = MSS_Q6SW_JTAG_CLK_CTL,
959 .name = "modem",
960 .depends = "modem_fw",
961 .pas_id = PAS_MODEM_SW,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -0700962 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -0700963};
964
965struct platform_device msm_8960_q6_mss_sw = {
966 .name = "pil_qdsp6v4",
967 .id = 2,
968 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_sw_resources),
969 .resource = msm_8960_q6_mss_sw_resources,
970 .dev.platform_data = &msm_8960_q6_mss_sw_data,
971};
972
Stephen Boyd322a9922011-09-20 01:05:54 -0700973static struct resource msm_8960_riva_resources[] = {
974 {
975 .start = 0x03204000,
976 .end = 0x03204000 + SZ_256 - 1,
977 .flags = IORESOURCE_MEM,
978 },
979};
980
981struct platform_device msm_8960_riva = {
982 .name = "pil_riva",
983 .id = -1,
984 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
985 .resource = msm_8960_riva_resources,
986};
987
Stephen Boydd89eebe2011-09-28 23:28:11 -0700988struct platform_device msm_pil_tzapps = {
989 .name = "pil_tzapps",
990 .id = -1,
991};
992
Stephen Boyd25c4a0b2011-09-20 00:12:36 -0700993struct platform_device msm_pil_dsps = {
994 .name = "pil_dsps",
995 .id = -1,
996 .dev.platform_data = "dsps",
997};
998
Eric Holmberg023d25c2012-03-01 12:27:55 -0700999static struct resource smd_resource[] = {
1000 {
1001 .name = "a9_m2a_0",
1002 .start = INT_A9_M2A_0,
1003 .flags = IORESOURCE_IRQ,
1004 },
1005 {
1006 .name = "a9_m2a_5",
1007 .start = INT_A9_M2A_5,
1008 .flags = IORESOURCE_IRQ,
1009 },
1010 {
1011 .name = "adsp_a11",
1012 .start = INT_ADSP_A11,
1013 .flags = IORESOURCE_IRQ,
1014 },
1015 {
1016 .name = "adsp_a11_smsm",
1017 .start = INT_ADSP_A11_SMSM,
1018 .flags = IORESOURCE_IRQ,
1019 },
1020 {
1021 .name = "dsps_a11",
1022 .start = INT_DSPS_A11,
1023 .flags = IORESOURCE_IRQ,
1024 },
1025 {
1026 .name = "dsps_a11_smsm",
1027 .start = INT_DSPS_A11_SMSM,
1028 .flags = IORESOURCE_IRQ,
1029 },
1030 {
1031 .name = "wcnss_a11",
1032 .start = INT_WCNSS_A11,
1033 .flags = IORESOURCE_IRQ,
1034 },
1035 {
1036 .name = "wcnss_a11_smsm",
1037 .start = INT_WCNSS_A11_SMSM,
1038 .flags = IORESOURCE_IRQ,
1039 },
1040};
1041
1042static struct smd_subsystem_config smd_config_list[] = {
1043 {
1044 .irq_config_id = SMD_MODEM,
1045 .subsys_name = "modem",
1046 .edge = SMD_APPS_MODEM,
1047
1048 .smd_int.irq_name = "a9_m2a_0",
1049 .smd_int.flags = IRQF_TRIGGER_RISING,
1050 .smd_int.irq_id = -1,
1051 .smd_int.device_name = "smd_dev",
1052 .smd_int.dev_id = 0,
1053 .smd_int.out_bit_pos = 1 << 3,
1054 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1055 .smd_int.out_offset = 0x8,
1056
1057 .smsm_int.irq_name = "a9_m2a_5",
1058 .smsm_int.flags = IRQF_TRIGGER_RISING,
1059 .smsm_int.irq_id = -1,
1060 .smsm_int.device_name = "smd_smsm",
1061 .smsm_int.dev_id = 0,
1062 .smsm_int.out_bit_pos = 1 << 4,
1063 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1064 .smsm_int.out_offset = 0x8,
1065 },
1066 {
1067 .irq_config_id = SMD_Q6,
1068 .subsys_name = "q6",
1069 .edge = SMD_APPS_QDSP,
1070
1071 .smd_int.irq_name = "adsp_a11",
1072 .smd_int.flags = IRQF_TRIGGER_RISING,
1073 .smd_int.irq_id = -1,
1074 .smd_int.device_name = "smd_dev",
1075 .smd_int.dev_id = 0,
1076 .smd_int.out_bit_pos = 1 << 15,
1077 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1078 .smd_int.out_offset = 0x8,
1079
1080 .smsm_int.irq_name = "adsp_a11_smsm",
1081 .smsm_int.flags = IRQF_TRIGGER_RISING,
1082 .smsm_int.irq_id = -1,
1083 .smsm_int.device_name = "smd_smsm",
1084 .smsm_int.dev_id = 0,
1085 .smsm_int.out_bit_pos = 1 << 14,
1086 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1087 .smsm_int.out_offset = 0x8,
1088 },
1089 {
1090 .irq_config_id = SMD_DSPS,
1091 .subsys_name = "dsps",
1092 .edge = SMD_APPS_DSPS,
1093
1094 .smd_int.irq_name = "dsps_a11",
1095 .smd_int.flags = IRQF_TRIGGER_RISING,
1096 .smd_int.irq_id = -1,
1097 .smd_int.device_name = "smd_dev",
1098 .smd_int.dev_id = 0,
1099 .smd_int.out_bit_pos = 1,
1100 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1101 .smd_int.out_offset = 0x4080,
1102
1103 .smsm_int.irq_name = "dsps_a11_smsm",
1104 .smsm_int.flags = IRQF_TRIGGER_RISING,
1105 .smsm_int.irq_id = -1,
1106 .smsm_int.device_name = "smd_smsm",
1107 .smsm_int.dev_id = 0,
1108 .smsm_int.out_bit_pos = 1,
1109 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1110 .smsm_int.out_offset = 0x4094,
1111 },
1112 {
1113 .irq_config_id = SMD_WCNSS,
1114 .subsys_name = "wcnss",
1115 .edge = SMD_APPS_WCNSS,
1116
1117 .smd_int.irq_name = "wcnss_a11",
1118 .smd_int.flags = IRQF_TRIGGER_RISING,
1119 .smd_int.irq_id = -1,
1120 .smd_int.device_name = "smd_dev",
1121 .smd_int.dev_id = 0,
1122 .smd_int.out_bit_pos = 1 << 25,
1123 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1124 .smd_int.out_offset = 0x8,
1125
1126 .smsm_int.irq_name = "wcnss_a11_smsm",
1127 .smsm_int.flags = IRQF_TRIGGER_RISING,
1128 .smsm_int.irq_id = -1,
1129 .smsm_int.device_name = "smd_smsm",
1130 .smsm_int.dev_id = 0,
1131 .smsm_int.out_bit_pos = 1 << 23,
1132 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1133 .smsm_int.out_offset = 0x8,
1134 },
1135};
1136
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001137static struct smd_subsystem_restart_config smd_ssr_config = {
1138 .disable_smsm_reset_handshake = 1,
1139};
1140
Eric Holmberg023d25c2012-03-01 12:27:55 -07001141static struct smd_platform smd_platform_data = {
1142 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1143 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001144 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001145};
1146
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001147struct platform_device msm_device_smd = {
1148 .name = "msm_smd",
1149 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001150 .resource = smd_resource,
1151 .num_resources = ARRAY_SIZE(smd_resource),
1152 .dev = {
1153 .platform_data = &smd_platform_data,
1154 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001155};
1156
1157struct platform_device msm_device_bam_dmux = {
1158 .name = "BAM_RMNT",
1159 .id = -1,
1160};
1161
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001162static struct msm_watchdog_pdata msm_watchdog_pdata = {
1163 .pet_time = 10000,
1164 .bark_time = 11000,
1165 .has_secure = true,
1166};
1167
1168struct platform_device msm8960_device_watchdog = {
1169 .name = "msm_watchdog",
1170 .id = -1,
1171 .dev = {
1172 .platform_data = &msm_watchdog_pdata,
1173 },
1174};
1175
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001176static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001177 {
1178 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001179 .flags = IORESOURCE_IRQ,
1180 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001181 {
1182 .start = 0x18320000,
1183 .end = 0x18320000 + SZ_1M - 1,
1184 .flags = IORESOURCE_MEM,
1185 },
1186};
1187
1188static struct msm_dmov_pdata msm_dmov_pdata = {
1189 .sd = 1,
1190 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001191};
1192
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001193struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001194 .name = "msm_dmov",
1195 .id = -1,
1196 .resource = msm_dmov_resource,
1197 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001198 .dev = {
1199 .platform_data = &msm_dmov_pdata,
1200 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001201};
1202
1203static struct platform_device *msm_sdcc_devices[] __initdata = {
1204 &msm_device_sdc1,
1205 &msm_device_sdc2,
1206 &msm_device_sdc3,
1207 &msm_device_sdc4,
1208 &msm_device_sdc5,
1209};
1210
1211int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1212{
1213 struct platform_device *pdev;
1214
1215 if (controller < 1 || controller > 5)
1216 return -EINVAL;
1217
1218 pdev = msm_sdcc_devices[controller-1];
1219 pdev->dev.platform_data = plat;
1220 return platform_device_register(pdev);
1221}
1222
1223static struct resource resources_qup_i2c_gsbi4[] = {
1224 {
1225 .name = "gsbi_qup_i2c_addr",
1226 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001227 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001228 .flags = IORESOURCE_MEM,
1229 },
1230 {
1231 .name = "qup_phys_addr",
1232 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001233 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001234 .flags = IORESOURCE_MEM,
1235 },
1236 {
1237 .name = "qup_err_intr",
1238 .start = GSBI4_QUP_IRQ,
1239 .end = GSBI4_QUP_IRQ,
1240 .flags = IORESOURCE_IRQ,
1241 },
1242};
1243
1244struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1245 .name = "qup_i2c",
1246 .id = 4,
1247 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1248 .resource = resources_qup_i2c_gsbi4,
1249};
1250
1251static struct resource resources_qup_i2c_gsbi3[] = {
1252 {
1253 .name = "gsbi_qup_i2c_addr",
1254 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001255 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001256 .flags = IORESOURCE_MEM,
1257 },
1258 {
1259 .name = "qup_phys_addr",
1260 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001261 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001262 .flags = IORESOURCE_MEM,
1263 },
1264 {
1265 .name = "qup_err_intr",
1266 .start = GSBI3_QUP_IRQ,
1267 .end = GSBI3_QUP_IRQ,
1268 .flags = IORESOURCE_IRQ,
1269 },
1270};
1271
1272struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1273 .name = "qup_i2c",
1274 .id = 3,
1275 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1276 .resource = resources_qup_i2c_gsbi3,
1277};
1278
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06001279static struct resource resources_qup_i2c_gsbi9[] = {
1280 {
1281 .name = "gsbi_qup_i2c_addr",
1282 .start = MSM_GSBI9_PHYS,
1283 .end = MSM_GSBI9_PHYS + 4 - 1,
1284 .flags = IORESOURCE_MEM,
1285 },
1286 {
1287 .name = "qup_phys_addr",
1288 .start = MSM_GSBI9_QUP_PHYS,
1289 .end = MSM_GSBI9_QUP_PHYS + MSM_QUP_SIZE - 1,
1290 .flags = IORESOURCE_MEM,
1291 },
1292 {
1293 .name = "qup_err_intr",
1294 .start = GSBI9_QUP_IRQ,
1295 .end = GSBI9_QUP_IRQ,
1296 .flags = IORESOURCE_IRQ,
1297 },
1298};
1299
1300struct platform_device msm8960_device_qup_i2c_gsbi9 = {
1301 .name = "qup_i2c",
1302 .id = 0,
1303 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi9),
1304 .resource = resources_qup_i2c_gsbi9,
1305};
1306
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001307static struct resource resources_qup_i2c_gsbi10[] = {
1308 {
1309 .name = "gsbi_qup_i2c_addr",
1310 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001311 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001312 .flags = IORESOURCE_MEM,
1313 },
1314 {
1315 .name = "qup_phys_addr",
1316 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001317 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001318 .flags = IORESOURCE_MEM,
1319 },
1320 {
1321 .name = "qup_err_intr",
1322 .start = GSBI10_QUP_IRQ,
1323 .end = GSBI10_QUP_IRQ,
1324 .flags = IORESOURCE_IRQ,
1325 },
1326};
1327
1328struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1329 .name = "qup_i2c",
1330 .id = 10,
1331 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1332 .resource = resources_qup_i2c_gsbi10,
1333};
1334
1335static struct resource resources_qup_i2c_gsbi12[] = {
1336 {
1337 .name = "gsbi_qup_i2c_addr",
1338 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001339 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001340 .flags = IORESOURCE_MEM,
1341 },
1342 {
1343 .name = "qup_phys_addr",
1344 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001345 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001346 .flags = IORESOURCE_MEM,
1347 },
1348 {
1349 .name = "qup_err_intr",
1350 .start = GSBI12_QUP_IRQ,
1351 .end = GSBI12_QUP_IRQ,
1352 .flags = IORESOURCE_IRQ,
1353 },
1354};
1355
1356struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1357 .name = "qup_i2c",
1358 .id = 12,
1359 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1360 .resource = resources_qup_i2c_gsbi12,
1361};
1362
1363#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001364static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001365 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001366 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301367 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001368 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301369 .flags = IORESOURCE_MEM,
1370 },
1371 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001372 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301373 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001374 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301375 .flags = IORESOURCE_MEM,
1376 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001377};
1378
Kevin Chanbb8ef862012-02-14 13:03:04 -08001379struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1380 .name = "msm_cam_i2c_mux",
1381 .id = 0,
1382 .resource = msm_cam_gsbi4_i2c_mux_resources,
1383 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1384};
Kevin Chanf6216f22011-10-25 18:40:11 -07001385
1386static struct resource msm_csiphy0_resources[] = {
1387 {
1388 .name = "csiphy",
1389 .start = 0x04800C00,
1390 .end = 0x04800C00 + SZ_1K - 1,
1391 .flags = IORESOURCE_MEM,
1392 },
1393 {
1394 .name = "csiphy",
1395 .start = CSIPHY_4LN_IRQ,
1396 .end = CSIPHY_4LN_IRQ,
1397 .flags = IORESOURCE_IRQ,
1398 },
1399};
1400
1401static struct resource msm_csiphy1_resources[] = {
1402 {
1403 .name = "csiphy",
1404 .start = 0x04801000,
1405 .end = 0x04801000 + SZ_1K - 1,
1406 .flags = IORESOURCE_MEM,
1407 },
1408 {
1409 .name = "csiphy",
1410 .start = MSM8960_CSIPHY_2LN_IRQ,
1411 .end = MSM8960_CSIPHY_2LN_IRQ,
1412 .flags = IORESOURCE_IRQ,
1413 },
1414};
1415
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001416static struct resource msm_csiphy2_resources[] = {
1417 {
1418 .name = "csiphy",
1419 .start = 0x04801400,
1420 .end = 0x04801400 + SZ_1K - 1,
1421 .flags = IORESOURCE_MEM,
1422 },
1423 {
1424 .name = "csiphy",
1425 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1426 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1427 .flags = IORESOURCE_IRQ,
1428 },
1429};
1430
Kevin Chanf6216f22011-10-25 18:40:11 -07001431struct platform_device msm8960_device_csiphy0 = {
1432 .name = "msm_csiphy",
1433 .id = 0,
1434 .resource = msm_csiphy0_resources,
1435 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
1436};
1437
1438struct platform_device msm8960_device_csiphy1 = {
1439 .name = "msm_csiphy",
1440 .id = 1,
1441 .resource = msm_csiphy1_resources,
1442 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
1443};
Kevin Chanc8b52e82011-10-25 23:20:21 -07001444
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001445struct platform_device msm8960_device_csiphy2 = {
1446 .name = "msm_csiphy",
1447 .id = 2,
1448 .resource = msm_csiphy2_resources,
1449 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
1450};
1451
Kevin Chanc8b52e82011-10-25 23:20:21 -07001452static struct resource msm_csid0_resources[] = {
1453 {
1454 .name = "csid",
1455 .start = 0x04800000,
1456 .end = 0x04800000 + SZ_1K - 1,
1457 .flags = IORESOURCE_MEM,
1458 },
1459 {
1460 .name = "csid",
1461 .start = CSI_0_IRQ,
1462 .end = CSI_0_IRQ,
1463 .flags = IORESOURCE_IRQ,
1464 },
1465};
1466
1467static struct resource msm_csid1_resources[] = {
1468 {
1469 .name = "csid",
1470 .start = 0x04800400,
1471 .end = 0x04800400 + SZ_1K - 1,
1472 .flags = IORESOURCE_MEM,
1473 },
1474 {
1475 .name = "csid",
1476 .start = CSI_1_IRQ,
1477 .end = CSI_1_IRQ,
1478 .flags = IORESOURCE_IRQ,
1479 },
1480};
1481
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001482static struct resource msm_csid2_resources[] = {
1483 {
1484 .name = "csid",
1485 .start = 0x04801800,
1486 .end = 0x04801800 + SZ_1K - 1,
1487 .flags = IORESOURCE_MEM,
1488 },
1489 {
1490 .name = "csid",
1491 .start = CSI_2_IRQ,
1492 .end = CSI_2_IRQ,
1493 .flags = IORESOURCE_IRQ,
1494 },
1495};
1496
Kevin Chanc8b52e82011-10-25 23:20:21 -07001497struct platform_device msm8960_device_csid0 = {
1498 .name = "msm_csid",
1499 .id = 0,
1500 .resource = msm_csid0_resources,
1501 .num_resources = ARRAY_SIZE(msm_csid0_resources),
1502};
1503
1504struct platform_device msm8960_device_csid1 = {
1505 .name = "msm_csid",
1506 .id = 1,
1507 .resource = msm_csid1_resources,
1508 .num_resources = ARRAY_SIZE(msm_csid1_resources),
1509};
Kevin Chane12c6672011-10-26 11:55:26 -07001510
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001511struct platform_device msm8960_device_csid2 = {
1512 .name = "msm_csid",
1513 .id = 2,
1514 .resource = msm_csid2_resources,
1515 .num_resources = ARRAY_SIZE(msm_csid2_resources),
1516};
1517
Kevin Chane12c6672011-10-26 11:55:26 -07001518struct resource msm_ispif_resources[] = {
1519 {
1520 .name = "ispif",
1521 .start = 0x04800800,
1522 .end = 0x04800800 + SZ_1K - 1,
1523 .flags = IORESOURCE_MEM,
1524 },
1525 {
1526 .name = "ispif",
1527 .start = ISPIF_IRQ,
1528 .end = ISPIF_IRQ,
1529 .flags = IORESOURCE_IRQ,
1530 },
1531};
1532
1533struct platform_device msm8960_device_ispif = {
1534 .name = "msm_ispif",
1535 .id = 0,
1536 .resource = msm_ispif_resources,
1537 .num_resources = ARRAY_SIZE(msm_ispif_resources),
1538};
Kevin Chan5827c552011-10-28 18:36:32 -07001539
1540static struct resource msm_vfe_resources[] = {
1541 {
1542 .name = "vfe32",
1543 .start = 0x04500000,
1544 .end = 0x04500000 + SZ_1M - 1,
1545 .flags = IORESOURCE_MEM,
1546 },
1547 {
1548 .name = "vfe32",
1549 .start = VFE_IRQ,
1550 .end = VFE_IRQ,
1551 .flags = IORESOURCE_IRQ,
1552 },
1553};
1554
1555struct platform_device msm8960_device_vfe = {
1556 .name = "msm_vfe",
1557 .id = 0,
1558 .resource = msm_vfe_resources,
1559 .num_resources = ARRAY_SIZE(msm_vfe_resources),
1560};
Kevin Chana0853122011-11-07 19:48:44 -08001561
1562static struct resource msm_vpe_resources[] = {
1563 {
1564 .name = "vpe",
1565 .start = 0x05300000,
1566 .end = 0x05300000 + SZ_1M - 1,
1567 .flags = IORESOURCE_MEM,
1568 },
1569 {
1570 .name = "vpe",
1571 .start = VPE_IRQ,
1572 .end = VPE_IRQ,
1573 .flags = IORESOURCE_IRQ,
1574 },
1575};
1576
1577struct platform_device msm8960_device_vpe = {
1578 .name = "msm_vpe",
1579 .id = 0,
1580 .resource = msm_vpe_resources,
1581 .num_resources = ARRAY_SIZE(msm_vpe_resources),
1582};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001583#endif
1584
Joel Nidera1261942011-09-12 16:30:09 +03001585#define MSM_TSIF0_PHYS (0x18200000)
1586#define MSM_TSIF1_PHYS (0x18201000)
1587#define MSM_TSIF_SIZE (0x200)
1588
1589#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
1590 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1591#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
1592 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1593#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
1594 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1595#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
1596 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1597#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
1598 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1599#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
1600 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1601#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
1602 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1603#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
1604 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1605
1606static const struct msm_gpio tsif0_gpios[] = {
1607 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
1608 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
1609 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
1610 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
1611};
1612
1613static const struct msm_gpio tsif1_gpios[] = {
1614 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
1615 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
1616 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
1617 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
1618};
1619
1620struct msm_tsif_platform_data tsif1_platform_data = {
1621 .num_gpios = ARRAY_SIZE(tsif1_gpios),
1622 .gpios = tsif1_gpios,
1623 .tsif_pclk = "tsif_pclk",
1624 .tsif_ref_clk = "tsif_ref_clk",
1625};
1626
1627struct resource tsif1_resources[] = {
1628 [0] = {
1629 .flags = IORESOURCE_IRQ,
1630 .start = TSIF2_IRQ,
1631 .end = TSIF2_IRQ,
1632 },
1633 [1] = {
1634 .flags = IORESOURCE_MEM,
1635 .start = MSM_TSIF1_PHYS,
1636 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1637 },
1638 [2] = {
1639 .flags = IORESOURCE_DMA,
1640 .start = DMOV_TSIF_CHAN,
1641 .end = DMOV_TSIF_CRCI,
1642 },
1643};
1644
1645struct msm_tsif_platform_data tsif0_platform_data = {
1646 .num_gpios = ARRAY_SIZE(tsif0_gpios),
1647 .gpios = tsif0_gpios,
1648 .tsif_pclk = "tsif_pclk",
1649 .tsif_ref_clk = "tsif_ref_clk",
1650};
1651struct resource tsif0_resources[] = {
1652 [0] = {
1653 .flags = IORESOURCE_IRQ,
1654 .start = TSIF1_IRQ,
1655 .end = TSIF1_IRQ,
1656 },
1657 [1] = {
1658 .flags = IORESOURCE_MEM,
1659 .start = MSM_TSIF0_PHYS,
1660 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1661 },
1662 [2] = {
1663 .flags = IORESOURCE_DMA,
1664 .start = DMOV_TSIF_CHAN,
1665 .end = DMOV_TSIF_CRCI,
1666 },
1667};
1668
1669struct platform_device msm_device_tsif[2] = {
1670 {
1671 .name = "msm_tsif",
1672 .id = 0,
1673 .num_resources = ARRAY_SIZE(tsif0_resources),
1674 .resource = tsif0_resources,
1675 .dev = {
1676 .platform_data = &tsif0_platform_data
1677 },
1678 },
1679 {
1680 .name = "msm_tsif",
1681 .id = 1,
1682 .num_resources = ARRAY_SIZE(tsif1_resources),
1683 .resource = tsif1_resources,
1684 .dev = {
1685 .platform_data = &tsif1_platform_data
1686 },
1687 }
1688};
1689
Jay Chokshi33c044a2011-12-07 13:05:40 -08001690static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001691 {
1692 .start = MSM_PMIC1_SSBI_CMD_PHYS,
1693 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1694 .flags = IORESOURCE_MEM,
1695 },
1696};
1697
Jay Chokshi33c044a2011-12-07 13:05:40 -08001698struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001699 .name = "msm_ssbi",
1700 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08001701 .resource = resources_ssbi_pmic,
1702 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001703};
1704
1705static struct resource resources_qup_spi_gsbi1[] = {
1706 {
1707 .name = "spi_base",
1708 .start = MSM_GSBI1_QUP_PHYS,
1709 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1710 .flags = IORESOURCE_MEM,
1711 },
1712 {
1713 .name = "gsbi_base",
1714 .start = MSM_GSBI1_PHYS,
1715 .end = MSM_GSBI1_PHYS + 4 - 1,
1716 .flags = IORESOURCE_MEM,
1717 },
1718 {
1719 .name = "spi_irq_in",
1720 .start = MSM8960_GSBI1_QUP_IRQ,
1721 .end = MSM8960_GSBI1_QUP_IRQ,
1722 .flags = IORESOURCE_IRQ,
1723 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001724 {
1725 .name = "spi_clk",
1726 .start = 9,
1727 .end = 9,
1728 .flags = IORESOURCE_IO,
1729 },
1730 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06001731 .name = "spi_miso",
1732 .start = 7,
1733 .end = 7,
1734 .flags = IORESOURCE_IO,
1735 },
1736 {
1737 .name = "spi_mosi",
1738 .start = 6,
1739 .end = 6,
1740 .flags = IORESOURCE_IO,
1741 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07001742 {
1743 .name = "spi_cs",
1744 .start = 8,
1745 .end = 8,
1746 .flags = IORESOURCE_IO,
1747 },
1748 {
1749 .name = "spi_cs1",
1750 .start = 14,
1751 .end = 14,
1752 .flags = IORESOURCE_IO,
1753 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001754};
1755
1756struct platform_device msm8960_device_qup_spi_gsbi1 = {
1757 .name = "spi_qsd",
1758 .id = 0,
1759 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
1760 .resource = resources_qup_spi_gsbi1,
1761};
1762
1763struct platform_device msm_pcm = {
1764 .name = "msm-pcm-dsp",
1765 .id = -1,
1766};
1767
Kiran Kandi5e809b02012-01-31 00:24:33 -08001768struct platform_device msm_multi_ch_pcm = {
1769 .name = "msm-multi-ch-pcm-dsp",
1770 .id = -1,
1771};
1772
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001773struct platform_device msm_pcm_routing = {
1774 .name = "msm-pcm-routing",
1775 .id = -1,
1776};
1777
1778struct platform_device msm_cpudai0 = {
1779 .name = "msm-dai-q6",
1780 .id = 0x4000,
1781};
1782
1783struct platform_device msm_cpudai1 = {
1784 .name = "msm-dai-q6",
1785 .id = 0x4001,
1786};
1787
1788struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08001789 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001790 .id = 8,
1791};
1792
1793struct platform_device msm_cpudai_bt_rx = {
1794 .name = "msm-dai-q6",
1795 .id = 0x3000,
1796};
1797
1798struct platform_device msm_cpudai_bt_tx = {
1799 .name = "msm-dai-q6",
1800 .id = 0x3001,
1801};
1802
1803struct platform_device msm_cpudai_fm_rx = {
1804 .name = "msm-dai-q6",
1805 .id = 0x3004,
1806};
1807
1808struct platform_device msm_cpudai_fm_tx = {
1809 .name = "msm-dai-q6",
1810 .id = 0x3005,
1811};
1812
Helen Zeng0705a5f2011-10-14 15:29:52 -07001813struct platform_device msm_cpudai_incall_music_rx = {
1814 .name = "msm-dai-q6",
1815 .id = 0x8005,
1816};
1817
Helen Zenge3d716a2011-10-14 16:32:16 -07001818struct platform_device msm_cpudai_incall_record_rx = {
1819 .name = "msm-dai-q6",
1820 .id = 0x8004,
1821};
1822
1823struct platform_device msm_cpudai_incall_record_tx = {
1824 .name = "msm-dai-q6",
1825 .id = 0x8003,
1826};
1827
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001828/*
1829 * Machine specific data for AUX PCM Interface
1830 * which the driver will be unware of.
1831 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001832struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001833 .clk = "pcm_clk",
1834 .mode = AFE_PCM_CFG_MODE_PCM,
1835 .sync = AFE_PCM_CFG_SYNC_INT,
1836 .frame = AFE_PCM_CFG_FRM_256BPF,
1837 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
1838 .slot = 0,
1839 .data = AFE_PCM_CFG_CDATAOE_MASTER,
1840 .pcm_clk_rate = 2048000,
1841};
1842
1843struct platform_device msm_cpudai_auxpcm_rx = {
1844 .name = "msm-dai-q6",
1845 .id = 2,
1846 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001847 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001848 },
1849};
1850
1851struct platform_device msm_cpudai_auxpcm_tx = {
1852 .name = "msm-dai-q6",
1853 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08001854 .dev = {
1855 .platform_data = &auxpcm_pdata,
1856 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07001857};
1858
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001859struct platform_device msm_cpu_fe = {
1860 .name = "msm-dai-fe",
1861 .id = -1,
1862};
1863
1864struct platform_device msm_stub_codec = {
1865 .name = "msm-stub-codec",
1866 .id = 1,
1867};
1868
1869struct platform_device msm_voice = {
1870 .name = "msm-pcm-voice",
1871 .id = -1,
1872};
1873
1874struct platform_device msm_voip = {
1875 .name = "msm-voip-dsp",
1876 .id = -1,
1877};
1878
1879struct platform_device msm_lpa_pcm = {
1880 .name = "msm-pcm-lpa",
1881 .id = -1,
1882};
1883
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05301884struct platform_device msm_compr_dsp = {
1885 .name = "msm-compr-dsp",
1886 .id = -1,
1887};
1888
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001889struct platform_device msm_pcm_hostless = {
1890 .name = "msm-pcm-hostless",
1891 .id = -1,
1892};
1893
Laxminath Kasamcee1d602011-08-01 19:26:57 +05301894struct platform_device msm_cpudai_afe_01_rx = {
1895 .name = "msm-dai-q6",
1896 .id = 0xE0,
1897};
1898
1899struct platform_device msm_cpudai_afe_01_tx = {
1900 .name = "msm-dai-q6",
1901 .id = 0xF0,
1902};
1903
1904struct platform_device msm_cpudai_afe_02_rx = {
1905 .name = "msm-dai-q6",
1906 .id = 0xF1,
1907};
1908
1909struct platform_device msm_cpudai_afe_02_tx = {
1910 .name = "msm-dai-q6",
1911 .id = 0xE1,
1912};
1913
1914struct platform_device msm_pcm_afe = {
1915 .name = "msm-pcm-afe",
1916 .id = -1,
1917};
1918
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001919struct platform_device *msm_footswitch_devices[] = {
Ravishangar Kalyanamb31a0e42012-01-19 16:02:34 -08001920 FS_8X60(FS_MDP, "fs_mdp"),
Nagamalleswararao Ganjifd7454a2011-08-09 10:56:40 -07001921 FS_8X60(FS_ROT, "fs_rot"),
Shuzhen Wang4d28c092011-07-14 15:40:33 -07001922 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1923 FS_8X60(FS_VFE, "fs_vfe"),
1924 FS_8X60(FS_VPE, "fs_vpe"),
Lucille Sylvestera610fb12011-07-22 17:22:20 -06001925 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1926 FS_8X60(FS_GFX2D0, "fs_gfx2d0"),
1927 FS_8X60(FS_GFX2D1, "fs_gfx2d1"),
Gopikrishnaiah Anandan031eb942011-07-28 13:24:00 -07001928 FS_8X60(FS_VED, "fs_ved"),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001929};
1930unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
1931
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001932
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001933#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07001934static struct msm_bus_vectors rotator_init_vectors[] = {
1935 {
1936 .src = MSM_BUS_MASTER_ROTATOR,
1937 .dst = MSM_BUS_SLAVE_EBI_CH0,
1938 .ab = 0,
1939 .ib = 0,
1940 },
1941};
1942
1943static struct msm_bus_vectors rotator_ui_vectors[] = {
1944 {
1945 .src = MSM_BUS_MASTER_ROTATOR,
1946 .dst = MSM_BUS_SLAVE_EBI_CH0,
1947 .ab = (1024 * 600 * 4 * 2 * 60),
1948 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
1949 },
1950};
1951
1952static struct msm_bus_vectors rotator_vga_vectors[] = {
1953 {
1954 .src = MSM_BUS_MASTER_ROTATOR,
1955 .dst = MSM_BUS_SLAVE_EBI_CH0,
1956 .ab = (640 * 480 * 2 * 2 * 30),
1957 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
1958 },
1959};
1960static struct msm_bus_vectors rotator_720p_vectors[] = {
1961 {
1962 .src = MSM_BUS_MASTER_ROTATOR,
1963 .dst = MSM_BUS_SLAVE_EBI_CH0,
1964 .ab = (1280 * 736 * 2 * 2 * 30),
1965 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
1966 },
1967};
1968
1969static struct msm_bus_vectors rotator_1080p_vectors[] = {
1970 {
1971 .src = MSM_BUS_MASTER_ROTATOR,
1972 .dst = MSM_BUS_SLAVE_EBI_CH0,
1973 .ab = (1920 * 1088 * 2 * 2 * 30),
1974 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
1975 },
1976};
1977
1978static struct msm_bus_paths rotator_bus_scale_usecases[] = {
1979 {
1980 ARRAY_SIZE(rotator_init_vectors),
1981 rotator_init_vectors,
1982 },
1983 {
1984 ARRAY_SIZE(rotator_ui_vectors),
1985 rotator_ui_vectors,
1986 },
1987 {
1988 ARRAY_SIZE(rotator_vga_vectors),
1989 rotator_vga_vectors,
1990 },
1991 {
1992 ARRAY_SIZE(rotator_720p_vectors),
1993 rotator_720p_vectors,
1994 },
1995 {
1996 ARRAY_SIZE(rotator_1080p_vectors),
1997 rotator_1080p_vectors,
1998 },
1999};
2000
2001struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2002 rotator_bus_scale_usecases,
2003 ARRAY_SIZE(rotator_bus_scale_usecases),
2004 .name = "rotator",
2005};
2006
2007void __init msm_rotator_update_bus_vectors(unsigned int xres,
2008 unsigned int yres)
2009{
2010 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2011 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2012}
2013
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002014#define ROTATOR_HW_BASE 0x04E00000
2015static struct resource resources_msm_rotator[] = {
2016 {
2017 .start = ROTATOR_HW_BASE,
2018 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2019 .flags = IORESOURCE_MEM,
2020 },
2021 {
2022 .start = ROT_IRQ,
2023 .end = ROT_IRQ,
2024 .flags = IORESOURCE_IRQ,
2025 },
2026};
2027
2028static struct msm_rot_clocks rotator_clocks[] = {
2029 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002030 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002031 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002032 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002033 },
2034 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002035 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002036 .clk_type = ROTATOR_PCLK,
2037 .clk_rate = 0,
2038 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002039};
2040
2041static struct msm_rotator_platform_data rotator_pdata = {
2042 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2043 .hardware_version_number = 0x01020309,
2044 .rotator_clks = rotator_clocks,
2045 .regulator_name = "fs_rot",
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002046#ifdef CONFIG_MSM_BUS_SCALING
2047 .bus_scale_table = &rotator_bus_scale_pdata,
2048#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002049};
2050
2051struct platform_device msm_rotator_device = {
2052 .name = "msm_rotator",
2053 .id = 0,
2054 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2055 .resource = resources_msm_rotator,
2056 .dev = {
2057 .platform_data = &rotator_pdata,
2058 },
2059};
2060#endif
2061
2062#define MIPI_DSI_HW_BASE 0x04700000
2063#define MDP_HW_BASE 0x05100000
2064
2065static struct resource msm_mipi_dsi1_resources[] = {
2066 {
2067 .name = "mipi_dsi",
2068 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002069 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002070 .flags = IORESOURCE_MEM,
2071 },
2072 {
2073 .start = DSI1_IRQ,
2074 .end = DSI1_IRQ,
2075 .flags = IORESOURCE_IRQ,
2076 },
2077};
2078
2079struct platform_device msm_mipi_dsi1_device = {
2080 .name = "mipi_dsi",
2081 .id = 1,
2082 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2083 .resource = msm_mipi_dsi1_resources,
2084};
2085
2086static struct resource msm_mdp_resources[] = {
2087 {
2088 .name = "mdp",
2089 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002090 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002091 .flags = IORESOURCE_MEM,
2092 },
2093 {
2094 .start = MDP_IRQ,
2095 .end = MDP_IRQ,
2096 .flags = IORESOURCE_IRQ,
2097 },
2098};
2099
2100static struct platform_device msm_mdp_device = {
2101 .name = "mdp",
2102 .id = 0,
2103 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2104 .resource = msm_mdp_resources,
2105};
2106
2107static void __init msm_register_device(struct platform_device *pdev, void *data)
2108{
2109 int ret;
2110
2111 pdev->dev.platform_data = data;
2112 ret = platform_device_register(pdev);
2113 if (ret)
2114 dev_err(&pdev->dev,
2115 "%s: platform_device_register() failed = %d\n",
2116 __func__, ret);
2117}
2118
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002119#ifdef CONFIG_MSM_BUS_SCALING
2120static struct platform_device msm_dtv_device = {
2121 .name = "dtv",
2122 .id = 0,
2123};
2124#endif
2125
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002126struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002127 .name = "lvds",
2128 .id = 0,
2129};
2130
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002131void __init msm_fb_register_device(char *name, void *data)
2132{
2133 if (!strncmp(name, "mdp", 3))
2134 msm_register_device(&msm_mdp_device, data);
2135 else if (!strncmp(name, "mipi_dsi", 8))
2136 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002137 else if (!strncmp(name, "lvds", 4))
2138 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002139#ifdef CONFIG_MSM_BUS_SCALING
2140 else if (!strncmp(name, "dtv", 3))
2141 msm_register_device(&msm_dtv_device, data);
2142#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002143 else
2144 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2145}
2146
2147static struct resource resources_sps[] = {
2148 {
2149 .name = "pipe_mem",
2150 .start = 0x12800000,
2151 .end = 0x12800000 + 0x4000 - 1,
2152 .flags = IORESOURCE_MEM,
2153 },
2154 {
2155 .name = "bamdma_dma",
2156 .start = 0x12240000,
2157 .end = 0x12240000 + 0x1000 - 1,
2158 .flags = IORESOURCE_MEM,
2159 },
2160 {
2161 .name = "bamdma_bam",
2162 .start = 0x12244000,
2163 .end = 0x12244000 + 0x4000 - 1,
2164 .flags = IORESOURCE_MEM,
2165 },
2166 {
2167 .name = "bamdma_irq",
2168 .start = SPS_BAM_DMA_IRQ,
2169 .end = SPS_BAM_DMA_IRQ,
2170 .flags = IORESOURCE_IRQ,
2171 },
2172};
2173
2174struct msm_sps_platform_data msm_sps_pdata = {
2175 .bamdma_restricted_pipes = 0x06,
2176};
2177
2178struct platform_device msm_device_sps = {
2179 .name = "msm_sps",
2180 .id = -1,
2181 .num_resources = ARRAY_SIZE(resources_sps),
2182 .resource = resources_sps,
2183 .dev.platform_data = &msm_sps_pdata,
2184};
2185
2186#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002187static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002188 [1] = MSM_GPIO_TO_INT(46),
2189 [2] = MSM_GPIO_TO_INT(150),
2190 [4] = MSM_GPIO_TO_INT(103),
2191 [5] = MSM_GPIO_TO_INT(104),
2192 [6] = MSM_GPIO_TO_INT(105),
2193 [7] = MSM_GPIO_TO_INT(106),
2194 [8] = MSM_GPIO_TO_INT(107),
2195 [9] = MSM_GPIO_TO_INT(7),
2196 [10] = MSM_GPIO_TO_INT(11),
2197 [11] = MSM_GPIO_TO_INT(15),
2198 [12] = MSM_GPIO_TO_INT(19),
2199 [13] = MSM_GPIO_TO_INT(23),
2200 [14] = MSM_GPIO_TO_INT(27),
2201 [15] = MSM_GPIO_TO_INT(31),
2202 [16] = MSM_GPIO_TO_INT(35),
2203 [19] = MSM_GPIO_TO_INT(90),
2204 [20] = MSM_GPIO_TO_INT(92),
2205 [23] = MSM_GPIO_TO_INT(85),
2206 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002207 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002208 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002209 [29] = MSM_GPIO_TO_INT(10),
2210 [30] = MSM_GPIO_TO_INT(102),
2211 [31] = MSM_GPIO_TO_INT(81),
2212 [32] = MSM_GPIO_TO_INT(78),
2213 [33] = MSM_GPIO_TO_INT(94),
2214 [34] = MSM_GPIO_TO_INT(72),
2215 [35] = MSM_GPIO_TO_INT(39),
2216 [36] = MSM_GPIO_TO_INT(43),
2217 [37] = MSM_GPIO_TO_INT(61),
2218 [38] = MSM_GPIO_TO_INT(50),
2219 [39] = MSM_GPIO_TO_INT(42),
2220 [41] = MSM_GPIO_TO_INT(62),
2221 [42] = MSM_GPIO_TO_INT(76),
2222 [43] = MSM_GPIO_TO_INT(75),
2223 [44] = MSM_GPIO_TO_INT(70),
2224 [45] = MSM_GPIO_TO_INT(69),
2225 [46] = MSM_GPIO_TO_INT(67),
2226 [47] = MSM_GPIO_TO_INT(65),
2227 [48] = MSM_GPIO_TO_INT(58),
2228 [49] = MSM_GPIO_TO_INT(54),
2229 [50] = MSM_GPIO_TO_INT(52),
2230 [51] = MSM_GPIO_TO_INT(49),
2231 [52] = MSM_GPIO_TO_INT(40),
2232 [53] = MSM_GPIO_TO_INT(37),
2233 [54] = MSM_GPIO_TO_INT(24),
2234 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002235};
2236
Praveen Chidambaram78499012011-11-01 17:15:17 -06002237static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002238 TLMM_MSM_SUMMARY_IRQ,
2239 RPM_APCC_CPU0_GP_HIGH_IRQ,
2240 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2241 RPM_APCC_CPU0_GP_LOW_IRQ,
2242 RPM_APCC_CPU0_WAKE_UP_IRQ,
2243 RPM_APCC_CPU1_GP_HIGH_IRQ,
2244 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2245 RPM_APCC_CPU1_GP_LOW_IRQ,
2246 RPM_APCC_CPU1_WAKE_UP_IRQ,
2247 MSS_TO_APPS_IRQ_0,
2248 MSS_TO_APPS_IRQ_1,
2249 MSS_TO_APPS_IRQ_2,
2250 MSS_TO_APPS_IRQ_3,
2251 MSS_TO_APPS_IRQ_4,
2252 MSS_TO_APPS_IRQ_5,
2253 MSS_TO_APPS_IRQ_6,
2254 MSS_TO_APPS_IRQ_7,
2255 MSS_TO_APPS_IRQ_8,
2256 MSS_TO_APPS_IRQ_9,
2257 LPASS_SCSS_GP_LOW_IRQ,
2258 LPASS_SCSS_GP_MEDIUM_IRQ,
2259 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002260 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002261 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002262 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002263 RIVA_APPS_WLAN_SMSM_IRQ,
2264 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2265 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002266};
2267
Praveen Chidambaram78499012011-11-01 17:15:17 -06002268struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002269 .irqs_m2a = msm_mpm_irqs_m2a,
2270 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2271 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2272 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2273 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2274 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2275 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2276 .mpm_apps_ipc_val = BIT(1),
2277 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2278
2279};
2280#endif
2281
Stephen Boydbb600ae2011-08-02 20:11:40 -07002282static struct clk_lookup msm_clocks_8960_dummy[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002283 CLK_DUMMY("pll2", PLL2, NULL, 0),
2284 CLK_DUMMY("pll8", PLL8, NULL, 0),
2285 CLK_DUMMY("pll4", PLL4, NULL, 0),
2286
2287 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
2288 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
2289 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
2290 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
2291 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
2292 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
2293 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
2294 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
2295 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
2296 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
2297 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
2298 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
2299 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
2300 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
2301 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
2302 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
2303
Matt Wagantalle2522372011-08-17 14:52:21 -07002304 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
2305 CLK_DUMMY("core_clk", GSBI2_UART_CLK, "msm_serial_hsl.0", OFF),
2306 CLK_DUMMY("core_clk", GSBI3_UART_CLK, NULL, OFF),
2307 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
2308 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
2309 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
2310 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
2311 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
2312 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
2313 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
2314 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
2315 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002316 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, "spi_qsd.0", OFF),
2317 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
2318 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, NULL, OFF),
2319 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
2320 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, NULL, OFF),
2321 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
2322 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
2323 CLK_DUMMY("core_clk", GSBI8_QUP_CLK, NULL, OFF),
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002324 CLK_DUMMY("core_clk", GSBI9_QUP_CLK, "qup_i2c.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002325 CLK_DUMMY("core_clk", GSBI10_QUP_CLK, NULL, OFF),
2326 CLK_DUMMY("core_clk", GSBI11_QUP_CLK, NULL, OFF),
2327 CLK_DUMMY("core_clk", GSBI12_QUP_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002328 CLK_DUMMY("core_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07002329 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Matt Wagantallc1205292011-08-11 17:19:31 -07002330 CLK_DUMMY("core_clk", PRNG_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002331 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
2332 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
2333 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
2334 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
2335 CLK_DUMMY("core_clk", SDC5_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07002336 CLK_DUMMY("core_clk", TSIF_REF_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002337 CLK_DUMMY("core_clk", TSSC_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08002338 CLK_DUMMY("alt_core_clk", USB_HS1_XCVR_CLK, NULL, OFF),
2339 CLK_DUMMY("phy_clk", USB_PHY0_CLK, NULL, OFF),
2340 CLK_DUMMY("src_clk", USB_FS1_SRC_CLK, NULL, OFF),
2341 CLK_DUMMY("alt_core_clk", USB_FS1_XCVR_CLK, NULL, OFF),
2342 CLK_DUMMY("sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
2343 CLK_DUMMY("src_clk", USB_FS2_SRC_CLK, NULL, OFF),
2344 CLK_DUMMY("alt_core_clk", USB_FS2_XCVR_CLK, NULL, OFF),
2345 CLK_DUMMY("sys_clk", USB_FS2_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07002346 CLK_DUMMY("iface_clk", CE2_CLK, "qce.0", OFF),
2347 CLK_DUMMY("core_clk", CE1_CORE_CLK, "qce.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002348 CLK_DUMMY("iface_clk", GSBI1_P_CLK, "spi_qsd.0", OFF),
2349 CLK_DUMMY("iface_clk", GSBI2_P_CLK,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002350 "msm_serial_hsl.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002351 CLK_DUMMY("iface_clk", GSBI3_P_CLK, NULL, OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07002352 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002353 CLK_DUMMY("iface_clk", GSBI5_P_CLK, NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07002354 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002355 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
2356 CLK_DUMMY("iface_clk", GSBI8_P_CLK, NULL, OFF),
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002357 CLK_DUMMY("iface_clk", GSBI9_P_CLK, "qup_i2c.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07002358 CLK_DUMMY("iface_clk", GSBI10_P_CLK, NULL, OFF),
2359 CLK_DUMMY("iface_clk", GSBI11_P_CLK, NULL, OFF),
2360 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
2361 CLK_DUMMY("iface_clk", GSBI12_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07002362 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08002363 CLK_DUMMY("iface_clk", USB_FS1_P_CLK, NULL, OFF),
2364 CLK_DUMMY("iface_clk", USB_FS2_P_CLK, NULL, OFF),
2365 CLK_DUMMY("iface_clk", USB_HS1_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002366 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
2367 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
2368 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
2369 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
2370 CLK_DUMMY("iface_clk", SDC5_P_CLK, NULL, OFF),
Matt Wagantalle1a86062011-08-18 17:46:10 -07002371 CLK_DUMMY("core_clk", ADM0_CLK, NULL, OFF),
2372 CLK_DUMMY("iface_clk", ADM0_P_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002373 CLK_DUMMY("iface_clk", PMIC_ARB0_P_CLK, NULL, OFF),
2374 CLK_DUMMY("iface_clk", PMIC_ARB1_P_CLK, NULL, OFF),
2375 CLK_DUMMY("core_clk", PMIC_SSBI2_CLK, NULL, OFF),
2376 CLK_DUMMY("mem_clk", RPM_MSG_RAM_P_CLK, NULL, OFF),
2377 CLK_DUMMY("core_clk", AMP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002378 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
2379 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
2380 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
2381 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
2382 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
2383 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
2384 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
2385 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
2386 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
2387 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
2388 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
2389 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, "mipi_dsi.1", OFF),
2390 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, "mipi_dsi.2", OFF),
2391 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, "mipi_dsi.1", OFF),
2392 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002393 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, OFF),
2394 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, OFF),
2395 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002396 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002397 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002398 CLK_DUMMY("core_clk", JPEGD_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002399 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
2400 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
2401 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002402 CLK_DUMMY("core_clk", ROT_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002403 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
2404 CLK_DUMMY("tv_enc_clk", TV_ENC_CLK, NULL, OFF),
2405 CLK_DUMMY("tv_dac_clk", TV_DAC_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07002406 CLK_DUMMY("core_clk", VCODEC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002407 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
2408 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
2409 CLK_DUMMY("hdmi_app_clk", HDMI_APP_CLK, NULL, OFF),
2410 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
2411 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
2412 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
2413 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
2414 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
2415 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002416 CLK_DUMMY("bus_clk", ROT_AXI_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002417 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
2418 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
2419 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
2420 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
2421 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
2422 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
2423 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, "mipi_dsi.1", OFF),
2424 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, "mipi_dsi.1", OFF),
2425 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, "mipi_dsi.2", OFF),
2426 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, "mipi_dsi.2", OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002427 CLK_DUMMY("iface_clk", GFX2D0_P_CLK, NULL, OFF),
2428 CLK_DUMMY("iface_clk", GFX2D1_P_CLK, NULL, OFF),
2429 CLK_DUMMY("iface_clk", GFX3D_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002430 CLK_DUMMY("hdmi_m_pclk", HDMI_M_P_CLK, NULL, OFF),
2431 CLK_DUMMY("hdmi_s_pclk", HDMI_S_P_CLK, NULL, OFF),
2432 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
2433 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07002434 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002435 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002436 CLK_DUMMY("iface_clk", SMMU_P_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07002437 CLK_DUMMY("iface_clk", ROT_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002438 CLK_DUMMY("tv_enc_pclk", TV_ENC_P_CLK, NULL, OFF),
2439 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
2440 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
2441 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
2442 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
2443 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
2444 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
2445 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
2446 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
2447 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
2448 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
2449 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
2450 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
2451 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
2452 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07002453 CLK_DUMMY("core_clk", JPEGD_AXI_CLK, NULL, 0),
2454 CLK_DUMMY("core_clk", VFE_AXI_CLK, NULL, 0),
2455 CLK_DUMMY("core_clk", VCODEC_AXI_CLK, NULL, 0),
2456 CLK_DUMMY("core_clk", GFX3D_CLK, NULL, 0),
2457 CLK_DUMMY("core_clk", GFX2D0_CLK, NULL, 0),
2458 CLK_DUMMY("core_clk", GFX2D1_CLK, NULL, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002459
2460 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
Manu Gautam5143b252012-01-05 19:25:23 -08002461 CLK_DUMMY("core_clk", DFAB_USB_HS_CLK, "msm_otg", NULL),
Matt Wagantall37ce3842011-08-17 16:00:36 -07002462 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, "msm_sdcc.1", 0),
2463 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, "msm_sdcc.2", 0),
2464 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, "msm_sdcc.3", 0),
2465 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, "msm_sdcc.4", 0),
2466 CLK_DUMMY("bus_clk", DFAB_SDC5_CLK, "msm_sdcc.5", 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002467 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
2468 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
2469};
2470
Stephen Boydbb600ae2011-08-02 20:11:40 -07002471struct clock_init_data msm8960_dummy_clock_init_data __initdata = {
2472 .table = msm_clocks_8960_dummy,
2473 .size = ARRAY_SIZE(msm_clocks_8960_dummy),
2474};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002475
2476#define LPASS_SLIMBUS_PHYS 0x28080000
2477#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06002478#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002479/* Board info for the slimbus slave device */
2480static struct resource slimbus_res[] = {
2481 {
2482 .start = LPASS_SLIMBUS_PHYS,
2483 .end = LPASS_SLIMBUS_PHYS + 8191,
2484 .flags = IORESOURCE_MEM,
2485 .name = "slimbus_physical",
2486 },
2487 {
2488 .start = LPASS_SLIMBUS_BAM_PHYS,
2489 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
2490 .flags = IORESOURCE_MEM,
2491 .name = "slimbus_bam_physical",
2492 },
2493 {
Sagar Dhariacc969452011-09-19 10:34:30 -06002494 .start = LPASS_SLIMBUS_SLEW,
2495 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
2496 .flags = IORESOURCE_MEM,
2497 .name = "slimbus_slew_reg",
2498 },
2499 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002500 .start = SLIMBUS0_CORE_EE1_IRQ,
2501 .end = SLIMBUS0_CORE_EE1_IRQ,
2502 .flags = IORESOURCE_IRQ,
2503 .name = "slimbus_irq",
2504 },
2505 {
2506 .start = SLIMBUS0_BAM_EE1_IRQ,
2507 .end = SLIMBUS0_BAM_EE1_IRQ,
2508 .flags = IORESOURCE_IRQ,
2509 .name = "slimbus_bam_irq",
2510 },
2511};
2512
2513struct platform_device msm_slim_ctrl = {
2514 .name = "msm_slim_ctrl",
2515 .id = 1,
2516 .num_resources = ARRAY_SIZE(slimbus_res),
2517 .resource = slimbus_res,
2518 .dev = {
2519 .coherent_dma_mask = 0xffffffffULL,
2520 },
2521};
2522
Lucille Sylvester6e362412011-12-09 16:21:42 -07002523static struct msm_dcvs_freq_entry grp3d_freq[] = {
2524 {0, 0, 333932},
2525 {0, 0, 497532},
2526 {0, 0, 707610},
2527 {0, 0, 844545},
2528};
2529
2530static struct msm_dcvs_freq_entry grp2d_freq[] = {
2531 {0, 0, 86000},
2532 {0, 0, 200000},
2533};
2534
2535static struct msm_dcvs_core_info grp3d_core_info = {
2536 .freq_tbl = &grp3d_freq[0],
2537 .core_param = {
2538 .max_time_us = 100000,
2539 .num_freq = ARRAY_SIZE(grp3d_freq),
2540 },
2541 .algo_param = {
2542 .slack_time_us = 39000,
2543 .disable_pc_threshold = 86000,
2544 .ss_window_size = 1000000,
2545 .ss_util_pct = 95,
2546 .em_max_util_pct = 97,
2547 .ss_iobusy_conv = 100,
2548 },
2549};
2550
2551static struct msm_dcvs_core_info grp2d_core_info = {
2552 .freq_tbl = &grp2d_freq[0],
2553 .core_param = {
2554 .max_time_us = 100000,
2555 .num_freq = ARRAY_SIZE(grp2d_freq),
2556 },
2557 .algo_param = {
2558 .slack_time_us = 39000,
2559 .disable_pc_threshold = 90000,
2560 .ss_window_size = 1000000,
2561 .ss_util_pct = 90,
2562 .em_max_util_pct = 95,
2563 },
2564};
2565
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002566#ifdef CONFIG_MSM_BUS_SCALING
2567static struct msm_bus_vectors grp3d_init_vectors[] = {
2568 {
2569 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2570 .dst = MSM_BUS_SLAVE_EBI_CH0,
2571 .ab = 0,
2572 .ib = 0,
2573 },
2574};
2575
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002576static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002577 {
2578 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2579 .dst = MSM_BUS_SLAVE_EBI_CH0,
2580 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002581 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002582 },
2583};
2584
2585static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
2586 {
2587 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2588 .dst = MSM_BUS_SLAVE_EBI_CH0,
2589 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002590 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002591 },
2592};
2593
2594static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
2595 {
2596 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2597 .dst = MSM_BUS_SLAVE_EBI_CH0,
2598 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002599 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002600 },
2601};
2602
2603static struct msm_bus_vectors grp3d_max_vectors[] = {
2604 {
2605 .src = MSM_BUS_MASTER_GRAPHICS_3D,
2606 .dst = MSM_BUS_SLAVE_EBI_CH0,
2607 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07002608 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002609 },
2610};
2611
2612static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
2613 {
2614 ARRAY_SIZE(grp3d_init_vectors),
2615 grp3d_init_vectors,
2616 },
2617 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002618 ARRAY_SIZE(grp3d_low_vectors),
2619 grp3d_low_vectors,
2620 },
2621 {
2622 ARRAY_SIZE(grp3d_nominal_low_vectors),
2623 grp3d_nominal_low_vectors,
2624 },
2625 {
2626 ARRAY_SIZE(grp3d_nominal_high_vectors),
2627 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002628 },
2629 {
2630 ARRAY_SIZE(grp3d_max_vectors),
2631 grp3d_max_vectors,
2632 },
2633};
2634
2635static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
2636 grp3d_bus_scale_usecases,
2637 ARRAY_SIZE(grp3d_bus_scale_usecases),
2638 .name = "grp3d",
2639};
2640
2641static struct msm_bus_vectors grp2d0_init_vectors[] = {
2642 {
2643 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2644 .dst = MSM_BUS_SLAVE_EBI_CH0,
2645 .ab = 0,
2646 .ib = 0,
2647 },
2648};
2649
Lucille Sylvester808eca22011-11-03 10:26:29 -07002650static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002651 {
2652 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2653 .dst = MSM_BUS_SLAVE_EBI_CH0,
2654 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002655 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002656 },
2657};
2658
Lucille Sylvester808eca22011-11-03 10:26:29 -07002659static struct msm_bus_vectors grp2d0_max_vectors[] = {
2660 {
2661 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
2662 .dst = MSM_BUS_SLAVE_EBI_CH0,
2663 .ab = 0,
2664 .ib = KGSL_CONVERT_TO_MBPS(2048),
2665 },
2666};
2667
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002668static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
2669 {
2670 ARRAY_SIZE(grp2d0_init_vectors),
2671 grp2d0_init_vectors,
2672 },
2673 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002674 ARRAY_SIZE(grp2d0_nominal_vectors),
2675 grp2d0_nominal_vectors,
2676 },
2677 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002678 ARRAY_SIZE(grp2d0_max_vectors),
2679 grp2d0_max_vectors,
2680 },
2681};
2682
2683struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
2684 grp2d0_bus_scale_usecases,
2685 ARRAY_SIZE(grp2d0_bus_scale_usecases),
2686 .name = "grp2d0",
2687};
2688
2689static struct msm_bus_vectors grp2d1_init_vectors[] = {
2690 {
2691 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2692 .dst = MSM_BUS_SLAVE_EBI_CH0,
2693 .ab = 0,
2694 .ib = 0,
2695 },
2696};
2697
Lucille Sylvester808eca22011-11-03 10:26:29 -07002698static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002699 {
2700 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2701 .dst = MSM_BUS_SLAVE_EBI_CH0,
2702 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07002703 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002704 },
2705};
2706
Lucille Sylvester808eca22011-11-03 10:26:29 -07002707static struct msm_bus_vectors grp2d1_max_vectors[] = {
2708 {
2709 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2710 .dst = MSM_BUS_SLAVE_EBI_CH0,
2711 .ab = 0,
2712 .ib = KGSL_CONVERT_TO_MBPS(2048),
2713 },
2714};
2715
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002716static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
2717 {
2718 ARRAY_SIZE(grp2d1_init_vectors),
2719 grp2d1_init_vectors,
2720 },
2721 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002722 ARRAY_SIZE(grp2d1_nominal_vectors),
2723 grp2d1_nominal_vectors,
2724 },
2725 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002726 ARRAY_SIZE(grp2d1_max_vectors),
2727 grp2d1_max_vectors,
2728 },
2729};
2730
2731struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
2732 grp2d1_bus_scale_usecases,
2733 ARRAY_SIZE(grp2d1_bus_scale_usecases),
2734 .name = "grp2d1",
2735};
2736#endif
2737
2738static struct resource kgsl_3d0_resources[] = {
2739 {
2740 .name = KGSL_3D0_REG_MEMORY,
2741 .start = 0x04300000, /* GFX3D address */
2742 .end = 0x0431ffff,
2743 .flags = IORESOURCE_MEM,
2744 },
2745 {
2746 .name = KGSL_3D0_IRQ,
2747 .start = GFX3D_IRQ,
2748 .end = GFX3D_IRQ,
2749 .flags = IORESOURCE_IRQ,
2750 },
2751};
2752
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002753static const char *kgsl_3d0_iommu_ctx_names[] = {
2754 "gfx3d_user",
2755 /* priv_ctx goes here */
2756};
2757
2758static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
2759 {
2760 .iommu_ctx_names = kgsl_3d0_iommu_ctx_names,
2761 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu_ctx_names),
2762 .physstart = 0x07C00000,
2763 .physend = 0x07C00000 + SZ_1M - 1,
2764 },
2765};
2766
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002767static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002768 .pwrlevel = {
2769 {
2770 .gpu_freq = 400000000,
2771 .bus_freq = 4,
2772 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002773 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002774 {
2775 .gpu_freq = 300000000,
2776 .bus_freq = 3,
2777 .io_fraction = 33,
2778 },
2779 {
2780 .gpu_freq = 200000000,
2781 .bus_freq = 2,
2782 .io_fraction = 100,
2783 },
2784 {
2785 .gpu_freq = 128000000,
2786 .bus_freq = 1,
2787 .io_fraction = 100,
2788 },
2789 {
2790 .gpu_freq = 27000000,
2791 .bus_freq = 0,
2792 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002793 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002794 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002795 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002796 .set_grp_async = NULL,
Lucille Sylvester93650bb2011-11-02 14:37:10 -07002797 .idle_timeout = HZ/20,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002798 .nap_allowed = true,
2799 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002800#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002801 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002802#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002803 .iommu_data = kgsl_3d0_iommu_data,
2804 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002805 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002806};
2807
2808struct platform_device msm_kgsl_3d0 = {
2809 .name = "kgsl-3d0",
2810 .id = 0,
2811 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
2812 .resource = kgsl_3d0_resources,
2813 .dev = {
2814 .platform_data = &kgsl_3d0_pdata,
2815 },
2816};
2817
2818static struct resource kgsl_2d0_resources[] = {
2819 {
2820 .name = KGSL_2D0_REG_MEMORY,
2821 .start = 0x04100000, /* Z180 base address */
2822 .end = 0x04100FFF,
2823 .flags = IORESOURCE_MEM,
2824 },
2825 {
2826 .name = KGSL_2D0_IRQ,
2827 .start = GFX2D0_IRQ,
2828 .end = GFX2D0_IRQ,
2829 .flags = IORESOURCE_IRQ,
2830 },
2831};
2832
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002833static const char *kgsl_2d0_iommu_ctx_names[] = {
2834 "gfx2d0_2d0",
2835};
2836
2837static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
2838 {
2839 .iommu_ctx_names = kgsl_2d0_iommu_ctx_names,
2840 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctx_names),
2841 .physstart = 0x07D00000,
2842 .physend = 0x07D00000 + SZ_1M - 1,
2843 },
2844};
2845
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002846static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002847 .pwrlevel = {
2848 {
2849 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002850 .bus_freq = 2,
2851 },
2852 {
2853 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002854 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002855 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002856 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002857 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002858 .bus_freq = 0,
2859 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002860 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002861 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002862 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002863 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002864 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002865 .nap_allowed = true,
2866 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002867#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002868 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002869#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002870 .iommu_data = kgsl_2d0_iommu_data,
2871 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002872 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002873};
2874
2875struct platform_device msm_kgsl_2d0 = {
2876 .name = "kgsl-2d0",
2877 .id = 0,
2878 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
2879 .resource = kgsl_2d0_resources,
2880 .dev = {
2881 .platform_data = &kgsl_2d0_pdata,
2882 },
2883};
2884
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002885static const char *kgsl_2d1_iommu_ctx_names[] = {
Jeremy Gebben5c4c1132012-02-27 11:26:49 -07002886 "gfx2d1_2d1",
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002887};
2888
2889static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
2890 {
2891 .iommu_ctx_names = kgsl_2d1_iommu_ctx_names,
2892 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctx_names),
2893 .physstart = 0x07E00000,
2894 .physend = 0x07E00000 + SZ_1M - 1,
2895 },
2896};
2897
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002898static struct resource kgsl_2d1_resources[] = {
2899 {
2900 .name = KGSL_2D1_REG_MEMORY,
2901 .start = 0x04200000, /* Z180 device 1 base address */
2902 .end = 0x04200FFF,
2903 .flags = IORESOURCE_MEM,
2904 },
2905 {
2906 .name = KGSL_2D1_IRQ,
2907 .start = GFX2D1_IRQ,
2908 .end = GFX2D1_IRQ,
2909 .flags = IORESOURCE_IRQ,
2910 },
2911};
2912
2913static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002914 .pwrlevel = {
2915 {
2916 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002917 .bus_freq = 2,
2918 },
2919 {
2920 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002921 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002922 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002923 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07002924 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002925 .bus_freq = 0,
2926 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002927 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002928 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07002929 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002930 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07002931 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002932 .nap_allowed = true,
2933 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002934#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002935 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002936#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07002937 .iommu_data = kgsl_2d1_iommu_data,
2938 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07002939 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002940};
2941
2942struct platform_device msm_kgsl_2d1 = {
2943 .name = "kgsl-2d1",
2944 .id = 1,
2945 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
2946 .resource = kgsl_2d1_resources,
2947 .dev = {
2948 .platform_data = &kgsl_2d1_pdata,
2949 },
2950};
2951
2952#ifdef CONFIG_MSM_GEMINI
2953static struct resource msm_gemini_resources[] = {
2954 {
2955 .start = 0x04600000,
2956 .end = 0x04600000 + SZ_1M - 1,
2957 .flags = IORESOURCE_MEM,
2958 },
2959 {
2960 .start = JPEG_IRQ,
2961 .end = JPEG_IRQ,
2962 .flags = IORESOURCE_IRQ,
2963 },
2964};
2965
2966struct platform_device msm8960_gemini_device = {
2967 .name = "msm_gemini",
2968 .resource = msm_gemini_resources,
2969 .num_resources = ARRAY_SIZE(msm_gemini_resources),
2970};
2971#endif
2972
Praveen Chidambaram78499012011-11-01 17:15:17 -06002973struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
2974 .reg_base_addrs = {
2975 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2976 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2977 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2978 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2979 },
2980 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002981 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002982 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2983 .ipc_rpm_val = 4,
2984 .target_id = {
2985 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2986 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2987 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
2988 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2989 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2990 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
2991 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
2992 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
2993 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2994 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2995 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2996 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2997 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
2998 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
2999 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
3000 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
3001 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
3002 APPS_FABRIC_CFG_HALT, 2),
3003 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
3004 APPS_FABRIC_CFG_CLKMOD, 3),
3005 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
3006 APPS_FABRIC_CFG_IOCTL, 1),
3007 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
3008 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
3009 SYS_FABRIC_CFG_HALT, 2),
3010 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
3011 SYS_FABRIC_CFG_CLKMOD, 3),
3012 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
3013 SYS_FABRIC_CFG_IOCTL, 1),
3014 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
3015 SYSTEM_FABRIC_ARB, 29),
3016 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
3017 MMSS_FABRIC_CFG_HALT, 2),
3018 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
3019 MMSS_FABRIC_CFG_CLKMOD, 3),
3020 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
3021 MMSS_FABRIC_CFG_IOCTL, 1),
3022 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
3023 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
3024 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
3025 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
3026 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
3027 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
3028 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
3029 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
3030 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
3031 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
3032 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
3033 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
3034 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
3035 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
3036 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
3037 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
3038 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
3039 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
3040 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
3041 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
3042 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
3043 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
3044 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
3045 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
3046 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
3047 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
3048 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
3049 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
3050 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
3051 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
3052 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
3053 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
3054 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
3055 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
3056 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
3057 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
3058 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
3059 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
3060 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
3061 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
3062 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
3063 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
3064 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
3065 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
3066 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
3067 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
3068 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
3069 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
3070 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
3071 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
3072 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
3073 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
3074 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
3075 },
3076 .target_status = {
3077 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
3078 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
3079 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
3080 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
3081 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
3082 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
3083 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
3084 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
3085 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
3086 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
3087 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
3088 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
3089 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
3090 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
3091 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
3092 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
3093 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
3094 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
3095 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
3096 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
3097 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
3098 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
3099 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
3100 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
3101 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
3102 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
3103 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
3104 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
3105 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
3106 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
3107 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
3108 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
3109 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
3110 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
3111 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
3112 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
3113 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
3114 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
3115 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
3116 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
3117 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
3118 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
3119 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
3120 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
3121 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
3122 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
3123 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
3124 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
3125 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
3126 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
3127 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
3128 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
3129 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
3130 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
3131 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
3132 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
3133 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
3134 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
3135 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3136 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3137 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3138 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3139 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3140 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3141 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3142 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3143 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3144 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3145 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3146 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3147 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3148 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3149 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3150 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3151 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3152 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3153 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3154 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3155 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3156 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3157 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3158 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3159 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3160 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3161 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3162 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3163 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3164 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3165 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3166 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3167 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3168 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3169 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3170 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3171 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3172 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3173 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3174 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3175 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3176 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3177 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3178 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3179 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3180 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3181 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3182 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3183 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3184 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3185 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3186 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3187 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3188 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3189 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3190 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3191 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3192 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3193 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3194 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3195 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3196 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3197 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3198 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3199 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3200 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3201 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3202 },
3203 .target_ctrl_id = {
3204 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3205 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3206 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3207 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3208 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3209 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3210 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3211 },
3212 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3213 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3214 .sel_last = MSM_RPM_8960_SEL_LAST,
3215 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003216};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003217
Praveen Chidambaram78499012011-11-01 17:15:17 -06003218struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003219 .name = "msm_rpm",
3220 .id = -1,
3221};
3222
Praveen Chidambaram78499012011-11-01 17:15:17 -06003223static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3224 .phys_addr_base = 0x0010C000,
3225 .reg_offsets = {
3226 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3227 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3228 },
3229 .phys_size = SZ_8K,
3230 .log_len = 4096, /* log's buffer length in bytes */
3231 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
3232};
3233
3234struct platform_device msm8960_rpm_log_device = {
3235 .name = "msm_rpm_log",
3236 .id = -1,
3237 .dev = {
3238 .platform_data = &msm_rpm_log_pdata,
3239 },
3240};
3241
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003242static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
3243 .phys_addr_base = 0x0010D204,
3244 .phys_size = SZ_8K,
3245};
3246
Praveen Chidambaram78499012011-11-01 17:15:17 -06003247struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003248 .name = "msm_rpm_stat",
3249 .id = -1,
3250 .dev = {
3251 .platform_data = &msm_rpm_stat_pdata,
3252 },
3253};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003254
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003255struct platform_device msm_bus_sys_fabric = {
3256 .name = "msm_bus_fabric",
3257 .id = MSM_BUS_FAB_SYSTEM,
3258};
3259struct platform_device msm_bus_apps_fabric = {
3260 .name = "msm_bus_fabric",
3261 .id = MSM_BUS_FAB_APPSS,
3262};
3263struct platform_device msm_bus_mm_fabric = {
3264 .name = "msm_bus_fabric",
3265 .id = MSM_BUS_FAB_MMSS,
3266};
3267struct platform_device msm_bus_sys_fpb = {
3268 .name = "msm_bus_fabric",
3269 .id = MSM_BUS_FAB_SYSTEM_FPB,
3270};
3271struct platform_device msm_bus_cpss_fpb = {
3272 .name = "msm_bus_fabric",
3273 .id = MSM_BUS_FAB_CPSS_FPB,
3274};
3275
3276/* Sensors DSPS platform data */
3277#ifdef CONFIG_MSM_DSPS
3278
3279#define PPSS_REG_PHYS_BASE 0x12080000
3280
3281static struct dsps_clk_info dsps_clks[] = {};
3282static struct dsps_regulator_info dsps_regs[] = {};
3283
3284/*
3285 * Note: GPIOs field is intialized in run-time at the function
3286 * msm8960_init_dsps().
3287 */
3288
3289struct msm_dsps_platform_data msm_dsps_pdata = {
3290 .clks = dsps_clks,
3291 .clks_num = ARRAY_SIZE(dsps_clks),
3292 .gpios = NULL,
3293 .gpios_num = 0,
3294 .regs = dsps_regs,
3295 .regs_num = ARRAY_SIZE(dsps_regs),
3296 .dsps_pwr_ctl_en = 1,
3297 .signature = DSPS_SIGNATURE,
3298};
3299
3300static struct resource msm_dsps_resources[] = {
3301 {
3302 .start = PPSS_REG_PHYS_BASE,
3303 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
3304 .name = "ppss_reg",
3305 .flags = IORESOURCE_MEM,
3306 },
Wentao Xua55500b2011-08-16 18:15:04 -04003307
3308 {
3309 .start = PPSS_WDOG_TIMER_IRQ,
3310 .end = PPSS_WDOG_TIMER_IRQ,
3311 .name = "ppss_wdog",
3312 .flags = IORESOURCE_IRQ,
3313 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003314};
3315
3316struct platform_device msm_dsps_device = {
3317 .name = "msm_dsps",
3318 .id = 0,
3319 .num_resources = ARRAY_SIZE(msm_dsps_resources),
3320 .resource = msm_dsps_resources,
3321 .dev.platform_data = &msm_dsps_pdata,
3322};
3323
3324#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07003325
3326#ifdef CONFIG_MSM_QDSS
3327
3328#define MSM_QDSS_PHYS_BASE 0x01A00000
3329#define MSM_ETB_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1000)
3330#define MSM_TPIU_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x3000)
3331#define MSM_FUNNEL_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x4000)
Pratik Patel492b3012012-03-06 14:22:30 -08003332#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
Pratik Patel7831c082011-06-08 21:44:37 -07003333
Pratik Patel1403f2a2012-03-21 10:10:00 -07003334#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
3335
3336static struct qdss_source msm_qdss_sources[] = {
3337 QDSS_SOURCE("msm_etm", 0x3),
3338};
3339
3340static struct msm_qdss_platform_data qdss_pdata = {
3341 .src_table = msm_qdss_sources,
3342 .size = ARRAY_SIZE(msm_qdss_sources),
3343 .afamily = 1,
3344};
3345
3346struct platform_device msm_qdss_device = {
3347 .name = "msm_qdss",
3348 .id = -1,
3349 .dev = {
3350 .platform_data = &qdss_pdata,
3351 },
3352};
3353
Pratik Patel7831c082011-06-08 21:44:37 -07003354static struct resource msm_etb_resources[] = {
3355 {
3356 .start = MSM_ETB_PHYS_BASE,
3357 .end = MSM_ETB_PHYS_BASE + SZ_4K - 1,
3358 .flags = IORESOURCE_MEM,
3359 },
3360};
3361
3362struct platform_device msm_etb_device = {
3363 .name = "msm_etb",
3364 .id = 0,
3365 .num_resources = ARRAY_SIZE(msm_etb_resources),
3366 .resource = msm_etb_resources,
3367};
3368
3369static struct resource msm_tpiu_resources[] = {
3370 {
3371 .start = MSM_TPIU_PHYS_BASE,
3372 .end = MSM_TPIU_PHYS_BASE + SZ_4K - 1,
3373 .flags = IORESOURCE_MEM,
3374 },
3375};
3376
3377struct platform_device msm_tpiu_device = {
3378 .name = "msm_tpiu",
3379 .id = 0,
3380 .num_resources = ARRAY_SIZE(msm_tpiu_resources),
3381 .resource = msm_tpiu_resources,
3382};
3383
3384static struct resource msm_funnel_resources[] = {
3385 {
3386 .start = MSM_FUNNEL_PHYS_BASE,
3387 .end = MSM_FUNNEL_PHYS_BASE + SZ_4K - 1,
3388 .flags = IORESOURCE_MEM,
3389 },
3390};
3391
3392struct platform_device msm_funnel_device = {
3393 .name = "msm_funnel",
3394 .id = 0,
3395 .num_resources = ARRAY_SIZE(msm_funnel_resources),
3396 .resource = msm_funnel_resources,
3397};
3398
Pratik Patel492b3012012-03-06 14:22:30 -08003399static struct resource msm_etm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07003400 {
Pratik Patel492b3012012-03-06 14:22:30 -08003401 .start = MSM_ETM_PHYS_BASE,
3402 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 2) - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07003403 .flags = IORESOURCE_MEM,
3404 },
3405};
3406
Pratik Patel492b3012012-03-06 14:22:30 -08003407struct platform_device msm_etm_device = {
3408 .name = "msm_etm",
Pratik Patel7831c082011-06-08 21:44:37 -07003409 .id = 0,
Pratik Patel492b3012012-03-06 14:22:30 -08003410 .num_resources = ARRAY_SIZE(msm_etm_resources),
3411 .resource = msm_etm_resources,
Pratik Patel7831c082011-06-08 21:44:37 -07003412};
3413
3414#endif
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07003415
3416static int msm8960_LPM_latency = 1000; /* >100 usec for WFI */
3417
3418struct platform_device msm8960_cpu_idle_device = {
3419 .name = "msm_cpu_idle",
3420 .id = -1,
3421 .dev = {
3422 .platform_data = &msm8960_LPM_latency,
3423 },
3424};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07003425
3426static struct msm_dcvs_freq_entry msm8960_freq[] = {
3427 { 384000, 166981, 345600},
3428 { 702000, 213049, 632502},
3429 {1026000, 285712, 925613},
3430 {1242000, 383945, 1176550},
3431 {1458000, 419729, 1465478},
3432 {1512000, 434116, 1546674},
3433
3434};
3435
3436static struct msm_dcvs_core_info msm8960_core_info = {
3437 .freq_tbl = &msm8960_freq[0],
3438 .core_param = {
3439 .max_time_us = 100000,
3440 .num_freq = ARRAY_SIZE(msm8960_freq),
3441 },
3442 .algo_param = {
3443 .slack_time_us = 58000,
3444 .scale_slack_time = 0,
3445 .scale_slack_time_pct = 0,
3446 .disable_pc_threshold = 1458000,
3447 .em_window_size = 100000,
3448 .em_max_util_pct = 97,
3449 .ss_window_size = 1000000,
3450 .ss_util_pct = 95,
3451 .ss_iobusy_conv = 100,
3452 },
3453};
3454
3455struct platform_device msm8960_msm_gov_device = {
3456 .name = "msm_dcvs_gov",
3457 .id = -1,
3458 .dev = {
3459 .platform_data = &msm8960_core_info,
3460 },
3461};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003462
3463static struct resource msm_cache_erp_resources[] = {
3464 {
3465 .name = "l1_irq",
3466 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3467 .flags = IORESOURCE_IRQ,
3468 },
3469 {
3470 .name = "l2_irq",
3471 .start = APCC_QGICL2IRPTREQ,
3472 .flags = IORESOURCE_IRQ,
3473 }
3474};
3475
3476struct platform_device msm8960_device_cache_erp = {
3477 .name = "msm_cache_erp",
3478 .id = -1,
3479 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3480 .resource = msm_cache_erp_resources,
3481};