blob: c19c133c599ee41f6c7ba819e6d74de0b73cedda [file] [log] [blame]
Taniya Das2e948192011-12-20 11:15:13 +05301/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/dma-mapping.h>
16#include <linux/msm_kgsl.h>
17#include <linux/regulator/machine.h>
Taniya Das2e948192011-12-20 11:15:13 +053018#include <linux/init.h>
Taniya Das43bcdd62011-12-02 17:33:27 +053019#include <linux/irq.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <mach/irqs.h>
21#include <mach/msm_iomap.h>
22#include <mach/board.h>
23#include <mach/dma.h>
24#include <mach/dal_axi.h>
25#include <asm/mach/flash.h>
Taniya Das43bcdd62011-12-02 17:33:27 +053026#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070027#include <asm/hardware/cache-l2x0.h>
28#include <asm/mach/mmc.h>
29#include <mach/rpc_hsusb.h>
30#include <mach/socinfo.h>
31
32#include "devices.h"
33#include "devices-msm7x2xa.h"
34#include "footswitch.h"
Matt Wagantall6d9ebee2011-08-26 12:15:24 -070035#include "acpuclock.h"
Murali Nalajala41786ab2012-03-06 10:47:32 +053036#include "spm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070037
38/* Address of GSBI blocks */
39#define MSM_GSBI0_PHYS 0xA1200000
40#define MSM_GSBI1_PHYS 0xA1300000
41
42/* GSBI QUPe devices */
43#define MSM_GSBI0_QUP_PHYS (MSM_GSBI0_PHYS + 0x80000)
44#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
45
46static struct resource gsbi0_qup_i2c_resources[] = {
47 {
48 .name = "qup_phys_addr",
49 .start = MSM_GSBI0_QUP_PHYS,
50 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
51 .flags = IORESOURCE_MEM,
52 },
53 {
54 .name = "gsbi_qup_i2c_addr",
55 .start = MSM_GSBI0_PHYS,
56 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
57 .flags = IORESOURCE_MEM,
58 },
59 {
60 .name = "qup_err_intr",
61 .start = INT_PWB_I2C,
62 .end = INT_PWB_I2C,
63 .flags = IORESOURCE_IRQ,
64 },
65};
66
67/* Use GSBI0 QUP for /dev/i2c-0 */
68struct platform_device msm_gsbi0_qup_i2c_device = {
69 .name = "qup_i2c",
70 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
71 .num_resources = ARRAY_SIZE(gsbi0_qup_i2c_resources),
72 .resource = gsbi0_qup_i2c_resources,
73};
74
75static struct resource gsbi1_qup_i2c_resources[] = {
76 {
77 .name = "qup_phys_addr",
78 .start = MSM_GSBI1_QUP_PHYS,
79 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
80 .flags = IORESOURCE_MEM,
81 },
82 {
83 .name = "gsbi_qup_i2c_addr",
84 .start = MSM_GSBI1_PHYS,
85 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
86 .flags = IORESOURCE_MEM,
87 },
88 {
89 .name = "qup_err_intr",
90 .start = INT_ARM11_DMA,
91 .end = INT_ARM11_DMA,
92 .flags = IORESOURCE_IRQ,
93 },
94};
95
96/* Use GSBI1 QUP for /dev/i2c-1 */
97struct platform_device msm_gsbi1_qup_i2c_device = {
98 .name = "qup_i2c",
99 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
100 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
101 .resource = gsbi1_qup_i2c_resources,
102};
103
104#define MSM_HSUSB_PHYS 0xA0800000
105static struct resource resources_hsusb_otg[] = {
106 {
107 .start = MSM_HSUSB_PHYS,
108 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
109 .flags = IORESOURCE_MEM,
110 },
111 {
112 .start = INT_USB_HS,
113 .end = INT_USB_HS,
114 .flags = IORESOURCE_IRQ,
115 },
116};
117
118static u64 dma_mask = 0xffffffffULL;
119struct platform_device msm_device_otg = {
120 .name = "msm_otg",
121 .id = -1,
122 .num_resources = ARRAY_SIZE(resources_hsusb_otg),
123 .resource = resources_hsusb_otg,
124 .dev = {
125 .dma_mask = &dma_mask,
126 .coherent_dma_mask = 0xffffffffULL,
127 },
128};
129
130static struct resource resources_gadget_peripheral[] = {
131 {
132 .start = MSM_HSUSB_PHYS,
133 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
134 .flags = IORESOURCE_MEM,
135 },
136 {
137 .start = INT_USB_HS,
138 .end = INT_USB_HS,
139 .flags = IORESOURCE_IRQ,
140 },
141};
142
143struct platform_device msm_device_gadget_peripheral = {
144 .name = "msm_hsusb",
145 .id = -1,
146 .num_resources = ARRAY_SIZE(resources_gadget_peripheral),
147 .resource = resources_gadget_peripheral,
148 .dev = {
149 .dma_mask = &dma_mask,
150 .coherent_dma_mask = 0xffffffffULL,
151 },
152};
153
154static struct resource resources_hsusb_host[] = {
155 {
156 .start = MSM_HSUSB_PHYS,
157 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
158 .flags = IORESOURCE_MEM,
159 },
160 {
161 .start = INT_USB_HS,
162 .end = INT_USB_HS,
163 .flags = IORESOURCE_IRQ,
164 },
165};
166
167struct platform_device msm_device_hsusb_host = {
168 .name = "msm_hsusb_host",
169 .id = 0,
170 .num_resources = ARRAY_SIZE(resources_hsusb_host),
171 .resource = resources_hsusb_host,
172 .dev = {
173 .dma_mask = &dma_mask,
174 .coherent_dma_mask = 0xffffffffULL,
175 },
176};
177
178static struct platform_device *msm_host_devices[] = {
179 &msm_device_hsusb_host,
180};
181
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700182static struct resource msm_dmov_resource[] = {
183 {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700184 .start = INT_ADM_AARM,
185 .flags = IORESOURCE_IRQ,
186 },
187 {
188 .start = 0xA9700000,
189 .end = 0xA9700000 + SZ_4K - 1,
190 .flags = IORESOURCE_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700191 },
192};
193
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700194static struct msm_dmov_pdata msm_dmov_pdata = {
195 .sd = 3,
196 .sd_size = 0x400,
197};
198
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700199struct platform_device msm_device_dmov = {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700200 .name = "msm_dmov",
201 .id = -1,
202 .resource = msm_dmov_resource,
203 .num_resources = ARRAY_SIZE(msm_dmov_resource),
204 .dev = {
205 .platform_data = &msm_dmov_pdata,
206 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700207};
208
209struct platform_device msm_device_smd = {
210 .name = "msm_smd",
211 .id = -1,
212};
213
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530214static struct resource smd_8625_resource[] = {
215 {
216 .name = "a9_m2a_0",
217 .start = MSM8625_INT_A9_M2A_0,
218 .flags = IORESOURCE_IRQ,
219 },
220 {
221 .name = "a9_m2a_5",
222 .start = MSM8625_INT_A9_M2A_5,
223 .flags = IORESOURCE_IRQ,
224 },
225};
226
227static struct smd_subsystem_config smd_8625_config_list[] = {
228 {
229 .irq_config_id = SMD_MODEM,
230 .subsys_name = "modem",
231 .edge = SMD_APPS_MODEM,
232
233 .smd_int.irq_name = "a9_m2a_0",
234 .smd_int.flags = IRQF_TRIGGER_RISING,
235 .smd_int.irq_id = -1,
236 .smd_int.device_name = "smd_dev",
237 .smd_int.dev_id = 0,
238
239 .smd_int.out_bit_pos = 1,
240 .smd_int.out_base = (void __iomem *)MSM_CSR_BASE,
241 .smd_int.out_offset = 0x400 + (0) * 4,
242
243 .smsm_int.irq_name = "a9_m2a_5",
244 .smsm_int.flags = IRQF_TRIGGER_RISING,
245 .smsm_int.irq_id = -1,
246 .smsm_int.device_name = "smsm_dev",
247 .smsm_int.dev_id = 0,
248
249 .smsm_int.out_bit_pos = 1,
250 .smsm_int.out_base = (void __iomem *)MSM_CSR_BASE,
251 .smsm_int.out_offset = 0x400 + (5) * 4,
252
253 }
254};
255
256static struct smd_platform smd_8625_platform_data = {
257 .num_ss_configs = ARRAY_SIZE(smd_8625_config_list),
258 .smd_ss_configs = smd_8625_config_list,
259};
260
261struct platform_device msm8625_device_smd = {
262 .name = "msm_smd",
263 .id = -1,
264 .resource = smd_8625_resource,
265 .num_resources = ARRAY_SIZE(smd_8625_resource),
266 .dev = {
267 .platform_data = &smd_8625_platform_data,
268 }
269};
270
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530271static struct resource resources_adsp[] = {
272 {
273 .start = INT_ADSP_A9_A11,
274 .end = INT_ADSP_A9_A11,
275 .flags = IORESOURCE_IRQ,
276 },
277};
278
279struct platform_device msm_adsp_device = {
280 .name = "msm_adsp",
281 .id = -1,
282 .num_resources = ARRAY_SIZE(resources_adsp),
283 .resource = resources_adsp,
284};
285
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700286static struct resource resources_uart1[] = {
287 {
288 .start = INT_UART1,
289 .end = INT_UART1,
290 .flags = IORESOURCE_IRQ,
291 },
292 {
Taniya Das13b811a2011-12-09 18:33:45 +0530293 .start = MSM7XXX_UART1_PHYS,
294 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700295 .flags = IORESOURCE_MEM,
296 },
297};
298
299struct platform_device msm_device_uart1 = {
300 .name = "msm_serial",
301 .id = 0,
302 .num_resources = ARRAY_SIZE(resources_uart1),
303 .resource = resources_uart1,
304};
305
306#define MSM_UART1DM_PHYS 0xA0200000
307static struct resource msm_uart1_dm_resources[] = {
308 {
309 .start = MSM_UART1DM_PHYS,
310 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
311 .flags = IORESOURCE_MEM,
312 },
313 {
314 .start = INT_UART1DM_IRQ,
315 .end = INT_UART1DM_IRQ,
316 .flags = IORESOURCE_IRQ,
317 },
318 {
319 .start = INT_UART1DM_RX,
320 .end = INT_UART1DM_RX,
321 .flags = IORESOURCE_IRQ,
322 },
323 {
324 .start = DMOV_HSUART1_TX_CHAN,
325 .end = DMOV_HSUART1_RX_CHAN,
326 .name = "uartdm_channels",
327 .flags = IORESOURCE_DMA,
328 },
329 {
330 .start = DMOV_HSUART1_TX_CRCI,
331 .end = DMOV_HSUART1_RX_CRCI,
332 .name = "uartdm_crci",
333 .flags = IORESOURCE_DMA,
334 },
335};
336
337static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
338struct platform_device msm_device_uart_dm1 = {
339 .name = "msm_serial_hs",
340 .id = 0,
341 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
342 .resource = msm_uart1_dm_resources,
343 .dev = {
344 .dma_mask = &msm_uart_dm1_dma_mask,
345 .coherent_dma_mask = DMA_BIT_MASK(32),
346 },
347};
348
349#define MSM_UART2DM_PHYS 0xA0300000
350static struct resource msm_uart2dm_resources[] = {
351 {
352 .start = MSM_UART2DM_PHYS,
353 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
354 .name = "uartdm_resource",
355 .flags = IORESOURCE_MEM,
356 },
357 {
358 .start = INT_UART2DM_IRQ,
359 .end = INT_UART2DM_IRQ,
360 .flags = IORESOURCE_IRQ,
361 },
362};
363
364struct platform_device msm_device_uart_dm2 = {
365 .name = "msm_serial_hsl",
366 .id = 0,
367 .num_resources = ARRAY_SIZE(msm_uart2dm_resources),
368 .resource = msm_uart2dm_resources,
369};
370
371#define MSM_NAND_PHYS 0xA0A00000
372#define MSM_NANDC01_PHYS 0xA0A40000
373#define MSM_NANDC10_PHYS 0xA0A80000
374#define MSM_NANDC11_PHYS 0xA0AC0000
375#define EBI2_REG_BASE 0xA0D00000
376static struct resource resources_nand[] = {
377 [0] = {
378 .name = "msm_nand_dmac",
379 .start = DMOV_NAND_CHAN,
380 .end = DMOV_NAND_CHAN,
381 .flags = IORESOURCE_DMA,
382 },
383 [1] = {
384 .name = "msm_nand_phys",
385 .start = MSM_NAND_PHYS,
386 .end = MSM_NAND_PHYS + 0x7FF,
387 .flags = IORESOURCE_MEM,
388 },
389 [2] = {
390 .name = "msm_nandc01_phys",
391 .start = MSM_NANDC01_PHYS,
392 .end = MSM_NANDC01_PHYS + 0x7FF,
393 .flags = IORESOURCE_MEM,
394 },
395 [3] = {
396 .name = "msm_nandc10_phys",
397 .start = MSM_NANDC10_PHYS,
398 .end = MSM_NANDC10_PHYS + 0x7FF,
399 .flags = IORESOURCE_MEM,
400 },
401 [4] = {
402 .name = "msm_nandc11_phys",
403 .start = MSM_NANDC11_PHYS,
404 .end = MSM_NANDC11_PHYS + 0x7FF,
405 .flags = IORESOURCE_MEM,
406 },
407 [5] = {
408 .name = "ebi2_reg_base",
409 .start = EBI2_REG_BASE,
410 .end = EBI2_REG_BASE + 0x60,
411 .flags = IORESOURCE_MEM,
412 },
413};
414
415struct flash_platform_data msm_nand_data;
416
417struct platform_device msm_device_nand = {
418 .name = "msm_nand",
419 .id = -1,
420 .num_resources = ARRAY_SIZE(resources_nand),
421 .resource = resources_nand,
422 .dev = {
423 .platform_data = &msm_nand_data,
424 },
425};
426
427#define MSM_SDC1_BASE 0xA0400000
428#define MSM_SDC2_BASE 0xA0500000
429#define MSM_SDC3_BASE 0xA0600000
430#define MSM_SDC4_BASE 0xA0700000
431static struct resource resources_sdc1[] = {
432 {
433 .start = MSM_SDC1_BASE,
434 .end = MSM_SDC1_BASE + SZ_4K - 1,
435 .flags = IORESOURCE_MEM,
436 },
437 {
438 .start = INT_SDC1_0,
439 .end = INT_SDC1_1,
440 .flags = IORESOURCE_IRQ,
441 },
442 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700443 .name = "sdcc_dma_chnl",
444 .start = DMOV_SDC1_CHAN,
445 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700446 .flags = IORESOURCE_DMA,
447 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700448 {
449 .name = "sdcc_dma_crci",
450 .start = DMOV_SDC1_CRCI,
451 .end = DMOV_SDC1_CRCI,
452 .flags = IORESOURCE_DMA,
453 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700454};
455
456static struct resource resources_sdc2[] = {
457 {
458 .start = MSM_SDC2_BASE,
459 .end = MSM_SDC2_BASE + SZ_4K - 1,
460 .flags = IORESOURCE_MEM,
461 },
462 {
463 .start = INT_SDC2_0,
464 .end = INT_SDC2_1,
465 .flags = IORESOURCE_IRQ,
466 },
467 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700468 .name = "sdcc_dma_chnl",
469 .start = DMOV_SDC2_CHAN,
470 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700471 .flags = IORESOURCE_DMA,
472 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700473 {
474 .name = "sdcc_dma_crci",
475 .start = DMOV_SDC2_CRCI,
476 .end = DMOV_SDC2_CRCI,
477 .flags = IORESOURCE_DMA,
478 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700479};
480
481static struct resource resources_sdc3[] = {
482 {
483 .start = MSM_SDC3_BASE,
484 .end = MSM_SDC3_BASE + SZ_4K - 1,
485 .flags = IORESOURCE_MEM,
486 },
487 {
488 .start = INT_SDC3_0,
489 .end = INT_SDC3_1,
490 .flags = IORESOURCE_IRQ,
491 },
492 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700493 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530494 .start = DMOV_SDC3_CHAN,
495 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700496 .flags = IORESOURCE_DMA,
497 },
498 {
499 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530500 .start = DMOV_SDC3_CRCI,
501 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700502 .flags = IORESOURCE_DMA,
503 },
504};
505
506static struct resource resources_sdc4[] = {
507 {
508 .start = MSM_SDC4_BASE,
509 .end = MSM_SDC4_BASE + SZ_4K - 1,
510 .flags = IORESOURCE_MEM,
511 },
512 {
513 .start = INT_SDC4_0,
514 .end = INT_SDC4_1,
515 .flags = IORESOURCE_IRQ,
516 },
517 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700518 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530519 .start = DMOV_SDC4_CHAN,
520 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700521 .flags = IORESOURCE_DMA,
522 },
523 {
524 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530525 .start = DMOV_SDC4_CRCI,
526 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700527 .flags = IORESOURCE_DMA,
528 },
529};
530
531struct platform_device msm_device_sdc1 = {
532 .name = "msm_sdcc",
533 .id = 1,
534 .num_resources = ARRAY_SIZE(resources_sdc1),
535 .resource = resources_sdc1,
536 .dev = {
537 .coherent_dma_mask = 0xffffffff,
538 },
539};
540
541struct platform_device msm_device_sdc2 = {
542 .name = "msm_sdcc",
543 .id = 2,
544 .num_resources = ARRAY_SIZE(resources_sdc2),
545 .resource = resources_sdc2,
546 .dev = {
547 .coherent_dma_mask = 0xffffffff,
548 },
549};
550
551struct platform_device msm_device_sdc3 = {
552 .name = "msm_sdcc",
553 .id = 3,
554 .num_resources = ARRAY_SIZE(resources_sdc3),
555 .resource = resources_sdc3,
556 .dev = {
557 .coherent_dma_mask = 0xffffffff,
558 },
559};
560
561struct platform_device msm_device_sdc4 = {
562 .name = "msm_sdcc",
563 .id = 4,
564 .num_resources = ARRAY_SIZE(resources_sdc4),
565 .resource = resources_sdc4,
566 .dev = {
567 .coherent_dma_mask = 0xffffffff,
568 },
569};
570
571static struct platform_device *msm_sdcc_devices[] __initdata = {
572 &msm_device_sdc1,
573 &msm_device_sdc2,
574 &msm_device_sdc3,
575 &msm_device_sdc4,
576};
577
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530578#ifdef CONFIG_MSM_CAMERA_V4L2
579static struct resource msm_csic0_resources[] = {
580 {
581 .name = "csic",
582 .start = 0xA0F00000,
583 .end = 0xA0F00000 + 0x00100000 - 1,
584 .flags = IORESOURCE_MEM,
585 },
586 {
587 .name = "csic",
588 .start = INT_CSI_IRQ_0,
589 .end = INT_CSI_IRQ_0,
590 .flags = IORESOURCE_IRQ,
591 },
592};
593
594static struct resource msm_csic1_resources[] = {
595 {
596 .name = "csic",
597 .start = 0xA1000000,
598 .end = 0xA1000000 + 0x00100000 - 1,
599 .flags = IORESOURCE_MEM,
600 },
601 {
602 .name = "csic",
603 .start = INT_CSI_IRQ_1,
604 .end = INT_CSI_IRQ_1,
605 .flags = IORESOURCE_IRQ,
606 },
607};
608
609struct platform_device msm7x27a_device_csic0 = {
610 .name = "msm_csic",
611 .id = 0,
612 .resource = msm_csic0_resources,
613 .num_resources = ARRAY_SIZE(msm_csic0_resources),
614};
615
616struct platform_device msm7x27a_device_csic1 = {
617 .name = "msm_csic",
618 .id = 1,
619 .resource = msm_csic1_resources,
620 .num_resources = ARRAY_SIZE(msm_csic1_resources),
621};
622
623static struct resource msm_clkctl_resources[] = {
624 {
625 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530626 .start = MSM7XXX_CLK_CTL_PHYS,
627 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530628 .flags = IORESOURCE_MEM,
629 },
630};
631struct platform_device msm7x27a_device_clkctl = {
632 .name = "msm_clk_ctl",
633 .id = 0,
634 .resource = msm_clkctl_resources,
635 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
636};
637
638struct platform_device msm7x27a_device_vfe = {
639 .name = "msm_vfe",
640 .id = 0,
641};
642
643#endif
644
Murali Nalajala41786ab2012-03-06 10:47:32 +0530645/* Command sequence for simple WFI */
646static uint8_t spm_wfi_cmd_sequence[] __initdata = {
647 0x00, 0x40, 0x40, 0x03,
648 0x00, 0x40, 0x40, 0x0f,
649};
650
651/* Command sequence for GDFS, this won't send any interrupt to the modem */
652static uint8_t spm_pc_without_modem[] __initdata = {
653 0x20, 0x00, 0x30, 0x10,
654 0x40, 0x40, 0x03, 0x10,
655 0x00, 0x30, 0x2E, 0x40,
656 0x40, 0x0f,
657};
658
659static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
660 [0] = {
661 .mode = MSM_SPM_MODE_CLOCK_GATING,
662 .notify_rpm = false,
663 .cmd = spm_wfi_cmd_sequence,
664 },
665 [1] = {
666 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
667 .notify_rpm = false,
668 .cmd = spm_pc_without_modem,
669 },
670};
671
672static struct msm_spm_platform_data msm_spm_data[] __initdata = {
673 [0] = {
674 .reg_base_addr = MSM_SAW0_BASE,
675 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
676 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
677 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
678 .modes = msm_spm_seq_list,
679 },
680 [1] = {
681 .reg_base_addr = MSM_SAW1_BASE,
682 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
683 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
684 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
685 .modes = msm_spm_seq_list,
686 },
687};
688
689void __init msm8x25_spm_device_init(void)
690{
691 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
692}
693
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700694#define MDP_BASE 0xAA200000
695#define MIPI_DSI_HW_BASE 0xA1100000
696
697static struct resource msm_mipi_dsi_resources[] = {
698 {
699 .name = "mipi_dsi",
700 .start = MIPI_DSI_HW_BASE,
701 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
702 .flags = IORESOURCE_MEM,
703 },
704 {
705 .start = INT_DSI_IRQ,
706 .end = INT_DSI_IRQ,
707 .flags = IORESOURCE_IRQ,
708 },
709};
710
711static struct platform_device msm_mipi_dsi_device = {
712 .name = "mipi_dsi",
713 .id = 1,
714 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
715 .resource = msm_mipi_dsi_resources,
716};
717
718static struct resource msm_mdp_resources[] = {
719 {
720 .name = "mdp",
721 .start = MDP_BASE,
722 .end = MDP_BASE + 0x000F1008 - 1,
723 .flags = IORESOURCE_MEM,
724 },
725 {
726 .start = INT_MDP,
727 .end = INT_MDP,
728 .flags = IORESOURCE_IRQ,
729 },
730};
731
732static struct platform_device msm_mdp_device = {
733 .name = "mdp",
734 .id = 0,
735 .num_resources = ARRAY_SIZE(msm_mdp_resources),
736 .resource = msm_mdp_resources,
737};
738
739static struct platform_device msm_lcdc_device = {
740 .name = "lcdc",
741 .id = 0,
742};
743
744static struct resource kgsl_3d0_resources[] = {
745 {
746 .name = KGSL_3D0_REG_MEMORY,
747 .start = 0xA0000000,
748 .end = 0xA001ffff,
749 .flags = IORESOURCE_MEM,
750 },
751 {
752 .name = KGSL_3D0_IRQ,
753 .start = INT_GRAPHICS,
754 .end = INT_GRAPHICS,
755 .flags = IORESOURCE_IRQ,
756 },
757};
758
759static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600760 .pwrlevel = {
761 {
762 .gpu_freq = 245760000,
763 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700764 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600765 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530766 .gpu_freq = 192000000,
767 .bus_freq = 160000000,
768 },
769 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600770 .gpu_freq = 133330000,
771 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700772 },
773 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600774 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530775 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600776 .set_grp_async = set_grp_xbar_async,
777 .idle_timeout = HZ/5,
778 .nap_allowed = false,
779 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700780};
781
782struct platform_device msm_kgsl_3d0 = {
783 .name = "kgsl-3d0",
784 .id = 0,
785 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
786 .resource = kgsl_3d0_resources,
787 .dev = {
788 .platform_data = &kgsl_3d0_pdata,
789 },
790};
791
792void __init msm7x25a_kgsl_3d0_init(void)
793{
794 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530795 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600796 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
797 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
798 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
799 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Ranjhith Kalisamyb1031292012-03-06 12:19:24 +0530800 } else if (cpu_is_msm8625())
801 /* msm8625 has an idle_timout of 50 hours */
802 kgsl_3d0_pdata.idle_timeout = 18000000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700803}
804
805static void __init msm_register_device(struct platform_device *pdev, void *data)
806{
807 int ret;
808
809 pdev->dev.platform_data = data;
810
811 ret = platform_device_register(pdev);
812
813 if (ret)
814 dev_err(&pdev->dev,
815 "%s: platform_device_register() failed = %d\n",
816 __func__, ret);
817}
818
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700819
820#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
821#define PDM0_CTL_OFFSET (0x04)
822#define SIZE_8B (0x08)
823
824static struct resource resources_led[] = {
825 {
826 .start = PERPH_WEB_BLOCK_ADDR,
827 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
828 .name = "led-gpio-pdm",
829 .flags = IORESOURCE_MEM,
830 },
831};
832
833static struct led_info msm_kpbl_pdm_led_pdata = {
834 .name = "keyboard-backlight",
835};
836
837struct platform_device led_pdev = {
838 .name = "leds-msm-pdm",
839 /* use pdev id to represent pdm id */
840 .id = 0,
841 .num_resources = ARRAY_SIZE(resources_led),
842 .resource = resources_led,
843 .dev = {
844 .platform_data = &msm_kpbl_pdm_led_pdata,
845 },
846};
847
Manish Dewangan3a260992011-06-24 18:01:34 +0530848struct platform_device asoc_msm_pcm = {
849 .name = "msm-dsp-audio",
850 .id = 0,
851};
852
853struct platform_device asoc_msm_dai0 = {
854 .name = "msm-codec-dai",
855 .id = 0,
856};
857
858struct platform_device asoc_msm_dai1 = {
859 .name = "msm-cpu-dai",
860 .id = 0,
861};
862
Taniya Das2e948192011-12-20 11:15:13 +0530863static struct resource gpio_resources[] = {
864 {
865 .start = INT_GPIO_GROUP1,
866 .flags = IORESOURCE_IRQ,
867 },
868 {
869 .start = INT_GPIO_GROUP2,
870 .flags = IORESOURCE_IRQ,
871 },
872};
873
874static struct platform_device msm_device_gpio = {
875 .name = "msmgpio",
876 .id = -1,
877 .resource = gpio_resources,
878 .num_resources = ARRAY_SIZE(gpio_resources),
879};
880
Taniya Das43bcdd62011-12-02 17:33:27 +0530881struct platform_device *msm_footswitch_devices[] = {
882 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
883};
884unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
885
886/* MSM8625 Devices */
887
888static struct resource msm8625_resources_uart1[] = {
889 {
890 .start = MSM8625_INT_UART1,
891 .end = MSM8625_INT_UART1,
892 .flags = IORESOURCE_IRQ,
893 },
894 {
Taniya Das13b811a2011-12-09 18:33:45 +0530895 .start = MSM7XXX_UART1_PHYS,
896 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530897 .flags = IORESOURCE_MEM,
898 },
899};
900
901struct platform_device msm8625_device_uart1 = {
902 .name = "msm_serial",
903 .id = 0,
904 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
905 .resource = msm8625_resources_uart1,
906};
907
Trilok Soni269fff42012-02-13 20:35:30 +0530908static struct resource msm8625_uart1_dm_resources[] = {
909 {
910 .start = MSM_UART1DM_PHYS,
911 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
912 .flags = IORESOURCE_MEM,
913 },
914 {
915 .start = MSM8625_INT_UART1DM_IRQ,
916 .end = MSM8625_INT_UART1DM_IRQ,
917 .flags = IORESOURCE_IRQ,
918 },
919 {
920 .start = MSM8625_INT_UART1DM_RX,
921 .end = MSM8625_INT_UART1DM_RX,
922 .flags = IORESOURCE_IRQ,
923 },
924 {
925 .start = DMOV_HSUART1_TX_CHAN,
926 .end = DMOV_HSUART1_RX_CHAN,
927 .name = "uartdm_channels",
928 .flags = IORESOURCE_DMA,
929 },
930 {
931 .start = DMOV_HSUART1_TX_CRCI,
932 .end = DMOV_HSUART1_RX_CRCI,
933 .name = "uartdm_crci",
934 .flags = IORESOURCE_DMA,
935 },
936};
937
938struct platform_device msm8625_device_uart_dm1 = {
939 .name = "msm_serial_hs",
940 .id = 0,
941 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
942 .resource = msm8625_uart1_dm_resources,
943 .dev = {
944 .dma_mask = &msm_uart_dm1_dma_mask,
945 .coherent_dma_mask = DMA_BIT_MASK(32),
946 },
947};
948
949static struct resource msm8625_uart2dm_resources[] = {
950 {
951 .start = MSM_UART2DM_PHYS,
952 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
953 .name = "uartdm_resource",
954 .flags = IORESOURCE_MEM,
955 },
956 {
957 .start = MSM8625_INT_UART2DM_IRQ,
958 .end = MSM8625_INT_UART2DM_IRQ,
959 .flags = IORESOURCE_IRQ,
960 },
961};
962
963struct platform_device msm8625_device_uart_dm2 = {
964 .name = "msm_serial_hsl",
965 .id = 0,
966 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
967 .resource = msm8625_uart2dm_resources,
968};
969
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530970static struct resource msm8625_resources_adsp[] = {
971 {
972 .start = MSM8625_INT_ADSP_A9_A11,
973 .end = MSM8625_INT_ADSP_A9_A11,
974 .flags = IORESOURCE_IRQ,
975 },
976};
977
978struct platform_device msm8625_device_adsp = {
979 .name = "msm_adsp",
980 .id = -1,
981 .num_resources = ARRAY_SIZE(msm8625_resources_adsp),
982 .resource = msm8625_resources_adsp,
983};
984
Taniya Das43bcdd62011-12-02 17:33:27 +0530985static struct resource msm8625_dmov_resource[] = {
986 {
987 .start = MSM8625_INT_ADM_AARM,
988 .flags = IORESOURCE_IRQ,
989 },
990 {
991 .start = 0xA9700000,
992 .end = 0xA9700000 + SZ_4K - 1,
993 .flags = IORESOURCE_MEM,
994 },
995};
996
997struct platform_device msm8625_device_dmov = {
998 .name = "msm_dmov",
999 .id = -1,
1000 .resource = msm8625_dmov_resource,
1001 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
1002 .dev = {
1003 .platform_data = &msm_dmov_pdata,
1004 },
1005};
Taniya Das2e948192011-12-20 11:15:13 +05301006
Taniya Das9d187142011-12-02 15:53:25 +05301007static struct resource gsbi0_msm8625_qup_resources[] = {
1008 {
1009 .name = "qup_phys_addr",
1010 .start = MSM_GSBI0_QUP_PHYS,
1011 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
1012 .flags = IORESOURCE_MEM,
1013 },
1014 {
1015 .name = "gsbi_qup_i2c_addr",
1016 .start = MSM_GSBI0_PHYS,
1017 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
1018 .flags = IORESOURCE_MEM,
1019 },
1020 {
1021 .name = "qup_err_intr",
1022 .start = MSM8625_INT_PWB_I2C,
1023 .end = MSM8625_INT_PWB_I2C,
1024 .flags = IORESOURCE_IRQ,
1025 },
1026};
1027
1028/* Use GSBI0 QUP for /dev/i2c-0 */
Taniya Dase3027e22012-02-27 16:32:27 +05301029struct platform_device msm8625_gsbi0_qup_i2c_device = {
Taniya Das9d187142011-12-02 15:53:25 +05301030 .name = "qup_i2c",
1031 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
1032 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
1033 .resource = gsbi0_msm8625_qup_resources,
1034};
1035
Trilok Soni633e59c2012-02-13 20:28:30 +05301036static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
1037 {
1038 .name = "qup_phys_addr",
1039 .start = MSM_GSBI1_QUP_PHYS,
1040 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1041 .flags = IORESOURCE_MEM,
1042 },
1043 {
1044 .name = "gsbi_qup_i2c_addr",
1045 .start = MSM_GSBI1_PHYS,
1046 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
1047 .flags = IORESOURCE_MEM,
1048 },
1049 {
1050 .name = "qup_err_intr",
1051 .start = MSM8625_INT_ARM11_DMA,
1052 .end = MSM8625_INT_ARM11_DMA,
1053 .flags = IORESOURCE_IRQ,
1054 },
1055};
1056
1057/* Use GSBI1 QUP for /dev/i2c-1 */
Taniya Dase3027e22012-02-27 16:32:27 +05301058struct platform_device msm8625_gsbi1_qup_i2c_device = {
Trilok Soni633e59c2012-02-13 20:28:30 +05301059 .name = "qup_i2c",
1060 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
1061 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
1062 .resource = gsbi1_msm8625_qup_i2c_resources,
1063};
1064
Taniya Das6684d622012-01-12 10:29:09 +05301065static struct resource msm8625_gpio_resources[] = {
1066 {
1067 .start = MSM8625_INT_GPIO_GROUP1,
1068 .flags = IORESOURCE_IRQ,
1069 },
1070 {
1071 .start = MSM8625_INT_GPIO_GROUP2,
1072 .flags = IORESOURCE_IRQ,
1073 },
1074};
1075
1076static struct platform_device msm8625_device_gpio = {
1077 .name = "msmgpio",
1078 .id = -1,
1079 .resource = msm8625_gpio_resources,
1080 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
1081};
1082
Trilok Soniee75f6c2012-02-13 20:45:07 +05301083static struct resource msm8625_resources_sdc1[] = {
1084 {
1085 .start = MSM_SDC1_BASE,
1086 .end = MSM_SDC1_BASE + SZ_4K - 1,
1087 .flags = IORESOURCE_MEM,
1088 },
1089 {
1090 .start = MSM8625_INT_SDC1_0,
1091 .end = MSM8625_INT_SDC1_1,
1092 .flags = IORESOURCE_IRQ,
1093 },
1094 {
1095 .name = "sdcc_dma_chnl",
1096 .start = DMOV_SDC1_CHAN,
1097 .end = DMOV_SDC1_CHAN,
1098 .flags = IORESOURCE_DMA,
1099 },
1100 {
1101 .name = "sdcc_dma_crci",
1102 .start = DMOV_SDC1_CRCI,
1103 .end = DMOV_SDC1_CRCI,
1104 .flags = IORESOURCE_DMA,
1105 }
1106};
1107
1108static struct resource msm8625_resources_sdc2[] = {
1109 {
1110 .start = MSM_SDC2_BASE,
1111 .end = MSM_SDC2_BASE + SZ_4K - 1,
1112 .flags = IORESOURCE_MEM,
1113 },
1114 {
1115 .start = MSM8625_INT_SDC2_0,
1116 .end = MSM8625_INT_SDC2_1,
1117 .flags = IORESOURCE_IRQ,
1118 },
1119 {
1120 .name = "sdcc_dma_chnl",
1121 .start = DMOV_SDC2_CHAN,
1122 .end = DMOV_SDC2_CHAN,
1123 .flags = IORESOURCE_DMA,
1124 },
1125 {
1126 .name = "sdcc_dma_crci",
1127 .start = DMOV_SDC2_CRCI,
1128 .end = DMOV_SDC2_CRCI,
1129 .flags = IORESOURCE_DMA,
1130 }
1131};
1132
1133static struct resource msm8625_resources_sdc3[] = {
1134 {
1135 .start = MSM_SDC3_BASE,
1136 .end = MSM_SDC3_BASE + SZ_4K - 1,
1137 .flags = IORESOURCE_MEM,
1138 },
1139 {
1140 .start = MSM8625_INT_SDC3_0,
1141 .end = MSM8625_INT_SDC3_1,
1142 .flags = IORESOURCE_IRQ,
1143 },
1144 {
1145 .name = "sdcc_dma_chnl",
1146 .start = DMOV_SDC3_CHAN,
1147 .end = DMOV_SDC3_CHAN,
1148 .flags = IORESOURCE_DMA,
1149 },
1150 {
1151 .name = "sdcc_dma_crci",
1152 .start = DMOV_SDC3_CRCI,
1153 .end = DMOV_SDC3_CRCI,
1154 .flags = IORESOURCE_DMA,
1155 },
1156};
1157
1158static struct resource msm8625_resources_sdc4[] = {
1159 {
1160 .start = MSM_SDC4_BASE,
1161 .end = MSM_SDC4_BASE + SZ_4K - 1,
1162 .flags = IORESOURCE_MEM,
1163 },
1164 {
1165 .start = MSM8625_INT_SDC4_0,
1166 .end = MSM8625_INT_SDC4_1,
1167 .flags = IORESOURCE_IRQ,
1168 },
1169 {
1170 .name = "sdcc_dma_chnl",
1171 .start = DMOV_SDC4_CHAN,
1172 .end = DMOV_SDC4_CHAN,
1173 .flags = IORESOURCE_DMA,
1174 },
1175 {
1176 .name = "sdcc_dma_crci",
1177 .start = DMOV_SDC4_CRCI,
1178 .end = DMOV_SDC4_CRCI,
1179 .flags = IORESOURCE_DMA,
1180 },
1181};
1182
1183struct platform_device msm8625_device_sdc1 = {
1184 .name = "msm_sdcc",
1185 .id = 1,
1186 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1187 .resource = msm8625_resources_sdc1,
1188 .dev = {
1189 .coherent_dma_mask = 0xffffffff,
1190 },
1191};
1192
1193struct platform_device msm8625_device_sdc2 = {
1194 .name = "msm_sdcc",
1195 .id = 2,
1196 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1197 .resource = msm8625_resources_sdc2,
1198 .dev = {
1199 .coherent_dma_mask = 0xffffffff,
1200 },
1201};
1202
1203struct platform_device msm8625_device_sdc3 = {
1204 .name = "msm_sdcc",
1205 .id = 3,
1206 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1207 .resource = msm8625_resources_sdc3,
1208 .dev = {
1209 .coherent_dma_mask = 0xffffffff,
1210 },
1211};
1212
1213struct platform_device msm8625_device_sdc4 = {
1214 .name = "msm_sdcc",
1215 .id = 4,
1216 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1217 .resource = msm8625_resources_sdc4,
1218 .dev = {
1219 .coherent_dma_mask = 0xffffffff,
1220 },
1221};
1222
1223static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1224 &msm8625_device_sdc1,
1225 &msm8625_device_sdc2,
1226 &msm8625_device_sdc3,
1227 &msm8625_device_sdc4,
1228};
1229
1230int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1231{
1232 struct platform_device *pdev;
1233
1234 if (controller < 1 || controller > 4)
1235 return -EINVAL;
1236
1237 if (cpu_is_msm8625())
1238 pdev = msm8625_sdcc_devices[controller-1];
1239 else
1240 pdev = msm_sdcc_devices[controller-1];
1241
1242 pdev->dev.platform_data = plat;
1243 return platform_device_register(pdev);
1244}
1245
Trilok Sonida63a8b2012-02-13 20:50:03 +05301246static struct resource msm8625_resources_hsusb_otg[] = {
1247 {
1248 .start = MSM_HSUSB_PHYS,
1249 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1250 .flags = IORESOURCE_MEM,
1251 },
1252 {
1253 .start = MSM8625_INT_USB_HS,
1254 .end = MSM8625_INT_USB_HS,
1255 .flags = IORESOURCE_IRQ,
1256 },
1257};
1258
1259struct platform_device msm8625_device_otg = {
1260 .name = "msm_otg",
1261 .id = -1,
1262 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1263 .resource = msm8625_resources_hsusb_otg,
1264 .dev = {
1265 .dma_mask = &dma_mask,
1266 .coherent_dma_mask = 0xffffffffULL,
1267 },
1268};
1269
1270static struct resource msm8625_resources_gadget_peripheral[] = {
1271 {
1272 .start = MSM_HSUSB_PHYS,
1273 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1274 .flags = IORESOURCE_MEM,
1275 },
1276 {
1277 .start = MSM8625_INT_USB_HS,
1278 .end = MSM8625_INT_USB_HS,
1279 .flags = IORESOURCE_IRQ,
1280 },
1281};
1282
1283struct platform_device msm8625_device_gadget_peripheral = {
1284 .name = "msm_hsusb",
1285 .id = -1,
1286 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1287 .resource = msm8625_resources_gadget_peripheral,
1288 .dev = {
1289 .dma_mask = &dma_mask,
1290 .coherent_dma_mask = 0xffffffffULL,
1291 },
1292};
1293
1294static struct resource msm8625_resources_hsusb_host[] = {
1295 {
1296 .start = MSM_HSUSB_PHYS,
1297 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1298 .flags = IORESOURCE_MEM,
1299 },
1300 {
1301 .start = MSM8625_INT_USB_HS,
1302 .end = MSM8625_INT_USB_HS,
1303 .flags = IORESOURCE_IRQ,
1304 },
1305};
1306
1307struct platform_device msm8625_device_hsusb_host = {
1308 .name = "msm_hsusb_host",
1309 .id = 0,
1310 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1311 .resource = msm8625_resources_hsusb_host,
1312 .dev = {
1313 .dma_mask = &dma_mask,
1314 .coherent_dma_mask = 0xffffffffULL,
1315 },
1316};
1317
1318static struct platform_device *msm8625_host_devices[] = {
1319 &msm8625_device_hsusb_host,
1320};
1321
1322int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1323{
1324 struct platform_device *pdev;
1325
1326 if (cpu_is_msm8625())
1327 pdev = msm8625_host_devices[host];
1328 else
1329 pdev = msm_host_devices[host];
1330 if (!pdev)
1331 return -ENODEV;
1332 pdev->dev.platform_data = plat;
1333 return platform_device_register(pdev);
1334}
1335
Trilok Soni88da2552012-02-13 21:01:24 +05301336#ifdef CONFIG_MSM_CAMERA_V4L2
1337static struct resource msm8625_csic0_resources[] = {
1338 {
1339 .name = "csic",
1340 .start = 0xA0F00000,
1341 .end = 0xA0F00000 + 0x00100000 - 1,
1342 .flags = IORESOURCE_MEM,
1343 },
1344 {
1345 .name = "csic",
1346 .start = MSM8625_INT_CSI_IRQ_0,
1347 .end = MSM8625_INT_CSI_IRQ_0,
1348 .flags = IORESOURCE_IRQ,
1349 },
1350};
1351
1352static struct resource msm8625_csic1_resources[] = {
1353 {
1354 .name = "csic",
1355 .start = 0xA1000000,
1356 .end = 0xA1000000 + 0x00100000 - 1,
1357 .flags = IORESOURCE_MEM,
1358 },
1359 {
1360 .name = "csic",
1361 .start = MSM8625_INT_CSI_IRQ_1,
1362 .end = MSM8625_INT_CSI_IRQ_1,
1363 .flags = IORESOURCE_IRQ,
1364 },
1365};
1366
1367struct platform_device msm8625_device_csic0 = {
1368 .name = "msm_csic",
1369 .id = 0,
1370 .resource = msm8625_csic0_resources,
1371 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1372};
1373
1374struct platform_device msm8625_device_csic1 = {
1375 .name = "msm_csic",
1376 .id = 1,
1377 .resource = msm8625_csic1_resources,
1378 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1379};
1380#endif
1381
Trilok Soniae4633d2012-02-13 21:08:32 +05301382static struct resource msm8625_mipi_dsi_resources[] = {
1383 {
1384 .name = "mipi_dsi",
1385 .start = MIPI_DSI_HW_BASE,
1386 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1387 .flags = IORESOURCE_MEM,
1388 },
1389 {
1390 .start = MSM8625_INT_DSI_IRQ,
1391 .end = MSM8625_INT_DSI_IRQ,
1392 .flags = IORESOURCE_IRQ,
1393 },
1394};
1395
1396static struct platform_device msm8625_mipi_dsi_device = {
1397 .name = "mipi_dsi",
1398 .id = 1,
1399 .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources),
1400 .resource = msm8625_mipi_dsi_resources,
1401};
1402
1403static struct resource msm8625_mdp_resources[] = {
1404 {
1405 .name = "mdp",
1406 .start = MDP_BASE,
1407 .end = MDP_BASE + 0x000F1008 - 1,
1408 .flags = IORESOURCE_MEM,
1409 },
1410 {
1411 .start = MSM8625_INT_MDP,
1412 .end = MSM8625_INT_MDP,
1413 .flags = IORESOURCE_IRQ,
1414 },
1415};
1416
1417static struct platform_device msm8625_mdp_device = {
1418 .name = "mdp",
1419 .id = 0,
1420 .num_resources = ARRAY_SIZE(msm8625_mdp_resources),
1421 .resource = msm8625_mdp_resources,
1422};
1423
1424void __init msm_fb_register_device(char *name, void *data)
1425{
1426 if (!strncmp(name, "mdp", 3)) {
1427 if (cpu_is_msm8625())
1428 msm_register_device(&msm8625_mdp_device, data);
1429 else
1430 msm_register_device(&msm_mdp_device, data);
1431 } else if (!strncmp(name, "mipi_dsi", 8)) {
1432 if (cpu_is_msm8625())
1433 msm_register_device(&msm8625_mipi_dsi_device, data);
1434 else
1435 msm_register_device(&msm_mipi_dsi_device, data);
1436 } else if (!strncmp(name, "lcdc", 4)) {
1437 msm_register_device(&msm_lcdc_device, data);
1438 } else {
1439 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1440 }
1441}
1442
Trilok Soni664b95d2012-02-13 21:13:15 +05301443static struct resource msm8625_kgsl_3d0_resources[] = {
1444 {
1445 .name = KGSL_3D0_REG_MEMORY,
1446 .start = 0xA0000000,
1447 .end = 0xA001ffff,
1448 .flags = IORESOURCE_MEM,
1449 },
1450 {
1451 .name = KGSL_3D0_IRQ,
1452 .start = MSM8625_INT_GRAPHICS,
1453 .end = MSM8625_INT_GRAPHICS,
1454 .flags = IORESOURCE_IRQ,
1455 },
1456};
1457
1458struct platform_device msm8625_kgsl_3d0 = {
1459 .name = "kgsl-3d0",
1460 .id = 0,
1461 .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources),
1462 .resource = msm8625_kgsl_3d0_resources,
1463 .dev = {
1464 .platform_data = &kgsl_3d0_pdata,
1465 },
1466};
1467
Taniya Das7c9f0512011-12-02 14:26:46 +05301468static struct clk_lookup msm_clock_8625_dummy[] = {
1469 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1470 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1471 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1472 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1473 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1474 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1475 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1476 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1477 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1478 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1479 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1480 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1481 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1482 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1483 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1484 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1485 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1486 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1487 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1488 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1489 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1490 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1491 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1492 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1493 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1494 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1495 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1496 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1497 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1498 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1499 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1500 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1501 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1502 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1503 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1504 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1505 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1506 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1507 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1508 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1509 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1510 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1511 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1512 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1513 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1514 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1515 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1516 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1517 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1518 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1519 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1520 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1521 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1522 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1523 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1524 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1525 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1526 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1527 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1528};
1529
1530struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1531 .table = msm_clock_8625_dummy,
1532 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1533};
1534
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001535int __init msm7x2x_misc_init(void)
1536{
Taniya Das7c9f0512011-12-02 14:26:46 +05301537 if (machine_is_msm8625_rumi3()) {
1538 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301539 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301540 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301541
Stephen Boydbb600ae2011-08-02 20:11:40 -07001542 msm_clock_init(&msm7x27a_clock_init_data);
Taniya Dase3027e22012-02-27 16:32:27 +05301543 if (cpu_is_msm7x27aa() || cpu_is_msm8625())
Matt Wagantallec57f062011-08-16 23:54:46 -07001544 acpuclk_init(&acpuclk_7x27aa_soc_data);
1545 else
1546 acpuclk_init(&acpuclk_7x27a_soc_data);
1547
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001548
1549 return 0;
1550}
1551
1552#ifdef CONFIG_CACHE_L2X0
1553static int __init msm7x27x_cache_init(void)
1554{
1555 int aux_ctrl = 0;
1556
1557 /* Way Size 010(0x2) 32KB */
1558 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1559 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1560 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1561
Taniya Das379b5682011-12-02 14:53:46 +05301562 if (cpu_is_msm8625()) {
1563 /* Way Size 011(0x3) 64KB */
1564 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1565 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
1566 (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT);
1567 }
1568
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001569 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
1570
1571 return 0;
1572}
1573#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301574static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001575#endif
1576
1577void __init msm_common_io_init(void)
1578{
1579 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301580 if (socinfo_init() < 0)
1581 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001582 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301583}
1584
1585void __init msm8625_init_irq(void)
1586{
1587 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1588 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301589}
1590
1591void __init msm8625_map_io(void)
1592{
1593 msm_map_msm8625_io();
1594
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001595 if (socinfo_init() < 0)
1596 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301597 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001598}
1599
Taniya Das43bcdd62011-12-02 17:33:27 +05301600static int msm7627a_init_gpio(void)
1601{
Taniya Das6684d622012-01-12 10:29:09 +05301602 if (cpu_is_msm8625())
1603 platform_device_register(&msm8625_device_gpio);
1604 else
1605 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301606 return 0;
1607}
1608postcore_initcall(msm7627a_init_gpio);
1609