blob: 343c7f8d67904b270baba1486fbca8bbb54280e4 [file] [log] [blame]
Mayank Rana2a1c7db2013-01-08 15:10:51 +05301/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002 *
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/io.h>
16#include <linux/irq.h>
17#include <linux/i2c.h>
18#include <linux/i2c/sx150x.h>
19#include <linux/i2c/isl9519.h>
20#include <linux/gpio.h>
21#include <linux/msm_ssbi.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070022#include <linux/regulator/msm-gpio-regulator.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080023#include <linux/mfd/pm8xxx/pm8921.h>
24#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
25#include <linux/regulator/consumer.h>
26#include <linux/spi/spi.h>
27#include <linux/slimbus/slimbus.h>
28#include <linux/bootmem.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080029#ifdef CONFIG_ANDROID_PMEM
30#include <linux/android_pmem.h>
31#endif
Laura Abbott87eafac2012-09-18 11:45:43 -070032#include <linux/dma-contiguous.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080033#include <linux/dma-mapping.h>
34#include <linux/platform_data/qcom_crypto_device.h>
35#include <linux/platform_data/qcom_wcnss_device.h>
36#include <linux/leds.h>
37#include <linux/leds-pm8xxx.h>
38#include <linux/i2c/atmel_mxt_ts.h>
39#include <linux/msm_tsens.h>
40#include <linux/ks8851.h>
41#include <linux/i2c/isa1200.h>
Anirudh Ghayaleb3af972011-12-13 17:29:06 +053042#include <linux/gpio_keys.h>
Jack Cheung6ce8f682012-01-17 10:35:42 -080043#include <linux/memory.h>
Hanumant Singheea62562012-05-14 11:32:45 -070044#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060045#include <linux/msm_thermal.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080046
Asish Bhattacharyab86c3472012-02-15 08:31:52 +053047#include <linux/slimbus/slimbus.h>
48#include <linux/mfd/wcd9xxx/core.h>
49#include <linux/mfd/wcd9xxx/pdata.h>
50
Wentao Xu114c0152012-06-12 11:40:38 -040051#ifdef CONFIG_STM_LIS3DH
52#include <linux/input/lis3dh.h>
53#endif
54
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080055#include <asm/mach-types.h>
56#include <asm/mach/arch.h>
57#include <asm/setup.h>
58#include <asm/hardware/gic.h>
59#include <asm/mach/mmc.h>
60
61#include <mach/board.h>
62#include <mach/msm_iomap.h>
63#include <mach/msm_spi.h>
64#ifdef CONFIG_USB_MSM_OTG_72K
65#include <mach/msm_hsusb.h>
66#else
67#include <linux/usb/msm_hsusb.h>
68#endif
69#include <linux/usb/android.h>
70#include <mach/usbdiag.h>
71#include <mach/socinfo.h>
72#include <mach/rpm.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080073#include <mach/gpiomux.h>
74#include <mach/msm_bus_board.h>
75#include <mach/msm_memtypes.h>
76#include <mach/dma.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080077#include <mach/msm_xo.h>
78#include <mach/restart.h>
79
Mitchel Humpherys46475f62012-09-06 11:33:28 -070080#include <linux/msm_ion.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080081#include <mach/ion.h>
82#include <mach/mdm2.h>
Laura Abbottf8c03b92012-02-16 14:57:58 -080083#include <mach/msm_rtb.h>
Hanumant Singheea62562012-05-14 11:32:45 -070084#include <linux/fmem.h>
Laura Abbottf3173042012-05-29 15:23:18 -070085#include <mach/msm_cache_dump.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080086
Jordan Crouse914de9b2012-07-09 13:49:46 -060087#include <mach/kgsl.h>
Wentao Xuf59ce4e2012-05-22 17:30:13 -040088#ifdef CONFIG_INPUT_MPU3050
89#include <linux/input/mpu3050.h>
90#endif
91
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080092#include "timer.h"
93#include "devices.h"
94#include "devices-msm8x60.h"
95#include "spm.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080096#include "pm.h"
Abhijeet Dharmapurikarefaca4f2011-12-27 16:24:07 -080097#include <mach/cpuidle.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080098#include "rpm_resources.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053099#include <mach/mpm.h>
Matt Wagantalld55b90f2012-02-23 23:27:44 -0800100#include "clock.h"
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800101#include "smd_private.h"
102#include "pm-boot.h"
103#include "msm_watchdog.h"
Jay Chokshi06fa7542011-12-07 13:09:17 -0800104#include "board-8930.h"
Patrick Dalya3b73c42012-08-28 13:39:17 -0700105#include "acpuclock-krait.h"
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800106
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800107static struct platform_device msm_fm_platform_init = {
108 .name = "iris_fm",
109 .id = -1,
110};
111
112#define KS8851_RST_GPIO 89
113#define KS8851_IRQ_GPIO 90
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800114#define HAP_SHIFT_LVL_OE_GPIO 47
115
Manoj Raoc6d904c2012-06-22 00:32:14 -0700116#define HDMI_MHL_MUX_GPIO 73
117#define MHL_GPIO_INT 72
118#define MHL_GPIO_RESET 71
119#define MHL_GPIO_PWR_EN 5
120
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800121#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
122
123struct sx150x_platform_data msm8930_sx150x_data[] = {
124 [SX150X_CAM] = {
125 .gpio_base = GPIO_CAM_EXPANDER_BASE,
126 .oscio_is_gpo = false,
127 .io_pullup_ena = 0x0,
128 .io_pulldn_ena = 0xc0,
129 .io_open_drain_ena = 0x0,
130 .irq_summary = -1,
131 },
132};
133
134#endif
135
Olav Haugana21169d2012-01-04 09:17:06 -0800136#define MSM_PMEM_ADSP_SIZE 0x7800000
Sudhir Sharmab83b1472012-11-28 19:46:13 -0800137#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800138#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
139#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
140#else
Olav Hauganb88eef12012-01-15 10:59:26 -0800141#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800142#endif
Hanumant Singheea62562012-05-14 11:32:45 -0700143#define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800144
145#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Deepak Kotur9830bf02012-06-01 15:04:29 -0700146#define HOLE_SIZE 0x20000
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700147#define MSM_CONTIG_MEM_SIZE 0x65000
Hanumant Singhedfb0462012-05-15 14:49:32 -0700148#ifdef CONFIG_MSM_IOMMU
149#define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */
150#define MSM_ION_SF_SIZE 0x0
Olav Haugan494e4dc2012-05-15 15:14:31 -0700151#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Laura Abbott03e3cd72013-02-09 09:35:30 -0800152#define MSM_ION_HEAP_NUM 8
Hanumant Singhedfb0462012-05-15 14:49:32 -0700153#else
Olav Hauganb88eef12012-01-15 10:59:26 -0800154#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Hauganb88eef12012-01-15 10:59:26 -0800155#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan494e4dc2012-05-15 15:14:31 -0700156#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Hanumant Singheea62562012-05-14 11:32:45 -0700157#define MSM_ION_HEAP_NUM 8
Hanumant Singhedfb0462012-05-15 14:49:32 -0700158#endif
Deepak Kotur9830bf02012-06-01 15:04:29 -0700159#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2MB - 128Kb */
Olav Hauganb5be7992011-11-18 14:29:02 -0800160#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan7355db02012-01-13 16:59:13 -0800161#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Hanumant Singheea62562012-05-14 11:32:45 -0700162
163#define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000)
164#define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE
165#define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE
166
Deepak Kotur9830bf02012-06-01 15:04:29 -0700167#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /*2MB -128Kb */
168#define MSM8930_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
169 HOLE_SIZE))
Hanumant Singheea62562012-05-14 11:32:45 -0700170#define MAX_FIXED_AREA_SIZE 0x10000000
Deepak Kotur9830bf02012-06-01 15:04:29 -0700171#define MSM8930_FW_START MSM8930_FIXED_AREA_START
Laura Abbott03e3cd72013-02-09 09:35:30 -0800172#define MSM_ION_ADSP_SIZE SZ_8M
Hanumant Singheea62562012-05-14 11:32:45 -0700173
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800174#else
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700175#define MSM_CONTIG_MEM_SIZE 0x110C000
Olav Hauganb5be7992011-11-18 14:29:02 -0800176#define MSM_ION_HEAP_NUM 1
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800177#endif
178
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700179#ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION
180static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE;
181static int __init msm_contig_mem_size_setup(char *p)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800182{
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700183 msm_contig_mem_size = memparse(p, NULL);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800184 return 0;
185}
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700186early_param("msm_contig_mem_size", msm_contig_mem_size_setup);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800187#endif
188
189#ifdef CONFIG_ANDROID_PMEM
190static unsigned pmem_size = MSM_PMEM_SIZE;
191static int __init pmem_size_setup(char *p)
192{
193 pmem_size = memparse(p, NULL);
194 return 0;
195}
196early_param("pmem_size", pmem_size_setup);
197
198static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
199
200static int __init pmem_adsp_size_setup(char *p)
201{
202 pmem_adsp_size = memparse(p, NULL);
203 return 0;
204}
205early_param("pmem_adsp_size", pmem_adsp_size_setup);
206
207static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
208
209static int __init pmem_audio_size_setup(char *p)
210{
211 pmem_audio_size = memparse(p, NULL);
212 return 0;
213}
214early_param("pmem_audio_size", pmem_audio_size_setup);
215#endif
216
217#ifdef CONFIG_ANDROID_PMEM
218#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
219static struct android_pmem_platform_data android_pmem_pdata = {
220 .name = "pmem",
221 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
222 .cached = 1,
223 .memory_type = MEMTYPE_EBI1,
224};
225
Laura Abbottb93525f2012-04-12 09:57:19 -0700226static struct platform_device msm8930_android_pmem_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800227 .name = "android_pmem",
228 .id = 0,
229 .dev = {.platform_data = &android_pmem_pdata},
230};
231
232static struct android_pmem_platform_data android_pmem_adsp_pdata = {
233 .name = "pmem_adsp",
234 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
235 .cached = 0,
236 .memory_type = MEMTYPE_EBI1,
237};
Laura Abbottb93525f2012-04-12 09:57:19 -0700238static struct platform_device msm8930_android_pmem_adsp_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800239 .name = "android_pmem",
240 .id = 2,
241 .dev = { .platform_data = &android_pmem_adsp_pdata },
242};
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800243
244static struct android_pmem_platform_data android_pmem_audio_pdata = {
245 .name = "pmem_audio",
246 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
247 .cached = 0,
248 .memory_type = MEMTYPE_EBI1,
249};
250
Laura Abbottb93525f2012-04-12 09:57:19 -0700251static struct platform_device msm8930_android_pmem_audio_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800252 .name = "android_pmem",
253 .id = 4,
254 .dev = { .platform_data = &android_pmem_audio_pdata },
255};
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530256#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
257#endif /* CONFIG_ANDROID_PMEM */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800258
Hanumant Singheea62562012-05-14 11:32:45 -0700259struct fmem_platform_data msm8930_fmem_pdata = {
260};
261
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800262#define DSP_RAM_BASE_8960 0x8da00000
263#define DSP_RAM_SIZE_8960 0x1800000
264static int dspcrashd_pdata_8960 = 0xDEADDEAD;
265
266static struct resource resources_dspcrashd_8960[] = {
267 {
268 .name = "msm_dspcrashd",
269 .start = DSP_RAM_BASE_8960,
270 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
271 .flags = IORESOURCE_DMA,
272 },
273};
274
275static struct platform_device msm_device_dspcrashd_8960 = {
276 .name = "msm_dspcrashd",
277 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
278 .resource = resources_dspcrashd_8960,
279 .dev = { .platform_data = &dspcrashd_pdata_8960 },
280};
281
282static struct memtype_reserve msm8930_reserve_table[] __initdata = {
283 [MEMTYPE_SMI] = {
284 },
285 [MEMTYPE_EBI0] = {
286 .flags = MEMTYPE_FLAGS_1M_ALIGN,
287 },
288 [MEMTYPE_EBI1] = {
289 .flags = MEMTYPE_FLAGS_1M_ALIGN,
290 },
291};
292
Laura Abbottf8c03b92012-02-16 14:57:58 -0800293
294static void __init reserve_rtb_memory(void)
295{
296#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700297 msm8930_reserve_table[MEMTYPE_EBI1].size += msm8930_rtb_pdata.size;
Laura Abbottf8c03b92012-02-16 14:57:58 -0800298#endif
299}
300
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800301static void __init size_pmem_devices(void)
302{
303#ifdef CONFIG_ANDROID_PMEM
304#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
305 android_pmem_adsp_pdata.size = pmem_adsp_size;
306 android_pmem_pdata.size = pmem_size;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800307 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530308#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
309#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800310}
311
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530312#ifdef CONFIG_ANDROID_PMEM
313#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800314static void __init reserve_memory_for(struct android_pmem_platform_data *p)
315{
316 msm8930_reserve_table[p->memory_type].size += p->size;
317}
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530318#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
319#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800320
321static void __init reserve_pmem_memory(void)
322{
323#ifdef CONFIG_ANDROID_PMEM
324#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
325 reserve_memory_for(&android_pmem_adsp_pdata);
326 reserve_memory_for(&android_pmem_pdata);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800327 reserve_memory_for(&android_pmem_audio_pdata);
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530328#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700329 msm8930_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size;
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530330#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800331}
332
333static int msm8930_paddr_to_memtype(unsigned int paddr)
334{
335 return MEMTYPE_EBI1;
336}
337
Steve Mucklef132c6c2012-06-06 18:30:57 -0700338#define FMEM_ENABLED 0
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800339#ifdef CONFIG_ION_MSM
Olav Haugan0703dbf2011-12-19 17:53:38 -0800340#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700341static struct ion_cp_heap_pdata cp_mm_msm8930_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800342 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugan42ebe712012-01-10 16:30:58 -0800343 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700344 .reusable = FMEM_ENABLED,
345 .mem_is_fmem = FMEM_ENABLED,
346 .fixed_position = FIXED_MIDDLE,
Laura Abbottadec9c72012-12-05 11:49:59 -0800347 .is_cma = 1,
Laura Abbott5249a052012-12-11 15:09:03 -0800348 .no_nonsecure_alloc = 1,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800349};
350
Laura Abbottb93525f2012-04-12 09:57:19 -0700351static struct ion_cp_heap_pdata cp_mfc_msm8930_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800352 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugan42ebe712012-01-10 16:30:58 -0800353 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700354 .reusable = 0,
355 .mem_is_fmem = FMEM_ENABLED,
356 .fixed_position = FIXED_HIGH,
Laura Abbott5249a052012-12-11 15:09:03 -0800357 .no_nonsecure_alloc = 1,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800358};
Hanumant Singheea62562012-05-14 11:32:45 -0700359
Laura Abbottb93525f2012-04-12 09:57:19 -0700360static struct ion_co_heap_pdata co_msm8930_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800361 .adjacent_mem_id = INVALID_HEAP_ID,
362 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700363 .mem_is_fmem = 0,
Olav Haugan42ebe712012-01-10 16:30:58 -0800364};
Hanumant Singheea62562012-05-14 11:32:45 -0700365
Laura Abbottb93525f2012-04-12 09:57:19 -0700366static struct ion_co_heap_pdata fw_co_msm8930_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800367 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
368 .align = SZ_128K,
Hanumant Singheea62562012-05-14 11:32:45 -0700369 .mem_is_fmem = FMEM_ENABLED,
370 .fixed_position = FIXED_LOW,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800371};
372#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800373
Laura Abbott87eafac2012-09-18 11:45:43 -0700374
375static u64 msm_dmamask = DMA_BIT_MASK(32);
376
377static struct platform_device ion_mm_heap_device = {
378 .name = "ion-mm-heap-device",
379 .id = -1,
380 .dev = {
381 .dma_mask = &msm_dmamask,
382 .coherent_dma_mask = DMA_BIT_MASK(32),
383 }
384};
385
Laura Abbott03e3cd72013-02-09 09:35:30 -0800386static struct platform_device ion_adsp_heap_device = {
387 .name = "ion-adsp-heap-device",
388 .id = -1,
389 .dev = {
390 .dma_mask = &msm_dmamask,
391 .coherent_dma_mask = DMA_BIT_MASK(32),
392 }
393};
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800394/**
395 * These heaps are listed in the order they will be allocated. Due to
396 * video hardware restrictions and content protection the FW heap has to
397 * be allocated adjacent (below) the MM heap and the MFC heap has to be
398 * allocated after the MM heap to ensure MFC heap is not more than 256MB
399 * away from the base address of the FW heap.
400 * However, the order of FW heap and MM heap doesn't matter since these
401 * two heaps are taken care of by separate code to ensure they are adjacent
402 * to each other.
403 * Don't swap the order unless you know what you are doing!
404 */
Benjamin Gaignardb2d367c2012-06-25 15:27:30 -0700405struct ion_platform_heap msm8930_heaps[] = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800406 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800407 .id = ION_SYSTEM_HEAP_ID,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800408 .type = ION_HEAP_TYPE_SYSTEM,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800409 .name = ION_VMALLOC_HEAP_NAME,
410 },
411#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
412 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800413 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800414 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800415 .name = ION_MM_HEAP_NAME,
416 .size = MSM_ION_MM_SIZE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800417 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700418 .extra_data = (void *) &cp_mm_msm8930_ion_pdata,
Laura Abbott87eafac2012-09-18 11:45:43 -0700419 .priv = &ion_mm_heap_device.dev
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800420 },
Olav Hauganb5be7992011-11-18 14:29:02 -0800421 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800422 .id = ION_MM_FIRMWARE_HEAP_ID,
423 .type = ION_HEAP_TYPE_CARVEOUT,
424 .name = ION_MM_FIRMWARE_HEAP_NAME,
425 .size = MSM_ION_MM_FW_SIZE,
426 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700427 .extra_data = (void *) &fw_co_msm8930_ion_pdata,
Olav Haugan42ebe712012-01-10 16:30:58 -0800428 },
429 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800430 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800431 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800432 .name = ION_MFC_HEAP_NAME,
433 .size = MSM_ION_MFC_SIZE,
434 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700435 .extra_data = (void *) &cp_mfc_msm8930_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800436 },
Hanumant Singhedfb0462012-05-15 14:49:32 -0700437#ifndef CONFIG_MSM_IOMMU
Olav Hauganb5be7992011-11-18 14:29:02 -0800438 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800439 .id = ION_SF_HEAP_ID,
440 .type = ION_HEAP_TYPE_CARVEOUT,
441 .name = ION_SF_HEAP_NAME,
442 .size = MSM_ION_SF_SIZE,
443 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700444 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800445 },
Hanumant Singhedfb0462012-05-15 14:49:32 -0700446#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800447 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800448 .id = ION_IOMMU_HEAP_ID,
449 .type = ION_HEAP_TYPE_IOMMU,
450 .name = ION_IOMMU_HEAP_NAME,
451 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800452 {
453 .id = ION_QSECOM_HEAP_ID,
454 .type = ION_HEAP_TYPE_CARVEOUT,
455 .name = ION_QSECOM_HEAP_NAME,
456 .size = MSM_ION_QSECOM_SIZE,
457 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700458 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan80854eb2012-01-12 12:00:23 -0800459 },
Olav Haugan7355db02012-01-13 16:59:13 -0800460 {
461 .id = ION_AUDIO_HEAP_ID,
462 .type = ION_HEAP_TYPE_CARVEOUT,
463 .name = ION_AUDIO_HEAP_NAME,
464 .size = MSM_ION_AUDIO_SIZE,
465 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700466 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan7355db02012-01-13 16:59:13 -0800467 },
Laura Abbott03e3cd72013-02-09 09:35:30 -0800468 {
469 .id = ION_ADSP_HEAP_ID,
470 .type = ION_HEAP_TYPE_DMA,
471 .name = ION_ADSP_HEAP_NAME,
472 .size = MSM_ION_ADSP_SIZE,
473 .memory_type = ION_EBI_TYPE,
474 .extra_data = (void *) &co_msm8930_ion_pdata,
475 .priv = &ion_adsp_heap_device.dev,
476 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800477#endif
Benjamin Gaignardb2d367c2012-06-25 15:27:30 -0700478};
479
480static struct ion_platform_data msm8930_ion_pdata = {
481 .nr = MSM_ION_HEAP_NUM,
482 .heaps = msm8930_heaps,
483
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800484};
485
Laura Abbottb93525f2012-04-12 09:57:19 -0700486static struct platform_device msm8930_ion_dev = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800487 .name = "ion-msm",
488 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700489 .dev = { .platform_data = &msm8930_ion_pdata },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800490};
491#endif
492
Hanumant Singheea62562012-05-14 11:32:45 -0700493struct platform_device msm8930_fmem_device = {
494 .name = "fmem",
495 .id = 1,
496 .dev = { .platform_data = &msm8930_fmem_pdata },
497};
498
499static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
500 unsigned long size)
501{
502 msm8930_reserve_table[mem_type].size += size;
503}
504
505static void __init msm8930_reserve_fixed_area(unsigned long fixed_area_size)
506{
507#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
508 int ret;
509
510 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
511 panic("fixed area size is larger than %dM\n",
512 MAX_FIXED_AREA_SIZE >> 20);
513
514 reserve_info->fixed_area_size = fixed_area_size;
515 reserve_info->fixed_area_start = MSM8930_FW_START;
516
517 ret = memblock_remove(reserve_info->fixed_area_start,
518 reserve_info->fixed_area_size);
519 BUG_ON(ret);
520#endif
521}
522
523/**
524 * Reserve memory for ION and calculate amount of reusable memory for fmem.
525 * We only reserve memory for heaps that are not reusable. However, we only
526 * support one reusable heap at the moment so we ignore the reusable flag for
527 * other than the first heap with reusable flag set. Also handle special case
528 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
529 * at a higher address than FW in addition to not more than 256MB away from the
530 * base address of the firmware. This means that if MM is reusable the other
531 * two heaps must be allocated in the same region as FW. This is handled by the
532 * mem_is_fmem flag in the platform data. In addition the MM heap must be
533 * adjacent to the FW heap for content protection purposes.
534 */
Stephen Boyd668d7652012-04-25 11:31:01 -0700535static void __init reserve_ion_memory(void)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800536{
537#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Hanumant Singheea62562012-05-14 11:32:45 -0700538 unsigned int i;
Laura Abbott87eafac2012-09-18 11:45:43 -0700539 int ret;
Hanumant Singheea62562012-05-14 11:32:45 -0700540 unsigned int fixed_size = 0;
541 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
542 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
Laura Abbott87eafac2012-09-18 11:45:43 -0700543 unsigned long cma_alignment;
544 unsigned int low_use_cma = 0;
545 unsigned int middle_use_cma = 0;
546 unsigned int high_use_cma = 0;
Hanumant Singheea62562012-05-14 11:32:45 -0700547
Hanumant Singheea62562012-05-14 11:32:45 -0700548 fixed_low_size = 0;
549 fixed_middle_size = 0;
550 fixed_high_size = 0;
551
Laura Abbott87eafac2012-09-18 11:45:43 -0700552 cma_alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order);
553
Hanumant Singheea62562012-05-14 11:32:45 -0700554 for (i = 0; i < msm8930_ion_pdata.nr; ++i) {
Laura Abbott87eafac2012-09-18 11:45:43 -0700555 struct ion_platform_heap *heap =
Hanumant Singheea62562012-05-14 11:32:45 -0700556 &(msm8930_ion_pdata.heaps[i]);
557
Laura Abbott87eafac2012-09-18 11:45:43 -0700558 int use_cma = 0;
559
Hanumant Singheea62562012-05-14 11:32:45 -0700560 if (heap->extra_data) {
561 int fixed_position = NOT_FIXED;
Hanumant Singheea62562012-05-14 11:32:45 -0700562
Mitchel Humpherysdc4d01d2012-09-13 10:53:22 -0700563 switch ((int) heap->type) {
Hanumant Singheea62562012-05-14 11:32:45 -0700564 case ION_HEAP_TYPE_CP:
Laura Abbott87eafac2012-09-18 11:45:43 -0700565 if (((struct ion_cp_heap_pdata *)
566 heap->extra_data)->is_cma) {
567 heap->size = ALIGN(heap->size,
568 cma_alignment);
569 use_cma = 1;
570 }
Hanumant Singheea62562012-05-14 11:32:45 -0700571 fixed_position = ((struct ion_cp_heap_pdata *)
572 heap->extra_data)->fixed_position;
573 break;
Laura Abbott87eafac2012-09-18 11:45:43 -0700574 case ION_HEAP_TYPE_DMA:
575 use_cma = 1;
576 /* Purposely fall through here */
Hanumant Singheea62562012-05-14 11:32:45 -0700577 case ION_HEAP_TYPE_CARVEOUT:
Hanumant Singheea62562012-05-14 11:32:45 -0700578 fixed_position = ((struct ion_co_heap_pdata *)
579 heap->extra_data)->fixed_position;
580 break;
581 default:
582 break;
583 }
584
585 if (fixed_position != NOT_FIXED)
586 fixed_size += heap->size;
587 else
588 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
589
Laura Abbott87eafac2012-09-18 11:45:43 -0700590 if (fixed_position == FIXED_LOW) {
Hanumant Singheea62562012-05-14 11:32:45 -0700591 fixed_low_size += heap->size;
Laura Abbott87eafac2012-09-18 11:45:43 -0700592 low_use_cma = use_cma;
593 } else if (fixed_position == FIXED_MIDDLE) {
Hanumant Singheea62562012-05-14 11:32:45 -0700594 fixed_middle_size += heap->size;
Laura Abbott87eafac2012-09-18 11:45:43 -0700595 middle_use_cma = use_cma;
596 } else if (fixed_position == FIXED_HIGH) {
Hanumant Singheea62562012-05-14 11:32:45 -0700597 fixed_high_size += heap->size;
Laura Abbott87eafac2012-09-18 11:45:43 -0700598 high_use_cma = use_cma;
599 } else if (use_cma) {
600 /*
601 * Heaps that use CMA but are not part of the
602 * fixed set. Create wherever.
603 */
604 dma_declare_contiguous(
605 heap->priv,
606 heap->size,
607 0,
608 0xb0000000);
609 }
Hanumant Singheea62562012-05-14 11:32:45 -0700610 }
611 }
612
613 if (!fixed_size)
614 return;
Laura Abbott87eafac2012-09-18 11:45:43 -0700615 /*
616 * Given the setup for the fixed area, we can't round up all sizes.
617 * Some sizes must be set up exactly and aligned correctly. Incorrect
618 * alignments are considered a configuration issue
Hanumant Singheea62562012-05-14 11:32:45 -0700619 */
Hanumant Singheea62562012-05-14 11:32:45 -0700620
621 fixed_low_start = MSM8930_FIXED_AREA_START;
Laura Abbott87eafac2012-09-18 11:45:43 -0700622 if (low_use_cma) {
623 BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, cma_alignment));
624 BUG_ON(!IS_ALIGNED(fixed_low_start, cma_alignment));
625 } else {
626 BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, SECTION_SIZE));
627 ret = memblock_remove(fixed_low_start,
628 fixed_low_size + HOLE_SIZE);
629 BUG_ON(ret);
630 }
631
Deepak Kotur9830bf02012-06-01 15:04:29 -0700632 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Laura Abbott87eafac2012-09-18 11:45:43 -0700633 if (middle_use_cma) {
634 BUG_ON(!IS_ALIGNED(fixed_middle_start, cma_alignment));
635 BUG_ON(!IS_ALIGNED(fixed_middle_size, cma_alignment));
636 } else {
637 BUG_ON(!IS_ALIGNED(fixed_middle_size, SECTION_SIZE));
638 ret = memblock_remove(fixed_middle_start, fixed_middle_size);
639 BUG_ON(ret);
640 }
641
Hanumant Singheea62562012-05-14 11:32:45 -0700642 fixed_high_start = fixed_middle_start + fixed_middle_size;
Laura Abbott87eafac2012-09-18 11:45:43 -0700643 if (high_use_cma) {
644 fixed_high_size = ALIGN(fixed_high_size, cma_alignment);
645 BUG_ON(!IS_ALIGNED(fixed_high_start, cma_alignment));
646 } else {
647 /* This is the end of the fixed area so it's okay to round up */
648 fixed_high_size = ALIGN(fixed_high_size, SECTION_SIZE);
649 ret = memblock_remove(fixed_high_start, fixed_high_size);
650 BUG_ON(ret);
651 }
Hanumant Singheea62562012-05-14 11:32:45 -0700652
653 for (i = 0; i < msm8930_ion_pdata.nr; ++i) {
654 struct ion_platform_heap *heap = &(msm8930_ion_pdata.heaps[i]);
655
656 if (heap->extra_data) {
657 int fixed_position = NOT_FIXED;
Steve Muckle75c34ca2012-06-12 14:27:40 -0700658 struct ion_cp_heap_pdata *pdata = NULL;
Hanumant Singheea62562012-05-14 11:32:45 -0700659
Mitchel Humpherysdc4d01d2012-09-13 10:53:22 -0700660 switch ((int) heap->type) {
Hanumant Singheea62562012-05-14 11:32:45 -0700661 case ION_HEAP_TYPE_CP:
Deepak Kotur9830bf02012-06-01 15:04:29 -0700662 pdata =
663 (struct ion_cp_heap_pdata *)heap->extra_data;
664 fixed_position = pdata->fixed_position;
Hanumant Singheea62562012-05-14 11:32:45 -0700665 break;
Laura Abbott87eafac2012-09-18 11:45:43 -0700666 case ION_HEAP_TYPE_DMA:
Hanumant Singheea62562012-05-14 11:32:45 -0700667 case ION_HEAP_TYPE_CARVEOUT:
668 fixed_position = ((struct ion_co_heap_pdata *)
669 heap->extra_data)->fixed_position;
670 break;
671 default:
672 break;
673 }
674
675 switch (fixed_position) {
676 case FIXED_LOW:
677 heap->base = fixed_low_start;
678 break;
679 case FIXED_MIDDLE:
680 heap->base = fixed_middle_start;
Laura Abbott87eafac2012-09-18 11:45:43 -0700681 if (middle_use_cma)
682 dma_declare_contiguous(
683 &ion_mm_heap_device.dev,
684 heap->size,
685 fixed_middle_start,
686 0xa0000000);
Deepak Kotur9830bf02012-06-01 15:04:29 -0700687 pdata->secure_base = fixed_middle_start
688 - HOLE_SIZE;
689 pdata->secure_size = HOLE_SIZE + heap->size;
Hanumant Singheea62562012-05-14 11:32:45 -0700690 break;
691 case FIXED_HIGH:
692 heap->base = fixed_high_start;
693 break;
694 default:
695 break;
696 }
697 }
698 }
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800699#endif
700}
Huaibin Yanga5419422011-12-08 23:52:10 -0800701
702static void __init reserve_mdp_memory(void)
703{
704 msm8930_mdp_writeback(msm8930_reserve_table);
705}
706
Laura Abbottf3173042012-05-29 15:23:18 -0700707#ifdef CONFIG_MSM_CACHE_DUMP
708static void __init reserve_cache_dump_memory(void)
709{
710 unsigned int total;
711
712 total = msm8930_cache_dump_pdata.l1_size +
713 msm8930_cache_dump_pdata.l2_size;
714 msm8930_reserve_table[MEMTYPE_EBI1].size += total;
715}
716#else
717static void __init reserve_cache_dump_memory(void) { }
718#endif
719
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800720static void __init msm8930_calculate_reserve_sizes(void)
721{
722 size_pmem_devices();
723 reserve_pmem_memory();
724 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800725 reserve_mdp_memory();
Laura Abbottf8c03b92012-02-16 14:57:58 -0800726 reserve_rtb_memory();
Laura Abbottf3173042012-05-29 15:23:18 -0700727 reserve_cache_dump_memory();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800728}
729
730static struct reserve_info msm8930_reserve_info __initdata = {
731 .memtype_reserve_table = msm8930_reserve_table,
732 .calculate_reserve_sizes = msm8930_calculate_reserve_sizes,
Hanumant Singheea62562012-05-14 11:32:45 -0700733 .reserve_fixed_area = msm8930_reserve_fixed_area,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800734 .paddr_to_memtype = msm8930_paddr_to_memtype,
735};
736
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800737static void __init msm8930_early_memory(void)
738{
739 reserve_info = &msm8930_reserve_info;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800740}
741
742static void __init msm8930_reserve(void)
743{
744 msm_reserve();
745}
746
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800747static void __init msm8930_allocate_memory_regions(void)
748{
749 msm8930_allocate_fb_region();
750}
751
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530752#ifdef CONFIG_WCD9304_CODEC
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800753
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530754#define SITAR_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800755
756/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
757 * 4 micbiases are used to power various analog and digital
758 * microphones operating at 1800 mV. Technically, all micbiases
759 * can source from single cfilter since all microphones operate
760 * at the same voltage level. The arrangement below is to make
761 * sure all cfilters are exercised. LDO_H regulator ouput level
762 * does not need to be as high as 2.85V. It is choosen for
763 * microphone sensitivity purpose.
764 */
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530765static struct wcd9xxx_pdata sitar_platform_data = {
766 .slimbus_slave_device = {
767 .name = "sitar-slave",
768 .e_addr = {0, 0, 0x00, 0, 0x17, 2},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800769 },
770 .irq = MSM_GPIO_TO_INT(62),
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530771 .irq_base = SITAR_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530772 .num_irqs = NR_WCD9XXX_IRQS,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530773 .reset_gpio = 42,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800774 .micbias = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530775 .ldoh_v = SITAR_LDOH_2P85_V,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800776 .cfilt1_mv = 1800,
777 .cfilt2_mv = 1800,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530778 .bias1_cfilt_sel = SITAR_CFILT1_SEL,
779 .bias2_cfilt_sel = SITAR_CFILT2_SEL,
Bhalchandra Gajare15dbeaa2012-06-26 12:53:07 -0700780 .bias1_cap_mode = MICBIAS_EXT_BYP_CAP,
781 .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530782 },
783 .regulator = {
784 {
785 .name = "CDC_VDD_CP",
David Collinsbba26332012-08-16 16:11:53 -0700786 .min_uV = 1800000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530787 .max_uV = 2200000,
788 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
789 },
790 {
791 .name = "CDC_VDDA_RX",
792 .min_uV = 1800000,
793 .max_uV = 1800000,
794 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
795 },
796 {
797 .name = "CDC_VDDA_TX",
798 .min_uV = 1800000,
799 .max_uV = 1800000,
800 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
801 },
802 {
803 .name = "VDDIO_CDC",
804 .min_uV = 1800000,
805 .max_uV = 1800000,
806 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
807 },
808 {
809 .name = "VDDD_CDC_D",
810 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700811 .max_uV = 1250000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530812 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
813 },
814 {
815 .name = "CDC_VDDA_A_1P2V",
816 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700817 .max_uV = 1250000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530818 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
819 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800820 },
821};
822
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530823static struct slim_device msm_slim_sitar = {
824 .name = "sitar-slim",
825 .e_addr = {0, 1, 0x00, 0, 0x17, 2},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800826 .dev = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530827 .platform_data = &sitar_platform_data,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800828 },
829};
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700830
831static struct wcd9xxx_pdata sitar1p1_platform_data = {
832 .slimbus_slave_device = {
833 .name = "sitar-slave",
834 .e_addr = {0, 0, 0x70, 0, 0x17, 2},
835 },
836 .irq = MSM_GPIO_TO_INT(62),
837 .irq_base = SITAR_INTERRUPT_BASE,
838 .num_irqs = NR_WCD9XXX_IRQS,
839 .reset_gpio = 42,
840 .micbias = {
841 .ldoh_v = SITAR_LDOH_2P85_V,
842 .cfilt1_mv = 1800,
843 .cfilt2_mv = 1800,
844 .bias1_cfilt_sel = SITAR_CFILT1_SEL,
845 .bias2_cfilt_sel = SITAR_CFILT2_SEL,
Bhalchandra Gajare15dbeaa2012-06-26 12:53:07 -0700846 .bias1_cap_mode = MICBIAS_EXT_BYP_CAP,
847 .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700848 },
849 .regulator = {
850 {
851 .name = "CDC_VDD_CP",
David Collinsbba26332012-08-16 16:11:53 -0700852 .min_uV = 1800000,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700853 .max_uV = 2200000,
854 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
855 },
856 {
857 .name = "CDC_VDDA_RX",
858 .min_uV = 1800000,
859 .max_uV = 1800000,
860 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
861 },
862 {
863 .name = "CDC_VDDA_TX",
864 .min_uV = 1800000,
865 .max_uV = 1800000,
866 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
867 },
868 {
869 .name = "VDDIO_CDC",
870 .min_uV = 1800000,
871 .max_uV = 1800000,
872 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
873 },
874 {
875 .name = "VDDD_CDC_D",
876 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700877 .max_uV = 1250000,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700878 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
879 },
880 {
881 .name = "CDC_VDDA_A_1P2V",
882 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700883 .max_uV = 1250000,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700884 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
885 },
886 },
887};
888
889static struct slim_device msm_slim_sitar1p1 = {
890 .name = "sitar1p1-slim",
891 .e_addr = {0, 1, 0x70, 0, 0x17, 2},
892 .dev = {
893 .platform_data = &sitar1p1_platform_data,
894 },
895};
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800896#endif
897
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530898
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800899static struct slim_boardinfo msm_slim_devices[] = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530900#ifdef CONFIG_WCD9304_CODEC
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800901 {
902 .bus_num = 1,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530903 .slim_slave = &msm_slim_sitar,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800904 },
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700905 {
906 .bus_num = 1,
907 .slim_slave = &msm_slim_sitar1p1,
908 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800909#endif
910 /* add more slimbus slaves as needed */
911};
912
913#define MSM_WCNSS_PHYS 0x03000000
914#define MSM_WCNSS_SIZE 0x280000
915
916static struct resource resources_wcnss_wlan[] = {
917 {
918 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
919 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
920 .name = "wcnss_wlanrx_irq",
921 .flags = IORESOURCE_IRQ,
922 },
923 {
924 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
925 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
926 .name = "wcnss_wlantx_irq",
927 .flags = IORESOURCE_IRQ,
928 },
929 {
930 .start = MSM_WCNSS_PHYS,
931 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
932 .name = "wcnss_mmio",
933 .flags = IORESOURCE_MEM,
934 },
935 {
936 .start = 84,
937 .end = 88,
938 .name = "wcnss_gpios_5wire",
939 .flags = IORESOURCE_IO,
940 },
941};
942
943static struct qcom_wcnss_opts qcom_wcnss_pdata = {
944 .has_48mhz_xo = 1,
945};
946
947static struct platform_device msm_device_wcnss_wlan = {
948 .name = "wcnss_wlan",
949 .id = 0,
950 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
951 .resource = resources_wcnss_wlan,
952 .dev = {.platform_data = &qcom_wcnss_pdata},
953};
954
Ramesh Masavarapua26cce72012-04-09 12:32:25 -0700955#ifdef CONFIG_QSEECOM
956/* qseecom bus scaling */
957static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
958 {
959 .src = MSM_BUS_MASTER_SPS,
960 .dst = MSM_BUS_SLAVE_EBI_CH0,
961 .ib = 0,
962 .ab = 0,
963 },
964 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -0700965 .src = MSM_BUS_MASTER_SPS,
966 .dst = MSM_BUS_SLAVE_SPS,
967 .ib = 0,
968 .ab = 0,
969 },
970 {
Ramesh Masavarapua26cce72012-04-09 12:32:25 -0700971 .src = MSM_BUS_MASTER_SPDM,
972 .dst = MSM_BUS_SLAVE_SPDM,
973 .ib = 0,
974 .ab = 0,
975 },
976};
977
978static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
979 {
980 .src = MSM_BUS_MASTER_SPS,
981 .dst = MSM_BUS_SLAVE_EBI_CH0,
982 .ib = (492 * 8) * 1000000UL,
983 .ab = (492 * 8) * 100000UL,
984 },
985 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -0700986 .src = MSM_BUS_MASTER_SPS,
987 .dst = MSM_BUS_SLAVE_SPS,
988 .ib = (492 * 8) * 1000000UL,
989 .ab = (492 * 8) * 100000UL,
990 },
991 {
Ramesh Masavarapua26cce72012-04-09 12:32:25 -0700992 .src = MSM_BUS_MASTER_SPDM,
993 .dst = MSM_BUS_SLAVE_SPDM,
994 .ib = 0,
995 .ab = 0,
996 },
997};
998
999static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1000 {
1001 .src = MSM_BUS_MASTER_SPS,
1002 .dst = MSM_BUS_SLAVE_EBI_CH0,
1003 .ib = 0,
1004 .ab = 0,
1005 },
1006 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001007 .src = MSM_BUS_MASTER_SPS,
1008 .dst = MSM_BUS_SLAVE_SPS,
1009 .ib = 0,
1010 .ab = 0,
1011 },
1012 {
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001013 .src = MSM_BUS_MASTER_SPDM,
1014 .dst = MSM_BUS_SLAVE_SPDM,
1015 .ib = (64 * 8) * 1000000UL,
1016 .ab = (64 * 8) * 100000UL,
1017 },
1018};
1019
Ramesh Masavarapu4f091cb2012-10-03 10:18:06 -07001020static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = {
1021 {
1022 .src = MSM_BUS_MASTER_SPS,
1023 .dst = MSM_BUS_SLAVE_EBI_CH0,
1024 .ib = (492 * 8) * 1000000UL,
1025 .ab = (492 * 8) * 100000UL,
1026 },
1027 {
1028 .src = MSM_BUS_MASTER_SPS,
1029 .dst = MSM_BUS_SLAVE_SPS,
1030 .ib = (492 * 8) * 1000000UL,
1031 .ab = (492 * 8) * 100000UL,
1032 },
1033 {
1034 .src = MSM_BUS_MASTER_SPDM,
1035 .dst = MSM_BUS_SLAVE_SPDM,
1036 .ib = (64 * 8) * 1000000UL,
1037 .ab = (64 * 8) * 100000UL,
1038 },
1039};
1040
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001041static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1042 {
1043 ARRAY_SIZE(qseecom_clks_init_vectors),
1044 qseecom_clks_init_vectors,
1045 },
1046 {
1047 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1048 qseecom_enable_sfpb_vectors,
1049 },
1050 {
1051 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1052 qseecom_enable_sfpb_vectors,
1053 },
Ramesh Masavarapu4f091cb2012-10-03 10:18:06 -07001054 {
1055 ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors),
1056 qseecom_enable_dfab_sfpb_vectors,
1057 },
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001058};
1059
1060static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1061 qseecom_hw_bus_scale_usecases,
1062 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1063 .name = "qsee",
1064};
1065
1066static struct platform_device qseecom_device = {
1067 .name = "qseecom",
1068 .id = 0,
1069 .dev = {
1070 .platform_data = &qseecom_bus_pdata,
1071 },
1072};
1073#endif
1074
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001075#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1076 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1077 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1078 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1079
1080#define QCE_SIZE 0x10000
1081#define QCE_0_BASE 0x18500000
1082
1083#define QCE_HW_KEY_SUPPORT 0
1084#define QCE_SHA_HMAC_SUPPORT 1
1085#define QCE_SHARE_CE_RESOURCE 1
1086#define QCE_CE_SHARED 0
1087
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001088/* Begin Bus scaling definitions */
1089static struct msm_bus_vectors crypto_hw_init_vectors[] = {
1090 {
1091 .src = MSM_BUS_MASTER_ADM_PORT0,
1092 .dst = MSM_BUS_SLAVE_EBI_CH0,
1093 .ab = 0,
1094 .ib = 0,
1095 },
1096 {
1097 .src = MSM_BUS_MASTER_ADM_PORT1,
1098 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1099 .ab = 0,
1100 .ib = 0,
1101 },
1102};
1103
1104static struct msm_bus_vectors crypto_hw_active_vectors[] = {
1105 {
1106 .src = MSM_BUS_MASTER_ADM_PORT0,
1107 .dst = MSM_BUS_SLAVE_EBI_CH0,
1108 .ab = 70000000UL,
1109 .ib = 70000000UL,
1110 },
1111 {
1112 .src = MSM_BUS_MASTER_ADM_PORT1,
1113 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1114 .ab = 2480000000UL,
1115 .ib = 2480000000UL,
1116 },
1117};
1118
1119static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
1120 {
1121 ARRAY_SIZE(crypto_hw_init_vectors),
1122 crypto_hw_init_vectors,
1123 },
1124 {
1125 ARRAY_SIZE(crypto_hw_active_vectors),
1126 crypto_hw_active_vectors,
1127 },
1128};
1129
1130static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
1131 crypto_hw_bus_scale_usecases,
1132 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
1133 .name = "cryptohw",
1134};
1135/* End Bus Scaling Definitions*/
1136
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001137static struct resource qcrypto_resources[] = {
1138 [0] = {
1139 .start = QCE_0_BASE,
1140 .end = QCE_0_BASE + QCE_SIZE - 1,
1141 .flags = IORESOURCE_MEM,
1142 },
1143 [1] = {
1144 .name = "crypto_channels",
1145 .start = DMOV_CE_IN_CHAN,
1146 .end = DMOV_CE_OUT_CHAN,
1147 .flags = IORESOURCE_DMA,
1148 },
1149 [2] = {
1150 .name = "crypto_crci_in",
1151 .start = DMOV_CE_IN_CRCI,
1152 .end = DMOV_CE_IN_CRCI,
1153 .flags = IORESOURCE_DMA,
1154 },
1155 [3] = {
1156 .name = "crypto_crci_out",
1157 .start = DMOV_CE_OUT_CRCI,
1158 .end = DMOV_CE_OUT_CRCI,
1159 .flags = IORESOURCE_DMA,
1160 },
1161};
1162
1163static struct resource qcedev_resources[] = {
1164 [0] = {
1165 .start = QCE_0_BASE,
1166 .end = QCE_0_BASE + QCE_SIZE - 1,
1167 .flags = IORESOURCE_MEM,
1168 },
1169 [1] = {
1170 .name = "crypto_channels",
1171 .start = DMOV_CE_IN_CHAN,
1172 .end = DMOV_CE_OUT_CHAN,
1173 .flags = IORESOURCE_DMA,
1174 },
1175 [2] = {
1176 .name = "crypto_crci_in",
1177 .start = DMOV_CE_IN_CRCI,
1178 .end = DMOV_CE_IN_CRCI,
1179 .flags = IORESOURCE_DMA,
1180 },
1181 [3] = {
1182 .name = "crypto_crci_out",
1183 .start = DMOV_CE_OUT_CRCI,
1184 .end = DMOV_CE_OUT_CRCI,
1185 .flags = IORESOURCE_DMA,
1186 },
1187};
1188
1189#endif
1190
1191#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1192 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1193
1194static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1195 .ce_shared = QCE_CE_SHARED,
1196 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1197 .hw_key_support = QCE_HW_KEY_SUPPORT,
1198 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001199 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001200};
1201
1202static struct platform_device qcrypto_device = {
1203 .name = "qcrypto",
1204 .id = 0,
1205 .num_resources = ARRAY_SIZE(qcrypto_resources),
1206 .resource = qcrypto_resources,
1207 .dev = {
1208 .coherent_dma_mask = DMA_BIT_MASK(32),
1209 .platform_data = &qcrypto_ce_hw_suppport,
1210 },
1211};
1212#endif
1213
1214#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1215 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1216
1217static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1218 .ce_shared = QCE_CE_SHARED,
1219 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1220 .hw_key_support = QCE_HW_KEY_SUPPORT,
1221 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001222 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001223};
1224
1225static struct platform_device qcedev_device = {
1226 .name = "qce",
1227 .id = 0,
1228 .num_resources = ARRAY_SIZE(qcedev_resources),
1229 .resource = qcedev_resources,
1230 .dev = {
1231 .coherent_dma_mask = DMA_BIT_MASK(32),
1232 .platform_data = &qcedev_ce_hw_suppport,
1233 },
1234};
1235#endif
1236
1237#define MDM2AP_ERRFATAL 70
1238#define AP2MDM_ERRFATAL 95
1239#define MDM2AP_STATUS 69
1240#define AP2MDM_STATUS 94
1241#define AP2MDM_PMIC_RESET_N 80
1242#define AP2MDM_KPDPWR_N 81
1243
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001244static struct resource mdm_resources[] = {
1245 {
1246 .start = MDM2AP_ERRFATAL,
1247 .end = MDM2AP_ERRFATAL,
1248 .name = "MDM2AP_ERRFATAL",
1249 .flags = IORESOURCE_IO,
1250 },
1251 {
1252 .start = AP2MDM_ERRFATAL,
1253 .end = AP2MDM_ERRFATAL,
1254 .name = "AP2MDM_ERRFATAL",
1255 .flags = IORESOURCE_IO,
1256 },
1257 {
1258 .start = MDM2AP_STATUS,
1259 .end = MDM2AP_STATUS,
1260 .name = "MDM2AP_STATUS",
1261 .flags = IORESOURCE_IO,
1262 },
1263 {
1264 .start = AP2MDM_STATUS,
1265 .end = AP2MDM_STATUS,
1266 .name = "AP2MDM_STATUS",
1267 .flags = IORESOURCE_IO,
1268 },
1269 {
1270 .start = AP2MDM_PMIC_RESET_N,
1271 .end = AP2MDM_PMIC_RESET_N,
1272 .name = "AP2MDM_PMIC_RESET_N",
1273 .flags = IORESOURCE_IO,
1274 },
1275 {
1276 .start = AP2MDM_KPDPWR_N,
1277 .end = AP2MDM_KPDPWR_N,
1278 .name = "AP2MDM_KPDPWR_N",
1279 .flags = IORESOURCE_IO,
1280 },
1281};
1282
1283static struct mdm_platform_data mdm_platform_data = {
1284 .mdm_version = "2.5",
1285};
1286
1287static struct platform_device mdm_device = {
1288 .name = "mdm2_modem",
1289 .id = -1,
1290 .num_resources = ARRAY_SIZE(mdm_resources),
1291 .resource = mdm_resources,
1292 .dev = {
1293 .platform_data = &mdm_platform_data,
1294 },
1295};
1296
Taniya Das087145b2013-03-16 21:37:41 +05301297static struct mdm_platform_data sglte_platform_data = {
1298 .mdm_version = "4.0",
1299 .ramdump_delay_ms = 1000,
1300 .soft_reset_inverted = 1,
1301 .peripheral_platform_device = NULL,
1302 .ramdump_timeout_ms = 600000,
1303 .no_powerdown_after_ramdumps = 1,
1304 .image_upgrade_supported = 1,
1305};
1306
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001307static struct platform_device *mdm_devices[] __initdata = {
1308 &mdm_device,
1309};
1310
Praveen Chidambaram78499012011-11-01 17:15:17 -06001311#ifdef CONFIG_MSM_MPM
1312static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
1313 [1] = MSM_GPIO_TO_INT(46),
1314 [2] = MSM_GPIO_TO_INT(150),
1315 [4] = MSM_GPIO_TO_INT(103),
1316 [5] = MSM_GPIO_TO_INT(104),
1317 [6] = MSM_GPIO_TO_INT(105),
1318 [7] = MSM_GPIO_TO_INT(106),
1319 [8] = MSM_GPIO_TO_INT(107),
1320 [9] = MSM_GPIO_TO_INT(7),
1321 [10] = MSM_GPIO_TO_INT(11),
1322 [11] = MSM_GPIO_TO_INT(15),
1323 [12] = MSM_GPIO_TO_INT(19),
1324 [13] = MSM_GPIO_TO_INT(23),
1325 [14] = MSM_GPIO_TO_INT(27),
1326 [15] = MSM_GPIO_TO_INT(31),
1327 [16] = MSM_GPIO_TO_INT(35),
1328 [19] = MSM_GPIO_TO_INT(90),
1329 [20] = MSM_GPIO_TO_INT(92),
1330 [23] = MSM_GPIO_TO_INT(85),
1331 [24] = MSM_GPIO_TO_INT(83),
1332 [25] = USB1_HS_IRQ,
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001333 [26] = MSM_GPIO_TO_INT(6),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001334 [27] = HDMI_IRQ,
1335 [29] = MSM_GPIO_TO_INT(10),
1336 [30] = MSM_GPIO_TO_INT(102),
1337 [31] = MSM_GPIO_TO_INT(81),
1338 [32] = MSM_GPIO_TO_INT(78),
1339 [33] = MSM_GPIO_TO_INT(94),
1340 [34] = MSM_GPIO_TO_INT(72),
1341 [35] = MSM_GPIO_TO_INT(39),
1342 [36] = MSM_GPIO_TO_INT(43),
1343 [37] = MSM_GPIO_TO_INT(61),
1344 [38] = MSM_GPIO_TO_INT(50),
1345 [39] = MSM_GPIO_TO_INT(42),
1346 [41] = MSM_GPIO_TO_INT(62),
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001347 [42] = MSM_GPIO_TO_INT(8),
1348 [43] = MSM_GPIO_TO_INT(33),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001349 [44] = MSM_GPIO_TO_INT(70),
1350 [45] = MSM_GPIO_TO_INT(69),
1351 [46] = MSM_GPIO_TO_INT(67),
1352 [47] = MSM_GPIO_TO_INT(65),
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001353 [48] = MSM_GPIO_TO_INT(55),
1354 [49] = MSM_GPIO_TO_INT(74),
1355 [50] = MSM_GPIO_TO_INT(98),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001356 [51] = MSM_GPIO_TO_INT(49),
1357 [52] = MSM_GPIO_TO_INT(40),
1358 [53] = MSM_GPIO_TO_INT(37),
1359 [54] = MSM_GPIO_TO_INT(24),
1360 [55] = MSM_GPIO_TO_INT(14),
1361};
1362
1363static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
1364 TLMM_MSM_SUMMARY_IRQ,
1365 RPM_APCC_CPU0_GP_HIGH_IRQ,
1366 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1367 RPM_APCC_CPU0_GP_LOW_IRQ,
1368 RPM_APCC_CPU0_WAKE_UP_IRQ,
1369 RPM_APCC_CPU1_GP_HIGH_IRQ,
1370 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1371 RPM_APCC_CPU1_GP_LOW_IRQ,
1372 RPM_APCC_CPU1_WAKE_UP_IRQ,
1373 MSS_TO_APPS_IRQ_0,
1374 MSS_TO_APPS_IRQ_1,
1375 MSS_TO_APPS_IRQ_2,
1376 MSS_TO_APPS_IRQ_3,
1377 MSS_TO_APPS_IRQ_4,
1378 MSS_TO_APPS_IRQ_5,
1379 MSS_TO_APPS_IRQ_6,
1380 MSS_TO_APPS_IRQ_7,
1381 MSS_TO_APPS_IRQ_8,
1382 MSS_TO_APPS_IRQ_9,
1383 LPASS_SCSS_GP_LOW_IRQ,
1384 LPASS_SCSS_GP_MEDIUM_IRQ,
1385 LPASS_SCSS_GP_HIGH_IRQ,
1386 SPS_MTI_30,
1387 SPS_MTI_31,
1388 RIVA_APSS_SPARE_IRQ,
1389 RIVA_APPS_WLAN_SMSM_IRQ,
1390 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1391 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1392};
1393
1394struct msm_mpm_device_data msm8930_mpm_dev_data __initdata = {
1395 .irqs_m2a = msm_mpm_irqs_m2a,
1396 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1397 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1398 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1399 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1400 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1401 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1402 .mpm_apps_ipc_val = BIT(1),
1403 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1404
1405};
1406#endif
1407
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001408#define MSM_SHARED_RAM_PHYS 0x80000000
1409
1410static void __init msm8930_map_io(void)
1411{
1412 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
1413 msm_map_msm8930_io();
1414
1415 if (socinfo_init() < 0)
1416 pr_err("socinfo_init() failed!\n");
1417}
1418
1419static void __init msm8930_init_irq(void)
1420{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001421 struct msm_mpm_device_data *data = NULL;
1422#ifdef CONFIG_MSM_MPM
1423 data = &msm8930_mpm_dev_data;
1424#endif
1425
1426 msm_mpm_irq_extn_init(data);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001427 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1428 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001429}
1430
1431static void __init msm8930_init_buses(void)
1432{
1433#ifdef CONFIG_MSM_BUS_SCALING
1434 msm_bus_rpm_set_mt_mask();
Gagan Maccd5b3272012-02-09 18:13:10 -07001435 msm_bus_8930_apps_fabric_pdata.rpm_enabled = 1;
1436 msm_bus_8930_sys_fabric_pdata.rpm_enabled = 1;
1437 msm_bus_8930_mm_fabric_pdata.rpm_enabled = 1;
1438 msm_bus_8930_apps_fabric.dev.platform_data =
1439 &msm_bus_8930_apps_fabric_pdata;
1440 msm_bus_8930_sys_fabric.dev.platform_data =
1441 &msm_bus_8930_sys_fabric_pdata;
1442 msm_bus_8930_mm_fabric.dev.platform_data =
1443 &msm_bus_8930_mm_fabric_pdata;
1444 msm_bus_8930_sys_fpb.dev.platform_data = &msm_bus_8930_sys_fpb_pdata;
1445 msm_bus_8930_cpss_fpb.dev.platform_data = &msm_bus_8930_cpss_fpb_pdata;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001446#endif
1447}
1448
1449static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1450 .max_clock_speed = 15060000,
1451};
1452
1453#ifdef CONFIG_USB_MSM_OTG_72K
1454static struct msm_otg_platform_data msm_otg_pdata;
1455#else
Mayank Rana2a1c7db2013-01-08 15:10:51 +05301456static int enable_usb_host_mode;
1457static int __init usb_host_mode_with_pm8917(char *param)
1458{
1459 int ret;
1460
1461 ret = kstrtoint(param, 10, &enable_usb_host_mode);
1462 return ret;
1463}
1464early_param("usb_host_mode_pm8917", usb_host_mode_with_pm8917);
1465
Manu Gautam32ab9462012-02-20 12:33:01 +05301466#ifdef CONFIG_MSM_BUS_SCALING
1467/* Bandwidth requests (zero) if no vote placed */
1468static struct msm_bus_vectors usb_init_vectors[] = {
1469 {
1470 .src = MSM_BUS_MASTER_SPS,
1471 .dst = MSM_BUS_SLAVE_EBI_CH0,
1472 .ab = 0,
1473 .ib = 0,
1474 },
1475};
1476
1477/* Bus bandwidth requests in Bytes/sec */
1478static struct msm_bus_vectors usb_max_vectors[] = {
1479 {
1480 .src = MSM_BUS_MASTER_SPS,
1481 .dst = MSM_BUS_SLAVE_EBI_CH0,
1482 .ab = 60000000, /* At least 480Mbps on bus. */
1483 .ib = 960000000, /* MAX bursts rate */
1484 },
1485};
1486
1487static struct msm_bus_paths usb_bus_scale_usecases[] = {
1488 {
1489 ARRAY_SIZE(usb_init_vectors),
1490 usb_init_vectors,
1491 },
1492 {
1493 ARRAY_SIZE(usb_max_vectors),
1494 usb_max_vectors,
1495 },
1496};
1497
1498static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
1499 usb_bus_scale_usecases,
1500 ARRAY_SIZE(usb_bus_scale_usecases),
1501 .name = "usb",
1502};
1503#endif
1504
Mayank Rana2fe1aec2012-06-07 18:00:12 +05301505static int hsusb_phy_init_seq[] = {
1506 0x44, 0x80, /* set VBUS valid threshold
1507 and disconnect valid threshold */
1508 0x38, 0x81, /* update DC voltage level */
1509 0x24, 0x82, /* set preemphasis and rise/fall time */
1510 0x13, 0x83, /* set source impedance adjusment */
1511 -1};
1512
Jack Pham87f202f2012-08-06 00:24:22 -07001513#define MSM_MPM_PIN_USB1_OTGSESSVLD 40
1514
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001515static struct msm_otg_platform_data msm_otg_pdata = {
1516 .mode = USB_OTG,
1517 .otg_control = OTG_PMIC_CONTROL,
1518 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001519 .power_budget = 750,
Manu Gautam32ab9462012-02-20 12:33:01 +05301520#ifdef CONFIG_MSM_BUS_SCALING
1521 .bus_scale_table = &usb_bus_scale_pdata,
1522#endif
Pavankumar Kondeti2aec9f32012-06-13 09:06:03 +05301523#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
1524 .mhl_dev_name = "sii8334",
1525#endif
Jack Pham87f202f2012-08-06 00:24:22 -07001526 .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001527};
1528#endif
1529
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001530#define PID_MAGIC_ID 0x71432909
1531#define SERIAL_NUM_MAGIC_ID 0x61945374
1532#define SERIAL_NUMBER_LENGTH 127
1533#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1534
1535struct magic_num_struct {
1536 uint32_t pid;
1537 uint32_t serial_num;
1538};
1539
1540struct dload_struct {
1541 uint32_t reserved1;
1542 uint32_t reserved2;
1543 uint32_t reserved3;
1544 uint16_t reserved4;
1545 uint16_t pid;
1546 char serial_number[SERIAL_NUMBER_LENGTH];
1547 uint16_t reserved5;
1548 struct magic_num_struct magic_struct;
1549};
1550
1551static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1552{
1553 struct dload_struct __iomem *dload = 0;
1554
1555 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1556 if (!dload) {
1557 pr_err("%s: cannot remap I/O memory region: %08x\n",
1558 __func__, DLOAD_USB_BASE_ADD);
1559 return -ENXIO;
1560 }
1561
1562 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1563 __func__, dload, pid, snum);
1564 /* update pid */
1565 dload->magic_struct.pid = PID_MAGIC_ID;
1566 dload->pid = pid;
1567
1568 /* update serial number */
1569 dload->magic_struct.serial_num = 0;
1570 if (!snum) {
1571 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1572 goto out;
1573 }
1574
1575 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
1576 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
1577out:
1578 iounmap(dload);
1579 return 0;
1580}
1581
1582static struct android_usb_platform_data android_usb_pdata = {
1583 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1584};
1585
1586static struct platform_device android_usb_device = {
1587 .name = "android_usb",
1588 .id = -1,
1589 .dev = {
1590 .platform_data = &android_usb_pdata,
1591 },
1592};
1593
1594static uint8_t spm_wfi_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001595 0x03, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001596};
1597
Anji Jonnala786b39e2013-01-29 13:34:10 +05301598
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301599static uint8_t spm_retention_cmd_sequence[] __initdata = {
1600 0x00, 0x05, 0x03, 0x0D,
1601 0x0B, 0x00, 0x0f,
1602};
1603
Anji Jonnala786b39e2013-01-29 13:34:10 +05301604static uint8_t spm_retention_with_krait_v3_cmd_sequence[] __initdata = {
1605 0x42, 0x1B, 0x00,
1606 0x05, 0x03, 0x0D, 0x0B,
1607 0x00, 0x42, 0x1B,
1608 0x0f,
1609};
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001610static uint8_t spm_power_collapse_without_rpm[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001611 0x00, 0x24, 0x54, 0x10,
1612 0x09, 0x03, 0x01,
1613 0x10, 0x54, 0x30, 0x0C,
1614 0x24, 0x30, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001615};
1616
1617static uint8_t spm_power_collapse_with_rpm[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001618 0x00, 0x24, 0x54, 0x10,
1619 0x09, 0x07, 0x01, 0x0B,
1620 0x10, 0x54, 0x30, 0x0C,
1621 0x24, 0x30, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001622};
1623
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301624static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = {
1625 [0] = {
1626 .mode = MSM_SPM_MODE_CLOCK_GATING,
1627 .notify_rpm = false,
1628 .cmd = spm_wfi_cmd_sequence,
1629 },
1630 [1] = {
1631 .mode = MSM_SPM_MODE_POWER_RETENTION,
1632 .notify_rpm = false,
1633 .cmd = spm_retention_cmd_sequence,
1634 },
1635 [2] = {
1636 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1637 .notify_rpm = false,
1638 .cmd = spm_power_collapse_without_rpm,
1639 },
1640 [3] = {
1641 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1642 .notify_rpm = true,
1643 .cmd = spm_power_collapse_with_rpm,
1644 },
1645};
1646
1647static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001648 [0] = {
1649 .mode = MSM_SPM_MODE_CLOCK_GATING,
1650 .notify_rpm = false,
1651 .cmd = spm_wfi_cmd_sequence,
1652 },
1653 [1] = {
Anji Jonnala786b39e2013-01-29 13:34:10 +05301654 .mode = MSM_SPM_MODE_POWER_RETENTION,
1655 .notify_rpm = false,
1656 .cmd = spm_retention_cmd_sequence,
1657 },
1658 [2] = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001659 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1660 .notify_rpm = false,
1661 .cmd = spm_power_collapse_without_rpm,
1662 },
Anji Jonnala786b39e2013-01-29 13:34:10 +05301663 [3] = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001664 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1665 .notify_rpm = true,
1666 .cmd = spm_power_collapse_with_rpm,
1667 },
1668};
1669
1670static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1671 [0] = {
1672 .reg_base_addr = MSM_SAW0_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001673 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001674#if defined(CONFIG_MSM_AVS_HW)
1675 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1676 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1677#endif
1678 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301679 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
1680 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
1681 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001682 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301683 .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list),
1684 .modes = msm_spm_boot_cpu_seq_list,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001685 },
1686 [1] = {
1687 .reg_base_addr = MSM_SAW1_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001688 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001689#if defined(CONFIG_MSM_AVS_HW)
1690 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1691 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1692#endif
1693 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala786b39e2013-01-29 13:34:10 +05301694 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
1695 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
1696 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001697 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301698 .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list),
1699 .modes = msm_spm_nonboot_cpu_seq_list,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001700 },
1701};
1702
1703static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001704 0x00, 0x20, 0x03, 0x20,
1705 0x00, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001706};
1707
1708static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001709 0x00, 0x20, 0x34, 0x64,
1710 0x48, 0x07, 0x48, 0x20,
1711 0x50, 0x64, 0x04, 0x34,
1712 0x50, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001713};
1714static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001715 0x00, 0x10, 0x34, 0x64,
1716 0x48, 0x07, 0x48, 0x10,
1717 0x50, 0x64, 0x04, 0x34,
1718 0x50, 0x0F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001719};
1720
1721static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1722 [0] = {
1723 .mode = MSM_SPM_L2_MODE_RETENTION,
1724 .notify_rpm = false,
1725 .cmd = l2_spm_wfi_cmd_sequence,
1726 },
1727 [1] = {
1728 .mode = MSM_SPM_L2_MODE_GDHS,
1729 .notify_rpm = true,
1730 .cmd = l2_spm_gdhs_cmd_sequence,
1731 },
1732 [2] = {
1733 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1734 .notify_rpm = true,
1735 .cmd = l2_spm_power_off_cmd_sequence,
1736 },
1737};
1738
1739static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1740 [0] = {
1741 .reg_base_addr = MSM_SAW_L2_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001742 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001743 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001744 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1745 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1746 .modes = msm_spm_l2_seq_list,
1747 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1748 },
1749};
1750
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301751#define ISA1200_HAP_EN_GPIO 77
1752#define ISA1200_HAP_LEN_GPIO 78
David Collins04499982012-08-06 15:02:03 -07001753#define ISA1200_HAP_CLK_PM8038 PM8038_GPIO_PM_TO_SYS(7)
1754#define ISA1200_HAP_CLK_PM8917 PM8917_GPIO_PM_TO_SYS(38)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001755
1756static int isa1200_power(int on)
1757{
David Collins04499982012-08-06 15:02:03 -07001758 unsigned int gpio = ISA1200_HAP_CLK_PM8038;
1759 enum pm8xxx_aux_clk_id clk_id = CLK_MP3_1;
Amy Malocheb20c1052012-04-11 10:36:13 -07001760 int rc = 0;
1761
David Collins04499982012-08-06 15:02:03 -07001762 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
1763 gpio = ISA1200_HAP_CLK_PM8917;
1764 clk_id = CLK_MP3_2;
1765 }
1766
1767 gpio_set_value_cansleep(gpio, !!on);
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301768
Amy Malocheb20c1052012-04-11 10:36:13 -07001769 if (on)
David Collins04499982012-08-06 15:02:03 -07001770 rc = pm8xxx_aux_clk_control(clk_id, XO_DIV_1, true);
Amy Malocheb20c1052012-04-11 10:36:13 -07001771 else
David Collins04499982012-08-06 15:02:03 -07001772 rc = pm8xxx_aux_clk_control(clk_id, XO_DIV_NONE, true);
Amy Malocheb20c1052012-04-11 10:36:13 -07001773
1774 if (rc) {
1775 pr_err("%s: unable to write aux clock register(%d)\n",
1776 __func__, rc);
1777 }
1778
1779 return rc;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001780}
1781
1782static int isa1200_dev_setup(bool enable)
1783{
David Collins04499982012-08-06 15:02:03 -07001784 unsigned int gpio = ISA1200_HAP_CLK_PM8038;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001785 int rc = 0;
1786
David Collins04499982012-08-06 15:02:03 -07001787 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
1788 gpio = ISA1200_HAP_CLK_PM8917;
1789
Amy Malocheb20c1052012-04-11 10:36:13 -07001790 if (!enable)
1791 goto fail_gpio_dir;
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301792
David Collins04499982012-08-06 15:02:03 -07001793 rc = gpio_request(gpio, "haptics_clk");
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301794 if (rc) {
1795 pr_err("%s: gpio_request for %d gpio failed rc(%d)\n",
David Collins04499982012-08-06 15:02:03 -07001796 __func__, gpio, rc);
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301797 goto fail_gpio_req;
1798 }
1799
David Collins04499982012-08-06 15:02:03 -07001800 rc = gpio_direction_output(gpio, 0);
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301801 if (rc) {
1802 pr_err("%s: gpio_direction_output failed for %d gpio rc(%d)\n",
David Collins04499982012-08-06 15:02:03 -07001803 __func__, gpio, rc);
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301804 goto fail_gpio_dir;
1805 }
1806
1807 return 0;
1808
1809fail_gpio_dir:
David Collins04499982012-08-06 15:02:03 -07001810 gpio_free(gpio);
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301811fail_gpio_req:
1812 return rc;
1813
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001814}
1815
1816static struct isa1200_regulator isa1200_reg_data[] = {
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301817 {
1818 .name = "vddp",
1819 .min_uV = ISA_I2C_VTG_MIN_UV,
1820 .max_uV = ISA_I2C_VTG_MAX_UV,
1821 .load_uA = ISA_I2C_CURR_UA,
1822 },
Amy Malochee8de95d2012-02-23 10:40:25 -08001823 {
1824 .name = "vcc_i2c",
1825 .min_uV = ISA_I2C_VTG_MIN_UV,
1826 .max_uV = ISA_I2C_VTG_MAX_UV,
1827 .load_uA = ISA_I2C_CURR_UA,
1828 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001829};
1830
1831static struct isa1200_platform_data isa1200_1_pdata = {
1832 .name = "vibrator",
1833 .dev_setup = isa1200_dev_setup,
1834 .power_on = isa1200_power,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301835 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1836 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001837 .max_timeout = 15000,
1838 .mode_ctrl = PWM_GEN_MODE,
1839 .pwm_fd = {
1840 .pwm_div = 256,
1841 },
1842 .is_erm = false,
1843 .smart_en = true,
1844 .ext_clk_en = true,
1845 .chip_en = 1,
1846 .regulator_info = isa1200_reg_data,
1847 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1848};
1849
1850static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1851 {
1852 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1853 .platform_data = &isa1200_1_pdata,
1854 },
1855};
1856
Amy Malochef3c9db42011-12-08 15:17:35 -08001857#define MXT_TS_GPIO_IRQ 11
1858#define MXT_TS_RESET_GPIO 52
1859
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301860static const u8 mxt_config_data_8930_v1[] = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001861 /* T6 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001862 0, 0, 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001863 /* T38 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301864 15, 3, 0, 15, 12, 11, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001865 /* T7 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301866 32, 16, 50,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001867 /* T8 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301868 30, 0, 5, 1, 0, 0, 8, 8, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001869 /* T9 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301870 131, 0, 0, 19, 11, 0, 16, 43, 2, 3,
1871 10, 7, 2, 0, 4, 5, 35, 10, 43, 4,
1872 54, 2, 15, 32, 38, 38, 143, 40, 143, 80,
1873 7, 9, 50, 50, 2,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001874 /* T15 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001875 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1876 0,
1877 /* T18 Object */
1878 0, 0,
1879 /* T19 Object */
1880 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1881 0, 0, 0, 0, 0, 0,
1882 /* T23 Object */
1883 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1884 0, 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001885 /* T25 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001886 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1887 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001888 /* T40 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001889 0, 0, 0, 0, 0,
1890 /* T42 Object */
1891 0, 0, 0, 0, 0, 0, 0, 0,
1892 /* T46 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301893 0, 3, 8, 16, 0, 0, 1, 0, 0,
Amy Malochef3c9db42011-12-08 15:17:35 -08001894 /* T47 Object */
1895 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1896 /* T48 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301897 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
1898 0, 0, 0, 0, 0, 0, 0, 100, 4, 64,
1899 0, 0, 5, 42, 0, 0, 0, 0, 0, 0,
Amy Malochef3c9db42011-12-08 15:17:35 -08001900 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1901 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1902 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001903};
1904
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301905static const u8 mxt_config_data_8930_v2[] = {
1906 /* T6 Object */
1907 0, 0, 0, 0, 0, 0,
1908 /* T38 Object */
1909 15, 4, 0, 9, 7, 12, 0, 0,
1910 /* T7 Object */
1911 32, 16, 50,
1912 /* T8 Object */
1913 30, 0, 5, 10, 0, 0, 10, 10, 0, 0,
1914 /* T9 Object */
1915 131, 0, 0, 19, 11, 0, 16, 50, 1, 3,
1916 12, 7, 2, 0, 4, 5, 2, 10, 43, 4,
1917 54, 2, -25, 29, 38, 18, 143, 40, 207, 80,
1918 17, 5, 50, 50, 0,
1919 /* T18 Object */
1920 0, 0,
1921 /* T19 Object */
1922 0, 0, 0, 0, 0, 0,
1923 /* T25 Object */
1924 0, 0, 0, 0, 0, 0,
1925 /* T42 Object */
1926 3, 60, 20, 20, 150, 0, 0, 0,
1927 /* T46 Object */
1928 0, 3, 28, 28, 0, 0, 1, 0, 0,
1929 /* T47 Object */
1930 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1931 /* T48 Object */
1932 1, 3, 82, 0, 0, 0, 0, 0, 0, 0,
1933 16, 30, 0, 6, 6, 0, 0, 124, 4, 100,
1934 0, 0, 0, 5, 0, 42, 0, 1, 0, 40,
1935 52, 20, 0, 0, 0, 50, 1, 5, 2, 1,
1936 4, 5, 3, -25, 29, 38, 18, 143, 40, 207,
1937 80, 10, 5, 2,
1938 /* T55 Object */
1939 0, 0, 0, 0,
1940};
1941
Amy Malochef3c9db42011-12-08 15:17:35 -08001942static ssize_t mxt224e_vkeys_show(struct kobject *kobj,
1943 struct kobj_attribute *attr, char *buf)
1944{
1945 return snprintf(buf, 200,
Amy Malochef8130f92012-02-01 10:38:59 +05301946 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":57:1030:90:90"
1947 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":206:1030:90:90"
1948 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":366:1030:90:90"
1949 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":503:1030:90:90"
Amy Malochef3c9db42011-12-08 15:17:35 -08001950 "\n");
1951}
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001952
Amy Malochef3c9db42011-12-08 15:17:35 -08001953static struct kobj_attribute mxt224e_vkeys_attr = {
1954 .attr = {
1955 .mode = S_IRUGO,
1956 },
1957 .show = &mxt224e_vkeys_show,
1958};
1959
1960static struct attribute *mxt224e_properties_attrs[] = {
1961 &mxt224e_vkeys_attr.attr,
1962 NULL
1963};
1964
1965static struct attribute_group mxt224e_properties_attr_group = {
1966 .attrs = mxt224e_properties_attrs,
1967};
1968
1969static void mxt_init_vkeys_8930(void)
1970{
Steve Mucklef132c6c2012-06-06 18:30:57 -07001971 int rc = 0;
Amy Malochef3c9db42011-12-08 15:17:35 -08001972 static struct kobject *mxt224e_properties_kobj;
1973
1974 mxt224e_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts";
1975 mxt224e_properties_kobj = kobject_create_and_add("board_properties",
1976 NULL);
1977 if (mxt224e_properties_kobj)
1978 rc = sysfs_create_group(mxt224e_properties_kobj,
1979 &mxt224e_properties_attr_group);
1980 if (!mxt224e_properties_kobj || rc)
1981 pr_err("%s: failed to create board_properties\n",
1982 __func__);
1983
1984 return;
1985}
1986
Jing Lindc4413c2012-01-16 15:22:52 -08001987static struct mxt_config_info mxt_config_array[] = {
1988 {
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301989 .config = mxt_config_data_8930_v1,
1990 .config_length = ARRAY_SIZE(mxt_config_data_8930_v1),
Jing Lindc4413c2012-01-16 15:22:52 -08001991 .family_id = 0x81,
1992 .variant_id = 0x01,
1993 .version = 0x10,
1994 .build = 0xAA,
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301995 .bootldr_id = MXT_BOOTLOADER_ID_224E,
1996 .fw_name = "atmel_8930_fluid_v2_0_AB.hex",
1997 },
1998 {
1999 .config = mxt_config_data_8930_v2,
2000 .config_length = ARRAY_SIZE(mxt_config_data_8930_v2),
2001 .family_id = 0x81,
2002 .variant_id = 0x15,
2003 .version = 0x11,
2004 .build = 0xAA,
2005 .bootldr_id = MXT_BOOTLOADER_ID_224E,
2006 .fw_name = "atmel_8930_fluid_v2_0_AB.hex",
2007 },
2008 {
2009 .config = mxt_config_data_8930_v2,
2010 .config_length = ARRAY_SIZE(mxt_config_data_8930_v2),
2011 .family_id = 0x81,
2012 .variant_id = 0x01,
2013 .version = 0x20,
2014 .build = 0xAB,
2015 .bootldr_id = MXT_BOOTLOADER_ID_224E,
Jing Lindc4413c2012-01-16 15:22:52 -08002016 },
2017};
2018
Amy Malochef3c9db42011-12-08 15:17:35 -08002019static struct mxt_platform_data mxt_platform_data_8930 = {
Jing Lindc4413c2012-01-16 15:22:52 -08002020 .config_array = mxt_config_array,
2021 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08002022 .panel_minx = 0,
2023 .panel_maxx = 566,
2024 .panel_miny = 0,
2025 .panel_maxy = 1067,
2026 .disp_minx = 0,
2027 .disp_maxx = 540,
2028 .disp_miny = 0,
2029 .disp_maxy = 960,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002030 .irqflags = IRQF_TRIGGER_FALLING,
Anirudh Ghayald7ad84c2012-01-09 09:17:53 +05302031#ifdef MSM8930_PHASE_2
2032 .digital_pwr_regulator = true,
2033#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002034 .i2c_pull_up = true,
Amy Malochef3c9db42011-12-08 15:17:35 -08002035 .reset_gpio = MXT_TS_RESET_GPIO,
2036 .irq_gpio = MXT_TS_GPIO_IRQ,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002037};
2038
Amy Malochef3c9db42011-12-08 15:17:35 -08002039static struct i2c_board_info mxt_device_info_8930[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002040 {
Amy Malochef3c9db42011-12-08 15:17:35 -08002041 I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
2042 .platform_data = &mxt_platform_data_8930,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002043 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
2044 },
2045};
2046
David Collins04499982012-08-06 15:02:03 -07002047#define MHL_POWER_GPIO_PM8038 PM8038_GPIO_PM_TO_SYS(MHL_GPIO_PWR_EN)
2048#define MHL_POWER_GPIO_PM8917 PM8917_GPIO_PM_TO_SYS(25)
Manoj Raoc6d904c2012-06-22 00:32:14 -07002049static struct msm_mhl_platform_data mhl_platform_data = {
2050 .irq = MSM_GPIO_TO_INT(MHL_GPIO_INT),
2051 .gpio_mhl_int = MHL_GPIO_INT,
2052 .gpio_mhl_reset = MHL_GPIO_RESET,
David Collins04499982012-08-06 15:02:03 -07002053 .gpio_mhl_power = MHL_POWER_GPIO_PM8038,
Manoj Raoc6d904c2012-06-22 00:32:14 -07002054 .gpio_hdmi_mhl_mux = HDMI_MHL_MUX_GPIO,
2055};
2056
2057static struct i2c_board_info sii_device_info[] __initdata = {
2058 {
2059 /*
2060 * keeps SI 8334 as the default
2061 * MHL TX
2062 */
2063 I2C_BOARD_INFO("sii8334", 0x39),
2064 .platform_data = &mhl_platform_data,
2065 .flags = I2C_CLIENT_WAKE,
2066 },
2067};
2068
2069
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302070#ifdef MSM8930_PHASE_2
2071
David Collins04499982012-08-06 15:02:03 -07002072#define GPIO_VOLUME_UP_PM8038 PM8038_GPIO_PM_TO_SYS(3)
2073#define GPIO_VOLUME_DOWN_PM8038 PM8038_GPIO_PM_TO_SYS(8)
2074#define GPIO_CAMERA_SNAPSHOT_PM8038 PM8038_GPIO_PM_TO_SYS(10)
2075#define GPIO_CAMERA_FOCUS_PM8038 PM8038_GPIO_PM_TO_SYS(11)
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302076
David Collins04499982012-08-06 15:02:03 -07002077#define GPIO_VOLUME_UP_PM8917 PM8917_GPIO_PM_TO_SYS(27)
2078#define GPIO_VOLUME_DOWN_PM8917 PM8917_GPIO_PM_TO_SYS(28)
2079#define GPIO_CAMERA_SNAPSHOT_PM8917 PM8917_GPIO_PM_TO_SYS(36)
2080#define GPIO_CAMERA_FOCUS_PM8917 PM8917_GPIO_PM_TO_SYS(37)
2081
2082static struct gpio_keys_button keys_8930_pm8038[] = {
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302083 {
2084 .code = KEY_VOLUMEUP,
2085 .type = EV_KEY,
2086 .desc = "volume_up",
David Collins04499982012-08-06 15:02:03 -07002087 .gpio = GPIO_VOLUME_UP_PM8038,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302088 .wakeup = 1,
2089 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07002090 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302091 },
2092 {
2093 .code = KEY_VOLUMEDOWN,
2094 .type = EV_KEY,
2095 .desc = "volume_down",
David Collins04499982012-08-06 15:02:03 -07002096 .gpio = GPIO_VOLUME_DOWN_PM8038,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302097 .wakeup = 1,
2098 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07002099 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302100 },
2101 {
2102 .code = KEY_CAMERA_FOCUS,
2103 .type = EV_KEY,
2104 .desc = "camera_focus",
David Collins04499982012-08-06 15:02:03 -07002105 .gpio = GPIO_CAMERA_FOCUS_PM8038,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302106 .wakeup = 1,
2107 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07002108 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302109 },
2110 {
2111 .code = KEY_CAMERA_SNAPSHOT,
2112 .type = EV_KEY,
2113 .desc = "camera_snapshot",
David Collins04499982012-08-06 15:02:03 -07002114 .gpio = GPIO_CAMERA_SNAPSHOT_PM8038,
2115 .wakeup = 1,
2116 .active_low = 1,
2117 .debounce_interval = 15,
2118 },
2119};
2120
2121static struct gpio_keys_button keys_8930_pm8917[] = {
2122 {
2123 .code = KEY_VOLUMEUP,
2124 .type = EV_KEY,
2125 .desc = "volume_up",
2126 .gpio = GPIO_VOLUME_UP_PM8917,
2127 .wakeup = 1,
2128 .active_low = 1,
2129 .debounce_interval = 15,
2130 },
2131 {
2132 .code = KEY_VOLUMEDOWN,
2133 .type = EV_KEY,
2134 .desc = "volume_down",
2135 .gpio = GPIO_VOLUME_DOWN_PM8917,
2136 .wakeup = 1,
2137 .active_low = 1,
2138 .debounce_interval = 15,
2139 },
2140 {
2141 .code = KEY_CAMERA_FOCUS,
2142 .type = EV_KEY,
2143 .desc = "camera_focus",
2144 .gpio = GPIO_CAMERA_FOCUS_PM8917,
2145 .wakeup = 1,
2146 .active_low = 1,
2147 .debounce_interval = 15,
2148 },
2149 {
2150 .code = KEY_CAMERA_SNAPSHOT,
2151 .type = EV_KEY,
2152 .desc = "camera_snapshot",
2153 .gpio = GPIO_CAMERA_SNAPSHOT_PM8917,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302154 .wakeup = 1,
2155 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07002156 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302157 },
2158};
2159
2160/* Add GPIO keys for 8930 */
2161static struct gpio_keys_platform_data gpio_keys_8930_pdata = {
David Collins04499982012-08-06 15:02:03 -07002162 .buttons = keys_8930_pm8038,
2163 .nbuttons = ARRAY_SIZE(keys_8930_pm8038),
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302164};
2165
2166static struct platform_device gpio_keys_8930 = {
2167 .name = "gpio-keys",
2168 .id = -1,
2169 .dev = {
2170 .platform_data = &gpio_keys_8930_pdata,
2171 },
2172};
2173#endif /* MSM8930_PHASE_2 */
2174
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002175static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2176 .clk_freq = 100000,
2177 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002178};
2179
2180static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2181 .clk_freq = 100000,
2182 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002183};
2184
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002185static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi9_pdata = {
2186 .clk_freq = 100000,
2187 .src_clk_rate = 24000000,
2188};
2189
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002190static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2191 .clk_freq = 100000,
2192 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002193};
2194
2195static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2196 .clk_freq = 100000,
2197 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002198};
2199
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002200
2201static struct ks8851_pdata spi_eth_pdata = {
2202 .irq_gpio = KS8851_IRQ_GPIO,
2203 .rst_gpio = KS8851_RST_GPIO,
2204};
2205
2206static struct spi_board_info spi_board_info[] __initdata = {
2207 {
2208 .modalias = "ks8851",
2209 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2210 .max_speed_hz = 19200000,
2211 .bus_num = 0,
2212 .chip_select = 0,
2213 .mode = SPI_MODE_0,
2214 .platform_data = &spi_eth_pdata
2215 },
2216 {
2217 .modalias = "dsi_novatek_3d_panel_spi",
2218 .max_speed_hz = 10800000,
2219 .bus_num = 0,
2220 .chip_select = 1,
2221 .mode = SPI_MODE_0,
2222 },
2223};
2224
2225static struct platform_device msm_device_saw_core0 = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002226 .name = "saw-regulator",
2227 .id = 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002228 .dev = {
David Collins86161e42012-08-20 12:17:09 -07002229 .platform_data = &msm8930_pm8038_saw_regulator_core0_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002230 },
2231};
2232
2233static struct platform_device msm_device_saw_core1 = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002234 .name = "saw-regulator",
2235 .id = 1,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002236 .dev = {
David Collins86161e42012-08-20 12:17:09 -07002237 .platform_data = &msm8930_pm8038_saw_regulator_core1_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002238 },
2239};
2240
2241static struct tsens_platform_data msm_tsens_pdata = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002242 .tsens_factor = 1000,
Siddartha Mohanadoss97425122012-03-09 12:06:54 -08002243 .hw_type = APQ_8064,
Siddartha Mohanadoss892ee472012-05-03 10:35:20 -07002244 .tsens_num_sensor = 10,
2245 .slope = {1132, 1135, 1137, 1135, 1157,
2246 1142, 1124, 1153, 1175, 1166},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002247};
2248
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002249static struct platform_device msm_tsens_device = {
2250 .name = "tsens8960-tm",
2251 .id = -1,
2252};
2253
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002254static struct msm_thermal_data msm_thermal_pdata = {
2255 .sensor_id = 9,
Eugene Seah2ee4a5d2012-06-25 18:16:41 -06002256 .poll_ms = 250,
2257 .limit_temp_degC = 60,
2258 .temp_hysteresis_degC = 10,
2259 .freq_step = 2,
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002260};
2261
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002262#ifdef CONFIG_MSM_FAKE_BATTERY
2263static struct platform_device fish_battery_device = {
2264 .name = "fish_battery",
2265};
2266#endif
2267
David Collins1d4061b2011-12-06 15:36:40 -08002268#ifndef MSM8930_PHASE_2
2269
2270/* 8930 Phase 1 */
Jay Chokshi06fa7542011-12-07 13:09:17 -08002271static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002272 .name = GPIO_REGULATOR_DEV_NAME,
2273 .id = PM8921_MPP_PM_TO_SYS(7),
2274 .dev = {
2275 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2276 },
2277};
2278
Jay Chokshi06fa7542011-12-07 13:09:17 -08002279static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002280 .name = GPIO_REGULATOR_DEV_NAME,
2281 .id = 91,
2282 .dev = {
2283 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2284 },
2285};
2286
David Collins1d4061b2011-12-06 15:36:40 -08002287#else
2288
2289/* 8930 Phase 2 */
2290static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
2291 .name = GPIO_REGULATOR_DEV_NAME,
2292 .id = 63,
2293 .dev = {
David Collins86161e42012-08-20 12:17:09 -07002294 .platform_data = &msm8930_pm8038_gpio_regulator_pdata[
2295 MSM8930_GPIO_VREG_ID_EXT_5V],
David Collins1d4061b2011-12-06 15:36:40 -08002296 },
2297};
2298
2299static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = {
2300 .name = GPIO_REGULATOR_DEV_NAME,
2301 .id = 97,
2302 .dev = {
David Collins86161e42012-08-20 12:17:09 -07002303 .platform_data = &msm8930_pm8038_gpio_regulator_pdata[
2304 MSM8930_GPIO_VREG_ID_EXT_OTG_SW],
David Collins1d4061b2011-12-06 15:36:40 -08002305 },
2306};
2307
2308#endif
2309
Jay Chokshi06fa7542011-12-07 13:09:17 -08002310static struct platform_device msm8930_device_rpm_regulator __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002311 .name = "rpm-regulator",
2312 .id = -1,
2313 .dev = {
David Collins8af872e2012-01-06 11:31:56 -08002314#ifndef MSM8930_PHASE_2
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002315 .platform_data = &msm_rpm_regulator_pdata,
David Collins8af872e2012-01-06 11:31:56 -08002316#else
David Collins86161e42012-08-20 12:17:09 -07002317 .platform_data = &msm8930_pm8038_rpm_regulator_pdata,
Jay Chokshi06fa7542011-12-07 13:09:17 -08002318#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002319 },
2320};
2321
David Collins86161e42012-08-20 12:17:09 -07002322static struct platform_device *early_common_devices[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002323 &msm8960_device_dmov,
2324 &msm_device_smd,
2325 &msm8960_device_uart_gsbi5,
2326 &msm_device_uart_dm6,
2327 &msm_device_saw_core0,
2328 &msm_device_saw_core1,
David Collins86161e42012-08-20 12:17:09 -07002329};
2330
2331/* ext_5v and ext_otg_sw are present when using PM8038 */
2332static struct platform_device *pmic_pm8038_devices[] __initdata = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002333 &msm8930_device_ext_5v_vreg,
David Collins1d4061b2011-12-06 15:36:40 -08002334#ifndef MSM8930_PHASE_2
Jay Chokshi06fa7542011-12-07 13:09:17 -08002335 &msm8930_device_ext_l2_vreg,
David Collins1d4061b2011-12-06 15:36:40 -08002336#endif
Jay Chokshi33c044a2011-12-07 13:05:40 -08002337 &msm8960_device_ssbi_pmic,
David Collins1d4061b2011-12-06 15:36:40 -08002338#ifdef MSM8930_PHASE_2
2339 &msm8930_device_ext_otg_sw_vreg,
2340#endif
David Collins86161e42012-08-20 12:17:09 -07002341};
2342
2343/* ext_5v and ext_otg_sw are not present when using PM8917 */
2344static struct platform_device *pmic_pm8917_devices[] __initdata = {
2345 &msm8960_device_ssbi_pmic,
2346};
2347
2348static struct platform_device *common_devices[] __initdata = {
Stephen Boyd28d54952011-12-16 13:19:51 -08002349 &msm_8960_q6_lpass,
2350 &msm_8960_q6_mss_fw,
2351 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07002352 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07002353 &msm_pil_tzapps,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002354 &msm_pil_vidc,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002355 &msm8960_device_qup_spi_gsbi1,
2356 &msm8960_device_qup_i2c_gsbi3,
2357 &msm8960_device_qup_i2c_gsbi4,
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002358 &msm8960_device_qup_i2c_gsbi9,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002359 &msm8960_device_qup_i2c_gsbi10,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002360 &msm8960_device_qup_i2c_gsbi12,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002361 &msm_slim_ctrl,
2362 &msm_device_wcnss_wlan,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002363#if defined(CONFIG_QSEECOM)
2364 &qseecom_device,
2365#endif
2366
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002367#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2368 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2369 &qcrypto_device,
2370#endif
2371
2372#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2373 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2374 &qcedev_device,
2375#endif
2376#ifdef CONFIG_MSM_ROTATOR
2377 &msm_rotator_device,
2378#endif
2379 &msm_device_sps,
2380#ifdef CONFIG_MSM_FAKE_BATTERY
2381 &fish_battery_device,
2382#endif
2383#ifdef CONFIG_ANDROID_PMEM
2384#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002385 &msm8930_android_pmem_device,
2386 &msm8930_android_pmem_adsp_device,
2387 &msm8930_android_pmem_audio_device,
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +05302388#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
2389#endif /*CONFIG_ANDROID_PMEM*/
Hanumant Singheea62562012-05-14 11:32:45 -07002390 &msm8930_fmem_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002391 &msm_device_bam_dmux,
2392 &msm_fm_platform_init,
2393
2394#ifdef CONFIG_HW_RANDOM_MSM
2395 &msm_device_rng,
2396#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06002397 &msm8930_rpm_device,
2398 &msm8930_rpm_log_device,
Girish Mahadevan898c56d2012-06-05 16:09:19 -06002399 &msm8930_rpm_rbcpr_device,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002400 &msm8930_rpm_stat_device,
Anji Jonnala2a8bd312012-11-01 13:11:42 +05302401 &msm8930_rpm_master_stat_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002402#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002403 &msm8930_ion_dev,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002404#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002405 &msm_device_tz_log,
Pratik Patel3b0ca882012-06-01 16:54:14 -07002406 &coresight_tpiu_device,
2407 &coresight_etb_device,
2408 &coresight_funnel_device,
2409 &coresight_etm0_device,
2410 &coresight_etm1_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002411 &msm_device_dspcrashd_8960,
2412 &msm8960_device_watchdog,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302413#ifdef MSM8930_PHASE_2
2414 &gpio_keys_8930,
2415#endif
Laura Abbottb93525f2012-04-12 09:57:19 -07002416 &msm8930_rtb_device,
Gagan Maccd5b3272012-02-09 18:13:10 -07002417 &msm_bus_8930_apps_fabric,
2418 &msm_bus_8930_sys_fabric,
2419 &msm_bus_8930_mm_fabric,
2420 &msm_bus_8930_sys_fpb,
2421 &msm_bus_8930_cpss_fpb,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002422 &msm8960_device_cache_erp,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002423 &msm8930_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002424 &msm_tsens_device,
Laura Abbottf3173042012-05-29 15:23:18 -07002425 &msm8930_cache_dump_device,
Anji Jonnalae84292b2012-09-21 13:34:44 +05302426 &msm8930_pc_cntr,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002427};
2428
2429static struct platform_device *cdp_devices[] __initdata = {
2430 &msm8960_device_otg,
2431 &msm8960_device_gadget_peripheral,
2432 &msm_device_hsusb_host,
2433 &android_usb_device,
2434 &msm_pcm,
2435 &msm_pcm_routing,
2436 &msm_cpudai0,
2437 &msm_cpudai1,
2438 &msm_cpudai_hdmi_rx,
2439 &msm_cpudai_bt_rx,
2440 &msm_cpudai_bt_tx,
2441 &msm_cpudai_fm_rx,
2442 &msm_cpudai_fm_tx,
2443 &msm_cpudai_auxpcm_rx,
2444 &msm_cpudai_auxpcm_tx,
2445 &msm_cpu_fe,
2446 &msm_stub_codec,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002447#ifdef CONFIG_MSM_GEMINI
2448 &msm8960_gemini_device,
2449#endif
2450 &msm_voice,
2451 &msm_voip,
2452 &msm_lpa_pcm,
2453 &msm_cpudai_afe_01_rx,
2454 &msm_cpudai_afe_01_tx,
2455 &msm_cpudai_afe_02_rx,
2456 &msm_cpudai_afe_02_tx,
2457 &msm_pcm_afe,
Ajay Dudani79e268c2011-12-28 13:14:44 -08002458 &msm_compr_dsp,
2459 &msm_cpudai_incall_music_rx,
2460 &msm_cpudai_incall_record_rx,
2461 &msm_cpudai_incall_record_tx,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002462 &msm_pcm_hostless,
Asish Bhattacharya705c6732012-08-14 23:22:55 +05302463 &msm_multi_ch_pcm,
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -07002464 &msm_lowlatency_pcm,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002465};
2466
2467static void __init msm8930_i2c_init(void)
2468{
2469 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2470 &msm8960_i2c_qup_gsbi4_pdata;
2471
2472 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2473 &msm8960_i2c_qup_gsbi3_pdata;
2474
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002475 msm8960_device_qup_i2c_gsbi9.dev.platform_data =
2476 &msm8960_i2c_qup_gsbi9_pdata;
2477
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002478 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2479 &msm8960_i2c_qup_gsbi10_pdata;
2480
2481 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2482 &msm8960_i2c_qup_gsbi12_pdata;
2483}
2484
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002485static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
2486 {
2487 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2488 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2489 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002490 1, 784, 180000, 100,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002491 },
2492
2493 {
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302494 MSM_PM_SLEEP_MODE_RETENTION,
2495 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2496 true,
2497 415, 715, 340827, 475,
2498 },
2499
2500 {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002501 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2502 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2503 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002504 1300, 228, 1200000, 2000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002505 },
2506
2507 {
2508 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2509 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2510 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002511 2000, 138, 1208400, 3200,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002512 },
2513
2514 {
2515 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002516 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2517 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002518 6000, 119, 1850300, 9000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002519 },
2520
2521 {
2522 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2523 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2524 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002525 9200, 68, 2839200, 16400,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002526 },
2527
2528 {
2529 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2530 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2531 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002532 10300, 63, 3128000, 18200,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002533 },
2534
2535 {
2536 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2537 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2538 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002539 18000, 10, 4602600, 27000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002540 },
2541
2542 {
2543 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2544 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2545 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002546 20000, 2, 5752000, 32000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002547 },
2548};
2549
Praveen Chidambaram78499012011-11-01 17:15:17 -06002550static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2551 .levels = &msm_rpmrs_levels[0],
2552 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2553 .vdd_mem_levels = {
2554 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2555 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2556 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2557 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2558 },
2559 .vdd_dig_levels = {
Mahesh Sivasubramanian745e16e2012-05-21 11:52:04 -06002560 [MSM_RPMRS_VDD_DIG_RET_LOW] = 0,
2561 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 0,
2562 [MSM_RPMRS_VDD_DIG_ACTIVE] = 1,
2563 [MSM_RPMRS_VDD_DIG_MAX] = 3,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002564 },
2565 .vdd_mask = 0x7FFFFF,
2566 .rpmrs_target_id = {
2567 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2568 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
Mahesh Sivasubramanian745e16e2012-05-21 11:52:04 -06002569 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER,
2570 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002571 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8038_L24_0,
2572 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8038_L24_1,
2573 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2574 },
2575};
2576
Praveen Chidambaramc6e04692012-08-10 16:26:37 -06002577static struct msm_rpmrs_platform_data msm_rpmrs_data_pm8917 __initdata = {
2578 .levels = &msm_rpmrs_levels[0],
2579 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2580 .vdd_mem_levels = {
2581 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2582 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2583 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2584 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2585 },
2586 .vdd_dig_levels = {
2587 [MSM_RPMRS_VDD_DIG_RET_LOW] = 0,
2588 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 0,
2589 [MSM_RPMRS_VDD_DIG_ACTIVE] = 1,
2590 [MSM_RPMRS_VDD_DIG_MAX] = 3,
2591 },
2592 .vdd_mask = 0x7FFFFF,
2593 .rpmrs_target_id = {
2594 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2595 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2596 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER,
2597 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST,
2598 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8917_L24_0,
2599 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8917_L24_1,
2600 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2601 },
2602};
2603
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002604static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2605 .mode = MSM_PM_BOOT_CONFIG_TZ,
2606};
2607
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002608#ifdef CONFIG_I2C
2609#define I2C_SURF 1
2610#define I2C_FFA (1 << 1)
2611#define I2C_RUMI (1 << 2)
2612#define I2C_SIM (1 << 3)
2613#define I2C_FLUID (1 << 4)
2614#define I2C_LIQUID (1 << 5)
Taniya Das087145b2013-03-16 21:37:41 +05302615#define I2C_EVT (1 << 6)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002616
2617struct i2c_registry {
2618 u8 machs;
2619 int bus;
2620 struct i2c_board_info *info;
2621 int len;
2622};
2623
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002624#ifdef CONFIG_INPUT_MPU3050
2625#define MPU3050_INT_GPIO 69
2626
2627static struct mpu3050_gyro_platform_data mpu3050_gyro = {
2628 .gpio_int = MPU3050_INT_GPIO,
2629};
2630
2631static struct i2c_board_info __initdata mpu3050_i2c_boardinfo[] = {
2632 {
2633 I2C_BOARD_INFO("mpu3050", 0x68),
Wentao Xuc7769c02012-08-03 15:06:41 -04002634 .irq = MSM_GPIO_TO_INT(MPU3050_INT_GPIO),
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002635 .platform_data = &mpu3050_gyro,
2636 },
2637};
2638#endif
2639
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002640#ifdef CONFIG_ISL9519_CHARGER
2641static struct isl_platform_data isl_data __initdata = {
2642 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2643 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2644 .max_system_voltage = 4200,
2645 .min_system_voltage = 3200,
2646 .chgcurrent = 1000, /* 1900, */
2647 .term_current = 400, /* Need fine tuning */
2648 .input_current = 2048,
2649};
2650
2651static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2652 {
2653 I2C_BOARD_INFO("isl9519q", 0x9),
2654 .irq = 0, /* Not required when notify-by-pmic */
2655 .platform_data = &isl_data,
2656 },
2657};
2658#endif /* CONFIG_ISL9519_CHARGER */
2659
Wentao Xu114c0152012-06-12 11:40:38 -04002660#ifdef CONFIG_STM_LIS3DH
2661static struct lis3dh_acc_platform_data lis3dh_accel = {
2662 .poll_interval = 200,
2663 .min_interval = 10,
2664 .g_range = LIS3DH_ACC_G_2G,
2665 .axis_map_x = 1,
2666 .axis_map_y = 0,
2667 .axis_map_z = 2,
2668 .negate_x = 0,
2669 .negate_y = 0,
2670 .negate_z = 1,
2671 .init = NULL,
2672 .exit = NULL,
2673 .gpio_int1 = -EINVAL,
2674 .gpio_int2 = -EINVAL,
2675};
2676
2677static struct i2c_board_info __initdata lis3dh_i2c_boardinfo[] = {
2678 {
2679 I2C_BOARD_INFO(LIS3DH_ACC_DEV_NAME, 0x18),
2680 .platform_data = &lis3dh_accel,
2681 },
2682};
2683#endif /* CONFIG_STM_LIS3DH */
2684
Orkhan Karimov4e7999f2013-02-13 17:52:11 -05002685#ifdef CONFIG_BMP18X_I2C
2686static struct i2c_board_info __initdata bmp18x_i2c_boardinfo[] = {
2687 {
2688 I2C_BOARD_INFO("bmp18x", 0x77),
2689 },
2690};
2691#endif
2692
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002693static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002694#ifdef CONFIG_ISL9519_CHARGER
2695 {
2696 I2C_LIQUID,
2697 MSM_8930_GSBI10_QUP_I2C_BUS_ID,
2698 isl_charger_i2c_info,
2699 ARRAY_SIZE(isl_charger_i2c_info),
2700 },
2701#endif /* CONFIG_ISL9519_CHARGER */
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002702#ifdef CONFIG_INPUT_MPU3050
2703 {
2704 I2C_FFA | I2C_FLUID,
2705 MSM_8930_GSBI12_QUP_I2C_BUS_ID,
2706 mpu3050_i2c_boardinfo,
2707 ARRAY_SIZE(mpu3050_i2c_boardinfo),
2708 },
2709#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002710 {
Amy Malochee8de95d2012-02-23 10:40:25 -08002711 I2C_SURF | I2C_FFA | I2C_FLUID,
2712 MSM_8930_GSBI9_QUP_I2C_BUS_ID,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002713 msm_isa1200_board_info,
2714 ARRAY_SIZE(msm_isa1200_board_info),
2715 },
Amy Malochef3c9db42011-12-08 15:17:35 -08002716 {
Amy Maloche8eb91112012-03-30 10:22:37 -07002717 I2C_SURF | I2C_FFA | I2C_FLUID,
Amy Malochef3c9db42011-12-08 15:17:35 -08002718 MSM_8930_GSBI3_QUP_I2C_BUS_ID,
2719 mxt_device_info_8930,
2720 ARRAY_SIZE(mxt_device_info_8930),
2721 },
Manoj Raoc6d904c2012-06-22 00:32:14 -07002722 {
2723 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_FLUID,
2724 MSM_8930_GSBI9_QUP_I2C_BUS_ID,
2725 sii_device_info,
2726 ARRAY_SIZE(sii_device_info),
2727 },
Wentao Xu114c0152012-06-12 11:40:38 -04002728#ifdef CONFIG_STM_LIS3DH
2729 {
2730 I2C_FFA | I2C_FLUID,
2731 MSM_8930_GSBI12_QUP_I2C_BUS_ID,
2732 lis3dh_i2c_boardinfo,
2733 ARRAY_SIZE(lis3dh_i2c_boardinfo),
2734 },
2735#endif
Orkhan Karimov4e7999f2013-02-13 17:52:11 -05002736#ifdef CONFIG_BMP18X_I2C
2737 {
2738 I2C_FFA | I2C_FLUID,
2739 MSM_8930_GSBI12_QUP_I2C_BUS_ID,
2740 bmp18x_i2c_boardinfo,
2741 ARRAY_SIZE(bmp18x_i2c_boardinfo),
2742 },
2743#endif
2744
2745
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002746};
2747#endif /* CONFIG_I2C */
2748
2749static void __init register_i2c_devices(void)
2750{
2751#ifdef CONFIG_I2C
2752 u8 mach_mask = 0;
2753 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002754#ifdef CONFIG_MSM_CAMERA
2755 struct i2c_registry msm8930_camera_i2c_devices = {
2756 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2757 MSM_8930_GSBI4_QUP_I2C_BUS_ID,
2758 msm8930_camera_board_info.board_info,
2759 msm8930_camera_board_info.num_i2c_board_info,
2760 };
2761#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002762
2763 /* Build the matching 'supported_machs' bitmask */
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002764 if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp())
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002765 mach_mask = I2C_SURF;
2766 else if (machine_is_msm8930_fluid())
2767 mach_mask = I2C_FLUID;
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002768 else if (machine_is_msm8930_mtp() || machine_is_msm8627_mtp())
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002769 mach_mask = I2C_FFA;
Taniya Das087145b2013-03-16 21:37:41 +05302770 else if (machine_is_msm8930_evt())
2771 mach_mask = I2C_EVT;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002772 else
2773 pr_err("unmatched machine ID in register_i2c_devices\n");
2774
2775 /* Run the array and install devices as appropriate */
2776 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2777 if (msm8960_i2c_devices[i].machs & mach_mask)
2778 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2779 msm8960_i2c_devices[i].info,
2780 msm8960_i2c_devices[i].len);
2781 }
Kevin Chan09f4e662011-12-16 08:17:02 -08002782#ifdef CONFIG_MSM_CAMERA
2783 if (msm8930_camera_i2c_devices.machs & mach_mask)
2784 i2c_register_board_info(msm8930_camera_i2c_devices.bus,
2785 msm8930_camera_i2c_devices.info,
2786 msm8930_camera_i2c_devices.len);
2787#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002788#endif
2789}
2790
David Collins04499982012-08-06 15:02:03 -07002791/* Modify platform data values to match requirements for PM8917. */
2792static void __init msm8930_pm8917_pdata_fixup(void)
2793{
Patrick Dalya3b73c42012-08-28 13:39:17 -07002794 struct acpuclk_platform_data *pdata;
2795
David Collins04499982012-08-06 15:02:03 -07002796 mhl_platform_data.gpio_mhl_power = MHL_POWER_GPIO_PM8917;
2797
2798 gpio_keys_8930_pdata.buttons = keys_8930_pm8917;
2799 gpio_keys_8930_pdata.nbuttons = ARRAY_SIZE(keys_8930_pm8917);
David Collins86161e42012-08-20 12:17:09 -07002800
2801 msm_device_saw_core0.dev.platform_data
2802 = &msm8930_pm8038_saw_regulator_core0_pdata;
2803 msm_device_saw_core1.dev.platform_data
2804 = &msm8930_pm8038_saw_regulator_core1_pdata;
2805
2806 msm8930_device_rpm_regulator.dev.platform_data
2807 = &msm8930_pm8917_rpm_regulator_pdata;
Patrick Dalya3b73c42012-08-28 13:39:17 -07002808
2809 pdata = msm8930_device_acpuclk.dev.platform_data;
2810 pdata->uses_pm8917 = true;
Tianyi Gou01c27a32012-10-29 19:13:53 -07002811
2812 pdata = msm8930ab_device_acpuclk.dev.platform_data;
2813 pdata->uses_pm8917 = true;
David Collins04499982012-08-06 15:02:03 -07002814}
2815
Anji Jonnala786b39e2013-01-29 13:34:10 +05302816static void __init msm8930ab_update_retention_spm(void)
2817{
2818 int i;
2819
2820 /* Update the SPM sequences for krait retention on all cores */
2821 for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) {
2822 int j;
2823 struct msm_spm_platform_data *pdata = &msm_spm_data[i];
2824 for (j = 0; j < pdata->num_modes; j++) {
2825 if (pdata->modes[j].cmd ==
2826 spm_retention_cmd_sequence)
2827 pdata->modes[j].cmd =
2828 spm_retention_with_krait_v3_cmd_sequence;
2829 }
2830 }
2831}
2832
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002833static void __init msm8930_cdp_init(void)
2834{
David Collins04499982012-08-06 15:02:03 -07002835 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
2836 msm8930_pm8917_pdata_fixup();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002837 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2838 pr_err("meminfo_init() failed!\n");
2839
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07002840 platform_device_register(&msm_gpio_device);
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002841 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002842 msm_thermal_init(&msm_thermal_pdata);
Praveen Chidambaramc6e04692012-08-10 16:26:37 -06002843 if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) {
2844 BUG_ON(msm_rpm_init(&msm8930_rpm_data));
2845 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
2846 } else {
2847 BUG_ON(msm_rpm_init(&msm8930_rpm_data_pm8917));
2848 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data_pm8917));
2849 }
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002850
2851 regulator_suppress_info_printing();
2852 if (msm_xo_init())
2853 pr_err("Failed to initialize XO votes\n");
Jay Chokshi06fa7542011-12-07 13:09:17 -08002854 platform_device_register(&msm8930_device_rpm_regulator);
Patrick Dalyb1d5f752012-08-27 16:25:07 -07002855 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
2856 msm_clock_init(&msm8930_pm8917_clock_init_data);
2857 else
2858 msm_clock_init(&msm8930_clock_init_data);
Mayank Rana2a1c7db2013-01-08 15:10:51 +05302859
2860 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) {
2861 /*
2862 * By default, set USB mode as USB Peripheral only due to
2863 * hardware rework requirement for USB Host Mode.
2864 * Provide pmic_id_irq number only if host mode is enable
2865 * by user assuming that hardware rework is available.
2866 */
2867 if (enable_usb_host_mode) {
2868 /* MPP01 IRQ number */
2869 msm_otg_pdata.pmic_id_irq =
2870 PM8921_MPP_IRQ(PM8917_IRQ_BASE, 1);
2871 } else {
2872 pr_err("Enabling USB Peripheral Only mode.\n");
2873 msm_otg_pdata.mode = USB_PERIPHERAL;
2874 }
2875 } else {
2876 msm_otg_pdata.pmic_id_irq =
2877 PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE);
2878 }
2879
Mayank Rana2fe1aec2012-06-07 18:00:12 +05302880 msm_otg_pdata.phy_init_seq = hsusb_phy_init_seq;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002881 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Mayank Ranac64b6392012-05-21 14:05:23 +05302882 android_usb_pdata.swfi_latency =
2883 msm_rpmrs_levels[0].latency_us;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002884 msm8930_init_gpiomux();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002885 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2886 &msm8960_qup_spi_gsbi1_pdata;
2887 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2888
Jay Chokshi06fa7542011-12-07 13:09:17 -08002889 /*
2890 * TODO: When physical 8930/PM8038 hardware becomes
2891 * available, remove this block or add the config
2892 * option.
2893 */
2894#ifndef MSM8930_PHASE_2
2895 msm8960_init_pmic();
2896#else
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002897 msm8930_init_pmic();
Jay Chokshi06fa7542011-12-07 13:09:17 -08002898#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002899 msm8930_i2c_init();
Sudhakara Rao Tentu8b5c8ed2012-03-05 14:48:41 +05302900 msm8930_init_gpu();
Anji Jonnala786b39e2013-01-29 13:34:10 +05302901 if (cpu_is_krait_v3()) {
2902 msm_pm_set_tz_retention_flag(0);
2903 msm8930ab_update_retention_spm();
2904 } else {
2905 msm_pm_set_tz_retention_flag(1);
2906 }
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002907 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2908 msm_spm_l2_init(msm_spm_l2_data);
2909 msm8930_init_buses();
Aravind Venkateswaranc5f91ca2012-10-29 17:54:55 -07002910 if (cpu_is_msm8627()) {
Tianyi Gou723843b2012-06-13 15:24:56 -07002911 platform_add_devices(msm8627_footswitch,
2912 msm8627_num_footswitch);
Aravind Venkateswaranc5f91ca2012-10-29 17:54:55 -07002913 } else {
2914 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
2915 platform_add_devices(msm8930_pm8917_footswitch,
2916 msm8930_pm8917_num_footswitch);
2917 else
2918 platform_add_devices(msm8930_footswitch,
2919 msm8930_num_footswitch);
2920 }
Matt Wagantall6dcfa922012-06-07 20:13:51 -07002921 if (cpu_is_msm8627())
Matt Wagantallab730bd2012-06-07 20:13:51 -07002922 platform_device_register(&msm8627_device_acpuclk);
Tianyi Gou12370f12012-07-23 19:13:57 -07002923 else if (cpu_is_msm8930())
Matt Wagantall6dcfa922012-06-07 20:13:51 -07002924 platform_device_register(&msm8930_device_acpuclk);
Tianyi Gou12370f12012-07-23 19:13:57 -07002925 else if (cpu_is_msm8930aa())
2926 platform_device_register(&msm8930aa_device_acpuclk);
Tianyi Gou01c27a32012-10-29 19:13:53 -07002927 else if (cpu_is_msm8930ab())
2928 platform_device_register(&msm8930ab_device_acpuclk);
David Collins86161e42012-08-20 12:17:09 -07002929 platform_add_devices(early_common_devices,
2930 ARRAY_SIZE(early_common_devices));
2931 if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917)
2932 platform_add_devices(pmic_pm8038_devices,
2933 ARRAY_SIZE(pmic_pm8038_devices));
2934 else
2935 platform_add_devices(pmic_pm8917_devices,
2936 ARRAY_SIZE(pmic_pm8917_devices));
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002937 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Arun Menonaabf2632012-02-24 15:30:47 -08002938 msm8930_add_vidc_device();
Jay Chokshi06fa7542011-12-07 13:09:17 -08002939 /*
2940 * TODO: When physical 8930/PM8038 hardware becomes
2941 * available, remove this block or add the config
2942 * option.
2943 */
2944#ifndef MSM8930_PHASE_2
2945 msm8960_pm8921_gpio_mpp_init();
2946#else
David Collins04499982012-08-06 15:02:03 -07002947 if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917)
2948 msm8930_pm8038_gpio_mpp_init();
2949 else
2950 msm8930_pm8917_gpio_mpp_init();
Jay Chokshi06fa7542011-12-07 13:09:17 -08002951#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002952 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Steve Mucklef132c6c2012-06-06 18:30:57 -07002953#ifdef CONFIG_MSM_CAMERA
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002954 msm8930_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07002955#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002956 msm8930_init_mmc();
Amy Maloche8eb91112012-03-30 10:22:37 -07002957 mxt_init_vkeys_8930();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002958 register_i2c_devices();
2959 msm8930_init_fb();
2960 slim_register_board_info(msm_slim_devices,
2961 ARRAY_SIZE(msm_slim_devices));
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002962 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002963
Taniya Das087145b2013-03-16 21:37:41 +05302964 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
2965 mdm_sglte_device.dev.platform_data = &sglte_platform_data;
2966 platform_device_register(&mdm_sglte_device);
2967 }
2968
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002969 if (PLATFORM_IS_CHARM25())
2970 platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
2971}
2972
2973MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP")
2974 .map_io = msm8930_map_io,
2975 .reserve = msm8930_reserve,
2976 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302977 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002978 .timer = &msm_timer,
2979 .init_machine = msm8930_cdp_init,
2980 .init_early = msm8930_allocate_memory_regions,
2981 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002982 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002983MACHINE_END
2984
2985MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP")
2986 .map_io = msm8930_map_io,
2987 .reserve = msm8930_reserve,
2988 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302989 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002990 .timer = &msm_timer,
2991 .init_machine = msm8930_cdp_init,
2992 .init_early = msm8930_allocate_memory_regions,
2993 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002994 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002995MACHINE_END
2996
2997MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID")
2998 .map_io = msm8930_map_io,
2999 .reserve = msm8930_reserve,
3000 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303001 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08003002 .timer = &msm_timer,
3003 .init_machine = msm8930_cdp_init,
3004 .init_early = msm8930_allocate_memory_regions,
3005 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003006 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08003007MACHINE_END
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08003008
3009MACHINE_START(MSM8627_CDP, "QCT MSM8627 CDP")
3010 .map_io = msm8930_map_io,
3011 .reserve = msm8930_reserve,
3012 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303013 .handle_irq = gic_handle_irq,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08003014 .timer = &msm_timer,
3015 .init_machine = msm8930_cdp_init,
3016 .init_early = msm8930_allocate_memory_regions,
3017 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003018 .restart = msm_restart,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08003019MACHINE_END
3020
3021MACHINE_START(MSM8627_MTP, "QCT MSM8627 MTP")
3022 .map_io = msm8930_map_io,
3023 .reserve = msm8930_reserve,
3024 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303025 .handle_irq = gic_handle_irq,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08003026 .timer = &msm_timer,
3027 .init_machine = msm8930_cdp_init,
3028 .init_early = msm8930_allocate_memory_regions,
3029 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003030 .restart = msm_restart,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08003031MACHINE_END
Taniya Das799085a2013-03-06 11:39:04 +05303032
3033MACHINE_START(MSM8930_EVT, "QRD8930 SGLTE EVT")
3034 .map_io = msm8930_map_io,
3035 .reserve = msm8930_reserve,
3036 .init_irq = msm8930_init_irq,
3037 .handle_irq = gic_handle_irq,
3038 .timer = &msm_timer,
3039 .init_machine = msm8930_cdp_init,
3040 .init_early = msm8930_allocate_memory_regions,
3041 .init_very_early = msm8930_early_memory,
3042 .restart = msm_restart,
3043MACHINE_END