blob: cbdc9ff5455b40bfbbf565a05a9fa5e92cc95ce0 [file] [log] [blame]
Harini Jayaramana9873ab2011-12-20 17:29:48 -07001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -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 *
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080012 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/i2c.h>
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -070018#include <linux/i2c/sx150x.h>
Amir Samuelov5137e392011-09-21 17:31:25 +030019#include <linux/i2c/isl9519.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070023#include <linux/mfd/pm8xxx/pm8921.h>
Siddartha Mohanadossaf91d902011-10-20 10:23:34 -070024#include <linux/mfd/pm8xxx/pm8xxx-adc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025#include <linux/regulator/consumer.h>
26#include <linux/spi/spi.h>
27#include <linux/slimbus/slimbus.h>
28#include <linux/bootmem.h>
29#ifdef CONFIG_ANDROID_PMEM
30#include <linux/android_pmem.h>
31#endif
Steve Mucklef132c6c2012-06-06 18:30:57 -070032#include <linux/cyttsp-qc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070033#include <linux/dma-mapping.h>
34#include <linux/platform_data/qcom_crypto_device.h>
Ankur Nandwanib0039b02011-08-09 14:00:45 -070035#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#include <linux/leds.h>
37#include <linux/leds-pm8xxx.h>
Mohan Pallaka50837382011-09-07 11:00:57 +053038#include <linux/i2c/atmel_mxt_ts.h>
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -070039#include <linux/msm_tsens.h>
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -070040#include <linux/ks8851.h>
Mohan Pallaka5e490392011-09-09 15:18:41 +053041#include <linux/i2c/isa1200.h>
Jack Cheung0b1987e2011-11-18 13:36:29 -080042#include <linux/memory.h>
Larry Bassel2d8b42d2012-03-12 10:41:26 -070043#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060044#include <linux/msm_thermal.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080045
46#include <asm/mach-types.h>
47#include <asm/mach/arch.h>
Larry Basselb4126da2011-07-18 14:31:33 -070048#include <asm/setup.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080049#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070050#include <asm/mach/mmc.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080051
52#include <mach/board.h>
Joel Nider266a2642011-10-16 10:58:05 +020053#include <mach/msm_tspp.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080054#include <mach/msm_iomap.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#include <mach/msm_spi.h>
Mayank Ranae009c922012-03-22 03:02:06 +053056#include <mach/msm_serial_hs.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057#ifdef CONFIG_USB_MSM_OTG_72K
58#include <mach/msm_hsusb.h>
59#else
60#include <linux/usb/msm_hsusb.h>
61#endif
62#include <linux/usb/android.h>
63#include <mach/usbdiag.h>
64#include <mach/socinfo.h>
65#include <mach/rpm.h>
Rohit Vaswania513aa8d2011-07-18 15:14:28 -070066#include <mach/gpiomux.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070067#include <mach/msm_bus_board.h>
68#include <mach/msm_memtypes.h>
69#include <mach/dma.h>
70#include <mach/msm_dsps.h>
71#include <mach/msm_xo.h>
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -070072#include <mach/restart.h>
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -080073
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070074#ifdef CONFIG_WCD9310_CODEC
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053075#include <linux/mfd/wcd9xxx/core.h>
76#include <linux/mfd/wcd9xxx/pdata.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070077#endif
78
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +053079#include <linux/smsc3503.h>
Laura Abbottd6183792011-08-19 13:42:24 -070080#include <linux/ion.h>
81#include <mach/ion.h>
Joel Kingb8352a12011-11-15 18:46:24 -080082#include <mach/mdm2.h>
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -080083#include <mach/mdm-peripheral.h>
Laura Abbottf8c03b92012-02-16 14:57:58 -080084#include <mach/msm_rtb.h>
Laura Abbott306bcc22012-03-08 11:24:53 -080085#include <mach/msm_cache_dump.h>
86#include <mach/scm.h>
Olav Haugan8726caf2012-05-10 15:11:35 -070087#include <mach/iommu_domains.h>
Laura Abbottd6183792011-08-19 13:42:24 -070088
Jordan Crouse914de9b2012-07-09 13:49:46 -060089#include <mach/kgsl.h>
Larry Bassel41a055b2011-12-06 16:15:14 -080090#include <linux/fmem.h>
91
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092#include "timer.h"
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -080093#include "devices.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070094#include "devices-msm8x60.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070095#include "spm.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080096#include "board-8960.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080097#include "pm.h"
Abhijeet Dharmapurikarefaca4f2011-12-27 16:24:07 -080098#include <mach/cpuidle.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070099#include "rpm_resources.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +0530100#include <mach/mpm.h>
Naveen Ramaraj76483ad2011-09-06 14:25:44 -0700101#include "smd_private.h"
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -0600102#include "pm-boot.h"
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700103#include "msm_watchdog.h"
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -0800104
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700105static struct platform_device msm_fm_platform_init = {
106 .name = "iris_fm",
107 .id = -1,
108};
109
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700110#define KS8851_RST_GPIO 89
111#define KS8851_IRQ_GPIO 90
Mohan Pallaka5e490392011-09-09 15:18:41 +0530112#define HAP_SHIFT_LVL_OE_GPIO 47
113
Manoj Rao14648742012-03-30 19:42:12 -0700114#define MHL_GPIO_INT 4
115#define MHL_GPIO_RESET 15
116
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700117#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700118
Stepan Moskovchenkoc6ada422011-11-28 19:31:16 -0800119struct sx150x_platform_data msm8960_sx150x_data[] = {
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700120 [SX150X_CAM] = {
121 .gpio_base = GPIO_CAM_EXPANDER_BASE,
122 .oscio_is_gpo = false,
123 .io_pullup_ena = 0x0,
Nishant Pandit474f2252011-07-23 23:17:56 +0530124 .io_pulldn_ena = 0xc0,
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700125 .io_open_drain_ena = 0x0,
126 .irq_summary = -1,
127 },
Amir Samuelov755616d2011-12-13 16:34:46 +0200128 [SX150X_LIQUID] = {
129 .gpio_base = GPIO_LIQUID_EXPANDER_BASE,
130 .oscio_is_gpo = false,
131 .io_pullup_ena = 0x0c08,
132 .io_pulldn_ena = 0x4060,
133 .io_open_drain_ena = 0x000c,
134 .io_polarity = 0,
135 .irq_summary = -1,
136 },
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -0700137};
Nishant Pandit474f2252011-07-23 23:17:56 +0530138
139#endif
140
Olav Haugana21169d2012-01-04 09:17:06 -0800141#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -0700142#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Mathew Karimpanal15fa5c42011-12-14 21:28:10 -0800143#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800144#define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800145#define MSM_HDMI_PRIM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Laura Abbott2d1760b2011-09-29 21:31:24 -0700146
147#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Deepak Kotur35825522012-06-06 15:49:14 -0700148#define HOLE_SIZE 0x20000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -0700149#define MSM_PMEM_KERNEL_EBI1_SIZE 0x65000
Olav Haugan32594552012-03-13 11:40:05 -0700150#ifdef CONFIG_MSM_IOMMU
Olav Haugan8726caf2012-05-10 15:11:35 -0700151#define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */
Olav Haugan32594552012-03-13 11:40:05 -0700152#define MSM_ION_SF_SIZE 0x0
Olav Hauganfbbf05b2012-04-05 14:33:41 -0700153#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Olav Haugan32594552012-03-13 11:40:05 -0700154#define MSM_ION_HEAP_NUM 7
155#else
156#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
157#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Hauganfbbf05b2012-04-05 14:33:41 -0700158#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Olav Haugan32594552012-03-13 11:40:05 -0700159#define MSM_ION_HEAP_NUM 8
160#endif
Deepak Kotur35825522012-06-06 15:49:14 -0700161#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 128kb */
Olav Hauganb5be7992011-11-18 14:29:02 -0800162#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan7355db02012-01-13 16:59:13 -0800163#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan32594552012-03-13 11:40:05 -0700164
Olav Hauganb5be7992011-11-18 14:29:02 -0800165#define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000)
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800166#define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE
167#define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700168
Deepak Kotur35825522012-06-06 15:49:14 -0700169#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2mb -128kb*/
170#define MSM8960_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
171 HOLE_SIZE))
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700172#define MAX_FIXED_AREA_SIZE 0x10000000
Deepak Kotur35825522012-06-06 15:49:14 -0700173#define MSM8960_FW_START MSM8960_FIXED_AREA_START
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700174
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800175static unsigned msm_ion_sf_size = MSM_ION_SF_SIZE;
Laura Abbott2d1760b2011-09-29 21:31:24 -0700176#else
Laura Abbott6db11c92011-11-04 10:31:43 -0700177#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
Olav Hauganb5be7992011-11-18 14:29:02 -0800178#define MSM_ION_HEAP_NUM 1
Laura Abbott2d1760b2011-09-29 21:31:24 -0700179#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700180
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700181#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
182static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
183static int __init pmem_kernel_ebi1_size_setup(char *p)
184{
185 pmem_kernel_ebi1_size = memparse(p, NULL);
186 return 0;
187}
188early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
189#endif
190
191#ifdef CONFIG_ANDROID_PMEM
192static unsigned pmem_size = MSM_PMEM_SIZE;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800193static unsigned pmem_param_set;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700194static int __init pmem_size_setup(char *p)
195{
196 pmem_size = memparse(p, NULL);
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800197 pmem_param_set = 1;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700198 return 0;
199}
200early_param("pmem_size", pmem_size_setup);
201
202static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
203
204static int __init pmem_adsp_size_setup(char *p)
205{
206 pmem_adsp_size = memparse(p, NULL);
207 return 0;
208}
209early_param("pmem_adsp_size", pmem_adsp_size_setup);
210
211static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
212
213static int __init pmem_audio_size_setup(char *p)
214{
215 pmem_audio_size = memparse(p, NULL);
216 return 0;
217}
218early_param("pmem_audio_size", pmem_audio_size_setup);
219#endif
220
221#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700222#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700223static struct android_pmem_platform_data android_pmem_pdata = {
224 .name = "pmem",
225 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
226 .cached = 1,
227 .memory_type = MEMTYPE_EBI1,
228};
229
Laura Abbottb93525f2012-04-12 09:57:19 -0700230static struct platform_device msm8960_android_pmem_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700231 .name = "android_pmem",
232 .id = 0,
233 .dev = {.platform_data = &android_pmem_pdata},
234};
235
236static struct android_pmem_platform_data android_pmem_adsp_pdata = {
237 .name = "pmem_adsp",
238 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
239 .cached = 0,
240 .memory_type = MEMTYPE_EBI1,
241};
Laura Abbottb93525f2012-04-12 09:57:19 -0700242static struct platform_device msm8960_android_pmem_adsp_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700243 .name = "android_pmem",
244 .id = 2,
245 .dev = { .platform_data = &android_pmem_adsp_pdata },
246};
247
248static struct android_pmem_platform_data android_pmem_audio_pdata = {
249 .name = "pmem_audio",
250 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
251 .cached = 0,
252 .memory_type = MEMTYPE_EBI1,
253};
254
Laura Abbottb93525f2012-04-12 09:57:19 -0700255static struct platform_device msm8960_android_pmem_audio_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700256 .name = "android_pmem",
257 .id = 4,
258 .dev = { .platform_data = &android_pmem_audio_pdata },
259};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700260#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
261#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700262
Laura Abbottb93525f2012-04-12 09:57:19 -0700263struct fmem_platform_data msm8960_fmem_pdata = {
Larry Bassel41a055b2011-12-06 16:15:14 -0800264};
265
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700266#define DSP_RAM_BASE_8960 0x8da00000
267#define DSP_RAM_SIZE_8960 0x1800000
268static int dspcrashd_pdata_8960 = 0xDEADDEAD;
269
270static struct resource resources_dspcrashd_8960[] = {
271 {
272 .name = "msm_dspcrashd",
273 .start = DSP_RAM_BASE_8960,
274 .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960,
275 .flags = IORESOURCE_DMA,
276 },
277};
278
Stepan Moskovchenkofc70d902011-11-30 12:39:36 -0800279static struct platform_device msm_device_dspcrashd_8960 = {
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -0700280 .name = "msm_dspcrashd",
281 .num_resources = ARRAY_SIZE(resources_dspcrashd_8960),
282 .resource = resources_dspcrashd_8960,
283 .dev = { .platform_data = &dspcrashd_pdata_8960 },
284};
285
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700286static struct memtype_reserve msm8960_reserve_table[] __initdata = {
287 [MEMTYPE_SMI] = {
288 },
289 [MEMTYPE_EBI0] = {
290 .flags = MEMTYPE_FLAGS_1M_ALIGN,
291 },
292 [MEMTYPE_EBI1] = {
293 .flags = MEMTYPE_FLAGS_1M_ALIGN,
294 },
295};
296
Laura Abbottf8c03b92012-02-16 14:57:58 -0800297static void __init reserve_rtb_memory(void)
298{
299#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700300 msm8960_reserve_table[MEMTYPE_EBI1].size += msm8960_rtb_pdata.size;
Laura Abbottf8c03b92012-02-16 14:57:58 -0800301#endif
302}
303
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304static void __init size_pmem_devices(void)
305{
306#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700307#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700308 android_pmem_adsp_pdata.size = pmem_adsp_size;
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800309
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800310 if (!pmem_param_set) {
311 if (machine_is_msm8960_liquid())
312 pmem_size = MSM_LIQUID_PMEM_SIZE;
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700313 if (msm8960_hdmi_as_primary_selected())
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800314 pmem_size = MSM_HDMI_PRIM_PMEM_SIZE;
315 }
316
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700317 android_pmem_pdata.size = pmem_size;
318 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700319#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
320#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700321}
322
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700323#ifdef CONFIG_ANDROID_PMEM
324#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700325static void __init reserve_memory_for(struct android_pmem_platform_data *p)
326{
327 msm8960_reserve_table[p->memory_type].size += p->size;
328}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700329#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
330#endif /*CONFIG_ANDROID_PMEM*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700331
332static void __init reserve_pmem_memory(void)
333{
334#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -0700335#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700336 reserve_memory_for(&android_pmem_adsp_pdata);
337 reserve_memory_for(&android_pmem_pdata);
338 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700339#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700340 msm8960_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
341#endif
342}
343
Larry Basselb4126da2011-07-18 14:31:33 -0700344static int msm8960_paddr_to_memtype(unsigned int paddr)
345{
346 return MEMTYPE_EBI1;
347}
348
Steve Mucklef132c6c2012-06-06 18:30:57 -0700349#define FMEM_ENABLED 0
Olav Hauganf6dc7742012-02-15 09:11:55 -0800350
Laura Abbottd6183792011-08-19 13:42:24 -0700351#ifdef CONFIG_ION_MSM
Olav Haugan0703dbf2011-12-19 17:53:38 -0800352#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700353static struct ion_cp_heap_pdata cp_mm_msm8960_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800354 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugan8726caf2012-05-10 15:11:35 -0700355 .align = SZ_64K,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800356 .reusable = FMEM_ENABLED,
357 .mem_is_fmem = FMEM_ENABLED,
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700358 .fixed_position = FIXED_MIDDLE,
Olav Haugan8726caf2012-05-10 15:11:35 -0700359 .iommu_map_all = 1,
360 .iommu_2x_map_domain = VIDEO_DOMAIN,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800361};
362
Laura Abbottb93525f2012-04-12 09:57:19 -0700363static struct ion_cp_heap_pdata cp_mfc_msm8960_ion_pdata = {
Olav Haugan0703dbf2011-12-19 17:53:38 -0800364 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugan42ebe712012-01-10 16:30:58 -0800365 .align = PAGE_SIZE,
Olav Haugan65f4bd82011-12-13 11:50:08 -0800366 .reusable = 0,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800367 .mem_is_fmem = FMEM_ENABLED,
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700368 .fixed_position = FIXED_HIGH,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800369};
370
Laura Abbottb93525f2012-04-12 09:57:19 -0700371static struct ion_co_heap_pdata co_msm8960_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800372 .adjacent_mem_id = INVALID_HEAP_ID,
373 .align = PAGE_SIZE,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800374 .mem_is_fmem = 0,
Olav Haugan42ebe712012-01-10 16:30:58 -0800375};
376
Laura Abbottb93525f2012-04-12 09:57:19 -0700377static struct ion_co_heap_pdata fw_co_msm8960_ion_pdata = {
Olav Haugan42ebe712012-01-10 16:30:58 -0800378 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
379 .align = SZ_128K,
Olav Hauganf6dc7742012-02-15 09:11:55 -0800380 .mem_is_fmem = FMEM_ENABLED,
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700381 .fixed_position = FIXED_LOW,
Olav Haugan0703dbf2011-12-19 17:53:38 -0800382};
383#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800384
385/**
386 * These heaps are listed in the order they will be allocated. Due to
387 * video hardware restrictions and content protection the FW heap has to
388 * be allocated adjacent (below) the MM heap and the MFC heap has to be
389 * allocated after the MM heap to ensure MFC heap is not more than 256MB
390 * away from the base address of the FW heap.
391 * However, the order of FW heap and MM heap doesn't matter since these
392 * two heaps are taken care of by separate code to ensure they are adjacent
393 * to each other.
394 * Don't swap the order unless you know what you are doing!
395 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700396static struct ion_platform_data msm8960_ion_pdata = {
Laura Abbott2d1760b2011-09-29 21:31:24 -0700397 .nr = MSM_ION_HEAP_NUM,
Laura Abbottd6183792011-08-19 13:42:24 -0700398 .heaps = {
399 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800400 .id = ION_SYSTEM_HEAP_ID,
Laura Abbottd6183792011-08-19 13:42:24 -0700401 .type = ION_HEAP_TYPE_SYSTEM,
Laura Abbottd6183792011-08-19 13:42:24 -0700402 .name = ION_VMALLOC_HEAP_NAME,
403 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700404#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottd6183792011-08-19 13:42:24 -0700405 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800406 .id = ION_CP_MM_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800407 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800408 .name = ION_MM_HEAP_NAME,
409 .size = MSM_ION_MM_SIZE,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700410 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700411 .extra_data = (void *) &cp_mm_msm8960_ion_pdata,
Laura Abbott2d1760b2011-09-29 21:31:24 -0700412 },
Laura Abbott8c017362011-09-22 20:59:12 -0700413 {
Olav Haugan42ebe712012-01-10 16:30:58 -0800414 .id = ION_MM_FIRMWARE_HEAP_ID,
415 .type = ION_HEAP_TYPE_CARVEOUT,
416 .name = ION_MM_FIRMWARE_HEAP_NAME,
417 .size = MSM_ION_MM_FW_SIZE,
418 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700419 .extra_data = (void *) &fw_co_msm8960_ion_pdata,
Olav Haugan42ebe712012-01-10 16:30:58 -0800420 },
421 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800422 .id = ION_CP_MFC_HEAP_ID,
Olav Haugan0a852512012-01-09 10:20:55 -0800423 .type = ION_HEAP_TYPE_CP,
Olav Hauganb5be7992011-11-18 14:29:02 -0800424 .name = ION_MFC_HEAP_NAME,
425 .size = MSM_ION_MFC_SIZE,
426 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700427 .extra_data = (void *) &cp_mfc_msm8960_ion_pdata,
Olav Hauganb5be7992011-11-18 14:29:02 -0800428 },
Olav Haugan32594552012-03-13 11:40:05 -0700429#ifndef CONFIG_MSM_IOMMU
Olav Hauganb5be7992011-11-18 14:29:02 -0800430 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800431 .id = ION_SF_HEAP_ID,
432 .type = ION_HEAP_TYPE_CARVEOUT,
433 .name = ION_SF_HEAP_NAME,
434 .size = MSM_ION_SF_SIZE,
435 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700436 .extra_data = (void *) &co_msm8960_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800437 },
Olav Haugan32594552012-03-13 11:40:05 -0700438#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800439 {
Olav Hauganb5be7992011-11-18 14:29:02 -0800440 .id = ION_IOMMU_HEAP_ID,
Laura Abbott8c017362011-09-22 20:59:12 -0700441 .type = ION_HEAP_TYPE_IOMMU,
442 .name = ION_IOMMU_HEAP_NAME,
443 },
Olav Haugan80854eb2012-01-12 12:00:23 -0800444 {
445 .id = ION_QSECOM_HEAP_ID,
446 .type = ION_HEAP_TYPE_CARVEOUT,
447 .name = ION_QSECOM_HEAP_NAME,
448 .size = MSM_ION_QSECOM_SIZE,
449 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700450 .extra_data = (void *) &co_msm8960_ion_pdata,
Olav Haugan80854eb2012-01-12 12:00:23 -0800451 },
Olav Haugan7355db02012-01-13 16:59:13 -0800452 {
453 .id = ION_AUDIO_HEAP_ID,
454 .type = ION_HEAP_TYPE_CARVEOUT,
455 .name = ION_AUDIO_HEAP_NAME,
456 .size = MSM_ION_AUDIO_SIZE,
457 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700458 .extra_data = (void *) &co_msm8960_ion_pdata,
Olav Haugan7355db02012-01-13 16:59:13 -0800459 },
Laura Abbott2d1760b2011-09-29 21:31:24 -0700460#endif
Laura Abbottd6183792011-08-19 13:42:24 -0700461 }
462};
463
Laura Abbottb93525f2012-04-12 09:57:19 -0700464static struct platform_device msm8960_ion_dev = {
Laura Abbottd6183792011-08-19 13:42:24 -0700465 .name = "ion-msm",
466 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700467 .dev = { .platform_data = &msm8960_ion_pdata },
Laura Abbottd6183792011-08-19 13:42:24 -0700468};
469#endif
470
Laura Abbottb93525f2012-04-12 09:57:19 -0700471struct platform_device msm8960_fmem_device = {
Larry Bassel41a055b2011-12-06 16:15:14 -0800472 .name = "fmem",
473 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700474 .dev = { .platform_data = &msm8960_fmem_pdata },
Larry Bassel41a055b2011-12-06 16:15:14 -0800475};
476
Olav Haugan65f4bd82011-12-13 11:50:08 -0800477static void __init adjust_mem_for_liquid(void)
Laura Abbottd6183792011-08-19 13:42:24 -0700478{
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800479 unsigned int i;
480
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800481 if (!pmem_param_set) {
482 if (machine_is_msm8960_liquid())
483 msm_ion_sf_size = MSM_LIQUID_ION_SF_SIZE;
484
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700485 if (msm8960_hdmi_as_primary_selected())
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800486 msm_ion_sf_size = MSM_HDMI_PRIM_ION_SF_SIZE;
487
Ravishangar Kalyanamfda36c42012-03-26 16:28:19 -0700488 if (machine_is_msm8960_liquid() ||
489 msm8960_hdmi_as_primary_selected()) {
Laura Abbottb93525f2012-04-12 09:57:19 -0700490 for (i = 0; i < msm8960_ion_pdata.nr; i++) {
491 if (msm8960_ion_pdata.heaps[i].id ==
492 ION_SF_HEAP_ID) {
493 msm8960_ion_pdata.heaps[i].size =
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800494 msm_ion_sf_size;
495 pr_debug("msm_ion_sf_size 0x%x\n",
496 msm_ion_sf_size);
497 break;
498 }
Ravishangar Kalyanam671f5ce2011-12-06 20:25:29 -0800499 }
500 }
501 }
Olav Haugan65f4bd82011-12-13 11:50:08 -0800502}
503
504static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
505 unsigned long size)
506{
507 msm8960_reserve_table[mem_type].size += size;
508}
509
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700510static void __init msm8960_reserve_fixed_area(unsigned long fixed_area_size)
511{
512#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
513 int ret;
514
515 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
516 panic("fixed area size is larger than %dM\n",
517 MAX_FIXED_AREA_SIZE >> 20);
518
519 reserve_info->fixed_area_size = fixed_area_size;
520 reserve_info->fixed_area_start = MSM8960_FW_START;
521
522 ret = memblock_remove(reserve_info->fixed_area_start,
523 reserve_info->fixed_area_size);
524 BUG_ON(ret);
525#endif
526}
527
Olav Haugan65f4bd82011-12-13 11:50:08 -0800528/**
529 * Reserve memory for ION and calculate amount of reusable memory for fmem.
530 * We only reserve memory for heaps that are not reusable. However, we only
531 * support one reusable heap at the moment so we ignore the reusable flag for
532 * other than the first heap with reusable flag set. Also handle special case
Olav Hauganf6dc7742012-02-15 09:11:55 -0800533 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
534 * at a higher address than FW in addition to not more than 256MB away from the
535 * base address of the firmware. This means that if MM is reusable the other
536 * two heaps must be allocated in the same region as FW. This is handled by the
537 * mem_is_fmem flag in the platform data. In addition the MM heap must be
538 * adjacent to the FW heap for content protection purposes.
Olav Haugan65f4bd82011-12-13 11:50:08 -0800539 */
540static void __init reserve_ion_memory(void)
541{
542#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
543 unsigned int i;
544 unsigned int reusable_count = 0;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700545 unsigned int fixed_size = 0;
546 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
547 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800548
549 adjust_mem_for_liquid();
Laura Abbottb93525f2012-04-12 09:57:19 -0700550 msm8960_fmem_pdata.size = 0;
551 msm8960_fmem_pdata.reserved_size_low = 0;
552 msm8960_fmem_pdata.reserved_size_high = 0;
Olav Haugan8726caf2012-05-10 15:11:35 -0700553 msm8960_fmem_pdata.align = PAGE_SIZE;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700554 fixed_low_size = 0;
555 fixed_middle_size = 0;
556 fixed_high_size = 0;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800557
558 /* We only support 1 reusable heap. Check if more than one heap
559 * is specified as reusable and set as non-reusable if found.
560 */
Laura Abbottb93525f2012-04-12 09:57:19 -0700561 for (i = 0; i < msm8960_ion_pdata.nr; ++i) {
562 const struct ion_platform_heap *heap =
563 &(msm8960_ion_pdata.heaps[i]);
Olav Haugan65f4bd82011-12-13 11:50:08 -0800564
565 if (heap->type == ION_HEAP_TYPE_CP && heap->extra_data) {
566 struct ion_cp_heap_pdata *data = heap->extra_data;
567
568 reusable_count += (data->reusable) ? 1 : 0;
569
570 if (data->reusable && reusable_count > 1) {
571 pr_err("%s: Too many heaps specified as "
572 "reusable. Heap %s was not configured "
573 "as reusable.\n", __func__, heap->name);
574 data->reusable = 0;
575 }
576 }
577 }
578
Laura Abbottb93525f2012-04-12 09:57:19 -0700579 for (i = 0; i < msm8960_ion_pdata.nr; ++i) {
Olav Haugan8726caf2012-05-10 15:11:35 -0700580 struct ion_platform_heap *heap =
Laura Abbottb93525f2012-04-12 09:57:19 -0700581 &(msm8960_ion_pdata.heaps[i]);
Olav Haugan8726caf2012-05-10 15:11:35 -0700582 int align = SZ_4K;
583 int iommu_map_all = 0;
584 int adjacent_mem_id = INVALID_HEAP_ID;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800585
586 if (heap->extra_data) {
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700587 int fixed_position = NOT_FIXED;
588 int mem_is_fmem = 0;
589
Olav Haugan65f4bd82011-12-13 11:50:08 -0800590 switch (heap->type) {
591 case ION_HEAP_TYPE_CP:
Olav Hauganf6dc7742012-02-15 09:11:55 -0800592 mem_is_fmem = ((struct ion_cp_heap_pdata *)
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700593 heap->extra_data)->mem_is_fmem;
594 fixed_position = ((struct ion_cp_heap_pdata *)
595 heap->extra_data)->fixed_position;
Olav Haugan8726caf2012-05-10 15:11:35 -0700596 align = ((struct ion_cp_heap_pdata *)
597 heap->extra_data)->align;
598 iommu_map_all =
599 ((struct ion_cp_heap_pdata *)
600 heap->extra_data)->iommu_map_all;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800601 break;
602 case ION_HEAP_TYPE_CARVEOUT:
Olav Hauganf6dc7742012-02-15 09:11:55 -0800603 mem_is_fmem = ((struct ion_co_heap_pdata *)
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700604 heap->extra_data)->mem_is_fmem;
605 fixed_position = ((struct ion_co_heap_pdata *)
606 heap->extra_data)->fixed_position;
Olav Haugan8726caf2012-05-10 15:11:35 -0700607 adjacent_mem_id = ((struct ion_co_heap_pdata *)
608 heap->extra_data)->adjacent_mem_id;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700609 break;
610 default:
611 break;
612 }
613
Olav Haugan8726caf2012-05-10 15:11:35 -0700614 if (iommu_map_all) {
615 if (heap->size & (SZ_64K-1)) {
616 heap->size = ALIGN(heap->size, SZ_64K);
617 pr_info("Heap %s not aligned to 64K. Adjusting size to %x\n",
618 heap->name, heap->size);
619 }
620 }
621
622 if (mem_is_fmem && adjacent_mem_id != INVALID_HEAP_ID)
623 msm8960_fmem_pdata.align = align;
624
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700625 if (fixed_position != NOT_FIXED)
626 fixed_size += heap->size;
627 else
628 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
629
630 if (fixed_position == FIXED_LOW)
631 fixed_low_size += heap->size;
632 else if (fixed_position == FIXED_MIDDLE)
633 fixed_middle_size += heap->size;
634 else if (fixed_position == FIXED_HIGH)
635 fixed_high_size += heap->size;
636
637 if (mem_is_fmem)
Laura Abbottb93525f2012-04-12 09:57:19 -0700638 msm8960_fmem_pdata.size += heap->size;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700639 }
640 }
641
642 if (!fixed_size)
643 return;
644
Laura Abbottb93525f2012-04-12 09:57:19 -0700645 if (msm8960_fmem_pdata.size) {
Deepak Kotur35825522012-06-06 15:49:14 -0700646 msm8960_fmem_pdata.reserved_size_low = fixed_low_size +
647 HOLE_SIZE;
Laura Abbottb93525f2012-04-12 09:57:19 -0700648 msm8960_fmem_pdata.reserved_size_high = fixed_high_size;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700649 }
650
Larry Bassel4d4f4482012-04-04 11:26:09 -0700651 /* Since the fixed area may be carved out of lowmem,
652 * make sure the length is a multiple of 1M.
653 */
654 fixed_size = (fixed_size + MSM_MM_FW_SIZE + SECTION_SIZE - 1)
655 & SECTION_MASK;
656 msm8960_reserve_fixed_area(fixed_size);
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700657
658 fixed_low_start = MSM8960_FIXED_AREA_START;
Deepak Kotur35825522012-06-06 15:49:14 -0700659 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700660 fixed_high_start = fixed_middle_start + fixed_middle_size;
661
Laura Abbottb93525f2012-04-12 09:57:19 -0700662 for (i = 0; i < msm8960_ion_pdata.nr; ++i) {
663 struct ion_platform_heap *heap = &(msm8960_ion_pdata.heaps[i]);
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700664
665 if (heap->extra_data) {
666 int fixed_position = NOT_FIXED;
Steve Muckle75c34ca2012-06-12 14:27:40 -0700667 struct ion_cp_heap_pdata *pdata = NULL;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700668
669 switch (heap->type) {
670 case ION_HEAP_TYPE_CP:
Deepak Kotur35825522012-06-06 15:49:14 -0700671 pdata =
672 (struct ion_cp_heap_pdata *)heap->extra_data;
673 fixed_position = pdata->fixed_position;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700674 break;
675 case ION_HEAP_TYPE_CARVEOUT:
676 fixed_position = ((struct ion_co_heap_pdata *)
677 heap->extra_data)->fixed_position;
678 break;
679 default:
680 break;
681 }
682
683 switch (fixed_position) {
684 case FIXED_LOW:
685 heap->base = fixed_low_start;
686 break;
687 case FIXED_MIDDLE:
688 heap->base = fixed_middle_start;
Deepak Kotur35825522012-06-06 15:49:14 -0700689 pdata->secure_base = fixed_middle_start
690 - HOLE_SIZE;
691 pdata->secure_size = HOLE_SIZE + heap->size;
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700692 break;
693 case FIXED_HIGH:
694 heap->base = fixed_high_start;
Olav Haugan65f4bd82011-12-13 11:50:08 -0800695 break;
696 default:
697 break;
698 }
699 }
Olav Haugan65f4bd82011-12-13 11:50:08 -0800700 }
Laura Abbottd6183792011-08-19 13:42:24 -0700701#endif
702}
Huaibin Yanga5419422011-12-08 23:52:10 -0800703
704static void __init reserve_mdp_memory(void)
705{
706 msm8960_mdp_writeback(msm8960_reserve_table);
707}
708
Stephen Boyd668d7652012-04-25 11:31:01 -0700709static void __init reserve_cache_dump_memory(void)
Laura Abbott306bcc22012-03-08 11:24:53 -0800710{
711#ifdef CONFIG_MSM_CACHE_DUMP
Laura Abbott306bcc22012-03-08 11:24:53 -0800712 unsigned int total;
Laura Abbott306bcc22012-03-08 11:24:53 -0800713
Laura Abbott155ab6f2012-05-25 08:52:18 -0700714 total = msm8960_cache_dump_pdata.l1_size +
715 msm8960_cache_dump_pdata.l2_size;
Laura Abbott306bcc22012-03-08 11:24:53 -0800716 msm8960_reserve_table[MEMTYPE_EBI1].size += total;
Laura Abbott306bcc22012-03-08 11:24:53 -0800717#endif
718}
719
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700720static void __init msm8960_calculate_reserve_sizes(void)
721{
722 size_pmem_devices();
723 reserve_pmem_memory();
Laura Abbottd6183792011-08-19 13:42:24 -0700724 reserve_ion_memory();
Huaibin Yanga5419422011-12-08 23:52:10 -0800725 reserve_mdp_memory();
Laura Abbottf8c03b92012-02-16 14:57:58 -0800726 reserve_rtb_memory();
Laura Abbott306bcc22012-03-08 11:24:53 -0800727 reserve_cache_dump_memory();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700728}
729
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700730static struct reserve_info msm8960_reserve_info __initdata = {
731 .memtype_reserve_table = msm8960_reserve_table,
732 .calculate_reserve_sizes = msm8960_calculate_reserve_sizes,
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700733 .reserve_fixed_area = msm8960_reserve_fixed_area,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700734 .paddr_to_memtype = msm8960_paddr_to_memtype,
735};
736
Larry Basselb4126da2011-07-18 14:31:33 -0700737static int msm8960_memory_bank_size(void)
738{
739 return 1<<29;
740}
741
742static void __init locate_unstable_memory(void)
743{
744 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
745 unsigned long bank_size;
746 unsigned long low, high;
747
748 bank_size = msm8960_memory_bank_size();
Larry Bassel4d4f4482012-04-04 11:26:09 -0700749 msm8960_reserve_info.bank_size = bank_size;
750
Larry Basselb4126da2011-07-18 14:31:33 -0700751 low = meminfo.bank[0].start;
752 high = mb->start + mb->size;
Olav Haugan62052e42011-10-28 14:28:32 -0700753
754 /* Check if 32 bit overflow occured */
755 if (high < mb->start)
756 high = ~0UL;
757
Larry Bassel4d4f4482012-04-04 11:26:09 -0700758 if (high < MAX_FIXED_AREA_SIZE + MSM8960_FIXED_AREA_START)
759 panic("fixed area extends beyond end of memory\n");
760
Larry Basselb4126da2011-07-18 14:31:33 -0700761 low &= ~(bank_size - 1);
762
763 if (high - low <= bank_size)
Larry Bassel4d4f4482012-04-04 11:26:09 -0700764 goto no_dmm;
Larry Basselb8d61022012-02-24 10:49:45 -0800765
Larry Basselb8d61022012-02-24 10:49:45 -0800766#ifdef CONFIG_ENABLE_DMM
Jack Cheung60eaeab2012-01-09 16:40:26 -0800767 msm8960_reserve_info.low_unstable_address = mb->start -
768 MIN_MEMORY_BLOCK_SIZE + mb->size;
Jack Cheung0b1987e2011-11-18 13:36:29 -0800769 msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
Larry Basselb4126da2011-07-18 14:31:33 -0700770 pr_info("low unstable address %lx max size %lx bank size %lx\n",
771 msm8960_reserve_info.low_unstable_address,
772 msm8960_reserve_info.max_unstable_size,
773 msm8960_reserve_info.bank_size);
Larry Bassel4d4f4482012-04-04 11:26:09 -0700774 return;
Larry Basselb8d61022012-02-24 10:49:45 -0800775#endif
Larry Bassel4d4f4482012-04-04 11:26:09 -0700776no_dmm:
777 msm8960_reserve_info.low_unstable_address = high;
778 msm8960_reserve_info.max_unstable_size = 0;
Larry Basselb4126da2011-07-18 14:31:33 -0700779}
780
Larry Basselb830e182011-10-14 10:46:55 -0700781static void __init place_movable_zone(void)
782{
Larry Basselb8d61022012-02-24 10:49:45 -0800783#ifdef CONFIG_ENABLE_DMM
Larry Basselb830e182011-10-14 10:46:55 -0700784 movable_reserved_start = msm8960_reserve_info.low_unstable_address;
785 movable_reserved_size = msm8960_reserve_info.max_unstable_size;
786 pr_info("movable zone start %lx size %lx\n",
787 movable_reserved_start, movable_reserved_size);
Larry Basselb8d61022012-02-24 10:49:45 -0800788#endif
Larry Basselb830e182011-10-14 10:46:55 -0700789}
790
791static void __init msm8960_early_memory(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700792{
793 reserve_info = &msm8960_reserve_info;
Larry Basselb4126da2011-07-18 14:31:33 -0700794 locate_unstable_memory();
Larry Basselb830e182011-10-14 10:46:55 -0700795 place_movable_zone();
796}
797
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800798static char prim_panel_name[PANEL_NAME_MAX_LEN];
799static char ext_panel_name[PANEL_NAME_MAX_LEN];
800static int __init prim_display_setup(char *param)
801{
802 if (strnlen(param, PANEL_NAME_MAX_LEN))
803 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
804 return 0;
805}
806early_param("prim_display", prim_display_setup);
807
808static int __init ext_display_setup(char *param)
809{
810 if (strnlen(param, PANEL_NAME_MAX_LEN))
811 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
812 return 0;
813}
814early_param("ext_display", ext_display_setup);
815
Larry Basselb830e182011-10-14 10:46:55 -0700816static void __init msm8960_reserve(void)
817{
Ravishangar Kalyanam8c79ead2011-12-02 21:05:01 -0800818 msm8960_set_display_params(prim_panel_name, ext_panel_name);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700819 msm_reserve();
Laura Abbottb93525f2012-04-12 09:57:19 -0700820 if (msm8960_fmem_pdata.size) {
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700821#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Larry Bassel861985f2012-05-02 15:54:52 -0700822 if (reserve_info->fixed_area_size) {
823 msm8960_fmem_pdata.phys =
824 reserve_info->fixed_area_start + MSM_MM_FW_SIZE;
825 pr_info("mm fw at %lx (fixed) size %x\n",
826 reserve_info->fixed_area_start, MSM_MM_FW_SIZE);
827 pr_info("fmem start %lx (fixed) size %lx\n",
828 msm8960_fmem_pdata.phys,
829 msm8960_fmem_pdata.size);
830 }
Larry Bassel2d8b42d2012-03-12 10:41:26 -0700831#endif
832 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700833}
834
Larry Bassela4414b12011-08-04 11:11:02 -0700835static int msm8960_change_memory_power(u64 start, u64 size,
836 int change_type)
Larry Bassela7eadea2011-07-14 10:46:00 -0700837{
Naveen Ramarajb03bb1b2011-09-12 14:34:31 -0700838 return soc_change_memory_power(start, size, change_type);
Larry Bassela7eadea2011-07-14 10:46:00 -0700839}
840
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700841static void __init msm8960_allocate_memory_regions(void)
842{
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800843 msm8960_allocate_fb_region();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700844}
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -0800845
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700846#ifdef CONFIG_WCD9310_CODEC
847
848#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
849
Patrick Lai3043fba2011-08-01 14:15:57 -0700850/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
851 * 4 micbiases are used to power various analog and digital
852 * microphones operating at 1800 mV. Technically, all micbiases
853 * can source from single cfilter since all microphones operate
854 * at the same voltage level. The arrangement below is to make
855 * sure all cfilters are exercised. LDO_H regulator ouput level
856 * does not need to be as high as 2.85V. It is choosen for
857 * microphone sensitivity purpose.
858 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530859static struct wcd9xxx_pdata tabla_platform_data = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700860 .slimbus_slave_device = {
861 .name = "tabla-slave",
862 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
863 },
864 .irq = MSM_GPIO_TO_INT(62),
865 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530866 .num_irqs = NR_WCD9XXX_IRQS,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700867 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
Patrick Lai3043fba2011-08-01 14:15:57 -0700868 .micbias = {
869 .ldoh_v = TABLA_LDOH_2P85_V,
870 .cfilt1_mv = 1800,
Joonwoo Parkcf473b42012-03-29 19:48:16 -0700871 .cfilt2_mv = 2700,
Patrick Lai3043fba2011-08-01 14:15:57 -0700872 .cfilt3_mv = 1800,
873 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
874 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
875 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
876 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530877 },
878 .regulator = {
879 {
880 .name = "CDC_VDD_CP",
881 .min_uV = 1800000,
882 .max_uV = 1800000,
883 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
884 },
885 {
886 .name = "CDC_VDDA_RX",
887 .min_uV = 1800000,
888 .max_uV = 1800000,
889 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
890 },
891 {
892 .name = "CDC_VDDA_TX",
893 .min_uV = 1800000,
894 .max_uV = 1800000,
895 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
896 },
897 {
898 .name = "VDDIO_CDC",
899 .min_uV = 1800000,
900 .max_uV = 1800000,
901 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
902 },
903 {
904 .name = "VDDD_CDC_D",
905 .min_uV = 1225000,
David Collins8f2a1962012-05-18 09:47:59 -0700906 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530907 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
908 },
909 {
910 .name = "CDC_VDDA_A_1P2V",
911 .min_uV = 1225000,
David Collins8f2a1962012-05-18 09:47:59 -0700912 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530913 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
914 },
915 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700916};
917
918static struct slim_device msm_slim_tabla = {
919 .name = "tabla-slim",
920 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
921 .dev = {
922 .platform_data = &tabla_platform_data,
923 },
924};
Santosh Mardi60e19d92011-10-28 01:15:14 +0530925
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530926static struct wcd9xxx_pdata tabla20_platform_data = {
Santosh Mardi60e19d92011-10-28 01:15:14 +0530927 .slimbus_slave_device = {
928 .name = "tabla-slave",
929 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
930 },
931 .irq = MSM_GPIO_TO_INT(62),
932 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530933 .num_irqs = NR_WCD9XXX_IRQS,
Santosh Mardi60e19d92011-10-28 01:15:14 +0530934 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
935 .micbias = {
936 .ldoh_v = TABLA_LDOH_2P85_V,
937 .cfilt1_mv = 1800,
Joonwoo Parkcf473b42012-03-29 19:48:16 -0700938 .cfilt2_mv = 2700,
Santosh Mardi60e19d92011-10-28 01:15:14 +0530939 .cfilt3_mv = 1800,
940 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
941 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
942 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
943 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530944 },
945 .regulator = {
946 {
947 .name = "CDC_VDD_CP",
948 .min_uV = 1800000,
949 .max_uV = 1800000,
950 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
951 },
952 {
953 .name = "CDC_VDDA_RX",
954 .min_uV = 1800000,
955 .max_uV = 1800000,
956 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
957 },
958 {
959 .name = "CDC_VDDA_TX",
960 .min_uV = 1800000,
961 .max_uV = 1800000,
962 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
963 },
964 {
965 .name = "VDDIO_CDC",
966 .min_uV = 1800000,
967 .max_uV = 1800000,
968 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
969 },
970 {
971 .name = "VDDD_CDC_D",
972 .min_uV = 1225000,
David Collins8f2a1962012-05-18 09:47:59 -0700973 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530974 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
975 },
976 {
977 .name = "CDC_VDDA_A_1P2V",
978 .min_uV = 1225000,
David Collins8f2a1962012-05-18 09:47:59 -0700979 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +0530980 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
981 },
982 },
Santosh Mardi60e19d92011-10-28 01:15:14 +0530983};
984
985static struct slim_device msm_slim_tabla20 = {
986 .name = "tabla2x-slim",
987 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
988 .dev = {
989 .platform_data = &tabla20_platform_data,
990 },
991};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992#endif
993
994static struct slim_boardinfo msm_slim_devices[] = {
995#ifdef CONFIG_WCD9310_CODEC
996 {
997 .bus_num = 1,
998 .slim_slave = &msm_slim_tabla,
999 },
Santosh Mardi60e19d92011-10-28 01:15:14 +05301000 {
1001 .bus_num = 1,
1002 .slim_slave = &msm_slim_tabla20,
1003 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001004#endif
1005 /* add more slimbus slaves as needed */
1006};
1007
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001008#define MSM_WCNSS_PHYS 0x03000000
1009#define MSM_WCNSS_SIZE 0x280000
1010
1011static struct resource resources_wcnss_wlan[] = {
1012 {
1013 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1014 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1015 .name = "wcnss_wlanrx_irq",
1016 .flags = IORESOURCE_IRQ,
1017 },
1018 {
1019 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1020 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1021 .name = "wcnss_wlantx_irq",
1022 .flags = IORESOURCE_IRQ,
1023 },
1024 {
1025 .start = MSM_WCNSS_PHYS,
1026 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1027 .name = "wcnss_mmio",
1028 .flags = IORESOURCE_MEM,
1029 },
Ankur Nandwaniad0d9ac2011-09-26 11:49:25 -07001030 {
1031 .start = 84,
1032 .end = 88,
1033 .name = "wcnss_gpios_5wire",
1034 .flags = IORESOURCE_IO,
1035 },
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001036};
1037
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001038static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1039 .has_48mhz_xo = 1,
1040};
1041
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001042static struct platform_device msm_device_wcnss_wlan = {
1043 .name = "wcnss_wlan",
1044 .id = 0,
1045 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1046 .resource = resources_wcnss_wlan,
Ankur Nandwanib0039b02011-08-09 14:00:45 -07001047 .dev = {.platform_data = &qcom_wcnss_pdata},
Yunsen Wang5c1a7392011-07-09 19:10:16 -07001048};
1049
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001050#ifdef CONFIG_QSEECOM
1051/* qseecom bus scaling */
1052static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1053 {
1054 .src = MSM_BUS_MASTER_SPS,
1055 .dst = MSM_BUS_SLAVE_EBI_CH0,
1056 .ib = 0,
1057 .ab = 0,
1058 },
1059 {
1060 .src = MSM_BUS_MASTER_SPDM,
1061 .dst = MSM_BUS_SLAVE_SPDM,
1062 .ib = 0,
1063 .ab = 0,
1064 },
1065};
1066
1067static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1068 {
1069 .src = MSM_BUS_MASTER_SPS,
1070 .dst = MSM_BUS_SLAVE_EBI_CH0,
1071 .ib = (492 * 8) * 1000000UL,
1072 .ab = (492 * 8) * 100000UL,
1073 },
1074 {
1075 .src = MSM_BUS_MASTER_SPDM,
1076 .dst = MSM_BUS_SLAVE_SPDM,
1077 .ib = 0,
1078 .ab = 0,
1079 },
1080};
1081
1082static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1083 {
1084 .src = MSM_BUS_MASTER_SPS,
1085 .dst = MSM_BUS_SLAVE_EBI_CH0,
1086 .ib = 0,
1087 .ab = 0,
1088 },
1089 {
1090 .src = MSM_BUS_MASTER_SPDM,
1091 .dst = MSM_BUS_SLAVE_SPDM,
1092 .ib = (64 * 8) * 1000000UL,
1093 .ab = (64 * 8) * 100000UL,
1094 },
1095};
1096
1097static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1098 {
1099 ARRAY_SIZE(qseecom_clks_init_vectors),
1100 qseecom_clks_init_vectors,
1101 },
1102 {
1103 ARRAY_SIZE(qseecom_enable_dfab_vectors),
1104 qseecom_enable_sfpb_vectors,
1105 },
1106 {
1107 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1108 qseecom_enable_sfpb_vectors,
1109 },
1110};
1111
1112static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1113 qseecom_hw_bus_scale_usecases,
1114 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1115 .name = "qsee",
1116};
1117
1118static struct platform_device qseecom_device = {
1119 .name = "qseecom",
1120 .id = 0,
1121 .dev = {
1122 .platform_data = &qseecom_bus_pdata,
1123 },
1124};
1125#endif
1126
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001127#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1128 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1129 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1130 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1131
1132#define QCE_SIZE 0x10000
1133#define QCE_0_BASE 0x18500000
1134
1135#define QCE_HW_KEY_SUPPORT 0
1136#define QCE_SHA_HMAC_SUPPORT 1
1137#define QCE_SHARE_CE_RESOURCE 1
1138#define QCE_CE_SHARED 0
1139
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001140/* Begin Bus scaling definitions */
1141static struct msm_bus_vectors crypto_hw_init_vectors[] = {
1142 {
1143 .src = MSM_BUS_MASTER_ADM_PORT0,
1144 .dst = MSM_BUS_SLAVE_EBI_CH0,
1145 .ab = 0,
1146 .ib = 0,
1147 },
1148 {
1149 .src = MSM_BUS_MASTER_ADM_PORT1,
1150 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1151 .ab = 0,
1152 .ib = 0,
1153 },
1154};
1155
1156static struct msm_bus_vectors crypto_hw_active_vectors[] = {
1157 {
1158 .src = MSM_BUS_MASTER_ADM_PORT0,
1159 .dst = MSM_BUS_SLAVE_EBI_CH0,
1160 .ab = 70000000UL,
1161 .ib = 70000000UL,
1162 },
1163 {
1164 .src = MSM_BUS_MASTER_ADM_PORT1,
1165 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1166 .ab = 2480000000UL,
1167 .ib = 2480000000UL,
1168 },
1169};
1170
1171static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = {
1172 {
1173 ARRAY_SIZE(crypto_hw_init_vectors),
1174 crypto_hw_init_vectors,
1175 },
1176 {
1177 ARRAY_SIZE(crypto_hw_active_vectors),
1178 crypto_hw_active_vectors,
1179 },
1180};
1181
1182static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = {
1183 crypto_hw_bus_scale_usecases,
1184 ARRAY_SIZE(crypto_hw_bus_scale_usecases),
1185 .name = "cryptohw",
1186};
1187/* End Bus Scaling Definitions*/
1188
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001189static struct resource qcrypto_resources[] = {
1190 [0] = {
1191 .start = QCE_0_BASE,
1192 .end = QCE_0_BASE + QCE_SIZE - 1,
1193 .flags = IORESOURCE_MEM,
1194 },
1195 [1] = {
1196 .name = "crypto_channels",
1197 .start = DMOV_CE_IN_CHAN,
1198 .end = DMOV_CE_OUT_CHAN,
1199 .flags = IORESOURCE_DMA,
1200 },
1201 [2] = {
1202 .name = "crypto_crci_in",
1203 .start = DMOV_CE_IN_CRCI,
1204 .end = DMOV_CE_IN_CRCI,
1205 .flags = IORESOURCE_DMA,
1206 },
1207 [3] = {
1208 .name = "crypto_crci_out",
1209 .start = DMOV_CE_OUT_CRCI,
1210 .end = DMOV_CE_OUT_CRCI,
1211 .flags = IORESOURCE_DMA,
1212 },
1213};
1214
1215static struct resource qcedev_resources[] = {
1216 [0] = {
1217 .start = QCE_0_BASE,
1218 .end = QCE_0_BASE + QCE_SIZE - 1,
1219 .flags = IORESOURCE_MEM,
1220 },
1221 [1] = {
1222 .name = "crypto_channels",
1223 .start = DMOV_CE_IN_CHAN,
1224 .end = DMOV_CE_OUT_CHAN,
1225 .flags = IORESOURCE_DMA,
1226 },
1227 [2] = {
1228 .name = "crypto_crci_in",
1229 .start = DMOV_CE_IN_CRCI,
1230 .end = DMOV_CE_IN_CRCI,
1231 .flags = IORESOURCE_DMA,
1232 },
1233 [3] = {
1234 .name = "crypto_crci_out",
1235 .start = DMOV_CE_OUT_CRCI,
1236 .end = DMOV_CE_OUT_CRCI,
1237 .flags = IORESOURCE_DMA,
1238 },
1239};
1240
1241#endif
1242
1243#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1244 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1245
1246static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1247 .ce_shared = QCE_CE_SHARED,
1248 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1249 .hw_key_support = QCE_HW_KEY_SUPPORT,
1250 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001251 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001252};
1253
1254static struct platform_device qcrypto_device = {
1255 .name = "qcrypto",
1256 .id = 0,
1257 .num_resources = ARRAY_SIZE(qcrypto_resources),
1258 .resource = qcrypto_resources,
1259 .dev = {
1260 .coherent_dma_mask = DMA_BIT_MASK(32),
1261 .platform_data = &qcrypto_ce_hw_suppport,
1262 },
1263};
1264#endif
1265
1266#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1267 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1268
1269static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1270 .ce_shared = QCE_CE_SHARED,
1271 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1272 .hw_key_support = QCE_HW_KEY_SUPPORT,
1273 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001274 .bus_scale_table = &crypto_hw_bus_scale_pdata,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001275};
1276
1277static struct platform_device qcedev_device = {
1278 .name = "qce",
1279 .id = 0,
1280 .num_resources = ARRAY_SIZE(qcedev_resources),
1281 .resource = qcedev_resources,
1282 .dev = {
1283 .coherent_dma_mask = DMA_BIT_MASK(32),
1284 .platform_data = &qcedev_ce_hw_suppport,
1285 },
1286};
1287#endif
1288
Joel King0cbf5d82012-05-24 15:21:38 -07001289static struct mdm_platform_data sglte_platform_data = {
1290 .mdm_version = "4.0",
1291 .ramdump_delay_ms = 1000,
Joel King63ce8332012-06-01 09:59:26 -07001292 .soft_reset_inverted = 1,
Joel King0cbf5d82012-05-24 15:21:38 -07001293 .peripheral_platform_device = NULL,
Ameya Thakurc9a7a842012-06-24 22:47:52 -07001294 .ramdump_timeout_ms = 600000,
Ameya Thakura98bde52012-06-28 18:55:19 -07001295 .no_powerdown_after_ramdumps = 1,
Ameya Thakur43248fd2012-07-10 18:50:52 -07001296 .image_upgrade_supported = 1,
Joel Kingb8352a12011-11-15 18:46:24 -08001297};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001298
Joel Nider266a2642011-10-16 10:58:05 +02001299#define MSM_TSIF0_PHYS (0x18200000)
1300#define MSM_TSIF1_PHYS (0x18201000)
1301#define MSM_TSIF_SIZE (0x200)
1302#define MSM_TSPP_PHYS (0x18202000)
1303#define MSM_TSPP_SIZE (0x1000)
1304#define MSM_TSPP_BAM_PHYS (0x18204000)
1305#define MSM_TSPP_BAM_SIZE (0x2000)
1306
1307#define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \
1308 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1309#define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \
1310 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1311#define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \
1312 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1313#define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \
1314 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1315#define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \
1316 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1317#define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \
1318 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1319#define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \
1320 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1321#define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \
1322 GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA)
1323
1324static const struct msm_gpio tsif_gpios[] = {
1325 { .gpio_cfg = TSIF_0_CLK, .label = "tsif0_clk", },
1326 { .gpio_cfg = TSIF_0_EN, .label = "tsif0_en", },
1327 { .gpio_cfg = TSIF_0_DATA, .label = "tsif0_data", },
1328 { .gpio_cfg = TSIF_0_SYNC, .label = "tsif0_sync", },
1329 { .gpio_cfg = TSIF_1_CLK, .label = "tsif1_clk", },
1330 { .gpio_cfg = TSIF_1_EN, .label = "tsif1_en", },
1331 { .gpio_cfg = TSIF_1_DATA, .label = "tsif1_data", },
1332 { .gpio_cfg = TSIF_1_SYNC, .label = "tsif1_sync", },
1333};
1334
1335static struct resource tspp_resources[] = {
1336 [0] = {
1337 .flags = IORESOURCE_IRQ,
1338 .start = TSIF_TSPP_IRQ,
1339 .end = TSIF1_IRQ,
1340 },
1341 [1] = {
1342 .flags = IORESOURCE_MEM,
1343 .start = MSM_TSIF0_PHYS,
1344 .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1,
1345 },
1346 [2] = {
1347 .flags = IORESOURCE_MEM,
1348 .start = MSM_TSIF1_PHYS,
1349 .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1,
1350 },
1351 [3] = {
1352 .flags = IORESOURCE_MEM,
1353 .start = MSM_TSPP_PHYS,
1354 .end = MSM_TSPP_PHYS + MSM_TSPP_SIZE - 1,
1355 },
1356 [4] = {
1357 .flags = IORESOURCE_MEM,
1358 .start = MSM_TSPP_BAM_PHYS,
1359 .end = MSM_TSPP_BAM_PHYS + MSM_TSPP_BAM_SIZE - 1,
1360 },
1361};
1362
1363static struct msm_tspp_platform_data tspp_platform_data = {
1364 .num_gpios = ARRAY_SIZE(tsif_gpios),
1365 .gpios = tsif_gpios,
1366 .tsif_pclk = "tsif_pclk",
1367 .tsif_ref_clk = "tsif_ref_clk",
1368};
1369
1370static struct platform_device msm_device_tspp = {
1371 .name = "msm_tspp",
1372 .id = 0,
1373 .num_resources = ARRAY_SIZE(tspp_resources),
1374 .resource = tspp_resources,
1375 .dev = {
1376 .platform_data = &tspp_platform_data
1377 },
1378};
1379
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001380#define MSM_SHARED_RAM_PHYS 0x80000000
1381
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001382static void __init msm8960_map_io(void)
1383{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001384 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001385 msm_map_msm8960_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001386
1387 if (socinfo_init() < 0)
1388 pr_err("socinfo_init() failed!\n");
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001389}
1390
1391static void __init msm8960_init_irq(void)
1392{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001393 struct msm_mpm_device_data *data = NULL;
1394
1395#ifdef CONFIG_MSM_MPM
1396 data = &msm8960_mpm_dev_data;
1397#endif
1398
1399 msm_mpm_irq_extn_init(data);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001400 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001401 (void *)MSM_QGIC_CPU_BASE);
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08001402}
1403
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001404static void __init msm8960_init_buses(void)
1405{
1406#ifdef CONFIG_MSM_BUS_SCALING
Gagan Macdc1dc142011-09-16 15:13:35 -06001407 msm_bus_rpm_set_mt_mask();
Gagan Macae154c4b2011-10-05 19:24:43 -06001408 msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1;
1409 msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1;
1410 msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1;
1411 msm_bus_apps_fabric.dev.platform_data =
1412 &msm_bus_8960_apps_fabric_pdata;
1413 msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata;
1414 msm_bus_mm_fabric.dev.platform_data = &msm_bus_8960_mm_fabric_pdata;
1415 msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata;
1416 msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001417#endif
1418}
1419
1420static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = {
1421 .max_clock_speed = 15060000,
Kiran Gundae8f16742012-06-27 10:06:32 +05301422 .infinite_mode = 1
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001423};
1424
1425#ifdef CONFIG_USB_MSM_OTG_72K
1426static struct msm_otg_platform_data msm_otg_pdata;
1427#else
Anji jonnalaa8b8d732011-12-06 10:03:24 +05301428static int wr_phy_init_seq[] = {
1429 0x44, 0x80, /* set VBUS valid threshold
1430 and disconnect valid threshold */
1431 0x38, 0x81, /* update DC voltage level */
1432 0x14, 0x82, /* set preemphasis and rise/fall time */
1433 0x13, 0x83, /* set source impedance adjusment */
1434 -1};
1435
1436static int liquid_v1_phy_init_seq[] = {
1437 0x44, 0x80,/* set VBUS valid threshold
1438 and disconnect valid threshold */
1439 0x3C, 0x81,/* update DC voltage level */
1440 0x18, 0x82,/* set preemphasis and rise/fall time */
1441 0x23, 0x83,/* set source impedance sdjusment */
1442 -1};
1443
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301444#ifdef CONFIG_MSM_BUS_SCALING
1445/* Bandwidth requests (zero) if no vote placed */
1446static struct msm_bus_vectors usb_init_vectors[] = {
1447 {
1448 .src = MSM_BUS_MASTER_SPS,
1449 .dst = MSM_BUS_SLAVE_EBI_CH0,
1450 .ab = 0,
1451 .ib = 0,
1452 },
1453};
1454
1455/* Bus bandwidth requests in Bytes/sec */
1456static struct msm_bus_vectors usb_max_vectors[] = {
1457 {
1458 .src = MSM_BUS_MASTER_SPS,
1459 .dst = MSM_BUS_SLAVE_EBI_CH0,
1460 .ab = 60000000, /* At least 480Mbps on bus. */
1461 .ib = 960000000, /* MAX bursts rate */
1462 },
1463};
1464
1465static struct msm_bus_paths usb_bus_scale_usecases[] = {
1466 {
1467 ARRAY_SIZE(usb_init_vectors),
1468 usb_init_vectors,
1469 },
1470 {
1471 ARRAY_SIZE(usb_max_vectors),
1472 usb_max_vectors,
1473 },
1474};
1475
1476static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
1477 usb_bus_scale_usecases,
1478 ARRAY_SIZE(usb_bus_scale_usecases),
1479 .name = "usb",
1480};
1481#endif
1482
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001483static struct msm_otg_platform_data msm_otg_pdata = {
1484 .mode = USB_OTG,
1485 .otg_control = OTG_PMIC_CONTROL,
1486 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001487 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
Anji jonnala4e3e6772011-09-15 18:53:42 +05301488 .power_budget = 750,
Manu Gautamcd82e9d2011-12-20 14:17:28 +05301489#ifdef CONFIG_MSM_BUS_SCALING
1490 .bus_scale_table = &usb_bus_scale_pdata,
1491#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001492};
1493#endif
1494
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301495#ifdef CONFIG_USB_EHCI_MSM_HSIC
Vijayavardhan Vennapusa2b592824f2011-11-02 19:51:32 +05301496#define HSIC_HUB_RESET_GPIO 91
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301497static struct msm_hsic_host_platform_data msm_hsic_pdata = {
1498 .strobe = 150,
1499 .data = 151,
1500};
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05301501
1502static struct smsc_hub_platform_data hsic_hub_pdata = {
1503 .hub_reset = HSIC_HUB_RESET_GPIO,
1504};
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301505#else
1506static struct msm_hsic_host_platform_data msm_hsic_pdata;
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05301507static struct smsc_hub_platform_data hsic_hub_pdata;
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05301508#endif
1509
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05301510static struct platform_device smsc_hub_device = {
1511 .name = "msm_smsc_hub",
1512 .id = -1,
1513 .dev = {
1514 .platform_data = &hsic_hub_pdata,
1515 },
1516};
1517
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001518#define PID_MAGIC_ID 0x71432909
1519#define SERIAL_NUM_MAGIC_ID 0x61945374
1520#define SERIAL_NUMBER_LENGTH 127
1521#define DLOAD_USB_BASE_ADD 0x2A03F0C8
1522
1523struct magic_num_struct {
1524 uint32_t pid;
1525 uint32_t serial_num;
1526};
1527
1528struct dload_struct {
1529 uint32_t reserved1;
1530 uint32_t reserved2;
1531 uint32_t reserved3;
1532 uint16_t reserved4;
1533 uint16_t pid;
1534 char serial_number[SERIAL_NUMBER_LENGTH];
1535 uint16_t reserved5;
1536 struct magic_num_struct magic_struct;
1537};
1538
1539static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
1540{
1541 struct dload_struct __iomem *dload = 0;
1542
1543 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
1544 if (!dload) {
1545 pr_err("%s: cannot remap I/O memory region: %08x\n",
1546 __func__, DLOAD_USB_BASE_ADD);
1547 return -ENXIO;
1548 }
1549
1550 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
1551 __func__, dload, pid, snum);
1552 /* update pid */
1553 dload->magic_struct.pid = PID_MAGIC_ID;
1554 dload->pid = pid;
1555
1556 /* update serial number */
1557 dload->magic_struct.serial_num = 0;
1558 if (!snum) {
1559 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
1560 goto out;
1561 }
1562
1563 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
Jin Honge49b1482011-10-03 11:15:50 -07001564 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001565out:
1566 iounmap(dload);
1567 return 0;
1568}
1569
1570static struct android_usb_platform_data android_usb_pdata = {
1571 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
1572};
1573
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001574static struct platform_device android_usb_device = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001575 .name = "android_usb",
1576 .id = -1,
1577 .dev = {
1578 .platform_data = &android_usb_pdata,
1579 },
1580};
1581
1582static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1583 0x03, 0x0f,
1584};
1585
1586static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1587 0x00, 0x24, 0x54, 0x10,
1588 0x09, 0x03, 0x01,
1589 0x10, 0x54, 0x30, 0x0C,
1590 0x24, 0x30, 0x0f,
1591};
1592
1593static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1594 0x00, 0x24, 0x54, 0x10,
1595 0x09, 0x07, 0x01, 0x0B,
1596 0x10, 0x54, 0x30, 0x0C,
1597 0x24, 0x30, 0x0f,
1598};
1599
1600static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1601 [0] = {
1602 .mode = MSM_SPM_MODE_CLOCK_GATING,
1603 .notify_rpm = false,
1604 .cmd = spm_wfi_cmd_sequence,
1605 },
1606 [1] = {
1607 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1608 .notify_rpm = false,
1609 .cmd = spm_power_collapse_without_rpm,
1610 },
1611 [2] = {
1612 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1613 .notify_rpm = true,
1614 .cmd = spm_power_collapse_with_rpm,
1615 },
1616};
1617
1618static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1619 [0] = {
1620 .reg_base_addr = MSM_SAW0_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001621 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001622#if defined(CONFIG_MSM_AVS_HW)
1623 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1624 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1625#endif
1626 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001627 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001628 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1629 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1630 .vctl_timeout_us = 50,
1631 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1632 .modes = msm_spm_seq_list,
1633 },
1634 [1] = {
1635 .reg_base_addr = MSM_SAW1_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001636 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001637#if defined(CONFIG_MSM_AVS_HW)
1638 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1639 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1640#endif
1641 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001642 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001643 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1644 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1645 .vctl_timeout_us = 50,
1646 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1647 .modes = msm_spm_seq_list,
1648 },
1649};
1650
1651static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1652 0x00, 0x20, 0x03, 0x20,
1653 0x00, 0x0f,
1654};
1655
1656static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1657 0x00, 0x20, 0x34, 0x64,
1658 0x48, 0x07, 0x48, 0x20,
1659 0x50, 0x64, 0x04, 0x34,
1660 0x50, 0x0f,
1661};
1662static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1663 0x00, 0x10, 0x34, 0x64,
1664 0x48, 0x07, 0x48, 0x10,
1665 0x50, 0x64, 0x04, 0x34,
1666 0x50, 0x0F,
1667};
1668
1669static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1670 [0] = {
1671 .mode = MSM_SPM_L2_MODE_RETENTION,
1672 .notify_rpm = false,
1673 .cmd = l2_spm_wfi_cmd_sequence,
1674 },
1675 [1] = {
1676 .mode = MSM_SPM_L2_MODE_GDHS,
1677 .notify_rpm = true,
1678 .cmd = l2_spm_gdhs_cmd_sequence,
1679 },
1680 [2] = {
1681 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1682 .notify_rpm = true,
1683 .cmd = l2_spm_power_off_cmd_sequence,
1684 },
1685};
1686
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001687static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1688 [0] = {
1689 .reg_base_addr = MSM_SAW_L2_BASE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001690 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07001691 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001692 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1693 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1694 .modes = msm_spm_l2_seq_list,
1695 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1696 },
1697};
1698
Mohan Pallaka5e490392011-09-09 15:18:41 +05301699#define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1700#define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
1701
1702static struct msm_xo_voter *xo_handle_d1;
1703
1704static int isa1200_power(int on)
1705{
1706 int rc = 0;
1707
1708 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !!on);
1709
1710 rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) :
1711 msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF);
1712 if (rc < 0) {
1713 pr_err("%s: failed to %svote for TCXO D1 buffer%d\n",
1714 __func__, on ? "" : "de-", rc);
1715 goto err_xo_vote;
1716 }
1717
1718 return 0;
1719
1720err_xo_vote:
1721 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, !on);
1722 return rc;
1723}
1724
1725static int isa1200_dev_setup(bool enable)
1726{
1727 int rc = 0;
1728
1729 struct pm_gpio hap_gpio_config = {
1730 .direction = PM_GPIO_DIR_OUT,
1731 .pull = PM_GPIO_PULL_NO,
1732 .out_strength = PM_GPIO_STRENGTH_HIGH,
1733 .function = PM_GPIO_FUNC_NORMAL,
1734 .inv_int_pol = 0,
1735 .vin_sel = 2,
1736 .output_buffer = PM_GPIO_OUT_BUF_CMOS,
1737 .output_value = 0,
1738 };
1739
1740 if (enable == true) {
1741 rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config);
1742 if (rc) {
1743 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1744 __func__, PM_HAP_EN_GPIO, rc);
1745 return rc;
1746 }
1747
1748 rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config);
1749 if (rc) {
1750 pr_err("%s: pm8921 gpio %d config failed(%d)\n",
1751 __func__, PM_HAP_LEN_GPIO, rc);
1752 return rc;
1753 }
1754
1755 rc = gpio_request(HAP_SHIFT_LVL_OE_GPIO, "hap_shft_lvl_oe");
1756 if (rc) {
1757 pr_err("%s: unable to request gpio %d (%d)\n",
1758 __func__, HAP_SHIFT_LVL_OE_GPIO, rc);
1759 return rc;
1760 }
1761
1762 rc = gpio_direction_output(HAP_SHIFT_LVL_OE_GPIO, 0);
1763 if (rc) {
1764 pr_err("%s: Unable to set direction\n", __func__);
1765 goto free_gpio;
1766 }
1767
1768 xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200");
1769 if (IS_ERR(xo_handle_d1)) {
1770 rc = PTR_ERR(xo_handle_d1);
1771 pr_err("%s: failed to get the handle for D1(%d)\n",
1772 __func__, rc);
1773 goto gpio_set_dir;
1774 }
1775 } else {
1776 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1777
1778 msm_xo_put(xo_handle_d1);
1779 }
1780
1781 return 0;
1782
1783gpio_set_dir:
1784 gpio_set_value(HAP_SHIFT_LVL_OE_GPIO, 0);
1785free_gpio:
1786 gpio_free(HAP_SHIFT_LVL_OE_GPIO);
1787 return rc;
1788}
1789
1790static struct isa1200_regulator isa1200_reg_data[] = {
1791 {
1792 .name = "vcc_i2c",
1793 .min_uV = ISA_I2C_VTG_MIN_UV,
1794 .max_uV = ISA_I2C_VTG_MAX_UV,
1795 .load_uA = ISA_I2C_CURR_UA,
1796 },
1797};
1798
1799static struct isa1200_platform_data isa1200_1_pdata = {
1800 .name = "vibrator",
1801 .dev_setup = isa1200_dev_setup,
1802 .power_on = isa1200_power,
1803 .hap_en_gpio = PM_HAP_EN_GPIO,
1804 .hap_len_gpio = PM_HAP_LEN_GPIO,
1805 .max_timeout = 15000,
1806 .mode_ctrl = PWM_GEN_MODE,
1807 .pwm_fd = {
1808 .pwm_div = 256,
1809 },
1810 .is_erm = false,
1811 .smart_en = true,
1812 .ext_clk_en = true,
1813 .chip_en = 1,
1814 .regulator_info = isa1200_reg_data,
1815 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1816};
1817
1818static struct i2c_board_info msm_isa1200_board_info[] __initdata = {
1819 {
1820 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
Mohan Pallaka5e490392011-09-09 15:18:41 +05301821 },
1822};
1823
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001824#define CYTTSP_TS_GPIO_IRQ 11
1825#define CYTTSP_TS_SLEEP_GPIO 50
1826#define CYTTSP_TS_RESOUT_N_GPIO 52
1827
1828/*virtual key support */
1829static ssize_t tma340_vkeys_show(struct kobject *kobj,
1830 struct kobj_attribute *attr, char *buf)
1831{
1832 return snprintf(buf, 200,
1833 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1834 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1835 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1836 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1837 "\n");
1838}
1839
1840static struct kobj_attribute tma340_vkeys_attr = {
1841 .attr = {
1842 .mode = S_IRUGO,
1843 },
1844 .show = &tma340_vkeys_show,
1845};
1846
1847static struct attribute *tma340_properties_attrs[] = {
1848 &tma340_vkeys_attr.attr,
1849 NULL
1850};
1851
1852static struct attribute_group tma340_properties_attr_group = {
1853 .attrs = tma340_properties_attrs,
1854};
1855
1856
1857static int cyttsp_platform_init(struct i2c_client *client)
1858{
1859 int rc = 0;
1860 static struct kobject *tma340_properties_kobj;
1861
1862 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1863 tma340_properties_kobj = kobject_create_and_add("board_properties",
1864 NULL);
1865 if (tma340_properties_kobj)
1866 rc = sysfs_create_group(tma340_properties_kobj,
1867 &tma340_properties_attr_group);
1868 if (!tma340_properties_kobj || rc)
1869 pr_err("%s: failed to create board_properties\n",
1870 __func__);
1871
1872 return 0;
1873}
1874
1875static struct cyttsp_regulator regulator_data[] = {
1876 {
1877 .name = "vdd",
1878 .min_uV = CY_TMA300_VTG_MIN_UV,
1879 .max_uV = CY_TMA300_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301880 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1881 .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001882 },
1883 /* TODO: Remove after runtime PM is enabled in I2C driver */
1884 {
1885 .name = "vcc_i2c",
1886 .min_uV = CY_I2C_VTG_MIN_UV,
1887 .max_uV = CY_I2C_VTG_MAX_UV,
Anirudh Ghayalf9929b12011-09-07 15:57:36 +05301888 .hpm_load_uA = CY_I2C_CURR_UA,
1889 .lpm_load_uA = CY_I2C_SLEEP_CURR_UA,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001890 },
1891};
1892
1893static struct cyttsp_platform_data cyttsp_pdata = {
1894 .panel_maxx = 634,
1895 .panel_maxy = 1166,
1896 .disp_maxx = 616,
1897 .disp_maxy = 1023,
1898 .disp_minx = 0,
1899 .disp_miny = 16,
1900 .flags = 0x01,
1901 .gen = CY_GEN3, /* or */
1902 .use_st = CY_USE_ST,
1903 .use_mt = CY_USE_MT,
1904 .use_hndshk = CY_SEND_HNDSHK,
1905 .use_trk_id = CY_USE_TRACKING_ID,
Anirudh Ghayale96f66d2011-08-11 14:06:38 +05301906 .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001907 .use_gestures = CY_USE_GESTURES,
1908 .fw_fname = "cyttsp_8960_cdp.hex",
1909 /* activate up to 4 groups
1910 * and set active distance
1911 */
1912 .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 |
1913 CY_GEST_GRP3 | CY_GEST_GRP4 |
1914 CY_ACT_DIST,
Amy Maloche7b741b22012-06-14 14:37:22 -07001915 .act_intrvl = 10,
1916 .tch_tmout = 200,
1917 .lp_intrvl = 30,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001918 .sleep_gpio = CYTTSP_TS_SLEEP_GPIO,
1919 .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO,
1920 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1921 .regulator_info = regulator_data,
1922 .num_regulators = ARRAY_SIZE(regulator_data),
1923 .init = cyttsp_platform_init,
Mohan Pallaka49c37d62011-08-01 11:52:00 +05301924 .correct_fw_ver = 9,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001925};
1926
1927static struct i2c_board_info cyttsp_info[] __initdata = {
1928 {
1929 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1930 .platform_data = &cyttsp_pdata,
1931#ifndef CY_USE_TIMER
1932 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1933#endif /* CY_USE_TIMER */
1934 },
1935};
1936
Jing Lindc4413c2012-01-16 15:22:52 -08001937/* configuration data for mxt1386 */
1938static const u8 mxt1386_config_data[] = {
Mohan Pallaka50837382011-09-07 11:00:57 +05301939 /* T6 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001940 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301941 /* T38 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001942 11, 2, 0, 11, 11, 11, 0, 0, 0, 0,
Jing Lin2f863172011-10-17 10:56:58 -07001943 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1944 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1945 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1946 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1947 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1948 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301949 /* T7 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001950 100, 16, 50,
Mohan Pallaka50837382011-09-07 11:00:57 +05301951 /* T8 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001952 8, 0, 0, 0, 0, 0, 8, 14, 50, 215,
Mohan Pallaka50837382011-09-07 11:00:57 +05301953 /* T9 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001954 131, 0, 0, 26, 42, 0, 32, 63, 3, 5,
1955 0, 2, 1, 113, 10, 10, 8, 10, 255, 2,
1956 85, 5, 0, 0, 20, 20, 75, 25, 202, 29,
1957 10, 10, 45, 46,
Mohan Pallaka50837382011-09-07 11:00:57 +05301958 /* T15 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001959 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1960 0,
Anirudh Ghayaldab4e0d2012-01-09 14:59:27 +05301961 /* T18 Object */
1962 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301963 /* T22 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001964 5, 0, 0, 0, 0, 0, 0, 0, 30, 0,
1965 0, 0, 5, 8, 10, 13, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301966 /* T24 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001967 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1968 0, 0, 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301969 /* T25 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001970 3, 0, 188, 52, 52, 33, 0, 0, 0, 0,
1971 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301972 /* T27 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001973 0, 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301974 /* T28 Object */
Jing Lin93f07082011-11-11 15:53:54 -08001975 0, 0, 0, 8, 12, 60,
Mohan Pallaka50837382011-09-07 11:00:57 +05301976 /* T40 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001977 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301978 /* T41 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001979 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301980 /* T43 Object */
Jing Lin2f863172011-10-17 10:56:58 -07001981 0, 0, 0, 0, 0, 0,
Mohan Pallaka50837382011-09-07 11:00:57 +05301982};
1983
Jing Lin33b007d2011-12-21 17:40:23 -08001984/* configuration data for mxt1386e using V1.0 firmware */
1985static const u8 mxt1386e_config_data_v1_0[] = {
1986 /* T6 Object */
1987 0, 0, 0, 0, 0, 0,
1988 /* T38 Object */
1989 12, 1, 0, 17, 1, 12, 0, 0, 0, 0,
1990 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1991 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1993 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1995 0, 0, 0, 0,
1996 /* T7 Object */
1997 100, 16, 50,
1998 /* T8 Object */
1999 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
2000 /* T9 Object */
2001 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
2002 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
2003 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
2004 10, 5, 0, 0, 0,
2005 /* T18 Object */
2006 0, 0,
2007 /* T24 Object */
2008 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2009 0, 0, 0, 0, 0, 0, 0, 0, 0,
2010 /* T25 Object */
2011 3, 0, 60, 115, 156, 99,
2012 /* T27 Object */
2013 0, 0, 0, 0, 0, 0, 0,
2014 /* T40 Object */
2015 0, 0, 0, 0, 0,
2016 /* T42 Object */
2017 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
2018 /* T43 Object */
2019 0, 0, 0, 0, 0, 0, 0,
2020 /* T46 Object */
2021 64, 0, 20, 20, 0, 0, 0, 0, 0,
2022 /* T47 Object */
2023 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
2024 /* T48 Object */
2025 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
2026 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
2027 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
2028 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
2029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2030 0, 0, 0, 0,
2031 /* T56 Object */
2032 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2033 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2034 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2036 2, 99, 33,
2037};
2038
2039/* configuration data for mxt1386e using V2.1 firmware */
2040static const u8 mxt1386e_config_data_v2_1[] = {
2041 /* T6 Object */
2042 0, 0, 0, 0, 0, 0,
2043 /* T38 Object */
Jing Lina0bc4102012-07-06 17:03:45 -07002044 12, 4, 0, 5, 7, 12, 0, 0, 0, 0,
Jing Lin33b007d2011-12-21 17:40:23 -08002045 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2048 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2049 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2050 0, 0, 0, 0,
2051 /* T7 Object */
2052 100, 16, 50,
2053 /* T8 Object */
2054 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
2055 /* T9 Object */
Jing Lin763f4772012-05-25 13:39:40 -07002056 139, 0, 0, 26, 42, 0, 32, 80, 2, 5,
Jing Lina0bc4102012-07-06 17:03:45 -07002057 0, 5, 5, 79, 10, 30, 10, 10, 255, 2,
Jing Lin33b007d2011-12-21 17:40:23 -08002058 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
2059 10, 5, 0, 0, 0,
2060 /* T18 Object */
2061 0, 0,
2062 /* T24 Object */
2063 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2064 0, 0, 0, 0, 0, 0, 0, 0, 0,
2065 /* T25 Object */
Jing Lin763f4772012-05-25 13:39:40 -07002066 1, 0, 60, 115, 156, 99,
Jing Lin33b007d2011-12-21 17:40:23 -08002067 /* T27 Object */
2068 0, 0, 0, 0, 0, 0, 0,
2069 /* T40 Object */
2070 0, 0, 0, 0, 0,
2071 /* T42 Object */
Jing Lin763f4772012-05-25 13:39:40 -07002072 0, 0, 255, 0, 255, 0, 0, 0, 0, 0,
Jing Lin33b007d2011-12-21 17:40:23 -08002073 /* T43 Object */
2074 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
2075 16,
2076 /* T46 Object */
Jing Lina0bc4102012-07-06 17:03:45 -07002077 64, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin33b007d2011-12-21 17:40:23 -08002078 /* T47 Object */
2079 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
2080 /* T48 Object */
Jing Lin763f4772012-05-25 13:39:40 -07002081 1, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Lin33b007d2011-12-21 17:40:23 -08002082 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
2083 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
2084 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
2085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2086 0, 0, 0, 0,
2087 /* T56 Object */
2088 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2090 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2092 2, 99, 33, 0, 149, 24, 193, 255, 255, 255,
2093 255,
2094};
2095
Jing Lineec88ca2012-02-08 11:18:30 -08002096/* configuration data for mxt1386e on 3D SKU using V2.1 firmware */
2097static const u8 mxt1386e_config_data_3d[] = {
2098 /* T6 Object */
2099 0, 0, 0, 0, 0, 0,
2100 /* T38 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002101 13, 1, 0, 23, 2, 12, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2105 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2107 0, 0, 0, 0,
2108 /* T7 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002109 100, 10, 50,
Jing Lineec88ca2012-02-08 11:18:30 -08002110 /* T8 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002111 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002112 /* T9 Object */
2113 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
2114 0, 5, 5, 0, 10, 30, 10, 10, 175, 4,
Jing Lin66ba78b2012-02-24 21:25:12 -08002115 127, 7, 26, 21, 17, 19, 143, 35, 207, 40,
2116 20, 5, 54, 49, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002117 /* T18 Object */
2118 0, 0,
2119 /* T24 Object */
2120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2121 0, 0, 0, 0, 0, 0, 0, 0, 0,
2122 /* T25 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002123 0, 0, 72, 113, 168, 97,
Jing Lineec88ca2012-02-08 11:18:30 -08002124 /* T27 Object */
2125 0, 0, 0, 0, 0, 0, 0,
2126 /* T40 Object */
2127 0, 0, 0, 0, 0,
2128 /* T42 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002130 /* T43 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2132 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002133 /* T46 Object */
Jing Lin66ba78b2012-02-24 21:25:12 -08002134 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002135 /* T47 Object */
2136 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
2137 /* T48 Object */
2138 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Lin66ba78b2012-02-24 21:25:12 -08002139 32, 50, 0, 10, 10, 0, 0, 100, 10, 90,
2140 0, 0, 0, 0, 0, 0, 0, 10, 1, 30,
2141 52, 10, 5, 0, 33, 0, 1, 0, 0, 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2143 0, 0, 0, 0,
2144 /* T56 Object */
2145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Lin66ba78b2012-02-24 21:25:12 -08002149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2150 0,
Jing Lineec88ca2012-02-08 11:18:30 -08002151};
2152
Amy Maloche08266db2011-11-04 11:07:16 -07002153#define MXT_TS_GPIO_IRQ 11
2154#define MXT_TS_LDO_EN_GPIO 50
2155#define MXT_TS_RESET_GPIO 52
Mohan Pallaka50837382011-09-07 11:00:57 +05302156
2157static void mxt_init_hw_liquid(void)
2158{
2159 int rc;
2160
Mohan Pallaka50837382011-09-07 11:00:57 +05302161 rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio");
2162 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07002163 pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n",
2164 __func__, MXT_TS_LDO_EN_GPIO);
2165 return;
Mohan Pallaka50837382011-09-07 11:00:57 +05302166 }
2167
2168 rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1);
2169 if (rc) {
Amy Maloche08266db2011-11-04 11:07:16 -07002170 pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n",
2171 __func__, MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05302172 goto err_ldo_gpio_req;
2173 }
2174
Mohan Pallaka50837382011-09-07 11:00:57 +05302175 return;
2176
Mohan Pallaka50837382011-09-07 11:00:57 +05302177err_ldo_gpio_req:
2178 gpio_free(MXT_TS_LDO_EN_GPIO);
Mohan Pallaka50837382011-09-07 11:00:57 +05302179}
2180
Jing Lineec88ca2012-02-08 11:18:30 -08002181static struct mxt_config_info mxt_config_array_2d[] = {
Jing Lindc4413c2012-01-16 15:22:52 -08002182 {
2183 .config = mxt1386_config_data,
2184 .config_length = ARRAY_SIZE(mxt1386_config_data),
2185 .family_id = 0xA0,
2186 .variant_id = 0x0,
2187 .version = 0x10,
2188 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08002189 .bootldr_id = MXT_BOOTLOADER_ID_1386,
Jing Lindc4413c2012-01-16 15:22:52 -08002190 },
Jing Lin33b007d2011-12-21 17:40:23 -08002191 {
2192 .config = mxt1386e_config_data_v1_0,
2193 .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0),
2194 .family_id = 0xA0,
2195 .variant_id = 0x2,
2196 .version = 0x10,
2197 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08002198 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Linaeaeed52012-03-26 14:57:15 -07002199 .fw_name = "atmel_8960_liquid_v2_2_AA.hex",
Jing Lin33b007d2011-12-21 17:40:23 -08002200 },
2201 {
2202 .config = mxt1386e_config_data_v2_1,
2203 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
2204 .family_id = 0xA0,
2205 .variant_id = 0x7,
2206 .version = 0x21,
2207 .build = 0xAA,
Anirudh Ghayala77941e2012-02-23 19:12:26 -08002208 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Linaeaeed52012-03-26 14:57:15 -07002209 .fw_name = "atmel_8960_liquid_v2_2_AA.hex",
2210 },
2211 {
2212 /* The config data for V2.2.AA is the same as for V2.1.AA */
2213 .config = mxt1386e_config_data_v2_1,
2214 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
2215 .family_id = 0xA0,
2216 .variant_id = 0x7,
2217 .version = 0x22,
2218 .build = 0xAA,
2219 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin33b007d2011-12-21 17:40:23 -08002220 },
Jing Lindc4413c2012-01-16 15:22:52 -08002221};
2222
Jing Lineec88ca2012-02-08 11:18:30 -08002223static struct mxt_platform_data mxt_platform_data_2d = {
2224 .config_array = mxt_config_array_2d,
2225 .config_array_size = ARRAY_SIZE(mxt_config_array_2d),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08002226 .panel_minx = 0,
2227 .panel_maxx = 1365,
2228 .panel_miny = 0,
2229 .panel_maxy = 767,
2230 .disp_minx = 0,
2231 .disp_maxx = 1365,
2232 .disp_miny = 0,
2233 .disp_maxy = 767,
Mohan Pallaka50837382011-09-07 11:00:57 +05302234 .irqflags = IRQF_TRIGGER_FALLING,
Jing Lin2f863172011-10-17 10:56:58 -07002235 .i2c_pull_up = true,
Amy Maloche08266db2011-11-04 11:07:16 -07002236 .reset_gpio = MXT_TS_RESET_GPIO,
2237 .irq_gpio = MXT_TS_GPIO_IRQ,
Mohan Pallaka50837382011-09-07 11:00:57 +05302238};
2239
Jing Lineec88ca2012-02-08 11:18:30 -08002240static struct mxt_config_info mxt_config_array_3d[] = {
2241 {
2242 .config = mxt1386e_config_data_3d,
2243 .config_length = ARRAY_SIZE(mxt1386e_config_data_3d),
2244 .family_id = 0xA0,
2245 .variant_id = 0x7,
2246 .version = 0x21,
2247 .build = 0xAA,
2248 },
2249};
2250
2251static struct mxt_platform_data mxt_platform_data_3d = {
2252 .config_array = mxt_config_array_3d,
2253 .config_array_size = ARRAY_SIZE(mxt_config_array_3d),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08002254 .panel_minx = 0,
2255 .panel_maxx = 1919,
2256 .panel_miny = 0,
2257 .panel_maxy = 1199,
2258 .disp_minx = 0,
2259 .disp_maxx = 1919,
2260 .disp_miny = 0,
2261 .disp_maxy = 1199,
Jing Lineec88ca2012-02-08 11:18:30 -08002262 .irqflags = IRQF_TRIGGER_FALLING,
2263 .i2c_pull_up = true,
2264 .reset_gpio = MXT_TS_RESET_GPIO,
2265 .irq_gpio = MXT_TS_GPIO_IRQ,
2266};
2267
Mohan Pallaka50837382011-09-07 11:00:57 +05302268static struct i2c_board_info mxt_device_info[] __initdata = {
2269 {
2270 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
Mohan Pallaka50837382011-09-07 11:00:57 +05302271 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
2272 },
2273};
2274
Manoj Rao14648742012-03-30 19:42:12 -07002275static struct msm_mhl_platform_data mhl_platform_data = {
2276 .irq = MSM_GPIO_TO_INT(4),
Manoj Raoc6d904c2012-06-22 00:32:14 -07002277 .gpio_mhl_int = MHL_GPIO_INT,
2278 .gpio_mhl_reset = MHL_GPIO_RESET,
2279 .gpio_mhl_power = 0,
2280 .gpio_hdmi_mhl_mux = 0,
Manoj Rao14648742012-03-30 19:42:12 -07002281};
Manoj Rao14648742012-03-30 19:42:12 -07002282
Eugene Yasmand2316b82011-12-07 18:23:48 +02002283static struct i2c_board_info sii_device_info[] __initdata = {
2284 {
Manoj Rao14648742012-03-30 19:42:12 -07002285#ifdef CONFIG_FB_MSM_HDMI_MHL_8334
2286 /*
2287 * keeps SI 8334 as the default
2288 * MHL TX
2289 */
2290 I2C_BOARD_INFO("sii8334", 0x39),
2291 .platform_data = &mhl_platform_data,
2292#endif
2293#ifdef CONFIG_FB_MSM_HDMI_MHL_9244
Eugene Yasmand2316b82011-12-07 18:23:48 +02002294 I2C_BOARD_INFO("Sil-9244", 0x39),
Eugene Yasmand2316b82011-12-07 18:23:48 +02002295 .irq = MSM_GPIO_TO_INT(15),
Manoj Rao14648742012-03-30 19:42:12 -07002296#endif /* CONFIG_MSM_HDMI_MHL */
2297 .flags = I2C_CLIENT_WAKE,
Eugene Yasmand2316b82011-12-07 18:23:48 +02002298 },
2299};
2300
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002301static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = {
2302 .clk_freq = 100000,
2303 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002304};
2305
2306static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = {
2307 .clk_freq = 100000,
2308 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002309};
2310
2311static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = {
2312 .clk_freq = 100000,
2313 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002314};
2315
2316static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = {
2317 .clk_freq = 100000,
2318 .src_clk_rate = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002319};
2320
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06002321static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
2322 .base_addr = MSM_ACC0_BASE + 0x08,
2323 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
2324 .mask = 1UL << 13,
2325};
2326
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07002327static struct ks8851_pdata spi_eth_pdata = {
2328 .irq_gpio = KS8851_IRQ_GPIO,
2329 .rst_gpio = KS8851_RST_GPIO,
2330};
Praveen Chidambaram043f4ce2011-08-02 09:37:59 -06002331
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002332static struct spi_board_info spi_board_info[] __initdata = {
2333 {
2334 .modalias = "ks8851",
2335 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2336 .max_speed_hz = 19200000,
2337 .bus_num = 0,
2338 .chip_select = 0,
2339 .mode = SPI_MODE_0,
Stepan Moskovchenko93d79ec2011-09-21 16:52:16 -07002340 .platform_data = &spi_eth_pdata
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002341 },
Chandan Uddaraju15e54b92011-09-12 10:52:36 -07002342 {
2343 .modalias = "dsi_novatek_3d_panel_spi",
2344 .max_speed_hz = 10800000,
2345 .bus_num = 0,
2346 .chip_select = 1,
2347 .mode = SPI_MODE_0,
2348 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002349};
2350
2351static struct platform_device msm_device_saw_core0 = {
2352 .name = "saw-regulator",
2353 .id = 0,
2354 .dev = {
2355 .platform_data = &msm_saw_regulator_pdata_s5,
2356 },
2357};
2358
2359static struct platform_device msm_device_saw_core1 = {
2360 .name = "saw-regulator",
2361 .id = 1,
2362 .dev = {
2363 .platform_data = &msm_saw_regulator_pdata_s6,
2364 },
2365};
2366
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07002367static struct tsens_platform_data msm_tsens_pdata = {
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08002368 .slope = {910, 910, 910, 910, 910},
Siddartha Mohanadossba21fdd2011-08-18 10:05:27 -07002369 .tsens_factor = 1000,
2370 .hw_type = MSM_8960,
2371 .tsens_num_sensor = 5,
2372};
2373
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002374static struct platform_device msm_tsens_device = {
2375 .name = "tsens8960-tm",
2376 .id = -1,
2377};
2378
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06002379static struct msm_thermal_data msm_thermal_pdata = {
2380 .sensor_id = 0,
2381 .poll_ms = 1000,
2382 .limit_temp = 60,
2383 .temp_hysteresis = 10,
2384 .limit_freq = 918000,
2385};
2386
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002387#ifdef CONFIG_MSM_FAKE_BATTERY
2388static struct platform_device fish_battery_device = {
2389 .name = "fish_battery",
2390};
2391#endif
2392
David Collins26f05562011-06-20 09:56:28 -07002393static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002394 .name = GPIO_REGULATOR_DEV_NAME,
2395 .id = PM8921_MPP_PM_TO_SYS(7),
2396 .dev = {
2397 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2398 },
2399};
2400
David Collins26f05562011-06-20 09:56:28 -07002401static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002402 .name = GPIO_REGULATOR_DEV_NAME,
2403 .id = 91,
2404 .dev = {
2405 .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2],
2406 },
2407};
2408
David Collinsb10be1d2011-09-02 10:29:31 -07002409static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
2410 .name = GPIO_REGULATOR_DEV_NAME,
2411 .id = PM8921_GPIO_PM_TO_SYS(17),
2412 .dev = {
2413 .platform_data =
2414 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2415 },
2416};
2417
David Collins35a78f52011-12-14 15:54:25 -08002418static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = {
2419 .name = GPIO_REGULATOR_DEV_NAME,
2420 .id = PM8921_GPIO_PM_TO_SYS(42),
2421 .dev = {
2422 .platform_data =
2423 &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW],
2424 },
2425};
2426
David Collins26f05562011-06-20 09:56:28 -07002427static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
2428 .name = "rpm-regulator",
2429 .id = -1,
2430 .dev = {
2431 .platform_data = &msm_rpm_regulator_pdata,
2432 },
2433};
Mayank Ranae009c922012-03-22 03:02:06 +05302434#ifdef CONFIG_SERIAL_MSM_HS
2435static int configure_uart_gpios(int on)
2436{
2437 int ret = 0, i;
2438 int uart_gpios[] = {93, 94, 95, 96};
2439
2440 for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) {
2441 if (on) {
2442 ret = gpio_request(uart_gpios[i], NULL);
2443 if (ret) {
2444 pr_err("%s: unable to request uart gpio[%d]\n",
2445 __func__, uart_gpios[i]);
2446 break;
2447 }
2448 } else {
2449 gpio_free(uart_gpios[i]);
2450 }
2451 }
2452
2453 if (ret && on && i)
2454 for (; i >= 0; i--)
2455 gpio_free(uart_gpios[i]);
2456 return ret;
2457}
2458
2459static struct msm_serial_hs_platform_data msm_uart_dm9_pdata = {
Mayank Ranad85a5082012-04-29 17:24:13 -07002460 .gpio_config = configure_uart_gpios,
Mayank Ranae009c922012-03-22 03:02:06 +05302461};
2462#else
2463static struct msm_serial_hs_platform_data msm_uart_dm9_pdata;
2464#endif
David Collins26f05562011-06-20 09:56:28 -07002465
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002466static struct platform_device *common_devices[] __initdata = {
Matt Wagantallbf430eb2012-03-22 11:45:49 -07002467 &msm8960_device_acpuclk,
Stepan Moskovchenkodf13d342011-08-03 19:01:25 -07002468 &msm8960_device_dmov,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002469 &msm_device_smd,
Mayank Rana9f51f582011-08-04 18:35:59 +05302470 &msm_device_uart_dm6,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002471 &msm_device_saw_core0,
2472 &msm_device_saw_core1,
2473 &msm8960_device_ext_5v_vreg,
David Collins87579612012-01-30 16:00:15 -08002474 &msm8960_device_ssbi_pmic,
David Collins96aa3e12012-02-29 10:31:34 -08002475 &msm8960_device_ext_otg_sw_vreg,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002476 &msm8960_device_qup_spi_gsbi1,
2477 &msm8960_device_qup_i2c_gsbi3,
2478 &msm8960_device_qup_i2c_gsbi4,
2479 &msm8960_device_qup_i2c_gsbi10,
2480#ifndef CONFIG_MSM_DSPS
2481 &msm8960_device_qup_i2c_gsbi12,
2482#endif
2483 &msm_slim_ctrl,
2484 &msm_device_wcnss_wlan,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002485#if defined(CONFIG_QSEECOM)
2486 &qseecom_device,
2487#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002488#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2489 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2490 &qcrypto_device,
2491#endif
2492
2493#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2494 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2495 &qcedev_device,
2496#endif
2497#ifdef CONFIG_MSM_ROTATOR
2498 &msm_rotator_device,
2499#endif
2500 &msm_device_sps,
2501#ifdef CONFIG_MSM_FAKE_BATTERY
2502 &fish_battery_device,
2503#endif
Laura Abbottb93525f2012-04-12 09:57:19 -07002504 &msm8960_fmem_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002505#ifdef CONFIG_ANDROID_PMEM
Laura Abbott2d1760b2011-09-29 21:31:24 -07002506#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002507 &msm8960_android_pmem_device,
2508 &msm8960_android_pmem_adsp_device,
2509 &msm8960_android_pmem_audio_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002510#endif
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07002511#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002512 &msm_device_vidc,
2513 &msm_device_bam_dmux,
2514 &msm_fm_platform_init,
Joel Nidera1261942011-09-12 16:30:09 +03002515#if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE)
2516#ifdef CONFIG_MSM_USE_TSIF1
2517 &msm_device_tsif[1],
2518#else
2519 &msm_device_tsif[0],
2520#endif
2521#endif
Joel Nider266a2642011-10-16 10:58:05 +02002522 &msm_device_tspp,
Mona Hossain9c430e32011-07-27 11:04:47 -07002523#ifdef CONFIG_HW_RANDOM_MSM
2524 &msm_device_rng,
2525#endif
Laura Abbottd6183792011-08-19 13:42:24 -07002526#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002527 &msm8960_ion_dev,
Laura Abbottd6183792011-08-19 13:42:24 -07002528#endif
Praveen Chidambaram78499012011-11-01 17:15:17 -06002529 &msm8960_rpm_device,
2530 &msm8960_rpm_log_device,
2531 &msm8960_rpm_stat_device,
Mona Hossain11c03ac2011-10-26 12:42:10 -07002532 &msm_device_tz_log,
Pratik Patel7831c082011-06-08 21:44:37 -07002533#ifdef CONFIG_MSM_QDSS
Pratik Patel1403f2a2012-03-21 10:10:00 -07002534 &msm_qdss_device,
Pratik Patel7831c082011-06-08 21:44:37 -07002535 &msm_etb_device,
2536 &msm_tpiu_device,
2537 &msm_funnel_device,
Pratik Patel492b3012012-03-06 14:22:30 -08002538 &msm_etm_device,
Pratik Patel7831c082011-06-08 21:44:37 -07002539#endif
Swaminathan Sathappanb77c65e92011-09-30 18:36:09 -07002540 &msm_device_dspcrashd_8960,
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002541 &msm8960_device_watchdog,
Laura Abbottb93525f2012-04-12 09:57:19 -07002542 &msm8960_rtb_device,
Praveen Chidambaram8ea3dcd2011-12-07 14:46:31 -07002543 &msm8960_cpu_idle_device,
Praveen Chidambaram5c8adf22012-02-23 18:44:37 -07002544 &msm8960_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002545 &msm8960_device_cache_erp,
Stepan Moskovchenkoc0557252012-06-07 17:39:14 -07002546 &msm8960_device_ebi1_ch0_erp,
2547 &msm8960_device_ebi1_ch1_erp,
Laura Abbottb93525f2012-04-12 09:57:19 -07002548 &msm8960_cache_dump_device,
Laura Abbott0577d7b2012-04-17 11:14:30 -07002549 &msm8960_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002550 &msm_tsens_device,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002551};
2552
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002553static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07002554 &msm8960_device_uart_gsbi5,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002555 &msm8960_device_otg,
2556 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002557 &msm_device_hsusb_host,
Vijayavardhan Vennapusaeb566482011-09-18 07:48:37 +05302558 &msm_device_hsic_host,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002559 &android_usb_device,
2560 &msm_device_vidc,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002561 &msm_bus_apps_fabric,
2562 &msm_bus_sys_fabric,
2563 &msm_bus_mm_fabric,
2564 &msm_bus_sys_fpb,
2565 &msm_bus_cpss_fpb,
2566 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08002567 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002568 &msm_pcm_routing,
2569 &msm_cpudai0,
2570 &msm_cpudai1,
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002571 &msm8960_cpudai_slimbus_2_rx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002572 &msm8960_cpudai_slimbus_2_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002573 &msm_cpudai_hdmi_rx,
2574 &msm_cpudai_bt_rx,
2575 &msm_cpudai_bt_tx,
2576 &msm_cpudai_fm_rx,
2577 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002578 &msm_cpudai_auxpcm_rx,
2579 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002580 &msm_cpu_fe,
2581 &msm_stub_codec,
2582 &msm_voice,
2583 &msm_voip,
2584 &msm_lpa_pcm,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302585 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07002586 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002587 &msm_cpudai_incall_record_rx,
2588 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002589
2590#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2591 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2592 &qcrypto_device,
2593#endif
2594
2595#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2596 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2597 &qcedev_device,
2598#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002599};
2600
2601static struct platform_device *rumi3_devices[] __initdata = {
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07002602 &msm8960_device_uart_gsbi5,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002603 &msm_kgsl_3d0,
2604 &msm_kgsl_2d0,
2605 &msm_kgsl_2d1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002606#ifdef CONFIG_MSM_GEMINI
2607 &msm8960_gemini_device,
2608#endif
Kalyani Oruganti465d1e12012-05-15 10:23:05 -07002609#ifdef CONFIG_MSM_MERCURY
2610 &msm8960_mercury_device,
2611#endif
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08002612};
2613
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002614static struct platform_device *cdp_devices[] __initdata = {
Stephen Boydeb819882011-08-29 14:46:30 -07002615 &msm_8960_q6_lpass,
2616 &msm_8960_q6_mss_fw,
2617 &msm_8960_q6_mss_sw,
Stephen Boyd322a9922011-09-20 01:05:54 -07002618 &msm_8960_riva,
Stephen Boydd89eebe2011-09-28 23:28:11 -07002619 &msm_pil_tzapps,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07002620 &msm_pil_dsps,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002621 &msm_pil_vidc,
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07002622 &msm8960_device_otg,
2623 &msm8960_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002624 &msm_device_hsusb_host,
2625 &android_usb_device,
2626 &msm_pcm,
Kiran Kandi5e809b02012-01-31 00:24:33 -08002627 &msm_multi_ch_pcm,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002628 &msm_pcm_routing,
2629 &msm_cpudai0,
2630 &msm_cpudai1,
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002631 &msm8960_cpudai_slimbus_2_rx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002632 &msm8960_cpudai_slimbus_2_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002633 &msm_cpudai_hdmi_rx,
2634 &msm_cpudai_bt_rx,
2635 &msm_cpudai_bt_tx,
2636 &msm_cpudai_fm_rx,
2637 &msm_cpudai_fm_tx,
Bhalchandra Gajare0e795c42011-08-15 18:10:30 -07002638 &msm_cpudai_auxpcm_rx,
2639 &msm_cpudai_auxpcm_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002640 &msm_cpu_fe,
2641 &msm_stub_codec,
2642 &msm_kgsl_3d0,
2643#ifdef CONFIG_MSM_KGSL_2D
2644 &msm_kgsl_2d0,
2645 &msm_kgsl_2d1,
2646#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002647#ifdef CONFIG_MSM_GEMINI
2648 &msm8960_gemini_device,
2649#endif
Kalyani Oruganti465d1e12012-05-15 10:23:05 -07002650#ifdef CONFIG_MSM_MERCURY
2651 &msm8960_mercury_device,
2652#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002653 &msm_voice,
2654 &msm_voip,
2655 &msm_lpa_pcm,
Laxminath Kasamcee1d602011-08-01 19:26:57 +05302656 &msm_cpudai_afe_01_rx,
2657 &msm_cpudai_afe_01_tx,
2658 &msm_cpudai_afe_02_rx,
2659 &msm_cpudai_afe_02_tx,
2660 &msm_pcm_afe,
Asish Bhattacharya96bb6f42011-11-01 20:36:09 +05302661 &msm_compr_dsp,
Helen Zeng0705a5f2011-10-14 15:29:52 -07002662 &msm_cpudai_incall_music_rx,
Helen Zenge3d716a2011-10-14 16:32:16 -07002663 &msm_cpudai_incall_record_rx,
2664 &msm_cpudai_incall_record_tx,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002665 &msm_pcm_hostless,
2666 &msm_bus_apps_fabric,
2667 &msm_bus_sys_fabric,
2668 &msm_bus_mm_fabric,
2669 &msm_bus_sys_fpb,
2670 &msm_bus_cpss_fpb,
2671};
2672
2673static void __init msm8960_i2c_init(void)
2674{
2675 msm8960_device_qup_i2c_gsbi4.dev.platform_data =
2676 &msm8960_i2c_qup_gsbi4_pdata;
2677
2678 msm8960_device_qup_i2c_gsbi3.dev.platform_data =
2679 &msm8960_i2c_qup_gsbi3_pdata;
2680
2681 msm8960_device_qup_i2c_gsbi10.dev.platform_data =
2682 &msm8960_i2c_qup_gsbi10_pdata;
2683
2684 msm8960_device_qup_i2c_gsbi12.dev.platform_data =
2685 &msm8960_i2c_qup_gsbi12_pdata;
2686}
2687
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002688static void __init msm8960_gfx_init(void)
2689{
Jordan Crouse4815e9f2012-07-09 15:36:37 -06002690 struct kgsl_device_platform_data *kgsl_3d0_pdata =
2691 msm_kgsl_3d0.dev.platform_data;
Jeremy Gebben58b2dce2011-10-13 11:14:19 -06002692 uint32_t soc_platform_version = socinfo_get_version();
Jordan Crouse4815e9f2012-07-09 15:36:37 -06002693
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002694 if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) {
Lucille Sylvesterdce84cd2011-10-12 14:15:37 -06002695 kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000;
2696 kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000;
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002697 }
Jordan Crouse4815e9f2012-07-09 15:36:37 -06002698 if (cpu_is_msm8960ab()) {
2699 kgsl_3d0_pdata->chipid = ADRENO_CHIPID(3, 2, 1, 0);
2700 } else {
2701
2702 /* 8960v3 GPU registers returns 5 for patch release
2703 * but it should be 6, so dummy up the chipid here
2704 * based the platform type
2705 */
2706
2707 if (SOCINFO_VERSION_MAJOR(soc_platform_version) >= 3)
2708 kgsl_3d0_pdata->chipid = ADRENO_CHIPID(2, 2, 0, 6);
2709 }
Lucille Sylvester34ec3692011-08-16 16:28:04 -06002710}
2711
Subhash Jadavani933e6a62011-12-26 18:05:04 +05302712static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002713 {
2714 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
2715 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2716 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002717 1, 784, 180000, 100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002718 },
2719
2720 {
2721 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
2722 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
2723 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002724 1300, 228, 1200000, 2000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002725 },
2726
2727 {
2728 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2729 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
2730 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002731 2000, 138, 1208400, 3200,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002732 },
2733
2734 {
2735 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002736 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
2737 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002738 6000, 119, 1850300, 9000,
Maheshkumar Sivasubramanian7df12362011-11-02 08:25:49 -06002739 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002740
2741 {
2742 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2743 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
2744 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002745 9200, 68, 2839200, 16400,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002746 },
2747
2748 {
2749 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2750 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
2751 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002752 10300, 63, 3128000, 18200,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002753 },
2754
2755 {
2756 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2757 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
2758 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002759 18000, 10, 4602600, 27000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002760 },
2761
2762 {
2763 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2764 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2765 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002766 20000, 2, 5752000, 32000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002767 },
2768};
2769
Praveen Chidambaram78499012011-11-01 17:15:17 -06002770static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2771 .levels = &msm_rpmrs_levels[0],
2772 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2773 .vdd_mem_levels = {
2774 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2775 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2776 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2777 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2778 },
2779 .vdd_dig_levels = {
2780 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
2781 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
2782 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
2783 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
2784 },
2785 .vdd_mask = 0x7FFFFF,
2786 .rpmrs_target_id = {
2787 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2788 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2789 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
2790 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
2791 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
2792 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
2793 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2794 },
2795};
2796
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06002797static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2798 .mode = MSM_PM_BOOT_CONFIG_TZ,
2799};
2800
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002801#ifdef CONFIG_I2C
2802#define I2C_SURF 1
2803#define I2C_FFA (1 << 1)
2804#define I2C_RUMI (1 << 2)
2805#define I2C_SIM (1 << 3)
2806#define I2C_FLUID (1 << 4)
Amir Samuelov05f87802011-08-27 18:30:12 +03002807#define I2C_LIQUID (1 << 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002808
2809struct i2c_registry {
2810 u8 machs;
2811 int bus;
2812 struct i2c_board_info *info;
2813 int len;
2814};
2815
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002816/* Sensors DSPS platform data */
2817#ifdef CONFIG_MSM_DSPS
2818#define DSPS_PIL_GENERIC_NAME "dsps"
2819#endif /* CONFIG_MSM_DSPS */
2820
2821static void __init msm8960_init_dsps(void)
2822{
2823#ifdef CONFIG_MSM_DSPS
2824 struct msm_dsps_platform_data *pdata =
2825 msm_dsps_device.dev.platform_data;
2826 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2827 pdata->gpios = NULL;
2828 pdata->gpios_num = 0;
2829
2830 platform_device_register(&msm_dsps_device);
2831#endif /* CONFIG_MSM_DSPS */
2832}
2833
Vamsi Krishna6aa6b1f2011-12-14 22:55:20 -08002834static int hsic_peripheral_status = 1;
2835static DEFINE_MUTEX(hsic_status_lock);
2836
2837void peripheral_connect()
2838{
2839 mutex_lock(&hsic_status_lock);
2840 if (hsic_peripheral_status)
2841 goto out;
2842 platform_device_add(&msm_device_hsic_host);
2843 hsic_peripheral_status = 1;
2844out:
2845 mutex_unlock(&hsic_status_lock);
2846}
2847EXPORT_SYMBOL(peripheral_connect);
2848
2849void peripheral_disconnect()
2850{
2851 mutex_lock(&hsic_status_lock);
2852 if (!hsic_peripheral_status)
2853 goto out;
2854 platform_device_del(&msm_device_hsic_host);
2855 hsic_peripheral_status = 0;
2856out:
2857 mutex_unlock(&hsic_status_lock);
2858}
2859EXPORT_SYMBOL(peripheral_disconnect);
2860
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05302861static void __init msm8960_init_smsc_hub(void)
2862{
2863 uint32_t version = socinfo_get_version();
2864
2865 if (SOCINFO_VERSION_MAJOR(version) == 1)
2866 return;
2867
2868 if (machine_is_msm8960_liquid())
2869 platform_device_register(&smsc_hub_device);
2870}
2871
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002872static void __init msm8960_init_hsic(void)
2873{
2874#ifdef CONFIG_USB_EHCI_MSM_HSIC
2875 uint32_t version = socinfo_get_version();
2876
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002877 if (SOCINFO_VERSION_MAJOR(version) == 1)
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002878 return;
2879
Joel King0cbf5d82012-05-24 15:21:38 -07002880 if (machine_is_msm8960_liquid())
Vamsi Krishnaf74d2edb2011-12-02 10:41:11 -08002881 platform_device_register(&msm_device_hsic_host);
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07002882#endif
2883}
2884
Amir Samuelov5137e392011-09-21 17:31:25 +03002885#ifdef CONFIG_ISL9519_CHARGER
2886static struct isl_platform_data isl_data __initdata = {
2887 .valid_n_gpio = 0, /* Not required when notify-by-pmic */
2888 .chg_detection_config = NULL, /* Not required when notify-by-pmic */
2889 .max_system_voltage = 4200,
2890 .min_system_voltage = 3200,
Amir Samuelov95f49ff2012-01-29 09:14:08 +02002891 .chgcurrent = 1900,
2892 .term_current = 0,
Amir Samuelov5137e392011-09-21 17:31:25 +03002893 .input_current = 2048,
2894};
2895
2896static struct i2c_board_info isl_charger_i2c_info[] __initdata = {
2897 {
2898 I2C_BOARD_INFO("isl9519q", 0x9),
2899 .irq = 0, /* Not required when notify-by-pmic */
2900 .platform_data = &isl_data,
2901 },
2902};
2903#endif /* CONFIG_ISL9519_CHARGER */
2904
Amir Samuelov755616d2011-12-13 16:34:46 +02002905static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = {
2906 {
2907 I2C_BOARD_INFO("sx1508q", 0x20),
2908 .platform_data = &msm8960_sx150x_data[SX150X_LIQUID]
2909 },
2910};
2911
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002912static struct i2c_registry msm8960_i2c_devices[] __initdata = {
Amir Samuelov5137e392011-09-21 17:31:25 +03002913#ifdef CONFIG_ISL9519_CHARGER
2914 {
2915 I2C_LIQUID,
2916 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2917 isl_charger_i2c_info,
2918 ARRAY_SIZE(isl_charger_i2c_info),
2919 },
2920#endif /* CONFIG_ISL9519_CHARGER */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002921 {
2922 I2C_SURF | I2C_FFA | I2C_FLUID,
2923 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2924 cyttsp_info,
2925 ARRAY_SIZE(cyttsp_info),
Rohit Vaswanicd2a59b2011-07-19 12:00:48 -07002926 },
Mohan Pallaka50837382011-09-07 11:00:57 +05302927 {
2928 I2C_LIQUID,
2929 MSM_8960_GSBI3_QUP_I2C_BUS_ID,
2930 mxt_device_info,
2931 ARRAY_SIZE(mxt_device_info),
2932 },
Mohan Pallaka5e490392011-09-09 15:18:41 +05302933 {
Manoj Rao14648742012-03-30 19:42:12 -07002934 I2C_SURF | I2C_FFA | I2C_LIQUID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302935 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Eugene Yasmand2316b82011-12-07 18:23:48 +02002936 sii_device_info,
2937 ARRAY_SIZE(sii_device_info),
2938 },
2939 {
2940 I2C_LIQUID,
2941 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
Mohan Pallaka5e490392011-09-09 15:18:41 +05302942 msm_isa1200_board_info,
2943 ARRAY_SIZE(msm_isa1200_board_info),
2944 },
Amir Samuelov755616d2011-12-13 16:34:46 +02002945 {
2946 I2C_LIQUID,
2947 MSM_8960_GSBI10_QUP_I2C_BUS_ID,
2948 liquid_io_expander_i2c_info,
2949 ARRAY_SIZE(liquid_io_expander_i2c_info),
2950 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002951};
2952#endif /* CONFIG_I2C */
2953
2954static void __init register_i2c_devices(void)
2955{
2956#ifdef CONFIG_I2C
2957 u8 mach_mask = 0;
2958 int i;
Kevin Chan09f4e662011-12-16 08:17:02 -08002959#ifdef CONFIG_MSM_CAMERA
2960 struct i2c_registry msm8960_camera_i2c_devices = {
2961 I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI,
2962 MSM_8960_GSBI4_QUP_I2C_BUS_ID,
2963 msm8960_camera_board_info.board_info,
2964 msm8960_camera_board_info.num_i2c_board_info,
2965 };
2966#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002967
2968 /* Build the matching 'supported_machs' bitmask */
2969 if (machine_is_msm8960_cdp())
2970 mach_mask = I2C_SURF;
2971 else if (machine_is_msm8960_rumi3())
2972 mach_mask = I2C_RUMI;
2973 else if (machine_is_msm8960_sim())
2974 mach_mask = I2C_SIM;
Amy Maloche2d028032011-07-20 14:08:06 -07002975 else if (machine_is_msm8960_fluid())
2976 mach_mask = I2C_FLUID;
Amir Samuelov05f87802011-08-27 18:30:12 +03002977 else if (machine_is_msm8960_liquid())
2978 mach_mask = I2C_LIQUID;
Amy Maloche1b0663f2011-08-02 16:46:22 -07002979 else if (machine_is_msm8960_mtp())
2980 mach_mask = I2C_FFA;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002981 else
2982 pr_err("unmatched machine ID in register_i2c_devices\n");
2983
Jing Lineec88ca2012-02-08 11:18:30 -08002984 if (machine_is_msm8960_liquid()) {
2985 if (SOCINFO_VERSION_MAJOR(socinfo_get_platform_version()) == 3)
2986 mxt_device_info[0].platform_data =
2987 &mxt_platform_data_3d;
2988 else
2989 mxt_device_info[0].platform_data =
2990 &mxt_platform_data_2d;
2991 }
2992
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002993 /* Run the array and install devices as appropriate */
2994 for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) {
2995 if (msm8960_i2c_devices[i].machs & mach_mask)
2996 i2c_register_board_info(msm8960_i2c_devices[i].bus,
2997 msm8960_i2c_devices[i].info,
2998 msm8960_i2c_devices[i].len);
2999 }
Manoj Raoc6d904c2012-06-22 00:32:14 -07003000
3001 if (!mhl_platform_data.gpio_mhl_power)
3002 pr_debug("mhl device configured for ext debug board\n");
3003
Kevin Chan09f4e662011-12-16 08:17:02 -08003004#ifdef CONFIG_MSM_CAMERA
3005 if (msm8960_camera_i2c_devices.machs & mach_mask)
3006 i2c_register_board_info(msm8960_camera_i2c_devices.bus,
3007 msm8960_camera_i2c_devices.info,
3008 msm8960_camera_i2c_devices.len);
3009#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003010#endif
3011}
3012
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003013static void __init msm8960_sim_init(void)
3014{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07003015 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
3016 &msm8960_device_watchdog.dev.platform_data;
3017
3018 wdog_pdata->bark_time = 15000;
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08003019 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06003020 msm_thermal_init(&msm_thermal_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06003021 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
3022 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003023 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003024 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003025 msm_clock_init(&msm8960_clock_init_data);
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003026 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003027
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003028 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08003029 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003030 msm8960_i2c_init();
3031 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3032 msm_spm_l2_init(msm_spm_l2_data);
3033 msm8960_init_buses();
3034 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003035 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003036 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003037
3038 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3039 &msm8960_qup_spi_gsbi1_pdata;
3040 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3041
3042 msm8960_init_mmc();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08003043 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003044 slim_register_board_info(msm_slim_devices,
3045 ARRAY_SIZE(msm_slim_devices));
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06003046 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06003047 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003048}
3049
3050static void __init msm8960_rumi3_init(void)
3051{
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08003052 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06003053 msm_thermal_init(&msm_thermal_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06003054 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
3055 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003056 regulator_suppress_info_printing();
David Collins26f05562011-06-20 09:56:28 -07003057 platform_device_register(&msm8960_device_rpm_regulator);
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08003058 msm8960_init_gpiomux();
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003059 msm8960_init_pmic();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003060 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3061 &msm8960_qup_spi_gsbi1_pdata;
3062 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
3063 msm8960_i2c_init();
3064 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3065 msm_spm_l2_init(msm_spm_l2_data);
3066 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003067 msm8960_pm8921_gpio_mpp_init();
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003068 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003069 msm8960_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003070 register_i2c_devices();
Mayank Ranae009c922012-03-22 03:02:06 +05303071
Mayank Ranae009c922012-03-22 03:02:06 +05303072
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08003073 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003074 slim_register_board_info(msm_slim_devices,
3075 ARRAY_SIZE(msm_slim_devices));
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06003076 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06003077 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003078}
3079
3080static void __init msm8960_cdp_init(void)
3081{
Naveen Ramaraj76483ad2011-09-06 14:25:44 -07003082 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
3083 pr_err("meminfo_init() failed!\n");
3084
Siddartha Mohanadossfad0af12012-01-20 15:08:38 -08003085 msm_tsens_early_init(&msm_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06003086 msm_thermal_init(&msm_thermal_pdata);
Praveen Chidambaram78499012011-11-01 17:15:17 -06003087 BUG_ON(msm_rpm_init(&msm8960_rpm_data));
3088 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Abhijeet Dharmapurikar6d565fd2011-09-15 18:49:56 -07003089
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003090 regulator_suppress_info_printing();
3091 if (msm_xo_init())
3092 pr_err("Failed to initialize XO votes\n");
David Collins26f05562011-06-20 09:56:28 -07003093 platform_device_register(&msm8960_device_rpm_regulator);
Stephen Boydbb600ae2011-08-02 20:11:40 -07003094 msm_clock_init(&msm8960_clock_init_data);
Vijayavardhan Vennapusafc464f02011-11-04 21:54:00 +05303095 if (machine_is_msm8960_liquid())
3096 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003097 msm8960_device_otg.dev.platform_data = &msm_otg_pdata;
Anji jonnalaa8b8d732011-12-06 10:03:24 +05303098 if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
3099 machine_is_msm8960_cdp()) {
3100 msm_otg_pdata.phy_init_seq = wr_phy_init_seq;
3101 } else if (machine_is_msm8960_liquid()) {
3102 msm_otg_pdata.phy_init_seq =
3103 liquid_v1_phy_init_seq;
3104 }
Ofir Cohen94213a72012-05-03 14:26:32 +03003105 android_usb_pdata.swfi_latency =
Anji jonnalaa7c1c5c2011-12-12 12:20:36 +05303106 msm_rpmrs_levels[0].latency_us;
Vijayavardhan Vennapusae3316a12011-10-15 06:05:17 +05303107 msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05303108 if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 &&
3109 machine_is_msm8960_liquid())
3110 msm_device_hsic_host.dev.parent = &smsc_hub_device.dev;
Stepan Moskovchenko3b09bf52011-12-06 20:40:53 -08003111 msm8960_init_gpiomux();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003112 msm8960_device_qup_spi_gsbi1.dev.platform_data =
3113 &msm8960_qup_spi_gsbi1_pdata;
3114 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003115
3116 msm8960_init_pmic();
Mohan Pallakaf69f0492011-11-21 13:08:33 +05303117 if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 &&
3118 (machine_is_msm8960_mtp())) || machine_is_msm8960_liquid())
3119 msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003120 msm8960_i2c_init();
Lucille Sylvester34ec3692011-08-16 16:28:04 -06003121 msm8960_gfx_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003122 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3123 msm_spm_l2_init(msm_spm_l2_data);
3124 msm8960_init_buses();
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07003125 platform_add_devices(msm8960_footswitch, msm8960_num_footswitch);
David Collinsb10be1d2011-09-02 10:29:31 -07003126 if (machine_is_msm8960_liquid())
3127 platform_device_register(&msm8960_device_ext_3p3v_vreg);
David Collinsd5a40732011-11-29 15:53:56 -08003128 if (machine_is_msm8960_cdp())
3129 platform_device_register(&msm8960_device_ext_l2_vreg);
Stepan Moskovchenko2b4b1cd2012-03-29 18:21:04 -07003130
3131 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE)
3132 platform_device_register(&msm8960_device_uart_gsbi8);
3133 else
3134 platform_device_register(&msm8960_device_uart_gsbi5);
3135
Mayank Ranaa7f75a62012-04-21 10:09:42 -07003136 /* For 8960 Fusion 2.2 Primary IPC */
Mayank Ranad85a5082012-04-29 17:24:13 -07003137 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
3138 msm_uart_dm9_pdata.wakeup_irq = gpio_to_irq(94); /* GSBI9(2) */
Mayank Ranaa7f75a62012-04-21 10:09:42 -07003139 msm_device_uart_dm9.dev.platform_data = &msm_uart_dm9_pdata;
Mayank Rana77f83c22012-07-10 09:31:02 +05303140 platform_device_register(&msm_device_uart_dm9);
Mayank Ranad85a5082012-04-29 17:24:13 -07003141 }
Mayank Ranaa7f75a62012-04-21 10:09:42 -07003142
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003143 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Stepan Moskovchenkoef1e0b62011-12-01 12:10:16 -08003144 msm8960_pm8921_gpio_mpp_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003145 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
Vijayavardhan Vennapusaafbbb8f2012-04-13 16:28:45 +05303146 msm8960_init_smsc_hub();
Vamsi Krishna98f54fb2011-11-02 14:55:41 -07003147 msm8960_init_hsic();
Steve Mucklef132c6c2012-06-06 18:30:57 -07003148#ifdef CONFIG_MSM_CAMERA
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003149 msm8960_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07003150#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003151 msm8960_init_mmc();
Mohan Pallaka50837382011-09-07 11:00:57 +05303152 if (machine_is_msm8960_liquid())
3153 mxt_init_hw_liquid();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003154 register_i2c_devices();
Stepan Moskovchenko24cd8642011-11-29 13:07:53 -08003155 msm8960_init_fb();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003156 slim_register_board_info(msm_slim_devices,
3157 ARRAY_SIZE(msm_slim_devices));
3158 msm8960_init_dsps();
Larry Bassela7eadea2011-07-14 10:46:00 -07003159 change_memory_power = &msm8960_change_memory_power;
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -06003160 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Maheshkumar Sivasubramanian6866b1c2011-06-07 14:20:33 -06003161 msm_pm_init_sleep_status_data(&msm_pm_slp_sts_data);
Joel King0cbf5d82012-05-24 15:21:38 -07003162 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) {
3163 mdm_sglte_device.dev.platform_data = &sglte_platform_data;
3164 platform_device_register(&mdm_sglte_device);
3165 }
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003166}
3167
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003168MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
3169 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003170 .reserve = msm8960_reserve,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003171 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303172 .handle_irq = gic_handle_irq,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003173 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003174 .init_machine = msm8960_sim_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003175 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003176 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003177 .restart = msm_restart,
Stepan Moskovchenkof441ca22010-12-01 19:31:16 -08003178MACHINE_END
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003179
3180MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
3181 .map_io = msm8960_map_io,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003182 .reserve = msm8960_reserve,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003183 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303184 .handle_irq = gic_handle_irq,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003185 .timer = &msm_timer,
Stepan Moskovchenkod056fca2011-01-27 12:12:07 -08003186 .init_machine = msm8960_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003187 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003188 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003189 .restart = msm_restart,
Stepan Moskovchenko50ede4e2010-12-13 18:12:19 -08003190MACHINE_END
3191
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003192MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP")
3193 .map_io = msm8960_map_io,
3194 .reserve = msm8960_reserve,
3195 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303196 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003197 .timer = &msm_timer,
3198 .init_machine = msm8960_cdp_init,
3199 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003200 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003201 .restart = msm_restart,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003202MACHINE_END
3203
3204MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP")
3205 .map_io = msm8960_map_io,
3206 .reserve = msm8960_reserve,
3207 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303208 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003209 .timer = &msm_timer,
3210 .init_machine = msm8960_cdp_init,
3211 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003212 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003213 .restart = msm_restart,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003214MACHINE_END
3215
3216MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID")
3217 .map_io = msm8960_map_io,
3218 .reserve = msm8960_reserve,
3219 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303220 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003221 .timer = &msm_timer,
3222 .init_machine = msm8960_cdp_init,
3223 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003224 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003225 .restart = msm_restart,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003226MACHINE_END
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003227
3228MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID")
3229 .map_io = msm8960_map_io,
3230 .reserve = msm8960_reserve,
3231 .init_irq = msm8960_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05303232 .handle_irq = gic_handle_irq,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003233 .timer = &msm_timer,
3234 .init_machine = msm8960_cdp_init,
3235 .init_early = msm8960_allocate_memory_regions,
Larry Basselb830e182011-10-14 10:46:55 -07003236 .init_very_early = msm8960_early_memory,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003237 .restart = msm_restart,
Amir Samuelov0d1f8ae2011-07-28 11:13:58 +03003238MACHINE_END