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