blob: 4654606e6b0f18e9871d5f58da3a5be58b9a4bde [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>
Taniya Das9d0c3c52012-05-04 14:40:55 +053020#include <linux/notifier.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021#include <mach/irqs.h>
22#include <mach/msm_iomap.h>
23#include <mach/board.h>
24#include <mach/dma.h>
25#include <mach/dal_axi.h>
26#include <asm/mach/flash.h>
Taniya Das43bcdd62011-12-02 17:33:27 +053027#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028#include <asm/hardware/cache-l2x0.h>
29#include <asm/mach/mmc.h>
Taniya Das9d0c3c52012-05-04 14:40:55 +053030#include <asm/cacheflush.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031#include <mach/rpc_hsusb.h>
32#include <mach/socinfo.h>
33
34#include "devices.h"
35#include "devices-msm7x2xa.h"
36#include "footswitch.h"
Matt Wagantall6d9ebee2011-08-26 12:15:24 -070037#include "acpuclock.h"
Murali Nalajala41786ab2012-03-06 10:47:32 +053038#include "spm.h"
Taniya Dasfcb35002012-03-09 15:28:12 +053039#include "mpm-8625.h"
Murali Nalajala2a0bbda2012-03-28 12:12:54 +053040#include "irq.h"
41#include "pm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070042
43/* Address of GSBI blocks */
44#define MSM_GSBI0_PHYS 0xA1200000
45#define MSM_GSBI1_PHYS 0xA1300000
46
47/* GSBI QUPe devices */
48#define MSM_GSBI0_QUP_PHYS (MSM_GSBI0_PHYS + 0x80000)
49#define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000)
50
51static struct resource gsbi0_qup_i2c_resources[] = {
52 {
53 .name = "qup_phys_addr",
54 .start = MSM_GSBI0_QUP_PHYS,
55 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
56 .flags = IORESOURCE_MEM,
57 },
58 {
59 .name = "gsbi_qup_i2c_addr",
60 .start = MSM_GSBI0_PHYS,
61 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .name = "qup_err_intr",
66 .start = INT_PWB_I2C,
67 .end = INT_PWB_I2C,
68 .flags = IORESOURCE_IRQ,
69 },
70};
71
72/* Use GSBI0 QUP for /dev/i2c-0 */
73struct platform_device msm_gsbi0_qup_i2c_device = {
74 .name = "qup_i2c",
75 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
76 .num_resources = ARRAY_SIZE(gsbi0_qup_i2c_resources),
77 .resource = gsbi0_qup_i2c_resources,
78};
79
80static struct resource gsbi1_qup_i2c_resources[] = {
81 {
82 .name = "qup_phys_addr",
83 .start = MSM_GSBI1_QUP_PHYS,
84 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
85 .flags = IORESOURCE_MEM,
86 },
87 {
88 .name = "gsbi_qup_i2c_addr",
89 .start = MSM_GSBI1_PHYS,
90 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
91 .flags = IORESOURCE_MEM,
92 },
93 {
94 .name = "qup_err_intr",
95 .start = INT_ARM11_DMA,
96 .end = INT_ARM11_DMA,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101/* Use GSBI1 QUP for /dev/i2c-1 */
102struct platform_device msm_gsbi1_qup_i2c_device = {
103 .name = "qup_i2c",
104 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
105 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
106 .resource = gsbi1_qup_i2c_resources,
107};
108
109#define MSM_HSUSB_PHYS 0xA0800000
110static struct resource resources_hsusb_otg[] = {
111 {
112 .start = MSM_HSUSB_PHYS,
113 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
114 .flags = IORESOURCE_MEM,
115 },
116 {
117 .start = INT_USB_HS,
118 .end = INT_USB_HS,
119 .flags = IORESOURCE_IRQ,
120 },
121};
122
123static u64 dma_mask = 0xffffffffULL;
124struct platform_device msm_device_otg = {
125 .name = "msm_otg",
126 .id = -1,
127 .num_resources = ARRAY_SIZE(resources_hsusb_otg),
128 .resource = resources_hsusb_otg,
129 .dev = {
130 .dma_mask = &dma_mask,
131 .coherent_dma_mask = 0xffffffffULL,
132 },
133};
134
135static struct resource resources_gadget_peripheral[] = {
136 {
137 .start = MSM_HSUSB_PHYS,
138 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
139 .flags = IORESOURCE_MEM,
140 },
141 {
142 .start = INT_USB_HS,
143 .end = INT_USB_HS,
144 .flags = IORESOURCE_IRQ,
145 },
146};
147
148struct platform_device msm_device_gadget_peripheral = {
149 .name = "msm_hsusb",
150 .id = -1,
151 .num_resources = ARRAY_SIZE(resources_gadget_peripheral),
152 .resource = resources_gadget_peripheral,
153 .dev = {
154 .dma_mask = &dma_mask,
155 .coherent_dma_mask = 0xffffffffULL,
156 },
157};
158
159static struct resource resources_hsusb_host[] = {
160 {
161 .start = MSM_HSUSB_PHYS,
162 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
163 .flags = IORESOURCE_MEM,
164 },
165 {
166 .start = INT_USB_HS,
167 .end = INT_USB_HS,
168 .flags = IORESOURCE_IRQ,
169 },
170};
171
172struct platform_device msm_device_hsusb_host = {
173 .name = "msm_hsusb_host",
174 .id = 0,
175 .num_resources = ARRAY_SIZE(resources_hsusb_host),
176 .resource = resources_hsusb_host,
177 .dev = {
178 .dma_mask = &dma_mask,
179 .coherent_dma_mask = 0xffffffffULL,
180 },
181};
182
183static struct platform_device *msm_host_devices[] = {
184 &msm_device_hsusb_host,
185};
186
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700187static struct resource msm_dmov_resource[] = {
188 {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700189 .start = INT_ADM_AARM,
190 .flags = IORESOURCE_IRQ,
191 },
192 {
193 .start = 0xA9700000,
194 .end = 0xA9700000 + SZ_4K - 1,
195 .flags = IORESOURCE_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700196 },
197};
198
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700199static struct msm_dmov_pdata msm_dmov_pdata = {
200 .sd = 3,
201 .sd_size = 0x400,
202};
203
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700204struct platform_device msm_device_dmov = {
Jeff Ohlstein905f1ce2011-09-07 18:50:18 -0700205 .name = "msm_dmov",
206 .id = -1,
207 .resource = msm_dmov_resource,
208 .num_resources = ARRAY_SIZE(msm_dmov_resource),
209 .dev = {
210 .platform_data = &msm_dmov_pdata,
211 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700212};
213
214struct platform_device msm_device_smd = {
215 .name = "msm_smd",
216 .id = -1,
217};
218
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530219static struct resource smd_8625_resource[] = {
220 {
221 .name = "a9_m2a_0",
222 .start = MSM8625_INT_A9_M2A_0,
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .name = "a9_m2a_5",
227 .start = MSM8625_INT_A9_M2A_5,
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct smd_subsystem_config smd_8625_config_list[] = {
233 {
234 .irq_config_id = SMD_MODEM,
235 .subsys_name = "modem",
236 .edge = SMD_APPS_MODEM,
237
238 .smd_int.irq_name = "a9_m2a_0",
239 .smd_int.flags = IRQF_TRIGGER_RISING,
240 .smd_int.irq_id = -1,
241 .smd_int.device_name = "smd_dev",
242 .smd_int.dev_id = 0,
243
244 .smd_int.out_bit_pos = 1,
245 .smd_int.out_base = (void __iomem *)MSM_CSR_BASE,
246 .smd_int.out_offset = 0x400 + (0) * 4,
247
248 .smsm_int.irq_name = "a9_m2a_5",
249 .smsm_int.flags = IRQF_TRIGGER_RISING,
250 .smsm_int.irq_id = -1,
251 .smsm_int.device_name = "smsm_dev",
252 .smsm_int.dev_id = 0,
253
254 .smsm_int.out_bit_pos = 1,
255 .smsm_int.out_base = (void __iomem *)MSM_CSR_BASE,
256 .smsm_int.out_offset = 0x400 + (5) * 4,
257
258 }
259};
260
261static struct smd_platform smd_8625_platform_data = {
262 .num_ss_configs = ARRAY_SIZE(smd_8625_config_list),
263 .smd_ss_configs = smd_8625_config_list,
264};
265
266struct platform_device msm8625_device_smd = {
267 .name = "msm_smd",
268 .id = -1,
269 .resource = smd_8625_resource,
270 .num_resources = ARRAY_SIZE(smd_8625_resource),
271 .dev = {
272 .platform_data = &smd_8625_platform_data,
273 }
274};
275
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530276static struct resource resources_adsp[] = {
277 {
278 .start = INT_ADSP_A9_A11,
279 .end = INT_ADSP_A9_A11,
280 .flags = IORESOURCE_IRQ,
281 },
282};
283
284struct platform_device msm_adsp_device = {
285 .name = "msm_adsp",
286 .id = -1,
287 .num_resources = ARRAY_SIZE(resources_adsp),
288 .resource = resources_adsp,
289};
290
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700291static struct resource resources_uart1[] = {
292 {
293 .start = INT_UART1,
294 .end = INT_UART1,
295 .flags = IORESOURCE_IRQ,
296 },
297 {
Taniya Das13b811a2011-12-09 18:33:45 +0530298 .start = MSM7XXX_UART1_PHYS,
299 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700300 .flags = IORESOURCE_MEM,
301 },
302};
303
304struct platform_device msm_device_uart1 = {
305 .name = "msm_serial",
306 .id = 0,
307 .num_resources = ARRAY_SIZE(resources_uart1),
308 .resource = resources_uart1,
309};
310
311#define MSM_UART1DM_PHYS 0xA0200000
312static struct resource msm_uart1_dm_resources[] = {
313 {
314 .start = MSM_UART1DM_PHYS,
315 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
316 .flags = IORESOURCE_MEM,
317 },
318 {
319 .start = INT_UART1DM_IRQ,
320 .end = INT_UART1DM_IRQ,
321 .flags = IORESOURCE_IRQ,
322 },
323 {
324 .start = INT_UART1DM_RX,
325 .end = INT_UART1DM_RX,
326 .flags = IORESOURCE_IRQ,
327 },
328 {
329 .start = DMOV_HSUART1_TX_CHAN,
330 .end = DMOV_HSUART1_RX_CHAN,
331 .name = "uartdm_channels",
332 .flags = IORESOURCE_DMA,
333 },
334 {
335 .start = DMOV_HSUART1_TX_CRCI,
336 .end = DMOV_HSUART1_RX_CRCI,
337 .name = "uartdm_crci",
338 .flags = IORESOURCE_DMA,
339 },
340};
341
342static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
343struct platform_device msm_device_uart_dm1 = {
344 .name = "msm_serial_hs",
345 .id = 0,
346 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
347 .resource = msm_uart1_dm_resources,
348 .dev = {
349 .dma_mask = &msm_uart_dm1_dma_mask,
350 .coherent_dma_mask = DMA_BIT_MASK(32),
351 },
352};
353
354#define MSM_UART2DM_PHYS 0xA0300000
355static struct resource msm_uart2dm_resources[] = {
356 {
357 .start = MSM_UART2DM_PHYS,
358 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
359 .name = "uartdm_resource",
360 .flags = IORESOURCE_MEM,
361 },
362 {
363 .start = INT_UART2DM_IRQ,
364 .end = INT_UART2DM_IRQ,
365 .flags = IORESOURCE_IRQ,
366 },
367};
368
369struct platform_device msm_device_uart_dm2 = {
370 .name = "msm_serial_hsl",
371 .id = 0,
372 .num_resources = ARRAY_SIZE(msm_uart2dm_resources),
373 .resource = msm_uart2dm_resources,
374};
375
376#define MSM_NAND_PHYS 0xA0A00000
377#define MSM_NANDC01_PHYS 0xA0A40000
378#define MSM_NANDC10_PHYS 0xA0A80000
379#define MSM_NANDC11_PHYS 0xA0AC0000
380#define EBI2_REG_BASE 0xA0D00000
381static struct resource resources_nand[] = {
382 [0] = {
383 .name = "msm_nand_dmac",
384 .start = DMOV_NAND_CHAN,
385 .end = DMOV_NAND_CHAN,
386 .flags = IORESOURCE_DMA,
387 },
388 [1] = {
389 .name = "msm_nand_phys",
390 .start = MSM_NAND_PHYS,
391 .end = MSM_NAND_PHYS + 0x7FF,
392 .flags = IORESOURCE_MEM,
393 },
394 [2] = {
395 .name = "msm_nandc01_phys",
396 .start = MSM_NANDC01_PHYS,
397 .end = MSM_NANDC01_PHYS + 0x7FF,
398 .flags = IORESOURCE_MEM,
399 },
400 [3] = {
401 .name = "msm_nandc10_phys",
402 .start = MSM_NANDC10_PHYS,
403 .end = MSM_NANDC10_PHYS + 0x7FF,
404 .flags = IORESOURCE_MEM,
405 },
406 [4] = {
407 .name = "msm_nandc11_phys",
408 .start = MSM_NANDC11_PHYS,
409 .end = MSM_NANDC11_PHYS + 0x7FF,
410 .flags = IORESOURCE_MEM,
411 },
412 [5] = {
413 .name = "ebi2_reg_base",
414 .start = EBI2_REG_BASE,
415 .end = EBI2_REG_BASE + 0x60,
416 .flags = IORESOURCE_MEM,
417 },
418};
419
Sujit Reddy Thummaec9b3252012-04-23 15:53:45 +0530420struct flash_platform_data msm_nand_data = {
421 .version = VERSION_2,
422};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700423
424struct platform_device msm_device_nand = {
425 .name = "msm_nand",
426 .id = -1,
427 .num_resources = ARRAY_SIZE(resources_nand),
428 .resource = resources_nand,
429 .dev = {
430 .platform_data = &msm_nand_data,
431 },
432};
433
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530434static struct msm_pm_irq_calls msm7x27a_pm_irq_calls = {
435 .irq_pending = msm_irq_pending,
436 .idle_sleep_allowed = msm_irq_idle_sleep_allowed,
437 .enter_sleep1 = msm_irq_enter_sleep1,
438 .enter_sleep2 = msm_irq_enter_sleep2,
439 .exit_sleep1 = msm_irq_exit_sleep1,
440 .exit_sleep2 = msm_irq_exit_sleep2,
441 .exit_sleep3 = msm_irq_exit_sleep3,
442};
443
444static struct msm_pm_irq_calls msm8625_pm_irq_calls = {
445 .irq_pending = msm_gic_spi_ppi_pending,
446 .idle_sleep_allowed = msm_gic_irq_idle_sleep_allowed,
447 .enter_sleep1 = msm_gic_irq_enter_sleep1,
448 .enter_sleep2 = msm_gic_irq_enter_sleep2,
449 .exit_sleep1 = msm_gic_irq_exit_sleep1,
450 .exit_sleep2 = msm_gic_irq_exit_sleep2,
451 .exit_sleep3 = msm_gic_irq_exit_sleep3,
452};
453
Stephen Boyd986c9632012-04-24 16:31:45 -0700454void __init msm_pm_register_irqs(void)
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530455{
456 if (cpu_is_msm8625())
457 msm_pm_set_irq_extns(&msm8625_pm_irq_calls);
458 else
459 msm_pm_set_irq_extns(&msm7x27a_pm_irq_calls);
460
461}
462
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700463#define MSM_SDC1_BASE 0xA0400000
464#define MSM_SDC2_BASE 0xA0500000
465#define MSM_SDC3_BASE 0xA0600000
466#define MSM_SDC4_BASE 0xA0700000
467static struct resource resources_sdc1[] = {
468 {
469 .start = MSM_SDC1_BASE,
470 .end = MSM_SDC1_BASE + SZ_4K - 1,
471 .flags = IORESOURCE_MEM,
472 },
473 {
474 .start = INT_SDC1_0,
475 .end = INT_SDC1_1,
476 .flags = IORESOURCE_IRQ,
477 },
478 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700479 .name = "sdcc_dma_chnl",
480 .start = DMOV_SDC1_CHAN,
481 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700482 .flags = IORESOURCE_DMA,
483 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700484 {
485 .name = "sdcc_dma_crci",
486 .start = DMOV_SDC1_CRCI,
487 .end = DMOV_SDC1_CRCI,
488 .flags = IORESOURCE_DMA,
489 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700490};
491
492static struct resource resources_sdc2[] = {
493 {
494 .start = MSM_SDC2_BASE,
495 .end = MSM_SDC2_BASE + SZ_4K - 1,
496 .flags = IORESOURCE_MEM,
497 },
498 {
499 .start = INT_SDC2_0,
500 .end = INT_SDC2_1,
501 .flags = IORESOURCE_IRQ,
502 },
503 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700504 .name = "sdcc_dma_chnl",
505 .start = DMOV_SDC2_CHAN,
506 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700507 .flags = IORESOURCE_DMA,
508 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700509 {
510 .name = "sdcc_dma_crci",
511 .start = DMOV_SDC2_CRCI,
512 .end = DMOV_SDC2_CRCI,
513 .flags = IORESOURCE_DMA,
514 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700515};
516
517static struct resource resources_sdc3[] = {
518 {
519 .start = MSM_SDC3_BASE,
520 .end = MSM_SDC3_BASE + SZ_4K - 1,
521 .flags = IORESOURCE_MEM,
522 },
523 {
524 .start = INT_SDC3_0,
525 .end = INT_SDC3_1,
526 .flags = IORESOURCE_IRQ,
527 },
528 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700529 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530530 .start = DMOV_SDC3_CHAN,
531 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700532 .flags = IORESOURCE_DMA,
533 },
534 {
535 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530536 .start = DMOV_SDC3_CRCI,
537 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700538 .flags = IORESOURCE_DMA,
539 },
540};
541
542static struct resource resources_sdc4[] = {
543 {
544 .start = MSM_SDC4_BASE,
545 .end = MSM_SDC4_BASE + SZ_4K - 1,
546 .flags = IORESOURCE_MEM,
547 },
548 {
549 .start = INT_SDC4_0,
550 .end = INT_SDC4_1,
551 .flags = IORESOURCE_IRQ,
552 },
553 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700554 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530555 .start = DMOV_SDC4_CHAN,
556 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700557 .flags = IORESOURCE_DMA,
558 },
559 {
560 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530561 .start = DMOV_SDC4_CRCI,
562 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700563 .flags = IORESOURCE_DMA,
564 },
565};
566
567struct platform_device msm_device_sdc1 = {
568 .name = "msm_sdcc",
569 .id = 1,
570 .num_resources = ARRAY_SIZE(resources_sdc1),
571 .resource = resources_sdc1,
572 .dev = {
573 .coherent_dma_mask = 0xffffffff,
574 },
575};
576
577struct platform_device msm_device_sdc2 = {
578 .name = "msm_sdcc",
579 .id = 2,
580 .num_resources = ARRAY_SIZE(resources_sdc2),
581 .resource = resources_sdc2,
582 .dev = {
583 .coherent_dma_mask = 0xffffffff,
584 },
585};
586
587struct platform_device msm_device_sdc3 = {
588 .name = "msm_sdcc",
589 .id = 3,
590 .num_resources = ARRAY_SIZE(resources_sdc3),
591 .resource = resources_sdc3,
592 .dev = {
593 .coherent_dma_mask = 0xffffffff,
594 },
595};
596
597struct platform_device msm_device_sdc4 = {
598 .name = "msm_sdcc",
599 .id = 4,
600 .num_resources = ARRAY_SIZE(resources_sdc4),
601 .resource = resources_sdc4,
602 .dev = {
603 .coherent_dma_mask = 0xffffffff,
604 },
605};
606
607static struct platform_device *msm_sdcc_devices[] __initdata = {
608 &msm_device_sdc1,
609 &msm_device_sdc2,
610 &msm_device_sdc3,
611 &msm_device_sdc4,
612};
613
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530614#ifdef CONFIG_MSM_CAMERA_V4L2
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530615static int apps_reset;
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530616static struct resource msm_csic0_resources[] = {
617 {
618 .name = "csic",
619 .start = 0xA0F00000,
620 .end = 0xA0F00000 + 0x00100000 - 1,
621 .flags = IORESOURCE_MEM,
622 },
623 {
624 .name = "csic",
625 .start = INT_CSI_IRQ_0,
626 .end = INT_CSI_IRQ_0,
627 .flags = IORESOURCE_IRQ,
628 },
629};
630
631static struct resource msm_csic1_resources[] = {
632 {
633 .name = "csic",
634 .start = 0xA1000000,
635 .end = 0xA1000000 + 0x00100000 - 1,
636 .flags = IORESOURCE_MEM,
637 },
638 {
639 .name = "csic",
640 .start = INT_CSI_IRQ_1,
641 .end = INT_CSI_IRQ_1,
642 .flags = IORESOURCE_IRQ,
643 },
644};
645
646struct platform_device msm7x27a_device_csic0 = {
647 .name = "msm_csic",
648 .id = 0,
649 .resource = msm_csic0_resources,
650 .num_resources = ARRAY_SIZE(msm_csic0_resources),
651};
652
653struct platform_device msm7x27a_device_csic1 = {
654 .name = "msm_csic",
655 .id = 1,
656 .resource = msm_csic1_resources,
657 .num_resources = ARRAY_SIZE(msm_csic1_resources),
658};
659
660static struct resource msm_clkctl_resources[] = {
661 {
662 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530663 .start = MSM7XXX_CLK_CTL_PHYS,
664 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530665 .flags = IORESOURCE_MEM,
666 },
667};
668struct platform_device msm7x27a_device_clkctl = {
669 .name = "msm_clk_ctl",
670 .id = 0,
671 .resource = msm_clkctl_resources,
672 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530673 .dev = {
674 .platform_data = &apps_reset,
675 },
Suresh Vankadara20cd3be2012-01-18 00:34:06 +0530676};
677
678struct platform_device msm7x27a_device_vfe = {
679 .name = "msm_vfe",
680 .id = 0,
681};
682
683#endif
684
Murali Nalajala41786ab2012-03-06 10:47:32 +0530685/* Command sequence for simple WFI */
686static uint8_t spm_wfi_cmd_sequence[] __initdata = {
Murali Nalajala2250a272012-03-13 15:56:59 +0530687 0x04, 0x03, 0x04, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530688};
689
690/* Command sequence for GDFS, this won't send any interrupt to the modem */
691static uint8_t spm_pc_without_modem[] __initdata = {
692 0x20, 0x00, 0x30, 0x10,
Murali Nalajala2250a272012-03-13 15:56:59 +0530693 0x03, 0x1e, 0x0e, 0x3e,
694 0x4e, 0x4e, 0x4e, 0x4e,
695 0x4e, 0x4e, 0x4e, 0x4e,
696 0x4e, 0x4e, 0x4e, 0x4e,
697 0x4e, 0x4e, 0x4e, 0x4e,
698 0x2E, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530699};
700
701static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
702 [0] = {
703 .mode = MSM_SPM_MODE_CLOCK_GATING,
704 .notify_rpm = false,
705 .cmd = spm_wfi_cmd_sequence,
706 },
707 [1] = {
708 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
709 .notify_rpm = false,
710 .cmd = spm_pc_without_modem,
711 },
712};
713
714static struct msm_spm_platform_data msm_spm_data[] __initdata = {
715 [0] = {
716 .reg_base_addr = MSM_SAW0_BASE,
717 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
718 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
719 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
720 .modes = msm_spm_seq_list,
721 },
722 [1] = {
723 .reg_base_addr = MSM_SAW1_BASE,
724 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
725 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
726 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
727 .modes = msm_spm_seq_list,
728 },
729};
730
731void __init msm8x25_spm_device_init(void)
732{
733 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
734}
735
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700736#define MDP_BASE 0xAA200000
737#define MIPI_DSI_HW_BASE 0xA1100000
738
739static struct resource msm_mipi_dsi_resources[] = {
740 {
741 .name = "mipi_dsi",
742 .start = MIPI_DSI_HW_BASE,
743 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
744 .flags = IORESOURCE_MEM,
745 },
746 {
747 .start = INT_DSI_IRQ,
748 .end = INT_DSI_IRQ,
749 .flags = IORESOURCE_IRQ,
750 },
751};
752
753static struct platform_device msm_mipi_dsi_device = {
754 .name = "mipi_dsi",
755 .id = 1,
756 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
757 .resource = msm_mipi_dsi_resources,
758};
759
760static struct resource msm_mdp_resources[] = {
761 {
762 .name = "mdp",
763 .start = MDP_BASE,
764 .end = MDP_BASE + 0x000F1008 - 1,
765 .flags = IORESOURCE_MEM,
766 },
767 {
768 .start = INT_MDP,
769 .end = INT_MDP,
770 .flags = IORESOURCE_IRQ,
771 },
772};
773
774static struct platform_device msm_mdp_device = {
775 .name = "mdp",
776 .id = 0,
777 .num_resources = ARRAY_SIZE(msm_mdp_resources),
778 .resource = msm_mdp_resources,
779};
780
781static struct platform_device msm_lcdc_device = {
782 .name = "lcdc",
783 .id = 0,
784};
785
786static struct resource kgsl_3d0_resources[] = {
787 {
788 .name = KGSL_3D0_REG_MEMORY,
789 .start = 0xA0000000,
790 .end = 0xA001ffff,
791 .flags = IORESOURCE_MEM,
792 },
793 {
794 .name = KGSL_3D0_IRQ,
795 .start = INT_GRAPHICS,
796 .end = INT_GRAPHICS,
797 .flags = IORESOURCE_IRQ,
798 },
799};
800
801static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600802 .pwrlevel = {
803 {
804 .gpu_freq = 245760000,
805 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700806 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600807 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530808 .gpu_freq = 192000000,
809 .bus_freq = 160000000,
810 },
811 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600812 .gpu_freq = 133330000,
813 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700814 },
815 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600816 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530817 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600818 .set_grp_async = set_grp_xbar_async,
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700819 .idle_timeout = HZ,
Lynus Vazfe4bede2012-04-06 11:53:30 -0700820 .strtstp_sleepwake = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600821 .nap_allowed = false,
822 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700823};
824
825struct platform_device msm_kgsl_3d0 = {
826 .name = "kgsl-3d0",
827 .id = 0,
828 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
829 .resource = kgsl_3d0_resources,
830 .dev = {
831 .platform_data = &kgsl_3d0_pdata,
832 },
833};
834
835void __init msm7x25a_kgsl_3d0_init(void)
836{
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530837 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa() || cpu_is_msm7x25ab()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530838 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600839 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
840 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
841 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
842 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Rajesh Kemisettidf6e62f2012-03-12 14:02:30 +0530843 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700844}
845
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700846void __init msm8x25_kgsl_3d0_init(void)
847{
Lynus Vazfe4bede2012-04-06 11:53:30 -0700848 if (cpu_is_msm8625()) {
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700849 kgsl_3d0_pdata.idle_timeout = HZ/5;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700850 kgsl_3d0_pdata.strtstp_sleepwake = false;
Ranjhith Kalisamy24696322012-04-11 22:09:17 +0530851 /* 8x25 supports a higher GPU frequency */
852 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 300000000;
853 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 200000000;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700854 }
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700855}
856
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700857static void __init msm_register_device(struct platform_device *pdev, void *data)
858{
859 int ret;
860
861 pdev->dev.platform_data = data;
862
863 ret = platform_device_register(pdev);
864
865 if (ret)
866 dev_err(&pdev->dev,
867 "%s: platform_device_register() failed = %d\n",
868 __func__, ret);
869}
870
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700871
872#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
873#define PDM0_CTL_OFFSET (0x04)
874#define SIZE_8B (0x08)
875
876static struct resource resources_led[] = {
877 {
878 .start = PERPH_WEB_BLOCK_ADDR,
879 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
880 .name = "led-gpio-pdm",
881 .flags = IORESOURCE_MEM,
882 },
883};
884
885static struct led_info msm_kpbl_pdm_led_pdata = {
886 .name = "keyboard-backlight",
887};
888
889struct platform_device led_pdev = {
890 .name = "leds-msm-pdm",
891 /* use pdev id to represent pdm id */
892 .id = 0,
893 .num_resources = ARRAY_SIZE(resources_led),
894 .resource = resources_led,
895 .dev = {
896 .platform_data = &msm_kpbl_pdm_led_pdata,
897 },
898};
899
Manish Dewangan3a260992011-06-24 18:01:34 +0530900struct platform_device asoc_msm_pcm = {
901 .name = "msm-dsp-audio",
902 .id = 0,
903};
904
905struct platform_device asoc_msm_dai0 = {
906 .name = "msm-codec-dai",
907 .id = 0,
908};
909
910struct platform_device asoc_msm_dai1 = {
911 .name = "msm-cpu-dai",
912 .id = 0,
913};
914
Taniya Das2e948192011-12-20 11:15:13 +0530915static struct resource gpio_resources[] = {
916 {
917 .start = INT_GPIO_GROUP1,
918 .flags = IORESOURCE_IRQ,
919 },
920 {
921 .start = INT_GPIO_GROUP2,
922 .flags = IORESOURCE_IRQ,
923 },
924};
925
926static struct platform_device msm_device_gpio = {
927 .name = "msmgpio",
928 .id = -1,
929 .resource = gpio_resources,
930 .num_resources = ARRAY_SIZE(gpio_resources),
931};
932
Taniya Das43bcdd62011-12-02 17:33:27 +0530933struct platform_device *msm_footswitch_devices[] = {
Matt Wagantalld6fbf232012-05-03 20:09:28 -0700934 FS_PCOM(FS_GFX3D, "vdd", "kgsl-3d0.0"),
Taniya Das43bcdd62011-12-02 17:33:27 +0530935};
936unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
937
938/* MSM8625 Devices */
939
940static struct resource msm8625_resources_uart1[] = {
941 {
942 .start = MSM8625_INT_UART1,
943 .end = MSM8625_INT_UART1,
944 .flags = IORESOURCE_IRQ,
945 },
946 {
Taniya Das13b811a2011-12-09 18:33:45 +0530947 .start = MSM7XXX_UART1_PHYS,
948 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530949 .flags = IORESOURCE_MEM,
950 },
951};
952
953struct platform_device msm8625_device_uart1 = {
954 .name = "msm_serial",
955 .id = 0,
956 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
957 .resource = msm8625_resources_uart1,
958};
959
Trilok Soni269fff42012-02-13 20:35:30 +0530960static struct resource msm8625_uart1_dm_resources[] = {
961 {
962 .start = MSM_UART1DM_PHYS,
963 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
964 .flags = IORESOURCE_MEM,
965 },
966 {
967 .start = MSM8625_INT_UART1DM_IRQ,
968 .end = MSM8625_INT_UART1DM_IRQ,
969 .flags = IORESOURCE_IRQ,
970 },
971 {
972 .start = MSM8625_INT_UART1DM_RX,
973 .end = MSM8625_INT_UART1DM_RX,
974 .flags = IORESOURCE_IRQ,
975 },
976 {
977 .start = DMOV_HSUART1_TX_CHAN,
978 .end = DMOV_HSUART1_RX_CHAN,
979 .name = "uartdm_channels",
980 .flags = IORESOURCE_DMA,
981 },
982 {
983 .start = DMOV_HSUART1_TX_CRCI,
984 .end = DMOV_HSUART1_RX_CRCI,
985 .name = "uartdm_crci",
986 .flags = IORESOURCE_DMA,
987 },
988};
989
990struct platform_device msm8625_device_uart_dm1 = {
991 .name = "msm_serial_hs",
992 .id = 0,
993 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
994 .resource = msm8625_uart1_dm_resources,
995 .dev = {
996 .dma_mask = &msm_uart_dm1_dma_mask,
997 .coherent_dma_mask = DMA_BIT_MASK(32),
998 },
999};
1000
1001static struct resource msm8625_uart2dm_resources[] = {
1002 {
1003 .start = MSM_UART2DM_PHYS,
1004 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
1005 .name = "uartdm_resource",
1006 .flags = IORESOURCE_MEM,
1007 },
1008 {
1009 .start = MSM8625_INT_UART2DM_IRQ,
1010 .end = MSM8625_INT_UART2DM_IRQ,
1011 .flags = IORESOURCE_IRQ,
1012 },
1013};
1014
1015struct platform_device msm8625_device_uart_dm2 = {
1016 .name = "msm_serial_hsl",
1017 .id = 0,
1018 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
1019 .resource = msm8625_uart2dm_resources,
1020};
1021
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301022static struct resource msm8625_resources_adsp[] = {
1023 {
1024 .start = MSM8625_INT_ADSP_A9_A11,
1025 .end = MSM8625_INT_ADSP_A9_A11,
1026 .flags = IORESOURCE_IRQ,
1027 },
1028};
1029
1030struct platform_device msm8625_device_adsp = {
1031 .name = "msm_adsp",
1032 .id = -1,
1033 .num_resources = ARRAY_SIZE(msm8625_resources_adsp),
1034 .resource = msm8625_resources_adsp,
1035};
1036
Taniya Das43bcdd62011-12-02 17:33:27 +05301037static struct resource msm8625_dmov_resource[] = {
1038 {
1039 .start = MSM8625_INT_ADM_AARM,
1040 .flags = IORESOURCE_IRQ,
1041 },
1042 {
1043 .start = 0xA9700000,
1044 .end = 0xA9700000 + SZ_4K - 1,
1045 .flags = IORESOURCE_MEM,
1046 },
1047};
1048
1049struct platform_device msm8625_device_dmov = {
1050 .name = "msm_dmov",
1051 .id = -1,
1052 .resource = msm8625_dmov_resource,
1053 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
1054 .dev = {
1055 .platform_data = &msm_dmov_pdata,
1056 },
1057};
Taniya Das2e948192011-12-20 11:15:13 +05301058
Taniya Das9d187142011-12-02 15:53:25 +05301059static struct resource gsbi0_msm8625_qup_resources[] = {
1060 {
1061 .name = "qup_phys_addr",
1062 .start = MSM_GSBI0_QUP_PHYS,
1063 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
1064 .flags = IORESOURCE_MEM,
1065 },
1066 {
1067 .name = "gsbi_qup_i2c_addr",
1068 .start = MSM_GSBI0_PHYS,
1069 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
1070 .flags = IORESOURCE_MEM,
1071 },
1072 {
1073 .name = "qup_err_intr",
1074 .start = MSM8625_INT_PWB_I2C,
1075 .end = MSM8625_INT_PWB_I2C,
1076 .flags = IORESOURCE_IRQ,
1077 },
1078};
1079
1080/* Use GSBI0 QUP for /dev/i2c-0 */
Taniya Dase3027e22012-02-27 16:32:27 +05301081struct platform_device msm8625_gsbi0_qup_i2c_device = {
Taniya Das9d187142011-12-02 15:53:25 +05301082 .name = "qup_i2c",
1083 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
1084 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
1085 .resource = gsbi0_msm8625_qup_resources,
1086};
1087
Trilok Soni633e59c2012-02-13 20:28:30 +05301088static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
1089 {
1090 .name = "qup_phys_addr",
1091 .start = MSM_GSBI1_QUP_PHYS,
1092 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1093 .flags = IORESOURCE_MEM,
1094 },
1095 {
1096 .name = "gsbi_qup_i2c_addr",
1097 .start = MSM_GSBI1_PHYS,
1098 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
1099 .flags = IORESOURCE_MEM,
1100 },
1101 {
1102 .name = "qup_err_intr",
1103 .start = MSM8625_INT_ARM11_DMA,
1104 .end = MSM8625_INT_ARM11_DMA,
1105 .flags = IORESOURCE_IRQ,
1106 },
1107};
1108
1109/* Use GSBI1 QUP for /dev/i2c-1 */
Taniya Dase3027e22012-02-27 16:32:27 +05301110struct platform_device msm8625_gsbi1_qup_i2c_device = {
Trilok Soni633e59c2012-02-13 20:28:30 +05301111 .name = "qup_i2c",
1112 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
1113 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
1114 .resource = gsbi1_msm8625_qup_i2c_resources,
1115};
1116
Taniya Das6684d622012-01-12 10:29:09 +05301117static struct resource msm8625_gpio_resources[] = {
1118 {
1119 .start = MSM8625_INT_GPIO_GROUP1,
1120 .flags = IORESOURCE_IRQ,
1121 },
1122 {
1123 .start = MSM8625_INT_GPIO_GROUP2,
1124 .flags = IORESOURCE_IRQ,
1125 },
1126};
1127
1128static struct platform_device msm8625_device_gpio = {
1129 .name = "msmgpio",
1130 .id = -1,
1131 .resource = msm8625_gpio_resources,
1132 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
1133};
1134
Trilok Soniee75f6c2012-02-13 20:45:07 +05301135static struct resource msm8625_resources_sdc1[] = {
1136 {
1137 .start = MSM_SDC1_BASE,
1138 .end = MSM_SDC1_BASE + SZ_4K - 1,
1139 .flags = IORESOURCE_MEM,
1140 },
1141 {
1142 .start = MSM8625_INT_SDC1_0,
1143 .end = MSM8625_INT_SDC1_1,
1144 .flags = IORESOURCE_IRQ,
1145 },
1146 {
1147 .name = "sdcc_dma_chnl",
1148 .start = DMOV_SDC1_CHAN,
1149 .end = DMOV_SDC1_CHAN,
1150 .flags = IORESOURCE_DMA,
1151 },
1152 {
1153 .name = "sdcc_dma_crci",
1154 .start = DMOV_SDC1_CRCI,
1155 .end = DMOV_SDC1_CRCI,
1156 .flags = IORESOURCE_DMA,
1157 }
1158};
1159
1160static struct resource msm8625_resources_sdc2[] = {
1161 {
1162 .start = MSM_SDC2_BASE,
1163 .end = MSM_SDC2_BASE + SZ_4K - 1,
1164 .flags = IORESOURCE_MEM,
1165 },
1166 {
1167 .start = MSM8625_INT_SDC2_0,
1168 .end = MSM8625_INT_SDC2_1,
1169 .flags = IORESOURCE_IRQ,
1170 },
1171 {
1172 .name = "sdcc_dma_chnl",
1173 .start = DMOV_SDC2_CHAN,
1174 .end = DMOV_SDC2_CHAN,
1175 .flags = IORESOURCE_DMA,
1176 },
1177 {
1178 .name = "sdcc_dma_crci",
1179 .start = DMOV_SDC2_CRCI,
1180 .end = DMOV_SDC2_CRCI,
1181 .flags = IORESOURCE_DMA,
1182 }
1183};
1184
1185static struct resource msm8625_resources_sdc3[] = {
1186 {
1187 .start = MSM_SDC3_BASE,
1188 .end = MSM_SDC3_BASE + SZ_4K - 1,
1189 .flags = IORESOURCE_MEM,
1190 },
1191 {
1192 .start = MSM8625_INT_SDC3_0,
1193 .end = MSM8625_INT_SDC3_1,
1194 .flags = IORESOURCE_IRQ,
1195 },
1196 {
1197 .name = "sdcc_dma_chnl",
1198 .start = DMOV_SDC3_CHAN,
1199 .end = DMOV_SDC3_CHAN,
1200 .flags = IORESOURCE_DMA,
1201 },
1202 {
1203 .name = "sdcc_dma_crci",
1204 .start = DMOV_SDC3_CRCI,
1205 .end = DMOV_SDC3_CRCI,
1206 .flags = IORESOURCE_DMA,
1207 },
1208};
1209
1210static struct resource msm8625_resources_sdc4[] = {
1211 {
1212 .start = MSM_SDC4_BASE,
1213 .end = MSM_SDC4_BASE + SZ_4K - 1,
1214 .flags = IORESOURCE_MEM,
1215 },
1216 {
1217 .start = MSM8625_INT_SDC4_0,
1218 .end = MSM8625_INT_SDC4_1,
1219 .flags = IORESOURCE_IRQ,
1220 },
1221 {
1222 .name = "sdcc_dma_chnl",
1223 .start = DMOV_SDC4_CHAN,
1224 .end = DMOV_SDC4_CHAN,
1225 .flags = IORESOURCE_DMA,
1226 },
1227 {
1228 .name = "sdcc_dma_crci",
1229 .start = DMOV_SDC4_CRCI,
1230 .end = DMOV_SDC4_CRCI,
1231 .flags = IORESOURCE_DMA,
1232 },
1233};
1234
1235struct platform_device msm8625_device_sdc1 = {
1236 .name = "msm_sdcc",
1237 .id = 1,
1238 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1239 .resource = msm8625_resources_sdc1,
1240 .dev = {
1241 .coherent_dma_mask = 0xffffffff,
1242 },
1243};
1244
1245struct platform_device msm8625_device_sdc2 = {
1246 .name = "msm_sdcc",
1247 .id = 2,
1248 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1249 .resource = msm8625_resources_sdc2,
1250 .dev = {
1251 .coherent_dma_mask = 0xffffffff,
1252 },
1253};
1254
1255struct platform_device msm8625_device_sdc3 = {
1256 .name = "msm_sdcc",
1257 .id = 3,
1258 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1259 .resource = msm8625_resources_sdc3,
1260 .dev = {
1261 .coherent_dma_mask = 0xffffffff,
1262 },
1263};
1264
1265struct platform_device msm8625_device_sdc4 = {
1266 .name = "msm_sdcc",
1267 .id = 4,
1268 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1269 .resource = msm8625_resources_sdc4,
1270 .dev = {
1271 .coherent_dma_mask = 0xffffffff,
1272 },
1273};
1274
1275static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1276 &msm8625_device_sdc1,
1277 &msm8625_device_sdc2,
1278 &msm8625_device_sdc3,
1279 &msm8625_device_sdc4,
1280};
1281
1282int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1283{
1284 struct platform_device *pdev;
1285
1286 if (controller < 1 || controller > 4)
1287 return -EINVAL;
1288
1289 if (cpu_is_msm8625())
1290 pdev = msm8625_sdcc_devices[controller-1];
1291 else
1292 pdev = msm_sdcc_devices[controller-1];
1293
1294 pdev->dev.platform_data = plat;
1295 return platform_device_register(pdev);
1296}
1297
Trilok Sonida63a8b2012-02-13 20:50:03 +05301298static struct resource msm8625_resources_hsusb_otg[] = {
1299 {
1300 .start = MSM_HSUSB_PHYS,
1301 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1302 .flags = IORESOURCE_MEM,
1303 },
1304 {
1305 .start = MSM8625_INT_USB_HS,
1306 .end = MSM8625_INT_USB_HS,
1307 .flags = IORESOURCE_IRQ,
1308 },
1309};
1310
1311struct platform_device msm8625_device_otg = {
1312 .name = "msm_otg",
1313 .id = -1,
1314 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1315 .resource = msm8625_resources_hsusb_otg,
1316 .dev = {
1317 .dma_mask = &dma_mask,
1318 .coherent_dma_mask = 0xffffffffULL,
1319 },
1320};
1321
1322static struct resource msm8625_resources_gadget_peripheral[] = {
1323 {
1324 .start = MSM_HSUSB_PHYS,
1325 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1326 .flags = IORESOURCE_MEM,
1327 },
1328 {
1329 .start = MSM8625_INT_USB_HS,
1330 .end = MSM8625_INT_USB_HS,
1331 .flags = IORESOURCE_IRQ,
1332 },
1333};
1334
1335struct platform_device msm8625_device_gadget_peripheral = {
1336 .name = "msm_hsusb",
1337 .id = -1,
1338 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1339 .resource = msm8625_resources_gadget_peripheral,
1340 .dev = {
1341 .dma_mask = &dma_mask,
1342 .coherent_dma_mask = 0xffffffffULL,
1343 },
1344};
1345
1346static struct resource msm8625_resources_hsusb_host[] = {
1347 {
1348 .start = MSM_HSUSB_PHYS,
1349 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1350 .flags = IORESOURCE_MEM,
1351 },
1352 {
1353 .start = MSM8625_INT_USB_HS,
1354 .end = MSM8625_INT_USB_HS,
1355 .flags = IORESOURCE_IRQ,
1356 },
1357};
1358
1359struct platform_device msm8625_device_hsusb_host = {
1360 .name = "msm_hsusb_host",
1361 .id = 0,
1362 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1363 .resource = msm8625_resources_hsusb_host,
1364 .dev = {
1365 .dma_mask = &dma_mask,
1366 .coherent_dma_mask = 0xffffffffULL,
1367 },
1368};
1369
1370static struct platform_device *msm8625_host_devices[] = {
1371 &msm8625_device_hsusb_host,
1372};
1373
1374int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1375{
1376 struct platform_device *pdev;
1377
1378 if (cpu_is_msm8625())
1379 pdev = msm8625_host_devices[host];
1380 else
1381 pdev = msm_host_devices[host];
1382 if (!pdev)
1383 return -ENODEV;
1384 pdev->dev.platform_data = plat;
1385 return platform_device_register(pdev);
1386}
1387
Trilok Soni88da2552012-02-13 21:01:24 +05301388#ifdef CONFIG_MSM_CAMERA_V4L2
1389static struct resource msm8625_csic0_resources[] = {
1390 {
1391 .name = "csic",
1392 .start = 0xA0F00000,
1393 .end = 0xA0F00000 + 0x00100000 - 1,
1394 .flags = IORESOURCE_MEM,
1395 },
1396 {
1397 .name = "csic",
1398 .start = MSM8625_INT_CSI_IRQ_0,
1399 .end = MSM8625_INT_CSI_IRQ_0,
1400 .flags = IORESOURCE_IRQ,
1401 },
1402};
1403
1404static struct resource msm8625_csic1_resources[] = {
1405 {
1406 .name = "csic",
1407 .start = 0xA1000000,
1408 .end = 0xA1000000 + 0x00100000 - 1,
1409 .flags = IORESOURCE_MEM,
1410 },
1411 {
1412 .name = "csic",
1413 .start = MSM8625_INT_CSI_IRQ_1,
1414 .end = MSM8625_INT_CSI_IRQ_1,
1415 .flags = IORESOURCE_IRQ,
1416 },
1417};
1418
1419struct platform_device msm8625_device_csic0 = {
1420 .name = "msm_csic",
1421 .id = 0,
1422 .resource = msm8625_csic0_resources,
1423 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1424};
1425
1426struct platform_device msm8625_device_csic1 = {
1427 .name = "msm_csic",
1428 .id = 1,
1429 .resource = msm8625_csic1_resources,
1430 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1431};
1432#endif
1433
Trilok Soniae4633d2012-02-13 21:08:32 +05301434static struct resource msm8625_mipi_dsi_resources[] = {
1435 {
1436 .name = "mipi_dsi",
1437 .start = MIPI_DSI_HW_BASE,
1438 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1439 .flags = IORESOURCE_MEM,
1440 },
1441 {
1442 .start = MSM8625_INT_DSI_IRQ,
1443 .end = MSM8625_INT_DSI_IRQ,
1444 .flags = IORESOURCE_IRQ,
1445 },
1446};
1447
1448static struct platform_device msm8625_mipi_dsi_device = {
1449 .name = "mipi_dsi",
1450 .id = 1,
1451 .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources),
1452 .resource = msm8625_mipi_dsi_resources,
1453};
1454
1455static struct resource msm8625_mdp_resources[] = {
1456 {
1457 .name = "mdp",
1458 .start = MDP_BASE,
1459 .end = MDP_BASE + 0x000F1008 - 1,
1460 .flags = IORESOURCE_MEM,
1461 },
1462 {
1463 .start = MSM8625_INT_MDP,
1464 .end = MSM8625_INT_MDP,
1465 .flags = IORESOURCE_IRQ,
1466 },
1467};
1468
1469static struct platform_device msm8625_mdp_device = {
1470 .name = "mdp",
1471 .id = 0,
1472 .num_resources = ARRAY_SIZE(msm8625_mdp_resources),
1473 .resource = msm8625_mdp_resources,
1474};
1475
1476void __init msm_fb_register_device(char *name, void *data)
1477{
1478 if (!strncmp(name, "mdp", 3)) {
1479 if (cpu_is_msm8625())
1480 msm_register_device(&msm8625_mdp_device, data);
1481 else
1482 msm_register_device(&msm_mdp_device, data);
1483 } else if (!strncmp(name, "mipi_dsi", 8)) {
1484 if (cpu_is_msm8625())
1485 msm_register_device(&msm8625_mipi_dsi_device, data);
1486 else
1487 msm_register_device(&msm_mipi_dsi_device, data);
1488 } else if (!strncmp(name, "lcdc", 4)) {
1489 msm_register_device(&msm_lcdc_device, data);
1490 } else {
1491 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1492 }
1493}
1494
Trilok Soni664b95d2012-02-13 21:13:15 +05301495static struct resource msm8625_kgsl_3d0_resources[] = {
1496 {
1497 .name = KGSL_3D0_REG_MEMORY,
1498 .start = 0xA0000000,
1499 .end = 0xA001ffff,
1500 .flags = IORESOURCE_MEM,
1501 },
1502 {
1503 .name = KGSL_3D0_IRQ,
1504 .start = MSM8625_INT_GRAPHICS,
1505 .end = MSM8625_INT_GRAPHICS,
1506 .flags = IORESOURCE_IRQ,
1507 },
1508};
1509
1510struct platform_device msm8625_kgsl_3d0 = {
1511 .name = "kgsl-3d0",
1512 .id = 0,
1513 .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources),
1514 .resource = msm8625_kgsl_3d0_resources,
1515 .dev = {
1516 .platform_data = &kgsl_3d0_pdata,
1517 },
1518};
1519
Taniya Das7c9f0512011-12-02 14:26:46 +05301520static struct clk_lookup msm_clock_8625_dummy[] = {
1521 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1522 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1523 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1524 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1525 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1526 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1527 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1528 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1529 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1530 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1531 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1532 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1533 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1534 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1535 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1536 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1537 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1538 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1539 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1540 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1541 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1542 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1543 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1544 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1545 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1546 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1547 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1548 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1549 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1550 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1551 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1552 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1553 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1554 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1555 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1556 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1557 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1558 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1559 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1560 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1561 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1562 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1563 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1564 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1565 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1566 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1567 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1568 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1569 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1570 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1571 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1572 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1573 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1574 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1575 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1576 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1577 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1578 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1579 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1580};
1581
1582struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1583 .table = msm_clock_8625_dummy,
1584 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1585};
1586
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301587enum {
1588 MSM8625,
1589 MSM8625A,
1590};
1591
1592static int __init msm8625_cpu_id(void)
1593{
1594 int raw_id, cpu;
1595
1596 raw_id = socinfo_get_raw_id();
1597 switch (raw_id) {
1598 /* Part number for 1GHz part */
1599 case 0x770:
1600 case 0x771:
1601 case 0x780:
1602 cpu = MSM8625;
1603 break;
1604 /* Part number for 1.2GHz part */
1605 case 0x773:
1606 case 0x774:
1607 case 0x781:
1608 cpu = MSM8625A;
1609 break;
1610 default:
1611 pr_err("Invalid Raw ID\n");
1612 return -ENODEV;
1613 }
1614 return cpu;
1615}
1616
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001617int __init msm7x2x_misc_init(void)
1618{
Taniya Das7c9f0512011-12-02 14:26:46 +05301619 if (machine_is_msm8625_rumi3()) {
1620 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301621 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301622 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301623
Stephen Boydbb600ae2011-08-02 20:11:40 -07001624 msm_clock_init(&msm7x27a_clock_init_data);
Pankaj Kumarfee56a82012-04-17 14:26:49 +05301625 if (cpu_is_msm7x27aa() || cpu_is_msm7x25ab())
Matt Wagantallec57f062011-08-16 23:54:46 -07001626 acpuclk_init(&acpuclk_7x27aa_soc_data);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301627 else if (cpu_is_msm8625()) {
1628 if (msm8625_cpu_id() == MSM8625)
1629 acpuclk_init(&acpuclk_7x27aa_soc_data);
1630 else if (msm8625_cpu_id() == MSM8625A)
1631 acpuclk_init(&acpuclk_8625_soc_data);
1632 } else {
Matt Wagantallec57f062011-08-16 23:54:46 -07001633 acpuclk_init(&acpuclk_7x27a_soc_data);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301634 }
Matt Wagantallec57f062011-08-16 23:54:46 -07001635
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001636
1637 return 0;
1638}
1639
1640#ifdef CONFIG_CACHE_L2X0
1641static int __init msm7x27x_cache_init(void)
1642{
1643 int aux_ctrl = 0;
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301644 int pctrl = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001645
1646 /* Way Size 010(0x2) 32KB */
1647 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1648 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1649 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1650
Taniya Das379b5682011-12-02 14:53:46 +05301651 if (cpu_is_msm8625()) {
1652 /* Way Size 011(0x3) 64KB */
1653 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1654 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301655 (0X1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | \
1656 (0x1 << L2X0_AUX_CTRL_L2_FORCE_NWA_SHIFT);
1657
1658 /* Write Prefetch Control settings */
1659 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1660 pctrl |= (0x3 << L2X0_PREFETCH_CTRL_OFFSET_SHIFT) | \
1661 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_INC_SHIFT) | \
1662 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_SHIFT);
1663 writel_relaxed(pctrl , MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
Taniya Das379b5682011-12-02 14:53:46 +05301664 }
1665
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001666 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301667 if (cpu_is_msm8625()) {
1668 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1669 pr_info("Prfetch Ctrl: 0x%08x\n", pctrl);
1670 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001671
1672 return 0;
1673}
1674#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301675static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001676#endif
1677
1678void __init msm_common_io_init(void)
1679{
1680 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301681 if (socinfo_init() < 0)
1682 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001683 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301684}
1685
1686void __init msm8625_init_irq(void)
1687{
Taniya Dasfcb35002012-03-09 15:28:12 +05301688 msm_gic_irq_extn_init(MSM_QGIC_DIST_BASE, MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301689 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1690 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301691}
1692
1693void __init msm8625_map_io(void)
1694{
1695 msm_map_msm8625_io();
1696
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001697 if (socinfo_init() < 0)
1698 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301699 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001700}
1701
Taniya Das43bcdd62011-12-02 17:33:27 +05301702static int msm7627a_init_gpio(void)
1703{
Taniya Das6684d622012-01-12 10:29:09 +05301704 if (cpu_is_msm8625())
1705 platform_device_register(&msm8625_device_gpio);
1706 else
1707 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301708 return 0;
1709}
1710postcore_initcall(msm7627a_init_gpio);
Taniya Das9d0c3c52012-05-04 14:40:55 +05301711
1712static int msm7627a_panic_handler(struct notifier_block *this,
1713 unsigned long event, void *ptr)
1714{
1715 flush_cache_all();
1716 outer_flush_all();
1717 return NOTIFY_DONE;
1718}
1719
1720static struct notifier_block panic_handler = {
1721 .notifier_call = msm7627a_panic_handler,
1722};
1723
1724static int __init panic_register(void)
1725{
1726 atomic_notifier_chain_register(&panic_notifier_list,
1727 &panic_handler);
1728 return 0;
1729}
1730module_init(panic_register);