blob: 705bdd469a59a84d6b131c60bcd83b639f6beb0c [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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <mach/irqs-8064.h>
21#include <mach/board.h>
22#include <mach/msm_iomap.h>
Yan He06913ce2011-08-26 16:33:46 -070023#include <mach/usbdiag.h>
24#include <mach/msm_sps.h>
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -070025#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080026#include <mach/msm_dsps.h>
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -080027#include <sound/msm-dai-q6.h>
28#include <sound/apr_audio.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070029#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060030#include <mach/rpm.h>
Joel Kingdacbc822012-01-25 13:30:57 -080031#include <mach/mdm2.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070032#include <mach/msm_smd.h>
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070033#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070034#include <mach/msm_rtb.h>
Pratik Patel212ab362012-03-16 12:30:07 -070035#include <mach/qdss.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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045
46/* Address of GSBI blocks */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070047#define MSM_GSBI1_PHYS 0x12440000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070048#define MSM_GSBI3_PHYS 0x16200000
Harini Jayaramanc4c58692011-07-19 14:50:10 -060049#define MSM_GSBI4_PHYS 0x16300000
50#define MSM_GSBI5_PHYS 0x1A200000
51#define MSM_GSBI6_PHYS 0x16500000
52#define MSM_GSBI7_PHYS 0x16600000
53
Kenneth Heitke748593a2011-07-15 15:45:11 -060054/* GSBI UART devices */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070055#define MSM_UART1DM_PHYS (MSM_GSBI1_PHYS + 0x10000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
Jin Hong4bbbfba2012-02-02 21:48:07 -080057#define MSM_UART7DM_PHYS (MSM_GSBI7_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070058
Harini Jayaramanc4c58692011-07-19 14:50:10 -060059/* GSBI QUP devices */
David Keitel3c40fc52012-02-09 17:53:52 -080060#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x20000)
Harini Jayaramanc4c58692011-07-19 14:50:10 -060061#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
62#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
63#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
64#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
65#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
66#define MSM_QUP_SIZE SZ_4K
67
Kenneth Heitke36920d32011-07-20 16:44:30 -060068/* Address of SSBI CMD */
69#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
70#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
71#define MSM_PMIC_SSBI_SIZE SZ_4K
Harini Jayaramanc4c58692011-07-19 14:50:10 -060072
Hemant Kumarcaa09092011-07-30 00:26:33 -070073/* Address of HS USBOTG1 */
Hemant Kumard86c4882012-01-24 19:39:37 -080074#define MSM_HSUSB1_PHYS 0x12500000
75#define MSM_HSUSB1_SIZE SZ_4K
Hemant Kumarcaa09092011-07-30 00:26:33 -070076
Manu Gautam91223e02011-11-08 15:27:22 +053077/* Address of HS USB3 */
78#define MSM_HSUSB3_PHYS 0x12520000
79#define MSM_HSUSB3_SIZE SZ_4K
80
Hemant Kumar1d66e1c2012-02-13 15:24:59 -080081/* Address of HS USB4 */
82#define MSM_HSUSB4_PHYS 0x12530000
83#define MSM_HSUSB4_SIZE SZ_4K
84
85
Jeff Ohlstein7e668552011-10-06 16:17:25 -070086static struct msm_watchdog_pdata msm_watchdog_pdata = {
87 .pet_time = 10000,
88 .bark_time = 11000,
89 .has_secure = true,
Joel Kinge7ca6f72012-02-09 20:51:25 -080090 .needs_expired_enable = true,
Jeff Ohlstein7e668552011-10-06 16:17:25 -070091};
92
93struct platform_device msm8064_device_watchdog = {
94 .name = "msm_watchdog",
95 .id = -1,
96 .dev = {
97 .platform_data = &msm_watchdog_pdata,
98 },
99};
100
Joel King0581896d2011-07-19 16:43:28 -0700101static struct resource msm_dmov_resource[] = {
102 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800103 .start = ADM_0_SCSS_1_IRQ,
Joel King0581896d2011-07-19 16:43:28 -0700104 .flags = IORESOURCE_IRQ,
105 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700106 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800107 .start = 0x18320000,
108 .end = 0x18320000 + SZ_1M - 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700109 .flags = IORESOURCE_MEM,
110 },
111};
112
113static struct msm_dmov_pdata msm_dmov_pdata = {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800114 .sd = 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700115 .sd_size = 0x800,
Joel King0581896d2011-07-19 16:43:28 -0700116};
117
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700118struct platform_device apq8064_device_dmov = {
Joel King0581896d2011-07-19 16:43:28 -0700119 .name = "msm_dmov",
120 .id = -1,
121 .resource = msm_dmov_resource,
122 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700123 .dev = {
124 .platform_data = &msm_dmov_pdata,
125 },
Joel King0581896d2011-07-19 16:43:28 -0700126};
127
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700128static struct resource resources_uart_gsbi1[] = {
129 {
130 .start = APQ8064_GSBI1_UARTDM_IRQ,
131 .end = APQ8064_GSBI1_UARTDM_IRQ,
132 .flags = IORESOURCE_IRQ,
133 },
134 {
135 .start = MSM_UART1DM_PHYS,
136 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
137 .name = "uartdm_resource",
138 .flags = IORESOURCE_MEM,
139 },
140 {
141 .start = MSM_GSBI1_PHYS,
142 .end = MSM_GSBI1_PHYS + PAGE_SIZE - 1,
143 .name = "gsbi_resource",
144 .flags = IORESOURCE_MEM,
145 },
146};
147
148struct platform_device apq8064_device_uart_gsbi1 = {
149 .name = "msm_serial_hsl",
Jin Hong4bbbfba2012-02-02 21:48:07 -0800150 .id = 1,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700151 .num_resources = ARRAY_SIZE(resources_uart_gsbi1),
152 .resource = resources_uart_gsbi1,
153};
154
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700155static struct resource resources_uart_gsbi3[] = {
156 {
157 .start = GSBI3_UARTDM_IRQ,
158 .end = GSBI3_UARTDM_IRQ,
159 .flags = IORESOURCE_IRQ,
160 },
161 {
162 .start = MSM_UART3DM_PHYS,
163 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
164 .name = "uartdm_resource",
165 .flags = IORESOURCE_MEM,
166 },
167 {
168 .start = MSM_GSBI3_PHYS,
169 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
170 .name = "gsbi_resource",
171 .flags = IORESOURCE_MEM,
172 },
173};
174
175struct platform_device apq8064_device_uart_gsbi3 = {
176 .name = "msm_serial_hsl",
177 .id = 0,
178 .num_resources = ARRAY_SIZE(resources_uart_gsbi3),
179 .resource = resources_uart_gsbi3,
180};
181
Jing Lin04601f92012-02-05 15:36:07 -0800182static struct resource resources_qup_i2c_gsbi3[] = {
183 {
184 .name = "gsbi_qup_i2c_addr",
185 .start = MSM_GSBI3_PHYS,
186 .end = MSM_GSBI3_PHYS + 4 - 1,
187 .flags = IORESOURCE_MEM,
188 },
189 {
190 .name = "qup_phys_addr",
191 .start = MSM_GSBI3_QUP_PHYS,
192 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
193 .flags = IORESOURCE_MEM,
194 },
195 {
196 .name = "qup_err_intr",
197 .start = GSBI3_QUP_IRQ,
198 .end = GSBI3_QUP_IRQ,
199 .flags = IORESOURCE_IRQ,
200 },
201 {
202 .name = "i2c_clk",
203 .start = 9,
204 .end = 9,
205 .flags = IORESOURCE_IO,
206 },
207 {
208 .name = "i2c_sda",
209 .start = 8,
210 .end = 8,
211 .flags = IORESOURCE_IO,
212 },
213};
214
David Keitel3c40fc52012-02-09 17:53:52 -0800215static struct resource resources_qup_i2c_gsbi1[] = {
216 {
217 .name = "gsbi_qup_i2c_addr",
218 .start = MSM_GSBI1_PHYS,
219 .end = MSM_GSBI1_PHYS + 4 - 1,
220 .flags = IORESOURCE_MEM,
221 },
222 {
223 .name = "qup_phys_addr",
224 .start = MSM_GSBI1_QUP_PHYS,
225 .end = MSM_GSBI1_QUP_PHYS + MSM_QUP_SIZE - 1,
226 .flags = IORESOURCE_MEM,
227 },
228 {
229 .name = "qup_err_intr",
230 .start = APQ8064_GSBI1_QUP_IRQ,
231 .end = APQ8064_GSBI1_QUP_IRQ,
232 .flags = IORESOURCE_IRQ,
233 },
234 {
235 .name = "i2c_clk",
236 .start = 21,
237 .end = 21,
238 .flags = IORESOURCE_IO,
239 },
240 {
241 .name = "i2c_sda",
242 .start = 20,
243 .end = 20,
244 .flags = IORESOURCE_IO,
245 },
246};
247
248struct platform_device apq8064_device_qup_i2c_gsbi1 = {
249 .name = "qup_i2c",
250 .id = 0,
251 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi1),
252 .resource = resources_qup_i2c_gsbi1,
253};
254
Jing Lin04601f92012-02-05 15:36:07 -0800255struct platform_device apq8064_device_qup_i2c_gsbi3 = {
256 .name = "qup_i2c",
257 .id = 3,
258 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
259 .resource = resources_qup_i2c_gsbi3,
260};
261
Kenneth Heitke748593a2011-07-15 15:45:11 -0600262static struct resource resources_qup_i2c_gsbi4[] = {
263 {
264 .name = "gsbi_qup_i2c_addr",
265 .start = MSM_GSBI4_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600266 .end = MSM_GSBI4_PHYS + 4 - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600267 .flags = IORESOURCE_MEM,
268 },
269 {
270 .name = "qup_phys_addr",
271 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600272 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600273 .flags = IORESOURCE_MEM,
274 },
275 {
276 .name = "qup_err_intr",
277 .start = GSBI4_QUP_IRQ,
278 .end = GSBI4_QUP_IRQ,
279 .flags = IORESOURCE_IRQ,
280 },
Kevin Chand07220e2012-02-13 15:52:22 -0800281 {
282 .name = "i2c_clk",
283 .start = 11,
284 .end = 11,
285 .flags = IORESOURCE_IO,
286 },
287 {
288 .name = "i2c_sda",
289 .start = 10,
290 .end = 10,
291 .flags = IORESOURCE_IO,
292 },
Kenneth Heitke748593a2011-07-15 15:45:11 -0600293};
294
295struct platform_device apq8064_device_qup_i2c_gsbi4 = {
296 .name = "qup_i2c",
297 .id = 4,
298 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
299 .resource = resources_qup_i2c_gsbi4,
300};
301
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700302static struct resource resources_qup_spi_gsbi5[] = {
303 {
304 .name = "spi_base",
305 .start = MSM_GSBI5_QUP_PHYS,
306 .end = MSM_GSBI5_QUP_PHYS + SZ_4K - 1,
307 .flags = IORESOURCE_MEM,
308 },
309 {
310 .name = "gsbi_base",
311 .start = MSM_GSBI5_PHYS,
312 .end = MSM_GSBI5_PHYS + 4 - 1,
313 .flags = IORESOURCE_MEM,
314 },
315 {
316 .name = "spi_irq_in",
317 .start = GSBI5_QUP_IRQ,
318 .end = GSBI5_QUP_IRQ,
319 .flags = IORESOURCE_IRQ,
320 },
321};
322
323struct platform_device apq8064_device_qup_spi_gsbi5 = {
324 .name = "spi_qsd",
325 .id = 0,
326 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi5),
327 .resource = resources_qup_spi_gsbi5,
328};
329
Joel King8f839b92012-04-01 14:37:46 -0700330static struct resource resources_qup_i2c_gsbi5[] = {
331 {
332 .name = "gsbi_qup_i2c_addr",
333 .start = MSM_GSBI5_PHYS,
334 .end = MSM_GSBI5_PHYS + 4 - 1,
335 .flags = IORESOURCE_MEM,
336 },
337 {
338 .name = "qup_phys_addr",
339 .start = MSM_GSBI5_QUP_PHYS,
340 .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
341 .flags = IORESOURCE_MEM,
342 },
343 {
344 .name = "qup_err_intr",
345 .start = GSBI5_QUP_IRQ,
346 .end = GSBI5_QUP_IRQ,
347 .flags = IORESOURCE_IRQ,
348 },
349 {
350 .name = "i2c_clk",
351 .start = 54,
352 .end = 54,
353 .flags = IORESOURCE_IO,
354 },
355 {
356 .name = "i2c_sda",
357 .start = 53,
358 .end = 53,
359 .flags = IORESOURCE_IO,
360 },
361};
362
363struct platform_device mpq8064_device_qup_i2c_gsbi5 = {
364 .name = "qup_i2c",
365 .id = 5,
366 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
367 .resource = resources_qup_i2c_gsbi5,
368};
369
Jin Hong4bbbfba2012-02-02 21:48:07 -0800370static struct resource resources_uart_gsbi7[] = {
371 {
372 .start = GSBI7_UARTDM_IRQ,
373 .end = GSBI7_UARTDM_IRQ,
374 .flags = IORESOURCE_IRQ,
375 },
376 {
377 .start = MSM_UART7DM_PHYS,
378 .end = MSM_UART7DM_PHYS + PAGE_SIZE - 1,
379 .name = "uartdm_resource",
380 .flags = IORESOURCE_MEM,
381 },
382 {
383 .start = MSM_GSBI7_PHYS,
384 .end = MSM_GSBI7_PHYS + PAGE_SIZE - 1,
385 .name = "gsbi_resource",
386 .flags = IORESOURCE_MEM,
387 },
388};
389
390struct platform_device apq8064_device_uart_gsbi7 = {
391 .name = "msm_serial_hsl",
392 .id = 0,
393 .num_resources = ARRAY_SIZE(resources_uart_gsbi7),
394 .resource = resources_uart_gsbi7,
395};
396
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800397struct platform_device apq_pcm = {
398 .name = "msm-pcm-dsp",
399 .id = -1,
400};
401
402struct platform_device apq_pcm_routing = {
403 .name = "msm-pcm-routing",
404 .id = -1,
405};
406
407struct platform_device apq_cpudai0 = {
408 .name = "msm-dai-q6",
409 .id = 0x4000,
410};
411
412struct platform_device apq_cpudai1 = {
413 .name = "msm-dai-q6",
414 .id = 0x4001,
415};
Santosh Mardieff9a742012-04-09 23:23:39 +0530416struct platform_device mpq_cpudai_sec_i2s_rx = {
417 .name = "msm-dai-q6",
418 .id = 4,
419};
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800420struct platform_device apq_cpudai_hdmi_rx = {
Swaminathan Sathappanfd9dbad2012-02-15 16:56:44 -0800421 .name = "msm-dai-q6-hdmi",
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800422 .id = 8,
423};
424
425struct platform_device apq_cpudai_bt_rx = {
426 .name = "msm-dai-q6",
427 .id = 0x3000,
428};
429
430struct platform_device apq_cpudai_bt_tx = {
431 .name = "msm-dai-q6",
432 .id = 0x3001,
433};
434
435struct platform_device apq_cpudai_fm_rx = {
436 .name = "msm-dai-q6",
437 .id = 0x3004,
438};
439
440struct platform_device apq_cpudai_fm_tx = {
441 .name = "msm-dai-q6",
442 .id = 0x3005,
443};
444
Helen Zeng8f925502012-03-05 16:50:17 -0800445struct platform_device apq_cpudai_slim_4_rx = {
446 .name = "msm-dai-q6",
447 .id = 0x4008,
448};
449
450struct platform_device apq_cpudai_slim_4_tx = {
451 .name = "msm-dai-q6",
452 .id = 0x4009,
453};
454
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800455/*
456 * Machine specific data for AUX PCM Interface
457 * which the driver will be unware of.
458 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800459struct msm_dai_auxpcm_pdata apq_auxpcm_pdata = {
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800460 .clk = "pcm_clk",
461 .mode = AFE_PCM_CFG_MODE_PCM,
462 .sync = AFE_PCM_CFG_SYNC_INT,
463 .frame = AFE_PCM_CFG_FRM_256BPF,
464 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
465 .slot = 0,
466 .data = AFE_PCM_CFG_CDATAOE_MASTER,
467 .pcm_clk_rate = 2048000,
468};
469
470struct platform_device apq_cpudai_auxpcm_rx = {
471 .name = "msm-dai-q6",
472 .id = 2,
473 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800474 .platform_data = &apq_auxpcm_pdata,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800475 },
476};
477
478struct platform_device apq_cpudai_auxpcm_tx = {
479 .name = "msm-dai-q6",
480 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800481 .dev = {
482 .platform_data = &apq_auxpcm_pdata,
483 },
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800484};
485
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700486struct msm_mi2s_data mpq_mi2s_tx_data = {
487 .sd_lines = MSM_MI2S_SD0 | MSM_MI2S_SD1 | MSM_MI2S_SD2 | MSM_MI2S_SD3,
488 .capability = MSM_MI2S_CAP_TX,
489};
490
491struct platform_device mpq_cpudai_mi2s_tx = {
492 .name = "msm-dai-q6",
493 .id = 7, /*MI2S_TX */
494 .dev = {
495 .platform_data = &mpq_mi2s_tx_data,
496 },
497};
498
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800499struct platform_device apq_cpu_fe = {
500 .name = "msm-dai-fe",
501 .id = -1,
502};
503
504struct platform_device apq_stub_codec = {
505 .name = "msm-stub-codec",
506 .id = 1,
507};
508
509struct platform_device apq_voice = {
510 .name = "msm-pcm-voice",
511 .id = -1,
512};
513
514struct platform_device apq_voip = {
515 .name = "msm-voip-dsp",
516 .id = -1,
517};
518
519struct platform_device apq_lpa_pcm = {
520 .name = "msm-pcm-lpa",
521 .id = -1,
522};
523
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -0700524struct platform_device apq_compr_dsp = {
525 .name = "msm-compr-dsp",
526 .id = -1,
527};
528
529struct platform_device apq_multi_ch_pcm = {
530 .name = "msm-multi-ch-pcm-dsp",
531 .id = -1,
532};
533
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800534struct platform_device apq_pcm_hostless = {
535 .name = "msm-pcm-hostless",
536 .id = -1,
537};
538
539struct platform_device apq_cpudai_afe_01_rx = {
540 .name = "msm-dai-q6",
541 .id = 0xE0,
542};
543
544struct platform_device apq_cpudai_afe_01_tx = {
545 .name = "msm-dai-q6",
546 .id = 0xF0,
547};
548
549struct platform_device apq_cpudai_afe_02_rx = {
550 .name = "msm-dai-q6",
551 .id = 0xF1,
552};
553
554struct platform_device apq_cpudai_afe_02_tx = {
555 .name = "msm-dai-q6",
556 .id = 0xE1,
557};
558
559struct platform_device apq_pcm_afe = {
560 .name = "msm-pcm-afe",
561 .id = -1,
562};
563
Neema Shetty8427c262012-02-16 11:23:43 -0800564struct platform_device apq_cpudai_stub = {
565 .name = "msm-dai-stub",
566 .id = -1,
567};
568
Neema Shetty3c9d2862012-03-11 01:25:32 -0800569struct platform_device apq_cpudai_slimbus_1_rx = {
570 .name = "msm-dai-q6",
571 .id = 0x4002,
572};
573
574struct platform_device apq_cpudai_slimbus_1_tx = {
575 .name = "msm-dai-q6",
576 .id = 0x4003,
577};
578
Kiran Kandi1e6371d2012-03-29 11:48:57 -0700579struct platform_device apq_cpudai_slimbus_2_tx = {
580 .name = "msm-dai-q6",
581 .id = 0x4005,
582};
583
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700584static struct resource resources_ssbi_pmic1[] = {
585 {
586 .start = MSM_PMIC1_SSBI_CMD_PHYS,
587 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
588 .flags = IORESOURCE_MEM,
589 },
590};
591
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600592#define LPASS_SLIMBUS_PHYS 0x28080000
593#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800594#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600595/* Board info for the slimbus slave device */
596static struct resource slimbus_res[] = {
597 {
598 .start = LPASS_SLIMBUS_PHYS,
599 .end = LPASS_SLIMBUS_PHYS + 8191,
600 .flags = IORESOURCE_MEM,
601 .name = "slimbus_physical",
602 },
603 {
604 .start = LPASS_SLIMBUS_BAM_PHYS,
605 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
606 .flags = IORESOURCE_MEM,
607 .name = "slimbus_bam_physical",
608 },
609 {
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800610 .start = LPASS_SLIMBUS_SLEW,
611 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
612 .flags = IORESOURCE_MEM,
613 .name = "slimbus_slew_reg",
614 },
615 {
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600616 .start = SLIMBUS0_CORE_EE1_IRQ,
617 .end = SLIMBUS0_CORE_EE1_IRQ,
618 .flags = IORESOURCE_IRQ,
619 .name = "slimbus_irq",
620 },
621 {
622 .start = SLIMBUS0_BAM_EE1_IRQ,
623 .end = SLIMBUS0_BAM_EE1_IRQ,
624 .flags = IORESOURCE_IRQ,
625 .name = "slimbus_bam_irq",
626 },
627};
628
629struct platform_device apq8064_slim_ctrl = {
630 .name = "msm_slim_ctrl",
631 .id = 1,
632 .num_resources = ARRAY_SIZE(slimbus_res),
633 .resource = slimbus_res,
634 .dev = {
635 .coherent_dma_mask = 0xffffffffULL,
636 },
637};
638
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700639struct platform_device apq8064_device_ssbi_pmic1 = {
640 .name = "msm_ssbi",
641 .id = 0,
642 .resource = resources_ssbi_pmic1,
643 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
644};
645
646static struct resource resources_ssbi_pmic2[] = {
647 {
648 .start = MSM_PMIC2_SSBI_CMD_PHYS,
649 .end = MSM_PMIC2_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
650 .flags = IORESOURCE_MEM,
651 },
652};
653
654struct platform_device apq8064_device_ssbi_pmic2 = {
655 .name = "msm_ssbi",
656 .id = 1,
657 .resource = resources_ssbi_pmic2,
658 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2),
659};
660
661static struct resource resources_otg[] = {
662 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800663 .start = MSM_HSUSB1_PHYS,
664 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700665 .flags = IORESOURCE_MEM,
666 },
667 {
668 .start = USB1_HS_IRQ,
669 .end = USB1_HS_IRQ,
670 .flags = IORESOURCE_IRQ,
671 },
672};
673
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700674struct platform_device apq8064_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700675 .name = "msm_otg",
676 .id = -1,
677 .num_resources = ARRAY_SIZE(resources_otg),
678 .resource = resources_otg,
679 .dev = {
680 .coherent_dma_mask = 0xffffffff,
681 },
682};
683
684static struct resource resources_hsusb[] = {
685 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800686 .start = MSM_HSUSB1_PHYS,
687 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700688 .flags = IORESOURCE_MEM,
689 },
690 {
691 .start = USB1_HS_IRQ,
692 .end = USB1_HS_IRQ,
693 .flags = IORESOURCE_IRQ,
694 },
695};
696
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700697struct platform_device apq8064_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700698 .name = "msm_hsusb",
699 .id = -1,
700 .num_resources = ARRAY_SIZE(resources_hsusb),
701 .resource = resources_hsusb,
702 .dev = {
703 .coherent_dma_mask = 0xffffffff,
704 },
705};
706
Hemant Kumard86c4882012-01-24 19:39:37 -0800707static struct resource resources_hsusb_host[] = {
708 {
709 .start = MSM_HSUSB1_PHYS,
710 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
711 .flags = IORESOURCE_MEM,
712 },
713 {
714 .start = USB1_HS_IRQ,
715 .end = USB1_HS_IRQ,
716 .flags = IORESOURCE_IRQ,
717 },
718};
719
Hemant Kumara945b472012-01-25 15:08:06 -0800720static struct resource resources_hsic_host[] = {
721 {
722 .start = 0x12510000,
723 .end = 0x12510000 + SZ_4K - 1,
724 .flags = IORESOURCE_MEM,
725 },
726 {
727 .start = USB2_HSIC_IRQ,
728 .end = USB2_HSIC_IRQ,
729 .flags = IORESOURCE_IRQ,
730 },
731 {
732 .start = MSM_GPIO_TO_INT(49),
733 .end = MSM_GPIO_TO_INT(49),
734 .name = "peripheral_status_irq",
735 .flags = IORESOURCE_IRQ,
736 },
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800737 {
738 .start = MSM_GPIO_TO_INT(88),
739 .end = MSM_GPIO_TO_INT(88),
740 .name = "wakeup_irq",
741 .flags = IORESOURCE_IRQ,
742 },
Hemant Kumara945b472012-01-25 15:08:06 -0800743};
744
Hemant Kumard86c4882012-01-24 19:39:37 -0800745static u64 dma_mask = DMA_BIT_MASK(32);
746struct platform_device apq8064_device_hsusb_host = {
747 .name = "msm_hsusb_host",
748 .id = -1,
749 .num_resources = ARRAY_SIZE(resources_hsusb_host),
750 .resource = resources_hsusb_host,
751 .dev = {
752 .dma_mask = &dma_mask,
753 .coherent_dma_mask = 0xffffffff,
754 },
755};
756
Hemant Kumara945b472012-01-25 15:08:06 -0800757struct platform_device apq8064_device_hsic_host = {
758 .name = "msm_hsic_host",
759 .id = -1,
760 .num_resources = ARRAY_SIZE(resources_hsic_host),
761 .resource = resources_hsic_host,
762 .dev = {
763 .dma_mask = &dma_mask,
764 .coherent_dma_mask = DMA_BIT_MASK(32),
765 },
766};
767
Manu Gautam91223e02011-11-08 15:27:22 +0530768static struct resource resources_ehci_host3[] = {
769{
770 .start = MSM_HSUSB3_PHYS,
771 .end = MSM_HSUSB3_PHYS + MSM_HSUSB3_SIZE - 1,
772 .flags = IORESOURCE_MEM,
773 },
774 {
775 .start = USB3_HS_IRQ,
776 .end = USB3_HS_IRQ,
777 .flags = IORESOURCE_IRQ,
778 },
779};
780
781struct platform_device apq8064_device_ehci_host3 = {
782 .name = "msm_ehci_host",
783 .id = 0,
784 .num_resources = ARRAY_SIZE(resources_ehci_host3),
785 .resource = resources_ehci_host3,
786 .dev = {
787 .dma_mask = &dma_mask,
788 .coherent_dma_mask = 0xffffffff,
789 },
790};
791
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800792static struct resource resources_ehci_host4[] = {
793{
794 .start = MSM_HSUSB4_PHYS,
795 .end = MSM_HSUSB4_PHYS + MSM_HSUSB4_SIZE - 1,
796 .flags = IORESOURCE_MEM,
797 },
798 {
799 .start = USB4_HS_IRQ,
800 .end = USB4_HS_IRQ,
801 .flags = IORESOURCE_IRQ,
802 },
803};
804
805struct platform_device apq8064_device_ehci_host4 = {
806 .name = "msm_ehci_host",
807 .id = 1,
808 .num_resources = ARRAY_SIZE(resources_ehci_host4),
809 .resource = resources_ehci_host4,
810 .dev = {
811 .dma_mask = &dma_mask,
812 .coherent_dma_mask = 0xffffffff,
813 },
814};
815
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -0800816/* MSM Video core device */
817#ifdef CONFIG_MSM_BUS_SCALING
818static struct msm_bus_vectors vidc_init_vectors[] = {
819 {
820 .src = MSM_BUS_MASTER_VIDEO_ENC,
821 .dst = MSM_BUS_SLAVE_EBI_CH0,
822 .ab = 0,
823 .ib = 0,
824 },
825 {
826 .src = MSM_BUS_MASTER_VIDEO_DEC,
827 .dst = MSM_BUS_SLAVE_EBI_CH0,
828 .ab = 0,
829 .ib = 0,
830 },
831 {
832 .src = MSM_BUS_MASTER_AMPSS_M0,
833 .dst = MSM_BUS_SLAVE_EBI_CH0,
834 .ab = 0,
835 .ib = 0,
836 },
837 {
838 .src = MSM_BUS_MASTER_AMPSS_M0,
839 .dst = MSM_BUS_SLAVE_EBI_CH0,
840 .ab = 0,
841 .ib = 0,
842 },
843};
844static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
845 {
846 .src = MSM_BUS_MASTER_VIDEO_ENC,
847 .dst = MSM_BUS_SLAVE_EBI_CH0,
848 .ab = 54525952,
849 .ib = 436207616,
850 },
851 {
852 .src = MSM_BUS_MASTER_VIDEO_DEC,
853 .dst = MSM_BUS_SLAVE_EBI_CH0,
854 .ab = 72351744,
855 .ib = 289406976,
856 },
857 {
858 .src = MSM_BUS_MASTER_AMPSS_M0,
859 .dst = MSM_BUS_SLAVE_EBI_CH0,
860 .ab = 500000,
861 .ib = 1000000,
862 },
863 {
864 .src = MSM_BUS_MASTER_AMPSS_M0,
865 .dst = MSM_BUS_SLAVE_EBI_CH0,
866 .ab = 500000,
867 .ib = 1000000,
868 },
869};
870static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
871 {
872 .src = MSM_BUS_MASTER_VIDEO_ENC,
873 .dst = MSM_BUS_SLAVE_EBI_CH0,
874 .ab = 40894464,
875 .ib = 327155712,
876 },
877 {
878 .src = MSM_BUS_MASTER_VIDEO_DEC,
879 .dst = MSM_BUS_SLAVE_EBI_CH0,
880 .ab = 48234496,
881 .ib = 192937984,
882 },
883 {
884 .src = MSM_BUS_MASTER_AMPSS_M0,
885 .dst = MSM_BUS_SLAVE_EBI_CH0,
886 .ab = 500000,
887 .ib = 2000000,
888 },
889 {
890 .src = MSM_BUS_MASTER_AMPSS_M0,
891 .dst = MSM_BUS_SLAVE_EBI_CH0,
892 .ab = 500000,
893 .ib = 2000000,
894 },
895};
896static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
897 {
898 .src = MSM_BUS_MASTER_VIDEO_ENC,
899 .dst = MSM_BUS_SLAVE_EBI_CH0,
900 .ab = 163577856,
901 .ib = 1308622848,
902 },
903 {
904 .src = MSM_BUS_MASTER_VIDEO_DEC,
905 .dst = MSM_BUS_SLAVE_EBI_CH0,
906 .ab = 219152384,
907 .ib = 876609536,
908 },
909 {
910 .src = MSM_BUS_MASTER_AMPSS_M0,
911 .dst = MSM_BUS_SLAVE_EBI_CH0,
912 .ab = 1750000,
913 .ib = 3500000,
914 },
915 {
916 .src = MSM_BUS_MASTER_AMPSS_M0,
917 .dst = MSM_BUS_SLAVE_EBI_CH0,
918 .ab = 1750000,
919 .ib = 3500000,
920 },
921};
922static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
923 {
924 .src = MSM_BUS_MASTER_VIDEO_ENC,
925 .dst = MSM_BUS_SLAVE_EBI_CH0,
926 .ab = 121634816,
927 .ib = 973078528,
928 },
929 {
930 .src = MSM_BUS_MASTER_VIDEO_DEC,
931 .dst = MSM_BUS_SLAVE_EBI_CH0,
932 .ab = 155189248,
933 .ib = 620756992,
934 },
935 {
936 .src = MSM_BUS_MASTER_AMPSS_M0,
937 .dst = MSM_BUS_SLAVE_EBI_CH0,
938 .ab = 1750000,
939 .ib = 7000000,
940 },
941 {
942 .src = MSM_BUS_MASTER_AMPSS_M0,
943 .dst = MSM_BUS_SLAVE_EBI_CH0,
944 .ab = 1750000,
945 .ib = 7000000,
946 },
947};
948static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
949 {
950 .src = MSM_BUS_MASTER_VIDEO_ENC,
951 .dst = MSM_BUS_SLAVE_EBI_CH0,
952 .ab = 372244480,
953 .ib = 2560000000U,
954 },
955 {
956 .src = MSM_BUS_MASTER_VIDEO_DEC,
957 .dst = MSM_BUS_SLAVE_EBI_CH0,
958 .ab = 501219328,
959 .ib = 2560000000U,
960 },
961 {
962 .src = MSM_BUS_MASTER_AMPSS_M0,
963 .dst = MSM_BUS_SLAVE_EBI_CH0,
964 .ab = 2500000,
965 .ib = 5000000,
966 },
967 {
968 .src = MSM_BUS_MASTER_AMPSS_M0,
969 .dst = MSM_BUS_SLAVE_EBI_CH0,
970 .ab = 2500000,
971 .ib = 5000000,
972 },
973};
974static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
975 {
976 .src = MSM_BUS_MASTER_VIDEO_ENC,
977 .dst = MSM_BUS_SLAVE_EBI_CH0,
978 .ab = 222298112,
979 .ib = 2560000000U,
980 },
981 {
982 .src = MSM_BUS_MASTER_VIDEO_DEC,
983 .dst = MSM_BUS_SLAVE_EBI_CH0,
984 .ab = 330301440,
985 .ib = 2560000000U,
986 },
987 {
988 .src = MSM_BUS_MASTER_AMPSS_M0,
989 .dst = MSM_BUS_SLAVE_EBI_CH0,
990 .ab = 2500000,
991 .ib = 700000000,
992 },
993 {
994 .src = MSM_BUS_MASTER_AMPSS_M0,
995 .dst = MSM_BUS_SLAVE_EBI_CH0,
996 .ab = 2500000,
997 .ib = 10000000,
998 },
999};
1000
1001static struct msm_bus_paths vidc_bus_client_config[] = {
1002 {
1003 ARRAY_SIZE(vidc_init_vectors),
1004 vidc_init_vectors,
1005 },
1006 {
1007 ARRAY_SIZE(vidc_venc_vga_vectors),
1008 vidc_venc_vga_vectors,
1009 },
1010 {
1011 ARRAY_SIZE(vidc_vdec_vga_vectors),
1012 vidc_vdec_vga_vectors,
1013 },
1014 {
1015 ARRAY_SIZE(vidc_venc_720p_vectors),
1016 vidc_venc_720p_vectors,
1017 },
1018 {
1019 ARRAY_SIZE(vidc_vdec_720p_vectors),
1020 vidc_vdec_720p_vectors,
1021 },
1022 {
1023 ARRAY_SIZE(vidc_venc_1080p_vectors),
1024 vidc_venc_1080p_vectors,
1025 },
1026 {
1027 ARRAY_SIZE(vidc_vdec_1080p_vectors),
1028 vidc_vdec_1080p_vectors,
1029 },
1030};
1031
1032static struct msm_bus_scale_pdata vidc_bus_client_data = {
1033 vidc_bus_client_config,
1034 ARRAY_SIZE(vidc_bus_client_config),
1035 .name = "vidc",
1036};
1037#endif
1038
1039
1040#define APQ8064_VIDC_BASE_PHYS 0x04400000
1041#define APQ8064_VIDC_BASE_SIZE 0x00100000
1042
1043static struct resource apq8064_device_vidc_resources[] = {
1044 {
1045 .start = APQ8064_VIDC_BASE_PHYS,
1046 .end = APQ8064_VIDC_BASE_PHYS + APQ8064_VIDC_BASE_SIZE - 1,
1047 .flags = IORESOURCE_MEM,
1048 },
1049 {
1050 .start = VCODEC_IRQ,
1051 .end = VCODEC_IRQ,
1052 .flags = IORESOURCE_IRQ,
1053 },
1054};
1055
1056struct msm_vidc_platform_data apq8064_vidc_platform_data = {
1057#ifdef CONFIG_MSM_BUS_SCALING
1058 .vidc_bus_client_pdata = &vidc_bus_client_data,
1059#endif
1060#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1061 .memtype = ION_CP_MM_HEAP_ID,
1062 .enable_ion = 1,
1063#else
1064 .memtype = MEMTYPE_EBI1,
1065 .enable_ion = 0,
1066#endif
1067 .disable_dmx = 0,
1068 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08001069 .cont_mode_dpb_count = 18,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001070};
1071
1072struct platform_device apq8064_msm_device_vidc = {
1073 .name = "msm_vidc",
1074 .id = 0,
1075 .num_resources = ARRAY_SIZE(apq8064_device_vidc_resources),
1076 .resource = apq8064_device_vidc_resources,
1077 .dev = {
1078 .platform_data = &apq8064_vidc_platform_data,
1079 },
1080};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001081#define MSM_SDC1_BASE 0x12400000
1082#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1083#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1084#define MSM_SDC2_BASE 0x12140000
1085#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1086#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1087#define MSM_SDC3_BASE 0x12180000
1088#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1089#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1090#define MSM_SDC4_BASE 0x121C0000
1091#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1092#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1093
1094static struct resource resources_sdc1[] = {
1095 {
1096 .name = "core_mem",
1097 .flags = IORESOURCE_MEM,
1098 .start = MSM_SDC1_BASE,
1099 .end = MSM_SDC1_DML_BASE - 1,
1100 },
1101 {
1102 .name = "core_irq",
1103 .flags = IORESOURCE_IRQ,
1104 .start = SDC1_IRQ_0,
1105 .end = SDC1_IRQ_0
1106 },
1107#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1108 {
1109 .name = "sdcc_dml_addr",
1110 .start = MSM_SDC1_DML_BASE,
1111 .end = MSM_SDC1_BAM_BASE - 1,
1112 .flags = IORESOURCE_MEM,
1113 },
1114 {
1115 .name = "sdcc_bam_addr",
1116 .start = MSM_SDC1_BAM_BASE,
1117 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1118 .flags = IORESOURCE_MEM,
1119 },
1120 {
1121 .name = "sdcc_bam_irq",
1122 .start = SDC1_BAM_IRQ,
1123 .end = SDC1_BAM_IRQ,
1124 .flags = IORESOURCE_IRQ,
1125 },
1126#endif
1127};
1128
1129static struct resource resources_sdc2[] = {
1130 {
1131 .name = "core_mem",
1132 .flags = IORESOURCE_MEM,
1133 .start = MSM_SDC2_BASE,
1134 .end = MSM_SDC2_DML_BASE - 1,
1135 },
1136 {
1137 .name = "core_irq",
1138 .flags = IORESOURCE_IRQ,
1139 .start = SDC2_IRQ_0,
1140 .end = SDC2_IRQ_0
1141 },
1142#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1143 {
1144 .name = "sdcc_dml_addr",
1145 .start = MSM_SDC2_DML_BASE,
1146 .end = MSM_SDC2_BAM_BASE - 1,
1147 .flags = IORESOURCE_MEM,
1148 },
1149 {
1150 .name = "sdcc_bam_addr",
1151 .start = MSM_SDC2_BAM_BASE,
1152 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1153 .flags = IORESOURCE_MEM,
1154 },
1155 {
1156 .name = "sdcc_bam_irq",
1157 .start = SDC2_BAM_IRQ,
1158 .end = SDC2_BAM_IRQ,
1159 .flags = IORESOURCE_IRQ,
1160 },
1161#endif
1162};
1163
1164static struct resource resources_sdc3[] = {
1165 {
1166 .name = "core_mem",
1167 .flags = IORESOURCE_MEM,
1168 .start = MSM_SDC3_BASE,
1169 .end = MSM_SDC3_DML_BASE - 1,
1170 },
1171 {
1172 .name = "core_irq",
1173 .flags = IORESOURCE_IRQ,
1174 .start = SDC3_IRQ_0,
1175 .end = SDC3_IRQ_0
1176 },
1177#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1178 {
1179 .name = "sdcc_dml_addr",
1180 .start = MSM_SDC3_DML_BASE,
1181 .end = MSM_SDC3_BAM_BASE - 1,
1182 .flags = IORESOURCE_MEM,
1183 },
1184 {
1185 .name = "sdcc_bam_addr",
1186 .start = MSM_SDC3_BAM_BASE,
1187 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1188 .flags = IORESOURCE_MEM,
1189 },
1190 {
1191 .name = "sdcc_bam_irq",
1192 .start = SDC3_BAM_IRQ,
1193 .end = SDC3_BAM_IRQ,
1194 .flags = IORESOURCE_IRQ,
1195 },
1196#endif
1197};
1198
1199static struct resource resources_sdc4[] = {
1200 {
1201 .name = "core_mem",
1202 .flags = IORESOURCE_MEM,
1203 .start = MSM_SDC4_BASE,
1204 .end = MSM_SDC4_DML_BASE - 1,
1205 },
1206 {
1207 .name = "core_irq",
1208 .flags = IORESOURCE_IRQ,
1209 .start = SDC4_IRQ_0,
1210 .end = SDC4_IRQ_0
1211 },
1212#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1213 {
1214 .name = "sdcc_dml_addr",
1215 .start = MSM_SDC4_DML_BASE,
1216 .end = MSM_SDC4_BAM_BASE - 1,
1217 .flags = IORESOURCE_MEM,
1218 },
1219 {
1220 .name = "sdcc_bam_addr",
1221 .start = MSM_SDC4_BAM_BASE,
1222 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1223 .flags = IORESOURCE_MEM,
1224 },
1225 {
1226 .name = "sdcc_bam_irq",
1227 .start = SDC4_BAM_IRQ,
1228 .end = SDC4_BAM_IRQ,
1229 .flags = IORESOURCE_IRQ,
1230 },
1231#endif
1232};
1233
1234struct platform_device apq8064_device_sdc1 = {
1235 .name = "msm_sdcc",
1236 .id = 1,
1237 .num_resources = ARRAY_SIZE(resources_sdc1),
1238 .resource = resources_sdc1,
1239 .dev = {
1240 .coherent_dma_mask = 0xffffffff,
1241 },
1242};
1243
1244struct platform_device apq8064_device_sdc2 = {
1245 .name = "msm_sdcc",
1246 .id = 2,
1247 .num_resources = ARRAY_SIZE(resources_sdc2),
1248 .resource = resources_sdc2,
1249 .dev = {
1250 .coherent_dma_mask = 0xffffffff,
1251 },
1252};
1253
1254struct platform_device apq8064_device_sdc3 = {
1255 .name = "msm_sdcc",
1256 .id = 3,
1257 .num_resources = ARRAY_SIZE(resources_sdc3),
1258 .resource = resources_sdc3,
1259 .dev = {
1260 .coherent_dma_mask = 0xffffffff,
1261 },
1262};
1263
1264struct platform_device apq8064_device_sdc4 = {
1265 .name = "msm_sdcc",
1266 .id = 4,
1267 .num_resources = ARRAY_SIZE(resources_sdc4),
1268 .resource = resources_sdc4,
1269 .dev = {
1270 .coherent_dma_mask = 0xffffffff,
1271 },
1272};
1273
1274static struct platform_device *apq8064_sdcc_devices[] __initdata = {
1275 &apq8064_device_sdc1,
1276 &apq8064_device_sdc2,
1277 &apq8064_device_sdc3,
1278 &apq8064_device_sdc4,
1279};
1280
1281int __init apq8064_add_sdcc(unsigned int controller,
1282 struct mmc_platform_data *plat)
1283{
1284 struct platform_device *pdev;
1285
1286 if (!plat)
1287 return 0;
1288 if (controller < 1 || controller > 4)
1289 return -EINVAL;
1290
1291 pdev = apq8064_sdcc_devices[controller-1];
1292 pdev->dev.platform_data = plat;
1293 return platform_device_register(pdev);
1294}
1295
Yan He06913ce2011-08-26 16:33:46 -07001296static struct resource resources_sps[] = {
1297 {
1298 .name = "pipe_mem",
1299 .start = 0x12800000,
1300 .end = 0x12800000 + 0x4000 - 1,
1301 .flags = IORESOURCE_MEM,
1302 },
1303 {
1304 .name = "bamdma_dma",
1305 .start = 0x12240000,
1306 .end = 0x12240000 + 0x1000 - 1,
1307 .flags = IORESOURCE_MEM,
1308 },
1309 {
1310 .name = "bamdma_bam",
1311 .start = 0x12244000,
1312 .end = 0x12244000 + 0x4000 - 1,
1313 .flags = IORESOURCE_MEM,
1314 },
1315 {
1316 .name = "bamdma_irq",
1317 .start = SPS_BAM_DMA_IRQ,
1318 .end = SPS_BAM_DMA_IRQ,
1319 .flags = IORESOURCE_IRQ,
1320 },
1321};
1322
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001323struct platform_device msm_bus_8064_sys_fabric = {
1324 .name = "msm_bus_fabric",
1325 .id = MSM_BUS_FAB_SYSTEM,
1326};
1327struct platform_device msm_bus_8064_apps_fabric = {
1328 .name = "msm_bus_fabric",
1329 .id = MSM_BUS_FAB_APPSS,
1330};
1331struct platform_device msm_bus_8064_mm_fabric = {
1332 .name = "msm_bus_fabric",
1333 .id = MSM_BUS_FAB_MMSS,
1334};
1335struct platform_device msm_bus_8064_sys_fpb = {
1336 .name = "msm_bus_fabric",
1337 .id = MSM_BUS_FAB_SYSTEM_FPB,
1338};
1339struct platform_device msm_bus_8064_cpss_fpb = {
1340 .name = "msm_bus_fabric",
1341 .id = MSM_BUS_FAB_CPSS_FPB,
1342};
1343
Yan He06913ce2011-08-26 16:33:46 -07001344static struct msm_sps_platform_data msm_sps_pdata = {
1345 .bamdma_restricted_pipes = 0x06,
1346};
1347
1348struct platform_device msm_device_sps_apq8064 = {
1349 .name = "msm_sps",
1350 .id = -1,
1351 .num_resources = ARRAY_SIZE(resources_sps),
1352 .resource = resources_sps,
1353 .dev.platform_data = &msm_sps_pdata,
1354};
1355
Eric Holmberg023d25c2012-03-01 12:27:55 -07001356static struct resource smd_resource[] = {
1357 {
1358 .name = "a9_m2a_0",
1359 .start = INT_A9_M2A_0,
1360 .flags = IORESOURCE_IRQ,
1361 },
1362 {
1363 .name = "a9_m2a_5",
1364 .start = INT_A9_M2A_5,
1365 .flags = IORESOURCE_IRQ,
1366 },
1367 {
1368 .name = "adsp_a11",
1369 .start = INT_ADSP_A11,
1370 .flags = IORESOURCE_IRQ,
1371 },
1372 {
1373 .name = "adsp_a11_smsm",
1374 .start = INT_ADSP_A11_SMSM,
1375 .flags = IORESOURCE_IRQ,
1376 },
1377 {
1378 .name = "dsps_a11",
1379 .start = INT_DSPS_A11,
1380 .flags = IORESOURCE_IRQ,
1381 },
1382 {
1383 .name = "dsps_a11_smsm",
1384 .start = INT_DSPS_A11_SMSM,
1385 .flags = IORESOURCE_IRQ,
1386 },
1387 {
1388 .name = "wcnss_a11",
1389 .start = INT_WCNSS_A11,
1390 .flags = IORESOURCE_IRQ,
1391 },
1392 {
1393 .name = "wcnss_a11_smsm",
1394 .start = INT_WCNSS_A11_SMSM,
1395 .flags = IORESOURCE_IRQ,
1396 },
1397};
1398
1399static struct smd_subsystem_config smd_config_list[] = {
1400 {
1401 .irq_config_id = SMD_MODEM,
1402 .subsys_name = "gss",
1403 .edge = SMD_APPS_MODEM,
1404
1405 .smd_int.irq_name = "a9_m2a_0",
1406 .smd_int.flags = IRQF_TRIGGER_RISING,
1407 .smd_int.irq_id = -1,
1408 .smd_int.device_name = "smd_dev",
1409 .smd_int.dev_id = 0,
1410 .smd_int.out_bit_pos = 1 << 3,
1411 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1412 .smd_int.out_offset = 0x8,
1413
1414 .smsm_int.irq_name = "a9_m2a_5",
1415 .smsm_int.flags = IRQF_TRIGGER_RISING,
1416 .smsm_int.irq_id = -1,
1417 .smsm_int.device_name = "smd_smsm",
1418 .smsm_int.dev_id = 0,
1419 .smsm_int.out_bit_pos = 1 << 4,
1420 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1421 .smsm_int.out_offset = 0x8,
1422 },
1423 {
1424 .irq_config_id = SMD_Q6,
1425 .subsys_name = "q6",
1426 .edge = SMD_APPS_QDSP,
1427
1428 .smd_int.irq_name = "adsp_a11",
1429 .smd_int.flags = IRQF_TRIGGER_RISING,
1430 .smd_int.irq_id = -1,
1431 .smd_int.device_name = "smd_dev",
1432 .smd_int.dev_id = 0,
1433 .smd_int.out_bit_pos = 1 << 15,
1434 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1435 .smd_int.out_offset = 0x8,
1436
1437 .smsm_int.irq_name = "adsp_a11_smsm",
1438 .smsm_int.flags = IRQF_TRIGGER_RISING,
1439 .smsm_int.irq_id = -1,
1440 .smsm_int.device_name = "smd_smsm",
1441 .smsm_int.dev_id = 0,
1442 .smsm_int.out_bit_pos = 1 << 14,
1443 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1444 .smsm_int.out_offset = 0x8,
1445 },
1446 {
1447 .irq_config_id = SMD_DSPS,
1448 .subsys_name = "dsps",
1449 .edge = SMD_APPS_DSPS,
1450
1451 .smd_int.irq_name = "dsps_a11",
1452 .smd_int.flags = IRQF_TRIGGER_RISING,
1453 .smd_int.irq_id = -1,
1454 .smd_int.device_name = "smd_dev",
1455 .smd_int.dev_id = 0,
1456 .smd_int.out_bit_pos = 1,
1457 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1458 .smd_int.out_offset = 0x4080,
1459
1460 .smsm_int.irq_name = "dsps_a11_smsm",
1461 .smsm_int.flags = IRQF_TRIGGER_RISING,
1462 .smsm_int.irq_id = -1,
1463 .smsm_int.device_name = "smd_smsm",
1464 .smsm_int.dev_id = 0,
1465 .smsm_int.out_bit_pos = 1,
1466 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1467 .smsm_int.out_offset = 0x4094,
1468 },
1469 {
1470 .irq_config_id = SMD_WCNSS,
1471 .subsys_name = "wcnss",
1472 .edge = SMD_APPS_WCNSS,
1473
1474 .smd_int.irq_name = "wcnss_a11",
1475 .smd_int.flags = IRQF_TRIGGER_RISING,
1476 .smd_int.irq_id = -1,
1477 .smd_int.device_name = "smd_dev",
1478 .smd_int.dev_id = 0,
1479 .smd_int.out_bit_pos = 1 << 25,
1480 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1481 .smd_int.out_offset = 0x8,
1482
1483 .smsm_int.irq_name = "wcnss_a11_smsm",
1484 .smsm_int.flags = IRQF_TRIGGER_RISING,
1485 .smsm_int.irq_id = -1,
1486 .smsm_int.device_name = "smd_smsm",
1487 .smsm_int.dev_id = 0,
1488 .smsm_int.out_bit_pos = 1 << 23,
1489 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1490 .smsm_int.out_offset = 0x8,
1491 },
1492};
1493
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001494static struct smd_subsystem_restart_config smd_ssr_config = {
1495 .disable_smsm_reset_handshake = 1,
1496};
1497
Eric Holmberg023d25c2012-03-01 12:27:55 -07001498static struct smd_platform smd_platform_data = {
1499 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1500 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001501 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001502};
1503
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001504struct platform_device msm_device_smd_apq8064 = {
1505 .name = "msm_smd",
1506 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001507 .resource = smd_resource,
1508 .num_resources = ARRAY_SIZE(smd_resource),
1509 .dev = {
1510 .platform_data = &smd_platform_data,
1511 },
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001512};
1513
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001514#ifdef CONFIG_HW_RANDOM_MSM
1515/* PRNG device */
1516#define MSM_PRNG_PHYS 0x1A500000
1517static struct resource rng_resources = {
1518 .flags = IORESOURCE_MEM,
1519 .start = MSM_PRNG_PHYS,
1520 .end = MSM_PRNG_PHYS + SZ_512 - 1,
1521};
1522
1523struct platform_device apq8064_device_rng = {
1524 .name = "msm_rng",
1525 .id = 0,
1526 .num_resources = 1,
1527 .resource = &rng_resources,
1528};
1529#endif
1530
Matt Wagantall292aace2012-01-26 19:12:34 -08001531static struct resource msm_gss_resources[] = {
1532 {
1533 .start = 0x10000000,
1534 .end = 0x10000000 + SZ_256 - 1,
1535 .flags = IORESOURCE_MEM,
1536 },
Matt Wagantall19ac4fd2012-02-03 20:18:23 -08001537 {
1538 .start = 0x10008000,
1539 .end = 0x10008000 + SZ_256 - 1,
1540 .flags = IORESOURCE_MEM,
1541 },
Matt Wagantall292aace2012-01-26 19:12:34 -08001542};
1543
1544struct platform_device msm_gss = {
1545 .name = "pil_gss",
1546 .id = -1,
1547 .num_resources = ARRAY_SIZE(msm_gss_resources),
1548 .resource = msm_gss_resources,
1549};
1550
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001551static struct fs_driver_data gfx3d_fs_data = {
1552 .clks = (struct fs_clk_data[]){
1553 { .name = "core_clk", .reset_rate = 27000000 },
1554 { .name = "iface_clk" },
1555 { .name = "bus_clk" },
1556 { 0 }
1557 },
1558 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
1559 .bus_port1 = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
Matt Wagantall1875d322012-02-22 16:11:33 -08001560};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001561
1562static struct fs_driver_data ijpeg_fs_data = {
1563 .clks = (struct fs_clk_data[]){
1564 { .name = "core_clk" },
1565 { .name = "iface_clk" },
1566 { .name = "bus_clk" },
1567 { 0 }
1568 },
1569 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
1570};
1571
1572static struct fs_driver_data rot_fs_data = {
1573 .clks = (struct fs_clk_data[]){
1574 { .name = "core_clk" },
1575 { .name = "iface_clk" },
1576 { .name = "bus_clk" },
1577 { 0 }
1578 },
1579 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
1580};
1581
1582static struct fs_driver_data ved_fs_data = {
1583 .clks = (struct fs_clk_data[]){
1584 { .name = "core_clk" },
1585 { .name = "iface_clk" },
1586 { .name = "bus_clk" },
1587 { 0 }
1588 },
1589 .bus_port0 = MSM_BUS_MASTER_VIDEO_ENC,
1590 .bus_port1 = MSM_BUS_MASTER_VIDEO_DEC,
1591};
1592
1593static struct fs_driver_data vfe_fs_data = {
1594 .clks = (struct fs_clk_data[]){
1595 { .name = "core_clk" },
1596 { .name = "iface_clk" },
1597 { .name = "bus_clk" },
1598 { 0 }
1599 },
1600 .bus_port0 = MSM_BUS_MASTER_VFE,
1601};
1602
1603static struct fs_driver_data vpe_fs_data = {
1604 .clks = (struct fs_clk_data[]){
1605 { .name = "core_clk" },
1606 { .name = "iface_clk" },
1607 { .name = "bus_clk" },
1608 { 0 }
1609 },
1610 .bus_port0 = MSM_BUS_MASTER_VPE,
1611};
1612
1613static struct fs_driver_data vcap_fs_data = {
1614 .clks = (struct fs_clk_data[]){
1615 { .name = "core_clk" },
1616 { .name = "iface_clk" },
1617 { .name = "bus_clk" },
1618 { 0 },
1619 },
1620 .bus_port0 = MSM_BUS_MASTER_VIDEO_CAP,
1621};
1622
1623struct platform_device *apq8064_footswitch[] __initdata = {
Matt Wagantall5c922112012-05-03 19:25:28 -07001624 FS_8X60(FS_ROT, "fs_rot", NULL, &rot_fs_data),
1625 FS_8X60(FS_IJPEG, "fs_ijpeg", NULL, &ijpeg_fs_data),
1626 FS_8X60(FS_VFE, "fs_vfe", NULL, &vfe_fs_data),
1627 FS_8X60(FS_VPE, "fs_vpe", NULL, &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07001628 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07001629 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall5c922112012-05-03 19:25:28 -07001630 FS_8X60(FS_VCAP, "fs_vcap", NULL, &vcap_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07001631};
1632unsigned apq8064_num_footswitch __initdata = ARRAY_SIZE(apq8064_footswitch);
Matt Wagantall1875d322012-02-22 16:11:33 -08001633
Praveen Chidambaram78499012011-11-01 17:15:17 -06001634struct msm_rpm_platform_data apq8064_rpm_data __initdata = {
1635 .reg_base_addrs = {
1636 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
1637 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
1638 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
1639 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
1640 },
1641 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08001642 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06001643 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001644 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
1645 .ipc_rpm_val = 4,
1646 .target_id = {
1647 MSM_RPM_MAP(8064, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
1648 MSM_RPM_MAP(8064, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
1649 MSM_RPM_MAP(8064, INVALIDATE_0, INVALIDATE, 8),
1650 MSM_RPM_MAP(8064, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
1651 MSM_RPM_MAP(8064, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
1652 MSM_RPM_MAP(8064, RPM_CTL, RPM_CTL, 1),
1653 MSM_RPM_MAP(8064, CXO_CLK, CXO_CLK, 1),
1654 MSM_RPM_MAP(8064, PXO_CLK, PXO_CLK, 1),
1655 MSM_RPM_MAP(8064, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
1656 MSM_RPM_MAP(8064, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
1657 MSM_RPM_MAP(8064, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
1658 MSM_RPM_MAP(8064, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
1659 MSM_RPM_MAP(8064, SFPB_CLK, SFPB_CLK, 1),
1660 MSM_RPM_MAP(8064, CFPB_CLK, CFPB_CLK, 1),
1661 MSM_RPM_MAP(8064, MMFPB_CLK, MMFPB_CLK, 1),
1662 MSM_RPM_MAP(8064, EBI1_CLK, EBI1_CLK, 1),
1663 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_HALT_0,
1664 APPS_FABRIC_CFG_HALT, 2),
1665 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_CLKMOD_0,
1666 APPS_FABRIC_CFG_CLKMOD, 3),
1667 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_IOCTL,
1668 APPS_FABRIC_CFG_IOCTL, 1),
1669 MSM_RPM_MAP(8064, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
1670 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_HALT_0,
1671 SYS_FABRIC_CFG_HALT, 2),
1672 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_CLKMOD_0,
1673 SYS_FABRIC_CFG_CLKMOD, 3),
1674 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_IOCTL,
1675 SYS_FABRIC_CFG_IOCTL, 1),
1676 MSM_RPM_MAP(8064, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 30),
1677 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_HALT_0,
1678 MMSS_FABRIC_CFG_HALT, 2),
1679 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_CLKMOD_0,
1680 MMSS_FABRIC_CFG_CLKMOD, 3),
1681 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_IOCTL,
1682 MMSS_FABRIC_CFG_IOCTL, 1),
1683 MSM_RPM_MAP(8064, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 21),
1684 MSM_RPM_MAP(8064, PM8921_S1_0, PM8921_S1, 2),
1685 MSM_RPM_MAP(8064, PM8921_S2_0, PM8921_S2, 2),
1686 MSM_RPM_MAP(8064, PM8921_S3_0, PM8921_S3, 2),
1687 MSM_RPM_MAP(8064, PM8921_S4_0, PM8921_S4, 2),
1688 MSM_RPM_MAP(8064, PM8921_S5_0, PM8921_S5, 2),
1689 MSM_RPM_MAP(8064, PM8921_S6_0, PM8921_S6, 2),
1690 MSM_RPM_MAP(8064, PM8921_S7_0, PM8921_S7, 2),
1691 MSM_RPM_MAP(8064, PM8921_S8_0, PM8921_S8, 2),
1692 MSM_RPM_MAP(8064, PM8921_L1_0, PM8921_L1, 2),
1693 MSM_RPM_MAP(8064, PM8921_L2_0, PM8921_L2, 2),
1694 MSM_RPM_MAP(8064, PM8921_L3_0, PM8921_L3, 2),
1695 MSM_RPM_MAP(8064, PM8921_L4_0, PM8921_L4, 2),
1696 MSM_RPM_MAP(8064, PM8921_L5_0, PM8921_L5, 2),
1697 MSM_RPM_MAP(8064, PM8921_L6_0, PM8921_L6, 2),
1698 MSM_RPM_MAP(8064, PM8921_L7_0, PM8921_L7, 2),
1699 MSM_RPM_MAP(8064, PM8921_L8_0, PM8921_L8, 2),
1700 MSM_RPM_MAP(8064, PM8921_L9_0, PM8921_L9, 2),
1701 MSM_RPM_MAP(8064, PM8921_L10_0, PM8921_L10, 2),
1702 MSM_RPM_MAP(8064, PM8921_L11_0, PM8921_L11, 2),
1703 MSM_RPM_MAP(8064, PM8921_L12_0, PM8921_L12, 2),
1704 MSM_RPM_MAP(8064, PM8921_L13_0, PM8921_L13, 2),
1705 MSM_RPM_MAP(8064, PM8921_L14_0, PM8921_L14, 2),
1706 MSM_RPM_MAP(8064, PM8921_L15_0, PM8921_L15, 2),
1707 MSM_RPM_MAP(8064, PM8921_L16_0, PM8921_L16, 2),
1708 MSM_RPM_MAP(8064, PM8921_L17_0, PM8921_L17, 2),
1709 MSM_RPM_MAP(8064, PM8921_L18_0, PM8921_L18, 2),
1710 MSM_RPM_MAP(8064, PM8921_L19_0, PM8921_L19, 2),
1711 MSM_RPM_MAP(8064, PM8921_L20_0, PM8921_L20, 2),
1712 MSM_RPM_MAP(8064, PM8921_L21_0, PM8921_L21, 2),
1713 MSM_RPM_MAP(8064, PM8921_L22_0, PM8921_L22, 2),
1714 MSM_RPM_MAP(8064, PM8921_L23_0, PM8921_L23, 2),
1715 MSM_RPM_MAP(8064, PM8921_L24_0, PM8921_L24, 2),
1716 MSM_RPM_MAP(8064, PM8921_L25_0, PM8921_L25, 2),
1717 MSM_RPM_MAP(8064, PM8921_L26_0, PM8921_L26, 2),
1718 MSM_RPM_MAP(8064, PM8921_L27_0, PM8921_L27, 2),
1719 MSM_RPM_MAP(8064, PM8921_L28_0, PM8921_L28, 2),
1720 MSM_RPM_MAP(8064, PM8921_L29_0, PM8921_L29, 2),
1721 MSM_RPM_MAP(8064, PM8921_CLK1_0, PM8921_CLK1, 2),
1722 MSM_RPM_MAP(8064, PM8921_CLK2_0, PM8921_CLK2, 2),
1723 MSM_RPM_MAP(8064, PM8921_LVS1, PM8921_LVS1, 1),
1724 MSM_RPM_MAP(8064, PM8921_LVS2, PM8921_LVS2, 1),
1725 MSM_RPM_MAP(8064, PM8921_LVS3, PM8921_LVS3, 1),
1726 MSM_RPM_MAP(8064, PM8921_LVS4, PM8921_LVS4, 1),
1727 MSM_RPM_MAP(8064, PM8921_LVS5, PM8921_LVS5, 1),
1728 MSM_RPM_MAP(8064, PM8921_LVS6, PM8921_LVS6, 1),
1729 MSM_RPM_MAP(8064, PM8921_LVS7, PM8921_LVS7, 1),
1730 MSM_RPM_MAP(8064, PM8821_S1_0, PM8821_S1, 2),
1731 MSM_RPM_MAP(8064, PM8821_S2_0, PM8821_S2, 2),
1732 MSM_RPM_MAP(8064, PM8821_L1_0, PM8821_L1, 2),
1733 MSM_RPM_MAP(8064, NCP_0, NCP, 2),
1734 MSM_RPM_MAP(8064, CXO_BUFFERS, CXO_BUFFERS, 1),
1735 MSM_RPM_MAP(8064, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
1736 MSM_RPM_MAP(8064, HDMI_SWITCH, HDMI_SWITCH, 1),
1737 MSM_RPM_MAP(8064, DDR_DMM_0, DDR_DMM, 2),
1738 MSM_RPM_MAP(8064, QDSS_CLK, QDSS_CLK, 1),
1739 },
1740 .target_status = {
1741 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MAJOR),
1742 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MINOR),
1743 MSM_RPM_STATUS_ID_MAP(8064, VERSION_BUILD),
1744 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_0),
1745 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_1),
1746 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_2),
1747 MSM_RPM_STATUS_ID_MAP(8064, RESERVED_SUPPORTED_RESOURCES_0),
1748 MSM_RPM_STATUS_ID_MAP(8064, SEQUENCE),
1749 MSM_RPM_STATUS_ID_MAP(8064, RPM_CTL),
1750 MSM_RPM_STATUS_ID_MAP(8064, CXO_CLK),
1751 MSM_RPM_STATUS_ID_MAP(8064, PXO_CLK),
1752 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CLK),
1753 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_CLK),
1754 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_CLK),
1755 MSM_RPM_STATUS_ID_MAP(8064, DAYTONA_FABRIC_CLK),
1756 MSM_RPM_STATUS_ID_MAP(8064, SFPB_CLK),
1757 MSM_RPM_STATUS_ID_MAP(8064, CFPB_CLK),
1758 MSM_RPM_STATUS_ID_MAP(8064, MMFPB_CLK),
1759 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CLK),
1760 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_HALT),
1761 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_CLKMOD),
1762 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_IOCTL),
1763 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_ARB),
1764 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_HALT),
1765 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_CLKMOD),
1766 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_IOCTL),
1767 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_ARB),
1768 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_HALT),
1769 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_CLKMOD),
1770 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_IOCTL),
1771 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_ARB),
1772 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_0),
1773 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_1),
1774 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_0),
1775 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_1),
1776 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_0),
1777 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_1),
1778 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_0),
1779 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_1),
1780 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_0),
1781 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_1),
1782 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_0),
1783 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_1),
1784 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_0),
1785 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_1),
1786 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_0),
1787 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_1),
1788 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_0),
1789 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_1),
1790 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_0),
1791 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_1),
1792 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_0),
1793 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_1),
1794 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_0),
1795 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_1),
1796 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_0),
1797 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_1),
1798 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_0),
1799 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_1),
1800 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_0),
1801 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_1),
1802 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_0),
1803 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_1),
1804 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_0),
1805 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_1),
1806 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_0),
1807 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_1),
1808 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_0),
1809 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_1),
1810 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_0),
1811 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_1),
1812 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_0),
1813 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_1),
1814 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_0),
1815 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_1),
1816 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_0),
1817 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_1),
1818 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_0),
1819 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_1),
1820 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_0),
1821 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_1),
1822 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_0),
1823 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_1),
1824 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_0),
1825 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_1),
1826 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_0),
1827 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_1),
1828 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_0),
1829 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_1),
1830 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_0),
1831 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_1),
1832 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_0),
1833 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_1),
1834 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_0),
1835 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_1),
1836 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_0),
1837 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_1),
1838 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_0),
1839 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_1),
1840 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_0),
1841 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_1),
1842 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_0),
1843 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_1),
1844 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_0),
1845 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_1),
1846 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_0),
1847 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_1),
1848 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_0),
1849 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_1),
1850 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS1),
1851 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS2),
1852 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS3),
1853 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS4),
1854 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS5),
1855 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS6),
1856 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS7),
1857 MSM_RPM_STATUS_ID_MAP(8064, NCP_0),
1858 MSM_RPM_STATUS_ID_MAP(8064, NCP_1),
1859 MSM_RPM_STATUS_ID_MAP(8064, CXO_BUFFERS),
1860 MSM_RPM_STATUS_ID_MAP(8064, USB_OTG_SWITCH),
1861 MSM_RPM_STATUS_ID_MAP(8064, HDMI_SWITCH),
1862 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_0),
1863 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_1),
1864 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH0_RANGE),
1865 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH1_RANGE),
1866 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_0),
1867 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_1),
1868 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_0),
1869 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_1),
1870 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_0),
1871 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_1),
1872 },
1873 .target_ctrl_id = {
1874 MSM_RPM_CTRL_MAP(8064, VERSION_MAJOR),
1875 MSM_RPM_CTRL_MAP(8064, VERSION_MINOR),
1876 MSM_RPM_CTRL_MAP(8064, VERSION_BUILD),
1877 MSM_RPM_CTRL_MAP(8064, REQ_CTX_0),
1878 MSM_RPM_CTRL_MAP(8064, REQ_SEL_0),
1879 MSM_RPM_CTRL_MAP(8064, ACK_CTX_0),
1880 MSM_RPM_CTRL_MAP(8064, ACK_SEL_0),
1881 },
1882 .sel_invalidate = MSM_RPM_8064_SEL_INVALIDATE,
1883 .sel_notification = MSM_RPM_8064_SEL_NOTIFICATION,
1884 .sel_last = MSM_RPM_8064_SEL_LAST,
1885 .ver = {3, 0, 0},
1886};
1887
1888struct platform_device apq8064_rpm_device = {
1889 .name = "msm_rpm",
1890 .id = -1,
1891};
1892
1893static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
1894 .phys_addr_base = 0x0010D204,
1895 .phys_size = SZ_8K,
1896};
1897
1898struct platform_device apq8064_rpm_stat_device = {
1899 .name = "msm_rpm_stat",
1900 .id = -1,
1901 .dev = {
1902 .platform_data = &msm_rpm_stat_pdata,
1903 },
1904};
1905
1906static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
1907 .phys_addr_base = 0x0010C000,
1908 .reg_offsets = {
1909 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
1910 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
1911 },
1912 .phys_size = SZ_8K,
1913 .log_len = 4096, /* log's buffer length in bytes */
1914 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
1915};
1916
1917struct platform_device apq8064_rpm_log_device = {
1918 .name = "msm_rpm_log",
1919 .id = -1,
1920 .dev = {
1921 .platform_data = &msm_rpm_log_pdata,
1922 },
1923};
1924
Jin Hongd3024e62012-02-09 16:13:32 -08001925/* Sensors DSPS platform data */
1926
1927#define PPSS_REG_PHYS_BASE 0x12080000
1928
1929static struct dsps_clk_info dsps_clks[] = {};
1930static struct dsps_regulator_info dsps_regs[] = {};
1931
1932/*
1933 * Note: GPIOs field is intialized in run-time at the function
1934 * apq8064_init_dsps().
1935 */
1936
1937struct msm_dsps_platform_data msm_dsps_pdata_8064 = {
1938 .clks = dsps_clks,
1939 .clks_num = ARRAY_SIZE(dsps_clks),
1940 .gpios = NULL,
1941 .gpios_num = 0,
1942 .regs = dsps_regs,
1943 .regs_num = ARRAY_SIZE(dsps_regs),
1944 .dsps_pwr_ctl_en = 1,
1945 .signature = DSPS_SIGNATURE,
1946};
1947
1948static struct resource msm_dsps_resources[] = {
1949 {
1950 .start = PPSS_REG_PHYS_BASE,
1951 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
1952 .name = "ppss_reg",
1953 .flags = IORESOURCE_MEM,
1954 },
1955
1956 {
1957 .start = PPSS_WDOG_TIMER_IRQ,
1958 .end = PPSS_WDOG_TIMER_IRQ,
1959 .name = "ppss_wdog",
1960 .flags = IORESOURCE_IRQ,
1961 },
1962};
1963
1964struct platform_device msm_dsps_device_8064 = {
1965 .name = "msm_dsps",
1966 .id = 0,
1967 .num_resources = ARRAY_SIZE(msm_dsps_resources),
1968 .resource = msm_dsps_resources,
1969 .dev.platform_data = &msm_dsps_pdata_8064,
1970};
1971
Praveen Chidambaram78499012011-11-01 17:15:17 -06001972#ifdef CONFIG_MSM_MPM
1973static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
1974 [1] = MSM_GPIO_TO_INT(26),
1975 [2] = MSM_GPIO_TO_INT(88),
1976 [4] = MSM_GPIO_TO_INT(73),
1977 [5] = MSM_GPIO_TO_INT(74),
1978 [6] = MSM_GPIO_TO_INT(75),
1979 [7] = MSM_GPIO_TO_INT(76),
1980 [8] = MSM_GPIO_TO_INT(77),
1981 [9] = MSM_GPIO_TO_INT(36),
1982 [10] = MSM_GPIO_TO_INT(84),
1983 [11] = MSM_GPIO_TO_INT(7),
1984 [12] = MSM_GPIO_TO_INT(11),
1985 [13] = MSM_GPIO_TO_INT(52),
1986 [14] = MSM_GPIO_TO_INT(15),
1987 [15] = MSM_GPIO_TO_INT(83),
1988 [16] = USB3_HS_IRQ,
1989 [19] = MSM_GPIO_TO_INT(61),
1990 [20] = MSM_GPIO_TO_INT(58),
1991 [23] = MSM_GPIO_TO_INT(65),
1992 [24] = MSM_GPIO_TO_INT(63),
1993 [25] = USB1_HS_IRQ,
1994 [27] = HDMI_IRQ,
1995 [29] = MSM_GPIO_TO_INT(22),
1996 [30] = MSM_GPIO_TO_INT(72),
1997 [31] = USB4_HS_IRQ,
1998 [33] = MSM_GPIO_TO_INT(44),
1999 [34] = MSM_GPIO_TO_INT(39),
2000 [35] = MSM_GPIO_TO_INT(19),
2001 [36] = MSM_GPIO_TO_INT(23),
2002 [37] = MSM_GPIO_TO_INT(41),
2003 [38] = MSM_GPIO_TO_INT(30),
2004 [41] = MSM_GPIO_TO_INT(42),
2005 [42] = MSM_GPIO_TO_INT(56),
2006 [43] = MSM_GPIO_TO_INT(55),
2007 [44] = MSM_GPIO_TO_INT(50),
2008 [45] = MSM_GPIO_TO_INT(49),
2009 [46] = MSM_GPIO_TO_INT(47),
2010 [47] = MSM_GPIO_TO_INT(45),
2011 [48] = MSM_GPIO_TO_INT(38),
2012 [49] = MSM_GPIO_TO_INT(34),
2013 [50] = MSM_GPIO_TO_INT(32),
2014 [51] = MSM_GPIO_TO_INT(29),
2015 [52] = MSM_GPIO_TO_INT(18),
2016 [53] = MSM_GPIO_TO_INT(10),
2017 [54] = MSM_GPIO_TO_INT(81),
2018 [55] = MSM_GPIO_TO_INT(6),
2019};
2020
2021static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
2022 TLMM_MSM_SUMMARY_IRQ,
2023 RPM_APCC_CPU0_GP_HIGH_IRQ,
2024 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2025 RPM_APCC_CPU0_GP_LOW_IRQ,
2026 RPM_APCC_CPU0_WAKE_UP_IRQ,
2027 RPM_APCC_CPU1_GP_HIGH_IRQ,
2028 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2029 RPM_APCC_CPU1_GP_LOW_IRQ,
2030 RPM_APCC_CPU1_WAKE_UP_IRQ,
2031 MSS_TO_APPS_IRQ_0,
2032 MSS_TO_APPS_IRQ_1,
2033 MSS_TO_APPS_IRQ_2,
2034 MSS_TO_APPS_IRQ_3,
2035 MSS_TO_APPS_IRQ_4,
2036 MSS_TO_APPS_IRQ_5,
2037 MSS_TO_APPS_IRQ_6,
2038 MSS_TO_APPS_IRQ_7,
2039 MSS_TO_APPS_IRQ_8,
2040 MSS_TO_APPS_IRQ_9,
2041 LPASS_SCSS_GP_LOW_IRQ,
2042 LPASS_SCSS_GP_MEDIUM_IRQ,
2043 LPASS_SCSS_GP_HIGH_IRQ,
2044 SPS_MTI_30,
2045 SPS_MTI_31,
2046 RIVA_APSS_SPARE_IRQ,
2047 RIVA_APPS_WLAN_SMSM_IRQ,
2048 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2049 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2050};
2051
2052struct msm_mpm_device_data apq8064_mpm_dev_data __initdata = {
2053 .irqs_m2a = msm_mpm_irqs_m2a,
2054 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2055 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2056 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2057 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2058 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2059 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2060 .mpm_apps_ipc_val = BIT(1),
2061 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2062
2063};
2064#endif
Joel Kingdacbc822012-01-25 13:30:57 -08002065
2066#define MDM2AP_ERRFATAL 19
2067#define AP2MDM_ERRFATAL 18
2068#define MDM2AP_STATUS 49
2069#define AP2MDM_STATUS 48
2070#define AP2MDM_PMIC_RESET_N 27
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002071#define AP2MDM_WAKEUP 35
Joel Kingdacbc822012-01-25 13:30:57 -08002072
2073static struct resource mdm_resources[] = {
2074 {
2075 .start = MDM2AP_ERRFATAL,
2076 .end = MDM2AP_ERRFATAL,
2077 .name = "MDM2AP_ERRFATAL",
2078 .flags = IORESOURCE_IO,
2079 },
2080 {
2081 .start = AP2MDM_ERRFATAL,
2082 .end = AP2MDM_ERRFATAL,
2083 .name = "AP2MDM_ERRFATAL",
2084 .flags = IORESOURCE_IO,
2085 },
2086 {
2087 .start = MDM2AP_STATUS,
2088 .end = MDM2AP_STATUS,
2089 .name = "MDM2AP_STATUS",
2090 .flags = IORESOURCE_IO,
2091 },
2092 {
2093 .start = AP2MDM_STATUS,
2094 .end = AP2MDM_STATUS,
2095 .name = "AP2MDM_STATUS",
2096 .flags = IORESOURCE_IO,
2097 },
2098 {
2099 .start = AP2MDM_PMIC_RESET_N,
2100 .end = AP2MDM_PMIC_RESET_N,
2101 .name = "AP2MDM_PMIC_RESET_N",
2102 .flags = IORESOURCE_IO,
2103 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002104 {
2105 .start = AP2MDM_WAKEUP,
2106 .end = AP2MDM_WAKEUP,
2107 .name = "AP2MDM_WAKEUP",
2108 .flags = IORESOURCE_IO,
2109 },
Joel Kingdacbc822012-01-25 13:30:57 -08002110};
2111
2112struct platform_device mdm_8064_device = {
2113 .name = "mdm2_modem",
2114 .id = -1,
2115 .num_resources = ARRAY_SIZE(mdm_resources),
2116 .resource = mdm_resources,
2117};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002118
2119static int apq8064_LPM_latency = 1000; /* >100 usec for WFI */
2120
2121struct platform_device apq8064_cpu_idle_device = {
2122 .name = "msm_cpu_idle",
2123 .id = -1,
2124 .dev = {
2125 .platform_data = &apq8064_LPM_latency,
2126 },
2127};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002128
2129static struct msm_dcvs_freq_entry apq8064_freq[] = {
2130 { 384000, 166981, 345600},
2131 { 702000, 213049, 632502},
2132 {1026000, 285712, 925613},
2133 {1242000, 383945, 1176550},
2134 {1458000, 419729, 1465478},
2135 {1512000, 434116, 1546674},
2136
2137};
2138
2139static struct msm_dcvs_core_info apq8064_core_info = {
2140 .freq_tbl = &apq8064_freq[0],
2141 .core_param = {
2142 .max_time_us = 100000,
2143 .num_freq = ARRAY_SIZE(apq8064_freq),
2144 },
2145 .algo_param = {
2146 .slack_time_us = 58000,
2147 .scale_slack_time = 0,
2148 .scale_slack_time_pct = 0,
2149 .disable_pc_threshold = 1458000,
2150 .em_window_size = 100000,
2151 .em_max_util_pct = 97,
2152 .ss_window_size = 1000000,
2153 .ss_util_pct = 95,
2154 .ss_iobusy_conv = 100,
2155 },
2156};
2157
2158struct platform_device apq8064_msm_gov_device = {
2159 .name = "msm_dcvs_gov",
2160 .id = -1,
2161 .dev = {
2162 .platform_data = &apq8064_core_info,
2163 },
2164};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002165
Terence Hampson2e1705f2012-04-11 19:55:29 -04002166#ifdef CONFIG_MSM_VCAP
2167#define VCAP_HW_BASE 0x05900000
2168
2169static struct msm_bus_vectors vcap_init_vectors[] = {
2170 {
2171 .src = MSM_BUS_MASTER_VIDEO_CAP,
2172 .dst = MSM_BUS_SLAVE_EBI_CH0,
2173 .ab = 0,
2174 .ib = 0,
2175 },
2176};
2177
2178
2179static struct msm_bus_vectors vcap_480_vectors[] = {
2180 {
2181 .src = MSM_BUS_MASTER_VIDEO_CAP,
2182 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002183 .ab = 1280 * 720 * 3 * 60,
2184 .ib = 1280 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002185 },
2186};
2187
2188static struct msm_bus_vectors vcap_720_vectors[] = {
2189 {
2190 .src = MSM_BUS_MASTER_VIDEO_CAP,
2191 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002192 .ab = 1280 * 720 * 3 * 60,
2193 .ib = 1280 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002194 },
2195};
2196
2197static struct msm_bus_vectors vcap_1080_vectors[] = {
2198 {
2199 .src = MSM_BUS_MASTER_VIDEO_CAP,
2200 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002201 .ab = 1920 * 1080 * 3 * 60,
2202 .ib = 1920 * 1080 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002203 },
2204};
2205
2206static struct msm_bus_paths vcap_bus_usecases[] = {
2207 {
2208 ARRAY_SIZE(vcap_init_vectors),
2209 vcap_init_vectors,
2210 },
2211 {
2212 ARRAY_SIZE(vcap_480_vectors),
2213 vcap_480_vectors,
2214 },
2215 {
2216 ARRAY_SIZE(vcap_720_vectors),
2217 vcap_720_vectors,
2218 },
2219 {
2220 ARRAY_SIZE(vcap_1080_vectors),
2221 vcap_1080_vectors,
2222 },
2223};
2224
2225static struct msm_bus_scale_pdata vcap_axi_client_pdata = {
2226 vcap_bus_usecases,
2227 ARRAY_SIZE(vcap_bus_usecases),
2228};
2229
2230static struct resource msm_vcap_resources[] = {
2231 {
2232 .name = "vcap",
2233 .start = VCAP_HW_BASE,
2234 .end = VCAP_HW_BASE + SZ_1M - 1,
2235 .flags = IORESOURCE_MEM,
2236 },
2237 {
2238 .name = "vcap",
2239 .start = VCAP_VC,
2240 .end = VCAP_VC,
2241 .flags = IORESOURCE_IRQ,
2242 },
2243};
2244
2245static unsigned vcap_gpios[] = {
2246 2, 3, 4, 5, 6, 7, 8, 9, 10,
2247 11, 12, 13, 18, 19, 20, 21,
2248 22, 23, 24, 25, 26, 80, 82,
2249 83, 84, 85, 86, 87,
2250};
2251
2252static struct vcap_platform_data vcap_pdata = {
2253 .gpios = vcap_gpios,
2254 .num_gpios = ARRAY_SIZE(vcap_gpios),
2255 .bus_client_pdata = &vcap_axi_client_pdata
2256};
2257
2258struct platform_device msm8064_device_vcap = {
2259 .name = "msm_vcap",
2260 .id = 0,
2261 .resource = msm_vcap_resources,
2262 .num_resources = ARRAY_SIZE(msm_vcap_resources),
2263 .dev = {
2264 .platform_data = &vcap_pdata,
2265 },
2266};
2267#endif
2268
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002269static struct resource msm_cache_erp_resources[] = {
2270 {
2271 .name = "l1_irq",
2272 .start = SC_SICCPUXEXTFAULTIRPTREQ,
2273 .flags = IORESOURCE_IRQ,
2274 },
2275 {
2276 .name = "l2_irq",
2277 .start = APCC_QGICL2IRPTREQ,
2278 .flags = IORESOURCE_IRQ,
2279 }
2280};
2281
2282struct platform_device apq8064_device_cache_erp = {
2283 .name = "msm_cache_erp",
2284 .id = -1,
2285 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
2286 .resource = msm_cache_erp_resources,
2287};
Pratik Patel212ab362012-03-16 12:30:07 -07002288
2289#define MSM_QDSS_PHYS_BASE 0x01A00000
2290#define MSM_ETM_PHYS_BASE (MSM_QDSS_PHYS_BASE + 0x1C000)
2291
2292#define QDSS_SOURCE(src_name, fpm) { .name = src_name, .fport_mask = fpm, }
2293
2294static struct qdss_source msm_qdss_sources[] = {
2295 QDSS_SOURCE("msm_etm", 0x33),
2296 QDSS_SOURCE("msm_oxili", 0x80),
2297};
2298
2299static struct msm_qdss_platform_data qdss_pdata = {
2300 .src_table = msm_qdss_sources,
2301 .size = ARRAY_SIZE(msm_qdss_sources),
2302 .afamily = 1,
2303};
2304
2305struct platform_device apq8064_qdss_device = {
2306 .name = "msm_qdss",
2307 .id = -1,
2308 .dev = {
2309 .platform_data = &qdss_pdata,
2310 },
2311};
2312
2313static struct resource msm_etm_resources[] = {
2314 {
2315 .start = MSM_ETM_PHYS_BASE,
2316 .end = MSM_ETM_PHYS_BASE + (SZ_4K * 4) - 1,
2317 .flags = IORESOURCE_MEM,
2318 },
2319};
2320
2321struct platform_device apq8064_etm_device = {
2322 .name = "msm_etm",
2323 .id = 0,
2324 .num_resources = ARRAY_SIZE(msm_etm_resources),
2325 .resource = msm_etm_resources,
2326};
Laura Abbott0577d7b2012-04-17 11:14:30 -07002327
2328struct msm_iommu_domain_name apq8064_iommu_ctx_names[] = {
2329 /* Camera */
2330 {
2331 .name = "vpe_src",
2332 .domain = CAMERA_DOMAIN,
2333 },
2334 /* Camera */
2335 {
2336 .name = "vpe_dst",
2337 .domain = CAMERA_DOMAIN,
2338 },
2339 /* Camera */
2340 {
2341 .name = "vfe_imgwr",
2342 .domain = CAMERA_DOMAIN,
2343 },
2344 /* Camera */
2345 {
2346 .name = "vfe_misc",
2347 .domain = CAMERA_DOMAIN,
2348 },
2349 /* Camera */
2350 {
2351 .name = "ijpeg_src",
2352 .domain = CAMERA_DOMAIN,
2353 },
2354 /* Camera */
2355 {
2356 .name = "ijpeg_dst",
2357 .domain = CAMERA_DOMAIN,
2358 },
2359 /* Camera */
2360 {
2361 .name = "jpegd_src",
2362 .domain = CAMERA_DOMAIN,
2363 },
2364 /* Camera */
2365 {
2366 .name = "jpegd_dst",
2367 .domain = CAMERA_DOMAIN,
2368 },
2369 /* Rotator */
2370 {
2371 .name = "rot_src",
2372 .domain = ROTATOR_DOMAIN,
2373 },
2374 /* Rotator */
2375 {
2376 .name = "rot_dst",
2377 .domain = ROTATOR_DOMAIN,
2378 },
2379 /* Video */
2380 {
2381 .name = "vcodec_a_mm1",
2382 .domain = VIDEO_DOMAIN,
2383 },
2384 /* Video */
2385 {
2386 .name = "vcodec_b_mm2",
2387 .domain = VIDEO_DOMAIN,
2388 },
2389 /* Video */
2390 {
2391 .name = "vcodec_a_stream",
2392 .domain = VIDEO_DOMAIN,
2393 },
2394};
2395
2396static struct mem_pool apq8064_video_pools[] = {
2397 /*
2398 * Video hardware has the following requirements:
2399 * 1. All video addresses used by the video hardware must be at a higher
2400 * address than video firmware address.
2401 * 2. Video hardware can only access a range of 256MB from the base of
2402 * the video firmware.
2403 */
2404 [VIDEO_FIRMWARE_POOL] =
2405 /* Low addresses, intended for video firmware */
2406 {
2407 .paddr = SZ_128K,
2408 .size = SZ_16M - SZ_128K,
2409 },
2410 [VIDEO_MAIN_POOL] =
2411 /* Main video pool */
2412 {
2413 .paddr = SZ_16M,
2414 .size = SZ_256M - SZ_16M,
2415 },
2416 [GEN_POOL] =
2417 /* Remaining address space up to 2G */
2418 {
2419 .paddr = SZ_256M,
2420 .size = SZ_2G - SZ_256M,
2421 },
2422};
2423
2424static struct mem_pool apq8064_camera_pools[] = {
2425 [GEN_POOL] =
2426 /* One address space for camera */
2427 {
2428 .paddr = SZ_128K,
2429 .size = SZ_2G - SZ_128K,
2430 },
2431};
2432
2433static struct mem_pool apq8064_display_pools[] = {
2434 [GEN_POOL] =
2435 /* One address space for display */
2436 {
2437 .paddr = SZ_128K,
2438 .size = SZ_2G - SZ_128K,
2439 },
2440};
2441
2442static struct mem_pool apq8064_rotator_pools[] = {
2443 [GEN_POOL] =
2444 /* One address space for rotator */
2445 {
2446 .paddr = SZ_128K,
2447 .size = SZ_2G - SZ_128K,
2448 },
2449};
2450
2451static struct msm_iommu_domain apq8064_iommu_domains[] = {
2452 [VIDEO_DOMAIN] = {
2453 .iova_pools = apq8064_video_pools,
2454 .npools = ARRAY_SIZE(apq8064_video_pools),
2455 },
2456 [CAMERA_DOMAIN] = {
2457 .iova_pools = apq8064_camera_pools,
2458 .npools = ARRAY_SIZE(apq8064_camera_pools),
2459 },
2460 [DISPLAY_DOMAIN] = {
2461 .iova_pools = apq8064_display_pools,
2462 .npools = ARRAY_SIZE(apq8064_display_pools),
2463 },
2464 [ROTATOR_DOMAIN] = {
2465 .iova_pools = apq8064_rotator_pools,
2466 .npools = ARRAY_SIZE(apq8064_rotator_pools),
2467 },
2468};
2469
2470struct iommu_domains_pdata apq8064_iommu_domain_pdata = {
2471 .domains = apq8064_iommu_domains,
2472 .ndomains = ARRAY_SIZE(apq8064_iommu_domains),
2473 .domain_names = apq8064_iommu_ctx_names,
2474 .nnames = ARRAY_SIZE(apq8064_iommu_ctx_names),
2475 .domain_alloc_flags = 0,
2476};
2477
2478struct platform_device apq8064_iommu_domain_device = {
2479 .name = "iommu_domains",
2480 .id = -1,
2481 .dev = {
2482 .platform_data = &apq8064_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07002483 }
2484};
2485
2486struct msm_rtb_platform_data apq8064_rtb_pdata = {
2487 .size = SZ_1M,
2488};
2489
2490static int __init msm_rtb_set_buffer_size(char *p)
2491{
2492 int s;
2493
2494 s = memparse(p, NULL);
2495 apq8064_rtb_pdata.size = ALIGN(s, SZ_4K);
2496 return 0;
2497}
2498early_param("msm_rtb_size", msm_rtb_set_buffer_size);
2499
2500struct platform_device apq8064_rtb_device = {
2501 .name = "msm_rtb",
2502 .id = -1,
2503 .dev = {
2504 .platform_data = &apq8064_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002505 },
2506};