blob: 281baa2b3d85ed8c95b10ee90da8699fc6c002cb [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 Vankadara20cd3be72012-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 Vankadara20cd3be72012-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
695void __init msm_fb_register_device(char *name, void *data)
696{
697 if (!strncmp(name, "mdp", 3))
698 msm_register_device(&msm_mdp_device, data);
699 else if (!strncmp(name, "mipi_dsi", 8))
700 msm_register_device(&msm_mipi_dsi_device, data);
701 else if (!strncmp(name, "lcdc", 4))
702 msm_register_device(&msm_lcdc_device, data);
703 else
704 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
705}
706
707#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
708#define PDM0_CTL_OFFSET (0x04)
709#define SIZE_8B (0x08)
710
711static struct resource resources_led[] = {
712 {
713 .start = PERPH_WEB_BLOCK_ADDR,
714 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
715 .name = "led-gpio-pdm",
716 .flags = IORESOURCE_MEM,
717 },
718};
719
720static struct led_info msm_kpbl_pdm_led_pdata = {
721 .name = "keyboard-backlight",
722};
723
724struct platform_device led_pdev = {
725 .name = "leds-msm-pdm",
726 /* use pdev id to represent pdm id */
727 .id = 0,
728 .num_resources = ARRAY_SIZE(resources_led),
729 .resource = resources_led,
730 .dev = {
731 .platform_data = &msm_kpbl_pdm_led_pdata,
732 },
733};
734
Manish Dewangan3a260992011-06-24 18:01:34 +0530735struct platform_device asoc_msm_pcm = {
736 .name = "msm-dsp-audio",
737 .id = 0,
738};
739
740struct platform_device asoc_msm_dai0 = {
741 .name = "msm-codec-dai",
742 .id = 0,
743};
744
745struct platform_device asoc_msm_dai1 = {
746 .name = "msm-cpu-dai",
747 .id = 0,
748};
749
Taniya Das2e948192011-12-20 11:15:13 +0530750static struct resource gpio_resources[] = {
751 {
752 .start = INT_GPIO_GROUP1,
753 .flags = IORESOURCE_IRQ,
754 },
755 {
756 .start = INT_GPIO_GROUP2,
757 .flags = IORESOURCE_IRQ,
758 },
759};
760
761static struct platform_device msm_device_gpio = {
762 .name = "msmgpio",
763 .id = -1,
764 .resource = gpio_resources,
765 .num_resources = ARRAY_SIZE(gpio_resources),
766};
767
Taniya Das43bcdd62011-12-02 17:33:27 +0530768struct platform_device *msm_footswitch_devices[] = {
769 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
770};
771unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
772
773/* MSM8625 Devices */
774
775static struct resource msm8625_resources_uart1[] = {
776 {
777 .start = MSM8625_INT_UART1,
778 .end = MSM8625_INT_UART1,
779 .flags = IORESOURCE_IRQ,
780 },
781 {
Taniya Das13b811a2011-12-09 18:33:45 +0530782 .start = MSM7XXX_UART1_PHYS,
783 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530784 .flags = IORESOURCE_MEM,
785 },
786};
787
788struct platform_device msm8625_device_uart1 = {
789 .name = "msm_serial",
790 .id = 0,
791 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
792 .resource = msm8625_resources_uart1,
793};
794
Trilok Soni269fff42012-02-13 20:35:30 +0530795static struct resource msm8625_uart1_dm_resources[] = {
796 {
797 .start = MSM_UART1DM_PHYS,
798 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
799 .flags = IORESOURCE_MEM,
800 },
801 {
802 .start = MSM8625_INT_UART1DM_IRQ,
803 .end = MSM8625_INT_UART1DM_IRQ,
804 .flags = IORESOURCE_IRQ,
805 },
806 {
807 .start = MSM8625_INT_UART1DM_RX,
808 .end = MSM8625_INT_UART1DM_RX,
809 .flags = IORESOURCE_IRQ,
810 },
811 {
812 .start = DMOV_HSUART1_TX_CHAN,
813 .end = DMOV_HSUART1_RX_CHAN,
814 .name = "uartdm_channels",
815 .flags = IORESOURCE_DMA,
816 },
817 {
818 .start = DMOV_HSUART1_TX_CRCI,
819 .end = DMOV_HSUART1_RX_CRCI,
820 .name = "uartdm_crci",
821 .flags = IORESOURCE_DMA,
822 },
823};
824
825struct platform_device msm8625_device_uart_dm1 = {
826 .name = "msm_serial_hs",
827 .id = 0,
828 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
829 .resource = msm8625_uart1_dm_resources,
830 .dev = {
831 .dma_mask = &msm_uart_dm1_dma_mask,
832 .coherent_dma_mask = DMA_BIT_MASK(32),
833 },
834};
835
836static struct resource msm8625_uart2dm_resources[] = {
837 {
838 .start = MSM_UART2DM_PHYS,
839 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
840 .name = "uartdm_resource",
841 .flags = IORESOURCE_MEM,
842 },
843 {
844 .start = MSM8625_INT_UART2DM_IRQ,
845 .end = MSM8625_INT_UART2DM_IRQ,
846 .flags = IORESOURCE_IRQ,
847 },
848};
849
850struct platform_device msm8625_device_uart_dm2 = {
851 .name = "msm_serial_hsl",
852 .id = 0,
853 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
854 .resource = msm8625_uart2dm_resources,
855};
856
Taniya Das43bcdd62011-12-02 17:33:27 +0530857static struct resource msm8625_dmov_resource[] = {
858 {
859 .start = MSM8625_INT_ADM_AARM,
860 .flags = IORESOURCE_IRQ,
861 },
862 {
863 .start = 0xA9700000,
864 .end = 0xA9700000 + SZ_4K - 1,
865 .flags = IORESOURCE_MEM,
866 },
867};
868
869struct platform_device msm8625_device_dmov = {
870 .name = "msm_dmov",
871 .id = -1,
872 .resource = msm8625_dmov_resource,
873 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
874 .dev = {
875 .platform_data = &msm_dmov_pdata,
876 },
877};
Taniya Das2e948192011-12-20 11:15:13 +0530878
Taniya Das9d187142011-12-02 15:53:25 +0530879static struct resource gsbi0_msm8625_qup_resources[] = {
880 {
881 .name = "qup_phys_addr",
882 .start = MSM_GSBI0_QUP_PHYS,
883 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
884 .flags = IORESOURCE_MEM,
885 },
886 {
887 .name = "gsbi_qup_i2c_addr",
888 .start = MSM_GSBI0_PHYS,
889 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
890 .flags = IORESOURCE_MEM,
891 },
892 {
893 .name = "qup_err_intr",
894 .start = MSM8625_INT_PWB_I2C,
895 .end = MSM8625_INT_PWB_I2C,
896 .flags = IORESOURCE_IRQ,
897 },
898};
899
900/* Use GSBI0 QUP for /dev/i2c-0 */
901struct platform_device msm8625_device_qup_i2c_gsbi0 = {
902 .name = "qup_i2c",
903 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
904 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
905 .resource = gsbi0_msm8625_qup_resources,
906};
907
Trilok Soni633e59c2012-02-13 20:28:30 +0530908static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
909 {
910 .name = "qup_phys_addr",
911 .start = MSM_GSBI1_QUP_PHYS,
912 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
913 .flags = IORESOURCE_MEM,
914 },
915 {
916 .name = "gsbi_qup_i2c_addr",
917 .start = MSM_GSBI1_PHYS,
918 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
919 .flags = IORESOURCE_MEM,
920 },
921 {
922 .name = "qup_err_intr",
923 .start = MSM8625_INT_ARM11_DMA,
924 .end = MSM8625_INT_ARM11_DMA,
925 .flags = IORESOURCE_IRQ,
926 },
927};
928
929/* Use GSBI1 QUP for /dev/i2c-1 */
930struct platform_device msm8625_device_qup_i2c_gsbi1 = {
931 .name = "qup_i2c",
932 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
933 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
934 .resource = gsbi1_msm8625_qup_i2c_resources,
935};
936
Taniya Das6684d622012-01-12 10:29:09 +0530937static struct resource msm8625_gpio_resources[] = {
938 {
939 .start = MSM8625_INT_GPIO_GROUP1,
940 .flags = IORESOURCE_IRQ,
941 },
942 {
943 .start = MSM8625_INT_GPIO_GROUP2,
944 .flags = IORESOURCE_IRQ,
945 },
946};
947
948static struct platform_device msm8625_device_gpio = {
949 .name = "msmgpio",
950 .id = -1,
951 .resource = msm8625_gpio_resources,
952 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
953};
954
Trilok Soniee75f6c2012-02-13 20:45:07 +0530955static struct resource msm8625_resources_sdc1[] = {
956 {
957 .start = MSM_SDC1_BASE,
958 .end = MSM_SDC1_BASE + SZ_4K - 1,
959 .flags = IORESOURCE_MEM,
960 },
961 {
962 .start = MSM8625_INT_SDC1_0,
963 .end = MSM8625_INT_SDC1_1,
964 .flags = IORESOURCE_IRQ,
965 },
966 {
967 .name = "sdcc_dma_chnl",
968 .start = DMOV_SDC1_CHAN,
969 .end = DMOV_SDC1_CHAN,
970 .flags = IORESOURCE_DMA,
971 },
972 {
973 .name = "sdcc_dma_crci",
974 .start = DMOV_SDC1_CRCI,
975 .end = DMOV_SDC1_CRCI,
976 .flags = IORESOURCE_DMA,
977 }
978};
979
980static struct resource msm8625_resources_sdc2[] = {
981 {
982 .start = MSM_SDC2_BASE,
983 .end = MSM_SDC2_BASE + SZ_4K - 1,
984 .flags = IORESOURCE_MEM,
985 },
986 {
987 .start = MSM8625_INT_SDC2_0,
988 .end = MSM8625_INT_SDC2_1,
989 .flags = IORESOURCE_IRQ,
990 },
991 {
992 .name = "sdcc_dma_chnl",
993 .start = DMOV_SDC2_CHAN,
994 .end = DMOV_SDC2_CHAN,
995 .flags = IORESOURCE_DMA,
996 },
997 {
998 .name = "sdcc_dma_crci",
999 .start = DMOV_SDC2_CRCI,
1000 .end = DMOV_SDC2_CRCI,
1001 .flags = IORESOURCE_DMA,
1002 }
1003};
1004
1005static struct resource msm8625_resources_sdc3[] = {
1006 {
1007 .start = MSM_SDC3_BASE,
1008 .end = MSM_SDC3_BASE + SZ_4K - 1,
1009 .flags = IORESOURCE_MEM,
1010 },
1011 {
1012 .start = MSM8625_INT_SDC3_0,
1013 .end = MSM8625_INT_SDC3_1,
1014 .flags = IORESOURCE_IRQ,
1015 },
1016 {
1017 .name = "sdcc_dma_chnl",
1018 .start = DMOV_SDC3_CHAN,
1019 .end = DMOV_SDC3_CHAN,
1020 .flags = IORESOURCE_DMA,
1021 },
1022 {
1023 .name = "sdcc_dma_crci",
1024 .start = DMOV_SDC3_CRCI,
1025 .end = DMOV_SDC3_CRCI,
1026 .flags = IORESOURCE_DMA,
1027 },
1028};
1029
1030static struct resource msm8625_resources_sdc4[] = {
1031 {
1032 .start = MSM_SDC4_BASE,
1033 .end = MSM_SDC4_BASE + SZ_4K - 1,
1034 .flags = IORESOURCE_MEM,
1035 },
1036 {
1037 .start = MSM8625_INT_SDC4_0,
1038 .end = MSM8625_INT_SDC4_1,
1039 .flags = IORESOURCE_IRQ,
1040 },
1041 {
1042 .name = "sdcc_dma_chnl",
1043 .start = DMOV_SDC4_CHAN,
1044 .end = DMOV_SDC4_CHAN,
1045 .flags = IORESOURCE_DMA,
1046 },
1047 {
1048 .name = "sdcc_dma_crci",
1049 .start = DMOV_SDC4_CRCI,
1050 .end = DMOV_SDC4_CRCI,
1051 .flags = IORESOURCE_DMA,
1052 },
1053};
1054
1055struct platform_device msm8625_device_sdc1 = {
1056 .name = "msm_sdcc",
1057 .id = 1,
1058 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1059 .resource = msm8625_resources_sdc1,
1060 .dev = {
1061 .coherent_dma_mask = 0xffffffff,
1062 },
1063};
1064
1065struct platform_device msm8625_device_sdc2 = {
1066 .name = "msm_sdcc",
1067 .id = 2,
1068 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1069 .resource = msm8625_resources_sdc2,
1070 .dev = {
1071 .coherent_dma_mask = 0xffffffff,
1072 },
1073};
1074
1075struct platform_device msm8625_device_sdc3 = {
1076 .name = "msm_sdcc",
1077 .id = 3,
1078 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1079 .resource = msm8625_resources_sdc3,
1080 .dev = {
1081 .coherent_dma_mask = 0xffffffff,
1082 },
1083};
1084
1085struct platform_device msm8625_device_sdc4 = {
1086 .name = "msm_sdcc",
1087 .id = 4,
1088 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1089 .resource = msm8625_resources_sdc4,
1090 .dev = {
1091 .coherent_dma_mask = 0xffffffff,
1092 },
1093};
1094
1095static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1096 &msm8625_device_sdc1,
1097 &msm8625_device_sdc2,
1098 &msm8625_device_sdc3,
1099 &msm8625_device_sdc4,
1100};
1101
1102int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1103{
1104 struct platform_device *pdev;
1105
1106 if (controller < 1 || controller > 4)
1107 return -EINVAL;
1108
1109 if (cpu_is_msm8625())
1110 pdev = msm8625_sdcc_devices[controller-1];
1111 else
1112 pdev = msm_sdcc_devices[controller-1];
1113
1114 pdev->dev.platform_data = plat;
1115 return platform_device_register(pdev);
1116}
1117
Trilok Sonida63a8b2012-02-13 20:50:03 +05301118static struct resource msm8625_resources_hsusb_otg[] = {
1119 {
1120 .start = MSM_HSUSB_PHYS,
1121 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1122 .flags = IORESOURCE_MEM,
1123 },
1124 {
1125 .start = MSM8625_INT_USB_HS,
1126 .end = MSM8625_INT_USB_HS,
1127 .flags = IORESOURCE_IRQ,
1128 },
1129};
1130
1131struct platform_device msm8625_device_otg = {
1132 .name = "msm_otg",
1133 .id = -1,
1134 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1135 .resource = msm8625_resources_hsusb_otg,
1136 .dev = {
1137 .dma_mask = &dma_mask,
1138 .coherent_dma_mask = 0xffffffffULL,
1139 },
1140};
1141
1142static struct resource msm8625_resources_gadget_peripheral[] = {
1143 {
1144 .start = MSM_HSUSB_PHYS,
1145 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1146 .flags = IORESOURCE_MEM,
1147 },
1148 {
1149 .start = MSM8625_INT_USB_HS,
1150 .end = MSM8625_INT_USB_HS,
1151 .flags = IORESOURCE_IRQ,
1152 },
1153};
1154
1155struct platform_device msm8625_device_gadget_peripheral = {
1156 .name = "msm_hsusb",
1157 .id = -1,
1158 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1159 .resource = msm8625_resources_gadget_peripheral,
1160 .dev = {
1161 .dma_mask = &dma_mask,
1162 .coherent_dma_mask = 0xffffffffULL,
1163 },
1164};
1165
1166static struct resource msm8625_resources_hsusb_host[] = {
1167 {
1168 .start = MSM_HSUSB_PHYS,
1169 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1170 .flags = IORESOURCE_MEM,
1171 },
1172 {
1173 .start = MSM8625_INT_USB_HS,
1174 .end = MSM8625_INT_USB_HS,
1175 .flags = IORESOURCE_IRQ,
1176 },
1177};
1178
1179struct platform_device msm8625_device_hsusb_host = {
1180 .name = "msm_hsusb_host",
1181 .id = 0,
1182 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1183 .resource = msm8625_resources_hsusb_host,
1184 .dev = {
1185 .dma_mask = &dma_mask,
1186 .coherent_dma_mask = 0xffffffffULL,
1187 },
1188};
1189
1190static struct platform_device *msm8625_host_devices[] = {
1191 &msm8625_device_hsusb_host,
1192};
1193
1194int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1195{
1196 struct platform_device *pdev;
1197
1198 if (cpu_is_msm8625())
1199 pdev = msm8625_host_devices[host];
1200 else
1201 pdev = msm_host_devices[host];
1202 if (!pdev)
1203 return -ENODEV;
1204 pdev->dev.platform_data = plat;
1205 return platform_device_register(pdev);
1206}
1207
Trilok Soni88da2552012-02-13 21:01:24 +05301208#ifdef CONFIG_MSM_CAMERA_V4L2
1209static struct resource msm8625_csic0_resources[] = {
1210 {
1211 .name = "csic",
1212 .start = 0xA0F00000,
1213 .end = 0xA0F00000 + 0x00100000 - 1,
1214 .flags = IORESOURCE_MEM,
1215 },
1216 {
1217 .name = "csic",
1218 .start = MSM8625_INT_CSI_IRQ_0,
1219 .end = MSM8625_INT_CSI_IRQ_0,
1220 .flags = IORESOURCE_IRQ,
1221 },
1222};
1223
1224static struct resource msm8625_csic1_resources[] = {
1225 {
1226 .name = "csic",
1227 .start = 0xA1000000,
1228 .end = 0xA1000000 + 0x00100000 - 1,
1229 .flags = IORESOURCE_MEM,
1230 },
1231 {
1232 .name = "csic",
1233 .start = MSM8625_INT_CSI_IRQ_1,
1234 .end = MSM8625_INT_CSI_IRQ_1,
1235 .flags = IORESOURCE_IRQ,
1236 },
1237};
1238
1239struct platform_device msm8625_device_csic0 = {
1240 .name = "msm_csic",
1241 .id = 0,
1242 .resource = msm8625_csic0_resources,
1243 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1244};
1245
1246struct platform_device msm8625_device_csic1 = {
1247 .name = "msm_csic",
1248 .id = 1,
1249 .resource = msm8625_csic1_resources,
1250 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1251};
1252#endif
1253
Taniya Das7c9f0512011-12-02 14:26:46 +05301254static struct clk_lookup msm_clock_8625_dummy[] = {
1255 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1256 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1257 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1258 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1259 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1260 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1261 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1262 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1263 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1264 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1265 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1266 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1267 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1268 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1269 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1270 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1271 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1272 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1273 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1274 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1275 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1276 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1277 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1278 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1279 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1280 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1281 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1282 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1283 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1284 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1285 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1286 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1287 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1288 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1289 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1290 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1291 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1292 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1293 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1294 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1295 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1296 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1297 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1298 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1299 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1300 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1301 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1302 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1303 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1304 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1305 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1306 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1307 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1308 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1309 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1310 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1311 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1312 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1313 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1314};
1315
1316struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1317 .table = msm_clock_8625_dummy,
1318 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1319};
1320
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001321int __init msm7x2x_misc_init(void)
1322{
Taniya Das7c9f0512011-12-02 14:26:46 +05301323 if (machine_is_msm8625_rumi3()) {
1324 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301325 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301326 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301327
Stephen Boydbb600ae2011-08-02 20:11:40 -07001328 msm_clock_init(&msm7x27a_clock_init_data);
Matt Wagantallec57f062011-08-16 23:54:46 -07001329 if (cpu_is_msm7x27aa())
1330 acpuclk_init(&acpuclk_7x27aa_soc_data);
1331 else
1332 acpuclk_init(&acpuclk_7x27a_soc_data);
1333
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001334
1335 return 0;
1336}
1337
1338#ifdef CONFIG_CACHE_L2X0
1339static int __init msm7x27x_cache_init(void)
1340{
1341 int aux_ctrl = 0;
1342
1343 /* Way Size 010(0x2) 32KB */
1344 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1345 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1346 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1347
Taniya Das379b5682011-12-02 14:53:46 +05301348 if (cpu_is_msm8625()) {
1349 /* Way Size 011(0x3) 64KB */
1350 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1351 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
1352 (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT);
1353 }
1354
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001355 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
1356
1357 return 0;
1358}
1359#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301360static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001361#endif
1362
1363void __init msm_common_io_init(void)
1364{
1365 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301366 if (socinfo_init() < 0)
1367 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001368 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301369}
1370
1371void __init msm8625_init_irq(void)
1372{
1373 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1374 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301375}
1376
1377void __init msm8625_map_io(void)
1378{
1379 msm_map_msm8625_io();
1380
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001381 if (socinfo_init() < 0)
1382 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301383 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001384}
1385
Taniya Das43bcdd62011-12-02 17:33:27 +05301386static int msm7627a_init_gpio(void)
1387{
Taniya Das6684d622012-01-12 10:29:09 +05301388 if (cpu_is_msm8625())
1389 platform_device_register(&msm8625_device_gpio);
1390 else
1391 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301392 return 0;
1393}
1394postcore_initcall(msm7627a_init_gpio);
1395