blob: 8cab63fc43211040ecbf9a1c91c59e4f0a6f6c88 [file] [log] [blame]
Deepak Verma888204f2013-01-25 11:43:09 +05301/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060014#include <linux/bitops.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070015#include <linux/platform_device.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016#include <linux/gpio.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070017#include <linux/io.h>
18#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060019#include <linux/i2c.h>
David Keitel2f613d92012-02-15 11:29:16 -080020#include <linux/i2c/smb349.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080021#include <linux/i2c/sx150x.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060022#include <linux/slimbus/slimbus.h>
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +053023#include <linux/mfd/wcd9xxx/core.h>
24#include <linux/mfd/wcd9xxx/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080025#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060026#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070027#include <linux/spi/spi.h>
Laura Abbott0ae40a02012-08-10 10:49:33 -070028#include <linux/dma-contiguous.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070029#include <linux/dma-mapping.h>
30#include <linux/platform_data/qcom_crypto_device.h>
Mitchel Humpherys6ff930c2012-09-06 11:32:54 -070031#include <linux/msm_ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080032#include <linux/memory.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070033#include <linux/memblock.h>
Praveen Chidambaram877d7a42012-06-05 14:33:20 -060034#include <linux/msm_thermal.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080035#include <linux/i2c/atmel_mxt_ts.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070036#include <linux/cyttsp-qc.h>
Amy Maloche70090f992012-02-16 16:35:26 -080037#include <linux/i2c/isa1200.h>
Mohan Pallaka474b94b2012-01-25 12:59:58 +053038#include <linux/gpio_keys.h>
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -080039#include <linux/epm_adc.h>
Jay Chokshie7d8d4f2012-04-04 14:47:57 -070040#include <linux/i2c/sx150x.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041#include <asm/mach-types.h>
42#include <asm/mach/arch.h>
43#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053044#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080045#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046
47#include <mach/board.h>
48#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080049#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070050#include <linux/usb/msm_hsusb.h>
51#include <linux/usb/android.h>
52#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060053#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054#include "timer.h"
55#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070056#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060057#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080058#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070059#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080060#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070061#include <mach/msm_memtypes.h>
62#include <linux/bootmem.h>
63#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070064#include <mach/dma.h>
Jin Hongd3024e62012-02-09 16:13:32 -080065#include <mach/msm_dsps.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070066#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060067#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080068#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080069#include <linux/msm_tsens.h>
Stephen Boyd4d0d2582012-02-10 14:49:40 -080070#include <mach/msm_xo.h>
Laura Abbott350c8362012-02-28 14:46:52 -080071#include <mach/msm_rtb.h>
Santosh Mardieff9a742012-04-09 23:23:39 +053072#include <sound/cs8427.h>
Ravi Kumar V05931a22012-04-04 17:09:37 +053073#include <media/gpio-ir-recv.h>
Larry Bassel67b921d2012-04-06 10:23:27 -070074#include <linux/fmem.h>
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -060075#include <mach/msm_pcie.h>
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -070076#include <mach/restart.h>
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -060077#include <mach/msm_iomap.h>
Mayank Ranae98f1e42013-02-22 19:58:59 +053078#include <mach/msm_serial_hs.h>
Joel King4ebccc62011-07-22 09:43:22 -070079
Jeff Ohlstein7e668552011-10-06 16:17:25 -070080#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080081#include "board-8064.h"
Matt Wagantalld55b90f2012-02-23 23:27:44 -080082#include "clock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060083#include "spm.h"
Subhash Jadavani909e04f2012-04-12 10:52:50 +053084#include <mach/mpm.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060085#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080086#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060087#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080088#include "devices-msm8x60.h"
Hanumant Singh50440d42012-04-23 19:27:16 -070089#include "smd_private.h"
Ameya Thakurffd21b02013-01-30 11:33:22 -080090#include "sysmon.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070091
Olav Haugan7c6aa742012-01-16 16:47:37 -080092#define MSM_PMEM_ADSP_SIZE 0x7800000
Bharath Ramachandramurthy2fd017a2012-03-13 10:21:09 -070093#define MSM_PMEM_AUDIO_SIZE 0x4CF000
Olav Haugan7c6aa742012-01-16 16:47:37 -080094#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
95#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
96#else
Chetan Kalyan72aac4f2012-02-23 14:56:54 -080097#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
Olav Haugan7c6aa742012-01-16 16:47:37 -080098#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070099
Olav Haugan7c6aa742012-01-16 16:47:37 -0800100#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Hanumant Singheadb7502012-05-15 18:14:04 -0700101#define HOLE_SIZE 0x20000
Deepak Verma888204f2013-01-25 11:43:09 +0530102#define MSM_ION_MFC_META_SIZE 0x40000 /* 256 Kbytes */
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700103#define MSM_CONTIG_MEM_SIZE 0x65000
Olav Haugan129992c2012-03-22 09:54:01 -0700104#ifdef CONFIG_MSM_IOMMU
105#define MSM_ION_MM_SIZE 0x3800000
106#define MSM_ION_SF_SIZE 0
Olav Haugan39477bb2012-05-14 16:05:36 -0700107#define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */
Laura Abbott03e3cd72013-02-09 09:35:30 -0800108#define MSM_ION_HEAP_NUM 8
Olav Haugan129992c2012-03-22 09:54:01 -0700109#else
Olav Haugan7c6aa742012-01-16 16:47:37 -0800110#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan129992c2012-03-22 09:54:01 -0700111#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugan39477bb2012-05-14 16:05:36 -0700112#define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */
Olav Haugan129992c2012-03-22 09:54:01 -0700113#define MSM_ION_HEAP_NUM 8
114#endif
Hanumant Singheadb7502012-05-15 18:14:04 -0700115#define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* (2MB - 128KB) */
Deepak Verma888204f2013-01-25 11:43:09 +0530116#define MSM_ION_MFC_SIZE (SZ_8K + MSM_ION_MFC_META_SIZE)
Olav Haugan2c43fac2012-01-19 11:06:37 -0800117#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
Olav Haugan7c6aa742012-01-16 16:47:37 -0800118#else
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700119#define MSM_CONTIG_MEM_SIZE 0x110C000
Olav Haugan7c6aa742012-01-16 16:47:37 -0800120#define MSM_ION_HEAP_NUM 1
121#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700122
Hanumant Singheadb7502012-05-15 18:14:04 -0700123#define APQ8064_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \
124 HOLE_SIZE))
Larry Bassel67b921d2012-04-06 10:23:27 -0700125#define MAX_FIXED_AREA_SIZE 0x10000000
Hanumant Singheadb7502012-05-15 18:14:04 -0700126#define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE)
127#define APQ8064_FW_START APQ8064_FIXED_AREA_START
Laura Abbott03e3cd72013-02-09 09:35:30 -0800128#define MSM_ION_ADSP_SIZE SZ_8M
Larry Bassel67b921d2012-04-06 10:23:27 -0700129
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -0600130#define QFPROM_RAW_FEAT_CONFIG_ROW0_MSB (MSM_QFPROM_BASE + 0x23c)
131#define QFPROM_RAW_OEM_CONFIG_ROW0_LSB (MSM_QFPROM_BASE + 0x220)
132
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -0600133/* PCIE AXI address space */
134#define PCIE_AXI_BAR_PHYS 0x08000000
135#define PCIE_AXI_BAR_SIZE SZ_128M
136
Niranjana Vishwanathapura459a27d2012-07-20 12:23:55 -0600137/* PCIe pmic gpios */
138#define PCIE_WAKE_N_PMIC_GPIO 12
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -0600139#define PCIE_PWR_EN_PMIC_GPIO 13
140#define PCIE_RST_N_PMIC_MPP 1
141
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700142#ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION
143static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE;
144static int __init msm_contig_mem_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -0700145{
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700146 msm_contig_mem_size = memparse(p, NULL);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800147 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -0700148}
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700149early_param("msm_contig_mem_size", msm_contig_mem_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800150#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700151
Olav Haugan7c6aa742012-01-16 16:47:37 -0800152#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700153static unsigned pmem_size = MSM_PMEM_SIZE;
154static int __init pmem_size_setup(char *p)
155{
156 pmem_size = memparse(p, NULL);
157 return 0;
158}
159early_param("pmem_size", pmem_size_setup);
160
161static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
162
163static int __init pmem_adsp_size_setup(char *p)
164{
165 pmem_adsp_size = memparse(p, NULL);
166 return 0;
167}
168early_param("pmem_adsp_size", pmem_adsp_size_setup);
169
170static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
171
172static int __init pmem_audio_size_setup(char *p)
173{
174 pmem_audio_size = memparse(p, NULL);
175 return 0;
176}
177early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800178#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700179
Olav Haugan7c6aa742012-01-16 16:47:37 -0800180#ifdef CONFIG_ANDROID_PMEM
181#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700182static struct android_pmem_platform_data android_pmem_pdata = {
183 .name = "pmem",
184 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
185 .cached = 1,
186 .memory_type = MEMTYPE_EBI1,
187};
188
Laura Abbottb93525f2012-04-12 09:57:19 -0700189static struct platform_device apq8064_android_pmem_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700190 .name = "android_pmem",
191 .id = 0,
192 .dev = {.platform_data = &android_pmem_pdata},
193};
194
195static struct android_pmem_platform_data android_pmem_adsp_pdata = {
196 .name = "pmem_adsp",
197 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
198 .cached = 0,
199 .memory_type = MEMTYPE_EBI1,
200};
Laura Abbottb93525f2012-04-12 09:57:19 -0700201static struct platform_device apq8064_android_pmem_adsp_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700202 .name = "android_pmem",
203 .id = 2,
204 .dev = { .platform_data = &android_pmem_adsp_pdata },
205};
206
207static struct android_pmem_platform_data android_pmem_audio_pdata = {
208 .name = "pmem_audio",
209 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
210 .cached = 0,
211 .memory_type = MEMTYPE_EBI1,
212};
213
Laura Abbottb93525f2012-04-12 09:57:19 -0700214static struct platform_device apq8064_android_pmem_audio_device = {
Kevin Chan13be4e22011-10-20 11:30:32 -0700215 .name = "android_pmem",
216 .id = 4,
217 .dev = { .platform_data = &android_pmem_audio_pdata },
218};
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700219#endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */
220#endif /* CONFIG_ANDROID_PMEM */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800221
Anji Jonnalafde57a32013-03-20 17:22:39 +0530222#ifdef CONFIG_BATTERY_BCL
223static struct platform_device battery_bcl_device = {
224 .name = "battery_current_limit",
225 .id = -1,
226 };
227#endif
228
Larry Bassel67b921d2012-04-06 10:23:27 -0700229struct fmem_platform_data apq8064_fmem_pdata = {
230};
231
Olav Haugan7c6aa742012-01-16 16:47:37 -0800232static struct memtype_reserve apq8064_reserve_table[] __initdata = {
233 [MEMTYPE_SMI] = {
234 },
235 [MEMTYPE_EBI0] = {
236 .flags = MEMTYPE_FLAGS_1M_ALIGN,
237 },
238 [MEMTYPE_EBI1] = {
239 .flags = MEMTYPE_FLAGS_1M_ALIGN,
240 },
241};
Kevin Chan13be4e22011-10-20 11:30:32 -0700242
Laura Abbott350c8362012-02-28 14:46:52 -0800243static void __init reserve_rtb_memory(void)
244{
245#if defined(CONFIG_MSM_RTB)
Laura Abbottb93525f2012-04-12 09:57:19 -0700246 apq8064_reserve_table[MEMTYPE_EBI1].size += apq8064_rtb_pdata.size;
Laura Abbott350c8362012-02-28 14:46:52 -0800247#endif
248}
249
250
Kevin Chan13be4e22011-10-20 11:30:32 -0700251static void __init size_pmem_devices(void)
252{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800253#ifdef CONFIG_ANDROID_PMEM
254#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700255 android_pmem_adsp_pdata.size = pmem_adsp_size;
256 android_pmem_pdata.size = pmem_size;
257 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700258#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
259#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700260}
261
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700262#ifdef CONFIG_ANDROID_PMEM
263#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700264static void __init reserve_memory_for(struct android_pmem_platform_data *p)
265{
266 apq8064_reserve_table[p->memory_type].size += p->size;
267}
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700268#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
269#endif /*CONFIG_ANDROID_PMEM*/
Kevin Chan13be4e22011-10-20 11:30:32 -0700270
Kevin Chan13be4e22011-10-20 11:30:32 -0700271static void __init reserve_pmem_memory(void)
272{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800273#ifdef CONFIG_ANDROID_PMEM
274#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700275 reserve_memory_for(&android_pmem_adsp_pdata);
276 reserve_memory_for(&android_pmem_pdata);
277 reserve_memory_for(&android_pmem_audio_pdata);
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700278#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
Mitchel Humpherys05e58812012-08-13 14:24:13 -0700279 apq8064_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size;
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -0700280#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -0800281}
282
283static int apq8064_paddr_to_memtype(unsigned int paddr)
284{
285 return MEMTYPE_EBI1;
286}
287
Steve Mucklef132c6c2012-06-06 18:30:57 -0700288#define FMEM_ENABLED 0
Larry Bassel67b921d2012-04-06 10:23:27 -0700289
Olav Haugan7c6aa742012-01-16 16:47:37 -0800290#ifdef CONFIG_ION_MSM
291#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -0700292static struct ion_cp_heap_pdata cp_mm_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800293 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800294 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700295 .reusable = FMEM_ENABLED,
296 .mem_is_fmem = FMEM_ENABLED,
297 .fixed_position = FIXED_MIDDLE,
Laura Abbottadec9c72012-12-05 11:49:59 -0800298 .is_cma = 1,
Laura Abbott5249a052012-12-11 15:09:03 -0800299 .no_nonsecure_alloc = 1,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800300};
301
Laura Abbottb93525f2012-04-12 09:57:19 -0700302static struct ion_cp_heap_pdata cp_mfc_apq8064_ion_pdata = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800303 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800304 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700305 .reusable = 0,
306 .mem_is_fmem = FMEM_ENABLED,
307 .fixed_position = FIXED_HIGH,
Laura Abbott5249a052012-12-11 15:09:03 -0800308 .no_nonsecure_alloc = 1,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800309};
310
Laura Abbottb93525f2012-04-12 09:57:19 -0700311static struct ion_co_heap_pdata co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800312 .adjacent_mem_id = INVALID_HEAP_ID,
313 .align = PAGE_SIZE,
Larry Bassel67b921d2012-04-06 10:23:27 -0700314 .mem_is_fmem = 0,
Olav Haugand3d29682012-01-19 10:57:07 -0800315};
316
Laura Abbottb93525f2012-04-12 09:57:19 -0700317static struct ion_co_heap_pdata fw_co_apq8064_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800318 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
319 .align = SZ_128K,
Larry Bassel67b921d2012-04-06 10:23:27 -0700320 .mem_is_fmem = FMEM_ENABLED,
321 .fixed_position = FIXED_LOW,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800322};
323#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800324
Laura Abbott0ae40a02012-08-10 10:49:33 -0700325static u64 msm_dmamask = DMA_BIT_MASK(32);
326
327static struct platform_device ion_mm_heap_device = {
328 .name = "ion-mm-heap-device",
329 .id = -1,
330 .dev = {
331 .dma_mask = &msm_dmamask,
332 .coherent_dma_mask = DMA_BIT_MASK(32),
333 }
334};
335
Laura Abbott03e3cd72013-02-09 09:35:30 -0800336static struct platform_device ion_adsp_heap_device = {
337 .name = "ion-adsp-heap-device",
338 .id = -1,
339 .dev = {
340 .dma_mask = &msm_dmamask,
341 .coherent_dma_mask = DMA_BIT_MASK(32),
342 }
343};
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800344/**
345 * These heaps are listed in the order they will be allocated. Due to
346 * video hardware restrictions and content protection the FW heap has to
347 * be allocated adjacent (below) the MM heap and the MFC heap has to be
348 * allocated after the MM heap to ensure MFC heap is not more than 256MB
349 * away from the base address of the FW heap.
350 * However, the order of FW heap and MM heap doesn't matter since these
351 * two heaps are taken care of by separate code to ensure they are adjacent
352 * to each other.
353 * Don't swap the order unless you know what you are doing!
354 */
Benjamin Gaignardb2d367c2012-06-25 15:27:30 -0700355struct ion_platform_heap apq8064_heaps[] = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800356 {
357 .id = ION_SYSTEM_HEAP_ID,
358 .type = ION_HEAP_TYPE_SYSTEM,
359 .name = ION_VMALLOC_HEAP_NAME,
360 },
361#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
362 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800363 .id = ION_CP_MM_HEAP_ID,
364 .type = ION_HEAP_TYPE_CP,
365 .name = ION_MM_HEAP_NAME,
366 .size = MSM_ION_MM_SIZE,
367 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700368 .extra_data = (void *) &cp_mm_apq8064_ion_pdata,
Laura Abbott0ae40a02012-08-10 10:49:33 -0700369 .priv = &ion_mm_heap_device.dev
Olav Haugan7c6aa742012-01-16 16:47:37 -0800370 },
371 {
Olav Haugand3d29682012-01-19 10:57:07 -0800372 .id = ION_MM_FIRMWARE_HEAP_ID,
373 .type = ION_HEAP_TYPE_CARVEOUT,
374 .name = ION_MM_FIRMWARE_HEAP_NAME,
375 .size = MSM_ION_MM_FW_SIZE,
376 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700377 .extra_data = (void *) &fw_co_apq8064_ion_pdata,
Olav Haugand3d29682012-01-19 10:57:07 -0800378 },
379 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800380 .id = ION_CP_MFC_HEAP_ID,
381 .type = ION_HEAP_TYPE_CP,
382 .name = ION_MFC_HEAP_NAME,
383 .size = MSM_ION_MFC_SIZE,
384 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700385 .extra_data = (void *) &cp_mfc_apq8064_ion_pdata,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800386 },
Olav Haugan129992c2012-03-22 09:54:01 -0700387#ifndef CONFIG_MSM_IOMMU
Olav Haugan7c6aa742012-01-16 16:47:37 -0800388 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800389 .id = ION_SF_HEAP_ID,
390 .type = ION_HEAP_TYPE_CARVEOUT,
391 .name = ION_SF_HEAP_NAME,
392 .size = MSM_ION_SF_SIZE,
393 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700394 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800395 },
Olav Haugan129992c2012-03-22 09:54:01 -0700396#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800397 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800398 .id = ION_IOMMU_HEAP_ID,
399 .type = ION_HEAP_TYPE_IOMMU,
400 .name = ION_IOMMU_HEAP_NAME,
401 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800402 {
403 .id = ION_QSECOM_HEAP_ID,
404 .type = ION_HEAP_TYPE_CARVEOUT,
405 .name = ION_QSECOM_HEAP_NAME,
406 .size = MSM_ION_QSECOM_SIZE,
407 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700408 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Hauganf45e2142012-01-19 11:01:01 -0800409 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800410 {
411 .id = ION_AUDIO_HEAP_ID,
412 .type = ION_HEAP_TYPE_CARVEOUT,
413 .name = ION_AUDIO_HEAP_NAME,
414 .size = MSM_ION_AUDIO_SIZE,
415 .memory_type = ION_EBI_TYPE,
Laura Abbottb93525f2012-04-12 09:57:19 -0700416 .extra_data = (void *) &co_apq8064_ion_pdata,
Olav Haugan2c43fac2012-01-19 11:06:37 -0800417 },
Laura Abbott03e3cd72013-02-09 09:35:30 -0800418 {
419 .id = ION_ADSP_HEAP_ID,
420 .type = ION_HEAP_TYPE_DMA,
421 .name = ION_ADSP_HEAP_NAME,
422 .size = MSM_ION_ADSP_SIZE,
423 .memory_type = ION_EBI_TYPE,
424 .extra_data = (void *) &co_apq8064_ion_pdata,
425 .priv = &ion_adsp_heap_device.dev,
426 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800427#endif
Benjamin Gaignardb2d367c2012-06-25 15:27:30 -0700428};
429
430static struct ion_platform_data apq8064_ion_pdata = {
431 .nr = MSM_ION_HEAP_NUM,
432 .heaps = apq8064_heaps,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800433};
434
Laura Abbottb93525f2012-04-12 09:57:19 -0700435static struct platform_device apq8064_ion_dev = {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800436 .name = "ion-msm",
437 .id = 1,
Laura Abbottb93525f2012-04-12 09:57:19 -0700438 .dev = { .platform_data = &apq8064_ion_pdata },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800439};
440#endif
441
Larry Bassel67b921d2012-04-06 10:23:27 -0700442static struct platform_device apq8064_fmem_device = {
443 .name = "fmem",
444 .id = 1,
445 .dev = { .platform_data = &apq8064_fmem_pdata },
446};
447
448static void __init reserve_mem_for_ion(enum ion_memory_types mem_type,
449 unsigned long size)
450{
451 apq8064_reserve_table[mem_type].size += size;
452}
453
454static void __init apq8064_reserve_fixed_area(unsigned long fixed_area_size)
455{
456#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
457 int ret;
458
459 if (fixed_area_size > MAX_FIXED_AREA_SIZE)
460 panic("fixed area size is larger than %dM\n",
461 MAX_FIXED_AREA_SIZE >> 20);
462
463 reserve_info->fixed_area_size = fixed_area_size;
464 reserve_info->fixed_area_start = APQ8064_FW_START;
465
466 ret = memblock_remove(reserve_info->fixed_area_start,
467 reserve_info->fixed_area_size);
468 BUG_ON(ret);
469#endif
470}
471
472/**
473 * Reserve memory for ION and calculate amount of reusable memory for fmem.
474 * We only reserve memory for heaps that are not reusable. However, we only
475 * support one reusable heap at the moment so we ignore the reusable flag for
476 * other than the first heap with reusable flag set. Also handle special case
477 * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be
478 * at a higher address than FW in addition to not more than 256MB away from the
479 * base address of the firmware. This means that if MM is reusable the other
480 * two heaps must be allocated in the same region as FW. This is handled by the
481 * mem_is_fmem flag in the platform data. In addition the MM heap must be
482 * adjacent to the FW heap for content protection purposes.
483 */
Stephen Boyd668d7652012-04-25 11:31:01 -0700484static void __init reserve_ion_memory(void)
Olav Haugan7c6aa742012-01-16 16:47:37 -0800485{
486#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
Larry Bassel67b921d2012-04-06 10:23:27 -0700487 unsigned int i;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700488 unsigned int ret;
Larry Bassel67b921d2012-04-06 10:23:27 -0700489 unsigned int fixed_size = 0;
490 unsigned int fixed_low_size, fixed_middle_size, fixed_high_size;
491 unsigned long fixed_low_start, fixed_middle_start, fixed_high_start;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700492 unsigned long cma_alignment;
493 unsigned int low_use_cma = 0;
494 unsigned int middle_use_cma = 0;
495 unsigned int high_use_cma = 0;
496
Larry Bassel67b921d2012-04-06 10:23:27 -0700497
Larry Bassel67b921d2012-04-06 10:23:27 -0700498 fixed_low_size = 0;
499 fixed_middle_size = 0;
500 fixed_high_size = 0;
501
Laura Abbott0ae40a02012-08-10 10:49:33 -0700502 cma_alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order);
503
Larry Bassel67b921d2012-04-06 10:23:27 -0700504 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
Laura Abbott0ae40a02012-08-10 10:49:33 -0700505 struct ion_platform_heap *heap =
Larry Bassel67b921d2012-04-06 10:23:27 -0700506 &(apq8064_ion_pdata.heaps[i]);
Laura Abbott0ae40a02012-08-10 10:49:33 -0700507 int use_cma = 0;
508
Larry Bassel67b921d2012-04-06 10:23:27 -0700509
510 if (heap->extra_data) {
511 int fixed_position = NOT_FIXED;
Larry Bassel67b921d2012-04-06 10:23:27 -0700512
Mitchel Humpherysdc4d01d2012-09-13 10:53:22 -0700513 switch ((int)heap->type) {
Larry Bassel67b921d2012-04-06 10:23:27 -0700514 case ION_HEAP_TYPE_CP:
Laura Abbott0ae40a02012-08-10 10:49:33 -0700515 if (((struct ion_cp_heap_pdata *)
516 heap->extra_data)->is_cma) {
517 heap->size = ALIGN(heap->size,
518 cma_alignment);
519 use_cma = 1;
520 }
Larry Bassel67b921d2012-04-06 10:23:27 -0700521 fixed_position = ((struct ion_cp_heap_pdata *)
522 heap->extra_data)->fixed_position;
523 break;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700524 case ION_HEAP_TYPE_DMA:
525 use_cma = 1;
526 /* Purposely fall through here */
Larry Bassel67b921d2012-04-06 10:23:27 -0700527 case ION_HEAP_TYPE_CARVEOUT:
Larry Bassel67b921d2012-04-06 10:23:27 -0700528 fixed_position = ((struct ion_co_heap_pdata *)
529 heap->extra_data)->fixed_position;
530 break;
531 default:
532 break;
533 }
534
535 if (fixed_position != NOT_FIXED)
536 fixed_size += heap->size;
537 else
538 reserve_mem_for_ion(MEMTYPE_EBI1, heap->size);
539
Laura Abbott0ae40a02012-08-10 10:49:33 -0700540 if (fixed_position == FIXED_LOW) {
Larry Bassel67b921d2012-04-06 10:23:27 -0700541 fixed_low_size += heap->size;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700542 low_use_cma = use_cma;
543 } else if (fixed_position == FIXED_MIDDLE) {
Larry Bassel67b921d2012-04-06 10:23:27 -0700544 fixed_middle_size += heap->size;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700545 middle_use_cma = use_cma;
546 } else if (fixed_position == FIXED_HIGH) {
Larry Bassel67b921d2012-04-06 10:23:27 -0700547 fixed_high_size += heap->size;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700548 high_use_cma = use_cma;
549 } else if (use_cma) {
550 /*
551 * Heaps that use CMA but are not part of the
552 * fixed set. Create wherever.
553 */
554 dma_declare_contiguous(
555 heap->priv,
556 heap->size,
557 0,
558 0xb0000000);
559
560 }
Larry Bassel67b921d2012-04-06 10:23:27 -0700561 }
562 }
563
564 if (!fixed_size)
565 return;
566
Laura Abbott0ae40a02012-08-10 10:49:33 -0700567 /*
568 * Given the setup for the fixed area, we can't round up all sizes.
569 * Some sizes must be set up exactly and aligned correctly. Incorrect
570 * alignments are considered a configuration issue
Larry Bassel67b921d2012-04-06 10:23:27 -0700571 */
Larry Bassel67b921d2012-04-06 10:23:27 -0700572
573 fixed_low_start = APQ8064_FIXED_AREA_START;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700574 if (low_use_cma) {
575 BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, cma_alignment));
576 BUG_ON(!IS_ALIGNED(fixed_low_start, cma_alignment));
577 } else {
578 BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, SECTION_SIZE));
579 ret = memblock_remove(fixed_low_start,
580 fixed_low_size + HOLE_SIZE);
581 BUG_ON(ret);
582 }
583
Hanumant Singheadb7502012-05-15 18:14:04 -0700584 fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700585 if (middle_use_cma) {
586 BUG_ON(!IS_ALIGNED(fixed_middle_start, cma_alignment));
587 BUG_ON(!IS_ALIGNED(fixed_middle_size, cma_alignment));
588 } else {
589 BUG_ON(!IS_ALIGNED(fixed_middle_size, SECTION_SIZE));
590 ret = memblock_remove(fixed_middle_start, fixed_middle_size);
591 BUG_ON(ret);
592 }
593
Larry Bassel67b921d2012-04-06 10:23:27 -0700594 fixed_high_start = fixed_middle_start + fixed_middle_size;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700595 if (high_use_cma) {
596 fixed_high_size = ALIGN(fixed_high_size, cma_alignment);
597 BUG_ON(!IS_ALIGNED(fixed_high_start, cma_alignment));
598 } else {
599 /* This is the end of the fixed area so it's okay to round up */
600 fixed_high_size = ALIGN(fixed_high_size, SECTION_SIZE);
601 ret = memblock_remove(fixed_high_start, fixed_high_size);
602 BUG_ON(ret);
603 }
Larry Bassel67b921d2012-04-06 10:23:27 -0700604
605 for (i = 0; i < apq8064_ion_pdata.nr; ++i) {
606 struct ion_platform_heap *heap = &(apq8064_ion_pdata.heaps[i]);
607
608 if (heap->extra_data) {
609 int fixed_position = NOT_FIXED;
Steve Mucklef132c6c2012-06-06 18:30:57 -0700610 struct ion_cp_heap_pdata *pdata = NULL;
Larry Bassel67b921d2012-04-06 10:23:27 -0700611
Mitchel Humpherysdc4d01d2012-09-13 10:53:22 -0700612 switch ((int) heap->type) {
Larry Bassel67b921d2012-04-06 10:23:27 -0700613 case ION_HEAP_TYPE_CP:
Hanumant Singheadb7502012-05-15 18:14:04 -0700614 pdata =
615 (struct ion_cp_heap_pdata *)heap->extra_data;
616 fixed_position = pdata->fixed_position;
Larry Bassel67b921d2012-04-06 10:23:27 -0700617 break;
618 case ION_HEAP_TYPE_CARVEOUT:
Laura Abbott0ae40a02012-08-10 10:49:33 -0700619 case ION_HEAP_TYPE_DMA:
Larry Bassel67b921d2012-04-06 10:23:27 -0700620 fixed_position = ((struct ion_co_heap_pdata *)
621 heap->extra_data)->fixed_position;
622 break;
623 default:
624 break;
625 }
626
627 switch (fixed_position) {
628 case FIXED_LOW:
629 heap->base = fixed_low_start;
630 break;
631 case FIXED_MIDDLE:
632 heap->base = fixed_middle_start;
Laura Abbott0ae40a02012-08-10 10:49:33 -0700633 if (middle_use_cma) {
634 ret = dma_declare_contiguous(
635 heap->priv,
636 heap->size,
637 fixed_middle_start,
638 0xa0000000);
639 WARN_ON(ret);
640 }
Hanumant Singheadb7502012-05-15 18:14:04 -0700641 pdata->secure_base = fixed_middle_start
642 - HOLE_SIZE;
643 pdata->secure_size = HOLE_SIZE + heap->size;
Larry Bassel67b921d2012-04-06 10:23:27 -0700644 break;
645 case FIXED_HIGH:
646 heap->base = fixed_high_start;
647 break;
648 default:
649 break;
650 }
651 }
652 }
Olav Haugan7c6aa742012-01-16 16:47:37 -0800653#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700654}
655
Huaibin Yang4a084e32011-12-15 15:25:52 -0800656static void __init reserve_mdp_memory(void)
657{
658 apq8064_mdp_writeback(apq8064_reserve_table);
659}
660
Laura Abbott93a4a352012-05-25 09:26:35 -0700661static void __init reserve_cache_dump_memory(void)
662{
663#ifdef CONFIG_MSM_CACHE_DUMP
664 unsigned int total;
665
666 total = apq8064_cache_dump_pdata.l1_size +
667 apq8064_cache_dump_pdata.l2_size;
668 apq8064_reserve_table[MEMTYPE_EBI1].size += total;
669#endif
670}
671
Abhijeet Dharmapurikar3edb5de2012-09-13 11:02:03 -0700672static void __init reserve_mpdcvs_memory(void)
673{
674 apq8064_reserve_table[MEMTYPE_EBI1].size += SZ_32K;
675}
676
Kevin Chan13be4e22011-10-20 11:30:32 -0700677static void __init apq8064_calculate_reserve_sizes(void)
678{
679 size_pmem_devices();
680 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800681 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800682 reserve_mdp_memory();
Laura Abbott350c8362012-02-28 14:46:52 -0800683 reserve_rtb_memory();
Laura Abbott93a4a352012-05-25 09:26:35 -0700684 reserve_cache_dump_memory();
Abhijeet Dharmapurikar3edb5de2012-09-13 11:02:03 -0700685 reserve_mpdcvs_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700686}
687
688static struct reserve_info apq8064_reserve_info __initdata = {
689 .memtype_reserve_table = apq8064_reserve_table,
690 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
Larry Bassel67b921d2012-04-06 10:23:27 -0700691 .reserve_fixed_area = apq8064_reserve_fixed_area,
Kevin Chan13be4e22011-10-20 11:30:32 -0700692 .paddr_to_memtype = apq8064_paddr_to_memtype,
693};
694
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700695static char prim_panel_name[PANEL_NAME_MAX_LEN];
696static char ext_panel_name[PANEL_NAME_MAX_LEN];
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530697
698static int ext_resolution;
699
Aravind Venkateswaran8ac7f412012-03-16 17:57:30 -0700700static int __init prim_display_setup(char *param)
701{
702 if (strnlen(param, PANEL_NAME_MAX_LEN))
703 strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN);
704 return 0;
705}
706early_param("prim_display", prim_display_setup);
707
708static int __init ext_display_setup(char *param)
709{
710 if (strnlen(param, PANEL_NAME_MAX_LEN))
711 strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN);
712 return 0;
713}
714early_param("ext_display", ext_display_setup);
715
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530716static int __init hdmi_resulution_setup(char *param)
717{
718 int ret;
719 ret = kstrtoint(param, 10, &ext_resolution);
720 return ret;
721}
722early_param("ext_resolution", hdmi_resulution_setup);
723
Kevin Chan13be4e22011-10-20 11:30:32 -0700724static void __init apq8064_reserve(void)
725{
Ajay Singh Parmar6b82d2b2012-07-19 17:23:26 +0530726 apq8064_set_display_params(prim_panel_name, ext_panel_name,
727 ext_resolution);
Kevin Chan13be4e22011-10-20 11:30:32 -0700728 msm_reserve();
729}
730
Laura Abbott6988cef2012-03-15 14:27:13 -0700731static void __init apq8064_early_reserve(void)
732{
733 reserve_info = &apq8064_reserve_info;
Laura Abbott6988cef2012-03-15 14:27:13 -0700734}
Hemant Kumara945b472012-01-25 15:08:06 -0800735#ifdef CONFIG_USB_EHCI_MSM_HSIC
Hemant Kumare6275972012-02-29 20:06:21 -0800736/* Bandwidth requests (zero) if no vote placed */
737static struct msm_bus_vectors hsic_init_vectors[] = {
738 {
739 .src = MSM_BUS_MASTER_SPS,
Hemant Kumare6275972012-02-29 20:06:21 -0800740 .dst = MSM_BUS_SLAVE_SPS,
741 .ab = 0,
742 .ib = 0,
743 },
744};
745
746/* Bus bandwidth requests in Bytes/sec */
747static struct msm_bus_vectors hsic_max_vectors[] = {
748 {
749 .src = MSM_BUS_MASTER_SPS,
Hemant Kumare6275972012-02-29 20:06:21 -0800750 .dst = MSM_BUS_SLAVE_SPS,
751 .ab = 0,
Hemant Kumar266d9d52012-10-17 13:48:10 -0700752 .ib = 256000000, /*vote for 32Mhz dfab clk rate*/
Hemant Kumare6275972012-02-29 20:06:21 -0800753 },
754};
755
756static struct msm_bus_paths hsic_bus_scale_usecases[] = {
757 {
758 ARRAY_SIZE(hsic_init_vectors),
759 hsic_init_vectors,
760 },
761 {
762 ARRAY_SIZE(hsic_max_vectors),
763 hsic_max_vectors,
764 },
765};
766
767static struct msm_bus_scale_pdata hsic_bus_scale_pdata = {
768 hsic_bus_scale_usecases,
769 ARRAY_SIZE(hsic_bus_scale_usecases),
770 .name = "hsic",
771};
772
Hemant Kumara945b472012-01-25 15:08:06 -0800773static struct msm_hsic_host_platform_data msm_hsic_pdata = {
Hemant Kumare6275972012-02-29 20:06:21 -0800774 .strobe = 88,
775 .data = 89,
776 .bus_scale_table = &hsic_bus_scale_pdata,
Hemant Kumara945b472012-01-25 15:08:06 -0800777};
778#else
779static struct msm_hsic_host_platform_data msm_hsic_pdata;
780#endif
781
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800782#define PID_MAGIC_ID 0x71432909
783#define SERIAL_NUM_MAGIC_ID 0x61945374
784#define SERIAL_NUMBER_LENGTH 127
785#define DLOAD_USB_BASE_ADD 0x2A03F0C8
786
787struct magic_num_struct {
788 uint32_t pid;
789 uint32_t serial_num;
790};
791
792struct dload_struct {
793 uint32_t reserved1;
794 uint32_t reserved2;
795 uint32_t reserved3;
796 uint16_t reserved4;
797 uint16_t pid;
798 char serial_number[SERIAL_NUMBER_LENGTH];
799 uint16_t reserved5;
800 struct magic_num_struct magic_struct;
801};
802
803static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
804{
805 struct dload_struct __iomem *dload = 0;
806
807 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
808 if (!dload) {
809 pr_err("%s: cannot remap I/O memory region: %08x\n",
810 __func__, DLOAD_USB_BASE_ADD);
811 return -ENXIO;
812 }
813
814 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
815 __func__, dload, pid, snum);
816 /* update pid */
817 dload->magic_struct.pid = PID_MAGIC_ID;
818 dload->pid = pid;
819
820 /* update serial number */
821 dload->magic_struct.serial_num = 0;
822 if (!snum) {
823 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
824 goto out;
825 }
826
827 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
828 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
829out:
830 iounmap(dload);
831 return 0;
832}
833
834static struct android_usb_platform_data android_usb_pdata = {
835 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
836};
837
Hemant Kumar4933b072011-10-17 23:43:11 -0700838static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800839 .name = "android_usb",
840 .id = -1,
841 .dev = {
842 .platform_data = &android_usb_pdata,
843 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700844};
845
Hemant Kumar7620eed2012-02-26 09:08:43 -0800846/* Bandwidth requests (zero) if no vote placed */
847static struct msm_bus_vectors usb_init_vectors[] = {
848 {
849 .src = MSM_BUS_MASTER_SPS,
850 .dst = MSM_BUS_SLAVE_EBI_CH0,
851 .ab = 0,
852 .ib = 0,
853 },
854};
855
856/* Bus bandwidth requests in Bytes/sec */
857static struct msm_bus_vectors usb_max_vectors[] = {
858 {
859 .src = MSM_BUS_MASTER_SPS,
860 .dst = MSM_BUS_SLAVE_EBI_CH0,
861 .ab = 60000000, /* At least 480Mbps on bus. */
862 .ib = 960000000, /* MAX bursts rate */
863 },
864};
865
866static struct msm_bus_paths usb_bus_scale_usecases[] = {
867 {
868 ARRAY_SIZE(usb_init_vectors),
869 usb_init_vectors,
870 },
871 {
872 ARRAY_SIZE(usb_max_vectors),
873 usb_max_vectors,
874 },
875};
876
877static struct msm_bus_scale_pdata usb_bus_scale_pdata = {
878 usb_bus_scale_usecases,
879 ARRAY_SIZE(usb_bus_scale_usecases),
880 .name = "usb",
881};
882
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700883static int phy_init_seq[] = {
884 0x38, 0x81, /* update DC voltage level */
885 0x24, 0x82, /* set pre-emphasis and rise/fall time */
886 -1
887};
888
Vijayavardhan Vennapusa4fa13692012-08-02 14:35:03 +0530889#define PMIC_GPIO_DP 27 /* PMIC GPIO for D+ change */
890#define PMIC_GPIO_DP_IRQ PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PMIC_GPIO_DP)
Jack Pham87f202f2012-08-06 00:24:22 -0700891#define MSM_MPM_PIN_USB1_OTGSESSVLD 40
892
Hemant Kumar4933b072011-10-17 23:43:11 -0700893static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800894 .mode = USB_OTG,
895 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700896 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800897 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
898 .power_budget = 750,
Hemant Kumar7620eed2012-02-26 09:08:43 -0800899 .bus_scale_table = &usb_bus_scale_pdata,
Vamsi Krishna1f8704c2012-03-29 18:24:24 -0700900 .phy_init_seq = phy_init_seq,
Jack Pham87f202f2012-08-06 00:24:22 -0700901 .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD,
Hemant Kumar4933b072011-10-17 23:43:11 -0700902};
903
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800904static struct msm_usb_host_platform_data msm_ehci_host_pdata3 = {
Manu Gautam91223e02011-11-08 15:27:22 +0530905 .power_budget = 500,
906};
907
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800908#ifdef CONFIG_USB_EHCI_MSM_HOST4
909static struct msm_usb_host_platform_data msm_ehci_host_pdata4;
910#endif
911
Manu Gautam91223e02011-11-08 15:27:22 +0530912static void __init apq8064_ehci_host_init(void)
913{
Chiranjeevi Velempatib822fa32012-05-23 22:05:59 +0530914 if (machine_is_apq8064_liquid() || machine_is_mpq8064_cdp() ||
915 machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv()) {
916 if (machine_is_apq8064_liquid())
917 msm_ehci_host_pdata3.dock_connect_irq =
918 PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
Vijayavardhan Vennapusa4fa13692012-08-02 14:35:03 +0530919 else
920 msm_ehci_host_pdata3.pmic_gpio_dp_irq =
921 PMIC_GPIO_DP_IRQ;
Hemant Kumar56925352012-02-13 16:59:52 -0800922
Manu Gautam91223e02011-11-08 15:27:22 +0530923 apq8064_device_ehci_host3.dev.platform_data =
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800924 &msm_ehci_host_pdata3;
Manu Gautam91223e02011-11-08 15:27:22 +0530925 platform_device_register(&apq8064_device_ehci_host3);
Hemant Kumar1d66e1c2012-02-13 15:24:59 -0800926
927#ifdef CONFIG_USB_EHCI_MSM_HOST4
928 apq8064_device_ehci_host4.dev.platform_data =
929 &msm_ehci_host_pdata4;
930 platform_device_register(&apq8064_device_ehci_host4);
931#endif
Manu Gautam91223e02011-11-08 15:27:22 +0530932 }
933}
934
David Keitel2f613d92012-02-15 11:29:16 -0800935static struct smb349_platform_data smb349_data __initdata = {
936 .en_n_gpio = PM8921_GPIO_PM_TO_SYS(37),
937 .chg_susp_gpio = PM8921_GPIO_PM_TO_SYS(30),
938 .chg_current_ma = 2200,
939};
940
941static struct i2c_board_info smb349_charger_i2c_info[] __initdata = {
942 {
943 I2C_BOARD_INFO(SMB349_NAME, 0x1B),
944 .platform_data = &smb349_data,
945 },
946};
947
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800948struct sx150x_platform_data apq8064_sx150x_data[] = {
949 [SX150X_EPM] = {
950 .gpio_base = GPIO_EPM_EXPANDER_BASE,
951 .oscio_is_gpo = false,
952 .io_pullup_ena = 0x0,
953 .io_pulldn_ena = 0x0,
954 .io_open_drain_ena = 0x0,
955 .io_polarity = 0,
956 .irq_summary = -1,
957 },
958};
959
960static struct epm_chan_properties ads_adc_channel_data[] = {
Yan Hec942e402012-08-31 11:14:58 -0700961 {10, 100}, {1000, 1}, {10, 100}, {1000, 1},
962 {10, 100}, {1000, 1}, {10, 100}, {1000, 1},
963 {10, 100}, {20, 100}, {500, 100}, {5, 100},
964 {1000, 1}, {200, 100}, {50, 100}, {10, 100},
965 {510, 100}, {50, 100}, {20, 100}, {100, 100},
966 {510, 100}, {20, 100}, {50, 100}, {200, 100},
967 {10, 100}, {20, 100}, {1000, 1}, {10, 100},
968 {200, 100}, {510, 100}, {1000, 100}, {200, 100},
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -0800969};
970
971static struct epm_adc_platform_data epm_adc_pdata = {
972 .channel = ads_adc_channel_data,
973 .bus_id = 0x0,
974 .epm_i2c_board_info = {
975 .type = "sx1509q",
976 .addr = 0x3e,
977 .platform_data = &apq8064_sx150x_data[SX150X_EPM],
978 },
979 .gpio_expander_base_addr = GPIO_EPM_EXPANDER_BASE,
980};
981
982static struct platform_device epm_adc_device = {
983 .name = "epm_adc",
984 .id = -1,
985 .dev = {
986 .platform_data = &epm_adc_pdata,
987 },
988};
989
990static void __init apq8064_epm_adc_init(void)
991{
992 epm_adc_pdata.num_channels = 32;
993 epm_adc_pdata.num_adc = 2;
994 epm_adc_pdata.chan_per_adc = 16;
995 epm_adc_pdata.chan_per_mux = 8;
996};
997
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800998/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
999 * 4 micbiases are used to power various analog and digital
1000 * microphones operating at 1800 mV. Technically, all micbiases
1001 * can source from single cfilter since all microphones operate
1002 * at the same voltage level. The arrangement below is to make
1003 * sure all cfilters are exercised. LDO_H regulator ouput level
1004 * does not need to be as high as 2.85V. It is choosen for
1005 * microphone sensitivity purpose.
1006 */
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301007static struct wcd9xxx_pdata apq8064_tabla_platform_data = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001008 .slimbus_slave_device = {
1009 .name = "tabla-slave",
1010 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
1011 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001012 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001013 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301014 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001015 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1016 .micbias = {
1017 .ldoh_v = TABLA_LDOH_2P85_V,
1018 .cfilt1_mv = 1800,
Bhalchandra Gajare975c53a2012-08-10 12:16:49 -07001019 .cfilt2_mv = 2700,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001020 .cfilt3_mv = 1800,
1021 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1022 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1023 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1024 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301025 },
1026 .regulator = {
1027 {
1028 .name = "CDC_VDD_CP",
1029 .min_uV = 1800000,
1030 .max_uV = 1800000,
1031 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1032 },
1033 {
1034 .name = "CDC_VDDA_RX",
1035 .min_uV = 1800000,
1036 .max_uV = 1800000,
1037 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1038 },
1039 {
1040 .name = "CDC_VDDA_TX",
1041 .min_uV = 1800000,
1042 .max_uV = 1800000,
1043 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1044 },
1045 {
1046 .name = "VDDIO_CDC",
1047 .min_uV = 1800000,
1048 .max_uV = 1800000,
1049 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1050 },
1051 {
1052 .name = "VDDD_CDC_D",
1053 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001054 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301055 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1056 },
1057 {
1058 .name = "CDC_VDDA_A_1P2V",
1059 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001060 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301061 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1062 },
1063 },
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001064};
1065
1066static struct slim_device apq8064_slim_tabla = {
1067 .name = "tabla-slim",
1068 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
1069 .dev = {
1070 .platform_data = &apq8064_tabla_platform_data,
1071 },
1072};
1073
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301074static struct wcd9xxx_pdata apq8064_tabla20_platform_data = {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001075 .slimbus_slave_device = {
1076 .name = "tabla-slave",
1077 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
1078 },
1079 .irq = MSM_GPIO_TO_INT(42),
1080 .irq_base = TABLA_INTERRUPT_BASE,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301081 .num_irqs = NR_WCD9XXX_IRQS,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001082 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
1083 .micbias = {
1084 .ldoh_v = TABLA_LDOH_2P85_V,
1085 .cfilt1_mv = 1800,
Bhalchandra Gajare975c53a2012-08-10 12:16:49 -07001086 .cfilt2_mv = 2700,
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001087 .cfilt3_mv = 1800,
1088 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
1089 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
1090 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
1091 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301092 },
1093 .regulator = {
1094 {
1095 .name = "CDC_VDD_CP",
1096 .min_uV = 1800000,
1097 .max_uV = 1800000,
1098 .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX,
1099 },
1100 {
1101 .name = "CDC_VDDA_RX",
1102 .min_uV = 1800000,
1103 .max_uV = 1800000,
1104 .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX,
1105 },
1106 {
1107 .name = "CDC_VDDA_TX",
1108 .min_uV = 1800000,
1109 .max_uV = 1800000,
1110 .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX,
1111 },
1112 {
1113 .name = "VDDIO_CDC",
1114 .min_uV = 1800000,
1115 .max_uV = 1800000,
1116 .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX,
1117 },
1118 {
1119 .name = "VDDD_CDC_D",
1120 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001121 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301122 .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX,
1123 },
1124 {
1125 .name = "CDC_VDDA_A_1P2V",
1126 .min_uV = 1225000,
David Collins62debe82012-06-06 17:01:03 -07001127 .max_uV = 1250000,
Asish Bhattacharyab1aeae22012-02-15 08:29:28 +05301128 .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX,
1129 },
1130 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001131};
1132
1133static struct slim_device apq8064_slim_tabla20 = {
1134 .name = "tabla2x-slim",
1135 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
1136 .dev = {
1137 .platform_data = &apq8064_tabla20_platform_data,
1138 },
1139};
1140
Santosh Mardi695be0d2012-04-10 23:21:12 +05301141/* enable the level shifter for cs8427 to make sure the I2C
1142 * clock is running at 100KHz and voltage levels are at 3.3
1143 * and 5 volts
1144 */
1145static int enable_100KHz_ls(int enable)
1146{
1147 int ret = 0;
1148 if (enable) {
1149 ret = gpio_request(SX150X_GPIO(1, 10),
1150 "cs8427_100KHZ_ENABLE");
1151 if (ret) {
1152 pr_err("%s: Failed to request gpio %d\n", __func__,
1153 SX150X_GPIO(1, 10));
1154 return ret;
1155 }
1156 gpio_direction_output(SX150X_GPIO(1, 10), 1);
Santosh Mardid706fcf2012-08-31 19:26:54 +05301157 } else {
1158 gpio_direction_output(SX150X_GPIO(1, 10), 0);
Santosh Mardi695be0d2012-04-10 23:21:12 +05301159 gpio_free(SX150X_GPIO(1, 10));
Santosh Mardid706fcf2012-08-31 19:26:54 +05301160 }
Santosh Mardi695be0d2012-04-10 23:21:12 +05301161 return ret;
1162}
1163
Santosh Mardieff9a742012-04-09 23:23:39 +05301164static struct cs8427_platform_data cs8427_i2c_platform_data = {
1165 .irq = SX150X_GPIO(1, 4),
1166 .reset_gpio = SX150X_GPIO(1, 6),
Santosh Mardi695be0d2012-04-10 23:21:12 +05301167 .enable = enable_100KHz_ls,
Santosh Mardieff9a742012-04-09 23:23:39 +05301168};
1169
1170static struct i2c_board_info cs8427_device_info[] __initdata = {
1171 {
1172 I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
1173 .platform_data = &cs8427_i2c_platform_data,
1174 },
1175};
1176
Amy Maloche70090f992012-02-16 16:35:26 -08001177#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
1178#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
1179#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
David Collins6f7c3472012-08-22 13:18:06 -07001180#define ISA1200_HAP_CLK_PM8921 PM8921_GPIO_PM_TO_SYS(44)
1181#define ISA1200_HAP_CLK_PM8917 PM8921_GPIO_PM_TO_SYS(38)
Amy Maloche70090f992012-02-16 16:35:26 -08001182
Mohan Pallaka2d877602012-05-11 13:07:30 +05301183static int isa1200_clk_enable(bool on)
Amy Maloche70090f992012-02-16 16:35:26 -08001184{
David Collins6f7c3472012-08-22 13:18:06 -07001185 unsigned int gpio = ISA1200_HAP_CLK_PM8921;
Amy Maloche8f973892012-03-26 14:53:13 -07001186 int rc = 0;
1187
David Collins6f7c3472012-08-22 13:18:06 -07001188 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
1189 gpio = ISA1200_HAP_CLK_PM8917;
1190
1191 gpio_set_value_cansleep(gpio, on);
Amy Maloche70090f992012-02-16 16:35:26 -08001192
Mohan Pallaka2d877602012-05-11 13:07:30 +05301193 if (on) {
Amy Maloche8f973892012-03-26 14:53:13 -07001194 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301195 if (rc) {
1196 pr_err("%s: unable to write aux clock register(%d)\n",
1197 __func__, rc);
1198 goto err_gpio_dis;
1199 }
1200 } else {
Amy Maloche8f973892012-03-26 14:53:13 -07001201 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_NONE, true);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301202 if (rc)
1203 pr_err("%s: unable to write aux clock register(%d)\n",
1204 __func__, rc);
Amy Maloche8f973892012-03-26 14:53:13 -07001205 }
1206
1207 return rc;
Mohan Pallaka2d877602012-05-11 13:07:30 +05301208
1209err_gpio_dis:
David Collins6f7c3472012-08-22 13:18:06 -07001210 gpio_set_value_cansleep(gpio, !on);
Mohan Pallaka2d877602012-05-11 13:07:30 +05301211 return rc;
Amy Maloche70090f992012-02-16 16:35:26 -08001212}
1213
1214static int isa1200_dev_setup(bool enable)
1215{
David Collins6f7c3472012-08-22 13:18:06 -07001216 unsigned int gpio = ISA1200_HAP_CLK_PM8921;
Amy Maloche70090f992012-02-16 16:35:26 -08001217 int rc = 0;
1218
David Collins6f7c3472012-08-22 13:18:06 -07001219 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
1220 gpio = ISA1200_HAP_CLK_PM8917;
1221
Amy Maloche70090f992012-02-16 16:35:26 -08001222 if (!enable)
1223 goto free_gpio;
1224
David Collins6f7c3472012-08-22 13:18:06 -07001225 rc = gpio_request(gpio, "haptics_clk");
Amy Maloche70090f992012-02-16 16:35:26 -08001226 if (rc) {
1227 pr_err("%s: unable to request gpio %d config(%d)\n",
David Collins6f7c3472012-08-22 13:18:06 -07001228 __func__, gpio, rc);
Amy Maloche70090f992012-02-16 16:35:26 -08001229 return rc;
1230 }
1231
David Collins6f7c3472012-08-22 13:18:06 -07001232 rc = gpio_direction_output(gpio, 0);
Amy Maloche70090f992012-02-16 16:35:26 -08001233 if (rc) {
1234 pr_err("%s: unable to set direction\n", __func__);
1235 goto free_gpio;
1236 }
1237
1238 return 0;
1239
1240free_gpio:
David Collins6f7c3472012-08-22 13:18:06 -07001241 gpio_free(gpio);
Amy Maloche70090f992012-02-16 16:35:26 -08001242 return rc;
1243}
1244
1245static struct isa1200_regulator isa1200_reg_data[] = {
1246 {
1247 .name = "vddp",
1248 .min_uV = ISA_I2C_VTG_MIN_UV,
1249 .max_uV = ISA_I2C_VTG_MAX_UV,
1250 .load_uA = ISA_I2C_CURR_UA,
1251 },
1252};
1253
1254static struct isa1200_platform_data isa1200_1_pdata = {
1255 .name = "vibrator",
1256 .dev_setup = isa1200_dev_setup,
Mohan Pallaka2d877602012-05-11 13:07:30 +05301257 .clk_enable = isa1200_clk_enable,
Mohan Pallaka32f20a72012-06-14 14:41:11 +05301258 .need_pwm_clk = true,
Amy Maloche70090f992012-02-16 16:35:26 -08001259 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
1260 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
1261 .max_timeout = 15000,
1262 .mode_ctrl = PWM_GEN_MODE,
1263 .pwm_fd = {
1264 .pwm_div = 256,
1265 },
1266 .is_erm = false,
1267 .smart_en = true,
1268 .ext_clk_en = true,
1269 .chip_en = 1,
1270 .regulator_info = isa1200_reg_data,
1271 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
1272};
1273
1274static struct i2c_board_info isa1200_board_info[] __initdata = {
1275 {
1276 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
1277 .platform_data = &isa1200_1_pdata,
1278 },
1279};
Jing Lin21ed4de2012-02-05 15:53:28 -08001280/* configuration data for mxt1386e using V2.1 firmware */
1281static const u8 mxt1386e_config_data_v2_1[] = {
1282 /* T6 Object */
1283 0, 0, 0, 0, 0, 0,
1284 /* T38 Object */
Jing Line4c47042012-08-31 10:54:44 -07001285 14, 3, 0, 5, 7, 12, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001286 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1287 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1288 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1289 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1291 0, 0, 0, 0,
1292 /* T7 Object */
Jing Line4c47042012-08-31 10:54:44 -07001293 32, 10, 50,
Jing Lin21ed4de2012-02-05 15:53:28 -08001294 /* T8 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001295 25, 0, 20, 20, 0, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001296 /* T9 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001297 139, 0, 0, 26, 42, 0, 32, 80, 2, 5,
Jing Line4c47042012-08-31 10:54:44 -07001298 0, 5, 5, 79, 10, 30, 10, 10, 255, 2,
Jing Linf1208fd2012-02-23 11:15:42 -08001299 85, 5, 0, 5, 9, 5, 12, 35, 70, 40,
1300 20, 5, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001301 /* T18 Object */
1302 0, 0,
1303 /* T24 Object */
1304 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1305 0, 0, 0, 0, 0, 0, 0, 0, 0,
1306 /* T25 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001307 1, 0, 60, 115, 156, 99,
Jing Lin21ed4de2012-02-05 15:53:28 -08001308 /* T27 Object */
1309 0, 0, 0, 0, 0, 0, 0,
1310 /* T40 Object */
1311 0, 0, 0, 0, 0,
1312 /* T42 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001313 0, 0, 255, 0, 255, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001314 /* T43 Object */
1315 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
1316 16,
1317 /* T46 Object */
Jing Linf1208fd2012-02-23 11:15:42 -08001318 68, 0, 16, 16, 0, 0, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001319 /* T47 Object */
1320 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
1321 /* T48 Object */
Jing Lin943fcec2012-05-25 13:58:57 -07001322 1, 64, 64, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001323 32, 40, 0, 10, 10, 0, 0, 100, 10, 90,
1324 0, 0, 0, 0, 0, 0, 0, 10, 1, 10,
1325 52, 10, 12, 0, 33, 0, 1, 0, 0, 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001326 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1327 0, 0, 0, 0,
1328 /* T56 Object */
1329 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1330 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Jing Linf1208fd2012-02-23 11:15:42 -08001333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1334 0,
Jing Lin21ed4de2012-02-05 15:53:28 -08001335};
1336
1337#define MXT_TS_GPIO_IRQ 6
1338#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
1339#define MXT_TS_RESET_GPIO 33
1340
1341static struct mxt_config_info mxt_config_array[] = {
1342 {
1343 .config = mxt1386e_config_data_v2_1,
1344 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1345 .family_id = 0xA0,
1346 .variant_id = 0x7,
1347 .version = 0x21,
1348 .build = 0xAA,
Jing Linef4aa9b2012-03-26 12:01:41 -07001349 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
1350 .fw_name = "atmel_8064_liquid_v2_2_AA.hex",
1351 },
1352 {
1353 /* The config data for V2.2.AA is the same as for V2.1.AA */
1354 .config = mxt1386e_config_data_v2_1,
1355 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
1356 .family_id = 0xA0,
1357 .variant_id = 0x7,
1358 .version = 0x22,
1359 .build = 0xAA,
1360 .bootldr_id = MXT_BOOTLOADER_ID_1386E,
Jing Lin21ed4de2012-02-05 15:53:28 -08001361 },
1362};
1363
1364static struct mxt_platform_data mxt_platform_data = {
1365 .config_array = mxt_config_array,
1366 .config_array_size = ARRAY_SIZE(mxt_config_array),
Mohan Pallaka56a1a5d2012-02-23 12:05:13 -08001367 .panel_minx = 0,
1368 .panel_maxx = 1365,
1369 .panel_miny = 0,
1370 .panel_maxy = 767,
1371 .disp_minx = 0,
1372 .disp_maxx = 1365,
1373 .disp_miny = 0,
1374 .disp_maxy = 767,
Anirudh Ghayal39dbe3f2012-04-13 15:43:16 +05301375 .irqflags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
Jing Lin21ed4de2012-02-05 15:53:28 -08001376 .i2c_pull_up = true,
1377 .reset_gpio = MXT_TS_RESET_GPIO,
1378 .irq_gpio = MXT_TS_GPIO_IRQ,
1379};
1380
1381static struct i2c_board_info mxt_device_info[] __initdata = {
1382 {
1383 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
1384 .platform_data = &mxt_platform_data,
1385 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
1386 },
1387};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001388#define CYTTSP_TS_GPIO_IRQ 6
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001389#define CYTTSP_TS_GPIO_SLEEP 33
Amy Maloche609bb5e2012-08-03 09:41:42 -07001390#define CYTTSP_TS_GPIO_SLEEP_ALT 12
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001391
1392static ssize_t tma340_vkeys_show(struct kobject *kobj,
1393 struct kobj_attribute *attr, char *buf)
1394{
1395 return snprintf(buf, 200,
1396 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
1397 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
1398 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
1399 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
1400 "\n");
1401}
1402
1403static struct kobj_attribute tma340_vkeys_attr = {
1404 .attr = {
1405 .mode = S_IRUGO,
1406 },
1407 .show = &tma340_vkeys_show,
1408};
1409
1410static struct attribute *tma340_properties_attrs[] = {
1411 &tma340_vkeys_attr.attr,
1412 NULL
1413};
1414
1415static struct attribute_group tma340_properties_attr_group = {
1416 .attrs = tma340_properties_attrs,
1417};
1418
1419static int cyttsp_platform_init(struct i2c_client *client)
1420{
1421 int rc = 0;
1422 static struct kobject *tma340_properties_kobj;
1423
1424 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
1425 tma340_properties_kobj = kobject_create_and_add("board_properties",
1426 NULL);
1427 if (tma340_properties_kobj)
1428 rc = sysfs_create_group(tma340_properties_kobj,
1429 &tma340_properties_attr_group);
1430 if (!tma340_properties_kobj || rc)
1431 pr_err("%s: failed to create board_properties\n",
1432 __func__);
1433
1434 return 0;
1435}
1436
1437static struct cyttsp_regulator cyttsp_regulator_data[] = {
1438 {
1439 .name = "vdd",
1440 .min_uV = CY_TMA300_VTG_MIN_UV,
1441 .max_uV = CY_TMA300_VTG_MAX_UV,
1442 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1443 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
1444 },
1445 {
1446 .name = "vcc_i2c",
1447 .min_uV = CY_I2C_VTG_MIN_UV,
1448 .max_uV = CY_I2C_VTG_MAX_UV,
1449 .hpm_load_uA = CY_I2C_CURR_UA,
1450 .lpm_load_uA = CY_I2C_CURR_UA,
1451 },
1452};
1453
1454static struct cyttsp_platform_data cyttsp_pdata = {
1455 .panel_maxx = 634,
1456 .panel_maxy = 1166,
Amy Maloche684fcda2012-12-05 14:28:53 -08001457 .disp_minx = 18,
1458 .disp_maxx = 617,
1459 .disp_miny = 18,
1460 .disp_maxy = 1041,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001461 .flags = 0x01,
1462 .gen = CY_GEN3,
1463 .use_st = CY_USE_ST,
1464 .use_mt = CY_USE_MT,
1465 .use_hndshk = CY_SEND_HNDSHK,
1466 .use_trk_id = CY_USE_TRACKING_ID,
1467 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
1468 .use_gestures = CY_USE_GESTURES,
1469 .fw_fname = "cyttsp_8064_mtp.hex",
1470 /* change act_intrvl to customize the Active power state
1471 * scanning/processing refresh interval for Operating mode
1472 */
1473 .act_intrvl = CY_ACT_INTRVL_DFLT,
1474 /* change tch_tmout to customize the touch timeout for the
1475 * Active power state for Operating mode
1476 */
1477 .tch_tmout = CY_TCH_TMOUT_DFLT,
1478 /* change lp_intrvl to customize the Low Power power state
1479 * scanning/processing refresh interval for Operating mode
1480 */
1481 .lp_intrvl = CY_LP_INTRVL_DFLT,
1482 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
Amy Maloche9ba3ffe2012-04-26 10:31:20 -07001483 .resout_gpio = -1,
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001484 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
1485 .regulator_info = cyttsp_regulator_data,
1486 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
1487 .init = cyttsp_platform_init,
1488 .correct_fw_ver = 17,
1489};
1490
1491static struct i2c_board_info cyttsp_info[] __initdata = {
1492 {
1493 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
1494 .platform_data = &cyttsp_pdata,
1495 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
1496 },
1497};
Jing Lin21ed4de2012-02-05 15:53:28 -08001498
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001499#define MSM_WCNSS_PHYS 0x03000000
1500#define MSM_WCNSS_SIZE 0x280000
1501
1502static struct resource resources_wcnss_wlan[] = {
1503 {
1504 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1505 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
1506 .name = "wcnss_wlanrx_irq",
1507 .flags = IORESOURCE_IRQ,
1508 },
1509 {
1510 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1511 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
1512 .name = "wcnss_wlantx_irq",
1513 .flags = IORESOURCE_IRQ,
1514 },
1515 {
1516 .start = MSM_WCNSS_PHYS,
1517 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
1518 .name = "wcnss_mmio",
1519 .flags = IORESOURCE_MEM,
1520 },
1521 {
1522 .start = 64,
1523 .end = 68,
1524 .name = "wcnss_gpios_5wire",
1525 .flags = IORESOURCE_IO,
1526 },
1527};
1528
1529static struct qcom_wcnss_opts qcom_wcnss_pdata = {
1530 .has_48mhz_xo = 1,
1531};
1532
1533static struct platform_device msm_device_wcnss_wlan = {
1534 .name = "wcnss_wlan",
1535 .id = 0,
1536 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
1537 .resource = resources_wcnss_wlan,
1538 .dev = {.platform_data = &qcom_wcnss_pdata},
1539};
1540
Ankit Vermab7c26e62012-02-28 15:04:15 -08001541static struct platform_device msm_device_iris_fm __devinitdata = {
1542 .name = "iris_fm",
1543 .id = -1,
1544};
1545
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001546#ifdef CONFIG_QSEECOM
1547/* qseecom bus scaling */
1548static struct msm_bus_vectors qseecom_clks_init_vectors[] = {
1549 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001550 .src = MSM_BUS_MASTER_ADM_PORT0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001551 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001552 .ab = 0,
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001553 .ib = 0,
1554 },
1555 {
1556 .src = MSM_BUS_MASTER_ADM_PORT1,
1557 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1558 .ab = 0,
1559 .ib = 0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001560 },
1561 {
1562 .src = MSM_BUS_MASTER_SPDM,
1563 .dst = MSM_BUS_SLAVE_SPDM,
1564 .ib = 0,
1565 .ab = 0,
1566 },
1567};
1568
1569static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = {
1570 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001571 .src = MSM_BUS_MASTER_ADM_PORT0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001572 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001573 .ab = 70000000UL,
1574 .ib = 70000000UL,
1575 },
1576 {
1577 .src = MSM_BUS_MASTER_ADM_PORT1,
1578 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1579 .ab = 2480000000UL,
1580 .ib = 2480000000UL,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001581 },
1582 {
1583 .src = MSM_BUS_MASTER_SPDM,
1584 .dst = MSM_BUS_SLAVE_SPDM,
1585 .ib = 0,
1586 .ab = 0,
1587 },
1588};
1589
1590static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = {
1591 {
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001592 .src = MSM_BUS_MASTER_ADM_PORT0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001593 .dst = MSM_BUS_SLAVE_EBI_CH0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001594 .ab = 0,
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001595 .ib = 0,
1596 },
1597 {
1598 .src = MSM_BUS_MASTER_ADM_PORT1,
1599 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1600 .ab = 0,
1601 .ib = 0,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001602 },
1603 {
1604 .src = MSM_BUS_MASTER_SPDM,
1605 .dst = MSM_BUS_SLAVE_SPDM,
1606 .ib = (64 * 8) * 1000000UL,
1607 .ab = (64 * 8) * 100000UL,
1608 },
1609};
1610
Ramesh Masavarapu4f091cb2012-10-03 10:18:06 -07001611static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = {
1612 {
1613 .src = MSM_BUS_MASTER_ADM_PORT0,
1614 .dst = MSM_BUS_SLAVE_EBI_CH0,
1615 .ab = 70000000UL,
1616 .ib = 70000000UL,
1617 },
1618 {
1619 .src = MSM_BUS_MASTER_ADM_PORT1,
1620 .dst = MSM_BUS_SLAVE_GSBI1_UART,
1621 .ab = 2480000000UL,
1622 .ib = 2480000000UL,
1623 },
1624 {
1625 .src = MSM_BUS_MASTER_SPDM,
1626 .dst = MSM_BUS_SLAVE_SPDM,
1627 .ib = (64 * 8) * 1000000UL,
1628 .ab = (64 * 8) * 100000UL,
1629 },
1630};
1631
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001632static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = {
1633 {
1634 ARRAY_SIZE(qseecom_clks_init_vectors),
1635 qseecom_clks_init_vectors,
1636 },
1637 {
1638 ARRAY_SIZE(qseecom_enable_dfab_vectors),
Ramesh Masavarapu037942d2012-09-04 11:52:57 -07001639 qseecom_enable_dfab_vectors,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001640 },
1641 {
1642 ARRAY_SIZE(qseecom_enable_sfpb_vectors),
1643 qseecom_enable_sfpb_vectors,
1644 },
Ramesh Masavarapu4f091cb2012-10-03 10:18:06 -07001645 {
1646 ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors),
1647 qseecom_enable_dfab_sfpb_vectors,
1648 },
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07001649};
1650
1651static struct msm_bus_scale_pdata qseecom_bus_pdata = {
1652 qseecom_hw_bus_scale_usecases,
1653 ARRAY_SIZE(qseecom_hw_bus_scale_usecases),
1654 .name = "qsee",
1655};
1656
1657static struct platform_device qseecom_device = {
1658 .name = "qseecom",
1659 .id = 0,
1660 .dev = {
1661 .platform_data = &qseecom_bus_pdata,
1662 },
1663};
1664#endif
1665
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001666#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1667 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
1668 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1669 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1670
1671#define QCE_SIZE 0x10000
1672#define QCE_0_BASE 0x11000000
1673
1674#define QCE_HW_KEY_SUPPORT 0
1675#define QCE_SHA_HMAC_SUPPORT 1
1676#define QCE_SHARE_CE_RESOURCE 3
1677#define QCE_CE_SHARED 0
1678
1679static struct resource qcrypto_resources[] = {
1680 [0] = {
1681 .start = QCE_0_BASE,
1682 .end = QCE_0_BASE + QCE_SIZE - 1,
1683 .flags = IORESOURCE_MEM,
1684 },
1685 [1] = {
1686 .name = "crypto_channels",
1687 .start = DMOV8064_CE_IN_CHAN,
1688 .end = DMOV8064_CE_OUT_CHAN,
1689 .flags = IORESOURCE_DMA,
1690 },
1691 [2] = {
1692 .name = "crypto_crci_in",
1693 .start = DMOV8064_CE_IN_CRCI,
1694 .end = DMOV8064_CE_IN_CRCI,
1695 .flags = IORESOURCE_DMA,
1696 },
1697 [3] = {
1698 .name = "crypto_crci_out",
1699 .start = DMOV8064_CE_OUT_CRCI,
1700 .end = DMOV8064_CE_OUT_CRCI,
1701 .flags = IORESOURCE_DMA,
1702 },
1703};
1704
1705static struct resource qcedev_resources[] = {
1706 [0] = {
1707 .start = QCE_0_BASE,
1708 .end = QCE_0_BASE + QCE_SIZE - 1,
1709 .flags = IORESOURCE_MEM,
1710 },
1711 [1] = {
1712 .name = "crypto_channels",
1713 .start = DMOV8064_CE_IN_CHAN,
1714 .end = DMOV8064_CE_OUT_CHAN,
1715 .flags = IORESOURCE_DMA,
1716 },
1717 [2] = {
1718 .name = "crypto_crci_in",
1719 .start = DMOV8064_CE_IN_CRCI,
1720 .end = DMOV8064_CE_IN_CRCI,
1721 .flags = IORESOURCE_DMA,
1722 },
1723 [3] = {
1724 .name = "crypto_crci_out",
1725 .start = DMOV8064_CE_OUT_CRCI,
1726 .end = DMOV8064_CE_OUT_CRCI,
1727 .flags = IORESOURCE_DMA,
1728 },
1729};
1730
1731#endif
1732
1733#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1734 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1735
1736static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
1737 .ce_shared = QCE_CE_SHARED,
1738 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1739 .hw_key_support = QCE_HW_KEY_SUPPORT,
1740 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001741 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001742};
1743
1744static struct platform_device qcrypto_device = {
1745 .name = "qcrypto",
1746 .id = 0,
1747 .num_resources = ARRAY_SIZE(qcrypto_resources),
1748 .resource = qcrypto_resources,
1749 .dev = {
1750 .coherent_dma_mask = DMA_BIT_MASK(32),
1751 .platform_data = &qcrypto_ce_hw_suppport,
1752 },
1753};
1754#endif
1755
1756#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1757 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1758
1759static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
1760 .ce_shared = QCE_CE_SHARED,
1761 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
1762 .hw_key_support = QCE_HW_KEY_SUPPORT,
1763 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -08001764 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001765};
1766
1767static struct platform_device qcedev_device = {
1768 .name = "qce",
1769 .id = 0,
1770 .num_resources = ARRAY_SIZE(qcedev_resources),
1771 .resource = qcedev_resources,
1772 .dev = {
1773 .coherent_dma_mask = DMA_BIT_MASK(32),
1774 .platform_data = &qcedev_ce_hw_suppport,
1775 },
1776};
1777#endif
1778
Joel Kingef390842012-05-23 16:42:48 -07001779static struct mdm_vddmin_resource mdm_vddmin_rscs = {
1780 .rpm_id = MSM_RPM_ID_VDDMIN_GPIO,
1781 .ap2mdm_vddmin_gpio = 30,
1782 .modes = 0x03,
1783 .drive_strength = 8,
1784 .mdm2ap_vddmin_gpio = 80,
1785};
1786
Joel King269aa602012-07-23 08:07:35 -07001787static struct gpiomux_setting mdm2ap_status_gpio_run_cfg = {
1788 .func = GPIOMUX_FUNC_GPIO,
1789 .drv = GPIOMUX_DRV_8MA,
1790 .pull = GPIOMUX_PULL_NONE,
1791};
1792
Joel Kingdacbc822012-01-25 13:30:57 -08001793static struct mdm_platform_data mdm_platform_data = {
1794 .mdm_version = "3.0",
1795 .ramdump_delay_ms = 2000,
Joel King14fe7fa2012-05-27 14:26:11 -07001796 .early_power_on = 1,
1797 .sfr_query = 1,
Joel Kingef390842012-05-23 16:42:48 -07001798 .vddmin_resource = &mdm_vddmin_rscs,
Hemant Kumara945b472012-01-25 15:08:06 -08001799 .peripheral_platform_device = &apq8064_device_hsic_host,
Ameya Thakurc9a7a842012-06-24 22:47:52 -07001800 .ramdump_timeout_ms = 120000,
Joel King269aa602012-07-23 08:07:35 -07001801 .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg,
Ameya Thakurffd21b02013-01-30 11:33:22 -08001802 .sysmon_subsys_id_valid = 1,
1803 .sysmon_subsys_id = SYSMON_SS_EXT_MODEM,
Joel Kingdacbc822012-01-25 13:30:57 -08001804};
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001805
Joel Kingfdde32b2013-02-06 17:38:05 -08001806static struct mdm_platform_data amdm_platform_data = {
1807 .mdm_version = "3.0",
1808 .ramdump_delay_ms = 2000,
1809 .early_power_on = 1,
1810 .sfr_query = 1,
1811 .send_shdn = 1,
1812 .vddmin_resource = &mdm_vddmin_rscs,
1813 .peripheral_platform_device = &apq8064_device_hsic_host,
1814 .ramdump_timeout_ms = 120000,
1815 .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg,
1816 .sysmon_subsys_id_valid = 1,
1817 .sysmon_subsys_id = SYSMON_SS_EXT_MODEM,
1818 .no_a2m_errfatal_on_ssr = 1,
1819};
1820
Ameya Thakur2702baf2013-01-30 11:55:25 -08001821static struct mdm_vddmin_resource bmdm_vddmin_rscs = {
1822 .rpm_id = MSM_RPM_ID_VDDMIN_GPIO,
1823 .ap2mdm_vddmin_gpio = 30,
1824 .modes = 0x03,
1825 .drive_strength = 8,
1826 .mdm2ap_vddmin_gpio = 64,
1827};
1828
1829static struct mdm_platform_data bmdm_platform_data = {
1830 .mdm_version = "3.0",
1831 .ramdump_delay_ms = 2000,
1832 .sfr_query = 1,
1833 .send_shdn = 1,
1834 .vddmin_resource = &bmdm_vddmin_rscs,
1835 .peripheral_platform_device = &apq8064_device_ehci_host3,
1836 .ramdump_timeout_ms = 120000,
1837 .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg,
Joel Kingfdde32b2013-02-06 17:38:05 -08001838 .sysmon_subsys_id_valid = 1,
1839 .sysmon_subsys_id = SYSMON_SS_EXT_MODEM2,
1840 .no_a2m_errfatal_on_ssr = 1,
Ameya Thakur2702baf2013-01-30 11:55:25 -08001841};
1842
Joel King57aefdd2013-03-11 13:46:05 -07001843static struct mdm_platform_data sglte2_mdm_platform_data = {
1844 .mdm_version = "3.0",
1845 .ramdump_delay_ms = 2000,
1846 .early_power_on = 1,
1847 .sfr_query = 1,
1848 .vddmin_resource = &mdm_vddmin_rscs,
1849 .peripheral_platform_device = &apq8064_device_hsic_host,
1850 .ramdump_timeout_ms = 120000,
1851 .mdm2ap_status_gpio_run_cfg = &mdm2ap_status_gpio_run_cfg,
1852 .sysmon_subsys_id_valid = 1,
1853 .sysmon_subsys_id = SYSMON_SS_EXT_MODEM,
1854 .no_a2m_errfatal_on_ssr = 1,
1855};
1856
Joel King3166e892013-02-26 11:16:08 -08001857static struct mdm_platform_data sglte2_qsc_platform_data = {
1858 .mdm_version = "3.0",
1859 .ramdump_delay_ms = 2000,
1860 .ramdump_timeout_ms = 600000,
1861 .no_powerdown_after_ramdumps = 1,
1862 .image_upgrade_supported = 1,
Joel King57aefdd2013-03-11 13:46:05 -07001863 .no_a2m_errfatal_on_ssr = 1,
Joel King68cb5462013-03-15 12:54:33 -07001864 .no_reset_on_first_powerup = 1,
Joel King3166e892013-02-26 11:16:08 -08001865};
1866
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001867static struct tsens_platform_data apq_tsens_pdata = {
1868 .tsens_factor = 1000,
1869 .hw_type = APQ_8064,
1870 .tsens_num_sensor = 11,
1871 .slope = {1176, 1176, 1154, 1176, 1111,
1872 1132, 1132, 1199, 1132, 1199, 1132},
1873};
1874
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07001875static struct platform_device msm_tsens_device = {
1876 .name = "tsens8960-tm",
1877 .id = -1,
1878};
1879
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06001880static struct msm_thermal_data msm_thermal_pdata = {
1881 .sensor_id = 7,
Eugene Seah2ee4a5d2012-06-25 18:16:41 -06001882 .poll_ms = 250,
1883 .limit_temp_degC = 60,
1884 .temp_hysteresis_degC = 10,
1885 .freq_step = 2,
Praveen Chidambaram771c7892013-02-21 11:44:38 -07001886 .core_limit_temp_degC = 80,
1887 .core_temp_hysteresis_degC = 10,
1888 .core_control_mask = 0xe,
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06001889};
1890
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001891#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001892static void __init apq8064_map_io(void)
1893{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001894 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001895 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001896 if (socinfo_init() < 0)
1897 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001898}
1899
1900static void __init apq8064_init_irq(void)
1901{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001902 struct msm_mpm_device_data *data = NULL;
1903
1904#ifdef CONFIG_MSM_MPM
1905 data = &apq8064_mpm_dev_data;
1906#endif
1907
1908 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001909 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1910 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001911}
1912
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001913static struct platform_device msm8064_device_saw_regulator_core0 = {
1914 .name = "saw-regulator",
1915 .id = 0,
1916 .dev = {
1917 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1918 },
1919};
1920
1921static struct platform_device msm8064_device_saw_regulator_core1 = {
1922 .name = "saw-regulator",
1923 .id = 1,
1924 .dev = {
1925 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1926 },
1927};
1928
1929static struct platform_device msm8064_device_saw_regulator_core2 = {
1930 .name = "saw-regulator",
1931 .id = 2,
1932 .dev = {
1933 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1934 },
1935};
1936
1937static struct platform_device msm8064_device_saw_regulator_core3 = {
1938 .name = "saw-regulator",
1939 .id = 3,
1940 .dev = {
1941 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001942
1943 },
1944};
1945
Oluwafemi Adeyemif5a31422012-03-08 16:58:45 -08001946static struct msm_rpmrs_level msm_rpmrs_levels[] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001947 {
1948 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1949 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1950 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001951 1, 784, 180000, 100,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001952 },
1953
1954 {
Anji Jonnala85b29ff2013-01-15 14:12:45 +05301955 MSM_PM_SLEEP_MODE_RETENTION,
1956 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1957 true,
1958 415, 715, 340827, 475,
1959 },
1960
1961 {
Praveen Chidambaram78499012011-11-01 17:15:17 -06001962 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1963 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1964 true,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001965 1300, 228, 1200000, 2000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001966 },
1967
1968 {
1969 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1970 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1971 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001972 2000, 138, 1208400, 3200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001973 },
1974
1975 {
1976 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
Praveen Chidambarame3380672012-02-08 10:32:27 -07001977 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH),
1978 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001979 6000, 119, 1850300, 9000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001980 },
1981
1982 {
1983 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1984 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1985 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001986 9200, 68, 2839200, 16400,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001987 },
1988
1989 {
1990 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1991 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1992 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06001993 10300, 63, 3128000, 18200,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001994 },
1995
1996 {
1997 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1998 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1999 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002000 18000, 10, 4602600, 27000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002001 },
2002
2003 {
2004 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
2005 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
2006 false,
Girish Mahadevan9bf71562012-04-13 14:41:44 -06002007 20000, 2, 5752000, 32000,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002008 },
2009};
2010
2011static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
2012 .mode = MSM_PM_BOOT_CONFIG_TZ,
2013};
2014
2015static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
2016 .levels = &msm_rpmrs_levels[0],
2017 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
2018 .vdd_mem_levels = {
2019 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
2020 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
2021 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
2022 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
2023 },
2024 .vdd_dig_levels = {
2025 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
2026 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
2027 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
2028 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
2029 },
2030 .vdd_mask = 0x7FFFFF,
2031 .rpmrs_target_id = {
2032 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
2033 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
2034 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
2035 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
2036 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
2037 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
2038 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
2039 },
2040};
2041
Praveen Chidambaram78499012011-11-01 17:15:17 -06002042static uint8_t spm_wfi_cmd_sequence[] __initdata = {
2043 0x03, 0x0f,
2044};
2045
2046static uint8_t spm_power_collapse_without_rpm[] __initdata = {
2047 0x00, 0x24, 0x54, 0x10,
2048 0x09, 0x03, 0x01,
2049 0x10, 0x54, 0x30, 0x0C,
2050 0x24, 0x30, 0x0f,
2051};
2052
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302053static uint8_t spm_retention_cmd_sequence[] __initdata = {
2054 0x00, 0x05, 0x03, 0x0D,
2055 0x0B, 0x00, 0x0f,
2056};
2057
Anji Jonnala786b39e2013-01-29 13:34:10 +05302058static uint8_t spm_retention_with_krait_v3_cmd_sequence[] __initdata = {
2059 0x42, 0x1B, 0x00,
2060 0x05, 0x03, 0x0D, 0x0B,
2061 0x00, 0x42, 0x1B,
2062 0x0f,
2063};
2064
Praveen Chidambaram78499012011-11-01 17:15:17 -06002065static uint8_t spm_power_collapse_with_rpm[] __initdata = {
2066 0x00, 0x24, 0x54, 0x10,
2067 0x09, 0x07, 0x01, 0x0B,
2068 0x10, 0x54, 0x30, 0x0C,
2069 0x24, 0x30, 0x0f,
2070};
2071
Anji Jonnala0f297a92013-01-19 11:22:25 +05302072/* 8064AB has a different command to assert apc_pdn */
2073static uint8_t spm_power_collapse_without_rpm_krait_v3[] __initdata = {
2074 0x00, 0x24, 0x84, 0x10,
2075 0x09, 0x03, 0x01,
2076 0x10, 0x84, 0x30, 0x0C,
2077 0x24, 0x30, 0x0f,
2078};
2079
2080static uint8_t spm_power_collapse_with_rpm_krait_v3[] __initdata = {
2081 0x00, 0x24, 0x84, 0x10,
2082 0x09, 0x07, 0x01, 0x0B,
2083 0x10, 0x84, 0x30, 0x0C,
2084 0x24, 0x30, 0x0f,
2085};
2086
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302087static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = {
2088 [0] = {
2089 .mode = MSM_SPM_MODE_CLOCK_GATING,
2090 .notify_rpm = false,
2091 .cmd = spm_wfi_cmd_sequence,
2092 },
2093 [1] = {
2094 .mode = MSM_SPM_MODE_POWER_RETENTION,
2095 .notify_rpm = false,
2096 .cmd = spm_retention_cmd_sequence,
2097 },
2098 [2] = {
2099 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2100 .notify_rpm = false,
2101 .cmd = spm_power_collapse_without_rpm,
2102 },
2103 [3] = {
2104 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2105 .notify_rpm = true,
2106 .cmd = spm_power_collapse_with_rpm,
2107 },
2108};
2109static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002110 [0] = {
2111 .mode = MSM_SPM_MODE_CLOCK_GATING,
2112 .notify_rpm = false,
2113 .cmd = spm_wfi_cmd_sequence,
2114 },
2115 [1] = {
Anji Jonnala786b39e2013-01-29 13:34:10 +05302116 .mode = MSM_SPM_MODE_POWER_RETENTION,
2117 .notify_rpm = false,
2118 .cmd = spm_retention_cmd_sequence,
2119 },
2120 [2] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002121 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2122 .notify_rpm = false,
2123 .cmd = spm_power_collapse_without_rpm,
2124 },
Anji Jonnala786b39e2013-01-29 13:34:10 +05302125 [3] = {
Praveen Chidambaram78499012011-11-01 17:15:17 -06002126 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
2127 .notify_rpm = true,
2128 .cmd = spm_power_collapse_with_rpm,
2129 },
2130};
2131
2132static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
2133 0x00, 0x20, 0x03, 0x20,
2134 0x00, 0x0f,
2135};
2136
2137static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
2138 0x00, 0x20, 0x34, 0x64,
2139 0x48, 0x07, 0x48, 0x20,
2140 0x50, 0x64, 0x04, 0x34,
2141 0x50, 0x0f,
2142};
2143static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
2144 0x00, 0x10, 0x34, 0x64,
2145 0x48, 0x07, 0x48, 0x10,
2146 0x50, 0x64, 0x04, 0x34,
2147 0x50, 0x0F,
2148};
2149
2150static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
2151 [0] = {
2152 .mode = MSM_SPM_L2_MODE_RETENTION,
2153 .notify_rpm = false,
2154 .cmd = l2_spm_wfi_cmd_sequence,
2155 },
2156 [1] = {
2157 .mode = MSM_SPM_L2_MODE_GDHS,
2158 .notify_rpm = true,
2159 .cmd = l2_spm_gdhs_cmd_sequence,
2160 },
2161 [2] = {
2162 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
2163 .notify_rpm = true,
2164 .cmd = l2_spm_power_off_cmd_sequence,
2165 },
2166};
2167
2168
2169static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
2170 [0] = {
2171 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002172 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
Praveen Chidambarame4b9eb12012-02-28 19:39:58 -07002173 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002174 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
2175 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
2176 .modes = msm_spm_l2_seq_list,
2177 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
2178 },
2179};
2180
2181static struct msm_spm_platform_data msm_spm_data[] __initdata = {
2182 [0] = {
2183 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002184 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002185#if defined(CONFIG_MSM_AVS_HW)
2186 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2187 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2188#endif
2189 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302190 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
2191 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
2192 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002193 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302194 .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list),
2195 .modes = msm_spm_boot_cpu_seq_list,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002196 },
2197 [1] = {
2198 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002199 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002200#if defined(CONFIG_MSM_AVS_HW)
2201 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2202 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2203#endif
2204 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala786b39e2013-01-29 13:34:10 +05302205 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
2206 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
2207 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002208 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302209 .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list),
2210 .modes = msm_spm_nonboot_cpu_seq_list,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002211 },
2212 [2] = {
2213 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002214 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002215#if defined(CONFIG_MSM_AVS_HW)
2216 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2217 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2218#endif
2219 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala786b39e2013-01-29 13:34:10 +05302220 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
2221 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
2222 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002223 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302224 .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list),
2225 .modes = msm_spm_nonboot_cpu_seq_list,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002226 },
2227 [3] = {
2228 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002229 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002230#if defined(CONFIG_MSM_AVS_HW)
2231 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
2232 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
2233#endif
2234 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
Anji Jonnala786b39e2013-01-29 13:34:10 +05302235 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004,
2236 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C,
2237 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002238 .vctl_timeout_us = 50,
Anji Jonnala85b29ff2013-01-15 14:12:45 +05302239 .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list),
2240 .modes = msm_spm_nonboot_cpu_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002241 },
2242};
2243
Anji Jonnala0f297a92013-01-19 11:22:25 +05302244static void __init apq8064ab_update_krait_spm(void)
2245{
2246 int i;
2247
2248 /* Update the SPM sequences for SPC and PC */
2249 for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) {
2250 int j;
2251 struct msm_spm_platform_data *pdata = &msm_spm_data[i];
2252 for (j = 0; j < pdata->num_modes; j++) {
2253 if (pdata->modes[j].cmd ==
2254 spm_power_collapse_without_rpm)
2255 pdata->modes[j].cmd =
2256 spm_power_collapse_without_rpm_krait_v3;
2257 else if (pdata->modes[j].cmd ==
2258 spm_power_collapse_with_rpm)
2259 pdata->modes[j].cmd =
2260 spm_power_collapse_with_rpm_krait_v3;
2261 }
2262 }
2263}
2264
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002265static void __init apq8064_init_buses(void)
2266{
2267 msm_bus_rpm_set_mt_mask();
2268 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
2269 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
2270 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
2271 msm_bus_8064_apps_fabric.dev.platform_data =
2272 &msm_bus_8064_apps_fabric_pdata;
2273 msm_bus_8064_sys_fabric.dev.platform_data =
2274 &msm_bus_8064_sys_fabric_pdata;
2275 msm_bus_8064_mm_fabric.dev.platform_data =
2276 &msm_bus_8064_mm_fabric_pdata;
2277 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
2278 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
2279}
2280
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002281/* PCIe gpios */
2282static struct msm_pcie_gpio_info_t msm_pcie_gpio_info[MSM_PCIE_MAX_GPIO] = {
2283 {"rst_n", PM8921_MPP_PM_TO_SYS(PCIE_RST_N_PMIC_MPP), 0},
2284 {"pwr_en", PM8921_GPIO_PM_TO_SYS(PCIE_PWR_EN_PMIC_GPIO), 1},
2285};
2286
2287static struct msm_pcie_platform msm_pcie_platform_data = {
2288 .gpio = msm_pcie_gpio_info,
Niranjana Vishwanathapura68210ff2012-06-24 18:03:49 -06002289 .axi_addr = PCIE_AXI_BAR_PHYS,
2290 .axi_size = PCIE_AXI_BAR_SIZE,
Niranjana Vishwanathapura459a27d2012-07-20 12:23:55 -06002291 .wake_n = PM8921_GPIO_IRQ(PM8921_IRQ_BASE, PCIE_WAKE_N_PMIC_GPIO),
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002292};
2293
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002294static int __init mpq8064_pcie_enabled(void)
2295{
2296 return !((readl_relaxed(QFPROM_RAW_FEAT_CONFIG_ROW0_MSB) & BIT(21)) ||
2297 (readl_relaxed(QFPROM_RAW_OEM_CONFIG_ROW0_LSB) & BIT(4)));
2298}
2299
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002300static void __init mpq8064_pcie_init(void)
2301{
Niranjana Vishwanathapurac1edd402012-06-28 15:32:50 -06002302 if (mpq8064_pcie_enabled()) {
2303 msm_device_pcie.dev.platform_data = &msm_pcie_platform_data;
2304 platform_device_register(&msm_device_pcie);
2305 }
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06002306}
2307
David Collinsf0d00732012-01-25 15:46:50 -08002308static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
2309 .name = GPIO_REGULATOR_DEV_NAME,
2310 .id = PM8921_MPP_PM_TO_SYS(7),
2311 .dev = {
2312 .platform_data
2313 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
2314 },
2315};
2316
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002317static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
2318 .name = GPIO_REGULATOR_DEV_NAME,
2319 .id = PM8921_MPP_PM_TO_SYS(8),
2320 .dev = {
2321 .platform_data
2322 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
2323 },
2324};
2325
David Collinsf0d00732012-01-25 15:46:50 -08002326static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
2327 .name = GPIO_REGULATOR_DEV_NAME,
2328 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
2329 .dev = {
2330 .platform_data =
2331 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
2332 },
2333};
2334
David Collins390fc332012-02-07 14:38:16 -08002335static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
2336 .name = GPIO_REGULATOR_DEV_NAME,
2337 .id = PM8921_GPIO_PM_TO_SYS(23),
2338 .dev = {
2339 .platform_data
2340 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
2341 },
2342};
2343
David Collins2782b5c2012-02-06 10:02:42 -08002344static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
2345 .name = "rpm-regulator",
David Collins36199252012-08-21 15:43:02 -07002346 .id = 0,
David Collins2782b5c2012-02-06 10:02:42 -08002347 .dev = {
2348 .platform_data = &apq8064_rpm_regulator_pdata,
2349 },
2350};
2351
David Collins36199252012-08-21 15:43:02 -07002352static struct platform_device
2353apq8064_pm8921_device_rpm_regulator __devinitdata = {
2354 .name = "rpm-regulator",
2355 .id = 1,
2356 .dev = {
2357 .platform_data = &apq8064_rpm_regulator_pm8921_pdata,
2358 },
2359};
2360
Ravi Kumar V05931a22012-04-04 17:09:37 +05302361static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
2362 .gpio_nr = 88,
2363 .active_low = 1,
2364};
2365
2366static struct platform_device gpio_ir_recv_pdev = {
2367 .name = "gpio-rc-recv",
2368 .dev = {
2369 .platform_data = &gpio_ir_recv_pdata,
2370 },
2371};
2372
Terence Hampson36b70722012-05-10 13:18:16 -04002373static struct platform_device *common_not_mpq_devices[] __initdata = {
David Keitel3c40fc52012-02-09 17:53:52 -08002374 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08002375 &apq8064_device_qup_i2c_gsbi3,
Terence Hampson36b70722012-05-10 13:18:16 -04002376};
2377
David Collins36199252012-08-21 15:43:02 -07002378static struct platform_device *early_common_devices[] __initdata = {
Matt Wagantallf5cc3892012-06-07 19:47:02 -07002379 &apq8064_device_acpuclk,
Terence Hampson36b70722012-05-10 13:18:16 -04002380 &apq8064_device_dmov,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002381 &apq8064_device_qup_spi_gsbi5,
David Collins36199252012-08-21 15:43:02 -07002382};
2383
2384static struct platform_device *pm8921_common_devices[] __initdata = {
David Collinsf0d00732012-01-25 15:46:50 -08002385 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08002386 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08002387 &apq8064_device_ext_3p3v_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07002388 &apq8064_device_ssbi_pmic1,
2389 &apq8064_device_ssbi_pmic2,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002390 &apq8064_device_ext_ts_sw_vreg,
David Collins36199252012-08-21 15:43:02 -07002391};
2392
2393static struct platform_device *pm8917_common_devices[] __initdata = {
2394 &apq8064_device_ext_mpp8_vreg,
2395 &apq8064_device_ext_3p3v_vreg,
2396 &apq8064_device_ssbi_pmic1,
2397 &apq8064_device_ssbi_pmic2,
2398 &apq8064_device_ext_ts_sw_vreg,
2399};
2400
2401static struct platform_device *common_devices[] __initdata = {
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06002402 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07002403 &apq8064_device_otg,
2404 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08002405 &apq8064_device_hsusb_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07002406 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08002407 &msm_device_wcnss_wlan,
Ankit Vermab7c26e62012-02-28 15:04:15 -08002408 &msm_device_iris_fm,
Larry Bassel67b921d2012-04-06 10:23:27 -07002409 &apq8064_fmem_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002410#ifdef CONFIG_ANDROID_PMEM
2411#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Laura Abbottb93525f2012-04-12 09:57:19 -07002412 &apq8064_android_pmem_device,
2413 &apq8064_android_pmem_adsp_device,
2414 &apq8064_android_pmem_audio_device,
Bharath Ramachandramurthy4a3fa912012-03-13 19:16:24 -07002415#endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/
2416#endif /*CONFIG_ANDROID_PMEM*/
Olav Haugan7c6aa742012-01-16 16:47:37 -08002417#ifdef CONFIG_ION_MSM
Laura Abbottb93525f2012-04-12 09:57:19 -07002418 &apq8064_ion_dev,
Olav Haugan7c6aa742012-01-16 16:47:37 -08002419#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07002420 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08002421 &msm8064_device_saw_regulator_core0,
2422 &msm8064_device_saw_regulator_core1,
2423 &msm8064_device_saw_regulator_core2,
2424 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapua26cce72012-04-09 12:32:25 -07002425#if defined(CONFIG_QSEECOM)
2426 &qseecom_device,
2427#endif
2428
Joel Nider6b9a7bc2012-06-26 11:19:19 +03002429 &msm_8064_device_tsif[0],
2430 &msm_8064_device_tsif[1],
2431
Ramesh Masavarapu28311912011-10-27 11:04:12 -07002432#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
2433 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
2434 &qcrypto_device,
2435#endif
2436
2437#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
2438 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
2439 &qcedev_device,
2440#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07002441
2442#ifdef CONFIG_HW_RANDOM_MSM
2443 &apq8064_device_rng,
2444#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002445 &apq_pcm,
2446 &apq_pcm_routing,
2447 &apq_cpudai0,
2448 &apq_cpudai1,
Santosh Mardieff9a742012-04-09 23:23:39 +05302449 &mpq_cpudai_sec_i2s_rx,
Kuirong Wangf23f8c52012-03-31 12:34:51 -07002450 &mpq_cpudai_mi2s_tx,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002451 &apq_cpudai_hdmi_rx,
2452 &apq_cpudai_bt_rx,
2453 &apq_cpudai_bt_tx,
2454 &apq_cpudai_fm_rx,
2455 &apq_cpudai_fm_tx,
2456 &apq_cpu_fe,
2457 &apq_stub_codec,
2458 &apq_voice,
2459 &apq_voip,
2460 &apq_lpa_pcm,
Krishnankutty Kolathappilly4374e332012-03-18 22:27:30 -07002461 &apq_compr_dsp,
2462 &apq_multi_ch_pcm,
Jayasena Sangaraboina99bf09c2012-07-17 12:03:08 -07002463 &apq_lowlatency_pcm,
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08002464 &apq_pcm_hostless,
2465 &apq_cpudai_afe_01_rx,
2466 &apq_cpudai_afe_01_tx,
2467 &apq_cpudai_afe_02_rx,
2468 &apq_cpudai_afe_02_tx,
2469 &apq_pcm_afe,
2470 &apq_cpudai_auxpcm_rx,
2471 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08002472 &apq_cpudai_stub,
Neema Shetty3c9d2862012-03-11 01:25:32 -08002473 &apq_cpudai_slimbus_1_rx,
2474 &apq_cpudai_slimbus_1_tx,
Kiran Kandi97fe19d2012-05-20 22:34:04 -07002475 &apq_cpudai_slimbus_2_rx,
Kiran Kandi1e6371d2012-03-29 11:48:57 -07002476 &apq_cpudai_slimbus_2_tx,
Neema Shettyc9d86c32012-05-09 12:01:39 -07002477 &apq_cpudai_slimbus_3_rx,
Helen Zeng38c3c962012-05-17 14:56:20 -07002478 &apq_cpudai_slimbus_3_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06002479 &apq8064_rpm_device,
2480 &apq8064_rpm_log_device,
2481 &apq8064_rpm_stat_device,
Anji Jonnala2a8bd312012-11-01 13:11:42 +05302482 &apq8064_rpm_master_stat_device,
Ramesh Masavarapuf31ff242012-05-10 18:55:21 -07002483 &apq_device_tz_log,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07002484 &msm_bus_8064_apps_fabric,
2485 &msm_bus_8064_sys_fabric,
2486 &msm_bus_8064_mm_fabric,
2487 &msm_bus_8064_sys_fpb,
2488 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08002489 &apq8064_msm_device_vidc,
Stephen Boyd25c4a0b2011-09-20 00:12:36 -07002490 &msm_pil_dsps,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08002491 &msm_8960_q6_lpass,
Stephen Boyd7b973de2012-03-09 12:26:16 -08002492 &msm_pil_vidc,
Matt Wagantall292aace2012-01-26 19:12:34 -08002493 &msm_gss,
Laura Abbottb93525f2012-04-12 09:57:19 -07002494 &apq8064_rtb_device,
Steve Mucklea9aac292012-11-02 15:41:00 -07002495 &apq8064_dcvs_device,
Abhijeet Dharmapurikarde91d2c2012-08-23 14:36:59 -07002496 &apq8064_msm_gov_device,
Stepan Moskovchenko28662c52012-03-01 12:48:45 -08002497 &apq8064_device_cache_erp,
Stepan Moskovchenko0f3de112012-06-08 18:11:46 -07002498 &msm8960_device_ebi1_ch0_erp,
2499 &msm8960_device_ebi1_ch1_erp,
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002500 &epm_adc_device,
Pratik Patel3b0ca882012-06-01 16:54:14 -07002501 &coresight_tpiu_device,
2502 &coresight_etb_device,
2503 &apq8064_coresight_funnel_device,
2504 &coresight_etm0_device,
2505 &coresight_etm1_device,
2506 &coresight_etm2_device,
2507 &coresight_etm3_device,
Helen Zeng8f925502012-03-05 16:50:17 -08002508 &apq_cpudai_slim_4_rx,
2509 &apq_cpudai_slim_4_tx,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002510#ifdef CONFIG_MSM_GEMINI
Jignesh Mehta921649d2012-04-19 06:57:23 -07002511 &msm8960_gemini_device,
Steve Mucklef132c6c2012-06-06 18:30:57 -07002512#endif
Laura Abbott0577d7b2012-04-17 11:14:30 -07002513 &apq8064_iommu_domain_device,
Siddartha Mohanadoss48cad912012-04-05 21:29:54 -07002514 &msm_tsens_device,
Laura Abbott93a4a352012-05-25 09:26:35 -07002515 &apq8064_cache_dump_device,
Joel Nider0e4a16d2012-08-05 14:20:11 +03002516 &msm_8064_device_tspp,
Abhijeet Dharmapurikarde91d2c2012-08-23 14:36:59 -07002517#ifdef CONFIG_BATTERY_BCL
2518 &battery_bcl_device,
2519#endif
2520 &apq8064_msm_mpd_device,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002521};
2522
Joel King82b7e3f2012-01-05 10:03:27 -08002523static struct platform_device *cdp_devices[] __initdata = {
2524 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08002525 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08002526 &msm_device_sps_apq8064,
Aravind Venkateswaran4ca27532012-02-16 14:27:05 -08002527#ifdef CONFIG_MSM_ROTATOR
2528 &msm_rotator_device,
2529#endif
Anji Jonnalae84292b2012-09-21 13:34:44 +05302530 &msm8064_pc_cntr,
Joel King82b7e3f2012-01-05 10:03:27 -08002531};
2532
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002533static struct platform_device
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002534mpq8064_device_ext_1p2_buck_vreg __devinitdata = {
2535 .name = GPIO_REGULATOR_DEV_NAME,
2536 .id = SX150X_GPIO(4, 2),
2537 .dev = {
2538 .platform_data =
2539 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P2V],
2540 },
2541};
2542
2543static struct platform_device
2544mpq8064_device_ext_1p8_buck_vreg __devinitdata = {
2545 .name = GPIO_REGULATOR_DEV_NAME,
2546 .id = SX150X_GPIO(4, 4),
2547 .dev = {
2548 .platform_data =
2549 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_1P8V],
2550 },
2551};
2552
2553static struct platform_device
2554mpq8064_device_ext_2p2_buck_vreg __devinitdata = {
2555 .name = GPIO_REGULATOR_DEV_NAME,
2556 .id = SX150X_GPIO(4, 14),
2557 .dev = {
2558 .platform_data =
2559 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_2P2V],
2560 },
2561};
2562
2563static struct platform_device
2564mpq8064_device_ext_5v_buck_vreg __devinitdata = {
2565 .name = GPIO_REGULATOR_DEV_NAME,
2566 .id = SX150X_GPIO(4, 3),
2567 .dev = {
2568 .platform_data =
2569 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_5V],
2570 },
2571};
2572
2573static struct platform_device
2574mpq8064_device_ext_3p3v_ldo_vreg __devinitdata = {
2575 .name = GPIO_REGULATOR_DEV_NAME,
2576 .id = SX150X_GPIO(4, 15),
2577 .dev = {
2578 .platform_data =
2579 &mpq8064_gpio_regulator_pdata[GPIO_VREG_ID_AVC_3P3V],
2580 },
2581};
2582
Ravi Kumar V1c903012012-05-15 16:11:35 +05302583static struct platform_device rc_input_loopback_pdev = {
2584 .name = "rc-user-input",
2585 .id = -1,
2586};
2587
Ravi Kumar V040eeff2012-05-23 21:29:23 +05302588static int rf4ce_gpio_init(void)
2589{
Ravi Kumar V0143c582012-08-14 17:18:11 +05302590 if (!machine_is_mpq8064_cdp() &&
2591 !machine_is_mpq8064_hrd() &&
2592 !machine_is_mpq8064_dtv())
Ravi Kumar V040eeff2012-05-23 21:29:23 +05302593 return -EINVAL;
2594
2595 /* CC2533 SRDY Input */
2596 if (!gpio_request(SX150X_GPIO(4, 6), "rf4ce_srdy")) {
2597 gpio_direction_input(SX150X_GPIO(4, 6));
2598 gpio_export(SX150X_GPIO(4, 6), true);
2599 }
2600
2601 /* CC2533 MRDY Output */
2602 if (!gpio_request(SX150X_GPIO(4, 5), "rf4ce_mrdy")) {
2603 gpio_direction_output(SX150X_GPIO(4, 5), 1);
2604 gpio_export(SX150X_GPIO(4, 5), true);
2605 }
2606
2607 /* CC2533 Reset Output */
2608 if (!gpio_request(SX150X_GPIO(4, 7), "rf4ce_reset")) {
2609 gpio_direction_output(SX150X_GPIO(4, 7), 0);
2610 gpio_export(SX150X_GPIO(4, 7), true);
2611 }
2612
2613 return 0;
2614}
2615late_initcall(rf4ce_gpio_init);
2616
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002617static struct platform_device *mpq_devices[] __initdata = {
2618 &msm_device_sps_apq8064,
2619 &mpq8064_device_qup_i2c_gsbi5,
2620#ifdef CONFIG_MSM_ROTATOR
2621 &msm_rotator_device,
2622#endif
Ravi Kumar V05931a22012-04-04 17:09:37 +05302623 &gpio_ir_recv_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002624 &mpq8064_device_ext_1p2_buck_vreg,
2625 &mpq8064_device_ext_1p8_buck_vreg,
2626 &mpq8064_device_ext_2p2_buck_vreg,
2627 &mpq8064_device_ext_5v_buck_vreg,
2628 &mpq8064_device_ext_3p3v_ldo_vreg,
Terence Hampson2e1705f2012-04-11 19:55:29 -04002629#ifdef CONFIG_MSM_VCAP
2630 &msm8064_device_vcap,
2631#endif
Ravi Kumar V1c903012012-05-15 16:11:35 +05302632 &rc_input_loopback_pdev,
Jay Chokshi1b7eaa92012-04-04 14:53:14 -07002633};
2634
Harini Jayaramanc4c58692011-07-19 14:50:10 -06002635static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002636 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002637};
2638
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002639#define KS8851_IRQ_GPIO 43
2640
2641static struct spi_board_info spi_board_info[] __initdata = {
2642 {
2643 .modalias = "ks8851",
2644 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
2645 .max_speed_hz = 19200000,
2646 .bus_num = 0,
2647 .chip_select = 2,
2648 .mode = SPI_MODE_0,
2649 },
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002650 {
2651 .modalias = "epm_adc",
2652 .max_speed_hz = 1100000,
2653 .bus_num = 0,
2654 .chip_select = 3,
2655 .mode = SPI_MODE_0,
2656 },
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002657};
2658
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002659static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002660 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08002661 .bus_num = 1,
2662 .slim_slave = &apq8064_slim_tabla,
2663 },
2664 {
2665 .bus_num = 1,
2666 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08002667 },
2668 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06002669};
2670
David Keitel3c40fc52012-02-09 17:53:52 -08002671static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
2672 .clk_freq = 100000,
2673 .src_clk_rate = 24000000,
2674};
2675
Jing Lin04601f92012-02-05 15:36:07 -08002676static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
Anirudh Ghayalc2163472012-04-10 14:58:14 +05302677 .clk_freq = 384000,
Jing Lin04601f92012-02-05 15:36:07 -08002678 .src_clk_rate = 24000000,
2679};
2680
Kenneth Heitke748593a2011-07-15 15:45:11 -06002681static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
2682 .clk_freq = 100000,
2683 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06002684};
2685
Joel King8f839b92012-04-01 14:37:46 -07002686static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
2687 .clk_freq = 100000,
2688 .src_clk_rate = 24000000,
2689};
2690
David Keitel3c40fc52012-02-09 17:53:52 -08002691#define GSBI_DUAL_MODE_CODE 0x60
2692#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06002693static void __init apq8064_i2c_init(void)
2694{
David Keitel3c40fc52012-02-09 17:53:52 -08002695 void __iomem *gsbi_mem;
2696
2697 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2698 &apq8064_i2c_qup_gsbi1_pdata;
2699 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
2700 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
2701 /* Ensure protocol code is written before proceeding */
2702 wmb();
2703 iounmap(gsbi_mem);
2704 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08002705 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
2706 &apq8064_i2c_qup_gsbi3_pdata;
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08002707 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
2708 &apq8064_i2c_qup_gsbi1_pdata;
Mayank Ranae98f1e42013-02-22 19:58:59 +05302709
2710 /* Add GSBI4 I2C pdata for non-fusion3 SGLTE2 */
2711 if (socinfo_get_platform_subtype() !=
2712 PLATFORM_SUBTYPE_SGLTE2) {
2713 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
Kenneth Heitke748593a2011-07-15 15:45:11 -06002714 &apq8064_i2c_qup_gsbi4_pdata;
Mayank Ranae98f1e42013-02-22 19:58:59 +05302715 }
Joel King8f839b92012-04-01 14:37:46 -07002716 mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
2717 &mpq8064_i2c_qup_gsbi5_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06002718}
2719
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08002720#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07002721static int ethernet_init(void)
2722{
2723 int ret;
2724 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
2725 if (ret) {
2726 pr_err("ks8851 gpio_request failed: %d\n", ret);
2727 goto fail;
2728 }
2729
2730 return 0;
2731fail:
2732 return ret;
2733}
2734#else
2735static int ethernet_init(void)
2736{
2737 return 0;
2738}
2739#endif
2740
David Collins6f7c3472012-08-22 13:18:06 -07002741#define GPIO_KEY_HOME PM8921_GPIO_PM_TO_SYS(27)
2742#define GPIO_KEY_VOLUME_UP PM8921_GPIO_PM_TO_SYS(35)
2743#define GPIO_KEY_VOLUME_DOWN_PM8921 PM8921_GPIO_PM_TO_SYS(38)
2744#define GPIO_KEY_VOLUME_DOWN_PM8917 PM8921_GPIO_PM_TO_SYS(30)
2745#define GPIO_KEY_CAM_FOCUS PM8921_GPIO_PM_TO_SYS(3)
2746#define GPIO_KEY_CAM_SNAP PM8921_GPIO_PM_TO_SYS(4)
2747#define GPIO_KEY_ROTATION_PM8921 PM8921_GPIO_PM_TO_SYS(42)
2748#define GPIO_KEY_ROTATION_PM8917 PM8921_GPIO_PM_TO_SYS(8)
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302749
David Collins6f7c3472012-08-22 13:18:06 -07002750static struct gpio_keys_button cdp_keys_pm8921[] = {
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302751 {
2752 .code = KEY_HOME,
2753 .gpio = GPIO_KEY_HOME,
2754 .desc = "home_key",
2755 .active_low = 1,
2756 .type = EV_KEY,
2757 .wakeup = 1,
2758 .debounce_interval = 15,
2759 },
2760 {
2761 .code = KEY_VOLUMEUP,
2762 .gpio = GPIO_KEY_VOLUME_UP,
2763 .desc = "volume_up_key",
2764 .active_low = 1,
2765 .type = EV_KEY,
2766 .wakeup = 1,
2767 .debounce_interval = 15,
2768 },
2769 {
2770 .code = KEY_VOLUMEDOWN,
David Collins6f7c3472012-08-22 13:18:06 -07002771 .gpio = GPIO_KEY_VOLUME_DOWN_PM8921,
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302772 .desc = "volume_down_key",
2773 .active_low = 1,
2774 .type = EV_KEY,
2775 .wakeup = 1,
2776 .debounce_interval = 15,
2777 },
2778 {
2779 .code = SW_ROTATE_LOCK,
David Collins6f7c3472012-08-22 13:18:06 -07002780 .gpio = GPIO_KEY_ROTATION_PM8921,
2781 .desc = "rotate_key",
2782 .active_low = 1,
2783 .type = EV_SW,
2784 .debounce_interval = 15,
2785 },
2786};
2787
2788static struct gpio_keys_button cdp_keys_pm8917[] = {
2789 {
2790 .code = KEY_HOME,
2791 .gpio = GPIO_KEY_HOME,
2792 .desc = "home_key",
2793 .active_low = 1,
2794 .type = EV_KEY,
2795 .wakeup = 1,
2796 .debounce_interval = 15,
2797 },
2798 {
2799 .code = KEY_VOLUMEUP,
2800 .gpio = GPIO_KEY_VOLUME_UP,
2801 .desc = "volume_up_key",
2802 .active_low = 1,
2803 .type = EV_KEY,
2804 .wakeup = 1,
2805 .debounce_interval = 15,
2806 },
2807 {
2808 .code = KEY_VOLUMEDOWN,
2809 .gpio = GPIO_KEY_VOLUME_DOWN_PM8917,
2810 .desc = "volume_down_key",
2811 .active_low = 1,
2812 .type = EV_KEY,
2813 .wakeup = 1,
2814 .debounce_interval = 15,
2815 },
2816 {
2817 .code = SW_ROTATE_LOCK,
2818 .gpio = GPIO_KEY_ROTATION_PM8917,
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302819 .desc = "rotate_key",
2820 .active_low = 1,
2821 .type = EV_SW,
2822 .debounce_interval = 15,
2823 },
2824};
2825
2826static struct gpio_keys_platform_data cdp_keys_data = {
David Collins6f7c3472012-08-22 13:18:06 -07002827 .buttons = cdp_keys_pm8921,
2828 .nbuttons = ARRAY_SIZE(cdp_keys_pm8921),
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302829};
2830
2831static struct platform_device cdp_kp_pdev = {
2832 .name = "gpio-keys",
2833 .id = -1,
2834 .dev = {
2835 .platform_data = &cdp_keys_data,
2836 },
2837};
2838
2839static struct gpio_keys_button mtp_keys[] = {
2840 {
2841 .code = KEY_CAMERA_FOCUS,
2842 .gpio = GPIO_KEY_CAM_FOCUS,
2843 .desc = "cam_focus_key",
2844 .active_low = 1,
2845 .type = EV_KEY,
2846 .wakeup = 1,
2847 .debounce_interval = 15,
2848 },
2849 {
2850 .code = KEY_VOLUMEUP,
2851 .gpio = GPIO_KEY_VOLUME_UP,
2852 .desc = "volume_up_key",
2853 .active_low = 1,
2854 .type = EV_KEY,
2855 .wakeup = 1,
2856 .debounce_interval = 15,
2857 },
2858 {
2859 .code = KEY_VOLUMEDOWN,
David Collins6f7c3472012-08-22 13:18:06 -07002860 .gpio = GPIO_KEY_VOLUME_DOWN_PM8921,
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302861 .desc = "volume_down_key",
2862 .active_low = 1,
2863 .type = EV_KEY,
2864 .wakeup = 1,
2865 .debounce_interval = 15,
2866 },
2867 {
2868 .code = KEY_CAMERA_SNAPSHOT,
2869 .gpio = GPIO_KEY_CAM_SNAP,
2870 .desc = "cam_snap_key",
2871 .active_low = 1,
2872 .type = EV_KEY,
2873 .debounce_interval = 15,
2874 },
2875};
2876
2877static struct gpio_keys_platform_data mtp_keys_data = {
2878 .buttons = mtp_keys,
2879 .nbuttons = ARRAY_SIZE(mtp_keys),
2880};
2881
2882static struct platform_device mtp_kp_pdev = {
2883 .name = "gpio-keys",
2884 .id = -1,
2885 .dev = {
2886 .platform_data = &mtp_keys_data,
2887 },
2888};
2889
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302890static struct gpio_keys_button mpq_keys[] = {
2891 {
2892 .code = KEY_VOLUMEDOWN,
David Collins6f7c3472012-08-22 13:18:06 -07002893 .gpio = GPIO_KEY_VOLUME_DOWN_PM8921,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05302894 .desc = "volume_down_key",
2895 .active_low = 1,
2896 .type = EV_KEY,
2897 .wakeup = 1,
2898 .debounce_interval = 15,
2899 },
2900 {
2901 .code = KEY_VOLUMEUP,
2902 .gpio = GPIO_KEY_VOLUME_UP,
2903 .desc = "volume_up_key",
2904 .active_low = 1,
2905 .type = EV_KEY,
2906 .wakeup = 1,
2907 .debounce_interval = 15,
2908 },
2909};
2910
2911static struct gpio_keys_platform_data mpq_keys_data = {
2912 .buttons = mpq_keys,
2913 .nbuttons = ARRAY_SIZE(mpq_keys),
2914};
2915
2916static struct platform_device mpq_gpio_keys_pdev = {
2917 .name = "gpio-keys",
2918 .id = -1,
2919 .dev = {
2920 .platform_data = &mpq_keys_data,
2921 },
2922};
2923
2924#define MPQ_KP_ROW_BASE SX150X_EXP2_GPIO_BASE
2925#define MPQ_KP_COL_BASE (SX150X_EXP2_GPIO_BASE + 4)
2926
2927static unsigned int mpq_row_gpios[] = {MPQ_KP_ROW_BASE, MPQ_KP_ROW_BASE + 1,
2928 MPQ_KP_ROW_BASE + 2, MPQ_KP_ROW_BASE + 3};
2929static unsigned int mpq_col_gpios[] = {MPQ_KP_COL_BASE, MPQ_KP_COL_BASE + 1,
2930 MPQ_KP_COL_BASE + 2};
2931
2932static const unsigned int mpq_keymap[] = {
2933 KEY(0, 0, KEY_UP),
2934 KEY(0, 1, KEY_ENTER),
2935 KEY(0, 2, KEY_3),
2936
2937 KEY(1, 0, KEY_DOWN),
2938 KEY(1, 1, KEY_EXIT),
2939 KEY(1, 2, KEY_4),
2940
2941 KEY(2, 0, KEY_LEFT),
2942 KEY(2, 1, KEY_1),
2943 KEY(2, 2, KEY_5),
2944
2945 KEY(3, 0, KEY_RIGHT),
2946 KEY(3, 1, KEY_2),
2947 KEY(3, 2, KEY_6),
2948};
2949
2950static struct matrix_keymap_data mpq_keymap_data = {
2951 .keymap_size = ARRAY_SIZE(mpq_keymap),
2952 .keymap = mpq_keymap,
2953};
2954
2955static struct matrix_keypad_platform_data mpq_keypad_data = {
2956 .keymap_data = &mpq_keymap_data,
2957 .row_gpios = mpq_row_gpios,
2958 .col_gpios = mpq_col_gpios,
2959 .num_row_gpios = ARRAY_SIZE(mpq_row_gpios),
2960 .num_col_gpios = ARRAY_SIZE(mpq_col_gpios),
2961 .col_scan_delay_us = 32000,
2962 .debounce_ms = 20,
2963 .wakeup = 1,
2964 .active_low = 1,
2965 .no_autorepeat = 1,
2966};
2967
2968static struct platform_device mpq_keypad_device = {
2969 .name = "matrix-keypad",
2970 .id = -1,
2971 .dev = {
2972 .platform_data = &mpq_keypad_data,
2973 },
2974};
2975
Jin Hongd3024e62012-02-09 16:13:32 -08002976/* Sensors DSPS platform data */
2977#define DSPS_PIL_GENERIC_NAME "dsps"
2978static void __init apq8064_init_dsps(void)
2979{
2980 struct msm_dsps_platform_data *pdata =
2981 msm_dsps_device_8064.dev.platform_data;
2982 pdata->pil_name = DSPS_PIL_GENERIC_NAME;
2983 pdata->gpios = NULL;
2984 pdata->gpios_num = 0;
2985
2986 platform_device_register(&msm_dsps_device_8064);
2987}
Mohan Pallaka474b94b2012-01-25 12:59:58 +05302988
Jing Lin417fa452012-02-05 14:31:06 -08002989#define I2C_SURF 1
2990#define I2C_FFA (1 << 1)
2991#define I2C_RUMI (1 << 2)
2992#define I2C_SIM (1 << 3)
2993#define I2C_LIQUID (1 << 4)
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07002994#define I2C_MPQ_CDP BIT(5)
2995#define I2C_MPQ_HRD BIT(6)
2996#define I2C_MPQ_DTV BIT(7)
Jing Lin417fa452012-02-05 14:31:06 -08002997
2998struct i2c_registry {
2999 u8 machs;
3000 int bus;
3001 struct i2c_board_info *info;
3002 int len;
3003};
3004
3005static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08003006 {
David Keitel2f613d92012-02-15 11:29:16 -08003007 I2C_LIQUID,
3008 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
3009 smb349_charger_i2c_info,
3010 ARRAY_SIZE(smb349_charger_i2c_info)
3011 },
3012 {
Jing Lin21ed4de2012-02-05 15:53:28 -08003013 I2C_SURF | I2C_LIQUID,
3014 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
3015 mxt_device_info,
3016 ARRAY_SIZE(mxt_device_info),
3017 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08003018 {
3019 I2C_FFA,
3020 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
3021 cyttsp_info,
3022 ARRAY_SIZE(cyttsp_info),
3023 },
Amy Maloche70090f992012-02-16 16:35:26 -08003024 {
3025 I2C_FFA | I2C_LIQUID,
3026 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
3027 isa1200_board_info,
3028 ARRAY_SIZE(isa1200_board_info),
3029 },
Santosh Mardieff9a742012-04-09 23:23:39 +05303030 {
3031 I2C_MPQ_CDP,
3032 APQ_8064_GSBI5_QUP_I2C_BUS_ID,
3033 cs8427_device_info,
3034 ARRAY_SIZE(cs8427_device_info),
3035 },
Jing Lin417fa452012-02-05 14:31:06 -08003036};
3037
Jay Chokshi607f61b2012-04-25 18:21:21 -07003038#define SX150X_EXP1_INT_N PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9)
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05303039#define SX150X_EXP2_INT_N MSM_GPIO_TO_INT(81)
Jay Chokshi607f61b2012-04-25 18:21:21 -07003040
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003041struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
3042 [SX150X_EXP1] = {
3043 .gpio_base = SX150X_EXP1_GPIO_BASE,
3044 .oscio_is_gpo = false,
3045 .io_pullup_ena = 0x0,
3046 .io_pulldn_ena = 0x0,
3047 .io_open_drain_ena = 0x0,
3048 .io_polarity = 0,
Jay Chokshi607f61b2012-04-25 18:21:21 -07003049 .irq_summary = SX150X_EXP1_INT_N,
3050 .irq_base = SX150X_EXP1_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003051 },
3052 [SX150X_EXP2] = {
3053 .gpio_base = SX150X_EXP2_GPIO_BASE,
3054 .oscio_is_gpo = false,
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05303055 .io_pullup_ena = 0x0f,
3056 .io_pulldn_ena = 0x70,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003057 .io_open_drain_ena = 0x0,
3058 .io_polarity = 0,
Anirudh Ghayal9f1aaa72012-04-26 18:15:08 +05303059 .irq_summary = SX150X_EXP2_INT_N,
3060 .irq_base = SX150X_EXP2_IRQ_BASE,
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003061 },
3062 [SX150X_EXP3] = {
3063 .gpio_base = SX150X_EXP3_GPIO_BASE,
3064 .oscio_is_gpo = false,
3065 .io_pullup_ena = 0x0,
3066 .io_pulldn_ena = 0x0,
3067 .io_open_drain_ena = 0x0,
3068 .io_polarity = 0,
3069 .irq_summary = -1,
3070 },
3071 [SX150X_EXP4] = {
3072 .gpio_base = SX150X_EXP4_GPIO_BASE,
3073 .oscio_is_gpo = false,
3074 .io_pullup_ena = 0x0,
3075 .io_pulldn_ena = 0x0,
3076 .io_open_drain_ena = 0x0,
3077 .io_polarity = 0,
3078 .irq_summary = -1,
3079 },
3080};
3081
3082static struct i2c_board_info sx150x_gpio_exp_info[] = {
3083 {
3084 I2C_BOARD_INFO("sx1509q", 0x70),
3085 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP1],
3086 },
3087 {
3088 I2C_BOARD_INFO("sx1508q", 0x23),
3089 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP2],
3090 },
3091 {
3092 I2C_BOARD_INFO("sx1508q", 0x22),
3093 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP3],
3094 },
3095 {
3096 I2C_BOARD_INFO("sx1509q", 0x3E),
3097 .platform_data = &mpq8064_sx150x_pdata[SX150X_EXP4],
3098 },
3099};
3100
3101#define MPQ8064_I2C_GSBI5_BUS_ID 5
3102
3103static struct i2c_registry mpq8064_i2c_devices[] __initdata = {
3104 {
3105 I2C_MPQ_CDP,
3106 MPQ8064_I2C_GSBI5_BUS_ID,
3107 sx150x_gpio_exp_info,
3108 ARRAY_SIZE(sx150x_gpio_exp_info),
3109 },
3110};
3111
Jing Lin417fa452012-02-05 14:31:06 -08003112static void __init register_i2c_devices(void)
3113{
3114 u8 mach_mask = 0;
3115 int i;
3116
Kevin Chand07220e2012-02-13 15:52:22 -08003117#ifdef CONFIG_MSM_CAMERA
3118 struct i2c_registry apq8064_camera_i2c_devices = {
3119 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
3120 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
3121 apq8064_camera_board_info.board_info,
3122 apq8064_camera_board_info.num_i2c_board_info,
3123 };
3124#endif
Jing Lin417fa452012-02-05 14:31:06 -08003125 /* Build the matching 'supported_machs' bitmask */
3126 if (machine_is_apq8064_cdp())
3127 mach_mask = I2C_SURF;
3128 else if (machine_is_apq8064_mtp())
3129 mach_mask = I2C_FFA;
3130 else if (machine_is_apq8064_liquid())
3131 mach_mask = I2C_LIQUID;
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003132 else if (PLATFORM_IS_MPQ8064())
3133 mach_mask = I2C_MPQ_CDP;
Jing Lin417fa452012-02-05 14:31:06 -08003134 else
3135 pr_err("unmatched machine ID in register_i2c_devices\n");
3136
3137 /* Run the array and install devices as appropriate */
3138 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
3139 if (apq8064_i2c_devices[i].machs & mach_mask)
3140 i2c_register_board_info(apq8064_i2c_devices[i].bus,
3141 apq8064_i2c_devices[i].info,
3142 apq8064_i2c_devices[i].len);
3143 }
Kevin Chand07220e2012-02-13 15:52:22 -08003144#ifdef CONFIG_MSM_CAMERA
3145 if (apq8064_camera_i2c_devices.machs & mach_mask)
3146 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
3147 apq8064_camera_i2c_devices.info,
3148 apq8064_camera_i2c_devices.len);
3149#endif
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003150
3151 for (i = 0; i < ARRAY_SIZE(mpq8064_i2c_devices); ++i) {
3152 if (mpq8064_i2c_devices[i].machs & mach_mask)
3153 i2c_register_board_info(
3154 mpq8064_i2c_devices[i].bus,
3155 mpq8064_i2c_devices[i].info,
3156 mpq8064_i2c_devices[i].len);
3157 }
Jing Lin417fa452012-02-05 14:31:06 -08003158}
3159
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003160static void enable_avc_i2c_bus(void)
3161{
3162 int avc_i2c_en_mpp = PM8921_MPP_PM_TO_SYS(8);
3163 int rc;
3164
3165 rc = gpio_request(avc_i2c_en_mpp, "avc_i2c_en");
3166 if (rc)
3167 pr_err("request for avc_i2c_en mpp failed,"
3168 "rc=%d\n", rc);
3169 else
3170 gpio_set_value_cansleep(avc_i2c_en_mpp, 1);
3171}
3172
David Collins6f7c3472012-08-22 13:18:06 -07003173/* Modify platform data values to match requirements for PM8917. */
3174static void __init apq8064_pm8917_pdata_fixup(void)
3175{
3176 cdp_keys_data.buttons = cdp_keys_pm8917;
3177 cdp_keys_data.nbuttons = ARRAY_SIZE(cdp_keys_pm8917);
3178}
3179
Mayank Ranae98f1e42013-02-22 19:58:59 +05303180#ifdef CONFIG_SERIAL_MSM_HS
3181static int configure_uartdm_gsbi4_gpios(int on)
3182{
3183 int ret = 0, i;
3184 int uart_gpios[] = {10, 11, 12, 13};
3185
3186 for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) {
3187 if (on) {
3188 ret = gpio_request(uart_gpios[i], NULL);
3189 if (ret) {
3190 pr_err("%s: unable to request uart gpio[%d]\n",
3191 __func__, uart_gpios[i]);
3192 break;
3193 }
3194 } else {
3195 gpio_free(uart_gpios[i]);
3196 }
3197 }
3198
3199 if (ret && on && i)
3200 for (; i >= 0; i--)
3201 gpio_free(uart_gpios[i]);
3202 return ret;
3203}
3204
3205static struct msm_serial_hs_platform_data apq8064_uartdm_gsbi4_pdata = {
3206 .gpio_config = configure_uartdm_gsbi4_gpios,
3207};
3208#else
3209static struct msm_serial_hs_platform_data apq8064_uartdm_gsbi4_pdata;
3210#endif
3211
Anji Jonnala786b39e2013-01-29 13:34:10 +05303212static void __init apq8064ab_update_retention_spm(void)
3213{
3214 int i;
3215
3216 /* Update the SPM sequences for krait retention on all cores */
3217 for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) {
3218 int j;
3219 struct msm_spm_platform_data *pdata = &msm_spm_data[i];
3220 for (j = 0; j < pdata->num_modes; j++) {
3221 if (pdata->modes[j].cmd ==
3222 spm_retention_cmd_sequence)
3223 pdata->modes[j].cmd =
3224 spm_retention_with_krait_v3_cmd_sequence;
3225 }
3226 }
3227}
3228
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003229static void __init apq8064_common_init(void)
3230{
Ameya Thakur2702baf2013-01-30 11:55:25 -08003231 u32 platform_version = socinfo_get_platform_version();
David Collins6f7c3472012-08-22 13:18:06 -07003232
3233 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
3234 apq8064_pm8917_pdata_fixup();
Rohit Vaswanib1cc4932012-07-23 21:30:11 -07003235 platform_device_register(&msm_gpio_device);
Praveen Chidambaram4908abf2013-03-06 18:10:15 -07003236 if (cpu_is_apq8064ab())
3237 apq8064ab_update_krait_spm();
3238 if (cpu_is_krait_v3()) {
3239 msm_pm_set_tz_retention_flag(0);
3240 apq8064ab_update_retention_spm();
3241 } else {
3242 msm_pm_set_tz_retention_flag(1);
3243 }
3244 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
3245 msm_spm_l2_init(msm_spm_l2_data);
Joel King8f839b92012-04-01 14:37:46 -07003246 msm_tsens_early_init(&apq_tsens_pdata);
Praveen Chidambaram877d7a42012-06-05 14:33:20 -06003247 msm_thermal_init(&msm_thermal_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003248 if (socinfo_init() < 0)
3249 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06003250 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
3251 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08003252 regulator_suppress_info_printing();
David Collins36199252012-08-21 15:43:02 -07003253 if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
3254 configure_apq8064_pm8917_power_grid();
David Collins2782b5c2012-02-06 10:02:42 -08003255 platform_device_register(&apq8064_device_rpm_regulator);
David Collins36199252012-08-21 15:43:02 -07003256 if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917)
3257 platform_device_register(&apq8064_pm8921_device_rpm_regulator);
Stephen Boyd4d0d2582012-02-10 14:49:40 -08003258 if (msm_xo_init())
3259 pr_err("Failed to initialize XO votes\n");
Matt Wagantallc51e5602012-02-27 17:25:25 -08003260 msm_clock_init(&apq8064_clock_init_data);
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08003261 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06003262 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08003263 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06003264
Harini Jayaramanc4c58692011-07-19 14:50:10 -06003265 apq8064_device_qup_spi_gsbi5.dev.platform_data =
3266 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08003267 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08003268 if (machine_is_apq8064_liquid())
3269 msm_otg_pdata.mhl_enable = true;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07003270
Ofir Cohen94213a72012-05-03 14:26:32 +03003271 android_usb_pdata.swfi_latency =
3272 msm_rpmrs_levels[0].latency_us;
Vamsi Krishnad9863eb2012-03-26 17:34:48 -07003273
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07003274 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Manu Gautam91223e02011-11-08 15:27:22 +05303275 apq8064_ehci_host_init();
Gagan Mac8a7a5d32011-11-11 16:43:06 -07003276 apq8064_init_buses();
David Collins36199252012-08-21 15:43:02 -07003277
3278 platform_add_devices(early_common_devices,
3279 ARRAY_SIZE(early_common_devices));
3280 if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917)
3281 platform_add_devices(pm8921_common_devices,
3282 ARRAY_SIZE(pm8921_common_devices));
3283 else
3284 platform_add_devices(pm8917_common_devices,
3285 ARRAY_SIZE(pm8917_common_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003286 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Terence Hampson36b70722012-05-10 13:18:16 -04003287 if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
Mayank Ranae98f1e42013-02-22 19:58:59 +05303288 machine_is_mpq8064_dtv())) {
Terence Hampson36b70722012-05-10 13:18:16 -04003289 platform_add_devices(common_not_mpq_devices,
3290 ARRAY_SIZE(common_not_mpq_devices));
Mayank Ranae98f1e42013-02-22 19:58:59 +05303291
3292 /* Add GSBI4 I2C Device for non-fusion3 platform */
3293 if (socinfo_get_platform_subtype() !=
3294 PLATFORM_SUBTYPE_SGLTE2) {
3295 platform_device_register(&apq8064_device_qup_i2c_gsbi4);
3296 }
3297 }
3298
Pavankumar Kondetife2d4d32012-09-07 15:33:09 +05303299 msm_hsic_pdata.swfi_latency =
3300 msm_rpmrs_levels[0].latency_us;
Hemant Kumarf1ca9192012-02-07 18:59:33 -08003301 if (machine_is_apq8064_mtp()) {
Ajay Dudanic4e40db2012-08-20 14:44:40 -07003302 msm_hsic_pdata.log2_irq_thresh = 5,
Hemant Kumarf1ca9192012-02-07 18:59:33 -08003303 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
3304 device_initialize(&apq8064_device_hsic_host.dev);
Ameya Thakur2702baf2013-01-30 11:55:25 -08003305 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
3306 apq8064_device_ehci_host3.dev.platform_data =
3307 &msm_ehci_host_pdata3;
3308 device_initialize(&apq8064_device_ehci_host3.dev);
3309 }
Hemant Kumarf1ca9192012-02-07 18:59:33 -08003310 }
Jay Chokshie8741282012-01-25 15:22:55 -08003311 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05303312 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08003313
3314 if (machine_is_apq8064_mtp()) {
Ameya Thakur2702baf2013-01-30 11:55:25 -08003315 if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
Joel Kingfdde32b2013-02-06 17:38:05 -08003316 amdm_8064_device.dev.platform_data =
3317 &amdm_platform_data;
Ameya Thakur2702baf2013-01-30 11:55:25 -08003318 platform_device_register(&amdm_8064_device);
3319 bmdm_8064_device.dev.platform_data =
3320 &bmdm_platform_data;
3321 platform_device_register(&bmdm_8064_device);
Joel King3166e892013-02-26 11:16:08 -08003322 } else if (socinfo_get_platform_subtype() ==
3323 PLATFORM_SUBTYPE_SGLTE2) {
3324 sglte_mdm_8064_device.dev.platform_data =
Joel King57aefdd2013-03-11 13:46:05 -07003325 &sglte2_mdm_platform_data;
Joel King3166e892013-02-26 11:16:08 -08003326 platform_device_register(&sglte_mdm_8064_device);
3327 sglte2_qsc_8064_device.dev.platform_data =
3328 &sglte2_qsc_platform_data;
3329 platform_device_register(&sglte2_qsc_8064_device);
Mayank Ranae98f1e42013-02-22 19:58:59 +05303330
3331 /* GSBI4 UART device for Primay IPC */
3332 apq8064_uartdm_gsbi4_pdata.wakeup_irq = gpio_to_irq(10);
3333 apq8064_device_uartdm_gsbi4.dev.platform_data =
3334 &apq8064_uartdm_gsbi4_pdata;
3335 platform_device_register(&apq8064_device_uartdm_gsbi4);
Ameya Thakur2702baf2013-01-30 11:55:25 -08003336 } else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
Ameya Thakure155ece2012-07-09 12:08:37 -07003337 i2s_mdm_8064_device.dev.platform_data =
3338 &mdm_platform_data;
3339 platform_device_register(&i2s_mdm_8064_device);
3340 } else {
3341 mdm_8064_device.dev.platform_data = &mdm_platform_data;
3342 platform_device_register(&mdm_8064_device);
3343 }
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08003344 }
3345 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06003346 slim_register_board_info(apq8064_slim_devices,
3347 ARRAY_SIZE(apq8064_slim_devices));
Taniya Dasbbf633d2012-07-31 16:07:47 +05303348 if (!PLATFORM_IS_MPQ8064()) {
Taniya Das30cae292012-07-31 15:56:12 +05303349 apq8064_init_dsps();
Taniya Dasbbf633d2012-07-31 16:07:47 +05303350 platform_device_register(&msm_8960_riva);
3351 }
Praveen Chidambaram78499012011-11-01 17:15:17 -06003352 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Siddartha Mohanadossb9df4942012-02-08 09:58:21 -08003353 apq8064_epm_adc_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07003354}
3355
Huaibin Yang4a084e32011-12-15 15:25:52 -08003356static void __init apq8064_allocate_memory_regions(void)
3357{
3358 apq8064_allocate_fb_region();
3359}
3360
Joel King82b7e3f2012-01-05 10:03:27 -08003361static void __init apq8064_cdp_init(void)
3362{
Hanumant Singh50440d42012-04-23 19:27:16 -07003363 if (meminfo_init(SYS_MEMORY, SZ_256M) < 0)
3364 pr_err("meminfo_init() failed!\n");
Amy Maloche609bb5e2012-08-03 09:41:42 -07003365 if (machine_is_apq8064_mtp() &&
3366 SOCINFO_VERSION_MINOR(socinfo_get_platform_version()) == 1)
3367 cyttsp_pdata.sleep_gpio = CYTTSP_TS_GPIO_SLEEP_ALT;
Joel King82b7e3f2012-01-05 10:03:27 -08003368 apq8064_common_init();
Joel King8f839b92012-04-01 14:37:46 -07003369 if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
3370 machine_is_mpq8064_dtv()) {
Jay Chokshie7d8d4f2012-04-04 14:47:57 -07003371 enable_avc_i2c_bus();
Olav Hauganef95ae32012-05-15 09:50:30 -07003372 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003373 platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
Niranjana Vishwanathapura06f89332012-05-03 17:11:13 -06003374 mpq8064_pcie_init();
Joel King8f839b92012-04-01 14:37:46 -07003375 } else {
3376 ethernet_init();
Olav Hauganef95ae32012-05-15 09:50:30 -07003377 msm_rotator_set_split_iommu_domain();
Joel King8f839b92012-04-01 14:37:46 -07003378 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
3379 spi_register_board_info(spi_board_info,
3380 ARRAY_SIZE(spi_board_info));
3381 }
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003382 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07003383 apq8064_init_gpu();
Matt Wagantall1f65d9d2012-04-25 14:24:20 -07003384 platform_add_devices(apq8064_footswitch, apq8064_num_footswitch);
Steve Mucklef132c6c2012-06-06 18:30:57 -07003385#ifdef CONFIG_MSM_CAMERA
Kevin Chand07220e2012-02-13 15:52:22 -08003386 apq8064_init_cam();
Steve Mucklef132c6c2012-06-06 18:30:57 -07003387#endif
Mohan Pallaka474b94b2012-01-25 12:59:58 +05303388
3389 if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
3390 platform_device_register(&cdp_kp_pdev);
3391
3392 if (machine_is_apq8064_mtp())
3393 platform_device_register(&mtp_kp_pdev);
Hanumant Singh50440d42012-04-23 19:27:16 -07003394
Anirudh Ghayal32ea6252012-04-26 16:39:50 +05303395 if (machine_is_mpq8064_cdp()) {
3396 platform_device_register(&mpq_gpio_keys_pdev);
3397 platform_device_register(&mpq_keypad_device);
3398 }
Joel King82b7e3f2012-01-05 10:03:27 -08003399}
3400
Joel King82b7e3f2012-01-05 10:03:27 -08003401MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
3402 .map_io = apq8064_map_io,
3403 .reserve = apq8064_reserve,
3404 .init_irq = apq8064_init_irq,
3405 .handle_irq = gic_handle_irq,
3406 .timer = &msm_timer,
3407 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003408 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003409 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003410 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003411MACHINE_END
3412
3413MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
3414 .map_io = apq8064_map_io,
3415 .reserve = apq8064_reserve,
3416 .init_irq = apq8064_init_irq,
3417 .handle_irq = gic_handle_irq,
3418 .timer = &msm_timer,
3419 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003420 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003421 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003422 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003423MACHINE_END
3424
3425MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
3426 .map_io = apq8064_map_io,
3427 .reserve = apq8064_reserve,
3428 .init_irq = apq8064_init_irq,
3429 .handle_irq = gic_handle_irq,
3430 .timer = &msm_timer,
3431 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08003432 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003433 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003434 .restart = msm_restart,
Joel King82b7e3f2012-01-05 10:03:27 -08003435MACHINE_END
3436
Joel King064bbf82012-04-01 13:23:39 -07003437MACHINE_START(MPQ8064_CDP, "QCT MPQ8064 CDP")
3438 .map_io = apq8064_map_io,
3439 .reserve = apq8064_reserve,
3440 .init_irq = apq8064_init_irq,
3441 .handle_irq = gic_handle_irq,
3442 .timer = &msm_timer,
3443 .init_machine = apq8064_cdp_init,
3444 .init_early = apq8064_allocate_memory_regions,
3445 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003446 .restart = msm_restart,
Joel King064bbf82012-04-01 13:23:39 -07003447MACHINE_END
3448
Joel King11ca8202012-02-13 16:19:03 -08003449MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
3450 .map_io = apq8064_map_io,
3451 .reserve = apq8064_reserve,
3452 .init_irq = apq8064_init_irq,
3453 .handle_irq = gic_handle_irq,
3454 .timer = &msm_timer,
3455 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003456 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003457 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003458 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003459MACHINE_END
3460
3461MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
3462 .map_io = apq8064_map_io,
3463 .reserve = apq8064_reserve,
3464 .init_irq = apq8064_init_irq,
3465 .handle_irq = gic_handle_irq,
3466 .timer = &msm_timer,
3467 .init_machine = apq8064_cdp_init,
Joel King3a57e772012-05-28 11:22:55 -07003468 .init_early = apq8064_allocate_memory_regions,
Laura Abbott6988cef2012-03-15 14:27:13 -07003469 .init_very_early = apq8064_early_reserve,
Jeff Ohlsteindd0dd9b2012-05-29 17:47:21 -07003470 .restart = msm_restart,
Joel King11ca8202012-02-13 16:19:03 -08003471MACHINE_END
3472