blob: e00f150816c26c7056506ab91dfd9dfeac5de7e3 [file] [log] [blame]
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +05301/* 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#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/gpio_event.h>
Taniya Das2b16d1d2011-12-02 14:44:19 +053015#include <linux/memblock.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070016#include <asm/mach-types.h>
Murali Nalajala41786ab2012-03-06 10:47:32 +053017#include <linux/memblock.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070018#include <asm/mach/arch.h>
Taniya Das43bcdd62011-12-02 17:33:27 +053019#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070020#include <mach/board.h>
21#include <mach/msm_iomap.h>
22#include <mach/msm_hsusb.h>
23#include <mach/rpc_hsusb.h>
24#include <mach/rpc_pmapp.h>
25#include <mach/usbdiag.h>
26#include <mach/msm_memtypes.h>
27#include <mach/msm_serial_hs.h>
28#include <linux/usb/android.h>
29#include <linux/platform_device.h>
30#include <linux/io.h>
31#include <linux/gpio.h>
32#include <mach/vreg.h>
33#include <mach/pmic.h>
34#include <mach/socinfo.h>
35#include <linux/mtd/nand.h>
36#include <linux/mtd/partitions.h>
37#include <asm/mach/mmc.h>
38#include <linux/i2c.h>
39#include <linux/i2c/sx150x.h>
40#include <linux/gpio.h>
41#include <linux/android_pmem.h>
42#include <linux/bootmem.h>
43#include <linux/mfd/marimba.h>
44#include <mach/vreg.h>
45#include <linux/power_supply.h>
Justin Paupored98328e2011-08-19 13:48:31 -070046#include <linux/regulator/consumer.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047#include <mach/rpc_pmapp.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070048#include <mach/msm_battery.h>
49#include <linux/smsc911x.h>
50#include <linux/atmel_maxtouch.h>
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -070051#include <linux/msm_adc.h>
Chintan Pandya43d0a342012-06-08 19:45:56 +053052#include <linux/ion.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053#include "devices.h"
54#include "timer.h"
Justin Pauporeb3a33b72011-08-23 15:30:32 -070055#include "board-msm7x27a-regulator.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#include "devices-msm7x2xa.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080057#include "pm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070058#include <mach/rpc_server_handset.h>
59#include <mach/socinfo.h>
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060060#include "pm-boot.h"
Chintan Pandyacf467fc2011-12-01 17:11:11 +053061#include "board-msm7627a.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070062
Trilok Sonib9410792012-04-07 15:37:13 +053063#define PMEM_KERNEL_EBI1_SIZE 0x3A000
Sidipotu Ashok554881c2012-04-12 11:42:02 +053064#define MSM_PMEM_AUDIO_SIZE 0x1F4000
Trilok Sonib9410792012-04-07 15:37:13 +053065
Manish Dewangan1c0fa492012-08-22 10:33:11 +053066#define SNDDEV_CAP_NONE 0x0
67#define SNDDEV_CAP_RX 0x1 /* RX direction */
68#define SNDDEV_CAP_TX 0x2 /* TX direction */
69#define SNDDEV_CAP_VOICE 0x4 /* Support voice call */
70#define SNDDEV_CAP_FM 0x10 /* Support FM radio */
71#define SNDDEV_CAP_TTY 0x20 /* Support TTY */
72
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073#if defined(CONFIG_GPIO_SX150X)
74enum {
75 SX150X_CORE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070076};
77
78static struct sx150x_platform_data sx150x_data[] __initdata = {
79 [SX150X_CORE] = {
80 .gpio_base = GPIO_CORE_EXPANDER_BASE,
81 .oscio_is_gpo = false,
82 .io_pullup_ena = 0,
pankaj kumarc5c01392011-08-12 13:44:05 +053083 .io_pulldn_ena = 0x02,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070084 .io_open_drain_ena = 0xfef8,
85 .irq_summary = -1,
86 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070087};
88#endif
89
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090
Steve Mucklef132c6c2012-06-06 18:30:57 -070091#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
Santosh Sajjan6822c682011-07-26 10:49:36 +053092static struct platform_device msm_wlan_ar6000_pm_device = {
93 .name = "wlan_ar6000_pm_dev",
94 .id = -1,
95};
Steve Mucklef132c6c2012-06-06 18:30:57 -070096#endif
Santosh Sajjan6822c682011-07-26 10:49:36 +053097
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070098#if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X)
99static struct i2c_board_info core_exp_i2c_info[] __initdata = {
100 {
101 I2C_BOARD_INFO("sx1509q", 0x3e),
102 },
103};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700104
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700105static void __init register_i2c_devices(void)
106{
Taniya Dase3027e22012-02-27 16:32:27 +0530107 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
108 machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700109 sx150x_data[SX150X_CORE].io_open_drain_ena = 0xe0f0;
110
111 core_exp_i2c_info[0].platform_data =
112 &sx150x_data[SX150X_CORE];
113
114 i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
115 core_exp_i2c_info,
116 ARRAY_SIZE(core_exp_i2c_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700117}
118#endif
119
120static struct msm_gpio qup_i2c_gpios_io[] = {
121 { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
122 "qup_scl" },
123 { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
124 "qup_sda" },
125 { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
126 "qup_scl" },
127 { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
128 "qup_sda" },
129};
130
131static struct msm_gpio qup_i2c_gpios_hw[] = {
132 { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
133 "qup_scl" },
134 { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
135 "qup_sda" },
136 { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
137 "qup_scl" },
138 { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
139 "qup_sda" },
140};
141
142static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
143{
144 int rc;
145
146 if (adap_id < 0 || adap_id > 1)
147 return;
148
149 /* Each adapter gets 2 lines from the table */
150 if (config_type)
151 rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2);
152 else
153 rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2);
154 if (rc < 0)
155 pr_err("QUP GPIO request/enable failed: %d\n", rc);
156}
157
158static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = {
159 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700160 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
161};
162
163static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = {
164 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
166};
167
Trilok Sonib9410792012-04-07 15:37:13 +0530168#ifdef CONFIG_ARCH_MSM7X27A
Sravan Kumar D.V.N2655b112012-08-02 19:08:30 +0530169#define MSM_PMEM_MDP_SIZE 0x1B00000
Trilok Sonib9410792012-04-07 15:37:13 +0530170#define MSM7x25A_MSM_PMEM_MDP_SIZE 0x1500000
171
Rajeshwar Kurapaty20d7ad12012-06-22 16:11:06 +0530172#define MSM_PMEM_ADSP_SIZE 0x1200000
Trilok Sonib9410792012-04-07 15:37:13 +0530173#define MSM7x25A_MSM_PMEM_ADSP_SIZE 0xB91000
174
175#endif
176
Chintan Pandya43d0a342012-06-08 19:45:56 +0530177#ifdef CONFIG_ION_MSM
178#define MSM_ION_HEAP_NUM 4
179static struct platform_device ion_dev;
180static int msm_ion_camera_size;
181static int msm_ion_audio_size;
182static int msm_ion_sf_size;
183#endif
184
185
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700186static struct android_usb_platform_data android_usb_pdata = {
187 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
188};
189
190static struct platform_device android_usb_device = {
191 .name = "android_usb",
192 .id = -1,
193 .dev = {
194 .platform_data = &android_usb_pdata,
195 },
196};
197
198#ifdef CONFIG_USB_EHCI_MSM_72K
199static void msm_hsusb_vbus_power(unsigned phy_info, int on)
200{
201 int rc = 0;
202 unsigned gpio;
203
204 gpio = GPIO_HOST_VBUS_EN;
205
206 rc = gpio_request(gpio, "i2c_host_vbus_en");
207 if (rc < 0) {
208 pr_err("failed to request %d GPIO\n", gpio);
209 return;
210 }
211 gpio_direction_output(gpio, !!on);
212 gpio_set_value_cansleep(gpio, !!on);
213 gpio_free(gpio);
214}
215
216static struct msm_usb_host_platform_data msm_usb_host_pdata = {
217 .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM),
218};
219
220static void __init msm7x2x_init_host(void)
221{
222 msm_add_host(0, &msm_usb_host_pdata);
223}
224#endif
225
226#ifdef CONFIG_USB_MSM_OTG_72K
227static int hsusb_rpc_connect(int connect)
228{
229 if (connect)
230 return msm_hsusb_rpc_connect();
231 else
232 return msm_hsusb_rpc_close();
233}
234
Justin Paupored98328e2011-08-19 13:48:31 -0700235static struct regulator *reg_hsusb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700236static int msm_hsusb_ldo_init(int init)
237{
Justin Paupored98328e2011-08-19 13:48:31 -0700238 int rc = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700239
Justin Paupored98328e2011-08-19 13:48:31 -0700240 if (init) {
241 reg_hsusb = regulator_get(NULL, "usb");
242 if (IS_ERR(reg_hsusb)) {
243 rc = PTR_ERR(reg_hsusb);
244 pr_err("%s: could not get regulator: %d\n",
245 __func__, rc);
246 goto out;
247 }
248
249 rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000);
250 if (rc) {
251 pr_err("%s: could not set voltage: %d\n",
252 __func__, rc);
253 goto reg_free;
254 }
255
256 return 0;
257 }
258 /* else fall through */
259reg_free:
260 regulator_put(reg_hsusb);
261out:
262 reg_hsusb = NULL;
263 return rc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700264}
265
266static int msm_hsusb_ldo_enable(int enable)
267{
268 static int ldo_status;
269
Justin Paupored98328e2011-08-19 13:48:31 -0700270 if (IS_ERR_OR_NULL(reg_hsusb))
271 return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700272
273 if (ldo_status == enable)
274 return 0;
275
276 ldo_status = enable;
277
Justin Paupored98328e2011-08-19 13:48:31 -0700278 return enable ?
279 regulator_enable(reg_hsusb) :
280 regulator_disable(reg_hsusb);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700281}
282
283#ifndef CONFIG_USB_EHCI_MSM_72K
284static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init)
285{
286 int ret = 0;
287
288 if (init)
289 ret = msm_pm_app_rpc_init(callback);
290 else
291 msm_pm_app_rpc_deinit(callback);
292
293 return ret;
294}
295#endif
296
297static struct msm_otg_platform_data msm_otg_pdata = {
298#ifndef CONFIG_USB_EHCI_MSM_72K
299 .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init,
300#else
301 .vbus_power = msm_hsusb_vbus_power,
302#endif
303 .rpc_connect = hsusb_rpc_connect,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700304 .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT,
305 .cdr_autoreset = CDR_AUTO_RESET_DISABLE,
306 .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT,
307 .se1_gating = SE1_GATING_DISABLE,
308 .ldo_init = msm_hsusb_ldo_init,
309 .ldo_enable = msm_hsusb_ldo_enable,
310 .chg_init = hsusb_chg_init,
311 .chg_connected = hsusb_chg_connected,
312 .chg_vbus_draw = hsusb_chg_vbus_draw,
313};
314#endif
315
316static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = {
317 .is_phy_status_timer_on = 1,
318};
319
320static struct resource smc91x_resources[] = {
321 [0] = {
322 .start = 0x90000300,
323 .end = 0x900003ff,
324 .flags = IORESOURCE_MEM,
325 },
326 [1] = {
327 .start = MSM_GPIO_TO_INT(4),
328 .end = MSM_GPIO_TO_INT(4),
329 .flags = IORESOURCE_IRQ,
330 },
331};
332
333static struct platform_device smc91x_device = {
334 .name = "smc91x",
335 .id = 0,
336 .num_resources = ARRAY_SIZE(smc91x_resources),
337 .resource = smc91x_resources,
338};
339
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700340#ifdef CONFIG_SERIAL_MSM_HS
341static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = {
342 .inject_rx_on_wakeup = 1,
343 .rx_to_inject = 0xFD,
344};
345#endif
346static struct msm_pm_platform_data msm7x27a_pm_data[MSM_PM_SLEEP_MODE_NR] = {
Murali Nalajalab10363d2012-01-12 16:29:01 +0530347 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700348 .idle_supported = 1,
349 .suspend_supported = 1,
350 .idle_enabled = 1,
351 .suspend_enabled = 1,
352 .latency = 16000,
353 .residency = 20000,
354 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530355 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700356 .idle_supported = 1,
357 .suspend_supported = 1,
358 .idle_enabled = 1,
359 .suspend_enabled = 1,
360 .latency = 12000,
361 .residency = 20000,
362 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530363 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700364 .idle_supported = 1,
365 .suspend_supported = 1,
366 .idle_enabled = 0,
367 .suspend_enabled = 1,
368 .latency = 2000,
369 .residency = 0,
370 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530371 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700372 .idle_supported = 1,
373 .suspend_supported = 1,
374 .idle_enabled = 1,
375 .suspend_enabled = 1,
376 .latency = 2,
377 .residency = 0,
378 },
379};
380
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600381static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +0530382 .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS,
383 .p_addr = 0,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600384};
385
Murali Nalajalad1f67b02012-02-10 00:23:49 +0530386/* 8625 PM platform data */
387static struct msm_pm_platform_data msm8625_pm_data[MSM_PM_SLEEP_MODE_NR * 2] = {
388 /* CORE0 entries */
389 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
390 .idle_supported = 1,
391 .suspend_supported = 1,
392 .idle_enabled = 0,
393 .suspend_enabled = 0,
394 .latency = 16000,
395 .residency = 20000,
396 },
397
398 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = {
399 .idle_supported = 1,
400 .suspend_supported = 1,
401 .idle_enabled = 0,
402 .suspend_enabled = 0,
403 .latency = 12000,
404 .residency = 20000,
405 },
406
407 /* picked latency & redisdency values from 7x30 */
408 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
409 .idle_supported = 1,
410 .suspend_supported = 1,
411 .idle_enabled = 0,
412 .suspend_enabled = 0,
413 .latency = 500,
414 .residency = 6000,
415 },
416
417 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
418 .idle_supported = 1,
419 .suspend_supported = 1,
420 .idle_enabled = 1,
421 .suspend_enabled = 1,
422 .latency = 2,
423 .residency = 10,
424 },
425
426 /* picked latency & redisdency values from 7x30 */
427 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = {
428 .idle_supported = 1,
429 .suspend_supported = 1,
430 .idle_enabled = 0,
431 .suspend_enabled = 0,
432 .latency = 500,
433 .residency = 6000,
434 },
435
436 [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
437 .idle_supported = 1,
438 .suspend_supported = 1,
439 .idle_enabled = 1,
440 .suspend_enabled = 1,
441 .latency = 2,
442 .residency = 10,
443 },
444
445};
446
Murali Nalajala41786ab2012-03-06 10:47:32 +0530447static struct msm_pm_boot_platform_data msm_pm_8625_boot_pdata __initdata = {
448 .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR,
449 .v_addr = MSM_CFG_CTL_BASE,
450};
451
Trilok Sonib9410792012-04-07 15:37:13 +0530452static struct android_pmem_platform_data android_pmem_adsp_pdata = {
453 .name = "pmem_adsp",
454 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
455 .cached = 1,
456 .memory_type = MEMTYPE_EBI1,
Trilok Sonib9410792012-04-07 15:37:13 +0530457};
458
459static struct platform_device android_pmem_adsp_device = {
460 .name = "android_pmem",
461 .id = 1,
462 .dev = { .platform_data = &android_pmem_adsp_pdata },
463};
464
465static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE;
466static int __init pmem_mdp_size_setup(char *p)
467{
468 pmem_mdp_size = memparse(p, NULL);
469 return 0;
470}
471
472early_param("pmem_mdp_size", pmem_mdp_size_setup);
473
474static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
475static int __init pmem_adsp_size_setup(char *p)
476{
477 pmem_adsp_size = memparse(p, NULL);
478 return 0;
479}
480
481early_param("pmem_adsp_size", pmem_adsp_size_setup);
482
483#define SND(desc, num) { .name = #desc, .id = num }
484static struct snd_endpoint snd_endpoints_list[] = {
485 SND(HANDSET, 0),
486 SND(MONO_HEADSET, 2),
487 SND(HEADSET, 3),
488 SND(SPEAKER, 6),
489 SND(TTY_HEADSET, 8),
490 SND(TTY_VCO, 9),
491 SND(TTY_HCO, 10),
492 SND(BT, 12),
493 SND(IN_S_SADC_OUT_HANDSET, 16),
494 SND(IN_S_SADC_OUT_SPEAKER_PHONE, 25),
495 SND(FM_DIGITAL_STEREO_HEADSET, 26),
496 SND(FM_DIGITAL_SPEAKER_PHONE, 27),
497 SND(FM_DIGITAL_BT_A2DP_HEADSET, 28),
498 SND(STEREO_HEADSET_AND_SPEAKER, 31),
499 SND(CURRENT, 0x7FFFFFFE),
500 SND(FM_ANALOG_STEREO_HEADSET, 35),
501 SND(FM_ANALOG_STEREO_HEADSET_CODEC, 36),
502};
503#undef SND
Trilok Sonib9410792012-04-07 15:37:13 +0530504static struct msm_snd_endpoints msm_device_snd_endpoints = {
505 .endpoints = snd_endpoints_list,
506 .num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint)
507};
508
509static struct platform_device msm_device_snd = {
510 .name = "msm_snd",
511 .id = -1,
512 .dev = {
513 .platform_data = &msm_device_snd_endpoints
514 },
515};
516
Manish Dewangan1c0fa492012-08-22 10:33:11 +0530517#define CAD(desc, num, cap) { .name = #desc, .id = num, .capability = cap, }
518static struct cad_endpoint cad_endpoints_list[] = {
519 CAD(NONE, 0, SNDDEV_CAP_NONE),
520 CAD(HANDSET_SPKR, 1, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
521 CAD(HANDSET_MIC, 2, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
522 CAD(HEADSET_MIC, 3, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
523 CAD(HEADSET_SPKR_MONO, 4, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
524 CAD(HEADSET_SPKR_STEREO, 5, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
525 CAD(SPEAKER_PHONE_MIC, 6, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
526 CAD(SPEAKER_PHONE_MONO, 7, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
527 CAD(SPEAKER_PHONE_STEREO, 8, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
528 CAD(BT_SCO_MIC, 9, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
529 CAD(BT_SCO_SPKR, 10, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
530 CAD(BT_A2DP_SPKR, 11, (SNDDEV_CAP_RX | SNDDEV_CAP_VOICE)),
531 CAD(TTY_HEADSET_MIC, 12, (SNDDEV_CAP_TX | \
532 SNDDEV_CAP_VOICE | SNDDEV_CAP_TTY)),
533 CAD(TTY_HEADSET_SPKR, 13, (SNDDEV_CAP_RX | \
534 SNDDEV_CAP_VOICE | SNDDEV_CAP_TTY)),
535 CAD(HEADSET_STEREO_PLUS_SPKR_MONO_RX, 19, (SNDDEV_CAP_TX | \
536 SNDDEV_CAP_VOICE)),
537 CAD(LP_FM_HEADSET_SPKR_STEREO_RX, 25, (SNDDEV_CAP_TX | SNDDEV_CAP_FM)),
538 CAD(I2S_RX, 26, (SNDDEV_CAP_RX)),
539 CAD(SPEAKER_PHONE_MIC_ENDFIRE, 45, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
540 CAD(HANDSET_MIC_ENDFIRE, 46, (SNDDEV_CAP_TX | SNDDEV_CAP_VOICE)),
541 CAD(I2S_TX, 48, (SNDDEV_CAP_TX)),
542 CAD(LP_FM_HEADSET_SPKR_STEREO_PLUS_HEADSET_SPKR_STEREO_RX, 57, \
543 (SNDDEV_CAP_FM | SNDDEV_CAP_RX)),
544 CAD(FM_DIGITAL_HEADSET_SPKR_STEREO, 65, \
545 (SNDDEV_CAP_FM | SNDDEV_CAP_RX)),
546 CAD(FM_DIGITAL_SPEAKER_PHONE_MONO, 67, \
547 (SNDDEV_CAP_FM | SNDDEV_CAP_RX)),
548 CAD(FM_DIGITAL_BT_A2DP_SPKR, 69, \
549 (SNDDEV_CAP_FM | SNDDEV_CAP_RX)),
550 CAD(MAX, 80, SNDDEV_CAP_NONE),
551};
552#undef CAD
553static struct msm_cad_endpoints msm_device_cad_endpoints = {
554 .endpoints = cad_endpoints_list,
555 .num = sizeof(cad_endpoints_list) / sizeof(struct cad_endpoint)
556};
557
558static struct platform_device msm_device_cad = {
559 .name = "msm_cad",
560 .id = -1,
561 .dev = {
562 .platform_data = &msm_device_cad_endpoints
563 },
564};
565
Trilok Sonib9410792012-04-07 15:37:13 +0530566#define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
567 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
568 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
569 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
570 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
Chaithanya Krishna Bacharaju8e838cc2012-08-16 11:32:46 +0530571 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))| \
572 (1<<MSM_ADSP_CODEC_AC3)
Trilok Sonib9410792012-04-07 15:37:13 +0530573#define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
574 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
575 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
576 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
577 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
578 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
579#define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
580 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
581 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
582 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
583 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
584 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
585#define DEC3_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
586 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
587 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
588 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
589 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
590 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
591#define DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI)
592
593static unsigned int dec_concurrency_table[] = {
594 /* Audio LP */
595 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DMA)), 0,
596 0, 0, 0,
597
598 /* Concurrency 1 */
599 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
600 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
601 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
602 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
603 (DEC4_FORMAT),
604
605 /* Concurrency 2 */
606 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
607 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
608 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
609 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
610 (DEC4_FORMAT),
611
612 /* Concurrency 3 */
613 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
614 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
615 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
616 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
617 (DEC4_FORMAT),
618
619 /* Concurrency 4 */
620 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
621 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
622 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
623 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
624 (DEC4_FORMAT),
625
626 /* Concurrency 5 */
627 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
628 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
629 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
630 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
631 (DEC4_FORMAT),
632
633 /* Concurrency 6 */
Chaithanya Krishna Bacharaju72ab89b2012-05-11 14:24:04 +0530634 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|
635 (1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
636 0, 0, 0, 0,
Trilok Sonib9410792012-04-07 15:37:13 +0530637
638 /* Concurrency 7 */
639 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
640 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
641 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
642 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
643 (DEC4_FORMAT),
644};
645
646#define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \
647 .module_queueid = queueid, .module_decid = decid, \
648 .nr_codec_support = nr_codec}
649
650static struct msm_adspdec_info dec_info_list[] = {
651 DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* AudPlay0BitStreamCtrlQueue */
652 DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* AudPlay1BitStreamCtrlQueue */
653 DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* AudPlay2BitStreamCtrlQueue */
654 DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* AudPlay3BitStreamCtrlQueue */
655 DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* AudPlay4BitStreamCtrlQueue */
656};
657
658static struct msm_adspdec_database msm_device_adspdec_database = {
659 .num_dec = ARRAY_SIZE(dec_info_list),
660 .num_concurrency_support = (ARRAY_SIZE(dec_concurrency_table) / \
661 ARRAY_SIZE(dec_info_list)),
662 .dec_concurrency_table = dec_concurrency_table,
663 .dec_info_list = dec_info_list,
664};
665
666static struct platform_device msm_device_adspdec = {
667 .name = "msm_adspdec",
668 .id = -1,
669 .dev = {
670 .platform_data = &msm_device_adspdec_database
671 },
672};
673
674static struct android_pmem_platform_data android_pmem_audio_pdata = {
675 .name = "pmem_audio",
676 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
677 .cached = 0,
678 .memory_type = MEMTYPE_EBI1,
679};
680
681static struct platform_device android_pmem_audio_device = {
682 .name = "android_pmem",
683 .id = 2,
684 .dev = { .platform_data = &android_pmem_audio_pdata },
685};
686
687static struct android_pmem_platform_data android_pmem_pdata = {
688 .name = "pmem",
689 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
690 .cached = 1,
691 .memory_type = MEMTYPE_EBI1,
692};
693static struct platform_device android_pmem_device = {
694 .name = "android_pmem",
695 .id = 0,
696 .dev = { .platform_data = &android_pmem_pdata },
697};
698
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700699static u32 msm_calculate_batt_capacity(u32 current_voltage);
700
701static struct msm_psy_batt_pdata msm_psy_batt_data = {
Krishna Vanka9a265e12012-06-04 23:24:26 +0530702 .voltage_min_design = 3200,
703 .voltage_max_design = 4200,
704 .voltage_fail_safe = 3340,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700705 .avail_chg_sources = AC_CHG | USB_CHG ,
706 .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
707 .calculate_capacity = &msm_calculate_batt_capacity,
708};
709
710static u32 msm_calculate_batt_capacity(u32 current_voltage)
711{
712 u32 low_voltage = msm_psy_batt_data.voltage_min_design;
713 u32 high_voltage = msm_psy_batt_data.voltage_max_design;
714
Krishna Vankab3494692012-06-12 15:06:43 +0530715 if (current_voltage <= low_voltage)
716 return 0;
717 else if (current_voltage >= high_voltage)
718 return 100;
719 else
720 return (current_voltage - low_voltage) * 100
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700721 / (high_voltage - low_voltage);
722}
723
724static struct platform_device msm_batt_device = {
725 .name = "msm-battery",
726 .id = -1,
727 .dev.platform_data = &msm_psy_batt_data,
728};
729
730static struct smsc911x_platform_config smsc911x_config = {
731 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
732 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
733 .flags = SMSC911X_USE_16BIT,
734};
735
736static struct resource smsc911x_resources[] = {
737 [0] = {
738 .start = 0x90000000,
739 .end = 0x90007fff,
740 .flags = IORESOURCE_MEM,
741 },
742 [1] = {
743 .start = MSM_GPIO_TO_INT(48),
744 .end = MSM_GPIO_TO_INT(48),
745 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
746 },
747};
748
749static struct platform_device smsc911x_device = {
750 .name = "smsc911x",
751 .id = 0,
752 .num_resources = ARRAY_SIZE(smsc911x_resources),
753 .resource = smsc911x_resources,
754 .dev = {
755 .platform_data = &smsc911x_config,
756 },
757};
758
759static struct msm_gpio smsc911x_gpios[] = {
760 { GPIO_CFG(48, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
761 "smsc911x_irq" },
762 { GPIO_CFG(49, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
763 "eth_fifo_sel" },
764};
765
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700766static char *msm_adc_surf_device_names[] = {
767 "XO_ADC",
768};
769
770static struct msm_adc_platform_data msm_adc_pdata = {
771 .dev_names = msm_adc_surf_device_names,
772 .num_adc = ARRAY_SIZE(msm_adc_surf_device_names),
773 .target_hw = MSM_8x25,
774};
775
776static struct platform_device msm_adc_device = {
777 .name = "msm_adc",
778 .id = -1,
779 .dev = {
780 .platform_data = &msm_adc_pdata,
781 },
782};
783
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700784#define ETH_FIFO_SEL_GPIO 49
785static void msm7x27a_cfg_smsc911x(void)
786{
787 int res;
788
789 res = msm_gpios_request_enable(smsc911x_gpios,
790 ARRAY_SIZE(smsc911x_gpios));
791 if (res) {
792 pr_err("%s: unable to enable gpios for SMSC911x\n", __func__);
793 return;
794 }
795
796 /* ETH_FIFO_SEL */
797 res = gpio_direction_output(ETH_FIFO_SEL_GPIO, 0);
798 if (res) {
799 pr_err("%s: unable to get direction for gpio %d\n", __func__,
800 ETH_FIFO_SEL_GPIO);
801 msm_gpios_disable_free(smsc911x_gpios,
802 ARRAY_SIZE(smsc911x_gpios));
803 return;
804 }
805 gpio_set_value(ETH_FIFO_SEL_GPIO, 0);
806}
807
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700808#if defined(CONFIG_SERIAL_MSM_HSL_CONSOLE) \
809 && defined(CONFIG_MSM_SHARED_GPIO_FOR_UART2DM)
810static struct msm_gpio uart2dm_gpios[] = {
811 {GPIO_CFG(19, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
812 "uart2dm_rfr_n" },
813 {GPIO_CFG(20, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
814 "uart2dm_cts_n" },
815 {GPIO_CFG(21, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
816 "uart2dm_rx" },
817 {GPIO_CFG(108, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
818 "uart2dm_tx" },
819};
820
821static void msm7x27a_cfg_uart2dm_serial(void)
822{
823 int ret;
824 ret = msm_gpios_request_enable(uart2dm_gpios,
825 ARRAY_SIZE(uart2dm_gpios));
826 if (ret)
827 pr_err("%s: unable to enable gpios for uart2dm\n", __func__);
828}
829#else
830static void msm7x27a_cfg_uart2dm_serial(void) { }
831#endif
832
833static struct platform_device *rumi_sim_devices[] __initdata = {
834 &msm_device_dmov,
835 &msm_device_smd,
836 &smc91x_device,
837 &msm_device_uart1,
838 &msm_device_nand,
839 &msm_device_uart_dm1,
840 &msm_gsbi0_qup_i2c_device,
841 &msm_gsbi1_qup_i2c_device,
842};
843
Taniya Das43bcdd62011-12-02 17:33:27 +0530844static struct platform_device *msm8625_rumi3_devices[] __initdata = {
845 &msm8625_device_dmov,
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530846 &msm8625_device_smd,
Taniya Das43bcdd62011-12-02 17:33:27 +0530847 &msm8625_device_uart1,
Taniya Dase3027e22012-02-27 16:32:27 +0530848 &msm8625_gsbi0_qup_i2c_device,
Taniya Das43bcdd62011-12-02 17:33:27 +0530849};
850
Taniya Dase3027e22012-02-27 16:32:27 +0530851static struct platform_device *msm7627a_surf_ffa_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700852 &msm_device_dmov,
853 &msm_device_smd,
854 &msm_device_uart1,
855 &msm_device_uart_dm1,
856 &msm_device_uart_dm2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700857 &msm_gsbi0_qup_i2c_device,
858 &msm_gsbi1_qup_i2c_device,
859 &msm_device_otg,
860 &msm_device_gadget_peripheral,
Taniya Dase3027e22012-02-27 16:32:27 +0530861 &smsc911x_device,
862 &msm_kgsl_3d0,
863};
864
865static struct platform_device *common_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700866 &android_usb_device,
Trilok Sonib9410792012-04-07 15:37:13 +0530867 &android_pmem_device,
868 &android_pmem_adsp_device,
869 &android_pmem_audio_device,
Taniya Dase3027e22012-02-27 16:32:27 +0530870 &msm_device_nand,
Trilok Sonib9410792012-04-07 15:37:13 +0530871 &msm_device_snd,
Manish Dewangan1c0fa492012-08-22 10:33:11 +0530872 &msm_device_cad,
Trilok Sonib9410792012-04-07 15:37:13 +0530873 &msm_device_adspdec,
Manish Dewangan3a260992011-06-24 18:01:34 +0530874 &asoc_msm_pcm,
875 &asoc_msm_dai0,
876 &asoc_msm_dai1,
Taniya Dase3027e22012-02-27 16:32:27 +0530877 &msm_batt_device,
Siddartha Mohanadossbc2103f2012-03-20 11:41:48 -0700878 &msm_adc_device,
Chintan Pandya43d0a342012-06-08 19:45:56 +0530879#ifdef CONFIG_ION_MSM
880 &ion_dev,
881#endif
Taniya Dase3027e22012-02-27 16:32:27 +0530882};
883
884static struct platform_device *msm8625_surf_devices[] __initdata = {
885 &msm8625_device_dmov,
886 &msm8625_device_uart1,
887 &msm8625_device_uart_dm1,
888 &msm8625_device_uart_dm2,
889 &msm8625_gsbi0_qup_i2c_device,
890 &msm8625_gsbi1_qup_i2c_device,
Taniya Dasf2665302012-02-28 16:54:54 +0530891 &msm8625_device_smd,
Taniya Dase3027e22012-02-27 16:32:27 +0530892 &msm8625_device_otg,
893 &msm8625_device_gadget_peripheral,
Ranjhith Kalisamy4ec2e102012-03-06 12:27:50 +0530894 &msm8625_kgsl_3d0,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700895};
896
Trilok Sonib9410792012-04-07 15:37:13 +0530897static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE;
898static int __init pmem_kernel_ebi1_size_setup(char *p)
899{
900 pmem_kernel_ebi1_size = memparse(p, NULL);
901 return 0;
902}
903early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
904
905static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
906static int __init pmem_audio_size_setup(char *p)
907{
908 pmem_audio_size = memparse(p, NULL);
909 return 0;
910}
911early_param("pmem_audio_size", pmem_audio_size_setup);
912
Chintan Pandya43d0a342012-06-08 19:45:56 +0530913static void fix_sizes(void)
914{
915 if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
916 pmem_mdp_size = MSM7x25A_MSM_PMEM_MDP_SIZE;
917 pmem_adsp_size = MSM7x25A_MSM_PMEM_ADSP_SIZE;
918 } else {
919 pmem_mdp_size = MSM_PMEM_MDP_SIZE;
920 pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
921 }
922#ifdef CONFIG_ION_MSM
923 msm_ion_camera_size = pmem_adsp_size;
924 msm_ion_audio_size = (MSM_PMEM_AUDIO_SIZE + PMEM_KERNEL_EBI1_SIZE);
925 msm_ion_sf_size = pmem_mdp_size;
926#endif
927}
928
929#ifdef CONFIG_ION_MSM
930#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
931static struct ion_co_heap_pdata co_ion_pdata = {
932 .adjacent_mem_id = INVALID_HEAP_ID,
933 .align = PAGE_SIZE,
934};
935#endif
936
937/**
938 * These heaps are listed in the order they will be allocated.
939 * Don't swap the order unless you know what you are doing!
940 */
941static struct ion_platform_data ion_pdata = {
942 .nr = MSM_ION_HEAP_NUM,
Chintan Pandya8ce738d2012-07-27 13:21:06 +0530943 .has_outer_cache = 1,
Chintan Pandya43d0a342012-06-08 19:45:56 +0530944 .heaps = {
945 {
946 .id = ION_SYSTEM_HEAP_ID,
947 .type = ION_HEAP_TYPE_SYSTEM,
948 .name = ION_VMALLOC_HEAP_NAME,
949 },
950#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
951 /* PMEM_ADSP = CAMERA */
952 {
953 .id = ION_CAMERA_HEAP_ID,
954 .type = ION_HEAP_TYPE_CARVEOUT,
955 .name = ION_CAMERA_HEAP_NAME,
956 .memory_type = ION_EBI_TYPE,
Chintan Pandya43d0a342012-06-08 19:45:56 +0530957 .extra_data = (void *)&co_ion_pdata,
958 },
959 /* PMEM_AUDIO */
960 {
961 .id = ION_AUDIO_HEAP_ID,
962 .type = ION_HEAP_TYPE_CARVEOUT,
963 .name = ION_AUDIO_HEAP_NAME,
964 .memory_type = ION_EBI_TYPE,
Chintan Pandya43d0a342012-06-08 19:45:56 +0530965 .extra_data = (void *)&co_ion_pdata,
966 },
967 /* PMEM_MDP = SF */
968 {
969 .id = ION_SF_HEAP_ID,
970 .type = ION_HEAP_TYPE_CARVEOUT,
971 .name = ION_SF_HEAP_NAME,
972 .memory_type = ION_EBI_TYPE,
Chintan Pandya43d0a342012-06-08 19:45:56 +0530973 .extra_data = (void *)&co_ion_pdata,
974 },
975#endif
976 }
977};
978
979static struct platform_device ion_dev = {
980 .name = "ion-msm",
981 .id = 1,
982 .dev = { .platform_data = &ion_pdata },
983};
984#endif
985
Trilok Sonib9410792012-04-07 15:37:13 +0530986static struct memtype_reserve msm7x27a_reserve_table[] __initdata = {
987 [MEMTYPE_SMI] = {
988 },
989 [MEMTYPE_EBI0] = {
990 .flags = MEMTYPE_FLAGS_1M_ALIGN,
991 },
992 [MEMTYPE_EBI1] = {
993 .flags = MEMTYPE_FLAGS_1M_ALIGN,
994 },
995};
996
Larry Bassel861985f2012-05-02 15:54:52 -0700997#ifdef CONFIG_ANDROID_PMEM
Chintan Pandya43d0a342012-06-08 19:45:56 +0530998#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Larry Bassel861985f2012-05-02 15:54:52 -0700999static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = {
1000 &android_pmem_adsp_pdata,
1001 &android_pmem_audio_pdata,
1002 &android_pmem_pdata,
1003};
1004#endif
Chintan Pandya43d0a342012-06-08 19:45:56 +05301005#endif
Larry Bassel861985f2012-05-02 15:54:52 -07001006
Trilok Sonib9410792012-04-07 15:37:13 +05301007static void __init size_pmem_devices(void)
1008{
Larry Bassel861985f2012-05-02 15:54:52 -07001009#ifdef CONFIG_ANDROID_PMEM
Chintan Pandya43d0a342012-06-08 19:45:56 +05301010#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Trilok Sonib9410792012-04-07 15:37:13 +05301011 android_pmem_adsp_pdata.size = pmem_adsp_size;
1012 android_pmem_pdata.size = pmem_mdp_size;
1013 android_pmem_audio_pdata.size = pmem_audio_size;
Larry Bassel861985f2012-05-02 15:54:52 -07001014
Trilok Sonib9410792012-04-07 15:37:13 +05301015#endif
Chintan Pandya43d0a342012-06-08 19:45:56 +05301016#endif
Trilok Sonib9410792012-04-07 15:37:13 +05301017}
1018
Chintan Pandya43d0a342012-06-08 19:45:56 +05301019#ifdef CONFIG_ANDROID_PMEM
1020#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Trilok Sonib9410792012-04-07 15:37:13 +05301021static void __init reserve_memory_for(struct android_pmem_platform_data *p)
1022{
1023 msm7x27a_reserve_table[p->memory_type].size += p->size;
1024}
Chintan Pandya43d0a342012-06-08 19:45:56 +05301025#endif
1026#endif
Trilok Sonib9410792012-04-07 15:37:13 +05301027
1028static void __init reserve_pmem_memory(void)
1029{
1030#ifdef CONFIG_ANDROID_PMEM
Chintan Pandya43d0a342012-06-08 19:45:56 +05301031#ifndef CONFIG_MSM_MULTIMEDIA_USE_ION
Larry Bassel861985f2012-05-02 15:54:52 -07001032 unsigned int i;
1033 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i)
1034 reserve_memory_for(pmem_pdata_array[i]);
1035
Trilok Sonib9410792012-04-07 15:37:13 +05301036 msm7x27a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
1037#endif
Chintan Pandya43d0a342012-06-08 19:45:56 +05301038#endif
1039}
1040
1041static void __init size_ion_devices(void)
1042{
1043#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1044 ion_pdata.heaps[1].size = msm_ion_camera_size;
1045 ion_pdata.heaps[2].size = msm_ion_audio_size;
1046 ion_pdata.heaps[3].size = msm_ion_sf_size;
1047#endif
1048}
1049
1050static void __init reserve_ion_memory(void)
1051{
1052#if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION)
1053 msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_camera_size;
1054 msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_audio_size;
1055 msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_sf_size;
1056#endif
Trilok Sonib9410792012-04-07 15:37:13 +05301057}
1058
1059static void __init msm7x27a_calculate_reserve_sizes(void)
1060{
Chintan Pandya43d0a342012-06-08 19:45:56 +05301061 fix_sizes();
Trilok Sonib9410792012-04-07 15:37:13 +05301062 size_pmem_devices();
1063 reserve_pmem_memory();
Chintan Pandya43d0a342012-06-08 19:45:56 +05301064 size_ion_devices();
1065 reserve_ion_memory();
Trilok Sonib9410792012-04-07 15:37:13 +05301066}
1067
1068static int msm7x27a_paddr_to_memtype(unsigned int paddr)
1069{
1070 return MEMTYPE_EBI1;
1071}
1072
1073static struct reserve_info msm7x27a_reserve_info __initdata = {
1074 .memtype_reserve_table = msm7x27a_reserve_table,
1075 .calculate_reserve_sizes = msm7x27a_calculate_reserve_sizes,
1076 .paddr_to_memtype = msm7x27a_paddr_to_memtype,
1077};
1078
1079static void __init msm7x27a_reserve(void)
1080{
1081 reserve_info = &msm7x27a_reserve_info;
1082 msm_reserve();
Trilok Sonib9410792012-04-07 15:37:13 +05301083}
1084
Taniya Das2b16d1d2011-12-02 14:44:19 +05301085static void __init msm8625_reserve(void)
1086{
Trilok Sonib9410792012-04-07 15:37:13 +05301087 msm7x27a_reserve();
Taniya Dasfe04d4f2012-03-14 11:13:21 +05301088 memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
Murali Nalajalafeedeae2012-03-28 16:15:32 +05301089 memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32);
Taniya Das2b16d1d2011-12-02 14:44:19 +05301090}
1091
Taniya Dase3027e22012-02-27 16:32:27 +05301092static void __init msm7x27a_device_i2c_init(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001093{
1094 msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata;
1095 msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
1096}
1097
Taniya Dase3027e22012-02-27 16:32:27 +05301098static void __init msm8625_device_i2c_init(void)
1099{
1100 msm8625_gsbi0_qup_i2c_device.dev.platform_data =
1101 &msm_gsbi0_qup_i2c_pdata;
1102 msm8625_gsbi1_qup_i2c_device.dev.platform_data =
1103 &msm_gsbi1_qup_i2c_pdata;
1104}
1105
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001106#define MSM_EBI2_PHYS 0xa0d00000
1107#define MSM_EBI2_XMEM_CS2_CFG1 0xa0d10030
1108
1109static void __init msm7x27a_init_ebi2(void)
1110{
1111 uint32_t ebi2_cfg;
1112 void __iomem *ebi2_cfg_ptr;
1113
1114 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_PHYS, sizeof(uint32_t));
1115 if (!ebi2_cfg_ptr)
1116 return;
1117
1118 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301119 if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf() ||
Taniya Dase3027e22012-02-27 16:32:27 +05301120 machine_is_msm7625a_surf() || machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001121 ebi2_cfg |= (1 << 4); /* CS2 */
1122
1123 writel(ebi2_cfg, ebi2_cfg_ptr);
1124 iounmap(ebi2_cfg_ptr);
1125
1126 /* Enable A/D MUX[bit 31] from EBI2_XMEM_CS2_CFG1 */
1127 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_XMEM_CS2_CFG1,
1128 sizeof(uint32_t));
1129 if (!ebi2_cfg_ptr)
1130 return;
1131
1132 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301133 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001134 ebi2_cfg |= (1 << 31);
1135
1136 writel(ebi2_cfg, ebi2_cfg_ptr);
1137 iounmap(ebi2_cfg_ptr);
1138}
1139
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001140static struct platform_device msm_proccomm_regulator_dev = {
1141 .name = PROCCOMM_REGULATOR_DEV_NAME,
1142 .id = -1,
1143 .dev = {
1144 .platform_data = &msm7x27a_proccomm_regulator_data
1145 }
1146};
1147
Trilok Sonib9410792012-04-07 15:37:13 +05301148static void msm_adsp_add_pdev(void)
1149{
1150 int rc = 0;
1151 struct rpc_board_dev *rpc_adsp_pdev;
1152
1153 rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL);
1154 if (rpc_adsp_pdev == NULL) {
1155 pr_err("%s: Memory Allocation failure\n", __func__);
1156 return;
1157 }
1158 rpc_adsp_pdev->prog = ADSP_RPC_PROG;
1159
1160 if (cpu_is_msm8625())
1161 rpc_adsp_pdev->pdev = msm8625_device_adsp;
1162 else
1163 rpc_adsp_pdev->pdev = msm_adsp_device;
1164 rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1);
1165 if (rc < 0) {
1166 pr_err("%s: return val: %d\n", __func__, rc);
1167 kfree(rpc_adsp_pdev);
1168 }
1169}
1170
Trilok Soni16f61af2011-07-26 16:06:58 +05301171static void __init msm7627a_rumi3_init(void)
1172{
1173 msm7x27a_init_ebi2();
1174 platform_add_devices(rumi_sim_devices,
1175 ARRAY_SIZE(rumi_sim_devices));
1176}
1177
Taniya Das43bcdd62011-12-02 17:33:27 +05301178static void __init msm8625_rumi3_init(void)
1179{
1180 msm7x2x_misc_init();
Taniya Dase3027e22012-02-27 16:32:27 +05301181 msm_adsp_add_pdev();
1182 msm8625_device_i2c_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301183 platform_add_devices(msm8625_rumi3_devices,
1184 ARRAY_SIZE(msm8625_rumi3_devices));
Murali Nalajala41786ab2012-03-06 10:47:32 +05301185
Murali Nalajalad1f67b02012-02-10 00:23:49 +05301186 msm_pm_set_platform_data(msm8625_pm_data,
1187 ARRAY_SIZE(msm8625_pm_data));
Murali Nalajala41786ab2012-03-06 10:47:32 +05301188 BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
1189 msm8x25_spm_device_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301190}
1191
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001192#define UART1DM_RX_GPIO 45
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301193
1194#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
1195static int __init msm7x27a_init_ar6000pm(void)
1196{
Santosh Sajjan374d6592012-01-19 23:16:46 +05301197 msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power;
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301198 return platform_device_register(&msm_wlan_ar6000_pm_device);
1199}
1200#else
1201static int __init msm7x27a_init_ar6000pm(void) { return 0; }
1202#endif
1203
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001204static void __init msm7x27a_init_regulators(void)
1205{
1206 int rc = platform_device_register(&msm_proccomm_regulator_dev);
1207 if (rc)
1208 pr_err("%s: could not register regulator device: %d\n",
1209 __func__, rc);
1210}
1211
Taniya Dase3027e22012-02-27 16:32:27 +05301212static void __init msm7x27a_add_footswitch_devices(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001213{
Trilok Soni16f61af2011-07-26 16:06:58 +05301214 platform_add_devices(msm_footswitch_devices,
1215 msm_num_footswitch_devices);
Taniya Dase3027e22012-02-27 16:32:27 +05301216}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001217
Taniya Dase3027e22012-02-27 16:32:27 +05301218static void __init msm7x27a_add_platform_devices(void)
1219{
Aparna Mallavarapu9f000a72012-04-20 15:37:57 +05301220 if (machine_is_msm8625_surf() || machine_is_msm8625_ffa()) {
Taniya Dase3027e22012-02-27 16:32:27 +05301221 platform_add_devices(msm8625_surf_devices,
1222 ARRAY_SIZE(msm8625_surf_devices));
1223 } else {
1224 platform_add_devices(msm7627a_surf_ffa_devices,
1225 ARRAY_SIZE(msm7627a_surf_ffa_devices));
1226 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001227
Taniya Dase3027e22012-02-27 16:32:27 +05301228 platform_add_devices(common_devices,
1229 ARRAY_SIZE(common_devices));
1230}
1231
1232static void __init msm7x27a_uartdm_config(void)
1233{
1234 msm7x27a_cfg_uart2dm_serial();
1235 msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
1236 if (cpu_is_msm8625())
1237 msm8625_device_uart_dm1.dev.platform_data =
1238 &msm_uart_dm1_pdata;
1239 else
1240 msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
1241}
1242
1243static void __init msm7x27a_otg_gadget(void)
1244{
Taniya Dase3027e22012-02-27 16:32:27 +05301245 if (cpu_is_msm8625()) {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +05301246 msm_otg_pdata.swfi_latency =
1247 msm8625_pm_data[MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency;
Taniya Dase3027e22012-02-27 16:32:27 +05301248 msm8625_device_otg.dev.platform_data = &msm_otg_pdata;
1249 msm8625_device_gadget_peripheral.dev.platform_data =
1250 &msm_gadget_pdata;
1251 } else {
Murali Nalajala6ff8fb12012-05-02 18:50:50 +05301252 msm_otg_pdata.swfi_latency =
1253 msm7x27a_pm_data[
1254 MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
Taniya Dase3027e22012-02-27 16:32:27 +05301255 msm_device_otg.dev.platform_data = &msm_otg_pdata;
1256 msm_device_gadget_peripheral.dev.platform_data =
1257 &msm_gadget_pdata;
1258 }
1259}
1260
Taniya Dase3027e22012-02-27 16:32:27 +05301261static void __init msm7x27a_pm_init(void)
1262{
Aparna Mallavarapu9f000a72012-04-20 15:37:57 +05301263 if (machine_is_msm8625_surf() || machine_is_msm8625_ffa()) {
Murali Nalajala8ee084e2012-03-07 00:09:38 +05301264 msm_pm_set_platform_data(msm8625_pm_data,
1265 ARRAY_SIZE(msm8625_pm_data));
1266 BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
1267 msm8x25_spm_device_init();
1268 } else {
1269 msm_pm_set_platform_data(msm7x27a_pm_data,
1270 ARRAY_SIZE(msm7x27a_pm_data));
1271 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
1272 }
Murali Nalajala2a0bbda2012-03-28 12:12:54 +05301273
1274 msm_pm_register_irqs();
Taniya Dase3027e22012-02-27 16:32:27 +05301275}
1276
1277static void __init msm7x2x_init(void)
1278{
1279 msm7x2x_misc_init();
1280
1281 /* Initialize regulators first so that other devices can use them */
1282 msm7x27a_init_regulators();
1283 msm_adsp_add_pdev();
1284 if (cpu_is_msm8625())
1285 msm8625_device_i2c_init();
1286 else
1287 msm7x27a_device_i2c_init();
1288 msm7x27a_init_ebi2();
1289 msm7x27a_uartdm_config();
1290
1291 msm7x27a_otg_gadget();
1292 msm7x27a_cfg_smsc911x();
1293
1294 msm7x27a_add_footswitch_devices();
1295 msm7x27a_add_platform_devices();
1296 /* Ensure ar6000pm device is registered before MMC/SDC */
1297 msm7x27a_init_ar6000pm();
1298 msm7627a_init_mmc();
1299 msm_fb_add_devices();
1300 msm7x2x_init_host();
1301 msm7x27a_pm_init();
1302 register_i2c_devices();
Steve Mucklef132c6c2012-06-06 18:30:57 -07001303#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
Taniya Dase3027e22012-02-27 16:32:27 +05301304 msm7627a_bt_power_init();
Steve Mucklef132c6c2012-06-06 18:30:57 -07001305#endif
Taniya Dase3027e22012-02-27 16:32:27 +05301306 msm7627a_camera_init();
Chintan Pandya0d453192012-03-09 13:20:33 +05301307 msm7627a_add_io_devices();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001308 /*7x25a kgsl initializations*/
1309 msm7x25a_kgsl_3d0_init();
Sudhakara Rao Tentu38ad6e12012-03-30 15:25:18 -07001310 /*8x25 kgsl initializations*/
1311 msm8x25_kgsl_3d0_init();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001312}
1313
1314static void __init msm7x2x_init_early(void)
1315{
Chintan Pandya250c2e52012-01-19 17:15:49 +05301316 msm_msm7627a_allocate_memory_regions();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001317}
1318
1319MACHINE_START(MSM7X27A_RUMI3, "QCT MSM7x27a RUMI3")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001320 .atag_offset = 0x100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001321 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +05301322 .reserve = msm7x27a_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001323 .init_irq = msm_init_irq,
Trilok Soni16f61af2011-07-26 16:06:58 +05301324 .init_machine = msm7627a_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001325 .timer = &msm_timer,
1326 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301327 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001328MACHINE_END
1329MACHINE_START(MSM7X27A_SURF, "QCT MSM7x27a SURF")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001330 .atag_offset = 0x100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001331 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +05301332 .reserve = msm7x27a_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001333 .init_irq = msm_init_irq,
1334 .init_machine = msm7x2x_init,
1335 .timer = &msm_timer,
1336 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301337 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001338MACHINE_END
1339MACHINE_START(MSM7X27A_FFA, "QCT MSM7x27a FFA")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001340 .atag_offset = 0x100,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001341 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +05301342 .reserve = msm7x27a_reserve,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001343 .init_irq = msm_init_irq,
1344 .init_machine = msm7x2x_init,
1345 .timer = &msm_timer,
1346 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301347 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001348MACHINE_END
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301349MACHINE_START(MSM7625A_SURF, "QCT MSM7625a SURF")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001350 .atag_offset = 0x100,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301351 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +05301352 .reserve = msm7x27a_reserve,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301353 .init_irq = msm_init_irq,
1354 .init_machine = msm7x2x_init,
1355 .timer = &msm_timer,
1356 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301357 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301358MACHINE_END
1359MACHINE_START(MSM7625A_FFA, "QCT MSM7625a FFA")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001360 .atag_offset = 0x100,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301361 .map_io = msm_common_io_init,
Trilok Sonib9410792012-04-07 15:37:13 +05301362 .reserve = msm7x27a_reserve,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301363 .init_irq = msm_init_irq,
1364 .init_machine = msm7x2x_init,
1365 .timer = &msm_timer,
1366 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301367 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301368MACHINE_END
Taniya Das43bcdd62011-12-02 17:33:27 +05301369MACHINE_START(MSM8625_RUMI3, "QCT MSM8625 RUMI3")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001370 .atag_offset = 0x100,
Taniya Das43bcdd62011-12-02 17:33:27 +05301371 .map_io = msm8625_map_io,
Taniya Das2b16d1d2011-12-02 14:44:19 +05301372 .reserve = msm8625_reserve,
Taniya Das43bcdd62011-12-02 17:33:27 +05301373 .init_irq = msm8625_init_irq,
1374 .init_machine = msm8625_rumi3_init,
1375 .timer = &msm_timer,
1376 .handle_irq = gic_handle_irq,
1377MACHINE_END
Taniya Dase3027e22012-02-27 16:32:27 +05301378MACHINE_START(MSM8625_SURF, "QCT MSM8625 SURF")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001379 .atag_offset = 0x100,
Taniya Dase3027e22012-02-27 16:32:27 +05301380 .map_io = msm8625_map_io,
1381 .reserve = msm8625_reserve,
1382 .init_irq = msm8625_init_irq,
1383 .init_machine = msm7x2x_init,
1384 .timer = &msm_timer,
1385 .init_early = msm7x2x_init_early,
1386 .handle_irq = gic_handle_irq,
1387MACHINE_END
Aparna Mallavarapu9f000a72012-04-20 15:37:57 +05301388MACHINE_START(MSM8625_FFA, "QCT MSM8625 FFA")
Steve Mucklef132c6c2012-06-06 18:30:57 -07001389 .atag_offset = 0x100,
Aparna Mallavarapu9f000a72012-04-20 15:37:57 +05301390 .map_io = msm8625_map_io,
1391 .reserve = msm8625_reserve,
1392 .init_irq = msm8625_init_irq,
1393 .init_machine = msm7x2x_init,
1394 .timer = &msm_timer,
1395 .init_early = msm7x2x_init_early,
1396 .handle_irq = gic_handle_irq,
1397MACHINE_END