blob: 091d03ae19e4207ac9e443d1b6f92042920b7cce [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>
Kenneth Heitke36920d32011-07-20 16:44:30 -060021#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070022#include <linux/spi/spi.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070023#include <linux/dma-mapping.h>
24#include <linux/platform_data/qcom_crypto_device.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080025#include <linux/ion.h>
Jack Cheung46bfffa2012-01-19 15:26:24 -080026#include <linux/memory.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070027#include <asm/mach-types.h>
28#include <asm/mach/arch.h>
29#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053030#include <asm/mach/mmc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031
32#include <mach/board.h>
33#include <mach/msm_iomap.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080034#include <mach/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070035#include <linux/usb/msm_hsusb.h>
36#include <linux/usb/android.h>
37#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060038#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039#include "timer.h"
40#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070041#include <mach/gpio.h>
42#include <mach/gpiomux.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060043#include <mach/rpm.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080044#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070045#include <linux/android_pmem.h>
Olav Haugan7c6aa742012-01-16 16:47:37 -080046#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070047#include <mach/msm_memtypes.h>
48#include <linux/bootmem.h>
49#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070050#include <mach/dma.h>
Gagan Mac8a7a5d32011-11-11 16:43:06 -070051#include <mach/msm_bus_board.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060052#include <mach/cpuidle.h>
Joel Kingdacbc822012-01-25 13:30:57 -080053#include <mach/mdm2.h>
Joel King4ebccc62011-07-22 09:43:22 -070054
Jeff Ohlstein7e668552011-10-06 16:17:25 -070055#include "msm_watchdog.h"
Stepan Moskovchenko5a83dba2011-12-05 17:30:17 -080056#include "board-8064.h"
Vikram Mulukutlabc2e9572011-11-04 03:41:38 -070057#include "acpuclock.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060058#include "spm.h"
59#include "mpm.h"
60#include "rpm_resources.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080061#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060062#include "pm-boot.h"
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -080063#include "devices-msm8x60.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070064
Olav Haugan7c6aa742012-01-16 16:47:37 -080065#define MSM_PMEM_ADSP_SIZE 0x7800000
Ben Romberger3ffcd812011-12-08 19:12:10 -080066#define MSM_PMEM_AUDIO_SIZE 0x2B4000
Olav Haugan7c6aa742012-01-16 16:47:37 -080067#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
68#define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */
69#else
70#define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */
71#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070072
Olav Haugan7c6aa742012-01-16 16:47:37 -080073#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
Olav Hauganedcf6832012-01-24 08:35:41 -080074#define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000
Olav Haugan7c6aa742012-01-16 16:47:37 -080075#define MSM_ION_SF_SIZE MSM_PMEM_SIZE
Olav Haugand3d29682012-01-19 10:57:07 -080076#define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080077#define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE
Olav Hauganf45e2142012-01-19 11:01:01 -080078#define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */
Olav Haugan7c6aa742012-01-16 16:47:37 -080079#define MSM_ION_MFC_SIZE SZ_8K
Olav Haugan2c43fac2012-01-19 11:06:37 -080080#define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE
81#define MSM_ION_HEAP_NUM 8
Olav Haugan7c6aa742012-01-16 16:47:37 -080082#else
83#define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000
84#define MSM_ION_HEAP_NUM 1
85#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070086
Olav Haugan7c6aa742012-01-16 16:47:37 -080087#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
88static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
89static int __init pmem_kernel_ebi1_size_setup(char *p)
Kevin Chan13be4e22011-10-20 11:30:32 -070090{
Olav Haugan7c6aa742012-01-16 16:47:37 -080091 pmem_kernel_ebi1_size = memparse(p, NULL);
92 return 0;
Kevin Chan13be4e22011-10-20 11:30:32 -070093}
Olav Haugan7c6aa742012-01-16 16:47:37 -080094early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
95#endif
Kevin Chan13be4e22011-10-20 11:30:32 -070096
Olav Haugan7c6aa742012-01-16 16:47:37 -080097#ifdef CONFIG_ANDROID_PMEM
Kevin Chan13be4e22011-10-20 11:30:32 -070098static unsigned pmem_size = MSM_PMEM_SIZE;
99static int __init pmem_size_setup(char *p)
100{
101 pmem_size = memparse(p, NULL);
102 return 0;
103}
104early_param("pmem_size", pmem_size_setup);
105
106static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
107
108static int __init pmem_adsp_size_setup(char *p)
109{
110 pmem_adsp_size = memparse(p, NULL);
111 return 0;
112}
113early_param("pmem_adsp_size", pmem_adsp_size_setup);
114
115static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
116
117static int __init pmem_audio_size_setup(char *p)
118{
119 pmem_audio_size = memparse(p, NULL);
120 return 0;
121}
122early_param("pmem_audio_size", pmem_audio_size_setup);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800123#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700124
Olav Haugan7c6aa742012-01-16 16:47:37 -0800125#ifdef CONFIG_ANDROID_PMEM
126#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700127static struct android_pmem_platform_data android_pmem_pdata = {
128 .name = "pmem",
129 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
130 .cached = 1,
131 .memory_type = MEMTYPE_EBI1,
132};
133
134static struct platform_device android_pmem_device = {
135 .name = "android_pmem",
136 .id = 0,
137 .dev = {.platform_data = &android_pmem_pdata},
138};
139
140static struct android_pmem_platform_data android_pmem_adsp_pdata = {
141 .name = "pmem_adsp",
142 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
143 .cached = 0,
144 .memory_type = MEMTYPE_EBI1,
145};
Kevin Chan13be4e22011-10-20 11:30:32 -0700146static struct platform_device android_pmem_adsp_device = {
147 .name = "android_pmem",
148 .id = 2,
149 .dev = { .platform_data = &android_pmem_adsp_pdata },
150};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800151#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700152
153static struct android_pmem_platform_data android_pmem_audio_pdata = {
154 .name = "pmem_audio",
155 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
156 .cached = 0,
157 .memory_type = MEMTYPE_EBI1,
158};
159
160static struct platform_device android_pmem_audio_device = {
161 .name = "android_pmem",
162 .id = 4,
163 .dev = { .platform_data = &android_pmem_audio_pdata },
164};
Olav Haugan7c6aa742012-01-16 16:47:37 -0800165#endif
166
167static struct memtype_reserve apq8064_reserve_table[] __initdata = {
168 [MEMTYPE_SMI] = {
169 },
170 [MEMTYPE_EBI0] = {
171 .flags = MEMTYPE_FLAGS_1M_ALIGN,
172 },
173 [MEMTYPE_EBI1] = {
174 .flags = MEMTYPE_FLAGS_1M_ALIGN,
175 },
176};
Kevin Chan13be4e22011-10-20 11:30:32 -0700177
178static void __init size_pmem_devices(void)
179{
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 -0700182 android_pmem_adsp_pdata.size = pmem_adsp_size;
183 android_pmem_pdata.size = pmem_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800184#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700185 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800186#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700187}
188
189static void __init reserve_memory_for(struct android_pmem_platform_data *p)
190{
191 apq8064_reserve_table[p->memory_type].size += p->size;
192}
193
Kevin Chan13be4e22011-10-20 11:30:32 -0700194static void __init reserve_pmem_memory(void)
195{
Olav Haugan7c6aa742012-01-16 16:47:37 -0800196#ifdef CONFIG_ANDROID_PMEM
197#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -0700198 reserve_memory_for(&android_pmem_adsp_pdata);
199 reserve_memory_for(&android_pmem_pdata);
Olav Haugan7c6aa742012-01-16 16:47:37 -0800200#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700201 reserve_memory_for(&android_pmem_audio_pdata);
202 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800203#endif
204}
205
206static int apq8064_paddr_to_memtype(unsigned int paddr)
207{
208 return MEMTYPE_EBI1;
209}
210
211#ifdef CONFIG_ION_MSM
212#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
213static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
214 .permission_type = IPT_TYPE_MM_CARVEOUT,
Olav Haugand3d29682012-01-19 10:57:07 -0800215 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800216};
217
218static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
219 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
Olav Haugand3d29682012-01-19 10:57:07 -0800220 .align = PAGE_SIZE,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800221};
222
223static struct ion_co_heap_pdata co_ion_pdata = {
Olav Haugand3d29682012-01-19 10:57:07 -0800224 .adjacent_mem_id = INVALID_HEAP_ID,
225 .align = PAGE_SIZE,
226};
227
228static struct ion_co_heap_pdata fw_co_ion_pdata = {
229 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
230 .align = SZ_128K,
Olav Haugan7c6aa742012-01-16 16:47:37 -0800231};
232#endif
233static struct ion_platform_data ion_pdata = {
234 .nr = MSM_ION_HEAP_NUM,
235 .heaps = {
236 {
237 .id = ION_SYSTEM_HEAP_ID,
238 .type = ION_HEAP_TYPE_SYSTEM,
239 .name = ION_VMALLOC_HEAP_NAME,
240 },
241#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
242 {
243 .id = ION_SF_HEAP_ID,
244 .type = ION_HEAP_TYPE_CARVEOUT,
245 .name = ION_SF_HEAP_NAME,
246 .size = MSM_ION_SF_SIZE,
247 .memory_type = ION_EBI_TYPE,
248 .extra_data = (void *) &co_ion_pdata,
249 },
250 {
251 .id = ION_CP_MM_HEAP_ID,
252 .type = ION_HEAP_TYPE_CP,
253 .name = ION_MM_HEAP_NAME,
254 .size = MSM_ION_MM_SIZE,
255 .memory_type = ION_EBI_TYPE,
256 .extra_data = (void *) &cp_mm_ion_pdata,
257 },
258 {
Olav Haugand3d29682012-01-19 10:57:07 -0800259 .id = ION_MM_FIRMWARE_HEAP_ID,
260 .type = ION_HEAP_TYPE_CARVEOUT,
261 .name = ION_MM_FIRMWARE_HEAP_NAME,
262 .size = MSM_ION_MM_FW_SIZE,
263 .memory_type = ION_EBI_TYPE,
264 .extra_data = (void *) &fw_co_ion_pdata,
265 },
266 {
Olav Haugan7c6aa742012-01-16 16:47:37 -0800267 .id = ION_CP_MFC_HEAP_ID,
268 .type = ION_HEAP_TYPE_CP,
269 .name = ION_MFC_HEAP_NAME,
270 .size = MSM_ION_MFC_SIZE,
271 .memory_type = ION_EBI_TYPE,
272 .extra_data = (void *) &cp_mfc_ion_pdata,
273 },
274 {
275 .id = ION_IOMMU_HEAP_ID,
276 .type = ION_HEAP_TYPE_IOMMU,
277 .name = ION_IOMMU_HEAP_NAME,
278 },
Olav Hauganf45e2142012-01-19 11:01:01 -0800279 {
280 .id = ION_QSECOM_HEAP_ID,
281 .type = ION_HEAP_TYPE_CARVEOUT,
282 .name = ION_QSECOM_HEAP_NAME,
283 .size = MSM_ION_QSECOM_SIZE,
284 .memory_type = ION_EBI_TYPE,
285 .extra_data = (void *) &co_ion_pdata,
286 },
Olav Haugan2c43fac2012-01-19 11:06:37 -0800287 {
288 .id = ION_AUDIO_HEAP_ID,
289 .type = ION_HEAP_TYPE_CARVEOUT,
290 .name = ION_AUDIO_HEAP_NAME,
291 .size = MSM_ION_AUDIO_SIZE,
292 .memory_type = ION_EBI_TYPE,
293 .extra_data = (void *) &co_ion_pdata,
294 },
Olav Haugan7c6aa742012-01-16 16:47:37 -0800295#endif
296 }
297};
298
299static struct platform_device ion_dev = {
300 .name = "ion-msm",
301 .id = 1,
302 .dev = { .platform_data = &ion_pdata },
303};
304#endif
305
306static void reserve_ion_memory(void)
307{
308#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
309 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
Olav Haugand3d29682012-01-19 10:57:07 -0800310 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800311 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
312 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
Olav Hauganf45e2142012-01-19 11:01:01 -0800313 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
Olav Haugan2c43fac2012-01-19 11:06:37 -0800314 apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
Olav Haugan7c6aa742012-01-16 16:47:37 -0800315#endif
Kevin Chan13be4e22011-10-20 11:30:32 -0700316}
317
Huaibin Yang4a084e32011-12-15 15:25:52 -0800318static void __init reserve_mdp_memory(void)
319{
320 apq8064_mdp_writeback(apq8064_reserve_table);
321}
322
Kevin Chan13be4e22011-10-20 11:30:32 -0700323static void __init apq8064_calculate_reserve_sizes(void)
324{
325 size_pmem_devices();
326 reserve_pmem_memory();
Olav Haugan7c6aa742012-01-16 16:47:37 -0800327 reserve_ion_memory();
Huaibin Yang4a084e32011-12-15 15:25:52 -0800328 reserve_mdp_memory();
Kevin Chan13be4e22011-10-20 11:30:32 -0700329}
330
331static struct reserve_info apq8064_reserve_info __initdata = {
332 .memtype_reserve_table = apq8064_reserve_table,
333 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
334 .paddr_to_memtype = apq8064_paddr_to_memtype,
335};
336
337static int apq8064_memory_bank_size(void)
338{
339 return 1<<29;
340}
341
342static void __init locate_unstable_memory(void)
343{
344 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
345 unsigned long bank_size;
346 unsigned long low, high;
347
348 bank_size = apq8064_memory_bank_size();
349 low = meminfo.bank[0].start;
350 high = mb->start + mb->size;
Olav Haugand76e3a82012-01-16 16:55:07 -0800351
352 /* Check if 32 bit overflow occured */
353 if (high < mb->start)
354 high = ~0UL;
355
Kevin Chan13be4e22011-10-20 11:30:32 -0700356 low &= ~(bank_size - 1);
357
358 if (high - low <= bank_size)
359 return;
Jack Cheung46bfffa2012-01-19 15:26:24 -0800360 apq8064_reserve_info.low_unstable_address = mb->start -
361 MIN_MEMORY_BLOCK_SIZE + mb->size;
362 apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE;
363
Kevin Chan13be4e22011-10-20 11:30:32 -0700364 apq8064_reserve_info.bank_size = bank_size;
365 pr_info("low unstable address %lx max size %lx bank size %lx\n",
366 apq8064_reserve_info.low_unstable_address,
367 apq8064_reserve_info.max_unstable_size,
368 apq8064_reserve_info.bank_size);
369}
370
371static void __init apq8064_reserve(void)
372{
373 reserve_info = &apq8064_reserve_info;
374 locate_unstable_memory();
375 msm_reserve();
376}
377
Hemant Kumara945b472012-01-25 15:08:06 -0800378#ifdef CONFIG_USB_EHCI_MSM_HSIC
379static struct msm_hsic_host_platform_data msm_hsic_pdata = {
380 .strobe = 88,
381 .data = 89,
382};
383#else
384static struct msm_hsic_host_platform_data msm_hsic_pdata;
385#endif
386
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800387#define PID_MAGIC_ID 0x71432909
388#define SERIAL_NUM_MAGIC_ID 0x61945374
389#define SERIAL_NUMBER_LENGTH 127
390#define DLOAD_USB_BASE_ADD 0x2A03F0C8
391
392struct magic_num_struct {
393 uint32_t pid;
394 uint32_t serial_num;
395};
396
397struct dload_struct {
398 uint32_t reserved1;
399 uint32_t reserved2;
400 uint32_t reserved3;
401 uint16_t reserved4;
402 uint16_t pid;
403 char serial_number[SERIAL_NUMBER_LENGTH];
404 uint16_t reserved5;
405 struct magic_num_struct magic_struct;
406};
407
408static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum)
409{
410 struct dload_struct __iomem *dload = 0;
411
412 dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload));
413 if (!dload) {
414 pr_err("%s: cannot remap I/O memory region: %08x\n",
415 __func__, DLOAD_USB_BASE_ADD);
416 return -ENXIO;
417 }
418
419 pr_debug("%s: dload:%p pid:%x serial_num:%s\n",
420 __func__, dload, pid, snum);
421 /* update pid */
422 dload->magic_struct.pid = PID_MAGIC_ID;
423 dload->pid = pid;
424
425 /* update serial number */
426 dload->magic_struct.serial_num = 0;
427 if (!snum) {
428 memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH);
429 goto out;
430 }
431
432 dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID;
433 strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH);
434out:
435 iounmap(dload);
436 return 0;
437}
438
439static struct android_usb_platform_data android_usb_pdata = {
440 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
441};
442
Hemant Kumar4933b072011-10-17 23:43:11 -0700443static struct platform_device android_usb_device = {
Hemant Kumarcb7d8a12012-01-25 12:25:55 -0800444 .name = "android_usb",
445 .id = -1,
446 .dev = {
447 .platform_data = &android_usb_pdata,
448 },
Hemant Kumar4933b072011-10-17 23:43:11 -0700449};
450
451static struct msm_otg_platform_data msm_otg_pdata = {
Hemant Kumard86c4882012-01-24 19:39:37 -0800452 .mode = USB_OTG,
453 .otg_control = OTG_PMIC_CONTROL,
Hemant Kumar4933b072011-10-17 23:43:11 -0700454 .phy_type = SNPS_28NM_INTEGRATED_PHY,
Hemant Kumard86c4882012-01-24 19:39:37 -0800455 .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE),
456 .power_budget = 750,
Hemant Kumar4933b072011-10-17 23:43:11 -0700457};
458
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800459#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
460
461/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
462 * 4 micbiases are used to power various analog and digital
463 * microphones operating at 1800 mV. Technically, all micbiases
464 * can source from single cfilter since all microphones operate
465 * at the same voltage level. The arrangement below is to make
466 * sure all cfilters are exercised. LDO_H regulator ouput level
467 * does not need to be as high as 2.85V. It is choosen for
468 * microphone sensitivity purpose.
469 */
470static struct tabla_pdata apq8064_tabla_platform_data = {
471 .slimbus_slave_device = {
472 .name = "tabla-slave",
473 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
474 },
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800475 .irq = MSM_GPIO_TO_INT(42),
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800476 .irq_base = TABLA_INTERRUPT_BASE,
477 .num_irqs = NR_TABLA_IRQS,
478 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
479 .micbias = {
480 .ldoh_v = TABLA_LDOH_2P85_V,
481 .cfilt1_mv = 1800,
482 .cfilt2_mv = 1800,
483 .cfilt3_mv = 1800,
484 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
485 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
486 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
487 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
488 }
489};
490
491static struct slim_device apq8064_slim_tabla = {
492 .name = "tabla-slim",
493 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
494 .dev = {
495 .platform_data = &apq8064_tabla_platform_data,
496 },
497};
498
Swaminathan Sathappancef966d2011-12-15 17:27:04 -0800499static struct tabla_pdata apq8064_tabla20_platform_data = {
500 .slimbus_slave_device = {
501 .name = "tabla-slave",
502 .e_addr = {0, 0, 0x60, 0, 0x17, 2},
503 },
504 .irq = MSM_GPIO_TO_INT(42),
505 .irq_base = TABLA_INTERRUPT_BASE,
506 .num_irqs = NR_TABLA_IRQS,
507 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
508 .micbias = {
509 .ldoh_v = TABLA_LDOH_2P85_V,
510 .cfilt1_mv = 1800,
511 .cfilt2_mv = 1800,
512 .cfilt3_mv = 1800,
513 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
514 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
515 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
516 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
517 }
518};
519
520static struct slim_device apq8064_slim_tabla20 = {
521 .name = "tabla2x-slim",
522 .e_addr = {0, 1, 0x60, 0, 0x17, 2},
523 .dev = {
524 .platform_data = &apq8064_tabla20_platform_data,
525 },
526};
527
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700528#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
529 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
530 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
531 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
532
533#define QCE_SIZE 0x10000
534#define QCE_0_BASE 0x11000000
535
536#define QCE_HW_KEY_SUPPORT 0
537#define QCE_SHA_HMAC_SUPPORT 1
538#define QCE_SHARE_CE_RESOURCE 3
539#define QCE_CE_SHARED 0
540
541static struct resource qcrypto_resources[] = {
542 [0] = {
543 .start = QCE_0_BASE,
544 .end = QCE_0_BASE + QCE_SIZE - 1,
545 .flags = IORESOURCE_MEM,
546 },
547 [1] = {
548 .name = "crypto_channels",
549 .start = DMOV8064_CE_IN_CHAN,
550 .end = DMOV8064_CE_OUT_CHAN,
551 .flags = IORESOURCE_DMA,
552 },
553 [2] = {
554 .name = "crypto_crci_in",
555 .start = DMOV8064_CE_IN_CRCI,
556 .end = DMOV8064_CE_IN_CRCI,
557 .flags = IORESOURCE_DMA,
558 },
559 [3] = {
560 .name = "crypto_crci_out",
561 .start = DMOV8064_CE_OUT_CRCI,
562 .end = DMOV8064_CE_OUT_CRCI,
563 .flags = IORESOURCE_DMA,
564 },
565};
566
567static struct resource qcedev_resources[] = {
568 [0] = {
569 .start = QCE_0_BASE,
570 .end = QCE_0_BASE + QCE_SIZE - 1,
571 .flags = IORESOURCE_MEM,
572 },
573 [1] = {
574 .name = "crypto_channels",
575 .start = DMOV8064_CE_IN_CHAN,
576 .end = DMOV8064_CE_OUT_CHAN,
577 .flags = IORESOURCE_DMA,
578 },
579 [2] = {
580 .name = "crypto_crci_in",
581 .start = DMOV8064_CE_IN_CRCI,
582 .end = DMOV8064_CE_IN_CRCI,
583 .flags = IORESOURCE_DMA,
584 },
585 [3] = {
586 .name = "crypto_crci_out",
587 .start = DMOV8064_CE_OUT_CRCI,
588 .end = DMOV8064_CE_OUT_CRCI,
589 .flags = IORESOURCE_DMA,
590 },
591};
592
593#endif
594
595#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
596 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
597
598static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
599 .ce_shared = QCE_CE_SHARED,
600 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
601 .hw_key_support = QCE_HW_KEY_SUPPORT,
602 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800603 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700604};
605
606static struct platform_device qcrypto_device = {
607 .name = "qcrypto",
608 .id = 0,
609 .num_resources = ARRAY_SIZE(qcrypto_resources),
610 .resource = qcrypto_resources,
611 .dev = {
612 .coherent_dma_mask = DMA_BIT_MASK(32),
613 .platform_data = &qcrypto_ce_hw_suppport,
614 },
615};
616#endif
617
618#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
619 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
620
621static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
622 .ce_shared = QCE_CE_SHARED,
623 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
624 .hw_key_support = QCE_HW_KEY_SUPPORT,
625 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
Ramesh Masavarapu49259682011-12-02 14:00:18 -0800626 .bus_scale_table = NULL,
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700627};
628
629static struct platform_device qcedev_device = {
630 .name = "qce",
631 .id = 0,
632 .num_resources = ARRAY_SIZE(qcedev_resources),
633 .resource = qcedev_resources,
634 .dev = {
635 .coherent_dma_mask = DMA_BIT_MASK(32),
636 .platform_data = &qcedev_ce_hw_suppport,
637 },
638};
639#endif
640
Joel Kingdacbc822012-01-25 13:30:57 -0800641static struct mdm_platform_data mdm_platform_data = {
642 .mdm_version = "3.0",
643 .ramdump_delay_ms = 2000,
Hemant Kumara945b472012-01-25 15:08:06 -0800644 .peripheral_platform_device = &apq8064_device_hsic_host,
Joel Kingdacbc822012-01-25 13:30:57 -0800645};
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700646
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600647#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700648static void __init apq8064_map_io(void)
649{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600650 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700651 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -0700652 if (socinfo_init() < 0)
653 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700654}
655
656static void __init apq8064_init_irq(void)
657{
Praveen Chidambaram78499012011-11-01 17:15:17 -0600658 struct msm_mpm_device_data *data = NULL;
659
660#ifdef CONFIG_MSM_MPM
661 data = &apq8064_mpm_dev_data;
662#endif
663
664 msm_mpm_irq_extn_init(data);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700665 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
666 (void *)MSM_QGIC_CPU_BASE);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700667}
668
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800669static struct platform_device msm8064_device_saw_regulator_core0 = {
670 .name = "saw-regulator",
671 .id = 0,
672 .dev = {
673 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
674 },
675};
676
677static struct platform_device msm8064_device_saw_regulator_core1 = {
678 .name = "saw-regulator",
679 .id = 1,
680 .dev = {
681 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
682 },
683};
684
685static struct platform_device msm8064_device_saw_regulator_core2 = {
686 .name = "saw-regulator",
687 .id = 2,
688 .dev = {
689 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
690 },
691};
692
693static struct platform_device msm8064_device_saw_regulator_core3 = {
694 .name = "saw-regulator",
695 .id = 3,
696 .dev = {
697 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
Praveen Chidambaram78499012011-11-01 17:15:17 -0600698
699 },
700};
701
702static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = {
703 {
704 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT,
705 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
706 true,
707 100, 8000, 100000, 1,
708 },
709
710 {
711 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE,
712 MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE),
713 true,
714 2000, 6000, 60100000, 3000,
715 },
716
717 {
718 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
719 MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE),
720 false,
721 4200, 5000, 60350000, 3500,
722 },
723
724 {
725 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
726 MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE),
727 false,
728 6300, 4500, 65350000, 4800,
729 },
730
731 {
732 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
733 MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE),
734 false,
735 11700, 2500, 67850000, 5500,
736 },
737
738 {
739 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
740 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE),
741 false,
742 13800, 2000, 71850000, 6800,
743 },
744
745 {
746 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
747 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH),
748 false,
749 29700, 500, 75850000, 8800,
750 },
751
752 {
753 MSM_PM_SLEEP_MODE_POWER_COLLAPSE,
754 MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW),
755 false,
756 29700, 0, 76350000, 9800,
757 },
758};
759
760static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
761 .mode = MSM_PM_BOOT_CONFIG_TZ,
762};
763
764static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = {
765 .levels = &msm_rpmrs_levels[0],
766 .num_levels = ARRAY_SIZE(msm_rpmrs_levels),
767 .vdd_mem_levels = {
768 [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000,
769 [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000,
770 [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000,
771 [MSM_RPMRS_VDD_MEM_MAX] = 1150000,
772 },
773 .vdd_dig_levels = {
774 [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000,
775 [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000,
776 [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000,
777 [MSM_RPMRS_VDD_DIG_MAX] = 1150000,
778 },
779 .vdd_mask = 0x7FFFFF,
780 .rpmrs_target_id = {
781 [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK,
782 [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST,
783 [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0,
784 [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1,
785 [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0,
786 [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1,
787 [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL,
788 },
789};
790
791static struct msm_cpuidle_state msm_cstates[] __initdata = {
792 {0, 0, "C0", "WFI",
793 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
794
795 {0, 1, "C1", "STANDALONE_POWER_COLLAPSE",
796 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
797
798 {0, 2, "C2", "POWER_COLLAPSE",
799 MSM_PM_SLEEP_MODE_POWER_COLLAPSE},
800
801 {1, 0, "C0", "WFI",
802 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
803
804 {1, 1, "C1", "STANDALONE_POWER_COLLAPSE",
805 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
806
807 {2, 0, "C0", "WFI",
808 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
809
810 {2, 1, "C1", "STANDALONE_POWER_COLLAPSE",
811 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
812
813 {3, 0, "C0", "WFI",
814 MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT},
815
816 {3, 1, "C1", "STANDALONE_POWER_COLLAPSE",
817 MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE},
818};
819
820static struct msm_pm_platform_data msm_pm_data[] = {
821 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
822 .idle_supported = 1,
823 .suspend_supported = 1,
824 .idle_enabled = 0,
825 .suspend_enabled = 0,
826 },
827
828 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
829 .idle_supported = 1,
830 .suspend_supported = 1,
831 .idle_enabled = 0,
832 .suspend_enabled = 0,
833 },
834
835 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
836 .idle_supported = 1,
837 .suspend_supported = 1,
838 .idle_enabled = 1,
839 .suspend_enabled = 1,
840 },
841
842 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
843 .idle_supported = 0,
844 .suspend_supported = 1,
845 .idle_enabled = 0,
846 .suspend_enabled = 0,
847 },
848
849 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
850 .idle_supported = 1,
851 .suspend_supported = 1,
852 .idle_enabled = 0,
853 .suspend_enabled = 0,
854 },
855
856 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
857 .idle_supported = 1,
858 .suspend_supported = 0,
859 .idle_enabled = 1,
860 .suspend_enabled = 0,
861 },
862
863 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
864 .idle_supported = 0,
865 .suspend_supported = 1,
866 .idle_enabled = 0,
867 .suspend_enabled = 0,
868 },
869
870 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
871 .idle_supported = 1,
872 .suspend_supported = 1,
873 .idle_enabled = 0,
874 .suspend_enabled = 0,
875 },
876
877 [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
878 .idle_supported = 1,
879 .suspend_supported = 0,
880 .idle_enabled = 1,
881 .suspend_enabled = 0,
882 },
883
884 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
885 .idle_supported = 0,
886 .suspend_supported = 1,
887 .idle_enabled = 0,
888 .suspend_enabled = 0,
889 },
890
891 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
892 .idle_supported = 1,
893 .suspend_supported = 1,
894 .idle_enabled = 0,
895 .suspend_enabled = 0,
896 },
897
898 [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
899 .idle_supported = 1,
900 .suspend_supported = 0,
901 .idle_enabled = 1,
902 .suspend_enabled = 0,
903 },
904};
905
906static uint8_t spm_wfi_cmd_sequence[] __initdata = {
907 0x03, 0x0f,
908};
909
910static uint8_t spm_power_collapse_without_rpm[] __initdata = {
911 0x00, 0x24, 0x54, 0x10,
912 0x09, 0x03, 0x01,
913 0x10, 0x54, 0x30, 0x0C,
914 0x24, 0x30, 0x0f,
915};
916
917static uint8_t spm_power_collapse_with_rpm[] __initdata = {
918 0x00, 0x24, 0x54, 0x10,
919 0x09, 0x07, 0x01, 0x0B,
920 0x10, 0x54, 0x30, 0x0C,
921 0x24, 0x30, 0x0f,
922};
923
924static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = {
925 [0] = {
926 .mode = MSM_SPM_MODE_CLOCK_GATING,
927 .notify_rpm = false,
928 .cmd = spm_wfi_cmd_sequence,
929 },
930 [1] = {
931 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
932 .notify_rpm = false,
933 .cmd = spm_power_collapse_without_rpm,
934 },
935 [2] = {
936 .mode = MSM_SPM_MODE_POWER_COLLAPSE,
937 .notify_rpm = true,
938 .cmd = spm_power_collapse_with_rpm,
939 },
940};
941
942static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = {
943 0x00, 0x20, 0x03, 0x20,
944 0x00, 0x0f,
945};
946
947static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = {
948 0x00, 0x20, 0x34, 0x64,
949 0x48, 0x07, 0x48, 0x20,
950 0x50, 0x64, 0x04, 0x34,
951 0x50, 0x0f,
952};
953static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = {
954 0x00, 0x10, 0x34, 0x64,
955 0x48, 0x07, 0x48, 0x10,
956 0x50, 0x64, 0x04, 0x34,
957 0x50, 0x0F,
958};
959
960static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = {
961 [0] = {
962 .mode = MSM_SPM_L2_MODE_RETENTION,
963 .notify_rpm = false,
964 .cmd = l2_spm_wfi_cmd_sequence,
965 },
966 [1] = {
967 .mode = MSM_SPM_L2_MODE_GDHS,
968 .notify_rpm = true,
969 .cmd = l2_spm_gdhs_cmd_sequence,
970 },
971 [2] = {
972 .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE,
973 .notify_rpm = true,
974 .cmd = l2_spm_power_off_cmd_sequence,
975 },
976};
977
978
979static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = {
980 [0] = {
981 .reg_base_addr = MSM_SAW_L2_BASE,
982 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
983 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00,
984 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
985 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE,
986 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020,
987 .modes = msm_spm_l2_seq_list,
988 .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list),
989 },
990};
991
992static struct msm_spm_platform_data msm_spm_data[] __initdata = {
993 [0] = {
994 .reg_base_addr = MSM_SAW0_BASE,
995 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
996 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
997 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
998#if defined(CONFIG_MSM_AVS_HW)
999 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1000 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1001#endif
1002 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1003 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1004 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1005 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1006 .vctl_timeout_us = 50,
1007 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1008 .modes = msm_spm_seq_list,
1009 },
1010 [1] = {
1011 .reg_base_addr = MSM_SAW1_BASE,
1012 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1013 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
1014 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
1015#if defined(CONFIG_MSM_AVS_HW)
1016 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1017 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1018#endif
1019 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1020 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1021 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1022 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1023 .vctl_timeout_us = 50,
1024 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1025 .modes = msm_spm_seq_list,
1026 },
1027 [2] = {
1028 .reg_base_addr = MSM_SAW2_BASE,
1029 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1030 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
1031 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
1032#if defined(CONFIG_MSM_AVS_HW)
1033 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1034 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1035#endif
1036 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1037 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1038 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1039 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1040 .vctl_timeout_us = 50,
1041 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1042 .modes = msm_spm_seq_list,
1043 },
1044 [3] = {
1045 .reg_base_addr = MSM_SAW3_BASE,
1046 .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00,
1047 .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F,
1048 .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C,
1049#if defined(CONFIG_MSM_AVS_HW)
1050 .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00,
1051 .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00,
1052#endif
1053 .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01,
1054 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202,
1055 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C,
1056 .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C,
1057 .vctl_timeout_us = 50,
1058 .num_modes = ARRAY_SIZE(msm_spm_seq_list),
1059 .modes = msm_spm_seq_list,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001060 },
1061};
1062
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001063static void __init apq8064_init_buses(void)
1064{
1065 msm_bus_rpm_set_mt_mask();
1066 msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1;
1067 msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1;
1068 msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1;
1069 msm_bus_8064_apps_fabric.dev.platform_data =
1070 &msm_bus_8064_apps_fabric_pdata;
1071 msm_bus_8064_sys_fabric.dev.platform_data =
1072 &msm_bus_8064_sys_fabric_pdata;
1073 msm_bus_8064_mm_fabric.dev.platform_data =
1074 &msm_bus_8064_mm_fabric_pdata;
1075 msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata;
1076 msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata;
1077}
1078
David Collinsf0d00732012-01-25 15:46:50 -08001079static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = {
1080 .name = GPIO_REGULATOR_DEV_NAME,
1081 .id = PM8921_MPP_PM_TO_SYS(7),
1082 .dev = {
1083 .platform_data
1084 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V],
1085 },
1086};
1087
1088static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = {
1089 .name = GPIO_REGULATOR_DEV_NAME,
1090 .id = APQ8064_EXT_3P3V_REG_EN_GPIO,
1091 .dev = {
1092 .platform_data =
1093 &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
1094 },
1095};
1096
David Collins390fc332012-02-07 14:38:16 -08001097static struct platform_device apq8064_device_ext_ts_sw_vreg __devinitdata = {
1098 .name = GPIO_REGULATOR_DEV_NAME,
1099 .id = PM8921_GPIO_PM_TO_SYS(23),
1100 .dev = {
1101 .platform_data
1102 = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_TS_SW],
1103 },
1104};
1105
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001106static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -07001107 &apq8064_device_dmov,
Jing Lin04601f92012-02-05 15:36:07 -08001108 &apq8064_device_qup_i2c_gsbi3,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001109 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001110 &apq8064_device_qup_spi_gsbi5,
David Collinsf0d00732012-01-25 15:46:50 -08001111 &apq8064_device_ext_5v_vreg,
1112 &apq8064_device_ext_3p3v_vreg,
David Collins390fc332012-02-07 14:38:16 -08001113 &apq8064_device_ext_ts_sw_vreg,
Jay Chokshi9c25f072011-09-23 18:19:15 -07001114 &apq8064_device_ssbi_pmic1,
1115 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -06001116 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -07001117 &apq8064_device_otg,
1118 &apq8064_device_gadget_peripheral,
Hemant Kumard86c4882012-01-24 19:39:37 -08001119 &apq8064_device_hsusb_host,
Hemant Kumara945b472012-01-25 15:08:06 -08001120 &apq8064_device_hsic_host,
Hemant Kumar4933b072011-10-17 23:43:11 -07001121 &android_usb_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001122#ifdef CONFIG_ANDROID_PMEM
1123#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Kevin Chan13be4e22011-10-20 11:30:32 -07001124 &android_pmem_device,
1125 &android_pmem_adsp_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001126#endif
Kevin Chan13be4e22011-10-20 11:30:32 -07001127 &android_pmem_audio_device,
Olav Haugan7c6aa742012-01-16 16:47:37 -08001128#endif
1129#ifdef CONFIG_ION_MSM
1130 &ion_dev,
1131#endif
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001132 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -08001133 &msm8064_device_saw_regulator_core0,
1134 &msm8064_device_saw_regulator_core1,
1135 &msm8064_device_saw_regulator_core2,
1136 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -07001137#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
1138 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
1139 &qcrypto_device,
1140#endif
1141
1142#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
1143 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
1144 &qcedev_device,
1145#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -07001146
1147#ifdef CONFIG_HW_RANDOM_MSM
1148 &apq8064_device_rng,
1149#endif
Bharath Ramachandramurthyb8e797f2011-11-30 12:08:42 -08001150 &apq_pcm,
1151 &apq_pcm_routing,
1152 &apq_cpudai0,
1153 &apq_cpudai1,
1154 &apq_cpudai_hdmi_rx,
1155 &apq_cpudai_bt_rx,
1156 &apq_cpudai_bt_tx,
1157 &apq_cpudai_fm_rx,
1158 &apq_cpudai_fm_tx,
1159 &apq_cpu_fe,
1160 &apq_stub_codec,
1161 &apq_voice,
1162 &apq_voip,
1163 &apq_lpa_pcm,
1164 &apq_pcm_hostless,
1165 &apq_cpudai_afe_01_rx,
1166 &apq_cpudai_afe_01_tx,
1167 &apq_cpudai_afe_02_rx,
1168 &apq_cpudai_afe_02_tx,
1169 &apq_pcm_afe,
1170 &apq_cpudai_auxpcm_rx,
1171 &apq_cpudai_auxpcm_tx,
Praveen Chidambaram78499012011-11-01 17:15:17 -06001172 &apq8064_rpm_device,
1173 &apq8064_rpm_log_device,
1174 &apq8064_rpm_stat_device,
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001175 &msm_bus_8064_apps_fabric,
1176 &msm_bus_8064_sys_fabric,
1177 &msm_bus_8064_mm_fabric,
1178 &msm_bus_8064_sys_fpb,
1179 &msm_bus_8064_cpss_fpb,
Rajesh Sastrulaaee8af32012-01-20 11:46:31 -08001180 &msm_device_vidc,
Matt Wagantalled832652012-02-02 19:23:17 -08001181 &msm_8960_riva,
Matt Wagantallb94b9a52012-02-02 21:59:54 -08001182 &msm_8960_q6_lpass,
Matt Wagantall292aace2012-01-26 19:12:34 -08001183 &msm_gss,
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001184};
1185
Joel King4e7ad222011-08-17 15:47:38 -07001186static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001187 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -07001188 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001189};
1190
1191static struct platform_device *rumi3_devices[] __initdata = {
1192 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -08001193 &msm_device_sps_apq8064,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001194#ifdef CONFIG_MSM_ROTATOR
1195 &msm_rotator_device,
1196#endif
Joel King4e7ad222011-08-17 15:47:38 -07001197};
1198
Joel King82b7e3f2012-01-05 10:03:27 -08001199static struct platform_device *cdp_devices[] __initdata = {
1200 &apq8064_device_uart_gsbi1,
Jin Hong4bbbfba2012-02-02 21:48:07 -08001201 &apq8064_device_uart_gsbi7,
Joel King82b7e3f2012-01-05 10:03:27 -08001202 &msm_device_sps_apq8064,
1203};
1204
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001205static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001206 .max_clock_speed = 1100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001207};
1208
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001209#define KS8851_IRQ_GPIO 43
1210
1211static struct spi_board_info spi_board_info[] __initdata = {
1212 {
1213 .modalias = "ks8851",
1214 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
1215 .max_speed_hz = 19200000,
1216 .bus_num = 0,
1217 .chip_select = 2,
1218 .mode = SPI_MODE_0,
1219 },
1220};
1221
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001222static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001223 {
Swaminathan Sathappancef966d2011-12-15 17:27:04 -08001224 .bus_num = 1,
1225 .slim_slave = &apq8064_slim_tabla,
1226 },
1227 {
1228 .bus_num = 1,
1229 .slim_slave = &apq8064_slim_tabla20,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -08001230 },
1231 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001232};
1233
Jing Lin04601f92012-02-05 15:36:07 -08001234static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi3_pdata = {
1235 .clk_freq = 100000,
1236 .src_clk_rate = 24000000,
1237};
1238
Kenneth Heitke748593a2011-07-15 15:45:11 -06001239static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
1240 .clk_freq = 100000,
1241 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -06001242};
1243
1244static void __init apq8064_i2c_init(void)
1245{
Jing Lin04601f92012-02-05 15:36:07 -08001246 apq8064_device_qup_i2c_gsbi3.dev.platform_data =
1247 &apq8064_i2c_qup_gsbi3_pdata;
Kenneth Heitke748593a2011-07-15 15:45:11 -06001248 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
1249 &apq8064_i2c_qup_gsbi4_pdata;
1250}
1251
Stepan Moskovchenkoc71c9792012-01-31 18:12:44 -08001252#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001253static int ethernet_init(void)
1254{
1255 int ret;
1256 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
1257 if (ret) {
1258 pr_err("ks8851 gpio_request failed: %d\n", ret);
1259 goto fail;
1260 }
1261
1262 return 0;
1263fail:
1264 return ret;
1265}
1266#else
1267static int ethernet_init(void)
1268{
1269 return 0;
1270}
1271#endif
1272
Tianyi Gou41515e22011-09-01 19:37:43 -07001273static void __init apq8064_clock_init(void)
1274{
Tianyi Gouacb588d2012-01-27 18:24:05 -08001275 if (machine_is_apq8064_rumi3())
Tianyi Gou41515e22011-09-01 19:37:43 -07001276 msm_clock_init(&apq8064_dummy_clock_init_data);
Tianyi Gouacb588d2012-01-27 18:24:05 -08001277 else
1278 msm_clock_init(&apq8064_clock_init_data);
Tianyi Gou41515e22011-09-01 19:37:43 -07001279}
1280
Jing Lin417fa452012-02-05 14:31:06 -08001281#define I2C_SURF 1
1282#define I2C_FFA (1 << 1)
1283#define I2C_RUMI (1 << 2)
1284#define I2C_SIM (1 << 3)
1285#define I2C_LIQUID (1 << 4)
1286
1287struct i2c_registry {
1288 u8 machs;
1289 int bus;
1290 struct i2c_board_info *info;
1291 int len;
1292};
1293
1294static struct i2c_registry apq8064_i2c_devices[] __initdata = {
1295};
1296
1297static void __init register_i2c_devices(void)
1298{
1299 u8 mach_mask = 0;
1300 int i;
1301
1302 /* Build the matching 'supported_machs' bitmask */
1303 if (machine_is_apq8064_cdp())
1304 mach_mask = I2C_SURF;
1305 else if (machine_is_apq8064_mtp())
1306 mach_mask = I2C_FFA;
1307 else if (machine_is_apq8064_liquid())
1308 mach_mask = I2C_LIQUID;
1309 else if (machine_is_apq8064_rumi3())
1310 mach_mask = I2C_RUMI;
1311 else if (machine_is_apq8064_sim())
1312 mach_mask = I2C_SIM;
1313 else
1314 pr_err("unmatched machine ID in register_i2c_devices\n");
1315
1316 /* Run the array and install devices as appropriate */
1317 for (i = 0; i < ARRAY_SIZE(apq8064_i2c_devices); ++i) {
1318 if (apq8064_i2c_devices[i].machs & mach_mask)
1319 i2c_register_board_info(apq8064_i2c_devices[i].bus,
1320 apq8064_i2c_devices[i].info,
1321 apq8064_i2c_devices[i].len);
1322 }
1323}
1324
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001325static void __init apq8064_common_init(void)
1326{
1327 if (socinfo_init() < 0)
1328 pr_err("socinfo_init() failed!\n");
Praveen Chidambaram78499012011-11-01 17:15:17 -06001329 BUG_ON(msm_rpm_init(&apq8064_rpm_data));
1330 BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data));
Tianyi Gou41515e22011-09-01 19:37:43 -07001331 apq8064_clock_init();
Stepan Moskovchenko2327a952011-12-14 16:31:28 -08001332 apq8064_init_gpiomux();
Kenneth Heitke748593a2011-07-15 15:45:11 -06001333 apq8064_i2c_init();
Jing Lin417fa452012-02-05 14:31:06 -08001334 register_i2c_devices();
Kenneth Heitke36920d32011-07-20 16:44:30 -06001335
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001336 apq8064_device_qup_spi_gsbi5.dev.platform_data =
1337 &apq8064_qup_spi_gsbi5_pdata;
Stepan Moskovchenkoc1074f02011-12-14 17:51:57 -08001338 apq8064_init_pmic();
Hemant Kumar94e7da22012-02-03 16:52:29 -08001339 if (machine_is_apq8064_liquid())
1340 msm_otg_pdata.mhl_enable = true;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001341 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Hemant Kumara945b472012-01-25 15:08:06 -08001342 apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata;
Gagan Mac8a7a5d32011-11-11 16:43:06 -07001343 apq8064_init_buses();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001344 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Jay Chokshie8741282012-01-25 15:22:55 -08001345 apq8064_pm8xxx_gpio_mpp_init();
Sahitya Tummala3586ed92011-08-03 09:13:23 +05301346 apq8064_init_mmc();
Swaminathan Sathappan144b4882012-02-06 17:01:20 -08001347
1348 if (machine_is_apq8064_mtp()) {
1349 mdm_8064_device.dev.platform_data = &mdm_platform_data;
1350 platform_device_register(&mdm_8064_device);
1351 }
1352 platform_device_register(&apq8064_slim_ctrl);
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001353 slim_register_board_info(apq8064_slim_devices,
1354 ARRAY_SIZE(apq8064_slim_devices));
Praveen Chidambaram78499012011-11-01 17:15:17 -06001355 msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data));
Mahesh Sivasubramaniancbce1ec2012-01-24 10:32:44 -07001356 acpuclk_init(&acpuclk_8064_soc_data);
Praveen Chidambaram78499012011-11-01 17:15:17 -06001357 msm_spm_l2_init(msm_spm_l2_data);
1358 msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data));
1359 msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ);
1360 msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates),
1361 msm_pm_data);
1362 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001363}
1364
Huaibin Yang4a084e32011-12-15 15:25:52 -08001365static void __init apq8064_allocate_memory_regions(void)
1366{
1367 apq8064_allocate_fb_region();
1368}
1369
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001370static void __init apq8064_sim_init(void)
1371{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001372 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
1373 &msm8064_device_watchdog.dev.platform_data;
1374
1375 wdog_pdata->bark_time = 15000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001376 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07001377 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
1378}
1379
1380static void __init apq8064_rumi3_init(void)
1381{
1382 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001383 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001384 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001385 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Huaibin Yang4a084e32011-12-15 15:25:52 -08001386 apq8064_init_fb();
Jordan Crouseb3115fe2012-02-01 22:11:12 -07001387 apq8064_init_gpu();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001388}
1389
Joel King82b7e3f2012-01-05 10:03:27 -08001390static void __init apq8064_cdp_init(void)
1391{
1392 apq8064_common_init();
1393 ethernet_init();
1394 platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
1395 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Jordan Crouseb3115fe2012-02-01 22:11:12 -07001396 apq8064_init_gpu();
Matt Wagantallef3cfe542012-02-04 19:01:08 -08001397 platform_add_devices(msm_footswitch_devices,
1398 msm_num_footswitch_devices);
Joel King82b7e3f2012-01-05 10:03:27 -08001399}
1400
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001401MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
1402 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001403 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001404 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05301405 .handle_irq = gic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001406 .timer = &msm_timer,
1407 .init_machine = apq8064_sim_init,
1408MACHINE_END
1409
Joel King4e7ad222011-08-17 15:47:38 -07001410MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
1411 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001412 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07001413 .init_irq = apq8064_init_irq,
Marc Zyngier89bdafd12011-12-22 11:39:20 +05301414 .handle_irq = gic_handle_irq,
Joel King4e7ad222011-08-17 15:47:38 -07001415 .timer = &msm_timer,
1416 .init_machine = apq8064_rumi3_init,
Huaibin Yang4a084e32011-12-15 15:25:52 -08001417 .init_early = apq8064_allocate_memory_regions,
Joel King4e7ad222011-08-17 15:47:38 -07001418MACHINE_END
1419
Joel King82b7e3f2012-01-05 10:03:27 -08001420MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP")
1421 .map_io = apq8064_map_io,
1422 .reserve = apq8064_reserve,
1423 .init_irq = apq8064_init_irq,
1424 .handle_irq = gic_handle_irq,
1425 .timer = &msm_timer,
1426 .init_machine = apq8064_cdp_init,
1427MACHINE_END
1428
1429MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP")
1430 .map_io = apq8064_map_io,
1431 .reserve = apq8064_reserve,
1432 .init_irq = apq8064_init_irq,
1433 .handle_irq = gic_handle_irq,
1434 .timer = &msm_timer,
1435 .init_machine = apq8064_cdp_init,
1436MACHINE_END
1437
1438MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID")
1439 .map_io = apq8064_map_io,
1440 .reserve = apq8064_reserve,
1441 .init_irq = apq8064_init_irq,
1442 .handle_irq = gic_handle_irq,
1443 .timer = &msm_timer,
1444 .init_machine = apq8064_cdp_init,
1445MACHINE_END
1446