blob: c6a0441d96735d121cf3d641a57b5613ea4aa6e6 [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/platform_device.h>
17#include <linux/msm_rotator.h>
Joel Nidere5de00e2012-07-03 10:58:10 +030018#include <linux/gpio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/clkdev.h>
Hemant Kumard86c4882012-01-24 19:39:37 -080020#include <linux/dma-mapping.h>
Pratik Patel1746b8f2012-06-02 21:11:41 -070021#include <linux/coresight.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070022#include <mach/irqs-8064.h>
23#include <mach/board.h>
24#include <mach/msm_iomap.h>
Yan He06913ce2011-08-26 16:33:46 -070025#include <mach/usbdiag.h>
26#include <mach/msm_sps.h>
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -070027#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080028#include <mach/msm_dsps.h>
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -080029#include <sound/msm-dai-q6.h>
30#include <sound/apr_audio.h>
Joel Nidere5de00e2012-07-03 10:58:10 +030031#include <mach/msm_tsif.h>
Joel Nider50b50fa2012-08-05 14:17:29 +030032#include <mach/msm_tspp.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070033#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060034#include <mach/rpm.h>
Joel Kingdacbc822012-01-25 13:30:57 -080035#include <mach/mdm2.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070036#include <mach/msm_smd.h>
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070037#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070038#include <mach/msm_rtb.h>
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -080039#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#include "clock.h"
41#include "devices.h"
Matt Wagantall1875d322012-02-22 16:11:33 -080042#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070043#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060044#include "rpm_stats.h"
45#include "rpm_log.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053046#include <mach/mpm.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070047#include <mach/iommu_domains.h>
Laura Abbott93a4a352012-05-25 09:26:35 -070048#include <mach/msm_cache_dump.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049
50/* Address of GSBI blocks */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070051#define MSM_GSBI1_PHYS 0x12440000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052#define MSM_GSBI3_PHYS 0x16200000
Harini Jayaramanc4c58692011-07-19 14:50:10 -060053#define MSM_GSBI4_PHYS 0x16300000
54#define MSM_GSBI5_PHYS 0x1A200000
55#define MSM_GSBI6_PHYS 0x16500000
56#define MSM_GSBI7_PHYS 0x16600000
57
Kenneth Heitke748593a2011-07-15 15:45:11 -060058/* GSBI UART devices */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070059#define MSM_UART1DM_PHYS (MSM_GSBI1_PHYS + 0x10000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
Jin Hong4bbbfba2012-02-02 21:48:07 -080061#define MSM_UART7DM_PHYS (MSM_GSBI7_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062
Harini Jayaramanc4c58692011-07-19 14:50:10 -060063/* GSBI QUP devices */
David Keitel3c40fc52012-02-09 17:53:52 -080064#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x20000)
Harini Jayaramanc4c58692011-07-19 14:50:10 -060065#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
66#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
67#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
68#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
69#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
70#define MSM_QUP_SIZE SZ_4K
71
Kenneth Heitke36920d32011-07-20 16:44:30 -060072/* Address of SSBI CMD */
73#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
74#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
75#define MSM_PMIC_SSBI_SIZE SZ_4K
Harini Jayaramanc4c58692011-07-19 14:50:10 -060076
Hemant Kumarcaa09092011-07-30 00:26:33 -070077/* Address of HS USBOTG1 */
Hemant Kumard86c4882012-01-24 19:39:37 -080078#define MSM_HSUSB1_PHYS 0x12500000
79#define MSM_HSUSB1_SIZE SZ_4K
Hemant Kumarcaa09092011-07-30 00:26:33 -070080
Manu Gautam91223e02011-11-08 15:27:22 +053081/* Address of HS USB3 */
82#define MSM_HSUSB3_PHYS 0x12520000
83#define MSM_HSUSB3_SIZE SZ_4K
84
Hemant Kumar1d66e1c2012-02-13 15:24:59 -080085/* Address of HS USB4 */
86#define MSM_HSUSB4_PHYS 0x12530000
87#define MSM_HSUSB4_SIZE SZ_4K
88
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060089/* Address of PCIE20 PARF */
90#define PCIE20_PARF_PHYS 0x1b600000
91#define PCIE20_PARF_SIZE SZ_128
92
93/* Address of PCIE20 ELBI */
94#define PCIE20_ELBI_PHYS 0x1b502000
95#define PCIE20_ELBI_SIZE SZ_256
96
97/* Address of PCIE20 */
98#define PCIE20_PHYS 0x1b500000
99#define PCIE20_SIZE SZ_4K
100
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700101static struct msm_watchdog_pdata msm_watchdog_pdata = {
102 .pet_time = 10000,
103 .bark_time = 11000,
104 .has_secure = true,
Joel Kinge7ca6f72012-02-09 20:51:25 -0800105 .needs_expired_enable = true,
Rohit Vaswanic77e4a62012-08-09 18:10:28 -0700106 .base = MSM_TMR0_BASE + WDT0_OFFSET,
107};
108
109static struct resource msm_watchdog_resources[] = {
110 {
111 .start = WDT0_ACCSCSSNBARK_INT,
112 .end = WDT0_ACCSCSSNBARK_INT,
113 .flags = IORESOURCE_IRQ,
114 },
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700115};
116
117struct platform_device msm8064_device_watchdog = {
118 .name = "msm_watchdog",
119 .id = -1,
120 .dev = {
121 .platform_data = &msm_watchdog_pdata,
122 },
Rohit Vaswanic77e4a62012-08-09 18:10:28 -0700123 .num_resources = ARRAY_SIZE(msm_watchdog_resources),
124 .resource = msm_watchdog_resources,
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700125};
126
Joel King0581896d2011-07-19 16:43:28 -0700127static struct resource msm_dmov_resource[] = {
128 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800129 .start = ADM_0_SCSS_1_IRQ,
Joel King0581896d2011-07-19 16:43:28 -0700130 .flags = IORESOURCE_IRQ,
131 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700132 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800133 .start = 0x18320000,
134 .end = 0x18320000 + SZ_1M - 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700135 .flags = IORESOURCE_MEM,
136 },
137};
138
139static struct msm_dmov_pdata msm_dmov_pdata = {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800140 .sd = 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700141 .sd_size = 0x800,
Joel King0581896d2011-07-19 16:43:28 -0700142};
143
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700144struct platform_device apq8064_device_dmov = {
Joel King0581896d2011-07-19 16:43:28 -0700145 .name = "msm_dmov",
146 .id = -1,
147 .resource = msm_dmov_resource,
148 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700149 .dev = {
150 .platform_data = &msm_dmov_pdata,
151 },
Joel King0581896d2011-07-19 16:43:28 -0700152};
153
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700154static struct resource resources_uart_gsbi1[] = {
155 {
156 .start = APQ8064_GSBI1_UARTDM_IRQ,
157 .end = APQ8064_GSBI1_UARTDM_IRQ,
158 .flags = IORESOURCE_IRQ,
159 },
160 {
161 .start = MSM_UART1DM_PHYS,
162 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
163 .name = "uartdm_resource",
164 .flags = IORESOURCE_MEM,
165 },
166 {
167 .start = MSM_GSBI1_PHYS,
168 .end = MSM_GSBI1_PHYS + PAGE_SIZE - 1,
169 .name = "gsbi_resource",
170 .flags = IORESOURCE_MEM,
171 },
172};
173
174struct platform_device apq8064_device_uart_gsbi1 = {
175 .name = "msm_serial_hsl",
Jin Hong4bbbfba2012-02-02 21:48:07 -0800176 .id = 1,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700177 .num_resources = ARRAY_SIZE(resources_uart_gsbi1),
178 .resource = resources_uart_gsbi1,
179};
180
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700181static struct resource resources_uart_gsbi3[] = {
182 {
183 .start = GSBI3_UARTDM_IRQ,
184 .end = GSBI3_UARTDM_IRQ,
185 .flags = IORESOURCE_IRQ,
186 },
187 {
188 .start = MSM_UART3DM_PHYS,
189 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
190 .name = "uartdm_resource",
191 .flags = IORESOURCE_MEM,
192 },
193 {
194 .start = MSM_GSBI3_PHYS,
195 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
196 .name = "gsbi_resource",
197 .flags = IORESOURCE_MEM,
198 },
199};
200
201struct platform_device apq8064_device_uart_gsbi3 = {
202 .name = "msm_serial_hsl",
203 .id = 0,
204 .num_resources = ARRAY_SIZE(resources_uart_gsbi3),
205 .resource = resources_uart_gsbi3,
206};
207
Jing Lin04601f92012-02-05 15:36:07 -0800208static struct resource resources_qup_i2c_gsbi3[] = {
209 {
210 .name = "gsbi_qup_i2c_addr",
211 .start = MSM_GSBI3_PHYS,
212 .end = MSM_GSBI3_PHYS + 4 - 1,
213 .flags = IORESOURCE_MEM,
214 },
215 {
216 .name = "qup_phys_addr",
217 .start = MSM_GSBI3_QUP_PHYS,
218 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
219 .flags = IORESOURCE_MEM,
220 },
221 {
222 .name = "qup_err_intr",
223 .start = GSBI3_QUP_IRQ,
224 .end = GSBI3_QUP_IRQ,
225 .flags = IORESOURCE_IRQ,
226 },
227 {
228 .name = "i2c_clk",
229 .start = 9,
230 .end = 9,
231 .flags = IORESOURCE_IO,
232 },
233 {
234 .name = "i2c_sda",
235 .start = 8,
236 .end = 8,
237 .flags = IORESOURCE_IO,
238 },
239};
240
David Keitel3c40fc52012-02-09 17:53:52 -0800241static struct resource resources_qup_i2c_gsbi1[] = {
242 {
243 .name = "gsbi_qup_i2c_addr",
244 .start = MSM_GSBI1_PHYS,
245 .end = MSM_GSBI1_PHYS + 4 - 1,
246 .flags = IORESOURCE_MEM,
247 },
248 {
249 .name = "qup_phys_addr",
250 .start = MSM_GSBI1_QUP_PHYS,
251 .end = MSM_GSBI1_QUP_PHYS + MSM_QUP_SIZE - 1,
252 .flags = IORESOURCE_MEM,
253 },
254 {
255 .name = "qup_err_intr",
256 .start = APQ8064_GSBI1_QUP_IRQ,
257 .end = APQ8064_GSBI1_QUP_IRQ,
258 .flags = IORESOURCE_IRQ,
259 },
260 {
261 .name = "i2c_clk",
262 .start = 21,
263 .end = 21,
264 .flags = IORESOURCE_IO,
265 },
266 {
267 .name = "i2c_sda",
268 .start = 20,
269 .end = 20,
270 .flags = IORESOURCE_IO,
271 },
272};
273
274struct platform_device apq8064_device_qup_i2c_gsbi1 = {
275 .name = "qup_i2c",
276 .id = 0,
277 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi1),
278 .resource = resources_qup_i2c_gsbi1,
279};
280
Jing Lin04601f92012-02-05 15:36:07 -0800281struct platform_device apq8064_device_qup_i2c_gsbi3 = {
282 .name = "qup_i2c",
283 .id = 3,
284 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
285 .resource = resources_qup_i2c_gsbi3,
286};
287
Kenneth Heitke748593a2011-07-15 15:45:11 -0600288static struct resource resources_qup_i2c_gsbi4[] = {
289 {
290 .name = "gsbi_qup_i2c_addr",
291 .start = MSM_GSBI4_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600292 .end = MSM_GSBI4_PHYS + 4 - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600293 .flags = IORESOURCE_MEM,
294 },
295 {
296 .name = "qup_phys_addr",
297 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600298 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600299 .flags = IORESOURCE_MEM,
300 },
301 {
302 .name = "qup_err_intr",
303 .start = GSBI4_QUP_IRQ,
304 .end = GSBI4_QUP_IRQ,
305 .flags = IORESOURCE_IRQ,
306 },
Kevin Chand07220e2012-02-13 15:52:22 -0800307 {
308 .name = "i2c_clk",
309 .start = 11,
310 .end = 11,
311 .flags = IORESOURCE_IO,
312 },
313 {
314 .name = "i2c_sda",
315 .start = 10,
316 .end = 10,
317 .flags = IORESOURCE_IO,
318 },
Kenneth Heitke748593a2011-07-15 15:45:11 -0600319};
320
321struct platform_device apq8064_device_qup_i2c_gsbi4 = {
322 .name = "qup_i2c",
323 .id = 4,
324 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
325 .resource = resources_qup_i2c_gsbi4,
326};
327
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700328static struct resource resources_qup_spi_gsbi5[] = {
329 {
330 .name = "spi_base",
331 .start = MSM_GSBI5_QUP_PHYS,
332 .end = MSM_GSBI5_QUP_PHYS + SZ_4K - 1,
333 .flags = IORESOURCE_MEM,
334 },
335 {
336 .name = "gsbi_base",
337 .start = MSM_GSBI5_PHYS,
338 .end = MSM_GSBI5_PHYS + 4 - 1,
339 .flags = IORESOURCE_MEM,
340 },
341 {
342 .name = "spi_irq_in",
343 .start = GSBI5_QUP_IRQ,
344 .end = GSBI5_QUP_IRQ,
345 .flags = IORESOURCE_IRQ,
346 },
347};
348
349struct platform_device apq8064_device_qup_spi_gsbi5 = {
350 .name = "spi_qsd",
351 .id = 0,
352 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi5),
353 .resource = resources_qup_spi_gsbi5,
354};
355
Joel King8f839b92012-04-01 14:37:46 -0700356static struct resource resources_qup_i2c_gsbi5[] = {
357 {
358 .name = "gsbi_qup_i2c_addr",
359 .start = MSM_GSBI5_PHYS,
360 .end = MSM_GSBI5_PHYS + 4 - 1,
361 .flags = IORESOURCE_MEM,
362 },
363 {
364 .name = "qup_phys_addr",
365 .start = MSM_GSBI5_QUP_PHYS,
366 .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
367 .flags = IORESOURCE_MEM,
368 },
369 {
370 .name = "qup_err_intr",
371 .start = GSBI5_QUP_IRQ,
372 .end = GSBI5_QUP_IRQ,
373 .flags = IORESOURCE_IRQ,
374 },
375 {
376 .name = "i2c_clk",
377 .start = 54,
378 .end = 54,
379 .flags = IORESOURCE_IO,
380 },
381 {
382 .name = "i2c_sda",
383 .start = 53,
384 .end = 53,
385 .flags = IORESOURCE_IO,
386 },
387};
388
389struct platform_device mpq8064_device_qup_i2c_gsbi5 = {
390 .name = "qup_i2c",
391 .id = 5,
392 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
393 .resource = resources_qup_i2c_gsbi5,
394};
395
Jin Hong4bbbfba2012-02-02 21:48:07 -0800396static struct resource resources_uart_gsbi7[] = {
397 {
398 .start = GSBI7_UARTDM_IRQ,
399 .end = GSBI7_UARTDM_IRQ,
400 .flags = IORESOURCE_IRQ,
401 },
402 {
403 .start = MSM_UART7DM_PHYS,
404 .end = MSM_UART7DM_PHYS + PAGE_SIZE - 1,
405 .name = "uartdm_resource",
406 .flags = IORESOURCE_MEM,
407 },
408 {
409 .start = MSM_GSBI7_PHYS,
410 .end = MSM_GSBI7_PHYS + PAGE_SIZE - 1,
411 .name = "gsbi_resource",
412 .flags = IORESOURCE_MEM,
413 },
414};
415
416struct platform_device apq8064_device_uart_gsbi7 = {
417 .name = "msm_serial_hsl",
418 .id = 0,
419 .num_resources = ARRAY_SIZE(resources_uart_gsbi7),
420 .resource = resources_uart_gsbi7,
421};
422
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800423struct platform_device apq_pcm = {
424 .name = "msm-pcm-dsp",
425 .id = -1,
426};
427
428struct platform_device apq_pcm_routing = {
429 .name = "msm-pcm-routing",
430 .id = -1,
431};
432
433struct platform_device apq_cpudai0 = {
434 .name = "msm-dai-q6",
435 .id = 0x4000,
436};
437
438struct platform_device apq_cpudai1 = {
439 .name = "msm-dai-q6",
440 .id = 0x4001,
441};
Santosh Mardieff9a742012-04-09 23:23:39 +0530442struct platform_device mpq_cpudai_sec_i2s_rx = {
443 .name = "msm-dai-q6",
444 .id = 4,
445};
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800446struct platform_device apq_cpudai_hdmi_rx = {
Swaminathan Sathappanfd9dbad2012-02-15 16:56:44 -0800447 .name = "msm-dai-q6-hdmi",
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800448 .id = 8,
449};
450
451struct platform_device apq_cpudai_bt_rx = {
452 .name = "msm-dai-q6",
453 .id = 0x3000,
454};
455
456struct platform_device apq_cpudai_bt_tx = {
457 .name = "msm-dai-q6",
458 .id = 0x3001,
459};
460
461struct platform_device apq_cpudai_fm_rx = {
462 .name = "msm-dai-q6",
463 .id = 0x3004,
464};
465
466struct platform_device apq_cpudai_fm_tx = {
467 .name = "msm-dai-q6",
468 .id = 0x3005,
469};
470
Helen Zeng8f925502012-03-05 16:50:17 -0800471struct platform_device apq_cpudai_slim_4_rx = {
472 .name = "msm-dai-q6",
473 .id = 0x4008,
474};
475
476struct platform_device apq_cpudai_slim_4_tx = {
477 .name = "msm-dai-q6",
478 .id = 0x4009,
479};
480
Joel Nidere5de00e2012-07-03 10:58:10 +0300481#define MSM_TSIF0_PHYS (0x18200000)
482#define MSM_TSIF1_PHYS (0x18201000)
483#define MSM_TSIF_SIZE (0x200)
484
485#define TSIF_0_CLK GPIO_CFG(55, 1, GPIO_CFG_INPUT, \
486 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
487#define TSIF_0_EN GPIO_CFG(56, 1, GPIO_CFG_INPUT, \
488 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
489#define TSIF_0_DATA GPIO_CFG(57, 1, GPIO_CFG_INPUT, \
490 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
491#define TSIF_0_SYNC GPIO_CFG(62, 1, GPIO_CFG_INPUT, \
492 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
493#define TSIF_1_CLK GPIO_CFG(59, 1, GPIO_CFG_INPUT, \
494 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
495#define TSIF_1_EN GPIO_CFG(60, 1, GPIO_CFG_INPUT, \
496 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
497#define TSIF_1_DATA GPIO_CFG(61, 1, GPIO_CFG_INPUT, \
498 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
499#define TSIF_1_SYNC GPIO_CFG(58, 1, GPIO_CFG_INPUT, \
500 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
501
502static const struct msm_gpio tsif0_gpios[] = {
503 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
504 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
505 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
506 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
507};
508
509static const struct msm_gpio tsif1_gpios[] = {
510 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
511 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
512 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
513 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
514};
515
516struct msm_tsif_platform_data tsif1_8064_platform_data = {
517 .num_gpios = ARRAY_SIZE(tsif1_gpios),
518 .gpios = tsif1_gpios,
519 .tsif_pclk = "iface_clk",
520 .tsif_ref_clk = "ref_clk",
521};
522
523struct resource tsif1_8064_resources[] = {
524 [0] = {
525 .flags = IORESOURCE_IRQ,
526 .start = TSIF2_IRQ,
527 .end = TSIF2_IRQ,
528 },
529 [1] = {
530 .flags = IORESOURCE_MEM,
531 .start = MSM_TSIF1_PHYS,
532 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
533 },
534 [2] = {
535 .flags = IORESOURCE_DMA,
536 .start = DMOV8064_TSIF_CHAN,
537 .end = DMOV8064_TSIF_CRCI,
538 },
539};
540
541struct msm_tsif_platform_data tsif0_8064_platform_data = {
542 .num_gpios = ARRAY_SIZE(tsif0_gpios),
543 .gpios = tsif0_gpios,
544 .tsif_pclk = "iface_clk",
545 .tsif_ref_clk = "ref_clk",
546};
547
548struct resource tsif0_8064_resources[] = {
549 [0] = {
550 .flags = IORESOURCE_IRQ,
551 .start = TSIF1_IRQ,
552 .end = TSIF1_IRQ,
553 },
554 [1] = {
555 .flags = IORESOURCE_MEM,
556 .start = MSM_TSIF0_PHYS,
557 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
558 },
559 [2] = {
560 .flags = IORESOURCE_DMA,
561 .start = DMOV_TSIF_CHAN,
562 .end = DMOV_TSIF_CRCI,
563 },
564};
565
566struct platform_device msm_8064_device_tsif[2] = {
567 {
568 .name = "msm_tsif",
569 .id = 0,
570 .num_resources = ARRAY_SIZE(tsif0_8064_resources),
571 .resource = tsif0_8064_resources,
572 .dev = {
573 .platform_data = &tsif0_8064_platform_data
574 },
575 },
576 {
577 .name = "msm_tsif",
578 .id = 1,
579 .num_resources = ARRAY_SIZE(tsif1_8064_resources),
580 .resource = tsif1_8064_resources,
581 .dev = {
582 .platform_data = &tsif1_8064_platform_data
583 },
584 }
585};
586
Joel Nider50b50fa2012-08-05 14:17:29 +0300587#define MSM_TSPP_PHYS (0x18202000)
588#define MSM_TSPP_SIZE (0x1000)
589#define MSM_TSPP_BAM_PHYS (0x18204000)
590#define MSM_TSPP_BAM_SIZE (0x2000)
591
592static const struct msm_gpio tspp_gpios[] = {
593 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
594 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
595 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
596 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
597 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
598 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
599 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
600 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
601};
602
603static struct resource tspp_resources[] = {
604 [0] = {
605 .flags = IORESOURCE_IRQ,
606 .start = TSIF_TSPP_IRQ,
607 .end = TSIF1_IRQ,
608 },
609 [1] = {
610 .flags = IORESOURCE_MEM,
611 .start = MSM_TSIF0_PHYS,
612 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
613 },
614 [2] = {
615 .flags = IORESOURCE_MEM,
616 .start = MSM_TSIF1_PHYS,
617 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
618 },
619 [3] = {
620 .flags = IORESOURCE_MEM,
621 .start = MSM_TSPP_PHYS,
622 .end = MSM_TSPP_PHYS + MSM_TSPP_SIZE - 1,
623 },
624 [4] = {
625 .flags = IORESOURCE_MEM,
626 .start = MSM_TSPP_BAM_PHYS,
627 .end = MSM_TSPP_BAM_PHYS + MSM_TSPP_BAM_SIZE - 1,
628 },
629};
630
631static struct msm_tspp_platform_data tspp_platform_data = {
632 .num_gpios = ARRAY_SIZE(tspp_gpios),
633 .gpios = tspp_gpios,
634 .tsif_pclk = "iface_clk",
635 .tsif_ref_clk = "ref_clk",
636};
637
638struct platform_device msm_8064_device_tspp = {
639 .name = "msm_tspp",
640 .id = 0,
641 .num_resources = ARRAY_SIZE(tspp_resources),
642 .resource = tspp_resources,
643 .dev = {
644 .platform_data = &tspp_platform_data
645 },
646};
647
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800648/*
649 * Machine specific data for AUX PCM Interface
650 * which the driver will be unware of.
651 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800652struct msm_dai_auxpcm_pdata apq_auxpcm_pdata = {
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800653 .clk = "pcm_clk",
Kuirong Wang547a9982012-05-04 18:29:11 -0700654 .mode_8k = {
655 .mode = AFE_PCM_CFG_MODE_PCM,
656 .sync = AFE_PCM_CFG_SYNC_INT,
657 .frame = AFE_PCM_CFG_FRM_256BPF,
658 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
659 .slot = 0,
660 .data = AFE_PCM_CFG_CDATAOE_MASTER,
661 .pcm_clk_rate = 2048000,
662 },
663 .mode_16k = {
664 .mode = AFE_PCM_CFG_MODE_PCM,
665 .sync = AFE_PCM_CFG_SYNC_INT,
666 .frame = AFE_PCM_CFG_FRM_256BPF,
667 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
668 .slot = 0,
669 .data = AFE_PCM_CFG_CDATAOE_MASTER,
670 .pcm_clk_rate = 4096000,
671 }
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800672};
673
674struct platform_device apq_cpudai_auxpcm_rx = {
675 .name = "msm-dai-q6",
676 .id = 2,
677 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800678 .platform_data = &apq_auxpcm_pdata,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800679 },
680};
681
682struct platform_device apq_cpudai_auxpcm_tx = {
683 .name = "msm-dai-q6",
684 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800685 .dev = {
686 .platform_data = &apq_auxpcm_pdata,
687 },
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800688};
689
Patrick Lai04baee942012-05-01 14:38:47 -0700690struct msm_mi2s_pdata mpq_mi2s_tx_data = {
691 .rx_sd_lines = 0,
692 .tx_sd_lines = MSM_MI2S_SD0 | MSM_MI2S_SD1 | MSM_MI2S_SD2 |
693 MSM_MI2S_SD3,
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700694};
695
696struct platform_device mpq_cpudai_mi2s_tx = {
Patrick Lai04baee942012-05-01 14:38:47 -0700697 .name = "msm-dai-q6-mi2s",
698 .id = -1, /*MI2S_TX */
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700699 .dev = {
700 .platform_data = &mpq_mi2s_tx_data,
701 },
702};
703
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800704struct platform_device apq_cpu_fe = {
705 .name = "msm-dai-fe",
706 .id = -1,
707};
708
709struct platform_device apq_stub_codec = {
710 .name = "msm-stub-codec",
711 .id = 1,
712};
713
714struct platform_device apq_voice = {
715 .name = "msm-pcm-voice",
716 .id = -1,
717};
718
719struct platform_device apq_voip = {
720 .name = "msm-voip-dsp",
721 .id = -1,
722};
723
724struct platform_device apq_lpa_pcm = {
725 .name = "msm-pcm-lpa",
726 .id = -1,
727};
728
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -0700729struct platform_device apq_compr_dsp = {
730 .name = "msm-compr-dsp",
731 .id = -1,
732};
733
734struct platform_device apq_multi_ch_pcm = {
735 .name = "msm-multi-ch-pcm-dsp",
736 .id = -1,
737};
738
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -0700739struct platform_device apq_lowlatency_pcm = {
740 .name = "msm-lowlatency-pcm-dsp",
741 .id = -1,
742};
743
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800744struct platform_device apq_pcm_hostless = {
745 .name = "msm-pcm-hostless",
746 .id = -1,
747};
748
749struct platform_device apq_cpudai_afe_01_rx = {
750 .name = "msm-dai-q6",
751 .id = 0xE0,
752};
753
754struct platform_device apq_cpudai_afe_01_tx = {
755 .name = "msm-dai-q6",
756 .id = 0xF0,
757};
758
759struct platform_device apq_cpudai_afe_02_rx = {
760 .name = "msm-dai-q6",
761 .id = 0xF1,
762};
763
764struct platform_device apq_cpudai_afe_02_tx = {
765 .name = "msm-dai-q6",
766 .id = 0xE1,
767};
768
769struct platform_device apq_pcm_afe = {
770 .name = "msm-pcm-afe",
771 .id = -1,
772};
773
Neema Shetty8427c262012-02-16 11:23:43 -0800774struct platform_device apq_cpudai_stub = {
775 .name = "msm-dai-stub",
776 .id = -1,
777};
778
Neema Shetty3c9d2862012-03-11 01:25:32 -0800779struct platform_device apq_cpudai_slimbus_1_rx = {
780 .name = "msm-dai-q6",
781 .id = 0x4002,
782};
783
784struct platform_device apq_cpudai_slimbus_1_tx = {
785 .name = "msm-dai-q6",
786 .id = 0x4003,
787};
788
Kiran Kandi97fe19d2012-05-20 22:34:04 -0700789struct platform_device apq_cpudai_slimbus_2_rx = {
790 .name = "msm-dai-q6",
791 .id = 0x4004,
792};
793
Kiran Kandi1e6371d2012-03-29 11:48:57 -0700794struct platform_device apq_cpudai_slimbus_2_tx = {
795 .name = "msm-dai-q6",
796 .id = 0x4005,
797};
798
Neema Shettyc9d86c32012-05-09 12:01:39 -0700799struct platform_device apq_cpudai_slimbus_3_rx = {
800 .name = "msm-dai-q6",
801 .id = 0x4006,
802};
803
Helen Zeng38c3c962012-05-17 14:56:20 -0700804struct platform_device apq_cpudai_slimbus_3_tx = {
805 .name = "msm-dai-q6",
806 .id = 0x4007,
807};
808
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700809static struct resource resources_ssbi_pmic1[] = {
810 {
811 .start = MSM_PMIC1_SSBI_CMD_PHYS,
812 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
813 .flags = IORESOURCE_MEM,
814 },
815};
816
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600817#define LPASS_SLIMBUS_PHYS 0x28080000
818#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800819#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600820/* Board info for the slimbus slave device */
821static struct resource slimbus_res[] = {
822 {
823 .start = LPASS_SLIMBUS_PHYS,
824 .end = LPASS_SLIMBUS_PHYS + 8191,
825 .flags = IORESOURCE_MEM,
826 .name = "slimbus_physical",
827 },
828 {
829 .start = LPASS_SLIMBUS_BAM_PHYS,
830 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
831 .flags = IORESOURCE_MEM,
832 .name = "slimbus_bam_physical",
833 },
834 {
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800835 .start = LPASS_SLIMBUS_SLEW,
836 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
837 .flags = IORESOURCE_MEM,
838 .name = "slimbus_slew_reg",
839 },
840 {
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600841 .start = SLIMBUS0_CORE_EE1_IRQ,
842 .end = SLIMBUS0_CORE_EE1_IRQ,
843 .flags = IORESOURCE_IRQ,
844 .name = "slimbus_irq",
845 },
846 {
847 .start = SLIMBUS0_BAM_EE1_IRQ,
848 .end = SLIMBUS0_BAM_EE1_IRQ,
849 .flags = IORESOURCE_IRQ,
850 .name = "slimbus_bam_irq",
851 },
852};
853
854struct platform_device apq8064_slim_ctrl = {
855 .name = "msm_slim_ctrl",
856 .id = 1,
857 .num_resources = ARRAY_SIZE(slimbus_res),
858 .resource = slimbus_res,
859 .dev = {
860 .coherent_dma_mask = 0xffffffffULL,
861 },
862};
863
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700864struct platform_device apq8064_device_ssbi_pmic1 = {
865 .name = "msm_ssbi",
866 .id = 0,
867 .resource = resources_ssbi_pmic1,
868 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
869};
870
871static struct resource resources_ssbi_pmic2[] = {
872 {
873 .start = MSM_PMIC2_SSBI_CMD_PHYS,
874 .end = MSM_PMIC2_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
875 .flags = IORESOURCE_MEM,
876 },
877};
878
879struct platform_device apq8064_device_ssbi_pmic2 = {
880 .name = "msm_ssbi",
881 .id = 1,
882 .resource = resources_ssbi_pmic2,
883 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2),
884};
885
886static struct resource resources_otg[] = {
887 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800888 .start = MSM_HSUSB1_PHYS,
889 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700890 .flags = IORESOURCE_MEM,
891 },
892 {
893 .start = USB1_HS_IRQ,
894 .end = USB1_HS_IRQ,
895 .flags = IORESOURCE_IRQ,
896 },
897};
898
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700899struct platform_device apq8064_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700900 .name = "msm_otg",
901 .id = -1,
902 .num_resources = ARRAY_SIZE(resources_otg),
903 .resource = resources_otg,
904 .dev = {
905 .coherent_dma_mask = 0xffffffff,
906 },
907};
908
909static struct resource resources_hsusb[] = {
910 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800911 .start = MSM_HSUSB1_PHYS,
912 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700913 .flags = IORESOURCE_MEM,
914 },
915 {
916 .start = USB1_HS_IRQ,
917 .end = USB1_HS_IRQ,
918 .flags = IORESOURCE_IRQ,
919 },
920};
921
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700922struct platform_device apq8064_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700923 .name = "msm_hsusb",
924 .id = -1,
925 .num_resources = ARRAY_SIZE(resources_hsusb),
926 .resource = resources_hsusb,
927 .dev = {
928 .coherent_dma_mask = 0xffffffff,
929 },
930};
931
Hemant Kumard86c4882012-01-24 19:39:37 -0800932static struct resource resources_hsusb_host[] = {
933 {
934 .start = MSM_HSUSB1_PHYS,
935 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
936 .flags = IORESOURCE_MEM,
937 },
938 {
939 .start = USB1_HS_IRQ,
940 .end = USB1_HS_IRQ,
941 .flags = IORESOURCE_IRQ,
942 },
943};
944
Hemant Kumara945b472012-01-25 15:08:06 -0800945static struct resource resources_hsic_host[] = {
946 {
947 .start = 0x12510000,
948 .end = 0x12510000 + SZ_4K - 1,
949 .flags = IORESOURCE_MEM,
950 },
951 {
952 .start = USB2_HSIC_IRQ,
953 .end = USB2_HSIC_IRQ,
954 .flags = IORESOURCE_IRQ,
955 },
956 {
957 .start = MSM_GPIO_TO_INT(49),
958 .end = MSM_GPIO_TO_INT(49),
959 .name = "peripheral_status_irq",
960 .flags = IORESOURCE_IRQ,
961 },
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800962 {
Hemant Kumar6fd65032012-05-23 13:02:24 -0700963 .start = 47,
964 .end = 47,
965 .name = "wakeup",
966 .flags = IORESOURCE_IO,
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800967 },
Hemant Kumara945b472012-01-25 15:08:06 -0800968};
969
Hemant Kumard86c4882012-01-24 19:39:37 -0800970static u64 dma_mask = DMA_BIT_MASK(32);
971struct platform_device apq8064_device_hsusb_host = {
972 .name = "msm_hsusb_host",
973 .id = -1,
974 .num_resources = ARRAY_SIZE(resources_hsusb_host),
975 .resource = resources_hsusb_host,
976 .dev = {
977 .dma_mask = &dma_mask,
978 .coherent_dma_mask = 0xffffffff,
979 },
980};
981
Hemant Kumara945b472012-01-25 15:08:06 -0800982struct platform_device apq8064_device_hsic_host = {
983 .name = "msm_hsic_host",
984 .id = -1,
985 .num_resources = ARRAY_SIZE(resources_hsic_host),
986 .resource = resources_hsic_host,
987 .dev = {
988 .dma_mask = &dma_mask,
989 .coherent_dma_mask = DMA_BIT_MASK(32),
990 },
991};
992
Manu Gautam91223e02011-11-08 15:27:22 +0530993static struct resource resources_ehci_host3[] = {
994{
995 .start = MSM_HSUSB3_PHYS,
996 .end = MSM_HSUSB3_PHYS + MSM_HSUSB3_SIZE - 1,
997 .flags = IORESOURCE_MEM,
998 },
999 {
1000 .start = USB3_HS_IRQ,
1001 .end = USB3_HS_IRQ,
1002 .flags = IORESOURCE_IRQ,
1003 },
1004};
1005
1006struct platform_device apq8064_device_ehci_host3 = {
1007 .name = "msm_ehci_host",
1008 .id = 0,
1009 .num_resources = ARRAY_SIZE(resources_ehci_host3),
1010 .resource = resources_ehci_host3,
1011 .dev = {
1012 .dma_mask = &dma_mask,
1013 .coherent_dma_mask = 0xffffffff,
1014 },
1015};
1016
Hemant Kumar1d66e1c2012-02-13 15:24:59 -08001017static struct resource resources_ehci_host4[] = {
1018{
1019 .start = MSM_HSUSB4_PHYS,
1020 .end = MSM_HSUSB4_PHYS + MSM_HSUSB4_SIZE - 1,
1021 .flags = IORESOURCE_MEM,
1022 },
1023 {
1024 .start = USB4_HS_IRQ,
1025 .end = USB4_HS_IRQ,
1026 .flags = IORESOURCE_IRQ,
1027 },
1028};
1029
1030struct platform_device apq8064_device_ehci_host4 = {
1031 .name = "msm_ehci_host",
1032 .id = 1,
1033 .num_resources = ARRAY_SIZE(resources_ehci_host4),
1034 .resource = resources_ehci_host4,
1035 .dev = {
1036 .dma_mask = &dma_mask,
1037 .coherent_dma_mask = 0xffffffff,
1038 },
1039};
1040
Matt Wagantallf5cc3892012-06-07 19:47:02 -07001041struct platform_device apq8064_device_acpuclk = {
1042 .name = "acpuclk-8064",
1043 .id = -1,
1044};
1045
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -07001046#define SHARED_IMEM_TZ_BASE 0x2a03f720
1047static struct resource tzlog_resources[] = {
1048 {
1049 .start = SHARED_IMEM_TZ_BASE,
1050 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
1051 .flags = IORESOURCE_MEM,
1052 },
1053};
1054
1055struct platform_device apq_device_tz_log = {
1056 .name = "tz_log",
1057 .id = 0,
1058 .num_resources = ARRAY_SIZE(tzlog_resources),
1059 .resource = tzlog_resources,
1060};
1061
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001062/* MSM Video core device */
1063#ifdef CONFIG_MSM_BUS_SCALING
1064static struct msm_bus_vectors vidc_init_vectors[] = {
1065 {
1066 .src = MSM_BUS_MASTER_VIDEO_ENC,
1067 .dst = MSM_BUS_SLAVE_EBI_CH0,
1068 .ab = 0,
1069 .ib = 0,
1070 },
1071 {
1072 .src = MSM_BUS_MASTER_VIDEO_DEC,
1073 .dst = MSM_BUS_SLAVE_EBI_CH0,
1074 .ab = 0,
1075 .ib = 0,
1076 },
1077 {
1078 .src = MSM_BUS_MASTER_AMPSS_M0,
1079 .dst = MSM_BUS_SLAVE_EBI_CH0,
1080 .ab = 0,
1081 .ib = 0,
1082 },
1083 {
1084 .src = MSM_BUS_MASTER_AMPSS_M0,
1085 .dst = MSM_BUS_SLAVE_EBI_CH0,
1086 .ab = 0,
1087 .ib = 0,
1088 },
1089};
1090static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
1091 {
1092 .src = MSM_BUS_MASTER_VIDEO_ENC,
1093 .dst = MSM_BUS_SLAVE_EBI_CH0,
1094 .ab = 54525952,
1095 .ib = 436207616,
1096 },
1097 {
1098 .src = MSM_BUS_MASTER_VIDEO_DEC,
1099 .dst = MSM_BUS_SLAVE_EBI_CH0,
1100 .ab = 72351744,
1101 .ib = 289406976,
1102 },
1103 {
1104 .src = MSM_BUS_MASTER_AMPSS_M0,
1105 .dst = MSM_BUS_SLAVE_EBI_CH0,
1106 .ab = 500000,
1107 .ib = 1000000,
1108 },
1109 {
1110 .src = MSM_BUS_MASTER_AMPSS_M0,
1111 .dst = MSM_BUS_SLAVE_EBI_CH0,
1112 .ab = 500000,
1113 .ib = 1000000,
1114 },
1115};
1116static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
1117 {
1118 .src = MSM_BUS_MASTER_VIDEO_ENC,
1119 .dst = MSM_BUS_SLAVE_EBI_CH0,
1120 .ab = 40894464,
1121 .ib = 327155712,
1122 },
1123 {
1124 .src = MSM_BUS_MASTER_VIDEO_DEC,
1125 .dst = MSM_BUS_SLAVE_EBI_CH0,
1126 .ab = 48234496,
1127 .ib = 192937984,
1128 },
1129 {
1130 .src = MSM_BUS_MASTER_AMPSS_M0,
1131 .dst = MSM_BUS_SLAVE_EBI_CH0,
1132 .ab = 500000,
1133 .ib = 2000000,
1134 },
1135 {
1136 .src = MSM_BUS_MASTER_AMPSS_M0,
1137 .dst = MSM_BUS_SLAVE_EBI_CH0,
1138 .ab = 500000,
1139 .ib = 2000000,
1140 },
1141};
1142static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
1143 {
1144 .src = MSM_BUS_MASTER_VIDEO_ENC,
1145 .dst = MSM_BUS_SLAVE_EBI_CH0,
1146 .ab = 163577856,
1147 .ib = 1308622848,
1148 },
1149 {
1150 .src = MSM_BUS_MASTER_VIDEO_DEC,
1151 .dst = MSM_BUS_SLAVE_EBI_CH0,
1152 .ab = 219152384,
1153 .ib = 876609536,
1154 },
1155 {
1156 .src = MSM_BUS_MASTER_AMPSS_M0,
1157 .dst = MSM_BUS_SLAVE_EBI_CH0,
1158 .ab = 1750000,
1159 .ib = 3500000,
1160 },
1161 {
1162 .src = MSM_BUS_MASTER_AMPSS_M0,
1163 .dst = MSM_BUS_SLAVE_EBI_CH0,
1164 .ab = 1750000,
1165 .ib = 3500000,
1166 },
1167};
1168static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
1169 {
1170 .src = MSM_BUS_MASTER_VIDEO_ENC,
1171 .dst = MSM_BUS_SLAVE_EBI_CH0,
1172 .ab = 121634816,
1173 .ib = 973078528,
1174 },
1175 {
1176 .src = MSM_BUS_MASTER_VIDEO_DEC,
1177 .dst = MSM_BUS_SLAVE_EBI_CH0,
1178 .ab = 155189248,
1179 .ib = 620756992,
1180 },
1181 {
1182 .src = MSM_BUS_MASTER_AMPSS_M0,
1183 .dst = MSM_BUS_SLAVE_EBI_CH0,
1184 .ab = 1750000,
1185 .ib = 7000000,
1186 },
1187 {
1188 .src = MSM_BUS_MASTER_AMPSS_M0,
1189 .dst = MSM_BUS_SLAVE_EBI_CH0,
1190 .ab = 1750000,
1191 .ib = 7000000,
1192 },
1193};
1194static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
1195 {
1196 .src = MSM_BUS_MASTER_VIDEO_ENC,
1197 .dst = MSM_BUS_SLAVE_EBI_CH0,
1198 .ab = 372244480,
1199 .ib = 2560000000U,
1200 },
1201 {
1202 .src = MSM_BUS_MASTER_VIDEO_DEC,
1203 .dst = MSM_BUS_SLAVE_EBI_CH0,
1204 .ab = 501219328,
1205 .ib = 2560000000U,
1206 },
1207 {
1208 .src = MSM_BUS_MASTER_AMPSS_M0,
1209 .dst = MSM_BUS_SLAVE_EBI_CH0,
1210 .ab = 2500000,
1211 .ib = 5000000,
1212 },
1213 {
1214 .src = MSM_BUS_MASTER_AMPSS_M0,
1215 .dst = MSM_BUS_SLAVE_EBI_CH0,
1216 .ab = 2500000,
1217 .ib = 5000000,
1218 },
1219};
1220static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
1221 {
1222 .src = MSM_BUS_MASTER_VIDEO_ENC,
1223 .dst = MSM_BUS_SLAVE_EBI_CH0,
1224 .ab = 222298112,
1225 .ib = 2560000000U,
1226 },
1227 {
1228 .src = MSM_BUS_MASTER_VIDEO_DEC,
1229 .dst = MSM_BUS_SLAVE_EBI_CH0,
1230 .ab = 330301440,
1231 .ib = 2560000000U,
1232 },
1233 {
1234 .src = MSM_BUS_MASTER_AMPSS_M0,
1235 .dst = MSM_BUS_SLAVE_EBI_CH0,
1236 .ab = 2500000,
1237 .ib = 700000000,
1238 },
1239 {
1240 .src = MSM_BUS_MASTER_AMPSS_M0,
1241 .dst = MSM_BUS_SLAVE_EBI_CH0,
1242 .ab = 2500000,
1243 .ib = 10000000,
1244 },
1245};
1246
Arun Menon152c3c72012-06-20 11:50:08 -07001247static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
1248 {
1249 .src = MSM_BUS_MASTER_VIDEO_ENC,
1250 .dst = MSM_BUS_SLAVE_EBI_CH0,
1251 .ab = 222298112,
1252 .ib = 3522000000U,
1253 },
1254 {
1255 .src = MSM_BUS_MASTER_VIDEO_DEC,
1256 .dst = MSM_BUS_SLAVE_EBI_CH0,
1257 .ab = 330301440,
1258 .ib = 3522000000U,
1259 },
1260 {
1261 .src = MSM_BUS_MASTER_AMPSS_M0,
1262 .dst = MSM_BUS_SLAVE_EBI_CH0,
1263 .ab = 2500000,
1264 .ib = 700000000,
1265 },
1266 {
1267 .src = MSM_BUS_MASTER_AMPSS_M0,
1268 .dst = MSM_BUS_SLAVE_EBI_CH0,
1269 .ab = 2500000,
1270 .ib = 10000000,
1271 },
1272};
1273static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
1274 {
1275 .src = MSM_BUS_MASTER_VIDEO_ENC,
1276 .dst = MSM_BUS_SLAVE_EBI_CH0,
1277 .ab = 222298112,
1278 .ib = 3522000000U,
1279 },
1280 {
1281 .src = MSM_BUS_MASTER_VIDEO_DEC,
1282 .dst = MSM_BUS_SLAVE_EBI_CH0,
1283 .ab = 330301440,
1284 .ib = 3522000000U,
1285 },
1286 {
1287 .src = MSM_BUS_MASTER_AMPSS_M0,
1288 .dst = MSM_BUS_SLAVE_EBI_CH0,
1289 .ab = 2500000,
1290 .ib = 700000000,
1291 },
1292 {
1293 .src = MSM_BUS_MASTER_AMPSS_M0,
1294 .dst = MSM_BUS_SLAVE_EBI_CH0,
1295 .ab = 2500000,
1296 .ib = 10000000,
1297 },
1298};
1299
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001300static struct msm_bus_paths vidc_bus_client_config[] = {
1301 {
1302 ARRAY_SIZE(vidc_init_vectors),
1303 vidc_init_vectors,
1304 },
1305 {
1306 ARRAY_SIZE(vidc_venc_vga_vectors),
1307 vidc_venc_vga_vectors,
1308 },
1309 {
1310 ARRAY_SIZE(vidc_vdec_vga_vectors),
1311 vidc_vdec_vga_vectors,
1312 },
1313 {
1314 ARRAY_SIZE(vidc_venc_720p_vectors),
1315 vidc_venc_720p_vectors,
1316 },
1317 {
1318 ARRAY_SIZE(vidc_vdec_720p_vectors),
1319 vidc_vdec_720p_vectors,
1320 },
1321 {
1322 ARRAY_SIZE(vidc_venc_1080p_vectors),
1323 vidc_venc_1080p_vectors,
1324 },
1325 {
1326 ARRAY_SIZE(vidc_vdec_1080p_vectors),
1327 vidc_vdec_1080p_vectors,
1328 },
Arun Menon152c3c72012-06-20 11:50:08 -07001329 {
1330 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
1331 vidc_venc_1080p_turbo_vectors,
1332 },
1333 {
1334 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
1335 vidc_vdec_1080p_turbo_vectors,
1336 },
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001337};
1338
1339static struct msm_bus_scale_pdata vidc_bus_client_data = {
1340 vidc_bus_client_config,
1341 ARRAY_SIZE(vidc_bus_client_config),
1342 .name = "vidc",
1343};
1344#endif
1345
1346
1347#define APQ8064_VIDC_BASE_PHYS 0x04400000
1348#define APQ8064_VIDC_BASE_SIZE 0x00100000
1349
1350static struct resource apq8064_device_vidc_resources[] = {
1351 {
1352 .start = APQ8064_VIDC_BASE_PHYS,
1353 .end = APQ8064_VIDC_BASE_PHYS + APQ8064_VIDC_BASE_SIZE - 1,
1354 .flags = IORESOURCE_MEM,
1355 },
1356 {
1357 .start = VCODEC_IRQ,
1358 .end = VCODEC_IRQ,
1359 .flags = IORESOURCE_IRQ,
1360 },
1361};
1362
1363struct msm_vidc_platform_data apq8064_vidc_platform_data = {
1364#ifdef CONFIG_MSM_BUS_SCALING
1365 .vidc_bus_client_pdata = &vidc_bus_client_data,
1366#endif
1367#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1368 .memtype = ION_CP_MM_HEAP_ID,
1369 .enable_ion = 1,
Deepak kotureda295a2012-05-10 19:49:46 -07001370 .cp_enabled = 1,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001371#else
1372 .memtype = MEMTYPE_EBI1,
1373 .enable_ion = 0,
1374#endif
1375 .disable_dmx = 0,
1376 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08001377 .cont_mode_dpb_count = 18,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05301378 .fw_addr = 0x9fe00000,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001379};
1380
1381struct platform_device apq8064_msm_device_vidc = {
1382 .name = "msm_vidc",
1383 .id = 0,
1384 .num_resources = ARRAY_SIZE(apq8064_device_vidc_resources),
1385 .resource = apq8064_device_vidc_resources,
1386 .dev = {
1387 .platform_data = &apq8064_vidc_platform_data,
1388 },
1389};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001390#define MSM_SDC1_BASE 0x12400000
1391#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1392#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1393#define MSM_SDC2_BASE 0x12140000
1394#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1395#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1396#define MSM_SDC3_BASE 0x12180000
1397#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1398#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1399#define MSM_SDC4_BASE 0x121C0000
1400#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1401#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1402
1403static struct resource resources_sdc1[] = {
1404 {
1405 .name = "core_mem",
1406 .flags = IORESOURCE_MEM,
1407 .start = MSM_SDC1_BASE,
1408 .end = MSM_SDC1_DML_BASE - 1,
1409 },
1410 {
1411 .name = "core_irq",
1412 .flags = IORESOURCE_IRQ,
1413 .start = SDC1_IRQ_0,
1414 .end = SDC1_IRQ_0
1415 },
1416#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1417 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301418 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001419 .start = MSM_SDC1_DML_BASE,
1420 .end = MSM_SDC1_BAM_BASE - 1,
1421 .flags = IORESOURCE_MEM,
1422 },
1423 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301424 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001425 .start = MSM_SDC1_BAM_BASE,
1426 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1427 .flags = IORESOURCE_MEM,
1428 },
1429 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301430 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001431 .start = SDC1_BAM_IRQ,
1432 .end = SDC1_BAM_IRQ,
1433 .flags = IORESOURCE_IRQ,
1434 },
1435#endif
1436};
1437
1438static struct resource resources_sdc2[] = {
1439 {
1440 .name = "core_mem",
1441 .flags = IORESOURCE_MEM,
1442 .start = MSM_SDC2_BASE,
1443 .end = MSM_SDC2_DML_BASE - 1,
1444 },
1445 {
1446 .name = "core_irq",
1447 .flags = IORESOURCE_IRQ,
1448 .start = SDC2_IRQ_0,
1449 .end = SDC2_IRQ_0
1450 },
1451#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1452 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301453 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001454 .start = MSM_SDC2_DML_BASE,
1455 .end = MSM_SDC2_BAM_BASE - 1,
1456 .flags = IORESOURCE_MEM,
1457 },
1458 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301459 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001460 .start = MSM_SDC2_BAM_BASE,
1461 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1462 .flags = IORESOURCE_MEM,
1463 },
1464 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301465 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001466 .start = SDC2_BAM_IRQ,
1467 .end = SDC2_BAM_IRQ,
1468 .flags = IORESOURCE_IRQ,
1469 },
1470#endif
1471};
1472
1473static struct resource resources_sdc3[] = {
1474 {
1475 .name = "core_mem",
1476 .flags = IORESOURCE_MEM,
1477 .start = MSM_SDC3_BASE,
1478 .end = MSM_SDC3_DML_BASE - 1,
1479 },
1480 {
1481 .name = "core_irq",
1482 .flags = IORESOURCE_IRQ,
1483 .start = SDC3_IRQ_0,
1484 .end = SDC3_IRQ_0
1485 },
1486#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1487 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301488 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001489 .start = MSM_SDC3_DML_BASE,
1490 .end = MSM_SDC3_BAM_BASE - 1,
1491 .flags = IORESOURCE_MEM,
1492 },
1493 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301494 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001495 .start = MSM_SDC3_BAM_BASE,
1496 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1497 .flags = IORESOURCE_MEM,
1498 },
1499 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301500 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001501 .start = SDC3_BAM_IRQ,
1502 .end = SDC3_BAM_IRQ,
1503 .flags = IORESOURCE_IRQ,
1504 },
1505#endif
1506};
1507
1508static struct resource resources_sdc4[] = {
1509 {
1510 .name = "core_mem",
1511 .flags = IORESOURCE_MEM,
1512 .start = MSM_SDC4_BASE,
1513 .end = MSM_SDC4_DML_BASE - 1,
1514 },
1515 {
1516 .name = "core_irq",
1517 .flags = IORESOURCE_IRQ,
1518 .start = SDC4_IRQ_0,
1519 .end = SDC4_IRQ_0
1520 },
1521#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1522 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301523 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001524 .start = MSM_SDC4_DML_BASE,
1525 .end = MSM_SDC4_BAM_BASE - 1,
1526 .flags = IORESOURCE_MEM,
1527 },
1528 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301529 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001530 .start = MSM_SDC4_BAM_BASE,
1531 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1532 .flags = IORESOURCE_MEM,
1533 },
1534 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301535 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001536 .start = SDC4_BAM_IRQ,
1537 .end = SDC4_BAM_IRQ,
1538 .flags = IORESOURCE_IRQ,
1539 },
1540#endif
1541};
1542
1543struct platform_device apq8064_device_sdc1 = {
1544 .name = "msm_sdcc",
1545 .id = 1,
1546 .num_resources = ARRAY_SIZE(resources_sdc1),
1547 .resource = resources_sdc1,
1548 .dev = {
1549 .coherent_dma_mask = 0xffffffff,
1550 },
1551};
1552
1553struct platform_device apq8064_device_sdc2 = {
1554 .name = "msm_sdcc",
1555 .id = 2,
1556 .num_resources = ARRAY_SIZE(resources_sdc2),
1557 .resource = resources_sdc2,
1558 .dev = {
1559 .coherent_dma_mask = 0xffffffff,
1560 },
1561};
1562
1563struct platform_device apq8064_device_sdc3 = {
1564 .name = "msm_sdcc",
1565 .id = 3,
1566 .num_resources = ARRAY_SIZE(resources_sdc3),
1567 .resource = resources_sdc3,
1568 .dev = {
1569 .coherent_dma_mask = 0xffffffff,
1570 },
1571};
1572
1573struct platform_device apq8064_device_sdc4 = {
1574 .name = "msm_sdcc",
1575 .id = 4,
1576 .num_resources = ARRAY_SIZE(resources_sdc4),
1577 .resource = resources_sdc4,
1578 .dev = {
1579 .coherent_dma_mask = 0xffffffff,
1580 },
1581};
1582
1583static struct platform_device *apq8064_sdcc_devices[] __initdata = {
1584 &apq8064_device_sdc1,
1585 &apq8064_device_sdc2,
1586 &apq8064_device_sdc3,
1587 &apq8064_device_sdc4,
1588};
1589
1590int __init apq8064_add_sdcc(unsigned int controller,
1591 struct mmc_platform_data *plat)
1592{
1593 struct platform_device *pdev;
1594
1595 if (!plat)
1596 return 0;
1597 if (controller < 1 || controller > 4)
1598 return -EINVAL;
1599
1600 pdev = apq8064_sdcc_devices[controller-1];
1601 pdev->dev.platform_data = plat;
1602 return platform_device_register(pdev);
1603}
1604
Yan He06913ce2011-08-26 16:33:46 -07001605static struct resource resources_sps[] = {
1606 {
1607 .name = "pipe_mem",
1608 .start = 0x12800000,
1609 .end = 0x12800000 + 0x4000 - 1,
1610 .flags = IORESOURCE_MEM,
1611 },
1612 {
1613 .name = "bamdma_dma",
1614 .start = 0x12240000,
1615 .end = 0x12240000 + 0x1000 - 1,
1616 .flags = IORESOURCE_MEM,
1617 },
1618 {
1619 .name = "bamdma_bam",
1620 .start = 0x12244000,
1621 .end = 0x12244000 + 0x4000 - 1,
1622 .flags = IORESOURCE_MEM,
1623 },
1624 {
1625 .name = "bamdma_irq",
1626 .start = SPS_BAM_DMA_IRQ,
1627 .end = SPS_BAM_DMA_IRQ,
1628 .flags = IORESOURCE_IRQ,
1629 },
1630};
1631
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001632struct platform_device msm_bus_8064_sys_fabric = {
1633 .name = "msm_bus_fabric",
1634 .id = MSM_BUS_FAB_SYSTEM,
1635};
1636struct platform_device msm_bus_8064_apps_fabric = {
1637 .name = "msm_bus_fabric",
1638 .id = MSM_BUS_FAB_APPSS,
1639};
1640struct platform_device msm_bus_8064_mm_fabric = {
1641 .name = "msm_bus_fabric",
1642 .id = MSM_BUS_FAB_MMSS,
1643};
1644struct platform_device msm_bus_8064_sys_fpb = {
1645 .name = "msm_bus_fabric",
1646 .id = MSM_BUS_FAB_SYSTEM_FPB,
1647};
1648struct platform_device msm_bus_8064_cpss_fpb = {
1649 .name = "msm_bus_fabric",
1650 .id = MSM_BUS_FAB_CPSS_FPB,
1651};
1652
Yan He06913ce2011-08-26 16:33:46 -07001653static struct msm_sps_platform_data msm_sps_pdata = {
1654 .bamdma_restricted_pipes = 0x06,
1655};
1656
1657struct platform_device msm_device_sps_apq8064 = {
1658 .name = "msm_sps",
1659 .id = -1,
1660 .num_resources = ARRAY_SIZE(resources_sps),
1661 .resource = resources_sps,
1662 .dev.platform_data = &msm_sps_pdata,
1663};
1664
Eric Holmberg023d25c2012-03-01 12:27:55 -07001665static struct resource smd_resource[] = {
1666 {
1667 .name = "a9_m2a_0",
1668 .start = INT_A9_M2A_0,
1669 .flags = IORESOURCE_IRQ,
1670 },
1671 {
1672 .name = "a9_m2a_5",
1673 .start = INT_A9_M2A_5,
1674 .flags = IORESOURCE_IRQ,
1675 },
1676 {
1677 .name = "adsp_a11",
1678 .start = INT_ADSP_A11,
1679 .flags = IORESOURCE_IRQ,
1680 },
1681 {
1682 .name = "adsp_a11_smsm",
1683 .start = INT_ADSP_A11_SMSM,
1684 .flags = IORESOURCE_IRQ,
1685 },
1686 {
1687 .name = "dsps_a11",
1688 .start = INT_DSPS_A11,
1689 .flags = IORESOURCE_IRQ,
1690 },
1691 {
1692 .name = "dsps_a11_smsm",
1693 .start = INT_DSPS_A11_SMSM,
1694 .flags = IORESOURCE_IRQ,
1695 },
1696 {
1697 .name = "wcnss_a11",
1698 .start = INT_WCNSS_A11,
1699 .flags = IORESOURCE_IRQ,
1700 },
1701 {
1702 .name = "wcnss_a11_smsm",
1703 .start = INT_WCNSS_A11_SMSM,
1704 .flags = IORESOURCE_IRQ,
1705 },
1706};
1707
1708static struct smd_subsystem_config smd_config_list[] = {
1709 {
1710 .irq_config_id = SMD_MODEM,
1711 .subsys_name = "gss",
1712 .edge = SMD_APPS_MODEM,
1713
1714 .smd_int.irq_name = "a9_m2a_0",
1715 .smd_int.flags = IRQF_TRIGGER_RISING,
1716 .smd_int.irq_id = -1,
1717 .smd_int.device_name = "smd_dev",
1718 .smd_int.dev_id = 0,
1719 .smd_int.out_bit_pos = 1 << 3,
1720 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1721 .smd_int.out_offset = 0x8,
1722
1723 .smsm_int.irq_name = "a9_m2a_5",
1724 .smsm_int.flags = IRQF_TRIGGER_RISING,
1725 .smsm_int.irq_id = -1,
1726 .smsm_int.device_name = "smd_smsm",
1727 .smsm_int.dev_id = 0,
1728 .smsm_int.out_bit_pos = 1 << 4,
1729 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1730 .smsm_int.out_offset = 0x8,
1731 },
1732 {
1733 .irq_config_id = SMD_Q6,
1734 .subsys_name = "q6",
1735 .edge = SMD_APPS_QDSP,
1736
1737 .smd_int.irq_name = "adsp_a11",
1738 .smd_int.flags = IRQF_TRIGGER_RISING,
1739 .smd_int.irq_id = -1,
1740 .smd_int.device_name = "smd_dev",
1741 .smd_int.dev_id = 0,
1742 .smd_int.out_bit_pos = 1 << 15,
1743 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1744 .smd_int.out_offset = 0x8,
1745
1746 .smsm_int.irq_name = "adsp_a11_smsm",
1747 .smsm_int.flags = IRQF_TRIGGER_RISING,
1748 .smsm_int.irq_id = -1,
1749 .smsm_int.device_name = "smd_smsm",
1750 .smsm_int.dev_id = 0,
1751 .smsm_int.out_bit_pos = 1 << 14,
1752 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1753 .smsm_int.out_offset = 0x8,
1754 },
1755 {
1756 .irq_config_id = SMD_DSPS,
1757 .subsys_name = "dsps",
1758 .edge = SMD_APPS_DSPS,
1759
1760 .smd_int.irq_name = "dsps_a11",
1761 .smd_int.flags = IRQF_TRIGGER_RISING,
1762 .smd_int.irq_id = -1,
1763 .smd_int.device_name = "smd_dev",
1764 .smd_int.dev_id = 0,
1765 .smd_int.out_bit_pos = 1,
1766 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1767 .smd_int.out_offset = 0x4080,
1768
1769 .smsm_int.irq_name = "dsps_a11_smsm",
1770 .smsm_int.flags = IRQF_TRIGGER_RISING,
1771 .smsm_int.irq_id = -1,
1772 .smsm_int.device_name = "smd_smsm",
1773 .smsm_int.dev_id = 0,
1774 .smsm_int.out_bit_pos = 1,
1775 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1776 .smsm_int.out_offset = 0x4094,
1777 },
1778 {
1779 .irq_config_id = SMD_WCNSS,
1780 .subsys_name = "wcnss",
1781 .edge = SMD_APPS_WCNSS,
1782
1783 .smd_int.irq_name = "wcnss_a11",
1784 .smd_int.flags = IRQF_TRIGGER_RISING,
1785 .smd_int.irq_id = -1,
1786 .smd_int.device_name = "smd_dev",
1787 .smd_int.dev_id = 0,
1788 .smd_int.out_bit_pos = 1 << 25,
1789 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1790 .smd_int.out_offset = 0x8,
1791
1792 .smsm_int.irq_name = "wcnss_a11_smsm",
1793 .smsm_int.flags = IRQF_TRIGGER_RISING,
1794 .smsm_int.irq_id = -1,
1795 .smsm_int.device_name = "smd_smsm",
1796 .smsm_int.dev_id = 0,
1797 .smsm_int.out_bit_pos = 1 << 23,
1798 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1799 .smsm_int.out_offset = 0x8,
1800 },
1801};
1802
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001803static struct smd_subsystem_restart_config smd_ssr_config = {
1804 .disable_smsm_reset_handshake = 1,
1805};
1806
Eric Holmberg023d25c2012-03-01 12:27:55 -07001807static struct smd_platform smd_platform_data = {
1808 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1809 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001810 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001811};
1812
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001813struct platform_device msm_device_smd_apq8064 = {
1814 .name = "msm_smd",
1815 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001816 .resource = smd_resource,
1817 .num_resources = ARRAY_SIZE(smd_resource),
1818 .dev = {
1819 .platform_data = &smd_platform_data,
1820 },
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001821};
1822
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001823static struct resource resources_msm_pcie[] = {
1824 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06001825 .name = "pcie_parf",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001826 .start = PCIE20_PARF_PHYS,
1827 .end = PCIE20_PARF_PHYS + PCIE20_PARF_SIZE - 1,
1828 .flags = IORESOURCE_MEM,
1829 },
1830 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06001831 .name = "pcie_elbi",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001832 .start = PCIE20_ELBI_PHYS,
1833 .end = PCIE20_ELBI_PHYS + PCIE20_ELBI_SIZE - 1,
1834 .flags = IORESOURCE_MEM,
1835 },
1836 {
1837 .name = "pcie20",
1838 .start = PCIE20_PHYS,
1839 .end = PCIE20_PHYS + PCIE20_SIZE - 1,
1840 .flags = IORESOURCE_MEM,
1841 },
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001842};
1843
1844struct platform_device msm_device_pcie = {
1845 .name = "msm_pcie",
1846 .id = -1,
1847 .num_resources = ARRAY_SIZE(resources_msm_pcie),
1848 .resource = resources_msm_pcie,
1849};
1850
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001851#ifdef CONFIG_HW_RANDOM_MSM
1852/* PRNG device */
1853#define MSM_PRNG_PHYS 0x1A500000
1854static struct resource rng_resources = {
1855 .flags = IORESOURCE_MEM,
1856 .start = MSM_PRNG_PHYS,
1857 .end = MSM_PRNG_PHYS + SZ_512 - 1,
1858};
1859
1860struct platform_device apq8064_device_rng = {
1861 .name = "msm_rng",
1862 .id = 0,
1863 .num_resources = 1,
1864 .resource = &rng_resources,
1865};
1866#endif
1867
Matt Wagantall292aace2012-01-26 19:12:34 -08001868static struct resource msm_gss_resources[] = {
1869 {
1870 .start = 0x10000000,
1871 .end = 0x10000000 + SZ_256 - 1,
1872 .flags = IORESOURCE_MEM,
1873 },
Matt Wagantall19ac4fd2012-02-03 20:18:23 -08001874 {
1875 .start = 0x10008000,
1876 .end = 0x10008000 + SZ_256 - 1,
1877 .flags = IORESOURCE_MEM,
1878 },
Matt Wagantall292aace2012-01-26 19:12:34 -08001879};
1880
1881struct platform_device msm_gss = {
1882 .name = "pil_gss",
1883 .id = -1,
1884 .num_resources = ARRAY_SIZE(msm_gss_resources),
1885 .resource = msm_gss_resources,
1886};
1887
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001888static struct fs_driver_data gfx3d_fs_data = {
1889 .clks = (struct fs_clk_data[]){
1890 { .name = "core_clk", .reset_rate = 27000000 },
1891 { .name = "iface_clk" },
1892 { .name = "bus_clk" },
1893 { 0 }
1894 },
1895 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
1896 .bus_port1 = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
Matt Wagantall1875d322012-02-22 16:11:33 -08001897};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001898
1899static struct fs_driver_data ijpeg_fs_data = {
1900 .clks = (struct fs_clk_data[]){
1901 { .name = "core_clk" },
1902 { .name = "iface_clk" },
1903 { .name = "bus_clk" },
1904 { 0 }
1905 },
1906 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
1907};
1908
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07001909static struct fs_driver_data mdp_fs_data = {
1910 .clks = (struct fs_clk_data[]){
1911 { .name = "core_clk" },
1912 { .name = "iface_clk" },
1913 { .name = "bus_clk" },
1914 { .name = "vsync_clk" },
1915 { .name = "lut_clk" },
1916 { .name = "tv_src_clk" },
1917 { .name = "tv_clk" },
Matt Wagantallc33c1ed2012-07-23 17:19:08 -07001918 { .name = "reset1_clk" },
1919 { .name = "reset2_clk" },
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07001920 { 0 }
1921 },
1922 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
1923 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
1924};
1925
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001926static struct fs_driver_data rot_fs_data = {
1927 .clks = (struct fs_clk_data[]){
1928 { .name = "core_clk" },
1929 { .name = "iface_clk" },
1930 { .name = "bus_clk" },
1931 { 0 }
1932 },
1933 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
1934};
1935
1936static struct fs_driver_data ved_fs_data = {
1937 .clks = (struct fs_clk_data[]){
1938 { .name = "core_clk" },
1939 { .name = "iface_clk" },
1940 { .name = "bus_clk" },
1941 { 0 }
1942 },
1943 .bus_port0 = MSM_BUS_MASTER_VIDEO_ENC,
1944 .bus_port1 = MSM_BUS_MASTER_VIDEO_DEC,
1945};
1946
1947static struct fs_driver_data vfe_fs_data = {
1948 .clks = (struct fs_clk_data[]){
1949 { .name = "core_clk" },
1950 { .name = "iface_clk" },
1951 { .name = "bus_clk" },
1952 { 0 }
1953 },
1954 .bus_port0 = MSM_BUS_MASTER_VFE,
1955};
1956
1957static struct fs_driver_data vpe_fs_data = {
1958 .clks = (struct fs_clk_data[]){
1959 { .name = "core_clk" },
1960 { .name = "iface_clk" },
1961 { .name = "bus_clk" },
1962 { 0 }
1963 },
1964 .bus_port0 = MSM_BUS_MASTER_VPE,
1965};
1966
1967static struct fs_driver_data vcap_fs_data = {
1968 .clks = (struct fs_clk_data[]){
1969 { .name = "core_clk" },
1970 { .name = "iface_clk" },
1971 { .name = "bus_clk" },
1972 { 0 },
1973 },
1974 .bus_port0 = MSM_BUS_MASTER_VIDEO_CAP,
1975};
1976
1977struct platform_device *apq8064_footswitch[] __initdata = {
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07001978 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07001979 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -07001980 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07001981 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
1982 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07001983 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07001984 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall3cd5b3d2012-05-03 20:35:20 -07001985 FS_8X60(FS_VCAP, "vdd", "msm_vcap.0", &vcap_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001986};
1987unsigned apq8064_num_footswitch __initdata = ARRAY_SIZE(apq8064_footswitch);
Matt Wagantall1875d322012-02-22 16:11:33 -08001988
Praveen Chidambaram78499012011-11-01 17:15:17 -06001989struct msm_rpm_platform_data apq8064_rpm_data __initdata = {
1990 .reg_base_addrs = {
1991 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
1992 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
1993 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
1994 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
1995 },
1996 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08001997 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06001998 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001999 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2000 .ipc_rpm_val = 4,
2001 .target_id = {
2002 MSM_RPM_MAP(8064, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2003 MSM_RPM_MAP(8064, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2004 MSM_RPM_MAP(8064, INVALIDATE_0, INVALIDATE, 8),
2005 MSM_RPM_MAP(8064, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2006 MSM_RPM_MAP(8064, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2007 MSM_RPM_MAP(8064, RPM_CTL, RPM_CTL, 1),
2008 MSM_RPM_MAP(8064, CXO_CLK, CXO_CLK, 1),
2009 MSM_RPM_MAP(8064, PXO_CLK, PXO_CLK, 1),
2010 MSM_RPM_MAP(8064, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2011 MSM_RPM_MAP(8064, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2012 MSM_RPM_MAP(8064, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2013 MSM_RPM_MAP(8064, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2014 MSM_RPM_MAP(8064, SFPB_CLK, SFPB_CLK, 1),
2015 MSM_RPM_MAP(8064, CFPB_CLK, CFPB_CLK, 1),
2016 MSM_RPM_MAP(8064, MMFPB_CLK, MMFPB_CLK, 1),
2017 MSM_RPM_MAP(8064, EBI1_CLK, EBI1_CLK, 1),
2018 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_HALT_0,
2019 APPS_FABRIC_CFG_HALT, 2),
2020 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_CLKMOD_0,
2021 APPS_FABRIC_CFG_CLKMOD, 3),
2022 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_IOCTL,
2023 APPS_FABRIC_CFG_IOCTL, 1),
2024 MSM_RPM_MAP(8064, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2025 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_HALT_0,
2026 SYS_FABRIC_CFG_HALT, 2),
2027 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_CLKMOD_0,
2028 SYS_FABRIC_CFG_CLKMOD, 3),
2029 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_IOCTL,
2030 SYS_FABRIC_CFG_IOCTL, 1),
2031 MSM_RPM_MAP(8064, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 30),
2032 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_HALT_0,
2033 MMSS_FABRIC_CFG_HALT, 2),
2034 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_CLKMOD_0,
2035 MMSS_FABRIC_CFG_CLKMOD, 3),
2036 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_IOCTL,
2037 MMSS_FABRIC_CFG_IOCTL, 1),
2038 MSM_RPM_MAP(8064, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 21),
2039 MSM_RPM_MAP(8064, PM8921_S1_0, PM8921_S1, 2),
2040 MSM_RPM_MAP(8064, PM8921_S2_0, PM8921_S2, 2),
2041 MSM_RPM_MAP(8064, PM8921_S3_0, PM8921_S3, 2),
2042 MSM_RPM_MAP(8064, PM8921_S4_0, PM8921_S4, 2),
2043 MSM_RPM_MAP(8064, PM8921_S5_0, PM8921_S5, 2),
2044 MSM_RPM_MAP(8064, PM8921_S6_0, PM8921_S6, 2),
2045 MSM_RPM_MAP(8064, PM8921_S7_0, PM8921_S7, 2),
2046 MSM_RPM_MAP(8064, PM8921_S8_0, PM8921_S8, 2),
2047 MSM_RPM_MAP(8064, PM8921_L1_0, PM8921_L1, 2),
2048 MSM_RPM_MAP(8064, PM8921_L2_0, PM8921_L2, 2),
2049 MSM_RPM_MAP(8064, PM8921_L3_0, PM8921_L3, 2),
2050 MSM_RPM_MAP(8064, PM8921_L4_0, PM8921_L4, 2),
2051 MSM_RPM_MAP(8064, PM8921_L5_0, PM8921_L5, 2),
2052 MSM_RPM_MAP(8064, PM8921_L6_0, PM8921_L6, 2),
2053 MSM_RPM_MAP(8064, PM8921_L7_0, PM8921_L7, 2),
2054 MSM_RPM_MAP(8064, PM8921_L8_0, PM8921_L8, 2),
2055 MSM_RPM_MAP(8064, PM8921_L9_0, PM8921_L9, 2),
2056 MSM_RPM_MAP(8064, PM8921_L10_0, PM8921_L10, 2),
2057 MSM_RPM_MAP(8064, PM8921_L11_0, PM8921_L11, 2),
2058 MSM_RPM_MAP(8064, PM8921_L12_0, PM8921_L12, 2),
2059 MSM_RPM_MAP(8064, PM8921_L13_0, PM8921_L13, 2),
2060 MSM_RPM_MAP(8064, PM8921_L14_0, PM8921_L14, 2),
2061 MSM_RPM_MAP(8064, PM8921_L15_0, PM8921_L15, 2),
2062 MSM_RPM_MAP(8064, PM8921_L16_0, PM8921_L16, 2),
2063 MSM_RPM_MAP(8064, PM8921_L17_0, PM8921_L17, 2),
2064 MSM_RPM_MAP(8064, PM8921_L18_0, PM8921_L18, 2),
2065 MSM_RPM_MAP(8064, PM8921_L19_0, PM8921_L19, 2),
2066 MSM_RPM_MAP(8064, PM8921_L20_0, PM8921_L20, 2),
2067 MSM_RPM_MAP(8064, PM8921_L21_0, PM8921_L21, 2),
2068 MSM_RPM_MAP(8064, PM8921_L22_0, PM8921_L22, 2),
2069 MSM_RPM_MAP(8064, PM8921_L23_0, PM8921_L23, 2),
2070 MSM_RPM_MAP(8064, PM8921_L24_0, PM8921_L24, 2),
2071 MSM_RPM_MAP(8064, PM8921_L25_0, PM8921_L25, 2),
2072 MSM_RPM_MAP(8064, PM8921_L26_0, PM8921_L26, 2),
2073 MSM_RPM_MAP(8064, PM8921_L27_0, PM8921_L27, 2),
2074 MSM_RPM_MAP(8064, PM8921_L28_0, PM8921_L28, 2),
2075 MSM_RPM_MAP(8064, PM8921_L29_0, PM8921_L29, 2),
2076 MSM_RPM_MAP(8064, PM8921_CLK1_0, PM8921_CLK1, 2),
2077 MSM_RPM_MAP(8064, PM8921_CLK2_0, PM8921_CLK2, 2),
2078 MSM_RPM_MAP(8064, PM8921_LVS1, PM8921_LVS1, 1),
2079 MSM_RPM_MAP(8064, PM8921_LVS2, PM8921_LVS2, 1),
2080 MSM_RPM_MAP(8064, PM8921_LVS3, PM8921_LVS3, 1),
2081 MSM_RPM_MAP(8064, PM8921_LVS4, PM8921_LVS4, 1),
2082 MSM_RPM_MAP(8064, PM8921_LVS5, PM8921_LVS5, 1),
2083 MSM_RPM_MAP(8064, PM8921_LVS6, PM8921_LVS6, 1),
2084 MSM_RPM_MAP(8064, PM8921_LVS7, PM8921_LVS7, 1),
2085 MSM_RPM_MAP(8064, PM8821_S1_0, PM8821_S1, 2),
2086 MSM_RPM_MAP(8064, PM8821_S2_0, PM8821_S2, 2),
2087 MSM_RPM_MAP(8064, PM8821_L1_0, PM8821_L1, 2),
2088 MSM_RPM_MAP(8064, NCP_0, NCP, 2),
2089 MSM_RPM_MAP(8064, CXO_BUFFERS, CXO_BUFFERS, 1),
2090 MSM_RPM_MAP(8064, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2091 MSM_RPM_MAP(8064, HDMI_SWITCH, HDMI_SWITCH, 1),
2092 MSM_RPM_MAP(8064, DDR_DMM_0, DDR_DMM, 2),
2093 MSM_RPM_MAP(8064, QDSS_CLK, QDSS_CLK, 1),
Joel Kingef390842012-05-23 16:42:48 -07002094 MSM_RPM_MAP(8064, VDDMIN_GPIO, VDDMIN_GPIO, 1),
Praveen Chidambaram78499012011-11-01 17:15:17 -06002095 },
2096 .target_status = {
2097 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MAJOR),
2098 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MINOR),
2099 MSM_RPM_STATUS_ID_MAP(8064, VERSION_BUILD),
2100 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_0),
2101 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_1),
2102 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_2),
2103 MSM_RPM_STATUS_ID_MAP(8064, RESERVED_SUPPORTED_RESOURCES_0),
2104 MSM_RPM_STATUS_ID_MAP(8064, SEQUENCE),
2105 MSM_RPM_STATUS_ID_MAP(8064, RPM_CTL),
2106 MSM_RPM_STATUS_ID_MAP(8064, CXO_CLK),
2107 MSM_RPM_STATUS_ID_MAP(8064, PXO_CLK),
2108 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CLK),
2109 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_CLK),
2110 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_CLK),
2111 MSM_RPM_STATUS_ID_MAP(8064, DAYTONA_FABRIC_CLK),
2112 MSM_RPM_STATUS_ID_MAP(8064, SFPB_CLK),
2113 MSM_RPM_STATUS_ID_MAP(8064, CFPB_CLK),
2114 MSM_RPM_STATUS_ID_MAP(8064, MMFPB_CLK),
2115 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CLK),
2116 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_HALT),
2117 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_CLKMOD),
2118 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_IOCTL),
2119 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_ARB),
2120 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_HALT),
2121 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_CLKMOD),
2122 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_IOCTL),
2123 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_ARB),
2124 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_HALT),
2125 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_CLKMOD),
2126 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_IOCTL),
2127 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_ARB),
2128 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_0),
2129 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_1),
2130 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_0),
2131 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_1),
2132 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_0),
2133 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_1),
2134 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_0),
2135 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_1),
2136 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_0),
2137 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_1),
2138 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_0),
2139 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_1),
2140 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_0),
2141 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_1),
2142 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_0),
2143 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_1),
2144 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_0),
2145 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_1),
2146 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_0),
2147 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_1),
2148 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_0),
2149 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_1),
2150 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_0),
2151 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_1),
2152 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_0),
2153 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_1),
2154 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_0),
2155 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_1),
2156 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_0),
2157 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_1),
2158 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_0),
2159 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_1),
2160 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_0),
2161 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_1),
2162 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_0),
2163 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_1),
2164 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_0),
2165 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_1),
2166 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_0),
2167 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_1),
2168 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_0),
2169 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_1),
2170 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_0),
2171 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_1),
2172 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_0),
2173 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_1),
2174 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_0),
2175 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_1),
2176 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_0),
2177 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_1),
2178 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_0),
2179 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_1),
2180 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_0),
2181 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_1),
2182 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_0),
2183 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_1),
2184 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_0),
2185 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_1),
2186 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_0),
2187 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_1),
2188 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_0),
2189 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_1),
2190 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_0),
2191 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_1),
2192 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_0),
2193 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_1),
2194 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_0),
2195 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_1),
2196 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_0),
2197 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_1),
2198 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_0),
2199 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_1),
2200 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_0),
2201 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_1),
2202 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_0),
2203 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_1),
2204 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_0),
2205 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_1),
2206 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS1),
2207 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS2),
2208 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS3),
2209 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS4),
2210 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS5),
2211 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS6),
2212 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS7),
2213 MSM_RPM_STATUS_ID_MAP(8064, NCP_0),
2214 MSM_RPM_STATUS_ID_MAP(8064, NCP_1),
2215 MSM_RPM_STATUS_ID_MAP(8064, CXO_BUFFERS),
2216 MSM_RPM_STATUS_ID_MAP(8064, USB_OTG_SWITCH),
2217 MSM_RPM_STATUS_ID_MAP(8064, HDMI_SWITCH),
2218 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_0),
2219 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_1),
2220 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH0_RANGE),
2221 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH1_RANGE),
2222 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_0),
2223 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_1),
2224 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_0),
2225 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_1),
2226 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_0),
2227 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_1),
Joel Kingef390842012-05-23 16:42:48 -07002228 MSM_RPM_STATUS_ID_MAP(8064, VDDMIN_GPIO),
Praveen Chidambaram78499012011-11-01 17:15:17 -06002229 },
2230 .target_ctrl_id = {
2231 MSM_RPM_CTRL_MAP(8064, VERSION_MAJOR),
2232 MSM_RPM_CTRL_MAP(8064, VERSION_MINOR),
2233 MSM_RPM_CTRL_MAP(8064, VERSION_BUILD),
2234 MSM_RPM_CTRL_MAP(8064, REQ_CTX_0),
2235 MSM_RPM_CTRL_MAP(8064, REQ_SEL_0),
2236 MSM_RPM_CTRL_MAP(8064, ACK_CTX_0),
2237 MSM_RPM_CTRL_MAP(8064, ACK_SEL_0),
2238 },
2239 .sel_invalidate = MSM_RPM_8064_SEL_INVALIDATE,
2240 .sel_notification = MSM_RPM_8064_SEL_NOTIFICATION,
2241 .sel_last = MSM_RPM_8064_SEL_LAST,
2242 .ver = {3, 0, 0},
2243};
2244
2245struct platform_device apq8064_rpm_device = {
2246 .name = "msm_rpm",
2247 .id = -1,
2248};
2249
2250static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2251 .phys_addr_base = 0x0010D204,
2252 .phys_size = SZ_8K,
2253};
2254
2255struct platform_device apq8064_rpm_stat_device = {
2256 .name = "msm_rpm_stat",
2257 .id = -1,
2258 .dev = {
2259 .platform_data = &msm_rpm_stat_pdata,
2260 },
2261};
2262
2263static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2264 .phys_addr_base = 0x0010C000,
2265 .reg_offsets = {
2266 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
2267 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
2268 },
2269 .phys_size = SZ_8K,
2270 .log_len = 4096, /* log's buffer length in bytes */
2271 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2272};
2273
2274struct platform_device apq8064_rpm_log_device = {
2275 .name = "msm_rpm_log",
2276 .id = -1,
2277 .dev = {
2278 .platform_data = &msm_rpm_log_pdata,
2279 },
2280};
2281
Jin Hongd3024e62012-02-09 16:13:32 -08002282/* Sensors DSPS platform data */
2283
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07002284#define PPSS_DSPS_TCM_CODE_BASE 0x12000000
2285#define PPSS_DSPS_TCM_CODE_SIZE 0x28000
2286#define PPSS_DSPS_TCM_BUF_BASE 0x12040000
2287#define PPSS_DSPS_TCM_BUF_SIZE 0x4000
2288#define PPSS_DSPS_PIPE_BASE 0x12800000
2289#define PPSS_DSPS_PIPE_SIZE 0x4000
2290#define PPSS_DSPS_DDR_BASE 0x8fe00000
2291#define PPSS_DSPS_DDR_SIZE 0x100000
2292#define PPSS_SMEM_BASE 0x80000000
2293#define PPSS_SMEM_SIZE 0x200000
Jin Hongd3024e62012-02-09 16:13:32 -08002294#define PPSS_REG_PHYS_BASE 0x12080000
2295
2296static struct dsps_clk_info dsps_clks[] = {};
2297static struct dsps_regulator_info dsps_regs[] = {};
2298
2299/*
2300 * Note: GPIOs field is intialized in run-time at the function
2301 * apq8064_init_dsps().
2302 */
2303
2304struct msm_dsps_platform_data msm_dsps_pdata_8064 = {
2305 .clks = dsps_clks,
2306 .clks_num = ARRAY_SIZE(dsps_clks),
2307 .gpios = NULL,
2308 .gpios_num = 0,
2309 .regs = dsps_regs,
2310 .regs_num = ARRAY_SIZE(dsps_regs),
2311 .dsps_pwr_ctl_en = 1,
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07002312 .tcm_code_start = PPSS_DSPS_TCM_CODE_BASE,
2313 .tcm_code_size = PPSS_DSPS_TCM_CODE_SIZE,
2314 .tcm_buf_start = PPSS_DSPS_TCM_BUF_BASE,
2315 .tcm_buf_size = PPSS_DSPS_TCM_BUF_SIZE,
2316 .pipe_start = PPSS_DSPS_PIPE_BASE,
2317 .pipe_size = PPSS_DSPS_PIPE_SIZE,
2318 .ddr_start = PPSS_DSPS_DDR_BASE,
2319 .ddr_size = PPSS_DSPS_DDR_SIZE,
2320 .smem_start = PPSS_SMEM_BASE,
2321 .smem_size = PPSS_SMEM_SIZE,
Jin Hongd3024e62012-02-09 16:13:32 -08002322 .signature = DSPS_SIGNATURE,
2323};
2324
2325static struct resource msm_dsps_resources[] = {
2326 {
2327 .start = PPSS_REG_PHYS_BASE,
2328 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2329 .name = "ppss_reg",
2330 .flags = IORESOURCE_MEM,
2331 },
2332
2333 {
2334 .start = PPSS_WDOG_TIMER_IRQ,
2335 .end = PPSS_WDOG_TIMER_IRQ,
2336 .name = "ppss_wdog",
2337 .flags = IORESOURCE_IRQ,
2338 },
2339};
2340
2341struct platform_device msm_dsps_device_8064 = {
2342 .name = "msm_dsps",
2343 .id = 0,
2344 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2345 .resource = msm_dsps_resources,
2346 .dev.platform_data = &msm_dsps_pdata_8064,
2347};
2348
Praveen Chidambaram78499012011-11-01 17:15:17 -06002349#ifdef CONFIG_MSM_MPM
2350static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
2351 [1] = MSM_GPIO_TO_INT(26),
2352 [2] = MSM_GPIO_TO_INT(88),
2353 [4] = MSM_GPIO_TO_INT(73),
2354 [5] = MSM_GPIO_TO_INT(74),
2355 [6] = MSM_GPIO_TO_INT(75),
2356 [7] = MSM_GPIO_TO_INT(76),
2357 [8] = MSM_GPIO_TO_INT(77),
2358 [9] = MSM_GPIO_TO_INT(36),
2359 [10] = MSM_GPIO_TO_INT(84),
2360 [11] = MSM_GPIO_TO_INT(7),
2361 [12] = MSM_GPIO_TO_INT(11),
2362 [13] = MSM_GPIO_TO_INT(52),
2363 [14] = MSM_GPIO_TO_INT(15),
2364 [15] = MSM_GPIO_TO_INT(83),
2365 [16] = USB3_HS_IRQ,
2366 [19] = MSM_GPIO_TO_INT(61),
2367 [20] = MSM_GPIO_TO_INT(58),
2368 [23] = MSM_GPIO_TO_INT(65),
2369 [24] = MSM_GPIO_TO_INT(63),
2370 [25] = USB1_HS_IRQ,
2371 [27] = HDMI_IRQ,
2372 [29] = MSM_GPIO_TO_INT(22),
2373 [30] = MSM_GPIO_TO_INT(72),
2374 [31] = USB4_HS_IRQ,
2375 [33] = MSM_GPIO_TO_INT(44),
2376 [34] = MSM_GPIO_TO_INT(39),
2377 [35] = MSM_GPIO_TO_INT(19),
2378 [36] = MSM_GPIO_TO_INT(23),
2379 [37] = MSM_GPIO_TO_INT(41),
2380 [38] = MSM_GPIO_TO_INT(30),
2381 [41] = MSM_GPIO_TO_INT(42),
2382 [42] = MSM_GPIO_TO_INT(56),
2383 [43] = MSM_GPIO_TO_INT(55),
2384 [44] = MSM_GPIO_TO_INT(50),
2385 [45] = MSM_GPIO_TO_INT(49),
2386 [46] = MSM_GPIO_TO_INT(47),
2387 [47] = MSM_GPIO_TO_INT(45),
2388 [48] = MSM_GPIO_TO_INT(38),
2389 [49] = MSM_GPIO_TO_INT(34),
2390 [50] = MSM_GPIO_TO_INT(32),
2391 [51] = MSM_GPIO_TO_INT(29),
2392 [52] = MSM_GPIO_TO_INT(18),
2393 [53] = MSM_GPIO_TO_INT(10),
2394 [54] = MSM_GPIO_TO_INT(81),
2395 [55] = MSM_GPIO_TO_INT(6),
2396};
2397
2398static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
2399 TLMM_MSM_SUMMARY_IRQ,
2400 RPM_APCC_CPU0_GP_HIGH_IRQ,
2401 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2402 RPM_APCC_CPU0_GP_LOW_IRQ,
2403 RPM_APCC_CPU0_WAKE_UP_IRQ,
2404 RPM_APCC_CPU1_GP_HIGH_IRQ,
2405 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2406 RPM_APCC_CPU1_GP_LOW_IRQ,
2407 RPM_APCC_CPU1_WAKE_UP_IRQ,
2408 MSS_TO_APPS_IRQ_0,
2409 MSS_TO_APPS_IRQ_1,
2410 MSS_TO_APPS_IRQ_2,
2411 MSS_TO_APPS_IRQ_3,
2412 MSS_TO_APPS_IRQ_4,
2413 MSS_TO_APPS_IRQ_5,
2414 MSS_TO_APPS_IRQ_6,
2415 MSS_TO_APPS_IRQ_7,
2416 MSS_TO_APPS_IRQ_8,
2417 MSS_TO_APPS_IRQ_9,
2418 LPASS_SCSS_GP_LOW_IRQ,
2419 LPASS_SCSS_GP_MEDIUM_IRQ,
2420 LPASS_SCSS_GP_HIGH_IRQ,
2421 SPS_MTI_30,
2422 SPS_MTI_31,
2423 RIVA_APSS_SPARE_IRQ,
2424 RIVA_APPS_WLAN_SMSM_IRQ,
2425 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2426 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Chandra Ramachandran59851722012-07-23 11:19:48 -07002427 PM8821_SEC_IRQ_N,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002428};
2429
2430struct msm_mpm_device_data apq8064_mpm_dev_data __initdata = {
2431 .irqs_m2a = msm_mpm_irqs_m2a,
2432 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2433 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2434 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2435 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2436 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2437 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2438 .mpm_apps_ipc_val = BIT(1),
2439 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2440
2441};
2442#endif
Joel Kingdacbc822012-01-25 13:30:57 -08002443
Joel King14fe7fa2012-05-27 14:26:11 -07002444/* AP2MDM_SOFT_RESET is implemented by the PON_RESET_N gpio */
Joel Kingdacbc822012-01-25 13:30:57 -08002445#define MDM2AP_ERRFATAL 19
2446#define AP2MDM_ERRFATAL 18
2447#define MDM2AP_STATUS 49
2448#define AP2MDM_STATUS 48
Joel King14fe7fa2012-05-27 14:26:11 -07002449#define AP2MDM_SOFT_RESET 27
Ameya Thakure155ece2012-07-09 12:08:37 -07002450#define I2S_AP2MDM_SOFT_RESET 0
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002451#define AP2MDM_WAKEUP 35
Ameya Thakure155ece2012-07-09 12:08:37 -07002452#define I2S_AP2MDM_WAKEUP 44
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002453#define MDM2AP_PBLRDY 46
Ameya Thakure155ece2012-07-09 12:08:37 -07002454#define I2S_MDM2AP_PBLRDY 81
Joel Kingdacbc822012-01-25 13:30:57 -08002455
2456static struct resource mdm_resources[] = {
2457 {
2458 .start = MDM2AP_ERRFATAL,
2459 .end = MDM2AP_ERRFATAL,
2460 .name = "MDM2AP_ERRFATAL",
2461 .flags = IORESOURCE_IO,
2462 },
2463 {
2464 .start = AP2MDM_ERRFATAL,
2465 .end = AP2MDM_ERRFATAL,
2466 .name = "AP2MDM_ERRFATAL",
2467 .flags = IORESOURCE_IO,
2468 },
2469 {
2470 .start = MDM2AP_STATUS,
2471 .end = MDM2AP_STATUS,
2472 .name = "MDM2AP_STATUS",
2473 .flags = IORESOURCE_IO,
2474 },
2475 {
2476 .start = AP2MDM_STATUS,
2477 .end = AP2MDM_STATUS,
2478 .name = "AP2MDM_STATUS",
2479 .flags = IORESOURCE_IO,
2480 },
2481 {
Joel King14fe7fa2012-05-27 14:26:11 -07002482 .start = AP2MDM_SOFT_RESET,
2483 .end = AP2MDM_SOFT_RESET,
2484 .name = "AP2MDM_SOFT_RESET",
Joel Kingdacbc822012-01-25 13:30:57 -08002485 .flags = IORESOURCE_IO,
2486 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002487 {
2488 .start = AP2MDM_WAKEUP,
2489 .end = AP2MDM_WAKEUP,
2490 .name = "AP2MDM_WAKEUP",
2491 .flags = IORESOURCE_IO,
2492 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002493 {
2494 .start = MDM2AP_PBLRDY,
2495 .end = MDM2AP_PBLRDY,
2496 .name = "MDM2AP_PBLRDY",
2497 .flags = IORESOURCE_IO,
2498 },
Joel Kingdacbc822012-01-25 13:30:57 -08002499};
2500
Ameya Thakure155ece2012-07-09 12:08:37 -07002501static struct resource i2s_mdm_resources[] = {
2502 {
2503 .start = MDM2AP_ERRFATAL,
2504 .end = MDM2AP_ERRFATAL,
2505 .name = "MDM2AP_ERRFATAL",
2506 .flags = IORESOURCE_IO,
2507 },
2508 {
2509 .start = AP2MDM_ERRFATAL,
2510 .end = AP2MDM_ERRFATAL,
2511 .name = "AP2MDM_ERRFATAL",
2512 .flags = IORESOURCE_IO,
2513 },
2514 {
2515 .start = MDM2AP_STATUS,
2516 .end = MDM2AP_STATUS,
2517 .name = "MDM2AP_STATUS",
2518 .flags = IORESOURCE_IO,
2519 },
2520 {
2521 .start = AP2MDM_STATUS,
2522 .end = AP2MDM_STATUS,
2523 .name = "AP2MDM_STATUS",
2524 .flags = IORESOURCE_IO,
2525 },
2526 {
2527 .start = I2S_AP2MDM_SOFT_RESET,
2528 .end = I2S_AP2MDM_SOFT_RESET,
2529 .name = "AP2MDM_SOFT_RESET",
2530 .flags = IORESOURCE_IO,
2531 },
2532 {
2533 .start = I2S_AP2MDM_WAKEUP,
2534 .end = I2S_AP2MDM_WAKEUP,
2535 .name = "AP2MDM_WAKEUP",
2536 .flags = IORESOURCE_IO,
2537 },
2538 {
2539 .start = I2S_MDM2AP_PBLRDY,
2540 .end = I2S_MDM2AP_PBLRDY,
2541 .name = "MDM2AP_PBLRDY",
2542 .flags = IORESOURCE_IO,
2543 },
2544};
2545
Joel Kingdacbc822012-01-25 13:30:57 -08002546struct platform_device mdm_8064_device = {
2547 .name = "mdm2_modem",
2548 .id = -1,
2549 .num_resources = ARRAY_SIZE(mdm_resources),
2550 .resource = mdm_resources,
2551};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002552
Ameya Thakure155ece2012-07-09 12:08:37 -07002553struct platform_device i2s_mdm_8064_device = {
2554 .name = "mdm2_modem",
2555 .id = -1,
2556 .num_resources = ARRAY_SIZE(i2s_mdm_resources),
2557 .resource = i2s_mdm_resources,
2558};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002559static int apq8064_LPM_latency = 1000; /* >100 usec for WFI */
2560
2561struct platform_device apq8064_cpu_idle_device = {
2562 .name = "msm_cpu_idle",
2563 .id = -1,
2564 .dev = {
2565 .platform_data = &apq8064_LPM_latency,
2566 },
2567};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002568
2569static struct msm_dcvs_freq_entry apq8064_freq[] = {
2570 { 384000, 166981, 345600},
2571 { 702000, 213049, 632502},
2572 {1026000, 285712, 925613},
2573 {1242000, 383945, 1176550},
2574 {1458000, 419729, 1465478},
2575 {1512000, 434116, 1546674},
2576
2577};
2578
2579static struct msm_dcvs_core_info apq8064_core_info = {
2580 .freq_tbl = &apq8064_freq[0],
2581 .core_param = {
2582 .max_time_us = 100000,
2583 .num_freq = ARRAY_SIZE(apq8064_freq),
2584 },
2585 .algo_param = {
2586 .slack_time_us = 58000,
2587 .scale_slack_time = 0,
2588 .scale_slack_time_pct = 0,
2589 .disable_pc_threshold = 1458000,
2590 .em_window_size = 100000,
2591 .em_max_util_pct = 97,
2592 .ss_window_size = 1000000,
2593 .ss_util_pct = 95,
2594 .ss_iobusy_conv = 100,
2595 },
2596};
2597
2598struct platform_device apq8064_msm_gov_device = {
2599 .name = "msm_dcvs_gov",
2600 .id = -1,
2601 .dev = {
2602 .platform_data = &apq8064_core_info,
2603 },
2604};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002605
Terence Hampson2e1705f2012-04-11 19:55:29 -04002606#ifdef CONFIG_MSM_VCAP
2607#define VCAP_HW_BASE 0x05900000
2608
2609static struct msm_bus_vectors vcap_init_vectors[] = {
2610 {
2611 .src = MSM_BUS_MASTER_VIDEO_CAP,
2612 .dst = MSM_BUS_SLAVE_EBI_CH0,
2613 .ab = 0,
2614 .ib = 0,
2615 },
2616};
2617
Terence Hampson2e1705f2012-04-11 19:55:29 -04002618static struct msm_bus_vectors vcap_480_vectors[] = {
2619 {
2620 .src = MSM_BUS_MASTER_VIDEO_CAP,
2621 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson779dc762012-06-07 15:59:27 -04002622 .ab = 480 * 720 * 3 * 60,
2623 .ib = 480 * 720 * 3 * 60 * 1.5,
2624 },
2625};
2626
2627static struct msm_bus_vectors vcap_576_vectors[] = {
2628 {
2629 .src = MSM_BUS_MASTER_VIDEO_CAP,
2630 .dst = MSM_BUS_SLAVE_EBI_CH0,
2631 .ab = 576 * 720 * 3 * 60,
2632 .ib = 576 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002633 },
2634};
2635
2636static struct msm_bus_vectors vcap_720_vectors[] = {
2637 {
2638 .src = MSM_BUS_MASTER_VIDEO_CAP,
2639 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002640 .ab = 1280 * 720 * 3 * 60,
2641 .ib = 1280 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002642 },
2643};
2644
2645static struct msm_bus_vectors vcap_1080_vectors[] = {
2646 {
2647 .src = MSM_BUS_MASTER_VIDEO_CAP,
2648 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002649 .ab = 1920 * 1080 * 3 * 60,
2650 .ib = 1920 * 1080 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002651 },
2652};
2653
2654static struct msm_bus_paths vcap_bus_usecases[] = {
2655 {
2656 ARRAY_SIZE(vcap_init_vectors),
2657 vcap_init_vectors,
2658 },
2659 {
2660 ARRAY_SIZE(vcap_480_vectors),
2661 vcap_480_vectors,
2662 },
2663 {
Terence Hampson779dc762012-06-07 15:59:27 -04002664 ARRAY_SIZE(vcap_576_vectors),
2665 vcap_576_vectors,
2666 },
2667 {
Terence Hampson2e1705f2012-04-11 19:55:29 -04002668 ARRAY_SIZE(vcap_720_vectors),
2669 vcap_720_vectors,
2670 },
2671 {
2672 ARRAY_SIZE(vcap_1080_vectors),
2673 vcap_1080_vectors,
2674 },
2675};
2676
2677static struct msm_bus_scale_pdata vcap_axi_client_pdata = {
2678 vcap_bus_usecases,
2679 ARRAY_SIZE(vcap_bus_usecases),
2680};
2681
2682static struct resource msm_vcap_resources[] = {
2683 {
2684 .name = "vcap",
2685 .start = VCAP_HW_BASE,
2686 .end = VCAP_HW_BASE + SZ_1M - 1,
2687 .flags = IORESOURCE_MEM,
2688 },
2689 {
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002690 .name = "vc_irq",
Terence Hampson2e1705f2012-04-11 19:55:29 -04002691 .start = VCAP_VC,
2692 .end = VCAP_VC,
2693 .flags = IORESOURCE_IRQ,
2694 },
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002695 {
2696 .name = "vp_irq",
2697 .start = VCAP_VP,
2698 .end = VCAP_VP,
2699 .flags = IORESOURCE_IRQ,
2700 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002701};
2702
2703static unsigned vcap_gpios[] = {
2704 2, 3, 4, 5, 6, 7, 8, 9, 10,
2705 11, 12, 13, 18, 19, 20, 21,
2706 22, 23, 24, 25, 26, 80, 82,
2707 83, 84, 85, 86, 87,
2708};
2709
2710static struct vcap_platform_data vcap_pdata = {
2711 .gpios = vcap_gpios,
2712 .num_gpios = ARRAY_SIZE(vcap_gpios),
2713 .bus_client_pdata = &vcap_axi_client_pdata
2714};
2715
2716struct platform_device msm8064_device_vcap = {
2717 .name = "msm_vcap",
2718 .id = 0,
2719 .resource = msm_vcap_resources,
2720 .num_resources = ARRAY_SIZE(msm_vcap_resources),
2721 .dev = {
2722 .platform_data = &vcap_pdata,
2723 },
2724};
2725#endif
2726
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002727static struct resource msm_cache_erp_resources[] = {
2728 {
2729 .name = "l1_irq",
2730 .start = SC_SICCPUXEXTFAULTIRPTREQ,
2731 .flags = IORESOURCE_IRQ,
2732 },
2733 {
2734 .name = "l2_irq",
2735 .start = APCC_QGICL2IRPTREQ,
2736 .flags = IORESOURCE_IRQ,
2737 }
2738};
2739
2740struct platform_device apq8064_device_cache_erp = {
2741 .name = "msm_cache_erp",
2742 .id = -1,
2743 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
2744 .resource = msm_cache_erp_resources,
2745};
Pratik Patel212ab362012-03-16 12:30:07 -07002746
Pratik Patel3b0ca882012-06-01 16:54:14 -07002747#define CORESIGHT_PHYS_BASE 0x01A00000
2748#define CORESIGHT_FUNNEL_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x4000)
2749#define CORESIGHT_ETM2_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1E000)
2750#define CORESIGHT_ETM3_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1F000)
Pratik Patel212ab362012-03-16 12:30:07 -07002751
Pratik Patel3b0ca882012-06-01 16:54:14 -07002752static struct resource coresight_funnel_resources[] = {
Pratik Patel212ab362012-03-16 12:30:07 -07002753 {
Pratik Patel3b0ca882012-06-01 16:54:14 -07002754 .start = CORESIGHT_FUNNEL_PHYS_BASE,
2755 .end = CORESIGHT_FUNNEL_PHYS_BASE + SZ_4K - 1,
Pratik Patel212ab362012-03-16 12:30:07 -07002756 .flags = IORESOURCE_MEM,
2757 },
2758};
2759
Pratik Patel3b0ca882012-06-01 16:54:14 -07002760static const int coresight_funnel_outports[] = { 0, 1 };
2761static const int coresight_funnel_child_ids[] = { 0, 1 };
2762static const int coresight_funnel_child_ports[] = { 0, 0 };
2763
2764static struct coresight_platform_data coresight_funnel_pdata = {
2765 .id = 2,
2766 .name = "coresight-funnel",
2767 .nr_inports = 4,
2768 .outports = coresight_funnel_outports,
2769 .child_ids = coresight_funnel_child_ids,
2770 .child_ports = coresight_funnel_child_ports,
2771 .nr_outports = ARRAY_SIZE(coresight_funnel_outports),
2772};
2773
2774struct platform_device apq8064_coresight_funnel_device = {
2775 .name = "coresight-funnel",
Pratik Patel212ab362012-03-16 12:30:07 -07002776 .id = 0,
Pratik Patel3b0ca882012-06-01 16:54:14 -07002777 .num_resources = ARRAY_SIZE(coresight_funnel_resources),
2778 .resource = coresight_funnel_resources,
2779 .dev = {
2780 .platform_data = &coresight_funnel_pdata,
2781 },
2782};
2783
2784static struct resource coresight_etm2_resources[] = {
2785 {
2786 .start = CORESIGHT_ETM2_PHYS_BASE,
2787 .end = CORESIGHT_ETM2_PHYS_BASE + SZ_4K - 1,
2788 .flags = IORESOURCE_MEM,
2789 },
2790};
2791
2792static const int coresight_etm2_outports[] = { 0 };
2793static const int coresight_etm2_child_ids[] = { 2 };
2794static const int coresight_etm2_child_ports[] = { 4 };
2795
2796static struct coresight_platform_data coresight_etm2_pdata = {
2797 .id = 6,
2798 .name = "coresight-etm2",
2799 .nr_inports = 1,
2800 .outports = coresight_etm2_outports,
2801 .child_ids = coresight_etm2_child_ids,
2802 .child_ports = coresight_etm2_child_ports,
2803 .nr_outports = ARRAY_SIZE(coresight_etm2_outports),
2804};
2805
2806struct platform_device coresight_etm2_device = {
2807 .name = "coresight-etm",
2808 .id = 2,
2809 .num_resources = ARRAY_SIZE(coresight_etm2_resources),
2810 .resource = coresight_etm2_resources,
2811 .dev = {
2812 .platform_data = &coresight_etm2_pdata,
2813 },
2814};
2815
2816static struct resource coresight_etm3_resources[] = {
2817 {
2818 .start = CORESIGHT_ETM3_PHYS_BASE,
2819 .end = CORESIGHT_ETM3_PHYS_BASE + SZ_4K - 1,
2820 .flags = IORESOURCE_MEM,
2821 },
2822};
2823
2824static const int coresight_etm3_outports[] = { 0 };
2825static const int coresight_etm3_child_ids[] = { 2 };
2826static const int coresight_etm3_child_ports[] = { 5 };
2827
2828static struct coresight_platform_data coresight_etm3_pdata = {
2829 .id = 7,
2830 .name = "coresight-etm3",
2831 .nr_inports = 3,
2832 .outports = coresight_etm3_outports,
2833 .child_ids = coresight_etm3_child_ids,
2834 .child_ports = coresight_etm3_child_ports,
2835 .nr_outports = ARRAY_SIZE(coresight_etm3_outports),
2836};
2837
2838struct platform_device coresight_etm3_device = {
2839 .name = "coresight-etm",
2840 .id = 3,
2841 .num_resources = ARRAY_SIZE(coresight_etm3_resources),
2842 .resource = coresight_etm3_resources,
2843 .dev = {
2844 .platform_data = &coresight_etm3_pdata,
2845 },
Pratik Patel212ab362012-03-16 12:30:07 -07002846};
Laura Abbott0577d7b2012-04-17 11:14:30 -07002847
2848struct msm_iommu_domain_name apq8064_iommu_ctx_names[] = {
2849 /* Camera */
2850 {
2851 .name = "vpe_src",
2852 .domain = CAMERA_DOMAIN,
2853 },
2854 /* Camera */
2855 {
2856 .name = "vpe_dst",
2857 .domain = CAMERA_DOMAIN,
2858 },
2859 /* Camera */
2860 {
2861 .name = "vfe_imgwr",
2862 .domain = CAMERA_DOMAIN,
2863 },
2864 /* Camera */
2865 {
2866 .name = "vfe_misc",
2867 .domain = CAMERA_DOMAIN,
2868 },
2869 /* Camera */
2870 {
2871 .name = "ijpeg_src",
2872 .domain = CAMERA_DOMAIN,
2873 },
2874 /* Camera */
2875 {
2876 .name = "ijpeg_dst",
2877 .domain = CAMERA_DOMAIN,
2878 },
2879 /* Camera */
2880 {
2881 .name = "jpegd_src",
2882 .domain = CAMERA_DOMAIN,
2883 },
2884 /* Camera */
2885 {
2886 .name = "jpegd_dst",
2887 .domain = CAMERA_DOMAIN,
2888 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002889 /* Rotator src*/
Laura Abbott0577d7b2012-04-17 11:14:30 -07002890 {
2891 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07002892 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002893 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002894 /* Rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002895 {
2896 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07002897 .domain = ROTATOR_DST_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002898 },
2899 /* Video */
2900 {
2901 .name = "vcodec_a_mm1",
2902 .domain = VIDEO_DOMAIN,
2903 },
2904 /* Video */
2905 {
2906 .name = "vcodec_b_mm2",
2907 .domain = VIDEO_DOMAIN,
2908 },
2909 /* Video */
2910 {
2911 .name = "vcodec_a_stream",
2912 .domain = VIDEO_DOMAIN,
2913 },
2914};
2915
2916static struct mem_pool apq8064_video_pools[] = {
2917 /*
2918 * Video hardware has the following requirements:
2919 * 1. All video addresses used by the video hardware must be at a higher
2920 * address than video firmware address.
2921 * 2. Video hardware can only access a range of 256MB from the base of
2922 * the video firmware.
2923 */
2924 [VIDEO_FIRMWARE_POOL] =
2925 /* Low addresses, intended for video firmware */
2926 {
2927 .paddr = SZ_128K,
2928 .size = SZ_16M - SZ_128K,
2929 },
2930 [VIDEO_MAIN_POOL] =
2931 /* Main video pool */
2932 {
2933 .paddr = SZ_16M,
2934 .size = SZ_256M - SZ_16M,
2935 },
2936 [GEN_POOL] =
2937 /* Remaining address space up to 2G */
2938 {
2939 .paddr = SZ_256M,
2940 .size = SZ_2G - SZ_256M,
2941 },
2942};
2943
2944static struct mem_pool apq8064_camera_pools[] = {
2945 [GEN_POOL] =
2946 /* One address space for camera */
2947 {
2948 .paddr = SZ_128K,
2949 .size = SZ_2G - SZ_128K,
2950 },
2951};
2952
Olav Hauganef95ae32012-05-15 09:50:30 -07002953static struct mem_pool apq8064_display_read_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07002954 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07002955 /* One address space for display reads */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002956 {
2957 .paddr = SZ_128K,
2958 .size = SZ_2G - SZ_128K,
2959 },
2960};
2961
Olav Hauganef95ae32012-05-15 09:50:30 -07002962static struct mem_pool apq8064_display_write_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07002963 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07002964 /* One address space for display writes */
2965 {
2966 .paddr = SZ_128K,
2967 .size = SZ_2G - SZ_128K,
2968 },
2969};
2970
2971static struct mem_pool apq8064_rotator_src_pools[] = {
2972 [GEN_POOL] =
2973 /* One address space for rotator src */
2974 {
2975 .paddr = SZ_128K,
2976 .size = SZ_2G - SZ_128K,
2977 },
2978};
2979
2980static struct mem_pool apq8064_rotator_dst_pools[] = {
2981 [GEN_POOL] =
2982 /* One address space for rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002983 {
2984 .paddr = SZ_128K,
2985 .size = SZ_2G - SZ_128K,
2986 },
2987};
2988
2989static struct msm_iommu_domain apq8064_iommu_domains[] = {
2990 [VIDEO_DOMAIN] = {
2991 .iova_pools = apq8064_video_pools,
2992 .npools = ARRAY_SIZE(apq8064_video_pools),
2993 },
2994 [CAMERA_DOMAIN] = {
2995 .iova_pools = apq8064_camera_pools,
2996 .npools = ARRAY_SIZE(apq8064_camera_pools),
2997 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002998 [DISPLAY_READ_DOMAIN] = {
2999 .iova_pools = apq8064_display_read_pools,
3000 .npools = ARRAY_SIZE(apq8064_display_read_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07003001 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003002 [DISPLAY_WRITE_DOMAIN] = {
3003 .iova_pools = apq8064_display_write_pools,
3004 .npools = ARRAY_SIZE(apq8064_display_write_pools),
3005 },
3006 [ROTATOR_SRC_DOMAIN] = {
3007 .iova_pools = apq8064_rotator_src_pools,
3008 .npools = ARRAY_SIZE(apq8064_rotator_src_pools),
3009 },
3010 [ROTATOR_DST_DOMAIN] = {
3011 .iova_pools = apq8064_rotator_dst_pools,
3012 .npools = ARRAY_SIZE(apq8064_rotator_dst_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07003013 },
3014};
3015
3016struct iommu_domains_pdata apq8064_iommu_domain_pdata = {
3017 .domains = apq8064_iommu_domains,
3018 .ndomains = ARRAY_SIZE(apq8064_iommu_domains),
3019 .domain_names = apq8064_iommu_ctx_names,
3020 .nnames = ARRAY_SIZE(apq8064_iommu_ctx_names),
3021 .domain_alloc_flags = 0,
3022};
3023
3024struct platform_device apq8064_iommu_domain_device = {
3025 .name = "iommu_domains",
3026 .id = -1,
3027 .dev = {
3028 .platform_data = &apq8064_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07003029 }
3030};
3031
3032struct msm_rtb_platform_data apq8064_rtb_pdata = {
3033 .size = SZ_1M,
3034};
3035
3036static int __init msm_rtb_set_buffer_size(char *p)
3037{
3038 int s;
3039
3040 s = memparse(p, NULL);
3041 apq8064_rtb_pdata.size = ALIGN(s, SZ_4K);
3042 return 0;
3043}
3044early_param("msm_rtb_size", msm_rtb_set_buffer_size);
3045
3046struct platform_device apq8064_rtb_device = {
3047 .name = "msm_rtb",
3048 .id = -1,
3049 .dev = {
3050 .platform_data = &apq8064_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003051 },
3052};
Laura Abbott93a4a352012-05-25 09:26:35 -07003053
3054#define APQ8064_L1_SIZE SZ_1M
3055/*
3056 * The actual L2 size is smaller but we need a larger buffer
3057 * size to store other dump information
3058 */
3059#define APQ8064_L2_SIZE SZ_8M
3060
3061struct msm_cache_dump_platform_data apq8064_cache_dump_pdata = {
3062 .l2_size = APQ8064_L2_SIZE,
3063 .l1_size = APQ8064_L1_SIZE,
3064};
3065
3066struct platform_device apq8064_cache_dump_device = {
3067 .name = "msm_cache_dump",
3068 .id = -1,
3069 .dev = {
3070 .platform_data = &apq8064_cache_dump_pdata,
3071 },
3072};