blob: aa67690aa94a1ccad4729017daf8cd37d39ae20d [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>
18#include <linux/clkdev.h>
Hemant Kumard86c4882012-01-24 19:39:37 -080019#include <linux/dma-mapping.h>
Pratik Patel1746b8f2012-06-02 21:11:41 -070020#include <linux/coresight.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021#include <mach/irqs-8064.h>
22#include <mach/board.h>
23#include <mach/msm_iomap.h>
Yan He06913ce2011-08-26 16:33:46 -070024#include <mach/usbdiag.h>
25#include <mach/msm_sps.h>
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -070026#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080027#include <mach/msm_dsps.h>
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -080028#include <sound/msm-dai-q6.h>
29#include <sound/apr_audio.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070030#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060031#include <mach/rpm.h>
Joel Kingdacbc822012-01-25 13:30:57 -080032#include <mach/mdm2.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070033#include <mach/msm_smd.h>
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070034#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070035#include <mach/msm_rtb.h>
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -080036#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037#include "clock.h"
38#include "devices.h"
Matt Wagantall1875d322012-02-22 16:11:33 -080039#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070040#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060041#include "rpm_stats.h"
42#include "rpm_log.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053043#include <mach/mpm.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070044#include <mach/iommu_domains.h>
Laura Abbott93a4a352012-05-25 09:26:35 -070045#include <mach/msm_cache_dump.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046
47/* Address of GSBI blocks */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070048#define MSM_GSBI1_PHYS 0x12440000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#define MSM_GSBI3_PHYS 0x16200000
Harini Jayaramanc4c58692011-07-19 14:50:10 -060050#define MSM_GSBI4_PHYS 0x16300000
51#define MSM_GSBI5_PHYS 0x1A200000
52#define MSM_GSBI6_PHYS 0x16500000
53#define MSM_GSBI7_PHYS 0x16600000
54
Kenneth Heitke748593a2011-07-15 15:45:11 -060055/* GSBI UART devices */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070056#define MSM_UART1DM_PHYS (MSM_GSBI1_PHYS + 0x10000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
Jin Hong4bbbfba2012-02-02 21:48:07 -080058#define MSM_UART7DM_PHYS (MSM_GSBI7_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070059
Harini Jayaramanc4c58692011-07-19 14:50:10 -060060/* GSBI QUP devices */
David Keitel3c40fc52012-02-09 17:53:52 -080061#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x20000)
Harini Jayaramanc4c58692011-07-19 14:50:10 -060062#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
63#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
64#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
65#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
66#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
67#define MSM_QUP_SIZE SZ_4K
68
Kenneth Heitke36920d32011-07-20 16:44:30 -060069/* Address of SSBI CMD */
70#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
71#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
72#define MSM_PMIC_SSBI_SIZE SZ_4K
Harini Jayaramanc4c58692011-07-19 14:50:10 -060073
Hemant Kumarcaa09092011-07-30 00:26:33 -070074/* Address of HS USBOTG1 */
Hemant Kumard86c4882012-01-24 19:39:37 -080075#define MSM_HSUSB1_PHYS 0x12500000
76#define MSM_HSUSB1_SIZE SZ_4K
Hemant Kumarcaa09092011-07-30 00:26:33 -070077
Manu Gautam91223e02011-11-08 15:27:22 +053078/* Address of HS USB3 */
79#define MSM_HSUSB3_PHYS 0x12520000
80#define MSM_HSUSB3_SIZE SZ_4K
81
Hemant Kumar1d66e1c2012-02-13 15:24:59 -080082/* Address of HS USB4 */
83#define MSM_HSUSB4_PHYS 0x12530000
84#define MSM_HSUSB4_SIZE SZ_4K
85
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060086/* Address of PCIE20 PARF */
87#define PCIE20_PARF_PHYS 0x1b600000
88#define PCIE20_PARF_SIZE SZ_128
89
90/* Address of PCIE20 ELBI */
91#define PCIE20_ELBI_PHYS 0x1b502000
92#define PCIE20_ELBI_SIZE SZ_256
93
94/* Address of PCIE20 */
95#define PCIE20_PHYS 0x1b500000
96#define PCIE20_SIZE SZ_4K
97
Jeff Ohlstein7e668552011-10-06 16:17:25 -070098static struct msm_watchdog_pdata msm_watchdog_pdata = {
99 .pet_time = 10000,
100 .bark_time = 11000,
101 .has_secure = true,
Joel Kinge7ca6f72012-02-09 20:51:25 -0800102 .needs_expired_enable = true,
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700103};
104
105struct platform_device msm8064_device_watchdog = {
106 .name = "msm_watchdog",
107 .id = -1,
108 .dev = {
109 .platform_data = &msm_watchdog_pdata,
110 },
111};
112
Joel King0581896d2011-07-19 16:43:28 -0700113static struct resource msm_dmov_resource[] = {
114 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800115 .start = ADM_0_SCSS_1_IRQ,
Joel King0581896d2011-07-19 16:43:28 -0700116 .flags = IORESOURCE_IRQ,
117 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700118 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800119 .start = 0x18320000,
120 .end = 0x18320000 + SZ_1M - 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700121 .flags = IORESOURCE_MEM,
122 },
123};
124
125static struct msm_dmov_pdata msm_dmov_pdata = {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800126 .sd = 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700127 .sd_size = 0x800,
Joel King0581896d2011-07-19 16:43:28 -0700128};
129
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700130struct platform_device apq8064_device_dmov = {
Joel King0581896d2011-07-19 16:43:28 -0700131 .name = "msm_dmov",
132 .id = -1,
133 .resource = msm_dmov_resource,
134 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700135 .dev = {
136 .platform_data = &msm_dmov_pdata,
137 },
Joel King0581896d2011-07-19 16:43:28 -0700138};
139
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700140static struct resource resources_uart_gsbi1[] = {
141 {
142 .start = APQ8064_GSBI1_UARTDM_IRQ,
143 .end = APQ8064_GSBI1_UARTDM_IRQ,
144 .flags = IORESOURCE_IRQ,
145 },
146 {
147 .start = MSM_UART1DM_PHYS,
148 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
149 .name = "uartdm_resource",
150 .flags = IORESOURCE_MEM,
151 },
152 {
153 .start = MSM_GSBI1_PHYS,
154 .end = MSM_GSBI1_PHYS + PAGE_SIZE - 1,
155 .name = "gsbi_resource",
156 .flags = IORESOURCE_MEM,
157 },
158};
159
160struct platform_device apq8064_device_uart_gsbi1 = {
161 .name = "msm_serial_hsl",
Jin Hong4bbbfba2012-02-02 21:48:07 -0800162 .id = 1,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700163 .num_resources = ARRAY_SIZE(resources_uart_gsbi1),
164 .resource = resources_uart_gsbi1,
165};
166
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700167static struct resource resources_uart_gsbi3[] = {
168 {
169 .start = GSBI3_UARTDM_IRQ,
170 .end = GSBI3_UARTDM_IRQ,
171 .flags = IORESOURCE_IRQ,
172 },
173 {
174 .start = MSM_UART3DM_PHYS,
175 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
176 .name = "uartdm_resource",
177 .flags = IORESOURCE_MEM,
178 },
179 {
180 .start = MSM_GSBI3_PHYS,
181 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
182 .name = "gsbi_resource",
183 .flags = IORESOURCE_MEM,
184 },
185};
186
187struct platform_device apq8064_device_uart_gsbi3 = {
188 .name = "msm_serial_hsl",
189 .id = 0,
190 .num_resources = ARRAY_SIZE(resources_uart_gsbi3),
191 .resource = resources_uart_gsbi3,
192};
193
Jing Lin04601f92012-02-05 15:36:07 -0800194static struct resource resources_qup_i2c_gsbi3[] = {
195 {
196 .name = "gsbi_qup_i2c_addr",
197 .start = MSM_GSBI3_PHYS,
198 .end = MSM_GSBI3_PHYS + 4 - 1,
199 .flags = IORESOURCE_MEM,
200 },
201 {
202 .name = "qup_phys_addr",
203 .start = MSM_GSBI3_QUP_PHYS,
204 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
205 .flags = IORESOURCE_MEM,
206 },
207 {
208 .name = "qup_err_intr",
209 .start = GSBI3_QUP_IRQ,
210 .end = GSBI3_QUP_IRQ,
211 .flags = IORESOURCE_IRQ,
212 },
213 {
214 .name = "i2c_clk",
215 .start = 9,
216 .end = 9,
217 .flags = IORESOURCE_IO,
218 },
219 {
220 .name = "i2c_sda",
221 .start = 8,
222 .end = 8,
223 .flags = IORESOURCE_IO,
224 },
225};
226
David Keitel3c40fc52012-02-09 17:53:52 -0800227static struct resource resources_qup_i2c_gsbi1[] = {
228 {
229 .name = "gsbi_qup_i2c_addr",
230 .start = MSM_GSBI1_PHYS,
231 .end = MSM_GSBI1_PHYS + 4 - 1,
232 .flags = IORESOURCE_MEM,
233 },
234 {
235 .name = "qup_phys_addr",
236 .start = MSM_GSBI1_QUP_PHYS,
237 .end = MSM_GSBI1_QUP_PHYS + MSM_QUP_SIZE - 1,
238 .flags = IORESOURCE_MEM,
239 },
240 {
241 .name = "qup_err_intr",
242 .start = APQ8064_GSBI1_QUP_IRQ,
243 .end = APQ8064_GSBI1_QUP_IRQ,
244 .flags = IORESOURCE_IRQ,
245 },
246 {
247 .name = "i2c_clk",
248 .start = 21,
249 .end = 21,
250 .flags = IORESOURCE_IO,
251 },
252 {
253 .name = "i2c_sda",
254 .start = 20,
255 .end = 20,
256 .flags = IORESOURCE_IO,
257 },
258};
259
260struct platform_device apq8064_device_qup_i2c_gsbi1 = {
261 .name = "qup_i2c",
262 .id = 0,
263 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi1),
264 .resource = resources_qup_i2c_gsbi1,
265};
266
Jing Lin04601f92012-02-05 15:36:07 -0800267struct platform_device apq8064_device_qup_i2c_gsbi3 = {
268 .name = "qup_i2c",
269 .id = 3,
270 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
271 .resource = resources_qup_i2c_gsbi3,
272};
273
Kenneth Heitke748593a2011-07-15 15:45:11 -0600274static struct resource resources_qup_i2c_gsbi4[] = {
275 {
276 .name = "gsbi_qup_i2c_addr",
277 .start = MSM_GSBI4_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600278 .end = MSM_GSBI4_PHYS + 4 - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600279 .flags = IORESOURCE_MEM,
280 },
281 {
282 .name = "qup_phys_addr",
283 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600284 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600285 .flags = IORESOURCE_MEM,
286 },
287 {
288 .name = "qup_err_intr",
289 .start = GSBI4_QUP_IRQ,
290 .end = GSBI4_QUP_IRQ,
291 .flags = IORESOURCE_IRQ,
292 },
Kevin Chand07220e2012-02-13 15:52:22 -0800293 {
294 .name = "i2c_clk",
295 .start = 11,
296 .end = 11,
297 .flags = IORESOURCE_IO,
298 },
299 {
300 .name = "i2c_sda",
301 .start = 10,
302 .end = 10,
303 .flags = IORESOURCE_IO,
304 },
Kenneth Heitke748593a2011-07-15 15:45:11 -0600305};
306
307struct platform_device apq8064_device_qup_i2c_gsbi4 = {
308 .name = "qup_i2c",
309 .id = 4,
310 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
311 .resource = resources_qup_i2c_gsbi4,
312};
313
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700314static struct resource resources_qup_spi_gsbi5[] = {
315 {
316 .name = "spi_base",
317 .start = MSM_GSBI5_QUP_PHYS,
318 .end = MSM_GSBI5_QUP_PHYS + SZ_4K - 1,
319 .flags = IORESOURCE_MEM,
320 },
321 {
322 .name = "gsbi_base",
323 .start = MSM_GSBI5_PHYS,
324 .end = MSM_GSBI5_PHYS + 4 - 1,
325 .flags = IORESOURCE_MEM,
326 },
327 {
328 .name = "spi_irq_in",
329 .start = GSBI5_QUP_IRQ,
330 .end = GSBI5_QUP_IRQ,
331 .flags = IORESOURCE_IRQ,
332 },
333};
334
335struct platform_device apq8064_device_qup_spi_gsbi5 = {
336 .name = "spi_qsd",
337 .id = 0,
338 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi5),
339 .resource = resources_qup_spi_gsbi5,
340};
341
Joel King8f839b92012-04-01 14:37:46 -0700342static struct resource resources_qup_i2c_gsbi5[] = {
343 {
344 .name = "gsbi_qup_i2c_addr",
345 .start = MSM_GSBI5_PHYS,
346 .end = MSM_GSBI5_PHYS + 4 - 1,
347 .flags = IORESOURCE_MEM,
348 },
349 {
350 .name = "qup_phys_addr",
351 .start = MSM_GSBI5_QUP_PHYS,
352 .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
353 .flags = IORESOURCE_MEM,
354 },
355 {
356 .name = "qup_err_intr",
357 .start = GSBI5_QUP_IRQ,
358 .end = GSBI5_QUP_IRQ,
359 .flags = IORESOURCE_IRQ,
360 },
361 {
362 .name = "i2c_clk",
363 .start = 54,
364 .end = 54,
365 .flags = IORESOURCE_IO,
366 },
367 {
368 .name = "i2c_sda",
369 .start = 53,
370 .end = 53,
371 .flags = IORESOURCE_IO,
372 },
373};
374
375struct platform_device mpq8064_device_qup_i2c_gsbi5 = {
376 .name = "qup_i2c",
377 .id = 5,
378 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
379 .resource = resources_qup_i2c_gsbi5,
380};
381
Jin Hong4bbbfba2012-02-02 21:48:07 -0800382static struct resource resources_uart_gsbi7[] = {
383 {
384 .start = GSBI7_UARTDM_IRQ,
385 .end = GSBI7_UARTDM_IRQ,
386 .flags = IORESOURCE_IRQ,
387 },
388 {
389 .start = MSM_UART7DM_PHYS,
390 .end = MSM_UART7DM_PHYS + PAGE_SIZE - 1,
391 .name = "uartdm_resource",
392 .flags = IORESOURCE_MEM,
393 },
394 {
395 .start = MSM_GSBI7_PHYS,
396 .end = MSM_GSBI7_PHYS + PAGE_SIZE - 1,
397 .name = "gsbi_resource",
398 .flags = IORESOURCE_MEM,
399 },
400};
401
402struct platform_device apq8064_device_uart_gsbi7 = {
403 .name = "msm_serial_hsl",
404 .id = 0,
405 .num_resources = ARRAY_SIZE(resources_uart_gsbi7),
406 .resource = resources_uart_gsbi7,
407};
408
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800409struct platform_device apq_pcm = {
410 .name = "msm-pcm-dsp",
411 .id = -1,
412};
413
414struct platform_device apq_pcm_routing = {
415 .name = "msm-pcm-routing",
416 .id = -1,
417};
418
419struct platform_device apq_cpudai0 = {
420 .name = "msm-dai-q6",
421 .id = 0x4000,
422};
423
424struct platform_device apq_cpudai1 = {
425 .name = "msm-dai-q6",
426 .id = 0x4001,
427};
Santosh Mardieff9a742012-04-09 23:23:39 +0530428struct platform_device mpq_cpudai_sec_i2s_rx = {
429 .name = "msm-dai-q6",
430 .id = 4,
431};
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800432struct platform_device apq_cpudai_hdmi_rx = {
Swaminathan Sathappanfd9dbad2012-02-15 16:56:44 -0800433 .name = "msm-dai-q6-hdmi",
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800434 .id = 8,
435};
436
437struct platform_device apq_cpudai_bt_rx = {
438 .name = "msm-dai-q6",
439 .id = 0x3000,
440};
441
442struct platform_device apq_cpudai_bt_tx = {
443 .name = "msm-dai-q6",
444 .id = 0x3001,
445};
446
447struct platform_device apq_cpudai_fm_rx = {
448 .name = "msm-dai-q6",
449 .id = 0x3004,
450};
451
452struct platform_device apq_cpudai_fm_tx = {
453 .name = "msm-dai-q6",
454 .id = 0x3005,
455};
456
Helen Zeng8f925502012-03-05 16:50:17 -0800457struct platform_device apq_cpudai_slim_4_rx = {
458 .name = "msm-dai-q6",
459 .id = 0x4008,
460};
461
462struct platform_device apq_cpudai_slim_4_tx = {
463 .name = "msm-dai-q6",
464 .id = 0x4009,
465};
466
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800467/*
468 * Machine specific data for AUX PCM Interface
469 * which the driver will be unware of.
470 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800471struct msm_dai_auxpcm_pdata apq_auxpcm_pdata = {
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800472 .clk = "pcm_clk",
Kuirong Wang547a9982012-05-04 18:29:11 -0700473 .mode_8k = {
474 .mode = AFE_PCM_CFG_MODE_PCM,
475 .sync = AFE_PCM_CFG_SYNC_INT,
476 .frame = AFE_PCM_CFG_FRM_256BPF,
477 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
478 .slot = 0,
479 .data = AFE_PCM_CFG_CDATAOE_MASTER,
480 .pcm_clk_rate = 2048000,
481 },
482 .mode_16k = {
483 .mode = AFE_PCM_CFG_MODE_PCM,
484 .sync = AFE_PCM_CFG_SYNC_INT,
485 .frame = AFE_PCM_CFG_FRM_256BPF,
486 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
487 .slot = 0,
488 .data = AFE_PCM_CFG_CDATAOE_MASTER,
489 .pcm_clk_rate = 4096000,
490 }
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800491};
492
493struct platform_device apq_cpudai_auxpcm_rx = {
494 .name = "msm-dai-q6",
495 .id = 2,
496 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800497 .platform_data = &apq_auxpcm_pdata,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800498 },
499};
500
501struct platform_device apq_cpudai_auxpcm_tx = {
502 .name = "msm-dai-q6",
503 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800504 .dev = {
505 .platform_data = &apq_auxpcm_pdata,
506 },
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800507};
508
Patrick Lai04baee942012-05-01 14:38:47 -0700509struct msm_mi2s_pdata mpq_mi2s_tx_data = {
510 .rx_sd_lines = 0,
511 .tx_sd_lines = MSM_MI2S_SD0 | MSM_MI2S_SD1 | MSM_MI2S_SD2 |
512 MSM_MI2S_SD3,
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700513};
514
515struct platform_device mpq_cpudai_mi2s_tx = {
Patrick Lai04baee942012-05-01 14:38:47 -0700516 .name = "msm-dai-q6-mi2s",
517 .id = -1, /*MI2S_TX */
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700518 .dev = {
519 .platform_data = &mpq_mi2s_tx_data,
520 },
521};
522
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800523struct platform_device apq_cpu_fe = {
524 .name = "msm-dai-fe",
525 .id = -1,
526};
527
528struct platform_device apq_stub_codec = {
529 .name = "msm-stub-codec",
530 .id = 1,
531};
532
533struct platform_device apq_voice = {
534 .name = "msm-pcm-voice",
535 .id = -1,
536};
537
538struct platform_device apq_voip = {
539 .name = "msm-voip-dsp",
540 .id = -1,
541};
542
543struct platform_device apq_lpa_pcm = {
544 .name = "msm-pcm-lpa",
545 .id = -1,
546};
547
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -0700548struct platform_device apq_compr_dsp = {
549 .name = "msm-compr-dsp",
550 .id = -1,
551};
552
553struct platform_device apq_multi_ch_pcm = {
554 .name = "msm-multi-ch-pcm-dsp",
555 .id = -1,
556};
557
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800558struct platform_device apq_pcm_hostless = {
559 .name = "msm-pcm-hostless",
560 .id = -1,
561};
562
563struct platform_device apq_cpudai_afe_01_rx = {
564 .name = "msm-dai-q6",
565 .id = 0xE0,
566};
567
568struct platform_device apq_cpudai_afe_01_tx = {
569 .name = "msm-dai-q6",
570 .id = 0xF0,
571};
572
573struct platform_device apq_cpudai_afe_02_rx = {
574 .name = "msm-dai-q6",
575 .id = 0xF1,
576};
577
578struct platform_device apq_cpudai_afe_02_tx = {
579 .name = "msm-dai-q6",
580 .id = 0xE1,
581};
582
583struct platform_device apq_pcm_afe = {
584 .name = "msm-pcm-afe",
585 .id = -1,
586};
587
Neema Shetty8427c262012-02-16 11:23:43 -0800588struct platform_device apq_cpudai_stub = {
589 .name = "msm-dai-stub",
590 .id = -1,
591};
592
Neema Shetty3c9d2862012-03-11 01:25:32 -0800593struct platform_device apq_cpudai_slimbus_1_rx = {
594 .name = "msm-dai-q6",
595 .id = 0x4002,
596};
597
598struct platform_device apq_cpudai_slimbus_1_tx = {
599 .name = "msm-dai-q6",
600 .id = 0x4003,
601};
602
Kiran Kandi97fe19d2012-05-20 22:34:04 -0700603struct platform_device apq_cpudai_slimbus_2_rx = {
604 .name = "msm-dai-q6",
605 .id = 0x4004,
606};
607
Kiran Kandi1e6371d2012-03-29 11:48:57 -0700608struct platform_device apq_cpudai_slimbus_2_tx = {
609 .name = "msm-dai-q6",
610 .id = 0x4005,
611};
612
Neema Shettyc9d86c32012-05-09 12:01:39 -0700613struct platform_device apq_cpudai_slimbus_3_rx = {
614 .name = "msm-dai-q6",
615 .id = 0x4006,
616};
617
Helen Zeng38c3c962012-05-17 14:56:20 -0700618struct platform_device apq_cpudai_slimbus_3_tx = {
619 .name = "msm-dai-q6",
620 .id = 0x4007,
621};
622
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700623static struct resource resources_ssbi_pmic1[] = {
624 {
625 .start = MSM_PMIC1_SSBI_CMD_PHYS,
626 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
627 .flags = IORESOURCE_MEM,
628 },
629};
630
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600631#define LPASS_SLIMBUS_PHYS 0x28080000
632#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800633#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600634/* Board info for the slimbus slave device */
635static struct resource slimbus_res[] = {
636 {
637 .start = LPASS_SLIMBUS_PHYS,
638 .end = LPASS_SLIMBUS_PHYS + 8191,
639 .flags = IORESOURCE_MEM,
640 .name = "slimbus_physical",
641 },
642 {
643 .start = LPASS_SLIMBUS_BAM_PHYS,
644 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
645 .flags = IORESOURCE_MEM,
646 .name = "slimbus_bam_physical",
647 },
648 {
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800649 .start = LPASS_SLIMBUS_SLEW,
650 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
651 .flags = IORESOURCE_MEM,
652 .name = "slimbus_slew_reg",
653 },
654 {
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600655 .start = SLIMBUS0_CORE_EE1_IRQ,
656 .end = SLIMBUS0_CORE_EE1_IRQ,
657 .flags = IORESOURCE_IRQ,
658 .name = "slimbus_irq",
659 },
660 {
661 .start = SLIMBUS0_BAM_EE1_IRQ,
662 .end = SLIMBUS0_BAM_EE1_IRQ,
663 .flags = IORESOURCE_IRQ,
664 .name = "slimbus_bam_irq",
665 },
666};
667
668struct platform_device apq8064_slim_ctrl = {
669 .name = "msm_slim_ctrl",
670 .id = 1,
671 .num_resources = ARRAY_SIZE(slimbus_res),
672 .resource = slimbus_res,
673 .dev = {
674 .coherent_dma_mask = 0xffffffffULL,
675 },
676};
677
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700678struct platform_device apq8064_device_ssbi_pmic1 = {
679 .name = "msm_ssbi",
680 .id = 0,
681 .resource = resources_ssbi_pmic1,
682 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
683};
684
685static struct resource resources_ssbi_pmic2[] = {
686 {
687 .start = MSM_PMIC2_SSBI_CMD_PHYS,
688 .end = MSM_PMIC2_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
689 .flags = IORESOURCE_MEM,
690 },
691};
692
693struct platform_device apq8064_device_ssbi_pmic2 = {
694 .name = "msm_ssbi",
695 .id = 1,
696 .resource = resources_ssbi_pmic2,
697 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2),
698};
699
700static struct resource resources_otg[] = {
701 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800702 .start = MSM_HSUSB1_PHYS,
703 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700704 .flags = IORESOURCE_MEM,
705 },
706 {
707 .start = USB1_HS_IRQ,
708 .end = USB1_HS_IRQ,
709 .flags = IORESOURCE_IRQ,
710 },
711};
712
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700713struct platform_device apq8064_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700714 .name = "msm_otg",
715 .id = -1,
716 .num_resources = ARRAY_SIZE(resources_otg),
717 .resource = resources_otg,
718 .dev = {
719 .coherent_dma_mask = 0xffffffff,
720 },
721};
722
723static struct resource resources_hsusb[] = {
724 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800725 .start = MSM_HSUSB1_PHYS,
726 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700727 .flags = IORESOURCE_MEM,
728 },
729 {
730 .start = USB1_HS_IRQ,
731 .end = USB1_HS_IRQ,
732 .flags = IORESOURCE_IRQ,
733 },
734};
735
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700736struct platform_device apq8064_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700737 .name = "msm_hsusb",
738 .id = -1,
739 .num_resources = ARRAY_SIZE(resources_hsusb),
740 .resource = resources_hsusb,
741 .dev = {
742 .coherent_dma_mask = 0xffffffff,
743 },
744};
745
Hemant Kumard86c4882012-01-24 19:39:37 -0800746static struct resource resources_hsusb_host[] = {
747 {
748 .start = MSM_HSUSB1_PHYS,
749 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
750 .flags = IORESOURCE_MEM,
751 },
752 {
753 .start = USB1_HS_IRQ,
754 .end = USB1_HS_IRQ,
755 .flags = IORESOURCE_IRQ,
756 },
757};
758
Hemant Kumara945b472012-01-25 15:08:06 -0800759static struct resource resources_hsic_host[] = {
760 {
761 .start = 0x12510000,
762 .end = 0x12510000 + SZ_4K - 1,
763 .flags = IORESOURCE_MEM,
764 },
765 {
766 .start = USB2_HSIC_IRQ,
767 .end = USB2_HSIC_IRQ,
768 .flags = IORESOURCE_IRQ,
769 },
770 {
771 .start = MSM_GPIO_TO_INT(49),
772 .end = MSM_GPIO_TO_INT(49),
773 .name = "peripheral_status_irq",
774 .flags = IORESOURCE_IRQ,
775 },
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800776 {
Hemant Kumar6fd65032012-05-23 13:02:24 -0700777 .start = 47,
778 .end = 47,
779 .name = "wakeup",
780 .flags = IORESOURCE_IO,
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800781 },
Hemant Kumara945b472012-01-25 15:08:06 -0800782};
783
Hemant Kumard86c4882012-01-24 19:39:37 -0800784static u64 dma_mask = DMA_BIT_MASK(32);
785struct platform_device apq8064_device_hsusb_host = {
786 .name = "msm_hsusb_host",
787 .id = -1,
788 .num_resources = ARRAY_SIZE(resources_hsusb_host),
789 .resource = resources_hsusb_host,
790 .dev = {
791 .dma_mask = &dma_mask,
792 .coherent_dma_mask = 0xffffffff,
793 },
794};
795
Hemant Kumara945b472012-01-25 15:08:06 -0800796struct platform_device apq8064_device_hsic_host = {
797 .name = "msm_hsic_host",
798 .id = -1,
799 .num_resources = ARRAY_SIZE(resources_hsic_host),
800 .resource = resources_hsic_host,
801 .dev = {
802 .dma_mask = &dma_mask,
803 .coherent_dma_mask = DMA_BIT_MASK(32),
804 },
805};
806
Manu Gautam91223e02011-11-08 15:27:22 +0530807static struct resource resources_ehci_host3[] = {
808{
809 .start = MSM_HSUSB3_PHYS,
810 .end = MSM_HSUSB3_PHYS + MSM_HSUSB3_SIZE - 1,
811 .flags = IORESOURCE_MEM,
812 },
813 {
814 .start = USB3_HS_IRQ,
815 .end = USB3_HS_IRQ,
816 .flags = IORESOURCE_IRQ,
817 },
818};
819
820struct platform_device apq8064_device_ehci_host3 = {
821 .name = "msm_ehci_host",
822 .id = 0,
823 .num_resources = ARRAY_SIZE(resources_ehci_host3),
824 .resource = resources_ehci_host3,
825 .dev = {
826 .dma_mask = &dma_mask,
827 .coherent_dma_mask = 0xffffffff,
828 },
829};
830
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800831static struct resource resources_ehci_host4[] = {
832{
833 .start = MSM_HSUSB4_PHYS,
834 .end = MSM_HSUSB4_PHYS + MSM_HSUSB4_SIZE - 1,
835 .flags = IORESOURCE_MEM,
836 },
837 {
838 .start = USB4_HS_IRQ,
839 .end = USB4_HS_IRQ,
840 .flags = IORESOURCE_IRQ,
841 },
842};
843
844struct platform_device apq8064_device_ehci_host4 = {
845 .name = "msm_ehci_host",
846 .id = 1,
847 .num_resources = ARRAY_SIZE(resources_ehci_host4),
848 .resource = resources_ehci_host4,
849 .dev = {
850 .dma_mask = &dma_mask,
851 .coherent_dma_mask = 0xffffffff,
852 },
853};
854
Matt Wagantallf5cc3892012-06-07 19:47:02 -0700855struct platform_device apq8064_device_acpuclk = {
856 .name = "acpuclk-8064",
857 .id = -1,
858};
859
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -0700860#define SHARED_IMEM_TZ_BASE 0x2a03f720
861static struct resource tzlog_resources[] = {
862 {
863 .start = SHARED_IMEM_TZ_BASE,
864 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
865 .flags = IORESOURCE_MEM,
866 },
867};
868
869struct platform_device apq_device_tz_log = {
870 .name = "tz_log",
871 .id = 0,
872 .num_resources = ARRAY_SIZE(tzlog_resources),
873 .resource = tzlog_resources,
874};
875
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -0800876/* MSM Video core device */
877#ifdef CONFIG_MSM_BUS_SCALING
878static struct msm_bus_vectors vidc_init_vectors[] = {
879 {
880 .src = MSM_BUS_MASTER_VIDEO_ENC,
881 .dst = MSM_BUS_SLAVE_EBI_CH0,
882 .ab = 0,
883 .ib = 0,
884 },
885 {
886 .src = MSM_BUS_MASTER_VIDEO_DEC,
887 .dst = MSM_BUS_SLAVE_EBI_CH0,
888 .ab = 0,
889 .ib = 0,
890 },
891 {
892 .src = MSM_BUS_MASTER_AMPSS_M0,
893 .dst = MSM_BUS_SLAVE_EBI_CH0,
894 .ab = 0,
895 .ib = 0,
896 },
897 {
898 .src = MSM_BUS_MASTER_AMPSS_M0,
899 .dst = MSM_BUS_SLAVE_EBI_CH0,
900 .ab = 0,
901 .ib = 0,
902 },
903};
904static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
905 {
906 .src = MSM_BUS_MASTER_VIDEO_ENC,
907 .dst = MSM_BUS_SLAVE_EBI_CH0,
908 .ab = 54525952,
909 .ib = 436207616,
910 },
911 {
912 .src = MSM_BUS_MASTER_VIDEO_DEC,
913 .dst = MSM_BUS_SLAVE_EBI_CH0,
914 .ab = 72351744,
915 .ib = 289406976,
916 },
917 {
918 .src = MSM_BUS_MASTER_AMPSS_M0,
919 .dst = MSM_BUS_SLAVE_EBI_CH0,
920 .ab = 500000,
921 .ib = 1000000,
922 },
923 {
924 .src = MSM_BUS_MASTER_AMPSS_M0,
925 .dst = MSM_BUS_SLAVE_EBI_CH0,
926 .ab = 500000,
927 .ib = 1000000,
928 },
929};
930static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
931 {
932 .src = MSM_BUS_MASTER_VIDEO_ENC,
933 .dst = MSM_BUS_SLAVE_EBI_CH0,
934 .ab = 40894464,
935 .ib = 327155712,
936 },
937 {
938 .src = MSM_BUS_MASTER_VIDEO_DEC,
939 .dst = MSM_BUS_SLAVE_EBI_CH0,
940 .ab = 48234496,
941 .ib = 192937984,
942 },
943 {
944 .src = MSM_BUS_MASTER_AMPSS_M0,
945 .dst = MSM_BUS_SLAVE_EBI_CH0,
946 .ab = 500000,
947 .ib = 2000000,
948 },
949 {
950 .src = MSM_BUS_MASTER_AMPSS_M0,
951 .dst = MSM_BUS_SLAVE_EBI_CH0,
952 .ab = 500000,
953 .ib = 2000000,
954 },
955};
956static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
957 {
958 .src = MSM_BUS_MASTER_VIDEO_ENC,
959 .dst = MSM_BUS_SLAVE_EBI_CH0,
960 .ab = 163577856,
961 .ib = 1308622848,
962 },
963 {
964 .src = MSM_BUS_MASTER_VIDEO_DEC,
965 .dst = MSM_BUS_SLAVE_EBI_CH0,
966 .ab = 219152384,
967 .ib = 876609536,
968 },
969 {
970 .src = MSM_BUS_MASTER_AMPSS_M0,
971 .dst = MSM_BUS_SLAVE_EBI_CH0,
972 .ab = 1750000,
973 .ib = 3500000,
974 },
975 {
976 .src = MSM_BUS_MASTER_AMPSS_M0,
977 .dst = MSM_BUS_SLAVE_EBI_CH0,
978 .ab = 1750000,
979 .ib = 3500000,
980 },
981};
982static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
983 {
984 .src = MSM_BUS_MASTER_VIDEO_ENC,
985 .dst = MSM_BUS_SLAVE_EBI_CH0,
986 .ab = 121634816,
987 .ib = 973078528,
988 },
989 {
990 .src = MSM_BUS_MASTER_VIDEO_DEC,
991 .dst = MSM_BUS_SLAVE_EBI_CH0,
992 .ab = 155189248,
993 .ib = 620756992,
994 },
995 {
996 .src = MSM_BUS_MASTER_AMPSS_M0,
997 .dst = MSM_BUS_SLAVE_EBI_CH0,
998 .ab = 1750000,
999 .ib = 7000000,
1000 },
1001 {
1002 .src = MSM_BUS_MASTER_AMPSS_M0,
1003 .dst = MSM_BUS_SLAVE_EBI_CH0,
1004 .ab = 1750000,
1005 .ib = 7000000,
1006 },
1007};
1008static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
1009 {
1010 .src = MSM_BUS_MASTER_VIDEO_ENC,
1011 .dst = MSM_BUS_SLAVE_EBI_CH0,
1012 .ab = 372244480,
1013 .ib = 2560000000U,
1014 },
1015 {
1016 .src = MSM_BUS_MASTER_VIDEO_DEC,
1017 .dst = MSM_BUS_SLAVE_EBI_CH0,
1018 .ab = 501219328,
1019 .ib = 2560000000U,
1020 },
1021 {
1022 .src = MSM_BUS_MASTER_AMPSS_M0,
1023 .dst = MSM_BUS_SLAVE_EBI_CH0,
1024 .ab = 2500000,
1025 .ib = 5000000,
1026 },
1027 {
1028 .src = MSM_BUS_MASTER_AMPSS_M0,
1029 .dst = MSM_BUS_SLAVE_EBI_CH0,
1030 .ab = 2500000,
1031 .ib = 5000000,
1032 },
1033};
1034static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
1035 {
1036 .src = MSM_BUS_MASTER_VIDEO_ENC,
1037 .dst = MSM_BUS_SLAVE_EBI_CH0,
1038 .ab = 222298112,
1039 .ib = 2560000000U,
1040 },
1041 {
1042 .src = MSM_BUS_MASTER_VIDEO_DEC,
1043 .dst = MSM_BUS_SLAVE_EBI_CH0,
1044 .ab = 330301440,
1045 .ib = 2560000000U,
1046 },
1047 {
1048 .src = MSM_BUS_MASTER_AMPSS_M0,
1049 .dst = MSM_BUS_SLAVE_EBI_CH0,
1050 .ab = 2500000,
1051 .ib = 700000000,
1052 },
1053 {
1054 .src = MSM_BUS_MASTER_AMPSS_M0,
1055 .dst = MSM_BUS_SLAVE_EBI_CH0,
1056 .ab = 2500000,
1057 .ib = 10000000,
1058 },
1059};
1060
Arun Menon152c3c72012-06-20 11:50:08 -07001061static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
1062 {
1063 .src = MSM_BUS_MASTER_VIDEO_ENC,
1064 .dst = MSM_BUS_SLAVE_EBI_CH0,
1065 .ab = 222298112,
1066 .ib = 3522000000U,
1067 },
1068 {
1069 .src = MSM_BUS_MASTER_VIDEO_DEC,
1070 .dst = MSM_BUS_SLAVE_EBI_CH0,
1071 .ab = 330301440,
1072 .ib = 3522000000U,
1073 },
1074 {
1075 .src = MSM_BUS_MASTER_AMPSS_M0,
1076 .dst = MSM_BUS_SLAVE_EBI_CH0,
1077 .ab = 2500000,
1078 .ib = 700000000,
1079 },
1080 {
1081 .src = MSM_BUS_MASTER_AMPSS_M0,
1082 .dst = MSM_BUS_SLAVE_EBI_CH0,
1083 .ab = 2500000,
1084 .ib = 10000000,
1085 },
1086};
1087static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
1088 {
1089 .src = MSM_BUS_MASTER_VIDEO_ENC,
1090 .dst = MSM_BUS_SLAVE_EBI_CH0,
1091 .ab = 222298112,
1092 .ib = 3522000000U,
1093 },
1094 {
1095 .src = MSM_BUS_MASTER_VIDEO_DEC,
1096 .dst = MSM_BUS_SLAVE_EBI_CH0,
1097 .ab = 330301440,
1098 .ib = 3522000000U,
1099 },
1100 {
1101 .src = MSM_BUS_MASTER_AMPSS_M0,
1102 .dst = MSM_BUS_SLAVE_EBI_CH0,
1103 .ab = 2500000,
1104 .ib = 700000000,
1105 },
1106 {
1107 .src = MSM_BUS_MASTER_AMPSS_M0,
1108 .dst = MSM_BUS_SLAVE_EBI_CH0,
1109 .ab = 2500000,
1110 .ib = 10000000,
1111 },
1112};
1113
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001114static struct msm_bus_paths vidc_bus_client_config[] = {
1115 {
1116 ARRAY_SIZE(vidc_init_vectors),
1117 vidc_init_vectors,
1118 },
1119 {
1120 ARRAY_SIZE(vidc_venc_vga_vectors),
1121 vidc_venc_vga_vectors,
1122 },
1123 {
1124 ARRAY_SIZE(vidc_vdec_vga_vectors),
1125 vidc_vdec_vga_vectors,
1126 },
1127 {
1128 ARRAY_SIZE(vidc_venc_720p_vectors),
1129 vidc_venc_720p_vectors,
1130 },
1131 {
1132 ARRAY_SIZE(vidc_vdec_720p_vectors),
1133 vidc_vdec_720p_vectors,
1134 },
1135 {
1136 ARRAY_SIZE(vidc_venc_1080p_vectors),
1137 vidc_venc_1080p_vectors,
1138 },
1139 {
1140 ARRAY_SIZE(vidc_vdec_1080p_vectors),
1141 vidc_vdec_1080p_vectors,
1142 },
Arun Menon152c3c72012-06-20 11:50:08 -07001143 {
1144 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
1145 vidc_venc_1080p_turbo_vectors,
1146 },
1147 {
1148 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
1149 vidc_vdec_1080p_turbo_vectors,
1150 },
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001151};
1152
1153static struct msm_bus_scale_pdata vidc_bus_client_data = {
1154 vidc_bus_client_config,
1155 ARRAY_SIZE(vidc_bus_client_config),
1156 .name = "vidc",
1157};
1158#endif
1159
1160
1161#define APQ8064_VIDC_BASE_PHYS 0x04400000
1162#define APQ8064_VIDC_BASE_SIZE 0x00100000
1163
1164static struct resource apq8064_device_vidc_resources[] = {
1165 {
1166 .start = APQ8064_VIDC_BASE_PHYS,
1167 .end = APQ8064_VIDC_BASE_PHYS + APQ8064_VIDC_BASE_SIZE - 1,
1168 .flags = IORESOURCE_MEM,
1169 },
1170 {
1171 .start = VCODEC_IRQ,
1172 .end = VCODEC_IRQ,
1173 .flags = IORESOURCE_IRQ,
1174 },
1175};
1176
1177struct msm_vidc_platform_data apq8064_vidc_platform_data = {
1178#ifdef CONFIG_MSM_BUS_SCALING
1179 .vidc_bus_client_pdata = &vidc_bus_client_data,
1180#endif
1181#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1182 .memtype = ION_CP_MM_HEAP_ID,
1183 .enable_ion = 1,
Deepak kotureda295a2012-05-10 19:49:46 -07001184 .cp_enabled = 1,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001185#else
1186 .memtype = MEMTYPE_EBI1,
1187 .enable_ion = 0,
1188#endif
1189 .disable_dmx = 0,
1190 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08001191 .cont_mode_dpb_count = 18,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05301192 .fw_addr = 0x9fe00000,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001193};
1194
1195struct platform_device apq8064_msm_device_vidc = {
1196 .name = "msm_vidc",
1197 .id = 0,
1198 .num_resources = ARRAY_SIZE(apq8064_device_vidc_resources),
1199 .resource = apq8064_device_vidc_resources,
1200 .dev = {
1201 .platform_data = &apq8064_vidc_platform_data,
1202 },
1203};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001204#define MSM_SDC1_BASE 0x12400000
1205#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1206#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1207#define MSM_SDC2_BASE 0x12140000
1208#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1209#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1210#define MSM_SDC3_BASE 0x12180000
1211#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1212#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1213#define MSM_SDC4_BASE 0x121C0000
1214#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1215#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1216
1217static struct resource resources_sdc1[] = {
1218 {
1219 .name = "core_mem",
1220 .flags = IORESOURCE_MEM,
1221 .start = MSM_SDC1_BASE,
1222 .end = MSM_SDC1_DML_BASE - 1,
1223 },
1224 {
1225 .name = "core_irq",
1226 .flags = IORESOURCE_IRQ,
1227 .start = SDC1_IRQ_0,
1228 .end = SDC1_IRQ_0
1229 },
1230#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1231 {
1232 .name = "sdcc_dml_addr",
1233 .start = MSM_SDC1_DML_BASE,
1234 .end = MSM_SDC1_BAM_BASE - 1,
1235 .flags = IORESOURCE_MEM,
1236 },
1237 {
1238 .name = "sdcc_bam_addr",
1239 .start = MSM_SDC1_BAM_BASE,
1240 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1241 .flags = IORESOURCE_MEM,
1242 },
1243 {
1244 .name = "sdcc_bam_irq",
1245 .start = SDC1_BAM_IRQ,
1246 .end = SDC1_BAM_IRQ,
1247 .flags = IORESOURCE_IRQ,
1248 },
1249#endif
1250};
1251
1252static struct resource resources_sdc2[] = {
1253 {
1254 .name = "core_mem",
1255 .flags = IORESOURCE_MEM,
1256 .start = MSM_SDC2_BASE,
1257 .end = MSM_SDC2_DML_BASE - 1,
1258 },
1259 {
1260 .name = "core_irq",
1261 .flags = IORESOURCE_IRQ,
1262 .start = SDC2_IRQ_0,
1263 .end = SDC2_IRQ_0
1264 },
1265#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1266 {
1267 .name = "sdcc_dml_addr",
1268 .start = MSM_SDC2_DML_BASE,
1269 .end = MSM_SDC2_BAM_BASE - 1,
1270 .flags = IORESOURCE_MEM,
1271 },
1272 {
1273 .name = "sdcc_bam_addr",
1274 .start = MSM_SDC2_BAM_BASE,
1275 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1276 .flags = IORESOURCE_MEM,
1277 },
1278 {
1279 .name = "sdcc_bam_irq",
1280 .start = SDC2_BAM_IRQ,
1281 .end = SDC2_BAM_IRQ,
1282 .flags = IORESOURCE_IRQ,
1283 },
1284#endif
1285};
1286
1287static struct resource resources_sdc3[] = {
1288 {
1289 .name = "core_mem",
1290 .flags = IORESOURCE_MEM,
1291 .start = MSM_SDC3_BASE,
1292 .end = MSM_SDC3_DML_BASE - 1,
1293 },
1294 {
1295 .name = "core_irq",
1296 .flags = IORESOURCE_IRQ,
1297 .start = SDC3_IRQ_0,
1298 .end = SDC3_IRQ_0
1299 },
1300#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1301 {
1302 .name = "sdcc_dml_addr",
1303 .start = MSM_SDC3_DML_BASE,
1304 .end = MSM_SDC3_BAM_BASE - 1,
1305 .flags = IORESOURCE_MEM,
1306 },
1307 {
1308 .name = "sdcc_bam_addr",
1309 .start = MSM_SDC3_BAM_BASE,
1310 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1311 .flags = IORESOURCE_MEM,
1312 },
1313 {
1314 .name = "sdcc_bam_irq",
1315 .start = SDC3_BAM_IRQ,
1316 .end = SDC3_BAM_IRQ,
1317 .flags = IORESOURCE_IRQ,
1318 },
1319#endif
1320};
1321
1322static struct resource resources_sdc4[] = {
1323 {
1324 .name = "core_mem",
1325 .flags = IORESOURCE_MEM,
1326 .start = MSM_SDC4_BASE,
1327 .end = MSM_SDC4_DML_BASE - 1,
1328 },
1329 {
1330 .name = "core_irq",
1331 .flags = IORESOURCE_IRQ,
1332 .start = SDC4_IRQ_0,
1333 .end = SDC4_IRQ_0
1334 },
1335#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1336 {
1337 .name = "sdcc_dml_addr",
1338 .start = MSM_SDC4_DML_BASE,
1339 .end = MSM_SDC4_BAM_BASE - 1,
1340 .flags = IORESOURCE_MEM,
1341 },
1342 {
1343 .name = "sdcc_bam_addr",
1344 .start = MSM_SDC4_BAM_BASE,
1345 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1346 .flags = IORESOURCE_MEM,
1347 },
1348 {
1349 .name = "sdcc_bam_irq",
1350 .start = SDC4_BAM_IRQ,
1351 .end = SDC4_BAM_IRQ,
1352 .flags = IORESOURCE_IRQ,
1353 },
1354#endif
1355};
1356
1357struct platform_device apq8064_device_sdc1 = {
1358 .name = "msm_sdcc",
1359 .id = 1,
1360 .num_resources = ARRAY_SIZE(resources_sdc1),
1361 .resource = resources_sdc1,
1362 .dev = {
1363 .coherent_dma_mask = 0xffffffff,
1364 },
1365};
1366
1367struct platform_device apq8064_device_sdc2 = {
1368 .name = "msm_sdcc",
1369 .id = 2,
1370 .num_resources = ARRAY_SIZE(resources_sdc2),
1371 .resource = resources_sdc2,
1372 .dev = {
1373 .coherent_dma_mask = 0xffffffff,
1374 },
1375};
1376
1377struct platform_device apq8064_device_sdc3 = {
1378 .name = "msm_sdcc",
1379 .id = 3,
1380 .num_resources = ARRAY_SIZE(resources_sdc3),
1381 .resource = resources_sdc3,
1382 .dev = {
1383 .coherent_dma_mask = 0xffffffff,
1384 },
1385};
1386
1387struct platform_device apq8064_device_sdc4 = {
1388 .name = "msm_sdcc",
1389 .id = 4,
1390 .num_resources = ARRAY_SIZE(resources_sdc4),
1391 .resource = resources_sdc4,
1392 .dev = {
1393 .coherent_dma_mask = 0xffffffff,
1394 },
1395};
1396
1397static struct platform_device *apq8064_sdcc_devices[] __initdata = {
1398 &apq8064_device_sdc1,
1399 &apq8064_device_sdc2,
1400 &apq8064_device_sdc3,
1401 &apq8064_device_sdc4,
1402};
1403
1404int __init apq8064_add_sdcc(unsigned int controller,
1405 struct mmc_platform_data *plat)
1406{
1407 struct platform_device *pdev;
1408
1409 if (!plat)
1410 return 0;
1411 if (controller < 1 || controller > 4)
1412 return -EINVAL;
1413
1414 pdev = apq8064_sdcc_devices[controller-1];
1415 pdev->dev.platform_data = plat;
1416 return platform_device_register(pdev);
1417}
1418
Yan He06913ce2011-08-26 16:33:46 -07001419static struct resource resources_sps[] = {
1420 {
1421 .name = "pipe_mem",
1422 .start = 0x12800000,
1423 .end = 0x12800000 + 0x4000 - 1,
1424 .flags = IORESOURCE_MEM,
1425 },
1426 {
1427 .name = "bamdma_dma",
1428 .start = 0x12240000,
1429 .end = 0x12240000 + 0x1000 - 1,
1430 .flags = IORESOURCE_MEM,
1431 },
1432 {
1433 .name = "bamdma_bam",
1434 .start = 0x12244000,
1435 .end = 0x12244000 + 0x4000 - 1,
1436 .flags = IORESOURCE_MEM,
1437 },
1438 {
1439 .name = "bamdma_irq",
1440 .start = SPS_BAM_DMA_IRQ,
1441 .end = SPS_BAM_DMA_IRQ,
1442 .flags = IORESOURCE_IRQ,
1443 },
1444};
1445
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001446struct platform_device msm_bus_8064_sys_fabric = {
1447 .name = "msm_bus_fabric",
1448 .id = MSM_BUS_FAB_SYSTEM,
1449};
1450struct platform_device msm_bus_8064_apps_fabric = {
1451 .name = "msm_bus_fabric",
1452 .id = MSM_BUS_FAB_APPSS,
1453};
1454struct platform_device msm_bus_8064_mm_fabric = {
1455 .name = "msm_bus_fabric",
1456 .id = MSM_BUS_FAB_MMSS,
1457};
1458struct platform_device msm_bus_8064_sys_fpb = {
1459 .name = "msm_bus_fabric",
1460 .id = MSM_BUS_FAB_SYSTEM_FPB,
1461};
1462struct platform_device msm_bus_8064_cpss_fpb = {
1463 .name = "msm_bus_fabric",
1464 .id = MSM_BUS_FAB_CPSS_FPB,
1465};
1466
Yan He06913ce2011-08-26 16:33:46 -07001467static struct msm_sps_platform_data msm_sps_pdata = {
1468 .bamdma_restricted_pipes = 0x06,
1469};
1470
1471struct platform_device msm_device_sps_apq8064 = {
1472 .name = "msm_sps",
1473 .id = -1,
1474 .num_resources = ARRAY_SIZE(resources_sps),
1475 .resource = resources_sps,
1476 .dev.platform_data = &msm_sps_pdata,
1477};
1478
Eric Holmberg023d25c2012-03-01 12:27:55 -07001479static struct resource smd_resource[] = {
1480 {
1481 .name = "a9_m2a_0",
1482 .start = INT_A9_M2A_0,
1483 .flags = IORESOURCE_IRQ,
1484 },
1485 {
1486 .name = "a9_m2a_5",
1487 .start = INT_A9_M2A_5,
1488 .flags = IORESOURCE_IRQ,
1489 },
1490 {
1491 .name = "adsp_a11",
1492 .start = INT_ADSP_A11,
1493 .flags = IORESOURCE_IRQ,
1494 },
1495 {
1496 .name = "adsp_a11_smsm",
1497 .start = INT_ADSP_A11_SMSM,
1498 .flags = IORESOURCE_IRQ,
1499 },
1500 {
1501 .name = "dsps_a11",
1502 .start = INT_DSPS_A11,
1503 .flags = IORESOURCE_IRQ,
1504 },
1505 {
1506 .name = "dsps_a11_smsm",
1507 .start = INT_DSPS_A11_SMSM,
1508 .flags = IORESOURCE_IRQ,
1509 },
1510 {
1511 .name = "wcnss_a11",
1512 .start = INT_WCNSS_A11,
1513 .flags = IORESOURCE_IRQ,
1514 },
1515 {
1516 .name = "wcnss_a11_smsm",
1517 .start = INT_WCNSS_A11_SMSM,
1518 .flags = IORESOURCE_IRQ,
1519 },
1520};
1521
1522static struct smd_subsystem_config smd_config_list[] = {
1523 {
1524 .irq_config_id = SMD_MODEM,
1525 .subsys_name = "gss",
1526 .edge = SMD_APPS_MODEM,
1527
1528 .smd_int.irq_name = "a9_m2a_0",
1529 .smd_int.flags = IRQF_TRIGGER_RISING,
1530 .smd_int.irq_id = -1,
1531 .smd_int.device_name = "smd_dev",
1532 .smd_int.dev_id = 0,
1533 .smd_int.out_bit_pos = 1 << 3,
1534 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1535 .smd_int.out_offset = 0x8,
1536
1537 .smsm_int.irq_name = "a9_m2a_5",
1538 .smsm_int.flags = IRQF_TRIGGER_RISING,
1539 .smsm_int.irq_id = -1,
1540 .smsm_int.device_name = "smd_smsm",
1541 .smsm_int.dev_id = 0,
1542 .smsm_int.out_bit_pos = 1 << 4,
1543 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1544 .smsm_int.out_offset = 0x8,
1545 },
1546 {
1547 .irq_config_id = SMD_Q6,
1548 .subsys_name = "q6",
1549 .edge = SMD_APPS_QDSP,
1550
1551 .smd_int.irq_name = "adsp_a11",
1552 .smd_int.flags = IRQF_TRIGGER_RISING,
1553 .smd_int.irq_id = -1,
1554 .smd_int.device_name = "smd_dev",
1555 .smd_int.dev_id = 0,
1556 .smd_int.out_bit_pos = 1 << 15,
1557 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1558 .smd_int.out_offset = 0x8,
1559
1560 .smsm_int.irq_name = "adsp_a11_smsm",
1561 .smsm_int.flags = IRQF_TRIGGER_RISING,
1562 .smsm_int.irq_id = -1,
1563 .smsm_int.device_name = "smd_smsm",
1564 .smsm_int.dev_id = 0,
1565 .smsm_int.out_bit_pos = 1 << 14,
1566 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1567 .smsm_int.out_offset = 0x8,
1568 },
1569 {
1570 .irq_config_id = SMD_DSPS,
1571 .subsys_name = "dsps",
1572 .edge = SMD_APPS_DSPS,
1573
1574 .smd_int.irq_name = "dsps_a11",
1575 .smd_int.flags = IRQF_TRIGGER_RISING,
1576 .smd_int.irq_id = -1,
1577 .smd_int.device_name = "smd_dev",
1578 .smd_int.dev_id = 0,
1579 .smd_int.out_bit_pos = 1,
1580 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1581 .smd_int.out_offset = 0x4080,
1582
1583 .smsm_int.irq_name = "dsps_a11_smsm",
1584 .smsm_int.flags = IRQF_TRIGGER_RISING,
1585 .smsm_int.irq_id = -1,
1586 .smsm_int.device_name = "smd_smsm",
1587 .smsm_int.dev_id = 0,
1588 .smsm_int.out_bit_pos = 1,
1589 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1590 .smsm_int.out_offset = 0x4094,
1591 },
1592 {
1593 .irq_config_id = SMD_WCNSS,
1594 .subsys_name = "wcnss",
1595 .edge = SMD_APPS_WCNSS,
1596
1597 .smd_int.irq_name = "wcnss_a11",
1598 .smd_int.flags = IRQF_TRIGGER_RISING,
1599 .smd_int.irq_id = -1,
1600 .smd_int.device_name = "smd_dev",
1601 .smd_int.dev_id = 0,
1602 .smd_int.out_bit_pos = 1 << 25,
1603 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1604 .smd_int.out_offset = 0x8,
1605
1606 .smsm_int.irq_name = "wcnss_a11_smsm",
1607 .smsm_int.flags = IRQF_TRIGGER_RISING,
1608 .smsm_int.irq_id = -1,
1609 .smsm_int.device_name = "smd_smsm",
1610 .smsm_int.dev_id = 0,
1611 .smsm_int.out_bit_pos = 1 << 23,
1612 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1613 .smsm_int.out_offset = 0x8,
1614 },
1615};
1616
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001617static struct smd_subsystem_restart_config smd_ssr_config = {
1618 .disable_smsm_reset_handshake = 1,
1619};
1620
Eric Holmberg023d25c2012-03-01 12:27:55 -07001621static struct smd_platform smd_platform_data = {
1622 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1623 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001624 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001625};
1626
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001627struct platform_device msm_device_smd_apq8064 = {
1628 .name = "msm_smd",
1629 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001630 .resource = smd_resource,
1631 .num_resources = ARRAY_SIZE(smd_resource),
1632 .dev = {
1633 .platform_data = &smd_platform_data,
1634 },
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001635};
1636
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001637static struct resource resources_msm_pcie[] = {
1638 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06001639 .name = "pcie_parf",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001640 .start = PCIE20_PARF_PHYS,
1641 .end = PCIE20_PARF_PHYS + PCIE20_PARF_SIZE - 1,
1642 .flags = IORESOURCE_MEM,
1643 },
1644 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06001645 .name = "pcie_elbi",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001646 .start = PCIE20_ELBI_PHYS,
1647 .end = PCIE20_ELBI_PHYS + PCIE20_ELBI_SIZE - 1,
1648 .flags = IORESOURCE_MEM,
1649 },
1650 {
1651 .name = "pcie20",
1652 .start = PCIE20_PHYS,
1653 .end = PCIE20_PHYS + PCIE20_SIZE - 1,
1654 .flags = IORESOURCE_MEM,
1655 },
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06001656};
1657
1658struct platform_device msm_device_pcie = {
1659 .name = "msm_pcie",
1660 .id = -1,
1661 .num_resources = ARRAY_SIZE(resources_msm_pcie),
1662 .resource = resources_msm_pcie,
1663};
1664
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001665#ifdef CONFIG_HW_RANDOM_MSM
1666/* PRNG device */
1667#define MSM_PRNG_PHYS 0x1A500000
1668static struct resource rng_resources = {
1669 .flags = IORESOURCE_MEM,
1670 .start = MSM_PRNG_PHYS,
1671 .end = MSM_PRNG_PHYS + SZ_512 - 1,
1672};
1673
1674struct platform_device apq8064_device_rng = {
1675 .name = "msm_rng",
1676 .id = 0,
1677 .num_resources = 1,
1678 .resource = &rng_resources,
1679};
1680#endif
1681
Matt Wagantall292aace2012-01-26 19:12:34 -08001682static struct resource msm_gss_resources[] = {
1683 {
1684 .start = 0x10000000,
1685 .end = 0x10000000 + SZ_256 - 1,
1686 .flags = IORESOURCE_MEM,
1687 },
Matt Wagantall19ac4fd2012-02-03 20:18:23 -08001688 {
1689 .start = 0x10008000,
1690 .end = 0x10008000 + SZ_256 - 1,
1691 .flags = IORESOURCE_MEM,
1692 },
Matt Wagantall292aace2012-01-26 19:12:34 -08001693};
1694
1695struct platform_device msm_gss = {
1696 .name = "pil_gss",
1697 .id = -1,
1698 .num_resources = ARRAY_SIZE(msm_gss_resources),
1699 .resource = msm_gss_resources,
1700};
1701
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001702static struct fs_driver_data gfx3d_fs_data = {
1703 .clks = (struct fs_clk_data[]){
1704 { .name = "core_clk", .reset_rate = 27000000 },
1705 { .name = "iface_clk" },
1706 { .name = "bus_clk" },
1707 { 0 }
1708 },
1709 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
1710 .bus_port1 = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
Matt Wagantall1875d322012-02-22 16:11:33 -08001711};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001712
1713static struct fs_driver_data ijpeg_fs_data = {
1714 .clks = (struct fs_clk_data[]){
1715 { .name = "core_clk" },
1716 { .name = "iface_clk" },
1717 { .name = "bus_clk" },
1718 { 0 }
1719 },
1720 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
1721};
1722
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07001723static struct fs_driver_data mdp_fs_data = {
1724 .clks = (struct fs_clk_data[]){
1725 { .name = "core_clk" },
1726 { .name = "iface_clk" },
1727 { .name = "bus_clk" },
1728 { .name = "vsync_clk" },
1729 { .name = "lut_clk" },
1730 { .name = "tv_src_clk" },
1731 { .name = "tv_clk" },
1732 { 0 }
1733 },
1734 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
1735 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
1736};
1737
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001738static struct fs_driver_data rot_fs_data = {
1739 .clks = (struct fs_clk_data[]){
1740 { .name = "core_clk" },
1741 { .name = "iface_clk" },
1742 { .name = "bus_clk" },
1743 { 0 }
1744 },
1745 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
1746};
1747
1748static struct fs_driver_data ved_fs_data = {
1749 .clks = (struct fs_clk_data[]){
1750 { .name = "core_clk" },
1751 { .name = "iface_clk" },
1752 { .name = "bus_clk" },
1753 { 0 }
1754 },
1755 .bus_port0 = MSM_BUS_MASTER_VIDEO_ENC,
1756 .bus_port1 = MSM_BUS_MASTER_VIDEO_DEC,
1757};
1758
1759static struct fs_driver_data vfe_fs_data = {
1760 .clks = (struct fs_clk_data[]){
1761 { .name = "core_clk" },
1762 { .name = "iface_clk" },
1763 { .name = "bus_clk" },
1764 { 0 }
1765 },
1766 .bus_port0 = MSM_BUS_MASTER_VFE,
1767};
1768
1769static struct fs_driver_data vpe_fs_data = {
1770 .clks = (struct fs_clk_data[]){
1771 { .name = "core_clk" },
1772 { .name = "iface_clk" },
1773 { .name = "bus_clk" },
1774 { 0 }
1775 },
1776 .bus_port0 = MSM_BUS_MASTER_VPE,
1777};
1778
1779static struct fs_driver_data vcap_fs_data = {
1780 .clks = (struct fs_clk_data[]){
1781 { .name = "core_clk" },
1782 { .name = "iface_clk" },
1783 { .name = "bus_clk" },
1784 { 0 },
1785 },
1786 .bus_port0 = MSM_BUS_MASTER_VIDEO_CAP,
1787};
1788
1789struct platform_device *apq8064_footswitch[] __initdata = {
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07001790 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07001791 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -07001792 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07001793 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
1794 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07001795 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07001796 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall3cd5b3d2012-05-03 20:35:20 -07001797 FS_8X60(FS_VCAP, "vdd", "msm_vcap.0", &vcap_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001798};
1799unsigned apq8064_num_footswitch __initdata = ARRAY_SIZE(apq8064_footswitch);
Matt Wagantall1875d322012-02-22 16:11:33 -08001800
Praveen Chidambaram78499012011-11-01 17:15:17 -06001801struct msm_rpm_platform_data apq8064_rpm_data __initdata = {
1802 .reg_base_addrs = {
1803 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
1804 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
1805 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
1806 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
1807 },
1808 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08001809 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06001810 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001811 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
1812 .ipc_rpm_val = 4,
1813 .target_id = {
1814 MSM_RPM_MAP(8064, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
1815 MSM_RPM_MAP(8064, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
1816 MSM_RPM_MAP(8064, INVALIDATE_0, INVALIDATE, 8),
1817 MSM_RPM_MAP(8064, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
1818 MSM_RPM_MAP(8064, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
1819 MSM_RPM_MAP(8064, RPM_CTL, RPM_CTL, 1),
1820 MSM_RPM_MAP(8064, CXO_CLK, CXO_CLK, 1),
1821 MSM_RPM_MAP(8064, PXO_CLK, PXO_CLK, 1),
1822 MSM_RPM_MAP(8064, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
1823 MSM_RPM_MAP(8064, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
1824 MSM_RPM_MAP(8064, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
1825 MSM_RPM_MAP(8064, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
1826 MSM_RPM_MAP(8064, SFPB_CLK, SFPB_CLK, 1),
1827 MSM_RPM_MAP(8064, CFPB_CLK, CFPB_CLK, 1),
1828 MSM_RPM_MAP(8064, MMFPB_CLK, MMFPB_CLK, 1),
1829 MSM_RPM_MAP(8064, EBI1_CLK, EBI1_CLK, 1),
1830 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_HALT_0,
1831 APPS_FABRIC_CFG_HALT, 2),
1832 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_CLKMOD_0,
1833 APPS_FABRIC_CFG_CLKMOD, 3),
1834 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_IOCTL,
1835 APPS_FABRIC_CFG_IOCTL, 1),
1836 MSM_RPM_MAP(8064, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
1837 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_HALT_0,
1838 SYS_FABRIC_CFG_HALT, 2),
1839 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_CLKMOD_0,
1840 SYS_FABRIC_CFG_CLKMOD, 3),
1841 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_IOCTL,
1842 SYS_FABRIC_CFG_IOCTL, 1),
1843 MSM_RPM_MAP(8064, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 30),
1844 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_HALT_0,
1845 MMSS_FABRIC_CFG_HALT, 2),
1846 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_CLKMOD_0,
1847 MMSS_FABRIC_CFG_CLKMOD, 3),
1848 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_IOCTL,
1849 MMSS_FABRIC_CFG_IOCTL, 1),
1850 MSM_RPM_MAP(8064, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 21),
1851 MSM_RPM_MAP(8064, PM8921_S1_0, PM8921_S1, 2),
1852 MSM_RPM_MAP(8064, PM8921_S2_0, PM8921_S2, 2),
1853 MSM_RPM_MAP(8064, PM8921_S3_0, PM8921_S3, 2),
1854 MSM_RPM_MAP(8064, PM8921_S4_0, PM8921_S4, 2),
1855 MSM_RPM_MAP(8064, PM8921_S5_0, PM8921_S5, 2),
1856 MSM_RPM_MAP(8064, PM8921_S6_0, PM8921_S6, 2),
1857 MSM_RPM_MAP(8064, PM8921_S7_0, PM8921_S7, 2),
1858 MSM_RPM_MAP(8064, PM8921_S8_0, PM8921_S8, 2),
1859 MSM_RPM_MAP(8064, PM8921_L1_0, PM8921_L1, 2),
1860 MSM_RPM_MAP(8064, PM8921_L2_0, PM8921_L2, 2),
1861 MSM_RPM_MAP(8064, PM8921_L3_0, PM8921_L3, 2),
1862 MSM_RPM_MAP(8064, PM8921_L4_0, PM8921_L4, 2),
1863 MSM_RPM_MAP(8064, PM8921_L5_0, PM8921_L5, 2),
1864 MSM_RPM_MAP(8064, PM8921_L6_0, PM8921_L6, 2),
1865 MSM_RPM_MAP(8064, PM8921_L7_0, PM8921_L7, 2),
1866 MSM_RPM_MAP(8064, PM8921_L8_0, PM8921_L8, 2),
1867 MSM_RPM_MAP(8064, PM8921_L9_0, PM8921_L9, 2),
1868 MSM_RPM_MAP(8064, PM8921_L10_0, PM8921_L10, 2),
1869 MSM_RPM_MAP(8064, PM8921_L11_0, PM8921_L11, 2),
1870 MSM_RPM_MAP(8064, PM8921_L12_0, PM8921_L12, 2),
1871 MSM_RPM_MAP(8064, PM8921_L13_0, PM8921_L13, 2),
1872 MSM_RPM_MAP(8064, PM8921_L14_0, PM8921_L14, 2),
1873 MSM_RPM_MAP(8064, PM8921_L15_0, PM8921_L15, 2),
1874 MSM_RPM_MAP(8064, PM8921_L16_0, PM8921_L16, 2),
1875 MSM_RPM_MAP(8064, PM8921_L17_0, PM8921_L17, 2),
1876 MSM_RPM_MAP(8064, PM8921_L18_0, PM8921_L18, 2),
1877 MSM_RPM_MAP(8064, PM8921_L19_0, PM8921_L19, 2),
1878 MSM_RPM_MAP(8064, PM8921_L20_0, PM8921_L20, 2),
1879 MSM_RPM_MAP(8064, PM8921_L21_0, PM8921_L21, 2),
1880 MSM_RPM_MAP(8064, PM8921_L22_0, PM8921_L22, 2),
1881 MSM_RPM_MAP(8064, PM8921_L23_0, PM8921_L23, 2),
1882 MSM_RPM_MAP(8064, PM8921_L24_0, PM8921_L24, 2),
1883 MSM_RPM_MAP(8064, PM8921_L25_0, PM8921_L25, 2),
1884 MSM_RPM_MAP(8064, PM8921_L26_0, PM8921_L26, 2),
1885 MSM_RPM_MAP(8064, PM8921_L27_0, PM8921_L27, 2),
1886 MSM_RPM_MAP(8064, PM8921_L28_0, PM8921_L28, 2),
1887 MSM_RPM_MAP(8064, PM8921_L29_0, PM8921_L29, 2),
1888 MSM_RPM_MAP(8064, PM8921_CLK1_0, PM8921_CLK1, 2),
1889 MSM_RPM_MAP(8064, PM8921_CLK2_0, PM8921_CLK2, 2),
1890 MSM_RPM_MAP(8064, PM8921_LVS1, PM8921_LVS1, 1),
1891 MSM_RPM_MAP(8064, PM8921_LVS2, PM8921_LVS2, 1),
1892 MSM_RPM_MAP(8064, PM8921_LVS3, PM8921_LVS3, 1),
1893 MSM_RPM_MAP(8064, PM8921_LVS4, PM8921_LVS4, 1),
1894 MSM_RPM_MAP(8064, PM8921_LVS5, PM8921_LVS5, 1),
1895 MSM_RPM_MAP(8064, PM8921_LVS6, PM8921_LVS6, 1),
1896 MSM_RPM_MAP(8064, PM8921_LVS7, PM8921_LVS7, 1),
1897 MSM_RPM_MAP(8064, PM8821_S1_0, PM8821_S1, 2),
1898 MSM_RPM_MAP(8064, PM8821_S2_0, PM8821_S2, 2),
1899 MSM_RPM_MAP(8064, PM8821_L1_0, PM8821_L1, 2),
1900 MSM_RPM_MAP(8064, NCP_0, NCP, 2),
1901 MSM_RPM_MAP(8064, CXO_BUFFERS, CXO_BUFFERS, 1),
1902 MSM_RPM_MAP(8064, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
1903 MSM_RPM_MAP(8064, HDMI_SWITCH, HDMI_SWITCH, 1),
1904 MSM_RPM_MAP(8064, DDR_DMM_0, DDR_DMM, 2),
1905 MSM_RPM_MAP(8064, QDSS_CLK, QDSS_CLK, 1),
Joel Kingef390842012-05-23 16:42:48 -07001906 MSM_RPM_MAP(8064, VDDMIN_GPIO, VDDMIN_GPIO, 1),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001907 },
1908 .target_status = {
1909 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MAJOR),
1910 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MINOR),
1911 MSM_RPM_STATUS_ID_MAP(8064, VERSION_BUILD),
1912 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_0),
1913 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_1),
1914 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_2),
1915 MSM_RPM_STATUS_ID_MAP(8064, RESERVED_SUPPORTED_RESOURCES_0),
1916 MSM_RPM_STATUS_ID_MAP(8064, SEQUENCE),
1917 MSM_RPM_STATUS_ID_MAP(8064, RPM_CTL),
1918 MSM_RPM_STATUS_ID_MAP(8064, CXO_CLK),
1919 MSM_RPM_STATUS_ID_MAP(8064, PXO_CLK),
1920 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CLK),
1921 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_CLK),
1922 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_CLK),
1923 MSM_RPM_STATUS_ID_MAP(8064, DAYTONA_FABRIC_CLK),
1924 MSM_RPM_STATUS_ID_MAP(8064, SFPB_CLK),
1925 MSM_RPM_STATUS_ID_MAP(8064, CFPB_CLK),
1926 MSM_RPM_STATUS_ID_MAP(8064, MMFPB_CLK),
1927 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CLK),
1928 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_HALT),
1929 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_CLKMOD),
1930 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_IOCTL),
1931 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_ARB),
1932 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_HALT),
1933 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_CLKMOD),
1934 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_IOCTL),
1935 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_ARB),
1936 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_HALT),
1937 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_CLKMOD),
1938 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_IOCTL),
1939 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_ARB),
1940 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_0),
1941 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_1),
1942 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_0),
1943 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_1),
1944 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_0),
1945 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_1),
1946 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_0),
1947 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_1),
1948 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_0),
1949 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_1),
1950 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_0),
1951 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_1),
1952 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_0),
1953 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_1),
1954 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_0),
1955 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_1),
1956 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_0),
1957 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_1),
1958 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_0),
1959 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_1),
1960 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_0),
1961 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_1),
1962 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_0),
1963 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_1),
1964 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_0),
1965 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_1),
1966 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_0),
1967 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_1),
1968 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_0),
1969 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_1),
1970 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_0),
1971 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_1),
1972 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_0),
1973 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_1),
1974 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_0),
1975 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_1),
1976 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_0),
1977 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_1),
1978 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_0),
1979 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_1),
1980 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_0),
1981 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_1),
1982 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_0),
1983 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_1),
1984 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_0),
1985 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_1),
1986 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_0),
1987 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_1),
1988 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_0),
1989 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_1),
1990 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_0),
1991 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_1),
1992 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_0),
1993 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_1),
1994 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_0),
1995 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_1),
1996 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_0),
1997 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_1),
1998 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_0),
1999 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_1),
2000 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_0),
2001 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_1),
2002 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_0),
2003 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_1),
2004 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_0),
2005 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_1),
2006 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_0),
2007 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_1),
2008 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_0),
2009 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_1),
2010 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_0),
2011 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_1),
2012 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_0),
2013 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_1),
2014 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_0),
2015 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_1),
2016 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_0),
2017 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_1),
2018 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS1),
2019 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS2),
2020 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS3),
2021 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS4),
2022 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS5),
2023 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS6),
2024 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS7),
2025 MSM_RPM_STATUS_ID_MAP(8064, NCP_0),
2026 MSM_RPM_STATUS_ID_MAP(8064, NCP_1),
2027 MSM_RPM_STATUS_ID_MAP(8064, CXO_BUFFERS),
2028 MSM_RPM_STATUS_ID_MAP(8064, USB_OTG_SWITCH),
2029 MSM_RPM_STATUS_ID_MAP(8064, HDMI_SWITCH),
2030 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_0),
2031 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_1),
2032 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH0_RANGE),
2033 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH1_RANGE),
2034 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_0),
2035 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_1),
2036 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_0),
2037 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_1),
2038 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_0),
2039 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_1),
Joel Kingef390842012-05-23 16:42:48 -07002040 MSM_RPM_STATUS_ID_MAP(8064, VDDMIN_GPIO),
Praveen Chidambaram78499012011-11-01 17:15:17 -06002041 },
2042 .target_ctrl_id = {
2043 MSM_RPM_CTRL_MAP(8064, VERSION_MAJOR),
2044 MSM_RPM_CTRL_MAP(8064, VERSION_MINOR),
2045 MSM_RPM_CTRL_MAP(8064, VERSION_BUILD),
2046 MSM_RPM_CTRL_MAP(8064, REQ_CTX_0),
2047 MSM_RPM_CTRL_MAP(8064, REQ_SEL_0),
2048 MSM_RPM_CTRL_MAP(8064, ACK_CTX_0),
2049 MSM_RPM_CTRL_MAP(8064, ACK_SEL_0),
2050 },
2051 .sel_invalidate = MSM_RPM_8064_SEL_INVALIDATE,
2052 .sel_notification = MSM_RPM_8064_SEL_NOTIFICATION,
2053 .sel_last = MSM_RPM_8064_SEL_LAST,
2054 .ver = {3, 0, 0},
2055};
2056
2057struct platform_device apq8064_rpm_device = {
2058 .name = "msm_rpm",
2059 .id = -1,
2060};
2061
2062static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
2063 .phys_addr_base = 0x0010D204,
2064 .phys_size = SZ_8K,
2065};
2066
2067struct platform_device apq8064_rpm_stat_device = {
2068 .name = "msm_rpm_stat",
2069 .id = -1,
2070 .dev = {
2071 .platform_data = &msm_rpm_stat_pdata,
2072 },
2073};
2074
2075static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2076 .phys_addr_base = 0x0010C000,
2077 .reg_offsets = {
2078 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
2079 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
2080 },
2081 .phys_size = SZ_8K,
2082 .log_len = 4096, /* log's buffer length in bytes */
2083 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2084};
2085
2086struct platform_device apq8064_rpm_log_device = {
2087 .name = "msm_rpm_log",
2088 .id = -1,
2089 .dev = {
2090 .platform_data = &msm_rpm_log_pdata,
2091 },
2092};
2093
Jin Hongd3024e62012-02-09 16:13:32 -08002094/* Sensors DSPS platform data */
2095
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07002096#define PPSS_DSPS_TCM_CODE_BASE 0x12000000
2097#define PPSS_DSPS_TCM_CODE_SIZE 0x28000
2098#define PPSS_DSPS_TCM_BUF_BASE 0x12040000
2099#define PPSS_DSPS_TCM_BUF_SIZE 0x4000
2100#define PPSS_DSPS_PIPE_BASE 0x12800000
2101#define PPSS_DSPS_PIPE_SIZE 0x4000
2102#define PPSS_DSPS_DDR_BASE 0x8fe00000
2103#define PPSS_DSPS_DDR_SIZE 0x100000
2104#define PPSS_SMEM_BASE 0x80000000
2105#define PPSS_SMEM_SIZE 0x200000
Jin Hongd3024e62012-02-09 16:13:32 -08002106#define PPSS_REG_PHYS_BASE 0x12080000
2107
2108static struct dsps_clk_info dsps_clks[] = {};
2109static struct dsps_regulator_info dsps_regs[] = {};
2110
2111/*
2112 * Note: GPIOs field is intialized in run-time at the function
2113 * apq8064_init_dsps().
2114 */
2115
2116struct msm_dsps_platform_data msm_dsps_pdata_8064 = {
2117 .clks = dsps_clks,
2118 .clks_num = ARRAY_SIZE(dsps_clks),
2119 .gpios = NULL,
2120 .gpios_num = 0,
2121 .regs = dsps_regs,
2122 .regs_num = ARRAY_SIZE(dsps_regs),
2123 .dsps_pwr_ctl_en = 1,
karthik karuppasamy1a1c6b02012-05-29 15:16:32 -07002124 .tcm_code_start = PPSS_DSPS_TCM_CODE_BASE,
2125 .tcm_code_size = PPSS_DSPS_TCM_CODE_SIZE,
2126 .tcm_buf_start = PPSS_DSPS_TCM_BUF_BASE,
2127 .tcm_buf_size = PPSS_DSPS_TCM_BUF_SIZE,
2128 .pipe_start = PPSS_DSPS_PIPE_BASE,
2129 .pipe_size = PPSS_DSPS_PIPE_SIZE,
2130 .ddr_start = PPSS_DSPS_DDR_BASE,
2131 .ddr_size = PPSS_DSPS_DDR_SIZE,
2132 .smem_start = PPSS_SMEM_BASE,
2133 .smem_size = PPSS_SMEM_SIZE,
Jin Hongd3024e62012-02-09 16:13:32 -08002134 .signature = DSPS_SIGNATURE,
2135};
2136
2137static struct resource msm_dsps_resources[] = {
2138 {
2139 .start = PPSS_REG_PHYS_BASE,
2140 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2141 .name = "ppss_reg",
2142 .flags = IORESOURCE_MEM,
2143 },
2144
2145 {
2146 .start = PPSS_WDOG_TIMER_IRQ,
2147 .end = PPSS_WDOG_TIMER_IRQ,
2148 .name = "ppss_wdog",
2149 .flags = IORESOURCE_IRQ,
2150 },
2151};
2152
2153struct platform_device msm_dsps_device_8064 = {
2154 .name = "msm_dsps",
2155 .id = 0,
2156 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2157 .resource = msm_dsps_resources,
2158 .dev.platform_data = &msm_dsps_pdata_8064,
2159};
2160
Praveen Chidambaram78499012011-11-01 17:15:17 -06002161#ifdef CONFIG_MSM_MPM
2162static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
2163 [1] = MSM_GPIO_TO_INT(26),
2164 [2] = MSM_GPIO_TO_INT(88),
2165 [4] = MSM_GPIO_TO_INT(73),
2166 [5] = MSM_GPIO_TO_INT(74),
2167 [6] = MSM_GPIO_TO_INT(75),
2168 [7] = MSM_GPIO_TO_INT(76),
2169 [8] = MSM_GPIO_TO_INT(77),
2170 [9] = MSM_GPIO_TO_INT(36),
2171 [10] = MSM_GPIO_TO_INT(84),
2172 [11] = MSM_GPIO_TO_INT(7),
2173 [12] = MSM_GPIO_TO_INT(11),
2174 [13] = MSM_GPIO_TO_INT(52),
2175 [14] = MSM_GPIO_TO_INT(15),
2176 [15] = MSM_GPIO_TO_INT(83),
2177 [16] = USB3_HS_IRQ,
2178 [19] = MSM_GPIO_TO_INT(61),
2179 [20] = MSM_GPIO_TO_INT(58),
2180 [23] = MSM_GPIO_TO_INT(65),
2181 [24] = MSM_GPIO_TO_INT(63),
2182 [25] = USB1_HS_IRQ,
2183 [27] = HDMI_IRQ,
2184 [29] = MSM_GPIO_TO_INT(22),
2185 [30] = MSM_GPIO_TO_INT(72),
2186 [31] = USB4_HS_IRQ,
2187 [33] = MSM_GPIO_TO_INT(44),
2188 [34] = MSM_GPIO_TO_INT(39),
2189 [35] = MSM_GPIO_TO_INT(19),
2190 [36] = MSM_GPIO_TO_INT(23),
2191 [37] = MSM_GPIO_TO_INT(41),
2192 [38] = MSM_GPIO_TO_INT(30),
2193 [41] = MSM_GPIO_TO_INT(42),
2194 [42] = MSM_GPIO_TO_INT(56),
2195 [43] = MSM_GPIO_TO_INT(55),
2196 [44] = MSM_GPIO_TO_INT(50),
2197 [45] = MSM_GPIO_TO_INT(49),
2198 [46] = MSM_GPIO_TO_INT(47),
2199 [47] = MSM_GPIO_TO_INT(45),
2200 [48] = MSM_GPIO_TO_INT(38),
2201 [49] = MSM_GPIO_TO_INT(34),
2202 [50] = MSM_GPIO_TO_INT(32),
2203 [51] = MSM_GPIO_TO_INT(29),
2204 [52] = MSM_GPIO_TO_INT(18),
2205 [53] = MSM_GPIO_TO_INT(10),
2206 [54] = MSM_GPIO_TO_INT(81),
2207 [55] = MSM_GPIO_TO_INT(6),
2208};
2209
2210static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
2211 TLMM_MSM_SUMMARY_IRQ,
2212 RPM_APCC_CPU0_GP_HIGH_IRQ,
2213 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2214 RPM_APCC_CPU0_GP_LOW_IRQ,
2215 RPM_APCC_CPU0_WAKE_UP_IRQ,
2216 RPM_APCC_CPU1_GP_HIGH_IRQ,
2217 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2218 RPM_APCC_CPU1_GP_LOW_IRQ,
2219 RPM_APCC_CPU1_WAKE_UP_IRQ,
2220 MSS_TO_APPS_IRQ_0,
2221 MSS_TO_APPS_IRQ_1,
2222 MSS_TO_APPS_IRQ_2,
2223 MSS_TO_APPS_IRQ_3,
2224 MSS_TO_APPS_IRQ_4,
2225 MSS_TO_APPS_IRQ_5,
2226 MSS_TO_APPS_IRQ_6,
2227 MSS_TO_APPS_IRQ_7,
2228 MSS_TO_APPS_IRQ_8,
2229 MSS_TO_APPS_IRQ_9,
2230 LPASS_SCSS_GP_LOW_IRQ,
2231 LPASS_SCSS_GP_MEDIUM_IRQ,
2232 LPASS_SCSS_GP_HIGH_IRQ,
2233 SPS_MTI_30,
2234 SPS_MTI_31,
2235 RIVA_APSS_SPARE_IRQ,
2236 RIVA_APPS_WLAN_SMSM_IRQ,
2237 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2238 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2239};
2240
2241struct msm_mpm_device_data apq8064_mpm_dev_data __initdata = {
2242 .irqs_m2a = msm_mpm_irqs_m2a,
2243 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2244 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2245 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2246 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2247 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2248 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2249 .mpm_apps_ipc_val = BIT(1),
2250 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2251
2252};
2253#endif
Joel Kingdacbc822012-01-25 13:30:57 -08002254
Joel King14fe7fa2012-05-27 14:26:11 -07002255/* AP2MDM_SOFT_RESET is implemented by the PON_RESET_N gpio */
Joel Kingdacbc822012-01-25 13:30:57 -08002256#define MDM2AP_ERRFATAL 19
2257#define AP2MDM_ERRFATAL 18
2258#define MDM2AP_STATUS 49
2259#define AP2MDM_STATUS 48
Joel King14fe7fa2012-05-27 14:26:11 -07002260#define AP2MDM_SOFT_RESET 27
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002261#define AP2MDM_WAKEUP 35
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002262#define MDM2AP_PBLRDY 46
Joel Kingdacbc822012-01-25 13:30:57 -08002263
2264static struct resource mdm_resources[] = {
2265 {
2266 .start = MDM2AP_ERRFATAL,
2267 .end = MDM2AP_ERRFATAL,
2268 .name = "MDM2AP_ERRFATAL",
2269 .flags = IORESOURCE_IO,
2270 },
2271 {
2272 .start = AP2MDM_ERRFATAL,
2273 .end = AP2MDM_ERRFATAL,
2274 .name = "AP2MDM_ERRFATAL",
2275 .flags = IORESOURCE_IO,
2276 },
2277 {
2278 .start = MDM2AP_STATUS,
2279 .end = MDM2AP_STATUS,
2280 .name = "MDM2AP_STATUS",
2281 .flags = IORESOURCE_IO,
2282 },
2283 {
2284 .start = AP2MDM_STATUS,
2285 .end = AP2MDM_STATUS,
2286 .name = "AP2MDM_STATUS",
2287 .flags = IORESOURCE_IO,
2288 },
2289 {
Joel King14fe7fa2012-05-27 14:26:11 -07002290 .start = AP2MDM_SOFT_RESET,
2291 .end = AP2MDM_SOFT_RESET,
2292 .name = "AP2MDM_SOFT_RESET",
Joel Kingdacbc822012-01-25 13:30:57 -08002293 .flags = IORESOURCE_IO,
2294 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002295 {
2296 .start = AP2MDM_WAKEUP,
2297 .end = AP2MDM_WAKEUP,
2298 .name = "AP2MDM_WAKEUP",
2299 .flags = IORESOURCE_IO,
2300 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002301 {
2302 .start = MDM2AP_PBLRDY,
2303 .end = MDM2AP_PBLRDY,
2304 .name = "MDM2AP_PBLRDY",
2305 .flags = IORESOURCE_IO,
2306 },
Joel Kingdacbc822012-01-25 13:30:57 -08002307};
2308
2309struct platform_device mdm_8064_device = {
2310 .name = "mdm2_modem",
2311 .id = -1,
2312 .num_resources = ARRAY_SIZE(mdm_resources),
2313 .resource = mdm_resources,
2314};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002315
2316static int apq8064_LPM_latency = 1000; /* >100 usec for WFI */
2317
2318struct platform_device apq8064_cpu_idle_device = {
2319 .name = "msm_cpu_idle",
2320 .id = -1,
2321 .dev = {
2322 .platform_data = &apq8064_LPM_latency,
2323 },
2324};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002325
2326static struct msm_dcvs_freq_entry apq8064_freq[] = {
2327 { 384000, 166981, 345600},
2328 { 702000, 213049, 632502},
2329 {1026000, 285712, 925613},
2330 {1242000, 383945, 1176550},
2331 {1458000, 419729, 1465478},
2332 {1512000, 434116, 1546674},
2333
2334};
2335
2336static struct msm_dcvs_core_info apq8064_core_info = {
2337 .freq_tbl = &apq8064_freq[0],
2338 .core_param = {
2339 .max_time_us = 100000,
2340 .num_freq = ARRAY_SIZE(apq8064_freq),
2341 },
2342 .algo_param = {
2343 .slack_time_us = 58000,
2344 .scale_slack_time = 0,
2345 .scale_slack_time_pct = 0,
2346 .disable_pc_threshold = 1458000,
2347 .em_window_size = 100000,
2348 .em_max_util_pct = 97,
2349 .ss_window_size = 1000000,
2350 .ss_util_pct = 95,
2351 .ss_iobusy_conv = 100,
2352 },
2353};
2354
2355struct platform_device apq8064_msm_gov_device = {
2356 .name = "msm_dcvs_gov",
2357 .id = -1,
2358 .dev = {
2359 .platform_data = &apq8064_core_info,
2360 },
2361};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002362
Terence Hampson2e1705f2012-04-11 19:55:29 -04002363#ifdef CONFIG_MSM_VCAP
2364#define VCAP_HW_BASE 0x05900000
2365
2366static struct msm_bus_vectors vcap_init_vectors[] = {
2367 {
2368 .src = MSM_BUS_MASTER_VIDEO_CAP,
2369 .dst = MSM_BUS_SLAVE_EBI_CH0,
2370 .ab = 0,
2371 .ib = 0,
2372 },
2373};
2374
Terence Hampson2e1705f2012-04-11 19:55:29 -04002375static struct msm_bus_vectors vcap_480_vectors[] = {
2376 {
2377 .src = MSM_BUS_MASTER_VIDEO_CAP,
2378 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson779dc762012-06-07 15:59:27 -04002379 .ab = 480 * 720 * 3 * 60,
2380 .ib = 480 * 720 * 3 * 60 * 1.5,
2381 },
2382};
2383
2384static struct msm_bus_vectors vcap_576_vectors[] = {
2385 {
2386 .src = MSM_BUS_MASTER_VIDEO_CAP,
2387 .dst = MSM_BUS_SLAVE_EBI_CH0,
2388 .ab = 576 * 720 * 3 * 60,
2389 .ib = 576 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002390 },
2391};
2392
2393static struct msm_bus_vectors vcap_720_vectors[] = {
2394 {
2395 .src = MSM_BUS_MASTER_VIDEO_CAP,
2396 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002397 .ab = 1280 * 720 * 3 * 60,
2398 .ib = 1280 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002399 },
2400};
2401
2402static struct msm_bus_vectors vcap_1080_vectors[] = {
2403 {
2404 .src = MSM_BUS_MASTER_VIDEO_CAP,
2405 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002406 .ab = 1920 * 1080 * 3 * 60,
2407 .ib = 1920 * 1080 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002408 },
2409};
2410
2411static struct msm_bus_paths vcap_bus_usecases[] = {
2412 {
2413 ARRAY_SIZE(vcap_init_vectors),
2414 vcap_init_vectors,
2415 },
2416 {
2417 ARRAY_SIZE(vcap_480_vectors),
2418 vcap_480_vectors,
2419 },
2420 {
Terence Hampson779dc762012-06-07 15:59:27 -04002421 ARRAY_SIZE(vcap_576_vectors),
2422 vcap_576_vectors,
2423 },
2424 {
Terence Hampson2e1705f2012-04-11 19:55:29 -04002425 ARRAY_SIZE(vcap_720_vectors),
2426 vcap_720_vectors,
2427 },
2428 {
2429 ARRAY_SIZE(vcap_1080_vectors),
2430 vcap_1080_vectors,
2431 },
2432};
2433
2434static struct msm_bus_scale_pdata vcap_axi_client_pdata = {
2435 vcap_bus_usecases,
2436 ARRAY_SIZE(vcap_bus_usecases),
2437};
2438
2439static struct resource msm_vcap_resources[] = {
2440 {
2441 .name = "vcap",
2442 .start = VCAP_HW_BASE,
2443 .end = VCAP_HW_BASE + SZ_1M - 1,
2444 .flags = IORESOURCE_MEM,
2445 },
2446 {
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002447 .name = "vc_irq",
Terence Hampson2e1705f2012-04-11 19:55:29 -04002448 .start = VCAP_VC,
2449 .end = VCAP_VC,
2450 .flags = IORESOURCE_IRQ,
2451 },
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002452 {
2453 .name = "vp_irq",
2454 .start = VCAP_VP,
2455 .end = VCAP_VP,
2456 .flags = IORESOURCE_IRQ,
2457 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002458};
2459
2460static unsigned vcap_gpios[] = {
2461 2, 3, 4, 5, 6, 7, 8, 9, 10,
2462 11, 12, 13, 18, 19, 20, 21,
2463 22, 23, 24, 25, 26, 80, 82,
2464 83, 84, 85, 86, 87,
2465};
2466
2467static struct vcap_platform_data vcap_pdata = {
2468 .gpios = vcap_gpios,
2469 .num_gpios = ARRAY_SIZE(vcap_gpios),
2470 .bus_client_pdata = &vcap_axi_client_pdata
2471};
2472
2473struct platform_device msm8064_device_vcap = {
2474 .name = "msm_vcap",
2475 .id = 0,
2476 .resource = msm_vcap_resources,
2477 .num_resources = ARRAY_SIZE(msm_vcap_resources),
2478 .dev = {
2479 .platform_data = &vcap_pdata,
2480 },
2481};
2482#endif
2483
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002484static struct resource msm_cache_erp_resources[] = {
2485 {
2486 .name = "l1_irq",
2487 .start = SC_SICCPUXEXTFAULTIRPTREQ,
2488 .flags = IORESOURCE_IRQ,
2489 },
2490 {
2491 .name = "l2_irq",
2492 .start = APCC_QGICL2IRPTREQ,
2493 .flags = IORESOURCE_IRQ,
2494 }
2495};
2496
2497struct platform_device apq8064_device_cache_erp = {
2498 .name = "msm_cache_erp",
2499 .id = -1,
2500 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
2501 .resource = msm_cache_erp_resources,
2502};
Pratik Patel212ab362012-03-16 12:30:07 -07002503
2504#define MSM_QDSS_PHYS_BASE 0x01A00000
2505#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
2506
2507#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
2508
2509static struct qdss_source msm_qdss_sources[] = {
2510 QDSS_SOURCE("msm_etm", 0x33),
2511 QDSS_SOURCE("msm_oxili", 0x80),
2512};
2513
2514static struct msm_qdss_platform_data qdss_pdata = {
2515 .src_table = msm_qdss_sources,
2516 .size = ARRAY_SIZE(msm_qdss_sources),
2517 .afamily = 1,
2518};
2519
2520struct platform_device apq8064_qdss_device = {
2521 .name = "msm_qdss",
2522 .id = -1,
2523 .dev = {
2524 .platform_data = &qdss_pdata,
2525 },
2526};
2527
2528static struct resource msm_etm_resources[] = {
2529 {
2530 .start = MSM_ETM_PHYS_BASE,
2531 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 4) - 1,
2532 .flags = IORESOURCE_MEM,
2533 },
2534};
2535
2536struct platform_device apq8064_etm_device = {
2537 .name = "msm_etm",
2538 .id = 0,
2539 .num_resources = ARRAY_SIZE(msm_etm_resources),
2540 .resource = msm_etm_resources,
2541};
Laura Abbott0577d7b2012-04-17 11:14:30 -07002542
2543struct msm_iommu_domain_name apq8064_iommu_ctx_names[] = {
2544 /* Camera */
2545 {
2546 .name = "vpe_src",
2547 .domain = CAMERA_DOMAIN,
2548 },
2549 /* Camera */
2550 {
2551 .name = "vpe_dst",
2552 .domain = CAMERA_DOMAIN,
2553 },
2554 /* Camera */
2555 {
2556 .name = "vfe_imgwr",
2557 .domain = CAMERA_DOMAIN,
2558 },
2559 /* Camera */
2560 {
2561 .name = "vfe_misc",
2562 .domain = CAMERA_DOMAIN,
2563 },
2564 /* Camera */
2565 {
2566 .name = "ijpeg_src",
2567 .domain = CAMERA_DOMAIN,
2568 },
2569 /* Camera */
2570 {
2571 .name = "ijpeg_dst",
2572 .domain = CAMERA_DOMAIN,
2573 },
2574 /* Camera */
2575 {
2576 .name = "jpegd_src",
2577 .domain = CAMERA_DOMAIN,
2578 },
2579 /* Camera */
2580 {
2581 .name = "jpegd_dst",
2582 .domain = CAMERA_DOMAIN,
2583 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002584 /* Rotator src*/
Laura Abbott0577d7b2012-04-17 11:14:30 -07002585 {
2586 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07002587 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002588 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002589 /* Rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002590 {
2591 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07002592 .domain = ROTATOR_DST_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002593 },
2594 /* Video */
2595 {
2596 .name = "vcodec_a_mm1",
2597 .domain = VIDEO_DOMAIN,
2598 },
2599 /* Video */
2600 {
2601 .name = "vcodec_b_mm2",
2602 .domain = VIDEO_DOMAIN,
2603 },
2604 /* Video */
2605 {
2606 .name = "vcodec_a_stream",
2607 .domain = VIDEO_DOMAIN,
2608 },
2609};
2610
2611static struct mem_pool apq8064_video_pools[] = {
2612 /*
2613 * Video hardware has the following requirements:
2614 * 1. All video addresses used by the video hardware must be at a higher
2615 * address than video firmware address.
2616 * 2. Video hardware can only access a range of 256MB from the base of
2617 * the video firmware.
2618 */
2619 [VIDEO_FIRMWARE_POOL] =
2620 /* Low addresses, intended for video firmware */
2621 {
2622 .paddr = SZ_128K,
2623 .size = SZ_16M - SZ_128K,
2624 },
2625 [VIDEO_MAIN_POOL] =
2626 /* Main video pool */
2627 {
2628 .paddr = SZ_16M,
2629 .size = SZ_256M - SZ_16M,
2630 },
2631 [GEN_POOL] =
2632 /* Remaining address space up to 2G */
2633 {
2634 .paddr = SZ_256M,
2635 .size = SZ_2G - SZ_256M,
2636 },
2637};
2638
2639static struct mem_pool apq8064_camera_pools[] = {
2640 [GEN_POOL] =
2641 /* One address space for camera */
2642 {
2643 .paddr = SZ_128K,
2644 .size = SZ_2G - SZ_128K,
2645 },
2646};
2647
Olav Hauganef95ae32012-05-15 09:50:30 -07002648static struct mem_pool apq8064_display_read_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07002649 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07002650 /* One address space for display reads */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002651 {
2652 .paddr = SZ_128K,
2653 .size = SZ_2G - SZ_128K,
2654 },
2655};
2656
Olav Hauganef95ae32012-05-15 09:50:30 -07002657static struct mem_pool apq8064_display_write_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07002658 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07002659 /* One address space for display writes */
2660 {
2661 .paddr = SZ_128K,
2662 .size = SZ_2G - SZ_128K,
2663 },
2664};
2665
2666static struct mem_pool apq8064_rotator_src_pools[] = {
2667 [GEN_POOL] =
2668 /* One address space for rotator src */
2669 {
2670 .paddr = SZ_128K,
2671 .size = SZ_2G - SZ_128K,
2672 },
2673};
2674
2675static struct mem_pool apq8064_rotator_dst_pools[] = {
2676 [GEN_POOL] =
2677 /* One address space for rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07002678 {
2679 .paddr = SZ_128K,
2680 .size = SZ_2G - SZ_128K,
2681 },
2682};
2683
2684static struct msm_iommu_domain apq8064_iommu_domains[] = {
2685 [VIDEO_DOMAIN] = {
2686 .iova_pools = apq8064_video_pools,
2687 .npools = ARRAY_SIZE(apq8064_video_pools),
2688 },
2689 [CAMERA_DOMAIN] = {
2690 .iova_pools = apq8064_camera_pools,
2691 .npools = ARRAY_SIZE(apq8064_camera_pools),
2692 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002693 [DISPLAY_READ_DOMAIN] = {
2694 .iova_pools = apq8064_display_read_pools,
2695 .npools = ARRAY_SIZE(apq8064_display_read_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07002696 },
Olav Hauganef95ae32012-05-15 09:50:30 -07002697 [DISPLAY_WRITE_DOMAIN] = {
2698 .iova_pools = apq8064_display_write_pools,
2699 .npools = ARRAY_SIZE(apq8064_display_write_pools),
2700 },
2701 [ROTATOR_SRC_DOMAIN] = {
2702 .iova_pools = apq8064_rotator_src_pools,
2703 .npools = ARRAY_SIZE(apq8064_rotator_src_pools),
2704 },
2705 [ROTATOR_DST_DOMAIN] = {
2706 .iova_pools = apq8064_rotator_dst_pools,
2707 .npools = ARRAY_SIZE(apq8064_rotator_dst_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07002708 },
2709};
2710
2711struct iommu_domains_pdata apq8064_iommu_domain_pdata = {
2712 .domains = apq8064_iommu_domains,
2713 .ndomains = ARRAY_SIZE(apq8064_iommu_domains),
2714 .domain_names = apq8064_iommu_ctx_names,
2715 .nnames = ARRAY_SIZE(apq8064_iommu_ctx_names),
2716 .domain_alloc_flags = 0,
2717};
2718
2719struct platform_device apq8064_iommu_domain_device = {
2720 .name = "iommu_domains",
2721 .id = -1,
2722 .dev = {
2723 .platform_data = &apq8064_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07002724 }
2725};
2726
2727struct msm_rtb_platform_data apq8064_rtb_pdata = {
2728 .size = SZ_1M,
2729};
2730
2731static int __init msm_rtb_set_buffer_size(char *p)
2732{
2733 int s;
2734
2735 s = memparse(p, NULL);
2736 apq8064_rtb_pdata.size = ALIGN(s, SZ_4K);
2737 return 0;
2738}
2739early_param("msm_rtb_size", msm_rtb_set_buffer_size);
2740
2741struct platform_device apq8064_rtb_device = {
2742 .name = "msm_rtb",
2743 .id = -1,
2744 .dev = {
2745 .platform_data = &apq8064_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002746 },
2747};
Laura Abbott93a4a352012-05-25 09:26:35 -07002748
2749#define APQ8064_L1_SIZE SZ_1M
2750/*
2751 * The actual L2 size is smaller but we need a larger buffer
2752 * size to store other dump information
2753 */
2754#define APQ8064_L2_SIZE SZ_8M
2755
2756struct msm_cache_dump_platform_data apq8064_cache_dump_pdata = {
2757 .l2_size = APQ8064_L2_SIZE,
2758 .l1_size = APQ8064_L1_SIZE,
2759};
2760
2761struct platform_device apq8064_cache_dump_device = {
2762 .name = "msm_cache_dump",
2763 .id = -1,
2764 .dev = {
2765 .platform_data = &apq8064_cache_dump_pdata,
2766 },
2767};