blob: 680060d67bc11dfdf9a43dcfbb7470dcecb8d577 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070025#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053028#include <asm/mach/mmc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070029
30#include <mach/board.h>
31#include <mach/msm_iomap.h>
32#include <linux/usb/msm_hsusb.h>
33#include <linux/usb/android.h>
34#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060035#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#include "timer.h"
37#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070038#include <mach/gpio.h>
39#include <mach/gpiomux.h>
Kevin Chan13be4e22011-10-20 11:30:32 -070040#include <linux/android_pmem.h>
41#include <mach/msm_memtypes.h>
42#include <linux/bootmem.h>
43#include <asm/setup.h>
Ramesh Masavarapu28311912011-10-27 11:04:12 -070044#include <mach/dma.h>
Joel King4ebccc62011-07-22 09:43:22 -070045
Jeff Ohlstein7e668552011-10-06 16:17:25 -070046#include "msm_watchdog.h"
Jay Chokshiea67c622011-07-29 17:12:26 -070047#include "board-apq8064.h"
48
Kevin Chan13be4e22011-10-20 11:30:32 -070049#define MSM_PMEM_KERNEL_EBI1_SIZE 0x600000
50#define MSM_PMEM_ADSP_SIZE 0x3800000
51#define MSM_PMEM_AUDIO_SIZE 0x28B000
52#define MSM_PMEM_SIZE 0x1800000 /* 24 Mbytes */
53
54static struct memtype_reserve apq8064_reserve_table[] __initdata = {
55 [MEMTYPE_SMI] = {
56 },
57 [MEMTYPE_EBI0] = {
58 .flags = MEMTYPE_FLAGS_1M_ALIGN,
59 },
60 [MEMTYPE_EBI1] = {
61 .flags = MEMTYPE_FLAGS_1M_ALIGN,
62 },
63};
64
65static int apq8064_paddr_to_memtype(unsigned int paddr)
66{
67 return MEMTYPE_EBI1;
68}
69
70static unsigned pmem_size = MSM_PMEM_SIZE;
71static int __init pmem_size_setup(char *p)
72{
73 pmem_size = memparse(p, NULL);
74 return 0;
75}
76early_param("pmem_size", pmem_size_setup);
77
78static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
79
80static int __init pmem_adsp_size_setup(char *p)
81{
82 pmem_adsp_size = memparse(p, NULL);
83 return 0;
84}
85early_param("pmem_adsp_size", pmem_adsp_size_setup);
86
87static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
88
89static int __init pmem_audio_size_setup(char *p)
90{
91 pmem_audio_size = memparse(p, NULL);
92 return 0;
93}
94early_param("pmem_audio_size", pmem_audio_size_setup);
95
96static struct android_pmem_platform_data android_pmem_pdata = {
97 .name = "pmem",
98 .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING,
99 .cached = 1,
100 .memory_type = MEMTYPE_EBI1,
101};
102
103static struct platform_device android_pmem_device = {
104 .name = "android_pmem",
105 .id = 0,
106 .dev = {.platform_data = &android_pmem_pdata},
107};
108
109static struct android_pmem_platform_data android_pmem_adsp_pdata = {
110 .name = "pmem_adsp",
111 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
112 .cached = 0,
113 .memory_type = MEMTYPE_EBI1,
114};
115
116static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE;
117static int __init pmem_kernel_ebi1_size_setup(char *p)
118{
119 pmem_kernel_ebi1_size = memparse(p, NULL);
120 return 0;
121}
122early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
123
124static struct platform_device android_pmem_adsp_device = {
125 .name = "android_pmem",
126 .id = 2,
127 .dev = { .platform_data = &android_pmem_adsp_pdata },
128};
129
130static struct android_pmem_platform_data android_pmem_audio_pdata = {
131 .name = "pmem_audio",
132 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
133 .cached = 0,
134 .memory_type = MEMTYPE_EBI1,
135};
136
137static struct platform_device android_pmem_audio_device = {
138 .name = "android_pmem",
139 .id = 4,
140 .dev = { .platform_data = &android_pmem_audio_pdata },
141};
142
143static void __init size_pmem_devices(void)
144{
145 android_pmem_adsp_pdata.size = pmem_adsp_size;
146 android_pmem_pdata.size = pmem_size;
147 android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE;
148}
149
150static void __init reserve_memory_for(struct android_pmem_platform_data *p)
151{
152 apq8064_reserve_table[p->memory_type].size += p->size;
153}
154
155
156static void __init reserve_pmem_memory(void)
157{
158 reserve_memory_for(&android_pmem_adsp_pdata);
159 reserve_memory_for(&android_pmem_pdata);
160 reserve_memory_for(&android_pmem_audio_pdata);
161 apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
162}
163
164static void __init apq8064_calculate_reserve_sizes(void)
165{
166 size_pmem_devices();
167 reserve_pmem_memory();
168}
169
170static struct reserve_info apq8064_reserve_info __initdata = {
171 .memtype_reserve_table = apq8064_reserve_table,
172 .calculate_reserve_sizes = apq8064_calculate_reserve_sizes,
173 .paddr_to_memtype = apq8064_paddr_to_memtype,
174};
175
176static int apq8064_memory_bank_size(void)
177{
178 return 1<<29;
179}
180
181static void __init locate_unstable_memory(void)
182{
183 struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1];
184 unsigned long bank_size;
185 unsigned long low, high;
186
187 bank_size = apq8064_memory_bank_size();
188 low = meminfo.bank[0].start;
189 high = mb->start + mb->size;
190 low &= ~(bank_size - 1);
191
192 if (high - low <= bank_size)
193 return;
194 apq8064_reserve_info.low_unstable_address = low + bank_size;
195 apq8064_reserve_info.max_unstable_size = high - low - bank_size;
196 apq8064_reserve_info.bank_size = bank_size;
197 pr_info("low unstable address %lx max size %lx bank size %lx\n",
198 apq8064_reserve_info.low_unstable_address,
199 apq8064_reserve_info.max_unstable_size,
200 apq8064_reserve_info.bank_size);
201}
202
203static void __init apq8064_reserve(void)
204{
205 reserve_info = &apq8064_reserve_info;
206 locate_unstable_memory();
207 msm_reserve();
208}
209
Hemant Kumar4933b072011-10-17 23:43:11 -0700210static struct platform_device android_usb_device = {
211 .name = "android_usb",
212 .id = -1,
213};
214
215static struct msm_otg_platform_data msm_otg_pdata = {
216 .mode = USB_PERIPHERAL,
217 .otg_control = OTG_PHY_CONTROL,
218 .phy_type = SNPS_28NM_INTEGRATED_PHY,
219 .pclk_src_name = "dfab_usb_hs_clk",
220};
221
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -0700222/* APQ8064 has 4 SDCC controllers */
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530223enum sdcc_controllers {
224 SDCC1,
225 SDCC2,
226 SDCC3,
227 SDCC4,
228 MAX_SDCC_CONTROLLER
229};
230
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800231#define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS)
232
233/* Micbias setting is based on 8660 CDP/MTP/FLUID requirement
234 * 4 micbiases are used to power various analog and digital
235 * microphones operating at 1800 mV. Technically, all micbiases
236 * can source from single cfilter since all microphones operate
237 * at the same voltage level. The arrangement below is to make
238 * sure all cfilters are exercised. LDO_H regulator ouput level
239 * does not need to be as high as 2.85V. It is choosen for
240 * microphone sensitivity purpose.
241 */
242static struct tabla_pdata apq8064_tabla_platform_data = {
243 .slimbus_slave_device = {
244 .name = "tabla-slave",
245 .e_addr = {0, 0, 0x10, 0, 0x17, 2},
246 },
247 .irq = MSM_GPIO_TO_INT(62),
248 .irq_base = TABLA_INTERRUPT_BASE,
249 .num_irqs = NR_TABLA_IRQS,
250 .reset_gpio = PM8921_GPIO_PM_TO_SYS(34),
251 .micbias = {
252 .ldoh_v = TABLA_LDOH_2P85_V,
253 .cfilt1_mv = 1800,
254 .cfilt2_mv = 1800,
255 .cfilt3_mv = 1800,
256 .bias1_cfilt_sel = TABLA_CFILT1_SEL,
257 .bias2_cfilt_sel = TABLA_CFILT2_SEL,
258 .bias3_cfilt_sel = TABLA_CFILT3_SEL,
259 .bias4_cfilt_sel = TABLA_CFILT3_SEL,
260 }
261};
262
263static struct slim_device apq8064_slim_tabla = {
264 .name = "tabla-slim",
265 .e_addr = {0, 1, 0x10, 0, 0x17, 2},
266 .dev = {
267 .platform_data = &apq8064_tabla_platform_data,
268 },
269};
270
Stepan Moskovchenko73b943b2011-10-31 22:43:00 -0700271/* All SDCC controllers require VDD/VCC voltage */
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530272static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
273 /* SDCC1 : eMMC card connected */
274 [SDCC1] = {
275 .name = "sdc_vdd",
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530276 .high_vol_level = 2950000,
277 .low_vol_level = 2950000,
278 .always_on = 1,
279 .lpm_sup = 1,
280 .lpm_uA = 9000,
281 .hpm_uA = 200000, /* 200mA */
282 },
283 /* SDCC3 : External card slot connected */
284 [SDCC3] = {
285 .name = "sdc_vdd",
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530286 .high_vol_level = 2950000,
287 .low_vol_level = 2950000,
288 .hpm_uA = 600000, /* 600mA */
289 }
290};
291
292/* Only slots having eMMC card will require VCCQ voltage */
293static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
294 /* SDCC1 : eMMC card connected */
295 [SDCC1] = {
296 .name = "sdc_vccq",
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530297 .always_on = 1,
298 .high_vol_level = 1800000,
299 .low_vol_level = 1800000,
300 .hpm_uA = 200000, /* 200mA */
301 }
302};
303
304/* All SDCC controllers may require voting for VDD PAD voltage */
305static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
306 /* SDCC3 : External card slot connected */
307 [SDCC3] = {
308 .name = "sdc_vddp",
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530309 .high_vol_level = 2950000,
310 .low_vol_level = 1850000,
311 .always_on = 1,
312 .lpm_sup = 1,
313 /* Max. Active current required is 16 mA */
314 .hpm_uA = 16000,
315 /*
316 * Sleep current required is ~300 uA. But min. vote can be
317 * in terms of mA (min. 1 mA). So let's vote for 2 mA
318 * during sleep.
319 */
320 .lpm_uA = 2000,
321 }
322};
323
324static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
325 /* SDCC1 : eMMC card connected */
326 [SDCC1] = {
327 .vdd_data = &mmc_vdd_reg_data[SDCC1],
328 .vccq_data = &mmc_vccq_reg_data[SDCC1],
329 },
330 /* SDCC3 : External card slot connected */
331 [SDCC3] = {
332 .vdd_data = &mmc_vdd_reg_data[SDCC3],
333 .vddp_data = &mmc_vddp_reg_data[SDCC3],
334 }
335};
336
337/* SDC1 pad data */
338static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
339 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
340 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
341 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
342};
343
344static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
345 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
346 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
347 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
348};
349
350static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
Sahitya Tummalaf5764e82011-10-03 13:46:00 +0530351 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530352 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
353 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
354};
355
356static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
Sahitya Tummalaf5764e82011-10-03 13:46:00 +0530357 {TLMM_PULL_SDC1_CLK, GPIO_CFG_NO_PULL},
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530358 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
359 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
360};
361
362/* SDC3 pad data */
363static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
364 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
365 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
366 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
367};
368
369static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
370 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
371 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
372 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
373};
374
375static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
Sahitya Tummalaf5764e82011-10-03 13:46:00 +0530376 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530377 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
378 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
379};
380
381static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
Sahitya Tummalaf5764e82011-10-03 13:46:00 +0530382 {TLMM_PULL_SDC3_CLK, GPIO_CFG_NO_PULL},
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530383 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN},
384 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN}
385};
386
387static struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
388 [SDCC1] = {
389 .on = sdc1_pad_pull_on_cfg,
390 .off = sdc1_pad_pull_off_cfg,
391 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
392 },
393 [SDCC3] = {
394 .on = sdc3_pad_pull_on_cfg,
395 .off = sdc3_pad_pull_off_cfg,
396 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
397 },
398};
399
400static struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
401 [SDCC1] = {
402 .on = sdc1_pad_drv_on_cfg,
403 .off = sdc1_pad_drv_off_cfg,
404 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
405 },
406 [SDCC3] = {
407 .on = sdc3_pad_drv_on_cfg,
408 .off = sdc3_pad_drv_off_cfg,
409 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
410 },
411};
412
413static struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
414 [SDCC1] = {
415 .pull = &mmc_pad_pull_data[SDCC1],
416 .drv = &mmc_pad_drv_data[SDCC1]
417 },
418 [SDCC3] = {
419 .pull = &mmc_pad_pull_data[SDCC3],
420 .drv = &mmc_pad_drv_data[SDCC3]
421 },
422};
423
424static struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
425 [SDCC1] = {
426 .pad_data = &mmc_pad_data[SDCC1],
427 },
428 [SDCC3] = {
429 .pad_data = &mmc_pad_data[SDCC3],
430 },
431};
432
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530433#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
434static unsigned int sdc1_sup_clk_rates[] = {
435 400000, 24000000, 48000000, 96000000
436};
437
438static struct mmc_platform_data sdc1_data = {
439 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
Sahitya Tummala01431972011-10-03 13:52:26 +0530440#ifdef CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT
441 .mmc_bus_width = MMC_CAP_8_BIT_DATA,
442#else
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530443 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
Sahitya Tummala01431972011-10-03 13:52:26 +0530444#endif
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530445 .sup_clk_table = sdc1_sup_clk_rates,
446 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530447 .pin_data = &mmc_slot_pin_data[SDCC1],
448 .vreg_data = &mmc_slot_vreg_data[SDCC1],
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530449};
450static struct mmc_platform_data *apq8064_sdc1_pdata = &sdc1_data;
451#else
452static struct mmc_platform_data *apq8064_sdc1_pdata;
453#endif
454
455#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
456static unsigned int sdc3_sup_clk_rates[] = {
457 400000, 24000000, 48000000, 96000000
458};
459
460static struct mmc_platform_data sdc3_data = {
461 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
462 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
463 .sup_clk_table = sdc3_sup_clk_rates,
464 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530465 .pin_data = &mmc_slot_pin_data[SDCC3],
466 .vreg_data = &mmc_slot_vreg_data[SDCC3],
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530467};
468static struct mmc_platform_data *apq8064_sdc3_pdata = &sdc3_data;
469#else
470static struct mmc_platform_data *apq8064_sdc3_pdata;
471#endif
472
473static void __init apq8064_init_mmc(void)
474{
Amol Jadi7d4ce032011-09-09 17:07:18 -0700475 if ((machine_is_apq8064_rumi3()) || machine_is_apq8064_sim()) {
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530476 if (apq8064_sdc1_pdata) {
Sahitya Tummaladc7c0a22011-11-17 11:36:16 +0530477 if (machine_is_apq8064_sim())
478 apq8064_sdc1_pdata->disable_bam = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530479 apq8064_sdc1_pdata->disable_runtime_pm = true;
Sahitya Tummala85fa0702011-09-15 09:39:37 +0530480 apq8064_sdc1_pdata->disable_cmd23 = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530481 }
482 if (apq8064_sdc3_pdata) {
Sahitya Tummaladc7c0a22011-11-17 11:36:16 +0530483 if (machine_is_apq8064_sim())
484 apq8064_sdc3_pdata->disable_bam = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530485 apq8064_sdc3_pdata->disable_runtime_pm = true;
Sahitya Tummala85fa0702011-09-15 09:39:37 +0530486 apq8064_sdc3_pdata->disable_cmd23 = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530487 }
Sahitya Tummalad9df3272011-08-19 16:50:46 +0530488 }
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530489 apq8064_add_sdcc(1, apq8064_sdc1_pdata);
490 apq8064_add_sdcc(3, apq8064_sdc3_pdata);
491}
492
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700493#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
494 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \
495 defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
496 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
497
498#define QCE_SIZE 0x10000
499#define QCE_0_BASE 0x11000000
500
501#define QCE_HW_KEY_SUPPORT 0
502#define QCE_SHA_HMAC_SUPPORT 1
503#define QCE_SHARE_CE_RESOURCE 3
504#define QCE_CE_SHARED 0
505
506static struct resource qcrypto_resources[] = {
507 [0] = {
508 .start = QCE_0_BASE,
509 .end = QCE_0_BASE + QCE_SIZE - 1,
510 .flags = IORESOURCE_MEM,
511 },
512 [1] = {
513 .name = "crypto_channels",
514 .start = DMOV8064_CE_IN_CHAN,
515 .end = DMOV8064_CE_OUT_CHAN,
516 .flags = IORESOURCE_DMA,
517 },
518 [2] = {
519 .name = "crypto_crci_in",
520 .start = DMOV8064_CE_IN_CRCI,
521 .end = DMOV8064_CE_IN_CRCI,
522 .flags = IORESOURCE_DMA,
523 },
524 [3] = {
525 .name = "crypto_crci_out",
526 .start = DMOV8064_CE_OUT_CRCI,
527 .end = DMOV8064_CE_OUT_CRCI,
528 .flags = IORESOURCE_DMA,
529 },
530};
531
532static struct resource qcedev_resources[] = {
533 [0] = {
534 .start = QCE_0_BASE,
535 .end = QCE_0_BASE + QCE_SIZE - 1,
536 .flags = IORESOURCE_MEM,
537 },
538 [1] = {
539 .name = "crypto_channels",
540 .start = DMOV8064_CE_IN_CHAN,
541 .end = DMOV8064_CE_OUT_CHAN,
542 .flags = IORESOURCE_DMA,
543 },
544 [2] = {
545 .name = "crypto_crci_in",
546 .start = DMOV8064_CE_IN_CRCI,
547 .end = DMOV8064_CE_IN_CRCI,
548 .flags = IORESOURCE_DMA,
549 },
550 [3] = {
551 .name = "crypto_crci_out",
552 .start = DMOV8064_CE_OUT_CRCI,
553 .end = DMOV8064_CE_OUT_CRCI,
554 .flags = IORESOURCE_DMA,
555 },
556};
557
558#endif
559
560#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
561 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
562
563static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
564 .ce_shared = QCE_CE_SHARED,
565 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
566 .hw_key_support = QCE_HW_KEY_SUPPORT,
567 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
568};
569
570static struct platform_device qcrypto_device = {
571 .name = "qcrypto",
572 .id = 0,
573 .num_resources = ARRAY_SIZE(qcrypto_resources),
574 .resource = qcrypto_resources,
575 .dev = {
576 .coherent_dma_mask = DMA_BIT_MASK(32),
577 .platform_data = &qcrypto_ce_hw_suppport,
578 },
579};
580#endif
581
582#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
583 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
584
585static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
586 .ce_shared = QCE_CE_SHARED,
587 .shared_ce_resource = QCE_SHARE_CE_RESOURCE,
588 .hw_key_support = QCE_HW_KEY_SUPPORT,
589 .sha_hmac = QCE_SHA_HMAC_SUPPORT,
590};
591
592static struct platform_device qcedev_device = {
593 .name = "qce",
594 .id = 0,
595 .num_resources = ARRAY_SIZE(qcedev_resources),
596 .resource = qcedev_resources,
597 .dev = {
598 .coherent_dma_mask = DMA_BIT_MASK(32),
599 .platform_data = &qcedev_ce_hw_suppport,
600 },
601};
602#endif
603
604
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600605#define MSM_SHARED_RAM_PHYS 0x80000000
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700606static void __init apq8064_map_io(void)
607{
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600608 msm_shared_ram_phys = MSM_SHARED_RAM_PHYS;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700609 msm_map_apq8064_io();
Jeff Ohlstein3a77f9f2011-09-06 14:50:20 -0700610 if (socinfo_init() < 0)
611 pr_err("socinfo_init() failed!\n");
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700612}
613
614static void __init apq8064_init_irq(void)
615{
616 unsigned int i;
617 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
618 (void *)MSM_QGIC_CPU_BASE);
619
620 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
621 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
622
623 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
624 mb();
625
626 /*
627 * FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
628 * as they are configured as level, which does not play nice with
629 * handle_percpu_irq.
630 */
631 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
632 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
633 irq_set_handler(i, handle_percpu_irq);
634 }
635}
636
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800637static struct platform_device msm8064_device_saw_regulator_core0 = {
638 .name = "saw-regulator",
639 .id = 0,
640 .dev = {
641 .platform_data = &msm8064_saw_regulator_pdata_8921_s5,
642 },
643};
644
645static struct platform_device msm8064_device_saw_regulator_core1 = {
646 .name = "saw-regulator",
647 .id = 1,
648 .dev = {
649 .platform_data = &msm8064_saw_regulator_pdata_8921_s6,
650 },
651};
652
653static struct platform_device msm8064_device_saw_regulator_core2 = {
654 .name = "saw-regulator",
655 .id = 2,
656 .dev = {
657 .platform_data = &msm8064_saw_regulator_pdata_8821_s0,
658 },
659};
660
661static struct platform_device msm8064_device_saw_regulator_core3 = {
662 .name = "saw-regulator",
663 .id = 3,
664 .dev = {
665 .platform_data = &msm8064_saw_regulator_pdata_8821_s1,
666 },
667};
668
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700669static struct platform_device *common_devices[] __initdata = {
Jin Hong01f2dbb2011-11-03 22:13:51 -0700670 &apq8064_device_dmov,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600671 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600672 &apq8064_device_qup_spi_gsbi5,
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600673 &apq8064_slim_ctrl,
Jay Chokshi9c25f072011-09-23 18:19:15 -0700674 &apq8064_device_ssbi_pmic1,
675 &apq8064_device_ssbi_pmic2,
Jeff Hugo0c0f5e92011-09-28 13:55:45 -0600676 &msm_device_smd_apq8064,
Hemant Kumar4933b072011-10-17 23:43:11 -0700677 &apq8064_device_otg,
678 &apq8064_device_gadget_peripheral,
679 &android_usb_device,
Kevin Chan13be4e22011-10-20 11:30:32 -0700680 &android_pmem_device,
681 &android_pmem_adsp_device,
682 &android_pmem_audio_device,
Jeff Ohlstein7e668552011-10-06 16:17:25 -0700683 &msm8064_device_watchdog,
Jay Chokshi7805b5a2011-11-07 15:55:30 -0800684 &msm8064_device_saw_regulator_core0,
685 &msm8064_device_saw_regulator_core1,
686 &msm8064_device_saw_regulator_core2,
687 &msm8064_device_saw_regulator_core3,
Ramesh Masavarapu28311912011-10-27 11:04:12 -0700688#if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \
689 defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE)
690 &qcrypto_device,
691#endif
692
693#if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \
694 defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE)
695 &qcedev_device,
696#endif
Ramesh Masavarapuf46be1b2011-11-03 11:13:41 -0700697
698#ifdef CONFIG_HW_RANDOM_MSM
699 &apq8064_device_rng,
700#endif
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800701 &msm_pcm,
702 &msm_pcm_routing,
703 &msm_cpudai0,
704 &msm_cpudai1,
705 &msm_cpudai_hdmi_rx,
706 &msm_cpudai_bt_rx,
707 &msm_cpudai_bt_tx,
708 &msm_cpudai_fm_rx,
709 &msm_cpudai_fm_tx,
710 &msm_cpu_fe,
711 &msm_stub_codec,
712 &msm_voice,
713 &msm_voip,
714 &msm_lpa_pcm,
715 &msm_cpudai_afe_01_rx,
716 &msm_cpudai_afe_01_tx,
717 &msm_cpudai_afe_02_rx,
718 &msm_cpudai_afe_02_tx,
719 &msm_pcm_afe,
720 &msm_cpudai_auxpcm_rx,
721 &msm_cpudai_auxpcm_tx,
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600722};
723
Joel King4e7ad222011-08-17 15:47:38 -0700724static struct platform_device *sim_devices[] __initdata = {
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700725 &apq8064_device_uart_gsbi3,
Yan He06913ce2011-08-26 16:33:46 -0700726 &msm_device_sps_apq8064,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700727};
728
729static struct platform_device *rumi3_devices[] __initdata = {
730 &apq8064_device_uart_gsbi1,
Yan He435ed612011-11-23 17:34:59 -0800731 &msm_device_sps_apq8064,
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800732 &msm_cpudai_bt_rx,
733 &msm_cpudai_bt_tx,
734 &msm_cpudai_fm_rx,
735 &msm_cpudai_fm_tx,
Joel King4e7ad222011-08-17 15:47:38 -0700736};
737
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600738static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
Harini Jayaraman60ee14c2011-11-09 18:53:27 -0700739 .max_clock_speed = 24000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700740};
741
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700742#define KS8851_IRQ_GPIO 43
743
744static struct spi_board_info spi_board_info[] __initdata = {
745 {
746 .modalias = "ks8851",
747 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
748 .max_speed_hz = 19200000,
749 .bus_num = 0,
750 .chip_select = 2,
751 .mode = SPI_MODE_0,
752 },
753};
754
755#ifdef CONFIG_KS8851
756static struct gpiomux_setting gpio_eth_config = {
757 .pull = GPIOMUX_PULL_NONE,
758 .drv = GPIOMUX_DRV_8MA,
759 .func = GPIOMUX_FUNC_GPIO,
760};
761
762/* The SPI configurations apply to GSBI 5*/
763static struct gpiomux_setting gpio_spi_config = {
764 .func = GPIOMUX_FUNC_2,
765 .drv = GPIOMUX_DRV_8MA,
766 .pull = GPIOMUX_PULL_NONE,
767};
768
769/* The SPI configurations apply to GSBI 5 chip select 2*/
770static struct gpiomux_setting gpio_spi_cs2_config = {
771 .func = GPIOMUX_FUNC_3,
772 .drv = GPIOMUX_DRV_8MA,
773 .pull = GPIOMUX_PULL_NONE,
774};
775#endif
776
777struct msm_gpiomux_config apq8064_ethernet_configs[NR_GPIO_IRQS] = {
778#ifdef CONFIG_KS8851
779 {
780 .gpio = KS8851_IRQ_GPIO,
781 .settings = {
782 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
783 [GPIOMUX_ACTIVE] = &gpio_eth_config,
784 }
785 },
786#endif
787};
788
789static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
790#ifdef CONFIG_KS8851
791 {
792 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
793 .settings = {
794 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
795 },
796 },
797 {
798 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
799 .settings = {
800 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
801 },
802 },
803 {
804 .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
805 .settings = {
806 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
807 },
808 },
809 {
810 .gpio = 54, /* GSBI5 QUP SPI_CLK */
811 .settings = {
812 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
813 },
814 },
815#endif
816};
817
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700818static struct pm8xxx_mpp_platform_data
819apq8064_pm8921_mpp_pdata __devinitdata = {
820 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
821};
822
823static struct pm8xxx_gpio_platform_data
824apq8064_pm8921_gpio_pdata __devinitdata = {
825 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
826};
827
828static struct pm8xxx_irq_platform_data
829apq8064_pm8921_irq_pdata __devinitdata = {
830 .irq_base = PM8921_IRQ_BASE,
Jay Chokshi44873f72011-08-30 17:24:26 -0700831 .devirq = PM8921_USR_IRQ_N,
832 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
Jay Chokshi9e926e72011-09-23 19:19:58 -0700833 .dev_id = 0,
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700834};
835
836static struct pm8921_platform_data
837apq8064_pm8921_platform_data __devinitdata = {
Jay Chokshiea67c622011-07-29 17:12:26 -0700838 .regulator_pdatas = msm8064_pm8921_regulator_pdata,
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700839 .irq_pdata = &apq8064_pm8921_irq_pdata,
840 .gpio_pdata = &apq8064_pm8921_gpio_pdata,
841 .mpp_pdata = &apq8064_pm8921_mpp_pdata,
Jay Chokshiea67c622011-07-29 17:12:26 -0700842};
843
Jay Chokshi44873f72011-08-30 17:24:26 -0700844static struct pm8xxx_irq_platform_data
845apq8064_pm8821_irq_pdata __devinitdata = {
846 .irq_base = PM8821_IRQ_BASE,
847 .devirq = PM8821_USR_IRQ_N,
848 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
Jay Chokshi9e926e72011-09-23 19:19:58 -0700849 .dev_id = 1,
Jay Chokshi44873f72011-08-30 17:24:26 -0700850};
851
852static struct pm8xxx_mpp_platform_data
853apq8064_pm8821_mpp_pdata __devinitdata = {
854 .mpp_base = PM8821_MPP_PM_TO_SYS(1),
855};
856
857static struct pm8821_platform_data
858apq8064_pm8821_platform_data __devinitdata = {
859 .irq_pdata = &apq8064_pm8821_irq_pdata,
860 .mpp_pdata = &apq8064_pm8821_mpp_pdata,
861};
862
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700863static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = {
864 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
865 .slave = {
Jay Chokshiea67c622011-07-29 17:12:26 -0700866 .name = "pm8921-core",
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700867 .platform_data = &apq8064_pm8921_platform_data,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700868 },
869};
870
871static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = {
872 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
873 .slave = {
Jay Chokshi44873f72011-08-30 17:24:26 -0700874 .name = "pm8821-core",
875 .platform_data = &apq8064_pm8821_platform_data,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700876 },
877};
878
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600879static struct slim_boardinfo apq8064_slim_devices[] = {
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800880 {
881 .bus_num = 1,
882 .slim_slave = &apq8064_slim_tabla,
883 },
884 /* add more slimbus slaves as needed */
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -0600885};
886
Kenneth Heitke748593a2011-07-15 15:45:11 -0600887static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
888 .clk_freq = 100000,
889 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600890};
891
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800892
893static struct gpiomux_setting audio_auxpcm[] = {
894 /* Suspended state */
895 {
896 .func = GPIOMUX_FUNC_GPIO,
897 .drv = GPIOMUX_DRV_2MA,
898 .pull = GPIOMUX_PULL_NONE,
899 },
900 /* Active state */
901 {
902 .func = GPIOMUX_FUNC_1,
903 .drv = GPIOMUX_DRV_2MA,
904 .pull = GPIOMUX_PULL_NONE,
905 },
906};
907static struct msm_gpiomux_config apq8064_audio_auxpcm_configs[] __initdata = {
908 {
909 .gpio = 43,
910 .settings = {
911 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
912 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
913 },
914 },
915 {
916 .gpio = 44,
917 .settings = {
918 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
919 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
920 },
921 },
922 {
923 .gpio = 45,
924 .settings = {
925 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
926 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
927 },
928 },
929 {
930 .gpio = 46,
931 .settings = {
932 [GPIOMUX_SUSPENDED] = &audio_auxpcm[0],
933 [GPIOMUX_ACTIVE] = &audio_auxpcm[1],
934 },
935 },
936};
937
Kenneth Heitke748593a2011-07-15 15:45:11 -0600938static void __init apq8064_i2c_init(void)
939{
940 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
941 &apq8064_i2c_qup_gsbi4_pdata;
942}
943
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700944static int __init gpiomux_init(void)
945{
946 int rc;
947
948 rc = msm_gpiomux_init(NR_GPIO_IRQS);
949 if (rc) {
950 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
951 return rc;
952 }
953 msm_gpiomux_install(apq8064_ethernet_configs,
954 ARRAY_SIZE(apq8064_ethernet_configs));
955
956 msm_gpiomux_install(apq8064_gsbi_configs,
957 ARRAY_SIZE(apq8064_gsbi_configs));
Swaminathan Sathappan2f51a752011-12-05 12:51:19 -0800958 msm_gpiomux_install(apq8064_audio_auxpcm_configs,
959 ARRAY_SIZE(apq8064_audio_auxpcm_configs));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700960 return 0;
961}
962
963#ifdef CONFIG_KS8851
964static int ethernet_init(void)
965{
966 int ret;
967 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
968 if (ret) {
969 pr_err("ks8851 gpio_request failed: %d\n", ret);
970 goto fail;
971 }
972
973 return 0;
974fail:
975 return ret;
976}
977#else
978static int ethernet_init(void)
979{
980 return 0;
981}
982#endif
983
Tianyi Gou41515e22011-09-01 19:37:43 -0700984static void __init apq8064_clock_init(void)
985{
986 if (machine_is_apq8064_sim())
987 msm_clock_init(&apq8064_clock_init_data);
988 else
989 msm_clock_init(&apq8064_dummy_clock_init_data);
990}
991
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992static void __init apq8064_common_init(void)
993{
994 if (socinfo_init() < 0)
995 pr_err("socinfo_init() failed!\n");
Tianyi Gou41515e22011-09-01 19:37:43 -0700996 apq8064_clock_init();
Joel King4ebccc62011-07-22 09:43:22 -0700997 gpiomux_init();
Kenneth Heitke748593a2011-07-15 15:45:11 -0600998 apq8064_i2c_init();
Kenneth Heitke36920d32011-07-20 16:44:30 -0600999
Harini Jayaramanc4c58692011-07-19 14:50:10 -06001000 apq8064_device_qup_spi_gsbi5.dev.platform_data =
1001 &apq8064_qup_spi_gsbi5_pdata;
Kenneth Heitke36920d32011-07-20 16:44:30 -06001002 apq8064_device_ssbi_pmic1.dev.platform_data =
Jay Chokshiea67c622011-07-29 17:12:26 -07001003 &apq8064_ssbi_pm8921_pdata;
Kenneth Heitke36920d32011-07-20 16:44:30 -06001004 apq8064_device_ssbi_pmic2.dev.platform_data =
1005 &apq8064_ssbi_pm8821_pdata;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -07001006 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
Jay Chokshibc3d98d2011-08-10 17:14:23 -07001007 apq8064_pm8921_platform_data.num_regulators =
Jay Chokshiea67c622011-07-29 17:12:26 -07001008 msm8064_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001009 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Sahitya Tummala3586ed92011-08-03 09:13:23 +05301010 apq8064_init_mmc();
Sagar Dharia8bdcdaf2011-09-16 16:01:15 -06001011 slim_register_board_info(apq8064_slim_devices,
1012 ARRAY_SIZE(apq8064_slim_devices));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001013}
1014
1015static void __init apq8064_sim_init(void)
1016{
Jeff Ohlstein7e668552011-10-06 16:17:25 -07001017 struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *)
1018 &msm8064_device_watchdog.dev.platform_data;
1019
1020 wdog_pdata->bark_time = 15000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001021 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -07001022 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
1023}
1024
1025static void __init apq8064_rumi3_init(void)
1026{
Jay Chokshi9c25f072011-09-23 18:19:15 -07001027 apq8064_pm8921_irq_pdata.devirq = 0;
1028 apq8064_pm8821_irq_pdata.devirq = 0;
Joel King4e7ad222011-08-17 15:47:38 -07001029 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001030 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -07001031 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -07001032 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001033}
1034
1035MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
1036 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001037 .reserve = apq8064_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001038 .init_irq = apq8064_init_irq,
1039 .timer = &msm_timer,
1040 .init_machine = apq8064_sim_init,
1041MACHINE_END
1042
Joel King4e7ad222011-08-17 15:47:38 -07001043MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
1044 .map_io = apq8064_map_io,
Kevin Chan13be4e22011-10-20 11:30:32 -07001045 .reserve = apq8064_reserve,
Joel King4e7ad222011-08-17 15:47:38 -07001046 .init_irq = apq8064_init_irq,
1047 .timer = &msm_timer,
1048 .init_machine = apq8064_rumi3_init,
1049MACHINE_END
1050