blob: 553f52f02a42fbccc6ad0aac43fff0a15f28e788 [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
Matt Wagantallbf430eb2012-03-22 11:45:49 -0700214static struct acpuclk_pdata msm7x27a_acpuclk_pdata = {
215 .max_speed_delta_khz = 400000,
216};
217
218struct platform_device msm7x27a_device_acpuclk = {
219 .name = "acpuclk-7627",
220 .id = -1,
221 .dev.platform_data = &msm7x27a_acpuclk_pdata,
222};
223
224static struct acpuclk_pdata msm7x27aa_acpuclk_pdata = {
225 .max_speed_delta_khz = 504000,
226};
227
228struct platform_device msm7x27aa_device_acpuclk = {
229 .name = "acpuclk-7627",
230 .id = -1,
231 .dev.platform_data = &msm7x27aa_acpuclk_pdata,
232};
233
234static struct acpuclk_pdata msm8625_acpuclk_pdata = {
235 /* TODO: Need to update speed delta from H/w Team */
236 .max_speed_delta_khz = 604800,
237};
238
239struct platform_device msm8625_device_acpuclk = {
240 .name = "acpuclk-7627",
241 .id = -1,
242 .dev.platform_data = &msm8625_acpuclk_pdata,
243};
244
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700245struct platform_device msm_device_smd = {
246 .name = "msm_smd",
247 .id = -1,
248};
249
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530250static struct resource smd_8625_resource[] = {
251 {
252 .name = "a9_m2a_0",
253 .start = MSM8625_INT_A9_M2A_0,
254 .flags = IORESOURCE_IRQ,
255 },
256 {
257 .name = "a9_m2a_5",
258 .start = MSM8625_INT_A9_M2A_5,
259 .flags = IORESOURCE_IRQ,
260 },
261};
262
263static struct smd_subsystem_config smd_8625_config_list[] = {
264 {
265 .irq_config_id = SMD_MODEM,
266 .subsys_name = "modem",
267 .edge = SMD_APPS_MODEM,
268
269 .smd_int.irq_name = "a9_m2a_0",
270 .smd_int.flags = IRQF_TRIGGER_RISING,
271 .smd_int.irq_id = -1,
272 .smd_int.device_name = "smd_dev",
273 .smd_int.dev_id = 0,
274
275 .smd_int.out_bit_pos = 1,
276 .smd_int.out_base = (void __iomem *)MSM_CSR_BASE,
277 .smd_int.out_offset = 0x400 + (0) * 4,
278
279 .smsm_int.irq_name = "a9_m2a_5",
280 .smsm_int.flags = IRQF_TRIGGER_RISING,
281 .smsm_int.irq_id = -1,
282 .smsm_int.device_name = "smsm_dev",
283 .smsm_int.dev_id = 0,
284
285 .smsm_int.out_bit_pos = 1,
286 .smsm_int.out_base = (void __iomem *)MSM_CSR_BASE,
287 .smsm_int.out_offset = 0x400 + (5) * 4,
288
289 }
290};
291
292static struct smd_platform smd_8625_platform_data = {
293 .num_ss_configs = ARRAY_SIZE(smd_8625_config_list),
294 .smd_ss_configs = smd_8625_config_list,
295};
296
297struct platform_device msm8625_device_smd = {
298 .name = "msm_smd",
299 .id = -1,
300 .resource = smd_8625_resource,
301 .num_resources = ARRAY_SIZE(smd_8625_resource),
302 .dev = {
303 .platform_data = &smd_8625_platform_data,
304 }
305};
306
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +0530307static struct resource resources_adsp[] = {
308 {
309 .start = INT_ADSP_A9_A11,
310 .end = INT_ADSP_A9_A11,
311 .flags = IORESOURCE_IRQ,
312 },
313};
314
315struct platform_device msm_adsp_device = {
316 .name = "msm_adsp",
317 .id = -1,
318 .num_resources = ARRAY_SIZE(resources_adsp),
319 .resource = resources_adsp,
320};
321
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700322static struct resource resources_uart1[] = {
323 {
324 .start = INT_UART1,
325 .end = INT_UART1,
326 .flags = IORESOURCE_IRQ,
327 },
328 {
Taniya Das13b811a2011-12-09 18:33:45 +0530329 .start = MSM7XXX_UART1_PHYS,
330 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700331 .flags = IORESOURCE_MEM,
332 },
333};
334
335struct platform_device msm_device_uart1 = {
336 .name = "msm_serial",
337 .id = 0,
338 .num_resources = ARRAY_SIZE(resources_uart1),
339 .resource = resources_uart1,
340};
341
342#define MSM_UART1DM_PHYS 0xA0200000
343static struct resource msm_uart1_dm_resources[] = {
344 {
345 .start = MSM_UART1DM_PHYS,
346 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
347 .flags = IORESOURCE_MEM,
348 },
349 {
350 .start = INT_UART1DM_IRQ,
351 .end = INT_UART1DM_IRQ,
352 .flags = IORESOURCE_IRQ,
353 },
354 {
355 .start = INT_UART1DM_RX,
356 .end = INT_UART1DM_RX,
357 .flags = IORESOURCE_IRQ,
358 },
359 {
360 .start = DMOV_HSUART1_TX_CHAN,
361 .end = DMOV_HSUART1_RX_CHAN,
362 .name = "uartdm_channels",
363 .flags = IORESOURCE_DMA,
364 },
365 {
366 .start = DMOV_HSUART1_TX_CRCI,
367 .end = DMOV_HSUART1_RX_CRCI,
368 .name = "uartdm_crci",
369 .flags = IORESOURCE_DMA,
370 },
371};
372
373static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32);
374struct platform_device msm_device_uart_dm1 = {
375 .name = "msm_serial_hs",
376 .id = 0,
377 .num_resources = ARRAY_SIZE(msm_uart1_dm_resources),
378 .resource = msm_uart1_dm_resources,
379 .dev = {
380 .dma_mask = &msm_uart_dm1_dma_mask,
381 .coherent_dma_mask = DMA_BIT_MASK(32),
382 },
383};
384
385#define MSM_UART2DM_PHYS 0xA0300000
386static struct resource msm_uart2dm_resources[] = {
387 {
388 .start = MSM_UART2DM_PHYS,
389 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
390 .name = "uartdm_resource",
391 .flags = IORESOURCE_MEM,
392 },
393 {
394 .start = INT_UART2DM_IRQ,
395 .end = INT_UART2DM_IRQ,
396 .flags = IORESOURCE_IRQ,
397 },
398};
399
400struct platform_device msm_device_uart_dm2 = {
401 .name = "msm_serial_hsl",
402 .id = 0,
403 .num_resources = ARRAY_SIZE(msm_uart2dm_resources),
404 .resource = msm_uart2dm_resources,
405};
406
407#define MSM_NAND_PHYS 0xA0A00000
408#define MSM_NANDC01_PHYS 0xA0A40000
409#define MSM_NANDC10_PHYS 0xA0A80000
410#define MSM_NANDC11_PHYS 0xA0AC0000
411#define EBI2_REG_BASE 0xA0D00000
412static struct resource resources_nand[] = {
413 [0] = {
414 .name = "msm_nand_dmac",
415 .start = DMOV_NAND_CHAN,
416 .end = DMOV_NAND_CHAN,
417 .flags = IORESOURCE_DMA,
418 },
419 [1] = {
420 .name = "msm_nand_phys",
421 .start = MSM_NAND_PHYS,
422 .end = MSM_NAND_PHYS + 0x7FF,
423 .flags = IORESOURCE_MEM,
424 },
425 [2] = {
426 .name = "msm_nandc01_phys",
427 .start = MSM_NANDC01_PHYS,
428 .end = MSM_NANDC01_PHYS + 0x7FF,
429 .flags = IORESOURCE_MEM,
430 },
431 [3] = {
432 .name = "msm_nandc10_phys",
433 .start = MSM_NANDC10_PHYS,
434 .end = MSM_NANDC10_PHYS + 0x7FF,
435 .flags = IORESOURCE_MEM,
436 },
437 [4] = {
438 .name = "msm_nandc11_phys",
439 .start = MSM_NANDC11_PHYS,
440 .end = MSM_NANDC11_PHYS + 0x7FF,
441 .flags = IORESOURCE_MEM,
442 },
443 [5] = {
444 .name = "ebi2_reg_base",
445 .start = EBI2_REG_BASE,
446 .end = EBI2_REG_BASE + 0x60,
447 .flags = IORESOURCE_MEM,
448 },
449};
450
Sujit Reddy Thummaec9b3252012-04-23 15:53:45 +0530451struct flash_platform_data msm_nand_data = {
452 .version = VERSION_2,
453};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700454
455struct platform_device msm_device_nand = {
456 .name = "msm_nand",
457 .id = -1,
458 .num_resources = ARRAY_SIZE(resources_nand),
459 .resource = resources_nand,
460 .dev = {
461 .platform_data = &msm_nand_data,
462 },
463};
464
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530465static struct msm_pm_irq_calls msm7x27a_pm_irq_calls = {
466 .irq_pending = msm_irq_pending,
467 .idle_sleep_allowed = msm_irq_idle_sleep_allowed,
468 .enter_sleep1 = msm_irq_enter_sleep1,
469 .enter_sleep2 = msm_irq_enter_sleep2,
470 .exit_sleep1 = msm_irq_exit_sleep1,
471 .exit_sleep2 = msm_irq_exit_sleep2,
472 .exit_sleep3 = msm_irq_exit_sleep3,
473};
474
475static struct msm_pm_irq_calls msm8625_pm_irq_calls = {
476 .irq_pending = msm_gic_spi_ppi_pending,
477 .idle_sleep_allowed = msm_gic_irq_idle_sleep_allowed,
478 .enter_sleep1 = msm_gic_irq_enter_sleep1,
479 .enter_sleep2 = msm_gic_irq_enter_sleep2,
480 .exit_sleep1 = msm_gic_irq_exit_sleep1,
481 .exit_sleep2 = msm_gic_irq_exit_sleep2,
482 .exit_sleep3 = msm_gic_irq_exit_sleep3,
483};
484
Stephen Boyd986c9632012-04-24 16:31:45 -0700485void __init msm_pm_register_irqs(void)
Murali Nalajala2a0bbda2012-03-28 12:12:54 +0530486{
487 if (cpu_is_msm8625())
488 msm_pm_set_irq_extns(&msm8625_pm_irq_calls);
489 else
490 msm_pm_set_irq_extns(&msm7x27a_pm_irq_calls);
491
492}
493
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700494#define MSM_SDC1_BASE 0xA0400000
495#define MSM_SDC2_BASE 0xA0500000
496#define MSM_SDC3_BASE 0xA0600000
497#define MSM_SDC4_BASE 0xA0700000
498static struct resource resources_sdc1[] = {
499 {
500 .start = MSM_SDC1_BASE,
501 .end = MSM_SDC1_BASE + SZ_4K - 1,
502 .flags = IORESOURCE_MEM,
503 },
504 {
505 .start = INT_SDC1_0,
506 .end = INT_SDC1_1,
507 .flags = IORESOURCE_IRQ,
508 },
509 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700510 .name = "sdcc_dma_chnl",
511 .start = DMOV_SDC1_CHAN,
512 .end = DMOV_SDC1_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700513 .flags = IORESOURCE_DMA,
514 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700515 {
516 .name = "sdcc_dma_crci",
517 .start = DMOV_SDC1_CRCI,
518 .end = DMOV_SDC1_CRCI,
519 .flags = IORESOURCE_DMA,
520 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700521};
522
523static struct resource resources_sdc2[] = {
524 {
525 .start = MSM_SDC2_BASE,
526 .end = MSM_SDC2_BASE + SZ_4K - 1,
527 .flags = IORESOURCE_MEM,
528 },
529 {
530 .start = INT_SDC2_0,
531 .end = INT_SDC2_1,
532 .flags = IORESOURCE_IRQ,
533 },
534 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700535 .name = "sdcc_dma_chnl",
536 .start = DMOV_SDC2_CHAN,
537 .end = DMOV_SDC2_CHAN,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700538 .flags = IORESOURCE_DMA,
539 },
Krishna Konda25786ec2011-07-25 16:21:36 -0700540 {
541 .name = "sdcc_dma_crci",
542 .start = DMOV_SDC2_CRCI,
543 .end = DMOV_SDC2_CRCI,
544 .flags = IORESOURCE_DMA,
545 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546};
547
548static struct resource resources_sdc3[] = {
549 {
550 .start = MSM_SDC3_BASE,
551 .end = MSM_SDC3_BASE + SZ_4K - 1,
552 .flags = IORESOURCE_MEM,
553 },
554 {
555 .start = INT_SDC3_0,
556 .end = INT_SDC3_1,
557 .flags = IORESOURCE_IRQ,
558 },
559 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700560 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530561 .start = DMOV_SDC3_CHAN,
562 .end = DMOV_SDC3_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700563 .flags = IORESOURCE_DMA,
564 },
565 {
566 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530567 .start = DMOV_SDC3_CRCI,
568 .end = DMOV_SDC3_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700569 .flags = IORESOURCE_DMA,
570 },
571};
572
573static struct resource resources_sdc4[] = {
574 {
575 .start = MSM_SDC4_BASE,
576 .end = MSM_SDC4_BASE + SZ_4K - 1,
577 .flags = IORESOURCE_MEM,
578 },
579 {
580 .start = INT_SDC4_0,
581 .end = INT_SDC4_1,
582 .flags = IORESOURCE_IRQ,
583 },
584 {
Krishna Konda25786ec2011-07-25 16:21:36 -0700585 .name = "sdcc_dma_chnl",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530586 .start = DMOV_SDC4_CHAN,
587 .end = DMOV_SDC4_CHAN,
Krishna Konda25786ec2011-07-25 16:21:36 -0700588 .flags = IORESOURCE_DMA,
589 },
590 {
591 .name = "sdcc_dma_crci",
Sujit Reddy Thumma119bfbb2011-10-12 11:52:21 +0530592 .start = DMOV_SDC4_CRCI,
593 .end = DMOV_SDC4_CRCI,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700594 .flags = IORESOURCE_DMA,
595 },
596};
597
598struct platform_device msm_device_sdc1 = {
599 .name = "msm_sdcc",
600 .id = 1,
601 .num_resources = ARRAY_SIZE(resources_sdc1),
602 .resource = resources_sdc1,
603 .dev = {
604 .coherent_dma_mask = 0xffffffff,
605 },
606};
607
608struct platform_device msm_device_sdc2 = {
609 .name = "msm_sdcc",
610 .id = 2,
611 .num_resources = ARRAY_SIZE(resources_sdc2),
612 .resource = resources_sdc2,
613 .dev = {
614 .coherent_dma_mask = 0xffffffff,
615 },
616};
617
618struct platform_device msm_device_sdc3 = {
619 .name = "msm_sdcc",
620 .id = 3,
621 .num_resources = ARRAY_SIZE(resources_sdc3),
622 .resource = resources_sdc3,
623 .dev = {
624 .coherent_dma_mask = 0xffffffff,
625 },
626};
627
628struct platform_device msm_device_sdc4 = {
629 .name = "msm_sdcc",
630 .id = 4,
631 .num_resources = ARRAY_SIZE(resources_sdc4),
632 .resource = resources_sdc4,
633 .dev = {
634 .coherent_dma_mask = 0xffffffff,
635 },
636};
637
638static struct platform_device *msm_sdcc_devices[] __initdata = {
639 &msm_device_sdc1,
640 &msm_device_sdc2,
641 &msm_device_sdc3,
642 &msm_device_sdc4,
643};
644
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530645#ifdef CONFIG_MSM_CAMERA_V4L2
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530646static int apps_reset;
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530647static struct resource msm_csic0_resources[] = {
648 {
649 .name = "csic",
650 .start = 0xA0F00000,
651 .end = 0xA0F00000 + 0x00100000 - 1,
652 .flags = IORESOURCE_MEM,
653 },
654 {
655 .name = "csic",
656 .start = INT_CSI_IRQ_0,
657 .end = INT_CSI_IRQ_0,
658 .flags = IORESOURCE_IRQ,
659 },
660};
661
662static struct resource msm_csic1_resources[] = {
663 {
664 .name = "csic",
665 .start = 0xA1000000,
666 .end = 0xA1000000 + 0x00100000 - 1,
667 .flags = IORESOURCE_MEM,
668 },
669 {
670 .name = "csic",
671 .start = INT_CSI_IRQ_1,
672 .end = INT_CSI_IRQ_1,
673 .flags = IORESOURCE_IRQ,
674 },
675};
676
677struct platform_device msm7x27a_device_csic0 = {
678 .name = "msm_csic",
679 .id = 0,
680 .resource = msm_csic0_resources,
681 .num_resources = ARRAY_SIZE(msm_csic0_resources),
682};
683
684struct platform_device msm7x27a_device_csic1 = {
685 .name = "msm_csic",
686 .id = 1,
687 .resource = msm_csic1_resources,
688 .num_resources = ARRAY_SIZE(msm_csic1_resources),
689};
690
691static struct resource msm_clkctl_resources[] = {
692 {
693 .name = "clk_ctl",
Taniya Das13b811a2011-12-09 18:33:45 +0530694 .start = MSM7XXX_CLK_CTL_PHYS,
695 .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1,
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530696 .flags = IORESOURCE_MEM,
697 },
698};
699struct platform_device msm7x27a_device_clkctl = {
700 .name = "msm_clk_ctl",
701 .id = 0,
702 .resource = msm_clkctl_resources,
703 .num_resources = ARRAY_SIZE(msm_clkctl_resources),
Suresh Vankadara6050cef52012-04-16 21:44:59 +0530704 .dev = {
705 .platform_data = &apps_reset,
706 },
Suresh Vankadara20cd3be72012-01-18 00:34:06 +0530707};
708
709struct platform_device msm7x27a_device_vfe = {
710 .name = "msm_vfe",
711 .id = 0,
712};
713
714#endif
715
Murali Nalajala41786ab2012-03-06 10:47:32 +0530716/* Command sequence for simple WFI */
717static uint8_t spm_wfi_cmd_sequence[] __initdata = {
Murali Nalajala2250a272012-03-13 15:56:59 +0530718 0x04, 0x03, 0x04, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530719};
720
721/* Command sequence for GDFS, this won't send any interrupt to the modem */
722static uint8_t spm_pc_without_modem[] __initdata = {
723 0x20, 0x00, 0x30, 0x10,
Murali Nalajala2250a272012-03-13 15:56:59 +0530724 0x03, 0x1e, 0x0e, 0x3e,
725 0x4e, 0x4e, 0x4e, 0x4e,
726 0x4e, 0x4e, 0x4e, 0x4e,
727 0x4e, 0x4e, 0x4e, 0x4e,
728 0x4e, 0x4e, 0x4e, 0x4e,
729 0x2E, 0x0f,
Murali Nalajala41786ab2012-03-06 10:47:32 +0530730};
731
732static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
733 [0] = {
734 .mode = MSM_SPM_MODE_CLOCK_GATING,
735 .notify_rpm = false,
736 .cmd = spm_wfi_cmd_sequence,
737 },
738 [1] = {
739 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
740 .notify_rpm = false,
741 .cmd = spm_pc_without_modem,
742 },
743};
744
745static struct msm_spm_platform_data msm_spm_data[] __initdata = {
746 [0] = {
747 .reg_base_addr = MSM_SAW0_BASE,
748 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
749 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
750 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
751 .modes = msm_spm_seq_list,
752 },
753 [1] = {
754 .reg_base_addr = MSM_SAW1_BASE,
755 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0,
756 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
757 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
758 .modes = msm_spm_seq_list,
759 },
760};
761
762void __init msm8x25_spm_device_init(void)
763{
764 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
765}
766
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700767#define MDP_BASE 0xAA200000
768#define MIPI_DSI_HW_BASE 0xA1100000
769
770static struct resource msm_mipi_dsi_resources[] = {
771 {
772 .name = "mipi_dsi",
773 .start = MIPI_DSI_HW_BASE,
774 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
775 .flags = IORESOURCE_MEM,
776 },
777 {
778 .start = INT_DSI_IRQ,
779 .end = INT_DSI_IRQ,
780 .flags = IORESOURCE_IRQ,
781 },
782};
783
784static struct platform_device msm_mipi_dsi_device = {
785 .name = "mipi_dsi",
786 .id = 1,
787 .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources),
788 .resource = msm_mipi_dsi_resources,
789};
790
791static struct resource msm_mdp_resources[] = {
792 {
793 .name = "mdp",
794 .start = MDP_BASE,
795 .end = MDP_BASE + 0x000F1008 - 1,
796 .flags = IORESOURCE_MEM,
797 },
798 {
799 .start = INT_MDP,
800 .end = INT_MDP,
801 .flags = IORESOURCE_IRQ,
802 },
803};
804
805static struct platform_device msm_mdp_device = {
806 .name = "mdp",
807 .id = 0,
808 .num_resources = ARRAY_SIZE(msm_mdp_resources),
809 .resource = msm_mdp_resources,
810};
811
812static struct platform_device msm_lcdc_device = {
813 .name = "lcdc",
814 .id = 0,
815};
816
817static struct resource kgsl_3d0_resources[] = {
818 {
819 .name = KGSL_3D0_REG_MEMORY,
820 .start = 0xA0000000,
821 .end = 0xA001ffff,
822 .flags = IORESOURCE_MEM,
823 },
824 {
825 .name = KGSL_3D0_IRQ,
826 .start = INT_GRAPHICS,
827 .end = INT_GRAPHICS,
828 .flags = IORESOURCE_IRQ,
829 },
830};
831
832static struct kgsl_device_platform_data kgsl_3d0_pdata = {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600833 .pwrlevel = {
834 {
835 .gpu_freq = 245760000,
836 .bus_freq = 200000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700837 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600838 {
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530839 .gpu_freq = 192000000,
840 .bus_freq = 160000000,
841 },
842 {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600843 .gpu_freq = 133330000,
844 .bus_freq = 0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700845 },
846 },
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600847 .init_level = 0,
Lynus Vazeaf0aac2012-01-05 12:28:47 +0530848 .num_levels = 3,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600849 .set_grp_async = set_grp_xbar_async,
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700850 .idle_timeout = HZ,
Lynus Vazfe4bede2012-04-06 11:53:30 -0700851 .strtstp_sleepwake = true,
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600852 .nap_allowed = false,
853 .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700854};
855
856struct platform_device msm_kgsl_3d0 = {
857 .name = "kgsl-3d0",
858 .id = 0,
859 .num_resources = ARRAY_SIZE(kgsl_3d0_resources),
860 .resource = kgsl_3d0_resources,
861 .dev = {
862 .platform_data = &kgsl_3d0_pdata,
863 },
864};
865
866void __init msm7x25a_kgsl_3d0_init(void)
867{
Pankaj Kumarfee56a82012-04-17 14:26:49 +0530868 if (cpu_is_msm7x25a() || cpu_is_msm7x25aa() || cpu_is_msm7x25ab()) {
Lynus Vaz971610e2012-01-06 11:00:32 +0530869 kgsl_3d0_pdata.num_levels = 2;
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -0600870 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000;
871 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000;
872 kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000;
873 kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0;
Rajesh Kemisettidf6e62f2012-03-12 14:02:30 +0530874 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700875}
876
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700877void __init msm8x25_kgsl_3d0_init(void)
878{
Lynus Vazfe4bede2012-04-06 11:53:30 -0700879 if (cpu_is_msm8625()) {
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700880 kgsl_3d0_pdata.idle_timeout = HZ/5;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700881 kgsl_3d0_pdata.strtstp_sleepwake = false;
Ranjhith Kalisamy24696322012-04-11 22:09:17 +0530882 /* 8x25 supports a higher GPU frequency */
883 kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 300000000;
884 kgsl_3d0_pdata.pwrlevel[0].bus_freq = 200000000;
Lynus Vazfe4bede2012-04-06 11:53:30 -0700885 }
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -0700886}
887
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700888static void __init msm_register_device(struct platform_device *pdev, void *data)
889{
890 int ret;
891
892 pdev->dev.platform_data = data;
893
894 ret = platform_device_register(pdev);
895
896 if (ret)
897 dev_err(&pdev->dev,
898 "%s: platform_device_register() failed = %d\n",
899 __func__, ret);
900}
901
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700902
903#define PERPH_WEB_BLOCK_ADDR (0xA9D00040)
904#define PDM0_CTL_OFFSET (0x04)
905#define SIZE_8B (0x08)
906
907static struct resource resources_led[] = {
908 {
909 .start = PERPH_WEB_BLOCK_ADDR,
910 .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1,
911 .name = "led-gpio-pdm",
912 .flags = IORESOURCE_MEM,
913 },
914};
915
916static struct led_info msm_kpbl_pdm_led_pdata = {
917 .name = "keyboard-backlight",
918};
919
920struct platform_device led_pdev = {
921 .name = "leds-msm-pdm",
922 /* use pdev id to represent pdm id */
923 .id = 0,
924 .num_resources = ARRAY_SIZE(resources_led),
925 .resource = resources_led,
926 .dev = {
927 .platform_data = &msm_kpbl_pdm_led_pdata,
928 },
929};
930
Manish Dewangan3a260992011-06-24 18:01:34 +0530931struct platform_device asoc_msm_pcm = {
932 .name = "msm-dsp-audio",
933 .id = 0,
934};
935
936struct platform_device asoc_msm_dai0 = {
937 .name = "msm-codec-dai",
938 .id = 0,
939};
940
941struct platform_device asoc_msm_dai1 = {
942 .name = "msm-cpu-dai",
943 .id = 0,
944};
945
Taniya Das2e948192011-12-20 11:15:13 +0530946static struct resource gpio_resources[] = {
947 {
948 .start = INT_GPIO_GROUP1,
949 .flags = IORESOURCE_IRQ,
950 },
951 {
952 .start = INT_GPIO_GROUP2,
953 .flags = IORESOURCE_IRQ,
954 },
955};
956
957static struct platform_device msm_device_gpio = {
958 .name = "msmgpio",
959 .id = -1,
960 .resource = gpio_resources,
961 .num_resources = ARRAY_SIZE(gpio_resources),
962};
963
Taniya Das43bcdd62011-12-02 17:33:27 +0530964struct platform_device *msm_footswitch_devices[] = {
Matt Wagantalld6fbf232012-05-03 20:09:28 -0700965 FS_PCOM(FS_GFX3D, "vdd", "kgsl-3d0.0"),
Taniya Das43bcdd62011-12-02 17:33:27 +0530966};
967unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices);
968
969/* MSM8625 Devices */
970
971static struct resource msm8625_resources_uart1[] = {
972 {
973 .start = MSM8625_INT_UART1,
974 .end = MSM8625_INT_UART1,
975 .flags = IORESOURCE_IRQ,
976 },
977 {
Taniya Das13b811a2011-12-09 18:33:45 +0530978 .start = MSM7XXX_UART1_PHYS,
979 .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1,
Taniya Das43bcdd62011-12-02 17:33:27 +0530980 .flags = IORESOURCE_MEM,
981 },
982};
983
984struct platform_device msm8625_device_uart1 = {
985 .name = "msm_serial",
986 .id = 0,
987 .num_resources = ARRAY_SIZE(msm8625_resources_uart1),
988 .resource = msm8625_resources_uart1,
989};
990
Trilok Soni269fff42012-02-13 20:35:30 +0530991static struct resource msm8625_uart1_dm_resources[] = {
992 {
993 .start = MSM_UART1DM_PHYS,
994 .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1,
995 .flags = IORESOURCE_MEM,
996 },
997 {
998 .start = MSM8625_INT_UART1DM_IRQ,
999 .end = MSM8625_INT_UART1DM_IRQ,
1000 .flags = IORESOURCE_IRQ,
1001 },
1002 {
1003 .start = MSM8625_INT_UART1DM_RX,
1004 .end = MSM8625_INT_UART1DM_RX,
1005 .flags = IORESOURCE_IRQ,
1006 },
1007 {
1008 .start = DMOV_HSUART1_TX_CHAN,
1009 .end = DMOV_HSUART1_RX_CHAN,
1010 .name = "uartdm_channels",
1011 .flags = IORESOURCE_DMA,
1012 },
1013 {
1014 .start = DMOV_HSUART1_TX_CRCI,
1015 .end = DMOV_HSUART1_RX_CRCI,
1016 .name = "uartdm_crci",
1017 .flags = IORESOURCE_DMA,
1018 },
1019};
1020
1021struct platform_device msm8625_device_uart_dm1 = {
1022 .name = "msm_serial_hs",
1023 .id = 0,
1024 .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources),
1025 .resource = msm8625_uart1_dm_resources,
1026 .dev = {
1027 .dma_mask = &msm_uart_dm1_dma_mask,
1028 .coherent_dma_mask = DMA_BIT_MASK(32),
1029 },
1030};
1031
1032static struct resource msm8625_uart2dm_resources[] = {
1033 {
1034 .start = MSM_UART2DM_PHYS,
1035 .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1,
1036 .name = "uartdm_resource",
1037 .flags = IORESOURCE_MEM,
1038 },
1039 {
1040 .start = MSM8625_INT_UART2DM_IRQ,
1041 .end = MSM8625_INT_UART2DM_IRQ,
1042 .flags = IORESOURCE_IRQ,
1043 },
1044};
1045
1046struct platform_device msm8625_device_uart_dm2 = {
1047 .name = "msm_serial_hsl",
1048 .id = 0,
1049 .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources),
1050 .resource = msm8625_uart2dm_resources,
1051};
1052
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301053static struct resource msm8625_resources_adsp[] = {
1054 {
1055 .start = MSM8625_INT_ADSP_A9_A11,
1056 .end = MSM8625_INT_ADSP_A9_A11,
1057 .flags = IORESOURCE_IRQ,
1058 },
1059};
1060
1061struct platform_device msm8625_device_adsp = {
1062 .name = "msm_adsp",
1063 .id = -1,
1064 .num_resources = ARRAY_SIZE(msm8625_resources_adsp),
1065 .resource = msm8625_resources_adsp,
1066};
1067
Taniya Das43bcdd62011-12-02 17:33:27 +05301068static struct resource msm8625_dmov_resource[] = {
1069 {
1070 .start = MSM8625_INT_ADM_AARM,
1071 .flags = IORESOURCE_IRQ,
1072 },
1073 {
1074 .start = 0xA9700000,
1075 .end = 0xA9700000 + SZ_4K - 1,
1076 .flags = IORESOURCE_MEM,
1077 },
1078};
1079
1080struct platform_device msm8625_device_dmov = {
1081 .name = "msm_dmov",
1082 .id = -1,
1083 .resource = msm8625_dmov_resource,
1084 .num_resources = ARRAY_SIZE(msm8625_dmov_resource),
1085 .dev = {
1086 .platform_data = &msm_dmov_pdata,
1087 },
1088};
Taniya Das2e948192011-12-20 11:15:13 +05301089
Taniya Das9d187142011-12-02 15:53:25 +05301090static struct resource gsbi0_msm8625_qup_resources[] = {
1091 {
1092 .name = "qup_phys_addr",
1093 .start = MSM_GSBI0_QUP_PHYS,
1094 .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1,
1095 .flags = IORESOURCE_MEM,
1096 },
1097 {
1098 .name = "gsbi_qup_i2c_addr",
1099 .start = MSM_GSBI0_PHYS,
1100 .end = MSM_GSBI0_PHYS + SZ_4K - 1,
1101 .flags = IORESOURCE_MEM,
1102 },
1103 {
1104 .name = "qup_err_intr",
1105 .start = MSM8625_INT_PWB_I2C,
1106 .end = MSM8625_INT_PWB_I2C,
1107 .flags = IORESOURCE_IRQ,
1108 },
1109};
1110
1111/* Use GSBI0 QUP for /dev/i2c-0 */
Taniya Dase3027e22012-02-27 16:32:27 +05301112struct platform_device msm8625_gsbi0_qup_i2c_device = {
Taniya Das9d187142011-12-02 15:53:25 +05301113 .name = "qup_i2c",
1114 .id = MSM_GSBI0_QUP_I2C_BUS_ID,
1115 .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources),
1116 .resource = gsbi0_msm8625_qup_resources,
1117};
1118
Trilok Soni633e59c2012-02-13 20:28:30 +05301119static struct resource gsbi1_msm8625_qup_i2c_resources[] = {
1120 {
1121 .name = "qup_phys_addr",
1122 .start = MSM_GSBI1_QUP_PHYS,
1123 .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1,
1124 .flags = IORESOURCE_MEM,
1125 },
1126 {
1127 .name = "gsbi_qup_i2c_addr",
1128 .start = MSM_GSBI1_PHYS,
1129 .end = MSM_GSBI1_PHYS + SZ_4K - 1,
1130 .flags = IORESOURCE_MEM,
1131 },
1132 {
1133 .name = "qup_err_intr",
1134 .start = MSM8625_INT_ARM11_DMA,
1135 .end = MSM8625_INT_ARM11_DMA,
1136 .flags = IORESOURCE_IRQ,
1137 },
1138};
1139
1140/* Use GSBI1 QUP for /dev/i2c-1 */
Taniya Dase3027e22012-02-27 16:32:27 +05301141struct platform_device msm8625_gsbi1_qup_i2c_device = {
Trilok Soni633e59c2012-02-13 20:28:30 +05301142 .name = "qup_i2c",
1143 .id = MSM_GSBI1_QUP_I2C_BUS_ID,
1144 .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources),
1145 .resource = gsbi1_msm8625_qup_i2c_resources,
1146};
1147
Taniya Das6684d622012-01-12 10:29:09 +05301148static struct resource msm8625_gpio_resources[] = {
1149 {
1150 .start = MSM8625_INT_GPIO_GROUP1,
1151 .flags = IORESOURCE_IRQ,
1152 },
1153 {
1154 .start = MSM8625_INT_GPIO_GROUP2,
1155 .flags = IORESOURCE_IRQ,
1156 },
1157};
1158
1159static struct platform_device msm8625_device_gpio = {
1160 .name = "msmgpio",
1161 .id = -1,
1162 .resource = msm8625_gpio_resources,
1163 .num_resources = ARRAY_SIZE(msm8625_gpio_resources),
1164};
1165
Trilok Soniee75f6c2012-02-13 20:45:07 +05301166static struct resource msm8625_resources_sdc1[] = {
1167 {
1168 .start = MSM_SDC1_BASE,
1169 .end = MSM_SDC1_BASE + SZ_4K - 1,
1170 .flags = IORESOURCE_MEM,
1171 },
1172 {
1173 .start = MSM8625_INT_SDC1_0,
1174 .end = MSM8625_INT_SDC1_1,
1175 .flags = IORESOURCE_IRQ,
1176 },
1177 {
1178 .name = "sdcc_dma_chnl",
1179 .start = DMOV_SDC1_CHAN,
1180 .end = DMOV_SDC1_CHAN,
1181 .flags = IORESOURCE_DMA,
1182 },
1183 {
1184 .name = "sdcc_dma_crci",
1185 .start = DMOV_SDC1_CRCI,
1186 .end = DMOV_SDC1_CRCI,
1187 .flags = IORESOURCE_DMA,
1188 }
1189};
1190
1191static struct resource msm8625_resources_sdc2[] = {
1192 {
1193 .start = MSM_SDC2_BASE,
1194 .end = MSM_SDC2_BASE + SZ_4K - 1,
1195 .flags = IORESOURCE_MEM,
1196 },
1197 {
1198 .start = MSM8625_INT_SDC2_0,
1199 .end = MSM8625_INT_SDC2_1,
1200 .flags = IORESOURCE_IRQ,
1201 },
1202 {
1203 .name = "sdcc_dma_chnl",
1204 .start = DMOV_SDC2_CHAN,
1205 .end = DMOV_SDC2_CHAN,
1206 .flags = IORESOURCE_DMA,
1207 },
1208 {
1209 .name = "sdcc_dma_crci",
1210 .start = DMOV_SDC2_CRCI,
1211 .end = DMOV_SDC2_CRCI,
1212 .flags = IORESOURCE_DMA,
1213 }
1214};
1215
1216static struct resource msm8625_resources_sdc3[] = {
1217 {
1218 .start = MSM_SDC3_BASE,
1219 .end = MSM_SDC3_BASE + SZ_4K - 1,
1220 .flags = IORESOURCE_MEM,
1221 },
1222 {
1223 .start = MSM8625_INT_SDC3_0,
1224 .end = MSM8625_INT_SDC3_1,
1225 .flags = IORESOURCE_IRQ,
1226 },
1227 {
1228 .name = "sdcc_dma_chnl",
1229 .start = DMOV_SDC3_CHAN,
1230 .end = DMOV_SDC3_CHAN,
1231 .flags = IORESOURCE_DMA,
1232 },
1233 {
1234 .name = "sdcc_dma_crci",
1235 .start = DMOV_SDC3_CRCI,
1236 .end = DMOV_SDC3_CRCI,
1237 .flags = IORESOURCE_DMA,
1238 },
1239};
1240
1241static struct resource msm8625_resources_sdc4[] = {
1242 {
1243 .start = MSM_SDC4_BASE,
1244 .end = MSM_SDC4_BASE + SZ_4K - 1,
1245 .flags = IORESOURCE_MEM,
1246 },
1247 {
1248 .start = MSM8625_INT_SDC4_0,
1249 .end = MSM8625_INT_SDC4_1,
1250 .flags = IORESOURCE_IRQ,
1251 },
1252 {
1253 .name = "sdcc_dma_chnl",
1254 .start = DMOV_SDC4_CHAN,
1255 .end = DMOV_SDC4_CHAN,
1256 .flags = IORESOURCE_DMA,
1257 },
1258 {
1259 .name = "sdcc_dma_crci",
1260 .start = DMOV_SDC4_CRCI,
1261 .end = DMOV_SDC4_CRCI,
1262 .flags = IORESOURCE_DMA,
1263 },
1264};
1265
1266struct platform_device msm8625_device_sdc1 = {
1267 .name = "msm_sdcc",
1268 .id = 1,
1269 .num_resources = ARRAY_SIZE(msm8625_resources_sdc1),
1270 .resource = msm8625_resources_sdc1,
1271 .dev = {
1272 .coherent_dma_mask = 0xffffffff,
1273 },
1274};
1275
1276struct platform_device msm8625_device_sdc2 = {
1277 .name = "msm_sdcc",
1278 .id = 2,
1279 .num_resources = ARRAY_SIZE(msm8625_resources_sdc2),
1280 .resource = msm8625_resources_sdc2,
1281 .dev = {
1282 .coherent_dma_mask = 0xffffffff,
1283 },
1284};
1285
1286struct platform_device msm8625_device_sdc3 = {
1287 .name = "msm_sdcc",
1288 .id = 3,
1289 .num_resources = ARRAY_SIZE(msm8625_resources_sdc3),
1290 .resource = msm8625_resources_sdc3,
1291 .dev = {
1292 .coherent_dma_mask = 0xffffffff,
1293 },
1294};
1295
1296struct platform_device msm8625_device_sdc4 = {
1297 .name = "msm_sdcc",
1298 .id = 4,
1299 .num_resources = ARRAY_SIZE(msm8625_resources_sdc4),
1300 .resource = msm8625_resources_sdc4,
1301 .dev = {
1302 .coherent_dma_mask = 0xffffffff,
1303 },
1304};
1305
1306static struct platform_device *msm8625_sdcc_devices[] __initdata = {
1307 &msm8625_device_sdc1,
1308 &msm8625_device_sdc2,
1309 &msm8625_device_sdc3,
1310 &msm8625_device_sdc4,
1311};
1312
1313int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
1314{
1315 struct platform_device *pdev;
1316
1317 if (controller < 1 || controller > 4)
1318 return -EINVAL;
1319
1320 if (cpu_is_msm8625())
1321 pdev = msm8625_sdcc_devices[controller-1];
1322 else
1323 pdev = msm_sdcc_devices[controller-1];
1324
1325 pdev->dev.platform_data = plat;
1326 return platform_device_register(pdev);
1327}
1328
Trilok Sonida63a8b2012-02-13 20:50:03 +05301329static struct resource msm8625_resources_hsusb_otg[] = {
1330 {
1331 .start = MSM_HSUSB_PHYS,
1332 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1333 .flags = IORESOURCE_MEM,
1334 },
1335 {
1336 .start = MSM8625_INT_USB_HS,
1337 .end = MSM8625_INT_USB_HS,
1338 .flags = IORESOURCE_IRQ,
1339 },
1340};
1341
1342struct platform_device msm8625_device_otg = {
1343 .name = "msm_otg",
1344 .id = -1,
1345 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg),
1346 .resource = msm8625_resources_hsusb_otg,
1347 .dev = {
1348 .dma_mask = &dma_mask,
1349 .coherent_dma_mask = 0xffffffffULL,
1350 },
1351};
1352
1353static struct resource msm8625_resources_gadget_peripheral[] = {
1354 {
1355 .start = MSM_HSUSB_PHYS,
1356 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1357 .flags = IORESOURCE_MEM,
1358 },
1359 {
1360 .start = MSM8625_INT_USB_HS,
1361 .end = MSM8625_INT_USB_HS,
1362 .flags = IORESOURCE_IRQ,
1363 },
1364};
1365
1366struct platform_device msm8625_device_gadget_peripheral = {
1367 .name = "msm_hsusb",
1368 .id = -1,
1369 .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral),
1370 .resource = msm8625_resources_gadget_peripheral,
1371 .dev = {
1372 .dma_mask = &dma_mask,
1373 .coherent_dma_mask = 0xffffffffULL,
1374 },
1375};
1376
1377static struct resource msm8625_resources_hsusb_host[] = {
1378 {
1379 .start = MSM_HSUSB_PHYS,
1380 .end = MSM_HSUSB_PHYS + SZ_1K - 1,
1381 .flags = IORESOURCE_MEM,
1382 },
1383 {
1384 .start = MSM8625_INT_USB_HS,
1385 .end = MSM8625_INT_USB_HS,
1386 .flags = IORESOURCE_IRQ,
1387 },
1388};
1389
1390struct platform_device msm8625_device_hsusb_host = {
1391 .name = "msm_hsusb_host",
1392 .id = 0,
1393 .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host),
1394 .resource = msm8625_resources_hsusb_host,
1395 .dev = {
1396 .dma_mask = &dma_mask,
1397 .coherent_dma_mask = 0xffffffffULL,
1398 },
1399};
1400
1401static struct platform_device *msm8625_host_devices[] = {
1402 &msm8625_device_hsusb_host,
1403};
1404
1405int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat)
1406{
1407 struct platform_device *pdev;
1408
1409 if (cpu_is_msm8625())
1410 pdev = msm8625_host_devices[host];
1411 else
1412 pdev = msm_host_devices[host];
1413 if (!pdev)
1414 return -ENODEV;
1415 pdev->dev.platform_data = plat;
1416 return platform_device_register(pdev);
1417}
1418
Trilok Soni88da2552012-02-13 21:01:24 +05301419#ifdef CONFIG_MSM_CAMERA_V4L2
1420static struct resource msm8625_csic0_resources[] = {
1421 {
1422 .name = "csic",
1423 .start = 0xA0F00000,
1424 .end = 0xA0F00000 + 0x00100000 - 1,
1425 .flags = IORESOURCE_MEM,
1426 },
1427 {
1428 .name = "csic",
1429 .start = MSM8625_INT_CSI_IRQ_0,
1430 .end = MSM8625_INT_CSI_IRQ_0,
1431 .flags = IORESOURCE_IRQ,
1432 },
1433};
1434
1435static struct resource msm8625_csic1_resources[] = {
1436 {
1437 .name = "csic",
1438 .start = 0xA1000000,
1439 .end = 0xA1000000 + 0x00100000 - 1,
1440 .flags = IORESOURCE_MEM,
1441 },
1442 {
1443 .name = "csic",
1444 .start = MSM8625_INT_CSI_IRQ_1,
1445 .end = MSM8625_INT_CSI_IRQ_1,
1446 .flags = IORESOURCE_IRQ,
1447 },
1448};
1449
1450struct platform_device msm8625_device_csic0 = {
1451 .name = "msm_csic",
1452 .id = 0,
1453 .resource = msm8625_csic0_resources,
1454 .num_resources = ARRAY_SIZE(msm8625_csic0_resources),
1455};
1456
1457struct platform_device msm8625_device_csic1 = {
1458 .name = "msm_csic",
1459 .id = 1,
1460 .resource = msm8625_csic1_resources,
1461 .num_resources = ARRAY_SIZE(msm8625_csic1_resources),
1462};
1463#endif
1464
Trilok Soniae4633d2012-02-13 21:08:32 +05301465static struct resource msm8625_mipi_dsi_resources[] = {
1466 {
1467 .name = "mipi_dsi",
1468 .start = MIPI_DSI_HW_BASE,
1469 .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1,
1470 .flags = IORESOURCE_MEM,
1471 },
1472 {
1473 .start = MSM8625_INT_DSI_IRQ,
1474 .end = MSM8625_INT_DSI_IRQ,
1475 .flags = IORESOURCE_IRQ,
1476 },
1477};
1478
Jeevan Shriram4461a112012-06-01 22:08:47 +05301479struct platform_device msm8625_mipi_dsi_device = {
Trilok Soniae4633d2012-02-13 21:08:32 +05301480 .name = "mipi_dsi",
1481 .id = 1,
1482 .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources),
1483 .resource = msm8625_mipi_dsi_resources,
1484};
1485
1486static struct resource msm8625_mdp_resources[] = {
1487 {
1488 .name = "mdp",
1489 .start = MDP_BASE,
1490 .end = MDP_BASE + 0x000F1008 - 1,
1491 .flags = IORESOURCE_MEM,
1492 },
1493 {
1494 .start = MSM8625_INT_MDP,
1495 .end = MSM8625_INT_MDP,
1496 .flags = IORESOURCE_IRQ,
1497 },
1498};
1499
1500static struct platform_device msm8625_mdp_device = {
1501 .name = "mdp",
1502 .id = 0,
1503 .num_resources = ARRAY_SIZE(msm8625_mdp_resources),
1504 .resource = msm8625_mdp_resources,
1505};
1506
1507void __init msm_fb_register_device(char *name, void *data)
1508{
1509 if (!strncmp(name, "mdp", 3)) {
1510 if (cpu_is_msm8625())
1511 msm_register_device(&msm8625_mdp_device, data);
1512 else
1513 msm_register_device(&msm_mdp_device, data);
1514 } else if (!strncmp(name, "mipi_dsi", 8)) {
1515 if (cpu_is_msm8625())
1516 msm_register_device(&msm8625_mipi_dsi_device, data);
1517 else
1518 msm_register_device(&msm_mipi_dsi_device, data);
1519 } else if (!strncmp(name, "lcdc", 4)) {
1520 msm_register_device(&msm_lcdc_device, data);
1521 } else {
1522 printk(KERN_ERR "%s: unknown device! %s\n", __func__, name);
1523 }
1524}
1525
Trilok Soni664b95d2012-02-13 21:13:15 +05301526static struct resource msm8625_kgsl_3d0_resources[] = {
1527 {
1528 .name = KGSL_3D0_REG_MEMORY,
1529 .start = 0xA0000000,
1530 .end = 0xA001ffff,
1531 .flags = IORESOURCE_MEM,
1532 },
1533 {
1534 .name = KGSL_3D0_IRQ,
1535 .start = MSM8625_INT_GRAPHICS,
1536 .end = MSM8625_INT_GRAPHICS,
1537 .flags = IORESOURCE_IRQ,
1538 },
1539};
1540
1541struct platform_device msm8625_kgsl_3d0 = {
1542 .name = "kgsl-3d0",
1543 .id = 0,
1544 .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources),
1545 .resource = msm8625_kgsl_3d0_resources,
1546 .dev = {
1547 .platform_data = &kgsl_3d0_pdata,
1548 },
1549};
1550
Taniya Das7c9f0512011-12-02 14:26:46 +05301551static struct clk_lookup msm_clock_8625_dummy[] = {
1552 CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0),
1553 CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0),
1554 CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0),
1555 CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0),
1556 CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0),
1557 CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0),
1558 CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0),
1559 CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0),
1560 CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0),
1561 CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0),
1562 CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0),
1563 CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0),
1564 CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0),
1565 CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0),
1566 CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0),
1567 CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0),
1568 CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0),
1569 CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0),
1570 CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0),
1571 CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0),
1572 CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0),
1573 CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0),
1574 CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0),
1575 CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0),
1576 CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0),
1577 CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0),
1578 CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0),
1579 CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0),
1580 CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0),
1581 CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0),
1582 CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0),
1583 CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0),
1584 CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0),
1585 CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0),
1586 CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0),
1587 CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0),
1588 CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0),
1589 CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0),
1590 CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0),
1591 CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0),
1592 CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0),
1593 CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0),
1594 CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0),
1595 CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0),
1596 CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0),
1597 CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0),
1598 CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0),
1599 CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0),
1600 CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0),
1601 CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0),
1602 CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0),
1603 CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0),
1604 CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0),
1605 CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0),
1606 CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0),
1607 CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0),
1608 CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0),
1609 CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0),
1610 CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0),
1611};
1612
1613struct clock_init_data msm8625_dummy_clock_init_data __initdata = {
1614 .table = msm_clock_8625_dummy,
1615 .size = ARRAY_SIZE(msm_clock_8625_dummy),
1616};
1617
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301618enum {
1619 MSM8625,
1620 MSM8625A,
1621};
1622
1623static int __init msm8625_cpu_id(void)
1624{
1625 int raw_id, cpu;
1626
1627 raw_id = socinfo_get_raw_id();
1628 switch (raw_id) {
1629 /* Part number for 1GHz part */
1630 case 0x770:
1631 case 0x771:
1632 case 0x780:
1633 cpu = MSM8625;
1634 break;
1635 /* Part number for 1.2GHz part */
1636 case 0x773:
1637 case 0x774:
1638 case 0x781:
1639 cpu = MSM8625A;
1640 break;
1641 default:
1642 pr_err("Invalid Raw ID\n");
1643 return -ENODEV;
1644 }
1645 return cpu;
1646}
1647
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001648int __init msm7x2x_misc_init(void)
1649{
Taniya Das7c9f0512011-12-02 14:26:46 +05301650 if (machine_is_msm8625_rumi3()) {
1651 msm_clock_init(&msm8625_dummy_clock_init_data);
Taniya Das43bcdd62011-12-02 17:33:27 +05301652 return 0;
Taniya Das7c9f0512011-12-02 14:26:46 +05301653 }
Taniya Das43bcdd62011-12-02 17:33:27 +05301654
Stephen Boydbb600ae2011-08-02 20:11:40 -07001655 msm_clock_init(&msm7x27a_clock_init_data);
Pankaj Kumarfee56a82012-04-17 14:26:49 +05301656 if (cpu_is_msm7x27aa() || cpu_is_msm7x25ab())
Matt Wagantallbf430eb2012-03-22 11:45:49 -07001657 platform_device_register(&msm7x27aa_device_acpuclk);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301658 else if (cpu_is_msm8625()) {
1659 if (msm8625_cpu_id() == MSM8625)
Matt Wagantallbf430eb2012-03-22 11:45:49 -07001660 platform_device_register(&msm7x27aa_device_acpuclk);
Pankaj Kumar50c705c2012-01-10 12:02:07 +05301661 else if (msm8625_cpu_id() == MSM8625A)
Matt Wagantallbf430eb2012-03-22 11:45:49 -07001662 platform_device_register(&msm8625_device_acpuclk);
1663 } else {
1664 platform_device_register(&msm7x27a_device_acpuclk);
1665 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001666
1667 return 0;
1668}
1669
1670#ifdef CONFIG_CACHE_L2X0
1671static int __init msm7x27x_cache_init(void)
1672{
1673 int aux_ctrl = 0;
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301674 int pctrl = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001675
1676 /* Way Size 010(0x2) 32KB */
1677 aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \
1678 (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1679 (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT);
1680
Taniya Das379b5682011-12-02 14:53:46 +05301681 if (cpu_is_msm8625()) {
1682 /* Way Size 011(0x3) 64KB */
1683 aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \
1684 (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301685 (0X1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | \
1686 (0x1 << L2X0_AUX_CTRL_L2_FORCE_NWA_SHIFT);
1687
1688 /* Write Prefetch Control settings */
1689 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1690 pctrl |= (0x3 << L2X0_PREFETCH_CTRL_OFFSET_SHIFT) | \
1691 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_INC_SHIFT) | \
1692 (0x1 << L2X0_PREFETCH_CTRL_WRAP8_SHIFT);
1693 writel_relaxed(pctrl , MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
Taniya Das379b5682011-12-02 14:53:46 +05301694 }
1695
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001696 l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK);
Prachee Ramsinghani86b1f652012-04-03 16:01:30 +05301697 if (cpu_is_msm8625()) {
1698 pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL);
1699 pr_info("Prfetch Ctrl: 0x%08x\n", pctrl);
1700 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001701
1702 return 0;
1703}
1704#else
pankaj kumar80d7cb62011-08-23 13:37:55 +05301705static int __init msm7x27x_cache_init(void){ return 0; }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001706#endif
1707
1708void __init msm_common_io_init(void)
1709{
1710 msm_map_common_io();
Taniya Das43bcdd62011-12-02 17:33:27 +05301711 if (socinfo_init() < 0)
1712 pr_err("%s: socinfo_init() failed!\n", __func__);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001713 msm7x27x_cache_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301714}
1715
1716void __init msm8625_init_irq(void)
1717{
Trilok Soni1a9fdee2012-05-28 19:54:11 +05301718 msm_gic_irq_extn_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301719 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1720 (void *)MSM_QGIC_CPU_BASE);
Taniya Das43bcdd62011-12-02 17:33:27 +05301721}
1722
1723void __init msm8625_map_io(void)
1724{
1725 msm_map_msm8625_io();
1726
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001727 if (socinfo_init() < 0)
1728 pr_err("%s: socinfo_init() failed!\n", __func__);
Taniya Das379b5682011-12-02 14:53:46 +05301729 msm7x27x_cache_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001730}
1731
Taniya Das43bcdd62011-12-02 17:33:27 +05301732static int msm7627a_init_gpio(void)
1733{
Taniya Das6684d622012-01-12 10:29:09 +05301734 if (cpu_is_msm8625())
1735 platform_device_register(&msm8625_device_gpio);
1736 else
1737 platform_device_register(&msm_device_gpio);
Taniya Das43bcdd62011-12-02 17:33:27 +05301738 return 0;
1739}
1740postcore_initcall(msm7627a_init_gpio);
Taniya Das9d0c3c52012-05-04 14:40:55 +05301741
1742static int msm7627a_panic_handler(struct notifier_block *this,
1743 unsigned long event, void *ptr)
1744{
1745 flush_cache_all();
1746 outer_flush_all();
1747 return NOTIFY_DONE;
1748}
1749
1750static struct notifier_block panic_handler = {
1751 .notifier_call = msm7627a_panic_handler,
1752};
1753
1754static int __init panic_register(void)
1755{
1756 atomic_notifier_chain_register(&panic_notifier_list,
1757 &panic_handler);
1758 return 0;
1759}
1760module_init(panic_register);