blob: 837aef33812751a5d7cb3f1c6d2f505ad54f760c [file] [log] [blame]
Arun Menon8ef6d5a2013-01-04 21:20:26 -08001/* Copyright (c) 2011-2013, The Linux Foundation. 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>
Mitchel Humpherys1c0f0562012-09-06 11:36:08 -070018#include <linux/msm_ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/gpio.h>
Pratik Patel1746b8f2012-06-02 21:11:41 -070020#include <linux/coresight.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021#include <asm/clkdev.h>
Rohit Vaswani341c2032012-11-08 18:49:29 -080022#include <mach/gpio.h>
Jordan Crouse914de9b2012-07-09 13:49:46 -060023#include <mach/kgsl.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070024#include <mach/irqs-8960.h>
Mayank Rana9f51f582011-08-04 18:35:59 +053025#include <mach/dma.h>
26#include <linux/dma-mapping.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070027#include <mach/board.h>
28#include <mach/msm_iomap.h>
29#include <mach/msm_hsusb.h>
30#include <mach/msm_sps.h>
31#include <mach/rpm.h>
32#include <mach/msm_bus_board.h>
33#include <mach/msm_memtypes.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070034#include <mach/msm_smd.h>
Lucille Sylvester6e362412011-12-09 16:21:42 -070035#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070036#include <mach/msm_rtb.h>
Laura Abbott2ae8f362012-04-12 11:03:04 -070037#include <mach/msm_cache_dump.h>
Matt Wagantall33d01f52012-02-23 23:27:44 -080038#include <mach/clk-provider.h>
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -070039#include <sound/msm-dai-q6.h>
40#include <sound/apr_audio.h>
Joel Nidera1261942011-09-12 16:30:09 +030041#include <mach/msm_tsif.h>
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070042#include <mach/msm_serial_hs_lite.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043#include "clock.h"
44#include "devices.h"
45#include "devices-msm8x60.h"
46#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070047#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060048#include "rpm_log.h"
Praveen Chidambaram7a712232011-10-28 13:39:45 -060049#include "rpm_stats.h"
Stephen Boydeb819882011-08-29 14:46:30 -070050#include "pil-q6v4.h"
51#include "scm-pas.h"
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070052#include <mach/msm_dcvs.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070053#include <mach/iommu_domains.h>
Arun Menon697e91b2012-08-20 15:25:50 -070054#include <mach/socinfo.h>
Praveen Chidambaramf27a5152013-02-01 11:44:53 -070055#include "pm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056
57#ifdef CONFIG_MSM_MPM
Subhash Jadavani909e04f2012-04-12 10:52:50 +053058#include <mach/mpm.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059#endif
60#ifdef CONFIG_MSM_DSPS
61#include <mach/msm_dsps.h>
62#endif
63
64
65/* Address of GSBI blocks */
66#define MSM_GSBI1_PHYS 0x16000000
67#define MSM_GSBI2_PHYS 0x16100000
68#define MSM_GSBI3_PHYS 0x16200000
69#define MSM_GSBI4_PHYS 0x16300000
70#define MSM_GSBI5_PHYS 0x16400000
71#define MSM_GSBI6_PHYS 0x16500000
72#define MSM_GSBI7_PHYS 0x16600000
73#define MSM_GSBI8_PHYS 0x1A000000
74#define MSM_GSBI9_PHYS 0x1A100000
75#define MSM_GSBI10_PHYS 0x1A200000
76#define MSM_GSBI11_PHYS 0x12440000
77#define MSM_GSBI12_PHYS 0x12480000
78
79#define MSM_UART2DM_PHYS (MSM_GSBI2_PHYS + 0x40000)
80#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana9f51f582011-08-04 18:35:59 +053081#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -070082#define MSM_UART8DM_PHYS (MSM_GSBI8_PHYS + 0x40000)
Mayank Ranae009c922012-03-22 03:02:06 +053083#define MSM_UART9DM_PHYS (MSM_GSBI9_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070084
85/* GSBI QUP devices */
86#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
87#define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000)
88#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
89#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
90#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
91#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
92#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
93#define MSM_GSBI8_QUP_PHYS (MSM_GSBI8_PHYS + 0x80000)
94#define MSM_GSBI9_QUP_PHYS (MSM_GSBI9_PHYS + 0x80000)
95#define MSM_GSBI10_QUP_PHYS (MSM_GSBI10_PHYS + 0x80000)
96#define MSM_GSBI11_QUP_PHYS (MSM_GSBI11_PHYS + 0x20000)
97#define MSM_GSBI12_QUP_PHYS (MSM_GSBI12_PHYS + 0x20000)
98#define MSM_QUP_SIZE SZ_4K
99
100#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
101#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
102#define MSM_PMIC_SSBI_SIZE SZ_4K
103
Stepan Moskovchenkobe5b45a2011-10-17 19:33:34 -0700104#define MSM8960_HSUSB_PHYS 0x12500000
105#define MSM8960_HSUSB_SIZE SZ_4K
106
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530107#define MSM8960_PC_CNTR_PHYS (MSM8960_IMEM_PHYS + 0x664)
108#define MSM8960_PC_CNTR_SIZE 0x40
Anji Jonnala93129922012-10-09 20:57:53 +0530109#define MSM8960_RPM_MASTER_STATS_BASE 0x10BB00
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530110
111static struct resource msm8960_resources_pccntr[] = {
112 {
113 .start = MSM8960_PC_CNTR_PHYS,
114 .end = MSM8960_PC_CNTR_PHYS + MSM8960_PC_CNTR_SIZE,
115 .flags = IORESOURCE_MEM,
116 },
117};
118
Praveen Chidambaramf27a5152013-02-01 11:44:53 -0700119static struct msm_pm_init_data_type msm_pm_data = {
120 .retention_calls_tz = true,
121};
122
123struct platform_device msm8960_pm_8x60 = {
124 .name = "pm-8x60",
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530125 .id = -1,
126 .num_resources = ARRAY_SIZE(msm8960_resources_pccntr),
127 .resource = msm8960_resources_pccntr,
Praveen Chidambaramf27a5152013-02-01 11:44:53 -0700128 .dev = {
129 .platform_data = &msm_pm_data,
130 },
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530131};
132
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700133static struct resource resources_otg[] = {
134 {
135 .start = MSM8960_HSUSB_PHYS,
136 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
137 .flags = IORESOURCE_MEM,
138 },
139 {
140 .start = USB1_HS_IRQ,
141 .end = USB1_HS_IRQ,
142 .flags = IORESOURCE_IRQ,
143 },
144};
145
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700146struct platform_device msm8960_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700147 .name = "msm_otg",
148 .id = -1,
149 .num_resources = ARRAY_SIZE(resources_otg),
150 .resource = resources_otg,
151 .dev = {
152 .coherent_dma_mask = 0xffffffff,
153 },
154};
155
156static struct resource resources_hsusb[] = {
157 {
158 .start = MSM8960_HSUSB_PHYS,
159 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE,
160 .flags = IORESOURCE_MEM,
161 },
162 {
163 .start = USB1_HS_IRQ,
164 .end = USB1_HS_IRQ,
165 .flags = IORESOURCE_IRQ,
166 },
167};
168
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700169struct platform_device msm8960_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700170 .name = "msm_hsusb",
171 .id = -1,
172 .num_resources = ARRAY_SIZE(resources_hsusb),
173 .resource = resources_hsusb,
174 .dev = {
175 .coherent_dma_mask = 0xffffffff,
176 },
177};
178
179static struct resource resources_hsusb_host[] = {
180 {
181 .start = MSM8960_HSUSB_PHYS,
182 .end = MSM8960_HSUSB_PHYS + MSM8960_HSUSB_SIZE - 1,
183 .flags = IORESOURCE_MEM,
184 },
185 {
186 .start = USB1_HS_IRQ,
187 .end = USB1_HS_IRQ,
188 .flags = IORESOURCE_IRQ,
189 },
190};
191
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530192static u64 dma_mask = DMA_BIT_MASK(32);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700193struct platform_device msm_device_hsusb_host = {
194 .name = "msm_hsusb_host",
195 .id = -1,
196 .num_resources = ARRAY_SIZE(resources_hsusb_host),
197 .resource = resources_hsusb_host,
198 .dev = {
199 .dma_mask = &dma_mask,
200 .coherent_dma_mask = 0xffffffff,
201 },
202};
203
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530204static struct resource resources_hsic_host[] = {
205 {
Stepan Moskovchenko8e06ae62011-10-17 18:01:29 -0700206 .start = 0x12520000,
207 .end = 0x12520000 + SZ_4K - 1,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530208 .flags = IORESOURCE_MEM,
209 },
210 {
211 .start = USB_HSIC_IRQ,
212 .end = USB_HSIC_IRQ,
213 .flags = IORESOURCE_IRQ,
214 },
Vamsi Krishna34f01582011-12-14 19:54:42 -0800215 {
216 .start = MSM_GPIO_TO_INT(69),
217 .end = MSM_GPIO_TO_INT(69),
218 .name = "peripheral_status_irq",
219 .flags = IORESOURCE_IRQ,
220 },
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +0530221};
222
223struct platform_device msm_device_hsic_host = {
224 .name = "msm_hsic_host",
225 .id = -1,
226 .num_resources = ARRAY_SIZE(resources_hsic_host),
227 .resource = resources_hsic_host,
228 .dev = {
229 .dma_mask = &dma_mask,
230 .coherent_dma_mask = DMA_BIT_MASK(32),
231 },
232};
233
Matt Wagantallbf430eb2012-03-22 11:45:49 -0700234struct platform_device msm8960_device_acpuclk = {
235 .name = "acpuclk-8960",
236 .id = -1,
237};
238
Patrick Daly6578e0c2012-07-19 18:50:02 -0700239struct platform_device msm8960ab_device_acpuclk = {
240 .name = "acpuclk-8960ab",
241 .id = -1,
242};
243
Mona Hossain11c03ac2011-10-26 12:42:10 -0700244#define SHARED_IMEM_TZ_BASE 0x2a03f720
245static struct resource tzlog_resources[] = {
246 {
247 .start = SHARED_IMEM_TZ_BASE,
248 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
249 .flags = IORESOURCE_MEM,
250 },
251};
252
253struct platform_device msm_device_tz_log = {
254 .name = "tz_log",
255 .id = 0,
256 .num_resources = ARRAY_SIZE(tzlog_resources),
257 .resource = tzlog_resources,
258};
259
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700260static struct resource resources_uart_gsbi2[] = {
261 {
262 .start = MSM8960_GSBI2_UARTDM_IRQ,
263 .end = MSM8960_GSBI2_UARTDM_IRQ,
264 .flags = IORESOURCE_IRQ,
265 },
266 {
267 .start = MSM_UART2DM_PHYS,
268 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
269 .name = "uartdm_resource",
270 .flags = IORESOURCE_MEM,
271 },
272 {
273 .start = MSM_GSBI2_PHYS,
274 .end = MSM_GSBI2_PHYS + PAGE_SIZE - 1,
275 .name = "gsbi_resource",
276 .flags = IORESOURCE_MEM,
277 },
278};
279
280struct platform_device msm8960_device_uart_gsbi2 = {
281 .name = "msm_serial_hsl",
282 .id = 0,
283 .num_resources = ARRAY_SIZE(resources_uart_gsbi2),
284 .resource = resources_uart_gsbi2,
285};
Mayank Rana9f51f582011-08-04 18:35:59 +0530286/* GSBI 6 used into UARTDM Mode */
287static struct resource msm_uart_dm6_resources[] = {
288 {
289 .start = MSM_UART6DM_PHYS,
290 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
291 .name = "uartdm_resource",
292 .flags = IORESOURCE_MEM,
293 },
294 {
295 .start = GSBI6_UARTDM_IRQ,
296 .end = GSBI6_UARTDM_IRQ,
297 .flags = IORESOURCE_IRQ,
298 },
299 {
300 .start = MSM_GSBI6_PHYS,
301 .end = MSM_GSBI6_PHYS + 4 - 1,
302 .name = "gsbi_resource",
303 .flags = IORESOURCE_MEM,
304 },
305 {
306 .start = DMOV_HSUART_GSBI6_TX_CHAN,
307 .end = DMOV_HSUART_GSBI6_RX_CHAN,
308 .name = "uartdm_channels",
309 .flags = IORESOURCE_DMA,
310 },
311 {
312 .start = DMOV_HSUART_GSBI6_TX_CRCI,
313 .end = DMOV_HSUART_GSBI6_RX_CRCI,
314 .name = "uartdm_crci",
315 .flags = IORESOURCE_DMA,
316 },
317};
318static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
319struct platform_device msm_device_uart_dm6 = {
320 .name = "msm_serial_hs",
321 .id = 0,
322 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
323 .resource = msm_uart_dm6_resources,
324 .dev = {
325 .dma_mask = &msm_uart_dm6_dma_mask,
326 .coherent_dma_mask = DMA_BIT_MASK(32),
327 },
328};
Mayank Rana1f02d952012-07-04 19:11:20 +0530329
330/* GSBI 8 used into UARTDM Mode */
331static struct resource msm_uart_dm8_resources[] = {
332 {
333 .start = MSM_UART8DM_PHYS,
334 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
335 .name = "uartdm_resource",
336 .flags = IORESOURCE_MEM,
337 },
338 {
339 .start = GSBI8_UARTDM_IRQ,
340 .end = GSBI8_UARTDM_IRQ,
341 .flags = IORESOURCE_IRQ,
342 },
343 {
344 .start = MSM_GSBI8_PHYS,
345 .end = MSM_GSBI8_PHYS + 4 - 1,
346 .name = "gsbi_resource",
347 .flags = IORESOURCE_MEM,
348 },
349 {
350 .start = DMOV_HSUART_GSBI8_TX_CHAN,
351 .end = DMOV_HSUART_GSBI8_RX_CHAN,
352 .name = "uartdm_channels",
353 .flags = IORESOURCE_DMA,
354 },
355 {
356 .start = DMOV_HSUART_GSBI8_TX_CRCI,
357 .end = DMOV_HSUART_GSBI8_RX_CRCI,
358 .name = "uartdm_crci",
359 .flags = IORESOURCE_DMA,
360 },
361};
362
363static u64 msm_uart_dm8_dma_mask = DMA_BIT_MASK(32);
364struct platform_device msm_device_uart_dm8 = {
365 .name = "msm_serial_hs",
366 .id = 2,
367 .num_resources = ARRAY_SIZE(msm_uart_dm8_resources),
368 .resource = msm_uart_dm8_resources,
369 .dev = {
370 .dma_mask = &msm_uart_dm8_dma_mask,
371 .coherent_dma_mask = DMA_BIT_MASK(32),
372 },
373};
374
Mayank Ranae009c922012-03-22 03:02:06 +0530375/*
376 * GSBI 9 used into UARTDM Mode
377 * For 8960 Fusion 2.2 Primary IPC
378 */
379static struct resource msm_uart_dm9_resources[] = {
380 {
381 .start = MSM_UART9DM_PHYS,
382 .end = MSM_UART9DM_PHYS + PAGE_SIZE - 1,
383 .name = "uartdm_resource",
384 .flags = IORESOURCE_MEM,
385 },
386 {
387 .start = GSBI9_UARTDM_IRQ,
388 .end = GSBI9_UARTDM_IRQ,
389 .flags = IORESOURCE_IRQ,
390 },
391 {
392 .start = MSM_GSBI9_PHYS,
393 .end = MSM_GSBI9_PHYS + 4 - 1,
394 .name = "gsbi_resource",
395 .flags = IORESOURCE_MEM,
396 },
397 {
398 .start = DMOV_HSUART_GSBI9_TX_CHAN,
399 .end = DMOV_HSUART_GSBI9_RX_CHAN,
400 .name = "uartdm_channels",
401 .flags = IORESOURCE_DMA,
402 },
403 {
404 .start = DMOV_HSUART_GSBI9_TX_CRCI,
405 .end = DMOV_HSUART_GSBI9_RX_CRCI,
406 .name = "uartdm_crci",
407 .flags = IORESOURCE_DMA,
408 },
409};
410static u64 msm_uart_dm9_dma_mask = DMA_BIT_MASK(32);
411struct platform_device msm_device_uart_dm9 = {
412 .name = "msm_serial_hs",
413 .id = 1,
414 .num_resources = ARRAY_SIZE(msm_uart_dm9_resources),
415 .resource = msm_uart_dm9_resources,
416 .dev = {
417 .dma_mask = &msm_uart_dm9_dma_mask,
418 .coherent_dma_mask = DMA_BIT_MASK(32),
419 },
420};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700421
422static struct resource resources_uart_gsbi5[] = {
423 {
424 .start = GSBI5_UARTDM_IRQ,
425 .end = GSBI5_UARTDM_IRQ,
426 .flags = IORESOURCE_IRQ,
427 },
428 {
429 .start = MSM_UART5DM_PHYS,
430 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
431 .name = "uartdm_resource",
432 .flags = IORESOURCE_MEM,
433 },
434 {
435 .start = MSM_GSBI5_PHYS,
436 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
437 .name = "gsbi_resource",
438 .flags = IORESOURCE_MEM,
439 },
440};
441
442struct platform_device msm8960_device_uart_gsbi5 = {
443 .name = "msm_serial_hsl",
444 .id = 0,
445 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
446 .resource = resources_uart_gsbi5,
447};
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -0700448
449static struct msm_serial_hslite_platform_data uart_gsbi8_pdata = {
450 .line = 0,
451};
452
453static struct resource resources_uart_gsbi8[] = {
454 {
455 .start = GSBI8_UARTDM_IRQ,
456 .end = GSBI8_UARTDM_IRQ,
457 .flags = IORESOURCE_IRQ,
458 },
459 {
460 .start = MSM_UART8DM_PHYS,
461 .end = MSM_UART8DM_PHYS + PAGE_SIZE - 1,
462 .name = "uartdm_resource",
463 .flags = IORESOURCE_MEM,
464 },
465 {
466 .start = MSM_GSBI8_PHYS,
467 .end = MSM_GSBI8_PHYS + PAGE_SIZE - 1,
468 .name = "gsbi_resource",
469 .flags = IORESOURCE_MEM,
470 },
471};
472
473struct platform_device msm8960_device_uart_gsbi8 = {
474 .name = "msm_serial_hsl",
475 .id = 1,
476 .num_resources = ARRAY_SIZE(resources_uart_gsbi8),
477 .resource = resources_uart_gsbi8,
478 .dev.platform_data = &uart_gsbi8_pdata,
479};
480
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700481/* MSM Video core device */
482#ifdef CONFIG_MSM_BUS_SCALING
483static struct msm_bus_vectors vidc_init_vectors[] = {
484 {
485 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
486 .dst = MSM_BUS_SLAVE_EBI_CH0,
487 .ab = 0,
488 .ib = 0,
489 },
490 {
491 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
492 .dst = MSM_BUS_SLAVE_EBI_CH0,
493 .ab = 0,
494 .ib = 0,
495 },
496 {
497 .src = MSM_BUS_MASTER_AMPSS_M0,
498 .dst = MSM_BUS_SLAVE_EBI_CH0,
499 .ab = 0,
500 .ib = 0,
501 },
502 {
503 .src = MSM_BUS_MASTER_AMPSS_M0,
504 .dst = MSM_BUS_SLAVE_EBI_CH0,
505 .ab = 0,
506 .ib = 0,
507 },
508};
509static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
510 {
511 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
512 .dst = MSM_BUS_SLAVE_EBI_CH0,
513 .ab = 54525952,
514 .ib = 436207616,
515 },
516 {
517 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
518 .dst = MSM_BUS_SLAVE_EBI_CH0,
519 .ab = 72351744,
520 .ib = 289406976,
521 },
522 {
523 .src = MSM_BUS_MASTER_AMPSS_M0,
524 .dst = MSM_BUS_SLAVE_EBI_CH0,
525 .ab = 500000,
526 .ib = 1000000,
527 },
528 {
529 .src = MSM_BUS_MASTER_AMPSS_M0,
530 .dst = MSM_BUS_SLAVE_EBI_CH0,
531 .ab = 500000,
532 .ib = 1000000,
533 },
534};
535static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
536 {
537 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
538 .dst = MSM_BUS_SLAVE_EBI_CH0,
539 .ab = 40894464,
540 .ib = 327155712,
541 },
542 {
543 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
544 .dst = MSM_BUS_SLAVE_EBI_CH0,
545 .ab = 48234496,
546 .ib = 192937984,
547 },
548 {
549 .src = MSM_BUS_MASTER_AMPSS_M0,
550 .dst = MSM_BUS_SLAVE_EBI_CH0,
551 .ab = 500000,
552 .ib = 2000000,
553 },
554 {
555 .src = MSM_BUS_MASTER_AMPSS_M0,
556 .dst = MSM_BUS_SLAVE_EBI_CH0,
557 .ab = 500000,
558 .ib = 2000000,
559 },
560};
561static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
562 {
563 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
564 .dst = MSM_BUS_SLAVE_EBI_CH0,
565 .ab = 163577856,
566 .ib = 1308622848,
567 },
568 {
569 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
570 .dst = MSM_BUS_SLAVE_EBI_CH0,
571 .ab = 219152384,
572 .ib = 876609536,
573 },
574 {
575 .src = MSM_BUS_MASTER_AMPSS_M0,
576 .dst = MSM_BUS_SLAVE_EBI_CH0,
577 .ab = 1750000,
578 .ib = 3500000,
579 },
580 {
581 .src = MSM_BUS_MASTER_AMPSS_M0,
582 .dst = MSM_BUS_SLAVE_EBI_CH0,
583 .ab = 1750000,
584 .ib = 3500000,
585 },
586};
587static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
588 {
589 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
590 .dst = MSM_BUS_SLAVE_EBI_CH0,
591 .ab = 121634816,
592 .ib = 973078528,
593 },
594 {
595 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
596 .dst = MSM_BUS_SLAVE_EBI_CH0,
597 .ab = 155189248,
598 .ib = 620756992,
599 },
600 {
601 .src = MSM_BUS_MASTER_AMPSS_M0,
602 .dst = MSM_BUS_SLAVE_EBI_CH0,
603 .ab = 1750000,
604 .ib = 7000000,
605 },
606 {
607 .src = MSM_BUS_MASTER_AMPSS_M0,
608 .dst = MSM_BUS_SLAVE_EBI_CH0,
609 .ab = 1750000,
610 .ib = 7000000,
611 },
612};
613static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
614 {
615 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
616 .dst = MSM_BUS_SLAVE_EBI_CH0,
617 .ab = 372244480,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700618 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700619 },
620 {
621 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
622 .dst = MSM_BUS_SLAVE_EBI_CH0,
623 .ab = 501219328,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700624 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700625 },
626 {
627 .src = MSM_BUS_MASTER_AMPSS_M0,
628 .dst = MSM_BUS_SLAVE_EBI_CH0,
629 .ab = 2500000,
630 .ib = 5000000,
631 },
632 {
633 .src = MSM_BUS_MASTER_AMPSS_M0,
634 .dst = MSM_BUS_SLAVE_EBI_CH0,
635 .ab = 2500000,
636 .ib = 5000000,
637 },
638};
639static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
640 {
641 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
642 .dst = MSM_BUS_SLAVE_EBI_CH0,
643 .ab = 222298112,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700644 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700645 },
646 {
647 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
648 .dst = MSM_BUS_SLAVE_EBI_CH0,
649 .ab = 330301440,
Gopikrishnaiah Anandan3e6bdda2011-11-04 16:05:04 -0700650 .ib = 2560000000U,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700651 },
652 {
653 .src = MSM_BUS_MASTER_AMPSS_M0,
654 .dst = MSM_BUS_SLAVE_EBI_CH0,
655 .ab = 2500000,
656 .ib = 700000000,
657 },
658 {
659 .src = MSM_BUS_MASTER_AMPSS_M0,
660 .dst = MSM_BUS_SLAVE_EBI_CH0,
661 .ab = 2500000,
662 .ib = 10000000,
663 },
664};
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700665static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
666 {
667 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
668 .dst = MSM_BUS_SLAVE_EBI_CH0,
669 .ab = 222298112,
670 .ib = 3522000000U,
671 },
672 {
673 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
674 .dst = MSM_BUS_SLAVE_EBI_CH0,
675 .ab = 330301440,
676 .ib = 3522000000U,
677 },
678 {
679 .src = MSM_BUS_MASTER_AMPSS_M0,
680 .dst = MSM_BUS_SLAVE_EBI_CH0,
681 .ab = 2500000,
682 .ib = 700000000,
683 },
684 {
685 .src = MSM_BUS_MASTER_AMPSS_M0,
686 .dst = MSM_BUS_SLAVE_EBI_CH0,
687 .ab = 2500000,
688 .ib = 10000000,
689 },
690};
691static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
692 {
693 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
694 .dst = MSM_BUS_SLAVE_EBI_CH0,
695 .ab = 222298112,
696 .ib = 3522000000U,
697 },
698 {
699 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
700 .dst = MSM_BUS_SLAVE_EBI_CH0,
701 .ab = 330301440,
702 .ib = 3522000000U,
703 },
704 {
705 .src = MSM_BUS_MASTER_AMPSS_M0,
706 .dst = MSM_BUS_SLAVE_EBI_CH0,
707 .ab = 2500000,
708 .ib = 700000000,
709 },
710 {
711 .src = MSM_BUS_MASTER_AMPSS_M0,
712 .dst = MSM_BUS_SLAVE_EBI_CH0,
713 .ab = 2500000,
714 .ib = 10000000,
715 },
716};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700717
718static struct msm_bus_paths vidc_bus_client_config[] = {
719 {
720 ARRAY_SIZE(vidc_init_vectors),
721 vidc_init_vectors,
722 },
723 {
724 ARRAY_SIZE(vidc_venc_vga_vectors),
725 vidc_venc_vga_vectors,
726 },
727 {
728 ARRAY_SIZE(vidc_vdec_vga_vectors),
729 vidc_vdec_vga_vectors,
730 },
731 {
732 ARRAY_SIZE(vidc_venc_720p_vectors),
733 vidc_venc_720p_vectors,
734 },
735 {
736 ARRAY_SIZE(vidc_vdec_720p_vectors),
737 vidc_vdec_720p_vectors,
738 },
739 {
740 ARRAY_SIZE(vidc_venc_1080p_vectors),
741 vidc_venc_1080p_vectors,
742 },
743 {
744 ARRAY_SIZE(vidc_vdec_1080p_vectors),
745 vidc_vdec_1080p_vectors,
746 },
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700747 {
748 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
Arun Menon697e91b2012-08-20 15:25:50 -0700749 vidc_venc_1080p_turbo_vectors,
Deva Ramasubramanian837ae362012-05-12 23:26:53 -0700750 },
751 {
752 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
753 vidc_vdec_1080p_turbo_vectors,
754 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700755};
756
757static struct msm_bus_scale_pdata vidc_bus_client_data = {
758 vidc_bus_client_config,
759 ARRAY_SIZE(vidc_bus_client_config),
760 .name = "vidc",
761};
Arun Menon697e91b2012-08-20 15:25:50 -0700762
763static struct msm_bus_vectors vidc_pro_init_vectors[] = {
764 {
765 .src = MSM_BUS_MASTER_VIDEO_ENC,
766 .dst = MSM_BUS_SLAVE_EBI_CH0,
767 .ab = 0,
768 .ib = 0,
769 },
770 {
771 .src = MSM_BUS_MASTER_VIDEO_DEC,
772 .dst = MSM_BUS_SLAVE_EBI_CH0,
773 .ab = 0,
774 .ib = 0,
775 },
776 {
777 .src = MSM_BUS_MASTER_AMPSS_M0,
778 .dst = MSM_BUS_SLAVE_EBI_CH0,
779 .ab = 0,
780 .ib = 0,
781 },
782 {
783 .src = MSM_BUS_MASTER_AMPSS_M0,
784 .dst = MSM_BUS_SLAVE_EBI_CH0,
785 .ab = 0,
786 .ib = 0,
787 },
788};
789static struct msm_bus_vectors vidc_pro_venc_vga_vectors[] = {
790 {
791 .src = MSM_BUS_MASTER_VIDEO_ENC,
792 .dst = MSM_BUS_SLAVE_EBI_CH0,
793 .ab = 54525952,
794 .ib = 436207616,
795 },
796 {
797 .src = MSM_BUS_MASTER_VIDEO_DEC,
798 .dst = MSM_BUS_SLAVE_EBI_CH0,
799 .ab = 72351744,
800 .ib = 289406976,
801 },
802 {
803 .src = MSM_BUS_MASTER_AMPSS_M0,
804 .dst = MSM_BUS_SLAVE_EBI_CH0,
805 .ab = 500000,
806 .ib = 1000000,
807 },
808 {
809 .src = MSM_BUS_MASTER_AMPSS_M0,
810 .dst = MSM_BUS_SLAVE_EBI_CH0,
811 .ab = 500000,
812 .ib = 1000000,
813 },
814};
815static struct msm_bus_vectors vidc_pro_vdec_vga_vectors[] = {
816 {
817 .src = MSM_BUS_MASTER_VIDEO_ENC,
818 .dst = MSM_BUS_SLAVE_EBI_CH0,
819 .ab = 40894464,
820 .ib = 327155712,
821 },
822 {
823 .src = MSM_BUS_MASTER_VIDEO_DEC,
824 .dst = MSM_BUS_SLAVE_EBI_CH0,
825 .ab = 48234496,
826 .ib = 192937984,
827 },
828 {
829 .src = MSM_BUS_MASTER_AMPSS_M0,
830 .dst = MSM_BUS_SLAVE_EBI_CH0,
831 .ab = 500000,
832 .ib = 2000000,
833 },
834 {
835 .src = MSM_BUS_MASTER_AMPSS_M0,
836 .dst = MSM_BUS_SLAVE_EBI_CH0,
837 .ab = 500000,
838 .ib = 2000000,
839 },
840};
841static struct msm_bus_vectors vidc_pro_venc_720p_vectors[] = {
842 {
843 .src = MSM_BUS_MASTER_VIDEO_ENC,
844 .dst = MSM_BUS_SLAVE_EBI_CH0,
845 .ab = 163577856,
846 .ib = 1308622848,
847 },
848 {
849 .src = MSM_BUS_MASTER_VIDEO_DEC,
850 .dst = MSM_BUS_SLAVE_EBI_CH0,
851 .ab = 219152384,
852 .ib = 876609536,
853 },
854 {
855 .src = MSM_BUS_MASTER_AMPSS_M0,
856 .dst = MSM_BUS_SLAVE_EBI_CH0,
857 .ab = 1750000,
858 .ib = 3500000,
859 },
860 {
861 .src = MSM_BUS_MASTER_AMPSS_M0,
862 .dst = MSM_BUS_SLAVE_EBI_CH0,
863 .ab = 1750000,
864 .ib = 3500000,
865 },
866};
867static struct msm_bus_vectors vidc_pro_vdec_720p_vectors[] = {
868 {
869 .src = MSM_BUS_MASTER_VIDEO_ENC,
870 .dst = MSM_BUS_SLAVE_EBI_CH0,
871 .ab = 121634816,
872 .ib = 973078528,
873 },
874 {
875 .src = MSM_BUS_MASTER_VIDEO_DEC,
876 .dst = MSM_BUS_SLAVE_EBI_CH0,
877 .ab = 155189248,
878 .ib = 620756992,
879 },
880 {
881 .src = MSM_BUS_MASTER_AMPSS_M0,
882 .dst = MSM_BUS_SLAVE_EBI_CH0,
883 .ab = 1750000,
884 .ib = 7000000,
885 },
886 {
887 .src = MSM_BUS_MASTER_AMPSS_M0,
888 .dst = MSM_BUS_SLAVE_EBI_CH0,
889 .ab = 1750000,
890 .ib = 7000000,
891 },
892};
893static struct msm_bus_vectors vidc_pro_venc_1080p_vectors[] = {
894 {
895 .src = MSM_BUS_MASTER_VIDEO_ENC,
896 .dst = MSM_BUS_SLAVE_EBI_CH0,
897 .ab = 372244480,
898 .ib = 2560000000U,
899 },
900 {
901 .src = MSM_BUS_MASTER_VIDEO_DEC,
902 .dst = MSM_BUS_SLAVE_EBI_CH0,
903 .ab = 501219328,
904 .ib = 2560000000U,
905 },
906 {
907 .src = MSM_BUS_MASTER_AMPSS_M0,
908 .dst = MSM_BUS_SLAVE_EBI_CH0,
909 .ab = 2500000,
910 .ib = 5000000,
911 },
912 {
913 .src = MSM_BUS_MASTER_AMPSS_M0,
914 .dst = MSM_BUS_SLAVE_EBI_CH0,
915 .ab = 2500000,
916 .ib = 5000000,
917 },
918};
919static struct msm_bus_vectors vidc_pro_vdec_1080p_vectors[] = {
920 {
921 .src = MSM_BUS_MASTER_VIDEO_ENC,
922 .dst = MSM_BUS_SLAVE_EBI_CH0,
923 .ab = 222298112,
924 .ib = 2560000000U,
925 },
926 {
927 .src = MSM_BUS_MASTER_VIDEO_DEC,
928 .dst = MSM_BUS_SLAVE_EBI_CH0,
929 .ab = 330301440,
930 .ib = 2560000000U,
931 },
932 {
933 .src = MSM_BUS_MASTER_AMPSS_M0,
934 .dst = MSM_BUS_SLAVE_EBI_CH0,
935 .ab = 2500000,
936 .ib = 700000000,
937 },
938 {
939 .src = MSM_BUS_MASTER_AMPSS_M0,
940 .dst = MSM_BUS_SLAVE_EBI_CH0,
941 .ab = 2500000,
942 .ib = 10000000,
943 },
944};
945static struct msm_bus_vectors vidc_pro_venc_1080p_turbo_vectors[] = {
946 {
947 .src = MSM_BUS_MASTER_VIDEO_ENC,
948 .dst = MSM_BUS_SLAVE_EBI_CH0,
949 .ab = 222298112,
950 .ib = 3522000000U,
951 },
952 {
953 .src = MSM_BUS_MASTER_VIDEO_DEC,
954 .dst = MSM_BUS_SLAVE_EBI_CH0,
955 .ab = 330301440,
956 .ib = 3522000000U,
957 },
958 {
959 .src = MSM_BUS_MASTER_AMPSS_M0,
960 .dst = MSM_BUS_SLAVE_EBI_CH0,
961 .ab = 2500000,
962 .ib = 700000000,
963 },
964 {
965 .src = MSM_BUS_MASTER_AMPSS_M0,
966 .dst = MSM_BUS_SLAVE_EBI_CH0,
967 .ab = 2500000,
968 .ib = 10000000,
969 },
970};
971static struct msm_bus_vectors vidc_pro_vdec_1080p_turbo_vectors[] = {
972 {
973 .src = MSM_BUS_MASTER_VIDEO_ENC,
974 .dst = MSM_BUS_SLAVE_EBI_CH0,
975 .ab = 222298112,
976 .ib = 3522000000U,
977 },
978 {
979 .src = MSM_BUS_MASTER_VIDEO_DEC,
980 .dst = MSM_BUS_SLAVE_EBI_CH0,
981 .ab = 330301440,
982 .ib = 3522000000U,
983 },
984 {
985 .src = MSM_BUS_MASTER_AMPSS_M0,
986 .dst = MSM_BUS_SLAVE_EBI_CH0,
987 .ab = 2500000,
988 .ib = 700000000,
989 },
990 {
991 .src = MSM_BUS_MASTER_AMPSS_M0,
992 .dst = MSM_BUS_SLAVE_EBI_CH0,
993 .ab = 2500000,
994 .ib = 10000000,
995 },
996};
997
998static struct msm_bus_paths vidc_pro_bus_client_config[] = {
999 {
1000 ARRAY_SIZE(vidc_pro_init_vectors),
1001 vidc_pro_init_vectors,
1002 },
1003 {
1004 ARRAY_SIZE(vidc_pro_venc_vga_vectors),
1005 vidc_pro_venc_vga_vectors,
1006 },
1007 {
1008 ARRAY_SIZE(vidc_pro_vdec_vga_vectors),
1009 vidc_pro_vdec_vga_vectors,
1010 },
1011 {
1012 ARRAY_SIZE(vidc_pro_venc_720p_vectors),
1013 vidc_pro_venc_720p_vectors,
1014 },
1015 {
1016 ARRAY_SIZE(vidc_pro_vdec_720p_vectors),
1017 vidc_pro_vdec_720p_vectors,
1018 },
1019 {
1020 ARRAY_SIZE(vidc_pro_venc_1080p_vectors),
1021 vidc_pro_venc_1080p_vectors,
1022 },
1023 {
1024 ARRAY_SIZE(vidc_pro_vdec_1080p_vectors),
1025 vidc_pro_vdec_1080p_vectors,
1026 },
1027 {
1028 ARRAY_SIZE(vidc_pro_venc_1080p_turbo_vectors),
1029 vidc_pro_venc_1080p_turbo_vectors,
1030 },
1031 {
1032 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
1033 vidc_pro_vdec_1080p_turbo_vectors,
1034 },
1035};
1036
1037static struct msm_bus_scale_pdata vidc_pro_bus_client_data = {
1038 vidc_pro_bus_client_config,
1039 ARRAY_SIZE(vidc_bus_client_config),
1040 .name = "vidc",
1041};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001042#endif
1043
Mona Hossain9c430e32011-07-27 11:04:47 -07001044#ifdef CONFIG_HW_RANDOM_MSM
1045/* PRNG device */
1046#define MSM_PRNG_PHYS 0x1A500000
1047static struct resource rng_resources = {
1048 .flags = IORESOURCE_MEM,
1049 .start = MSM_PRNG_PHYS,
1050 .end = MSM_PRNG_PHYS + SZ_512 - 1,
1051};
1052
1053struct platform_device msm_device_rng = {
1054 .name = "msm_rng",
1055 .id = 0,
1056 .num_resources = 1,
1057 .resource = &rng_resources,
1058};
1059#endif
1060
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001061#define MSM_VIDC_BASE_PHYS 0x04400000
1062#define MSM_VIDC_BASE_SIZE 0x00100000
1063
1064static struct resource msm_device_vidc_resources[] = {
1065 {
1066 .start = MSM_VIDC_BASE_PHYS,
1067 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
1068 .flags = IORESOURCE_MEM,
1069 },
1070 {
1071 .start = VCODEC_IRQ,
1072 .end = VCODEC_IRQ,
1073 .flags = IORESOURCE_IRQ,
1074 },
1075};
1076
Arun Menon8ef6d5a2013-01-04 21:20:26 -08001077int64_t vidc_v4l2_ns_iommu_mapping[] = {-1, -1};
1078int64_t vidc_v4l2_cp_iommu_mapping[] = {-1, -1};
1079int64_t *vidc_v4l2_iommu_mappings[] = {
1080 [MSM_VIDC_V4L2_IOMMU_MAP_NS] = vidc_v4l2_ns_iommu_mapping,
1081 [MSM_VIDC_V4L2_IOMMU_MAP_CP] = vidc_v4l2_cp_iommu_mapping,
1082};
1083
1084int64_t vidc_v4l2_load_1[] = {-1, -1};
1085int64_t vidc_v4l2_load_2[] = {-1, -1};
1086int64_t *vidc_v4l2_load_table[] = {
1087 vidc_v4l2_load_1,
1088 vidc_v4l2_load_2,
1089};
1090
1091static struct msm_vidc_v4l2_platform_data vidc_v4l2_plaform_data = {
1092 .iommu_table = vidc_v4l2_iommu_mappings,
1093 .num_iommu_table = 2,
1094 .load_table = vidc_v4l2_load_table,
1095 .num_load_table = 2,
Deva Ramasubramanian1973ba82013-03-27 15:34:38 -07001096 .max_load = 800*480*30/256,
Arun Menon8ef6d5a2013-01-04 21:20:26 -08001097};
1098
1099struct platform_device msm_device_vidc_v4l2 = {
1100 .name = "msm_vidc_v4l2",
1101 .id = 0,
1102 .num_resources = 0,
1103 .dev = {
1104 .platform_data = &vidc_v4l2_plaform_data,
1105 },
1106};
1107
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001108struct msm_vidc_platform_data vidc_platform_data = {
1109#ifdef CONFIG_MSM_BUS_SCALING
1110 .vidc_bus_client_pdata = &vidc_bus_client_data,
1111#endif
Deepak Koturcb4f6722011-10-31 14:06:57 -07001112#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganb5be7992011-11-18 14:29:02 -08001113 .memtype = ION_CP_MM_HEAP_ID,
Deepak Koturcb4f6722011-10-31 14:06:57 -07001114 .enable_ion = 1,
Deepak kotur5f10b272012-03-15 22:01:39 -07001115 .cp_enabled = 1,
Deepak Koturcb4f6722011-10-31 14:06:57 -07001116#else
Deepak Kotur12301a72011-11-09 18:30:29 -08001117 .memtype = MEMTYPE_EBI1,
Deepak Koturcb4f6722011-10-31 14:06:57 -07001118 .enable_ion = 0,
1119#endif
Deepika Pepakayalabebc7622011-12-01 15:13:43 -08001120 .disable_dmx = 0,
Rajeshwar Kurapatyc155c352011-12-17 06:35:32 +05301121 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08001122 .cont_mode_dpb_count = 18,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05301123 .fw_addr = 0x9fe00000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001124};
1125
1126struct platform_device msm_device_vidc = {
1127 .name = "msm_vidc",
1128 .id = 0,
1129 .num_resources = ARRAY_SIZE(msm_device_vidc_resources),
1130 .resource = msm_device_vidc_resources,
1131 .dev = {
1132 .platform_data = &vidc_platform_data,
1133 },
1134};
1135
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001136#define MSM_SDC1_BASE 0x12400000
1137#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1138#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1139#define MSM_SDC2_BASE 0x12140000
1140#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1141#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001142#define MSM_SDC3_BASE 0x12180000
1143#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1144#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1145#define MSM_SDC4_BASE 0x121C0000
1146#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1147#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1148#define MSM_SDC5_BASE 0x12200000
1149#define MSM_SDC5_DML_BASE (MSM_SDC5_BASE + 0x800)
1150#define MSM_SDC5_BAM_BASE (MSM_SDC5_BASE + 0x2000)
1151
1152static struct resource resources_sdc1[] = {
1153 {
1154 .name = "core_mem",
1155 .flags = IORESOURCE_MEM,
1156 .start = MSM_SDC1_BASE,
1157 .end = MSM_SDC1_DML_BASE - 1,
1158 },
1159 {
1160 .name = "core_irq",
1161 .flags = IORESOURCE_IRQ,
1162 .start = SDC1_IRQ_0,
1163 .end = SDC1_IRQ_0
1164 },
1165#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1166 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301167 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001168 .start = MSM_SDC1_DML_BASE,
1169 .end = MSM_SDC1_BAM_BASE - 1,
1170 .flags = IORESOURCE_MEM,
1171 },
1172 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301173 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001174 .start = MSM_SDC1_BAM_BASE,
1175 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1176 .flags = IORESOURCE_MEM,
1177 },
1178 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301179 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001180 .start = SDC1_BAM_IRQ,
1181 .end = SDC1_BAM_IRQ,
1182 .flags = IORESOURCE_IRQ,
1183 },
1184#endif
1185};
1186
1187static struct resource resources_sdc2[] = {
1188 {
1189 .name = "core_mem",
1190 .flags = IORESOURCE_MEM,
1191 .start = MSM_SDC2_BASE,
1192 .end = MSM_SDC2_DML_BASE - 1,
1193 },
1194 {
1195 .name = "core_irq",
1196 .flags = IORESOURCE_IRQ,
1197 .start = SDC2_IRQ_0,
1198 .end = SDC2_IRQ_0
1199 },
1200#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1201 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301202 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001203 .start = MSM_SDC2_DML_BASE,
1204 .end = MSM_SDC2_BAM_BASE - 1,
1205 .flags = IORESOURCE_MEM,
1206 },
1207 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301208 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001209 .start = MSM_SDC2_BAM_BASE,
1210 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1211 .flags = IORESOURCE_MEM,
1212 },
1213 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301214 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001215 .start = SDC2_BAM_IRQ,
1216 .end = SDC2_BAM_IRQ,
1217 .flags = IORESOURCE_IRQ,
1218 },
1219#endif
1220};
1221
1222static struct resource resources_sdc3[] = {
1223 {
1224 .name = "core_mem",
1225 .flags = IORESOURCE_MEM,
1226 .start = MSM_SDC3_BASE,
1227 .end = MSM_SDC3_DML_BASE - 1,
1228 },
1229 {
1230 .name = "core_irq",
1231 .flags = IORESOURCE_IRQ,
1232 .start = SDC3_IRQ_0,
1233 .end = SDC3_IRQ_0
1234 },
1235#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1236 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301237 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001238 .start = MSM_SDC3_DML_BASE,
1239 .end = MSM_SDC3_BAM_BASE - 1,
1240 .flags = IORESOURCE_MEM,
1241 },
1242 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301243 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001244 .start = MSM_SDC3_BAM_BASE,
1245 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1246 .flags = IORESOURCE_MEM,
1247 },
1248 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301249 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001250 .start = SDC3_BAM_IRQ,
1251 .end = SDC3_BAM_IRQ,
1252 .flags = IORESOURCE_IRQ,
1253 },
1254#endif
1255};
1256
1257static struct resource resources_sdc4[] = {
1258 {
1259 .name = "core_mem",
1260 .flags = IORESOURCE_MEM,
1261 .start = MSM_SDC4_BASE,
1262 .end = MSM_SDC4_DML_BASE - 1,
1263 },
1264 {
1265 .name = "core_irq",
1266 .flags = IORESOURCE_IRQ,
1267 .start = SDC4_IRQ_0,
1268 .end = SDC4_IRQ_0
1269 },
1270#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1271 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301272 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001273 .start = MSM_SDC4_DML_BASE,
1274 .end = MSM_SDC4_BAM_BASE - 1,
1275 .flags = IORESOURCE_MEM,
1276 },
1277 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301278 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001279 .start = MSM_SDC4_BAM_BASE,
1280 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1281 .flags = IORESOURCE_MEM,
1282 },
1283 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301284 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001285 .start = SDC4_BAM_IRQ,
1286 .end = SDC4_BAM_IRQ,
1287 .flags = IORESOURCE_IRQ,
1288 },
1289#endif
1290};
1291
1292static struct resource resources_sdc5[] = {
1293 {
1294 .name = "core_mem",
1295 .flags = IORESOURCE_MEM,
1296 .start = MSM_SDC5_BASE,
1297 .end = MSM_SDC5_DML_BASE - 1,
1298 },
1299 {
1300 .name = "core_irq",
1301 .flags = IORESOURCE_IRQ,
1302 .start = SDC5_IRQ_0,
1303 .end = SDC5_IRQ_0
1304 },
1305#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1306 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301307 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001308 .start = MSM_SDC5_DML_BASE,
1309 .end = MSM_SDC5_BAM_BASE - 1,
1310 .flags = IORESOURCE_MEM,
1311 },
1312 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301313 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001314 .start = MSM_SDC5_BAM_BASE,
1315 .end = MSM_SDC5_BAM_BASE + (2 * SZ_4K) - 1,
1316 .flags = IORESOURCE_MEM,
1317 },
1318 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301319 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001320 .start = SDC5_BAM_IRQ,
1321 .end = SDC5_BAM_IRQ,
1322 .flags = IORESOURCE_IRQ,
1323 },
1324#endif
1325};
1326
1327struct platform_device msm_device_sdc1 = {
1328 .name = "msm_sdcc",
1329 .id = 1,
1330 .num_resources = ARRAY_SIZE(resources_sdc1),
1331 .resource = resources_sdc1,
1332 .dev = {
1333 .coherent_dma_mask = 0xffffffff,
1334 },
1335};
1336
1337struct platform_device msm_device_sdc2 = {
1338 .name = "msm_sdcc",
1339 .id = 2,
1340 .num_resources = ARRAY_SIZE(resources_sdc2),
1341 .resource = resources_sdc2,
1342 .dev = {
1343 .coherent_dma_mask = 0xffffffff,
1344 },
1345};
1346
1347struct platform_device msm_device_sdc3 = {
1348 .name = "msm_sdcc",
1349 .id = 3,
1350 .num_resources = ARRAY_SIZE(resources_sdc3),
1351 .resource = resources_sdc3,
1352 .dev = {
1353 .coherent_dma_mask = 0xffffffff,
1354 },
1355};
1356
1357struct platform_device msm_device_sdc4 = {
1358 .name = "msm_sdcc",
1359 .id = 4,
1360 .num_resources = ARRAY_SIZE(resources_sdc4),
1361 .resource = resources_sdc4,
1362 .dev = {
1363 .coherent_dma_mask = 0xffffffff,
1364 },
1365};
1366
1367struct platform_device msm_device_sdc5 = {
1368 .name = "msm_sdcc",
1369 .id = 5,
1370 .num_resources = ARRAY_SIZE(resources_sdc5),
1371 .resource = resources_sdc5,
1372 .dev = {
1373 .coherent_dma_mask = 0xffffffff,
1374 },
1375};
1376
Stephen Boydeb819882011-08-29 14:46:30 -07001377static struct resource msm_8960_q6_lpass_resources[] = {
1378 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001379 .start = 0x28800000,
1380 .end = 0x28800000 + SZ_256 - 1,
Stephen Boydeb819882011-08-29 14:46:30 -07001381 .flags = IORESOURCE_MEM,
1382 },
Stephen Boyda1cf76b2012-06-13 12:05:35 -07001383 {
1384 .start = LPASS_Q6SS_WDOG_EXPIRED,
1385 .end = LPASS_Q6SS_WDOG_EXPIRED,
1386 .flags = IORESOURCE_IRQ,
1387 },
Stephen Boydeb819882011-08-29 14:46:30 -07001388};
1389
1390static struct pil_q6v4_pdata msm_8960_q6_lpass_data = {
1391 .strap_tcm_base = 0x01460000,
1392 .strap_ahb_upper = 0x00290000,
1393 .strap_ahb_lower = 0x00000280,
Stephen Boydbdb53f32012-06-05 18:39:47 -07001394 .aclk_reg = MSM_CLK_CTL_BASE + 0x23A0,
Stephen Boydeb819882011-08-29 14:46:30 -07001395 .name = "q6",
1396 .pas_id = PAS_Q6,
Matt Wagantall6e4aafb2011-09-09 17:53:54 -07001397 .bus_port = MSM_BUS_MASTER_LPASS_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001398};
1399
1400struct platform_device msm_8960_q6_lpass = {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001401 .name = "pil-q6v4-lpass",
1402 .id = -1,
Stephen Boydeb819882011-08-29 14:46:30 -07001403 .num_resources = ARRAY_SIZE(msm_8960_q6_lpass_resources),
1404 .resource = msm_8960_q6_lpass_resources,
1405 .dev.platform_data = &msm_8960_q6_lpass_data,
1406};
1407
Stephen Boydbdb53f32012-06-05 18:39:47 -07001408static struct resource msm_8960_q6_mss_resources[] = {
Stephen Boydeb819882011-08-29 14:46:30 -07001409 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001410 .start = 0x08800000,
1411 .end = 0x08800000 + SZ_256 - 1,
Stephen Boydeb819882011-08-29 14:46:30 -07001412 .flags = IORESOURCE_MEM,
1413 },
1414 {
Stephen Boyde24edf52012-07-12 17:46:19 -07001415 .start = 0x00900000,
1416 .end = 0x00900000 + SZ_16K - 1,
1417 .flags = IORESOURCE_MEM,
1418 },
1419 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001420 .start = 0x08B00000,
1421 .end = 0x08B00000 + SZ_256 - 1,
1422 .flags = IORESOURCE_MEM,
1423 },
1424 {
Stephen Boyd2efa9962012-06-12 14:20:12 -07001425 .start = 0x08882000,
1426 .end = 0x08882000 + SZ_256 - 1,
1427 .flags = IORESOURCE_MEM,
1428 },
1429 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001430 .start = 0x08900000,
1431 .end = 0x08900000 + SZ_256 - 1,
Stephen Boydeb819882011-08-29 14:46:30 -07001432 .flags = IORESOURCE_MEM,
1433 },
Stephen Boyd2efa9962012-06-12 14:20:12 -07001434 {
1435 .start = 0x08982000,
1436 .end = 0x08982000 + SZ_256 - 1,
1437 .flags = IORESOURCE_MEM,
1438 },
1439 {
1440 .start = Q6FW_WDOG_EXPIRED_IRQ,
1441 .end = Q6FW_WDOG_EXPIRED_IRQ,
1442 .flags = IORESOURCE_IRQ,
1443 },
1444 {
1445 .start = Q6SW_WDOG_EXPIRED_IRQ,
1446 .end = Q6SW_WDOG_EXPIRED_IRQ,
1447 .flags = IORESOURCE_IRQ,
1448 },
Stephen Boydeb819882011-08-29 14:46:30 -07001449};
1450
Stephen Boydbdb53f32012-06-05 18:39:47 -07001451static struct pil_q6v4_pdata msm_8960_q6_mss_data[2] = {
Stephen Boydeb819882011-08-29 14:46:30 -07001452 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001453 .strap_tcm_base = 0x00400000,
1454 .strap_ahb_upper = 0x00090000,
1455 .strap_ahb_lower = 0x00000080,
1456 .aclk_reg = MSM_CLK_CTL_BASE + 0x2C6C,
1457 .jtag_clk_reg = MSM_CLK_CTL_BASE + 0x2044,
1458 .name = "modem_fw",
Stephen Boydbdb53f32012-06-05 18:39:47 -07001459 .pas_id = PAS_MODEM_FW,
1460 .bus_port = MSM_BUS_MASTER_MSS_FW_PROC,
Stephen Boydeb819882011-08-29 14:46:30 -07001461 },
1462 {
Stephen Boydbdb53f32012-06-05 18:39:47 -07001463 .strap_tcm_base = 0x00420000,
1464 .strap_ahb_upper = 0x00090000,
1465 .strap_ahb_lower = 0x00000080,
1466 .aclk_reg = MSM_CLK_CTL_BASE + 0x2040,
1467 .jtag_clk_reg = MSM_CLK_CTL_BASE + 0x2C68,
1468 .name = "modem",
Stephen Boydbdb53f32012-06-05 18:39:47 -07001469 .pas_id = PAS_MODEM_SW,
1470 .bus_port = MSM_BUS_MASTER_MSS_SW_PROC,
1471 }
Stephen Boydeb819882011-08-29 14:46:30 -07001472};
1473
Stephen Boydbdb53f32012-06-05 18:39:47 -07001474struct platform_device msm_8960_q6_mss = {
1475 .name = "pil-q6v4-modem",
1476 .id = -1,
1477 .num_resources = ARRAY_SIZE(msm_8960_q6_mss_resources),
1478 .resource = msm_8960_q6_mss_resources,
1479 .dev.platform_data = msm_8960_q6_mss_data,
Stephen Boydeb819882011-08-29 14:46:30 -07001480};
1481
Stephen Boyd322a9922011-09-20 01:05:54 -07001482static struct resource msm_8960_riva_resources[] = {
1483 {
1484 .start = 0x03204000,
1485 .end = 0x03204000 + SZ_256 - 1,
1486 .flags = IORESOURCE_MEM,
1487 },
Stephen Boydfdec00d2012-05-10 17:04:49 -07001488 {
Stephen Boyde24edf52012-07-12 17:46:19 -07001489 .start = 0x00900000,
1490 .end = 0x00900000 + SZ_16K - 1,
1491 .flags = IORESOURCE_MEM,
1492 },
1493 {
Stephen Boydfdec00d2012-05-10 17:04:49 -07001494 .start = RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ,
1495 .end = RIVA_APSS_WDOG_BITE_RESET_RDY_IRQ,
1496 .flags = IORESOURCE_IRQ,
1497 },
Stephen Boyd322a9922011-09-20 01:05:54 -07001498};
1499
1500struct platform_device msm_8960_riva = {
1501 .name = "pil_riva",
1502 .id = -1,
1503 .num_resources = ARRAY_SIZE(msm_8960_riva_resources),
1504 .resource = msm_8960_riva_resources,
1505};
1506
Stephen Boydd89eebe2011-09-28 23:28:11 -07001507struct platform_device msm_pil_tzapps = {
1508 .name = "pil_tzapps",
1509 .id = -1,
1510};
1511
Stephen Boydf169b4b2012-05-10 17:55:55 -07001512static struct resource msm_pil_dsps_resources[] = {
1513 {
Stephen Boyde24edf52012-07-12 17:46:19 -07001514 .start = 0x00900000,
1515 .end = 0x00900000 + SZ_16K - 1,
1516 .flags = IORESOURCE_MEM,
1517 },
1518 {
Stephen Boydf169b4b2012-05-10 17:55:55 -07001519 .start = PPSS_WDOG_TIMER_IRQ,
1520 .end = PPSS_WDOG_TIMER_IRQ,
1521 .flags = IORESOURCE_IRQ,
1522 },
1523 {
1524 .start = 0x12080000,
1525 .end = 0x12080000 + SZ_8K - 1,
1526 .flags = IORESOURCE_MEM,
1527 },
1528};
1529
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001530struct platform_device msm_pil_dsps = {
Stephen Boydf169b4b2012-05-10 17:55:55 -07001531 .name = "pil_dsps",
1532 .id = -1,
1533 .resource = msm_pil_dsps_resources,
1534 .num_resources = ARRAY_SIZE(msm_pil_dsps_resources),
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07001535 .dev.platform_data = "dsps",
1536};
1537
Stephen Boyd7b973de2012-03-09 12:26:16 -08001538struct platform_device msm_pil_vidc = {
1539 .name = "pil_vidc",
1540 .id = -1,
1541};
1542
Eric Holmberg023d25c2012-03-01 12:27:55 -07001543static struct resource smd_resource[] = {
1544 {
1545 .name = "a9_m2a_0",
1546 .start = INT_A9_M2A_0,
1547 .flags = IORESOURCE_IRQ,
1548 },
1549 {
1550 .name = "a9_m2a_5",
1551 .start = INT_A9_M2A_5,
1552 .flags = IORESOURCE_IRQ,
1553 },
1554 {
1555 .name = "adsp_a11",
1556 .start = INT_ADSP_A11,
1557 .flags = IORESOURCE_IRQ,
1558 },
1559 {
1560 .name = "adsp_a11_smsm",
1561 .start = INT_ADSP_A11_SMSM,
1562 .flags = IORESOURCE_IRQ,
1563 },
1564 {
1565 .name = "dsps_a11",
1566 .start = INT_DSPS_A11,
1567 .flags = IORESOURCE_IRQ,
1568 },
1569 {
1570 .name = "dsps_a11_smsm",
1571 .start = INT_DSPS_A11_SMSM,
1572 .flags = IORESOURCE_IRQ,
1573 },
1574 {
1575 .name = "wcnss_a11",
1576 .start = INT_WCNSS_A11,
1577 .flags = IORESOURCE_IRQ,
1578 },
1579 {
1580 .name = "wcnss_a11_smsm",
1581 .start = INT_WCNSS_A11_SMSM,
1582 .flags = IORESOURCE_IRQ,
1583 },
1584};
1585
1586static struct smd_subsystem_config smd_config_list[] = {
1587 {
1588 .irq_config_id = SMD_MODEM,
1589 .subsys_name = "modem",
1590 .edge = SMD_APPS_MODEM,
1591
1592 .smd_int.irq_name = "a9_m2a_0",
1593 .smd_int.flags = IRQF_TRIGGER_RISING,
1594 .smd_int.irq_id = -1,
1595 .smd_int.device_name = "smd_dev",
1596 .smd_int.dev_id = 0,
1597 .smd_int.out_bit_pos = 1 << 3,
1598 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1599 .smd_int.out_offset = 0x8,
1600
1601 .smsm_int.irq_name = "a9_m2a_5",
1602 .smsm_int.flags = IRQF_TRIGGER_RISING,
1603 .smsm_int.irq_id = -1,
1604 .smsm_int.device_name = "smd_smsm",
1605 .smsm_int.dev_id = 0,
1606 .smsm_int.out_bit_pos = 1 << 4,
1607 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1608 .smsm_int.out_offset = 0x8,
1609 },
1610 {
1611 .irq_config_id = SMD_Q6,
Stephen Boyd77db8bb2012-06-27 15:15:16 -07001612 .subsys_name = "adsp",
Eric Holmberg023d25c2012-03-01 12:27:55 -07001613 .edge = SMD_APPS_QDSP,
1614
1615 .smd_int.irq_name = "adsp_a11",
1616 .smd_int.flags = IRQF_TRIGGER_RISING,
1617 .smd_int.irq_id = -1,
1618 .smd_int.device_name = "smd_dev",
1619 .smd_int.dev_id = 0,
1620 .smd_int.out_bit_pos = 1 << 15,
1621 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1622 .smd_int.out_offset = 0x8,
1623
1624 .smsm_int.irq_name = "adsp_a11_smsm",
1625 .smsm_int.flags = IRQF_TRIGGER_RISING,
1626 .smsm_int.irq_id = -1,
1627 .smsm_int.device_name = "smd_smsm",
1628 .smsm_int.dev_id = 0,
1629 .smsm_int.out_bit_pos = 1 << 14,
1630 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1631 .smsm_int.out_offset = 0x8,
1632 },
1633 {
1634 .irq_config_id = SMD_DSPS,
1635 .subsys_name = "dsps",
1636 .edge = SMD_APPS_DSPS,
1637
1638 .smd_int.irq_name = "dsps_a11",
1639 .smd_int.flags = IRQF_TRIGGER_RISING,
1640 .smd_int.irq_id = -1,
1641 .smd_int.device_name = "smd_dev",
1642 .smd_int.dev_id = 0,
1643 .smd_int.out_bit_pos = 1,
1644 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1645 .smd_int.out_offset = 0x4080,
1646
1647 .smsm_int.irq_name = "dsps_a11_smsm",
1648 .smsm_int.flags = IRQF_TRIGGER_RISING,
1649 .smsm_int.irq_id = -1,
1650 .smsm_int.device_name = "smd_smsm",
1651 .smsm_int.dev_id = 0,
1652 .smsm_int.out_bit_pos = 1,
1653 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1654 .smsm_int.out_offset = 0x4094,
1655 },
1656 {
1657 .irq_config_id = SMD_WCNSS,
1658 .subsys_name = "wcnss",
1659 .edge = SMD_APPS_WCNSS,
1660
1661 .smd_int.irq_name = "wcnss_a11",
1662 .smd_int.flags = IRQF_TRIGGER_RISING,
1663 .smd_int.irq_id = -1,
1664 .smd_int.device_name = "smd_dev",
1665 .smd_int.dev_id = 0,
1666 .smd_int.out_bit_pos = 1 << 25,
1667 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1668 .smd_int.out_offset = 0x8,
1669
1670 .smsm_int.irq_name = "wcnss_a11_smsm",
1671 .smsm_int.flags = IRQF_TRIGGER_RISING,
1672 .smsm_int.irq_id = -1,
1673 .smsm_int.device_name = "smd_smsm",
1674 .smsm_int.dev_id = 0,
1675 .smsm_int.out_bit_pos = 1 << 23,
1676 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1677 .smsm_int.out_offset = 0x8,
1678 },
1679};
1680
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001681static struct smd_subsystem_restart_config smd_ssr_config = {
1682 .disable_smsm_reset_handshake = 1,
1683};
1684
Eric Holmberg023d25c2012-03-01 12:27:55 -07001685static struct smd_platform smd_platform_data = {
1686 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1687 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001688 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001689};
1690
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001691struct platform_device msm_device_smd = {
1692 .name = "msm_smd",
1693 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001694 .resource = smd_resource,
1695 .num_resources = ARRAY_SIZE(smd_resource),
1696 .dev = {
1697 .platform_data = &smd_platform_data,
1698 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001699};
1700
1701struct platform_device msm_device_bam_dmux = {
1702 .name = "BAM_RMNT",
1703 .id = -1,
1704};
1705
Anji Jonnalaf91d8972013-02-26 17:55:50 +05301706static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
1707 .base_addr = MSM_ACC0_BASE + 0x08,
1708 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
1709 .mask = 1UL << 13,
1710};
1711struct platform_device msm8960_cpu_slp_status = {
1712 .name = "cpu_slp_status",
1713 .id = -1,
1714 .dev = {
1715 .platform_data = &msm_pm_slp_sts_data,
1716 },
1717};
1718
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001719static struct msm_watchdog_pdata msm_watchdog_pdata = {
1720 .pet_time = 10000,
1721 .bark_time = 11000,
1722 .has_secure = true,
Rohit Vaswanic77e4a62012-08-09 18:10:28 -07001723 .base = MSM_TMR0_BASE + WDT0_OFFSET,
1724};
1725
1726static struct resource msm_watchdog_resources[] = {
1727 {
1728 .start = WDT0_ACCSCSSNBARK_INT,
1729 .end = WDT0_ACCSCSSNBARK_INT,
1730 .flags = IORESOURCE_IRQ,
1731 },
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001732};
1733
1734struct platform_device msm8960_device_watchdog = {
1735 .name = "msm_watchdog",
1736 .id = -1,
1737 .dev = {
1738 .platform_data = &msm_watchdog_pdata,
1739 },
Rohit Vaswanic77e4a62012-08-09 18:10:28 -07001740 .num_resources = ARRAY_SIZE(msm_watchdog_resources),
1741 .resource = msm_watchdog_resources,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001742};
1743
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001744static struct resource msm_dmov_resource[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001745 {
1746 .start = ADM_0_SCSS_1_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001747 .flags = IORESOURCE_IRQ,
1748 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001749 {
1750 .start = 0x18320000,
1751 .end = 0x18320000 + SZ_1M - 1,
1752 .flags = IORESOURCE_MEM,
1753 },
1754};
1755
1756static struct msm_dmov_pdata msm_dmov_pdata = {
1757 .sd = 1,
1758 .sd_size = 0x800,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001759};
1760
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07001761struct platform_device msm8960_device_dmov = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001762 .name = "msm_dmov",
1763 .id = -1,
1764 .resource = msm_dmov_resource,
1765 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -07001766 .dev = {
1767 .platform_data = &msm_dmov_pdata,
1768 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001769};
1770
1771static struct platform_device *msm_sdcc_devices[] __initdata = {
1772 &msm_device_sdc1,
1773 &msm_device_sdc2,
1774 &msm_device_sdc3,
1775 &msm_device_sdc4,
1776 &msm_device_sdc5,
1777};
1778
1779int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1780{
1781 struct platform_device *pdev;
1782
1783 if (controller < 1 || controller > 5)
1784 return -EINVAL;
1785
1786 pdev = msm_sdcc_devices[controller-1];
1787 pdev->dev.platform_data = plat;
1788 return platform_device_register(pdev);
1789}
1790
1791static struct resource resources_qup_i2c_gsbi4[] = {
1792 {
1793 .name = "gsbi_qup_i2c_addr",
1794 .start = MSM_GSBI4_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001795 .end = MSM_GSBI4_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001796 .flags = IORESOURCE_MEM,
1797 },
1798 {
1799 .name = "qup_phys_addr",
1800 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001801 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001802 .flags = IORESOURCE_MEM,
1803 },
1804 {
1805 .name = "qup_err_intr",
1806 .start = GSBI4_QUP_IRQ,
1807 .end = GSBI4_QUP_IRQ,
1808 .flags = IORESOURCE_IRQ,
1809 },
1810};
1811
1812struct platform_device msm8960_device_qup_i2c_gsbi4 = {
1813 .name = "qup_i2c",
1814 .id = 4,
1815 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
1816 .resource = resources_qup_i2c_gsbi4,
1817};
1818
1819static struct resource resources_qup_i2c_gsbi3[] = {
1820 {
1821 .name = "gsbi_qup_i2c_addr",
1822 .start = MSM_GSBI3_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001823 .end = MSM_GSBI3_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001824 .flags = IORESOURCE_MEM,
1825 },
1826 {
1827 .name = "qup_phys_addr",
1828 .start = MSM_GSBI3_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001829 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001830 .flags = IORESOURCE_MEM,
1831 },
1832 {
1833 .name = "qup_err_intr",
1834 .start = GSBI3_QUP_IRQ,
1835 .end = GSBI3_QUP_IRQ,
1836 .flags = IORESOURCE_IRQ,
1837 },
1838};
1839
1840struct platform_device msm8960_device_qup_i2c_gsbi3 = {
1841 .name = "qup_i2c",
1842 .id = 3,
1843 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
1844 .resource = resources_qup_i2c_gsbi3,
1845};
1846
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06001847static struct resource resources_qup_i2c_gsbi9[] = {
1848 {
1849 .name = "gsbi_qup_i2c_addr",
1850 .start = MSM_GSBI9_PHYS,
1851 .end = MSM_GSBI9_PHYS + 4 - 1,
1852 .flags = IORESOURCE_MEM,
1853 },
1854 {
1855 .name = "qup_phys_addr",
1856 .start = MSM_GSBI9_QUP_PHYS,
1857 .end = MSM_GSBI9_QUP_PHYS + MSM_QUP_SIZE - 1,
1858 .flags = IORESOURCE_MEM,
1859 },
1860 {
1861 .name = "qup_err_intr",
1862 .start = GSBI9_QUP_IRQ,
1863 .end = GSBI9_QUP_IRQ,
1864 .flags = IORESOURCE_IRQ,
1865 },
1866};
1867
1868struct platform_device msm8960_device_qup_i2c_gsbi9 = {
1869 .name = "qup_i2c",
1870 .id = 0,
1871 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi9),
1872 .resource = resources_qup_i2c_gsbi9,
1873};
1874
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001875static struct resource resources_qup_i2c_gsbi10[] = {
1876 {
1877 .name = "gsbi_qup_i2c_addr",
1878 .start = MSM_GSBI10_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001879 .end = MSM_GSBI10_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001880 .flags = IORESOURCE_MEM,
1881 },
1882 {
1883 .name = "qup_phys_addr",
1884 .start = MSM_GSBI10_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001885 .end = MSM_GSBI10_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001886 .flags = IORESOURCE_MEM,
1887 },
1888 {
1889 .name = "qup_err_intr",
1890 .start = GSBI10_QUP_IRQ,
1891 .end = GSBI10_QUP_IRQ,
1892 .flags = IORESOURCE_IRQ,
1893 },
1894};
1895
1896struct platform_device msm8960_device_qup_i2c_gsbi10 = {
1897 .name = "qup_i2c",
1898 .id = 10,
1899 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi10),
1900 .resource = resources_qup_i2c_gsbi10,
1901};
1902
1903static struct resource resources_qup_i2c_gsbi12[] = {
1904 {
1905 .name = "gsbi_qup_i2c_addr",
1906 .start = MSM_GSBI12_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001907 .end = MSM_GSBI12_PHYS + 4 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001908 .flags = IORESOURCE_MEM,
1909 },
1910 {
1911 .name = "qup_phys_addr",
1912 .start = MSM_GSBI12_QUP_PHYS,
Harini Jayaramand7614a72011-09-15 14:16:02 -06001913 .end = MSM_GSBI12_QUP_PHYS + MSM_QUP_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001914 .flags = IORESOURCE_MEM,
1915 },
1916 {
1917 .name = "qup_err_intr",
1918 .start = GSBI12_QUP_IRQ,
1919 .end = GSBI12_QUP_IRQ,
1920 .flags = IORESOURCE_IRQ,
1921 },
1922};
1923
1924struct platform_device msm8960_device_qup_i2c_gsbi12 = {
1925 .name = "qup_i2c",
1926 .id = 12,
1927 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi12),
1928 .resource = resources_qup_i2c_gsbi12,
1929};
1930
1931#ifdef CONFIG_MSM_CAMERA
Kevin Chanbb8ef862012-02-14 13:03:04 -08001932static struct resource msm_cam_gsbi4_i2c_mux_resources[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001933 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001934 .name = "i2c_mux_rw",
Nishant Pandit24153d82011-08-27 16:05:13 +05301935 .start = 0x008003E0,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001936 .end = 0x008003E0 + SZ_8 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301937 .flags = IORESOURCE_MEM,
1938 },
1939 {
Kevin Chanbb8ef862012-02-14 13:03:04 -08001940 .name = "i2c_mux_ctl",
Nishant Pandit24153d82011-08-27 16:05:13 +05301941 .start = 0x008020B8,
Kevin Chanbb8ef862012-02-14 13:03:04 -08001942 .end = 0x008020B8 + SZ_4 - 1,
Nishant Pandit24153d82011-08-27 16:05:13 +05301943 .flags = IORESOURCE_MEM,
1944 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001945};
1946
Kevin Chanbb8ef862012-02-14 13:03:04 -08001947struct platform_device msm8960_device_i2c_mux_gsbi4 = {
1948 .name = "msm_cam_i2c_mux",
1949 .id = 0,
1950 .resource = msm_cam_gsbi4_i2c_mux_resources,
1951 .num_resources = ARRAY_SIZE(msm_cam_gsbi4_i2c_mux_resources),
1952};
Kevin Chanf6216f22011-10-25 18:40:11 -07001953
1954static struct resource msm_csiphy0_resources[] = {
1955 {
1956 .name = "csiphy",
1957 .start = 0x04800C00,
1958 .end = 0x04800C00 + SZ_1K - 1,
1959 .flags = IORESOURCE_MEM,
1960 },
1961 {
1962 .name = "csiphy",
1963 .start = CSIPHY_4LN_IRQ,
1964 .end = CSIPHY_4LN_IRQ,
1965 .flags = IORESOURCE_IRQ,
1966 },
1967};
1968
1969static struct resource msm_csiphy1_resources[] = {
1970 {
1971 .name = "csiphy",
1972 .start = 0x04801000,
1973 .end = 0x04801000 + SZ_1K - 1,
1974 .flags = IORESOURCE_MEM,
1975 },
1976 {
1977 .name = "csiphy",
1978 .start = MSM8960_CSIPHY_2LN_IRQ,
1979 .end = MSM8960_CSIPHY_2LN_IRQ,
1980 .flags = IORESOURCE_IRQ,
1981 },
1982};
1983
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08001984static struct resource msm_csiphy2_resources[] = {
1985 {
1986 .name = "csiphy",
1987 .start = 0x04801400,
1988 .end = 0x04801400 + SZ_1K - 1,
1989 .flags = IORESOURCE_MEM,
1990 },
1991 {
1992 .name = "csiphy",
1993 .start = MSM8960_CSIPHY_2_2LN_IRQ,
1994 .end = MSM8960_CSIPHY_2_2LN_IRQ,
1995 .flags = IORESOURCE_IRQ,
1996 },
1997};
1998
Kevin Chanf6216f22011-10-25 18:40:11 -07001999struct platform_device msm8960_device_csiphy0 = {
2000 .name = "msm_csiphy",
2001 .id = 0,
2002 .resource = msm_csiphy0_resources,
2003 .num_resources = ARRAY_SIZE(msm_csiphy0_resources),
2004};
2005
2006struct platform_device msm8960_device_csiphy1 = {
2007 .name = "msm_csiphy",
2008 .id = 1,
2009 .resource = msm_csiphy1_resources,
2010 .num_resources = ARRAY_SIZE(msm_csiphy1_resources),
2011};
Kevin Chanc8b52e82011-10-25 23:20:21 -07002012
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08002013struct platform_device msm8960_device_csiphy2 = {
2014 .name = "msm_csiphy",
2015 .id = 2,
2016 .resource = msm_csiphy2_resources,
2017 .num_resources = ARRAY_SIZE(msm_csiphy2_resources),
2018};
2019
Kevin Chanc8b52e82011-10-25 23:20:21 -07002020static struct resource msm_csid0_resources[] = {
2021 {
2022 .name = "csid",
2023 .start = 0x04800000,
2024 .end = 0x04800000 + SZ_1K - 1,
2025 .flags = IORESOURCE_MEM,
2026 },
2027 {
2028 .name = "csid",
2029 .start = CSI_0_IRQ,
2030 .end = CSI_0_IRQ,
2031 .flags = IORESOURCE_IRQ,
2032 },
2033};
2034
2035static struct resource msm_csid1_resources[] = {
2036 {
2037 .name = "csid",
2038 .start = 0x04800400,
2039 .end = 0x04800400 + SZ_1K - 1,
2040 .flags = IORESOURCE_MEM,
2041 },
2042 {
2043 .name = "csid",
2044 .start = CSI_1_IRQ,
2045 .end = CSI_1_IRQ,
2046 .flags = IORESOURCE_IRQ,
2047 },
2048};
2049
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08002050static struct resource msm_csid2_resources[] = {
2051 {
2052 .name = "csid",
2053 .start = 0x04801800,
2054 .end = 0x04801800 + SZ_1K - 1,
2055 .flags = IORESOURCE_MEM,
2056 },
2057 {
2058 .name = "csid",
2059 .start = CSI_2_IRQ,
2060 .end = CSI_2_IRQ,
2061 .flags = IORESOURCE_IRQ,
2062 },
2063};
2064
Kevin Chanc8b52e82011-10-25 23:20:21 -07002065struct platform_device msm8960_device_csid0 = {
2066 .name = "msm_csid",
2067 .id = 0,
2068 .resource = msm_csid0_resources,
2069 .num_resources = ARRAY_SIZE(msm_csid0_resources),
2070};
2071
2072struct platform_device msm8960_device_csid1 = {
2073 .name = "msm_csid",
2074 .id = 1,
2075 .resource = msm_csid1_resources,
2076 .num_resources = ARRAY_SIZE(msm_csid1_resources),
2077};
Kevin Chane12c6672011-10-26 11:55:26 -07002078
Sreesudhan Ramakrish Ramkumarb1edcd02012-01-17 11:33:05 -08002079struct platform_device msm8960_device_csid2 = {
2080 .name = "msm_csid",
2081 .id = 2,
2082 .resource = msm_csid2_resources,
2083 .num_resources = ARRAY_SIZE(msm_csid2_resources),
2084};
2085
Kevin Chane12c6672011-10-26 11:55:26 -07002086struct resource msm_ispif_resources[] = {
2087 {
2088 .name = "ispif",
2089 .start = 0x04800800,
2090 .end = 0x04800800 + SZ_1K - 1,
2091 .flags = IORESOURCE_MEM,
2092 },
2093 {
2094 .name = "ispif",
2095 .start = ISPIF_IRQ,
2096 .end = ISPIF_IRQ,
2097 .flags = IORESOURCE_IRQ,
2098 },
2099};
2100
2101struct platform_device msm8960_device_ispif = {
2102 .name = "msm_ispif",
2103 .id = 0,
2104 .resource = msm_ispif_resources,
2105 .num_resources = ARRAY_SIZE(msm_ispif_resources),
2106};
Kevin Chan5827c552011-10-28 18:36:32 -07002107
2108static struct resource msm_vfe_resources[] = {
2109 {
2110 .name = "vfe32",
2111 .start = 0x04500000,
2112 .end = 0x04500000 + SZ_1M - 1,
2113 .flags = IORESOURCE_MEM,
2114 },
2115 {
2116 .name = "vfe32",
2117 .start = VFE_IRQ,
2118 .end = VFE_IRQ,
2119 .flags = IORESOURCE_IRQ,
2120 },
2121};
2122
2123struct platform_device msm8960_device_vfe = {
2124 .name = "msm_vfe",
2125 .id = 0,
2126 .resource = msm_vfe_resources,
2127 .num_resources = ARRAY_SIZE(msm_vfe_resources),
2128};
Kevin Chana0853122011-11-07 19:48:44 -08002129
2130static struct resource msm_vpe_resources[] = {
2131 {
2132 .name = "vpe",
2133 .start = 0x05300000,
2134 .end = 0x05300000 + SZ_1M - 1,
2135 .flags = IORESOURCE_MEM,
2136 },
2137 {
2138 .name = "vpe",
2139 .start = VPE_IRQ,
2140 .end = VPE_IRQ,
2141 .flags = IORESOURCE_IRQ,
2142 },
2143};
2144
2145struct platform_device msm8960_device_vpe = {
2146 .name = "msm_vpe",
2147 .id = 0,
2148 .resource = msm_vpe_resources,
2149 .num_resources = ARRAY_SIZE(msm_vpe_resources),
2150};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002151#endif
2152
Joel Nidera1261942011-09-12 16:30:09 +03002153#define MSM_TSIF0_PHYS (0x18200000)
2154#define MSM_TSIF1_PHYS (0x18201000)
2155#define MSM_TSIF_SIZE (0x200)
2156
2157#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
2158 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2159#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
2160 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2161#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
2162 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2163#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
2164 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2165#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
2166 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2167#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
2168 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2169#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
2170 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2171#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
2172 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
2173
2174static const struct msm_gpio tsif0_gpios[] = {
2175 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
2176 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
2177 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
2178 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
2179};
2180
2181static const struct msm_gpio tsif1_gpios[] = {
2182 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
2183 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
2184 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
2185 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
2186};
2187
2188struct msm_tsif_platform_data tsif1_platform_data = {
2189 .num_gpios = ARRAY_SIZE(tsif1_gpios),
2190 .gpios = tsif1_gpios,
Joel Niderdfb793b2012-06-27 12:00:22 +03002191 .tsif_pclk = "iface_clk",
2192 .tsif_ref_clk = "ref_clk",
Joel Nidera1261942011-09-12 16:30:09 +03002193};
2194
2195struct resource tsif1_resources[] = {
2196 [0] = {
2197 .flags = IORESOURCE_IRQ,
2198 .start = TSIF2_IRQ,
2199 .end = TSIF2_IRQ,
2200 },
2201 [1] = {
2202 .flags = IORESOURCE_MEM,
2203 .start = MSM_TSIF1_PHYS,
2204 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
2205 },
2206 [2] = {
2207 .flags = IORESOURCE_DMA,
2208 .start = DMOV_TSIF_CHAN,
2209 .end = DMOV_TSIF_CRCI,
2210 },
2211};
2212
2213struct msm_tsif_platform_data tsif0_platform_data = {
2214 .num_gpios = ARRAY_SIZE(tsif0_gpios),
2215 .gpios = tsif0_gpios,
Joel Niderdfb793b2012-06-27 12:00:22 +03002216 .tsif_pclk = "iface_clk",
2217 .tsif_ref_clk = "ref_clk",
Joel Nidera1261942011-09-12 16:30:09 +03002218};
2219struct resource tsif0_resources[] = {
2220 [0] = {
2221 .flags = IORESOURCE_IRQ,
2222 .start = TSIF1_IRQ,
2223 .end = TSIF1_IRQ,
2224 },
2225 [1] = {
2226 .flags = IORESOURCE_MEM,
2227 .start = MSM_TSIF0_PHYS,
2228 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
2229 },
2230 [2] = {
2231 .flags = IORESOURCE_DMA,
2232 .start = DMOV_TSIF_CHAN,
2233 .end = DMOV_TSIF_CRCI,
2234 },
2235};
2236
2237struct platform_device msm_device_tsif[2] = {
2238 {
2239 .name = "msm_tsif",
2240 .id = 0,
2241 .num_resources = ARRAY_SIZE(tsif0_resources),
2242 .resource = tsif0_resources,
2243 .dev = {
2244 .platform_data = &tsif0_platform_data
2245 },
2246 },
2247 {
2248 .name = "msm_tsif",
2249 .id = 1,
2250 .num_resources = ARRAY_SIZE(tsif1_resources),
2251 .resource = tsif1_resources,
2252 .dev = {
2253 .platform_data = &tsif1_platform_data
2254 },
2255 }
2256};
2257
Jay Chokshi33c044a2011-12-07 13:05:40 -08002258static struct resource resources_ssbi_pmic[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002259 {
2260 .start = MSM_PMIC1_SSBI_CMD_PHYS,
2261 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
2262 .flags = IORESOURCE_MEM,
2263 },
2264};
2265
Jay Chokshi33c044a2011-12-07 13:05:40 -08002266struct platform_device msm8960_device_ssbi_pmic = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002267 .name = "msm_ssbi",
2268 .id = 0,
Jay Chokshi33c044a2011-12-07 13:05:40 -08002269 .resource = resources_ssbi_pmic,
2270 .num_resources = ARRAY_SIZE(resources_ssbi_pmic),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002271};
2272
2273static struct resource resources_qup_spi_gsbi1[] = {
2274 {
2275 .name = "spi_base",
2276 .start = MSM_GSBI1_QUP_PHYS,
2277 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
2278 .flags = IORESOURCE_MEM,
2279 },
2280 {
2281 .name = "gsbi_base",
2282 .start = MSM_GSBI1_PHYS,
2283 .end = MSM_GSBI1_PHYS + 4 - 1,
2284 .flags = IORESOURCE_MEM,
2285 },
2286 {
2287 .name = "spi_irq_in",
2288 .start = MSM8960_GSBI1_QUP_IRQ,
2289 .end = MSM8960_GSBI1_QUP_IRQ,
2290 .flags = IORESOURCE_IRQ,
2291 },
Harini Jayaramanaac8e342011-08-09 19:25:23 -06002292 {
2293 .name = "spi_clk",
2294 .start = 9,
2295 .end = 9,
2296 .flags = IORESOURCE_IO,
2297 },
2298 {
Harini Jayaramanaac8e342011-08-09 19:25:23 -06002299 .name = "spi_miso",
2300 .start = 7,
2301 .end = 7,
2302 .flags = IORESOURCE_IO,
2303 },
2304 {
2305 .name = "spi_mosi",
2306 .start = 6,
2307 .end = 6,
2308 .flags = IORESOURCE_IO,
2309 },
Harini Jayaraman8392e432011-11-29 18:26:17 -07002310 {
2311 .name = "spi_cs",
2312 .start = 8,
2313 .end = 8,
2314 .flags = IORESOURCE_IO,
2315 },
2316 {
2317 .name = "spi_cs1",
2318 .start = 14,
2319 .end = 14,
2320 .flags = IORESOURCE_IO,
2321 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002322};
2323
2324struct platform_device msm8960_device_qup_spi_gsbi1 = {
2325 .name = "spi_qsd",
2326 .id = 0,
2327 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi1),
2328 .resource = resources_qup_spi_gsbi1,
2329};
2330
2331struct platform_device msm_pcm = {
2332 .name = "msm-pcm-dsp",
2333 .id = -1,
2334};
2335
Kiran Kandi5e809b02012-01-31 00:24:33 -08002336struct platform_device msm_multi_ch_pcm = {
2337 .name = "msm-multi-ch-pcm-dsp",
2338 .id = -1,
2339};
2340
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -07002341struct platform_device msm_lowlatency_pcm = {
2342 .name = "msm-lowlatency-pcm-dsp",
2343 .id = -1,
2344};
2345
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002346struct platform_device msm_pcm_routing = {
2347 .name = "msm-pcm-routing",
2348 .id = -1,
2349};
2350
2351struct platform_device msm_cpudai0 = {
2352 .name = "msm-dai-q6",
2353 .id = 0x4000,
2354};
2355
2356struct platform_device msm_cpudai1 = {
2357 .name = "msm-dai-q6",
2358 .id = 0x4001,
2359};
2360
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002361struct platform_device msm8960_cpudai_slimbus_2_rx = {
2362 .name = "msm-dai-q6",
2363 .id = 0x4004,
2364};
2365
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002366struct platform_device msm8960_cpudai_slimbus_2_tx = {
2367 .name = "msm-dai-q6",
2368 .id = 0x4005,
2369};
2370
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002371struct platform_device msm_cpudai_hdmi_rx = {
Kiran Kandi5e809b02012-01-31 00:24:33 -08002372 .name = "msm-dai-q6-hdmi",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002373 .id = 8,
2374};
2375
2376struct platform_device msm_cpudai_bt_rx = {
2377 .name = "msm-dai-q6",
2378 .id = 0x3000,
2379};
2380
2381struct platform_device msm_cpudai_bt_tx = {
2382 .name = "msm-dai-q6",
2383 .id = 0x3001,
2384};
2385
2386struct platform_device msm_cpudai_fm_rx = {
2387 .name = "msm-dai-q6",
2388 .id = 0x3004,
2389};
2390
2391struct platform_device msm_cpudai_fm_tx = {
2392 .name = "msm-dai-q6",
2393 .id = 0x3005,
2394};
2395
Helen Zeng0705a5f2011-10-14 15:29:52 -07002396struct platform_device msm_cpudai_incall_music_rx = {
2397 .name = "msm-dai-q6",
2398 .id = 0x8005,
2399};
2400
Helen Zenge3d716a2011-10-14 16:32:16 -07002401struct platform_device msm_cpudai_incall_record_rx = {
2402 .name = "msm-dai-q6",
2403 .id = 0x8004,
2404};
2405
2406struct platform_device msm_cpudai_incall_record_tx = {
2407 .name = "msm-dai-q6",
2408 .id = 0x8003,
2409};
2410
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002411/*
2412 * Machine specific data for AUX PCM Interface
2413 * which the driver will be unware of.
2414 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -08002415struct msm_dai_auxpcm_pdata auxpcm_pdata = {
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002416 .clk = "pcm_clk",
Kuirong Wang547a9982012-05-04 18:29:11 -07002417 .mode_8k = {
2418 .mode = AFE_PCM_CFG_MODE_PCM,
2419 .sync = AFE_PCM_CFG_SYNC_INT,
Damir Didjusto08d2aa52012-08-17 00:16:07 -07002420 .frame = AFE_PCM_CFG_FRM_32BPF,
Kuirong Wang547a9982012-05-04 18:29:11 -07002421 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
2422 .slot = 0,
2423 .data = AFE_PCM_CFG_CDATAOE_MASTER,
Damir Didjusto08d2aa52012-08-17 00:16:07 -07002424 .pcm_clk_rate = 256000,
Kuirong Wang547a9982012-05-04 18:29:11 -07002425 },
2426 .mode_16k = {
2427 .mode = AFE_PCM_CFG_MODE_PCM,
2428 .sync = AFE_PCM_CFG_SYNC_INT,
Damir Didjusto08d2aa52012-08-17 00:16:07 -07002429 .frame = AFE_PCM_CFG_FRM_32BPF,
Kuirong Wang547a9982012-05-04 18:29:11 -07002430 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
2431 .slot = 0,
2432 .data = AFE_PCM_CFG_CDATAOE_MASTER,
Damir Didjusto08d2aa52012-08-17 00:16:07 -07002433 .pcm_clk_rate = 512000,
Kuirong Wang547a9982012-05-04 18:29:11 -07002434 }
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002435};
2436
2437struct platform_device msm_cpudai_auxpcm_rx = {
2438 .name = "msm-dai-q6",
2439 .id = 2,
2440 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -08002441 .platform_data = &auxpcm_pdata,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002442 },
2443};
2444
2445struct platform_device msm_cpudai_auxpcm_tx = {
2446 .name = "msm-dai-q6",
2447 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -08002448 .dev = {
2449 .platform_data = &auxpcm_pdata,
2450 },
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002451};
2452
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002453struct platform_device msm_cpu_fe = {
2454 .name = "msm-dai-fe",
2455 .id = -1,
2456};
2457
2458struct platform_device msm_stub_codec = {
2459 .name = "msm-stub-codec",
2460 .id = 1,
2461};
2462
2463struct platform_device msm_voice = {
2464 .name = "msm-pcm-voice",
2465 .id = -1,
2466};
2467
2468struct platform_device msm_voip = {
2469 .name = "msm-voip-dsp",
2470 .id = -1,
2471};
2472
2473struct platform_device msm_lpa_pcm = {
2474 .name = "msm-pcm-lpa",
2475 .id = -1,
2476};
2477
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302478struct platform_device msm_compr_dsp = {
2479 .name = "msm-compr-dsp",
2480 .id = -1,
2481};
2482
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002483struct platform_device msm_pcm_hostless = {
2484 .name = "msm-pcm-hostless",
2485 .id = -1,
2486};
2487
Laxminath Kasamcee1d602011-08-01 19:26:57 +05302488struct platform_device msm_cpudai_afe_01_rx = {
2489 .name = "msm-dai-q6",
2490 .id = 0xE0,
2491};
2492
2493struct platform_device msm_cpudai_afe_01_tx = {
2494 .name = "msm-dai-q6",
2495 .id = 0xF0,
2496};
2497
2498struct platform_device msm_cpudai_afe_02_rx = {
2499 .name = "msm-dai-q6",
2500 .id = 0xF1,
2501};
2502
2503struct platform_device msm_cpudai_afe_02_tx = {
2504 .name = "msm-dai-q6",
2505 .id = 0xE1,
2506};
2507
2508struct platform_device msm_pcm_afe = {
2509 .name = "msm-pcm-afe",
2510 .id = -1,
2511};
2512
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002513static struct fs_driver_data gfx2d0_fs_data = {
2514 .clks = (struct fs_clk_data[]){
2515 { .name = "core_clk" },
2516 { .name = "iface_clk" },
2517 { 0 }
2518 },
2519 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002520};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002521
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002522static struct fs_driver_data gfx2d1_fs_data = {
2523 .clks = (struct fs_clk_data[]){
2524 { .name = "core_clk" },
2525 { .name = "iface_clk" },
2526 { 0 }
2527 },
2528 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
2529};
2530
2531static struct fs_driver_data gfx3d_fs_data = {
2532 .clks = (struct fs_clk_data[]){
2533 { .name = "core_clk", .reset_rate = 27000000 },
2534 { .name = "iface_clk" },
2535 { 0 }
2536 },
2537 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2538};
2539
Stephen Boyd9071e512012-12-05 14:01:17 -08002540static struct fs_driver_data gfx3d_fs_data_8960ab = {
2541 .clks = (struct fs_clk_data[]){
2542 { .name = "core_clk", .reset_rate = 27000000 },
2543 { .name = "iface_clk" },
2544 { .name = "bus_clk" },
2545 { 0 }
2546 },
2547 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2548 .bus_port1 = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
2549};
2550
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002551static struct fs_driver_data ijpeg_fs_data = {
2552 .clks = (struct fs_clk_data[]){
2553 { .name = "core_clk" },
2554 { .name = "iface_clk" },
2555 { .name = "bus_clk" },
2556 { 0 }
2557 },
2558 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2559};
2560
2561static struct fs_driver_data mdp_fs_data = {
2562 .clks = (struct fs_clk_data[]){
2563 { .name = "core_clk" },
2564 { .name = "iface_clk" },
2565 { .name = "bus_clk" },
2566 { .name = "vsync_clk" },
2567 { .name = "lut_clk" },
2568 { .name = "tv_src_clk" },
2569 { .name = "tv_clk" },
Matt Wagantallc33c1ed2012-07-23 17:19:08 -07002570 { .name = "reset1_clk" },
2571 { .name = "reset2_clk" },
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002572 { 0 }
2573 },
2574 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2575 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2576};
2577
2578static struct fs_driver_data rot_fs_data = {
2579 .clks = (struct fs_clk_data[]){
2580 { .name = "core_clk" },
2581 { .name = "iface_clk" },
2582 { .name = "bus_clk" },
2583 { 0 }
2584 },
2585 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2586};
2587
2588static struct fs_driver_data ved_fs_data = {
2589 .clks = (struct fs_clk_data[]){
2590 { .name = "core_clk" },
2591 { .name = "iface_clk" },
2592 { .name = "bus_clk" },
2593 { 0 }
2594 },
2595 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
2596 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
2597};
2598
Matt Wagantall231cb1b2012-11-09 16:03:59 -08002599static struct fs_driver_data ved_fs_data_8960ab = {
2600 .clks = (struct fs_clk_data[]){
2601 { .name = "core_clk" },
2602 { .name = "iface_clk" },
2603 { .name = "bus_clk" },
2604 { 0 }
2605 },
2606 .bus_port0 = MSM_BUS_MASTER_VIDEO_DEC,
2607 .bus_port1 = MSM_BUS_MASTER_VIDEO_ENC,
2608};
2609
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002610static struct fs_driver_data vfe_fs_data = {
2611 .clks = (struct fs_clk_data[]){
2612 { .name = "core_clk" },
2613 { .name = "iface_clk" },
2614 { .name = "bus_clk" },
2615 { 0 }
2616 },
2617 .bus_port0 = MSM_BUS_MASTER_VFE,
2618};
2619
2620static struct fs_driver_data vpe_fs_data = {
2621 .clks = (struct fs_clk_data[]){
2622 { .name = "core_clk" },
2623 { .name = "iface_clk" },
2624 { .name = "bus_clk" },
2625 { 0 }
2626 },
2627 .bus_port0 = MSM_BUS_MASTER_VPE,
2628};
2629
2630struct platform_device *msm8960_footswitch[] __initdata = {
Matt Wagantalld4aab1e2012-05-03 20:26:56 -07002631 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07002632 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -07002633 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07002634 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
2635 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002636 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
2637 FS_8X60(FS_GFX2D0, "vdd", "kgsl-2d0.0", &gfx2d0_fs_data),
2638 FS_8X60(FS_GFX2D1, "vdd", "kgsl-2d1.1", &gfx2d1_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002639 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002640};
2641unsigned msm8960_num_footswitch __initdata = ARRAY_SIZE(msm8960_footswitch);
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002642
Stephen Boyd913c29d2012-10-25 11:46:04 -07002643struct platform_device *msm8960ab_footswitch[] __initdata = {
2644 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
2645 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
2646 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
2647 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
2648 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Stephen Boyd9071e512012-12-05 14:01:17 -08002649 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data_8960ab),
Matt Wagantall231cb1b2012-11-09 16:03:59 -08002650 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data_8960ab),
Stephen Boyd913c29d2012-10-25 11:46:04 -07002651};
2652unsigned msm8960ab_num_footswitch __initdata = ARRAY_SIZE(msm8960ab_footswitch);
2653
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002654#ifdef CONFIG_MSM_ROTATOR
Ravishangar Kalyanam319a83c2012-03-21 18:38:05 -07002655static struct msm_bus_vectors rotator_init_vectors[] = {
2656 {
2657 .src = MSM_BUS_MASTER_ROTATOR,
2658 .dst = MSM_BUS_SLAVE_EBI_CH0,
2659 .ab = 0,
2660 .ib = 0,
2661 },
2662};
2663
2664static struct msm_bus_vectors rotator_ui_vectors[] = {
2665 {
2666 .src = MSM_BUS_MASTER_ROTATOR,
2667 .dst = MSM_BUS_SLAVE_EBI_CH0,
2668 .ab = (1024 * 600 * 4 * 2 * 60),
2669 .ib = (1024 * 600 * 4 * 2 * 60 * 1.5),
2670 },
2671};
2672
2673static struct msm_bus_vectors rotator_vga_vectors[] = {
2674 {
2675 .src = MSM_BUS_MASTER_ROTATOR,
2676 .dst = MSM_BUS_SLAVE_EBI_CH0,
2677 .ab = (640 * 480 * 2 * 2 * 30),
2678 .ib = (640 * 480 * 2 * 2 * 30 * 1.5),
2679 },
2680};
2681static struct msm_bus_vectors rotator_720p_vectors[] = {
2682 {
2683 .src = MSM_BUS_MASTER_ROTATOR,
2684 .dst = MSM_BUS_SLAVE_EBI_CH0,
2685 .ab = (1280 * 736 * 2 * 2 * 30),
2686 .ib = (1280 * 736 * 2 * 2 * 30 * 1.5),
2687 },
2688};
2689
2690static struct msm_bus_vectors rotator_1080p_vectors[] = {
2691 {
2692 .src = MSM_BUS_MASTER_ROTATOR,
2693 .dst = MSM_BUS_SLAVE_EBI_CH0,
2694 .ab = (1920 * 1088 * 2 * 2 * 30),
2695 .ib = (1920 * 1088 * 2 * 2 * 30 * 1.5),
2696 },
2697};
2698
2699static struct msm_bus_paths rotator_bus_scale_usecases[] = {
2700 {
2701 ARRAY_SIZE(rotator_init_vectors),
2702 rotator_init_vectors,
2703 },
2704 {
2705 ARRAY_SIZE(rotator_ui_vectors),
2706 rotator_ui_vectors,
2707 },
2708 {
2709 ARRAY_SIZE(rotator_vga_vectors),
2710 rotator_vga_vectors,
2711 },
2712 {
2713 ARRAY_SIZE(rotator_720p_vectors),
2714 rotator_720p_vectors,
2715 },
2716 {
2717 ARRAY_SIZE(rotator_1080p_vectors),
2718 rotator_1080p_vectors,
2719 },
2720};
2721
2722struct msm_bus_scale_pdata rotator_bus_scale_pdata = {
2723 rotator_bus_scale_usecases,
2724 ARRAY_SIZE(rotator_bus_scale_usecases),
2725 .name = "rotator",
2726};
2727
2728void __init msm_rotator_update_bus_vectors(unsigned int xres,
2729 unsigned int yres)
2730{
2731 rotator_ui_vectors[0].ab = xres * yres * 4 * 2 * 60;
2732 rotator_ui_vectors[0].ib = xres * yres * 4 * 2 * 60 * 3 / 2;
2733}
2734
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002735#define ROTATOR_HW_BASE 0x04E00000
2736static struct resource resources_msm_rotator[] = {
2737 {
2738 .start = ROTATOR_HW_BASE,
2739 .end = ROTATOR_HW_BASE + 0x100000 - 1,
2740 .flags = IORESOURCE_MEM,
2741 },
2742 {
2743 .start = ROT_IRQ,
2744 .end = ROT_IRQ,
2745 .flags = IORESOURCE_IRQ,
2746 },
2747};
2748
2749static struct msm_rot_clocks rotator_clocks[] = {
2750 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002751 .clk_name = "core_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002752 .clk_type = ROTATOR_CORE_CLK,
Nagamalleswararao Ganji0bb107342011-10-10 20:55:32 -07002753 .clk_rate = 200 * 1000 * 1000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002754 },
2755 {
Matt Wagantallbb90da92011-10-25 15:07:52 -07002756 .clk_name = "iface_clk",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002757 .clk_type = ROTATOR_PCLK,
2758 .clk_rate = 0,
2759 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002760};
2761
2762static struct msm_rotator_platform_data rotator_pdata = {
2763 .number_of_clocks = ARRAY_SIZE(rotator_clocks),
2764 .hardware_version_number = 0x01020309,
2765 .rotator_clks = rotator_clocks,
Nagamalleswararao Ganji5fabbd62011-11-06 23:10:43 -08002766#ifdef CONFIG_MSM_BUS_SCALING
2767 .bus_scale_table = &rotator_bus_scale_pdata,
2768#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002769};
2770
2771struct platform_device msm_rotator_device = {
2772 .name = "msm_rotator",
2773 .id = 0,
2774 .num_resources = ARRAY_SIZE(resources_msm_rotator),
2775 .resource = resources_msm_rotator,
2776 .dev = {
2777 .platform_data = &rotator_pdata,
2778 },
2779};
Olav Hauganef95ae32012-05-15 09:50:30 -07002780
2781void __init msm_rotator_set_split_iommu_domain(void)
2782{
2783 rotator_pdata.rot_iommu_split_domain = 1;
2784}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002785#endif
2786
2787#define MIPI_DSI_HW_BASE 0x04700000
2788#define MDP_HW_BASE 0x05100000
2789
2790static struct resource msm_mipi_dsi1_resources[] = {
2791 {
2792 .name = "mipi_dsi",
2793 .start = MIPI_DSI_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002794 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002795 .flags = IORESOURCE_MEM,
2796 },
2797 {
2798 .start = DSI1_IRQ,
2799 .end = DSI1_IRQ,
2800 .flags = IORESOURCE_IRQ,
2801 },
2802};
2803
2804struct platform_device msm_mipi_dsi1_device = {
2805 .name = "mipi_dsi",
2806 .id = 1,
2807 .num_resources = ARRAY_SIZE(msm_mipi_dsi1_resources),
2808 .resource = msm_mipi_dsi1_resources,
2809};
2810
2811static struct resource msm_mdp_resources[] = {
2812 {
2813 .name = "mdp",
2814 .start = MDP_HW_BASE,
kuogee hsiehf12acf52011-09-06 10:49:43 -07002815 .end = MDP_HW_BASE + 0x000F0000 - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002816 .flags = IORESOURCE_MEM,
2817 },
2818 {
2819 .start = MDP_IRQ,
2820 .end = MDP_IRQ,
2821 .flags = IORESOURCE_IRQ,
2822 },
2823};
2824
2825static struct platform_device msm_mdp_device = {
2826 .name = "mdp",
2827 .id = 0,
2828 .num_resources = ARRAY_SIZE(msm_mdp_resources),
2829 .resource = msm_mdp_resources,
2830};
2831
2832static void __init msm_register_device(struct platform_device *pdev, void *data)
2833{
2834 int ret;
2835
2836 pdev->dev.platform_data = data;
2837 ret = platform_device_register(pdev);
2838 if (ret)
2839 dev_err(&pdev->dev,
2840 "%s: platform_device_register() failed = %d\n",
2841 __func__, ret);
2842}
2843
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002844#ifdef CONFIG_MSM_BUS_SCALING
2845static struct platform_device msm_dtv_device = {
2846 .name = "dtv",
2847 .id = 0,
2848};
2849#endif
2850
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08002851struct platform_device msm_lvds_device = {
Huaibin Yang4a084e32011-12-15 15:25:52 -08002852 .name = "lvds",
2853 .id = 0,
2854};
2855
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002856void __init msm_fb_register_device(char *name, void *data)
2857{
2858 if (!strncmp(name, "mdp", 3))
2859 msm_register_device(&msm_mdp_device, data);
2860 else if (!strncmp(name, "mipi_dsi", 8))
2861 msm_register_device(&msm_mipi_dsi1_device, data);
Huaibin Yang4a084e32011-12-15 15:25:52 -08002862 else if (!strncmp(name, "lvds", 4))
2863 msm_register_device(&msm_lvds_device, data);
Ravishangar Kalyanam882930f2011-07-08 17:51:52 -07002864#ifdef CONFIG_MSM_BUS_SCALING
2865 else if (!strncmp(name, "dtv", 3))
2866 msm_register_device(&msm_dtv_device, data);
2867#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002868 else
2869 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
2870}
2871
2872static struct resource resources_sps[] = {
2873 {
2874 .name = "pipe_mem",
2875 .start = 0x12800000,
2876 .end = 0x12800000 + 0x4000 - 1,
2877 .flags = IORESOURCE_MEM,
2878 },
2879 {
2880 .name = "bamdma_dma",
2881 .start = 0x12240000,
2882 .end = 0x12240000 + 0x1000 - 1,
2883 .flags = IORESOURCE_MEM,
2884 },
2885 {
2886 .name = "bamdma_bam",
2887 .start = 0x12244000,
2888 .end = 0x12244000 + 0x4000 - 1,
2889 .flags = IORESOURCE_MEM,
2890 },
2891 {
2892 .name = "bamdma_irq",
2893 .start = SPS_BAM_DMA_IRQ,
2894 .end = SPS_BAM_DMA_IRQ,
2895 .flags = IORESOURCE_IRQ,
2896 },
2897};
2898
2899struct msm_sps_platform_data msm_sps_pdata = {
2900 .bamdma_restricted_pipes = 0x06,
2901};
2902
2903struct platform_device msm_device_sps = {
2904 .name = "msm_sps",
2905 .id = -1,
2906 .num_resources = ARRAY_SIZE(resources_sps),
2907 .resource = resources_sps,
2908 .dev.platform_data = &msm_sps_pdata,
2909};
2910
2911#ifdef CONFIG_MSM_MPM
Praveen Chidambaram78499012011-11-01 17:15:17 -06002912static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002913 [1] = MSM_GPIO_TO_INT(46),
2914 [2] = MSM_GPIO_TO_INT(150),
2915 [4] = MSM_GPIO_TO_INT(103),
2916 [5] = MSM_GPIO_TO_INT(104),
2917 [6] = MSM_GPIO_TO_INT(105),
2918 [7] = MSM_GPIO_TO_INT(106),
2919 [8] = MSM_GPIO_TO_INT(107),
2920 [9] = MSM_GPIO_TO_INT(7),
2921 [10] = MSM_GPIO_TO_INT(11),
2922 [11] = MSM_GPIO_TO_INT(15),
2923 [12] = MSM_GPIO_TO_INT(19),
2924 [13] = MSM_GPIO_TO_INT(23),
2925 [14] = MSM_GPIO_TO_INT(27),
2926 [15] = MSM_GPIO_TO_INT(31),
2927 [16] = MSM_GPIO_TO_INT(35),
2928 [19] = MSM_GPIO_TO_INT(90),
2929 [20] = MSM_GPIO_TO_INT(92),
2930 [23] = MSM_GPIO_TO_INT(85),
2931 [24] = MSM_GPIO_TO_INT(83),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002932 [25] = USB1_HS_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002933 [27] = HDMI_IRQ,
Praveen Chidambaramb3d857c2011-05-31 16:28:07 -06002934 [29] = MSM_GPIO_TO_INT(10),
2935 [30] = MSM_GPIO_TO_INT(102),
2936 [31] = MSM_GPIO_TO_INT(81),
2937 [32] = MSM_GPIO_TO_INT(78),
2938 [33] = MSM_GPIO_TO_INT(94),
2939 [34] = MSM_GPIO_TO_INT(72),
2940 [35] = MSM_GPIO_TO_INT(39),
2941 [36] = MSM_GPIO_TO_INT(43),
2942 [37] = MSM_GPIO_TO_INT(61),
2943 [38] = MSM_GPIO_TO_INT(50),
2944 [39] = MSM_GPIO_TO_INT(42),
2945 [41] = MSM_GPIO_TO_INT(62),
2946 [42] = MSM_GPIO_TO_INT(76),
2947 [43] = MSM_GPIO_TO_INT(75),
2948 [44] = MSM_GPIO_TO_INT(70),
2949 [45] = MSM_GPIO_TO_INT(69),
2950 [46] = MSM_GPIO_TO_INT(67),
2951 [47] = MSM_GPIO_TO_INT(65),
2952 [48] = MSM_GPIO_TO_INT(58),
2953 [49] = MSM_GPIO_TO_INT(54),
2954 [50] = MSM_GPIO_TO_INT(52),
2955 [51] = MSM_GPIO_TO_INT(49),
2956 [52] = MSM_GPIO_TO_INT(40),
2957 [53] = MSM_GPIO_TO_INT(37),
2958 [54] = MSM_GPIO_TO_INT(24),
2959 [55] = MSM_GPIO_TO_INT(14),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002960};
2961
Praveen Chidambaram78499012011-11-01 17:15:17 -06002962static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002963 TLMM_MSM_SUMMARY_IRQ,
2964 RPM_APCC_CPU0_GP_HIGH_IRQ,
2965 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2966 RPM_APCC_CPU0_GP_LOW_IRQ,
2967 RPM_APCC_CPU0_WAKE_UP_IRQ,
2968 RPM_APCC_CPU1_GP_HIGH_IRQ,
2969 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2970 RPM_APCC_CPU1_GP_LOW_IRQ,
2971 RPM_APCC_CPU1_WAKE_UP_IRQ,
2972 MSS_TO_APPS_IRQ_0,
2973 MSS_TO_APPS_IRQ_1,
2974 MSS_TO_APPS_IRQ_2,
2975 MSS_TO_APPS_IRQ_3,
2976 MSS_TO_APPS_IRQ_4,
2977 MSS_TO_APPS_IRQ_5,
2978 MSS_TO_APPS_IRQ_6,
2979 MSS_TO_APPS_IRQ_7,
2980 MSS_TO_APPS_IRQ_8,
2981 MSS_TO_APPS_IRQ_9,
2982 LPASS_SCSS_GP_LOW_IRQ,
2983 LPASS_SCSS_GP_MEDIUM_IRQ,
2984 LPASS_SCSS_GP_HIGH_IRQ,
David Collins5e2b2fd2011-09-08 15:23:30 -07002985 SPS_MTI_30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002986 SPS_MTI_31,
David Collins5e2b2fd2011-09-08 15:23:30 -07002987 RIVA_APSS_SPARE_IRQ,
David Collins84ecd0a2011-09-27 21:11:11 -07002988 RIVA_APPS_WLAN_SMSM_IRQ,
2989 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2990 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002991};
2992
Praveen Chidambaram78499012011-11-01 17:15:17 -06002993struct msm_mpm_device_data msm8960_mpm_dev_data __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002994 .irqs_m2a = msm_mpm_irqs_m2a,
2995 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2996 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2997 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2998 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2999 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
3000 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
3001 .mpm_apps_ipc_val = BIT(1),
3002 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
3003
3004};
3005#endif
3006
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003007#define LPASS_SLIMBUS_PHYS 0x28080000
3008#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Sagar Dhariacc969452011-09-19 10:34:30 -06003009#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003010/* Board info for the slimbus slave device */
3011static struct resource slimbus_res[] = {
3012 {
3013 .start = LPASS_SLIMBUS_PHYS,
3014 .end = LPASS_SLIMBUS_PHYS + 8191,
3015 .flags = IORESOURCE_MEM,
3016 .name = "slimbus_physical",
3017 },
3018 {
3019 .start = LPASS_SLIMBUS_BAM_PHYS,
3020 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
3021 .flags = IORESOURCE_MEM,
3022 .name = "slimbus_bam_physical",
3023 },
3024 {
Sagar Dhariacc969452011-09-19 10:34:30 -06003025 .start = LPASS_SLIMBUS_SLEW,
3026 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
3027 .flags = IORESOURCE_MEM,
3028 .name = "slimbus_slew_reg",
3029 },
3030 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003031 .start = SLIMBUS0_CORE_EE1_IRQ,
3032 .end = SLIMBUS0_CORE_EE1_IRQ,
3033 .flags = IORESOURCE_IRQ,
3034 .name = "slimbus_irq",
3035 },
3036 {
3037 .start = SLIMBUS0_BAM_EE1_IRQ,
3038 .end = SLIMBUS0_BAM_EE1_IRQ,
3039 .flags = IORESOURCE_IRQ,
3040 .name = "slimbus_bam_irq",
3041 },
3042};
3043
3044struct platform_device msm_slim_ctrl = {
3045 .name = "msm_slim_ctrl",
3046 .id = 1,
3047 .num_resources = ARRAY_SIZE(slimbus_res),
3048 .resource = slimbus_res,
3049 .dev = {
3050 .coherent_dma_mask = 0xffffffffULL,
3051 },
3052};
3053
Lucille Sylvester6e362412011-12-09 16:21:42 -07003054static struct msm_dcvs_freq_entry grp3d_freq[] = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003055 {0, 900, 0, 0, 0},
3056 {0, 950, 0, 0, 0},
3057 {0, 950, 0, 0, 0},
3058 {0, 1200, 1, 100, 100},
Lucille Sylvester6e362412011-12-09 16:21:42 -07003059};
3060
3061static struct msm_dcvs_freq_entry grp2d_freq[] = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003062 {0, 900, 0, 0, 0},
3063 {0, 950, 1, 100, 100},
Lucille Sylvester6e362412011-12-09 16:21:42 -07003064};
3065
3066static struct msm_dcvs_core_info grp3d_core_info = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003067 .freq_tbl = &grp3d_freq[0],
3068 .core_param = {
3069 .core_type = MSM_DCVS_CORE_TYPE_GPU,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003070 },
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003071 .algo_param = {
3072 .disable_pc_threshold = 0,
3073 .em_win_size_min_us = 100000,
3074 .em_win_size_max_us = 300000,
3075 .em_max_util_pct = 97,
3076 .group_id = 0,
3077 .max_freq_chg_time_us = 100000,
3078 .slack_mode_dynamic = 0,
3079 .slack_weight_thresh_pct = 0,
3080 .slack_time_min_us = 39000,
3081 .slack_time_max_us = 39000,
3082 .ss_win_size_min_us = 1000000,
3083 .ss_win_size_max_us = 1000000,
3084 .ss_util_pct = 95,
Steve Mucklee8c6d612012-12-06 14:31:00 -08003085 .ss_no_corr_below_freq = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003086 },
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003087 .energy_coeffs = {
3088 .active_coeff_a = 2492,
3089 .active_coeff_b = 0,
3090 .active_coeff_c = 0,
3091
3092 .leakage_coeff_a = -17720,
3093 .leakage_coeff_b = 37,
3094 .leakage_coeff_c = 2729,
3095 .leakage_coeff_d = -277,
3096 },
3097 .power_param = {
3098 .current_temp = 25,
3099 .num_freq = ARRAY_SIZE(grp3d_freq),
3100 }
Lucille Sylvester6e362412011-12-09 16:21:42 -07003101};
3102
3103static struct msm_dcvs_core_info grp2d_core_info = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003104 .freq_tbl = &grp2d_freq[0],
3105 .core_param = {
3106 .core_type = MSM_DCVS_CORE_TYPE_GPU,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003107 },
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003108 .algo_param = {
3109 .disable_pc_threshold = 0,
3110 .em_win_size_min_us = 100000,
3111 .em_win_size_max_us = 300000,
3112 .em_max_util_pct = 97,
3113 .group_id = 0,
3114 .max_freq_chg_time_us = 100000,
3115 .slack_mode_dynamic = 0,
3116 .slack_weight_thresh_pct = 0,
3117 .slack_time_min_us = 39000,
3118 .slack_time_max_us = 39000,
3119 .ss_win_size_min_us = 1000000,
3120 .ss_win_size_max_us = 1000000,
3121 .ss_util_pct = 95,
Steve Mucklee8c6d612012-12-06 14:31:00 -08003122 .ss_no_corr_below_freq = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003123 },
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07003124 .energy_coeffs = {
3125 .active_coeff_a = 2492,
3126 .active_coeff_b = 0,
3127 .active_coeff_c = 0,
3128
3129 .leakage_coeff_a = -17720,
3130 .leakage_coeff_b = 37,
3131 .leakage_coeff_c = 2729,
3132 .leakage_coeff_d = -277,
3133 },
3134 .power_param = {
3135 .current_temp = 25,
3136 .num_freq = ARRAY_SIZE(grp2d_freq),
3137 }
Lucille Sylvester6e362412011-12-09 16:21:42 -07003138};
3139
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003140#ifdef CONFIG_MSM_BUS_SCALING
3141static struct msm_bus_vectors grp3d_init_vectors[] = {
3142 {
3143 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3144 .dst = MSM_BUS_SLAVE_EBI_CH0,
3145 .ab = 0,
3146 .ib = 0,
3147 },
3148};
3149
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003150static struct msm_bus_vectors grp3d_low_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003151 {
3152 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3153 .dst = MSM_BUS_SLAVE_EBI_CH0,
3154 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07003155 .ib = KGSL_CONVERT_TO_MBPS(1000),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003156 },
3157};
3158
3159static struct msm_bus_vectors grp3d_nominal_low_vectors[] = {
3160 {
3161 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3162 .dst = MSM_BUS_SLAVE_EBI_CH0,
3163 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07003164 .ib = KGSL_CONVERT_TO_MBPS(2048),
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003165 },
3166};
3167
3168static struct msm_bus_vectors grp3d_nominal_high_vectors[] = {
3169 {
3170 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3171 .dst = MSM_BUS_SLAVE_EBI_CH0,
3172 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07003173 .ib = KGSL_CONVERT_TO_MBPS(2656),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003174 },
3175};
3176
3177static struct msm_bus_vectors grp3d_max_vectors[] = {
3178 {
3179 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3180 .dst = MSM_BUS_SLAVE_EBI_CH0,
3181 .ab = 0,
Suman Tatiraju0123d182011-09-30 14:59:06 -07003182 .ib = KGSL_CONVERT_TO_MBPS(3968),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003183 },
3184};
3185
Lucille Sylvester0a82ff22012-12-06 14:10:19 -07003186struct msm_bus_vectors grp3d_init_vectors_1[] = {
3187 {
3188 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3189 .dst = MSM_BUS_SLAVE_EBI_CH0,
3190 .ab = 0,
3191 .ib = 0,
3192 },
3193 {
3194 .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
3195 .dst = MSM_BUS_SLAVE_EBI_CH0,
3196 .ab = 0,
3197 .ib = 0,
3198 },
3199};
3200
3201struct msm_bus_vectors grp3d_low_vectors_1[] = {
3202 {
3203 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3204 .dst = MSM_BUS_SLAVE_EBI_CH0,
3205 .ab = 0,
3206 .ib = KGSL_CONVERT_TO_MBPS(1000),
3207 },
3208 {
3209 .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
3210 .dst = MSM_BUS_SLAVE_EBI_CH0,
3211 .ab = 0,
3212 .ib = KGSL_CONVERT_TO_MBPS(1000),
3213 },
3214};
3215
3216struct msm_bus_vectors grp3d_nominal_low_vectors_1[] = {
3217 {
3218 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3219 .dst = MSM_BUS_SLAVE_EBI_CH0,
3220 .ab = 0,
3221 .ib = KGSL_CONVERT_TO_MBPS(2048),
3222 },
3223 {
3224 .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
3225 .dst = MSM_BUS_SLAVE_EBI_CH0,
3226 .ab = 0,
3227 .ib = KGSL_CONVERT_TO_MBPS(2048),
3228 },
3229};
3230
3231struct msm_bus_vectors grp3d_nominal_high_vectors_1[] = {
3232 {
3233 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3234 .dst = MSM_BUS_SLAVE_EBI_CH0,
3235 .ab = 0,
3236 .ib = KGSL_CONVERT_TO_MBPS(2656),
3237 },
3238 {
3239 .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
3240 .dst = MSM_BUS_SLAVE_EBI_CH0,
3241 .ab = 0,
3242 .ib = KGSL_CONVERT_TO_MBPS(2656),
3243 },
3244};
3245
3246struct msm_bus_vectors grp3d_max_vectors_1[] = {
3247 {
3248 .src = MSM_BUS_MASTER_GRAPHICS_3D,
3249 .dst = MSM_BUS_SLAVE_EBI_CH0,
3250 .ab = 0,
3251 .ib = KGSL_CONVERT_TO_MBPS(3968),
3252 },
3253 {
3254 .src = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
3255 .dst = MSM_BUS_SLAVE_EBI_CH0,
3256 .ab = 0,
3257 .ib = KGSL_CONVERT_TO_MBPS(3968),
3258 },
3259};
3260
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003261static struct msm_bus_paths grp3d_bus_scale_usecases[] = {
3262 {
3263 ARRAY_SIZE(grp3d_init_vectors),
3264 grp3d_init_vectors,
3265 },
3266 {
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003267 ARRAY_SIZE(grp3d_low_vectors),
3268 grp3d_low_vectors,
3269 },
3270 {
3271 ARRAY_SIZE(grp3d_nominal_low_vectors),
3272 grp3d_nominal_low_vectors,
3273 },
3274 {
3275 ARRAY_SIZE(grp3d_nominal_high_vectors),
3276 grp3d_nominal_high_vectors,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003277 },
3278 {
3279 ARRAY_SIZE(grp3d_max_vectors),
3280 grp3d_max_vectors,
3281 },
3282};
3283
Lucille Sylvester0a82ff22012-12-06 14:10:19 -07003284struct msm_bus_paths grp3d_bus_scale_usecases_1[] = {
3285 {
3286 ARRAY_SIZE(grp3d_init_vectors_1),
3287 grp3d_init_vectors_1,
3288 },
3289 {
3290 ARRAY_SIZE(grp3d_low_vectors_1),
3291 grp3d_low_vectors_1,
3292 },
3293 {
3294 ARRAY_SIZE(grp3d_nominal_low_vectors_1),
3295 grp3d_nominal_low_vectors_1,
3296 },
3297 {
3298 ARRAY_SIZE(grp3d_nominal_high_vectors_1),
3299 grp3d_nominal_high_vectors_1,
3300 },
3301 {
3302 ARRAY_SIZE(grp3d_max_vectors_1),
3303 grp3d_max_vectors_1,
3304 },
3305};
3306
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003307static struct msm_bus_scale_pdata grp3d_bus_scale_pdata = {
3308 grp3d_bus_scale_usecases,
3309 ARRAY_SIZE(grp3d_bus_scale_usecases),
3310 .name = "grp3d",
3311};
3312
Lucille Sylvester0a82ff22012-12-06 14:10:19 -07003313struct msm_bus_scale_pdata grp3d_bus_scale_pdata_ab = {
3314 grp3d_bus_scale_usecases_1,
3315 ARRAY_SIZE(grp3d_bus_scale_usecases_1),
3316 .name = "grp3d",
3317};
3318
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003319static struct msm_bus_vectors grp2d0_init_vectors[] = {
3320 {
3321 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
3322 .dst = MSM_BUS_SLAVE_EBI_CH0,
3323 .ab = 0,
3324 .ib = 0,
3325 },
3326};
3327
Lucille Sylvester808eca22011-11-03 10:26:29 -07003328static struct msm_bus_vectors grp2d0_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003329 {
3330 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
3331 .dst = MSM_BUS_SLAVE_EBI_CH0,
3332 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07003333 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003334 },
3335};
3336
Lucille Sylvester808eca22011-11-03 10:26:29 -07003337static struct msm_bus_vectors grp2d0_max_vectors[] = {
3338 {
3339 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE0,
3340 .dst = MSM_BUS_SLAVE_EBI_CH0,
3341 .ab = 0,
3342 .ib = KGSL_CONVERT_TO_MBPS(2048),
3343 },
3344};
3345
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003346static struct msm_bus_paths grp2d0_bus_scale_usecases[] = {
3347 {
3348 ARRAY_SIZE(grp2d0_init_vectors),
3349 grp2d0_init_vectors,
3350 },
3351 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07003352 ARRAY_SIZE(grp2d0_nominal_vectors),
3353 grp2d0_nominal_vectors,
3354 },
3355 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003356 ARRAY_SIZE(grp2d0_max_vectors),
3357 grp2d0_max_vectors,
3358 },
3359};
3360
3361struct msm_bus_scale_pdata grp2d0_bus_scale_pdata = {
3362 grp2d0_bus_scale_usecases,
3363 ARRAY_SIZE(grp2d0_bus_scale_usecases),
3364 .name = "grp2d0",
3365};
3366
3367static struct msm_bus_vectors grp2d1_init_vectors[] = {
3368 {
3369 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
3370 .dst = MSM_BUS_SLAVE_EBI_CH0,
3371 .ab = 0,
3372 .ib = 0,
3373 },
3374};
3375
Lucille Sylvester808eca22011-11-03 10:26:29 -07003376static struct msm_bus_vectors grp2d1_nominal_vectors[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003377 {
3378 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
3379 .dst = MSM_BUS_SLAVE_EBI_CH0,
3380 .ab = 0,
Lucille Sylvester3efebb52012-01-17 12:58:38 -07003381 .ib = KGSL_CONVERT_TO_MBPS(1000),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003382 },
3383};
3384
Lucille Sylvester808eca22011-11-03 10:26:29 -07003385static struct msm_bus_vectors grp2d1_max_vectors[] = {
3386 {
3387 .src = MSM_BUS_MASTER_GRAPHICS_2D_CORE1,
3388 .dst = MSM_BUS_SLAVE_EBI_CH0,
3389 .ab = 0,
3390 .ib = KGSL_CONVERT_TO_MBPS(2048),
3391 },
3392};
3393
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003394static struct msm_bus_paths grp2d1_bus_scale_usecases[] = {
3395 {
3396 ARRAY_SIZE(grp2d1_init_vectors),
3397 grp2d1_init_vectors,
3398 },
3399 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07003400 ARRAY_SIZE(grp2d1_nominal_vectors),
3401 grp2d1_nominal_vectors,
3402 },
3403 {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003404 ARRAY_SIZE(grp2d1_max_vectors),
3405 grp2d1_max_vectors,
3406 },
3407};
3408
3409struct msm_bus_scale_pdata grp2d1_bus_scale_pdata = {
3410 grp2d1_bus_scale_usecases,
3411 ARRAY_SIZE(grp2d1_bus_scale_usecases),
3412 .name = "grp2d1",
3413};
3414#endif
3415
Harsh Vardhan Dwivedi623b9a22012-10-28 20:54:17 -06003416struct resource kgsl_3d0_resources_8960ab[] = {
3417 {
3418 .name = KGSL_3D0_REG_MEMORY,
3419 .start = 0x04300000, /* GFX3D address */
3420 .end = 0x0430ffff,
3421 .flags = IORESOURCE_MEM,
3422 },
3423 {
3424 .name = KGSL_3D0_SHADER_MEMORY,
3425 .start = 0x04310000, /* Shader Mem Address (8960AB) */
3426 .end = 0x0431ffff,
3427 .flags = IORESOURCE_MEM,
3428 },
3429 {
3430 .name = KGSL_3D0_IRQ,
3431 .start = GFX3D_IRQ,
3432 .end = GFX3D_IRQ,
3433 .flags = IORESOURCE_IRQ,
3434 },
3435};
3436
3437int kgsl_num_resources_8960ab = ARRAY_SIZE(kgsl_3d0_resources_8960ab);
3438
3439static struct resource kgsl_3d0_resources_8960[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003440 {
3441 .name = KGSL_3D0_REG_MEMORY,
3442 .start = 0x04300000, /* GFX3D address */
3443 .end = 0x0431ffff,
3444 .flags = IORESOURCE_MEM,
3445 },
3446 {
3447 .name = KGSL_3D0_IRQ,
3448 .start = GFX3D_IRQ,
3449 .end = GFX3D_IRQ,
3450 .flags = IORESOURCE_IRQ,
3451 },
3452};
3453
Carter Coopera4a7ed22012-08-20 22:11:42 -06003454static const struct kgsl_iommu_ctx kgsl_3d0_iommu0_ctxs[] = {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06003455 { "gfx3d_user", 0 },
3456 { "gfx3d_priv", 1 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003457};
3458
Carter Coopera4a7ed22012-08-20 22:11:42 -06003459static const struct kgsl_iommu_ctx kgsl_3d0_iommu1_ctxs[] = {
3460 { "gfx3d1_user", 0 },
3461 { "gfx3d1_priv", 1 },
3462};
3463
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003464static struct kgsl_device_iommu_data kgsl_3d0_iommu_data[] = {
3465 {
Carter Coopera4a7ed22012-08-20 22:11:42 -06003466 .iommu_ctxs = kgsl_3d0_iommu0_ctxs,
3467 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu0_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003468 .physstart = 0x07C00000,
3469 .physend = 0x07C00000 + SZ_1M - 1,
3470 },
Carter Coopera4a7ed22012-08-20 22:11:42 -06003471 {
3472 .iommu_ctxs = kgsl_3d0_iommu1_ctxs,
3473 .iommu_ctx_count = ARRAY_SIZE(kgsl_3d0_iommu1_ctxs),
3474 .physstart = 0x07D00000,
3475 .physend = 0x07D00000 + SZ_1M - 1,
3476 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003477};
3478
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003479static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003480 .pwrlevel = {
3481 {
3482 .gpu_freq = 400000000,
3483 .bus_freq = 4,
3484 .io_fraction = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003485 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003486 {
3487 .gpu_freq = 300000000,
3488 .bus_freq = 3,
3489 .io_fraction = 33,
3490 },
3491 {
3492 .gpu_freq = 200000000,
3493 .bus_freq = 2,
3494 .io_fraction = 100,
3495 },
3496 {
3497 .gpu_freq = 128000000,
3498 .bus_freq = 1,
3499 .io_fraction = 100,
3500 },
3501 {
3502 .gpu_freq = 27000000,
3503 .bus_freq = 0,
3504 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003505 },
Lucille Sylvester67b4c532012-02-08 11:24:31 -08003506 .init_level = 1,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003507 .num_levels = ARRAY_SIZE(grp3d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003508 .set_grp_async = NULL,
Lucille Sylvester5dc67512012-03-27 15:07:58 -06003509 .idle_timeout = HZ/12,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003510 .nap_allowed = true,
3511 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003512#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003513 .bus_scale_table = &grp3d_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003514#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003515 .iommu_data = kgsl_3d0_iommu_data,
3516 .iommu_count = ARRAY_SIZE(kgsl_3d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07003517 .core_info = &grp3d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003518};
3519
3520struct platform_device msm_kgsl_3d0 = {
3521 .name = "kgsl-3d0",
3522 .id = 0,
Harsh Vardhan Dwivedi623b9a22012-10-28 20:54:17 -06003523 .num_resources = ARRAY_SIZE(kgsl_3d0_resources_8960),
3524 .resource = kgsl_3d0_resources_8960,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003525 .dev = {
3526 .platform_data = &kgsl_3d0_pdata,
3527 },
3528};
3529
3530static struct resource kgsl_2d0_resources[] = {
3531 {
3532 .name = KGSL_2D0_REG_MEMORY,
3533 .start = 0x04100000, /* Z180 base address */
3534 .end = 0x04100FFF,
3535 .flags = IORESOURCE_MEM,
3536 },
3537 {
3538 .name = KGSL_2D0_IRQ,
3539 .start = GFX2D0_IRQ,
3540 .end = GFX2D0_IRQ,
3541 .flags = IORESOURCE_IRQ,
3542 },
3543};
3544
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06003545static const struct kgsl_iommu_ctx kgsl_2d0_iommu_ctxs[] = {
3546 { "gfx2d0_2d0", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003547};
3548
3549static struct kgsl_device_iommu_data kgsl_2d0_iommu_data[] = {
3550 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06003551 .iommu_ctxs = kgsl_2d0_iommu_ctxs,
3552 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d0_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003553 .physstart = 0x07D00000,
3554 .physend = 0x07D00000 + SZ_1M - 1,
3555 },
3556};
3557
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003558static struct kgsl_device_platform_data kgsl_2d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003559 .pwrlevel = {
3560 {
3561 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07003562 .bus_freq = 2,
3563 },
3564 {
3565 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003566 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003567 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003568 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07003569 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003570 .bus_freq = 0,
3571 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003572 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003573 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003574 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003575 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07003576 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003577 .nap_allowed = true,
3578 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003579#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003580 .bus_scale_table = &grp2d0_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003581#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003582 .iommu_data = kgsl_2d0_iommu_data,
3583 .iommu_count = ARRAY_SIZE(kgsl_2d0_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07003584 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003585};
3586
3587struct platform_device msm_kgsl_2d0 = {
3588 .name = "kgsl-2d0",
3589 .id = 0,
3590 .num_resources = ARRAY_SIZE(kgsl_2d0_resources),
3591 .resource = kgsl_2d0_resources,
3592 .dev = {
3593 .platform_data = &kgsl_2d0_pdata,
3594 },
3595};
3596
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06003597static const struct kgsl_iommu_ctx kgsl_2d1_iommu_ctxs[] = {
3598 { "gfx2d1_2d1", 0 },
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003599};
3600
3601static struct kgsl_device_iommu_data kgsl_2d1_iommu_data[] = {
3602 {
Shubhraprakash Daseb6df1d2012-05-01 00:55:35 -06003603 .iommu_ctxs = kgsl_2d1_iommu_ctxs,
3604 .iommu_ctx_count = ARRAY_SIZE(kgsl_2d1_iommu_ctxs),
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003605 .physstart = 0x07E00000,
3606 .physend = 0x07E00000 + SZ_1M - 1,
3607 },
3608};
3609
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003610static struct resource kgsl_2d1_resources[] = {
3611 {
3612 .name = KGSL_2D1_REG_MEMORY,
3613 .start = 0x04200000, /* Z180 device 1 base address */
3614 .end = 0x04200FFF,
3615 .flags = IORESOURCE_MEM,
3616 },
3617 {
3618 .name = KGSL_2D1_IRQ,
3619 .start = GFX2D1_IRQ,
3620 .end = GFX2D1_IRQ,
3621 .flags = IORESOURCE_IRQ,
3622 },
3623};
3624
3625static struct kgsl_device_platform_data kgsl_2d1_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003626 .pwrlevel = {
3627 {
3628 .gpu_freq = 200000000,
Lucille Sylvester808eca22011-11-03 10:26:29 -07003629 .bus_freq = 2,
3630 },
3631 {
3632 .gpu_freq = 96000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003633 .bus_freq = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003634 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003635 {
Lucille Sylvester808eca22011-11-03 10:26:29 -07003636 .gpu_freq = 27000000,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003637 .bus_freq = 0,
3638 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003639 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003640 .init_level = 0,
Lucille Sylvester6e362412011-12-09 16:21:42 -07003641 .num_levels = ARRAY_SIZE(grp2d_freq) + 1,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003642 .set_grp_async = NULL,
Lucille Sylvester808eca22011-11-03 10:26:29 -07003643 .idle_timeout = HZ/5,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003644 .nap_allowed = true,
3645 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003646#ifdef CONFIG_MSM_BUS_SCALING
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06003647 .bus_scale_table = &grp2d1_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003648#endif
Jordan Crouse46cf4bb2012-02-21 08:54:52 -07003649 .iommu_data = kgsl_2d1_iommu_data,
3650 .iommu_count = ARRAY_SIZE(kgsl_2d1_iommu_data),
Lucille Sylvester6e362412011-12-09 16:21:42 -07003651 .core_info = &grp2d_core_info,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003652};
3653
3654struct platform_device msm_kgsl_2d1 = {
3655 .name = "kgsl-2d1",
3656 .id = 1,
3657 .num_resources = ARRAY_SIZE(kgsl_2d1_resources),
3658 .resource = kgsl_2d1_resources,
3659 .dev = {
3660 .platform_data = &kgsl_2d1_pdata,
3661 },
3662};
3663
3664#ifdef CONFIG_MSM_GEMINI
3665static struct resource msm_gemini_resources[] = {
3666 {
3667 .start = 0x04600000,
3668 .end = 0x04600000 + SZ_1M - 1,
3669 .flags = IORESOURCE_MEM,
3670 },
3671 {
3672 .start = JPEG_IRQ,
3673 .end = JPEG_IRQ,
3674 .flags = IORESOURCE_IRQ,
3675 },
3676};
3677
3678struct platform_device msm8960_gemini_device = {
3679 .name = "msm_gemini",
3680 .resource = msm_gemini_resources,
3681 .num_resources = ARRAY_SIZE(msm_gemini_resources),
3682};
3683#endif
3684
Kalyani Oruganti465d1e12012-05-15 10:23:05 -07003685#ifdef CONFIG_MSM_MERCURY
3686static struct resource msm_mercury_resources[] = {
3687 {
3688 .start = 0x05000000,
3689 .end = 0x05000000 + SZ_1M - 1,
3690 .name = "mercury_resource_base",
3691 .flags = IORESOURCE_MEM,
3692 },
3693 {
3694 .start = JPEGD_IRQ,
3695 .end = JPEGD_IRQ,
3696 .flags = IORESOURCE_IRQ,
3697 },
3698};
3699struct platform_device msm8960_mercury_device = {
3700 .name = "msm_mercury",
3701 .resource = msm_mercury_resources,
3702 .num_resources = ARRAY_SIZE(msm_mercury_resources),
3703};
3704#endif
3705
Praveen Chidambaram78499012011-11-01 17:15:17 -06003706struct msm_rpm_platform_data msm8960_rpm_data __initdata = {
3707 .reg_base_addrs = {
3708 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
3709 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
3710 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
3711 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
3712 },
3713 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08003714 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06003715 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06003716 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
3717 .ipc_rpm_val = 4,
3718 .target_id = {
3719 MSM_RPM_MAP(8960, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
3720 MSM_RPM_MAP(8960, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
3721 MSM_RPM_MAP(8960, INVALIDATE_0, INVALIDATE, 8),
3722 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
3723 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
3724 MSM_RPM_MAP(8960, RPM_CTL, RPM_CTL, 1),
3725 MSM_RPM_MAP(8960, CXO_CLK, CXO_CLK, 1),
3726 MSM_RPM_MAP(8960, PXO_CLK, PXO_CLK, 1),
3727 MSM_RPM_MAP(8960, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
3728 MSM_RPM_MAP(8960, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
3729 MSM_RPM_MAP(8960, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
3730 MSM_RPM_MAP(8960, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
3731 MSM_RPM_MAP(8960, SFPB_CLK, SFPB_CLK, 1),
3732 MSM_RPM_MAP(8960, CFPB_CLK, CFPB_CLK, 1),
3733 MSM_RPM_MAP(8960, MMFPB_CLK, MMFPB_CLK, 1),
3734 MSM_RPM_MAP(8960, EBI1_CLK, EBI1_CLK, 1),
3735 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_HALT_0,
3736 APPS_FABRIC_CFG_HALT, 2),
3737 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_CLKMOD_0,
3738 APPS_FABRIC_CFG_CLKMOD, 3),
3739 MSM_RPM_MAP(8960, APPS_FABRIC_CFG_IOCTL,
3740 APPS_FABRIC_CFG_IOCTL, 1),
3741 MSM_RPM_MAP(8960, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
3742 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_HALT_0,
3743 SYS_FABRIC_CFG_HALT, 2),
3744 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_CLKMOD_0,
3745 SYS_FABRIC_CFG_CLKMOD, 3),
3746 MSM_RPM_MAP(8960, SYS_FABRIC_CFG_IOCTL,
3747 SYS_FABRIC_CFG_IOCTL, 1),
3748 MSM_RPM_MAP(8960, SYSTEM_FABRIC_ARB_0,
3749 SYSTEM_FABRIC_ARB, 29),
3750 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_HALT_0,
3751 MMSS_FABRIC_CFG_HALT, 2),
3752 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_CLKMOD_0,
3753 MMSS_FABRIC_CFG_CLKMOD, 3),
3754 MSM_RPM_MAP(8960, MMSS_FABRIC_CFG_IOCTL,
3755 MMSS_FABRIC_CFG_IOCTL, 1),
3756 MSM_RPM_MAP(8960, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 23),
3757 MSM_RPM_MAP(8960, PM8921_S1_0, PM8921_S1, 2),
3758 MSM_RPM_MAP(8960, PM8921_S2_0, PM8921_S2, 2),
3759 MSM_RPM_MAP(8960, PM8921_S3_0, PM8921_S3, 2),
3760 MSM_RPM_MAP(8960, PM8921_S4_0, PM8921_S4, 2),
3761 MSM_RPM_MAP(8960, PM8921_S5_0, PM8921_S5, 2),
3762 MSM_RPM_MAP(8960, PM8921_S6_0, PM8921_S6, 2),
3763 MSM_RPM_MAP(8960, PM8921_S7_0, PM8921_S7, 2),
3764 MSM_RPM_MAP(8960, PM8921_S8_0, PM8921_S8, 2),
3765 MSM_RPM_MAP(8960, PM8921_L1_0, PM8921_L1, 2),
3766 MSM_RPM_MAP(8960, PM8921_L2_0, PM8921_L2, 2),
3767 MSM_RPM_MAP(8960, PM8921_L3_0, PM8921_L3, 2),
3768 MSM_RPM_MAP(8960, PM8921_L4_0, PM8921_L4, 2),
3769 MSM_RPM_MAP(8960, PM8921_L5_0, PM8921_L5, 2),
3770 MSM_RPM_MAP(8960, PM8921_L6_0, PM8921_L6, 2),
3771 MSM_RPM_MAP(8960, PM8921_L7_0, PM8921_L7, 2),
3772 MSM_RPM_MAP(8960, PM8921_L8_0, PM8921_L8, 2),
3773 MSM_RPM_MAP(8960, PM8921_L9_0, PM8921_L9, 2),
3774 MSM_RPM_MAP(8960, PM8921_L10_0, PM8921_L10, 2),
3775 MSM_RPM_MAP(8960, PM8921_L11_0, PM8921_L11, 2),
3776 MSM_RPM_MAP(8960, PM8921_L12_0, PM8921_L12, 2),
3777 MSM_RPM_MAP(8960, PM8921_L13_0, PM8921_L13, 2),
3778 MSM_RPM_MAP(8960, PM8921_L14_0, PM8921_L14, 2),
3779 MSM_RPM_MAP(8960, PM8921_L15_0, PM8921_L15, 2),
3780 MSM_RPM_MAP(8960, PM8921_L16_0, PM8921_L16, 2),
3781 MSM_RPM_MAP(8960, PM8921_L17_0, PM8921_L17, 2),
3782 MSM_RPM_MAP(8960, PM8921_L18_0, PM8921_L18, 2),
3783 MSM_RPM_MAP(8960, PM8921_L19_0, PM8921_L19, 2),
3784 MSM_RPM_MAP(8960, PM8921_L20_0, PM8921_L20, 2),
3785 MSM_RPM_MAP(8960, PM8921_L21_0, PM8921_L21, 2),
3786 MSM_RPM_MAP(8960, PM8921_L22_0, PM8921_L22, 2),
3787 MSM_RPM_MAP(8960, PM8921_L23_0, PM8921_L23, 2),
3788 MSM_RPM_MAP(8960, PM8921_L24_0, PM8921_L24, 2),
3789 MSM_RPM_MAP(8960, PM8921_L25_0, PM8921_L25, 2),
3790 MSM_RPM_MAP(8960, PM8921_L26_0, PM8921_L26, 2),
3791 MSM_RPM_MAP(8960, PM8921_L27_0, PM8921_L27, 2),
3792 MSM_RPM_MAP(8960, PM8921_L28_0, PM8921_L28, 2),
3793 MSM_RPM_MAP(8960, PM8921_L29_0, PM8921_L29, 2),
3794 MSM_RPM_MAP(8960, PM8921_CLK1_0, PM8921_CLK1, 2),
3795 MSM_RPM_MAP(8960, PM8921_CLK2_0, PM8921_CLK2, 2),
3796 MSM_RPM_MAP(8960, PM8921_LVS1, PM8921_LVS1, 1),
3797 MSM_RPM_MAP(8960, PM8921_LVS2, PM8921_LVS2, 1),
3798 MSM_RPM_MAP(8960, PM8921_LVS3, PM8921_LVS3, 1),
3799 MSM_RPM_MAP(8960, PM8921_LVS4, PM8921_LVS4, 1),
3800 MSM_RPM_MAP(8960, PM8921_LVS5, PM8921_LVS5, 1),
3801 MSM_RPM_MAP(8960, PM8921_LVS6, PM8921_LVS6, 1),
3802 MSM_RPM_MAP(8960, PM8921_LVS7, PM8921_LVS7, 1),
3803 MSM_RPM_MAP(8960, NCP_0, NCP, 2),
3804 MSM_RPM_MAP(8960, CXO_BUFFERS, CXO_BUFFERS, 1),
3805 MSM_RPM_MAP(8960, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
3806 MSM_RPM_MAP(8960, HDMI_SWITCH, HDMI_SWITCH, 1),
3807 MSM_RPM_MAP(8960, DDR_DMM_0, DDR_DMM, 2),
3808 MSM_RPM_MAP(8960, QDSS_CLK, QDSS_CLK, 1),
3809 },
3810 .target_status = {
3811 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MAJOR),
3812 MSM_RPM_STATUS_ID_MAP(8960, VERSION_MINOR),
3813 MSM_RPM_STATUS_ID_MAP(8960, VERSION_BUILD),
3814 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_0),
3815 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_1),
3816 MSM_RPM_STATUS_ID_MAP(8960, SUPPORTED_RESOURCES_2),
3817 MSM_RPM_STATUS_ID_MAP(8960, RESERVED_SUPPORTED_RESOURCES_0),
3818 MSM_RPM_STATUS_ID_MAP(8960, SEQUENCE),
3819 MSM_RPM_STATUS_ID_MAP(8960, RPM_CTL),
3820 MSM_RPM_STATUS_ID_MAP(8960, CXO_CLK),
3821 MSM_RPM_STATUS_ID_MAP(8960, PXO_CLK),
3822 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CLK),
3823 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_CLK),
3824 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_CLK),
3825 MSM_RPM_STATUS_ID_MAP(8960, DAYTONA_FABRIC_CLK),
3826 MSM_RPM_STATUS_ID_MAP(8960, SFPB_CLK),
3827 MSM_RPM_STATUS_ID_MAP(8960, CFPB_CLK),
3828 MSM_RPM_STATUS_ID_MAP(8960, MMFPB_CLK),
3829 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CLK),
3830 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_HALT),
3831 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_CLKMOD),
3832 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_CFG_IOCTL),
3833 MSM_RPM_STATUS_ID_MAP(8960, APPS_FABRIC_ARB),
3834 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_HALT),
3835 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_CLKMOD),
3836 MSM_RPM_STATUS_ID_MAP(8960, SYS_FABRIC_CFG_IOCTL),
3837 MSM_RPM_STATUS_ID_MAP(8960, SYSTEM_FABRIC_ARB),
3838 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_HALT),
3839 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_CLKMOD),
3840 MSM_RPM_STATUS_ID_MAP(8960, MMSS_FABRIC_CFG_IOCTL),
3841 MSM_RPM_STATUS_ID_MAP(8960, MM_FABRIC_ARB),
3842 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_0),
3843 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S1_1),
3844 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_0),
3845 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S2_1),
3846 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_0),
3847 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S3_1),
3848 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_0),
3849 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S4_1),
3850 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_0),
3851 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S5_1),
3852 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_0),
3853 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S6_1),
3854 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_0),
3855 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S7_1),
3856 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_0),
3857 MSM_RPM_STATUS_ID_MAP(8960, PM8921_S8_1),
3858 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_0),
3859 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L1_1),
3860 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_0),
3861 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L2_1),
3862 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_0),
3863 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L3_1),
3864 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_0),
3865 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L4_1),
3866 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_0),
3867 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L5_1),
3868 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_0),
3869 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L6_1),
3870 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_0),
3871 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L7_1),
3872 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_0),
3873 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L8_1),
3874 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_0),
3875 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L9_1),
3876 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_0),
3877 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L10_1),
3878 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_0),
3879 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L11_1),
3880 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_0),
3881 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L12_1),
3882 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_0),
3883 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L13_1),
3884 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_0),
3885 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L14_1),
3886 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_0),
3887 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L15_1),
3888 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_0),
3889 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L16_1),
3890 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_0),
3891 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L17_1),
3892 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_0),
3893 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L18_1),
3894 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_0),
3895 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L19_1),
3896 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_0),
3897 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L20_1),
3898 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_0),
3899 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L21_1),
3900 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_0),
3901 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L22_1),
3902 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_0),
3903 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L23_1),
3904 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_0),
3905 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L24_1),
3906 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_0),
3907 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L25_1),
3908 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_0),
3909 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L26_1),
3910 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_0),
3911 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L27_1),
3912 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_0),
3913 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L28_1),
3914 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_0),
3915 MSM_RPM_STATUS_ID_MAP(8960, PM8921_L29_1),
3916 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_0),
3917 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK1_1),
3918 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_0),
3919 MSM_RPM_STATUS_ID_MAP(8960, PM8921_CLK2_1),
3920 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS1),
3921 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS2),
3922 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS3),
3923 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS4),
3924 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS5),
3925 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS6),
3926 MSM_RPM_STATUS_ID_MAP(8960, PM8921_LVS7),
3927 MSM_RPM_STATUS_ID_MAP(8960, NCP_0),
3928 MSM_RPM_STATUS_ID_MAP(8960, NCP_1),
3929 MSM_RPM_STATUS_ID_MAP(8960, CXO_BUFFERS),
3930 MSM_RPM_STATUS_ID_MAP(8960, USB_OTG_SWITCH),
3931 MSM_RPM_STATUS_ID_MAP(8960, HDMI_SWITCH),
3932 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_0),
3933 MSM_RPM_STATUS_ID_MAP(8960, DDR_DMM_1),
3934 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH0_RANGE),
3935 MSM_RPM_STATUS_ID_MAP(8960, EBI1_CH1_RANGE),
3936 },
3937 .target_ctrl_id = {
3938 MSM_RPM_CTRL_MAP(8960, VERSION_MAJOR),
3939 MSM_RPM_CTRL_MAP(8960, VERSION_MINOR),
3940 MSM_RPM_CTRL_MAP(8960, VERSION_BUILD),
3941 MSM_RPM_CTRL_MAP(8960, REQ_CTX_0),
3942 MSM_RPM_CTRL_MAP(8960, REQ_SEL_0),
3943 MSM_RPM_CTRL_MAP(8960, ACK_CTX_0),
3944 MSM_RPM_CTRL_MAP(8960, ACK_SEL_0),
3945 },
3946 .sel_invalidate = MSM_RPM_8960_SEL_INVALIDATE,
3947 .sel_notification = MSM_RPM_8960_SEL_NOTIFICATION,
3948 .sel_last = MSM_RPM_8960_SEL_LAST,
3949 .ver = {3, 0, 0},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003950};
Praveen Chidambaram8985b012011-12-16 13:38:59 -07003951
Praveen Chidambaram78499012011-11-01 17:15:17 -06003952struct platform_device msm8960_rpm_device = {
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06003953 .name = "msm_rpm",
3954 .id = -1,
3955};
3956
Praveen Chidambaram78499012011-11-01 17:15:17 -06003957static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
3958 .phys_addr_base = 0x0010C000,
3959 .reg_offsets = {
3960 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
3961 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
3962 },
3963 .phys_size = SZ_8K,
Anji Jonnala11efe5a2013-03-28 13:45:58 +05303964 .log_len = 6144, /* log's buffer length in bytes */
3965 .log_len_mask = (6144 >> 2) - 1, /* length mask in units of u32 */
Praveen Chidambaram78499012011-11-01 17:15:17 -06003966};
3967
3968struct platform_device msm8960_rpm_log_device = {
3969 .name = "msm_rpm_log",
3970 .id = -1,
3971 .dev = {
3972 .platform_data = &msm_rpm_log_pdata,
3973 },
3974};
3975
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003976static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
Priyanka Mathur71859f42012-10-17 10:54:35 -07003977 .version = 1,
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003978};
3979
Priyanka Mathur71859f42012-10-17 10:54:35 -07003980static struct resource msm_rpm_stat_resource[] = {
3981 {
3982 .start = 0x0010D204,
3983 .end = 0x0010D204 + SZ_8K,
3984 .flags = IORESOURCE_MEM,
3985 .name = "phys_addr_base"
3986 },
3987};
3988
3989
3990
Praveen Chidambaram78499012011-11-01 17:15:17 -06003991struct platform_device msm8960_rpm_stat_device = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003992 .name = "msm_rpm_stat",
3993 .id = -1,
Priyanka Mathur71859f42012-10-17 10:54:35 -07003994 .resource = msm_rpm_stat_resource,
3995 .num_resources = ARRAY_SIZE(msm_rpm_stat_resource),
3996 .dev = {
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003997 .platform_data = &msm_rpm_stat_pdata,
Priyanka Mathur71859f42012-10-17 10:54:35 -07003998 }
Praveen Chidambaram7a712232011-10-28 13:39:45 -06003999};
Maheshkumar Sivasubramanian9c8cdc92011-09-12 14:11:30 -06004000
Anji Jonnala93129922012-10-09 20:57:53 +05304001static struct resource resources_rpm_master_stats[] = {
4002 {
4003 .start = MSM8960_RPM_MASTER_STATS_BASE,
4004 .end = MSM8960_RPM_MASTER_STATS_BASE + SZ_256,
4005 .flags = IORESOURCE_MEM,
4006 },
4007};
4008
4009static char *master_names[] = {
4010 "KPSS",
4011 "GPSS",
4012 "LPASS",
4013 "RIVA",
4014 "DSPS",
4015};
4016
4017static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
4018 .masters = master_names,
4019 .nomasters = ARRAY_SIZE(master_names),
4020};
4021
4022struct platform_device msm8960_rpm_master_stat_device = {
4023 .name = "msm_rpm_master_stat",
4024 .id = -1,
4025 .num_resources = ARRAY_SIZE(resources_rpm_master_stats),
4026 .resource = resources_rpm_master_stats,
4027 .dev = {
4028 .platform_data = &msm_rpm_master_stat_pdata,
4029 },
4030};
4031
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004032struct platform_device msm_bus_sys_fabric = {
4033 .name = "msm_bus_fabric",
4034 .id = MSM_BUS_FAB_SYSTEM,
4035};
4036struct platform_device msm_bus_apps_fabric = {
4037 .name = "msm_bus_fabric",
4038 .id = MSM_BUS_FAB_APPSS,
4039};
4040struct platform_device msm_bus_mm_fabric = {
4041 .name = "msm_bus_fabric",
4042 .id = MSM_BUS_FAB_MMSS,
4043};
4044struct platform_device msm_bus_sys_fpb = {
4045 .name = "msm_bus_fabric",
4046 .id = MSM_BUS_FAB_SYSTEM_FPB,
4047};
4048struct platform_device msm_bus_cpss_fpb = {
4049 .name = "msm_bus_fabric",
4050 .id = MSM_BUS_FAB_CPSS_FPB,
4051};
4052
4053/* Sensors DSPS platform data */
4054#ifdef CONFIG_MSM_DSPS
4055
Stephen Boydf169b4b2012-05-10 17:55:55 -07004056#define PPSS_REG_PHYS_BASE 0x12080000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004057
4058static struct dsps_clk_info dsps_clks[] = {};
4059static struct dsps_regulator_info dsps_regs[] = {};
4060
4061/*
4062 * Note: GPIOs field is intialized in run-time at the function
4063 * msm8960_init_dsps().
4064 */
4065
4066struct msm_dsps_platform_data msm_dsps_pdata = {
4067 .clks = dsps_clks,
4068 .clks_num = ARRAY_SIZE(dsps_clks),
4069 .gpios = NULL,
4070 .gpios_num = 0,
4071 .regs = dsps_regs,
4072 .regs_num = ARRAY_SIZE(dsps_regs),
4073 .dsps_pwr_ctl_en = 1,
4074 .signature = DSPS_SIGNATURE,
4075};
4076
4077static struct resource msm_dsps_resources[] = {
4078 {
4079 .start = PPSS_REG_PHYS_BASE,
4080 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
4081 .name = "ppss_reg",
4082 .flags = IORESOURCE_MEM,
4083 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07004084};
4085
4086struct platform_device msm_dsps_device = {
4087 .name = "msm_dsps",
4088 .id = 0,
4089 .num_resources = ARRAY_SIZE(msm_dsps_resources),
4090 .resource = msm_dsps_resources,
4091 .dev.platform_data = &msm_dsps_pdata,
4092};
4093
4094#endif /* CONFIG_MSM_DSPS */
Pratik Patel7831c082011-06-08 21:44:37 -07004095
Pratik Patel3b0ca882012-06-01 16:54:14 -07004096#define CORESIGHT_PHYS_BASE 0x01A00000
4097#define CORESIGHT_TPIU_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x3000)
4098#define CORESIGHT_ETB_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1000)
4099#define CORESIGHT_FUNNEL_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x4000)
4100#define CORESIGHT_STM_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x6000)
4101#define CORESIGHT_ETM0_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1C000)
4102#define CORESIGHT_ETM1_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1D000)
Pratik Patel7831c082011-06-08 21:44:37 -07004103
Pratik Patel3b0ca882012-06-01 16:54:14 -07004104#define CORESIGHT_STM_CHANNEL_PHYS_BASE (0x14000000 + 0x280000)
Pratik Patel7831c082011-06-08 21:44:37 -07004105
Pratik Patel3b0ca882012-06-01 16:54:14 -07004106static struct resource coresight_tpiu_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07004107 {
Aparna Das360cf422013-03-19 18:18:01 -07004108 .name = "tpiu-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004109 .start = CORESIGHT_TPIU_PHYS_BASE,
4110 .end = CORESIGHT_TPIU_PHYS_BASE + SZ_4K - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07004111 .flags = IORESOURCE_MEM,
4112 },
4113};
4114
Pratik Patel3b0ca882012-06-01 16:54:14 -07004115static struct coresight_platform_data coresight_tpiu_pdata = {
4116 .id = 0,
4117 .name = "coresight-tpiu",
4118 .nr_inports = 1,
4119 .nr_outports = 0,
Pratik Patel7831c082011-06-08 21:44:37 -07004120};
4121
Pratik Patel3b0ca882012-06-01 16:54:14 -07004122struct platform_device coresight_tpiu_device = {
4123 .name = "coresight-tpiu",
4124 .id = 0,
4125 .num_resources = ARRAY_SIZE(coresight_tpiu_resources),
4126 .resource = coresight_tpiu_resources,
4127 .dev = {
4128 .platform_data = &coresight_tpiu_pdata,
4129 },
4130};
4131
4132static struct resource coresight_etb_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07004133 {
Aparna Das360cf422013-03-19 18:18:01 -07004134 .name = "etb-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004135 .start = CORESIGHT_ETB_PHYS_BASE,
4136 .end = CORESIGHT_ETB_PHYS_BASE + SZ_4K - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07004137 .flags = IORESOURCE_MEM,
4138 },
4139};
4140
Pratik Patel3b0ca882012-06-01 16:54:14 -07004141static struct coresight_platform_data coresight_etb_pdata = {
4142 .id = 1,
4143 .name = "coresight-etb",
4144 .nr_inports = 1,
4145 .nr_outports = 0,
4146 .default_sink = true,
Pratik Patel7831c082011-06-08 21:44:37 -07004147};
4148
Pratik Patel3b0ca882012-06-01 16:54:14 -07004149struct platform_device coresight_etb_device = {
4150 .name = "coresight-etb",
4151 .id = 0,
4152 .num_resources = ARRAY_SIZE(coresight_etb_resources),
4153 .resource = coresight_etb_resources,
4154 .dev = {
4155 .platform_data = &coresight_etb_pdata,
4156 },
4157};
4158
4159static struct resource coresight_funnel_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07004160 {
Aparna Das360cf422013-03-19 18:18:01 -07004161 .name = "funnel-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004162 .start = CORESIGHT_FUNNEL_PHYS_BASE,
4163 .end = CORESIGHT_FUNNEL_PHYS_BASE + SZ_4K - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07004164 .flags = IORESOURCE_MEM,
4165 },
4166};
4167
Pratik Patel3b0ca882012-06-01 16:54:14 -07004168static const int coresight_funnel_outports[] = { 0, 1 };
4169static const int coresight_funnel_child_ids[] = { 0, 1 };
4170static const int coresight_funnel_child_ports[] = { 0, 0 };
4171
4172static struct coresight_platform_data coresight_funnel_pdata = {
4173 .id = 2,
4174 .name = "coresight-funnel",
4175 .nr_inports = 4,
4176 .outports = coresight_funnel_outports,
4177 .child_ids = coresight_funnel_child_ids,
4178 .child_ports = coresight_funnel_child_ports,
4179 .nr_outports = ARRAY_SIZE(coresight_funnel_outports),
Pratik Patel7831c082011-06-08 21:44:37 -07004180};
4181
Pratik Patel3b0ca882012-06-01 16:54:14 -07004182struct platform_device coresight_funnel_device = {
4183 .name = "coresight-funnel",
4184 .id = 0,
4185 .num_resources = ARRAY_SIZE(coresight_funnel_resources),
4186 .resource = coresight_funnel_resources,
4187 .dev = {
4188 .platform_data = &coresight_funnel_pdata,
4189 },
4190};
4191
4192static struct resource coresight_stm_resources[] = {
Pratik Patel7831c082011-06-08 21:44:37 -07004193 {
Aparna Das360cf422013-03-19 18:18:01 -07004194 .name = "stm-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004195 .start = CORESIGHT_STM_PHYS_BASE,
4196 .end = CORESIGHT_STM_PHYS_BASE + SZ_4K - 1,
4197 .flags = IORESOURCE_MEM,
4198 },
4199 {
Aparna Das360cf422013-03-19 18:18:01 -07004200 .name = "stm-data-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004201 .start = CORESIGHT_STM_CHANNEL_PHYS_BASE,
4202 .end = CORESIGHT_STM_CHANNEL_PHYS_BASE + SZ_1M + SZ_512K - 1,
Pratik Patel7831c082011-06-08 21:44:37 -07004203 .flags = IORESOURCE_MEM,
4204 },
4205};
4206
Pratik Patel3b0ca882012-06-01 16:54:14 -07004207static const int coresight_stm_outports[] = { 0 };
4208static const int coresight_stm_child_ids[] = { 2 };
4209static const int coresight_stm_child_ports[] = { 2 };
4210
4211static struct coresight_platform_data coresight_stm_pdata = {
4212 .id = 3,
4213 .name = "coresight-stm",
4214 .nr_inports = 0,
4215 .outports = coresight_stm_outports,
4216 .child_ids = coresight_stm_child_ids,
4217 .child_ports = coresight_stm_child_ports,
4218 .nr_outports = ARRAY_SIZE(coresight_stm_outports),
Pratik Patel7831c082011-06-08 21:44:37 -07004219};
4220
Pratik Patel3b0ca882012-06-01 16:54:14 -07004221struct platform_device coresight_stm_device = {
4222 .name = "coresight-stm",
4223 .id = 0,
4224 .num_resources = ARRAY_SIZE(coresight_stm_resources),
4225 .resource = coresight_stm_resources,
4226 .dev = {
4227 .platform_data = &coresight_stm_pdata,
4228 },
4229};
4230
4231static struct resource coresight_etm0_resources[] = {
4232 {
Aparna Das360cf422013-03-19 18:18:01 -07004233 .name = "etm-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004234 .start = CORESIGHT_ETM0_PHYS_BASE,
4235 .end = CORESIGHT_ETM0_PHYS_BASE + SZ_4K - 1,
4236 .flags = IORESOURCE_MEM,
4237 },
4238};
4239
4240static const int coresight_etm0_outports[] = { 0 };
4241static const int coresight_etm0_child_ids[] = { 2 };
4242static const int coresight_etm0_child_ports[] = { 0 };
4243
4244static struct coresight_platform_data coresight_etm0_pdata = {
4245 .id = 4,
4246 .name = "coresight-etm0",
4247 .nr_inports = 0,
4248 .outports = coresight_etm0_outports,
4249 .child_ids = coresight_etm0_child_ids,
4250 .child_ports = coresight_etm0_child_ports,
4251 .nr_outports = ARRAY_SIZE(coresight_etm0_outports),
4252};
4253
4254struct platform_device coresight_etm0_device = {
4255 .name = "coresight-etm",
4256 .id = 0,
4257 .num_resources = ARRAY_SIZE(coresight_etm0_resources),
4258 .resource = coresight_etm0_resources,
4259 .dev = {
4260 .platform_data = &coresight_etm0_pdata,
4261 },
4262};
4263
4264static struct resource coresight_etm1_resources[] = {
4265 {
Aparna Das360cf422013-03-19 18:18:01 -07004266 .name = "etm-base",
Pratik Patel3b0ca882012-06-01 16:54:14 -07004267 .start = CORESIGHT_ETM1_PHYS_BASE,
4268 .end = CORESIGHT_ETM1_PHYS_BASE + SZ_4K - 1,
4269 .flags = IORESOURCE_MEM,
4270 },
4271};
4272
4273static const int coresight_etm1_outports[] = { 0 };
4274static const int coresight_etm1_child_ids[] = { 2 };
4275static const int coresight_etm1_child_ports[] = { 1 };
4276
4277static struct coresight_platform_data coresight_etm1_pdata = {
4278 .id = 5,
4279 .name = "coresight-etm1",
4280 .nr_inports = 0,
4281 .outports = coresight_etm1_outports,
4282 .child_ids = coresight_etm1_child_ids,
4283 .child_ports = coresight_etm1_child_ports,
4284 .nr_outports = ARRAY_SIZE(coresight_etm1_outports),
4285};
4286
4287struct platform_device coresight_etm1_device = {
4288 .name = "coresight-etm",
4289 .id = 1,
4290 .num_resources = ARRAY_SIZE(coresight_etm1_resources),
4291 .resource = coresight_etm1_resources,
4292 .dev = {
4293 .platform_data = &coresight_etm1_pdata,
4294 },
4295};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07004296
Stepan Moskovchenkoc0557252012-06-07 17:39:14 -07004297static struct resource msm_ebi1_ch0_erp_resources[] = {
4298 {
4299 .start = HSDDRX_EBI1CH0_IRQ,
4300 .flags = IORESOURCE_IRQ,
4301 },
4302 {
4303 .start = 0x00A40000,
4304 .end = 0x00A40000 + SZ_4K - 1,
4305 .flags = IORESOURCE_MEM,
4306 },
4307};
4308
4309struct platform_device msm8960_device_ebi1_ch0_erp = {
4310 .name = "msm_ebi_erp",
4311 .id = 0,
4312 .num_resources = ARRAY_SIZE(msm_ebi1_ch0_erp_resources),
4313 .resource = msm_ebi1_ch0_erp_resources,
4314};
4315
4316static struct resource msm_ebi1_ch1_erp_resources[] = {
4317 {
4318 .start = HSDDRX_EBI1CH1_IRQ,
4319 .flags = IORESOURCE_IRQ,
4320 },
4321 {
4322 .start = 0x00D40000,
4323 .end = 0x00D40000 + SZ_4K - 1,
4324 .flags = IORESOURCE_MEM,
4325 },
4326};
4327
4328struct platform_device msm8960_device_ebi1_ch1_erp = {
4329 .name = "msm_ebi_erp",
4330 .id = 1,
4331 .num_resources = ARRAY_SIZE(msm_ebi1_ch1_erp_resources),
4332 .resource = msm_ebi1_ch1_erp_resources,
4333};
4334
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08004335static struct resource msm_cache_erp_resources[] = {
4336 {
4337 .name = "l1_irq",
4338 .start = SC_SICCPUXEXTFAULTIRPTREQ,
4339 .flags = IORESOURCE_IRQ,
4340 },
4341 {
4342 .name = "l2_irq",
4343 .start = APCC_QGICL2IRPTREQ,
4344 .flags = IORESOURCE_IRQ,
4345 }
4346};
4347
4348struct platform_device msm8960_device_cache_erp = {
4349 .name = "msm_cache_erp",
4350 .id = -1,
4351 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
4352 .resource = msm_cache_erp_resources,
4353};
Laura Abbott0577d7b2012-04-17 11:14:30 -07004354
4355struct msm_iommu_domain_name msm8960_iommu_ctx_names[] = {
4356 /* Camera */
4357 {
Laura Abbott0577d7b2012-04-17 11:14:30 -07004358 .name = "ijpeg_src",
4359 .domain = CAMERA_DOMAIN,
4360 },
4361 /* Camera */
4362 {
4363 .name = "ijpeg_dst",
4364 .domain = CAMERA_DOMAIN,
4365 },
4366 /* Camera */
4367 {
4368 .name = "jpegd_src",
4369 .domain = CAMERA_DOMAIN,
4370 },
4371 /* Camera */
4372 {
4373 .name = "jpegd_dst",
4374 .domain = CAMERA_DOMAIN,
4375 },
Mayank Chopra9c4743f2012-06-27 15:31:43 +05304376 /* Rotator */
Laura Abbott0577d7b2012-04-17 11:14:30 -07004377 {
4378 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07004379 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07004380 },
Mayank Chopra9c4743f2012-06-27 15:31:43 +05304381 /* Rotator */
Laura Abbott0577d7b2012-04-17 11:14:30 -07004382 {
4383 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07004384 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07004385 },
4386 /* Video */
4387 {
4388 .name = "vcodec_a_mm1",
4389 .domain = VIDEO_DOMAIN,
4390 },
4391 /* Video */
4392 {
4393 .name = "vcodec_b_mm2",
4394 .domain = VIDEO_DOMAIN,
4395 },
4396 /* Video */
4397 {
4398 .name = "vcodec_a_stream",
4399 .domain = VIDEO_DOMAIN,
4400 },
4401};
4402
4403static struct mem_pool msm8960_video_pools[] = {
4404 /*
4405 * Video hardware has the following requirements:
4406 * 1. All video addresses used by the video hardware must be at a higher
4407 * address than video firmware address.
4408 * 2. Video hardware can only access a range of 256MB from the base of
4409 * the video firmware.
4410 */
4411 [VIDEO_FIRMWARE_POOL] =
4412 /* Low addresses, intended for video firmware */
4413 {
4414 .paddr = SZ_128K,
4415 .size = SZ_16M - SZ_128K,
4416 },
4417 [VIDEO_MAIN_POOL] =
4418 /* Main video pool */
4419 {
4420 .paddr = SZ_16M,
4421 .size = SZ_256M - SZ_16M,
4422 },
4423 [GEN_POOL] =
4424 /* Remaining address space up to 2G */
4425 {
4426 .paddr = SZ_256M,
4427 .size = SZ_2G - SZ_256M,
4428 },
4429};
4430
4431static struct mem_pool msm8960_camera_pools[] = {
4432 [GEN_POOL] =
4433 /* One address space for camera */
4434 {
4435 .paddr = SZ_128K,
4436 .size = SZ_2G - SZ_128K,
4437 },
4438};
4439
Olav Hauganef95ae32012-05-15 09:50:30 -07004440static struct mem_pool msm8960_display_read_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07004441 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07004442 /* One address space for display reads */
Laura Abbott0577d7b2012-04-17 11:14:30 -07004443 {
4444 .paddr = SZ_128K,
4445 .size = SZ_2G - SZ_128K,
4446 },
4447};
4448
Olav Hauganef95ae32012-05-15 09:50:30 -07004449static struct mem_pool msm8960_rotator_src_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07004450 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07004451 /* One address space for rotator src */
Laura Abbott0577d7b2012-04-17 11:14:30 -07004452 {
4453 .paddr = SZ_128K,
4454 .size = SZ_2G - SZ_128K,
4455 },
4456};
4457
4458static struct msm_iommu_domain msm8960_iommu_domains[] = {
4459 [VIDEO_DOMAIN] = {
4460 .iova_pools = msm8960_video_pools,
4461 .npools = ARRAY_SIZE(msm8960_video_pools),
4462 },
4463 [CAMERA_DOMAIN] = {
4464 .iova_pools = msm8960_camera_pools,
4465 .npools = ARRAY_SIZE(msm8960_camera_pools),
4466 },
Olav Hauganef95ae32012-05-15 09:50:30 -07004467 [DISPLAY_READ_DOMAIN] = {
4468 .iova_pools = msm8960_display_read_pools,
4469 .npools = ARRAY_SIZE(msm8960_display_read_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07004470 },
Olav Hauganef95ae32012-05-15 09:50:30 -07004471 [ROTATOR_SRC_DOMAIN] = {
4472 .iova_pools = msm8960_rotator_src_pools,
4473 .npools = ARRAY_SIZE(msm8960_rotator_src_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07004474 },
4475};
4476
4477struct iommu_domains_pdata msm8960_iommu_domain_pdata = {
4478 .domains = msm8960_iommu_domains,
4479 .ndomains = ARRAY_SIZE(msm8960_iommu_domains),
4480 .domain_names = msm8960_iommu_ctx_names,
4481 .nnames = ARRAY_SIZE(msm8960_iommu_ctx_names),
4482 .domain_alloc_flags = 0,
4483};
4484
4485struct platform_device msm8960_iommu_domain_device = {
4486 .name = "iommu_domains",
4487 .id = -1,
4488 .dev = {
4489 .platform_data = &msm8960_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07004490 }
4491};
4492
4493struct msm_rtb_platform_data msm8960_rtb_pdata = {
4494 .size = SZ_1M,
4495};
4496
4497static int __init msm_rtb_set_buffer_size(char *p)
4498{
4499 int s;
4500
4501 s = memparse(p, NULL);
4502 msm8960_rtb_pdata.size = ALIGN(s, SZ_4K);
4503 return 0;
4504}
4505early_param("msm_rtb_size", msm_rtb_set_buffer_size);
4506
4507
4508struct platform_device msm8960_rtb_device = {
4509 .name = "msm_rtb",
4510 .id = -1,
4511 .dev = {
4512 .platform_data = &msm8960_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07004513 },
4514};
Laura Abbott2ae8f362012-04-12 11:03:04 -07004515
Laura Abbott0a103cf2012-05-25 09:00:23 -07004516#define MSM_8960_L1_SIZE SZ_1M
4517/*
4518 * The actual L2 size is smaller but we need a larger buffer
4519 * size to store other dump information
4520 */
4521#define MSM_8960_L2_SIZE SZ_4M
4522
Laura Abbott2ae8f362012-04-12 11:03:04 -07004523struct msm_cache_dump_platform_data msm8960_cache_dump_pdata = {
Laura Abbott0a103cf2012-05-25 09:00:23 -07004524 .l2_size = MSM_8960_L2_SIZE,
4525 .l1_size = MSM_8960_L1_SIZE,
Laura Abbott2ae8f362012-04-12 11:03:04 -07004526};
4527
4528struct platform_device msm8960_cache_dump_device = {
4529 .name = "msm_cache_dump",
4530 .id = -1,
4531 .dev = {
4532 .platform_data = &msm8960_cache_dump_pdata,
4533 },
4534};
Joel King0cbf5d82012-05-24 15:21:38 -07004535
4536#define MDM2AP_ERRFATAL 40
4537#define AP2MDM_ERRFATAL 80
4538#define MDM2AP_STATUS 24
4539#define AP2MDM_STATUS 77
4540#define AP2MDM_PMIC_PWR_EN 22
4541#define AP2MDM_KPDPWR_N 79
4542#define AP2MDM_SOFT_RESET 78
Ameya Thakur43248fd2012-07-10 18:50:52 -07004543#define USB_SW 25
Joel King0cbf5d82012-05-24 15:21:38 -07004544
4545static struct resource sglte_resources[] = {
4546 {
4547 .start = MDM2AP_ERRFATAL,
4548 .end = MDM2AP_ERRFATAL,
4549 .name = "MDM2AP_ERRFATAL",
4550 .flags = IORESOURCE_IO,
4551 },
4552 {
4553 .start = AP2MDM_ERRFATAL,
4554 .end = AP2MDM_ERRFATAL,
4555 .name = "AP2MDM_ERRFATAL",
4556 .flags = IORESOURCE_IO,
4557 },
4558 {
4559 .start = MDM2AP_STATUS,
4560 .end = MDM2AP_STATUS,
4561 .name = "MDM2AP_STATUS",
4562 .flags = IORESOURCE_IO,
4563 },
4564 {
4565 .start = AP2MDM_STATUS,
4566 .end = AP2MDM_STATUS,
4567 .name = "AP2MDM_STATUS",
4568 .flags = IORESOURCE_IO,
4569 },
4570 {
4571 .start = AP2MDM_PMIC_PWR_EN,
4572 .end = AP2MDM_PMIC_PWR_EN,
4573 .name = "AP2MDM_PMIC_PWR_EN",
4574 .flags = IORESOURCE_IO,
4575 },
4576 {
4577 .start = AP2MDM_KPDPWR_N,
4578 .end = AP2MDM_KPDPWR_N,
4579 .name = "AP2MDM_KPDPWR_N",
4580 .flags = IORESOURCE_IO,
4581 },
4582 {
4583 .start = AP2MDM_SOFT_RESET,
4584 .end = AP2MDM_SOFT_RESET,
4585 .name = "AP2MDM_SOFT_RESET",
4586 .flags = IORESOURCE_IO,
4587 },
Ameya Thakur43248fd2012-07-10 18:50:52 -07004588 {
4589 .start = USB_SW,
4590 .end = USB_SW,
4591 .name = "USB_SW",
4592 .flags = IORESOURCE_IO,
4593 },
Joel King0cbf5d82012-05-24 15:21:38 -07004594};
4595
Rohit Vaswanid2001522012-12-05 19:23:44 -08004596static struct resource msm_gpio_resources[] = {
4597 {
4598 .start = TLMM_MSM_SUMMARY_IRQ,
4599 .end = TLMM_MSM_SUMMARY_IRQ,
4600 .flags = IORESOURCE_IRQ,
4601 },
4602};
4603
Rohit Vaswani341c2032012-11-08 18:49:29 -08004604static struct msm_gpio_pdata msm8960_gpio_pdata = {
4605 .ngpio = 152,
Rohit Vaswanied0a4ef2012-12-11 15:14:42 -08004606 .direct_connect_irqs = 8,
Rohit Vaswani341c2032012-11-08 18:49:29 -08004607};
4608
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07004609struct platform_device msm_gpio_device = {
Rohit Vaswani341c2032012-11-08 18:49:29 -08004610 .name = "msmgpio",
4611 .id = -1,
4612 .num_resources = ARRAY_SIZE(msm_gpio_resources),
4613 .resource = msm_gpio_resources,
4614 .dev.platform_data = &msm8960_gpio_pdata,
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07004615};
4616
Joel King0cbf5d82012-05-24 15:21:38 -07004617struct platform_device mdm_sglte_device = {
4618 .name = "mdm2_modem",
4619 .id = -1,
4620 .num_resources = ARRAY_SIZE(sglte_resources),
4621 .resource = sglte_resources,
4622};
Arun Menon697e91b2012-08-20 15:25:50 -07004623
4624struct platform_device *msm8960_vidc_device[] __initdata = {
Arun Menon8ef6d5a2013-01-04 21:20:26 -08004625 &msm_device_vidc,
4626 &msm_device_vidc_v4l2,
Arun Menon697e91b2012-08-20 15:25:50 -07004627};
4628
4629void __init msm8960_add_vidc_device(void)
4630{
4631 if (cpu_is_msm8960ab()) {
4632 struct msm_vidc_platform_data *pdata;
4633 pdata = (struct msm_vidc_platform_data *)
4634 msm_device_vidc.dev.platform_data;
4635 pdata->vidc_bus_client_pdata = &vidc_pro_bus_client_data;
4636 }
4637 platform_add_devices(msm8960_vidc_device,
4638 ARRAY_SIZE(msm8960_vidc_device));
4639}