blob: d5014bd01791c28e2ea0239a5fc276e712e05ae6 [file] [log] [blame]
David Collinsb4558422012-01-05 10:50:49 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. 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
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080032#include <linux/dma-mapping.h>
33#include <linux/platform_data/qcom_crypto_device.h>
34#include <linux/platform_data/qcom_wcnss_device.h>
35#include <linux/leds.h>
36#include <linux/leds-pm8xxx.h>
37#include <linux/i2c/atmel_mxt_ts.h>
38#include <linux/msm_tsens.h>
39#include <linux/ks8851.h>
40#include <linux/i2c/isa1200.h>
Anirudh Ghayaleb3af972011-12-13 17:29:06 +053041#include <linux/gpio_keys.h>
Jack Cheung6ce8f682012-01-17 10:35:42 -080042#include <linux/memory.h>
Hanumant Singheea62562012-05-14 11:32:45 -070043#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060044#include <linux/msm_thermal.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080045
Asish Bhattacharyab86c3472012-02-15 08:31:52 +053046#include <linux/slimbus/slimbus.h>
47#include <linux/mfd/wcd9xxx/core.h>
48#include <linux/mfd/wcd9xxx/pdata.h>
49
Wentao Xu114c0152012-06-12 11:40:38 -040050#ifdef CONFIG_STM_LIS3DH
51#include <linux/input/lis3dh.h>
52#endif
53
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080054#include <asm/mach-types.h>
55#include <asm/mach/arch.h>
56#include <asm/setup.h>
57#include <asm/hardware/gic.h>
58#include <asm/mach/mmc.h>
59
60#include <mach/board.h>
61#include <mach/msm_iomap.h>
62#include <mach/msm_spi.h>
63#ifdef CONFIG_USB_MSM_OTG_72K
64#include <mach/msm_hsusb.h>
65#else
66#include <linux/usb/msm_hsusb.h>
67#endif
68#include <linux/usb/android.h>
69#include <mach/usbdiag.h>
70#include <mach/socinfo.h>
71#include <mach/rpm.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080072#include <mach/gpiomux.h>
73#include <mach/msm_bus_board.h>
74#include <mach/msm_memtypes.h>
75#include <mach/dma.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080076#include <mach/msm_xo.h>
77#include <mach/restart.h>
78
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080079#include <linux/ion.h>
80#include <mach/ion.h>
81#include <mach/mdm2.h>
Laura Abbottf8c03b92012-02-16 14:57:58 -080082#include <mach/msm_rtb.h>
Hanumant Singheea62562012-05-14 11:32:45 -070083#include <linux/fmem.h>
Laura Abbottf3173042012-05-29 15:23:18 -070084#include <mach/msm_cache_dump.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080085
Jordan Crouse914de9b2012-07-09 13:49:46 -060086#include <mach/kgsl.h>
Wentao Xuf59ce4e2012-05-22 17:30:13 -040087#ifdef CONFIG_INPUT_MPU3050
88#include <linux/input/mpu3050.h>
89#endif
90
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080091#include "timer.h"
92#include "devices.h"
93#include "devices-msm8x60.h"
94#include "spm.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080095#include "pm.h"
Abhijeet Dharmapurikarefaca4f2011-12-27 16:24:07 -080096#include <mach/cpuidle.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080097#include "rpm_resources.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053098#include <mach/mpm.h>
Stepan Moskovchenko39236d72011-11-30 17:42:23 -080099#include "smd_private.h"
100#include "pm-boot.h"
101#include "msm_watchdog.h"
Jay Chokshi06fa7542011-12-07 13:09:17 -0800102#include "board-8930.h"
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800103
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800104static struct platform_device msm_fm_platform_init = {
105 .name = "iris_fm",
106 .id = -1,
107};
108
109#define KS8851_RST_GPIO 89
110#define KS8851_IRQ_GPIO 90
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800111#define HAP_SHIFT_LVL_OE_GPIO 47
112
Manoj Raoc6d904c2012-06-22 00:32:14 -0700113#define HDMI_MHL_MUX_GPIO 73
114#define MHL_GPIO_INT 72
115#define MHL_GPIO_RESET 71
116#define MHL_GPIO_PWR_EN 5
117
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800118#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
119
120struct sx150x_platform_data msm8930_sx150x_data[] = {
121 [SX150X_CAM] = {
122 .gpio_base = GPIO_CAM_EXPANDER_BASE,
123 .oscio_is_gpo = false,
124 .io_pullup_ena = 0x0,
125 .io_pulldn_ena = 0xc0,
126 .io_open_drain_ena = 0x0,
127 .irq_summary = -1,
128 },
129};
130
131#endif
132
Olav Haugana21169d2012-01-04 09:17:06 -0800133#define MSM_PMEM_ADSP_SIZE 0x7800000
Asish Bhattacharya9ed880f2012-04-12 08:33:37 +0530134#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800135#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
136#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
137#else
Olav Hauganb88eef12012-01-15 10:59:26 -0800138#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800139#endif
Hanumant Singheea62562012-05-14 11:32:45 -0700140#define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800141
142#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Deepak Kotur9830bf02012-06-01 15:04:29 -0700143#define HOLE_SIZE 0x20000
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700144#define MSM_CONTIG_MEM_SIZE 0x65000
Hanumant Singhedfb0462012-05-15 14:49:32 -0700145#ifdef CONFIG_MSM_IOMMU
146#define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */
147#define MSM_ION_SF_SIZE 0x0
Olav Haugan494e4dc2012-05-15 15:14:31 -0700148#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Hanumant Singhedfb0462012-05-15 14:49:32 -0700149#define MSM_ION_HEAP_NUM 7
150#else
Olav Hauganb88eef12012-01-15 10:59:26 -0800151#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Hauganb88eef12012-01-15 10:59:26 -0800152#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan494e4dc2012-05-15 15:14:31 -0700153#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Hanumant Singheea62562012-05-14 11:32:45 -0700154#define MSM_ION_HEAP_NUM 8
Hanumant Singhedfb0462012-05-15 14:49:32 -0700155#endif
Deepak Kotur9830bf02012-06-01 15:04:29 -0700156#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2MB - 128Kb */
Olav Hauganb5be7992011-11-18 14:29:02 -0800157#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan7355db02012-01-13 16:59:13 -0800158#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Hanumant Singheea62562012-05-14 11:32:45 -0700159
160#define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000)
161#define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE
162#define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE
163
Deepak Kotur9830bf02012-06-01 15:04:29 -0700164#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /*2MB -128Kb */
165#define MSM8930_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
166 HOLE_SIZE))
Hanumant Singheea62562012-05-14 11:32:45 -0700167#define MAX_FIXED_AREA_SIZE 0x10000000
Deepak Kotur9830bf02012-06-01 15:04:29 -0700168#define MSM8930_FW_START MSM8930_FIXED_AREA_START
Hanumant Singheea62562012-05-14 11:32:45 -0700169
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800170#else
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700171#define MSM_CONTIG_MEM_SIZE 0x110C000
Olav Hauganb5be7992011-11-18 14:29:02 -0800172#define MSM_ION_HEAP_NUM 1
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800173#endif
174
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700175#ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION
176static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE;
177static int __init msm_contig_mem_size_setup(char *p)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800178{
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700179 msm_contig_mem_size = memparse(p, NULL);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800180 return 0;
181}
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700182early_param("msm_contig_mem_size", msm_contig_mem_size_setup);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800183#endif
184
185#ifdef CONFIG_ANDROID_PMEM
186static unsigned pmem_size = MSM_PMEM_SIZE;
187static int __init pmem_size_setup(char *p)
188{
189 pmem_size = memparse(p, NULL);
190 return 0;
191}
192early_param("pmem_size", pmem_size_setup);
193
194static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
195
196static int __init pmem_adsp_size_setup(char *p)
197{
198 pmem_adsp_size = memparse(p, NULL);
199 return 0;
200}
201early_param("pmem_adsp_size", pmem_adsp_size_setup);
202
203static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
204
205static int __init pmem_audio_size_setup(char *p)
206{
207 pmem_audio_size = memparse(p, NULL);
208 return 0;
209}
210early_param("pmem_audio_size", pmem_audio_size_setup);
211#endif
212
213#ifdef CONFIG_ANDROID_PMEM
214#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
215static struct android_pmem_platform_data android_pmem_pdata = {
216 .name = "pmem",
217 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
218 .cached = 1,
219 .memory_type = MEMTYPE_EBI1,
220};
221
Laura Abbottb93525f2012-04-12 09:57:19 -0700222static struct platform_device msm8930_android_pmem_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800223 .name = "android_pmem",
224 .id = 0,
225 .dev = {.platform_data = &android_pmem_pdata},
226};
227
228static struct android_pmem_platform_data android_pmem_adsp_pdata = {
229 .name = "pmem_adsp",
230 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
231 .cached = 0,
232 .memory_type = MEMTYPE_EBI1,
233};
Laura Abbottb93525f2012-04-12 09:57:19 -0700234static struct platform_device msm8930_android_pmem_adsp_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800235 .name = "android_pmem",
236 .id = 2,
237 .dev = { .platform_data = &android_pmem_adsp_pdata },
238};
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800239
240static struct android_pmem_platform_data android_pmem_audio_pdata = {
241 .name = "pmem_audio",
242 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
243 .cached = 0,
244 .memory_type = MEMTYPE_EBI1,
245};
246
Laura Abbottb93525f2012-04-12 09:57:19 -0700247static struct platform_device msm8930_android_pmem_audio_device = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800248 .name = "android_pmem",
249 .id = 4,
250 .dev = { .platform_data = &android_pmem_audio_pdata },
251};
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530252#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
253#endif /* CONFIG_ANDROID_PMEM */
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800254
Hanumant Singheea62562012-05-14 11:32:45 -0700255struct fmem_platform_data msm8930_fmem_pdata = {
256};
257
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800258#define DSP_RAM_BASE_8960 0x8da00000
259#define DSP_RAM_SIZE_8960 0x1800000
260static int dspcrashd_pdata_8960 = 0xDEADDEAD;
261
262static struct resource resources_dspcrashd_8960[] = {
263 {
264 .name = "msm_dspcrashd",
265 .start = DSP_RAM_BASE_8960,
266 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
267 .flags = IORESOURCE_DMA,
268 },
269};
270
271static struct platform_device msm_device_dspcrashd_8960 = {
272 .name = "msm_dspcrashd",
273 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
274 .resource = resources_dspcrashd_8960,
275 .dev = { .platform_data = &dspcrashd_pdata_8960 },
276};
277
278static struct memtype_reserve msm8930_reserve_table[] __initdata = {
279 [MEMTYPE_SMI] = {
280 },
281 [MEMTYPE_EBI0] = {
282 .flags = MEMTYPE_FLAGS_1M_ALIGN,
283 },
284 [MEMTYPE_EBI1] = {
285 .flags = MEMTYPE_FLAGS_1M_ALIGN,
286 },
287};
288
Laura Abbottf8c03b92012-02-16 14:57:58 -0800289
290static void __init reserve_rtb_memory(void)
291{
292#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700293 msm8930_reserve_table[MEMTYPE_EBI1].size += msm8930_rtb_pdata.size;
Laura Abbottf8c03b92012-02-16 14:57:58 -0800294#endif
295}
296
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800297static void __init size_pmem_devices(void)
298{
299#ifdef CONFIG_ANDROID_PMEM
300#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
301 android_pmem_adsp_pdata.size = pmem_adsp_size;
302 android_pmem_pdata.size = pmem_size;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800303 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530304#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
305#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800306}
307
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530308#ifdef CONFIG_ANDROID_PMEM
309#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800310static void __init reserve_memory_for(struct android_pmem_platform_data *p)
311{
312 msm8930_reserve_table[p->memory_type].size += p->size;
313}
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530314#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
315#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800316
317static void __init reserve_pmem_memory(void)
318{
319#ifdef CONFIG_ANDROID_PMEM
320#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
321 reserve_memory_for(&android_pmem_adsp_pdata);
322 reserve_memory_for(&android_pmem_pdata);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800323 reserve_memory_for(&android_pmem_audio_pdata);
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530324#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700325 msm8930_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size;
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +0530326#endif /*CONFIG_ANDROID_PMEM*/
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800327}
328
329static int msm8930_paddr_to_memtype(unsigned int paddr)
330{
331 return MEMTYPE_EBI1;
332}
333
Steve Mucklef132c6c2012-06-06 18:30:57 -0700334#define FMEM_ENABLED 0
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800335#ifdef CONFIG_ION_MSM
Olav Haugan0703dbf2011-12-19 17:53:38 -0800336#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700337static struct ion_cp_heap_pdata cp_mm_msm8930_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800338 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugan42ebe712012-01-10 16:30:58 -0800339 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700340 .reusable = FMEM_ENABLED,
341 .mem_is_fmem = FMEM_ENABLED,
342 .fixed_position = FIXED_MIDDLE,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800343};
344
Laura Abbottb93525f2012-04-12 09:57:19 -0700345static struct ion_cp_heap_pdata cp_mfc_msm8930_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800346 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugan42ebe712012-01-10 16:30:58 -0800347 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700348 .reusable = 0,
349 .mem_is_fmem = FMEM_ENABLED,
350 .fixed_position = FIXED_HIGH,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800351};
Hanumant Singheea62562012-05-14 11:32:45 -0700352
Laura Abbottb93525f2012-04-12 09:57:19 -0700353static struct ion_co_heap_pdata co_msm8930_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800354 .adjacent_mem_id = INVALID_HEAP_ID,
355 .align = PAGE_SIZE,
Hanumant Singheea62562012-05-14 11:32:45 -0700356 .mem_is_fmem = 0,
Olav Haugan42ebe712012-01-10 16:30:58 -0800357};
Hanumant Singheea62562012-05-14 11:32:45 -0700358
Laura Abbottb93525f2012-04-12 09:57:19 -0700359static struct ion_co_heap_pdata fw_co_msm8930_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800360 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
361 .align = SZ_128K,
Hanumant Singheea62562012-05-14 11:32:45 -0700362 .mem_is_fmem = FMEM_ENABLED,
363 .fixed_position = FIXED_LOW,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800364};
365#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800366
367/**
368 * These heaps are listed in the order they will be allocated. Due to
369 * video hardware restrictions and content protection the FW heap has to
370 * be allocated adjacent (below) the MM heap and the MFC heap has to be
371 * allocated after the MM heap to ensure MFC heap is not more than 256MB
372 * away from the base address of the FW heap.
373 * However, the order of FW heap and MM heap doesn't matter since these
374 * two heaps are taken care of by separate code to ensure they are adjacent
375 * to each other.
376 * Don't swap the order unless you know what you are doing!
377 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700378static struct ion_platform_data msm8930_ion_pdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800379 .nr = MSM_ION_HEAP_NUM,
380 .heaps = {
381 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800382 .id = ION_SYSTEM_HEAP_ID,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800383 .type = ION_HEAP_TYPE_SYSTEM,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800384 .name = ION_VMALLOC_HEAP_NAME,
385 },
386#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
387 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800388 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800389 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800390 .name = ION_MM_HEAP_NAME,
391 .size = MSM_ION_MM_SIZE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800392 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700393 .extra_data = (void *) &cp_mm_msm8930_ion_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800394 },
Olav Hauganb5be7992011-11-18 14:29:02 -0800395 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800396 .id = ION_MM_FIRMWARE_HEAP_ID,
397 .type = ION_HEAP_TYPE_CARVEOUT,
398 .name = ION_MM_FIRMWARE_HEAP_NAME,
399 .size = MSM_ION_MM_FW_SIZE,
400 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700401 .extra_data = (void *) &fw_co_msm8930_ion_pdata,
Olav Haugan42ebe712012-01-10 16:30:58 -0800402 },
403 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800404 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800405 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800406 .name = ION_MFC_HEAP_NAME,
407 .size = MSM_ION_MFC_SIZE,
408 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700409 .extra_data = (void *) &cp_mfc_msm8930_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800410 },
Hanumant Singhedfb0462012-05-15 14:49:32 -0700411#ifndef CONFIG_MSM_IOMMU
Olav Hauganb5be7992011-11-18 14:29:02 -0800412 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800413 .id = ION_SF_HEAP_ID,
414 .type = ION_HEAP_TYPE_CARVEOUT,
415 .name = ION_SF_HEAP_NAME,
416 .size = MSM_ION_SF_SIZE,
417 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700418 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800419 },
Hanumant Singhedfb0462012-05-15 14:49:32 -0700420#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800421 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800422 .id = ION_IOMMU_HEAP_ID,
423 .type = ION_HEAP_TYPE_IOMMU,
424 .name = ION_IOMMU_HEAP_NAME,
425 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800426 {
427 .id = ION_QSECOM_HEAP_ID,
428 .type = ION_HEAP_TYPE_CARVEOUT,
429 .name = ION_QSECOM_HEAP_NAME,
430 .size = MSM_ION_QSECOM_SIZE,
431 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700432 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan80854eb2012-01-12 12:00:23 -0800433 },
Olav Haugan7355db02012-01-13 16:59:13 -0800434 {
435 .id = ION_AUDIO_HEAP_ID,
436 .type = ION_HEAP_TYPE_CARVEOUT,
437 .name = ION_AUDIO_HEAP_NAME,
438 .size = MSM_ION_AUDIO_SIZE,
439 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700440 .extra_data = (void *) &co_msm8930_ion_pdata,
Olav Haugan7355db02012-01-13 16:59:13 -0800441 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800442#endif
443 }
444};
445
Laura Abbottb93525f2012-04-12 09:57:19 -0700446static struct platform_device msm8930_ion_dev = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800447 .name = "ion-msm",
448 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700449 .dev = { .platform_data = &msm8930_ion_pdata },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800450};
451#endif
452
Hanumant Singheea62562012-05-14 11:32:45 -0700453struct platform_device msm8930_fmem_device = {
454 .name = "fmem",
455 .id = 1,
456 .dev = { .platform_data = &msm8930_fmem_pdata },
457};
458
459static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
460 unsigned long size)
461{
462 msm8930_reserve_table[mem_type].size += size;
463}
464
465static void __init msm8930_reserve_fixed_area(unsigned long fixed_area_size)
466{
467#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
468 int ret;
469
470 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
471 panic("fixed area size is larger than %dM\n",
472 MAX_FIXED_AREA_SIZE >> 20);
473
474 reserve_info->fixed_area_size = fixed_area_size;
475 reserve_info->fixed_area_start = MSM8930_FW_START;
476
477 ret = memblock_remove(reserve_info->fixed_area_start,
478 reserve_info->fixed_area_size);
479 BUG_ON(ret);
480#endif
481}
482
483/**
484 * Reserve memory for ION and calculate amount of reusable memory for fmem.
485 * We only reserve memory for heaps that are not reusable. However, we only
486 * support one reusable heap at the moment so we ignore the reusable flag for
487 * other than the first heap with reusable flag set. Also handle special case
488 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
489 * at a higher address than FW in addition to not more than 256MB away from the
490 * base address of the firmware. This means that if MM is reusable the other
491 * two heaps must be allocated in the same region as FW. This is handled by the
492 * mem_is_fmem flag in the platform data. In addition the MM heap must be
493 * adjacent to the FW heap for content protection purposes.
494 */
Stephen Boyd668d7652012-04-25 11:31:01 -0700495static void __init reserve_ion_memory(void)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800496{
497#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Hanumant Singheea62562012-05-14 11:32:45 -0700498 unsigned int i;
499 unsigned int reusable_count = 0;
500 unsigned int fixed_size = 0;
501 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
502 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
503
504 msm8930_fmem_pdata.size = 0;
505 msm8930_fmem_pdata.reserved_size_low = 0;
506 msm8930_fmem_pdata.reserved_size_high = 0;
Olav Haugan62436252012-05-16 09:09:43 -0700507 msm8930_fmem_pdata.align = PAGE_SIZE;
Hanumant Singheea62562012-05-14 11:32:45 -0700508 fixed_low_size = 0;
509 fixed_middle_size = 0;
510 fixed_high_size = 0;
511
512 /* We only support 1 reusable heap. Check if more than one heap
513 * is specified as reusable and set as non-reusable if found.
514 */
515 for (i = 0; i < msm8930_ion_pdata.nr; ++i) {
516 const struct ion_platform_heap *heap =
517 &(msm8930_ion_pdata.heaps[i]);
518
519 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
520 struct ion_cp_heap_pdata *data = heap->extra_data;
521
522 reusable_count += (data->reusable) ? 1 : 0;
523
524 if (data->reusable && reusable_count > 1) {
525 pr_err("%s: Too many heaps specified as "
526 "reusable. Heap %s was not configured "
527 "as reusable.\n", __func__, heap->name);
528 data->reusable = 0;
529 }
530 }
531 }
532
533 for (i = 0; i < msm8930_ion_pdata.nr; ++i) {
534 const struct ion_platform_heap *heap =
535 &(msm8930_ion_pdata.heaps[i]);
536
537 if (heap->extra_data) {
538 int fixed_position = NOT_FIXED;
539 int mem_is_fmem = 0;
540
541 switch (heap->type) {
542 case ION_HEAP_TYPE_CP:
543 mem_is_fmem = ((struct ion_cp_heap_pdata *)
544 heap->extra_data)->mem_is_fmem;
545 fixed_position = ((struct ion_cp_heap_pdata *)
546 heap->extra_data)->fixed_position;
547 break;
548 case ION_HEAP_TYPE_CARVEOUT:
549 mem_is_fmem = ((struct ion_co_heap_pdata *)
550 heap->extra_data)->mem_is_fmem;
551 fixed_position = ((struct ion_co_heap_pdata *)
552 heap->extra_data)->fixed_position;
553 break;
554 default:
555 break;
556 }
557
558 if (fixed_position != NOT_FIXED)
559 fixed_size += heap->size;
560 else
561 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
562
563 if (fixed_position == FIXED_LOW)
564 fixed_low_size += heap->size;
565 else if (fixed_position == FIXED_MIDDLE)
566 fixed_middle_size += heap->size;
567 else if (fixed_position == FIXED_HIGH)
568 fixed_high_size += heap->size;
569
570 if (mem_is_fmem)
571 msm8930_fmem_pdata.size += heap->size;
572 }
573 }
574
575 if (!fixed_size)
576 return;
577
578 if (msm8930_fmem_pdata.size) {
Deepak Kotur9830bf02012-06-01 15:04:29 -0700579 msm8930_fmem_pdata.reserved_size_low = fixed_low_size +
580 HOLE_SIZE;
Hanumant Singheea62562012-05-14 11:32:45 -0700581 msm8930_fmem_pdata.reserved_size_high = fixed_high_size;
582 }
583
584 /* Since the fixed area may be carved out of lowmem,
585 * make sure the length is a multiple of 1M.
586 */
587 fixed_size = (fixed_size + MSM_MM_FW_SIZE + SECTION_SIZE - 1)
588 & SECTION_MASK;
589 msm8930_reserve_fixed_area(fixed_size);
590
591 fixed_low_start = MSM8930_FIXED_AREA_START;
Deepak Kotur9830bf02012-06-01 15:04:29 -0700592 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Hanumant Singheea62562012-05-14 11:32:45 -0700593 fixed_high_start = fixed_middle_start + fixed_middle_size;
594
595 for (i = 0; i < msm8930_ion_pdata.nr; ++i) {
596 struct ion_platform_heap *heap = &(msm8930_ion_pdata.heaps[i]);
597
598 if (heap->extra_data) {
599 int fixed_position = NOT_FIXED;
Steve Muckle75c34ca2012-06-12 14:27:40 -0700600 struct ion_cp_heap_pdata *pdata = NULL;
Hanumant Singheea62562012-05-14 11:32:45 -0700601
602 switch (heap->type) {
603 case ION_HEAP_TYPE_CP:
Deepak Kotur9830bf02012-06-01 15:04:29 -0700604 pdata =
605 (struct ion_cp_heap_pdata *)heap->extra_data;
606 fixed_position = pdata->fixed_position;
Hanumant Singheea62562012-05-14 11:32:45 -0700607 break;
608 case ION_HEAP_TYPE_CARVEOUT:
609 fixed_position = ((struct ion_co_heap_pdata *)
610 heap->extra_data)->fixed_position;
611 break;
612 default:
613 break;
614 }
615
616 switch (fixed_position) {
617 case FIXED_LOW:
618 heap->base = fixed_low_start;
619 break;
620 case FIXED_MIDDLE:
621 heap->base = fixed_middle_start;
Deepak Kotur9830bf02012-06-01 15:04:29 -0700622 pdata->secure_base = fixed_middle_start
623 - HOLE_SIZE;
624 pdata->secure_size = HOLE_SIZE + heap->size;
Hanumant Singheea62562012-05-14 11:32:45 -0700625 break;
626 case FIXED_HIGH:
627 heap->base = fixed_high_start;
628 break;
629 default:
630 break;
631 }
632 }
633 }
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800634#endif
635}
Huaibin Yanga5419422011-12-08 23:52:10 -0800636
637static void __init reserve_mdp_memory(void)
638{
639 msm8930_mdp_writeback(msm8930_reserve_table);
640}
641
Laura Abbottf3173042012-05-29 15:23:18 -0700642#ifdef CONFIG_MSM_CACHE_DUMP
643static void __init reserve_cache_dump_memory(void)
644{
645 unsigned int total;
646
647 total = msm8930_cache_dump_pdata.l1_size +
648 msm8930_cache_dump_pdata.l2_size;
649 msm8930_reserve_table[MEMTYPE_EBI1].size += total;
650}
651#else
652static void __init reserve_cache_dump_memory(void) { }
653#endif
654
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800655static void __init msm8930_calculate_reserve_sizes(void)
656{
657 size_pmem_devices();
658 reserve_pmem_memory();
659 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800660 reserve_mdp_memory();
Laura Abbottf8c03b92012-02-16 14:57:58 -0800661 reserve_rtb_memory();
Laura Abbottf3173042012-05-29 15:23:18 -0700662 reserve_cache_dump_memory();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800663}
664
665static struct reserve_info msm8930_reserve_info __initdata = {
666 .memtype_reserve_table = msm8930_reserve_table,
667 .calculate_reserve_sizes = msm8930_calculate_reserve_sizes,
Hanumant Singheea62562012-05-14 11:32:45 -0700668 .reserve_fixed_area = msm8930_reserve_fixed_area,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800669 .paddr_to_memtype = msm8930_paddr_to_memtype,
670};
671
672static int msm8930_memory_bank_size(void)
673{
674 return 1<<29;
675}
676
677static void __init locate_unstable_memory(void)
678{
679 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
680 unsigned long bank_size;
681 unsigned long low, high;
682
683 bank_size = msm8930_memory_bank_size();
684 low = meminfo.bank[0].start;
685 high = mb->start + mb->size;
686
687 /* Check if 32 bit overflow occured */
688 if (high < mb->start)
Hanumant Singheea62562012-05-14 11:32:45 -0700689 high -= PAGE_SIZE;
690
691 if (high < MAX_FIXED_AREA_SIZE + MSM8930_FIXED_AREA_START)
692 panic("fixed area extends beyond end of memory\n");
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800693
694 low &= ~(bank_size - 1);
695
696 if (high - low <= bank_size)
Hanumant Singheea62562012-05-14 11:32:45 -0700697 goto no_dmm;
Larry Basselb8d61022012-02-24 10:49:45 -0800698
699 msm8930_reserve_info.bank_size = bank_size;
700#ifdef CONFIG_ENABLE_DMM
Jack Cheung6ce8f682012-01-17 10:35:42 -0800701 msm8930_reserve_info.low_unstable_address = mb->start -
702 MIN_MEMORY_BLOCK_SIZE + mb->size;
703 msm8930_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800704 pr_info("low unstable address %lx max size %lx bank size %lx\n",
705 msm8930_reserve_info.low_unstable_address,
706 msm8930_reserve_info.max_unstable_size,
707 msm8930_reserve_info.bank_size);
Hanumant Singheea62562012-05-14 11:32:45 -0700708 return;
Larry Basselb8d61022012-02-24 10:49:45 -0800709#endif
Hanumant Singheea62562012-05-14 11:32:45 -0700710no_dmm:
711 msm8930_reserve_info.low_unstable_address = high;
712 msm8930_reserve_info.max_unstable_size = 0;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800713}
714
715static void __init place_movable_zone(void)
716{
Larry Basselb8d61022012-02-24 10:49:45 -0800717#ifdef CONFIG_ENABLE_DMM
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800718 movable_reserved_start = msm8930_reserve_info.low_unstable_address;
719 movable_reserved_size = msm8930_reserve_info.max_unstable_size;
720 pr_info("movable zone start %lx size %lx\n",
721 movable_reserved_start, movable_reserved_size);
Larry Basselb8d61022012-02-24 10:49:45 -0800722#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800723}
724
725static void __init msm8930_early_memory(void)
726{
727 reserve_info = &msm8930_reserve_info;
728 locate_unstable_memory();
729 place_movable_zone();
730}
731
732static void __init msm8930_reserve(void)
733{
734 msm_reserve();
Hanumant Singheea62562012-05-14 11:32:45 -0700735 if (msm8930_fmem_pdata.size) {
736#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
737 if (reserve_info->fixed_area_size) {
738 msm8930_fmem_pdata.phys =
739 reserve_info->fixed_area_start + MSM_MM_FW_SIZE;
740 pr_info("mm fw at %lx (fixed) size %x\n",
741 reserve_info->fixed_area_start, MSM_MM_FW_SIZE);
742 pr_info("fmem start %lx (fixed) size %lx\n",
743 msm8930_fmem_pdata.phys, msm8930_fmem_pdata.size);
744 }
745#endif
746 }
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800747}
748
749static int msm8930_change_memory_power(u64 start, u64 size,
750 int change_type)
751{
752 return soc_change_memory_power(start, size, change_type);
753}
754
755static void __init msm8930_allocate_memory_regions(void)
756{
757 msm8930_allocate_fb_region();
758}
759
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530760#ifdef CONFIG_WCD9304_CODEC
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800761
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530762#define SITAR_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800763
764/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
765 * 4 micbiases are used to power various analog and digital
766 * microphones operating at 1800 mV. Technically, all micbiases
767 * can source from single cfilter since all microphones operate
768 * at the same voltage level. The arrangement below is to make
769 * sure all cfilters are exercised. LDO_H regulator ouput level
770 * does not need to be as high as 2.85V. It is choosen for
771 * microphone sensitivity purpose.
772 */
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530773static struct wcd9xxx_pdata sitar_platform_data = {
774 .slimbus_slave_device = {
775 .name = "sitar-slave",
776 .e_addr = {0, 0, 0x00, 0, 0x17, 2},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800777 },
778 .irq = MSM_GPIO_TO_INT(62),
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530779 .irq_base = SITAR_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530780 .num_irqs = NR_WCD9XXX_IRQS,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530781 .reset_gpio = 42,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800782 .micbias = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530783 .ldoh_v = SITAR_LDOH_2P85_V,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800784 .cfilt1_mv = 1800,
785 .cfilt2_mv = 1800,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530786 .bias1_cfilt_sel = SITAR_CFILT1_SEL,
787 .bias2_cfilt_sel = SITAR_CFILT2_SEL,
Bhalchandra Gajare15dbeaa2012-06-26 12:53:07 -0700788 .bias1_cap_mode = MICBIAS_EXT_BYP_CAP,
789 .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530790 },
791 .regulator = {
792 {
793 .name = "CDC_VDD_CP",
David Collins226f2512012-03-19 13:18:39 -0700794 .min_uV = 1950000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530795 .max_uV = 2200000,
796 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
797 },
798 {
799 .name = "CDC_VDDA_RX",
800 .min_uV = 1800000,
801 .max_uV = 1800000,
802 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
803 },
804 {
805 .name = "CDC_VDDA_TX",
806 .min_uV = 1800000,
807 .max_uV = 1800000,
808 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
809 },
810 {
811 .name = "VDDIO_CDC",
812 .min_uV = 1800000,
813 .max_uV = 1800000,
814 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
815 },
816 {
817 .name = "VDDD_CDC_D",
818 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700819 .max_uV = 1250000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530820 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
821 },
822 {
823 .name = "CDC_VDDA_A_1P2V",
824 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700825 .max_uV = 1250000,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530826 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
827 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800828 },
829};
830
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530831static struct slim_device msm_slim_sitar = {
832 .name = "sitar-slim",
833 .e_addr = {0, 1, 0x00, 0, 0x17, 2},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800834 .dev = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530835 .platform_data = &sitar_platform_data,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800836 },
837};
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700838
839static struct wcd9xxx_pdata sitar1p1_platform_data = {
840 .slimbus_slave_device = {
841 .name = "sitar-slave",
842 .e_addr = {0, 0, 0x70, 0, 0x17, 2},
843 },
844 .irq = MSM_GPIO_TO_INT(62),
845 .irq_base = SITAR_INTERRUPT_BASE,
846 .num_irqs = NR_WCD9XXX_IRQS,
847 .reset_gpio = 42,
848 .micbias = {
849 .ldoh_v = SITAR_LDOH_2P85_V,
850 .cfilt1_mv = 1800,
851 .cfilt2_mv = 1800,
852 .bias1_cfilt_sel = SITAR_CFILT1_SEL,
853 .bias2_cfilt_sel = SITAR_CFILT2_SEL,
Bhalchandra Gajare15dbeaa2012-06-26 12:53:07 -0700854 .bias1_cap_mode = MICBIAS_EXT_BYP_CAP,
855 .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700856 },
857 .regulator = {
858 {
859 .name = "CDC_VDD_CP",
860 .min_uV = 1950000,
861 .max_uV = 2200000,
862 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
863 },
864 {
865 .name = "CDC_VDDA_RX",
866 .min_uV = 1800000,
867 .max_uV = 1800000,
868 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
869 },
870 {
871 .name = "CDC_VDDA_TX",
872 .min_uV = 1800000,
873 .max_uV = 1800000,
874 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
875 },
876 {
877 .name = "VDDIO_CDC",
878 .min_uV = 1800000,
879 .max_uV = 1800000,
880 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
881 },
882 {
883 .name = "VDDD_CDC_D",
884 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700885 .max_uV = 1250000,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700886 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
887 },
888 {
889 .name = "CDC_VDDA_A_1P2V",
890 .min_uV = 1200000,
David Collins19e78812012-06-04 15:50:09 -0700891 .max_uV = 1250000,
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700892 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
893 },
894 },
895};
896
897static struct slim_device msm_slim_sitar1p1 = {
898 .name = "sitar1p1-slim",
899 .e_addr = {0, 1, 0x70, 0, 0x17, 2},
900 .dev = {
901 .platform_data = &sitar1p1_platform_data,
902 },
903};
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800904#endif
905
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530906
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800907static struct slim_boardinfo msm_slim_devices[] = {
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530908#ifdef CONFIG_WCD9304_CODEC
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800909 {
910 .bus_num = 1,
Asish Bhattacharyab86c3472012-02-15 08:31:52 +0530911 .slim_slave = &msm_slim_sitar,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800912 },
Bhalchandra Gajare83c81f62012-05-18 16:09:05 -0700913 {
914 .bus_num = 1,
915 .slim_slave = &msm_slim_sitar1p1,
916 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -0800917#endif
918 /* add more slimbus slaves as needed */
919};
920
921#define MSM_WCNSS_PHYS 0x03000000
922#define MSM_WCNSS_SIZE 0x280000
923
924static struct resource resources_wcnss_wlan[] = {
925 {
926 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
927 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
928 .name = "wcnss_wlanrx_irq",
929 .flags = IORESOURCE_IRQ,
930 },
931 {
932 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
933 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
934 .name = "wcnss_wlantx_irq",
935 .flags = IORESOURCE_IRQ,
936 },
937 {
938 .start = MSM_WCNSS_PHYS,
939 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
940 .name = "wcnss_mmio",
941 .flags = IORESOURCE_MEM,
942 },
943 {
944 .start = 84,
945 .end = 88,
946 .name = "wcnss_gpios_5wire",
947 .flags = IORESOURCE_IO,
948 },
949};
950
951static struct qcom_wcnss_opts qcom_wcnss_pdata = {
952 .has_48mhz_xo = 1,
953};
954
955static struct platform_device msm_device_wcnss_wlan = {
956 .name = "wcnss_wlan",
957 .id = 0,
958 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
959 .resource = resources_wcnss_wlan,
960 .dev = {.platform_data = &qcom_wcnss_pdata},
961};
962
Ramesh Masavarapua26cce72012-04-09 12:32:25 -0700963#ifdef CONFIG_QSEECOM
964/* qseecom bus scaling */
965static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
966 {
967 .src = MSM_BUS_MASTER_SPS,
968 .dst = MSM_BUS_SLAVE_EBI_CH0,
969 .ib = 0,
970 .ab = 0,
971 },
972 {
973 .src = MSM_BUS_MASTER_SPDM,
974 .dst = MSM_BUS_SLAVE_SPDM,
975 .ib = 0,
976 .ab = 0,
977 },
978};
979
980static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
981 {
982 .src = MSM_BUS_MASTER_SPS,
983 .dst = MSM_BUS_SLAVE_EBI_CH0,
984 .ib = (492 * 8) * 1000000UL,
985 .ab = (492 * 8) * 100000UL,
986 },
987 {
988 .src = MSM_BUS_MASTER_SPDM,
989 .dst = MSM_BUS_SLAVE_SPDM,
990 .ib = 0,
991 .ab = 0,
992 },
993};
994
995static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
996 {
997 .src = MSM_BUS_MASTER_SPS,
998 .dst = MSM_BUS_SLAVE_EBI_CH0,
999 .ib = 0,
1000 .ab = 0,
1001 },
1002 {
1003 .src = MSM_BUS_MASTER_SPDM,
1004 .dst = MSM_BUS_SLAVE_SPDM,
1005 .ib = (64 * 8) * 1000000UL,
1006 .ab = (64 * 8) * 100000UL,
1007 },
1008};
1009
1010static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1011 {
1012 ARRAY_SIZE(qseecom_clks_init_vectors),
1013 qseecom_clks_init_vectors,
1014 },
1015 {
1016 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1017 qseecom_enable_sfpb_vectors,
1018 },
1019 {
1020 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1021 qseecom_enable_sfpb_vectors,
1022 },
1023};
1024
1025static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1026 qseecom_hw_bus_scale_usecases,
1027 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1028 .name = "qsee",
1029};
1030
1031static struct platform_device qseecom_device = {
1032 .name = "qseecom",
1033 .id = 0,
1034 .dev = {
1035 .platform_data = &qseecom_bus_pdata,
1036 },
1037};
1038#endif
1039
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001040#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1041 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1042 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1043 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1044
1045#define QCE_SIZE 0x10000
1046#define QCE_0_BASE 0x18500000
1047
1048#define QCE_HW_KEY_SUPPORT 0
1049#define QCE_SHA_HMAC_SUPPORT 1
1050#define QCE_SHARE_CE_RESOURCE 1
1051#define QCE_CE_SHARED 0
1052
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001053/* Begin Bus scaling definitions */
1054static struct msm_bus_vectors crypto_hw_init_vectors[] = {
1055 {
1056 .src = MSM_BUS_MASTER_ADM_PORT0,
1057 .dst = MSM_BUS_SLAVE_EBI_CH0,
1058 .ab = 0,
1059 .ib = 0,
1060 },
1061 {
1062 .src = MSM_BUS_MASTER_ADM_PORT1,
1063 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1064 .ab = 0,
1065 .ib = 0,
1066 },
1067};
1068
1069static struct msm_bus_vectors crypto_hw_active_vectors[] = {
1070 {
1071 .src = MSM_BUS_MASTER_ADM_PORT0,
1072 .dst = MSM_BUS_SLAVE_EBI_CH0,
1073 .ab = 70000000UL,
1074 .ib = 70000000UL,
1075 },
1076 {
1077 .src = MSM_BUS_MASTER_ADM_PORT1,
1078 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1079 .ab = 2480000000UL,
1080 .ib = 2480000000UL,
1081 },
1082};
1083
1084static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
1085 {
1086 ARRAY_SIZE(crypto_hw_init_vectors),
1087 crypto_hw_init_vectors,
1088 },
1089 {
1090 ARRAY_SIZE(crypto_hw_active_vectors),
1091 crypto_hw_active_vectors,
1092 },
1093};
1094
1095static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
1096 crypto_hw_bus_scale_usecases,
1097 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
1098 .name = "cryptohw",
1099};
1100/* End Bus Scaling Definitions*/
1101
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001102static struct resource qcrypto_resources[] = {
1103 [0] = {
1104 .start = QCE_0_BASE,
1105 .end = QCE_0_BASE + QCE_SIZE - 1,
1106 .flags = IORESOURCE_MEM,
1107 },
1108 [1] = {
1109 .name = "crypto_channels",
1110 .start = DMOV_CE_IN_CHAN,
1111 .end = DMOV_CE_OUT_CHAN,
1112 .flags = IORESOURCE_DMA,
1113 },
1114 [2] = {
1115 .name = "crypto_crci_in",
1116 .start = DMOV_CE_IN_CRCI,
1117 .end = DMOV_CE_IN_CRCI,
1118 .flags = IORESOURCE_DMA,
1119 },
1120 [3] = {
1121 .name = "crypto_crci_out",
1122 .start = DMOV_CE_OUT_CRCI,
1123 .end = DMOV_CE_OUT_CRCI,
1124 .flags = IORESOURCE_DMA,
1125 },
1126};
1127
1128static struct resource qcedev_resources[] = {
1129 [0] = {
1130 .start = QCE_0_BASE,
1131 .end = QCE_0_BASE + QCE_SIZE - 1,
1132 .flags = IORESOURCE_MEM,
1133 },
1134 [1] = {
1135 .name = "crypto_channels",
1136 .start = DMOV_CE_IN_CHAN,
1137 .end = DMOV_CE_OUT_CHAN,
1138 .flags = IORESOURCE_DMA,
1139 },
1140 [2] = {
1141 .name = "crypto_crci_in",
1142 .start = DMOV_CE_IN_CRCI,
1143 .end = DMOV_CE_IN_CRCI,
1144 .flags = IORESOURCE_DMA,
1145 },
1146 [3] = {
1147 .name = "crypto_crci_out",
1148 .start = DMOV_CE_OUT_CRCI,
1149 .end = DMOV_CE_OUT_CRCI,
1150 .flags = IORESOURCE_DMA,
1151 },
1152};
1153
1154#endif
1155
1156#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1157 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1158
1159static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1160 .ce_shared = QCE_CE_SHARED,
1161 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1162 .hw_key_support = QCE_HW_KEY_SUPPORT,
1163 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001164 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001165};
1166
1167static struct platform_device qcrypto_device = {
1168 .name = "qcrypto",
1169 .id = 0,
1170 .num_resources = ARRAY_SIZE(qcrypto_resources),
1171 .resource = qcrypto_resources,
1172 .dev = {
1173 .coherent_dma_mask = DMA_BIT_MASK(32),
1174 .platform_data = &qcrypto_ce_hw_suppport,
1175 },
1176};
1177#endif
1178
1179#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1180 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1181
1182static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1183 .ce_shared = QCE_CE_SHARED,
1184 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1185 .hw_key_support = QCE_HW_KEY_SUPPORT,
1186 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu992faf62012-06-15 20:21:39 -07001187 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001188};
1189
1190static struct platform_device qcedev_device = {
1191 .name = "qce",
1192 .id = 0,
1193 .num_resources = ARRAY_SIZE(qcedev_resources),
1194 .resource = qcedev_resources,
1195 .dev = {
1196 .coherent_dma_mask = DMA_BIT_MASK(32),
1197 .platform_data = &qcedev_ce_hw_suppport,
1198 },
1199};
1200#endif
1201
1202#define MDM2AP_ERRFATAL 70
1203#define AP2MDM_ERRFATAL 95
1204#define MDM2AP_STATUS 69
1205#define AP2MDM_STATUS 94
1206#define AP2MDM_PMIC_RESET_N 80
1207#define AP2MDM_KPDPWR_N 81
1208
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001209static struct resource mdm_resources[] = {
1210 {
1211 .start = MDM2AP_ERRFATAL,
1212 .end = MDM2AP_ERRFATAL,
1213 .name = "MDM2AP_ERRFATAL",
1214 .flags = IORESOURCE_IO,
1215 },
1216 {
1217 .start = AP2MDM_ERRFATAL,
1218 .end = AP2MDM_ERRFATAL,
1219 .name = "AP2MDM_ERRFATAL",
1220 .flags = IORESOURCE_IO,
1221 },
1222 {
1223 .start = MDM2AP_STATUS,
1224 .end = MDM2AP_STATUS,
1225 .name = "MDM2AP_STATUS",
1226 .flags = IORESOURCE_IO,
1227 },
1228 {
1229 .start = AP2MDM_STATUS,
1230 .end = AP2MDM_STATUS,
1231 .name = "AP2MDM_STATUS",
1232 .flags = IORESOURCE_IO,
1233 },
1234 {
1235 .start = AP2MDM_PMIC_RESET_N,
1236 .end = AP2MDM_PMIC_RESET_N,
1237 .name = "AP2MDM_PMIC_RESET_N",
1238 .flags = IORESOURCE_IO,
1239 },
1240 {
1241 .start = AP2MDM_KPDPWR_N,
1242 .end = AP2MDM_KPDPWR_N,
1243 .name = "AP2MDM_KPDPWR_N",
1244 .flags = IORESOURCE_IO,
1245 },
1246};
1247
1248static struct mdm_platform_data mdm_platform_data = {
1249 .mdm_version = "2.5",
1250};
1251
1252static struct platform_device mdm_device = {
1253 .name = "mdm2_modem",
1254 .id = -1,
1255 .num_resources = ARRAY_SIZE(mdm_resources),
1256 .resource = mdm_resources,
1257 .dev = {
1258 .platform_data = &mdm_platform_data,
1259 },
1260};
1261
1262static struct platform_device *mdm_devices[] __initdata = {
1263 &mdm_device,
1264};
1265
Praveen Chidambaram78499012011-11-01 17:15:17 -06001266#ifdef CONFIG_MSM_MPM
1267static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = {
1268 [1] = MSM_GPIO_TO_INT(46),
1269 [2] = MSM_GPIO_TO_INT(150),
1270 [4] = MSM_GPIO_TO_INT(103),
1271 [5] = MSM_GPIO_TO_INT(104),
1272 [6] = MSM_GPIO_TO_INT(105),
1273 [7] = MSM_GPIO_TO_INT(106),
1274 [8] = MSM_GPIO_TO_INT(107),
1275 [9] = MSM_GPIO_TO_INT(7),
1276 [10] = MSM_GPIO_TO_INT(11),
1277 [11] = MSM_GPIO_TO_INT(15),
1278 [12] = MSM_GPIO_TO_INT(19),
1279 [13] = MSM_GPIO_TO_INT(23),
1280 [14] = MSM_GPIO_TO_INT(27),
1281 [15] = MSM_GPIO_TO_INT(31),
1282 [16] = MSM_GPIO_TO_INT(35),
1283 [19] = MSM_GPIO_TO_INT(90),
1284 [20] = MSM_GPIO_TO_INT(92),
1285 [23] = MSM_GPIO_TO_INT(85),
1286 [24] = MSM_GPIO_TO_INT(83),
1287 [25] = USB1_HS_IRQ,
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001288 [26] = MSM_GPIO_TO_INT(6),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001289 [27] = HDMI_IRQ,
1290 [29] = MSM_GPIO_TO_INT(10),
1291 [30] = MSM_GPIO_TO_INT(102),
1292 [31] = MSM_GPIO_TO_INT(81),
1293 [32] = MSM_GPIO_TO_INT(78),
1294 [33] = MSM_GPIO_TO_INT(94),
1295 [34] = MSM_GPIO_TO_INT(72),
1296 [35] = MSM_GPIO_TO_INT(39),
1297 [36] = MSM_GPIO_TO_INT(43),
1298 [37] = MSM_GPIO_TO_INT(61),
1299 [38] = MSM_GPIO_TO_INT(50),
1300 [39] = MSM_GPIO_TO_INT(42),
1301 [41] = MSM_GPIO_TO_INT(62),
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001302 [42] = MSM_GPIO_TO_INT(8),
1303 [43] = MSM_GPIO_TO_INT(33),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001304 [44] = MSM_GPIO_TO_INT(70),
1305 [45] = MSM_GPIO_TO_INT(69),
1306 [46] = MSM_GPIO_TO_INT(67),
1307 [47] = MSM_GPIO_TO_INT(65),
Mahesh Sivasubramanian47e38a82012-03-06 09:35:26 -07001308 [48] = MSM_GPIO_TO_INT(55),
1309 [49] = MSM_GPIO_TO_INT(74),
1310 [50] = MSM_GPIO_TO_INT(98),
Praveen Chidambaram78499012011-11-01 17:15:17 -06001311 [51] = MSM_GPIO_TO_INT(49),
1312 [52] = MSM_GPIO_TO_INT(40),
1313 [53] = MSM_GPIO_TO_INT(37),
1314 [54] = MSM_GPIO_TO_INT(24),
1315 [55] = MSM_GPIO_TO_INT(14),
1316};
1317
1318static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = {
1319 TLMM_MSM_SUMMARY_IRQ,
1320 RPM_APCC_CPU0_GP_HIGH_IRQ,
1321 RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1322 RPM_APCC_CPU0_GP_LOW_IRQ,
1323 RPM_APCC_CPU0_WAKE_UP_IRQ,
1324 RPM_APCC_CPU1_GP_HIGH_IRQ,
1325 RPM_APCC_CPU1_GP_MEDIUM_IRQ,
1326 RPM_APCC_CPU1_GP_LOW_IRQ,
1327 RPM_APCC_CPU1_WAKE_UP_IRQ,
1328 MSS_TO_APPS_IRQ_0,
1329 MSS_TO_APPS_IRQ_1,
1330 MSS_TO_APPS_IRQ_2,
1331 MSS_TO_APPS_IRQ_3,
1332 MSS_TO_APPS_IRQ_4,
1333 MSS_TO_APPS_IRQ_5,
1334 MSS_TO_APPS_IRQ_6,
1335 MSS_TO_APPS_IRQ_7,
1336 MSS_TO_APPS_IRQ_8,
1337 MSS_TO_APPS_IRQ_9,
1338 LPASS_SCSS_GP_LOW_IRQ,
1339 LPASS_SCSS_GP_MEDIUM_IRQ,
1340 LPASS_SCSS_GP_HIGH_IRQ,
1341 SPS_MTI_30,
1342 SPS_MTI_31,
1343 RIVA_APSS_SPARE_IRQ,
1344 RIVA_APPS_WLAN_SMSM_IRQ,
1345 RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1346 RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1347};
1348
1349struct msm_mpm_device_data msm8930_mpm_dev_data __initdata = {
1350 .irqs_m2a = msm_mpm_irqs_m2a,
1351 .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a),
1352 .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs,
1353 .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs),
1354 .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8,
1355 .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8,
1356 .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008,
1357 .mpm_apps_ipc_val = BIT(1),
1358 .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ,
1359
1360};
1361#endif
1362
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001363#define MSM_SHARED_RAM_PHYS 0x80000000
1364
1365static void __init msm8930_map_io(void)
1366{
1367 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
1368 msm_map_msm8930_io();
1369
1370 if (socinfo_init() < 0)
1371 pr_err("socinfo_init() failed!\n");
1372}
1373
1374static void __init msm8930_init_irq(void)
1375{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001376 struct msm_mpm_device_data *data = NULL;
1377#ifdef CONFIG_MSM_MPM
1378 data = &msm8930_mpm_dev_data;
1379#endif
1380
1381 msm_mpm_irq_extn_init(data);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001382 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1383 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001384}
1385
1386static void __init msm8930_init_buses(void)
1387{
1388#ifdef CONFIG_MSM_BUS_SCALING
1389 msm_bus_rpm_set_mt_mask();
Gagan Maccd5b3272012-02-09 18:13:10 -07001390 msm_bus_8930_apps_fabric_pdata.rpm_enabled = 1;
1391 msm_bus_8930_sys_fabric_pdata.rpm_enabled = 1;
1392 msm_bus_8930_mm_fabric_pdata.rpm_enabled = 1;
1393 msm_bus_8930_apps_fabric.dev.platform_data =
1394 &msm_bus_8930_apps_fabric_pdata;
1395 msm_bus_8930_sys_fabric.dev.platform_data =
1396 &msm_bus_8930_sys_fabric_pdata;
1397 msm_bus_8930_mm_fabric.dev.platform_data =
1398 &msm_bus_8930_mm_fabric_pdata;
1399 msm_bus_8930_sys_fpb.dev.platform_data = &msm_bus_8930_sys_fpb_pdata;
1400 msm_bus_8930_cpss_fpb.dev.platform_data = &msm_bus_8930_cpss_fpb_pdata;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001401#endif
1402}
1403
1404static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1405 .max_clock_speed = 15060000,
1406};
1407
1408#ifdef CONFIG_USB_MSM_OTG_72K
1409static struct msm_otg_platform_data msm_otg_pdata;
1410#else
Manu Gautam32ab9462012-02-20 12:33:01 +05301411#ifdef CONFIG_MSM_BUS_SCALING
1412/* Bandwidth requests (zero) if no vote placed */
1413static struct msm_bus_vectors usb_init_vectors[] = {
1414 {
1415 .src = MSM_BUS_MASTER_SPS,
1416 .dst = MSM_BUS_SLAVE_EBI_CH0,
1417 .ab = 0,
1418 .ib = 0,
1419 },
1420};
1421
1422/* Bus bandwidth requests in Bytes/sec */
1423static struct msm_bus_vectors usb_max_vectors[] = {
1424 {
1425 .src = MSM_BUS_MASTER_SPS,
1426 .dst = MSM_BUS_SLAVE_EBI_CH0,
1427 .ab = 60000000, /* At least 480Mbps on bus. */
1428 .ib = 960000000, /* MAX bursts rate */
1429 },
1430};
1431
1432static struct msm_bus_paths usb_bus_scale_usecases[] = {
1433 {
1434 ARRAY_SIZE(usb_init_vectors),
1435 usb_init_vectors,
1436 },
1437 {
1438 ARRAY_SIZE(usb_max_vectors),
1439 usb_max_vectors,
1440 },
1441};
1442
1443static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
1444 usb_bus_scale_usecases,
1445 ARRAY_SIZE(usb_bus_scale_usecases),
1446 .name = "usb",
1447};
1448#endif
1449
Mayank Rana2fe1aec2012-06-07 18:00:12 +05301450static int hsusb_phy_init_seq[] = {
1451 0x44, 0x80, /* set VBUS valid threshold
1452 and disconnect valid threshold */
1453 0x38, 0x81, /* update DC voltage level */
1454 0x24, 0x82, /* set preemphasis and rise/fall time */
1455 0x13, 0x83, /* set source impedance adjusment */
1456 -1};
1457
Jack Pham87f202f2012-08-06 00:24:22 -07001458#define MSM_MPM_PIN_USB1_OTGSESSVLD 40
1459
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001460static struct msm_otg_platform_data msm_otg_pdata = {
1461 .mode = USB_OTG,
1462 .otg_control = OTG_PMIC_CONTROL,
1463 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Jay Chokshi06fa7542011-12-07 13:09:17 -08001464 .pmic_id_irq = PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE),
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001465 .power_budget = 750,
Manu Gautam32ab9462012-02-20 12:33:01 +05301466#ifdef CONFIG_MSM_BUS_SCALING
1467 .bus_scale_table = &usb_bus_scale_pdata,
1468#endif
Pavankumar Kondeti2aec9f32012-06-13 09:06:03 +05301469#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
1470 .mhl_dev_name = "sii8334",
1471#endif
Jack Pham87f202f2012-08-06 00:24:22 -07001472 .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001473};
1474#endif
1475
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001476#define PID_MAGIC_ID 0x71432909
1477#define SERIAL_NUM_MAGIC_ID 0x61945374
1478#define SERIAL_NUMBER_LENGTH 127
1479#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1480
1481struct magic_num_struct {
1482 uint32_t pid;
1483 uint32_t serial_num;
1484};
1485
1486struct dload_struct {
1487 uint32_t reserved1;
1488 uint32_t reserved2;
1489 uint32_t reserved3;
1490 uint16_t reserved4;
1491 uint16_t pid;
1492 char serial_number[SERIAL_NUMBER_LENGTH];
1493 uint16_t reserved5;
1494 struct magic_num_struct magic_struct;
1495};
1496
1497static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1498{
1499 struct dload_struct __iomem *dload = 0;
1500
1501 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1502 if (!dload) {
1503 pr_err("%s: cannot remap I/O memory region: %08x\n",
1504 __func__, DLOAD_USB_BASE_ADD);
1505 return -ENXIO;
1506 }
1507
1508 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1509 __func__, dload, pid, snum);
1510 /* update pid */
1511 dload->magic_struct.pid = PID_MAGIC_ID;
1512 dload->pid = pid;
1513
1514 /* update serial number */
1515 dload->magic_struct.serial_num = 0;
1516 if (!snum) {
1517 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1518 goto out;
1519 }
1520
1521 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
1522 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
1523out:
1524 iounmap(dload);
1525 return 0;
1526}
1527
1528static struct android_usb_platform_data android_usb_pdata = {
1529 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1530};
1531
1532static struct platform_device android_usb_device = {
1533 .name = "android_usb",
1534 .id = -1,
1535 .dev = {
1536 .platform_data = &android_usb_pdata,
1537 },
1538};
1539
1540static uint8_t spm_wfi_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001541 0x03, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001542};
1543
1544static uint8_t spm_power_collapse_without_rpm[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001545 0x00, 0x24, 0x54, 0x10,
1546 0x09, 0x03, 0x01,
1547 0x10, 0x54, 0x30, 0x0C,
1548 0x24, 0x30, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001549};
1550
1551static uint8_t spm_power_collapse_with_rpm[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001552 0x00, 0x24, 0x54, 0x10,
1553 0x09, 0x07, 0x01, 0x0B,
1554 0x10, 0x54, 0x30, 0x0C,
1555 0x24, 0x30, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001556};
1557
1558static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1559 [0] = {
1560 .mode = MSM_SPM_MODE_CLOCK_GATING,
1561 .notify_rpm = false,
1562 .cmd = spm_wfi_cmd_sequence,
1563 },
1564 [1] = {
1565 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1566 .notify_rpm = false,
1567 .cmd = spm_power_collapse_without_rpm,
1568 },
1569 [2] = {
1570 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1571 .notify_rpm = true,
1572 .cmd = spm_power_collapse_with_rpm,
1573 },
1574};
1575
1576static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1577 [0] = {
1578 .reg_base_addr = MSM_SAW0_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001579 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001580#if defined(CONFIG_MSM_AVS_HW)
1581 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1582 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1583#endif
1584 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001585 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001586 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1587 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1588 .vctl_timeout_us = 50,
1589 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1590 .modes = msm_spm_seq_list,
1591 },
1592 [1] = {
1593 .reg_base_addr = MSM_SAW1_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001594 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001595#if defined(CONFIG_MSM_AVS_HW)
1596 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1597 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1598#endif
1599 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001600 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001601 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1602 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1603 .vctl_timeout_us = 50,
1604 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1605 .modes = msm_spm_seq_list,
1606 },
1607};
1608
1609static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001610 0x00, 0x20, 0x03, 0x20,
1611 0x00, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001612};
1613
1614static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001615 0x00, 0x20, 0x34, 0x64,
1616 0x48, 0x07, 0x48, 0x20,
1617 0x50, 0x64, 0x04, 0x34,
1618 0x50, 0x0f,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001619};
1620static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001621 0x00, 0x10, 0x34, 0x64,
1622 0x48, 0x07, 0x48, 0x10,
1623 0x50, 0x64, 0x04, 0x34,
1624 0x50, 0x0F,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001625};
1626
1627static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1628 [0] = {
1629 .mode = MSM_SPM_L2_MODE_RETENTION,
1630 .notify_rpm = false,
1631 .cmd = l2_spm_wfi_cmd_sequence,
1632 },
1633 [1] = {
1634 .mode = MSM_SPM_L2_MODE_GDHS,
1635 .notify_rpm = true,
1636 .cmd = l2_spm_gdhs_cmd_sequence,
1637 },
1638 [2] = {
1639 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1640 .notify_rpm = true,
1641 .cmd = l2_spm_power_off_cmd_sequence,
1642 },
1643};
1644
1645static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1646 [0] = {
1647 .reg_base_addr = MSM_SAW_L2_BASE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001648 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001649 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001650 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1651 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1652 .modes = msm_spm_l2_seq_list,
1653 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1654 },
1655};
1656
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301657#define ISA1200_HAP_EN_GPIO 77
1658#define ISA1200_HAP_LEN_GPIO 78
1659#define ISA1200_HAP_CLK PM8038_GPIO_PM_TO_SYS(7)
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001660
1661static int isa1200_power(int on)
1662{
Amy Malocheb20c1052012-04-11 10:36:13 -07001663 int rc = 0;
1664
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301665 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
1666
Amy Malocheb20c1052012-04-11 10:36:13 -07001667 if (on)
1668 rc = pm8xxx_aux_clk_control(CLK_MP3_1, XO_DIV_1, true);
1669 else
1670 rc = pm8xxx_aux_clk_control(CLK_MP3_1, XO_DIV_NONE, true);
1671
1672 if (rc) {
1673 pr_err("%s: unable to write aux clock register(%d)\n",
1674 __func__, rc);
1675 }
1676
1677 return rc;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001678}
1679
1680static int isa1200_dev_setup(bool enable)
1681{
1682 int rc = 0;
1683
Amy Malocheb20c1052012-04-11 10:36:13 -07001684 if (!enable)
1685 goto fail_gpio_dir;
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301686
1687 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
1688 if (rc) {
1689 pr_err("%s: gpio_request for %d gpio failed rc(%d)\n",
1690 __func__, ISA1200_HAP_CLK, rc);
1691 goto fail_gpio_req;
1692 }
1693
1694 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
1695 if (rc) {
1696 pr_err("%s: gpio_direction_output failed for %d gpio rc(%d)\n",
1697 __func__, ISA1200_HAP_CLK, rc);
1698 goto fail_gpio_dir;
1699 }
1700
1701 return 0;
1702
1703fail_gpio_dir:
1704 gpio_free(ISA1200_HAP_CLK);
1705fail_gpio_req:
1706 return rc;
1707
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001708}
1709
1710static struct isa1200_regulator isa1200_reg_data[] = {
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301711 {
1712 .name = "vddp",
1713 .min_uV = ISA_I2C_VTG_MIN_UV,
1714 .max_uV = ISA_I2C_VTG_MAX_UV,
1715 .load_uA = ISA_I2C_CURR_UA,
1716 },
Amy Malochee8de95d2012-02-23 10:40:25 -08001717 {
1718 .name = "vcc_i2c",
1719 .min_uV = ISA_I2C_VTG_MIN_UV,
1720 .max_uV = ISA_I2C_VTG_MAX_UV,
1721 .load_uA = ISA_I2C_CURR_UA,
1722 },
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001723};
1724
1725static struct isa1200_platform_data isa1200_1_pdata = {
1726 .name = "vibrator",
1727 .dev_setup = isa1200_dev_setup,
1728 .power_on = isa1200_power,
Anirudh Ghayal8c15f7f2012-01-09 14:04:02 +05301729 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1730 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001731 .max_timeout = 15000,
1732 .mode_ctrl = PWM_GEN_MODE,
1733 .pwm_fd = {
1734 .pwm_div = 256,
1735 },
1736 .is_erm = false,
1737 .smart_en = true,
1738 .ext_clk_en = true,
1739 .chip_en = 1,
1740 .regulator_info = isa1200_reg_data,
1741 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1742};
1743
1744static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1745 {
1746 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1747 .platform_data = &isa1200_1_pdata,
1748 },
1749};
1750
Amy Malochef3c9db42011-12-08 15:17:35 -08001751#define MXT_TS_GPIO_IRQ 11
1752#define MXT_TS_RESET_GPIO 52
1753
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301754static const u8 mxt_config_data_8930_v1[] = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001755 /* T6 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001756 0, 0, 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001757 /* T38 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301758 15, 3, 0, 15, 12, 11, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001759 /* T7 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301760 32, 16, 50,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001761 /* T8 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301762 30, 0, 5, 1, 0, 0, 8, 8, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001763 /* T9 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301764 131, 0, 0, 19, 11, 0, 16, 43, 2, 3,
1765 10, 7, 2, 0, 4, 5, 35, 10, 43, 4,
1766 54, 2, 15, 32, 38, 38, 143, 40, 143, 80,
1767 7, 9, 50, 50, 2,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001768 /* T15 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001769 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1770 0,
1771 /* T18 Object */
1772 0, 0,
1773 /* T19 Object */
1774 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1775 0, 0, 0, 0, 0, 0,
1776 /* T23 Object */
1777 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1778 0, 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001779 /* T25 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001780 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1781 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001782 /* T40 Object */
Amy Malochef3c9db42011-12-08 15:17:35 -08001783 0, 0, 0, 0, 0,
1784 /* T42 Object */
1785 0, 0, 0, 0, 0, 0, 0, 0,
1786 /* T46 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301787 0, 3, 8, 16, 0, 0, 1, 0, 0,
Amy Malochef3c9db42011-12-08 15:17:35 -08001788 /* T47 Object */
1789 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1790 /* T48 Object */
Mohan Pallaka84f725132012-05-17 16:38:56 +05301791 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
1792 0, 0, 0, 0, 0, 0, 0, 100, 4, 64,
1793 0, 0, 5, 42, 0, 0, 0, 0, 0, 0,
Amy Malochef3c9db42011-12-08 15:17:35 -08001794 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1795 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1796 0, 0, 0, 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001797};
1798
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301799static const u8 mxt_config_data_8930_v2[] = {
1800 /* T6 Object */
1801 0, 0, 0, 0, 0, 0,
1802 /* T38 Object */
1803 15, 4, 0, 9, 7, 12, 0, 0,
1804 /* T7 Object */
1805 32, 16, 50,
1806 /* T8 Object */
1807 30, 0, 5, 10, 0, 0, 10, 10, 0, 0,
1808 /* T9 Object */
1809 131, 0, 0, 19, 11, 0, 16, 50, 1, 3,
1810 12, 7, 2, 0, 4, 5, 2, 10, 43, 4,
1811 54, 2, -25, 29, 38, 18, 143, 40, 207, 80,
1812 17, 5, 50, 50, 0,
1813 /* T18 Object */
1814 0, 0,
1815 /* T19 Object */
1816 0, 0, 0, 0, 0, 0,
1817 /* T25 Object */
1818 0, 0, 0, 0, 0, 0,
1819 /* T42 Object */
1820 3, 60, 20, 20, 150, 0, 0, 0,
1821 /* T46 Object */
1822 0, 3, 28, 28, 0, 0, 1, 0, 0,
1823 /* T47 Object */
1824 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1825 /* T48 Object */
1826 1, 3, 82, 0, 0, 0, 0, 0, 0, 0,
1827 16, 30, 0, 6, 6, 0, 0, 124, 4, 100,
1828 0, 0, 0, 5, 0, 42, 0, 1, 0, 40,
1829 52, 20, 0, 0, 0, 50, 1, 5, 2, 1,
1830 4, 5, 3, -25, 29, 38, 18, 143, 40, 207,
1831 80, 10, 5, 2,
1832 /* T55 Object */
1833 0, 0, 0, 0,
1834};
1835
Amy Malochef3c9db42011-12-08 15:17:35 -08001836static ssize_t mxt224e_vkeys_show(struct kobject *kobj,
1837 struct kobj_attribute *attr, char *buf)
1838{
1839 return snprintf(buf, 200,
Amy Malochef8130f92012-02-01 10:38:59 +05301840 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":57:1030:90:90"
1841 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":206:1030:90:90"
1842 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":366:1030:90:90"
1843 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":503:1030:90:90"
Amy Malochef3c9db42011-12-08 15:17:35 -08001844 "\n");
1845}
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001846
Amy Malochef3c9db42011-12-08 15:17:35 -08001847static struct kobj_attribute mxt224e_vkeys_attr = {
1848 .attr = {
1849 .mode = S_IRUGO,
1850 },
1851 .show = &mxt224e_vkeys_show,
1852};
1853
1854static struct attribute *mxt224e_properties_attrs[] = {
1855 &mxt224e_vkeys_attr.attr,
1856 NULL
1857};
1858
1859static struct attribute_group mxt224e_properties_attr_group = {
1860 .attrs = mxt224e_properties_attrs,
1861};
1862
1863static void mxt_init_vkeys_8930(void)
1864{
Steve Mucklef132c6c2012-06-06 18:30:57 -07001865 int rc = 0;
Amy Malochef3c9db42011-12-08 15:17:35 -08001866 static struct kobject *mxt224e_properties_kobj;
1867
1868 mxt224e_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts";
1869 mxt224e_properties_kobj = kobject_create_and_add("board_properties",
1870 NULL);
1871 if (mxt224e_properties_kobj)
1872 rc = sysfs_create_group(mxt224e_properties_kobj,
1873 &mxt224e_properties_attr_group);
1874 if (!mxt224e_properties_kobj || rc)
1875 pr_err("%s: failed to create board_properties\n",
1876 __func__);
1877
1878 return;
1879}
1880
Jing Lindc4413c2012-01-16 15:22:52 -08001881static struct mxt_config_info mxt_config_array[] = {
1882 {
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301883 .config = mxt_config_data_8930_v1,
1884 .config_length = ARRAY_SIZE(mxt_config_data_8930_v1),
Jing Lindc4413c2012-01-16 15:22:52 -08001885 .family_id = 0x81,
1886 .variant_id = 0x01,
1887 .version = 0x10,
1888 .build = 0xAA,
Mohan Pallaka204b6f72012-07-09 14:44:10 +05301889 .bootldr_id = MXT_BOOTLOADER_ID_224E,
1890 .fw_name = "atmel_8930_fluid_v2_0_AB.hex",
1891 },
1892 {
1893 .config = mxt_config_data_8930_v2,
1894 .config_length = ARRAY_SIZE(mxt_config_data_8930_v2),
1895 .family_id = 0x81,
1896 .variant_id = 0x15,
1897 .version = 0x11,
1898 .build = 0xAA,
1899 .bootldr_id = MXT_BOOTLOADER_ID_224E,
1900 .fw_name = "atmel_8930_fluid_v2_0_AB.hex",
1901 },
1902 {
1903 .config = mxt_config_data_8930_v2,
1904 .config_length = ARRAY_SIZE(mxt_config_data_8930_v2),
1905 .family_id = 0x81,
1906 .variant_id = 0x01,
1907 .version = 0x20,
1908 .build = 0xAB,
1909 .bootldr_id = MXT_BOOTLOADER_ID_224E,
Jing Lindc4413c2012-01-16 15:22:52 -08001910 },
1911};
1912
Amy Malochef3c9db42011-12-08 15:17:35 -08001913static struct mxt_platform_data mxt_platform_data_8930 = {
Jing Lindc4413c2012-01-16 15:22:52 -08001914 .config_array = mxt_config_array,
1915 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001916 .panel_minx = 0,
1917 .panel_maxx = 566,
1918 .panel_miny = 0,
1919 .panel_maxy = 1067,
1920 .disp_minx = 0,
1921 .disp_maxx = 540,
1922 .disp_miny = 0,
1923 .disp_maxy = 960,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001924 .irqflags = IRQF_TRIGGER_FALLING,
Anirudh Ghayald7ad84c2012-01-09 09:17:53 +05301925#ifdef MSM8930_PHASE_2
1926 .digital_pwr_regulator = true,
1927#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001928 .i2c_pull_up = true,
Amy Malochef3c9db42011-12-08 15:17:35 -08001929 .reset_gpio = MXT_TS_RESET_GPIO,
1930 .irq_gpio = MXT_TS_GPIO_IRQ,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001931};
1932
Amy Malochef3c9db42011-12-08 15:17:35 -08001933static struct i2c_board_info mxt_device_info_8930[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001934 {
Amy Malochef3c9db42011-12-08 15:17:35 -08001935 I2C_BOARD_INFO("atmel_mxt_ts", 0x4a),
1936 .platform_data = &mxt_platform_data_8930,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08001937 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1938 },
1939};
1940
Manoj Raoc6d904c2012-06-22 00:32:14 -07001941#define MHL_POWER_GPIO PM8038_GPIO_PM_TO_SYS(MHL_GPIO_PWR_EN)
1942static struct msm_mhl_platform_data mhl_platform_data = {
1943 .irq = MSM_GPIO_TO_INT(MHL_GPIO_INT),
1944 .gpio_mhl_int = MHL_GPIO_INT,
1945 .gpio_mhl_reset = MHL_GPIO_RESET,
1946 .gpio_mhl_power = MHL_POWER_GPIO,
1947 .gpio_hdmi_mhl_mux = HDMI_MHL_MUX_GPIO,
1948};
1949
1950static struct i2c_board_info sii_device_info[] __initdata = {
1951 {
1952 /*
1953 * keeps SI 8334 as the default
1954 * MHL TX
1955 */
1956 I2C_BOARD_INFO("sii8334", 0x39),
1957 .platform_data = &mhl_platform_data,
1958 .flags = I2C_CLIENT_WAKE,
1959 },
1960};
1961
1962
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05301963#ifdef MSM8930_PHASE_2
1964
1965#define GPIO_VOLUME_UP PM8038_GPIO_PM_TO_SYS(3)
1966#define GPIO_VOLUME_DOWN PM8038_GPIO_PM_TO_SYS(8)
1967#define GPIO_CAMERA_SNAPSHOT PM8038_GPIO_PM_TO_SYS(10)
1968#define GPIO_CAMERA_FOCUS PM8038_GPIO_PM_TO_SYS(11)
1969
1970static struct gpio_keys_button keys_8930[] = {
1971 {
1972 .code = KEY_VOLUMEUP,
1973 .type = EV_KEY,
1974 .desc = "volume_up",
1975 .gpio = GPIO_VOLUME_UP,
1976 .wakeup = 1,
1977 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07001978 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05301979 },
1980 {
1981 .code = KEY_VOLUMEDOWN,
1982 .type = EV_KEY,
1983 .desc = "volume_down",
1984 .gpio = GPIO_VOLUME_DOWN,
1985 .wakeup = 1,
1986 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07001987 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05301988 },
1989 {
1990 .code = KEY_CAMERA_FOCUS,
1991 .type = EV_KEY,
1992 .desc = "camera_focus",
1993 .gpio = GPIO_CAMERA_FOCUS,
1994 .wakeup = 1,
1995 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07001996 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05301997 },
1998 {
1999 .code = KEY_CAMERA_SNAPSHOT,
2000 .type = EV_KEY,
2001 .desc = "camera_snapshot",
2002 .gpio = GPIO_CAMERA_SNAPSHOT,
2003 .wakeup = 1,
2004 .active_low = 1,
Amy Malocheff31a972012-06-06 15:28:54 -07002005 .debounce_interval = 15,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302006 },
2007};
2008
2009/* Add GPIO keys for 8930 */
2010static struct gpio_keys_platform_data gpio_keys_8930_pdata = {
2011 .buttons = keys_8930,
2012 .nbuttons = 4,
2013};
2014
2015static struct platform_device gpio_keys_8930 = {
2016 .name = "gpio-keys",
2017 .id = -1,
2018 .dev = {
2019 .platform_data = &gpio_keys_8930_pdata,
2020 },
2021};
2022#endif /* MSM8930_PHASE_2 */
2023
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002024static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2025 .clk_freq = 100000,
2026 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002027};
2028
2029static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2030 .clk_freq = 100000,
2031 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002032};
2033
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002034static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi9_pdata = {
2035 .clk_freq = 100000,
2036 .src_clk_rate = 24000000,
2037};
2038
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002039static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2040 .clk_freq = 100000,
2041 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002042};
2043
2044static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2045 .clk_freq = 100000,
2046 .src_clk_rate = 24000000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002047};
2048
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002049
2050static struct ks8851_pdata spi_eth_pdata = {
2051 .irq_gpio = KS8851_IRQ_GPIO,
2052 .rst_gpio = KS8851_RST_GPIO,
2053};
2054
2055static struct spi_board_info spi_board_info[] __initdata = {
2056 {
2057 .modalias = "ks8851",
2058 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2059 .max_speed_hz = 19200000,
2060 .bus_num = 0,
2061 .chip_select = 0,
2062 .mode = SPI_MODE_0,
2063 .platform_data = &spi_eth_pdata
2064 },
2065 {
2066 .modalias = "dsi_novatek_3d_panel_spi",
2067 .max_speed_hz = 10800000,
2068 .bus_num = 0,
2069 .chip_select = 1,
2070 .mode = SPI_MODE_0,
2071 },
2072};
2073
2074static struct platform_device msm_device_saw_core0 = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002075 .name = "saw-regulator",
2076 .id = 0,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002077 .dev = {
David Collinsb4558422012-01-05 10:50:49 -08002078 .platform_data = &msm8930_saw_regulator_core0_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002079 },
2080};
2081
2082static struct platform_device msm_device_saw_core1 = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002083 .name = "saw-regulator",
2084 .id = 1,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002085 .dev = {
David Collinsb4558422012-01-05 10:50:49 -08002086 .platform_data = &msm8930_saw_regulator_core1_pdata,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002087 },
2088};
2089
2090static struct tsens_platform_data msm_tsens_pdata = {
Jay Chokshi06fa7542011-12-07 13:09:17 -08002091 .tsens_factor = 1000,
Siddartha Mohanadoss97425122012-03-09 12:06:54 -08002092 .hw_type = APQ_8064,
Siddartha Mohanadoss892ee472012-05-03 10:35:20 -07002093 .tsens_num_sensor = 10,
2094 .slope = {1132, 1135, 1137, 1135, 1157,
2095 1142, 1124, 1153, 1175, 1166},
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002096};
2097
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002098static struct platform_device msm_tsens_device = {
2099 .name = "tsens8960-tm",
2100 .id = -1,
2101};
2102
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002103static struct msm_thermal_data msm_thermal_pdata = {
2104 .sensor_id = 9,
Eugene Seah2ee4a5d2012-06-25 18:16:41 -06002105 .poll_ms = 250,
2106 .limit_temp_degC = 60,
2107 .temp_hysteresis_degC = 10,
2108 .freq_step = 2,
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002109};
2110
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002111#ifdef CONFIG_MSM_FAKE_BATTERY
2112static struct platform_device fish_battery_device = {
2113 .name = "fish_battery",
2114};
2115#endif
2116
David Collins1d4061b2011-12-06 15:36:40 -08002117#ifndef MSM8930_PHASE_2
2118
2119/* 8930 Phase 1 */
Jay Chokshi06fa7542011-12-07 13:09:17 -08002120static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002121 .name = GPIO_REGULATOR_DEV_NAME,
2122 .id = PM8921_MPP_PM_TO_SYS(7),
2123 .dev = {
2124 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2125 },
2126};
2127
Jay Chokshi06fa7542011-12-07 13:09:17 -08002128static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002129 .name = GPIO_REGULATOR_DEV_NAME,
2130 .id = 91,
2131 .dev = {
2132 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2133 },
2134};
2135
David Collins1d4061b2011-12-06 15:36:40 -08002136#else
2137
2138/* 8930 Phase 2 */
2139static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = {
2140 .name = GPIO_REGULATOR_DEV_NAME,
2141 .id = 63,
2142 .dev = {
2143 .platform_data =
2144 &msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_5V],
2145 },
2146};
2147
2148static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = {
2149 .name = GPIO_REGULATOR_DEV_NAME,
2150 .id = 97,
2151 .dev = {
2152 .platform_data =
2153 &msm8930_gpio_regulator_pdata[MSM8930_GPIO_VREG_ID_EXT_OTG_SW],
2154 },
2155};
2156
2157#endif
2158
Jay Chokshi06fa7542011-12-07 13:09:17 -08002159static struct platform_device msm8930_device_rpm_regulator __devinitdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002160 .name = "rpm-regulator",
2161 .id = -1,
2162 .dev = {
David Collins8af872e2012-01-06 11:31:56 -08002163#ifndef MSM8930_PHASE_2
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002164 .platform_data = &msm_rpm_regulator_pdata,
David Collins8af872e2012-01-06 11:31:56 -08002165#else
2166 .platform_data = &msm8930_rpm_regulator_pdata,
Jay Chokshi06fa7542011-12-07 13:09:17 -08002167#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002168 },
2169};
2170
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002171static struct platform_device *common_devices[] __initdata = {
2172 &msm8960_device_dmov,
2173 &msm_device_smd,
2174 &msm8960_device_uart_gsbi5,
2175 &msm_device_uart_dm6,
2176 &msm_device_saw_core0,
2177 &msm_device_saw_core1,
Jay Chokshi06fa7542011-12-07 13:09:17 -08002178 &msm8930_device_ext_5v_vreg,
David Collins1d4061b2011-12-06 15:36:40 -08002179#ifndef MSM8930_PHASE_2
Jay Chokshi06fa7542011-12-07 13:09:17 -08002180 &msm8930_device_ext_l2_vreg,
David Collins1d4061b2011-12-06 15:36:40 -08002181#endif
Jay Chokshi33c044a2011-12-07 13:05:40 -08002182 &msm8960_device_ssbi_pmic,
David Collins1d4061b2011-12-06 15:36:40 -08002183#ifdef MSM8930_PHASE_2
2184 &msm8930_device_ext_otg_sw_vreg,
2185#endif
Stephen Boyd28d54952011-12-16 13:19:51 -08002186 &msm_8960_q6_lpass,
2187 &msm_8960_q6_mss_fw,
2188 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07002189 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07002190 &msm_pil_tzapps,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002191 &msm_pil_vidc,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002192 &msm8960_device_qup_spi_gsbi1,
2193 &msm8960_device_qup_i2c_gsbi3,
2194 &msm8960_device_qup_i2c_gsbi4,
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002195 &msm8960_device_qup_i2c_gsbi9,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002196 &msm8960_device_qup_i2c_gsbi10,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002197 &msm8960_device_qup_i2c_gsbi12,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002198 &msm_slim_ctrl,
2199 &msm_device_wcnss_wlan,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002200#if defined(CONFIG_QSEECOM)
2201 &qseecom_device,
2202#endif
2203
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002204#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2205 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2206 &qcrypto_device,
2207#endif
2208
2209#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2210 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2211 &qcedev_device,
2212#endif
2213#ifdef CONFIG_MSM_ROTATOR
2214 &msm_rotator_device,
2215#endif
2216 &msm_device_sps,
2217#ifdef CONFIG_MSM_FAKE_BATTERY
2218 &fish_battery_device,
2219#endif
2220#ifdef CONFIG_ANDROID_PMEM
2221#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002222 &msm8930_android_pmem_device,
2223 &msm8930_android_pmem_adsp_device,
2224 &msm8930_android_pmem_audio_device,
Asish Bhattacharya5d63c4b2012-04-12 08:41:12 +05302225#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
2226#endif /*CONFIG_ANDROID_PMEM*/
Hanumant Singheea62562012-05-14 11:32:45 -07002227 &msm8930_fmem_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002228 &msm_device_bam_dmux,
2229 &msm_fm_platform_init,
2230
2231#ifdef CONFIG_HW_RANDOM_MSM
2232 &msm_device_rng,
2233#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06002234 &msm8930_rpm_device,
2235 &msm8930_rpm_log_device,
Girish Mahadevan898c56d2012-06-05 16:09:19 -06002236 &msm8930_rpm_rbcpr_device,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002237 &msm8930_rpm_stat_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002238#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002239 &msm8930_ion_dev,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002240#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002241 &msm_device_tz_log,
Pratik Patel3b0ca882012-06-01 16:54:14 -07002242 &coresight_tpiu_device,
2243 &coresight_etb_device,
2244 &coresight_funnel_device,
2245 &coresight_etm0_device,
2246 &coresight_etm1_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002247 &msm_device_dspcrashd_8960,
2248 &msm8960_device_watchdog,
Anirudh Ghayaleb3af972011-12-13 17:29:06 +05302249#ifdef MSM8930_PHASE_2
2250 &gpio_keys_8930,
2251#endif
Laura Abbottb93525f2012-04-12 09:57:19 -07002252 &msm8930_rtb_device,
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002253 &msm8930_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002254 &msm8930_msm_gov_device,
Gagan Maccd5b3272012-02-09 18:13:10 -07002255 &msm_bus_8930_apps_fabric,
2256 &msm_bus_8930_sys_fabric,
2257 &msm_bus_8930_mm_fabric,
2258 &msm_bus_8930_sys_fpb,
2259 &msm_bus_8930_cpss_fpb,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002260 &msm8960_device_cache_erp,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002261 &msm8930_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002262 &msm_tsens_device,
Laura Abbottf3173042012-05-29 15:23:18 -07002263 &msm8930_cache_dump_device,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002264};
2265
2266static struct platform_device *cdp_devices[] __initdata = {
2267 &msm8960_device_otg,
2268 &msm8960_device_gadget_peripheral,
2269 &msm_device_hsusb_host,
2270 &android_usb_device,
2271 &msm_pcm,
2272 &msm_pcm_routing,
2273 &msm_cpudai0,
2274 &msm_cpudai1,
2275 &msm_cpudai_hdmi_rx,
2276 &msm_cpudai_bt_rx,
2277 &msm_cpudai_bt_tx,
2278 &msm_cpudai_fm_rx,
2279 &msm_cpudai_fm_tx,
2280 &msm_cpudai_auxpcm_rx,
2281 &msm_cpudai_auxpcm_tx,
2282 &msm_cpu_fe,
2283 &msm_stub_codec,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002284#ifdef CONFIG_MSM_GEMINI
2285 &msm8960_gemini_device,
2286#endif
2287 &msm_voice,
2288 &msm_voip,
2289 &msm_lpa_pcm,
2290 &msm_cpudai_afe_01_rx,
2291 &msm_cpudai_afe_01_tx,
2292 &msm_cpudai_afe_02_rx,
2293 &msm_cpudai_afe_02_tx,
2294 &msm_pcm_afe,
Ajay Dudani79e268c2011-12-28 13:14:44 -08002295 &msm_compr_dsp,
2296 &msm_cpudai_incall_music_rx,
2297 &msm_cpudai_incall_record_rx,
2298 &msm_cpudai_incall_record_tx,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002299 &msm_pcm_hostless,
Asish Bhattacharya705c6732012-08-14 23:22:55 +05302300 &msm_multi_ch_pcm,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002301};
2302
2303static void __init msm8930_i2c_init(void)
2304{
2305 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2306 &msm8960_i2c_qup_gsbi4_pdata;
2307
2308 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2309 &msm8960_i2c_qup_gsbi3_pdata;
2310
Harini Jayaramanfe6ff4162012-03-14 11:25:40 -06002311 msm8960_device_qup_i2c_gsbi9.dev.platform_data =
2312 &msm8960_i2c_qup_gsbi9_pdata;
2313
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002314 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2315 &msm8960_i2c_qup_gsbi10_pdata;
2316
2317 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2318 &msm8960_i2c_qup_gsbi12_pdata;
2319}
2320
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002321static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
2322 {
2323 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2324 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2325 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002326 1, 784, 180000, 100,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002327 },
2328
2329 {
2330 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2331 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2332 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002333 1300, 228, 1200000, 2000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002334 },
2335
2336 {
2337 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2338 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2339 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002340 2000, 138, 1208400, 3200,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002341 },
2342
2343 {
2344 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002345 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2346 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002347 6000, 119, 1850300, 9000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002348 },
2349
2350 {
2351 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2352 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2353 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002354 9200, 68, 2839200, 16400,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002355 },
2356
2357 {
2358 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2359 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2360 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002361 10300, 63, 3128000, 18200,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002362 },
2363
2364 {
2365 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2366 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2367 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002368 18000, 10, 4602600, 27000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002369 },
2370
2371 {
2372 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2373 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2374 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002375 20000, 2, 5752000, 32000,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002376 },
2377};
2378
Praveen Chidambaram78499012011-11-01 17:15:17 -06002379static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2380 .levels = &msm_rpmrs_levels[0],
2381 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2382 .vdd_mem_levels = {
2383 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2384 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2385 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2386 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2387 },
2388 .vdd_dig_levels = {
Mahesh Sivasubramanian745e16e2012-05-21 11:52:04 -06002389 [MSM_RPMRS_VDD_DIG_RET_LOW] = 0,
2390 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 0,
2391 [MSM_RPMRS_VDD_DIG_ACTIVE] = 1,
2392 [MSM_RPMRS_VDD_DIG_MAX] = 3,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002393 },
2394 .vdd_mask = 0x7FFFFF,
2395 .rpmrs_target_id = {
2396 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2397 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
Mahesh Sivasubramanian745e16e2012-05-21 11:52:04 -06002398 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER,
2399 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002400 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8038_L24_0,
2401 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8038_L24_1,
2402 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2403 },
2404};
2405
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002406static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2407 .mode = MSM_PM_BOOT_CONFIG_TZ,
2408};
2409
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002410#ifdef CONFIG_I2C
2411#define I2C_SURF 1
2412#define I2C_FFA (1 << 1)
2413#define I2C_RUMI (1 << 2)
2414#define I2C_SIM (1 << 3)
2415#define I2C_FLUID (1 << 4)
2416#define I2C_LIQUID (1 << 5)
2417
2418struct i2c_registry {
2419 u8 machs;
2420 int bus;
2421 struct i2c_board_info *info;
2422 int len;
2423};
2424
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002425#ifdef CONFIG_INPUT_MPU3050
2426#define MPU3050_INT_GPIO 69
2427
2428static struct mpu3050_gyro_platform_data mpu3050_gyro = {
2429 .gpio_int = MPU3050_INT_GPIO,
2430};
2431
2432static struct i2c_board_info __initdata mpu3050_i2c_boardinfo[] = {
2433 {
2434 I2C_BOARD_INFO("mpu3050", 0x68),
Wentao Xuc7769c02012-08-03 15:06:41 -04002435 .irq = MSM_GPIO_TO_INT(MPU3050_INT_GPIO),
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002436 .platform_data = &mpu3050_gyro,
2437 },
2438};
2439#endif
2440
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002441#ifdef CONFIG_ISL9519_CHARGER
2442static struct isl_platform_data isl_data __initdata = {
2443 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2444 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2445 .max_system_voltage = 4200,
2446 .min_system_voltage = 3200,
2447 .chgcurrent = 1000, /* 1900, */
2448 .term_current = 400, /* Need fine tuning */
2449 .input_current = 2048,
2450};
2451
2452static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2453 {
2454 I2C_BOARD_INFO("isl9519q", 0x9),
2455 .irq = 0, /* Not required when notify-by-pmic */
2456 .platform_data = &isl_data,
2457 },
2458};
2459#endif /* CONFIG_ISL9519_CHARGER */
2460
Wentao Xu114c0152012-06-12 11:40:38 -04002461#ifdef CONFIG_STM_LIS3DH
2462static struct lis3dh_acc_platform_data lis3dh_accel = {
2463 .poll_interval = 200,
2464 .min_interval = 10,
2465 .g_range = LIS3DH_ACC_G_2G,
2466 .axis_map_x = 1,
2467 .axis_map_y = 0,
2468 .axis_map_z = 2,
2469 .negate_x = 0,
2470 .negate_y = 0,
2471 .negate_z = 1,
2472 .init = NULL,
2473 .exit = NULL,
2474 .gpio_int1 = -EINVAL,
2475 .gpio_int2 = -EINVAL,
2476};
2477
2478static struct i2c_board_info __initdata lis3dh_i2c_boardinfo[] = {
2479 {
2480 I2C_BOARD_INFO(LIS3DH_ACC_DEV_NAME, 0x18),
2481 .platform_data = &lis3dh_accel,
2482 },
2483};
2484#endif /* CONFIG_STM_LIS3DH */
2485
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002486static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002487#ifdef CONFIG_ISL9519_CHARGER
2488 {
2489 I2C_LIQUID,
2490 MSM_8930_GSBI10_QUP_I2C_BUS_ID,
2491 isl_charger_i2c_info,
2492 ARRAY_SIZE(isl_charger_i2c_info),
2493 },
2494#endif /* CONFIG_ISL9519_CHARGER */
Wentao Xuf59ce4e2012-05-22 17:30:13 -04002495#ifdef CONFIG_INPUT_MPU3050
2496 {
2497 I2C_FFA | I2C_FLUID,
2498 MSM_8930_GSBI12_QUP_I2C_BUS_ID,
2499 mpu3050_i2c_boardinfo,
2500 ARRAY_SIZE(mpu3050_i2c_boardinfo),
2501 },
2502#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002503 {
Amy Malochee8de95d2012-02-23 10:40:25 -08002504 I2C_SURF | I2C_FFA | I2C_FLUID,
2505 MSM_8930_GSBI9_QUP_I2C_BUS_ID,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002506 msm_isa1200_board_info,
2507 ARRAY_SIZE(msm_isa1200_board_info),
2508 },
Amy Malochef3c9db42011-12-08 15:17:35 -08002509 {
Amy Maloche8eb91112012-03-30 10:22:37 -07002510 I2C_SURF | I2C_FFA | I2C_FLUID,
Amy Malochef3c9db42011-12-08 15:17:35 -08002511 MSM_8930_GSBI3_QUP_I2C_BUS_ID,
2512 mxt_device_info_8930,
2513 ARRAY_SIZE(mxt_device_info_8930),
2514 },
Manoj Raoc6d904c2012-06-22 00:32:14 -07002515 {
2516 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_FLUID,
2517 MSM_8930_GSBI9_QUP_I2C_BUS_ID,
2518 sii_device_info,
2519 ARRAY_SIZE(sii_device_info),
2520 },
Wentao Xu114c0152012-06-12 11:40:38 -04002521#ifdef CONFIG_STM_LIS3DH
2522 {
2523 I2C_FFA | I2C_FLUID,
2524 MSM_8930_GSBI12_QUP_I2C_BUS_ID,
2525 lis3dh_i2c_boardinfo,
2526 ARRAY_SIZE(lis3dh_i2c_boardinfo),
2527 },
2528#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002529};
2530#endif /* CONFIG_I2C */
2531
2532static void __init register_i2c_devices(void)
2533{
2534#ifdef CONFIG_I2C
2535 u8 mach_mask = 0;
2536 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002537#ifdef CONFIG_MSM_CAMERA
2538 struct i2c_registry msm8930_camera_i2c_devices = {
2539 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2540 MSM_8930_GSBI4_QUP_I2C_BUS_ID,
2541 msm8930_camera_board_info.board_info,
2542 msm8930_camera_board_info.num_i2c_board_info,
2543 };
2544#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002545
2546 /* Build the matching 'supported_machs' bitmask */
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002547 if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp())
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002548 mach_mask = I2C_SURF;
2549 else if (machine_is_msm8930_fluid())
2550 mach_mask = I2C_FLUID;
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002551 else if (machine_is_msm8930_mtp() || machine_is_msm8627_mtp())
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002552 mach_mask = I2C_FFA;
2553 else
2554 pr_err("unmatched machine ID in register_i2c_devices\n");
2555
2556 /* Run the array and install devices as appropriate */
2557 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2558 if (msm8960_i2c_devices[i].machs & mach_mask)
2559 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2560 msm8960_i2c_devices[i].info,
2561 msm8960_i2c_devices[i].len);
2562 }
Kevin Chan09f4e662011-12-16 08:17:02 -08002563#ifdef CONFIG_MSM_CAMERA
2564 if (msm8930_camera_i2c_devices.machs & mach_mask)
2565 i2c_register_board_info(msm8930_camera_i2c_devices.bus,
2566 msm8930_camera_i2c_devices.info,
2567 msm8930_camera_i2c_devices.len);
2568#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002569#endif
2570}
2571
2572static void __init msm8930_cdp_init(void)
2573{
2574 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
2575 pr_err("meminfo_init() failed!\n");
2576
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07002577 platform_device_register(&msm_gpio_device);
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08002578 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002579 msm_thermal_init(&msm_thermal_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06002580 BUG_ON(msm_rpm_init(&msm8930_rpm_data));
2581 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002582
2583 regulator_suppress_info_printing();
2584 if (msm_xo_init())
2585 pr_err("Failed to initialize XO votes\n");
Jay Chokshi06fa7542011-12-07 13:09:17 -08002586 platform_device_register(&msm8930_device_rpm_regulator);
Tianyi Goue3d4f542012-03-15 17:06:45 -07002587 msm_clock_init(&msm8930_clock_init_data);
Mayank Rana2fe1aec2012-06-07 18:00:12 +05302588 msm_otg_pdata.phy_init_seq = hsusb_phy_init_seq;
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002589 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Mayank Ranac64b6392012-05-21 14:05:23 +05302590 android_usb_pdata.swfi_latency =
2591 msm_rpmrs_levels[0].latency_us;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08002592 msm8930_init_gpiomux();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002593 msm8960_device_qup_spi_gsbi1.dev.platform_data =
2594 &msm8960_qup_spi_gsbi1_pdata;
2595 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
2596
Jay Chokshi06fa7542011-12-07 13:09:17 -08002597 /*
2598 * TODO: When physical 8930/PM8038 hardware becomes
2599 * available, remove this block or add the config
2600 * option.
2601 */
2602#ifndef MSM8930_PHASE_2
2603 msm8960_init_pmic();
2604#else
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002605 msm8930_init_pmic();
Jay Chokshi06fa7542011-12-07 13:09:17 -08002606#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002607 msm8930_i2c_init();
Sudhakara Rao Tentu8b5c8ed2012-03-05 14:48:41 +05302608 msm8930_init_gpu();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002609 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
2610 msm_spm_l2_init(msm_spm_l2_data);
2611 msm8930_init_buses();
Tianyi Gou723843b2012-06-13 15:24:56 -07002612 if (cpu_is_msm8627())
2613 platform_add_devices(msm8627_footswitch,
2614 msm8627_num_footswitch);
2615 else
2616 platform_add_devices(msm8930_footswitch,
2617 msm8930_num_footswitch);
Matt Wagantall6dcfa922012-06-07 20:13:51 -07002618 if (cpu_is_msm8627())
Matt Wagantallab730bd2012-06-07 20:13:51 -07002619 platform_device_register(&msm8627_device_acpuclk);
Tianyi Gou12370f12012-07-23 19:13:57 -07002620 else if (cpu_is_msm8930())
Matt Wagantall6dcfa922012-06-07 20:13:51 -07002621 platform_device_register(&msm8930_device_acpuclk);
Tianyi Gou12370f12012-07-23 19:13:57 -07002622 else if (cpu_is_msm8930aa())
2623 platform_device_register(&msm8930aa_device_acpuclk);
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002624 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Arun Menonaabf2632012-02-24 15:30:47 -08002625 msm8930_add_vidc_device();
Jay Chokshi06fa7542011-12-07 13:09:17 -08002626 /*
2627 * TODO: When physical 8930/PM8038 hardware becomes
2628 * available, remove this block or add the config
2629 * option.
2630 */
2631#ifndef MSM8930_PHASE_2
2632 msm8960_pm8921_gpio_mpp_init();
2633#else
2634 msm8930_pm8038_gpio_mpp_init();
2635#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002636 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Steve Mucklef132c6c2012-06-06 18:30:57 -07002637#ifdef CONFIG_MSM_CAMERA
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002638 msm8930_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07002639#endif
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002640 msm8930_init_mmc();
Amy Maloche8eb91112012-03-30 10:22:37 -07002641 mxt_init_vkeys_8930();
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002642 register_i2c_devices();
2643 msm8930_init_fb();
2644 slim_register_board_info(msm_slim_devices,
2645 ARRAY_SIZE(msm_slim_devices));
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002646 change_memory_power = &msm8930_change_memory_power;
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002647 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002648
2649 if (PLATFORM_IS_CHARM25())
2650 platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices));
2651}
2652
2653MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP")
2654 .map_io = msm8930_map_io,
2655 .reserve = msm8930_reserve,
2656 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302657 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002658 .timer = &msm_timer,
2659 .init_machine = msm8930_cdp_init,
2660 .init_early = msm8930_allocate_memory_regions,
2661 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002662 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002663MACHINE_END
2664
2665MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP")
2666 .map_io = msm8930_map_io,
2667 .reserve = msm8930_reserve,
2668 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302669 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002670 .timer = &msm_timer,
2671 .init_machine = msm8930_cdp_init,
2672 .init_early = msm8930_allocate_memory_regions,
2673 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002674 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002675MACHINE_END
2676
2677MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID")
2678 .map_io = msm8930_map_io,
2679 .reserve = msm8930_reserve,
2680 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302681 .handle_irq = gic_handle_irq,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002682 .timer = &msm_timer,
2683 .init_machine = msm8930_cdp_init,
2684 .init_early = msm8930_allocate_memory_regions,
2685 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002686 .restart = msm_restart,
Stepan Moskovchenko39236d72011-11-30 17:42:23 -08002687MACHINE_END
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002688
2689MACHINE_START(MSM8627_CDP, "QCT MSM8627 CDP")
2690 .map_io = msm8930_map_io,
2691 .reserve = msm8930_reserve,
2692 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302693 .handle_irq = gic_handle_irq,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002694 .timer = &msm_timer,
2695 .init_machine = msm8930_cdp_init,
2696 .init_early = msm8930_allocate_memory_regions,
2697 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002698 .restart = msm_restart,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002699MACHINE_END
2700
2701MACHINE_START(MSM8627_MTP, "QCT MSM8627 MTP")
2702 .map_io = msm8930_map_io,
2703 .reserve = msm8930_reserve,
2704 .init_irq = msm8930_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05302705 .handle_irq = gic_handle_irq,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002706 .timer = &msm_timer,
2707 .init_machine = msm8930_cdp_init,
2708 .init_early = msm8930_allocate_memory_regions,
2709 .init_very_early = msm8930_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07002710 .restart = msm_restart,
Stepan Moskovchenko8768eff2011-12-01 18:55:07 -08002711MACHINE_END