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