blob: 12cee78012ee0b9223441d9281d25470e2b56186 [file] [log] [blame]
Manu Gautam5143b252012-01-05 19:25:23 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
16#include <linux/irq.h>
Kenneth Heitke748593a2011-07-15 15:45:11 -060017#include <linux/i2c.h>
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -060018#include <linux/slimbus/slimbus.h>
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -080019#include <linux/mfd/wcd9310/core.h>
20#include <linux/mfd/wcd9310/pdata.h>
Amy Maloche70090f992012-02-16 16:35:26 -080021#include <linux/mfd/pm8xxx/misc.h>
Kenneth Heitke36920d32011-07-20 16:44:30 -060022#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070023#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070024#include <linux/dma-mapping.h>
25#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080026#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080027#include <linux/memory.h>
Jing Lin21ed4de2012-02-05 15:53:28 -080028#include <linux/i2c/atmel_mxt_ts.h>
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -080029#include <linux/cyttsp.h>
Amy Maloche70090f992012-02-16 16:35:26 -080030#include <linux/i2c/isa1200.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053034#include <asm/mach/mmc.h>
Ankit Verma6b7e2ba2012-01-26 15:48:54 -080035#include <linux/platform_data/qcom_wcnss_device.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036
37#include <mach/board.h>
38#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080039#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040#include <linux/usb/msm_hsusb.h>
41#include <linux/usb/android.h>
42#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060043#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070044#include "timer.h"
45#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070046#include <mach/gpio.h>
47#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060048#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080049#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070050#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080051#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070052#include <mach/msm_memtypes.h>
53#include <linux/bootmem.h>
54#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070055#include <mach/dma.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070056#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060057#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080058#include <mach/mdm2.h>
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -080059#include <linux/msm_tsens.h>
Joel King4ebccc62011-07-22 09:43:22 -070060
Jeff Ohlstein7e668552011-10-06 16:17:25 -070061#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080062#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070063#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060064#include "spm.h"
65#include "mpm.h"
66#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080067#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060068#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080069#include "devices-msm8x60.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070070
Olav Haugan7c6aa742012-01-16 16:47:37 -080071#define MSM_PMEM_ADSP_SIZE 0x7800000
Ben Romberger3ffcd812011-12-08 19:12:10 -080072#define MSM_PMEM_AUDIO_SIZE 0x2B4000
Olav Haugan7c6aa742012-01-16 16:47:37 -080073#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
74#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
75#else
76#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
77#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070078
Olav Haugan7c6aa742012-01-16 16:47:37 -080079#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganedcf6832012-01-24 08:35:41 -080080#define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000
Olav Haugan7c6aa742012-01-16 16:47:37 -080081#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugand3d29682012-01-19 10:57:07 -080082#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080083#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Haugan3a9bd232012-02-15 14:23:27 -080084#define MSM_ION_QSECOM_SIZE 0x300000 /* (3MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080085#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -080086#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
87#define MSM_ION_HEAP_NUM 8
Olav Haugan7c6aa742012-01-16 16:47:37 -080088#else
89#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
90#define MSM_ION_HEAP_NUM 1
91#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070092
Olav Haugan7c6aa742012-01-16 16:47:37 -080093#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
94static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
95static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -070096{
Olav Haugan7c6aa742012-01-16 16:47:37 -080097 pmem_kernel_ebi1_size = memparse(p, NULL);
98 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -070099}
Olav Haugan7c6aa742012-01-16 16:47:37 -0800100early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
101#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700102
Olav Haugan7c6aa742012-01-16 16:47:37 -0800103#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -0700104static unsigned pmem_size = MSM_PMEM_SIZE;
105static int __init pmem_size_setup(char *p)
106{
107 pmem_size = memparse(p, NULL);
108 return 0;
109}
110early_param("pmem_size", pmem_size_setup);
111
112static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
113
114static int __init pmem_adsp_size_setup(char *p)
115{
116 pmem_adsp_size = memparse(p, NULL);
117 return 0;
118}
119early_param("pmem_adsp_size", pmem_adsp_size_setup);
120
121static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
122
123static int __init pmem_audio_size_setup(char *p)
124{
125 pmem_audio_size = memparse(p, NULL);
126 return 0;
127}
128early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800129#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700130
Olav Haugan7c6aa742012-01-16 16:47:37 -0800131#ifdef CONFIG_ANDROID_PMEM
132#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700133static struct android_pmem_platform_data android_pmem_pdata = {
134 .name = "pmem",
135 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
136 .cached = 1,
137 .memory_type = MEMTYPE_EBI1,
138};
139
140static struct platform_device android_pmem_device = {
141 .name = "android_pmem",
142 .id = 0,
143 .dev = {.platform_data = &android_pmem_pdata},
144};
145
146static struct android_pmem_platform_data android_pmem_adsp_pdata = {
147 .name = "pmem_adsp",
148 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
149 .cached = 0,
150 .memory_type = MEMTYPE_EBI1,
151};
Kevin Chan13be4e22011-10-20 11:30:32 -0700152static struct platform_device android_pmem_adsp_device = {
153 .name = "android_pmem",
154 .id = 2,
155 .dev = { .platform_data = &android_pmem_adsp_pdata },
156};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800157#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700158
159static struct android_pmem_platform_data android_pmem_audio_pdata = {
160 .name = "pmem_audio",
161 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
162 .cached = 0,
163 .memory_type = MEMTYPE_EBI1,
164};
165
166static struct platform_device android_pmem_audio_device = {
167 .name = "android_pmem",
168 .id = 4,
169 .dev = { .platform_data = &android_pmem_audio_pdata },
170};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800171#endif
172
173static struct memtype_reserve apq8064_reserve_table[] __initdata = {
174 [MEMTYPE_SMI] = {
175 },
176 [MEMTYPE_EBI0] = {
177 .flags = MEMTYPE_FLAGS_1M_ALIGN,
178 },
179 [MEMTYPE_EBI1] = {
180 .flags = MEMTYPE_FLAGS_1M_ALIGN,
181 },
182};
Kevin Chan13be4e22011-10-20 11:30:32 -0700183
184static void __init size_pmem_devices(void)
185{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800186#ifdef CONFIG_ANDROID_PMEM
187#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700188 android_pmem_adsp_pdata.size = pmem_adsp_size;
189 android_pmem_pdata.size = pmem_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800190#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700191 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800192#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700193}
194
195static void __init reserve_memory_for(struct android_pmem_platform_data *p)
196{
197 apq8064_reserve_table[p->memory_type].size += p->size;
198}
199
Kevin Chan13be4e22011-10-20 11:30:32 -0700200static void __init reserve_pmem_memory(void)
201{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800202#ifdef CONFIG_ANDROID_PMEM
203#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700204 reserve_memory_for(&android_pmem_adsp_pdata);
205 reserve_memory_for(&android_pmem_pdata);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800206#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700207 reserve_memory_for(&android_pmem_audio_pdata);
208 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800209#endif
210}
211
212static int apq8064_paddr_to_memtype(unsigned int paddr)
213{
214 return MEMTYPE_EBI1;
215}
216
217#ifdef CONFIG_ION_MSM
218#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
219static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
220 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800221 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800222};
223
224static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
225 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800226 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800227};
228
229static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800230 .adjacent_mem_id = INVALID_HEAP_ID,
231 .align = PAGE_SIZE,
232};
233
234static struct ion_co_heap_pdata fw_co_ion_pdata = {
235 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
236 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800237};
238#endif
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800239
240/**
241 * These heaps are listed in the order they will be allocated. Due to
242 * video hardware restrictions and content protection the FW heap has to
243 * be allocated adjacent (below) the MM heap and the MFC heap has to be
244 * allocated after the MM heap to ensure MFC heap is not more than 256MB
245 * away from the base address of the FW heap.
246 * However, the order of FW heap and MM heap doesn't matter since these
247 * two heaps are taken care of by separate code to ensure they are adjacent
248 * to each other.
249 * Don't swap the order unless you know what you are doing!
250 */
Olav Haugan7c6aa742012-01-16 16:47:37 -0800251static struct ion_platform_data ion_pdata = {
252 .nr = MSM_ION_HEAP_NUM,
253 .heaps = {
254 {
255 .id = ION_SYSTEM_HEAP_ID,
256 .type = ION_HEAP_TYPE_SYSTEM,
257 .name = ION_VMALLOC_HEAP_NAME,
258 },
259#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
260 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800261 .id = ION_CP_MM_HEAP_ID,
262 .type = ION_HEAP_TYPE_CP,
263 .name = ION_MM_HEAP_NAME,
264 .size = MSM_ION_MM_SIZE,
265 .memory_type = ION_EBI_TYPE,
266 .extra_data = (void *) &cp_mm_ion_pdata,
267 },
268 {
Olav Haugand3d29682012-01-19 10:57:07 -0800269 .id = ION_MM_FIRMWARE_HEAP_ID,
270 .type = ION_HEAP_TYPE_CARVEOUT,
271 .name = ION_MM_FIRMWARE_HEAP_NAME,
272 .size = MSM_ION_MM_FW_SIZE,
273 .memory_type = ION_EBI_TYPE,
274 .extra_data = (void *) &fw_co_ion_pdata,
275 },
276 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800277 .id = ION_CP_MFC_HEAP_ID,
278 .type = ION_HEAP_TYPE_CP,
279 .name = ION_MFC_HEAP_NAME,
280 .size = MSM_ION_MFC_SIZE,
281 .memory_type = ION_EBI_TYPE,
282 .extra_data = (void *) &cp_mfc_ion_pdata,
283 },
284 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800285 .id = ION_SF_HEAP_ID,
286 .type = ION_HEAP_TYPE_CARVEOUT,
287 .name = ION_SF_HEAP_NAME,
288 .size = MSM_ION_SF_SIZE,
289 .memory_type = ION_EBI_TYPE,
290 .extra_data = (void *) &co_ion_pdata,
291 },
292 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800293 .id = ION_IOMMU_HEAP_ID,
294 .type = ION_HEAP_TYPE_IOMMU,
295 .name = ION_IOMMU_HEAP_NAME,
296 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800297 {
298 .id = ION_QSECOM_HEAP_ID,
299 .type = ION_HEAP_TYPE_CARVEOUT,
300 .name = ION_QSECOM_HEAP_NAME,
301 .size = MSM_ION_QSECOM_SIZE,
302 .memory_type = ION_EBI_TYPE,
303 .extra_data = (void *) &co_ion_pdata,
304 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800305 {
306 .id = ION_AUDIO_HEAP_ID,
307 .type = ION_HEAP_TYPE_CARVEOUT,
308 .name = ION_AUDIO_HEAP_NAME,
309 .size = MSM_ION_AUDIO_SIZE,
310 .memory_type = ION_EBI_TYPE,
311 .extra_data = (void *) &co_ion_pdata,
312 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800313#endif
314 }
315};
316
317static struct platform_device ion_dev = {
318 .name = "ion-msm",
319 .id = 1,
320 .dev = { .platform_data = &ion_pdata },
321};
322#endif
323
324static void reserve_ion_memory(void)
325{
326#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
327 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800328 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800329 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
330 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800331 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800332 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800333#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700334}
335
Huaibin Yang4a084e32011-12-15 15:25:52 -0800336static void __init reserve_mdp_memory(void)
337{
338 apq8064_mdp_writeback(apq8064_reserve_table);
339}
340
Kevin Chan13be4e22011-10-20 11:30:32 -0700341static void __init apq8064_calculate_reserve_sizes(void)
342{
343 size_pmem_devices();
344 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800345 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800346 reserve_mdp_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700347}
348
349static struct reserve_info apq8064_reserve_info __initdata = {
350 .memtype_reserve_table = apq8064_reserve_table,
351 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
352 .paddr_to_memtype = apq8064_paddr_to_memtype,
353};
354
355static int apq8064_memory_bank_size(void)
356{
357 return 1<<29;
358}
359
360static void __init locate_unstable_memory(void)
361{
362 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
363 unsigned long bank_size;
364 unsigned long low, high;
365
366 bank_size = apq8064_memory_bank_size();
367 low = meminfo.bank[0].start;
368 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800369
370 /* Check if 32 bit overflow occured */
371 if (high < mb->start)
372 high = ~0UL;
373
Kevin Chan13be4e22011-10-20 11:30:32 -0700374 low &= ~(bank_size - 1);
375
376 if (high - low <= bank_size)
377 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800378 apq8064_reserve_info.low_unstable_address = mb->start -
379 MIN_MEMORY_BLOCK_SIZE + mb->size;
380 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
381
Kevin Chan13be4e22011-10-20 11:30:32 -0700382 apq8064_reserve_info.bank_size = bank_size;
383 pr_info("low unstable address %lx max size %lx bank size %lx\n",
384 apq8064_reserve_info.low_unstable_address,
385 apq8064_reserve_info.max_unstable_size,
386 apq8064_reserve_info.bank_size);
387}
388
389static void __init apq8064_reserve(void)
390{
391 reserve_info = &apq8064_reserve_info;
392 locate_unstable_memory();
393 msm_reserve();
394}
395
Hemant Kumara945b472012-01-25 15:08:06 -0800396#ifdef CONFIG_USB_EHCI_MSM_HSIC
397static struct msm_hsic_host_platform_data msm_hsic_pdata = {
398 .strobe = 88,
399 .data = 89,
400};
401#else
402static struct msm_hsic_host_platform_data msm_hsic_pdata;
403#endif
404
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800405#define PID_MAGIC_ID 0x71432909
406#define SERIAL_NUM_MAGIC_ID 0x61945374
407#define SERIAL_NUMBER_LENGTH 127
408#define DLOAD_USB_BASE_ADD 0x2A03F0C8
409
410struct magic_num_struct {
411 uint32_t pid;
412 uint32_t serial_num;
413};
414
415struct dload_struct {
416 uint32_t reserved1;
417 uint32_t reserved2;
418 uint32_t reserved3;
419 uint16_t reserved4;
420 uint16_t pid;
421 char serial_number[SERIAL_NUMBER_LENGTH];
422 uint16_t reserved5;
423 struct magic_num_struct magic_struct;
424};
425
426static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
427{
428 struct dload_struct __iomem *dload = 0;
429
430 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
431 if (!dload) {
432 pr_err("%s: cannot remap I/O memory region: %08x\n",
433 __func__, DLOAD_USB_BASE_ADD);
434 return -ENXIO;
435 }
436
437 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
438 __func__, dload, pid, snum);
439 /* update pid */
440 dload->magic_struct.pid = PID_MAGIC_ID;
441 dload->pid = pid;
442
443 /* update serial number */
444 dload->magic_struct.serial_num = 0;
445 if (!snum) {
446 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
447 goto out;
448 }
449
450 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
451 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
452out:
453 iounmap(dload);
454 return 0;
455}
456
457static struct android_usb_platform_data android_usb_pdata = {
458 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
459};
460
Hemant Kumar4933b072011-10-17 23:43:11 -0700461static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800462 .name = "android_usb",
463 .id = -1,
464 .dev = {
465 .platform_data = &android_usb_pdata,
466 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700467};
468
469static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800470 .mode = USB_OTG,
471 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700472 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800473 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
474 .power_budget = 750,
Hemant Kumar4933b072011-10-17 23:43:11 -0700475};
476
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800477#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
478
479/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
480 * 4 micbiases are used to power various analog and digital
481 * microphones operating at 1800 mV. Technically, all micbiases
482 * can source from single cfilter since all microphones operate
483 * at the same voltage level. The arrangement below is to make
484 * sure all cfilters are exercised. LDO_H regulator ouput level
485 * does not need to be as high as 2.85V. It is choosen for
486 * microphone sensitivity purpose.
487 */
488static struct tabla_pdata apq8064_tabla_platform_data = {
489 .slimbus_slave_device = {
490 .name = "tabla-slave",
491 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
492 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800493 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800494 .irq_base = TABLA_INTERRUPT_BASE,
495 .num_irqs = NR_TABLA_IRQS,
496 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
497 .micbias = {
498 .ldoh_v = TABLA_LDOH_2P85_V,
499 .cfilt1_mv = 1800,
500 .cfilt2_mv = 1800,
501 .cfilt3_mv = 1800,
502 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
503 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
504 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
505 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
506 }
507};
508
509static struct slim_device apq8064_slim_tabla = {
510 .name = "tabla-slim",
511 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
512 .dev = {
513 .platform_data = &apq8064_tabla_platform_data,
514 },
515};
516
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800517static struct tabla_pdata apq8064_tabla20_platform_data = {
518 .slimbus_slave_device = {
519 .name = "tabla-slave",
520 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
521 },
522 .irq = MSM_GPIO_TO_INT(42),
523 .irq_base = TABLA_INTERRUPT_BASE,
524 .num_irqs = NR_TABLA_IRQS,
525 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
526 .micbias = {
527 .ldoh_v = TABLA_LDOH_2P85_V,
528 .cfilt1_mv = 1800,
529 .cfilt2_mv = 1800,
530 .cfilt3_mv = 1800,
531 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
532 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
533 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
534 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
535 }
536};
537
538static struct slim_device apq8064_slim_tabla20 = {
539 .name = "tabla2x-slim",
540 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
541 .dev = {
542 .platform_data = &apq8064_tabla20_platform_data,
543 },
544};
545
Amy Maloche70090f992012-02-16 16:35:26 -0800546#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
547#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
548#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
549#define ISA1200_HAP_CLK PM8921_GPIO_PM_TO_SYS(44)
550
551static int isa1200_power(int on)
552{
553 gpio_set_value_cansleep(ISA1200_HAP_CLK, !!on);
554
555 return 0;
556}
557
558static int isa1200_dev_setup(bool enable)
559{
560 int rc = 0;
561
562 rc = pm8xxx_aux_clk_control(CLK_MP3_2, XO_DIV_1, enable);
563 if (rc) {
564 pr_err("%s: unable to write aux clock register(%d)\n",
565 __func__, rc);
566 return rc;
567 }
568
569 if (!enable)
570 goto free_gpio;
571
572 rc = gpio_request(ISA1200_HAP_CLK, "haptics_clk");
573 if (rc) {
574 pr_err("%s: unable to request gpio %d config(%d)\n",
575 __func__, ISA1200_HAP_CLK, rc);
576 return rc;
577 }
578
579 rc = gpio_direction_output(ISA1200_HAP_CLK, 0);
580 if (rc) {
581 pr_err("%s: unable to set direction\n", __func__);
582 goto free_gpio;
583 }
584
585 return 0;
586
587free_gpio:
588 gpio_free(ISA1200_HAP_CLK);
589 return rc;
590}
591
592static struct isa1200_regulator isa1200_reg_data[] = {
593 {
594 .name = "vddp",
595 .min_uV = ISA_I2C_VTG_MIN_UV,
596 .max_uV = ISA_I2C_VTG_MAX_UV,
597 .load_uA = ISA_I2C_CURR_UA,
598 },
599};
600
601static struct isa1200_platform_data isa1200_1_pdata = {
602 .name = "vibrator",
603 .dev_setup = isa1200_dev_setup,
604 .power_on = isa1200_power,
605 .hap_en_gpio = ISA1200_HAP_EN_GPIO,
606 .hap_len_gpio = ISA1200_HAP_LEN_GPIO,
607 .max_timeout = 15000,
608 .mode_ctrl = PWM_GEN_MODE,
609 .pwm_fd = {
610 .pwm_div = 256,
611 },
612 .is_erm = false,
613 .smart_en = true,
614 .ext_clk_en = true,
615 .chip_en = 1,
616 .regulator_info = isa1200_reg_data,
617 .num_regulators = ARRAY_SIZE(isa1200_reg_data),
618};
619
620static struct i2c_board_info isa1200_board_info[] __initdata = {
621 {
622 I2C_BOARD_INFO("isa1200_1", 0x90>>1),
623 .platform_data = &isa1200_1_pdata,
624 },
625};
Jing Lin21ed4de2012-02-05 15:53:28 -0800626/* configuration data for mxt1386e using V2.1 firmware */
627static const u8 mxt1386e_config_data_v2_1[] = {
628 /* T6 Object */
629 0, 0, 0, 0, 0, 0,
630 /* T38 Object */
631 14, 0, 0, 24, 1, 12, 0, 0, 0, 0,
632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
633 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
634 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
635 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
636 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
637 0, 0, 0, 0,
638 /* T7 Object */
639 100, 16, 50,
640 /* T8 Object */
641 25, 0, 20, 20, 0, 0, 20, 50, 0, 0,
642 /* T9 Object */
643 131, 0, 0, 26, 42, 0, 32, 80, 2, 5,
644 0, 5, 5, 0, 10, 30, 10, 10, 255, 2,
645 85, 5, 10, 10, 10, 10, 135, 55, 70, 40,
646 10, 5, 0, 0, 0,
647 /* T18 Object */
648 0, 0,
649 /* T24 Object */
650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
651 0, 0, 0, 0, 0, 0, 0, 0, 0,
652 /* T25 Object */
653 3, 0, 60, 115, 156, 99,
654 /* T27 Object */
655 0, 0, 0, 0, 0, 0, 0,
656 /* T40 Object */
657 0, 0, 0, 0, 0,
658 /* T42 Object */
659 2, 0, 255, 0, 255, 0, 0, 0, 0, 0,
660 /* T43 Object */
661 0, 0, 0, 0, 0, 0, 0, 64, 0, 8,
662 16,
663 /* T46 Object */
664 64, 0, 20, 20, 0, 0, 0, 0, 0,
665 /* T47 Object */
666 0, 0, 0, 0, 0, 0, 3, 64, 66, 0,
667 /* T48 Object */
668 31, 64, 64, 0, 0, 0, 0, 0, 0, 0,
669 48, 40, 0, 10, 10, 0, 0, 100, 10, 80,
670 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
671 52, 0, 12, 0, 17, 0, 1, 0, 0, 0,
672 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
673 0, 0, 0, 0,
674 /* T56 Object */
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
676 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
679 2, 99, 33, 0, 149, 24, 193, 255, 255, 255,
680 255,
681};
682
683#define MXT_TS_GPIO_IRQ 6
684#define MXT_TS_PWR_EN_GPIO PM8921_GPIO_PM_TO_SYS(23)
685#define MXT_TS_RESET_GPIO 33
686
687static struct mxt_config_info mxt_config_array[] = {
688 {
689 .config = mxt1386e_config_data_v2_1,
690 .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1),
691 .family_id = 0xA0,
692 .variant_id = 0x7,
693 .version = 0x21,
694 .build = 0xAA,
695 },
696};
697
698static struct mxt_platform_data mxt_platform_data = {
699 .config_array = mxt_config_array,
700 .config_array_size = ARRAY_SIZE(mxt_config_array),
701 .x_size = 1365,
702 .y_size = 767,
703 .irqflags = IRQF_TRIGGER_FALLING,
704 .i2c_pull_up = true,
705 .reset_gpio = MXT_TS_RESET_GPIO,
706 .irq_gpio = MXT_TS_GPIO_IRQ,
707};
708
709static struct i2c_board_info mxt_device_info[] __initdata = {
710 {
711 I2C_BOARD_INFO("atmel_mxt_ts", 0x5b),
712 .platform_data = &mxt_platform_data,
713 .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ),
714 },
715};
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -0800716#define CYTTSP_TS_GPIO_IRQ 6
717#define CYTTSP_TS_GPIO_RESOUT 7
718#define CYTTSP_TS_GPIO_SLEEP 33
719
720static ssize_t tma340_vkeys_show(struct kobject *kobj,
721 struct kobj_attribute *attr, char *buf)
722{
723 return snprintf(buf, 200,
724 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97"
725 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97"
726 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97"
727 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97"
728 "\n");
729}
730
731static struct kobj_attribute tma340_vkeys_attr = {
732 .attr = {
733 .mode = S_IRUGO,
734 },
735 .show = &tma340_vkeys_show,
736};
737
738static struct attribute *tma340_properties_attrs[] = {
739 &tma340_vkeys_attr.attr,
740 NULL
741};
742
743static struct attribute_group tma340_properties_attr_group = {
744 .attrs = tma340_properties_attrs,
745};
746
747static int cyttsp_platform_init(struct i2c_client *client)
748{
749 int rc = 0;
750 static struct kobject *tma340_properties_kobj;
751
752 tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c";
753 tma340_properties_kobj = kobject_create_and_add("board_properties",
754 NULL);
755 if (tma340_properties_kobj)
756 rc = sysfs_create_group(tma340_properties_kobj,
757 &tma340_properties_attr_group);
758 if (!tma340_properties_kobj || rc)
759 pr_err("%s: failed to create board_properties\n",
760 __func__);
761
762 return 0;
763}
764
765static struct cyttsp_regulator cyttsp_regulator_data[] = {
766 {
767 .name = "vdd",
768 .min_uV = CY_TMA300_VTG_MIN_UV,
769 .max_uV = CY_TMA300_VTG_MAX_UV,
770 .hpm_load_uA = CY_TMA300_CURR_24HZ_UA,
771 .lpm_load_uA = CY_TMA300_CURR_24HZ_UA,
772 },
773 {
774 .name = "vcc_i2c",
775 .min_uV = CY_I2C_VTG_MIN_UV,
776 .max_uV = CY_I2C_VTG_MAX_UV,
777 .hpm_load_uA = CY_I2C_CURR_UA,
778 .lpm_load_uA = CY_I2C_CURR_UA,
779 },
780};
781
782static struct cyttsp_platform_data cyttsp_pdata = {
783 .panel_maxx = 634,
784 .panel_maxy = 1166,
785 .disp_maxx = 599,
786 .disp_maxy = 1023,
787 .disp_minx = 0,
788 .disp_miny = 0,
789 .flags = 0x01,
790 .gen = CY_GEN3,
791 .use_st = CY_USE_ST,
792 .use_mt = CY_USE_MT,
793 .use_hndshk = CY_SEND_HNDSHK,
794 .use_trk_id = CY_USE_TRACKING_ID,
795 .use_sleep = CY_USE_DEEP_SLEEP_SEL,
796 .use_gestures = CY_USE_GESTURES,
797 .fw_fname = "cyttsp_8064_mtp.hex",
798 /* change act_intrvl to customize the Active power state
799 * scanning/processing refresh interval for Operating mode
800 */
801 .act_intrvl = CY_ACT_INTRVL_DFLT,
802 /* change tch_tmout to customize the touch timeout for the
803 * Active power state for Operating mode
804 */
805 .tch_tmout = CY_TCH_TMOUT_DFLT,
806 /* change lp_intrvl to customize the Low Power power state
807 * scanning/processing refresh interval for Operating mode
808 */
809 .lp_intrvl = CY_LP_INTRVL_DFLT,
810 .sleep_gpio = CYTTSP_TS_GPIO_SLEEP,
811 .resout_gpio = CYTTSP_TS_GPIO_RESOUT,
812 .irq_gpio = CYTTSP_TS_GPIO_IRQ,
813 .regulator_info = cyttsp_regulator_data,
814 .num_regulators = ARRAY_SIZE(cyttsp_regulator_data),
815 .init = cyttsp_platform_init,
816 .correct_fw_ver = 17,
817};
818
819static struct i2c_board_info cyttsp_info[] __initdata = {
820 {
821 I2C_BOARD_INFO(CY_I2C_NAME, 0x24),
822 .platform_data = &cyttsp_pdata,
823 .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ),
824 },
825};
Jing Lin21ed4de2012-02-05 15:53:28 -0800826
Ankit Verma6b7e2ba2012-01-26 15:48:54 -0800827#define MSM_WCNSS_PHYS 0x03000000
828#define MSM_WCNSS_SIZE 0x280000
829
830static struct resource resources_wcnss_wlan[] = {
831 {
832 .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
833 .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ,
834 .name = "wcnss_wlanrx_irq",
835 .flags = IORESOURCE_IRQ,
836 },
837 {
838 .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
839 .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ,
840 .name = "wcnss_wlantx_irq",
841 .flags = IORESOURCE_IRQ,
842 },
843 {
844 .start = MSM_WCNSS_PHYS,
845 .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1,
846 .name = "wcnss_mmio",
847 .flags = IORESOURCE_MEM,
848 },
849 {
850 .start = 64,
851 .end = 68,
852 .name = "wcnss_gpios_5wire",
853 .flags = IORESOURCE_IO,
854 },
855};
856
857static struct qcom_wcnss_opts qcom_wcnss_pdata = {
858 .has_48mhz_xo = 1,
859};
860
861static struct platform_device msm_device_wcnss_wlan = {
862 .name = "wcnss_wlan",
863 .id = 0,
864 .num_resources = ARRAY_SIZE(resources_wcnss_wlan),
865 .resource = resources_wcnss_wlan,
866 .dev = {.platform_data = &qcom_wcnss_pdata},
867};
868
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700869#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
870 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
871 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
872 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
873
874#define QCE_SIZE 0x10000
875#define QCE_0_BASE 0x11000000
876
877#define QCE_HW_KEY_SUPPORT 0
878#define QCE_SHA_HMAC_SUPPORT 1
879#define QCE_SHARE_CE_RESOURCE 3
880#define QCE_CE_SHARED 0
881
882static struct resource qcrypto_resources[] = {
883 [0] = {
884 .start = QCE_0_BASE,
885 .end = QCE_0_BASE + QCE_SIZE - 1,
886 .flags = IORESOURCE_MEM,
887 },
888 [1] = {
889 .name = "crypto_channels",
890 .start = DMOV8064_CE_IN_CHAN,
891 .end = DMOV8064_CE_OUT_CHAN,
892 .flags = IORESOURCE_DMA,
893 },
894 [2] = {
895 .name = "crypto_crci_in",
896 .start = DMOV8064_CE_IN_CRCI,
897 .end = DMOV8064_CE_IN_CRCI,
898 .flags = IORESOURCE_DMA,
899 },
900 [3] = {
901 .name = "crypto_crci_out",
902 .start = DMOV8064_CE_OUT_CRCI,
903 .end = DMOV8064_CE_OUT_CRCI,
904 .flags = IORESOURCE_DMA,
905 },
906};
907
908static struct resource qcedev_resources[] = {
909 [0] = {
910 .start = QCE_0_BASE,
911 .end = QCE_0_BASE + QCE_SIZE - 1,
912 .flags = IORESOURCE_MEM,
913 },
914 [1] = {
915 .name = "crypto_channels",
916 .start = DMOV8064_CE_IN_CHAN,
917 .end = DMOV8064_CE_OUT_CHAN,
918 .flags = IORESOURCE_DMA,
919 },
920 [2] = {
921 .name = "crypto_crci_in",
922 .start = DMOV8064_CE_IN_CRCI,
923 .end = DMOV8064_CE_IN_CRCI,
924 .flags = IORESOURCE_DMA,
925 },
926 [3] = {
927 .name = "crypto_crci_out",
928 .start = DMOV8064_CE_OUT_CRCI,
929 .end = DMOV8064_CE_OUT_CRCI,
930 .flags = IORESOURCE_DMA,
931 },
932};
933
934#endif
935
936#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
937 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
938
939static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
940 .ce_shared = QCE_CE_SHARED,
941 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
942 .hw_key_support = QCE_HW_KEY_SUPPORT,
943 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800944 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700945};
946
947static struct platform_device qcrypto_device = {
948 .name = "qcrypto",
949 .id = 0,
950 .num_resources = ARRAY_SIZE(qcrypto_resources),
951 .resource = qcrypto_resources,
952 .dev = {
953 .coherent_dma_mask = DMA_BIT_MASK(32),
954 .platform_data = &qcrypto_ce_hw_suppport,
955 },
956};
957#endif
958
959#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
960 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
961
962static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
963 .ce_shared = QCE_CE_SHARED,
964 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
965 .hw_key_support = QCE_HW_KEY_SUPPORT,
966 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800967 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700968};
969
970static struct platform_device qcedev_device = {
971 .name = "qce",
972 .id = 0,
973 .num_resources = ARRAY_SIZE(qcedev_resources),
974 .resource = qcedev_resources,
975 .dev = {
976 .coherent_dma_mask = DMA_BIT_MASK(32),
977 .platform_data = &qcedev_ce_hw_suppport,
978 },
979};
980#endif
981
Joel Kingdacbc822012-01-25 13:30:57 -0800982static struct mdm_platform_data mdm_platform_data = {
983 .mdm_version = "3.0",
984 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -0800985 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -0800986};
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700987
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -0800988static struct tsens_platform_data apq_tsens_pdata = {
989 .tsens_factor = 1000,
990 .hw_type = APQ_8064,
991 .tsens_num_sensor = 11,
992 .slope = {1176, 1176, 1154, 1176, 1111,
993 1132, 1132, 1199, 1132, 1199, 1132},
994};
995
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600996#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700997static void __init apq8064_map_io(void)
998{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600999 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001000 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -07001001 if (socinfo_init() < 0)
1002 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001003}
1004
1005static void __init apq8064_init_irq(void)
1006{
Praveen Chidambaram78499012011-11-01 17:15:17 -06001007 struct msm_mpm_device_data *data = NULL;
1008
1009#ifdef CONFIG_MSM_MPM
1010 data = &apq8064_mpm_dev_data;
1011#endif
1012
1013 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001014 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
1015 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001016}
1017
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001018static struct platform_device msm8064_device_saw_regulator_core0 = {
1019 .name = "saw-regulator",
1020 .id = 0,
1021 .dev = {
1022 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
1023 },
1024};
1025
1026static struct platform_device msm8064_device_saw_regulator_core1 = {
1027 .name = "saw-regulator",
1028 .id = 1,
1029 .dev = {
1030 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
1031 },
1032};
1033
1034static struct platform_device msm8064_device_saw_regulator_core2 = {
1035 .name = "saw-regulator",
1036 .id = 2,
1037 .dev = {
1038 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
1039 },
1040};
1041
1042static struct platform_device msm8064_device_saw_regulator_core3 = {
1043 .name = "saw-regulator",
1044 .id = 3,
1045 .dev = {
1046 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001047
1048 },
1049};
1050
1051static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
1052 {
1053 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
1054 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1055 true,
1056 100, 8000, 100000, 1,
1057 },
1058
1059 {
1060 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
1061 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
1062 true,
1063 2000, 6000, 60100000, 3000,
1064 },
1065
1066 {
1067 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1068 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
1069 false,
1070 4200, 5000, 60350000, 3500,
1071 },
1072
1073 {
1074 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1075 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
1076 false,
1077 6300, 4500, 65350000, 4800,
1078 },
1079
1080 {
1081 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1082 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
1083 false,
1084 11700, 2500, 67850000, 5500,
1085 },
1086
1087 {
1088 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1089 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
1090 false,
1091 13800, 2000, 71850000, 6800,
1092 },
1093
1094 {
1095 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1096 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
1097 false,
1098 29700, 500, 75850000, 8800,
1099 },
1100
1101 {
1102 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
1103 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
1104 false,
1105 29700, 0, 76350000, 9800,
1106 },
1107};
1108
1109static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
1110 .mode = MSM_PM_BOOT_CONFIG_TZ,
1111};
1112
1113static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
1114 .levels = &msm_rpmrs_levels[0],
1115 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
1116 .vdd_mem_levels = {
1117 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
1118 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
1119 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
1120 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
1121 },
1122 .vdd_dig_levels = {
1123 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
1124 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
1125 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
1126 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
1127 },
1128 .vdd_mask = 0x7FFFFF,
1129 .rpmrs_target_id = {
1130 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
1131 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
1132 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
1133 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
1134 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
1135 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
1136 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
1137 },
1138};
1139
1140static struct msm_cpuidle_state msm_cstates[] __initdata = {
1141 {0, 0, "C0", "WFI",
1142 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1143
1144 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1145 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1146
1147 {0, 2, "C2", "POWER_COLLAPSE",
1148 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
1149
1150 {1, 0, "C0", "WFI",
1151 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1152
1153 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1154 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1155
1156 {2, 0, "C0", "WFI",
1157 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1158
1159 {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1160 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1161
1162 {3, 0, "C0", "WFI",
1163 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
1164
1165 {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
1166 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
1167};
1168
1169static struct msm_pm_platform_data msm_pm_data[] = {
1170 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1171 .idle_supported = 1,
1172 .suspend_supported = 1,
1173 .idle_enabled = 0,
1174 .suspend_enabled = 0,
1175 },
1176
1177 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1178 .idle_supported = 1,
1179 .suspend_supported = 1,
1180 .idle_enabled = 0,
1181 .suspend_enabled = 0,
1182 },
1183
1184 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1185 .idle_supported = 1,
1186 .suspend_supported = 1,
1187 .idle_enabled = 1,
1188 .suspend_enabled = 1,
1189 },
1190
1191 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1192 .idle_supported = 0,
1193 .suspend_supported = 1,
1194 .idle_enabled = 0,
1195 .suspend_enabled = 0,
1196 },
1197
1198 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1199 .idle_supported = 1,
1200 .suspend_supported = 1,
1201 .idle_enabled = 0,
1202 .suspend_enabled = 0,
1203 },
1204
1205 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1206 .idle_supported = 1,
1207 .suspend_supported = 0,
1208 .idle_enabled = 1,
1209 .suspend_enabled = 0,
1210 },
1211
1212 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1213 .idle_supported = 0,
1214 .suspend_supported = 1,
1215 .idle_enabled = 0,
1216 .suspend_enabled = 0,
1217 },
1218
1219 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1220 .idle_supported = 1,
1221 .suspend_supported = 1,
1222 .idle_enabled = 0,
1223 .suspend_enabled = 0,
1224 },
1225
1226 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1227 .idle_supported = 1,
1228 .suspend_supported = 0,
1229 .idle_enabled = 1,
1230 .suspend_enabled = 0,
1231 },
1232
1233 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
1234 .idle_supported = 0,
1235 .suspend_supported = 1,
1236 .idle_enabled = 0,
1237 .suspend_enabled = 0,
1238 },
1239
1240 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
1241 .idle_supported = 1,
1242 .suspend_supported = 1,
1243 .idle_enabled = 0,
1244 .suspend_enabled = 0,
1245 },
1246
1247 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
1248 .idle_supported = 1,
1249 .suspend_supported = 0,
1250 .idle_enabled = 1,
1251 .suspend_enabled = 0,
1252 },
1253};
1254
1255static uint8_t spm_wfi_cmd_sequence[] __initdata = {
1256 0x03, 0x0f,
1257};
1258
1259static uint8_t spm_power_collapse_without_rpm[] __initdata = {
1260 0x00, 0x24, 0x54, 0x10,
1261 0x09, 0x03, 0x01,
1262 0x10, 0x54, 0x30, 0x0C,
1263 0x24, 0x30, 0x0f,
1264};
1265
1266static uint8_t spm_power_collapse_with_rpm[] __initdata = {
1267 0x00, 0x24, 0x54, 0x10,
1268 0x09, 0x07, 0x01, 0x0B,
1269 0x10, 0x54, 0x30, 0x0C,
1270 0x24, 0x30, 0x0f,
1271};
1272
1273static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
1274 [0] = {
1275 .mode = MSM_SPM_MODE_CLOCK_GATING,
1276 .notify_rpm = false,
1277 .cmd = spm_wfi_cmd_sequence,
1278 },
1279 [1] = {
1280 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1281 .notify_rpm = false,
1282 .cmd = spm_power_collapse_without_rpm,
1283 },
1284 [2] = {
1285 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
1286 .notify_rpm = true,
1287 .cmd = spm_power_collapse_with_rpm,
1288 },
1289};
1290
1291static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
1292 0x00, 0x20, 0x03, 0x20,
1293 0x00, 0x0f,
1294};
1295
1296static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
1297 0x00, 0x20, 0x34, 0x64,
1298 0x48, 0x07, 0x48, 0x20,
1299 0x50, 0x64, 0x04, 0x34,
1300 0x50, 0x0f,
1301};
1302static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
1303 0x00, 0x10, 0x34, 0x64,
1304 0x48, 0x07, 0x48, 0x10,
1305 0x50, 0x64, 0x04, 0x34,
1306 0x50, 0x0F,
1307};
1308
1309static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
1310 [0] = {
1311 .mode = MSM_SPM_L2_MODE_RETENTION,
1312 .notify_rpm = false,
1313 .cmd = l2_spm_wfi_cmd_sequence,
1314 },
1315 [1] = {
1316 .mode = MSM_SPM_L2_MODE_GDHS,
1317 .notify_rpm = true,
1318 .cmd = l2_spm_gdhs_cmd_sequence,
1319 },
1320 [2] = {
1321 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
1322 .notify_rpm = true,
1323 .cmd = l2_spm_power_off_cmd_sequence,
1324 },
1325};
1326
1327
1328static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
1329 [0] = {
1330 .reg_base_addr = MSM_SAW_L2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001331 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
1332 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1333 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
1334 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
1335 .modes = msm_spm_l2_seq_list,
1336 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
1337 },
1338};
1339
1340static struct msm_spm_platform_data msm_spm_data[] __initdata = {
1341 [0] = {
1342 .reg_base_addr = MSM_SAW0_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001343 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001344#if defined(CONFIG_MSM_AVS_HW)
1345 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1346 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1347#endif
1348 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1349 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1350 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1351 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1352 .vctl_timeout_us = 50,
1353 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1354 .modes = msm_spm_seq_list,
1355 },
1356 [1] = {
1357 .reg_base_addr = MSM_SAW1_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001358 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001359#if defined(CONFIG_MSM_AVS_HW)
1360 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1361 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1362#endif
1363 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1364 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1365 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1366 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1367 .vctl_timeout_us = 50,
1368 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1369 .modes = msm_spm_seq_list,
1370 },
1371 [2] = {
1372 .reg_base_addr = MSM_SAW2_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001373 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001374#if defined(CONFIG_MSM_AVS_HW)
1375 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1376 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1377#endif
1378 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1379 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1380 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1381 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1382 .vctl_timeout_us = 50,
1383 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1384 .modes = msm_spm_seq_list,
1385 },
1386 [3] = {
1387 .reg_base_addr = MSM_SAW3_BASE,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001388 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001389#if defined(CONFIG_MSM_AVS_HW)
1390 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1391 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1392#endif
1393 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1394 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1395 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1396 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1397 .vctl_timeout_us = 50,
1398 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1399 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001400 },
1401};
1402
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001403static void __init apq8064_init_buses(void)
1404{
1405 msm_bus_rpm_set_mt_mask();
1406 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1407 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1408 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1409 msm_bus_8064_apps_fabric.dev.platform_data =
1410 &msm_bus_8064_apps_fabric_pdata;
1411 msm_bus_8064_sys_fabric.dev.platform_data =
1412 &msm_bus_8064_sys_fabric_pdata;
1413 msm_bus_8064_mm_fabric.dev.platform_data =
1414 &msm_bus_8064_mm_fabric_pdata;
1415 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1416 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1417}
1418
David Collinsf0d00732012-01-25 15:46:50 -08001419static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1420 .name = GPIO_REGULATOR_DEV_NAME,
1421 .id = PM8921_MPP_PM_TO_SYS(7),
1422 .dev = {
1423 .platform_data
1424 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1425 },
1426};
1427
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001428static struct platform_device apq8064_device_ext_mpp8_vreg __devinitdata = {
1429 .name = GPIO_REGULATOR_DEV_NAME,
1430 .id = PM8921_MPP_PM_TO_SYS(8),
1431 .dev = {
1432 .platform_data
1433 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_MPP8],
1434 },
1435};
1436
David Collinsf0d00732012-01-25 15:46:50 -08001437static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1438 .name = GPIO_REGULATOR_DEV_NAME,
1439 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1440 .dev = {
1441 .platform_data =
1442 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1443 },
1444};
1445
David Collins390fc332012-02-07 14:38:16 -08001446static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1447 .name = GPIO_REGULATOR_DEV_NAME,
1448 .id = PM8921_GPIO_PM_TO_SYS(23),
1449 .dev = {
1450 .platform_data
1451 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1452 },
1453};
1454
David Collins2782b5c2012-02-06 10:02:42 -08001455static struct platform_device apq8064_device_rpm_regulator __devinitdata = {
1456 .name = "rpm-regulator",
1457 .id = -1,
1458 .dev = {
1459 .platform_data = &apq8064_rpm_regulator_pdata,
1460 },
1461};
1462
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001463static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001464 &apq8064_device_dmov,
David Keitel3c40fc52012-02-09 17:53:52 -08001465 &apq8064_device_qup_i2c_gsbi1,
Jing Lin04601f92012-02-05 15:36:07 -08001466 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001467 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001468 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001469 &apq8064_device_ext_5v_vreg,
Jay Chokshi1de4f9d2012-02-07 16:11:31 -08001470 &apq8064_device_ext_mpp8_vreg,
David Collinsf0d00732012-01-25 15:46:50 -08001471 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001472 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001473 &apq8064_device_ssbi_pmic1,
1474 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001475 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001476 &apq8064_device_otg,
1477 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001478 &apq8064_device_hsusb_host,
Hemant Kumara945b472012-01-25 15:08:06 -08001479 &apq8064_device_hsic_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001480 &android_usb_device,
Ankit Verma6b7e2ba2012-01-26 15:48:54 -08001481 &msm_device_wcnss_wlan,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001482#ifdef CONFIG_ANDROID_PMEM
1483#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -07001484 &android_pmem_device,
1485 &android_pmem_adsp_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001486#endif
Kevin Chan13be4e22011-10-20 11:30:32 -07001487 &android_pmem_audio_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001488#endif
1489#ifdef CONFIG_ION_MSM
1490 &ion_dev,
1491#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001492 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001493 &msm8064_device_saw_regulator_core0,
1494 &msm8064_device_saw_regulator_core1,
1495 &msm8064_device_saw_regulator_core2,
1496 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001497#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1498 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1499 &qcrypto_device,
1500#endif
1501
1502#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1503 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1504 &qcedev_device,
1505#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001506
1507#ifdef CONFIG_HW_RANDOM_MSM
1508 &apq8064_device_rng,
1509#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001510 &apq_pcm,
1511 &apq_pcm_routing,
1512 &apq_cpudai0,
1513 &apq_cpudai1,
1514 &apq_cpudai_hdmi_rx,
1515 &apq_cpudai_bt_rx,
1516 &apq_cpudai_bt_tx,
1517 &apq_cpudai_fm_rx,
1518 &apq_cpudai_fm_tx,
1519 &apq_cpu_fe,
1520 &apq_stub_codec,
1521 &apq_voice,
1522 &apq_voip,
1523 &apq_lpa_pcm,
1524 &apq_pcm_hostless,
1525 &apq_cpudai_afe_01_rx,
1526 &apq_cpudai_afe_01_tx,
1527 &apq_cpudai_afe_02_rx,
1528 &apq_cpudai_afe_02_tx,
1529 &apq_pcm_afe,
1530 &apq_cpudai_auxpcm_rx,
1531 &apq_cpudai_auxpcm_tx,
Neema Shetty8427c262012-02-16 11:23:43 -08001532 &apq_cpudai_stub,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001533 &apq8064_rpm_device,
1534 &apq8064_rpm_log_device,
1535 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001536 &msm_bus_8064_apps_fabric,
1537 &msm_bus_8064_sys_fabric,
1538 &msm_bus_8064_mm_fabric,
1539 &msm_bus_8064_sys_fpb,
1540 &msm_bus_8064_cpss_fpb,
Mohan Kumar Gubbihalli Lachma Naik7f72edd2012-02-06 17:26:47 -08001541 &apq8064_msm_device_vidc,
Matt Wagantalled832652012-02-02 19:23:17 -08001542 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001543 &msm_8960_q6_lpass,
Matt Wagantall292aace2012-01-26 19:12:34 -08001544 &msm_gss,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001545};
1546
Joel King4e7ad222011-08-17 15:47:38 -07001547static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001548 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001549 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001550};
1551
1552static struct platform_device *rumi3_devices[] __initdata = {
1553 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001554 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001555#ifdef CONFIG_MSM_ROTATOR
1556 &msm_rotator_device,
1557#endif
Joel King4e7ad222011-08-17 15:47:38 -07001558};
1559
Joel King82b7e3f2012-01-05 10:03:27 -08001560static struct platform_device *cdp_devices[] __initdata = {
1561 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001562 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001563 &msm_device_sps_apq8064,
1564};
1565
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001566static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001567 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001568};
1569
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001570#define KS8851_IRQ_GPIO 43
1571
1572static struct spi_board_info spi_board_info[] __initdata = {
1573 {
1574 .modalias = "ks8851",
1575 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1576 .max_speed_hz = 19200000,
1577 .bus_num = 0,
1578 .chip_select = 2,
1579 .mode = SPI_MODE_0,
1580 },
1581};
1582
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001583static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001584 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001585 .bus_num = 1,
1586 .slim_slave = &apq8064_slim_tabla,
1587 },
1588 {
1589 .bus_num = 1,
1590 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001591 },
1592 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001593};
1594
David Keitel3c40fc52012-02-09 17:53:52 -08001595static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi1_pdata = {
1596 .clk_freq = 100000,
1597 .src_clk_rate = 24000000,
1598};
1599
Jing Lin04601f92012-02-05 15:36:07 -08001600static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
1601 .clk_freq = 100000,
1602 .src_clk_rate = 24000000,
1603};
1604
Kenneth Heitke748593a2011-07-15 15:45:11 -06001605static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
1606 .clk_freq = 100000,
1607 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001608};
1609
David Keitel3c40fc52012-02-09 17:53:52 -08001610#define GSBI_DUAL_MODE_CODE 0x60
1611#define MSM_GSBI1_PHYS 0x12440000
Kenneth Heitke748593a2011-07-15 15:45:11 -06001612static void __init apq8064_i2c_init(void)
1613{
David Keitel3c40fc52012-02-09 17:53:52 -08001614 void __iomem *gsbi_mem;
1615
1616 apq8064_device_qup_i2c_gsbi1.dev.platform_data =
1617 &apq8064_i2c_qup_gsbi1_pdata;
1618 gsbi_mem = ioremap_nocache(MSM_GSBI1_PHYS, 4);
1619 writel_relaxed(GSBI_DUAL_MODE_CODE, gsbi_mem);
1620 /* Ensure protocol code is written before proceeding */
1621 wmb();
1622 iounmap(gsbi_mem);
1623 apq8064_i2c_qup_gsbi1_pdata.use_gsbi_shared_mode = 1;
Jing Lin04601f92012-02-05 15:36:07 -08001624 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
1625 &apq8064_i2c_qup_gsbi3_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06001626 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
1627 &apq8064_i2c_qup_gsbi4_pdata;
1628}
1629
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001630#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001631static int ethernet_init(void)
1632{
1633 int ret;
1634 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
1635 if (ret) {
1636 pr_err("ks8851 gpio_request failed: %d\n", ret);
1637 goto fail;
1638 }
1639
1640 return 0;
1641fail:
1642 return ret;
1643}
1644#else
1645static int ethernet_init(void)
1646{
1647 return 0;
1648}
1649#endif
1650
Tianyi Gou41515e22011-09-01 19:37:43 -07001651static void __init apq8064_clock_init(void)
1652{
Tianyi Gouacb588d2012-01-27 18:24:05 -08001653 if (machine_is_apq8064_rumi3())
Tianyi Gou41515e22011-09-01 19:37:43 -07001654 msm_clock_init(&apq8064_dummy_clock_init_data);
Tianyi Gouacb588d2012-01-27 18:24:05 -08001655 else
1656 msm_clock_init(&apq8064_clock_init_data);
Tianyi Gou41515e22011-09-01 19:37:43 -07001657}
1658
Jing Lin417fa452012-02-05 14:31:06 -08001659#define I2C_SURF 1
1660#define I2C_FFA (1 << 1)
1661#define I2C_RUMI (1 << 2)
1662#define I2C_SIM (1 << 3)
1663#define I2C_LIQUID (1 << 4)
1664
1665struct i2c_registry {
1666 u8 machs;
1667 int bus;
1668 struct i2c_board_info *info;
1669 int len;
1670};
1671
1672static struct i2c_registry apq8064_i2c_devices[] __initdata = {
Jing Lin21ed4de2012-02-05 15:53:28 -08001673 {
1674 I2C_SURF | I2C_LIQUID,
1675 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
1676 mxt_device_info,
1677 ARRAY_SIZE(mxt_device_info),
1678 },
Anirudh Ghayal2917a5a2012-02-05 19:51:07 -08001679 {
1680 I2C_FFA,
1681 APQ_8064_GSBI3_QUP_I2C_BUS_ID,
1682 cyttsp_info,
1683 ARRAY_SIZE(cyttsp_info),
1684 },
Amy Maloche70090f992012-02-16 16:35:26 -08001685 {
1686 I2C_FFA | I2C_LIQUID,
1687 APQ_8064_GSBI1_QUP_I2C_BUS_ID,
1688 isa1200_board_info,
1689 ARRAY_SIZE(isa1200_board_info),
1690 },
Jing Lin417fa452012-02-05 14:31:06 -08001691};
1692
1693static void __init register_i2c_devices(void)
1694{
1695 u8 mach_mask = 0;
1696 int i;
1697
Kevin Chand07220e2012-02-13 15:52:22 -08001698#ifdef CONFIG_MSM_CAMERA
1699 struct i2c_registry apq8064_camera_i2c_devices = {
1700 I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_RUMI,
1701 APQ_8064_GSBI4_QUP_I2C_BUS_ID,
1702 apq8064_camera_board_info.board_info,
1703 apq8064_camera_board_info.num_i2c_board_info,
1704 };
1705#endif
Jing Lin417fa452012-02-05 14:31:06 -08001706 /* Build the matching 'supported_machs' bitmask */
1707 if (machine_is_apq8064_cdp())
1708 mach_mask = I2C_SURF;
1709 else if (machine_is_apq8064_mtp())
1710 mach_mask = I2C_FFA;
1711 else if (machine_is_apq8064_liquid())
1712 mach_mask = I2C_LIQUID;
1713 else if (machine_is_apq8064_rumi3())
1714 mach_mask = I2C_RUMI;
1715 else if (machine_is_apq8064_sim())
1716 mach_mask = I2C_SIM;
1717 else
1718 pr_err("unmatched machine ID in register_i2c_devices\n");
1719
1720 /* Run the array and install devices as appropriate */
1721 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
1722 if (apq8064_i2c_devices[i].machs & mach_mask)
1723 i2c_register_board_info(apq8064_i2c_devices[i].bus,
1724 apq8064_i2c_devices[i].info,
1725 apq8064_i2c_devices[i].len);
1726 }
Kevin Chand07220e2012-02-13 15:52:22 -08001727#ifdef CONFIG_MSM_CAMERA
1728 if (apq8064_camera_i2c_devices.machs & mach_mask)
1729 i2c_register_board_info(apq8064_camera_i2c_devices.bus,
1730 apq8064_camera_i2c_devices.info,
1731 apq8064_camera_i2c_devices.len);
1732#endif
Jing Lin417fa452012-02-05 14:31:06 -08001733}
1734
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001735static void __init apq8064_common_init(void)
1736{
1737 if (socinfo_init() < 0)
1738 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06001739 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
1740 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
David Collins2782b5c2012-02-06 10:02:42 -08001741 regulator_suppress_info_printing();
1742 platform_device_register(&apq8064_device_rpm_regulator);
Tianyi Gou41515e22011-09-01 19:37:43 -07001743 apq8064_clock_init();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001744 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06001745 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08001746 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06001747
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001748 apq8064_device_qup_spi_gsbi5.dev.platform_data =
1749 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08001750 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08001751 if (machine_is_apq8064_liquid())
1752 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001753 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Hemant Kumara945b472012-01-25 15:08:06 -08001754 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001755 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001756 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Jay Chokshie8741282012-01-25 15:22:55 -08001757 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05301758 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08001759
1760 if (machine_is_apq8064_mtp()) {
1761 mdm_8064_device.dev.platform_data = &mdm_platform_data;
1762 platform_device_register(&mdm_8064_device);
1763 }
1764 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001765 slim_register_board_info(apq8064_slim_devices,
1766 ARRAY_SIZE(apq8064_slim_devices));
Praveen Chidambaram78499012011-11-01 17:15:17 -06001767 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07001768 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06001769 msm_spm_l2_init(msm_spm_l2_data);
1770 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
1771 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
1772 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
1773 msm_pm_data);
1774 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001775}
1776
Huaibin Yang4a084e32011-12-15 15:25:52 -08001777static void __init apq8064_allocate_memory_regions(void)
1778{
1779 apq8064_allocate_fb_region();
1780}
1781
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001782static void __init apq8064_sim_init(void)
1783{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001784 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
1785 &msm8064_device_watchdog.dev.platform_data;
1786
1787 wdog_pdata->bark_time = 15000;
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001788 msm_tsens_early_init(&apq_tsens_pdata);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001789 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07001790 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
1791}
1792
1793static void __init apq8064_rumi3_init(void)
1794{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001795 msm_tsens_early_init(&apq_tsens_pdata);
Joel King4e7ad222011-08-17 15:47:38 -07001796 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001797 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001798 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001799 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Huaibin Yang4a084e32011-12-15 15:25:52 -08001800 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07001801 apq8064_init_gpu();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001802}
1803
Joel King82b7e3f2012-01-05 10:03:27 -08001804static void __init apq8064_cdp_init(void)
1805{
Siddartha Mohanadosscaeaa922012-02-07 16:41:38 -08001806 msm_tsens_early_init(&apq_tsens_pdata);
Joel King82b7e3f2012-01-05 10:03:27 -08001807 apq8064_common_init();
1808 ethernet_init();
1809 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
1810 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08001811 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07001812 apq8064_init_gpu();
Matt Wagantallef3cfe542012-02-04 19:01:08 -08001813 platform_add_devices(msm_footswitch_devices,
1814 msm_num_footswitch_devices);
Kevin Chand07220e2012-02-13 15:52:22 -08001815 apq8064_init_cam();
Joel King82b7e3f2012-01-05 10:03:27 -08001816}
1817
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001818MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
1819 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001820 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001821 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05301822 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001823 .timer = &msm_timer,
1824 .init_machine = apq8064_sim_init,
1825MACHINE_END
1826
Joel King4e7ad222011-08-17 15:47:38 -07001827MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
1828 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001829 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07001830 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05301831 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07001832 .timer = &msm_timer,
1833 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001834 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07001835MACHINE_END
1836
Joel King82b7e3f2012-01-05 10:03:27 -08001837MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
1838 .map_io = apq8064_map_io,
1839 .reserve = apq8064_reserve,
1840 .init_irq = apq8064_init_irq,
1841 .handle_irq = gic_handle_irq,
1842 .timer = &msm_timer,
1843 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08001844 .init_early = apq8064_allocate_memory_regions,
Joel King82b7e3f2012-01-05 10:03:27 -08001845MACHINE_END
1846
1847MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
1848 .map_io = apq8064_map_io,
1849 .reserve = apq8064_reserve,
1850 .init_irq = apq8064_init_irq,
1851 .handle_irq = gic_handle_irq,
1852 .timer = &msm_timer,
1853 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08001854 .init_early = apq8064_allocate_memory_regions,
Joel King82b7e3f2012-01-05 10:03:27 -08001855MACHINE_END
1856
1857MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
1858 .map_io = apq8064_map_io,
1859 .reserve = apq8064_reserve,
1860 .init_irq = apq8064_init_irq,
1861 .handle_irq = gic_handle_irq,
1862 .timer = &msm_timer,
1863 .init_machine = apq8064_cdp_init,
Ravishangar Kalyanamc2fee312012-02-09 19:11:22 -08001864 .init_early = apq8064_allocate_memory_regions,
Joel King82b7e3f2012-01-05 10:03:27 -08001865MACHINE_END
1866
Joel King11ca8202012-02-13 16:19:03 -08001867MACHINE_START(MPQ8064_HRD, "QCT MPQ8064 HRD")
1868 .map_io = apq8064_map_io,
1869 .reserve = apq8064_reserve,
1870 .init_irq = apq8064_init_irq,
1871 .handle_irq = gic_handle_irq,
1872 .timer = &msm_timer,
1873 .init_machine = apq8064_cdp_init,
1874MACHINE_END
1875
1876MACHINE_START(MPQ8064_DTV, "QCT MPQ8064 DTV")
1877 .map_io = apq8064_map_io,
1878 .reserve = apq8064_reserve,
1879 .init_irq = apq8064_init_irq,
1880 .handle_irq = gic_handle_irq,
1881 .timer = &msm_timer,
1882 .init_machine = apq8064_cdp_init,
1883MACHINE_END
1884