blob: cc1e7c52168d597937fdf5197fae281053998404 [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
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530213static struct resource resources_adsp[] = {
214 {
215 .start = INT_ADSP_A9_A11,
216 .end = INT_ADSP_A9_A11,
217 .flags = IORESOURCE_IRQ,
218 },
219};
220
221struct platform_device msm_adsp_device = {
222 .name = "msm_adsp",
223 .id = -1,
224 .num_resources = ARRAY_SIZE(resources_adsp),
225 .resource = resources_adsp,
226};
227
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700228static struct resource resources_uart1[] = {
229 {
230 .start = INT_UART1,
231 .end = INT_UART1,
232 .flags = IORESOURCE_IRQ,
233 },
234 {
Taniya Das13b811a2011-12-09 18:33:45 +0530235 .start = MSM7XXX_UART1_PHYS,
236 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700237 .flags = IORESOURCE_MEM,
238 },
239};
240
241struct platform_device msm_device_uart1 = {
242 .name = "msm_serial",
243 .id = 0,
244 .num_resources = ARRAY_SIZE(resources_uart1),
245 .resource = resources_uart1,
246};
247
248#define MSM_UART1DM_PHYS 0xA0200000
249static struct resource msm_uart1_dm_resources[] = {
250 {
251 .start = MSM_UART1DM_PHYS,
252 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
253 .flags = IORESOURCE_MEM,
254 },
255 {
256 .start = INT_UART1DM_IRQ,
257 .end = INT_UART1DM_IRQ,
258 .flags = IORESOURCE_IRQ,
259 },
260 {
261 .start = INT_UART1DM_RX,
262 .end = INT_UART1DM_RX,
263 .flags = IORESOURCE_IRQ,
264 },
265 {
266 .start = DMOV_HSUART1_TX_CHAN,
267 .end = DMOV_HSUART1_RX_CHAN,
268 .name = "uartdm_channels",
269 .flags = IORESOURCE_DMA,
270 },
271 {
272 .start = DMOV_HSUART1_TX_CRCI,
273 .end = DMOV_HSUART1_RX_CRCI,
274 .name = "uartdm_crci",
275 .flags = IORESOURCE_DMA,
276 },
277};
278
279static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
280struct platform_device msm_device_uart_dm1 = {
281 .name = "msm_serial_hs",
282 .id = 0,
283 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
284 .resource = msm_uart1_dm_resources,
285 .dev = {
286 .dma_mask = &msm_uart_dm1_dma_mask,
287 .coherent_dma_mask = DMA_BIT_MASK(32),
288 },
289};
290
291#define MSM_UART2DM_PHYS 0xA0300000
292static struct resource msm_uart2dm_resources[] = {
293 {
294 .start = MSM_UART2DM_PHYS,
295 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
296 .name = "uartdm_resource",
297 .flags = IORESOURCE_MEM,
298 },
299 {
300 .start = INT_UART2DM_IRQ,
301 .end = INT_UART2DM_IRQ,
302 .flags = IORESOURCE_IRQ,
303 },
304};
305
306struct platform_device msm_device_uart_dm2 = {
307 .name = "msm_serial_hsl",
308 .id = 0,
309 .num_resources = ARRAY_SIZE(msm_uart2dm_resources),
310 .resource = msm_uart2dm_resources,
311};
312
313#define MSM_NAND_PHYS 0xA0A00000
314#define MSM_NANDC01_PHYS 0xA0A40000
315#define MSM_NANDC10_PHYS 0xA0A80000
316#define MSM_NANDC11_PHYS 0xA0AC0000
317#define EBI2_REG_BASE 0xA0D00000
318static struct resource resources_nand[] = {
319 [0] = {
320 .name = "msm_nand_dmac",
321 .start = DMOV_NAND_CHAN,
322 .end = DMOV_NAND_CHAN,
323 .flags = IORESOURCE_DMA,
324 },
325 [1] = {
326 .name = "msm_nand_phys",
327 .start = MSM_NAND_PHYS,
328 .end = MSM_NAND_PHYS + 0x7FF,
329 .flags = IORESOURCE_MEM,
330 },
331 [2] = {
332 .name = "msm_nandc01_phys",
333 .start = MSM_NANDC01_PHYS,
334 .end = MSM_NANDC01_PHYS + 0x7FF,
335 .flags = IORESOURCE_MEM,
336 },
337 [3] = {
338 .name = "msm_nandc10_phys",
339 .start = MSM_NANDC10_PHYS,
340 .end = MSM_NANDC10_PHYS + 0x7FF,
341 .flags = IORESOURCE_MEM,
342 },
343 [4] = {
344 .name = "msm_nandc11_phys",
345 .start = MSM_NANDC11_PHYS,
346 .end = MSM_NANDC11_PHYS + 0x7FF,
347 .flags = IORESOURCE_MEM,
348 },
349 [5] = {
350 .name = "ebi2_reg_base",
351 .start = EBI2_REG_BASE,
352 .end = EBI2_REG_BASE + 0x60,
353 .flags = IORESOURCE_MEM,
354 },
355};
356
357struct flash_platform_data msm_nand_data;
358
359struct platform_device msm_device_nand = {
360 .name = "msm_nand",
361 .id = -1,
362 .num_resources = ARRAY_SIZE(resources_nand),
363 .resource = resources_nand,
364 .dev = {
365 .platform_data = &msm_nand_data,
366 },
367};
368
369#define MSM_SDC1_BASE 0xA0400000
370#define MSM_SDC2_BASE 0xA0500000
371#define MSM_SDC3_BASE 0xA0600000
372#define MSM_SDC4_BASE 0xA0700000
373static struct resource resources_sdc1[] = {
374 {
375 .start = MSM_SDC1_BASE,
376 .end = MSM_SDC1_BASE + SZ_4K - 1,
377 .flags = IORESOURCE_MEM,
378 },
379 {
380 .start = INT_SDC1_0,
381 .end = INT_SDC1_1,
382 .flags = IORESOURCE_IRQ,
383 },
384 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700385 .name = "sdcc_dma_chnl",
386 .start = DMOV_SDC1_CHAN,
387 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700388 .flags = IORESOURCE_DMA,
389 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700390 {
391 .name = "sdcc_dma_crci",
392 .start = DMOV_SDC1_CRCI,
393 .end = DMOV_SDC1_CRCI,
394 .flags = IORESOURCE_DMA,
395 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700396};
397
398static struct resource resources_sdc2[] = {
399 {
400 .start = MSM_SDC2_BASE,
401 .end = MSM_SDC2_BASE + SZ_4K - 1,
402 .flags = IORESOURCE_MEM,
403 },
404 {
405 .start = INT_SDC2_0,
406 .end = INT_SDC2_1,
407 .flags = IORESOURCE_IRQ,
408 },
409 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700410 .name = "sdcc_dma_chnl",
411 .start = DMOV_SDC2_CHAN,
412 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700413 .flags = IORESOURCE_DMA,
414 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700415 {
416 .name = "sdcc_dma_crci",
417 .start = DMOV_SDC2_CRCI,
418 .end = DMOV_SDC2_CRCI,
419 .flags = IORESOURCE_DMA,
420 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700421};
422
423static struct resource resources_sdc3[] = {
424 {
425 .start = MSM_SDC3_BASE,
426 .end = MSM_SDC3_BASE + SZ_4K - 1,
427 .flags = IORESOURCE_MEM,
428 },
429 {
430 .start = INT_SDC3_0,
431 .end = INT_SDC3_1,
432 .flags = IORESOURCE_IRQ,
433 },
434 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700435 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530436 .start = DMOV_SDC3_CHAN,
437 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700438 .flags = IORESOURCE_DMA,
439 },
440 {
441 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530442 .start = DMOV_SDC3_CRCI,
443 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700444 .flags = IORESOURCE_DMA,
445 },
446};
447
448static struct resource resources_sdc4[] = {
449 {
450 .start = MSM_SDC4_BASE,
451 .end = MSM_SDC4_BASE + SZ_4K - 1,
452 .flags = IORESOURCE_MEM,
453 },
454 {
455 .start = INT_SDC4_0,
456 .end = INT_SDC4_1,
457 .flags = IORESOURCE_IRQ,
458 },
459 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700460 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530461 .start = DMOV_SDC4_CHAN,
462 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700463 .flags = IORESOURCE_DMA,
464 },
465 {
466 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530467 .start = DMOV_SDC4_CRCI,
468 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700469 .flags = IORESOURCE_DMA,
470 },
471};
472
473struct platform_device msm_device_sdc1 = {
474 .name = "msm_sdcc",
475 .id = 1,
476 .num_resources = ARRAY_SIZE(resources_sdc1),
477 .resource = resources_sdc1,
478 .dev = {
479 .coherent_dma_mask = 0xffffffff,
480 },
481};
482
483struct platform_device msm_device_sdc2 = {
484 .name = "msm_sdcc",
485 .id = 2,
486 .num_resources = ARRAY_SIZE(resources_sdc2),
487 .resource = resources_sdc2,
488 .dev = {
489 .coherent_dma_mask = 0xffffffff,
490 },
491};
492
493struct platform_device msm_device_sdc3 = {
494 .name = "msm_sdcc",
495 .id = 3,
496 .num_resources = ARRAY_SIZE(resources_sdc3),
497 .resource = resources_sdc3,
498 .dev = {
499 .coherent_dma_mask = 0xffffffff,
500 },
501};
502
503struct platform_device msm_device_sdc4 = {
504 .name = "msm_sdcc",
505 .id = 4,
506 .num_resources = ARRAY_SIZE(resources_sdc4),
507 .resource = resources_sdc4,
508 .dev = {
509 .coherent_dma_mask = 0xffffffff,
510 },
511};
512
513static struct platform_device *msm_sdcc_devices[] __initdata = {
514 &msm_device_sdc1,
515 &msm_device_sdc2,
516 &msm_device_sdc3,
517 &msm_device_sdc4,
518};
519
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530520#ifdef CONFIG_MSM_CAMERA_V4L2
521static struct resource msm_csic0_resources[] = {
522 {
523 .name = "csic",
524 .start = 0xA0F00000,
525 .end = 0xA0F00000 + 0x00100000 - 1,
526 .flags = IORESOURCE_MEM,
527 },
528 {
529 .name = "csic",
530 .start = INT_CSI_IRQ_0,
531 .end = INT_CSI_IRQ_0,
532 .flags = IORESOURCE_IRQ,
533 },
534};
535
536static struct resource msm_csic1_resources[] = {
537 {
538 .name = "csic",
539 .start = 0xA1000000,
540 .end = 0xA1000000 + 0x00100000 - 1,
541 .flags = IORESOURCE_MEM,
542 },
543 {
544 .name = "csic",
545 .start = INT_CSI_IRQ_1,
546 .end = INT_CSI_IRQ_1,
547 .flags = IORESOURCE_IRQ,
548 },
549};
550
551struct platform_device msm7x27a_device_csic0 = {
552 .name = "msm_csic",
553 .id = 0,
554 .resource = msm_csic0_resources,
555 .num_resources = ARRAY_SIZE(msm_csic0_resources),
556};
557
558struct platform_device msm7x27a_device_csic1 = {
559 .name = "msm_csic",
560 .id = 1,
561 .resource = msm_csic1_resources,
562 .num_resources = ARRAY_SIZE(msm_csic1_resources),
563};
564
565static struct resource msm_clkctl_resources[] = {
566 {
567 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530568 .start = MSM7XXX_CLK_CTL_PHYS,
569 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530570 .flags = IORESOURCE_MEM,
571 },
572};
573struct platform_device msm7x27a_device_clkctl = {
574 .name = "msm_clk_ctl",
575 .id = 0,
576 .resource = msm_clkctl_resources,
577 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
578};
579
580struct platform_device msm7x27a_device_vfe = {
581 .name = "msm_vfe",
582 .id = 0,
583};
584
585#endif
586
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700587#define MDP_BASE 0xAA200000
588#define MIPI_DSI_HW_BASE 0xA1100000
589
590static struct resource msm_mipi_dsi_resources[] = {
591 {
592 .name = "mipi_dsi",
593 .start = MIPI_DSI_HW_BASE,
594 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
595 .flags = IORESOURCE_MEM,
596 },
597 {
598 .start = INT_DSI_IRQ,
599 .end = INT_DSI_IRQ,
600 .flags = IORESOURCE_IRQ,
601 },
602};
603
604static struct platform_device msm_mipi_dsi_device = {
605 .name = "mipi_dsi",
606 .id = 1,
607 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
608 .resource = msm_mipi_dsi_resources,
609};
610
611static struct resource msm_mdp_resources[] = {
612 {
613 .name = "mdp",
614 .start = MDP_BASE,
615 .end = MDP_BASE + 0x000F1008 - 1,
616 .flags = IORESOURCE_MEM,
617 },
618 {
619 .start = INT_MDP,
620 .end = INT_MDP,
621 .flags = IORESOURCE_IRQ,
622 },
623};
624
625static struct platform_device msm_mdp_device = {
626 .name = "mdp",
627 .id = 0,
628 .num_resources = ARRAY_SIZE(msm_mdp_resources),
629 .resource = msm_mdp_resources,
630};
631
632static struct platform_device msm_lcdc_device = {
633 .name = "lcdc",
634 .id = 0,
635};
636
637static struct resource kgsl_3d0_resources[] = {
638 {
639 .name = KGSL_3D0_REG_MEMORY,
640 .start = 0xA0000000,
641 .end = 0xA001ffff,
642 .flags = IORESOURCE_MEM,
643 },
644 {
645 .name = KGSL_3D0_IRQ,
646 .start = INT_GRAPHICS,
647 .end = INT_GRAPHICS,
648 .flags = IORESOURCE_IRQ,
649 },
650};
651
652static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600653 .pwrlevel = {
654 {
655 .gpu_freq = 245760000,
656 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700657 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600658 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530659 .gpu_freq = 192000000,
660 .bus_freq = 160000000,
661 },
662 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600663 .gpu_freq = 133330000,
664 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700665 },
666 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600667 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530668 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600669 .set_grp_async = set_grp_xbar_async,
670 .idle_timeout = HZ/5,
671 .nap_allowed = false,
672 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700673};
674
675struct platform_device msm_kgsl_3d0 = {
676 .name = "kgsl-3d0",
677 .id = 0,
678 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
679 .resource = kgsl_3d0_resources,
680 .dev = {
681 .platform_data = &kgsl_3d0_pdata,
682 },
683};
684
685void __init msm7x25a_kgsl_3d0_init(void)
686{
687 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530688 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600689 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
690 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
691 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
692 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700693 }
694}
695
696static void __init msm_register_device(struct platform_device *pdev, void *data)
697{
698 int ret;
699
700 pdev->dev.platform_data = data;
701
702 ret = platform_device_register(pdev);
703
704 if (ret)
705 dev_err(&pdev->dev,
706 "%s: platform_device_register() failed = %d\n",
707 __func__, ret);
708}
709
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700710
711#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
712#define PDM0_CTL_OFFSET (0x04)
713#define SIZE_8B (0x08)
714
715static struct resource resources_led[] = {
716 {
717 .start = PERPH_WEB_BLOCK_ADDR,
718 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
719 .name = "led-gpio-pdm",
720 .flags = IORESOURCE_MEM,
721 },
722};
723
724static struct led_info msm_kpbl_pdm_led_pdata = {
725 .name = "keyboard-backlight",
726};
727
728struct platform_device led_pdev = {
729 .name = "leds-msm-pdm",
730 /* use pdev id to represent pdm id */
731 .id = 0,
732 .num_resources = ARRAY_SIZE(resources_led),
733 .resource = resources_led,
734 .dev = {
735 .platform_data = &msm_kpbl_pdm_led_pdata,
736 },
737};
738
Manish Dewangan3a260992011-06-24 18:01:34 +0530739struct platform_device asoc_msm_pcm = {
740 .name = "msm-dsp-audio",
741 .id = 0,
742};
743
744struct platform_device asoc_msm_dai0 = {
745 .name = "msm-codec-dai",
746 .id = 0,
747};
748
749struct platform_device asoc_msm_dai1 = {
750 .name = "msm-cpu-dai",
751 .id = 0,
752};
753
Taniya Das2e948192011-12-20 11:15:13 +0530754static struct resource gpio_resources[] = {
755 {
756 .start = INT_GPIO_GROUP1,
757 .flags = IORESOURCE_IRQ,
758 },
759 {
760 .start = INT_GPIO_GROUP2,
761 .flags = IORESOURCE_IRQ,
762 },
763};
764
765static struct platform_device msm_device_gpio = {
766 .name = "msmgpio",
767 .id = -1,
768 .resource = gpio_resources,
769 .num_resources = ARRAY_SIZE(gpio_resources),
770};
771
Taniya Das43bcdd62011-12-02 17:33:27 +0530772struct platform_device *msm_footswitch_devices[] = {
773 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
774};
775unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
776
777/* MSM8625 Devices */
778
779static struct resource msm8625_resources_uart1[] = {
780 {
781 .start = MSM8625_INT_UART1,
782 .end = MSM8625_INT_UART1,
783 .flags = IORESOURCE_IRQ,
784 },
785 {
Taniya Das13b811a2011-12-09 18:33:45 +0530786 .start = MSM7XXX_UART1_PHYS,
787 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530788 .flags = IORESOURCE_MEM,
789 },
790};
791
792struct platform_device msm8625_device_uart1 = {
793 .name = "msm_serial",
794 .id = 0,
795 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
796 .resource = msm8625_resources_uart1,
797};
798
Trilok Soni269fff42012-02-13 20:35:30 +0530799static struct resource msm8625_uart1_dm_resources[] = {
800 {
801 .start = MSM_UART1DM_PHYS,
802 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
803 .flags = IORESOURCE_MEM,
804 },
805 {
806 .start = MSM8625_INT_UART1DM_IRQ,
807 .end = MSM8625_INT_UART1DM_IRQ,
808 .flags = IORESOURCE_IRQ,
809 },
810 {
811 .start = MSM8625_INT_UART1DM_RX,
812 .end = MSM8625_INT_UART1DM_RX,
813 .flags = IORESOURCE_IRQ,
814 },
815 {
816 .start = DMOV_HSUART1_TX_CHAN,
817 .end = DMOV_HSUART1_RX_CHAN,
818 .name = "uartdm_channels",
819 .flags = IORESOURCE_DMA,
820 },
821 {
822 .start = DMOV_HSUART1_TX_CRCI,
823 .end = DMOV_HSUART1_RX_CRCI,
824 .name = "uartdm_crci",
825 .flags = IORESOURCE_DMA,
826 },
827};
828
829struct platform_device msm8625_device_uart_dm1 = {
830 .name = "msm_serial_hs",
831 .id = 0,
832 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
833 .resource = msm8625_uart1_dm_resources,
834 .dev = {
835 .dma_mask = &msm_uart_dm1_dma_mask,
836 .coherent_dma_mask = DMA_BIT_MASK(32),
837 },
838};
839
840static struct resource msm8625_uart2dm_resources[] = {
841 {
842 .start = MSM_UART2DM_PHYS,
843 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
844 .name = "uartdm_resource",
845 .flags = IORESOURCE_MEM,
846 },
847 {
848 .start = MSM8625_INT_UART2DM_IRQ,
849 .end = MSM8625_INT_UART2DM_IRQ,
850 .flags = IORESOURCE_IRQ,
851 },
852};
853
854struct platform_device msm8625_device_uart_dm2 = {
855 .name = "msm_serial_hsl",
856 .id = 0,
857 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
858 .resource = msm8625_uart2dm_resources,
859};
860
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530861static struct resource msm8625_resources_adsp[] = {
862 {
863 .start = MSM8625_INT_ADSP_A9_A11,
864 .end = MSM8625_INT_ADSP_A9_A11,
865 .flags = IORESOURCE_IRQ,
866 },
867};
868
869struct platform_device msm8625_device_adsp = {
870 .name = "msm_adsp",
871 .id = -1,
872 .num_resources = ARRAY_SIZE(msm8625_resources_adsp),
873 .resource = msm8625_resources_adsp,
874};
875
Taniya Das43bcdd62011-12-02 17:33:27 +0530876static struct resource msm8625_dmov_resource[] = {
877 {
878 .start = MSM8625_INT_ADM_AARM,
879 .flags = IORESOURCE_IRQ,
880 },
881 {
882 .start = 0xA9700000,
883 .end = 0xA9700000 + SZ_4K - 1,
884 .flags = IORESOURCE_MEM,
885 },
886};
887
888struct platform_device msm8625_device_dmov = {
889 .name = "msm_dmov",
890 .id = -1,
891 .resource = msm8625_dmov_resource,
892 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
893 .dev = {
894 .platform_data = &msm_dmov_pdata,
895 },
896};
Taniya Das2e948192011-12-20 11:15:13 +0530897
Taniya Das9d187142011-12-02 15:53:25 +0530898static struct resource gsbi0_msm8625_qup_resources[] = {
899 {
900 .name = "qup_phys_addr",
901 .start = MSM_GSBI0_QUP_PHYS,
902 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
903 .flags = IORESOURCE_MEM,
904 },
905 {
906 .name = "gsbi_qup_i2c_addr",
907 .start = MSM_GSBI0_PHYS,
908 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
909 .flags = IORESOURCE_MEM,
910 },
911 {
912 .name = "qup_err_intr",
913 .start = MSM8625_INT_PWB_I2C,
914 .end = MSM8625_INT_PWB_I2C,
915 .flags = IORESOURCE_IRQ,
916 },
917};
918
919/* Use GSBI0 QUP for /dev/i2c-0 */
920struct platform_device msm8625_device_qup_i2c_gsbi0 = {
921 .name = "qup_i2c",
922 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
923 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
924 .resource = gsbi0_msm8625_qup_resources,
925};
926
Trilok Soni633e59c2012-02-13 20:28:30 +0530927static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
928 {
929 .name = "qup_phys_addr",
930 .start = MSM_GSBI1_QUP_PHYS,
931 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
932 .flags = IORESOURCE_MEM,
933 },
934 {
935 .name = "gsbi_qup_i2c_addr",
936 .start = MSM_GSBI1_PHYS,
937 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
938 .flags = IORESOURCE_MEM,
939 },
940 {
941 .name = "qup_err_intr",
942 .start = MSM8625_INT_ARM11_DMA,
943 .end = MSM8625_INT_ARM11_DMA,
944 .flags = IORESOURCE_IRQ,
945 },
946};
947
948/* Use GSBI1 QUP for /dev/i2c-1 */
949struct platform_device msm8625_device_qup_i2c_gsbi1 = {
950 .name = "qup_i2c",
951 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
952 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
953 .resource = gsbi1_msm8625_qup_i2c_resources,
954};
955
Taniya Das6684d622012-01-12 10:29:09 +0530956static struct resource msm8625_gpio_resources[] = {
957 {
958 .start = MSM8625_INT_GPIO_GROUP1,
959 .flags = IORESOURCE_IRQ,
960 },
961 {
962 .start = MSM8625_INT_GPIO_GROUP2,
963 .flags = IORESOURCE_IRQ,
964 },
965};
966
967static struct platform_device msm8625_device_gpio = {
968 .name = "msmgpio",
969 .id = -1,
970 .resource = msm8625_gpio_resources,
971 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
972};
973
Trilok Soniee75f6c2012-02-13 20:45:07 +0530974static struct resource msm8625_resources_sdc1[] = {
975 {
976 .start = MSM_SDC1_BASE,
977 .end = MSM_SDC1_BASE + SZ_4K - 1,
978 .flags = IORESOURCE_MEM,
979 },
980 {
981 .start = MSM8625_INT_SDC1_0,
982 .end = MSM8625_INT_SDC1_1,
983 .flags = IORESOURCE_IRQ,
984 },
985 {
986 .name = "sdcc_dma_chnl",
987 .start = DMOV_SDC1_CHAN,
988 .end = DMOV_SDC1_CHAN,
989 .flags = IORESOURCE_DMA,
990 },
991 {
992 .name = "sdcc_dma_crci",
993 .start = DMOV_SDC1_CRCI,
994 .end = DMOV_SDC1_CRCI,
995 .flags = IORESOURCE_DMA,
996 }
997};
998
999static struct resource msm8625_resources_sdc2[] = {
1000 {
1001 .start = MSM_SDC2_BASE,
1002 .end = MSM_SDC2_BASE + SZ_4K - 1,
1003 .flags = IORESOURCE_MEM,
1004 },
1005 {
1006 .start = MSM8625_INT_SDC2_0,
1007 .end = MSM8625_INT_SDC2_1,
1008 .flags = IORESOURCE_IRQ,
1009 },
1010 {
1011 .name = "sdcc_dma_chnl",
1012 .start = DMOV_SDC2_CHAN,
1013 .end = DMOV_SDC2_CHAN,
1014 .flags = IORESOURCE_DMA,
1015 },
1016 {
1017 .name = "sdcc_dma_crci",
1018 .start = DMOV_SDC2_CRCI,
1019 .end = DMOV_SDC2_CRCI,
1020 .flags = IORESOURCE_DMA,
1021 }
1022};
1023
1024static struct resource msm8625_resources_sdc3[] = {
1025 {
1026 .start = MSM_SDC3_BASE,
1027 .end = MSM_SDC3_BASE + SZ_4K - 1,
1028 .flags = IORESOURCE_MEM,
1029 },
1030 {
1031 .start = MSM8625_INT_SDC3_0,
1032 .end = MSM8625_INT_SDC3_1,
1033 .flags = IORESOURCE_IRQ,
1034 },
1035 {
1036 .name = "sdcc_dma_chnl",
1037 .start = DMOV_SDC3_CHAN,
1038 .end = DMOV_SDC3_CHAN,
1039 .flags = IORESOURCE_DMA,
1040 },
1041 {
1042 .name = "sdcc_dma_crci",
1043 .start = DMOV_SDC3_CRCI,
1044 .end = DMOV_SDC3_CRCI,
1045 .flags = IORESOURCE_DMA,
1046 },
1047};
1048
1049static struct resource msm8625_resources_sdc4[] = {
1050 {
1051 .start = MSM_SDC4_BASE,
1052 .end = MSM_SDC4_BASE + SZ_4K - 1,
1053 .flags = IORESOURCE_MEM,
1054 },
1055 {
1056 .start = MSM8625_INT_SDC4_0,
1057 .end = MSM8625_INT_SDC4_1,
1058 .flags = IORESOURCE_IRQ,
1059 },
1060 {
1061 .name = "sdcc_dma_chnl",
1062 .start = DMOV_SDC4_CHAN,
1063 .end = DMOV_SDC4_CHAN,
1064 .flags = IORESOURCE_DMA,
1065 },
1066 {
1067 .name = "sdcc_dma_crci",
1068 .start = DMOV_SDC4_CRCI,
1069 .end = DMOV_SDC4_CRCI,
1070 .flags = IORESOURCE_DMA,
1071 },
1072};
1073
1074struct platform_device msm8625_device_sdc1 = {
1075 .name = "msm_sdcc",
1076 .id = 1,
1077 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1078 .resource = msm8625_resources_sdc1,
1079 .dev = {
1080 .coherent_dma_mask = 0xffffffff,
1081 },
1082};
1083
1084struct platform_device msm8625_device_sdc2 = {
1085 .name = "msm_sdcc",
1086 .id = 2,
1087 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1088 .resource = msm8625_resources_sdc2,
1089 .dev = {
1090 .coherent_dma_mask = 0xffffffff,
1091 },
1092};
1093
1094struct platform_device msm8625_device_sdc3 = {
1095 .name = "msm_sdcc",
1096 .id = 3,
1097 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1098 .resource = msm8625_resources_sdc3,
1099 .dev = {
1100 .coherent_dma_mask = 0xffffffff,
1101 },
1102};
1103
1104struct platform_device msm8625_device_sdc4 = {
1105 .name = "msm_sdcc",
1106 .id = 4,
1107 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1108 .resource = msm8625_resources_sdc4,
1109 .dev = {
1110 .coherent_dma_mask = 0xffffffff,
1111 },
1112};
1113
1114static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1115 &msm8625_device_sdc1,
1116 &msm8625_device_sdc2,
1117 &msm8625_device_sdc3,
1118 &msm8625_device_sdc4,
1119};
1120
1121int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1122{
1123 struct platform_device *pdev;
1124
1125 if (controller < 1 || controller > 4)
1126 return -EINVAL;
1127
1128 if (cpu_is_msm8625())
1129 pdev = msm8625_sdcc_devices[controller-1];
1130 else
1131 pdev = msm_sdcc_devices[controller-1];
1132
1133 pdev->dev.platform_data = plat;
1134 return platform_device_register(pdev);
1135}
1136
Trilok Sonida63a8b2012-02-13 20:50:03 +05301137static struct resource msm8625_resources_hsusb_otg[] = {
1138 {
1139 .start = MSM_HSUSB_PHYS,
1140 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1141 .flags = IORESOURCE_MEM,
1142 },
1143 {
1144 .start = MSM8625_INT_USB_HS,
1145 .end = MSM8625_INT_USB_HS,
1146 .flags = IORESOURCE_IRQ,
1147 },
1148};
1149
1150struct platform_device msm8625_device_otg = {
1151 .name = "msm_otg",
1152 .id = -1,
1153 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1154 .resource = msm8625_resources_hsusb_otg,
1155 .dev = {
1156 .dma_mask = &dma_mask,
1157 .coherent_dma_mask = 0xffffffffULL,
1158 },
1159};
1160
1161static struct resource msm8625_resources_gadget_peripheral[] = {
1162 {
1163 .start = MSM_HSUSB_PHYS,
1164 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1165 .flags = IORESOURCE_MEM,
1166 },
1167 {
1168 .start = MSM8625_INT_USB_HS,
1169 .end = MSM8625_INT_USB_HS,
1170 .flags = IORESOURCE_IRQ,
1171 },
1172};
1173
1174struct platform_device msm8625_device_gadget_peripheral = {
1175 .name = "msm_hsusb",
1176 .id = -1,
1177 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1178 .resource = msm8625_resources_gadget_peripheral,
1179 .dev = {
1180 .dma_mask = &dma_mask,
1181 .coherent_dma_mask = 0xffffffffULL,
1182 },
1183};
1184
1185static struct resource msm8625_resources_hsusb_host[] = {
1186 {
1187 .start = MSM_HSUSB_PHYS,
1188 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1189 .flags = IORESOURCE_MEM,
1190 },
1191 {
1192 .start = MSM8625_INT_USB_HS,
1193 .end = MSM8625_INT_USB_HS,
1194 .flags = IORESOURCE_IRQ,
1195 },
1196};
1197
1198struct platform_device msm8625_device_hsusb_host = {
1199 .name = "msm_hsusb_host",
1200 .id = 0,
1201 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1202 .resource = msm8625_resources_hsusb_host,
1203 .dev = {
1204 .dma_mask = &dma_mask,
1205 .coherent_dma_mask = 0xffffffffULL,
1206 },
1207};
1208
1209static struct platform_device *msm8625_host_devices[] = {
1210 &msm8625_device_hsusb_host,
1211};
1212
1213int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1214{
1215 struct platform_device *pdev;
1216
1217 if (cpu_is_msm8625())
1218 pdev = msm8625_host_devices[host];
1219 else
1220 pdev = msm_host_devices[host];
1221 if (!pdev)
1222 return -ENODEV;
1223 pdev->dev.platform_data = plat;
1224 return platform_device_register(pdev);
1225}
1226
Trilok Soni88da2552012-02-13 21:01:24 +05301227#ifdef CONFIG_MSM_CAMERA_V4L2
1228static struct resource msm8625_csic0_resources[] = {
1229 {
1230 .name = "csic",
1231 .start = 0xA0F00000,
1232 .end = 0xA0F00000 + 0x00100000 - 1,
1233 .flags = IORESOURCE_MEM,
1234 },
1235 {
1236 .name = "csic",
1237 .start = MSM8625_INT_CSI_IRQ_0,
1238 .end = MSM8625_INT_CSI_IRQ_0,
1239 .flags = IORESOURCE_IRQ,
1240 },
1241};
1242
1243static struct resource msm8625_csic1_resources[] = {
1244 {
1245 .name = "csic",
1246 .start = 0xA1000000,
1247 .end = 0xA1000000 + 0x00100000 - 1,
1248 .flags = IORESOURCE_MEM,
1249 },
1250 {
1251 .name = "csic",
1252 .start = MSM8625_INT_CSI_IRQ_1,
1253 .end = MSM8625_INT_CSI_IRQ_1,
1254 .flags = IORESOURCE_IRQ,
1255 },
1256};
1257
1258struct platform_device msm8625_device_csic0 = {
1259 .name = "msm_csic",
1260 .id = 0,
1261 .resource = msm8625_csic0_resources,
1262 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1263};
1264
1265struct platform_device msm8625_device_csic1 = {
1266 .name = "msm_csic",
1267 .id = 1,
1268 .resource = msm8625_csic1_resources,
1269 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1270};
1271#endif
1272
Trilok Soniae4633d2012-02-13 21:08:32 +05301273static struct resource msm8625_mipi_dsi_resources[] = {
1274 {
1275 .name = "mipi_dsi",
1276 .start = MIPI_DSI_HW_BASE,
1277 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1278 .flags = IORESOURCE_MEM,
1279 },
1280 {
1281 .start = MSM8625_INT_DSI_IRQ,
1282 .end = MSM8625_INT_DSI_IRQ,
1283 .flags = IORESOURCE_IRQ,
1284 },
1285};
1286
1287static struct platform_device msm8625_mipi_dsi_device = {
1288 .name = "mipi_dsi",
1289 .id = 1,
1290 .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources),
1291 .resource = msm8625_mipi_dsi_resources,
1292};
1293
1294static struct resource msm8625_mdp_resources[] = {
1295 {
1296 .name = "mdp",
1297 .start = MDP_BASE,
1298 .end = MDP_BASE + 0x000F1008 - 1,
1299 .flags = IORESOURCE_MEM,
1300 },
1301 {
1302 .start = MSM8625_INT_MDP,
1303 .end = MSM8625_INT_MDP,
1304 .flags = IORESOURCE_IRQ,
1305 },
1306};
1307
1308static struct platform_device msm8625_mdp_device = {
1309 .name = "mdp",
1310 .id = 0,
1311 .num_resources = ARRAY_SIZE(msm8625_mdp_resources),
1312 .resource = msm8625_mdp_resources,
1313};
1314
1315void __init msm_fb_register_device(char *name, void *data)
1316{
1317 if (!strncmp(name, "mdp", 3)) {
1318 if (cpu_is_msm8625())
1319 msm_register_device(&msm8625_mdp_device, data);
1320 else
1321 msm_register_device(&msm_mdp_device, data);
1322 } else if (!strncmp(name, "mipi_dsi", 8)) {
1323 if (cpu_is_msm8625())
1324 msm_register_device(&msm8625_mipi_dsi_device, data);
1325 else
1326 msm_register_device(&msm_mipi_dsi_device, data);
1327 } else if (!strncmp(name, "lcdc", 4)) {
1328 msm_register_device(&msm_lcdc_device, data);
1329 } else {
1330 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1331 }
1332}
1333
Trilok Soni664b95d2012-02-13 21:13:15 +05301334static struct resource msm8625_kgsl_3d0_resources[] = {
1335 {
1336 .name = KGSL_3D0_REG_MEMORY,
1337 .start = 0xA0000000,
1338 .end = 0xA001ffff,
1339 .flags = IORESOURCE_MEM,
1340 },
1341 {
1342 .name = KGSL_3D0_IRQ,
1343 .start = MSM8625_INT_GRAPHICS,
1344 .end = MSM8625_INT_GRAPHICS,
1345 .flags = IORESOURCE_IRQ,
1346 },
1347};
1348
1349struct platform_device msm8625_kgsl_3d0 = {
1350 .name = "kgsl-3d0",
1351 .id = 0,
1352 .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources),
1353 .resource = msm8625_kgsl_3d0_resources,
1354 .dev = {
1355 .platform_data = &kgsl_3d0_pdata,
1356 },
1357};
1358
Taniya Das7c9f0512011-12-02 14:26:46 +05301359static struct clk_lookup msm_clock_8625_dummy[] = {
1360 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1361 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1362 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1363 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1364 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1365 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1366 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1367 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1368 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1369 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1370 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1371 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1372 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1373 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1374 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1375 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1376 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1377 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1378 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1379 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1380 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1381 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1382 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1383 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1384 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1385 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1386 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1387 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1388 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1389 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1390 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1391 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1392 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1393 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1394 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1395 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1396 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1397 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1398 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1399 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1400 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1401 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1402 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1403 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1404 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1405 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1406 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1407 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1408 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1409 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1410 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1411 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1412 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1413 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1414 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1415 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1416 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1417 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1418 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1419};
1420
1421struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1422 .table = msm_clock_8625_dummy,
1423 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1424};
1425
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001426int __init msm7x2x_misc_init(void)
1427{
Taniya Das7c9f0512011-12-02 14:26:46 +05301428 if (machine_is_msm8625_rumi3()) {
1429 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301430 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301431 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301432
Stephen Boydbb600ae2011-08-02 20:11:40 -07001433 msm_clock_init(&msm7x27a_clock_init_data);
Matt Wagantallec57f062011-08-16 23:54:46 -07001434 if (cpu_is_msm7x27aa())
1435 acpuclk_init(&acpuclk_7x27aa_soc_data);
1436 else
1437 acpuclk_init(&acpuclk_7x27a_soc_data);
1438
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001439
1440 return 0;
1441}
1442
1443#ifdef CONFIG_CACHE_L2X0
1444static int __init msm7x27x_cache_init(void)
1445{
1446 int aux_ctrl = 0;
1447
1448 /* Way Size 010(0x2) 32KB */
1449 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1450 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1451 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1452
Taniya Das379b5682011-12-02 14:53:46 +05301453 if (cpu_is_msm8625()) {
1454 /* Way Size 011(0x3) 64KB */
1455 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1456 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
1457 (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT);
1458 }
1459
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001460 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
1461
1462 return 0;
1463}
1464#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301465static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001466#endif
1467
1468void __init msm_common_io_init(void)
1469{
1470 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301471 if (socinfo_init() < 0)
1472 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001473 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301474}
1475
1476void __init msm8625_init_irq(void)
1477{
1478 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1479 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301480}
1481
1482void __init msm8625_map_io(void)
1483{
1484 msm_map_msm8625_io();
1485
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001486 if (socinfo_init() < 0)
1487 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301488 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001489}
1490
Taniya Das43bcdd62011-12-02 17:33:27 +05301491static int msm7627a_init_gpio(void)
1492{
Taniya Das6684d622012-01-12 10:29:09 +05301493 if (cpu_is_msm8625())
1494 platform_device_register(&msm8625_device_gpio);
1495 else
1496 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301497 return 0;
1498}
1499postcore_initcall(msm7627a_init_gpio);
1500