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