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