blob: 043ec0e2afa4709663469f5614c9bd86d037f331 [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
181int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
182{
183 struct platform_device *pdev;
184
185 pdev = msm_host_devices[host];
186 if (!pdev)
187 return -ENODEV;
188 pdev->dev.platform_data = plat;
189 return platform_device_register(pdev);
190}
191
192static struct resource msm_dmov_resource[] = {
193 {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700194 .start = INT_ADM_AARM,
195 .flags = IORESOURCE_IRQ,
196 },
197 {
198 .start = 0xA9700000,
199 .end = 0xA9700000 + SZ_4K - 1,
200 .flags = IORESOURCE_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700201 },
202};
203
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700204static struct msm_dmov_pdata msm_dmov_pdata = {
205 .sd = 3,
206 .sd_size = 0x400,
207};
208
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700209struct platform_device msm_device_dmov = {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700210 .name = "msm_dmov",
211 .id = -1,
212 .resource = msm_dmov_resource,
213 .num_resources = ARRAY_SIZE(msm_dmov_resource),
214 .dev = {
215 .platform_data = &msm_dmov_pdata,
216 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217};
218
219struct platform_device msm_device_smd = {
220 .name = "msm_smd",
221 .id = -1,
222};
223
224static struct resource resources_uart1[] = {
225 {
226 .start = INT_UART1,
227 .end = INT_UART1,
228 .flags = IORESOURCE_IRQ,
229 },
230 {
Taniya Das13b811a2011-12-09 18:33:45 +0530231 .start = MSM7XXX_UART1_PHYS,
232 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700233 .flags = IORESOURCE_MEM,
234 },
235};
236
237struct platform_device msm_device_uart1 = {
238 .name = "msm_serial",
239 .id = 0,
240 .num_resources = ARRAY_SIZE(resources_uart1),
241 .resource = resources_uart1,
242};
243
244#define MSM_UART1DM_PHYS 0xA0200000
245static struct resource msm_uart1_dm_resources[] = {
246 {
247 .start = MSM_UART1DM_PHYS,
248 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
249 .flags = IORESOURCE_MEM,
250 },
251 {
252 .start = INT_UART1DM_IRQ,
253 .end = INT_UART1DM_IRQ,
254 .flags = IORESOURCE_IRQ,
255 },
256 {
257 .start = INT_UART1DM_RX,
258 .end = INT_UART1DM_RX,
259 .flags = IORESOURCE_IRQ,
260 },
261 {
262 .start = DMOV_HSUART1_TX_CHAN,
263 .end = DMOV_HSUART1_RX_CHAN,
264 .name = "uartdm_channels",
265 .flags = IORESOURCE_DMA,
266 },
267 {
268 .start = DMOV_HSUART1_TX_CRCI,
269 .end = DMOV_HSUART1_RX_CRCI,
270 .name = "uartdm_crci",
271 .flags = IORESOURCE_DMA,
272 },
273};
274
275static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
276struct platform_device msm_device_uart_dm1 = {
277 .name = "msm_serial_hs",
278 .id = 0,
279 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
280 .resource = msm_uart1_dm_resources,
281 .dev = {
282 .dma_mask = &msm_uart_dm1_dma_mask,
283 .coherent_dma_mask = DMA_BIT_MASK(32),
284 },
285};
286
287#define MSM_UART2DM_PHYS 0xA0300000
288static struct resource msm_uart2dm_resources[] = {
289 {
290 .start = MSM_UART2DM_PHYS,
291 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
292 .name = "uartdm_resource",
293 .flags = IORESOURCE_MEM,
294 },
295 {
296 .start = INT_UART2DM_IRQ,
297 .end = INT_UART2DM_IRQ,
298 .flags = IORESOURCE_IRQ,
299 },
300};
301
302struct platform_device msm_device_uart_dm2 = {
303 .name = "msm_serial_hsl",
304 .id = 0,
305 .num_resources = ARRAY_SIZE(msm_uart2dm_resources),
306 .resource = msm_uart2dm_resources,
307};
308
309#define MSM_NAND_PHYS 0xA0A00000
310#define MSM_NANDC01_PHYS 0xA0A40000
311#define MSM_NANDC10_PHYS 0xA0A80000
312#define MSM_NANDC11_PHYS 0xA0AC0000
313#define EBI2_REG_BASE 0xA0D00000
314static struct resource resources_nand[] = {
315 [0] = {
316 .name = "msm_nand_dmac",
317 .start = DMOV_NAND_CHAN,
318 .end = DMOV_NAND_CHAN,
319 .flags = IORESOURCE_DMA,
320 },
321 [1] = {
322 .name = "msm_nand_phys",
323 .start = MSM_NAND_PHYS,
324 .end = MSM_NAND_PHYS + 0x7FF,
325 .flags = IORESOURCE_MEM,
326 },
327 [2] = {
328 .name = "msm_nandc01_phys",
329 .start = MSM_NANDC01_PHYS,
330 .end = MSM_NANDC01_PHYS + 0x7FF,
331 .flags = IORESOURCE_MEM,
332 },
333 [3] = {
334 .name = "msm_nandc10_phys",
335 .start = MSM_NANDC10_PHYS,
336 .end = MSM_NANDC10_PHYS + 0x7FF,
337 .flags = IORESOURCE_MEM,
338 },
339 [4] = {
340 .name = "msm_nandc11_phys",
341 .start = MSM_NANDC11_PHYS,
342 .end = MSM_NANDC11_PHYS + 0x7FF,
343 .flags = IORESOURCE_MEM,
344 },
345 [5] = {
346 .name = "ebi2_reg_base",
347 .start = EBI2_REG_BASE,
348 .end = EBI2_REG_BASE + 0x60,
349 .flags = IORESOURCE_MEM,
350 },
351};
352
353struct flash_platform_data msm_nand_data;
354
355struct platform_device msm_device_nand = {
356 .name = "msm_nand",
357 .id = -1,
358 .num_resources = ARRAY_SIZE(resources_nand),
359 .resource = resources_nand,
360 .dev = {
361 .platform_data = &msm_nand_data,
362 },
363};
364
365#define MSM_SDC1_BASE 0xA0400000
366#define MSM_SDC2_BASE 0xA0500000
367#define MSM_SDC3_BASE 0xA0600000
368#define MSM_SDC4_BASE 0xA0700000
369static struct resource resources_sdc1[] = {
370 {
371 .start = MSM_SDC1_BASE,
372 .end = MSM_SDC1_BASE + SZ_4K - 1,
373 .flags = IORESOURCE_MEM,
374 },
375 {
376 .start = INT_SDC1_0,
377 .end = INT_SDC1_1,
378 .flags = IORESOURCE_IRQ,
379 },
380 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700381 .name = "sdcc_dma_chnl",
382 .start = DMOV_SDC1_CHAN,
383 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700384 .flags = IORESOURCE_DMA,
385 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700386 {
387 .name = "sdcc_dma_crci",
388 .start = DMOV_SDC1_CRCI,
389 .end = DMOV_SDC1_CRCI,
390 .flags = IORESOURCE_DMA,
391 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700392};
393
394static struct resource resources_sdc2[] = {
395 {
396 .start = MSM_SDC2_BASE,
397 .end = MSM_SDC2_BASE + SZ_4K - 1,
398 .flags = IORESOURCE_MEM,
399 },
400 {
401 .start = INT_SDC2_0,
402 .end = INT_SDC2_1,
403 .flags = IORESOURCE_IRQ,
404 },
405 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700406 .name = "sdcc_dma_chnl",
407 .start = DMOV_SDC2_CHAN,
408 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700409 .flags = IORESOURCE_DMA,
410 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700411 {
412 .name = "sdcc_dma_crci",
413 .start = DMOV_SDC2_CRCI,
414 .end = DMOV_SDC2_CRCI,
415 .flags = IORESOURCE_DMA,
416 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700417};
418
419static struct resource resources_sdc3[] = {
420 {
421 .start = MSM_SDC3_BASE,
422 .end = MSM_SDC3_BASE + SZ_4K - 1,
423 .flags = IORESOURCE_MEM,
424 },
425 {
426 .start = INT_SDC3_0,
427 .end = INT_SDC3_1,
428 .flags = IORESOURCE_IRQ,
429 },
430 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700431 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530432 .start = DMOV_SDC3_CHAN,
433 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700434 .flags = IORESOURCE_DMA,
435 },
436 {
437 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530438 .start = DMOV_SDC3_CRCI,
439 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700440 .flags = IORESOURCE_DMA,
441 },
442};
443
444static struct resource resources_sdc4[] = {
445 {
446 .start = MSM_SDC4_BASE,
447 .end = MSM_SDC4_BASE + SZ_4K - 1,
448 .flags = IORESOURCE_MEM,
449 },
450 {
451 .start = INT_SDC4_0,
452 .end = INT_SDC4_1,
453 .flags = IORESOURCE_IRQ,
454 },
455 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700456 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530457 .start = DMOV_SDC4_CHAN,
458 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700459 .flags = IORESOURCE_DMA,
460 },
461 {
462 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530463 .start = DMOV_SDC4_CRCI,
464 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700465 .flags = IORESOURCE_DMA,
466 },
467};
468
469struct platform_device msm_device_sdc1 = {
470 .name = "msm_sdcc",
471 .id = 1,
472 .num_resources = ARRAY_SIZE(resources_sdc1),
473 .resource = resources_sdc1,
474 .dev = {
475 .coherent_dma_mask = 0xffffffff,
476 },
477};
478
479struct platform_device msm_device_sdc2 = {
480 .name = "msm_sdcc",
481 .id = 2,
482 .num_resources = ARRAY_SIZE(resources_sdc2),
483 .resource = resources_sdc2,
484 .dev = {
485 .coherent_dma_mask = 0xffffffff,
486 },
487};
488
489struct platform_device msm_device_sdc3 = {
490 .name = "msm_sdcc",
491 .id = 3,
492 .num_resources = ARRAY_SIZE(resources_sdc3),
493 .resource = resources_sdc3,
494 .dev = {
495 .coherent_dma_mask = 0xffffffff,
496 },
497};
498
499struct platform_device msm_device_sdc4 = {
500 .name = "msm_sdcc",
501 .id = 4,
502 .num_resources = ARRAY_SIZE(resources_sdc4),
503 .resource = resources_sdc4,
504 .dev = {
505 .coherent_dma_mask = 0xffffffff,
506 },
507};
508
509static struct platform_device *msm_sdcc_devices[] __initdata = {
510 &msm_device_sdc1,
511 &msm_device_sdc2,
512 &msm_device_sdc3,
513 &msm_device_sdc4,
514};
515
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530516#ifdef CONFIG_MSM_CAMERA_V4L2
517static struct resource msm_csic0_resources[] = {
518 {
519 .name = "csic",
520 .start = 0xA0F00000,
521 .end = 0xA0F00000 + 0x00100000 - 1,
522 .flags = IORESOURCE_MEM,
523 },
524 {
525 .name = "csic",
526 .start = INT_CSI_IRQ_0,
527 .end = INT_CSI_IRQ_0,
528 .flags = IORESOURCE_IRQ,
529 },
530};
531
532static struct resource msm_csic1_resources[] = {
533 {
534 .name = "csic",
535 .start = 0xA1000000,
536 .end = 0xA1000000 + 0x00100000 - 1,
537 .flags = IORESOURCE_MEM,
538 },
539 {
540 .name = "csic",
541 .start = INT_CSI_IRQ_1,
542 .end = INT_CSI_IRQ_1,
543 .flags = IORESOURCE_IRQ,
544 },
545};
546
547struct platform_device msm7x27a_device_csic0 = {
548 .name = "msm_csic",
549 .id = 0,
550 .resource = msm_csic0_resources,
551 .num_resources = ARRAY_SIZE(msm_csic0_resources),
552};
553
554struct platform_device msm7x27a_device_csic1 = {
555 .name = "msm_csic",
556 .id = 1,
557 .resource = msm_csic1_resources,
558 .num_resources = ARRAY_SIZE(msm_csic1_resources),
559};
560
561static struct resource msm_clkctl_resources[] = {
562 {
563 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530564 .start = MSM7XXX_CLK_CTL_PHYS,
565 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530566 .flags = IORESOURCE_MEM,
567 },
568};
569struct platform_device msm7x27a_device_clkctl = {
570 .name = "msm_clk_ctl",
571 .id = 0,
572 .resource = msm_clkctl_resources,
573 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
574};
575
576struct platform_device msm7x27a_device_vfe = {
577 .name = "msm_vfe",
578 .id = 0,
579};
580
581#endif
582
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700583#define MDP_BASE 0xAA200000
584#define MIPI_DSI_HW_BASE 0xA1100000
585
586static struct resource msm_mipi_dsi_resources[] = {
587 {
588 .name = "mipi_dsi",
589 .start = MIPI_DSI_HW_BASE,
590 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
591 .flags = IORESOURCE_MEM,
592 },
593 {
594 .start = INT_DSI_IRQ,
595 .end = INT_DSI_IRQ,
596 .flags = IORESOURCE_IRQ,
597 },
598};
599
600static struct platform_device msm_mipi_dsi_device = {
601 .name = "mipi_dsi",
602 .id = 1,
603 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
604 .resource = msm_mipi_dsi_resources,
605};
606
607static struct resource msm_mdp_resources[] = {
608 {
609 .name = "mdp",
610 .start = MDP_BASE,
611 .end = MDP_BASE + 0x000F1008 - 1,
612 .flags = IORESOURCE_MEM,
613 },
614 {
615 .start = INT_MDP,
616 .end = INT_MDP,
617 .flags = IORESOURCE_IRQ,
618 },
619};
620
621static struct platform_device msm_mdp_device = {
622 .name = "mdp",
623 .id = 0,
624 .num_resources = ARRAY_SIZE(msm_mdp_resources),
625 .resource = msm_mdp_resources,
626};
627
628static struct platform_device msm_lcdc_device = {
629 .name = "lcdc",
630 .id = 0,
631};
632
633static struct resource kgsl_3d0_resources[] = {
634 {
635 .name = KGSL_3D0_REG_MEMORY,
636 .start = 0xA0000000,
637 .end = 0xA001ffff,
638 .flags = IORESOURCE_MEM,
639 },
640 {
641 .name = KGSL_3D0_IRQ,
642 .start = INT_GRAPHICS,
643 .end = INT_GRAPHICS,
644 .flags = IORESOURCE_IRQ,
645 },
646};
647
648static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600649 .pwrlevel = {
650 {
651 .gpu_freq = 245760000,
652 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700653 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600654 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530655 .gpu_freq = 192000000,
656 .bus_freq = 160000000,
657 },
658 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600659 .gpu_freq = 133330000,
660 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700661 },
662 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600663 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530664 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600665 .set_grp_async = set_grp_xbar_async,
666 .idle_timeout = HZ/5,
667 .nap_allowed = false,
668 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700669};
670
671struct platform_device msm_kgsl_3d0 = {
672 .name = "kgsl-3d0",
673 .id = 0,
674 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
675 .resource = kgsl_3d0_resources,
676 .dev = {
677 .platform_data = &kgsl_3d0_pdata,
678 },
679};
680
681void __init msm7x25a_kgsl_3d0_init(void)
682{
683 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530684 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600685 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
686 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
687 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
688 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700689 }
690}
691
692static void __init msm_register_device(struct platform_device *pdev, void *data)
693{
694 int ret;
695
696 pdev->dev.platform_data = data;
697
698 ret = platform_device_register(pdev);
699
700 if (ret)
701 dev_err(&pdev->dev,
702 "%s: platform_device_register() failed = %d\n",
703 __func__, ret);
704}
705
706void __init msm_fb_register_device(char *name, void *data)
707{
708 if (!strncmp(name, "mdp", 3))
709 msm_register_device(&msm_mdp_device, data);
710 else if (!strncmp(name, "mipi_dsi", 8))
711 msm_register_device(&msm_mipi_dsi_device, data);
712 else if (!strncmp(name, "lcdc", 4))
713 msm_register_device(&msm_lcdc_device, data);
714 else
715 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
716}
717
718#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
719#define PDM0_CTL_OFFSET (0x04)
720#define SIZE_8B (0x08)
721
722static struct resource resources_led[] = {
723 {
724 .start = PERPH_WEB_BLOCK_ADDR,
725 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
726 .name = "led-gpio-pdm",
727 .flags = IORESOURCE_MEM,
728 },
729};
730
731static struct led_info msm_kpbl_pdm_led_pdata = {
732 .name = "keyboard-backlight",
733};
734
735struct platform_device led_pdev = {
736 .name = "leds-msm-pdm",
737 /* use pdev id to represent pdm id */
738 .id = 0,
739 .num_resources = ARRAY_SIZE(resources_led),
740 .resource = resources_led,
741 .dev = {
742 .platform_data = &msm_kpbl_pdm_led_pdata,
743 },
744};
745
Manish Dewangan3a260992011-06-24 18:01:34 +0530746struct platform_device asoc_msm_pcm = {
747 .name = "msm-dsp-audio",
748 .id = 0,
749};
750
751struct platform_device asoc_msm_dai0 = {
752 .name = "msm-codec-dai",
753 .id = 0,
754};
755
756struct platform_device asoc_msm_dai1 = {
757 .name = "msm-cpu-dai",
758 .id = 0,
759};
760
Taniya Das2e948192011-12-20 11:15:13 +0530761static struct resource gpio_resources[] = {
762 {
763 .start = INT_GPIO_GROUP1,
764 .flags = IORESOURCE_IRQ,
765 },
766 {
767 .start = INT_GPIO_GROUP2,
768 .flags = IORESOURCE_IRQ,
769 },
770};
771
772static struct platform_device msm_device_gpio = {
773 .name = "msmgpio",
774 .id = -1,
775 .resource = gpio_resources,
776 .num_resources = ARRAY_SIZE(gpio_resources),
777};
778
Taniya Das43bcdd62011-12-02 17:33:27 +0530779struct platform_device *msm_footswitch_devices[] = {
780 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
781};
782unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
783
784/* MSM8625 Devices */
785
786static struct resource msm8625_resources_uart1[] = {
787 {
788 .start = MSM8625_INT_UART1,
789 .end = MSM8625_INT_UART1,
790 .flags = IORESOURCE_IRQ,
791 },
792 {
Taniya Das13b811a2011-12-09 18:33:45 +0530793 .start = MSM7XXX_UART1_PHYS,
794 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530795 .flags = IORESOURCE_MEM,
796 },
797};
798
799struct platform_device msm8625_device_uart1 = {
800 .name = "msm_serial",
801 .id = 0,
802 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
803 .resource = msm8625_resources_uart1,
804};
805
Trilok Soni269fff42012-02-13 20:35:30 +0530806static struct resource msm8625_uart1_dm_resources[] = {
807 {
808 .start = MSM_UART1DM_PHYS,
809 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
810 .flags = IORESOURCE_MEM,
811 },
812 {
813 .start = MSM8625_INT_UART1DM_IRQ,
814 .end = MSM8625_INT_UART1DM_IRQ,
815 .flags = IORESOURCE_IRQ,
816 },
817 {
818 .start = MSM8625_INT_UART1DM_RX,
819 .end = MSM8625_INT_UART1DM_RX,
820 .flags = IORESOURCE_IRQ,
821 },
822 {
823 .start = DMOV_HSUART1_TX_CHAN,
824 .end = DMOV_HSUART1_RX_CHAN,
825 .name = "uartdm_channels",
826 .flags = IORESOURCE_DMA,
827 },
828 {
829 .start = DMOV_HSUART1_TX_CRCI,
830 .end = DMOV_HSUART1_RX_CRCI,
831 .name = "uartdm_crci",
832 .flags = IORESOURCE_DMA,
833 },
834};
835
836struct platform_device msm8625_device_uart_dm1 = {
837 .name = "msm_serial_hs",
838 .id = 0,
839 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
840 .resource = msm8625_uart1_dm_resources,
841 .dev = {
842 .dma_mask = &msm_uart_dm1_dma_mask,
843 .coherent_dma_mask = DMA_BIT_MASK(32),
844 },
845};
846
847static struct resource msm8625_uart2dm_resources[] = {
848 {
849 .start = MSM_UART2DM_PHYS,
850 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
851 .name = "uartdm_resource",
852 .flags = IORESOURCE_MEM,
853 },
854 {
855 .start = MSM8625_INT_UART2DM_IRQ,
856 .end = MSM8625_INT_UART2DM_IRQ,
857 .flags = IORESOURCE_IRQ,
858 },
859};
860
861struct platform_device msm8625_device_uart_dm2 = {
862 .name = "msm_serial_hsl",
863 .id = 0,
864 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
865 .resource = msm8625_uart2dm_resources,
866};
867
Taniya Das43bcdd62011-12-02 17:33:27 +0530868static struct resource msm8625_dmov_resource[] = {
869 {
870 .start = MSM8625_INT_ADM_AARM,
871 .flags = IORESOURCE_IRQ,
872 },
873 {
874 .start = 0xA9700000,
875 .end = 0xA9700000 + SZ_4K - 1,
876 .flags = IORESOURCE_MEM,
877 },
878};
879
880struct platform_device msm8625_device_dmov = {
881 .name = "msm_dmov",
882 .id = -1,
883 .resource = msm8625_dmov_resource,
884 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
885 .dev = {
886 .platform_data = &msm_dmov_pdata,
887 },
888};
Taniya Das2e948192011-12-20 11:15:13 +0530889
Taniya Das9d187142011-12-02 15:53:25 +0530890static struct resource gsbi0_msm8625_qup_resources[] = {
891 {
892 .name = "qup_phys_addr",
893 .start = MSM_GSBI0_QUP_PHYS,
894 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
895 .flags = IORESOURCE_MEM,
896 },
897 {
898 .name = "gsbi_qup_i2c_addr",
899 .start = MSM_GSBI0_PHYS,
900 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
901 .flags = IORESOURCE_MEM,
902 },
903 {
904 .name = "qup_err_intr",
905 .start = MSM8625_INT_PWB_I2C,
906 .end = MSM8625_INT_PWB_I2C,
907 .flags = IORESOURCE_IRQ,
908 },
909};
910
911/* Use GSBI0 QUP for /dev/i2c-0 */
912struct platform_device msm8625_device_qup_i2c_gsbi0 = {
913 .name = "qup_i2c",
914 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
915 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
916 .resource = gsbi0_msm8625_qup_resources,
917};
918
Trilok Soni633e59c2012-02-13 20:28:30 +0530919static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
920 {
921 .name = "qup_phys_addr",
922 .start = MSM_GSBI1_QUP_PHYS,
923 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
924 .flags = IORESOURCE_MEM,
925 },
926 {
927 .name = "gsbi_qup_i2c_addr",
928 .start = MSM_GSBI1_PHYS,
929 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
930 .flags = IORESOURCE_MEM,
931 },
932 {
933 .name = "qup_err_intr",
934 .start = MSM8625_INT_ARM11_DMA,
935 .end = MSM8625_INT_ARM11_DMA,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940/* Use GSBI1 QUP for /dev/i2c-1 */
941struct platform_device msm8625_device_qup_i2c_gsbi1 = {
942 .name = "qup_i2c",
943 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
944 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
945 .resource = gsbi1_msm8625_qup_i2c_resources,
946};
947
Taniya Das6684d622012-01-12 10:29:09 +0530948static struct resource msm8625_gpio_resources[] = {
949 {
950 .start = MSM8625_INT_GPIO_GROUP1,
951 .flags = IORESOURCE_IRQ,
952 },
953 {
954 .start = MSM8625_INT_GPIO_GROUP2,
955 .flags = IORESOURCE_IRQ,
956 },
957};
958
959static struct platform_device msm8625_device_gpio = {
960 .name = "msmgpio",
961 .id = -1,
962 .resource = msm8625_gpio_resources,
963 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
964};
965
Trilok Soniee75f6c2012-02-13 20:45:07 +0530966static struct resource msm8625_resources_sdc1[] = {
967 {
968 .start = MSM_SDC1_BASE,
969 .end = MSM_SDC1_BASE + SZ_4K - 1,
970 .flags = IORESOURCE_MEM,
971 },
972 {
973 .start = MSM8625_INT_SDC1_0,
974 .end = MSM8625_INT_SDC1_1,
975 .flags = IORESOURCE_IRQ,
976 },
977 {
978 .name = "sdcc_dma_chnl",
979 .start = DMOV_SDC1_CHAN,
980 .end = DMOV_SDC1_CHAN,
981 .flags = IORESOURCE_DMA,
982 },
983 {
984 .name = "sdcc_dma_crci",
985 .start = DMOV_SDC1_CRCI,
986 .end = DMOV_SDC1_CRCI,
987 .flags = IORESOURCE_DMA,
988 }
989};
990
991static struct resource msm8625_resources_sdc2[] = {
992 {
993 .start = MSM_SDC2_BASE,
994 .end = MSM_SDC2_BASE + SZ_4K - 1,
995 .flags = IORESOURCE_MEM,
996 },
997 {
998 .start = MSM8625_INT_SDC2_0,
999 .end = MSM8625_INT_SDC2_1,
1000 .flags = IORESOURCE_IRQ,
1001 },
1002 {
1003 .name = "sdcc_dma_chnl",
1004 .start = DMOV_SDC2_CHAN,
1005 .end = DMOV_SDC2_CHAN,
1006 .flags = IORESOURCE_DMA,
1007 },
1008 {
1009 .name = "sdcc_dma_crci",
1010 .start = DMOV_SDC2_CRCI,
1011 .end = DMOV_SDC2_CRCI,
1012 .flags = IORESOURCE_DMA,
1013 }
1014};
1015
1016static struct resource msm8625_resources_sdc3[] = {
1017 {
1018 .start = MSM_SDC3_BASE,
1019 .end = MSM_SDC3_BASE + SZ_4K - 1,
1020 .flags = IORESOURCE_MEM,
1021 },
1022 {
1023 .start = MSM8625_INT_SDC3_0,
1024 .end = MSM8625_INT_SDC3_1,
1025 .flags = IORESOURCE_IRQ,
1026 },
1027 {
1028 .name = "sdcc_dma_chnl",
1029 .start = DMOV_SDC3_CHAN,
1030 .end = DMOV_SDC3_CHAN,
1031 .flags = IORESOURCE_DMA,
1032 },
1033 {
1034 .name = "sdcc_dma_crci",
1035 .start = DMOV_SDC3_CRCI,
1036 .end = DMOV_SDC3_CRCI,
1037 .flags = IORESOURCE_DMA,
1038 },
1039};
1040
1041static struct resource msm8625_resources_sdc4[] = {
1042 {
1043 .start = MSM_SDC4_BASE,
1044 .end = MSM_SDC4_BASE + SZ_4K - 1,
1045 .flags = IORESOURCE_MEM,
1046 },
1047 {
1048 .start = MSM8625_INT_SDC4_0,
1049 .end = MSM8625_INT_SDC4_1,
1050 .flags = IORESOURCE_IRQ,
1051 },
1052 {
1053 .name = "sdcc_dma_chnl",
1054 .start = DMOV_SDC4_CHAN,
1055 .end = DMOV_SDC4_CHAN,
1056 .flags = IORESOURCE_DMA,
1057 },
1058 {
1059 .name = "sdcc_dma_crci",
1060 .start = DMOV_SDC4_CRCI,
1061 .end = DMOV_SDC4_CRCI,
1062 .flags = IORESOURCE_DMA,
1063 },
1064};
1065
1066struct platform_device msm8625_device_sdc1 = {
1067 .name = "msm_sdcc",
1068 .id = 1,
1069 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1070 .resource = msm8625_resources_sdc1,
1071 .dev = {
1072 .coherent_dma_mask = 0xffffffff,
1073 },
1074};
1075
1076struct platform_device msm8625_device_sdc2 = {
1077 .name = "msm_sdcc",
1078 .id = 2,
1079 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1080 .resource = msm8625_resources_sdc2,
1081 .dev = {
1082 .coherent_dma_mask = 0xffffffff,
1083 },
1084};
1085
1086struct platform_device msm8625_device_sdc3 = {
1087 .name = "msm_sdcc",
1088 .id = 3,
1089 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1090 .resource = msm8625_resources_sdc3,
1091 .dev = {
1092 .coherent_dma_mask = 0xffffffff,
1093 },
1094};
1095
1096struct platform_device msm8625_device_sdc4 = {
1097 .name = "msm_sdcc",
1098 .id = 4,
1099 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1100 .resource = msm8625_resources_sdc4,
1101 .dev = {
1102 .coherent_dma_mask = 0xffffffff,
1103 },
1104};
1105
1106static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1107 &msm8625_device_sdc1,
1108 &msm8625_device_sdc2,
1109 &msm8625_device_sdc3,
1110 &msm8625_device_sdc4,
1111};
1112
1113int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1114{
1115 struct platform_device *pdev;
1116
1117 if (controller < 1 || controller > 4)
1118 return -EINVAL;
1119
1120 if (cpu_is_msm8625())
1121 pdev = msm8625_sdcc_devices[controller-1];
1122 else
1123 pdev = msm_sdcc_devices[controller-1];
1124
1125 pdev->dev.platform_data = plat;
1126 return platform_device_register(pdev);
1127}
1128
Taniya Das7c9f0512011-12-02 14:26:46 +05301129static struct clk_lookup msm_clock_8625_dummy[] = {
1130 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1131 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1132 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1133 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1134 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1135 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1136 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1137 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1138 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1139 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1140 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1141 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1142 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1143 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1144 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1145 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1146 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1147 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1148 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1149 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1150 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1151 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1152 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1153 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1154 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1155 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1156 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1157 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1158 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1159 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1160 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1161 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1162 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1163 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1164 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1165 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1166 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1167 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1168 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1169 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1170 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1171 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1172 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1173 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1174 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1175 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1176 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1177 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1178 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1179 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1180 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1181 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1182 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1183 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1184 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1185 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1186 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1187 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1188 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1189};
1190
1191struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1192 .table = msm_clock_8625_dummy,
1193 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1194};
1195
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001196int __init msm7x2x_misc_init(void)
1197{
Taniya Das7c9f0512011-12-02 14:26:46 +05301198 if (machine_is_msm8625_rumi3()) {
1199 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301200 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301201 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301202
Stephen Boydbb600ae2011-08-02 20:11:40 -07001203 msm_clock_init(&msm7x27a_clock_init_data);
Matt Wagantallec57f062011-08-16 23:54:46 -07001204 if (cpu_is_msm7x27aa())
1205 acpuclk_init(&acpuclk_7x27aa_soc_data);
1206 else
1207 acpuclk_init(&acpuclk_7x27a_soc_data);
1208
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001209
1210 return 0;
1211}
1212
1213#ifdef CONFIG_CACHE_L2X0
1214static int __init msm7x27x_cache_init(void)
1215{
1216 int aux_ctrl = 0;
1217
1218 /* Way Size 010(0x2) 32KB */
1219 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1220 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1221 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1222
Taniya Das379b5682011-12-02 14:53:46 +05301223 if (cpu_is_msm8625()) {
1224 /* Way Size 011(0x3) 64KB */
1225 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1226 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
1227 (0x1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT);
1228 }
1229
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001230 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
1231
1232 return 0;
1233}
1234#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301235static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001236#endif
1237
1238void __init msm_common_io_init(void)
1239{
1240 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301241 if (socinfo_init() < 0)
1242 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001243 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301244}
1245
1246void __init msm8625_init_irq(void)
1247{
1248 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1249 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301250}
1251
1252void __init msm8625_map_io(void)
1253{
1254 msm_map_msm8625_io();
1255
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001256 if (socinfo_init() < 0)
1257 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301258 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001259}
1260
Taniya Das43bcdd62011-12-02 17:33:27 +05301261static int msm7627a_init_gpio(void)
1262{
Taniya Das6684d622012-01-12 10:29:09 +05301263 if (cpu_is_msm8625())
1264 platform_device_register(&msm8625_device_gpio);
1265 else
1266 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301267 return 0;
1268}
1269postcore_initcall(msm7627a_init_gpio);
1270