blob: 45fcd90cb6e886bc8b2b2c6db5384e1dc5ff4c7c [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>
Kenneth Heitke36920d32011-07-20 16:44:30 -060018#include <linux/msm_ssbi.h>
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -070019#include <linux/spi/spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <asm/hardware/gic.h>
Sahitya Tummala3586ed92011-08-03 09:13:23 +053023#include <asm/mach/mmc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070024
25#include <mach/board.h>
26#include <mach/msm_iomap.h>
27#include <linux/usb/msm_hsusb.h>
28#include <linux/usb/android.h>
29#include <mach/socinfo.h>
Harini Jayaramanc4c58692011-07-19 14:50:10 -060030#include <mach/msm_spi.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031#include "timer.h"
32#include "devices.h"
Joel King4ebccc62011-07-22 09:43:22 -070033#include <mach/gpio.h>
34#include <mach/gpiomux.h>
35
Jay Chokshiea67c622011-07-29 17:12:26 -070036#include "board-apq8064.h"
37
Sahitya Tummalab4d883f2011-08-23 10:44:51 +053038/* APQ8064 have 4 SDCC controllers */
39enum sdcc_controllers {
40 SDCC1,
41 SDCC2,
42 SDCC3,
43 SDCC4,
44 MAX_SDCC_CONTROLLER
45};
46
47/* All SDCC controllers requires VDD/VCC voltage */
48static struct msm_mmc_reg_data mmc_vdd_reg_data[MAX_SDCC_CONTROLLER] = {
49 /* SDCC1 : eMMC card connected */
50 [SDCC1] = {
51 .name = "sdc_vdd",
52 .set_voltage_sup = 1,
53 .high_vol_level = 2950000,
54 .low_vol_level = 2950000,
55 .always_on = 1,
56 .lpm_sup = 1,
57 .lpm_uA = 9000,
58 .hpm_uA = 200000, /* 200mA */
59 },
60 /* SDCC3 : External card slot connected */
61 [SDCC3] = {
62 .name = "sdc_vdd",
63 .set_voltage_sup = 1,
64 .high_vol_level = 2950000,
65 .low_vol_level = 2950000,
66 .hpm_uA = 600000, /* 600mA */
67 }
68};
69
70/* Only slots having eMMC card will require VCCQ voltage */
71static struct msm_mmc_reg_data mmc_vccq_reg_data[1] = {
72 /* SDCC1 : eMMC card connected */
73 [SDCC1] = {
74 .name = "sdc_vccq",
75 .set_voltage_sup = 1,
76 .always_on = 1,
77 .high_vol_level = 1800000,
78 .low_vol_level = 1800000,
79 .hpm_uA = 200000, /* 200mA */
80 }
81};
82
83/* All SDCC controllers may require voting for VDD PAD voltage */
84static struct msm_mmc_reg_data mmc_vddp_reg_data[MAX_SDCC_CONTROLLER] = {
85 /* SDCC3 : External card slot connected */
86 [SDCC3] = {
87 .name = "sdc_vddp",
88 .set_voltage_sup = 1,
89 .high_vol_level = 2950000,
90 .low_vol_level = 1850000,
91 .always_on = 1,
92 .lpm_sup = 1,
93 /* Max. Active current required is 16 mA */
94 .hpm_uA = 16000,
95 /*
96 * Sleep current required is ~300 uA. But min. vote can be
97 * in terms of mA (min. 1 mA). So let's vote for 2 mA
98 * during sleep.
99 */
100 .lpm_uA = 2000,
101 }
102};
103
104static struct msm_mmc_slot_reg_data mmc_slot_vreg_data[MAX_SDCC_CONTROLLER] = {
105 /* SDCC1 : eMMC card connected */
106 [SDCC1] = {
107 .vdd_data = &mmc_vdd_reg_data[SDCC1],
108 .vccq_data = &mmc_vccq_reg_data[SDCC1],
109 },
110 /* SDCC3 : External card slot connected */
111 [SDCC3] = {
112 .vdd_data = &mmc_vdd_reg_data[SDCC3],
113 .vddp_data = &mmc_vddp_reg_data[SDCC3],
114 }
115};
116
117/* SDC1 pad data */
118static struct msm_mmc_pad_drv sdc1_pad_drv_on_cfg[] = {
119 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_16MA},
120 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_10MA},
121 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_10MA}
122};
123
124static struct msm_mmc_pad_drv sdc1_pad_drv_off_cfg[] = {
125 {TLMM_HDRV_SDC1_CLK, GPIO_CFG_2MA},
126 {TLMM_HDRV_SDC1_CMD, GPIO_CFG_2MA},
127 {TLMM_HDRV_SDC1_DATA, GPIO_CFG_2MA}
128};
129
130static struct msm_mmc_pad_pull sdc1_pad_pull_on_cfg[] = {
131 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_UP},
132 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_UP}
133};
134
135static struct msm_mmc_pad_pull sdc1_pad_pull_off_cfg[] = {
136 {TLMM_PULL_SDC1_CMD, GPIO_CFG_PULL_DOWN},
137 {TLMM_PULL_SDC1_DATA, GPIO_CFG_PULL_DOWN}
138};
139
140/* SDC3 pad data */
141static struct msm_mmc_pad_drv sdc3_pad_drv_on_cfg[] = {
142 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_8MA},
143 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_8MA},
144 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_8MA}
145};
146
147static struct msm_mmc_pad_drv sdc3_pad_drv_off_cfg[] = {
148 {TLMM_HDRV_SDC3_CLK, GPIO_CFG_2MA},
149 {TLMM_HDRV_SDC3_CMD, GPIO_CFG_2MA},
150 {TLMM_HDRV_SDC3_DATA, GPIO_CFG_2MA}
151};
152
153static struct msm_mmc_pad_pull sdc3_pad_pull_on_cfg[] = {
154 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_UP},
155 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_UP}
156};
157
158static struct msm_mmc_pad_pull sdc3_pad_pull_off_cfg[] = {
159 {TLMM_PULL_SDC3_CMD, GPIO_CFG_PULL_DOWN},
160 {TLMM_PULL_SDC3_DATA, GPIO_CFG_PULL_DOWN}
161};
162
163static struct msm_mmc_pad_pull_data mmc_pad_pull_data[MAX_SDCC_CONTROLLER] = {
164 [SDCC1] = {
165 .on = sdc1_pad_pull_on_cfg,
166 .off = sdc1_pad_pull_off_cfg,
167 .size = ARRAY_SIZE(sdc1_pad_pull_on_cfg)
168 },
169 [SDCC3] = {
170 .on = sdc3_pad_pull_on_cfg,
171 .off = sdc3_pad_pull_off_cfg,
172 .size = ARRAY_SIZE(sdc3_pad_pull_on_cfg)
173 },
174};
175
176static struct msm_mmc_pad_drv_data mmc_pad_drv_data[MAX_SDCC_CONTROLLER] = {
177 [SDCC1] = {
178 .on = sdc1_pad_drv_on_cfg,
179 .off = sdc1_pad_drv_off_cfg,
180 .size = ARRAY_SIZE(sdc1_pad_drv_on_cfg)
181 },
182 [SDCC3] = {
183 .on = sdc3_pad_drv_on_cfg,
184 .off = sdc3_pad_drv_off_cfg,
185 .size = ARRAY_SIZE(sdc3_pad_drv_on_cfg)
186 },
187};
188
189static struct msm_mmc_pad_data mmc_pad_data[MAX_SDCC_CONTROLLER] = {
190 [SDCC1] = {
191 .pull = &mmc_pad_pull_data[SDCC1],
192 .drv = &mmc_pad_drv_data[SDCC1]
193 },
194 [SDCC3] = {
195 .pull = &mmc_pad_pull_data[SDCC3],
196 .drv = &mmc_pad_drv_data[SDCC3]
197 },
198};
199
200static struct msm_mmc_pin_data mmc_slot_pin_data[MAX_SDCC_CONTROLLER] = {
201 [SDCC1] = {
202 .pad_data = &mmc_pad_data[SDCC1],
203 },
204 [SDCC3] = {
205 .pad_data = &mmc_pad_data[SDCC3],
206 },
207};
208
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530209#ifdef CONFIG_MMC_MSM_SDC1_SUPPORT
210static unsigned int sdc1_sup_clk_rates[] = {
211 400000, 24000000, 48000000, 96000000
212};
213
214static struct mmc_platform_data sdc1_data = {
215 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
216 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
217 .sup_clk_table = sdc1_sup_clk_rates,
218 .sup_clk_cnt = ARRAY_SIZE(sdc1_sup_clk_rates),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530219 .pin_data = &mmc_slot_pin_data[SDCC1],
220 .vreg_data = &mmc_slot_vreg_data[SDCC1],
221 .sdcc_v4_sup = true,
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530222};
223static struct mmc_platform_data *apq8064_sdc1_pdata = &sdc1_data;
224#else
225static struct mmc_platform_data *apq8064_sdc1_pdata;
226#endif
227
228#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
229static unsigned int sdc3_sup_clk_rates[] = {
230 400000, 24000000, 48000000, 96000000
231};
232
233static struct mmc_platform_data sdc3_data = {
234 .ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
235 .mmc_bus_width = MMC_CAP_4_BIT_DATA,
236 .sup_clk_table = sdc3_sup_clk_rates,
237 .sup_clk_cnt = ARRAY_SIZE(sdc3_sup_clk_rates),
Sahitya Tummalab4d883f2011-08-23 10:44:51 +0530238 .pin_data = &mmc_slot_pin_data[SDCC3],
239 .vreg_data = &mmc_slot_vreg_data[SDCC3],
240 .sdcc_v4_sup = true,
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530241};
242static struct mmc_platform_data *apq8064_sdc3_pdata = &sdc3_data;
243#else
244static struct mmc_platform_data *apq8064_sdc3_pdata;
245#endif
246
247static void __init apq8064_init_mmc(void)
248{
Amol Jadi7d4ce032011-09-09 17:07:18 -0700249 if ((machine_is_apq8064_rumi3()) || machine_is_apq8064_sim()) {
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530250 if (apq8064_sdc1_pdata) {
Sahitya Tummalad9df3272011-08-19 16:50:46 +0530251 apq8064_sdc1_pdata->disable_bam = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530252 apq8064_sdc1_pdata->disable_runtime_pm = true;
253 }
254 if (apq8064_sdc3_pdata) {
Sahitya Tummalad9df3272011-08-19 16:50:46 +0530255 apq8064_sdc3_pdata->disable_bam = true;
Sahitya Tummalab07e1ae2011-09-02 11:58:42 +0530256 apq8064_sdc3_pdata->disable_runtime_pm = true;
257 }
Sahitya Tummalad9df3272011-08-19 16:50:46 +0530258 }
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530259 apq8064_add_sdcc(1, apq8064_sdc1_pdata);
260 apq8064_add_sdcc(3, apq8064_sdc3_pdata);
261}
262
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263static void __init apq8064_map_io(void)
264{
265 msm_map_apq8064_io();
266}
267
268static void __init apq8064_init_irq(void)
269{
270 unsigned int i;
271 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
272 (void *)MSM_QGIC_CPU_BASE);
273
274 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
275 writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
276
277 writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
278 mb();
279
280 /*
281 * FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet
282 * as they are configured as level, which does not play nice with
283 * handle_percpu_irq.
284 */
285 for (i = GIC_PPI_START; i < GIC_SPI_START; i++) {
286 if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE)
287 irq_set_handler(i, handle_percpu_irq);
288 }
289}
290
291static struct platform_device *common_devices[] __initdata = {
Kenneth Heitke748593a2011-07-15 15:45:11 -0600292 &apq8064_device_qup_i2c_gsbi4,
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600293 &apq8064_device_qup_spi_gsbi5,
294};
295
Joel King4e7ad222011-08-17 15:47:38 -0700296static struct platform_device *sim_devices[] __initdata = {
297 &apq8064_device_dmov,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700298 &apq8064_device_uart_gsbi3,
Stepan Moskovchenko250557b2011-09-01 12:26:50 -0700299 &apq8064_device_ssbi_pmic1,
300 &apq8064_device_ssbi_pmic2,
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700301};
302
303static struct platform_device *rumi3_devices[] __initdata = {
304 &apq8064_device_uart_gsbi1,
Joel King4e7ad222011-08-17 15:47:38 -0700305};
306
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600307static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = {
308 .max_clock_speed = 26000000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700309};
310
311static struct msm_otg_platform_data msm_otg_pdata = {
312 .mode = USB_PERIPHERAL,
313 .otg_control = OTG_PHY_CONTROL,
314 .phy_type = SNPS_28NM_INTEGRATED_PHY,
315 .pclk_src_name = "dfab_usb_hs_clk",
316};
317
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700318#define KS8851_IRQ_GPIO 43
319
320static struct spi_board_info spi_board_info[] __initdata = {
321 {
322 .modalias = "ks8851",
323 .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO),
324 .max_speed_hz = 19200000,
325 .bus_num = 0,
326 .chip_select = 2,
327 .mode = SPI_MODE_0,
328 },
329};
330
331#ifdef CONFIG_KS8851
332static struct gpiomux_setting gpio_eth_config = {
333 .pull = GPIOMUX_PULL_NONE,
334 .drv = GPIOMUX_DRV_8MA,
335 .func = GPIOMUX_FUNC_GPIO,
336};
337
338/* The SPI configurations apply to GSBI 5*/
339static struct gpiomux_setting gpio_spi_config = {
340 .func = GPIOMUX_FUNC_2,
341 .drv = GPIOMUX_DRV_8MA,
342 .pull = GPIOMUX_PULL_NONE,
343};
344
345/* The SPI configurations apply to GSBI 5 chip select 2*/
346static struct gpiomux_setting gpio_spi_cs2_config = {
347 .func = GPIOMUX_FUNC_3,
348 .drv = GPIOMUX_DRV_8MA,
349 .pull = GPIOMUX_PULL_NONE,
350};
351#endif
352
353struct msm_gpiomux_config apq8064_ethernet_configs[NR_GPIO_IRQS] = {
354#ifdef CONFIG_KS8851
355 {
356 .gpio = KS8851_IRQ_GPIO,
357 .settings = {
358 [GPIOMUX_SUSPENDED] = &gpio_eth_config,
359 [GPIOMUX_ACTIVE] = &gpio_eth_config,
360 }
361 },
362#endif
363};
364
365static struct msm_gpiomux_config apq8064_gsbi_configs[] __initdata = {
366#ifdef CONFIG_KS8851
367 {
368 .gpio = 51, /* GSBI5 QUP SPI_DATA_MOSI */
369 .settings = {
370 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
371 },
372 },
373 {
374 .gpio = 52, /* GSBI5 QUP SPI_DATA_MISO */
375 .settings = {
376 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
377 },
378 },
379 {
380 .gpio = 31, /* GSBI5 QUP SPI_CS2_N */
381 .settings = {
382 [GPIOMUX_SUSPENDED] = &gpio_spi_cs2_config,
383 },
384 },
385 {
386 .gpio = 54, /* GSBI5 QUP SPI_CLK */
387 .settings = {
388 [GPIOMUX_SUSPENDED] = &gpio_spi_config,
389 },
390 },
391#endif
392};
393
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700394static struct pm8xxx_mpp_platform_data
395apq8064_pm8921_mpp_pdata __devinitdata = {
396 .mpp_base = PM8921_MPP_PM_TO_SYS(1),
397};
398
399static struct pm8xxx_gpio_platform_data
400apq8064_pm8921_gpio_pdata __devinitdata = {
401 .gpio_base = PM8921_GPIO_PM_TO_SYS(1),
402};
403
404static struct pm8xxx_irq_platform_data
405apq8064_pm8921_irq_pdata __devinitdata = {
406 .irq_base = PM8921_IRQ_BASE,
Jay Chokshi44873f72011-08-30 17:24:26 -0700407 .devirq = PM8921_USR_IRQ_N,
408 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700409};
410
411static struct pm8921_platform_data
412apq8064_pm8921_platform_data __devinitdata = {
Jay Chokshiea67c622011-07-29 17:12:26 -0700413 .regulator_pdatas = msm8064_pm8921_regulator_pdata,
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700414 .irq_pdata = &apq8064_pm8921_irq_pdata,
415 .gpio_pdata = &apq8064_pm8921_gpio_pdata,
416 .mpp_pdata = &apq8064_pm8921_mpp_pdata,
Jay Chokshiea67c622011-07-29 17:12:26 -0700417};
418
Jay Chokshi44873f72011-08-30 17:24:26 -0700419static struct pm8xxx_irq_platform_data
420apq8064_pm8821_irq_pdata __devinitdata = {
421 .irq_base = PM8821_IRQ_BASE,
422 .devirq = PM8821_USR_IRQ_N,
423 .irq_trigger_flag = IRQF_TRIGGER_HIGH,
424};
425
426static struct pm8xxx_mpp_platform_data
427apq8064_pm8821_mpp_pdata __devinitdata = {
428 .mpp_base = PM8821_MPP_PM_TO_SYS(1),
429};
430
431static struct pm8821_platform_data
432apq8064_pm8821_platform_data __devinitdata = {
433 .irq_pdata = &apq8064_pm8821_irq_pdata,
434 .mpp_pdata = &apq8064_pm8821_mpp_pdata,
435};
436
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700437static struct msm_ssbi_platform_data apq8064_ssbi_pm8921_pdata __devinitdata = {
438 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
439 .slave = {
Jay Chokshiea67c622011-07-29 17:12:26 -0700440 .name = "pm8921-core",
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700441 .platform_data = &apq8064_pm8921_platform_data,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700442 },
443};
444
445static struct msm_ssbi_platform_data apq8064_ssbi_pm8821_pdata __devinitdata = {
446 .controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
447 .slave = {
Jay Chokshi44873f72011-08-30 17:24:26 -0700448 .name = "pm8821-core",
449 .platform_data = &apq8064_pm8821_platform_data,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700450 },
451};
452
Kenneth Heitke748593a2011-07-15 15:45:11 -0600453static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = {
454 .clk_freq = 100000,
455 .src_clk_rate = 24000000,
Kenneth Heitke748593a2011-07-15 15:45:11 -0600456};
457
458static void __init apq8064_i2c_init(void)
459{
460 apq8064_device_qup_i2c_gsbi4.dev.platform_data =
461 &apq8064_i2c_qup_gsbi4_pdata;
462}
463
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700464static int __init gpiomux_init(void)
465{
466 int rc;
467
468 rc = msm_gpiomux_init(NR_GPIO_IRQS);
469 if (rc) {
470 pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
471 return rc;
472 }
473 msm_gpiomux_install(apq8064_ethernet_configs,
474 ARRAY_SIZE(apq8064_ethernet_configs));
475
476 msm_gpiomux_install(apq8064_gsbi_configs,
477 ARRAY_SIZE(apq8064_gsbi_configs));
478 return 0;
479}
480
481#ifdef CONFIG_KS8851
482static int ethernet_init(void)
483{
484 int ret;
485 ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq");
486 if (ret) {
487 pr_err("ks8851 gpio_request failed: %d\n", ret);
488 goto fail;
489 }
490
491 return 0;
492fail:
493 return ret;
494}
495#else
496static int ethernet_init(void)
497{
498 return 0;
499}
500#endif
501
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700502static void __init apq8064_common_init(void)
503{
504 if (socinfo_init() < 0)
505 pr_err("socinfo_init() failed!\n");
Stephen Boydbb600ae2011-08-02 20:11:40 -0700506 msm_clock_init(&apq8064_dummy_clock_init_data);
Joel King4ebccc62011-07-22 09:43:22 -0700507 gpiomux_init();
Kenneth Heitke748593a2011-07-15 15:45:11 -0600508 apq8064_i2c_init();
Kenneth Heitke36920d32011-07-20 16:44:30 -0600509
Harini Jayaramanc4c58692011-07-19 14:50:10 -0600510 apq8064_device_qup_spi_gsbi5.dev.platform_data =
511 &apq8064_qup_spi_gsbi5_pdata;
Kenneth Heitke36920d32011-07-20 16:44:30 -0600512 apq8064_device_ssbi_pmic1.dev.platform_data =
Jay Chokshiea67c622011-07-29 17:12:26 -0700513 &apq8064_ssbi_pm8921_pdata;
Kenneth Heitke36920d32011-07-20 16:44:30 -0600514 apq8064_device_ssbi_pmic2.dev.platform_data =
515 &apq8064_ssbi_pm8821_pdata;
Stepan Moskovchenko14aa6492011-08-08 15:15:01 -0700516 apq8064_device_otg.dev.platform_data = &msm_otg_pdata;
517 apq8064_device_gadget_peripheral.dev.parent = &apq8064_device_otg.dev;
Jay Chokshibc3d98d2011-08-10 17:14:23 -0700518 apq8064_pm8921_platform_data.num_regulators =
Jay Chokshiea67c622011-07-29 17:12:26 -0700519 msm8064_pm8921_regulator_pdata_len;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700520 platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
Sahitya Tummala3586ed92011-08-03 09:13:23 +0530521 apq8064_init_mmc();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700522}
523
524static void __init apq8064_sim_init(void)
525{
526 apq8064_common_init();
Joel King4e7ad222011-08-17 15:47:38 -0700527 platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
528}
529
530static void __init apq8064_rumi3_init(void)
531{
532 apq8064_common_init();
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700533 ethernet_init();
Stepan Moskovchenko2701a442011-08-19 13:47:22 -0700534 platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
Stepan Moskovchenkoeed82a52011-09-02 13:19:23 -0700535 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700536}
537
538MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR")
539 .map_io = apq8064_map_io,
540 .init_irq = apq8064_init_irq,
541 .timer = &msm_timer,
542 .init_machine = apq8064_sim_init,
543MACHINE_END
544
Joel King4e7ad222011-08-17 15:47:38 -0700545MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3")
546 .map_io = apq8064_map_io,
547 .init_irq = apq8064_init_irq,
548 .timer = &msm_timer,
549 .init_machine = apq8064_rumi3_init,
550MACHINE_END
551