blob: b6609066b7af4a1ae5c6fbfbfdc059a8d3ddb26c [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>
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -080033#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070034#include "clock.h"
35#include "devices.h"
Matt Wagantall1875d322012-02-22 16:11:33 -080036#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070037#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060038#include "rpm_stats.h"
39#include "rpm_log.h"
40#include "mpm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041
42/* Address of GSBI blocks */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070043#define MSM_GSBI1_PHYS 0x12440000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044#define MSM_GSBI3_PHYS 0x16200000
Harini Jayaramanc4c58692011-07-19 14:50:10 -060045#define MSM_GSBI4_PHYS 0x16300000
46#define MSM_GSBI5_PHYS 0x1A200000
47#define MSM_GSBI6_PHYS 0x16500000
48#define MSM_GSBI7_PHYS 0x16600000
49
Kenneth Heitke748593a2011-07-15 15:45:11 -060050/* GSBI UART devices */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070051#define MSM_UART1DM_PHYS (MSM_GSBI1_PHYS + 0x10000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
Jin Hong4bbbfba2012-02-02 21:48:07 -080053#define MSM_UART7DM_PHYS (MSM_GSBI7_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054
Harini Jayaramanc4c58692011-07-19 14:50:10 -060055/* GSBI QUP devices */
David Keitel3c40fc52012-02-09 17:53:52 -080056#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x20000)
Harini Jayaramanc4c58692011-07-19 14:50:10 -060057#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
58#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
59#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
60#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
61#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
62#define MSM_QUP_SIZE SZ_4K
63
Kenneth Heitke36920d32011-07-20 16:44:30 -060064/* Address of SSBI CMD */
65#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
66#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
67#define MSM_PMIC_SSBI_SIZE SZ_4K
Harini Jayaramanc4c58692011-07-19 14:50:10 -060068
Hemant Kumarcaa09092011-07-30 00:26:33 -070069/* Address of HS USBOTG1 */
Hemant Kumard86c4882012-01-24 19:39:37 -080070#define MSM_HSUSB1_PHYS 0x12500000
71#define MSM_HSUSB1_SIZE SZ_4K
Hemant Kumarcaa09092011-07-30 00:26:33 -070072
Manu Gautam91223e02011-11-08 15:27:22 +053073/* Address of HS USB3 */
74#define MSM_HSUSB3_PHYS 0x12520000
75#define MSM_HSUSB3_SIZE SZ_4K
76
Hemant Kumar1d66e1c2012-02-13 15:24:59 -080077/* Address of HS USB4 */
78#define MSM_HSUSB4_PHYS 0x12530000
79#define MSM_HSUSB4_SIZE SZ_4K
80
81
Jeff Ohlstein7e668552011-10-06 16:17:25 -070082static struct msm_watchdog_pdata msm_watchdog_pdata = {
83 .pet_time = 10000,
84 .bark_time = 11000,
85 .has_secure = true,
Joel Kinge7ca6f72012-02-09 20:51:25 -080086 .needs_expired_enable = true,
Jeff Ohlstein7e668552011-10-06 16:17:25 -070087};
88
89struct platform_device msm8064_device_watchdog = {
90 .name = "msm_watchdog",
91 .id = -1,
92 .dev = {
93 .platform_data = &msm_watchdog_pdata,
94 },
95};
96
Joel King0581896d2011-07-19 16:43:28 -070097static struct resource msm_dmov_resource[] = {
98 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -080099 .start = ADM_0_SCSS_1_IRQ,
Joel King0581896d2011-07-19 16:43:28 -0700100 .flags = IORESOURCE_IRQ,
101 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700102 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800103 .start = 0x18320000,
104 .end = 0x18320000 + SZ_1M - 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700105 .flags = IORESOURCE_MEM,
106 },
107};
108
109static struct msm_dmov_pdata msm_dmov_pdata = {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800110 .sd = 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700111 .sd_size = 0x800,
Joel King0581896d2011-07-19 16:43:28 -0700112};
113
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700114struct platform_device apq8064_device_dmov = {
Joel King0581896d2011-07-19 16:43:28 -0700115 .name = "msm_dmov",
116 .id = -1,
117 .resource = msm_dmov_resource,
118 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700119 .dev = {
120 .platform_data = &msm_dmov_pdata,
121 },
Joel King0581896d2011-07-19 16:43:28 -0700122};
123
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700124static struct resource resources_uart_gsbi1[] = {
125 {
126 .start = APQ8064_GSBI1_UARTDM_IRQ,
127 .end = APQ8064_GSBI1_UARTDM_IRQ,
128 .flags = IORESOURCE_IRQ,
129 },
130 {
131 .start = MSM_UART1DM_PHYS,
132 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
133 .name = "uartdm_resource",
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = MSM_GSBI1_PHYS,
138 .end = MSM_GSBI1_PHYS + PAGE_SIZE - 1,
139 .name = "gsbi_resource",
140 .flags = IORESOURCE_MEM,
141 },
142};
143
144struct platform_device apq8064_device_uart_gsbi1 = {
145 .name = "msm_serial_hsl",
Jin Hong4bbbfba2012-02-02 21:48:07 -0800146 .id = 1,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700147 .num_resources = ARRAY_SIZE(resources_uart_gsbi1),
148 .resource = resources_uart_gsbi1,
149};
150
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700151static struct resource resources_uart_gsbi3[] = {
152 {
153 .start = GSBI3_UARTDM_IRQ,
154 .end = GSBI3_UARTDM_IRQ,
155 .flags = IORESOURCE_IRQ,
156 },
157 {
158 .start = MSM_UART3DM_PHYS,
159 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
160 .name = "uartdm_resource",
161 .flags = IORESOURCE_MEM,
162 },
163 {
164 .start = MSM_GSBI3_PHYS,
165 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
166 .name = "gsbi_resource",
167 .flags = IORESOURCE_MEM,
168 },
169};
170
171struct platform_device apq8064_device_uart_gsbi3 = {
172 .name = "msm_serial_hsl",
173 .id = 0,
174 .num_resources = ARRAY_SIZE(resources_uart_gsbi3),
175 .resource = resources_uart_gsbi3,
176};
177
Jing Lin04601f92012-02-05 15:36:07 -0800178static struct resource resources_qup_i2c_gsbi3[] = {
179 {
180 .name = "gsbi_qup_i2c_addr",
181 .start = MSM_GSBI3_PHYS,
182 .end = MSM_GSBI3_PHYS + 4 - 1,
183 .flags = IORESOURCE_MEM,
184 },
185 {
186 .name = "qup_phys_addr",
187 .start = MSM_GSBI3_QUP_PHYS,
188 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
189 .flags = IORESOURCE_MEM,
190 },
191 {
192 .name = "qup_err_intr",
193 .start = GSBI3_QUP_IRQ,
194 .end = GSBI3_QUP_IRQ,
195 .flags = IORESOURCE_IRQ,
196 },
197 {
198 .name = "i2c_clk",
199 .start = 9,
200 .end = 9,
201 .flags = IORESOURCE_IO,
202 },
203 {
204 .name = "i2c_sda",
205 .start = 8,
206 .end = 8,
207 .flags = IORESOURCE_IO,
208 },
209};
210
David Keitel3c40fc52012-02-09 17:53:52 -0800211static struct resource resources_qup_i2c_gsbi1[] = {
212 {
213 .name = "gsbi_qup_i2c_addr",
214 .start = MSM_GSBI1_PHYS,
215 .end = MSM_GSBI1_PHYS + 4 - 1,
216 .flags = IORESOURCE_MEM,
217 },
218 {
219 .name = "qup_phys_addr",
220 .start = MSM_GSBI1_QUP_PHYS,
221 .end = MSM_GSBI1_QUP_PHYS + MSM_QUP_SIZE - 1,
222 .flags = IORESOURCE_MEM,
223 },
224 {
225 .name = "qup_err_intr",
226 .start = APQ8064_GSBI1_QUP_IRQ,
227 .end = APQ8064_GSBI1_QUP_IRQ,
228 .flags = IORESOURCE_IRQ,
229 },
230 {
231 .name = "i2c_clk",
232 .start = 21,
233 .end = 21,
234 .flags = IORESOURCE_IO,
235 },
236 {
237 .name = "i2c_sda",
238 .start = 20,
239 .end = 20,
240 .flags = IORESOURCE_IO,
241 },
242};
243
244struct platform_device apq8064_device_qup_i2c_gsbi1 = {
245 .name = "qup_i2c",
246 .id = 0,
247 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi1),
248 .resource = resources_qup_i2c_gsbi1,
249};
250
Jing Lin04601f92012-02-05 15:36:07 -0800251struct platform_device apq8064_device_qup_i2c_gsbi3 = {
252 .name = "qup_i2c",
253 .id = 3,
254 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
255 .resource = resources_qup_i2c_gsbi3,
256};
257
Kenneth Heitke748593a2011-07-15 15:45:11 -0600258static struct resource resources_qup_i2c_gsbi4[] = {
259 {
260 .name = "gsbi_qup_i2c_addr",
261 .start = MSM_GSBI4_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600262 .end = MSM_GSBI4_PHYS + 4 - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600263 .flags = IORESOURCE_MEM,
264 },
265 {
266 .name = "qup_phys_addr",
267 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600268 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600269 .flags = IORESOURCE_MEM,
270 },
271 {
272 .name = "qup_err_intr",
273 .start = GSBI4_QUP_IRQ,
274 .end = GSBI4_QUP_IRQ,
275 .flags = IORESOURCE_IRQ,
276 },
Kevin Chand07220e2012-02-13 15:52:22 -0800277 {
278 .name = "i2c_clk",
279 .start = 11,
280 .end = 11,
281 .flags = IORESOURCE_IO,
282 },
283 {
284 .name = "i2c_sda",
285 .start = 10,
286 .end = 10,
287 .flags = IORESOURCE_IO,
288 },
Kenneth Heitke748593a2011-07-15 15:45:11 -0600289};
290
291struct platform_device apq8064_device_qup_i2c_gsbi4 = {
292 .name = "qup_i2c",
293 .id = 4,
294 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
295 .resource = resources_qup_i2c_gsbi4,
296};
297
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700298static struct resource resources_qup_spi_gsbi5[] = {
299 {
300 .name = "spi_base",
301 .start = MSM_GSBI5_QUP_PHYS,
302 .end = MSM_GSBI5_QUP_PHYS + SZ_4K - 1,
303 .flags = IORESOURCE_MEM,
304 },
305 {
306 .name = "gsbi_base",
307 .start = MSM_GSBI5_PHYS,
308 .end = MSM_GSBI5_PHYS + 4 - 1,
309 .flags = IORESOURCE_MEM,
310 },
311 {
312 .name = "spi_irq_in",
313 .start = GSBI5_QUP_IRQ,
314 .end = GSBI5_QUP_IRQ,
315 .flags = IORESOURCE_IRQ,
316 },
317};
318
319struct platform_device apq8064_device_qup_spi_gsbi5 = {
320 .name = "spi_qsd",
321 .id = 0,
322 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi5),
323 .resource = resources_qup_spi_gsbi5,
324};
325
Jin Hong4bbbfba2012-02-02 21:48:07 -0800326static struct resource resources_uart_gsbi7[] = {
327 {
328 .start = GSBI7_UARTDM_IRQ,
329 .end = GSBI7_UARTDM_IRQ,
330 .flags = IORESOURCE_IRQ,
331 },
332 {
333 .start = MSM_UART7DM_PHYS,
334 .end = MSM_UART7DM_PHYS + PAGE_SIZE - 1,
335 .name = "uartdm_resource",
336 .flags = IORESOURCE_MEM,
337 },
338 {
339 .start = MSM_GSBI7_PHYS,
340 .end = MSM_GSBI7_PHYS + PAGE_SIZE - 1,
341 .name = "gsbi_resource",
342 .flags = IORESOURCE_MEM,
343 },
344};
345
346struct platform_device apq8064_device_uart_gsbi7 = {
347 .name = "msm_serial_hsl",
348 .id = 0,
349 .num_resources = ARRAY_SIZE(resources_uart_gsbi7),
350 .resource = resources_uart_gsbi7,
351};
352
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800353struct platform_device apq_pcm = {
354 .name = "msm-pcm-dsp",
355 .id = -1,
356};
357
358struct platform_device apq_pcm_routing = {
359 .name = "msm-pcm-routing",
360 .id = -1,
361};
362
363struct platform_device apq_cpudai0 = {
364 .name = "msm-dai-q6",
365 .id = 0x4000,
366};
367
368struct platform_device apq_cpudai1 = {
369 .name = "msm-dai-q6",
370 .id = 0x4001,
371};
372
373struct platform_device apq_cpudai_hdmi_rx = {
Swaminathan Sathappanfd9dbad2012-02-15 16:56:44 -0800374 .name = "msm-dai-q6-hdmi",
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800375 .id = 8,
376};
377
378struct platform_device apq_cpudai_bt_rx = {
379 .name = "msm-dai-q6",
380 .id = 0x3000,
381};
382
383struct platform_device apq_cpudai_bt_tx = {
384 .name = "msm-dai-q6",
385 .id = 0x3001,
386};
387
388struct platform_device apq_cpudai_fm_rx = {
389 .name = "msm-dai-q6",
390 .id = 0x3004,
391};
392
393struct platform_device apq_cpudai_fm_tx = {
394 .name = "msm-dai-q6",
395 .id = 0x3005,
396};
397
398/*
399 * Machine specific data for AUX PCM Interface
400 * which the driver will be unware of.
401 */
402struct msm_dai_auxpcm_pdata apq_auxpcm_rx_pdata = {
403 .clk = "pcm_clk",
404 .mode = AFE_PCM_CFG_MODE_PCM,
405 .sync = AFE_PCM_CFG_SYNC_INT,
406 .frame = AFE_PCM_CFG_FRM_256BPF,
407 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
408 .slot = 0,
409 .data = AFE_PCM_CFG_CDATAOE_MASTER,
410 .pcm_clk_rate = 2048000,
411};
412
413struct platform_device apq_cpudai_auxpcm_rx = {
414 .name = "msm-dai-q6",
415 .id = 2,
416 .dev = {
417 .platform_data = &apq_auxpcm_rx_pdata,
418 },
419};
420
421struct platform_device apq_cpudai_auxpcm_tx = {
422 .name = "msm-dai-q6",
423 .id = 3,
424};
425
426struct platform_device apq_cpu_fe = {
427 .name = "msm-dai-fe",
428 .id = -1,
429};
430
431struct platform_device apq_stub_codec = {
432 .name = "msm-stub-codec",
433 .id = 1,
434};
435
436struct platform_device apq_voice = {
437 .name = "msm-pcm-voice",
438 .id = -1,
439};
440
441struct platform_device apq_voip = {
442 .name = "msm-voip-dsp",
443 .id = -1,
444};
445
446struct platform_device apq_lpa_pcm = {
447 .name = "msm-pcm-lpa",
448 .id = -1,
449};
450
451struct platform_device apq_pcm_hostless = {
452 .name = "msm-pcm-hostless",
453 .id = -1,
454};
455
456struct platform_device apq_cpudai_afe_01_rx = {
457 .name = "msm-dai-q6",
458 .id = 0xE0,
459};
460
461struct platform_device apq_cpudai_afe_01_tx = {
462 .name = "msm-dai-q6",
463 .id = 0xF0,
464};
465
466struct platform_device apq_cpudai_afe_02_rx = {
467 .name = "msm-dai-q6",
468 .id = 0xF1,
469};
470
471struct platform_device apq_cpudai_afe_02_tx = {
472 .name = "msm-dai-q6",
473 .id = 0xE1,
474};
475
476struct platform_device apq_pcm_afe = {
477 .name = "msm-pcm-afe",
478 .id = -1,
479};
480
Neema Shetty8427c262012-02-16 11:23:43 -0800481struct platform_device apq_cpudai_stub = {
482 .name = "msm-dai-stub",
483 .id = -1,
484};
485
Neema Shetty3c9d2862012-03-11 01:25:32 -0800486struct platform_device apq_cpudai_slimbus_1_rx = {
487 .name = "msm-dai-q6",
488 .id = 0x4002,
489};
490
491struct platform_device apq_cpudai_slimbus_1_tx = {
492 .name = "msm-dai-q6",
493 .id = 0x4003,
494};
495
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700496static struct resource resources_ssbi_pmic1[] = {
497 {
498 .start = MSM_PMIC1_SSBI_CMD_PHYS,
499 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
500 .flags = IORESOURCE_MEM,
501 },
502};
503
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600504#define LPASS_SLIMBUS_PHYS 0x28080000
505#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800506#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600507/* Board info for the slimbus slave device */
508static struct resource slimbus_res[] = {
509 {
510 .start = LPASS_SLIMBUS_PHYS,
511 .end = LPASS_SLIMBUS_PHYS + 8191,
512 .flags = IORESOURCE_MEM,
513 .name = "slimbus_physical",
514 },
515 {
516 .start = LPASS_SLIMBUS_BAM_PHYS,
517 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
518 .flags = IORESOURCE_MEM,
519 .name = "slimbus_bam_physical",
520 },
521 {
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800522 .start = LPASS_SLIMBUS_SLEW,
523 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
524 .flags = IORESOURCE_MEM,
525 .name = "slimbus_slew_reg",
526 },
527 {
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600528 .start = SLIMBUS0_CORE_EE1_IRQ,
529 .end = SLIMBUS0_CORE_EE1_IRQ,
530 .flags = IORESOURCE_IRQ,
531 .name = "slimbus_irq",
532 },
533 {
534 .start = SLIMBUS0_BAM_EE1_IRQ,
535 .end = SLIMBUS0_BAM_EE1_IRQ,
536 .flags = IORESOURCE_IRQ,
537 .name = "slimbus_bam_irq",
538 },
539};
540
541struct platform_device apq8064_slim_ctrl = {
542 .name = "msm_slim_ctrl",
543 .id = 1,
544 .num_resources = ARRAY_SIZE(slimbus_res),
545 .resource = slimbus_res,
546 .dev = {
547 .coherent_dma_mask = 0xffffffffULL,
548 },
549};
550
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700551struct platform_device apq8064_device_ssbi_pmic1 = {
552 .name = "msm_ssbi",
553 .id = 0,
554 .resource = resources_ssbi_pmic1,
555 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
556};
557
558static struct resource resources_ssbi_pmic2[] = {
559 {
560 .start = MSM_PMIC2_SSBI_CMD_PHYS,
561 .end = MSM_PMIC2_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
562 .flags = IORESOURCE_MEM,
563 },
564};
565
566struct platform_device apq8064_device_ssbi_pmic2 = {
567 .name = "msm_ssbi",
568 .id = 1,
569 .resource = resources_ssbi_pmic2,
570 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2),
571};
572
573static struct resource resources_otg[] = {
574 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800575 .start = MSM_HSUSB1_PHYS,
576 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700577 .flags = IORESOURCE_MEM,
578 },
579 {
580 .start = USB1_HS_IRQ,
581 .end = USB1_HS_IRQ,
582 .flags = IORESOURCE_IRQ,
583 },
584};
585
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700586struct platform_device apq8064_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700587 .name = "msm_otg",
588 .id = -1,
589 .num_resources = ARRAY_SIZE(resources_otg),
590 .resource = resources_otg,
591 .dev = {
592 .coherent_dma_mask = 0xffffffff,
593 },
594};
595
596static struct resource resources_hsusb[] = {
597 {
Hemant Kumard86c4882012-01-24 19:39:37 -0800598 .start = MSM_HSUSB1_PHYS,
599 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700600 .flags = IORESOURCE_MEM,
601 },
602 {
603 .start = USB1_HS_IRQ,
604 .end = USB1_HS_IRQ,
605 .flags = IORESOURCE_IRQ,
606 },
607};
608
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700609struct platform_device apq8064_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700610 .name = "msm_hsusb",
611 .id = -1,
612 .num_resources = ARRAY_SIZE(resources_hsusb),
613 .resource = resources_hsusb,
614 .dev = {
615 .coherent_dma_mask = 0xffffffff,
616 },
617};
618
Hemant Kumard86c4882012-01-24 19:39:37 -0800619static struct resource resources_hsusb_host[] = {
620 {
621 .start = MSM_HSUSB1_PHYS,
622 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
623 .flags = IORESOURCE_MEM,
624 },
625 {
626 .start = USB1_HS_IRQ,
627 .end = USB1_HS_IRQ,
628 .flags = IORESOURCE_IRQ,
629 },
630};
631
Hemant Kumara945b472012-01-25 15:08:06 -0800632static struct resource resources_hsic_host[] = {
633 {
634 .start = 0x12510000,
635 .end = 0x12510000 + SZ_4K - 1,
636 .flags = IORESOURCE_MEM,
637 },
638 {
639 .start = USB2_HSIC_IRQ,
640 .end = USB2_HSIC_IRQ,
641 .flags = IORESOURCE_IRQ,
642 },
643 {
644 .start = MSM_GPIO_TO_INT(49),
645 .end = MSM_GPIO_TO_INT(49),
646 .name = "peripheral_status_irq",
647 .flags = IORESOURCE_IRQ,
648 },
Vamsi Krishna6921cbe2012-02-21 18:34:43 -0800649 {
650 .start = MSM_GPIO_TO_INT(88),
651 .end = MSM_GPIO_TO_INT(88),
652 .name = "wakeup_irq",
653 .flags = IORESOURCE_IRQ,
654 },
Hemant Kumara945b472012-01-25 15:08:06 -0800655};
656
Hemant Kumard86c4882012-01-24 19:39:37 -0800657static u64 dma_mask = DMA_BIT_MASK(32);
658struct platform_device apq8064_device_hsusb_host = {
659 .name = "msm_hsusb_host",
660 .id = -1,
661 .num_resources = ARRAY_SIZE(resources_hsusb_host),
662 .resource = resources_hsusb_host,
663 .dev = {
664 .dma_mask = &dma_mask,
665 .coherent_dma_mask = 0xffffffff,
666 },
667};
668
Hemant Kumara945b472012-01-25 15:08:06 -0800669struct platform_device apq8064_device_hsic_host = {
670 .name = "msm_hsic_host",
671 .id = -1,
672 .num_resources = ARRAY_SIZE(resources_hsic_host),
673 .resource = resources_hsic_host,
674 .dev = {
675 .dma_mask = &dma_mask,
676 .coherent_dma_mask = DMA_BIT_MASK(32),
677 },
678};
679
Manu Gautam91223e02011-11-08 15:27:22 +0530680static struct resource resources_ehci_host3[] = {
681{
682 .start = MSM_HSUSB3_PHYS,
683 .end = MSM_HSUSB3_PHYS + MSM_HSUSB3_SIZE - 1,
684 .flags = IORESOURCE_MEM,
685 },
686 {
687 .start = USB3_HS_IRQ,
688 .end = USB3_HS_IRQ,
689 .flags = IORESOURCE_IRQ,
690 },
691};
692
693struct platform_device apq8064_device_ehci_host3 = {
694 .name = "msm_ehci_host",
695 .id = 0,
696 .num_resources = ARRAY_SIZE(resources_ehci_host3),
697 .resource = resources_ehci_host3,
698 .dev = {
699 .dma_mask = &dma_mask,
700 .coherent_dma_mask = 0xffffffff,
701 },
702};
703
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800704static struct resource resources_ehci_host4[] = {
705{
706 .start = MSM_HSUSB4_PHYS,
707 .end = MSM_HSUSB4_PHYS + MSM_HSUSB4_SIZE - 1,
708 .flags = IORESOURCE_MEM,
709 },
710 {
711 .start = USB4_HS_IRQ,
712 .end = USB4_HS_IRQ,
713 .flags = IORESOURCE_IRQ,
714 },
715};
716
717struct platform_device apq8064_device_ehci_host4 = {
718 .name = "msm_ehci_host",
719 .id = 1,
720 .num_resources = ARRAY_SIZE(resources_ehci_host4),
721 .resource = resources_ehci_host4,
722 .dev = {
723 .dma_mask = &dma_mask,
724 .coherent_dma_mask = 0xffffffff,
725 },
726};
727
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -0800728/* MSM Video core device */
729#ifdef CONFIG_MSM_BUS_SCALING
730static struct msm_bus_vectors vidc_init_vectors[] = {
731 {
732 .src = MSM_BUS_MASTER_VIDEO_ENC,
733 .dst = MSM_BUS_SLAVE_EBI_CH0,
734 .ab = 0,
735 .ib = 0,
736 },
737 {
738 .src = MSM_BUS_MASTER_VIDEO_DEC,
739 .dst = MSM_BUS_SLAVE_EBI_CH0,
740 .ab = 0,
741 .ib = 0,
742 },
743 {
744 .src = MSM_BUS_MASTER_AMPSS_M0,
745 .dst = MSM_BUS_SLAVE_EBI_CH0,
746 .ab = 0,
747 .ib = 0,
748 },
749 {
750 .src = MSM_BUS_MASTER_AMPSS_M0,
751 .dst = MSM_BUS_SLAVE_EBI_CH0,
752 .ab = 0,
753 .ib = 0,
754 },
755};
756static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
757 {
758 .src = MSM_BUS_MASTER_VIDEO_ENC,
759 .dst = MSM_BUS_SLAVE_EBI_CH0,
760 .ab = 54525952,
761 .ib = 436207616,
762 },
763 {
764 .src = MSM_BUS_MASTER_VIDEO_DEC,
765 .dst = MSM_BUS_SLAVE_EBI_CH0,
766 .ab = 72351744,
767 .ib = 289406976,
768 },
769 {
770 .src = MSM_BUS_MASTER_AMPSS_M0,
771 .dst = MSM_BUS_SLAVE_EBI_CH0,
772 .ab = 500000,
773 .ib = 1000000,
774 },
775 {
776 .src = MSM_BUS_MASTER_AMPSS_M0,
777 .dst = MSM_BUS_SLAVE_EBI_CH0,
778 .ab = 500000,
779 .ib = 1000000,
780 },
781};
782static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
783 {
784 .src = MSM_BUS_MASTER_VIDEO_ENC,
785 .dst = MSM_BUS_SLAVE_EBI_CH0,
786 .ab = 40894464,
787 .ib = 327155712,
788 },
789 {
790 .src = MSM_BUS_MASTER_VIDEO_DEC,
791 .dst = MSM_BUS_SLAVE_EBI_CH0,
792 .ab = 48234496,
793 .ib = 192937984,
794 },
795 {
796 .src = MSM_BUS_MASTER_AMPSS_M0,
797 .dst = MSM_BUS_SLAVE_EBI_CH0,
798 .ab = 500000,
799 .ib = 2000000,
800 },
801 {
802 .src = MSM_BUS_MASTER_AMPSS_M0,
803 .dst = MSM_BUS_SLAVE_EBI_CH0,
804 .ab = 500000,
805 .ib = 2000000,
806 },
807};
808static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
809 {
810 .src = MSM_BUS_MASTER_VIDEO_ENC,
811 .dst = MSM_BUS_SLAVE_EBI_CH0,
812 .ab = 163577856,
813 .ib = 1308622848,
814 },
815 {
816 .src = MSM_BUS_MASTER_VIDEO_DEC,
817 .dst = MSM_BUS_SLAVE_EBI_CH0,
818 .ab = 219152384,
819 .ib = 876609536,
820 },
821 {
822 .src = MSM_BUS_MASTER_AMPSS_M0,
823 .dst = MSM_BUS_SLAVE_EBI_CH0,
824 .ab = 1750000,
825 .ib = 3500000,
826 },
827 {
828 .src = MSM_BUS_MASTER_AMPSS_M0,
829 .dst = MSM_BUS_SLAVE_EBI_CH0,
830 .ab = 1750000,
831 .ib = 3500000,
832 },
833};
834static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
835 {
836 .src = MSM_BUS_MASTER_VIDEO_ENC,
837 .dst = MSM_BUS_SLAVE_EBI_CH0,
838 .ab = 121634816,
839 .ib = 973078528,
840 },
841 {
842 .src = MSM_BUS_MASTER_VIDEO_DEC,
843 .dst = MSM_BUS_SLAVE_EBI_CH0,
844 .ab = 155189248,
845 .ib = 620756992,
846 },
847 {
848 .src = MSM_BUS_MASTER_AMPSS_M0,
849 .dst = MSM_BUS_SLAVE_EBI_CH0,
850 .ab = 1750000,
851 .ib = 7000000,
852 },
853 {
854 .src = MSM_BUS_MASTER_AMPSS_M0,
855 .dst = MSM_BUS_SLAVE_EBI_CH0,
856 .ab = 1750000,
857 .ib = 7000000,
858 },
859};
860static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
861 {
862 .src = MSM_BUS_MASTER_VIDEO_ENC,
863 .dst = MSM_BUS_SLAVE_EBI_CH0,
864 .ab = 372244480,
865 .ib = 2560000000U,
866 },
867 {
868 .src = MSM_BUS_MASTER_VIDEO_DEC,
869 .dst = MSM_BUS_SLAVE_EBI_CH0,
870 .ab = 501219328,
871 .ib = 2560000000U,
872 },
873 {
874 .src = MSM_BUS_MASTER_AMPSS_M0,
875 .dst = MSM_BUS_SLAVE_EBI_CH0,
876 .ab = 2500000,
877 .ib = 5000000,
878 },
879 {
880 .src = MSM_BUS_MASTER_AMPSS_M0,
881 .dst = MSM_BUS_SLAVE_EBI_CH0,
882 .ab = 2500000,
883 .ib = 5000000,
884 },
885};
886static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
887 {
888 .src = MSM_BUS_MASTER_VIDEO_ENC,
889 .dst = MSM_BUS_SLAVE_EBI_CH0,
890 .ab = 222298112,
891 .ib = 2560000000U,
892 },
893 {
894 .src = MSM_BUS_MASTER_VIDEO_DEC,
895 .dst = MSM_BUS_SLAVE_EBI_CH0,
896 .ab = 330301440,
897 .ib = 2560000000U,
898 },
899 {
900 .src = MSM_BUS_MASTER_AMPSS_M0,
901 .dst = MSM_BUS_SLAVE_EBI_CH0,
902 .ab = 2500000,
903 .ib = 700000000,
904 },
905 {
906 .src = MSM_BUS_MASTER_AMPSS_M0,
907 .dst = MSM_BUS_SLAVE_EBI_CH0,
908 .ab = 2500000,
909 .ib = 10000000,
910 },
911};
912
913static struct msm_bus_paths vidc_bus_client_config[] = {
914 {
915 ARRAY_SIZE(vidc_init_vectors),
916 vidc_init_vectors,
917 },
918 {
919 ARRAY_SIZE(vidc_venc_vga_vectors),
920 vidc_venc_vga_vectors,
921 },
922 {
923 ARRAY_SIZE(vidc_vdec_vga_vectors),
924 vidc_vdec_vga_vectors,
925 },
926 {
927 ARRAY_SIZE(vidc_venc_720p_vectors),
928 vidc_venc_720p_vectors,
929 },
930 {
931 ARRAY_SIZE(vidc_vdec_720p_vectors),
932 vidc_vdec_720p_vectors,
933 },
934 {
935 ARRAY_SIZE(vidc_venc_1080p_vectors),
936 vidc_venc_1080p_vectors,
937 },
938 {
939 ARRAY_SIZE(vidc_vdec_1080p_vectors),
940 vidc_vdec_1080p_vectors,
941 },
942};
943
944static struct msm_bus_scale_pdata vidc_bus_client_data = {
945 vidc_bus_client_config,
946 ARRAY_SIZE(vidc_bus_client_config),
947 .name = "vidc",
948};
949#endif
950
951
952#define APQ8064_VIDC_BASE_PHYS 0x04400000
953#define APQ8064_VIDC_BASE_SIZE 0x00100000
954
955static struct resource apq8064_device_vidc_resources[] = {
956 {
957 .start = APQ8064_VIDC_BASE_PHYS,
958 .end = APQ8064_VIDC_BASE_PHYS + APQ8064_VIDC_BASE_SIZE - 1,
959 .flags = IORESOURCE_MEM,
960 },
961 {
962 .start = VCODEC_IRQ,
963 .end = VCODEC_IRQ,
964 .flags = IORESOURCE_IRQ,
965 },
966};
967
968struct msm_vidc_platform_data apq8064_vidc_platform_data = {
969#ifdef CONFIG_MSM_BUS_SCALING
970 .vidc_bus_client_pdata = &vidc_bus_client_data,
971#endif
972#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
973 .memtype = ION_CP_MM_HEAP_ID,
974 .enable_ion = 1,
975#else
976 .memtype = MEMTYPE_EBI1,
977 .enable_ion = 0,
978#endif
979 .disable_dmx = 0,
980 .disable_fullhd = 0,
981};
982
983struct platform_device apq8064_msm_device_vidc = {
984 .name = "msm_vidc",
985 .id = 0,
986 .num_resources = ARRAY_SIZE(apq8064_device_vidc_resources),
987 .resource = apq8064_device_vidc_resources,
988 .dev = {
989 .platform_data = &apq8064_vidc_platform_data,
990 },
991};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992#define MSM_SDC1_BASE 0x12400000
993#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
994#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
995#define MSM_SDC2_BASE 0x12140000
996#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
997#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
998#define MSM_SDC3_BASE 0x12180000
999#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1000#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1001#define MSM_SDC4_BASE 0x121C0000
1002#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1003#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1004
1005static struct resource resources_sdc1[] = {
1006 {
1007 .name = "core_mem",
1008 .flags = IORESOURCE_MEM,
1009 .start = MSM_SDC1_BASE,
1010 .end = MSM_SDC1_DML_BASE - 1,
1011 },
1012 {
1013 .name = "core_irq",
1014 .flags = IORESOURCE_IRQ,
1015 .start = SDC1_IRQ_0,
1016 .end = SDC1_IRQ_0
1017 },
1018#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1019 {
1020 .name = "sdcc_dml_addr",
1021 .start = MSM_SDC1_DML_BASE,
1022 .end = MSM_SDC1_BAM_BASE - 1,
1023 .flags = IORESOURCE_MEM,
1024 },
1025 {
1026 .name = "sdcc_bam_addr",
1027 .start = MSM_SDC1_BAM_BASE,
1028 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1029 .flags = IORESOURCE_MEM,
1030 },
1031 {
1032 .name = "sdcc_bam_irq",
1033 .start = SDC1_BAM_IRQ,
1034 .end = SDC1_BAM_IRQ,
1035 .flags = IORESOURCE_IRQ,
1036 },
1037#endif
1038};
1039
1040static struct resource resources_sdc2[] = {
1041 {
1042 .name = "core_mem",
1043 .flags = IORESOURCE_MEM,
1044 .start = MSM_SDC2_BASE,
1045 .end = MSM_SDC2_DML_BASE - 1,
1046 },
1047 {
1048 .name = "core_irq",
1049 .flags = IORESOURCE_IRQ,
1050 .start = SDC2_IRQ_0,
1051 .end = SDC2_IRQ_0
1052 },
1053#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1054 {
1055 .name = "sdcc_dml_addr",
1056 .start = MSM_SDC2_DML_BASE,
1057 .end = MSM_SDC2_BAM_BASE - 1,
1058 .flags = IORESOURCE_MEM,
1059 },
1060 {
1061 .name = "sdcc_bam_addr",
1062 .start = MSM_SDC2_BAM_BASE,
1063 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1064 .flags = IORESOURCE_MEM,
1065 },
1066 {
1067 .name = "sdcc_bam_irq",
1068 .start = SDC2_BAM_IRQ,
1069 .end = SDC2_BAM_IRQ,
1070 .flags = IORESOURCE_IRQ,
1071 },
1072#endif
1073};
1074
1075static struct resource resources_sdc3[] = {
1076 {
1077 .name = "core_mem",
1078 .flags = IORESOURCE_MEM,
1079 .start = MSM_SDC3_BASE,
1080 .end = MSM_SDC3_DML_BASE - 1,
1081 },
1082 {
1083 .name = "core_irq",
1084 .flags = IORESOURCE_IRQ,
1085 .start = SDC3_IRQ_0,
1086 .end = SDC3_IRQ_0
1087 },
1088#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1089 {
1090 .name = "sdcc_dml_addr",
1091 .start = MSM_SDC3_DML_BASE,
1092 .end = MSM_SDC3_BAM_BASE - 1,
1093 .flags = IORESOURCE_MEM,
1094 },
1095 {
1096 .name = "sdcc_bam_addr",
1097 .start = MSM_SDC3_BAM_BASE,
1098 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1099 .flags = IORESOURCE_MEM,
1100 },
1101 {
1102 .name = "sdcc_bam_irq",
1103 .start = SDC3_BAM_IRQ,
1104 .end = SDC3_BAM_IRQ,
1105 .flags = IORESOURCE_IRQ,
1106 },
1107#endif
1108};
1109
1110static struct resource resources_sdc4[] = {
1111 {
1112 .name = "core_mem",
1113 .flags = IORESOURCE_MEM,
1114 .start = MSM_SDC4_BASE,
1115 .end = MSM_SDC4_DML_BASE - 1,
1116 },
1117 {
1118 .name = "core_irq",
1119 .flags = IORESOURCE_IRQ,
1120 .start = SDC4_IRQ_0,
1121 .end = SDC4_IRQ_0
1122 },
1123#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1124 {
1125 .name = "sdcc_dml_addr",
1126 .start = MSM_SDC4_DML_BASE,
1127 .end = MSM_SDC4_BAM_BASE - 1,
1128 .flags = IORESOURCE_MEM,
1129 },
1130 {
1131 .name = "sdcc_bam_addr",
1132 .start = MSM_SDC4_BAM_BASE,
1133 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1134 .flags = IORESOURCE_MEM,
1135 },
1136 {
1137 .name = "sdcc_bam_irq",
1138 .start = SDC4_BAM_IRQ,
1139 .end = SDC4_BAM_IRQ,
1140 .flags = IORESOURCE_IRQ,
1141 },
1142#endif
1143};
1144
1145struct platform_device apq8064_device_sdc1 = {
1146 .name = "msm_sdcc",
1147 .id = 1,
1148 .num_resources = ARRAY_SIZE(resources_sdc1),
1149 .resource = resources_sdc1,
1150 .dev = {
1151 .coherent_dma_mask = 0xffffffff,
1152 },
1153};
1154
1155struct platform_device apq8064_device_sdc2 = {
1156 .name = "msm_sdcc",
1157 .id = 2,
1158 .num_resources = ARRAY_SIZE(resources_sdc2),
1159 .resource = resources_sdc2,
1160 .dev = {
1161 .coherent_dma_mask = 0xffffffff,
1162 },
1163};
1164
1165struct platform_device apq8064_device_sdc3 = {
1166 .name = "msm_sdcc",
1167 .id = 3,
1168 .num_resources = ARRAY_SIZE(resources_sdc3),
1169 .resource = resources_sdc3,
1170 .dev = {
1171 .coherent_dma_mask = 0xffffffff,
1172 },
1173};
1174
1175struct platform_device apq8064_device_sdc4 = {
1176 .name = "msm_sdcc",
1177 .id = 4,
1178 .num_resources = ARRAY_SIZE(resources_sdc4),
1179 .resource = resources_sdc4,
1180 .dev = {
1181 .coherent_dma_mask = 0xffffffff,
1182 },
1183};
1184
1185static struct platform_device *apq8064_sdcc_devices[] __initdata = {
1186 &apq8064_device_sdc1,
1187 &apq8064_device_sdc2,
1188 &apq8064_device_sdc3,
1189 &apq8064_device_sdc4,
1190};
1191
1192int __init apq8064_add_sdcc(unsigned int controller,
1193 struct mmc_platform_data *plat)
1194{
1195 struct platform_device *pdev;
1196
1197 if (!plat)
1198 return 0;
1199 if (controller < 1 || controller > 4)
1200 return -EINVAL;
1201
1202 pdev = apq8064_sdcc_devices[controller-1];
1203 pdev->dev.platform_data = plat;
1204 return platform_device_register(pdev);
1205}
1206
Yan He06913ce2011-08-26 16:33:46 -07001207static struct resource resources_sps[] = {
1208 {
1209 .name = "pipe_mem",
1210 .start = 0x12800000,
1211 .end = 0x12800000 + 0x4000 - 1,
1212 .flags = IORESOURCE_MEM,
1213 },
1214 {
1215 .name = "bamdma_dma",
1216 .start = 0x12240000,
1217 .end = 0x12240000 + 0x1000 - 1,
1218 .flags = IORESOURCE_MEM,
1219 },
1220 {
1221 .name = "bamdma_bam",
1222 .start = 0x12244000,
1223 .end = 0x12244000 + 0x4000 - 1,
1224 .flags = IORESOURCE_MEM,
1225 },
1226 {
1227 .name = "bamdma_irq",
1228 .start = SPS_BAM_DMA_IRQ,
1229 .end = SPS_BAM_DMA_IRQ,
1230 .flags = IORESOURCE_IRQ,
1231 },
1232};
1233
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001234struct platform_device msm_bus_8064_sys_fabric = {
1235 .name = "msm_bus_fabric",
1236 .id = MSM_BUS_FAB_SYSTEM,
1237};
1238struct platform_device msm_bus_8064_apps_fabric = {
1239 .name = "msm_bus_fabric",
1240 .id = MSM_BUS_FAB_APPSS,
1241};
1242struct platform_device msm_bus_8064_mm_fabric = {
1243 .name = "msm_bus_fabric",
1244 .id = MSM_BUS_FAB_MMSS,
1245};
1246struct platform_device msm_bus_8064_sys_fpb = {
1247 .name = "msm_bus_fabric",
1248 .id = MSM_BUS_FAB_SYSTEM_FPB,
1249};
1250struct platform_device msm_bus_8064_cpss_fpb = {
1251 .name = "msm_bus_fabric",
1252 .id = MSM_BUS_FAB_CPSS_FPB,
1253};
1254
Yan He06913ce2011-08-26 16:33:46 -07001255static struct msm_sps_platform_data msm_sps_pdata = {
1256 .bamdma_restricted_pipes = 0x06,
1257};
1258
1259struct platform_device msm_device_sps_apq8064 = {
1260 .name = "msm_sps",
1261 .id = -1,
1262 .num_resources = ARRAY_SIZE(resources_sps),
1263 .resource = resources_sps,
1264 .dev.platform_data = &msm_sps_pdata,
1265};
1266
Eric Holmberg023d25c2012-03-01 12:27:55 -07001267static struct resource smd_resource[] = {
1268 {
1269 .name = "a9_m2a_0",
1270 .start = INT_A9_M2A_0,
1271 .flags = IORESOURCE_IRQ,
1272 },
1273 {
1274 .name = "a9_m2a_5",
1275 .start = INT_A9_M2A_5,
1276 .flags = IORESOURCE_IRQ,
1277 },
1278 {
1279 .name = "adsp_a11",
1280 .start = INT_ADSP_A11,
1281 .flags = IORESOURCE_IRQ,
1282 },
1283 {
1284 .name = "adsp_a11_smsm",
1285 .start = INT_ADSP_A11_SMSM,
1286 .flags = IORESOURCE_IRQ,
1287 },
1288 {
1289 .name = "dsps_a11",
1290 .start = INT_DSPS_A11,
1291 .flags = IORESOURCE_IRQ,
1292 },
1293 {
1294 .name = "dsps_a11_smsm",
1295 .start = INT_DSPS_A11_SMSM,
1296 .flags = IORESOURCE_IRQ,
1297 },
1298 {
1299 .name = "wcnss_a11",
1300 .start = INT_WCNSS_A11,
1301 .flags = IORESOURCE_IRQ,
1302 },
1303 {
1304 .name = "wcnss_a11_smsm",
1305 .start = INT_WCNSS_A11_SMSM,
1306 .flags = IORESOURCE_IRQ,
1307 },
1308};
1309
1310static struct smd_subsystem_config smd_config_list[] = {
1311 {
1312 .irq_config_id = SMD_MODEM,
1313 .subsys_name = "gss",
1314 .edge = SMD_APPS_MODEM,
1315
1316 .smd_int.irq_name = "a9_m2a_0",
1317 .smd_int.flags = IRQF_TRIGGER_RISING,
1318 .smd_int.irq_id = -1,
1319 .smd_int.device_name = "smd_dev",
1320 .smd_int.dev_id = 0,
1321 .smd_int.out_bit_pos = 1 << 3,
1322 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1323 .smd_int.out_offset = 0x8,
1324
1325 .smsm_int.irq_name = "a9_m2a_5",
1326 .smsm_int.flags = IRQF_TRIGGER_RISING,
1327 .smsm_int.irq_id = -1,
1328 .smsm_int.device_name = "smd_smsm",
1329 .smsm_int.dev_id = 0,
1330 .smsm_int.out_bit_pos = 1 << 4,
1331 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1332 .smsm_int.out_offset = 0x8,
1333 },
1334 {
1335 .irq_config_id = SMD_Q6,
1336 .subsys_name = "q6",
1337 .edge = SMD_APPS_QDSP,
1338
1339 .smd_int.irq_name = "adsp_a11",
1340 .smd_int.flags = IRQF_TRIGGER_RISING,
1341 .smd_int.irq_id = -1,
1342 .smd_int.device_name = "smd_dev",
1343 .smd_int.dev_id = 0,
1344 .smd_int.out_bit_pos = 1 << 15,
1345 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1346 .smd_int.out_offset = 0x8,
1347
1348 .smsm_int.irq_name = "adsp_a11_smsm",
1349 .smsm_int.flags = IRQF_TRIGGER_RISING,
1350 .smsm_int.irq_id = -1,
1351 .smsm_int.device_name = "smd_smsm",
1352 .smsm_int.dev_id = 0,
1353 .smsm_int.out_bit_pos = 1 << 14,
1354 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1355 .smsm_int.out_offset = 0x8,
1356 },
1357 {
1358 .irq_config_id = SMD_DSPS,
1359 .subsys_name = "dsps",
1360 .edge = SMD_APPS_DSPS,
1361
1362 .smd_int.irq_name = "dsps_a11",
1363 .smd_int.flags = IRQF_TRIGGER_RISING,
1364 .smd_int.irq_id = -1,
1365 .smd_int.device_name = "smd_dev",
1366 .smd_int.dev_id = 0,
1367 .smd_int.out_bit_pos = 1,
1368 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1369 .smd_int.out_offset = 0x4080,
1370
1371 .smsm_int.irq_name = "dsps_a11_smsm",
1372 .smsm_int.flags = IRQF_TRIGGER_RISING,
1373 .smsm_int.irq_id = -1,
1374 .smsm_int.device_name = "smd_smsm",
1375 .smsm_int.dev_id = 0,
1376 .smsm_int.out_bit_pos = 1,
1377 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1378 .smsm_int.out_offset = 0x4094,
1379 },
1380 {
1381 .irq_config_id = SMD_WCNSS,
1382 .subsys_name = "wcnss",
1383 .edge = SMD_APPS_WCNSS,
1384
1385 .smd_int.irq_name = "wcnss_a11",
1386 .smd_int.flags = IRQF_TRIGGER_RISING,
1387 .smd_int.irq_id = -1,
1388 .smd_int.device_name = "smd_dev",
1389 .smd_int.dev_id = 0,
1390 .smd_int.out_bit_pos = 1 << 25,
1391 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1392 .smd_int.out_offset = 0x8,
1393
1394 .smsm_int.irq_name = "wcnss_a11_smsm",
1395 .smsm_int.flags = IRQF_TRIGGER_RISING,
1396 .smsm_int.irq_id = -1,
1397 .smsm_int.device_name = "smd_smsm",
1398 .smsm_int.dev_id = 0,
1399 .smsm_int.out_bit_pos = 1 << 23,
1400 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1401 .smsm_int.out_offset = 0x8,
1402 },
1403};
1404
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001405static struct smd_subsystem_restart_config smd_ssr_config = {
1406 .disable_smsm_reset_handshake = 1,
1407};
1408
Eric Holmberg023d25c2012-03-01 12:27:55 -07001409static struct smd_platform smd_platform_data = {
1410 .num_ss_configs = ARRAY_SIZE(smd_config_list),
1411 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06001412 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001413};
1414
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001415struct platform_device msm_device_smd_apq8064 = {
1416 .name = "msm_smd",
1417 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07001418 .resource = smd_resource,
1419 .num_resources = ARRAY_SIZE(smd_resource),
1420 .dev = {
1421 .platform_data = &smd_platform_data,
1422 },
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001423};
1424
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001425#ifdef CONFIG_HW_RANDOM_MSM
1426/* PRNG device */
1427#define MSM_PRNG_PHYS 0x1A500000
1428static struct resource rng_resources = {
1429 .flags = IORESOURCE_MEM,
1430 .start = MSM_PRNG_PHYS,
1431 .end = MSM_PRNG_PHYS + SZ_512 - 1,
1432};
1433
1434struct platform_device apq8064_device_rng = {
1435 .name = "msm_rng",
1436 .id = 0,
1437 .num_resources = 1,
1438 .resource = &rng_resources,
1439};
1440#endif
1441
Matt Wagantall292aace2012-01-26 19:12:34 -08001442static struct resource msm_gss_resources[] = {
1443 {
1444 .start = 0x10000000,
1445 .end = 0x10000000 + SZ_256 - 1,
1446 .flags = IORESOURCE_MEM,
1447 },
Matt Wagantall19ac4fd2012-02-03 20:18:23 -08001448 {
1449 .start = 0x10008000,
1450 .end = 0x10008000 + SZ_256 - 1,
1451 .flags = IORESOURCE_MEM,
1452 },
Matt Wagantall292aace2012-01-26 19:12:34 -08001453};
1454
1455struct platform_device msm_gss = {
1456 .name = "pil_gss",
1457 .id = -1,
1458 .num_resources = ARRAY_SIZE(msm_gss_resources),
1459 .resource = msm_gss_resources,
1460};
1461
Matt Wagantall1875d322012-02-22 16:11:33 -08001462struct platform_device *apq8064_fs_devices[] = {
1463 FS_8X60(FS_ROT, "fs_rot"),
1464 FS_8X60(FS_IJPEG, "fs_ijpeg"),
1465 FS_8X60(FS_VFE, "fs_vfe"),
1466 FS_8X60(FS_VPE, "fs_vpe"),
1467 FS_8X60(FS_GFX3D, "fs_gfx3d"),
1468 FS_8X60(FS_VED, "fs_ved"),
1469 FS_8X60(FS_VCAP, "fs_vcap"),
1470};
1471unsigned apq8064_num_fs_devices = ARRAY_SIZE(apq8064_fs_devices);
1472
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001473static struct clk_lookup msm_clocks_8064_dummy[] = {
1474 CLK_DUMMY("pll2", PLL2, NULL, 0),
1475 CLK_DUMMY("pll8", PLL8, NULL, 0),
1476 CLK_DUMMY("pll4", PLL4, NULL, 0),
1477
1478 CLK_DUMMY("afab_clk", AFAB_CLK, NULL, 0),
1479 CLK_DUMMY("afab_a_clk", AFAB_A_CLK, NULL, 0),
1480 CLK_DUMMY("cfpb_clk", CFPB_CLK, NULL, 0),
1481 CLK_DUMMY("cfpb_a_clk", CFPB_A_CLK, NULL, 0),
1482 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1483 CLK_DUMMY("dfab_a_clk", DFAB_A_CLK, NULL, 0),
1484 CLK_DUMMY("ebi1_clk", EBI1_CLK, NULL, 0),
1485 CLK_DUMMY("ebi1_a_clk", EBI1_A_CLK, NULL, 0),
1486 CLK_DUMMY("mmfab_clk", MMFAB_CLK, NULL, 0),
1487 CLK_DUMMY("mmfab_a_clk", MMFAB_A_CLK, NULL, 0),
1488 CLK_DUMMY("mmfpb_clk", MMFPB_CLK, NULL, 0),
1489 CLK_DUMMY("mmfpb_a_clk", MMFPB_A_CLK, NULL, 0),
1490 CLK_DUMMY("sfab_clk", SFAB_CLK, NULL, 0),
1491 CLK_DUMMY("sfab_a_clk", SFAB_A_CLK, NULL, 0),
1492 CLK_DUMMY("sfpb_clk", SFPB_CLK, NULL, 0),
1493 CLK_DUMMY("sfpb_a_clk", SFPB_A_CLK, NULL, 0),
1494
Matt Wagantalle2522372011-08-17 14:52:21 -07001495 CLK_DUMMY("core_clk", GSBI1_UART_CLK, NULL, OFF),
1496 CLK_DUMMY("core_clk", GSBI2_UART_CLK, NULL, OFF),
1497 CLK_DUMMY("core_clk", GSBI3_UART_CLK,
Jing Lin04601f92012-02-05 15:36:07 -08001498 NULL, OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07001499 CLK_DUMMY("core_clk", GSBI4_UART_CLK, NULL, OFF),
1500 CLK_DUMMY("core_clk", GSBI5_UART_CLK, NULL, OFF),
1501 CLK_DUMMY("core_clk", GSBI6_UART_CLK, NULL, OFF),
1502 CLK_DUMMY("core_clk", GSBI7_UART_CLK, NULL, OFF),
1503 CLK_DUMMY("core_clk", GSBI8_UART_CLK, NULL, OFF),
1504 CLK_DUMMY("core_clk", GSBI9_UART_CLK, NULL, OFF),
1505 CLK_DUMMY("core_clk", GSBI10_UART_CLK, NULL, OFF),
1506 CLK_DUMMY("core_clk", GSBI11_UART_CLK, NULL, OFF),
1507 CLK_DUMMY("core_clk", GSBI12_UART_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001508 CLK_DUMMY("core_clk", GSBI1_QUP_CLK, NULL, OFF),
1509 CLK_DUMMY("core_clk", GSBI2_QUP_CLK, NULL, OFF),
Jing Lin04601f92012-02-05 15:36:07 -08001510 CLK_DUMMY("core_clk", GSBI3_QUP_CLK, "qup_i2c.3", OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07001511 CLK_DUMMY("core_clk", GSBI4_QUP_CLK, "qup_i2c.4", OFF),
1512 CLK_DUMMY("core_clk", GSBI5_QUP_CLK, "spi_qsd.0", OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001513 CLK_DUMMY("core_clk", GSBI6_QUP_CLK, NULL, OFF),
1514 CLK_DUMMY("core_clk", GSBI7_QUP_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001515 CLK_DUMMY("core_clk", PDM_CLK, NULL, OFF),
Matt Wagantalld86d6832011-08-17 14:06:55 -07001516 CLK_DUMMY("mem_clk", PMEM_CLK, NULL, OFF),
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001517 CLK_DUMMY("core_clk", PRNG_CLK, "msm_rng.0", OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001518 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
1519 CLK_DUMMY("core_clk", SDC2_CLK, NULL, OFF),
1520 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
1521 CLK_DUMMY("core_clk", SDC4_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001522 CLK_DUMMY("ref_clk", TSIF_REF_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001523 CLK_DUMMY("core_clk", TSSC_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08001524 CLK_DUMMY("alt_core_clk", USB_HS1_XCVR_CLK, NULL, OFF),
1525 CLK_DUMMY("alt_core_clk", USB_HS3_XCVR_CLK, NULL, OFF),
1526 CLK_DUMMY("alt_core_clk", USB_HS4_XCVR_CLK, NULL, OFF),
1527 CLK_DUMMY("phy_clk", USB_PHY0_CLK, NULL, OFF),
1528 CLK_DUMMY("src_clk", USB_FS1_SRC_CLK, NULL, OFF),
1529 CLK_DUMMY("alt_core_clk", USB_FS1_XCVR_CLK, NULL, OFF),
1530 CLK_DUMMY("sys_clk", USB_FS1_SYS_CLK, NULL, OFF),
Matt Wagantallc4b3a4d2011-08-17 16:58:39 -07001531 CLK_DUMMY("core_clk", CE2_CLK, NULL, OFF),
1532 CLK_DUMMY("core_clk", CE1_CORE_CLK, NULL, OFF),
1533 CLK_DUMMY("core_clk", CE3_CORE_CLK, NULL, OFF),
1534 CLK_DUMMY("iface_clk", CE3_P_CLK, NULL, OFF),
Tianyi Gou86bb4722011-08-09 13:28:02 -07001535 CLK_DUMMY("pcie_pclk", PCIE_P_CLK, NULL, OFF),
1536 CLK_DUMMY("pcie_alt_ref_clk", PCIE_ALT_REF_CLK, NULL, OFF),
1537 CLK_DUMMY("sata_rxoob_clk", SATA_RXOOB_CLK, NULL, OFF),
1538 CLK_DUMMY("sata_pmalive_clk", SATA_PMALIVE_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001539 CLK_DUMMY("ref_clk", SATA_PHY_REF_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001540 CLK_DUMMY("iface_clk", GSBI1_P_CLK, NULL, OFF),
1541 CLK_DUMMY("iface_clk", GSBI2_P_CLK, NULL, OFF),
Jing Lin04601f92012-02-05 15:36:07 -08001542 CLK_DUMMY("iface_clk", GSBI3_P_CLK, "qup_i2c.3", OFF),
Matt Wagantallac294852011-08-17 15:44:58 -07001543 CLK_DUMMY("iface_clk", GSBI4_P_CLK, "qup_i2c.4", OFF),
1544 CLK_DUMMY("iface_clk", GSBI5_P_CLK, "spi_qsd.0", OFF),
Matt Wagantalle2522372011-08-17 14:52:21 -07001545 CLK_DUMMY("iface_clk", GSBI6_P_CLK, NULL, OFF),
Matt Wagantall62cf63e2011-08-17 16:34:47 -07001546 CLK_DUMMY("iface_clk", GSBI7_P_CLK, NULL, OFF),
Matt Wagantall640e5fd2011-08-17 16:08:53 -07001547 CLK_DUMMY("iface_clk", TSIF_P_CLK, NULL, OFF),
Manu Gautam5143b252012-01-05 19:25:23 -08001548 CLK_DUMMY("iface_clk", USB_FS1_P_CLK, NULL, OFF),
1549 CLK_DUMMY("iface_clk", USB_HS1_P_CLK, NULL, OFF),
1550 CLK_DUMMY("iface_clk", USB_HS3_P_CLK, NULL, OFF),
1551 CLK_DUMMY("iface_clk", USB_HS4_P_CLK, NULL, OFF),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001552 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
1553 CLK_DUMMY("iface_clk", SDC2_P_CLK, NULL, OFF),
1554 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
1555 CLK_DUMMY("iface_clk", SDC4_P_CLK, NULL, OFF),
Jin Hong01f2dbb2011-11-03 22:13:51 -07001556 CLK_DUMMY("core_clk", ADM0_CLK, "msm_dmov", OFF),
1557 CLK_DUMMY("iface_clk", ADM0_P_CLK, "msm_dmov", OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001558 CLK_DUMMY("iface_clk", PMIC_ARB0_P_CLK, NULL, OFF),
1559 CLK_DUMMY("iface_clk", PMIC_ARB1_P_CLK, NULL, OFF),
1560 CLK_DUMMY("core_clk", PMIC_SSBI2_CLK, NULL, OFF),
1561 CLK_DUMMY("mem_clk", RPM_MSG_RAM_P_CLK, NULL, OFF),
1562 CLK_DUMMY("core_clk", AMP_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001563 CLK_DUMMY("cam_clk", CAM0_CLK, NULL, OFF),
1564 CLK_DUMMY("cam_clk", CAM1_CLK, NULL, OFF),
1565 CLK_DUMMY("csi_src_clk", CSI0_SRC_CLK, NULL, OFF),
1566 CLK_DUMMY("csi_src_clk", CSI1_SRC_CLK, NULL, OFF),
1567 CLK_DUMMY("csi_clk", CSI0_CLK, NULL, OFF),
1568 CLK_DUMMY("csi_clk", CSI1_CLK, NULL, OFF),
1569 CLK_DUMMY("csi_pix_clk", CSI_PIX_CLK, NULL, OFF),
1570 CLK_DUMMY("csi_rdi_clk", CSI_RDI_CLK, NULL, OFF),
1571 CLK_DUMMY("csiphy_timer_src_clk", CSIPHY_TIMER_SRC_CLK, NULL, OFF),
1572 CLK_DUMMY("csi0phy_timer_clk", CSIPHY0_TIMER_CLK, NULL, OFF),
1573 CLK_DUMMY("csi1phy_timer_clk", CSIPHY1_TIMER_CLK, NULL, OFF),
1574 CLK_DUMMY("dsi_byte_div_clk", DSI1_BYTE_CLK, NULL, OFF),
1575 CLK_DUMMY("dsi_byte_div_clk", DSI2_BYTE_CLK, NULL, OFF),
1576 CLK_DUMMY("dsi_esc_clk", DSI1_ESC_CLK, NULL, OFF),
1577 CLK_DUMMY("dsi_esc_clk", DSI2_ESC_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001578 CLK_DUMMY("core_clk", VCAP_CLK, NULL, OFF),
1579 CLK_DUMMY("npl_clk", VCAP_NPL_CLK, NULL, OFF),
Pu Chen86b4be92011-11-03 17:27:57 -07001580 CLK_DUMMY("core_clk", GFX3D_CLK, "kgsl-3d0.0", OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001581 CLK_DUMMY("ijpeg_clk", IJPEG_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001582 CLK_DUMMY("mem_clk", IMEM_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001583 CLK_DUMMY("core_clk", JPEGD_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001584 CLK_DUMMY("mdp_clk", MDP_CLK, NULL, OFF),
1585 CLK_DUMMY("mdp_vsync_clk", MDP_VSYNC_CLK, NULL, OFF),
1586 CLK_DUMMY("lut_mdp", LUT_MDP_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001587 CLK_DUMMY("core_clk", ROT_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001588 CLK_DUMMY("tv_src_clk", TV_SRC_CLK, NULL, OFF),
Matt Wagantallb86ad262011-10-24 19:50:29 -07001589 CLK_DUMMY("core_clk", VCODEC_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001590 CLK_DUMMY("mdp_tv_clk", MDP_TV_CLK, NULL, OFF),
Tianyi Gou86bb4722011-08-09 13:28:02 -07001591 CLK_DUMMY("rgb_tv_clk", RGB_TV_CLK, NULL, OFF),
1592 CLK_DUMMY("npl_tv_clk", NPL_TV_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001593 CLK_DUMMY("hdmi_clk", HDMI_TV_CLK, NULL, OFF),
Matt Wagantall5a4f1ba2011-08-18 18:13:03 -07001594 CLK_DUMMY("core_clk", HDMI_APP_CLK, "hdmi_msm.1", OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001595 CLK_DUMMY("vpe_clk", VPE_CLK, NULL, OFF),
1596 CLK_DUMMY("vfe_clk", VFE_CLK, NULL, OFF),
1597 CLK_DUMMY("csi_vfe_clk", CSI0_VFE_CLK, NULL, OFF),
1598 CLK_DUMMY("vfe_axi_clk", VFE_AXI_CLK, NULL, OFF),
1599 CLK_DUMMY("ijpeg_axi_clk", IJPEG_AXI_CLK, NULL, OFF),
1600 CLK_DUMMY("mdp_axi_clk", MDP_AXI_CLK, NULL, OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001601 CLK_DUMMY("bus_clk", ROT_AXI_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001602 CLK_DUMMY("vcodec_axi_clk", VCODEC_AXI_CLK, NULL, OFF),
1603 CLK_DUMMY("vcodec_axi_a_clk", VCODEC_AXI_A_CLK, NULL, OFF),
1604 CLK_DUMMY("vcodec_axi_b_clk", VCODEC_AXI_B_CLK, NULL, OFF),
1605 CLK_DUMMY("vpe_axi_clk", VPE_AXI_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001606 CLK_DUMMY("bus_clk", GFX3D_AXI_CLK, NULL, OFF),
Tianyi Gou86bb4722011-08-09 13:28:02 -07001607 CLK_DUMMY("vcap_axi_clk", VCAP_AXI_CLK, NULL, OFF),
1608 CLK_DUMMY("vcap_ahb_clk", VCAP_AHB_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001609 CLK_DUMMY("amp_pclk", AMP_P_CLK, NULL, OFF),
1610 CLK_DUMMY("csi_pclk", CSI0_P_CLK, NULL, OFF),
1611 CLK_DUMMY("dsi_m_pclk", DSI1_M_P_CLK, NULL, OFF),
1612 CLK_DUMMY("dsi_s_pclk", DSI1_S_P_CLK, NULL, OFF),
1613 CLK_DUMMY("dsi_m_pclk", DSI2_M_P_CLK, NULL, OFF),
1614 CLK_DUMMY("dsi_s_pclk", DSI2_S_P_CLK, NULL, OFF),
Tianyi Gou86bb4722011-08-09 13:28:02 -07001615 CLK_DUMMY("lvds_clk", LVDS_CLK, NULL, OFF),
1616 CLK_DUMMY("mdp_p2clk", MDP_P2CLK, NULL, OFF),
1617 CLK_DUMMY("dsi2_pixel_clk", DSI2_PIXEL_CLK, NULL, OFF),
1618 CLK_DUMMY("lvds_ref_clk", LVDS_REF_CLK, NULL, OFF),
Pu Chen86b4be92011-11-03 17:27:57 -07001619 CLK_DUMMY("iface_clk", GFX3D_P_CLK, "kgsl-3d0.0", OFF),
Matt Wagantall5a4f1ba2011-08-18 18:13:03 -07001620 CLK_DUMMY("master_iface_clk", HDMI_M_P_CLK, "hdmi_msm.1", OFF),
1621 CLK_DUMMY("slave_iface_clk", HDMI_S_P_CLK, "hdmi_msm.1", OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001622 CLK_DUMMY("ijpeg_pclk", IJPEG_P_CLK, NULL, OFF),
1623 CLK_DUMMY("jpegd_pclk", JPEGD_P_CLK, NULL, OFF),
Matt Wagantall9dc01632011-08-17 18:55:04 -07001624 CLK_DUMMY("mem_iface_clk", IMEM_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001625 CLK_DUMMY("mdp_pclk", MDP_P_CLK, NULL, OFF),
Matt Wagantalle604d712011-10-21 15:38:18 -07001626 CLK_DUMMY("iface_clk", SMMU_P_CLK, "msm_smmu", OFF),
Matt Wagantallbb90da92011-10-25 15:07:52 -07001627 CLK_DUMMY("iface_clk", ROT_P_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001628 CLK_DUMMY("vcodec_pclk", VCODEC_P_CLK, NULL, OFF),
1629 CLK_DUMMY("vfe_pclk", VFE_P_CLK, NULL, OFF),
1630 CLK_DUMMY("vpe_pclk", VPE_P_CLK, NULL, OFF),
1631 CLK_DUMMY("mi2s_osr_clk", MI2S_OSR_CLK, NULL, OFF),
1632 CLK_DUMMY("mi2s_bit_clk", MI2S_BIT_CLK, NULL, OFF),
1633 CLK_DUMMY("i2s_mic_osr_clk", CODEC_I2S_MIC_OSR_CLK, NULL, OFF),
1634 CLK_DUMMY("i2s_mic_bit_clk", CODEC_I2S_MIC_BIT_CLK, NULL, OFF),
1635 CLK_DUMMY("i2s_mic_osr_clk", SPARE_I2S_MIC_OSR_CLK, NULL, OFF),
1636 CLK_DUMMY("i2s_mic_bit_clk", SPARE_I2S_MIC_BIT_CLK, NULL, OFF),
1637 CLK_DUMMY("i2s_spkr_osr_clk", CODEC_I2S_SPKR_OSR_CLK, NULL, OFF),
1638 CLK_DUMMY("i2s_spkr_bit_clk", CODEC_I2S_SPKR_BIT_CLK, NULL, OFF),
1639 CLK_DUMMY("i2s_spkr_osr_clk", SPARE_I2S_SPKR_OSR_CLK, NULL, OFF),
1640 CLK_DUMMY("i2s_spkr_bit_clk", SPARE_I2S_SPKR_BIT_CLK, NULL, OFF),
1641 CLK_DUMMY("pcm_clk", PCM_CLK, NULL, OFF),
Tianyi Gou142b8db2011-09-21 18:01:54 -07001642 CLK_DUMMY("audio_slimbus_clk", AUDIO_SLIMBUS_CLK, NULL, OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001643
1644 CLK_DUMMY("dfab_dsps_clk", DFAB_DSPS_CLK, NULL, 0),
Manu Gautam5143b252012-01-05 19:25:23 -08001645 CLK_DUMMY("core_clk", DFAB_USB_HS_CLK, NULL, 0),
Matt Wagantall37ce3842011-08-17 16:00:36 -07001646 CLK_DUMMY("bus_clk", DFAB_SDC1_CLK, NULL, 0),
1647 CLK_DUMMY("bus_clk", DFAB_SDC2_CLK, NULL, 0),
1648 CLK_DUMMY("bus_clk", DFAB_SDC3_CLK, NULL, 0),
1649 CLK_DUMMY("bus_clk", DFAB_SDC4_CLK, NULL, 0),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001650 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
1651 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
Jin Hong01f2dbb2011-11-03 22:13:51 -07001652 CLK_DUMMY("mem_clk", EBI1_ADM_CLK, "msm_dmov", 0),
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001653 CLK_DUMMY("ce3_core_src_clk", CE3_SRC_CLK, "qce.0", OFF),
1654 CLK_DUMMY("ce3_core_src_clk", CE3_SRC_CLK, "qcrypto.0", OFF),
1655 CLK_DUMMY("core_clk", CE3_CORE_CLK, "qce.0", OFF),
1656 CLK_DUMMY("core_clk", CE3_CORE_CLK, "qcrypto.0", OFF),
1657 CLK_DUMMY("iface_clk", CE3_P_CLK, "qce0.0", OFF),
1658 CLK_DUMMY("iface_clk", CE3_P_CLK, "qcrypto.0", OFF),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001659};
1660
Stephen Boydbb600ae2011-08-02 20:11:40 -07001661struct clock_init_data apq8064_dummy_clock_init_data __initdata = {
1662 .table = msm_clocks_8064_dummy,
1663 .size = ARRAY_SIZE(msm_clocks_8064_dummy),
1664};
Praveen Chidambaram78499012011-11-01 17:15:17 -06001665
1666struct msm_rpm_platform_data apq8064_rpm_data __initdata = {
1667 .reg_base_addrs = {
1668 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
1669 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
1670 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
1671 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
1672 },
1673 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
1674 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
1675 .ipc_rpm_val = 4,
1676 .target_id = {
1677 MSM_RPM_MAP(8064, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
1678 MSM_RPM_MAP(8064, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
1679 MSM_RPM_MAP(8064, INVALIDATE_0, INVALIDATE, 8),
1680 MSM_RPM_MAP(8064, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
1681 MSM_RPM_MAP(8064, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
1682 MSM_RPM_MAP(8064, RPM_CTL, RPM_CTL, 1),
1683 MSM_RPM_MAP(8064, CXO_CLK, CXO_CLK, 1),
1684 MSM_RPM_MAP(8064, PXO_CLK, PXO_CLK, 1),
1685 MSM_RPM_MAP(8064, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
1686 MSM_RPM_MAP(8064, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
1687 MSM_RPM_MAP(8064, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
1688 MSM_RPM_MAP(8064, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
1689 MSM_RPM_MAP(8064, SFPB_CLK, SFPB_CLK, 1),
1690 MSM_RPM_MAP(8064, CFPB_CLK, CFPB_CLK, 1),
1691 MSM_RPM_MAP(8064, MMFPB_CLK, MMFPB_CLK, 1),
1692 MSM_RPM_MAP(8064, EBI1_CLK, EBI1_CLK, 1),
1693 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_HALT_0,
1694 APPS_FABRIC_CFG_HALT, 2),
1695 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_CLKMOD_0,
1696 APPS_FABRIC_CFG_CLKMOD, 3),
1697 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_IOCTL,
1698 APPS_FABRIC_CFG_IOCTL, 1),
1699 MSM_RPM_MAP(8064, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
1700 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_HALT_0,
1701 SYS_FABRIC_CFG_HALT, 2),
1702 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_CLKMOD_0,
1703 SYS_FABRIC_CFG_CLKMOD, 3),
1704 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_IOCTL,
1705 SYS_FABRIC_CFG_IOCTL, 1),
1706 MSM_RPM_MAP(8064, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 30),
1707 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_HALT_0,
1708 MMSS_FABRIC_CFG_HALT, 2),
1709 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_CLKMOD_0,
1710 MMSS_FABRIC_CFG_CLKMOD, 3),
1711 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_IOCTL,
1712 MMSS_FABRIC_CFG_IOCTL, 1),
1713 MSM_RPM_MAP(8064, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 21),
1714 MSM_RPM_MAP(8064, PM8921_S1_0, PM8921_S1, 2),
1715 MSM_RPM_MAP(8064, PM8921_S2_0, PM8921_S2, 2),
1716 MSM_RPM_MAP(8064, PM8921_S3_0, PM8921_S3, 2),
1717 MSM_RPM_MAP(8064, PM8921_S4_0, PM8921_S4, 2),
1718 MSM_RPM_MAP(8064, PM8921_S5_0, PM8921_S5, 2),
1719 MSM_RPM_MAP(8064, PM8921_S6_0, PM8921_S6, 2),
1720 MSM_RPM_MAP(8064, PM8921_S7_0, PM8921_S7, 2),
1721 MSM_RPM_MAP(8064, PM8921_S8_0, PM8921_S8, 2),
1722 MSM_RPM_MAP(8064, PM8921_L1_0, PM8921_L1, 2),
1723 MSM_RPM_MAP(8064, PM8921_L2_0, PM8921_L2, 2),
1724 MSM_RPM_MAP(8064, PM8921_L3_0, PM8921_L3, 2),
1725 MSM_RPM_MAP(8064, PM8921_L4_0, PM8921_L4, 2),
1726 MSM_RPM_MAP(8064, PM8921_L5_0, PM8921_L5, 2),
1727 MSM_RPM_MAP(8064, PM8921_L6_0, PM8921_L6, 2),
1728 MSM_RPM_MAP(8064, PM8921_L7_0, PM8921_L7, 2),
1729 MSM_RPM_MAP(8064, PM8921_L8_0, PM8921_L8, 2),
1730 MSM_RPM_MAP(8064, PM8921_L9_0, PM8921_L9, 2),
1731 MSM_RPM_MAP(8064, PM8921_L10_0, PM8921_L10, 2),
1732 MSM_RPM_MAP(8064, PM8921_L11_0, PM8921_L11, 2),
1733 MSM_RPM_MAP(8064, PM8921_L12_0, PM8921_L12, 2),
1734 MSM_RPM_MAP(8064, PM8921_L13_0, PM8921_L13, 2),
1735 MSM_RPM_MAP(8064, PM8921_L14_0, PM8921_L14, 2),
1736 MSM_RPM_MAP(8064, PM8921_L15_0, PM8921_L15, 2),
1737 MSM_RPM_MAP(8064, PM8921_L16_0, PM8921_L16, 2),
1738 MSM_RPM_MAP(8064, PM8921_L17_0, PM8921_L17, 2),
1739 MSM_RPM_MAP(8064, PM8921_L18_0, PM8921_L18, 2),
1740 MSM_RPM_MAP(8064, PM8921_L19_0, PM8921_L19, 2),
1741 MSM_RPM_MAP(8064, PM8921_L20_0, PM8921_L20, 2),
1742 MSM_RPM_MAP(8064, PM8921_L21_0, PM8921_L21, 2),
1743 MSM_RPM_MAP(8064, PM8921_L22_0, PM8921_L22, 2),
1744 MSM_RPM_MAP(8064, PM8921_L23_0, PM8921_L23, 2),
1745 MSM_RPM_MAP(8064, PM8921_L24_0, PM8921_L24, 2),
1746 MSM_RPM_MAP(8064, PM8921_L25_0, PM8921_L25, 2),
1747 MSM_RPM_MAP(8064, PM8921_L26_0, PM8921_L26, 2),
1748 MSM_RPM_MAP(8064, PM8921_L27_0, PM8921_L27, 2),
1749 MSM_RPM_MAP(8064, PM8921_L28_0, PM8921_L28, 2),
1750 MSM_RPM_MAP(8064, PM8921_L29_0, PM8921_L29, 2),
1751 MSM_RPM_MAP(8064, PM8921_CLK1_0, PM8921_CLK1, 2),
1752 MSM_RPM_MAP(8064, PM8921_CLK2_0, PM8921_CLK2, 2),
1753 MSM_RPM_MAP(8064, PM8921_LVS1, PM8921_LVS1, 1),
1754 MSM_RPM_MAP(8064, PM8921_LVS2, PM8921_LVS2, 1),
1755 MSM_RPM_MAP(8064, PM8921_LVS3, PM8921_LVS3, 1),
1756 MSM_RPM_MAP(8064, PM8921_LVS4, PM8921_LVS4, 1),
1757 MSM_RPM_MAP(8064, PM8921_LVS5, PM8921_LVS5, 1),
1758 MSM_RPM_MAP(8064, PM8921_LVS6, PM8921_LVS6, 1),
1759 MSM_RPM_MAP(8064, PM8921_LVS7, PM8921_LVS7, 1),
1760 MSM_RPM_MAP(8064, PM8821_S1_0, PM8821_S1, 2),
1761 MSM_RPM_MAP(8064, PM8821_S2_0, PM8821_S2, 2),
1762 MSM_RPM_MAP(8064, PM8821_L1_0, PM8821_L1, 2),
1763 MSM_RPM_MAP(8064, NCP_0, NCP, 2),
1764 MSM_RPM_MAP(8064, CXO_BUFFERS, CXO_BUFFERS, 1),
1765 MSM_RPM_MAP(8064, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
1766 MSM_RPM_MAP(8064, HDMI_SWITCH, HDMI_SWITCH, 1),
1767 MSM_RPM_MAP(8064, DDR_DMM_0, DDR_DMM, 2),
1768 MSM_RPM_MAP(8064, QDSS_CLK, QDSS_CLK, 1),
1769 },
1770 .target_status = {
1771 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MAJOR),
1772 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MINOR),
1773 MSM_RPM_STATUS_ID_MAP(8064, VERSION_BUILD),
1774 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_0),
1775 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_1),
1776 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_2),
1777 MSM_RPM_STATUS_ID_MAP(8064, RESERVED_SUPPORTED_RESOURCES_0),
1778 MSM_RPM_STATUS_ID_MAP(8064, SEQUENCE),
1779 MSM_RPM_STATUS_ID_MAP(8064, RPM_CTL),
1780 MSM_RPM_STATUS_ID_MAP(8064, CXO_CLK),
1781 MSM_RPM_STATUS_ID_MAP(8064, PXO_CLK),
1782 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CLK),
1783 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_CLK),
1784 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_CLK),
1785 MSM_RPM_STATUS_ID_MAP(8064, DAYTONA_FABRIC_CLK),
1786 MSM_RPM_STATUS_ID_MAP(8064, SFPB_CLK),
1787 MSM_RPM_STATUS_ID_MAP(8064, CFPB_CLK),
1788 MSM_RPM_STATUS_ID_MAP(8064, MMFPB_CLK),
1789 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CLK),
1790 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_HALT),
1791 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_CLKMOD),
1792 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_IOCTL),
1793 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_ARB),
1794 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_HALT),
1795 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_CLKMOD),
1796 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_IOCTL),
1797 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_ARB),
1798 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_HALT),
1799 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_CLKMOD),
1800 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_IOCTL),
1801 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_ARB),
1802 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_0),
1803 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_1),
1804 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_0),
1805 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_1),
1806 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_0),
1807 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_1),
1808 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_0),
1809 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_1),
1810 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_0),
1811 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_1),
1812 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_0),
1813 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_1),
1814 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_0),
1815 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_1),
1816 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_0),
1817 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_1),
1818 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_0),
1819 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_1),
1820 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_0),
1821 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_1),
1822 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_0),
1823 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_1),
1824 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_0),
1825 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_1),
1826 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_0),
1827 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_1),
1828 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_0),
1829 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_1),
1830 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_0),
1831 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_1),
1832 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_0),
1833 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_1),
1834 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_0),
1835 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_1),
1836 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_0),
1837 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_1),
1838 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_0),
1839 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_1),
1840 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_0),
1841 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_1),
1842 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_0),
1843 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_1),
1844 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_0),
1845 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_1),
1846 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_0),
1847 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_1),
1848 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_0),
1849 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_1),
1850 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_0),
1851 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_1),
1852 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_0),
1853 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_1),
1854 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_0),
1855 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_1),
1856 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_0),
1857 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_1),
1858 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_0),
1859 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_1),
1860 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_0),
1861 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_1),
1862 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_0),
1863 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_1),
1864 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_0),
1865 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_1),
1866 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_0),
1867 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_1),
1868 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_0),
1869 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_1),
1870 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_0),
1871 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_1),
1872 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_0),
1873 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_1),
1874 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_0),
1875 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_1),
1876 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_0),
1877 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_1),
1878 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_0),
1879 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_1),
1880 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS1),
1881 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS2),
1882 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS3),
1883 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS4),
1884 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS5),
1885 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS6),
1886 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS7),
1887 MSM_RPM_STATUS_ID_MAP(8064, NCP_0),
1888 MSM_RPM_STATUS_ID_MAP(8064, NCP_1),
1889 MSM_RPM_STATUS_ID_MAP(8064, CXO_BUFFERS),
1890 MSM_RPM_STATUS_ID_MAP(8064, USB_OTG_SWITCH),
1891 MSM_RPM_STATUS_ID_MAP(8064, HDMI_SWITCH),
1892 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_0),
1893 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_1),
1894 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH0_RANGE),
1895 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH1_RANGE),
1896 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_0),
1897 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_1),
1898 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_0),
1899 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_1),
1900 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_0),
1901 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_1),
1902 },
1903 .target_ctrl_id = {
1904 MSM_RPM_CTRL_MAP(8064, VERSION_MAJOR),
1905 MSM_RPM_CTRL_MAP(8064, VERSION_MINOR),
1906 MSM_RPM_CTRL_MAP(8064, VERSION_BUILD),
1907 MSM_RPM_CTRL_MAP(8064, REQ_CTX_0),
1908 MSM_RPM_CTRL_MAP(8064, REQ_SEL_0),
1909 MSM_RPM_CTRL_MAP(8064, ACK_CTX_0),
1910 MSM_RPM_CTRL_MAP(8064, ACK_SEL_0),
1911 },
1912 .sel_invalidate = MSM_RPM_8064_SEL_INVALIDATE,
1913 .sel_notification = MSM_RPM_8064_SEL_NOTIFICATION,
1914 .sel_last = MSM_RPM_8064_SEL_LAST,
1915 .ver = {3, 0, 0},
1916};
1917
1918struct platform_device apq8064_rpm_device = {
1919 .name = "msm_rpm",
1920 .id = -1,
1921};
1922
1923static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
1924 .phys_addr_base = 0x0010D204,
1925 .phys_size = SZ_8K,
1926};
1927
1928struct platform_device apq8064_rpm_stat_device = {
1929 .name = "msm_rpm_stat",
1930 .id = -1,
1931 .dev = {
1932 .platform_data = &msm_rpm_stat_pdata,
1933 },
1934};
1935
1936static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
1937 .phys_addr_base = 0x0010C000,
1938 .reg_offsets = {
1939 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
1940 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
1941 },
1942 .phys_size = SZ_8K,
1943 .log_len = 4096, /* log's buffer length in bytes */
1944 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
1945};
1946
1947struct platform_device apq8064_rpm_log_device = {
1948 .name = "msm_rpm_log",
1949 .id = -1,
1950 .dev = {
1951 .platform_data = &msm_rpm_log_pdata,
1952 },
1953};
1954
Jin Hongd3024e62012-02-09 16:13:32 -08001955/* Sensors DSPS platform data */
1956
1957#define PPSS_REG_PHYS_BASE 0x12080000
1958
1959static struct dsps_clk_info dsps_clks[] = {};
1960static struct dsps_regulator_info dsps_regs[] = {};
1961
1962/*
1963 * Note: GPIOs field is intialized in run-time at the function
1964 * apq8064_init_dsps().
1965 */
1966
1967struct msm_dsps_platform_data msm_dsps_pdata_8064 = {
1968 .clks = dsps_clks,
1969 .clks_num = ARRAY_SIZE(dsps_clks),
1970 .gpios = NULL,
1971 .gpios_num = 0,
1972 .regs = dsps_regs,
1973 .regs_num = ARRAY_SIZE(dsps_regs),
1974 .dsps_pwr_ctl_en = 1,
1975 .signature = DSPS_SIGNATURE,
1976};
1977
1978static struct resource msm_dsps_resources[] = {
1979 {
1980 .start = PPSS_REG_PHYS_BASE,
1981 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
1982 .name = "ppss_reg",
1983 .flags = IORESOURCE_MEM,
1984 },
1985
1986 {
1987 .start = PPSS_WDOG_TIMER_IRQ,
1988 .end = PPSS_WDOG_TIMER_IRQ,
1989 .name = "ppss_wdog",
1990 .flags = IORESOURCE_IRQ,
1991 },
1992};
1993
1994struct platform_device msm_dsps_device_8064 = {
1995 .name = "msm_dsps",
1996 .id = 0,
1997 .num_resources = ARRAY_SIZE(msm_dsps_resources),
1998 .resource = msm_dsps_resources,
1999 .dev.platform_data = &msm_dsps_pdata_8064,
2000};
2001
Praveen Chidambaram78499012011-11-01 17:15:17 -06002002#ifdef CONFIG_MSM_MPM
2003static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
2004 [1] = MSM_GPIO_TO_INT(26),
2005 [2] = MSM_GPIO_TO_INT(88),
2006 [4] = MSM_GPIO_TO_INT(73),
2007 [5] = MSM_GPIO_TO_INT(74),
2008 [6] = MSM_GPIO_TO_INT(75),
2009 [7] = MSM_GPIO_TO_INT(76),
2010 [8] = MSM_GPIO_TO_INT(77),
2011 [9] = MSM_GPIO_TO_INT(36),
2012 [10] = MSM_GPIO_TO_INT(84),
2013 [11] = MSM_GPIO_TO_INT(7),
2014 [12] = MSM_GPIO_TO_INT(11),
2015 [13] = MSM_GPIO_TO_INT(52),
2016 [14] = MSM_GPIO_TO_INT(15),
2017 [15] = MSM_GPIO_TO_INT(83),
2018 [16] = USB3_HS_IRQ,
2019 [19] = MSM_GPIO_TO_INT(61),
2020 [20] = MSM_GPIO_TO_INT(58),
2021 [23] = MSM_GPIO_TO_INT(65),
2022 [24] = MSM_GPIO_TO_INT(63),
2023 [25] = USB1_HS_IRQ,
2024 [27] = HDMI_IRQ,
2025 [29] = MSM_GPIO_TO_INT(22),
2026 [30] = MSM_GPIO_TO_INT(72),
2027 [31] = USB4_HS_IRQ,
2028 [33] = MSM_GPIO_TO_INT(44),
2029 [34] = MSM_GPIO_TO_INT(39),
2030 [35] = MSM_GPIO_TO_INT(19),
2031 [36] = MSM_GPIO_TO_INT(23),
2032 [37] = MSM_GPIO_TO_INT(41),
2033 [38] = MSM_GPIO_TO_INT(30),
2034 [41] = MSM_GPIO_TO_INT(42),
2035 [42] = MSM_GPIO_TO_INT(56),
2036 [43] = MSM_GPIO_TO_INT(55),
2037 [44] = MSM_GPIO_TO_INT(50),
2038 [45] = MSM_GPIO_TO_INT(49),
2039 [46] = MSM_GPIO_TO_INT(47),
2040 [47] = MSM_GPIO_TO_INT(45),
2041 [48] = MSM_GPIO_TO_INT(38),
2042 [49] = MSM_GPIO_TO_INT(34),
2043 [50] = MSM_GPIO_TO_INT(32),
2044 [51] = MSM_GPIO_TO_INT(29),
2045 [52] = MSM_GPIO_TO_INT(18),
2046 [53] = MSM_GPIO_TO_INT(10),
2047 [54] = MSM_GPIO_TO_INT(81),
2048 [55] = MSM_GPIO_TO_INT(6),
2049};
2050
2051static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
2052 TLMM_MSM_SUMMARY_IRQ,
2053 RPM_APCC_CPU0_GP_HIGH_IRQ,
2054 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2055 RPM_APCC_CPU0_GP_LOW_IRQ,
2056 RPM_APCC_CPU0_WAKE_UP_IRQ,
2057 RPM_APCC_CPU1_GP_HIGH_IRQ,
2058 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2059 RPM_APCC_CPU1_GP_LOW_IRQ,
2060 RPM_APCC_CPU1_WAKE_UP_IRQ,
2061 MSS_TO_APPS_IRQ_0,
2062 MSS_TO_APPS_IRQ_1,
2063 MSS_TO_APPS_IRQ_2,
2064 MSS_TO_APPS_IRQ_3,
2065 MSS_TO_APPS_IRQ_4,
2066 MSS_TO_APPS_IRQ_5,
2067 MSS_TO_APPS_IRQ_6,
2068 MSS_TO_APPS_IRQ_7,
2069 MSS_TO_APPS_IRQ_8,
2070 MSS_TO_APPS_IRQ_9,
2071 LPASS_SCSS_GP_LOW_IRQ,
2072 LPASS_SCSS_GP_MEDIUM_IRQ,
2073 LPASS_SCSS_GP_HIGH_IRQ,
2074 SPS_MTI_30,
2075 SPS_MTI_31,
2076 RIVA_APSS_SPARE_IRQ,
2077 RIVA_APPS_WLAN_SMSM_IRQ,
2078 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2079 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
2080};
2081
2082struct msm_mpm_device_data apq8064_mpm_dev_data __initdata = {
2083 .irqs_m2a = msm_mpm_irqs_m2a,
2084 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2085 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2086 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2087 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2088 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2089 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2090 .mpm_apps_ipc_val = BIT(1),
2091 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2092
2093};
2094#endif
Joel Kingdacbc822012-01-25 13:30:57 -08002095
2096#define MDM2AP_ERRFATAL 19
2097#define AP2MDM_ERRFATAL 18
2098#define MDM2AP_STATUS 49
2099#define AP2MDM_STATUS 48
2100#define AP2MDM_PMIC_RESET_N 27
2101
2102static struct resource mdm_resources[] = {
2103 {
2104 .start = MDM2AP_ERRFATAL,
2105 .end = MDM2AP_ERRFATAL,
2106 .name = "MDM2AP_ERRFATAL",
2107 .flags = IORESOURCE_IO,
2108 },
2109 {
2110 .start = AP2MDM_ERRFATAL,
2111 .end = AP2MDM_ERRFATAL,
2112 .name = "AP2MDM_ERRFATAL",
2113 .flags = IORESOURCE_IO,
2114 },
2115 {
2116 .start = MDM2AP_STATUS,
2117 .end = MDM2AP_STATUS,
2118 .name = "MDM2AP_STATUS",
2119 .flags = IORESOURCE_IO,
2120 },
2121 {
2122 .start = AP2MDM_STATUS,
2123 .end = AP2MDM_STATUS,
2124 .name = "AP2MDM_STATUS",
2125 .flags = IORESOURCE_IO,
2126 },
2127 {
2128 .start = AP2MDM_PMIC_RESET_N,
2129 .end = AP2MDM_PMIC_RESET_N,
2130 .name = "AP2MDM_PMIC_RESET_N",
2131 .flags = IORESOURCE_IO,
2132 },
2133};
2134
2135struct platform_device mdm_8064_device = {
2136 .name = "mdm2_modem",
2137 .id = -1,
2138 .num_resources = ARRAY_SIZE(mdm_resources),
2139 .resource = mdm_resources,
2140};