blob: dcd90d0a890a6924129a3f6a9248e3377807c3c5 [file] [log] [blame]
Abhijeet Dharmapurikarfb4a2f82012-08-23 14:36:59 -07001/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/platform_device.h>
17#include <linux/msm_rotator.h>
Joel Nidere5de00e2012-07-03 10:58:10 +030018#include <linux/gpio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <linux/clkdev.h>
Hemant Kumard86c4882012-01-24 19:39:37 -080020#include <linux/dma-mapping.h>
Pratik Patel1746b8f2012-06-02 21:11:41 -070021#include <linux/coresight.h>
Srikanth Uyyala7d4f7212012-10-12 17:45:36 +053022#include <linux/avtimer.h>
Sujit Reddy Thumma183a5c92012-03-07 18:37:07 +053023#include <linux/ahci_platform.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070024#include <mach/irqs-8064.h>
25#include <mach/board.h>
26#include <mach/msm_iomap.h>
Yan He06913ce2011-08-26 16:33:46 -070027#include <mach/usbdiag.h>
28#include <mach/msm_sps.h>
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -070029#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080030#include <mach/msm_dsps.h>
Matt Wagantall33d01f52012-02-23 23:27:44 -080031#include <mach/clk-provider.h>
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -080032#include <sound/msm-dai-q6.h>
33#include <sound/apr_audio.h>
Joel Nidere5de00e2012-07-03 10:58:10 +030034#include <mach/msm_tsif.h>
Joel Nider50b50fa2012-08-05 14:17:29 +030035#include <mach/msm_tspp.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070036#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060037#include <mach/rpm.h>
Joel Kingdacbc822012-01-25 13:30:57 -080038#include <mach/mdm2.h>
Eric Holmberg023d25c2012-03-01 12:27:55 -070039#include <mach/msm_smd.h>
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -070040#include <mach/msm_dcvs.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070041#include <mach/msm_rtb.h>
Mitchel Humpherysa67e37f2012-09-06 11:35:39 -070042#include <linux/msm_ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043#include "clock.h"
44#include "devices.h"
Matt Wagantall1875d322012-02-22 16:11:33 -080045#include "footswitch.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -070046#include "msm_watchdog.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060047#include "rpm_stats.h"
48#include "rpm_log.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053049#include <mach/mpm.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070050#include <mach/iommu_domains.h>
Laura Abbott93a4a352012-05-25 09:26:35 -070051#include <mach/msm_cache_dump.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052
53/* Address of GSBI blocks */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070054#define MSM_GSBI1_PHYS 0x12440000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#define MSM_GSBI3_PHYS 0x16200000
Harini Jayaramanc4c58692011-07-19 14:50:10 -060056#define MSM_GSBI4_PHYS 0x16300000
57#define MSM_GSBI5_PHYS 0x1A200000
58#define MSM_GSBI6_PHYS 0x16500000
59#define MSM_GSBI7_PHYS 0x16600000
60
Kenneth Heitke748593a2011-07-15 15:45:11 -060061/* GSBI UART devices */
Stepan Moskovchenko2701a442011-08-19 13:47:22 -070062#define MSM_UART1DM_PHYS (MSM_GSBI1_PHYS + 0x10000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070063#define MSM_UART3DM_PHYS (MSM_GSBI3_PHYS + 0x40000)
Saket Saurabhd425a5d2012-11-06 16:08:28 +053064#define MSM_UART5DM_PHYS (MSM_GSBI5_PHYS + 0x40000)
Mayank Rana262e9032012-05-10 15:14:00 -070065#define MSM_UART6DM_PHYS (MSM_GSBI6_PHYS + 0x40000)
Jin Hong4bbbfba2012-02-02 21:48:07 -080066#define MSM_UART7DM_PHYS (MSM_GSBI7_PHYS + 0x40000)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070067
Harini Jayaramanc4c58692011-07-19 14:50:10 -060068/* GSBI QUP devices */
David Keitel3c40fc52012-02-09 17:53:52 -080069#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x20000)
Harini Jayaramanc4c58692011-07-19 14:50:10 -060070#define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000)
71#define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000)
72#define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000)
73#define MSM_GSBI6_QUP_PHYS (MSM_GSBI6_PHYS + 0x80000)
74#define MSM_GSBI7_QUP_PHYS (MSM_GSBI7_PHYS + 0x80000)
75#define MSM_QUP_SIZE SZ_4K
76
Kenneth Heitke36920d32011-07-20 16:44:30 -060077/* Address of SSBI CMD */
78#define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000
79#define MSM_PMIC2_SSBI_CMD_PHYS 0x00C00000
80#define MSM_PMIC_SSBI_SIZE SZ_4K
Harini Jayaramanc4c58692011-07-19 14:50:10 -060081
Hemant Kumarcaa09092011-07-30 00:26:33 -070082/* Address of HS USBOTG1 */
Hemant Kumard86c4882012-01-24 19:39:37 -080083#define MSM_HSUSB1_PHYS 0x12500000
84#define MSM_HSUSB1_SIZE SZ_4K
Hemant Kumarcaa09092011-07-30 00:26:33 -070085
Manu Gautam91223e02011-11-08 15:27:22 +053086/* Address of HS USB3 */
87#define MSM_HSUSB3_PHYS 0x12520000
88#define MSM_HSUSB3_SIZE SZ_4K
89
Hemant Kumar1d66e1c2012-02-13 15:24:59 -080090/* Address of HS USB4 */
91#define MSM_HSUSB4_PHYS 0x12530000
92#define MSM_HSUSB4_SIZE SZ_4K
93
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060094/* Address of PCIE20 PARF */
95#define PCIE20_PARF_PHYS 0x1b600000
96#define PCIE20_PARF_SIZE SZ_128
97
98/* Address of PCIE20 ELBI */
99#define PCIE20_ELBI_PHYS 0x1b502000
100#define PCIE20_ELBI_SIZE SZ_256
101
102/* Address of PCIE20 */
103#define PCIE20_PHYS 0x1b500000
104#define PCIE20_SIZE SZ_4K
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530105#define MSM8064_PC_CNTR_PHYS (APQ8064_IMEM_PHYS + 0x664)
106#define MSM8064_PC_CNTR_SIZE 0x40
Anji Jonnala93129922012-10-09 20:57:53 +0530107#define MSM8064_RPM_MASTER_STATS_BASE 0x10BB00
Srikanth Uyyala7d4f7212012-10-12 17:45:36 +0530108/* avtimer */
109#define AVTIMER_MSW_PHYSICAL_ADDRESS 0x2800900C
110#define AVTIMER_LSW_PHYSICAL_ADDRESS 0x28009008
Anji Jonnala6c2b6852012-09-21 13:34:44 +0530111
112static struct resource msm8064_resources_pccntr[] = {
113 {
114 .start = MSM8064_PC_CNTR_PHYS,
115 .end = MSM8064_PC_CNTR_PHYS + MSM8064_PC_CNTR_SIZE,
116 .flags = IORESOURCE_MEM,
117 },
118};
119
120struct platform_device msm8064_pc_cntr = {
121 .name = "pc-cntr",
122 .id = -1,
123 .num_resources = ARRAY_SIZE(msm8064_resources_pccntr),
124 .resource = msm8064_resources_pccntr,
125};
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600126
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700127static struct msm_watchdog_pdata msm_watchdog_pdata = {
128 .pet_time = 10000,
129 .bark_time = 11000,
130 .has_secure = true,
Joel Kinge7ca6f72012-02-09 20:51:25 -0800131 .needs_expired_enable = true,
Rohit Vaswanic77e4a62012-08-09 18:10:28 -0700132 .base = MSM_TMR0_BASE + WDT0_OFFSET,
133};
134
135static struct resource msm_watchdog_resources[] = {
136 {
137 .start = WDT0_ACCSCSSNBARK_INT,
138 .end = WDT0_ACCSCSSNBARK_INT,
139 .flags = IORESOURCE_IRQ,
140 },
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700141};
142
143struct platform_device msm8064_device_watchdog = {
144 .name = "msm_watchdog",
145 .id = -1,
146 .dev = {
147 .platform_data = &msm_watchdog_pdata,
148 },
Rohit Vaswanic77e4a62012-08-09 18:10:28 -0700149 .num_resources = ARRAY_SIZE(msm_watchdog_resources),
150 .resource = msm_watchdog_resources,
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700151};
152
Joel King0581896d2011-07-19 16:43:28 -0700153static struct resource msm_dmov_resource[] = {
154 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800155 .start = ADM_0_SCSS_1_IRQ,
Joel King0581896d2011-07-19 16:43:28 -0700156 .flags = IORESOURCE_IRQ,
157 },
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700158 {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800159 .start = 0x18320000,
160 .end = 0x18320000 + SZ_1M - 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700161 .flags = IORESOURCE_MEM,
162 },
163};
164
165static struct msm_dmov_pdata msm_dmov_pdata = {
Jeff Ohlstein4af72692011-11-07 15:59:17 -0800166 .sd = 1,
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700167 .sd_size = 0x800,
Joel King0581896d2011-07-19 16:43:28 -0700168};
169
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -0700170struct platform_device apq8064_device_dmov = {
Joel King0581896d2011-07-19 16:43:28 -0700171 .name = "msm_dmov",
172 .id = -1,
173 .resource = msm_dmov_resource,
174 .num_resources = ARRAY_SIZE(msm_dmov_resource),
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700175 .dev = {
176 .platform_data = &msm_dmov_pdata,
177 },
Joel King0581896d2011-07-19 16:43:28 -0700178};
179
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700180static struct resource resources_uart_gsbi1[] = {
181 {
182 .start = APQ8064_GSBI1_UARTDM_IRQ,
183 .end = APQ8064_GSBI1_UARTDM_IRQ,
184 .flags = IORESOURCE_IRQ,
185 },
186 {
187 .start = MSM_UART1DM_PHYS,
188 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
189 .name = "uartdm_resource",
190 .flags = IORESOURCE_MEM,
191 },
192 {
193 .start = MSM_GSBI1_PHYS,
194 .end = MSM_GSBI1_PHYS + PAGE_SIZE - 1,
195 .name = "gsbi_resource",
196 .flags = IORESOURCE_MEM,
197 },
198};
199
200struct platform_device apq8064_device_uart_gsbi1 = {
201 .name = "msm_serial_hsl",
Jin Hong4bbbfba2012-02-02 21:48:07 -0800202 .id = 1,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700203 .num_resources = ARRAY_SIZE(resources_uart_gsbi1),
204 .resource = resources_uart_gsbi1,
205};
206
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700207static struct resource resources_uart_gsbi3[] = {
208 {
209 .start = GSBI3_UARTDM_IRQ,
210 .end = GSBI3_UARTDM_IRQ,
211 .flags = IORESOURCE_IRQ,
212 },
213 {
214 .start = MSM_UART3DM_PHYS,
215 .end = MSM_UART3DM_PHYS + PAGE_SIZE - 1,
216 .name = "uartdm_resource",
217 .flags = IORESOURCE_MEM,
218 },
219 {
220 .start = MSM_GSBI3_PHYS,
221 .end = MSM_GSBI3_PHYS + PAGE_SIZE - 1,
222 .name = "gsbi_resource",
223 .flags = IORESOURCE_MEM,
224 },
225};
226
227struct platform_device apq8064_device_uart_gsbi3 = {
228 .name = "msm_serial_hsl",
229 .id = 0,
230 .num_resources = ARRAY_SIZE(resources_uart_gsbi3),
231 .resource = resources_uart_gsbi3,
232};
233
Jing Lin04601f92012-02-05 15:36:07 -0800234static struct resource resources_qup_i2c_gsbi3[] = {
235 {
236 .name = "gsbi_qup_i2c_addr",
237 .start = MSM_GSBI3_PHYS,
238 .end = MSM_GSBI3_PHYS + 4 - 1,
239 .flags = IORESOURCE_MEM,
240 },
241 {
242 .name = "qup_phys_addr",
243 .start = MSM_GSBI3_QUP_PHYS,
244 .end = MSM_GSBI3_QUP_PHYS + MSM_QUP_SIZE - 1,
245 .flags = IORESOURCE_MEM,
246 },
247 {
248 .name = "qup_err_intr",
249 .start = GSBI3_QUP_IRQ,
250 .end = GSBI3_QUP_IRQ,
251 .flags = IORESOURCE_IRQ,
252 },
253 {
254 .name = "i2c_clk",
255 .start = 9,
256 .end = 9,
257 .flags = IORESOURCE_IO,
258 },
259 {
260 .name = "i2c_sda",
261 .start = 8,
262 .end = 8,
263 .flags = IORESOURCE_IO,
264 },
265};
266
David Keitel3c40fc52012-02-09 17:53:52 -0800267static struct resource resources_qup_i2c_gsbi1[] = {
268 {
269 .name = "gsbi_qup_i2c_addr",
270 .start = MSM_GSBI1_PHYS,
271 .end = MSM_GSBI1_PHYS + 4 - 1,
272 .flags = IORESOURCE_MEM,
273 },
274 {
275 .name = "qup_phys_addr",
276 .start = MSM_GSBI1_QUP_PHYS,
277 .end = MSM_GSBI1_QUP_PHYS + MSM_QUP_SIZE - 1,
278 .flags = IORESOURCE_MEM,
279 },
280 {
281 .name = "qup_err_intr",
282 .start = APQ8064_GSBI1_QUP_IRQ,
283 .end = APQ8064_GSBI1_QUP_IRQ,
284 .flags = IORESOURCE_IRQ,
285 },
286 {
287 .name = "i2c_clk",
288 .start = 21,
289 .end = 21,
290 .flags = IORESOURCE_IO,
291 },
292 {
293 .name = "i2c_sda",
294 .start = 20,
295 .end = 20,
296 .flags = IORESOURCE_IO,
297 },
298};
299
300struct platform_device apq8064_device_qup_i2c_gsbi1 = {
301 .name = "qup_i2c",
302 .id = 0,
303 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi1),
304 .resource = resources_qup_i2c_gsbi1,
305};
306
Jing Lin04601f92012-02-05 15:36:07 -0800307struct platform_device apq8064_device_qup_i2c_gsbi3 = {
308 .name = "qup_i2c",
309 .id = 3,
310 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi3),
311 .resource = resources_qup_i2c_gsbi3,
312};
313
Kenneth Heitke748593a2011-07-15 15:45:11 -0600314static struct resource resources_qup_i2c_gsbi4[] = {
315 {
316 .name = "gsbi_qup_i2c_addr",
317 .start = MSM_GSBI4_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600318 .end = MSM_GSBI4_PHYS + 4 - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600319 .flags = IORESOURCE_MEM,
320 },
321 {
322 .name = "qup_phys_addr",
323 .start = MSM_GSBI4_QUP_PHYS,
Harini Jayaramane1554a92011-09-15 14:43:02 -0600324 .end = MSM_GSBI4_QUP_PHYS + MSM_QUP_SIZE - 1,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600325 .flags = IORESOURCE_MEM,
326 },
327 {
328 .name = "qup_err_intr",
329 .start = GSBI4_QUP_IRQ,
330 .end = GSBI4_QUP_IRQ,
331 .flags = IORESOURCE_IRQ,
332 },
Kevin Chand07220e2012-02-13 15:52:22 -0800333 {
334 .name = "i2c_clk",
335 .start = 11,
336 .end = 11,
337 .flags = IORESOURCE_IO,
338 },
339 {
340 .name = "i2c_sda",
341 .start = 10,
342 .end = 10,
343 .flags = IORESOURCE_IO,
344 },
Kenneth Heitke748593a2011-07-15 15:45:11 -0600345};
346
347struct platform_device apq8064_device_qup_i2c_gsbi4 = {
348 .name = "qup_i2c",
349 .id = 4,
350 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi4),
351 .resource = resources_qup_i2c_gsbi4,
352};
353
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700354static struct resource resources_qup_spi_gsbi5[] = {
355 {
356 .name = "spi_base",
357 .start = MSM_GSBI5_QUP_PHYS,
358 .end = MSM_GSBI5_QUP_PHYS + SZ_4K - 1,
359 .flags = IORESOURCE_MEM,
360 },
361 {
362 .name = "gsbi_base",
363 .start = MSM_GSBI5_PHYS,
364 .end = MSM_GSBI5_PHYS + 4 - 1,
365 .flags = IORESOURCE_MEM,
366 },
367 {
368 .name = "spi_irq_in",
369 .start = GSBI5_QUP_IRQ,
370 .end = GSBI5_QUP_IRQ,
371 .flags = IORESOURCE_IRQ,
372 },
373};
374
375struct platform_device apq8064_device_qup_spi_gsbi5 = {
376 .name = "spi_qsd",
377 .id = 0,
378 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi5),
379 .resource = resources_qup_spi_gsbi5,
380};
381
Bar Weinerf82c5872012-10-23 14:31:26 +0200382static struct resource resources_qup_spi_gsbi6[] = {
383 {
384 .name = "spi_base",
385 .start = MSM_GSBI6_QUP_PHYS,
386 .end = MSM_GSBI6_QUP_PHYS + SZ_4K - 1,
387 .flags = IORESOURCE_MEM,
388 },
389 {
390 .name = "gsbi_base",
391 .start = MSM_GSBI6_PHYS,
392 .end = MSM_GSBI6_PHYS + 4 - 1,
393 .flags = IORESOURCE_MEM,
394 },
395 {
396 .name = "spi_irq_in",
397 .start = GSBI6_QUP_IRQ,
398 .end = GSBI6_QUP_IRQ,
399 .flags = IORESOURCE_IRQ,
400 },
401 {
402 .name = "spi_clk",
403 .start = 17,
404 .end = 17,
405 .flags = IORESOURCE_IO,
406 },
407 {
408 .name = "spi_miso",
409 .start = 15,
410 .end = 15,
411 .flags = IORESOURCE_IO,
412 },
413 {
414 .name = "spi_mosi",
415 .start = 14,
416 .end = 14,
417 .flags = IORESOURCE_IO,
418 },
419 {
420 .name = "spi_cs",
421 .start = 16,
422 .end = 16,
423 .flags = IORESOURCE_IO,
424 }
425};
426
427struct platform_device mpq8064_device_qup_spi_gsbi6 = {
428 .name = "spi_qsd",
429 .id = 1,
430 .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi6),
431 .resource = resources_qup_spi_gsbi6,
432};
433
Joel King8f839b92012-04-01 14:37:46 -0700434static struct resource resources_qup_i2c_gsbi5[] = {
435 {
436 .name = "gsbi_qup_i2c_addr",
437 .start = MSM_GSBI5_PHYS,
438 .end = MSM_GSBI5_PHYS + 4 - 1,
439 .flags = IORESOURCE_MEM,
440 },
441 {
442 .name = "qup_phys_addr",
443 .start = MSM_GSBI5_QUP_PHYS,
444 .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
445 .flags = IORESOURCE_MEM,
446 },
447 {
448 .name = "qup_err_intr",
449 .start = GSBI5_QUP_IRQ,
450 .end = GSBI5_QUP_IRQ,
451 .flags = IORESOURCE_IRQ,
452 },
453 {
454 .name = "i2c_clk",
455 .start = 54,
456 .end = 54,
457 .flags = IORESOURCE_IO,
458 },
459 {
460 .name = "i2c_sda",
461 .start = 53,
462 .end = 53,
463 .flags = IORESOURCE_IO,
464 },
465};
466
467struct platform_device mpq8064_device_qup_i2c_gsbi5 = {
468 .name = "qup_i2c",
469 .id = 5,
470 .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
471 .resource = resources_qup_i2c_gsbi5,
472};
473
Saket Saurabhd425a5d2012-11-06 16:08:28 +0530474static struct resource resources_uart_gsbi5[] = {
475 {
476 .start = GSBI5_UARTDM_IRQ,
477 .end = GSBI5_UARTDM_IRQ,
478 .flags = IORESOURCE_IRQ,
479 },
480 {
481 .start = MSM_UART5DM_PHYS,
482 .end = MSM_UART5DM_PHYS + PAGE_SIZE - 1,
483 .name = "uartdm_resource",
484 .flags = IORESOURCE_MEM,
485 },
486 {
487 .start = MSM_GSBI5_PHYS,
488 .end = MSM_GSBI5_PHYS + PAGE_SIZE - 1,
489 .name = "gsbi_resource",
490 .flags = IORESOURCE_MEM,
491 },
492};
493
494struct platform_device mpq8064_device_uart_gsbi5 = {
495 .name = "msm_serial_hsl",
496 .id = 2,
497 .num_resources = ARRAY_SIZE(resources_uart_gsbi5),
498 .resource = resources_uart_gsbi5,
499};
500
Mayank Rana262e9032012-05-10 15:14:00 -0700501/* GSBI 6 used into UARTDM Mode */
502static struct resource msm_uart_dm6_resources[] = {
503 {
504 .start = MSM_UART6DM_PHYS,
505 .end = MSM_UART6DM_PHYS + PAGE_SIZE - 1,
506 .name = "uartdm_resource",
507 .flags = IORESOURCE_MEM,
508 },
509 {
510 .start = GSBI6_UARTDM_IRQ,
511 .end = GSBI6_UARTDM_IRQ,
512 .flags = IORESOURCE_IRQ,
513 },
514 {
515 .start = MSM_GSBI6_PHYS,
516 .end = MSM_GSBI6_PHYS + 4 - 1,
517 .name = "gsbi_resource",
518 .flags = IORESOURCE_MEM,
519 },
520 {
521 .start = DMOV_MPQ8064_HSUART_GSBI6_TX_CHAN,
522 .end = DMOV_MPQ8064_HSUART_GSBI6_RX_CHAN,
523 .name = "uartdm_channels",
524 .flags = IORESOURCE_DMA,
525 },
526 {
527 .start = DMOV_MPQ8064_HSUART_GSBI6_TX_CRCI,
528 .end = DMOV_MPQ8064_HSUART_GSBI6_RX_CRCI,
529 .name = "uartdm_crci",
530 .flags = IORESOURCE_DMA,
531 },
532};
533static u64 msm_uart_dm6_dma_mask = DMA_BIT_MASK(32);
534struct platform_device mpq8064_device_uartdm_gsbi6 = {
535 .name = "msm_serial_hs",
536 .id = 0,
537 .num_resources = ARRAY_SIZE(msm_uart_dm6_resources),
538 .resource = msm_uart_dm6_resources,
539 .dev = {
540 .dma_mask = &msm_uart_dm6_dma_mask,
541 .coherent_dma_mask = DMA_BIT_MASK(32),
542 },
543};
544
Jin Hong4bbbfba2012-02-02 21:48:07 -0800545static struct resource resources_uart_gsbi7[] = {
546 {
547 .start = GSBI7_UARTDM_IRQ,
548 .end = GSBI7_UARTDM_IRQ,
549 .flags = IORESOURCE_IRQ,
550 },
551 {
552 .start = MSM_UART7DM_PHYS,
553 .end = MSM_UART7DM_PHYS + PAGE_SIZE - 1,
554 .name = "uartdm_resource",
555 .flags = IORESOURCE_MEM,
556 },
557 {
558 .start = MSM_GSBI7_PHYS,
559 .end = MSM_GSBI7_PHYS + PAGE_SIZE - 1,
560 .name = "gsbi_resource",
561 .flags = IORESOURCE_MEM,
562 },
563};
564
565struct platform_device apq8064_device_uart_gsbi7 = {
566 .name = "msm_serial_hsl",
567 .id = 0,
568 .num_resources = ARRAY_SIZE(resources_uart_gsbi7),
569 .resource = resources_uart_gsbi7,
570};
571
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800572struct platform_device apq_pcm = {
573 .name = "msm-pcm-dsp",
574 .id = -1,
575};
576
577struct platform_device apq_pcm_routing = {
578 .name = "msm-pcm-routing",
579 .id = -1,
580};
581
582struct platform_device apq_cpudai0 = {
583 .name = "msm-dai-q6",
584 .id = 0x4000,
585};
586
587struct platform_device apq_cpudai1 = {
588 .name = "msm-dai-q6",
589 .id = 0x4001,
590};
Santosh Mardieff9a742012-04-09 23:23:39 +0530591struct platform_device mpq_cpudai_sec_i2s_rx = {
592 .name = "msm-dai-q6",
593 .id = 4,
594};
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800595struct platform_device apq_cpudai_hdmi_rx = {
Swaminathan Sathappanfd9dbad2012-02-15 16:56:44 -0800596 .name = "msm-dai-q6-hdmi",
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800597 .id = 8,
598};
599
600struct platform_device apq_cpudai_bt_rx = {
601 .name = "msm-dai-q6",
602 .id = 0x3000,
603};
604
605struct platform_device apq_cpudai_bt_tx = {
606 .name = "msm-dai-q6",
607 .id = 0x3001,
608};
609
610struct platform_device apq_cpudai_fm_rx = {
611 .name = "msm-dai-q6",
612 .id = 0x3004,
613};
614
615struct platform_device apq_cpudai_fm_tx = {
616 .name = "msm-dai-q6",
617 .id = 0x3005,
618};
619
Helen Zeng8f925502012-03-05 16:50:17 -0800620struct platform_device apq_cpudai_slim_4_rx = {
621 .name = "msm-dai-q6",
622 .id = 0x4008,
623};
624
625struct platform_device apq_cpudai_slim_4_tx = {
626 .name = "msm-dai-q6",
627 .id = 0x4009,
628};
629
Aviral Guptabfa97882012-10-16 12:15:59 +0530630struct platform_device mpq_cpudai_pseudo = {
631 .name = "msm-dai-q6",
632 .id = 0x8001,
633};
Joel Nidere5de00e2012-07-03 10:58:10 +0300634#define MSM_TSIF0_PHYS (0x18200000)
635#define MSM_TSIF1_PHYS (0x18201000)
636#define MSM_TSIF_SIZE (0x200)
637
638#define TSIF_0_CLK GPIO_CFG(55, 1, GPIO_CFG_INPUT, \
639 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
640#define TSIF_0_EN GPIO_CFG(56, 1, GPIO_CFG_INPUT, \
641 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
642#define TSIF_0_DATA GPIO_CFG(57, 1, GPIO_CFG_INPUT, \
643 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
644#define TSIF_0_SYNC GPIO_CFG(62, 1, GPIO_CFG_INPUT, \
645 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
646#define TSIF_1_CLK GPIO_CFG(59, 1, GPIO_CFG_INPUT, \
647 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
648#define TSIF_1_EN GPIO_CFG(60, 1, GPIO_CFG_INPUT, \
649 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
650#define TSIF_1_DATA GPIO_CFG(61, 1, GPIO_CFG_INPUT, \
651 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
652#define TSIF_1_SYNC GPIO_CFG(58, 1, GPIO_CFG_INPUT, \
653 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
654
655static const struct msm_gpio tsif0_gpios[] = {
656 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
657 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
658 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
659 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
660};
661
662static const struct msm_gpio tsif1_gpios[] = {
663 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
664 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
665 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
666 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
667};
668
669struct msm_tsif_platform_data tsif1_8064_platform_data = {
670 .num_gpios = ARRAY_SIZE(tsif1_gpios),
671 .gpios = tsif1_gpios,
672 .tsif_pclk = "iface_clk",
673 .tsif_ref_clk = "ref_clk",
674};
675
676struct resource tsif1_8064_resources[] = {
677 [0] = {
678 .flags = IORESOURCE_IRQ,
679 .start = TSIF2_IRQ,
680 .end = TSIF2_IRQ,
681 },
682 [1] = {
683 .flags = IORESOURCE_MEM,
684 .start = MSM_TSIF1_PHYS,
685 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
686 },
687 [2] = {
688 .flags = IORESOURCE_DMA,
689 .start = DMOV8064_TSIF_CHAN,
690 .end = DMOV8064_TSIF_CRCI,
691 },
692};
693
694struct msm_tsif_platform_data tsif0_8064_platform_data = {
695 .num_gpios = ARRAY_SIZE(tsif0_gpios),
696 .gpios = tsif0_gpios,
697 .tsif_pclk = "iface_clk",
698 .tsif_ref_clk = "ref_clk",
699};
700
701struct resource tsif0_8064_resources[] = {
702 [0] = {
703 .flags = IORESOURCE_IRQ,
704 .start = TSIF1_IRQ,
705 .end = TSIF1_IRQ,
706 },
707 [1] = {
708 .flags = IORESOURCE_MEM,
709 .start = MSM_TSIF0_PHYS,
710 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
711 },
712 [2] = {
713 .flags = IORESOURCE_DMA,
714 .start = DMOV_TSIF_CHAN,
715 .end = DMOV_TSIF_CRCI,
716 },
717};
718
719struct platform_device msm_8064_device_tsif[2] = {
720 {
721 .name = "msm_tsif",
722 .id = 0,
723 .num_resources = ARRAY_SIZE(tsif0_8064_resources),
724 .resource = tsif0_8064_resources,
725 .dev = {
726 .platform_data = &tsif0_8064_platform_data
727 },
728 },
729 {
730 .name = "msm_tsif",
731 .id = 1,
732 .num_resources = ARRAY_SIZE(tsif1_8064_resources),
733 .resource = tsif1_8064_resources,
734 .dev = {
735 .platform_data = &tsif1_8064_platform_data
736 },
737 }
738};
739
Joel Nider50b50fa2012-08-05 14:17:29 +0300740#define MSM_TSPP_PHYS (0x18202000)
741#define MSM_TSPP_SIZE (0x1000)
742#define MSM_TSPP_BAM_PHYS (0x18204000)
743#define MSM_TSPP_BAM_SIZE (0x2000)
744
745static const struct msm_gpio tspp_gpios[] = {
746 { .gpio_cfg = TSIF_0_CLK, .label = "tsif_clk", },
747 { .gpio_cfg = TSIF_0_EN, .label = "tsif_en", },
748 { .gpio_cfg = TSIF_0_DATA, .label = "tsif_data", },
749 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif_sync", },
750 { .gpio_cfg = TSIF_1_CLK, .label = "tsif_clk", },
751 { .gpio_cfg = TSIF_1_EN, .label = "tsif_en", },
752 { .gpio_cfg = TSIF_1_DATA, .label = "tsif_data", },
753 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif_sync", },
754};
755
756static struct resource tspp_resources[] = {
757 [0] = {
758 .flags = IORESOURCE_IRQ,
759 .start = TSIF_TSPP_IRQ,
760 .end = TSIF1_IRQ,
761 },
762 [1] = {
763 .flags = IORESOURCE_MEM,
764 .start = MSM_TSIF0_PHYS,
765 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
766 },
767 [2] = {
768 .flags = IORESOURCE_MEM,
769 .start = MSM_TSIF1_PHYS,
770 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
771 },
772 [3] = {
773 .flags = IORESOURCE_MEM,
774 .start = MSM_TSPP_PHYS,
775 .end = MSM_TSPP_PHYS + MSM_TSPP_SIZE - 1,
776 },
777 [4] = {
778 .flags = IORESOURCE_MEM,
779 .start = MSM_TSPP_BAM_PHYS,
780 .end = MSM_TSPP_BAM_PHYS + MSM_TSPP_BAM_SIZE - 1,
781 },
782};
783
784static struct msm_tspp_platform_data tspp_platform_data = {
785 .num_gpios = ARRAY_SIZE(tspp_gpios),
786 .gpios = tspp_gpios,
787 .tsif_pclk = "iface_clk",
788 .tsif_ref_clk = "ref_clk",
789};
790
791struct platform_device msm_8064_device_tspp = {
792 .name = "msm_tspp",
793 .id = 0,
794 .num_resources = ARRAY_SIZE(tspp_resources),
795 .resource = tspp_resources,
796 .dev = {
797 .platform_data = &tspp_platform_data
798 },
799};
800
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800801/*
802 * Machine specific data for AUX PCM Interface
803 * which the driver will be unware of.
804 */
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800805struct msm_dai_auxpcm_pdata apq_auxpcm_pdata = {
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800806 .clk = "pcm_clk",
Kuirong Wang547a9982012-05-04 18:29:11 -0700807 .mode_8k = {
808 .mode = AFE_PCM_CFG_MODE_PCM,
809 .sync = AFE_PCM_CFG_SYNC_INT,
810 .frame = AFE_PCM_CFG_FRM_256BPF,
811 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
812 .slot = 0,
813 .data = AFE_PCM_CFG_CDATAOE_MASTER,
814 .pcm_clk_rate = 2048000,
815 },
816 .mode_16k = {
817 .mode = AFE_PCM_CFG_MODE_PCM,
818 .sync = AFE_PCM_CFG_SYNC_INT,
819 .frame = AFE_PCM_CFG_FRM_256BPF,
820 .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD,
821 .slot = 0,
822 .data = AFE_PCM_CFG_CDATAOE_MASTER,
823 .pcm_clk_rate = 4096000,
824 }
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800825};
826
827struct platform_device apq_cpudai_auxpcm_rx = {
828 .name = "msm-dai-q6",
829 .id = 2,
830 .dev = {
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800831 .platform_data = &apq_auxpcm_pdata,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800832 },
833};
834
835struct platform_device apq_cpudai_auxpcm_tx = {
836 .name = "msm-dai-q6",
837 .id = 3,
Kiran Kandi5f4ab692012-02-23 11:23:56 -0800838 .dev = {
839 .platform_data = &apq_auxpcm_pdata,
840 },
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800841};
842
Patrick Lai04baee942012-05-01 14:38:47 -0700843struct msm_mi2s_pdata mpq_mi2s_tx_data = {
844 .rx_sd_lines = 0,
845 .tx_sd_lines = MSM_MI2S_SD0 | MSM_MI2S_SD1 | MSM_MI2S_SD2 |
846 MSM_MI2S_SD3,
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700847};
848
849struct platform_device mpq_cpudai_mi2s_tx = {
Patrick Lai04baee942012-05-01 14:38:47 -0700850 .name = "msm-dai-q6-mi2s",
851 .id = -1, /*MI2S_TX */
Kuirong Wangf23f8c52012-03-31 12:34:51 -0700852 .dev = {
853 .platform_data = &mpq_mi2s_tx_data,
854 },
855};
856
Kuirong Wangf8c5e142012-06-21 16:17:32 -0700857struct msm_mi2s_pdata apq_mi2s_data = {
858 .rx_sd_lines = MSM_MI2S_SD0,
859 .tx_sd_lines = MSM_MI2S_SD3,
860};
861
862struct platform_device apq_cpudai_mi2s = {
863 .name = "msm-dai-q6-mi2s",
864 .id = -1,
865 .dev = {
866 .platform_data = &apq_mi2s_data,
867 },
868};
869
870struct platform_device apq_cpudai_i2s_rx = {
871 .name = "msm-dai-q6",
872 .id = PRIMARY_I2S_RX,
873};
874
875struct platform_device apq_cpudai_i2s_tx = {
876 .name = "msm-dai-q6",
877 .id = PRIMARY_I2S_TX,
878};
879
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800880struct platform_device apq_cpu_fe = {
881 .name = "msm-dai-fe",
882 .id = -1,
883};
884
885struct platform_device apq_stub_codec = {
886 .name = "msm-stub-codec",
887 .id = 1,
888};
889
890struct platform_device apq_voice = {
891 .name = "msm-pcm-voice",
892 .id = -1,
893};
894
895struct platform_device apq_voip = {
896 .name = "msm-voip-dsp",
897 .id = -1,
898};
899
900struct platform_device apq_lpa_pcm = {
901 .name = "msm-pcm-lpa",
902 .id = -1,
903};
904
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -0700905struct platform_device apq_compr_dsp = {
906 .name = "msm-compr-dsp",
907 .id = -1,
908};
909
910struct platform_device apq_multi_ch_pcm = {
911 .name = "msm-multi-ch-pcm-dsp",
912 .id = -1,
913};
914
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -0700915struct platform_device apq_lowlatency_pcm = {
916 .name = "msm-lowlatency-pcm-dsp",
917 .id = -1,
918};
919
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -0800920struct platform_device apq_pcm_hostless = {
921 .name = "msm-pcm-hostless",
922 .id = -1,
923};
924
925struct platform_device apq_cpudai_afe_01_rx = {
926 .name = "msm-dai-q6",
927 .id = 0xE0,
928};
929
930struct platform_device apq_cpudai_afe_01_tx = {
931 .name = "msm-dai-q6",
932 .id = 0xF0,
933};
934
935struct platform_device apq_cpudai_afe_02_rx = {
936 .name = "msm-dai-q6",
937 .id = 0xF1,
938};
939
940struct platform_device apq_cpudai_afe_02_tx = {
941 .name = "msm-dai-q6",
942 .id = 0xE1,
943};
944
945struct platform_device apq_pcm_afe = {
946 .name = "msm-pcm-afe",
947 .id = -1,
948};
949
Neema Shetty8427c262012-02-16 11:23:43 -0800950struct platform_device apq_cpudai_stub = {
951 .name = "msm-dai-stub",
952 .id = -1,
953};
954
Neema Shetty3c9d2862012-03-11 01:25:32 -0800955struct platform_device apq_cpudai_slimbus_1_rx = {
956 .name = "msm-dai-q6",
957 .id = 0x4002,
958};
959
960struct platform_device apq_cpudai_slimbus_1_tx = {
961 .name = "msm-dai-q6",
962 .id = 0x4003,
963};
964
Kiran Kandi97fe19d2012-05-20 22:34:04 -0700965struct platform_device apq_cpudai_slimbus_2_rx = {
966 .name = "msm-dai-q6",
967 .id = 0x4004,
968};
969
Kiran Kandi1e6371d2012-03-29 11:48:57 -0700970struct platform_device apq_cpudai_slimbus_2_tx = {
971 .name = "msm-dai-q6",
972 .id = 0x4005,
973};
974
Neema Shettyc9d86c32012-05-09 12:01:39 -0700975struct platform_device apq_cpudai_slimbus_3_rx = {
976 .name = "msm-dai-q6",
977 .id = 0x4006,
978};
979
Helen Zeng38c3c962012-05-17 14:56:20 -0700980struct platform_device apq_cpudai_slimbus_3_tx = {
981 .name = "msm-dai-q6",
982 .id = 0x4007,
983};
984
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700985static struct resource resources_ssbi_pmic1[] = {
986 {
987 .start = MSM_PMIC1_SSBI_CMD_PHYS,
988 .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
989 .flags = IORESOURCE_MEM,
990 },
991};
992
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600993#define LPASS_SLIMBUS_PHYS 0x28080000
994#define LPASS_SLIMBUS_BAM_PHYS 0x28084000
Swaminathan Sathappan2316e082012-02-03 14:07:17 -0800995#define LPASS_SLIMBUS_SLEW (MSM8960_TLMM_PHYS + 0x207C)
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600996/* Board info for the slimbus slave device */
997static struct resource slimbus_res[] = {
998 {
999 .start = LPASS_SLIMBUS_PHYS,
1000 .end = LPASS_SLIMBUS_PHYS + 8191,
1001 .flags = IORESOURCE_MEM,
1002 .name = "slimbus_physical",
1003 },
1004 {
1005 .start = LPASS_SLIMBUS_BAM_PHYS,
1006 .end = LPASS_SLIMBUS_BAM_PHYS + 8191,
1007 .flags = IORESOURCE_MEM,
1008 .name = "slimbus_bam_physical",
1009 },
1010 {
Swaminathan Sathappan2316e082012-02-03 14:07:17 -08001011 .start = LPASS_SLIMBUS_SLEW,
1012 .end = LPASS_SLIMBUS_SLEW + 4 - 1,
1013 .flags = IORESOURCE_MEM,
1014 .name = "slimbus_slew_reg",
1015 },
1016 {
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001017 .start = SLIMBUS0_CORE_EE1_IRQ,
1018 .end = SLIMBUS0_CORE_EE1_IRQ,
1019 .flags = IORESOURCE_IRQ,
1020 .name = "slimbus_irq",
1021 },
1022 {
1023 .start = SLIMBUS0_BAM_EE1_IRQ,
1024 .end = SLIMBUS0_BAM_EE1_IRQ,
1025 .flags = IORESOURCE_IRQ,
1026 .name = "slimbus_bam_irq",
1027 },
1028};
1029
1030struct platform_device apq8064_slim_ctrl = {
1031 .name = "msm_slim_ctrl",
1032 .id = 1,
1033 .num_resources = ARRAY_SIZE(slimbus_res),
1034 .resource = slimbus_res,
1035 .dev = {
1036 .coherent_dma_mask = 0xffffffffULL,
1037 },
1038};
1039
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001040struct platform_device apq8064_device_ssbi_pmic1 = {
1041 .name = "msm_ssbi",
1042 .id = 0,
1043 .resource = resources_ssbi_pmic1,
1044 .num_resources = ARRAY_SIZE(resources_ssbi_pmic1),
1045};
1046
1047static struct resource resources_ssbi_pmic2[] = {
1048 {
1049 .start = MSM_PMIC2_SSBI_CMD_PHYS,
1050 .end = MSM_PMIC2_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1,
1051 .flags = IORESOURCE_MEM,
1052 },
1053};
1054
1055struct platform_device apq8064_device_ssbi_pmic2 = {
1056 .name = "msm_ssbi",
1057 .id = 1,
1058 .resource = resources_ssbi_pmic2,
1059 .num_resources = ARRAY_SIZE(resources_ssbi_pmic2),
1060};
1061
1062static struct resource resources_otg[] = {
1063 {
Hemant Kumard86c4882012-01-24 19:39:37 -08001064 .start = MSM_HSUSB1_PHYS,
1065 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001066 .flags = IORESOURCE_MEM,
1067 },
1068 {
1069 .start = USB1_HS_IRQ,
1070 .end = USB1_HS_IRQ,
1071 .flags = IORESOURCE_IRQ,
1072 },
1073};
1074
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001075struct platform_device apq8064_device_otg = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001076 .name = "msm_otg",
1077 .id = -1,
1078 .num_resources = ARRAY_SIZE(resources_otg),
1079 .resource = resources_otg,
1080 .dev = {
1081 .coherent_dma_mask = 0xffffffff,
1082 },
1083};
1084
1085static struct resource resources_hsusb[] = {
1086 {
Hemant Kumard86c4882012-01-24 19:39:37 -08001087 .start = MSM_HSUSB1_PHYS,
1088 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001089 .flags = IORESOURCE_MEM,
1090 },
1091 {
1092 .start = USB1_HS_IRQ,
1093 .end = USB1_HS_IRQ,
1094 .flags = IORESOURCE_IRQ,
1095 },
1096};
1097
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001098struct platform_device apq8064_device_gadget_peripheral = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001099 .name = "msm_hsusb",
1100 .id = -1,
1101 .num_resources = ARRAY_SIZE(resources_hsusb),
1102 .resource = resources_hsusb,
1103 .dev = {
1104 .coherent_dma_mask = 0xffffffff,
1105 },
1106};
1107
Hemant Kumard86c4882012-01-24 19:39:37 -08001108static struct resource resources_hsusb_host[] = {
1109 {
1110 .start = MSM_HSUSB1_PHYS,
1111 .end = MSM_HSUSB1_PHYS + MSM_HSUSB1_SIZE - 1,
1112 .flags = IORESOURCE_MEM,
1113 },
1114 {
1115 .start = USB1_HS_IRQ,
1116 .end = USB1_HS_IRQ,
1117 .flags = IORESOURCE_IRQ,
1118 },
1119};
1120
Hemant Kumara945b472012-01-25 15:08:06 -08001121static struct resource resources_hsic_host[] = {
1122 {
1123 .start = 0x12510000,
1124 .end = 0x12510000 + SZ_4K - 1,
1125 .flags = IORESOURCE_MEM,
1126 },
1127 {
1128 .start = USB2_HSIC_IRQ,
1129 .end = USB2_HSIC_IRQ,
1130 .flags = IORESOURCE_IRQ,
1131 },
1132 {
1133 .start = MSM_GPIO_TO_INT(49),
1134 .end = MSM_GPIO_TO_INT(49),
1135 .name = "peripheral_status_irq",
1136 .flags = IORESOURCE_IRQ,
1137 },
Vamsi Krishna6921cbe2012-02-21 18:34:43 -08001138 {
Jack Pham0cc75c42012-10-10 02:03:50 +02001139 .start = MSM_GPIO_TO_INT(47),
1140 .end = MSM_GPIO_TO_INT(47),
Hemant Kumar6fd65032012-05-23 13:02:24 -07001141 .name = "wakeup",
Jack Pham0cc75c42012-10-10 02:03:50 +02001142 .flags = IORESOURCE_IRQ,
Vamsi Krishna6921cbe2012-02-21 18:34:43 -08001143 },
Hemant Kumara945b472012-01-25 15:08:06 -08001144};
1145
Hemant Kumard86c4882012-01-24 19:39:37 -08001146static u64 dma_mask = DMA_BIT_MASK(32);
1147struct platform_device apq8064_device_hsusb_host = {
1148 .name = "msm_hsusb_host",
1149 .id = -1,
1150 .num_resources = ARRAY_SIZE(resources_hsusb_host),
1151 .resource = resources_hsusb_host,
1152 .dev = {
1153 .dma_mask = &dma_mask,
1154 .coherent_dma_mask = 0xffffffff,
1155 },
1156};
1157
Hemant Kumara945b472012-01-25 15:08:06 -08001158struct platform_device apq8064_device_hsic_host = {
1159 .name = "msm_hsic_host",
1160 .id = -1,
1161 .num_resources = ARRAY_SIZE(resources_hsic_host),
1162 .resource = resources_hsic_host,
1163 .dev = {
1164 .dma_mask = &dma_mask,
1165 .coherent_dma_mask = DMA_BIT_MASK(32),
1166 },
1167};
1168
Manu Gautam91223e02011-11-08 15:27:22 +05301169static struct resource resources_ehci_host3[] = {
1170{
1171 .start = MSM_HSUSB3_PHYS,
1172 .end = MSM_HSUSB3_PHYS + MSM_HSUSB3_SIZE - 1,
1173 .flags = IORESOURCE_MEM,
1174 },
1175 {
1176 .start = USB3_HS_IRQ,
1177 .end = USB3_HS_IRQ,
1178 .flags = IORESOURCE_IRQ,
1179 },
1180};
1181
1182struct platform_device apq8064_device_ehci_host3 = {
1183 .name = "msm_ehci_host",
1184 .id = 0,
1185 .num_resources = ARRAY_SIZE(resources_ehci_host3),
1186 .resource = resources_ehci_host3,
1187 .dev = {
1188 .dma_mask = &dma_mask,
1189 .coherent_dma_mask = 0xffffffff,
1190 },
1191};
1192
Hemant Kumar1d66e1c2012-02-13 15:24:59 -08001193static struct resource resources_ehci_host4[] = {
1194{
1195 .start = MSM_HSUSB4_PHYS,
1196 .end = MSM_HSUSB4_PHYS + MSM_HSUSB4_SIZE - 1,
1197 .flags = IORESOURCE_MEM,
1198 },
1199 {
1200 .start = USB4_HS_IRQ,
1201 .end = USB4_HS_IRQ,
1202 .flags = IORESOURCE_IRQ,
1203 },
1204};
1205
1206struct platform_device apq8064_device_ehci_host4 = {
1207 .name = "msm_ehci_host",
1208 .id = 1,
1209 .num_resources = ARRAY_SIZE(resources_ehci_host4),
1210 .resource = resources_ehci_host4,
1211 .dev = {
1212 .dma_mask = &dma_mask,
1213 .coherent_dma_mask = 0xffffffff,
1214 },
1215};
1216
Matt Wagantallf5cc3892012-06-07 19:47:02 -07001217struct platform_device apq8064_device_acpuclk = {
1218 .name = "acpuclk-8064",
1219 .id = -1,
1220};
1221
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -07001222#define SHARED_IMEM_TZ_BASE 0x2a03f720
1223static struct resource tzlog_resources[] = {
1224 {
1225 .start = SHARED_IMEM_TZ_BASE,
1226 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
1227 .flags = IORESOURCE_MEM,
1228 },
1229};
1230
1231struct platform_device apq_device_tz_log = {
1232 .name = "tz_log",
1233 .id = 0,
1234 .num_resources = ARRAY_SIZE(tzlog_resources),
1235 .resource = tzlog_resources,
1236};
1237
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001238/* MSM Video core device */
1239#ifdef CONFIG_MSM_BUS_SCALING
1240static struct msm_bus_vectors vidc_init_vectors[] = {
1241 {
1242 .src = MSM_BUS_MASTER_VIDEO_ENC,
1243 .dst = MSM_BUS_SLAVE_EBI_CH0,
1244 .ab = 0,
1245 .ib = 0,
1246 },
1247 {
1248 .src = MSM_BUS_MASTER_VIDEO_DEC,
1249 .dst = MSM_BUS_SLAVE_EBI_CH0,
1250 .ab = 0,
1251 .ib = 0,
1252 },
1253 {
1254 .src = MSM_BUS_MASTER_AMPSS_M0,
1255 .dst = MSM_BUS_SLAVE_EBI_CH0,
1256 .ab = 0,
1257 .ib = 0,
1258 },
1259 {
1260 .src = MSM_BUS_MASTER_AMPSS_M0,
1261 .dst = MSM_BUS_SLAVE_EBI_CH0,
1262 .ab = 0,
1263 .ib = 0,
1264 },
1265};
1266static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
1267 {
1268 .src = MSM_BUS_MASTER_VIDEO_ENC,
1269 .dst = MSM_BUS_SLAVE_EBI_CH0,
1270 .ab = 54525952,
1271 .ib = 436207616,
1272 },
1273 {
1274 .src = MSM_BUS_MASTER_VIDEO_DEC,
1275 .dst = MSM_BUS_SLAVE_EBI_CH0,
1276 .ab = 72351744,
1277 .ib = 289406976,
1278 },
1279 {
1280 .src = MSM_BUS_MASTER_AMPSS_M0,
1281 .dst = MSM_BUS_SLAVE_EBI_CH0,
1282 .ab = 500000,
1283 .ib = 1000000,
1284 },
1285 {
1286 .src = MSM_BUS_MASTER_AMPSS_M0,
1287 .dst = MSM_BUS_SLAVE_EBI_CH0,
1288 .ab = 500000,
1289 .ib = 1000000,
1290 },
1291};
1292static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
1293 {
1294 .src = MSM_BUS_MASTER_VIDEO_ENC,
1295 .dst = MSM_BUS_SLAVE_EBI_CH0,
1296 .ab = 40894464,
1297 .ib = 327155712,
1298 },
1299 {
1300 .src = MSM_BUS_MASTER_VIDEO_DEC,
1301 .dst = MSM_BUS_SLAVE_EBI_CH0,
1302 .ab = 48234496,
1303 .ib = 192937984,
1304 },
1305 {
1306 .src = MSM_BUS_MASTER_AMPSS_M0,
1307 .dst = MSM_BUS_SLAVE_EBI_CH0,
1308 .ab = 500000,
1309 .ib = 2000000,
1310 },
1311 {
1312 .src = MSM_BUS_MASTER_AMPSS_M0,
1313 .dst = MSM_BUS_SLAVE_EBI_CH0,
1314 .ab = 500000,
1315 .ib = 2000000,
1316 },
1317};
1318static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
1319 {
1320 .src = MSM_BUS_MASTER_VIDEO_ENC,
1321 .dst = MSM_BUS_SLAVE_EBI_CH0,
1322 .ab = 163577856,
1323 .ib = 1308622848,
1324 },
1325 {
1326 .src = MSM_BUS_MASTER_VIDEO_DEC,
1327 .dst = MSM_BUS_SLAVE_EBI_CH0,
1328 .ab = 219152384,
1329 .ib = 876609536,
1330 },
1331 {
1332 .src = MSM_BUS_MASTER_AMPSS_M0,
1333 .dst = MSM_BUS_SLAVE_EBI_CH0,
1334 .ab = 1750000,
1335 .ib = 3500000,
1336 },
1337 {
1338 .src = MSM_BUS_MASTER_AMPSS_M0,
1339 .dst = MSM_BUS_SLAVE_EBI_CH0,
1340 .ab = 1750000,
1341 .ib = 3500000,
1342 },
1343};
1344static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
1345 {
1346 .src = MSM_BUS_MASTER_VIDEO_ENC,
1347 .dst = MSM_BUS_SLAVE_EBI_CH0,
1348 .ab = 121634816,
1349 .ib = 973078528,
1350 },
1351 {
1352 .src = MSM_BUS_MASTER_VIDEO_DEC,
1353 .dst = MSM_BUS_SLAVE_EBI_CH0,
1354 .ab = 155189248,
1355 .ib = 620756992,
1356 },
1357 {
1358 .src = MSM_BUS_MASTER_AMPSS_M0,
1359 .dst = MSM_BUS_SLAVE_EBI_CH0,
1360 .ab = 1750000,
1361 .ib = 7000000,
1362 },
1363 {
1364 .src = MSM_BUS_MASTER_AMPSS_M0,
1365 .dst = MSM_BUS_SLAVE_EBI_CH0,
1366 .ab = 1750000,
1367 .ib = 7000000,
1368 },
1369};
1370static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
1371 {
1372 .src = MSM_BUS_MASTER_VIDEO_ENC,
1373 .dst = MSM_BUS_SLAVE_EBI_CH0,
1374 .ab = 372244480,
1375 .ib = 2560000000U,
1376 },
1377 {
1378 .src = MSM_BUS_MASTER_VIDEO_DEC,
1379 .dst = MSM_BUS_SLAVE_EBI_CH0,
1380 .ab = 501219328,
1381 .ib = 2560000000U,
1382 },
1383 {
1384 .src = MSM_BUS_MASTER_AMPSS_M0,
1385 .dst = MSM_BUS_SLAVE_EBI_CH0,
1386 .ab = 2500000,
1387 .ib = 5000000,
1388 },
1389 {
1390 .src = MSM_BUS_MASTER_AMPSS_M0,
1391 .dst = MSM_BUS_SLAVE_EBI_CH0,
1392 .ab = 2500000,
1393 .ib = 5000000,
1394 },
1395};
1396static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
1397 {
1398 .src = MSM_BUS_MASTER_VIDEO_ENC,
1399 .dst = MSM_BUS_SLAVE_EBI_CH0,
1400 .ab = 222298112,
1401 .ib = 2560000000U,
1402 },
1403 {
1404 .src = MSM_BUS_MASTER_VIDEO_DEC,
1405 .dst = MSM_BUS_SLAVE_EBI_CH0,
1406 .ab = 330301440,
1407 .ib = 2560000000U,
1408 },
1409 {
1410 .src = MSM_BUS_MASTER_AMPSS_M0,
1411 .dst = MSM_BUS_SLAVE_EBI_CH0,
1412 .ab = 2500000,
1413 .ib = 700000000,
1414 },
1415 {
1416 .src = MSM_BUS_MASTER_AMPSS_M0,
1417 .dst = MSM_BUS_SLAVE_EBI_CH0,
1418 .ab = 2500000,
1419 .ib = 10000000,
1420 },
1421};
1422
Arun Menon152c3c72012-06-20 11:50:08 -07001423static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
1424 {
1425 .src = MSM_BUS_MASTER_VIDEO_ENC,
1426 .dst = MSM_BUS_SLAVE_EBI_CH0,
1427 .ab = 222298112,
1428 .ib = 3522000000U,
1429 },
1430 {
1431 .src = MSM_BUS_MASTER_VIDEO_DEC,
1432 .dst = MSM_BUS_SLAVE_EBI_CH0,
1433 .ab = 330301440,
1434 .ib = 3522000000U,
1435 },
1436 {
1437 .src = MSM_BUS_MASTER_AMPSS_M0,
1438 .dst = MSM_BUS_SLAVE_EBI_CH0,
1439 .ab = 2500000,
1440 .ib = 700000000,
1441 },
1442 {
1443 .src = MSM_BUS_MASTER_AMPSS_M0,
1444 .dst = MSM_BUS_SLAVE_EBI_CH0,
1445 .ab = 2500000,
1446 .ib = 10000000,
1447 },
1448};
1449static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
1450 {
1451 .src = MSM_BUS_MASTER_VIDEO_ENC,
1452 .dst = MSM_BUS_SLAVE_EBI_CH0,
1453 .ab = 222298112,
1454 .ib = 3522000000U,
1455 },
1456 {
1457 .src = MSM_BUS_MASTER_VIDEO_DEC,
1458 .dst = MSM_BUS_SLAVE_EBI_CH0,
1459 .ab = 330301440,
1460 .ib = 3522000000U,
1461 },
1462 {
1463 .src = MSM_BUS_MASTER_AMPSS_M0,
1464 .dst = MSM_BUS_SLAVE_EBI_CH0,
1465 .ab = 2500000,
1466 .ib = 700000000,
1467 },
1468 {
1469 .src = MSM_BUS_MASTER_AMPSS_M0,
1470 .dst = MSM_BUS_SLAVE_EBI_CH0,
1471 .ab = 2500000,
1472 .ib = 10000000,
1473 },
1474};
1475
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001476static struct msm_bus_paths vidc_bus_client_config[] = {
1477 {
1478 ARRAY_SIZE(vidc_init_vectors),
1479 vidc_init_vectors,
1480 },
1481 {
1482 ARRAY_SIZE(vidc_venc_vga_vectors),
1483 vidc_venc_vga_vectors,
1484 },
1485 {
1486 ARRAY_SIZE(vidc_vdec_vga_vectors),
1487 vidc_vdec_vga_vectors,
1488 },
1489 {
1490 ARRAY_SIZE(vidc_venc_720p_vectors),
1491 vidc_venc_720p_vectors,
1492 },
1493 {
1494 ARRAY_SIZE(vidc_vdec_720p_vectors),
1495 vidc_vdec_720p_vectors,
1496 },
1497 {
1498 ARRAY_SIZE(vidc_venc_1080p_vectors),
1499 vidc_venc_1080p_vectors,
1500 },
1501 {
1502 ARRAY_SIZE(vidc_vdec_1080p_vectors),
1503 vidc_vdec_1080p_vectors,
1504 },
Arun Menon152c3c72012-06-20 11:50:08 -07001505 {
1506 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
1507 vidc_venc_1080p_turbo_vectors,
1508 },
1509 {
1510 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
1511 vidc_vdec_1080p_turbo_vectors,
1512 },
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001513};
1514
1515static struct msm_bus_scale_pdata vidc_bus_client_data = {
1516 vidc_bus_client_config,
1517 ARRAY_SIZE(vidc_bus_client_config),
1518 .name = "vidc",
1519};
1520#endif
1521
1522
1523#define APQ8064_VIDC_BASE_PHYS 0x04400000
1524#define APQ8064_VIDC_BASE_SIZE 0x00100000
1525
1526static struct resource apq8064_device_vidc_resources[] = {
1527 {
1528 .start = APQ8064_VIDC_BASE_PHYS,
1529 .end = APQ8064_VIDC_BASE_PHYS + APQ8064_VIDC_BASE_SIZE - 1,
1530 .flags = IORESOURCE_MEM,
1531 },
1532 {
1533 .start = VCODEC_IRQ,
1534 .end = VCODEC_IRQ,
1535 .flags = IORESOURCE_IRQ,
1536 },
1537};
1538
1539struct msm_vidc_platform_data apq8064_vidc_platform_data = {
1540#ifdef CONFIG_MSM_BUS_SCALING
1541 .vidc_bus_client_pdata = &vidc_bus_client_data,
1542#endif
1543#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1544 .memtype = ION_CP_MM_HEAP_ID,
1545 .enable_ion = 1,
Deepak kotureda295a2012-05-10 19:49:46 -07001546 .cp_enabled = 1,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001547#else
1548 .memtype = MEMTYPE_EBI1,
1549 .enable_ion = 0,
1550#endif
1551 .disable_dmx = 0,
1552 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naiked9dc912012-03-01 19:11:14 -08001553 .cont_mode_dpb_count = 18,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05301554 .fw_addr = 0x9fe00000,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001555};
1556
1557struct platform_device apq8064_msm_device_vidc = {
1558 .name = "msm_vidc",
1559 .id = 0,
1560 .num_resources = ARRAY_SIZE(apq8064_device_vidc_resources),
1561 .resource = apq8064_device_vidc_resources,
1562 .dev = {
1563 .platform_data = &apq8064_vidc_platform_data,
1564 },
1565};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001566#define MSM_SDC1_BASE 0x12400000
1567#define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800)
1568#define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000)
1569#define MSM_SDC2_BASE 0x12140000
1570#define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800)
1571#define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000)
1572#define MSM_SDC3_BASE 0x12180000
1573#define MSM_SDC3_DML_BASE (MSM_SDC3_BASE + 0x800)
1574#define MSM_SDC3_BAM_BASE (MSM_SDC3_BASE + 0x2000)
1575#define MSM_SDC4_BASE 0x121C0000
1576#define MSM_SDC4_DML_BASE (MSM_SDC4_BASE + 0x800)
1577#define MSM_SDC4_BAM_BASE (MSM_SDC4_BASE + 0x2000)
1578
1579static struct resource resources_sdc1[] = {
1580 {
1581 .name = "core_mem",
1582 .flags = IORESOURCE_MEM,
1583 .start = MSM_SDC1_BASE,
1584 .end = MSM_SDC1_DML_BASE - 1,
1585 },
1586 {
1587 .name = "core_irq",
1588 .flags = IORESOURCE_IRQ,
1589 .start = SDC1_IRQ_0,
1590 .end = SDC1_IRQ_0
1591 },
1592#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1593 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301594 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001595 .start = MSM_SDC1_DML_BASE,
1596 .end = MSM_SDC1_BAM_BASE - 1,
1597 .flags = IORESOURCE_MEM,
1598 },
1599 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301600 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001601 .start = MSM_SDC1_BAM_BASE,
1602 .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1,
1603 .flags = IORESOURCE_MEM,
1604 },
1605 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301606 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001607 .start = SDC1_BAM_IRQ,
1608 .end = SDC1_BAM_IRQ,
1609 .flags = IORESOURCE_IRQ,
1610 },
1611#endif
1612};
1613
1614static struct resource resources_sdc2[] = {
1615 {
1616 .name = "core_mem",
1617 .flags = IORESOURCE_MEM,
1618 .start = MSM_SDC2_BASE,
1619 .end = MSM_SDC2_DML_BASE - 1,
1620 },
1621 {
1622 .name = "core_irq",
1623 .flags = IORESOURCE_IRQ,
1624 .start = SDC2_IRQ_0,
1625 .end = SDC2_IRQ_0
1626 },
1627#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1628 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301629 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001630 .start = MSM_SDC2_DML_BASE,
1631 .end = MSM_SDC2_BAM_BASE - 1,
1632 .flags = IORESOURCE_MEM,
1633 },
1634 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301635 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001636 .start = MSM_SDC2_BAM_BASE,
1637 .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1,
1638 .flags = IORESOURCE_MEM,
1639 },
1640 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301641 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001642 .start = SDC2_BAM_IRQ,
1643 .end = SDC2_BAM_IRQ,
1644 .flags = IORESOURCE_IRQ,
1645 },
1646#endif
1647};
1648
1649static struct resource resources_sdc3[] = {
1650 {
1651 .name = "core_mem",
1652 .flags = IORESOURCE_MEM,
1653 .start = MSM_SDC3_BASE,
1654 .end = MSM_SDC3_DML_BASE - 1,
1655 },
1656 {
1657 .name = "core_irq",
1658 .flags = IORESOURCE_IRQ,
1659 .start = SDC3_IRQ_0,
1660 .end = SDC3_IRQ_0
1661 },
1662#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1663 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301664 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001665 .start = MSM_SDC3_DML_BASE,
1666 .end = MSM_SDC3_BAM_BASE - 1,
1667 .flags = IORESOURCE_MEM,
1668 },
1669 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301670 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001671 .start = MSM_SDC3_BAM_BASE,
1672 .end = MSM_SDC3_BAM_BASE + (2 * SZ_4K) - 1,
1673 .flags = IORESOURCE_MEM,
1674 },
1675 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301676 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001677 .start = SDC3_BAM_IRQ,
1678 .end = SDC3_BAM_IRQ,
1679 .flags = IORESOURCE_IRQ,
1680 },
1681#endif
1682};
1683
1684static struct resource resources_sdc4[] = {
1685 {
1686 .name = "core_mem",
1687 .flags = IORESOURCE_MEM,
1688 .start = MSM_SDC4_BASE,
1689 .end = MSM_SDC4_DML_BASE - 1,
1690 },
1691 {
1692 .name = "core_irq",
1693 .flags = IORESOURCE_IRQ,
1694 .start = SDC4_IRQ_0,
1695 .end = SDC4_IRQ_0
1696 },
1697#ifdef CONFIG_MMC_MSM_SPS_SUPPORT
1698 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301699 .name = "dml_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001700 .start = MSM_SDC4_DML_BASE,
1701 .end = MSM_SDC4_BAM_BASE - 1,
1702 .flags = IORESOURCE_MEM,
1703 },
1704 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301705 .name = "bam_mem",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001706 .start = MSM_SDC4_BAM_BASE,
1707 .end = MSM_SDC4_BAM_BASE + (2 * SZ_4K) - 1,
1708 .flags = IORESOURCE_MEM,
1709 },
1710 {
Sujit Reddy Thumma1dfac2c2012-07-30 10:15:39 +05301711 .name = "bam_irq",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001712 .start = SDC4_BAM_IRQ,
1713 .end = SDC4_BAM_IRQ,
1714 .flags = IORESOURCE_IRQ,
1715 },
1716#endif
1717};
1718
1719struct platform_device apq8064_device_sdc1 = {
1720 .name = "msm_sdcc",
1721 .id = 1,
1722 .num_resources = ARRAY_SIZE(resources_sdc1),
1723 .resource = resources_sdc1,
1724 .dev = {
1725 .coherent_dma_mask = 0xffffffff,
1726 },
1727};
1728
1729struct platform_device apq8064_device_sdc2 = {
1730 .name = "msm_sdcc",
1731 .id = 2,
1732 .num_resources = ARRAY_SIZE(resources_sdc2),
1733 .resource = resources_sdc2,
1734 .dev = {
1735 .coherent_dma_mask = 0xffffffff,
1736 },
1737};
1738
1739struct platform_device apq8064_device_sdc3 = {
1740 .name = "msm_sdcc",
1741 .id = 3,
1742 .num_resources = ARRAY_SIZE(resources_sdc3),
1743 .resource = resources_sdc3,
1744 .dev = {
1745 .coherent_dma_mask = 0xffffffff,
1746 },
1747};
1748
1749struct platform_device apq8064_device_sdc4 = {
1750 .name = "msm_sdcc",
1751 .id = 4,
1752 .num_resources = ARRAY_SIZE(resources_sdc4),
1753 .resource = resources_sdc4,
1754 .dev = {
1755 .coherent_dma_mask = 0xffffffff,
1756 },
1757};
1758
1759static struct platform_device *apq8064_sdcc_devices[] __initdata = {
1760 &apq8064_device_sdc1,
1761 &apq8064_device_sdc2,
1762 &apq8064_device_sdc3,
1763 &apq8064_device_sdc4,
1764};
1765
1766int __init apq8064_add_sdcc(unsigned int controller,
1767 struct mmc_platform_data *plat)
1768{
1769 struct platform_device *pdev;
1770
1771 if (!plat)
1772 return 0;
1773 if (controller < 1 || controller > 4)
1774 return -EINVAL;
1775
1776 pdev = apq8064_sdcc_devices[controller-1];
1777 pdev->dev.platform_data = plat;
1778 return platform_device_register(pdev);
1779}
1780
Sujit Reddy Thumma183a5c92012-03-07 18:37:07 +05301781#define MSM_SATA_AHCI_BASE 0x29000000
1782#define MSM_SATA_AHCI_REGS_SZ 0x17C
1783
1784static struct resource resources_ahci[] = {
1785 {
1786 .name = "ahci_mem",
1787 .flags = IORESOURCE_MEM,
1788 .start = MSM_SATA_AHCI_BASE,
1789 .end = MSM_SATA_AHCI_BASE + MSM_SATA_AHCI_REGS_SZ - 1,
1790 },
1791 {
1792 .name = "ahci_irq",
1793 .flags = IORESOURCE_IRQ,
1794 .start = SATA_CONTROLLER_IRQ,
1795 .end = SATA_CONTROLLER_IRQ,
1796 },
1797};
1798
1799static u64 ahci_dma_mask = DMA_BIT_MASK(32);
1800static struct platform_device apq8064_device_ahci = {
1801 .name = "ahci",
1802 .id = 0,
1803 .num_resources = ARRAY_SIZE(resources_ahci),
1804 .resource = resources_ahci,
1805 .dev = {
1806 .dma_mask = &ahci_dma_mask,
1807 .coherent_dma_mask = DMA_BIT_MASK(32),
1808 },
1809};
1810
1811int __init apq8064_add_ahci(struct ahci_platform_data *platd)
1812{
1813 struct platform_device *pdev;
1814
1815 if (!platd)
1816 return -EINVAL;
1817
1818 pdev = &apq8064_device_ahci;
1819 pdev->dev.platform_data = platd;
1820 return platform_device_register(pdev);
1821}
1822
Yan He06913ce2011-08-26 16:33:46 -07001823static struct resource resources_sps[] = {
1824 {
1825 .name = "pipe_mem",
1826 .start = 0x12800000,
1827 .end = 0x12800000 + 0x4000 - 1,
1828 .flags = IORESOURCE_MEM,
1829 },
1830 {
1831 .name = "bamdma_dma",
1832 .start = 0x12240000,
1833 .end = 0x12240000 + 0x1000 - 1,
1834 .flags = IORESOURCE_MEM,
1835 },
1836 {
1837 .name = "bamdma_bam",
1838 .start = 0x12244000,
1839 .end = 0x12244000 + 0x4000 - 1,
1840 .flags = IORESOURCE_MEM,
1841 },
1842 {
1843 .name = "bamdma_irq",
1844 .start = SPS_BAM_DMA_IRQ,
1845 .end = SPS_BAM_DMA_IRQ,
1846 .flags = IORESOURCE_IRQ,
1847 },
1848};
1849
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001850struct platform_device msm_bus_8064_sys_fabric = {
1851 .name = "msm_bus_fabric",
1852 .id = MSM_BUS_FAB_SYSTEM,
1853};
1854struct platform_device msm_bus_8064_apps_fabric = {
1855 .name = "msm_bus_fabric",
1856 .id = MSM_BUS_FAB_APPSS,
1857};
1858struct platform_device msm_bus_8064_mm_fabric = {
1859 .name = "msm_bus_fabric",
1860 .id = MSM_BUS_FAB_MMSS,
1861};
1862struct platform_device msm_bus_8064_sys_fpb = {
1863 .name = "msm_bus_fabric",
1864 .id = MSM_BUS_FAB_SYSTEM_FPB,
1865};
1866struct platform_device msm_bus_8064_cpss_fpb = {
1867 .name = "msm_bus_fabric",
1868 .id = MSM_BUS_FAB_CPSS_FPB,
1869};
1870
Yan He06913ce2011-08-26 16:33:46 -07001871static struct msm_sps_platform_data msm_sps_pdata = {
1872 .bamdma_restricted_pipes = 0x06,
1873};
1874
1875struct platform_device msm_device_sps_apq8064 = {
1876 .name = "msm_sps",
1877 .id = -1,
1878 .num_resources = ARRAY_SIZE(resources_sps),
1879 .resource = resources_sps,
1880 .dev.platform_data = &msm_sps_pdata,
1881};
1882
Eric Holmberg023d25c2012-03-01 12:27:55 -07001883static struct resource smd_resource[] = {
1884 {
1885 .name = "a9_m2a_0",
1886 .start = INT_A9_M2A_0,
1887 .flags = IORESOURCE_IRQ,
1888 },
1889 {
1890 .name = "a9_m2a_5",
1891 .start = INT_A9_M2A_5,
1892 .flags = IORESOURCE_IRQ,
1893 },
1894 {
1895 .name = "adsp_a11",
1896 .start = INT_ADSP_A11,
1897 .flags = IORESOURCE_IRQ,
1898 },
1899 {
1900 .name = "adsp_a11_smsm",
1901 .start = INT_ADSP_A11_SMSM,
1902 .flags = IORESOURCE_IRQ,
1903 },
1904 {
1905 .name = "dsps_a11",
1906 .start = INT_DSPS_A11,
1907 .flags = IORESOURCE_IRQ,
1908 },
1909 {
1910 .name = "dsps_a11_smsm",
1911 .start = INT_DSPS_A11_SMSM,
1912 .flags = IORESOURCE_IRQ,
1913 },
1914 {
1915 .name = "wcnss_a11",
1916 .start = INT_WCNSS_A11,
1917 .flags = IORESOURCE_IRQ,
1918 },
1919 {
1920 .name = "wcnss_a11_smsm",
1921 .start = INT_WCNSS_A11_SMSM,
1922 .flags = IORESOURCE_IRQ,
1923 },
1924};
1925
1926static struct smd_subsystem_config smd_config_list[] = {
1927 {
1928 .irq_config_id = SMD_MODEM,
1929 .subsys_name = "gss",
1930 .edge = SMD_APPS_MODEM,
1931
1932 .smd_int.irq_name = "a9_m2a_0",
1933 .smd_int.flags = IRQF_TRIGGER_RISING,
1934 .smd_int.irq_id = -1,
1935 .smd_int.device_name = "smd_dev",
1936 .smd_int.dev_id = 0,
1937 .smd_int.out_bit_pos = 1 << 3,
1938 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1939 .smd_int.out_offset = 0x8,
1940
1941 .smsm_int.irq_name = "a9_m2a_5",
1942 .smsm_int.flags = IRQF_TRIGGER_RISING,
1943 .smsm_int.irq_id = -1,
1944 .smsm_int.device_name = "smd_smsm",
1945 .smsm_int.dev_id = 0,
1946 .smsm_int.out_bit_pos = 1 << 4,
1947 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1948 .smsm_int.out_offset = 0x8,
1949 },
1950 {
1951 .irq_config_id = SMD_Q6,
Stephen Boyd77db8bb2012-06-27 15:15:16 -07001952 .subsys_name = "adsp",
Eric Holmberg023d25c2012-03-01 12:27:55 -07001953 .edge = SMD_APPS_QDSP,
1954
1955 .smd_int.irq_name = "adsp_a11",
1956 .smd_int.flags = IRQF_TRIGGER_RISING,
1957 .smd_int.irq_id = -1,
1958 .smd_int.device_name = "smd_dev",
1959 .smd_int.dev_id = 0,
1960 .smd_int.out_bit_pos = 1 << 15,
1961 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1962 .smd_int.out_offset = 0x8,
1963
1964 .smsm_int.irq_name = "adsp_a11_smsm",
1965 .smsm_int.flags = IRQF_TRIGGER_RISING,
1966 .smsm_int.irq_id = -1,
1967 .smsm_int.device_name = "smd_smsm",
1968 .smsm_int.dev_id = 0,
1969 .smsm_int.out_bit_pos = 1 << 14,
1970 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
1971 .smsm_int.out_offset = 0x8,
1972 },
1973 {
1974 .irq_config_id = SMD_DSPS,
1975 .subsys_name = "dsps",
1976 .edge = SMD_APPS_DSPS,
1977
1978 .smd_int.irq_name = "dsps_a11",
1979 .smd_int.flags = IRQF_TRIGGER_RISING,
1980 .smd_int.irq_id = -1,
1981 .smd_int.device_name = "smd_dev",
1982 .smd_int.dev_id = 0,
1983 .smd_int.out_bit_pos = 1,
1984 .smd_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1985 .smd_int.out_offset = 0x4080,
1986
1987 .smsm_int.irq_name = "dsps_a11_smsm",
1988 .smsm_int.flags = IRQF_TRIGGER_RISING,
1989 .smsm_int.irq_id = -1,
1990 .smsm_int.device_name = "smd_smsm",
1991 .smsm_int.dev_id = 0,
1992 .smsm_int.out_bit_pos = 1,
1993 .smsm_int.out_base = (void __iomem *)MSM_SIC_NON_SECURE_BASE,
1994 .smsm_int.out_offset = 0x4094,
1995 },
1996 {
1997 .irq_config_id = SMD_WCNSS,
1998 .subsys_name = "wcnss",
1999 .edge = SMD_APPS_WCNSS,
2000
2001 .smd_int.irq_name = "wcnss_a11",
2002 .smd_int.flags = IRQF_TRIGGER_RISING,
2003 .smd_int.irq_id = -1,
2004 .smd_int.device_name = "smd_dev",
2005 .smd_int.dev_id = 0,
2006 .smd_int.out_bit_pos = 1 << 25,
2007 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
2008 .smd_int.out_offset = 0x8,
2009
2010 .smsm_int.irq_name = "wcnss_a11_smsm",
2011 .smsm_int.flags = IRQF_TRIGGER_RISING,
2012 .smsm_int.irq_id = -1,
2013 .smsm_int.device_name = "smd_smsm",
2014 .smsm_int.dev_id = 0,
2015 .smsm_int.out_bit_pos = 1 << 23,
2016 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
2017 .smsm_int.out_offset = 0x8,
2018 },
2019};
2020
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06002021static struct smd_subsystem_restart_config smd_ssr_config = {
2022 .disable_smsm_reset_handshake = 1,
2023};
2024
Eric Holmberg023d25c2012-03-01 12:27:55 -07002025static struct smd_platform smd_platform_data = {
2026 .num_ss_configs = ARRAY_SIZE(smd_config_list),
2027 .smd_ss_configs = smd_config_list,
Eric Holmberg2bb6ccd2012-03-13 13:05:14 -06002028 .smd_ssr_config = &smd_ssr_config,
Eric Holmberg023d25c2012-03-01 12:27:55 -07002029};
2030
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06002031struct platform_device msm_device_smd_apq8064 = {
2032 .name = "msm_smd",
2033 .id = -1,
Eric Holmberg023d25c2012-03-01 12:27:55 -07002034 .resource = smd_resource,
2035 .num_resources = ARRAY_SIZE(smd_resource),
2036 .dev = {
2037 .platform_data = &smd_platform_data,
2038 },
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06002039};
2040
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002041static struct resource resources_msm_pcie[] = {
2042 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06002043 .name = "pcie_parf",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002044 .start = PCIE20_PARF_PHYS,
2045 .end = PCIE20_PARF_PHYS + PCIE20_PARF_SIZE - 1,
2046 .flags = IORESOURCE_MEM,
2047 },
2048 {
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06002049 .name = "pcie_elbi",
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002050 .start = PCIE20_ELBI_PHYS,
2051 .end = PCIE20_ELBI_PHYS + PCIE20_ELBI_SIZE - 1,
2052 .flags = IORESOURCE_MEM,
2053 },
2054 {
2055 .name = "pcie20",
2056 .start = PCIE20_PHYS,
2057 .end = PCIE20_PHYS + PCIE20_SIZE - 1,
2058 .flags = IORESOURCE_MEM,
2059 },
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002060};
2061
2062struct platform_device msm_device_pcie = {
2063 .name = "msm_pcie",
2064 .id = -1,
2065 .num_resources = ARRAY_SIZE(resources_msm_pcie),
2066 .resource = resources_msm_pcie,
2067};
2068
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07002069#ifdef CONFIG_HW_RANDOM_MSM
2070/* PRNG device */
2071#define MSM_PRNG_PHYS 0x1A500000
2072static struct resource rng_resources = {
2073 .flags = IORESOURCE_MEM,
2074 .start = MSM_PRNG_PHYS,
2075 .end = MSM_PRNG_PHYS + SZ_512 - 1,
2076};
2077
2078struct platform_device apq8064_device_rng = {
2079 .name = "msm_rng",
2080 .id = 0,
2081 .num_resources = 1,
2082 .resource = &rng_resources,
2083};
2084#endif
2085
Matt Wagantall292aace2012-01-26 19:12:34 -08002086static struct resource msm_gss_resources[] = {
2087 {
2088 .start = 0x10000000,
2089 .end = 0x10000000 + SZ_256 - 1,
2090 .flags = IORESOURCE_MEM,
2091 },
Matt Wagantall19ac4fd2012-02-03 20:18:23 -08002092 {
2093 .start = 0x10008000,
2094 .end = 0x10008000 + SZ_256 - 1,
2095 .flags = IORESOURCE_MEM,
2096 },
Stephen Boydd86214b2012-05-10 15:26:35 -07002097 {
Stephen Boyde24edf52012-07-12 17:46:19 -07002098 .start = 0x00900000,
2099 .end = 0x00900000 + SZ_16K - 1,
2100 .flags = IORESOURCE_MEM,
2101 },
2102 {
Stephen Boydd86214b2012-05-10 15:26:35 -07002103 .start = GSS_A5_WDOG_EXPIRED,
2104 .end = GSS_A5_WDOG_EXPIRED,
2105 .flags = IORESOURCE_IRQ,
2106 },
Matt Wagantall292aace2012-01-26 19:12:34 -08002107};
2108
2109struct platform_device msm_gss = {
2110 .name = "pil_gss",
2111 .id = -1,
2112 .num_resources = ARRAY_SIZE(msm_gss_resources),
2113 .resource = msm_gss_resources,
2114};
2115
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002116static struct fs_driver_data gfx3d_fs_data = {
2117 .clks = (struct fs_clk_data[]){
2118 { .name = "core_clk", .reset_rate = 27000000 },
2119 { .name = "iface_clk" },
2120 { .name = "bus_clk" },
2121 { 0 }
2122 },
2123 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
2124 .bus_port1 = MSM_BUS_MASTER_GRAPHICS_3D_PORT1,
Matt Wagantall1875d322012-02-22 16:11:33 -08002125};
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002126
2127static struct fs_driver_data ijpeg_fs_data = {
2128 .clks = (struct fs_clk_data[]){
2129 { .name = "core_clk" },
2130 { .name = "iface_clk" },
2131 { .name = "bus_clk" },
2132 { 0 }
2133 },
2134 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
2135};
2136
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07002137static struct fs_driver_data mdp_fs_data = {
2138 .clks = (struct fs_clk_data[]){
2139 { .name = "core_clk" },
2140 { .name = "iface_clk" },
2141 { .name = "bus_clk" },
2142 { .name = "vsync_clk" },
2143 { .name = "lut_clk" },
2144 { .name = "tv_src_clk" },
2145 { .name = "tv_clk" },
Matt Wagantallc33c1ed2012-07-23 17:19:08 -07002146 { .name = "reset1_clk" },
2147 { .name = "reset2_clk" },
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07002148 { 0 }
2149 },
2150 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
2151 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
2152};
2153
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002154static struct fs_driver_data rot_fs_data = {
2155 .clks = (struct fs_clk_data[]){
2156 { .name = "core_clk" },
2157 { .name = "iface_clk" },
2158 { .name = "bus_clk" },
2159 { 0 }
2160 },
2161 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
2162};
2163
2164static struct fs_driver_data ved_fs_data = {
2165 .clks = (struct fs_clk_data[]){
2166 { .name = "core_clk" },
2167 { .name = "iface_clk" },
2168 { .name = "bus_clk" },
2169 { 0 }
2170 },
2171 .bus_port0 = MSM_BUS_MASTER_VIDEO_ENC,
2172 .bus_port1 = MSM_BUS_MASTER_VIDEO_DEC,
2173};
2174
2175static struct fs_driver_data vfe_fs_data = {
2176 .clks = (struct fs_clk_data[]){
2177 { .name = "core_clk" },
2178 { .name = "iface_clk" },
2179 { .name = "bus_clk" },
2180 { 0 }
2181 },
2182 .bus_port0 = MSM_BUS_MASTER_VFE,
2183};
2184
2185static struct fs_driver_data vpe_fs_data = {
2186 .clks = (struct fs_clk_data[]){
2187 { .name = "core_clk" },
2188 { .name = "iface_clk" },
2189 { .name = "bus_clk" },
2190 { 0 }
2191 },
2192 .bus_port0 = MSM_BUS_MASTER_VPE,
2193};
2194
2195static struct fs_driver_data vcap_fs_data = {
2196 .clks = (struct fs_clk_data[]){
2197 { .name = "core_clk" },
2198 { .name = "iface_clk" },
2199 { .name = "bus_clk" },
2200 { 0 },
2201 },
2202 .bus_port0 = MSM_BUS_MASTER_VIDEO_CAP,
2203};
2204
2205struct platform_device *apq8064_footswitch[] __initdata = {
Nagamalleswararao Ganji6db8c512012-05-24 20:26:23 -07002206 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data),
Matt Wagantall316f2fc2012-05-03 20:41:42 -07002207 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -07002208 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -07002209 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
2210 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -07002211 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -07002212 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall3cd5b3d2012-05-03 20:35:20 -07002213 FS_8X60(FS_VCAP, "vdd", "msm_vcap.0", &vcap_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07002214};
2215unsigned apq8064_num_footswitch __initdata = ARRAY_SIZE(apq8064_footswitch);
Matt Wagantall1875d322012-02-22 16:11:33 -08002216
Praveen Chidambaram78499012011-11-01 17:15:17 -06002217struct msm_rpm_platform_data apq8064_rpm_data __initdata = {
2218 .reg_base_addrs = {
2219 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
2220 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
2221 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
2222 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
2223 },
2224 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -08002225 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -06002226 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002227 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
2228 .ipc_rpm_val = 4,
2229 .target_id = {
2230 MSM_RPM_MAP(8064, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
2231 MSM_RPM_MAP(8064, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
2232 MSM_RPM_MAP(8064, INVALIDATE_0, INVALIDATE, 8),
2233 MSM_RPM_MAP(8064, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
2234 MSM_RPM_MAP(8064, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
2235 MSM_RPM_MAP(8064, RPM_CTL, RPM_CTL, 1),
2236 MSM_RPM_MAP(8064, CXO_CLK, CXO_CLK, 1),
2237 MSM_RPM_MAP(8064, PXO_CLK, PXO_CLK, 1),
2238 MSM_RPM_MAP(8064, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
2239 MSM_RPM_MAP(8064, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
2240 MSM_RPM_MAP(8064, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
2241 MSM_RPM_MAP(8064, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
2242 MSM_RPM_MAP(8064, SFPB_CLK, SFPB_CLK, 1),
2243 MSM_RPM_MAP(8064, CFPB_CLK, CFPB_CLK, 1),
2244 MSM_RPM_MAP(8064, MMFPB_CLK, MMFPB_CLK, 1),
2245 MSM_RPM_MAP(8064, EBI1_CLK, EBI1_CLK, 1),
2246 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_HALT_0,
2247 APPS_FABRIC_CFG_HALT, 2),
2248 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_CLKMOD_0,
2249 APPS_FABRIC_CFG_CLKMOD, 3),
2250 MSM_RPM_MAP(8064, APPS_FABRIC_CFG_IOCTL,
2251 APPS_FABRIC_CFG_IOCTL, 1),
2252 MSM_RPM_MAP(8064, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 12),
2253 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_HALT_0,
2254 SYS_FABRIC_CFG_HALT, 2),
2255 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_CLKMOD_0,
2256 SYS_FABRIC_CFG_CLKMOD, 3),
2257 MSM_RPM_MAP(8064, SYS_FABRIC_CFG_IOCTL,
2258 SYS_FABRIC_CFG_IOCTL, 1),
2259 MSM_RPM_MAP(8064, SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 30),
2260 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_HALT_0,
2261 MMSS_FABRIC_CFG_HALT, 2),
2262 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_CLKMOD_0,
2263 MMSS_FABRIC_CFG_CLKMOD, 3),
2264 MSM_RPM_MAP(8064, MMSS_FABRIC_CFG_IOCTL,
2265 MMSS_FABRIC_CFG_IOCTL, 1),
2266 MSM_RPM_MAP(8064, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 21),
2267 MSM_RPM_MAP(8064, PM8921_S1_0, PM8921_S1, 2),
2268 MSM_RPM_MAP(8064, PM8921_S2_0, PM8921_S2, 2),
2269 MSM_RPM_MAP(8064, PM8921_S3_0, PM8921_S3, 2),
2270 MSM_RPM_MAP(8064, PM8921_S4_0, PM8921_S4, 2),
2271 MSM_RPM_MAP(8064, PM8921_S5_0, PM8921_S5, 2),
2272 MSM_RPM_MAP(8064, PM8921_S6_0, PM8921_S6, 2),
2273 MSM_RPM_MAP(8064, PM8921_S7_0, PM8921_S7, 2),
2274 MSM_RPM_MAP(8064, PM8921_S8_0, PM8921_S8, 2),
2275 MSM_RPM_MAP(8064, PM8921_L1_0, PM8921_L1, 2),
2276 MSM_RPM_MAP(8064, PM8921_L2_0, PM8921_L2, 2),
2277 MSM_RPM_MAP(8064, PM8921_L3_0, PM8921_L3, 2),
2278 MSM_RPM_MAP(8064, PM8921_L4_0, PM8921_L4, 2),
2279 MSM_RPM_MAP(8064, PM8921_L5_0, PM8921_L5, 2),
2280 MSM_RPM_MAP(8064, PM8921_L6_0, PM8921_L6, 2),
2281 MSM_RPM_MAP(8064, PM8921_L7_0, PM8921_L7, 2),
2282 MSM_RPM_MAP(8064, PM8921_L8_0, PM8921_L8, 2),
2283 MSM_RPM_MAP(8064, PM8921_L9_0, PM8921_L9, 2),
2284 MSM_RPM_MAP(8064, PM8921_L10_0, PM8921_L10, 2),
2285 MSM_RPM_MAP(8064, PM8921_L11_0, PM8921_L11, 2),
2286 MSM_RPM_MAP(8064, PM8921_L12_0, PM8921_L12, 2),
2287 MSM_RPM_MAP(8064, PM8921_L13_0, PM8921_L13, 2),
2288 MSM_RPM_MAP(8064, PM8921_L14_0, PM8921_L14, 2),
2289 MSM_RPM_MAP(8064, PM8921_L15_0, PM8921_L15, 2),
2290 MSM_RPM_MAP(8064, PM8921_L16_0, PM8921_L16, 2),
2291 MSM_RPM_MAP(8064, PM8921_L17_0, PM8921_L17, 2),
2292 MSM_RPM_MAP(8064, PM8921_L18_0, PM8921_L18, 2),
2293 MSM_RPM_MAP(8064, PM8921_L19_0, PM8921_L19, 2),
2294 MSM_RPM_MAP(8064, PM8921_L20_0, PM8921_L20, 2),
2295 MSM_RPM_MAP(8064, PM8921_L21_0, PM8921_L21, 2),
2296 MSM_RPM_MAP(8064, PM8921_L22_0, PM8921_L22, 2),
2297 MSM_RPM_MAP(8064, PM8921_L23_0, PM8921_L23, 2),
2298 MSM_RPM_MAP(8064, PM8921_L24_0, PM8921_L24, 2),
2299 MSM_RPM_MAP(8064, PM8921_L25_0, PM8921_L25, 2),
2300 MSM_RPM_MAP(8064, PM8921_L26_0, PM8921_L26, 2),
2301 MSM_RPM_MAP(8064, PM8921_L27_0, PM8921_L27, 2),
2302 MSM_RPM_MAP(8064, PM8921_L28_0, PM8921_L28, 2),
2303 MSM_RPM_MAP(8064, PM8921_L29_0, PM8921_L29, 2),
2304 MSM_RPM_MAP(8064, PM8921_CLK1_0, PM8921_CLK1, 2),
2305 MSM_RPM_MAP(8064, PM8921_CLK2_0, PM8921_CLK2, 2),
2306 MSM_RPM_MAP(8064, PM8921_LVS1, PM8921_LVS1, 1),
2307 MSM_RPM_MAP(8064, PM8921_LVS2, PM8921_LVS2, 1),
2308 MSM_RPM_MAP(8064, PM8921_LVS3, PM8921_LVS3, 1),
2309 MSM_RPM_MAP(8064, PM8921_LVS4, PM8921_LVS4, 1),
2310 MSM_RPM_MAP(8064, PM8921_LVS5, PM8921_LVS5, 1),
2311 MSM_RPM_MAP(8064, PM8921_LVS6, PM8921_LVS6, 1),
2312 MSM_RPM_MAP(8064, PM8921_LVS7, PM8921_LVS7, 1),
2313 MSM_RPM_MAP(8064, PM8821_S1_0, PM8821_S1, 2),
2314 MSM_RPM_MAP(8064, PM8821_S2_0, PM8821_S2, 2),
2315 MSM_RPM_MAP(8064, PM8821_L1_0, PM8821_L1, 2),
2316 MSM_RPM_MAP(8064, NCP_0, NCP, 2),
2317 MSM_RPM_MAP(8064, CXO_BUFFERS, CXO_BUFFERS, 1),
2318 MSM_RPM_MAP(8064, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
2319 MSM_RPM_MAP(8064, HDMI_SWITCH, HDMI_SWITCH, 1),
2320 MSM_RPM_MAP(8064, DDR_DMM_0, DDR_DMM, 2),
2321 MSM_RPM_MAP(8064, QDSS_CLK, QDSS_CLK, 1),
Joel Kingef390842012-05-23 16:42:48 -07002322 MSM_RPM_MAP(8064, VDDMIN_GPIO, VDDMIN_GPIO, 1),
Praveen Chidambaram78499012011-11-01 17:15:17 -06002323 },
2324 .target_status = {
2325 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MAJOR),
2326 MSM_RPM_STATUS_ID_MAP(8064, VERSION_MINOR),
2327 MSM_RPM_STATUS_ID_MAP(8064, VERSION_BUILD),
2328 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_0),
2329 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_1),
2330 MSM_RPM_STATUS_ID_MAP(8064, SUPPORTED_RESOURCES_2),
2331 MSM_RPM_STATUS_ID_MAP(8064, RESERVED_SUPPORTED_RESOURCES_0),
2332 MSM_RPM_STATUS_ID_MAP(8064, SEQUENCE),
2333 MSM_RPM_STATUS_ID_MAP(8064, RPM_CTL),
2334 MSM_RPM_STATUS_ID_MAP(8064, CXO_CLK),
2335 MSM_RPM_STATUS_ID_MAP(8064, PXO_CLK),
2336 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CLK),
2337 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_CLK),
2338 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_CLK),
2339 MSM_RPM_STATUS_ID_MAP(8064, DAYTONA_FABRIC_CLK),
2340 MSM_RPM_STATUS_ID_MAP(8064, SFPB_CLK),
2341 MSM_RPM_STATUS_ID_MAP(8064, CFPB_CLK),
2342 MSM_RPM_STATUS_ID_MAP(8064, MMFPB_CLK),
2343 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CLK),
2344 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_HALT),
2345 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_CLKMOD),
2346 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_CFG_IOCTL),
2347 MSM_RPM_STATUS_ID_MAP(8064, APPS_FABRIC_ARB),
2348 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_HALT),
2349 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_CLKMOD),
2350 MSM_RPM_STATUS_ID_MAP(8064, SYS_FABRIC_CFG_IOCTL),
2351 MSM_RPM_STATUS_ID_MAP(8064, SYSTEM_FABRIC_ARB),
2352 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_HALT),
2353 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_CLKMOD),
2354 MSM_RPM_STATUS_ID_MAP(8064, MMSS_FABRIC_CFG_IOCTL),
2355 MSM_RPM_STATUS_ID_MAP(8064, MM_FABRIC_ARB),
2356 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_0),
2357 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S1_1),
2358 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_0),
2359 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S2_1),
2360 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_0),
2361 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S3_1),
2362 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_0),
2363 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S4_1),
2364 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_0),
2365 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S5_1),
2366 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_0),
2367 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S6_1),
2368 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_0),
2369 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S7_1),
2370 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_0),
2371 MSM_RPM_STATUS_ID_MAP(8064, PM8921_S8_1),
2372 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_0),
2373 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L1_1),
2374 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_0),
2375 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L2_1),
2376 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_0),
2377 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L3_1),
2378 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_0),
2379 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L4_1),
2380 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_0),
2381 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L5_1),
2382 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_0),
2383 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L6_1),
2384 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_0),
2385 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L7_1),
2386 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_0),
2387 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L8_1),
2388 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_0),
2389 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L9_1),
2390 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_0),
2391 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L10_1),
2392 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_0),
2393 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L11_1),
2394 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_0),
2395 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L12_1),
2396 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_0),
2397 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L13_1),
2398 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_0),
2399 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L14_1),
2400 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_0),
2401 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L15_1),
2402 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_0),
2403 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L16_1),
2404 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_0),
2405 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L17_1),
2406 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_0),
2407 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L18_1),
2408 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_0),
2409 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L19_1),
2410 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_0),
2411 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L20_1),
2412 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_0),
2413 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L21_1),
2414 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_0),
2415 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L22_1),
2416 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_0),
2417 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L23_1),
2418 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_0),
2419 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L24_1),
2420 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_0),
2421 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L25_1),
2422 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_0),
2423 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L26_1),
2424 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_0),
2425 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L27_1),
2426 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_0),
2427 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L28_1),
2428 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_0),
2429 MSM_RPM_STATUS_ID_MAP(8064, PM8921_L29_1),
2430 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_0),
2431 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK1_1),
2432 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_0),
2433 MSM_RPM_STATUS_ID_MAP(8064, PM8921_CLK2_1),
2434 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS1),
2435 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS2),
2436 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS3),
2437 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS4),
2438 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS5),
2439 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS6),
2440 MSM_RPM_STATUS_ID_MAP(8064, PM8921_LVS7),
2441 MSM_RPM_STATUS_ID_MAP(8064, NCP_0),
2442 MSM_RPM_STATUS_ID_MAP(8064, NCP_1),
2443 MSM_RPM_STATUS_ID_MAP(8064, CXO_BUFFERS),
2444 MSM_RPM_STATUS_ID_MAP(8064, USB_OTG_SWITCH),
2445 MSM_RPM_STATUS_ID_MAP(8064, HDMI_SWITCH),
2446 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_0),
2447 MSM_RPM_STATUS_ID_MAP(8064, DDR_DMM_1),
2448 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH0_RANGE),
2449 MSM_RPM_STATUS_ID_MAP(8064, EBI1_CH1_RANGE),
2450 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_0),
2451 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S1_1),
2452 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_0),
2453 MSM_RPM_STATUS_ID_MAP(8064, PM8821_S2_1),
2454 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_0),
2455 MSM_RPM_STATUS_ID_MAP(8064, PM8821_L1_1),
Joel Kingef390842012-05-23 16:42:48 -07002456 MSM_RPM_STATUS_ID_MAP(8064, VDDMIN_GPIO),
Praveen Chidambaram78499012011-11-01 17:15:17 -06002457 },
2458 .target_ctrl_id = {
2459 MSM_RPM_CTRL_MAP(8064, VERSION_MAJOR),
2460 MSM_RPM_CTRL_MAP(8064, VERSION_MINOR),
2461 MSM_RPM_CTRL_MAP(8064, VERSION_BUILD),
2462 MSM_RPM_CTRL_MAP(8064, REQ_CTX_0),
2463 MSM_RPM_CTRL_MAP(8064, REQ_SEL_0),
2464 MSM_RPM_CTRL_MAP(8064, ACK_CTX_0),
2465 MSM_RPM_CTRL_MAP(8064, ACK_SEL_0),
2466 },
2467 .sel_invalidate = MSM_RPM_8064_SEL_INVALIDATE,
2468 .sel_notification = MSM_RPM_8064_SEL_NOTIFICATION,
2469 .sel_last = MSM_RPM_8064_SEL_LAST,
2470 .ver = {3, 0, 0},
2471};
2472
2473struct platform_device apq8064_rpm_device = {
2474 .name = "msm_rpm",
2475 .id = -1,
2476};
2477
2478static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
Priyanka Mathur71859f42012-10-17 10:54:35 -07002479 .version = 1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002480};
2481
Priyanka Mathur71859f42012-10-17 10:54:35 -07002482
2483static struct resource msm_rpm_stat_resource[] = {
2484 {
2485 .start = 0x0010D204,
2486 .end = 0x0010D204 + SZ_8K,
2487 .flags = IORESOURCE_MEM,
2488 .name = "phys_addr_base"
2489 },
2490};
2491
2492
Praveen Chidambaram78499012011-11-01 17:15:17 -06002493struct platform_device apq8064_rpm_stat_device = {
2494 .name = "msm_rpm_stat",
2495 .id = -1,
Priyanka Mathur71859f42012-10-17 10:54:35 -07002496 .resource = msm_rpm_stat_resource,
2497 .num_resources = ARRAY_SIZE(msm_rpm_stat_resource),
2498 .dev = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002499 .platform_data = &msm_rpm_stat_pdata,
Priyanka Mathur71859f42012-10-17 10:54:35 -07002500 }
Praveen Chidambaram78499012011-11-01 17:15:17 -06002501};
2502
Anji Jonnala93129922012-10-09 20:57:53 +05302503static struct resource resources_rpm_master_stats[] = {
2504 {
2505 .start = MSM8064_RPM_MASTER_STATS_BASE,
2506 .end = MSM8064_RPM_MASTER_STATS_BASE + SZ_256,
2507 .flags = IORESOURCE_MEM,
2508 },
2509};
2510
2511static char *master_names[] = {
2512 "KPSS",
2513 "MPSS",
2514 "LPASS",
2515 "RIVA",
2516 "DSPS",
2517};
2518
2519static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
2520 .masters = master_names,
2521 .nomasters = ARRAY_SIZE(master_names),
2522};
2523
2524struct platform_device apq8064_rpm_master_stat_device = {
2525 .name = "msm_rpm_master_stat",
2526 .id = -1,
2527 .num_resources = ARRAY_SIZE(resources_rpm_master_stats),
2528 .resource = resources_rpm_master_stats,
2529 .dev = {
2530 .platform_data = &msm_rpm_master_stat_pdata,
2531 },
2532};
2533
Praveen Chidambaram78499012011-11-01 17:15:17 -06002534static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
2535 .phys_addr_base = 0x0010C000,
2536 .reg_offsets = {
2537 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
2538 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
2539 },
2540 .phys_size = SZ_8K,
2541 .log_len = 4096, /* log's buffer length in bytes */
2542 .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */
2543};
2544
2545struct platform_device apq8064_rpm_log_device = {
2546 .name = "msm_rpm_log",
2547 .id = -1,
2548 .dev = {
2549 .platform_data = &msm_rpm_log_pdata,
2550 },
2551};
2552
Jin Hongd3024e62012-02-09 16:13:32 -08002553/* Sensors DSPS platform data */
2554
Jin Hongd3024e62012-02-09 16:13:32 -08002555static struct dsps_clk_info dsps_clks[] = {};
2556static struct dsps_regulator_info dsps_regs[] = {};
2557
2558/*
2559 * Note: GPIOs field is intialized in run-time at the function
2560 * apq8064_init_dsps().
2561 */
2562
Stephen Boydf169b4b2012-05-10 17:55:55 -07002563#define PPSS_REG_PHYS_BASE 0x12080000
2564
Jin Hongd3024e62012-02-09 16:13:32 -08002565struct msm_dsps_platform_data msm_dsps_pdata_8064 = {
2566 .clks = dsps_clks,
2567 .clks_num = ARRAY_SIZE(dsps_clks),
2568 .gpios = NULL,
2569 .gpios_num = 0,
2570 .regs = dsps_regs,
2571 .regs_num = ARRAY_SIZE(dsps_regs),
2572 .dsps_pwr_ctl_en = 1,
2573 .signature = DSPS_SIGNATURE,
2574};
2575
2576static struct resource msm_dsps_resources[] = {
2577 {
2578 .start = PPSS_REG_PHYS_BASE,
2579 .end = PPSS_REG_PHYS_BASE + SZ_8K - 1,
2580 .name = "ppss_reg",
2581 .flags = IORESOURCE_MEM,
2582 },
Jin Hongd3024e62012-02-09 16:13:32 -08002583};
2584
2585struct platform_device msm_dsps_device_8064 = {
2586 .name = "msm_dsps",
2587 .id = 0,
2588 .num_resources = ARRAY_SIZE(msm_dsps_resources),
2589 .resource = msm_dsps_resources,
2590 .dev.platform_data = &msm_dsps_pdata_8064,
2591};
2592
Praveen Chidambaram78499012011-11-01 17:15:17 -06002593#ifdef CONFIG_MSM_MPM
2594static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
2595 [1] = MSM_GPIO_TO_INT(26),
2596 [2] = MSM_GPIO_TO_INT(88),
2597 [4] = MSM_GPIO_TO_INT(73),
2598 [5] = MSM_GPIO_TO_INT(74),
2599 [6] = MSM_GPIO_TO_INT(75),
2600 [7] = MSM_GPIO_TO_INT(76),
2601 [8] = MSM_GPIO_TO_INT(77),
2602 [9] = MSM_GPIO_TO_INT(36),
2603 [10] = MSM_GPIO_TO_INT(84),
2604 [11] = MSM_GPIO_TO_INT(7),
2605 [12] = MSM_GPIO_TO_INT(11),
2606 [13] = MSM_GPIO_TO_INT(52),
2607 [14] = MSM_GPIO_TO_INT(15),
2608 [15] = MSM_GPIO_TO_INT(83),
2609 [16] = USB3_HS_IRQ,
2610 [19] = MSM_GPIO_TO_INT(61),
2611 [20] = MSM_GPIO_TO_INT(58),
2612 [23] = MSM_GPIO_TO_INT(65),
2613 [24] = MSM_GPIO_TO_INT(63),
2614 [25] = USB1_HS_IRQ,
2615 [27] = HDMI_IRQ,
2616 [29] = MSM_GPIO_TO_INT(22),
2617 [30] = MSM_GPIO_TO_INT(72),
2618 [31] = USB4_HS_IRQ,
2619 [33] = MSM_GPIO_TO_INT(44),
2620 [34] = MSM_GPIO_TO_INT(39),
2621 [35] = MSM_GPIO_TO_INT(19),
2622 [36] = MSM_GPIO_TO_INT(23),
2623 [37] = MSM_GPIO_TO_INT(41),
2624 [38] = MSM_GPIO_TO_INT(30),
2625 [41] = MSM_GPIO_TO_INT(42),
2626 [42] = MSM_GPIO_TO_INT(56),
2627 [43] = MSM_GPIO_TO_INT(55),
2628 [44] = MSM_GPIO_TO_INT(50),
2629 [45] = MSM_GPIO_TO_INT(49),
2630 [46] = MSM_GPIO_TO_INT(47),
2631 [47] = MSM_GPIO_TO_INT(45),
2632 [48] = MSM_GPIO_TO_INT(38),
2633 [49] = MSM_GPIO_TO_INT(34),
2634 [50] = MSM_GPIO_TO_INT(32),
2635 [51] = MSM_GPIO_TO_INT(29),
2636 [52] = MSM_GPIO_TO_INT(18),
2637 [53] = MSM_GPIO_TO_INT(10),
2638 [54] = MSM_GPIO_TO_INT(81),
2639 [55] = MSM_GPIO_TO_INT(6),
2640};
2641
2642static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
2643 TLMM_MSM_SUMMARY_IRQ,
2644 RPM_APCC_CPU0_GP_HIGH_IRQ,
2645 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2646 RPM_APCC_CPU0_GP_LOW_IRQ,
2647 RPM_APCC_CPU0_WAKE_UP_IRQ,
2648 RPM_APCC_CPU1_GP_HIGH_IRQ,
2649 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
2650 RPM_APCC_CPU1_GP_LOW_IRQ,
2651 RPM_APCC_CPU1_WAKE_UP_IRQ,
2652 MSS_TO_APPS_IRQ_0,
2653 MSS_TO_APPS_IRQ_1,
2654 MSS_TO_APPS_IRQ_2,
2655 MSS_TO_APPS_IRQ_3,
2656 MSS_TO_APPS_IRQ_4,
2657 MSS_TO_APPS_IRQ_5,
2658 MSS_TO_APPS_IRQ_6,
2659 MSS_TO_APPS_IRQ_7,
2660 MSS_TO_APPS_IRQ_8,
2661 MSS_TO_APPS_IRQ_9,
2662 LPASS_SCSS_GP_LOW_IRQ,
2663 LPASS_SCSS_GP_MEDIUM_IRQ,
2664 LPASS_SCSS_GP_HIGH_IRQ,
2665 SPS_MTI_30,
2666 SPS_MTI_31,
2667 RIVA_APSS_SPARE_IRQ,
2668 RIVA_APPS_WLAN_SMSM_IRQ,
2669 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
2670 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
Chandra Ramachandran59851722012-07-23 11:19:48 -07002671 PM8821_SEC_IRQ_N,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002672};
2673
2674struct msm_mpm_device_data apq8064_mpm_dev_data __initdata = {
2675 .irqs_m2a = msm_mpm_irqs_m2a,
2676 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
2677 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
2678 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
2679 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
2680 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
2681 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
2682 .mpm_apps_ipc_val = BIT(1),
2683 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
2684
2685};
2686#endif
Joel Kingdacbc822012-01-25 13:30:57 -08002687
Joel King14fe7fa2012-05-27 14:26:11 -07002688/* AP2MDM_SOFT_RESET is implemented by the PON_RESET_N gpio */
Joel Kingdacbc822012-01-25 13:30:57 -08002689#define MDM2AP_ERRFATAL 19
2690#define AP2MDM_ERRFATAL 18
2691#define MDM2AP_STATUS 49
2692#define AP2MDM_STATUS 48
Joel King14fe7fa2012-05-27 14:26:11 -07002693#define AP2MDM_SOFT_RESET 27
Ameya Thakure155ece2012-07-09 12:08:37 -07002694#define I2S_AP2MDM_SOFT_RESET 0
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002695#define AP2MDM_WAKEUP 35
Ameya Thakure155ece2012-07-09 12:08:37 -07002696#define I2S_AP2MDM_WAKEUP 44
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002697#define MDM2AP_PBLRDY 46
Ameya Thakure155ece2012-07-09 12:08:37 -07002698#define I2S_MDM2AP_PBLRDY 81
Joel Kingdacbc822012-01-25 13:30:57 -08002699
2700static struct resource mdm_resources[] = {
2701 {
2702 .start = MDM2AP_ERRFATAL,
2703 .end = MDM2AP_ERRFATAL,
2704 .name = "MDM2AP_ERRFATAL",
2705 .flags = IORESOURCE_IO,
2706 },
2707 {
2708 .start = AP2MDM_ERRFATAL,
2709 .end = AP2MDM_ERRFATAL,
2710 .name = "AP2MDM_ERRFATAL",
2711 .flags = IORESOURCE_IO,
2712 },
2713 {
2714 .start = MDM2AP_STATUS,
2715 .end = MDM2AP_STATUS,
2716 .name = "MDM2AP_STATUS",
2717 .flags = IORESOURCE_IO,
2718 },
2719 {
2720 .start = AP2MDM_STATUS,
2721 .end = AP2MDM_STATUS,
2722 .name = "AP2MDM_STATUS",
2723 .flags = IORESOURCE_IO,
2724 },
2725 {
Joel King14fe7fa2012-05-27 14:26:11 -07002726 .start = AP2MDM_SOFT_RESET,
2727 .end = AP2MDM_SOFT_RESET,
2728 .name = "AP2MDM_SOFT_RESET",
Joel Kingdacbc822012-01-25 13:30:57 -08002729 .flags = IORESOURCE_IO,
2730 },
Vamsi Krishna9e307cd2012-04-11 13:15:36 -07002731 {
2732 .start = AP2MDM_WAKEUP,
2733 .end = AP2MDM_WAKEUP,
2734 .name = "AP2MDM_WAKEUP",
2735 .flags = IORESOURCE_IO,
2736 },
Vamsi Krishnac6dcd5e2012-05-09 15:38:01 -07002737 {
2738 .start = MDM2AP_PBLRDY,
2739 .end = MDM2AP_PBLRDY,
2740 .name = "MDM2AP_PBLRDY",
2741 .flags = IORESOURCE_IO,
2742 },
Joel Kingdacbc822012-01-25 13:30:57 -08002743};
2744
Ameya Thakure155ece2012-07-09 12:08:37 -07002745static struct resource i2s_mdm_resources[] = {
2746 {
2747 .start = MDM2AP_ERRFATAL,
2748 .end = MDM2AP_ERRFATAL,
2749 .name = "MDM2AP_ERRFATAL",
2750 .flags = IORESOURCE_IO,
2751 },
2752 {
2753 .start = AP2MDM_ERRFATAL,
2754 .end = AP2MDM_ERRFATAL,
2755 .name = "AP2MDM_ERRFATAL",
2756 .flags = IORESOURCE_IO,
2757 },
2758 {
2759 .start = MDM2AP_STATUS,
2760 .end = MDM2AP_STATUS,
2761 .name = "MDM2AP_STATUS",
2762 .flags = IORESOURCE_IO,
2763 },
2764 {
2765 .start = AP2MDM_STATUS,
2766 .end = AP2MDM_STATUS,
2767 .name = "AP2MDM_STATUS",
2768 .flags = IORESOURCE_IO,
2769 },
2770 {
2771 .start = I2S_AP2MDM_SOFT_RESET,
2772 .end = I2S_AP2MDM_SOFT_RESET,
2773 .name = "AP2MDM_SOFT_RESET",
2774 .flags = IORESOURCE_IO,
2775 },
2776 {
2777 .start = I2S_AP2MDM_WAKEUP,
2778 .end = I2S_AP2MDM_WAKEUP,
2779 .name = "AP2MDM_WAKEUP",
2780 .flags = IORESOURCE_IO,
2781 },
2782 {
2783 .start = I2S_MDM2AP_PBLRDY,
2784 .end = I2S_MDM2AP_PBLRDY,
2785 .name = "MDM2AP_PBLRDY",
2786 .flags = IORESOURCE_IO,
2787 },
2788};
2789
Joel Kingdacbc822012-01-25 13:30:57 -08002790struct platform_device mdm_8064_device = {
2791 .name = "mdm2_modem",
2792 .id = -1,
2793 .num_resources = ARRAY_SIZE(mdm_resources),
2794 .resource = mdm_resources,
2795};
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002796
Ameya Thakure155ece2012-07-09 12:08:37 -07002797struct platform_device i2s_mdm_8064_device = {
2798 .name = "mdm2_modem",
2799 .id = -1,
2800 .num_resources = ARRAY_SIZE(i2s_mdm_resources),
2801 .resource = i2s_mdm_resources,
2802};
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002803
Steve Mucklef9a87492012-11-02 15:41:00 -07002804static struct msm_dcvs_sync_rule apq8064_dcvs_sync_rules[] = {
2805 {1026000, 400000},
2806 {384000, 200000},
Steve Muckle682c7a02012-11-12 14:20:39 -08002807 {0, 128000},
Steve Mucklef9a87492012-11-02 15:41:00 -07002808};
2809
2810static struct msm_dcvs_platform_data apq8064_dcvs_data = {
2811 .sync_rules = apq8064_dcvs_sync_rules,
2812 .num_sync_rules = ARRAY_SIZE(apq8064_dcvs_sync_rules),
Steve Muckle749f3012012-11-21 10:12:39 -08002813 .gpu_max_nom_khz = 320000,
Steve Mucklef9a87492012-11-02 15:41:00 -07002814};
2815
2816struct platform_device apq8064_dcvs_device = {
2817 .name = "dcvs",
2818 .id = -1,
2819 .dev = {
2820 .platform_data = &apq8064_dcvs_data,
2821 },
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002822};
2823
2824static struct msm_dcvs_core_info apq8064_core_info = {
Abhijeet Dharmapurikar80add422012-09-13 11:11:54 -07002825 .num_cores = 4,
2826 .sensors = (int[]){7, 8, 9, 10},
2827 .thermal_poll_ms = 60000,
2828 .core_param = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002829 .core_type = MSM_DCVS_CORE_TYPE_CPU,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002830 },
Abhijeet Dharmapurikar80add422012-09-13 11:11:54 -07002831 .algo_param = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002832 .disable_pc_threshold = 1458000,
2833 .em_win_size_min_us = 100000,
2834 .em_win_size_max_us = 300000,
2835 .em_max_util_pct = 97,
2836 .group_id = 1,
2837 .max_freq_chg_time_us = 100000,
2838 .slack_mode_dynamic = 0,
2839 .slack_weight_thresh_pct = 3,
2840 .slack_time_min_us = 45000,
2841 .slack_time_max_us = 45000,
Steve Mucklee8c6d612012-12-06 14:31:00 -08002842 .ss_no_corr_below_freq = 0,
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002843 .ss_win_size_min_us = 1000000,
2844 .ss_win_size_max_us = 1000000,
2845 .ss_util_pct = 95,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002846 },
Abhijeet Dharmapurikar80add422012-09-13 11:11:54 -07002847 .energy_coeffs = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002848 .active_coeff_a = 336,
2849 .active_coeff_b = 0,
2850 .active_coeff_c = 0,
2851
2852 .leakage_coeff_a = -17720,
2853 .leakage_coeff_b = 37,
2854 .leakage_coeff_c = 3329,
2855 .leakage_coeff_d = -277,
2856 },
Abhijeet Dharmapurikar80add422012-09-13 11:11:54 -07002857 .power_param = {
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002858 .current_temp = 25,
Steve Mucklef9a87492012-11-02 15:41:00 -07002859 .num_freq = 0, /* set at runtime */
Abhijeet Dharmapurikar44451662012-08-23 18:58:44 -07002860 }
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002861};
2862
Abhijeet Dharmapurikarc1ed66c2012-09-10 16:03:39 -07002863#define APQ8064_LPM_LATENCY 1000 /* >100 usec for WFI */
2864
2865static struct msm_gov_platform_data gov_platform_data = {
2866 .info = &apq8064_core_info,
2867 .latency = APQ8064_LPM_LATENCY,
2868};
2869
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002870struct platform_device apq8064_msm_gov_device = {
2871 .name = "msm_dcvs_gov",
2872 .id = -1,
2873 .dev = {
Abhijeet Dharmapurikarc1ed66c2012-09-10 16:03:39 -07002874 .platform_data = &gov_platform_data,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002875 },
2876};
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002877
Abhijeet Dharmapurikarfb4a2f82012-08-23 14:36:59 -07002878static struct msm_mpd_algo_param apq8064_mpd_algo_param = {
2879 .em_win_size_min_us = 10000,
2880 .em_win_size_max_us = 100000,
2881 .em_max_util_pct = 90,
2882 .online_util_pct_min = 60,
2883 .slack_time_min_us = 50000,
2884 .slack_time_max_us = 100000,
2885};
2886
2887struct platform_device apq8064_msm_mpd_device = {
2888 .name = "msm_mpdecision",
2889 .id = -1,
2890 .dev = {
2891 .platform_data = &apq8064_mpd_algo_param,
2892 },
2893};
2894
Terence Hampson2e1705f2012-04-11 19:55:29 -04002895#ifdef CONFIG_MSM_VCAP
2896#define VCAP_HW_BASE 0x05900000
2897
2898static struct msm_bus_vectors vcap_init_vectors[] = {
2899 {
2900 .src = MSM_BUS_MASTER_VIDEO_CAP,
2901 .dst = MSM_BUS_SLAVE_EBI_CH0,
2902 .ab = 0,
2903 .ib = 0,
2904 },
2905};
2906
Terence Hampson2e1705f2012-04-11 19:55:29 -04002907static struct msm_bus_vectors vcap_480_vectors[] = {
2908 {
2909 .src = MSM_BUS_MASTER_VIDEO_CAP,
2910 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson779dc762012-06-07 15:59:27 -04002911 .ab = 480 * 720 * 3 * 60,
2912 .ib = 480 * 720 * 3 * 60 * 1.5,
2913 },
2914};
2915
2916static struct msm_bus_vectors vcap_576_vectors[] = {
2917 {
2918 .src = MSM_BUS_MASTER_VIDEO_CAP,
2919 .dst = MSM_BUS_SLAVE_EBI_CH0,
2920 .ab = 576 * 720 * 3 * 60,
2921 .ib = 576 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002922 },
2923};
2924
2925static struct msm_bus_vectors vcap_720_vectors[] = {
2926 {
2927 .src = MSM_BUS_MASTER_VIDEO_CAP,
2928 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampson35a1ff02012-04-25 17:07:18 -04002929 .ab = 1280 * 720 * 3 * 60,
2930 .ib = 1280 * 720 * 3 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002931 },
2932};
2933
2934static struct msm_bus_vectors vcap_1080_vectors[] = {
2935 {
2936 .src = MSM_BUS_MASTER_VIDEO_CAP,
2937 .dst = MSM_BUS_SLAVE_EBI_CH0,
Terence Hampsonf51f6e62012-08-29 11:02:17 -04002938 .ab = 1920 * 1080 * 10 * 60,
2939 .ib = 1920 * 1080 * 10 * 60 * 1.5,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002940 },
2941};
2942
2943static struct msm_bus_paths vcap_bus_usecases[] = {
2944 {
2945 ARRAY_SIZE(vcap_init_vectors),
2946 vcap_init_vectors,
2947 },
2948 {
2949 ARRAY_SIZE(vcap_480_vectors),
2950 vcap_480_vectors,
2951 },
2952 {
Terence Hampson779dc762012-06-07 15:59:27 -04002953 ARRAY_SIZE(vcap_576_vectors),
2954 vcap_576_vectors,
2955 },
2956 {
Terence Hampson2e1705f2012-04-11 19:55:29 -04002957 ARRAY_SIZE(vcap_720_vectors),
2958 vcap_720_vectors,
2959 },
2960 {
2961 ARRAY_SIZE(vcap_1080_vectors),
2962 vcap_1080_vectors,
2963 },
2964};
2965
2966static struct msm_bus_scale_pdata vcap_axi_client_pdata = {
2967 vcap_bus_usecases,
2968 ARRAY_SIZE(vcap_bus_usecases),
2969};
2970
2971static struct resource msm_vcap_resources[] = {
2972 {
2973 .name = "vcap",
2974 .start = VCAP_HW_BASE,
2975 .end = VCAP_HW_BASE + SZ_1M - 1,
2976 .flags = IORESOURCE_MEM,
2977 },
2978 {
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002979 .name = "vc_irq",
Terence Hampson2e1705f2012-04-11 19:55:29 -04002980 .start = VCAP_VC,
2981 .end = VCAP_VC,
2982 .flags = IORESOURCE_IRQ,
2983 },
Terence Hampsonaeb793e2012-05-11 11:41:16 -04002984 {
2985 .name = "vp_irq",
2986 .start = VCAP_VP,
2987 .end = VCAP_VP,
2988 .flags = IORESOURCE_IRQ,
2989 },
Terence Hampson2e1705f2012-04-11 19:55:29 -04002990};
2991
2992static unsigned vcap_gpios[] = {
2993 2, 3, 4, 5, 6, 7, 8, 9, 10,
2994 11, 12, 13, 18, 19, 20, 21,
2995 22, 23, 24, 25, 26, 80, 82,
2996 83, 84, 85, 86, 87,
2997};
2998
2999static struct vcap_platform_data vcap_pdata = {
3000 .gpios = vcap_gpios,
3001 .num_gpios = ARRAY_SIZE(vcap_gpios),
3002 .bus_client_pdata = &vcap_axi_client_pdata
3003};
3004
3005struct platform_device msm8064_device_vcap = {
3006 .name = "msm_vcap",
3007 .id = 0,
3008 .resource = msm_vcap_resources,
3009 .num_resources = ARRAY_SIZE(msm_vcap_resources),
3010 .dev = {
3011 .platform_data = &vcap_pdata,
3012 },
3013};
3014#endif
3015
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08003016static struct resource msm_cache_erp_resources[] = {
3017 {
3018 .name = "l1_irq",
3019 .start = SC_SICCPUXEXTFAULTIRPTREQ,
3020 .flags = IORESOURCE_IRQ,
3021 },
3022 {
3023 .name = "l2_irq",
3024 .start = APCC_QGICL2IRPTREQ,
3025 .flags = IORESOURCE_IRQ,
3026 }
3027};
3028
3029struct platform_device apq8064_device_cache_erp = {
3030 .name = "msm_cache_erp",
3031 .id = -1,
3032 .num_resources = ARRAY_SIZE(msm_cache_erp_resources),
3033 .resource = msm_cache_erp_resources,
3034};
Pratik Patel212ab362012-03-16 12:30:07 -07003035
Pratik Patel3b0ca882012-06-01 16:54:14 -07003036#define CORESIGHT_PHYS_BASE 0x01A00000
3037#define CORESIGHT_FUNNEL_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x4000)
3038#define CORESIGHT_ETM2_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1E000)
3039#define CORESIGHT_ETM3_PHYS_BASE (CORESIGHT_PHYS_BASE + 0x1F000)
Pratik Patel212ab362012-03-16 12:30:07 -07003040
Pratik Patel3b0ca882012-06-01 16:54:14 -07003041static struct resource coresight_funnel_resources[] = {
Pratik Patel212ab362012-03-16 12:30:07 -07003042 {
Pratik Patel3b0ca882012-06-01 16:54:14 -07003043 .start = CORESIGHT_FUNNEL_PHYS_BASE,
3044 .end = CORESIGHT_FUNNEL_PHYS_BASE + SZ_4K - 1,
Pratik Patel212ab362012-03-16 12:30:07 -07003045 .flags = IORESOURCE_MEM,
3046 },
3047};
3048
Pratik Patel3b0ca882012-06-01 16:54:14 -07003049static const int coresight_funnel_outports[] = { 0, 1 };
3050static const int coresight_funnel_child_ids[] = { 0, 1 };
3051static const int coresight_funnel_child_ports[] = { 0, 0 };
3052
3053static struct coresight_platform_data coresight_funnel_pdata = {
3054 .id = 2,
3055 .name = "coresight-funnel",
Pratik Patel0480dc62012-09-06 09:41:49 -07003056 .nr_inports = 8,
Pratik Patel3b0ca882012-06-01 16:54:14 -07003057 .outports = coresight_funnel_outports,
3058 .child_ids = coresight_funnel_child_ids,
3059 .child_ports = coresight_funnel_child_ports,
3060 .nr_outports = ARRAY_SIZE(coresight_funnel_outports),
3061};
3062
3063struct platform_device apq8064_coresight_funnel_device = {
3064 .name = "coresight-funnel",
Pratik Patel212ab362012-03-16 12:30:07 -07003065 .id = 0,
Pratik Patel3b0ca882012-06-01 16:54:14 -07003066 .num_resources = ARRAY_SIZE(coresight_funnel_resources),
3067 .resource = coresight_funnel_resources,
3068 .dev = {
3069 .platform_data = &coresight_funnel_pdata,
3070 },
3071};
3072
3073static struct resource coresight_etm2_resources[] = {
3074 {
3075 .start = CORESIGHT_ETM2_PHYS_BASE,
3076 .end = CORESIGHT_ETM2_PHYS_BASE + SZ_4K - 1,
3077 .flags = IORESOURCE_MEM,
3078 },
3079};
3080
3081static const int coresight_etm2_outports[] = { 0 };
3082static const int coresight_etm2_child_ids[] = { 2 };
3083static const int coresight_etm2_child_ports[] = { 4 };
3084
3085static struct coresight_platform_data coresight_etm2_pdata = {
3086 .id = 6,
3087 .name = "coresight-etm2",
Pratik Patel0480dc62012-09-06 09:41:49 -07003088 .nr_inports = 0,
Pratik Patel3b0ca882012-06-01 16:54:14 -07003089 .outports = coresight_etm2_outports,
3090 .child_ids = coresight_etm2_child_ids,
3091 .child_ports = coresight_etm2_child_ports,
3092 .nr_outports = ARRAY_SIZE(coresight_etm2_outports),
3093};
3094
3095struct platform_device coresight_etm2_device = {
3096 .name = "coresight-etm",
3097 .id = 2,
3098 .num_resources = ARRAY_SIZE(coresight_etm2_resources),
3099 .resource = coresight_etm2_resources,
3100 .dev = {
3101 .platform_data = &coresight_etm2_pdata,
3102 },
3103};
3104
3105static struct resource coresight_etm3_resources[] = {
3106 {
3107 .start = CORESIGHT_ETM3_PHYS_BASE,
3108 .end = CORESIGHT_ETM3_PHYS_BASE + SZ_4K - 1,
3109 .flags = IORESOURCE_MEM,
3110 },
3111};
3112
3113static const int coresight_etm3_outports[] = { 0 };
3114static const int coresight_etm3_child_ids[] = { 2 };
3115static const int coresight_etm3_child_ports[] = { 5 };
3116
3117static struct coresight_platform_data coresight_etm3_pdata = {
3118 .id = 7,
3119 .name = "coresight-etm3",
Pratik Patel0480dc62012-09-06 09:41:49 -07003120 .nr_inports = 0,
Pratik Patel3b0ca882012-06-01 16:54:14 -07003121 .outports = coresight_etm3_outports,
3122 .child_ids = coresight_etm3_child_ids,
3123 .child_ports = coresight_etm3_child_ports,
3124 .nr_outports = ARRAY_SIZE(coresight_etm3_outports),
3125};
3126
3127struct platform_device coresight_etm3_device = {
3128 .name = "coresight-etm",
3129 .id = 3,
3130 .num_resources = ARRAY_SIZE(coresight_etm3_resources),
3131 .resource = coresight_etm3_resources,
3132 .dev = {
3133 .platform_data = &coresight_etm3_pdata,
3134 },
Pratik Patel212ab362012-03-16 12:30:07 -07003135};
Laura Abbott0577d7b2012-04-17 11:14:30 -07003136
3137struct msm_iommu_domain_name apq8064_iommu_ctx_names[] = {
3138 /* Camera */
3139 {
Laura Abbott0577d7b2012-04-17 11:14:30 -07003140 .name = "ijpeg_src",
3141 .domain = CAMERA_DOMAIN,
3142 },
3143 /* Camera */
3144 {
3145 .name = "ijpeg_dst",
3146 .domain = CAMERA_DOMAIN,
3147 },
3148 /* Camera */
3149 {
3150 .name = "jpegd_src",
3151 .domain = CAMERA_DOMAIN,
3152 },
3153 /* Camera */
3154 {
3155 .name = "jpegd_dst",
3156 .domain = CAMERA_DOMAIN,
3157 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003158 /* Rotator src*/
Laura Abbott0577d7b2012-04-17 11:14:30 -07003159 {
3160 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07003161 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003162 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003163 /* Rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07003164 {
3165 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07003166 .domain = ROTATOR_DST_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003167 },
3168 /* Video */
3169 {
3170 .name = "vcodec_a_mm1",
3171 .domain = VIDEO_DOMAIN,
3172 },
3173 /* Video */
3174 {
3175 .name = "vcodec_b_mm2",
3176 .domain = VIDEO_DOMAIN,
3177 },
3178 /* Video */
3179 {
3180 .name = "vcodec_a_stream",
3181 .domain = VIDEO_DOMAIN,
3182 },
3183};
3184
3185static struct mem_pool apq8064_video_pools[] = {
3186 /*
3187 * Video hardware has the following requirements:
3188 * 1. All video addresses used by the video hardware must be at a higher
3189 * address than video firmware address.
3190 * 2. Video hardware can only access a range of 256MB from the base of
3191 * the video firmware.
3192 */
3193 [VIDEO_FIRMWARE_POOL] =
3194 /* Low addresses, intended for video firmware */
3195 {
3196 .paddr = SZ_128K,
3197 .size = SZ_16M - SZ_128K,
3198 },
3199 [VIDEO_MAIN_POOL] =
3200 /* Main video pool */
3201 {
3202 .paddr = SZ_16M,
3203 .size = SZ_256M - SZ_16M,
3204 },
3205 [GEN_POOL] =
3206 /* Remaining address space up to 2G */
3207 {
3208 .paddr = SZ_256M,
3209 .size = SZ_2G - SZ_256M,
3210 },
3211};
3212
3213static struct mem_pool apq8064_camera_pools[] = {
3214 [GEN_POOL] =
3215 /* One address space for camera */
3216 {
3217 .paddr = SZ_128K,
3218 .size = SZ_2G - SZ_128K,
3219 },
3220};
3221
Olav Hauganef95ae32012-05-15 09:50:30 -07003222static struct mem_pool apq8064_display_read_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07003223 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07003224 /* One address space for display reads */
Laura Abbott0577d7b2012-04-17 11:14:30 -07003225 {
3226 .paddr = SZ_128K,
3227 .size = SZ_2G - SZ_128K,
3228 },
3229};
3230
Olav Hauganef95ae32012-05-15 09:50:30 -07003231static struct mem_pool apq8064_display_write_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07003232 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07003233 /* One address space for display writes */
3234 {
3235 .paddr = SZ_128K,
3236 .size = SZ_2G - SZ_128K,
3237 },
3238};
3239
3240static struct mem_pool apq8064_rotator_src_pools[] = {
3241 [GEN_POOL] =
3242 /* One address space for rotator src */
3243 {
3244 .paddr = SZ_128K,
3245 .size = SZ_2G - SZ_128K,
3246 },
3247};
3248
3249static struct mem_pool apq8064_rotator_dst_pools[] = {
3250 [GEN_POOL] =
3251 /* One address space for rotator dst */
Laura Abbott0577d7b2012-04-17 11:14:30 -07003252 {
3253 .paddr = SZ_128K,
3254 .size = SZ_2G - SZ_128K,
3255 },
3256};
3257
3258static struct msm_iommu_domain apq8064_iommu_domains[] = {
3259 [VIDEO_DOMAIN] = {
3260 .iova_pools = apq8064_video_pools,
3261 .npools = ARRAY_SIZE(apq8064_video_pools),
3262 },
3263 [CAMERA_DOMAIN] = {
3264 .iova_pools = apq8064_camera_pools,
3265 .npools = ARRAY_SIZE(apq8064_camera_pools),
3266 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003267 [DISPLAY_READ_DOMAIN] = {
3268 .iova_pools = apq8064_display_read_pools,
3269 .npools = ARRAY_SIZE(apq8064_display_read_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07003270 },
Olav Hauganef95ae32012-05-15 09:50:30 -07003271 [DISPLAY_WRITE_DOMAIN] = {
3272 .iova_pools = apq8064_display_write_pools,
3273 .npools = ARRAY_SIZE(apq8064_display_write_pools),
3274 },
3275 [ROTATOR_SRC_DOMAIN] = {
3276 .iova_pools = apq8064_rotator_src_pools,
3277 .npools = ARRAY_SIZE(apq8064_rotator_src_pools),
3278 },
3279 [ROTATOR_DST_DOMAIN] = {
3280 .iova_pools = apq8064_rotator_dst_pools,
3281 .npools = ARRAY_SIZE(apq8064_rotator_dst_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07003282 },
3283};
3284
3285struct iommu_domains_pdata apq8064_iommu_domain_pdata = {
3286 .domains = apq8064_iommu_domains,
3287 .ndomains = ARRAY_SIZE(apq8064_iommu_domains),
3288 .domain_names = apq8064_iommu_ctx_names,
3289 .nnames = ARRAY_SIZE(apq8064_iommu_ctx_names),
3290 .domain_alloc_flags = 0,
3291};
3292
3293struct platform_device apq8064_iommu_domain_device = {
3294 .name = "iommu_domains",
3295 .id = -1,
3296 .dev = {
3297 .platform_data = &apq8064_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07003298 }
3299};
3300
3301struct msm_rtb_platform_data apq8064_rtb_pdata = {
3302 .size = SZ_1M,
3303};
3304
3305static int __init msm_rtb_set_buffer_size(char *p)
3306{
3307 int s;
3308
3309 s = memparse(p, NULL);
3310 apq8064_rtb_pdata.size = ALIGN(s, SZ_4K);
3311 return 0;
3312}
3313early_param("msm_rtb_size", msm_rtb_set_buffer_size);
3314
3315struct platform_device apq8064_rtb_device = {
3316 .name = "msm_rtb",
3317 .id = -1,
3318 .dev = {
3319 .platform_data = &apq8064_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07003320 },
3321};
Laura Abbott93a4a352012-05-25 09:26:35 -07003322
3323#define APQ8064_L1_SIZE SZ_1M
3324/*
3325 * The actual L2 size is smaller but we need a larger buffer
3326 * size to store other dump information
3327 */
3328#define APQ8064_L2_SIZE SZ_8M
3329
3330struct msm_cache_dump_platform_data apq8064_cache_dump_pdata = {
3331 .l2_size = APQ8064_L2_SIZE,
3332 .l1_size = APQ8064_L1_SIZE,
3333};
3334
3335struct platform_device apq8064_cache_dump_device = {
3336 .name = "msm_cache_dump",
3337 .id = -1,
3338 .dev = {
3339 .platform_data = &apq8064_cache_dump_pdata,
3340 },
3341};
Srikanth Uyyala7d4f7212012-10-12 17:45:36 +05303342
3343struct dev_avtimer_data dev_avtimer_pdata = {
3344 .avtimer_msw_phy_addr = AVTIMER_MSW_PHYSICAL_ADDRESS,
3345 .avtimer_lsw_phy_addr = AVTIMER_LSW_PHYSICAL_ADDRESS,
3346};