blob: a9d68a63ec478d4d3e0b9116535bd5f5238fc0f7 [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
420struct flash_platform_data msm_nand_data;
421
422struct platform_device msm_device_nand = {
423 .name = "msm_nand",
424 .id = -1,
425 .num_resources = ARRAY_SIZE(resources_nand),
426 .resource = resources_nand,
427 .dev = {
428 .platform_data = &msm_nand_data,
429 },
430};
431
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530432static struct msm_pm_irq_calls msm7x27a_pm_irq_calls = {
433 .irq_pending = msm_irq_pending,
434 .idle_sleep_allowed = msm_irq_idle_sleep_allowed,
435 .enter_sleep1 = msm_irq_enter_sleep1,
436 .enter_sleep2 = msm_irq_enter_sleep2,
437 .exit_sleep1 = msm_irq_exit_sleep1,
438 .exit_sleep2 = msm_irq_exit_sleep2,
439 .exit_sleep3 = msm_irq_exit_sleep3,
440};
441
442static struct msm_pm_irq_calls msm8625_pm_irq_calls = {
443 .irq_pending = msm_gic_spi_ppi_pending,
444 .idle_sleep_allowed = msm_gic_irq_idle_sleep_allowed,
445 .enter_sleep1 = msm_gic_irq_enter_sleep1,
446 .enter_sleep2 = msm_gic_irq_enter_sleep2,
447 .exit_sleep1 = msm_gic_irq_exit_sleep1,
448 .exit_sleep2 = msm_gic_irq_exit_sleep2,
449 .exit_sleep3 = msm_gic_irq_exit_sleep3,
450};
451
Stephen Boyd986c9632012-04-24 16:31:45 -0700452void __init msm_pm_register_irqs(void)
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530453{
454 if (cpu_is_msm8625())
455 msm_pm_set_irq_extns(&msm8625_pm_irq_calls);
456 else
457 msm_pm_set_irq_extns(&msm7x27a_pm_irq_calls);
458
459}
460
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700461#define MSM_SDC1_BASE 0xA0400000
462#define MSM_SDC2_BASE 0xA0500000
463#define MSM_SDC3_BASE 0xA0600000
464#define MSM_SDC4_BASE 0xA0700000
465static struct resource resources_sdc1[] = {
466 {
467 .start = MSM_SDC1_BASE,
468 .end = MSM_SDC1_BASE + SZ_4K - 1,
469 .flags = IORESOURCE_MEM,
470 },
471 {
472 .start = INT_SDC1_0,
473 .end = INT_SDC1_1,
474 .flags = IORESOURCE_IRQ,
475 },
476 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700477 .name = "sdcc_dma_chnl",
478 .start = DMOV_SDC1_CHAN,
479 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700480 .flags = IORESOURCE_DMA,
481 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700482 {
483 .name = "sdcc_dma_crci",
484 .start = DMOV_SDC1_CRCI,
485 .end = DMOV_SDC1_CRCI,
486 .flags = IORESOURCE_DMA,
487 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700488};
489
490static struct resource resources_sdc2[] = {
491 {
492 .start = MSM_SDC2_BASE,
493 .end = MSM_SDC2_BASE + SZ_4K - 1,
494 .flags = IORESOURCE_MEM,
495 },
496 {
497 .start = INT_SDC2_0,
498 .end = INT_SDC2_1,
499 .flags = IORESOURCE_IRQ,
500 },
501 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700502 .name = "sdcc_dma_chnl",
503 .start = DMOV_SDC2_CHAN,
504 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700505 .flags = IORESOURCE_DMA,
506 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700507 {
508 .name = "sdcc_dma_crci",
509 .start = DMOV_SDC2_CRCI,
510 .end = DMOV_SDC2_CRCI,
511 .flags = IORESOURCE_DMA,
512 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700513};
514
515static struct resource resources_sdc3[] = {
516 {
517 .start = MSM_SDC3_BASE,
518 .end = MSM_SDC3_BASE + SZ_4K - 1,
519 .flags = IORESOURCE_MEM,
520 },
521 {
522 .start = INT_SDC3_0,
523 .end = INT_SDC3_1,
524 .flags = IORESOURCE_IRQ,
525 },
526 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700527 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530528 .start = DMOV_SDC3_CHAN,
529 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700530 .flags = IORESOURCE_DMA,
531 },
532 {
533 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530534 .start = DMOV_SDC3_CRCI,
535 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700536 .flags = IORESOURCE_DMA,
537 },
538};
539
540static struct resource resources_sdc4[] = {
541 {
542 .start = MSM_SDC4_BASE,
543 .end = MSM_SDC4_BASE + SZ_4K - 1,
544 .flags = IORESOURCE_MEM,
545 },
546 {
547 .start = INT_SDC4_0,
548 .end = INT_SDC4_1,
549 .flags = IORESOURCE_IRQ,
550 },
551 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700552 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530553 .start = DMOV_SDC4_CHAN,
554 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700555 .flags = IORESOURCE_DMA,
556 },
557 {
558 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530559 .start = DMOV_SDC4_CRCI,
560 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700561 .flags = IORESOURCE_DMA,
562 },
563};
564
565struct platform_device msm_device_sdc1 = {
566 .name = "msm_sdcc",
567 .id = 1,
568 .num_resources = ARRAY_SIZE(resources_sdc1),
569 .resource = resources_sdc1,
570 .dev = {
571 .coherent_dma_mask = 0xffffffff,
572 },
573};
574
575struct platform_device msm_device_sdc2 = {
576 .name = "msm_sdcc",
577 .id = 2,
578 .num_resources = ARRAY_SIZE(resources_sdc2),
579 .resource = resources_sdc2,
580 .dev = {
581 .coherent_dma_mask = 0xffffffff,
582 },
583};
584
585struct platform_device msm_device_sdc3 = {
586 .name = "msm_sdcc",
587 .id = 3,
588 .num_resources = ARRAY_SIZE(resources_sdc3),
589 .resource = resources_sdc3,
590 .dev = {
591 .coherent_dma_mask = 0xffffffff,
592 },
593};
594
595struct platform_device msm_device_sdc4 = {
596 .name = "msm_sdcc",
597 .id = 4,
598 .num_resources = ARRAY_SIZE(resources_sdc4),
599 .resource = resources_sdc4,
600 .dev = {
601 .coherent_dma_mask = 0xffffffff,
602 },
603};
604
605static struct platform_device *msm_sdcc_devices[] __initdata = {
606 &msm_device_sdc1,
607 &msm_device_sdc2,
608 &msm_device_sdc3,
609 &msm_device_sdc4,
610};
611
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530612#ifdef CONFIG_MSM_CAMERA_V4L2
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530613static int apps_reset;
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530614static struct resource msm_csic0_resources[] = {
615 {
616 .name = "csic",
617 .start = 0xA0F00000,
618 .end = 0xA0F00000 + 0x00100000 - 1,
619 .flags = IORESOURCE_MEM,
620 },
621 {
622 .name = "csic",
623 .start = INT_CSI_IRQ_0,
624 .end = INT_CSI_IRQ_0,
625 .flags = IORESOURCE_IRQ,
626 },
627};
628
629static struct resource msm_csic1_resources[] = {
630 {
631 .name = "csic",
632 .start = 0xA1000000,
633 .end = 0xA1000000 + 0x00100000 - 1,
634 .flags = IORESOURCE_MEM,
635 },
636 {
637 .name = "csic",
638 .start = INT_CSI_IRQ_1,
639 .end = INT_CSI_IRQ_1,
640 .flags = IORESOURCE_IRQ,
641 },
642};
643
644struct platform_device msm7x27a_device_csic0 = {
645 .name = "msm_csic",
646 .id = 0,
647 .resource = msm_csic0_resources,
648 .num_resources = ARRAY_SIZE(msm_csic0_resources),
649};
650
651struct platform_device msm7x27a_device_csic1 = {
652 .name = "msm_csic",
653 .id = 1,
654 .resource = msm_csic1_resources,
655 .num_resources = ARRAY_SIZE(msm_csic1_resources),
656};
657
658static struct resource msm_clkctl_resources[] = {
659 {
660 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530661 .start = MSM7XXX_CLK_CTL_PHYS,
662 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530663 .flags = IORESOURCE_MEM,
664 },
665};
666struct platform_device msm7x27a_device_clkctl = {
667 .name = "msm_clk_ctl",
668 .id = 0,
669 .resource = msm_clkctl_resources,
670 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530671 .dev = {
672 .platform_data = &apps_reset,
673 },
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530674};
675
676struct platform_device msm7x27a_device_vfe = {
677 .name = "msm_vfe",
678 .id = 0,
679};
680
681#endif
682
Murali Nalajala41786ab2012-03-06 10:47:32 +0530683/* Command sequence for simple WFI */
684static uint8_t spm_wfi_cmd_sequence[] __initdata = {
Murali Nalajala2250a272012-03-13 15:56:59 +0530685 0x04, 0x03, 0x04, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530686};
687
688/* Command sequence for GDFS, this won't send any interrupt to the modem */
689static uint8_t spm_pc_without_modem[] __initdata = {
690 0x20, 0x00, 0x30, 0x10,
Murali Nalajala2250a272012-03-13 15:56:59 +0530691 0x03, 0x1e, 0x0e, 0x3e,
692 0x4e, 0x4e, 0x4e, 0x4e,
693 0x4e, 0x4e, 0x4e, 0x4e,
694 0x4e, 0x4e, 0x4e, 0x4e,
695 0x4e, 0x4e, 0x4e, 0x4e,
696 0x2E, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530697};
698
699static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
700 [0] = {
701 .mode = MSM_SPM_MODE_CLOCK_GATING,
702 .notify_rpm = false,
703 .cmd = spm_wfi_cmd_sequence,
704 },
705 [1] = {
706 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
707 .notify_rpm = false,
708 .cmd = spm_pc_without_modem,
709 },
710};
711
712static struct msm_spm_platform_data msm_spm_data[] __initdata = {
713 [0] = {
714 .reg_base_addr = MSM_SAW0_BASE,
715 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
716 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
717 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
718 .modes = msm_spm_seq_list,
719 },
720 [1] = {
721 .reg_base_addr = MSM_SAW1_BASE,
722 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
723 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
724 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
725 .modes = msm_spm_seq_list,
726 },
727};
728
729void __init msm8x25_spm_device_init(void)
730{
731 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
732}
733
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700734#define MDP_BASE 0xAA200000
735#define MIPI_DSI_HW_BASE 0xA1100000
736
737static struct resource msm_mipi_dsi_resources[] = {
738 {
739 .name = "mipi_dsi",
740 .start = MIPI_DSI_HW_BASE,
741 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
742 .flags = IORESOURCE_MEM,
743 },
744 {
745 .start = INT_DSI_IRQ,
746 .end = INT_DSI_IRQ,
747 .flags = IORESOURCE_IRQ,
748 },
749};
750
751static struct platform_device msm_mipi_dsi_device = {
752 .name = "mipi_dsi",
753 .id = 1,
754 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
755 .resource = msm_mipi_dsi_resources,
756};
757
758static struct resource msm_mdp_resources[] = {
759 {
760 .name = "mdp",
761 .start = MDP_BASE,
762 .end = MDP_BASE + 0x000F1008 - 1,
763 .flags = IORESOURCE_MEM,
764 },
765 {
766 .start = INT_MDP,
767 .end = INT_MDP,
768 .flags = IORESOURCE_IRQ,
769 },
770};
771
772static struct platform_device msm_mdp_device = {
773 .name = "mdp",
774 .id = 0,
775 .num_resources = ARRAY_SIZE(msm_mdp_resources),
776 .resource = msm_mdp_resources,
777};
778
779static struct platform_device msm_lcdc_device = {
780 .name = "lcdc",
781 .id = 0,
782};
783
784static struct resource kgsl_3d0_resources[] = {
785 {
786 .name = KGSL_3D0_REG_MEMORY,
787 .start = 0xA0000000,
788 .end = 0xA001ffff,
789 .flags = IORESOURCE_MEM,
790 },
791 {
792 .name = KGSL_3D0_IRQ,
793 .start = INT_GRAPHICS,
794 .end = INT_GRAPHICS,
795 .flags = IORESOURCE_IRQ,
796 },
797};
798
799static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600800 .pwrlevel = {
801 {
802 .gpu_freq = 245760000,
803 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700804 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600805 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530806 .gpu_freq = 192000000,
807 .bus_freq = 160000000,
808 },
809 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600810 .gpu_freq = 133330000,
811 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700812 },
813 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600814 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530815 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600816 .set_grp_async = set_grp_xbar_async,
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700817 .idle_timeout = HZ,
Lynus Vazfe4bede2012-04-06 11:53:30 -0700818 .strtstp_sleepwake = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600819 .nap_allowed = false,
820 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700821};
822
823struct platform_device msm_kgsl_3d0 = {
824 .name = "kgsl-3d0",
825 .id = 0,
826 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
827 .resource = kgsl_3d0_resources,
828 .dev = {
829 .platform_data = &kgsl_3d0_pdata,
830 },
831};
832
833void __init msm7x25a_kgsl_3d0_init(void)
834{
835 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530836 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600837 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
838 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
839 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
840 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Rajesh Kemisettidf6e62f2012-03-12 14:02:30 +0530841 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700842}
843
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700844void __init msm8x25_kgsl_3d0_init(void)
845{
Lynus Vazfe4bede2012-04-06 11:53:30 -0700846 if (cpu_is_msm8625()) {
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700847 kgsl_3d0_pdata.idle_timeout = HZ/5;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700848 kgsl_3d0_pdata.strtstp_sleepwake = false;
Ranjhith Kalisamy24696322012-04-11 22:09:17 +0530849 /* 8x25 supports a higher GPU frequency */
850 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 300000000;
851 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 200000000;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700852 }
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700853}
854
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700855static void __init msm_register_device(struct platform_device *pdev, void *data)
856{
857 int ret;
858
859 pdev->dev.platform_data = data;
860
861 ret = platform_device_register(pdev);
862
863 if (ret)
864 dev_err(&pdev->dev,
865 "%s: platform_device_register() failed = %d\n",
866 __func__, ret);
867}
868
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700869
870#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
871#define PDM0_CTL_OFFSET (0x04)
872#define SIZE_8B (0x08)
873
874static struct resource resources_led[] = {
875 {
876 .start = PERPH_WEB_BLOCK_ADDR,
877 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
878 .name = "led-gpio-pdm",
879 .flags = IORESOURCE_MEM,
880 },
881};
882
883static struct led_info msm_kpbl_pdm_led_pdata = {
884 .name = "keyboard-backlight",
885};
886
887struct platform_device led_pdev = {
888 .name = "leds-msm-pdm",
889 /* use pdev id to represent pdm id */
890 .id = 0,
891 .num_resources = ARRAY_SIZE(resources_led),
892 .resource = resources_led,
893 .dev = {
894 .platform_data = &msm_kpbl_pdm_led_pdata,
895 },
896};
897
Manish Dewangan3a260992011-06-24 18:01:34 +0530898struct platform_device asoc_msm_pcm = {
899 .name = "msm-dsp-audio",
900 .id = 0,
901};
902
903struct platform_device asoc_msm_dai0 = {
904 .name = "msm-codec-dai",
905 .id = 0,
906};
907
908struct platform_device asoc_msm_dai1 = {
909 .name = "msm-cpu-dai",
910 .id = 0,
911};
912
Taniya Das2e948192011-12-20 11:15:13 +0530913static struct resource gpio_resources[] = {
914 {
915 .start = INT_GPIO_GROUP1,
916 .flags = IORESOURCE_IRQ,
917 },
918 {
919 .start = INT_GPIO_GROUP2,
920 .flags = IORESOURCE_IRQ,
921 },
922};
923
924static struct platform_device msm_device_gpio = {
925 .name = "msmgpio",
926 .id = -1,
927 .resource = gpio_resources,
928 .num_resources = ARRAY_SIZE(gpio_resources),
929};
930
Taniya Das43bcdd62011-12-02 17:33:27 +0530931struct platform_device *msm_footswitch_devices[] = {
932 FS_PCOM(FS_GFX3D, "fs_gfx3d"),
933};
934unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
935
936/* MSM8625 Devices */
937
938static struct resource msm8625_resources_uart1[] = {
939 {
940 .start = MSM8625_INT_UART1,
941 .end = MSM8625_INT_UART1,
942 .flags = IORESOURCE_IRQ,
943 },
944 {
Taniya Das13b811a2011-12-09 18:33:45 +0530945 .start = MSM7XXX_UART1_PHYS,
946 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530947 .flags = IORESOURCE_MEM,
948 },
949};
950
951struct platform_device msm8625_device_uart1 = {
952 .name = "msm_serial",
953 .id = 0,
954 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
955 .resource = msm8625_resources_uart1,
956};
957
Trilok Soni269fff42012-02-13 20:35:30 +0530958static struct resource msm8625_uart1_dm_resources[] = {
959 {
960 .start = MSM_UART1DM_PHYS,
961 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
962 .flags = IORESOURCE_MEM,
963 },
964 {
965 .start = MSM8625_INT_UART1DM_IRQ,
966 .end = MSM8625_INT_UART1DM_IRQ,
967 .flags = IORESOURCE_IRQ,
968 },
969 {
970 .start = MSM8625_INT_UART1DM_RX,
971 .end = MSM8625_INT_UART1DM_RX,
972 .flags = IORESOURCE_IRQ,
973 },
974 {
975 .start = DMOV_HSUART1_TX_CHAN,
976 .end = DMOV_HSUART1_RX_CHAN,
977 .name = "uartdm_channels",
978 .flags = IORESOURCE_DMA,
979 },
980 {
981 .start = DMOV_HSUART1_TX_CRCI,
982 .end = DMOV_HSUART1_RX_CRCI,
983 .name = "uartdm_crci",
984 .flags = IORESOURCE_DMA,
985 },
986};
987
988struct platform_device msm8625_device_uart_dm1 = {
989 .name = "msm_serial_hs",
990 .id = 0,
991 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
992 .resource = msm8625_uart1_dm_resources,
993 .dev = {
994 .dma_mask = &msm_uart_dm1_dma_mask,
995 .coherent_dma_mask = DMA_BIT_MASK(32),
996 },
997};
998
999static struct resource msm8625_uart2dm_resources[] = {
1000 {
1001 .start = MSM_UART2DM_PHYS,
1002 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
1003 .name = "uartdm_resource",
1004 .flags = IORESOURCE_MEM,
1005 },
1006 {
1007 .start = MSM8625_INT_UART2DM_IRQ,
1008 .end = MSM8625_INT_UART2DM_IRQ,
1009 .flags = IORESOURCE_IRQ,
1010 },
1011};
1012
1013struct platform_device msm8625_device_uart_dm2 = {
1014 .name = "msm_serial_hsl",
1015 .id = 0,
1016 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
1017 .resource = msm8625_uart2dm_resources,
1018};
1019
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301020static struct resource msm8625_resources_adsp[] = {
1021 {
1022 .start = MSM8625_INT_ADSP_A9_A11,
1023 .end = MSM8625_INT_ADSP_A9_A11,
1024 .flags = IORESOURCE_IRQ,
1025 },
1026};
1027
1028struct platform_device msm8625_device_adsp = {
1029 .name = "msm_adsp",
1030 .id = -1,
1031 .num_resources = ARRAY_SIZE(msm8625_resources_adsp),
1032 .resource = msm8625_resources_adsp,
1033};
1034
Taniya Das43bcdd62011-12-02 17:33:27 +05301035static struct resource msm8625_dmov_resource[] = {
1036 {
1037 .start = MSM8625_INT_ADM_AARM,
1038 .flags = IORESOURCE_IRQ,
1039 },
1040 {
1041 .start = 0xA9700000,
1042 .end = 0xA9700000 + SZ_4K - 1,
1043 .flags = IORESOURCE_MEM,
1044 },
1045};
1046
1047struct platform_device msm8625_device_dmov = {
1048 .name = "msm_dmov",
1049 .id = -1,
1050 .resource = msm8625_dmov_resource,
1051 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
1052 .dev = {
1053 .platform_data = &msm_dmov_pdata,
1054 },
1055};
Taniya Das2e948192011-12-20 11:15:13 +05301056
Taniya Das9d187142011-12-02 15:53:25 +05301057static struct resource gsbi0_msm8625_qup_resources[] = {
1058 {
1059 .name = "qup_phys_addr",
1060 .start = MSM_GSBI0_QUP_PHYS,
1061 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
1062 .flags = IORESOURCE_MEM,
1063 },
1064 {
1065 .name = "gsbi_qup_i2c_addr",
1066 .start = MSM_GSBI0_PHYS,
1067 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
1068 .flags = IORESOURCE_MEM,
1069 },
1070 {
1071 .name = "qup_err_intr",
1072 .start = MSM8625_INT_PWB_I2C,
1073 .end = MSM8625_INT_PWB_I2C,
1074 .flags = IORESOURCE_IRQ,
1075 },
1076};
1077
1078/* Use GSBI0 QUP for /dev/i2c-0 */
Taniya Dase3027e22012-02-27 16:32:27 +05301079struct platform_device msm8625_gsbi0_qup_i2c_device = {
Taniya Das9d187142011-12-02 15:53:25 +05301080 .name = "qup_i2c",
1081 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
1082 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
1083 .resource = gsbi0_msm8625_qup_resources,
1084};
1085
Trilok Soni633e59c2012-02-13 20:28:30 +05301086static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
1087 {
1088 .name = "qup_phys_addr",
1089 .start = MSM_GSBI1_QUP_PHYS,
1090 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1091 .flags = IORESOURCE_MEM,
1092 },
1093 {
1094 .name = "gsbi_qup_i2c_addr",
1095 .start = MSM_GSBI1_PHYS,
1096 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
1097 .flags = IORESOURCE_MEM,
1098 },
1099 {
1100 .name = "qup_err_intr",
1101 .start = MSM8625_INT_ARM11_DMA,
1102 .end = MSM8625_INT_ARM11_DMA,
1103 .flags = IORESOURCE_IRQ,
1104 },
1105};
1106
1107/* Use GSBI1 QUP for /dev/i2c-1 */
Taniya Dase3027e22012-02-27 16:32:27 +05301108struct platform_device msm8625_gsbi1_qup_i2c_device = {
Trilok Soni633e59c2012-02-13 20:28:30 +05301109 .name = "qup_i2c",
1110 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
1111 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
1112 .resource = gsbi1_msm8625_qup_i2c_resources,
1113};
1114
Taniya Das6684d622012-01-12 10:29:09 +05301115static struct resource msm8625_gpio_resources[] = {
1116 {
1117 .start = MSM8625_INT_GPIO_GROUP1,
1118 .flags = IORESOURCE_IRQ,
1119 },
1120 {
1121 .start = MSM8625_INT_GPIO_GROUP2,
1122 .flags = IORESOURCE_IRQ,
1123 },
1124};
1125
1126static struct platform_device msm8625_device_gpio = {
1127 .name = "msmgpio",
1128 .id = -1,
1129 .resource = msm8625_gpio_resources,
1130 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
1131};
1132
Trilok Soniee75f6c2012-02-13 20:45:07 +05301133static struct resource msm8625_resources_sdc1[] = {
1134 {
1135 .start = MSM_SDC1_BASE,
1136 .end = MSM_SDC1_BASE + SZ_4K - 1,
1137 .flags = IORESOURCE_MEM,
1138 },
1139 {
1140 .start = MSM8625_INT_SDC1_0,
1141 .end = MSM8625_INT_SDC1_1,
1142 .flags = IORESOURCE_IRQ,
1143 },
1144 {
1145 .name = "sdcc_dma_chnl",
1146 .start = DMOV_SDC1_CHAN,
1147 .end = DMOV_SDC1_CHAN,
1148 .flags = IORESOURCE_DMA,
1149 },
1150 {
1151 .name = "sdcc_dma_crci",
1152 .start = DMOV_SDC1_CRCI,
1153 .end = DMOV_SDC1_CRCI,
1154 .flags = IORESOURCE_DMA,
1155 }
1156};
1157
1158static struct resource msm8625_resources_sdc2[] = {
1159 {
1160 .start = MSM_SDC2_BASE,
1161 .end = MSM_SDC2_BASE + SZ_4K - 1,
1162 .flags = IORESOURCE_MEM,
1163 },
1164 {
1165 .start = MSM8625_INT_SDC2_0,
1166 .end = MSM8625_INT_SDC2_1,
1167 .flags = IORESOURCE_IRQ,
1168 },
1169 {
1170 .name = "sdcc_dma_chnl",
1171 .start = DMOV_SDC2_CHAN,
1172 .end = DMOV_SDC2_CHAN,
1173 .flags = IORESOURCE_DMA,
1174 },
1175 {
1176 .name = "sdcc_dma_crci",
1177 .start = DMOV_SDC2_CRCI,
1178 .end = DMOV_SDC2_CRCI,
1179 .flags = IORESOURCE_DMA,
1180 }
1181};
1182
1183static struct resource msm8625_resources_sdc3[] = {
1184 {
1185 .start = MSM_SDC3_BASE,
1186 .end = MSM_SDC3_BASE + SZ_4K - 1,
1187 .flags = IORESOURCE_MEM,
1188 },
1189 {
1190 .start = MSM8625_INT_SDC3_0,
1191 .end = MSM8625_INT_SDC3_1,
1192 .flags = IORESOURCE_IRQ,
1193 },
1194 {
1195 .name = "sdcc_dma_chnl",
1196 .start = DMOV_SDC3_CHAN,
1197 .end = DMOV_SDC3_CHAN,
1198 .flags = IORESOURCE_DMA,
1199 },
1200 {
1201 .name = "sdcc_dma_crci",
1202 .start = DMOV_SDC3_CRCI,
1203 .end = DMOV_SDC3_CRCI,
1204 .flags = IORESOURCE_DMA,
1205 },
1206};
1207
1208static struct resource msm8625_resources_sdc4[] = {
1209 {
1210 .start = MSM_SDC4_BASE,
1211 .end = MSM_SDC4_BASE + SZ_4K - 1,
1212 .flags = IORESOURCE_MEM,
1213 },
1214 {
1215 .start = MSM8625_INT_SDC4_0,
1216 .end = MSM8625_INT_SDC4_1,
1217 .flags = IORESOURCE_IRQ,
1218 },
1219 {
1220 .name = "sdcc_dma_chnl",
1221 .start = DMOV_SDC4_CHAN,
1222 .end = DMOV_SDC4_CHAN,
1223 .flags = IORESOURCE_DMA,
1224 },
1225 {
1226 .name = "sdcc_dma_crci",
1227 .start = DMOV_SDC4_CRCI,
1228 .end = DMOV_SDC4_CRCI,
1229 .flags = IORESOURCE_DMA,
1230 },
1231};
1232
1233struct platform_device msm8625_device_sdc1 = {
1234 .name = "msm_sdcc",
1235 .id = 1,
1236 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1237 .resource = msm8625_resources_sdc1,
1238 .dev = {
1239 .coherent_dma_mask = 0xffffffff,
1240 },
1241};
1242
1243struct platform_device msm8625_device_sdc2 = {
1244 .name = "msm_sdcc",
1245 .id = 2,
1246 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1247 .resource = msm8625_resources_sdc2,
1248 .dev = {
1249 .coherent_dma_mask = 0xffffffff,
1250 },
1251};
1252
1253struct platform_device msm8625_device_sdc3 = {
1254 .name = "msm_sdcc",
1255 .id = 3,
1256 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1257 .resource = msm8625_resources_sdc3,
1258 .dev = {
1259 .coherent_dma_mask = 0xffffffff,
1260 },
1261};
1262
1263struct platform_device msm8625_device_sdc4 = {
1264 .name = "msm_sdcc",
1265 .id = 4,
1266 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1267 .resource = msm8625_resources_sdc4,
1268 .dev = {
1269 .coherent_dma_mask = 0xffffffff,
1270 },
1271};
1272
1273static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1274 &msm8625_device_sdc1,
1275 &msm8625_device_sdc2,
1276 &msm8625_device_sdc3,
1277 &msm8625_device_sdc4,
1278};
1279
1280int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1281{
1282 struct platform_device *pdev;
1283
1284 if (controller < 1 || controller > 4)
1285 return -EINVAL;
1286
1287 if (cpu_is_msm8625())
1288 pdev = msm8625_sdcc_devices[controller-1];
1289 else
1290 pdev = msm_sdcc_devices[controller-1];
1291
1292 pdev->dev.platform_data = plat;
1293 return platform_device_register(pdev);
1294}
1295
Trilok Sonida63a8b2012-02-13 20:50:03 +05301296static struct resource msm8625_resources_hsusb_otg[] = {
1297 {
1298 .start = MSM_HSUSB_PHYS,
1299 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1300 .flags = IORESOURCE_MEM,
1301 },
1302 {
1303 .start = MSM8625_INT_USB_HS,
1304 .end = MSM8625_INT_USB_HS,
1305 .flags = IORESOURCE_IRQ,
1306 },
1307};
1308
1309struct platform_device msm8625_device_otg = {
1310 .name = "msm_otg",
1311 .id = -1,
1312 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1313 .resource = msm8625_resources_hsusb_otg,
1314 .dev = {
1315 .dma_mask = &dma_mask,
1316 .coherent_dma_mask = 0xffffffffULL,
1317 },
1318};
1319
1320static struct resource msm8625_resources_gadget_peripheral[] = {
1321 {
1322 .start = MSM_HSUSB_PHYS,
1323 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1324 .flags = IORESOURCE_MEM,
1325 },
1326 {
1327 .start = MSM8625_INT_USB_HS,
1328 .end = MSM8625_INT_USB_HS,
1329 .flags = IORESOURCE_IRQ,
1330 },
1331};
1332
1333struct platform_device msm8625_device_gadget_peripheral = {
1334 .name = "msm_hsusb",
1335 .id = -1,
1336 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1337 .resource = msm8625_resources_gadget_peripheral,
1338 .dev = {
1339 .dma_mask = &dma_mask,
1340 .coherent_dma_mask = 0xffffffffULL,
1341 },
1342};
1343
1344static struct resource msm8625_resources_hsusb_host[] = {
1345 {
1346 .start = MSM_HSUSB_PHYS,
1347 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1348 .flags = IORESOURCE_MEM,
1349 },
1350 {
1351 .start = MSM8625_INT_USB_HS,
1352 .end = MSM8625_INT_USB_HS,
1353 .flags = IORESOURCE_IRQ,
1354 },
1355};
1356
1357struct platform_device msm8625_device_hsusb_host = {
1358 .name = "msm_hsusb_host",
1359 .id = 0,
1360 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1361 .resource = msm8625_resources_hsusb_host,
1362 .dev = {
1363 .dma_mask = &dma_mask,
1364 .coherent_dma_mask = 0xffffffffULL,
1365 },
1366};
1367
1368static struct platform_device *msm8625_host_devices[] = {
1369 &msm8625_device_hsusb_host,
1370};
1371
1372int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1373{
1374 struct platform_device *pdev;
1375
1376 if (cpu_is_msm8625())
1377 pdev = msm8625_host_devices[host];
1378 else
1379 pdev = msm_host_devices[host];
1380 if (!pdev)
1381 return -ENODEV;
1382 pdev->dev.platform_data = plat;
1383 return platform_device_register(pdev);
1384}
1385
Trilok Soni88da2552012-02-13 21:01:24 +05301386#ifdef CONFIG_MSM_CAMERA_V4L2
1387static struct resource msm8625_csic0_resources[] = {
1388 {
1389 .name = "csic",
1390 .start = 0xA0F00000,
1391 .end = 0xA0F00000 + 0x00100000 - 1,
1392 .flags = IORESOURCE_MEM,
1393 },
1394 {
1395 .name = "csic",
1396 .start = MSM8625_INT_CSI_IRQ_0,
1397 .end = MSM8625_INT_CSI_IRQ_0,
1398 .flags = IORESOURCE_IRQ,
1399 },
1400};
1401
1402static struct resource msm8625_csic1_resources[] = {
1403 {
1404 .name = "csic",
1405 .start = 0xA1000000,
1406 .end = 0xA1000000 + 0x00100000 - 1,
1407 .flags = IORESOURCE_MEM,
1408 },
1409 {
1410 .name = "csic",
1411 .start = MSM8625_INT_CSI_IRQ_1,
1412 .end = MSM8625_INT_CSI_IRQ_1,
1413 .flags = IORESOURCE_IRQ,
1414 },
1415};
1416
1417struct platform_device msm8625_device_csic0 = {
1418 .name = "msm_csic",
1419 .id = 0,
1420 .resource = msm8625_csic0_resources,
1421 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1422};
1423
1424struct platform_device msm8625_device_csic1 = {
1425 .name = "msm_csic",
1426 .id = 1,
1427 .resource = msm8625_csic1_resources,
1428 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1429};
1430#endif
1431
Trilok Soniae4633d2012-02-13 21:08:32 +05301432static struct resource msm8625_mipi_dsi_resources[] = {
1433 {
1434 .name = "mipi_dsi",
1435 .start = MIPI_DSI_HW_BASE,
1436 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1437 .flags = IORESOURCE_MEM,
1438 },
1439 {
1440 .start = MSM8625_INT_DSI_IRQ,
1441 .end = MSM8625_INT_DSI_IRQ,
1442 .flags = IORESOURCE_IRQ,
1443 },
1444};
1445
1446static struct platform_device msm8625_mipi_dsi_device = {
1447 .name = "mipi_dsi",
1448 .id = 1,
1449 .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources),
1450 .resource = msm8625_mipi_dsi_resources,
1451};
1452
1453static struct resource msm8625_mdp_resources[] = {
1454 {
1455 .name = "mdp",
1456 .start = MDP_BASE,
1457 .end = MDP_BASE + 0x000F1008 - 1,
1458 .flags = IORESOURCE_MEM,
1459 },
1460 {
1461 .start = MSM8625_INT_MDP,
1462 .end = MSM8625_INT_MDP,
1463 .flags = IORESOURCE_IRQ,
1464 },
1465};
1466
1467static struct platform_device msm8625_mdp_device = {
1468 .name = "mdp",
1469 .id = 0,
1470 .num_resources = ARRAY_SIZE(msm8625_mdp_resources),
1471 .resource = msm8625_mdp_resources,
1472};
1473
1474void __init msm_fb_register_device(char *name, void *data)
1475{
1476 if (!strncmp(name, "mdp", 3)) {
1477 if (cpu_is_msm8625())
1478 msm_register_device(&msm8625_mdp_device, data);
1479 else
1480 msm_register_device(&msm_mdp_device, data);
1481 } else if (!strncmp(name, "mipi_dsi", 8)) {
1482 if (cpu_is_msm8625())
1483 msm_register_device(&msm8625_mipi_dsi_device, data);
1484 else
1485 msm_register_device(&msm_mipi_dsi_device, data);
1486 } else if (!strncmp(name, "lcdc", 4)) {
1487 msm_register_device(&msm_lcdc_device, data);
1488 } else {
1489 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1490 }
1491}
1492
Trilok Soni664b95d2012-02-13 21:13:15 +05301493static struct resource msm8625_kgsl_3d0_resources[] = {
1494 {
1495 .name = KGSL_3D0_REG_MEMORY,
1496 .start = 0xA0000000,
1497 .end = 0xA001ffff,
1498 .flags = IORESOURCE_MEM,
1499 },
1500 {
1501 .name = KGSL_3D0_IRQ,
1502 .start = MSM8625_INT_GRAPHICS,
1503 .end = MSM8625_INT_GRAPHICS,
1504 .flags = IORESOURCE_IRQ,
1505 },
1506};
1507
1508struct platform_device msm8625_kgsl_3d0 = {
1509 .name = "kgsl-3d0",
1510 .id = 0,
1511 .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources),
1512 .resource = msm8625_kgsl_3d0_resources,
1513 .dev = {
1514 .platform_data = &kgsl_3d0_pdata,
1515 },
1516};
1517
Taniya Das7c9f0512011-12-02 14:26:46 +05301518static struct clk_lookup msm_clock_8625_dummy[] = {
1519 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1520 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1521 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1522 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1523 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1524 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1525 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1526 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1527 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1528 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1529 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1530 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1531 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1532 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1533 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1534 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1535 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1536 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1537 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1538 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1539 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1540 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1541 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1542 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1543 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1544 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1545 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1546 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1547 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1548 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1549 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1550 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1551 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1552 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1553 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1554 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1555 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1556 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1557 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1558 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1559 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1560 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1561 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1562 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1563 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1564 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1565 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1566 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1567 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1568 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1569 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1570 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1571 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1572 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1573 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1574 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1575 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1576 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1577 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1578};
1579
1580struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1581 .table = msm_clock_8625_dummy,
1582 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1583};
1584
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301585enum {
1586 MSM8625,
1587 MSM8625A,
1588};
1589
1590static int __init msm8625_cpu_id(void)
1591{
1592 int raw_id, cpu;
1593
1594 raw_id = socinfo_get_raw_id();
1595 switch (raw_id) {
1596 /* Part number for 1GHz part */
1597 case 0x770:
1598 case 0x771:
1599 case 0x780:
1600 cpu = MSM8625;
1601 break;
1602 /* Part number for 1.2GHz part */
1603 case 0x773:
1604 case 0x774:
1605 case 0x781:
1606 cpu = MSM8625A;
1607 break;
1608 default:
1609 pr_err("Invalid Raw ID\n");
1610 return -ENODEV;
1611 }
1612 return cpu;
1613}
1614
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001615int __init msm7x2x_misc_init(void)
1616{
Taniya Das7c9f0512011-12-02 14:26:46 +05301617 if (machine_is_msm8625_rumi3()) {
1618 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301619 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301620 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301621
Stephen Boydbb600ae2011-08-02 20:11:40 -07001622 msm_clock_init(&msm7x27a_clock_init_data);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301623 if (cpu_is_msm7x27aa())
Matt Wagantallec57f062011-08-16 23:54:46 -07001624 acpuclk_init(&acpuclk_7x27aa_soc_data);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301625 else if (cpu_is_msm8625()) {
1626 if (msm8625_cpu_id() == MSM8625)
1627 acpuclk_init(&acpuclk_7x27aa_soc_data);
1628 else if (msm8625_cpu_id() == MSM8625A)
1629 acpuclk_init(&acpuclk_8625_soc_data);
1630 } else {
Matt Wagantallec57f062011-08-16 23:54:46 -07001631 acpuclk_init(&acpuclk_7x27a_soc_data);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301632 }
Matt Wagantallec57f062011-08-16 23:54:46 -07001633
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001634
1635 return 0;
1636}
1637
1638#ifdef CONFIG_CACHE_L2X0
1639static int __init msm7x27x_cache_init(void)
1640{
1641 int aux_ctrl = 0;
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301642 int pctrl = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001643
1644 /* Way Size 010(0x2) 32KB */
1645 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1646 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1647 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1648
Taniya Das379b5682011-12-02 14:53:46 +05301649 if (cpu_is_msm8625()) {
1650 /* Way Size 011(0x3) 64KB */
1651 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1652 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301653 (0X1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | \
1654 (0x1 << L2X0_AUX_CTRL_L2_FORCE_NWA_SHIFT);
1655
1656 /* Write Prefetch Control settings */
1657 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1658 pctrl |= (0x3 << L2X0_PREFETCH_CTRL_OFFSET_SHIFT) | \
1659 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_INC_SHIFT) | \
1660 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_SHIFT);
1661 writel_relaxed(pctrl , MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
Taniya Das379b5682011-12-02 14:53:46 +05301662 }
1663
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001664 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301665 if (cpu_is_msm8625()) {
1666 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1667 pr_info("Prfetch Ctrl: 0x%08x\n", pctrl);
1668 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001669
1670 return 0;
1671}
1672#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301673static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001674#endif
1675
1676void __init msm_common_io_init(void)
1677{
1678 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301679 if (socinfo_init() < 0)
1680 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001681 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301682}
1683
1684void __init msm8625_init_irq(void)
1685{
Taniya Dasfcb35002012-03-09 15:28:12 +05301686 msm_gic_irq_extn_init(MSM_QGIC_DIST_BASE, MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301687 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1688 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301689}
1690
1691void __init msm8625_map_io(void)
1692{
1693 msm_map_msm8625_io();
1694
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001695 if (socinfo_init() < 0)
1696 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301697 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001698}
1699
Taniya Das43bcdd62011-12-02 17:33:27 +05301700static int msm7627a_init_gpio(void)
1701{
Taniya Das6684d622012-01-12 10:29:09 +05301702 if (cpu_is_msm8625())
1703 platform_device_register(&msm8625_device_gpio);
1704 else
1705 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301706 return 0;
1707}
1708postcore_initcall(msm7627a_init_gpio);
Taniya Das9d0c3c52012-05-04 14:40:55 +05301709
1710static int msm7627a_panic_handler(struct notifier_block *this,
1711 unsigned long event, void *ptr)
1712{
1713 flush_cache_all();
1714 outer_flush_all();
1715 return NOTIFY_DONE;
1716}
1717
1718static struct notifier_block panic_handler = {
1719 .notifier_call = msm7627a_panic_handler,
1720};
1721
1722static int __init panic_register(void)
1723{
1724 atomic_notifier_chain_register(&panic_notifier_list,
1725 &panic_handler);
1726 return 0;
1727}
1728module_init(panic_register);