blob: a9345e64e857c43585044b946ad0755e07e337ed [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>
Laura Abbott8f3d58b2011-12-18 10:47:03 -080051#include <linux/fmem.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052#include "devices.h"
53#include "timer.h"
Justin Pauporeb3a33b72011-08-23 15:30:32 -070054#include "board-msm7x27a-regulator.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070055#include "devices-msm7x2xa.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080056#include "pm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057#include <mach/rpc_server_handset.h>
58#include <mach/socinfo.h>
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060059#include "pm-boot.h"
Chintan Pandyacf467fc2011-12-01 17:11:11 +053060#include "board-msm7627a.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070061
62#define PMEM_KERNEL_EBI1_SIZE 0x3A000
63#define MSM_PMEM_AUDIO_SIZE 0x5B000
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +053064#define ADSP_RPC_PROG 0x3000000a
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070066#if defined(CONFIG_GPIO_SX150X)
67enum {
68 SX150X_CORE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070069};
70
71static struct sx150x_platform_data sx150x_data[] __initdata = {
72 [SX150X_CORE] = {
73 .gpio_base = GPIO_CORE_EXPANDER_BASE,
74 .oscio_is_gpo = false,
75 .io_pullup_ena = 0,
pankaj kumarc5c01392011-08-12 13:44:05 +053076 .io_pulldn_ena = 0x02,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070077 .io_open_drain_ena = 0xfef8,
78 .irq_summary = -1,
79 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070080};
81#endif
82
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070083
Santosh Sajjan6822c682011-07-26 10:49:36 +053084static struct platform_device msm_wlan_ar6000_pm_device = {
85 .name = "wlan_ar6000_pm_dev",
86 .id = -1,
87};
88
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070089#if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X)
90static struct i2c_board_info core_exp_i2c_info[] __initdata = {
91 {
92 I2C_BOARD_INFO("sx1509q", 0x3e),
93 },
94};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070095
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070096static void __init register_i2c_devices(void)
97{
Taniya Dase3027e22012-02-27 16:32:27 +053098 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
99 machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700100 sx150x_data[SX150X_CORE].io_open_drain_ena = 0xe0f0;
101
102 core_exp_i2c_info[0].platform_data =
103 &sx150x_data[SX150X_CORE];
104
105 i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
106 core_exp_i2c_info,
107 ARRAY_SIZE(core_exp_i2c_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700108}
109#endif
110
111static struct msm_gpio qup_i2c_gpios_io[] = {
112 { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
113 "qup_scl" },
114 { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
115 "qup_sda" },
116 { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
117 "qup_scl" },
118 { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
119 "qup_sda" },
120};
121
122static struct msm_gpio qup_i2c_gpios_hw[] = {
123 { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
124 "qup_scl" },
125 { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
126 "qup_sda" },
127 { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
128 "qup_scl" },
129 { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
130 "qup_sda" },
131};
132
133static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
134{
135 int rc;
136
137 if (adap_id < 0 || adap_id > 1)
138 return;
139
140 /* Each adapter gets 2 lines from the table */
141 if (config_type)
142 rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2);
143 else
144 rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2);
145 if (rc < 0)
146 pr_err("QUP GPIO request/enable failed: %d\n", rc);
147}
148
149static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = {
150 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700151 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
152};
153
154static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = {
155 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700156 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
157};
158
159#ifdef CONFIG_ARCH_MSM7X27A
Neti Ravi Kumar061726e2011-12-08 15:14:57 +0530160#define MSM_PMEM_MDP_SIZE 0x2300000
161#define MSM7x25A_MSM_PMEM_MDP_SIZE 0x1500000
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530162
Mahesh Lankaa2f6df12012-01-05 16:54:40 +0530163#define MSM_PMEM_ADSP_SIZE 0x1100000
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530164#define MSM7x25A_MSM_PMEM_ADSP_SIZE 0xB91000
165
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700166#endif
167
168static struct android_usb_platform_data android_usb_pdata = {
169 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
170};
171
172static struct platform_device android_usb_device = {
173 .name = "android_usb",
174 .id = -1,
175 .dev = {
176 .platform_data = &android_usb_pdata,
177 },
178};
179
180#ifdef CONFIG_USB_EHCI_MSM_72K
181static void msm_hsusb_vbus_power(unsigned phy_info, int on)
182{
183 int rc = 0;
184 unsigned gpio;
185
186 gpio = GPIO_HOST_VBUS_EN;
187
188 rc = gpio_request(gpio, "i2c_host_vbus_en");
189 if (rc < 0) {
190 pr_err("failed to request %d GPIO\n", gpio);
191 return;
192 }
193 gpio_direction_output(gpio, !!on);
194 gpio_set_value_cansleep(gpio, !!on);
195 gpio_free(gpio);
196}
197
198static struct msm_usb_host_platform_data msm_usb_host_pdata = {
199 .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM),
200};
201
202static void __init msm7x2x_init_host(void)
203{
204 msm_add_host(0, &msm_usb_host_pdata);
205}
206#endif
207
208#ifdef CONFIG_USB_MSM_OTG_72K
209static int hsusb_rpc_connect(int connect)
210{
211 if (connect)
212 return msm_hsusb_rpc_connect();
213 else
214 return msm_hsusb_rpc_close();
215}
216
Justin Paupored98328e2011-08-19 13:48:31 -0700217static struct regulator *reg_hsusb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700218static int msm_hsusb_ldo_init(int init)
219{
Justin Paupored98328e2011-08-19 13:48:31 -0700220 int rc = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700221
Justin Paupored98328e2011-08-19 13:48:31 -0700222 if (init) {
223 reg_hsusb = regulator_get(NULL, "usb");
224 if (IS_ERR(reg_hsusb)) {
225 rc = PTR_ERR(reg_hsusb);
226 pr_err("%s: could not get regulator: %d\n",
227 __func__, rc);
228 goto out;
229 }
230
231 rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000);
232 if (rc) {
233 pr_err("%s: could not set voltage: %d\n",
234 __func__, rc);
235 goto reg_free;
236 }
237
238 return 0;
239 }
240 /* else fall through */
241reg_free:
242 regulator_put(reg_hsusb);
243out:
244 reg_hsusb = NULL;
245 return rc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700246}
247
248static int msm_hsusb_ldo_enable(int enable)
249{
250 static int ldo_status;
251
Justin Paupored98328e2011-08-19 13:48:31 -0700252 if (IS_ERR_OR_NULL(reg_hsusb))
253 return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700254
255 if (ldo_status == enable)
256 return 0;
257
258 ldo_status = enable;
259
Justin Paupored98328e2011-08-19 13:48:31 -0700260 return enable ?
261 regulator_enable(reg_hsusb) :
262 regulator_disable(reg_hsusb);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700263}
264
265#ifndef CONFIG_USB_EHCI_MSM_72K
266static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init)
267{
268 int ret = 0;
269
270 if (init)
271 ret = msm_pm_app_rpc_init(callback);
272 else
273 msm_pm_app_rpc_deinit(callback);
274
275 return ret;
276}
277#endif
278
279static struct msm_otg_platform_data msm_otg_pdata = {
280#ifndef CONFIG_USB_EHCI_MSM_72K
281 .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init,
282#else
283 .vbus_power = msm_hsusb_vbus_power,
284#endif
285 .rpc_connect = hsusb_rpc_connect,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700286 .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT,
287 .cdr_autoreset = CDR_AUTO_RESET_DISABLE,
288 .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT,
289 .se1_gating = SE1_GATING_DISABLE,
290 .ldo_init = msm_hsusb_ldo_init,
291 .ldo_enable = msm_hsusb_ldo_enable,
292 .chg_init = hsusb_chg_init,
293 .chg_connected = hsusb_chg_connected,
294 .chg_vbus_draw = hsusb_chg_vbus_draw,
295};
296#endif
297
298static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = {
299 .is_phy_status_timer_on = 1,
300};
301
302static struct resource smc91x_resources[] = {
303 [0] = {
304 .start = 0x90000300,
305 .end = 0x900003ff,
306 .flags = IORESOURCE_MEM,
307 },
308 [1] = {
309 .start = MSM_GPIO_TO_INT(4),
310 .end = MSM_GPIO_TO_INT(4),
311 .flags = IORESOURCE_IRQ,
312 },
313};
314
315static struct platform_device smc91x_device = {
316 .name = "smc91x",
317 .id = 0,
318 .num_resources = ARRAY_SIZE(smc91x_resources),
319 .resource = smc91x_resources,
320};
321
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700322#ifdef CONFIG_SERIAL_MSM_HS
323static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = {
324 .inject_rx_on_wakeup = 1,
325 .rx_to_inject = 0xFD,
326};
327#endif
328static struct msm_pm_platform_data msm7x27a_pm_data[MSM_PM_SLEEP_MODE_NR] = {
Murali Nalajalab10363d2012-01-12 16:29:01 +0530329 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700330 .idle_supported = 1,
331 .suspend_supported = 1,
332 .idle_enabled = 1,
333 .suspend_enabled = 1,
334 .latency = 16000,
335 .residency = 20000,
336 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530337 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700338 .idle_supported = 1,
339 .suspend_supported = 1,
340 .idle_enabled = 1,
341 .suspend_enabled = 1,
342 .latency = 12000,
343 .residency = 20000,
344 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530345 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700346 .idle_supported = 1,
347 .suspend_supported = 1,
348 .idle_enabled = 0,
349 .suspend_enabled = 1,
350 .latency = 2000,
351 .residency = 0,
352 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530353 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700354 .idle_supported = 1,
355 .suspend_supported = 1,
356 .idle_enabled = 1,
357 .suspend_enabled = 1,
358 .latency = 2,
359 .residency = 0,
360 },
361};
362
Sujit Reddy Thummaca0c1062012-02-24 14:47:05 +0530363u32 msm7627a_power_collapse_latency(enum msm_pm_sleep_mode mode)
364{
365 switch (mode) {
366 case MSM_PM_SLEEP_MODE_POWER_COLLAPSE:
367 return msm7x27a_pm_data
368 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE].latency;
369 case MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN:
370 return msm7x27a_pm_data
371 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN].latency;
372 case MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT:
373 return msm7x27a_pm_data
374 [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
375 case MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT:
376 return msm7x27a_pm_data
377 [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency;
378 default:
379 return 0;
380 }
381}
382
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600383static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +0530384 .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS,
385 .p_addr = 0,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600386};
387
Murali Nalajala41786ab2012-03-06 10:47:32 +0530388static struct msm_pm_boot_platform_data msm_pm_8625_boot_pdata __initdata = {
389 .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR,
390 .v_addr = MSM_CFG_CTL_BASE,
391};
392
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700393static struct android_pmem_platform_data android_pmem_adsp_pdata = {
394 .name = "pmem_adsp",
395 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
Mahesh Lankac6af7eb2011-08-02 18:00:35 +0530396 .cached = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700397 .memory_type = MEMTYPE_EBI1,
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800398 .request_region = request_fmem_c_region,
399 .release_region = release_fmem_c_region,
400 .reusable = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700401};
402
403static struct platform_device android_pmem_adsp_device = {
404 .name = "android_pmem",
405 .id = 1,
406 .dev = { .platform_data = &android_pmem_adsp_pdata },
407};
408
409static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE;
410static int __init pmem_mdp_size_setup(char *p)
411{
412 pmem_mdp_size = memparse(p, NULL);
413 return 0;
414}
415
416early_param("pmem_mdp_size", pmem_mdp_size_setup);
417
418static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
419static int __init pmem_adsp_size_setup(char *p)
420{
421 pmem_adsp_size = memparse(p, NULL);
422 return 0;
423}
424
425early_param("pmem_adsp_size", pmem_adsp_size_setup);
426
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700427#define SND(desc, num) { .name = #desc, .id = num }
428static struct snd_endpoint snd_endpoints_list[] = {
429 SND(HANDSET, 0),
430 SND(MONO_HEADSET, 2),
431 SND(HEADSET, 3),
432 SND(SPEAKER, 6),
433 SND(TTY_HEADSET, 8),
434 SND(TTY_VCO, 9),
435 SND(TTY_HCO, 10),
436 SND(BT, 12),
437 SND(IN_S_SADC_OUT_HANDSET, 16),
438 SND(IN_S_SADC_OUT_SPEAKER_PHONE, 25),
439 SND(FM_DIGITAL_STEREO_HEADSET, 26),
440 SND(FM_DIGITAL_SPEAKER_PHONE, 27),
441 SND(FM_DIGITAL_BT_A2DP_HEADSET, 28),
Shashi Kumar64e07602011-10-11 13:18:57 +0530442 SND(STEREO_HEADSET_AND_SPEAKER, 31),
Sidipotu Ashokab34ca42011-07-22 16:34:20 +0530443 SND(CURRENT, 0x7FFFFFFE),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700444 SND(FM_ANALOG_STEREO_HEADSET, 35),
445 SND(FM_ANALOG_STEREO_HEADSET_CODEC, 36),
446};
447#undef SND
448
449static struct msm_snd_endpoints msm_device_snd_endpoints = {
450 .endpoints = snd_endpoints_list,
451 .num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint)
452};
453
454static struct platform_device msm_device_snd = {
455 .name = "msm_snd",
456 .id = -1,
457 .dev = {
458 .platform_data = &msm_device_snd_endpoints
459 },
460};
461
462#define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
463 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
464 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
465 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
466 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
467 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
468#define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
469 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
470 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
471 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
472 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
473 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
474#define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
475 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
476 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
477 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
478 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
479 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
480#define DEC3_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
481 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
482 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
483 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
484 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
485 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
486#define DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI)
487
488static unsigned int dec_concurrency_table[] = {
489 /* Audio LP */
490 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DMA)), 0,
491 0, 0, 0,
492
493 /* Concurrency 1 */
494 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
495 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
496 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
497 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
498 (DEC4_FORMAT),
499
500 /* Concurrency 2 */
501 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
502 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
503 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
504 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
505 (DEC4_FORMAT),
506
507 /* Concurrency 3 */
508 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
509 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
510 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
511 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
512 (DEC4_FORMAT),
513
514 /* Concurrency 4 */
515 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
516 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
517 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
518 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
519 (DEC4_FORMAT),
520
521 /* Concurrency 5 */
522 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
523 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
524 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
525 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
526 (DEC4_FORMAT),
527
528 /* Concurrency 6 */
529 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
530 0, 0, 0, 0,
531
532 /* Concurrency 7 */
533 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
534 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
535 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
536 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
537 (DEC4_FORMAT),
538};
539
540#define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \
541 .module_queueid = queueid, .module_decid = decid, \
542 .nr_codec_support = nr_codec}
543
544static struct msm_adspdec_info dec_info_list[] = {
545 DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* AudPlay0BitStreamCtrlQueue */
546 DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* AudPlay1BitStreamCtrlQueue */
547 DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* AudPlay2BitStreamCtrlQueue */
548 DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* AudPlay3BitStreamCtrlQueue */
549 DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* AudPlay4BitStreamCtrlQueue */
550};
551
552static struct msm_adspdec_database msm_device_adspdec_database = {
553 .num_dec = ARRAY_SIZE(dec_info_list),
554 .num_concurrency_support = (ARRAY_SIZE(dec_concurrency_table) / \
555 ARRAY_SIZE(dec_info_list)),
556 .dec_concurrency_table = dec_concurrency_table,
557 .dec_info_list = dec_info_list,
558};
559
560static struct platform_device msm_device_adspdec = {
561 .name = "msm_adspdec",
562 .id = -1,
563 .dev = {
564 .platform_data = &msm_device_adspdec_database
565 },
566};
567
568static struct android_pmem_platform_data android_pmem_audio_pdata = {
569 .name = "pmem_audio",
570 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
571 .cached = 0,
572 .memory_type = MEMTYPE_EBI1,
573};
574
575static struct platform_device android_pmem_audio_device = {
576 .name = "android_pmem",
577 .id = 2,
578 .dev = { .platform_data = &android_pmem_audio_pdata },
579};
580
581static struct android_pmem_platform_data android_pmem_pdata = {
582 .name = "pmem",
583 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
584 .cached = 1,
585 .memory_type = MEMTYPE_EBI1,
586};
587static struct platform_device android_pmem_device = {
588 .name = "android_pmem",
589 .id = 0,
590 .dev = { .platform_data = &android_pmem_pdata },
591};
592
593static u32 msm_calculate_batt_capacity(u32 current_voltage);
594
595static struct msm_psy_batt_pdata msm_psy_batt_data = {
596 .voltage_min_design = 2800,
597 .voltage_max_design = 4300,
598 .avail_chg_sources = AC_CHG | USB_CHG ,
599 .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
600 .calculate_capacity = &msm_calculate_batt_capacity,
601};
602
603static u32 msm_calculate_batt_capacity(u32 current_voltage)
604{
605 u32 low_voltage = msm_psy_batt_data.voltage_min_design;
606 u32 high_voltage = msm_psy_batt_data.voltage_max_design;
607
608 return (current_voltage - low_voltage) * 100
609 / (high_voltage - low_voltage);
610}
611
612static struct platform_device msm_batt_device = {
613 .name = "msm-battery",
614 .id = -1,
615 .dev.platform_data = &msm_psy_batt_data,
616};
617
618static struct smsc911x_platform_config smsc911x_config = {
619 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
620 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
621 .flags = SMSC911X_USE_16BIT,
622};
623
624static struct resource smsc911x_resources[] = {
625 [0] = {
626 .start = 0x90000000,
627 .end = 0x90007fff,
628 .flags = IORESOURCE_MEM,
629 },
630 [1] = {
631 .start = MSM_GPIO_TO_INT(48),
632 .end = MSM_GPIO_TO_INT(48),
633 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
634 },
635};
636
637static struct platform_device smsc911x_device = {
638 .name = "smsc911x",
639 .id = 0,
640 .num_resources = ARRAY_SIZE(smsc911x_resources),
641 .resource = smsc911x_resources,
642 .dev = {
643 .platform_data = &smsc911x_config,
644 },
645};
646
647static struct msm_gpio smsc911x_gpios[] = {
648 { GPIO_CFG(48, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
649 "smsc911x_irq" },
650 { GPIO_CFG(49, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
651 "eth_fifo_sel" },
652};
653
654#define ETH_FIFO_SEL_GPIO 49
655static void msm7x27a_cfg_smsc911x(void)
656{
657 int res;
658
659 res = msm_gpios_request_enable(smsc911x_gpios,
660 ARRAY_SIZE(smsc911x_gpios));
661 if (res) {
662 pr_err("%s: unable to enable gpios for SMSC911x\n", __func__);
663 return;
664 }
665
666 /* ETH_FIFO_SEL */
667 res = gpio_direction_output(ETH_FIFO_SEL_GPIO, 0);
668 if (res) {
669 pr_err("%s: unable to get direction for gpio %d\n", __func__,
670 ETH_FIFO_SEL_GPIO);
671 msm_gpios_disable_free(smsc911x_gpios,
672 ARRAY_SIZE(smsc911x_gpios));
673 return;
674 }
675 gpio_set_value(ETH_FIFO_SEL_GPIO, 0);
676}
677
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700678#if defined(CONFIG_SERIAL_MSM_HSL_CONSOLE) \
679 && defined(CONFIG_MSM_SHARED_GPIO_FOR_UART2DM)
680static struct msm_gpio uart2dm_gpios[] = {
681 {GPIO_CFG(19, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
682 "uart2dm_rfr_n" },
683 {GPIO_CFG(20, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
684 "uart2dm_cts_n" },
685 {GPIO_CFG(21, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
686 "uart2dm_rx" },
687 {GPIO_CFG(108, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
688 "uart2dm_tx" },
689};
690
691static void msm7x27a_cfg_uart2dm_serial(void)
692{
693 int ret;
694 ret = msm_gpios_request_enable(uart2dm_gpios,
695 ARRAY_SIZE(uart2dm_gpios));
696 if (ret)
697 pr_err("%s: unable to enable gpios for uart2dm\n", __func__);
698}
699#else
700static void msm7x27a_cfg_uart2dm_serial(void) { }
701#endif
702
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800703struct fmem_platform_data fmem_pdata;
704
705struct platform_device fmem_device = {
706 .name = "fmem",
707 .id = -1,
708 .dev = { .platform_data = &fmem_pdata },
709};
710
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700711static struct platform_device *rumi_sim_devices[] __initdata = {
712 &msm_device_dmov,
713 &msm_device_smd,
714 &smc91x_device,
715 &msm_device_uart1,
716 &msm_device_nand,
717 &msm_device_uart_dm1,
718 &msm_gsbi0_qup_i2c_device,
719 &msm_gsbi1_qup_i2c_device,
720};
721
Taniya Das43bcdd62011-12-02 17:33:27 +0530722static struct platform_device *msm8625_rumi3_devices[] __initdata = {
723 &msm8625_device_dmov,
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530724 &msm8625_device_smd,
Taniya Das43bcdd62011-12-02 17:33:27 +0530725 &msm8625_device_uart1,
Taniya Dase3027e22012-02-27 16:32:27 +0530726 &msm8625_gsbi0_qup_i2c_device,
Taniya Das43bcdd62011-12-02 17:33:27 +0530727};
728
Taniya Dase3027e22012-02-27 16:32:27 +0530729static struct platform_device *msm7627a_surf_ffa_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700730 &msm_device_dmov,
731 &msm_device_smd,
732 &msm_device_uart1,
733 &msm_device_uart_dm1,
734 &msm_device_uart_dm2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700735 &msm_gsbi0_qup_i2c_device,
736 &msm_gsbi1_qup_i2c_device,
737 &msm_device_otg,
738 &msm_device_gadget_peripheral,
Taniya Dase3027e22012-02-27 16:32:27 +0530739 &smsc911x_device,
740 &msm_kgsl_3d0,
741};
742
743static struct platform_device *common_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700744 &android_usb_device,
745 &android_pmem_device,
746 &android_pmem_adsp_device,
747 &android_pmem_audio_device,
Taniya Dase3027e22012-02-27 16:32:27 +0530748 &fmem_device,
749 &msm_device_nand,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700750 &msm_device_snd,
751 &msm_device_adspdec,
Manish Dewangan3a260992011-06-24 18:01:34 +0530752 &asoc_msm_pcm,
753 &asoc_msm_dai0,
754 &asoc_msm_dai1,
Taniya Dase3027e22012-02-27 16:32:27 +0530755 &msm_batt_device,
756};
757
758static struct platform_device *msm8625_surf_devices[] __initdata = {
759 &msm8625_device_dmov,
760 &msm8625_device_uart1,
761 &msm8625_device_uart_dm1,
762 &msm8625_device_uart_dm2,
763 &msm8625_gsbi0_qup_i2c_device,
764 &msm8625_gsbi1_qup_i2c_device,
Taniya Dasf2665302012-02-28 16:54:54 +0530765 &msm8625_device_smd,
Taniya Dase3027e22012-02-27 16:32:27 +0530766 &msm8625_device_otg,
767 &msm8625_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700768};
769
770static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE;
771static int __init pmem_kernel_ebi1_size_setup(char *p)
772{
773 pmem_kernel_ebi1_size = memparse(p, NULL);
774 return 0;
775}
776early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
777
778static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
779static int __init pmem_audio_size_setup(char *p)
780{
781 pmem_audio_size = memparse(p, NULL);
782 return 0;
783}
784early_param("pmem_audio_size", pmem_audio_size_setup);
785
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700786static struct memtype_reserve msm7x27a_reserve_table[] __initdata = {
787 [MEMTYPE_SMI] = {
788 },
789 [MEMTYPE_EBI0] = {
790 .flags = MEMTYPE_FLAGS_1M_ALIGN,
791 },
792 [MEMTYPE_EBI1] = {
793 .flags = MEMTYPE_FLAGS_1M_ALIGN,
794 },
795};
796
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800797#ifdef CONFIG_ANDROID_PMEM
798static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = {
799 &android_pmem_adsp_pdata,
800 &android_pmem_audio_pdata,
801 &android_pmem_pdata,
802};
803#endif
804
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700805static void __init size_pmem_devices(void)
806{
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800807#ifdef CONFIG_ANDROID_PMEM
808 unsigned int i;
809 unsigned int reusable_count = 0;
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530810
811 if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
812 pmem_mdp_size = MSM7x25A_MSM_PMEM_MDP_SIZE;
813 pmem_adsp_size = MSM7x25A_MSM_PMEM_ADSP_SIZE;
814 } else {
815 pmem_mdp_size = MSM_PMEM_MDP_SIZE;
816 pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
817 }
818
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700819 android_pmem_adsp_pdata.size = pmem_adsp_size;
820 android_pmem_pdata.size = pmem_mdp_size;
821 android_pmem_audio_pdata.size = pmem_audio_size;
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800822
823 fmem_pdata.size = 0;
824
825 /* Find pmem devices that should use FMEM (reusable) memory.
826 */
827 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
828 struct android_pmem_platform_data *pdata = pmem_pdata_array[i];
829
830 if (!reusable_count && pdata->reusable)
831 fmem_pdata.size += pdata->size;
832
833 reusable_count += (pdata->reusable) ? 1 : 0;
834
835 if (pdata->reusable && reusable_count > 1) {
836 pr_err("%s: Too many PMEM devices specified as reusable. PMEM device %s was not configured as reusable.\n",
837 __func__, pdata->name);
838 pdata->reusable = 0;
839 }
840 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700841#endif
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800842
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700843}
844
845static void __init reserve_memory_for(struct android_pmem_platform_data *p)
846{
847 msm7x27a_reserve_table[p->memory_type].size += p->size;
848}
849
850static void __init reserve_pmem_memory(void)
851{
852#ifdef CONFIG_ANDROID_PMEM
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800853 unsigned int i;
854 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
855 if (!pmem_pdata_array[i]->reusable)
856 reserve_memory_for(pmem_pdata_array[i]);
857 }
858
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700859 msm7x27a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
860#endif
861}
862
863static void __init msm7x27a_calculate_reserve_sizes(void)
864{
865 size_pmem_devices();
866 reserve_pmem_memory();
867}
868
869static int msm7x27a_paddr_to_memtype(unsigned int paddr)
870{
871 return MEMTYPE_EBI1;
872}
873
874static struct reserve_info msm7x27a_reserve_info __initdata = {
875 .memtype_reserve_table = msm7x27a_reserve_table,
876 .calculate_reserve_sizes = msm7x27a_calculate_reserve_sizes,
877 .paddr_to_memtype = msm7x27a_paddr_to_memtype,
878};
879
880static void __init msm7x27a_reserve(void)
881{
882 reserve_info = &msm7x27a_reserve_info;
883 msm_reserve();
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800884 fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700885}
886
Taniya Das2b16d1d2011-12-02 14:44:19 +0530887static void __init msm8625_reserve(void)
888{
Taniya Dase3027e22012-02-27 16:32:27 +0530889 msm7x27a_reserve();
Murali Nalajala41786ab2012-03-06 10:47:32 +0530890 memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
891 msm_pm_8625_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
Taniya Das2b16d1d2011-12-02 14:44:19 +0530892}
893
Taniya Dase3027e22012-02-27 16:32:27 +0530894static void __init msm7x27a_device_i2c_init(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700895{
896 msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata;
897 msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
898}
899
Taniya Dase3027e22012-02-27 16:32:27 +0530900static void __init msm8625_device_i2c_init(void)
901{
902 msm8625_gsbi0_qup_i2c_device.dev.platform_data =
903 &msm_gsbi0_qup_i2c_pdata;
904 msm8625_gsbi1_qup_i2c_device.dev.platform_data =
905 &msm_gsbi1_qup_i2c_pdata;
906}
907
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700908#define MSM_EBI2_PHYS 0xa0d00000
909#define MSM_EBI2_XMEM_CS2_CFG1 0xa0d10030
910
911static void __init msm7x27a_init_ebi2(void)
912{
913 uint32_t ebi2_cfg;
914 void __iomem *ebi2_cfg_ptr;
915
916 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_PHYS, sizeof(uint32_t));
917 if (!ebi2_cfg_ptr)
918 return;
919
920 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +0530921 if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf() ||
Taniya Dase3027e22012-02-27 16:32:27 +0530922 machine_is_msm7625a_surf() || machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700923 ebi2_cfg |= (1 << 4); /* CS2 */
924
925 writel(ebi2_cfg, ebi2_cfg_ptr);
926 iounmap(ebi2_cfg_ptr);
927
928 /* Enable A/D MUX[bit 31] from EBI2_XMEM_CS2_CFG1 */
929 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_XMEM_CS2_CFG1,
930 sizeof(uint32_t));
931 if (!ebi2_cfg_ptr)
932 return;
933
934 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +0530935 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700936 ebi2_cfg |= (1 << 31);
937
938 writel(ebi2_cfg, ebi2_cfg_ptr);
939 iounmap(ebi2_cfg_ptr);
940}
941
942#define ATMEL_TS_I2C_NAME "maXTouch"
Justin Paupored98328e2011-08-19 13:48:31 -0700943
944static struct regulator_bulk_data regs_atmel[] = {
945 { .supply = "ldo2", .min_uV = 2850000, .max_uV = 2850000 },
946 { .supply = "smps3", .min_uV = 1800000, .max_uV = 1800000 },
947};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700948
949#define ATMEL_TS_GPIO_IRQ 82
950
951static int atmel_ts_power_on(bool on)
952{
Justin Paupored98328e2011-08-19 13:48:31 -0700953 int rc = on ?
954 regulator_bulk_enable(ARRAY_SIZE(regs_atmel), regs_atmel) :
955 regulator_bulk_disable(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700956
Justin Paupored98328e2011-08-19 13:48:31 -0700957 if (rc)
958 pr_err("%s: could not %sable regulators: %d\n",
959 __func__, on ? "en" : "dis", rc);
960 else
961 msleep(50);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700962
Justin Paupored98328e2011-08-19 13:48:31 -0700963 return rc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700964}
965
966static int atmel_ts_platform_init(struct i2c_client *client)
967{
968 int rc;
Justin Paupored98328e2011-08-19 13:48:31 -0700969 struct device *dev = &client->dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700970
Justin Paupored98328e2011-08-19 13:48:31 -0700971 rc = regulator_bulk_get(dev, ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700972 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700973 dev_err(dev, "%s: could not get regulators: %d\n",
974 __func__, rc);
975 goto out;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700976 }
977
Justin Paupored98328e2011-08-19 13:48:31 -0700978 rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700979 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700980 dev_err(dev, "%s: could not set voltages: %d\n",
981 __func__, rc);
982 goto reg_free;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700983 }
984
985 rc = gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
986 GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
987 GPIO_CFG_8MA), GPIO_CFG_ENABLE);
988 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700989 dev_err(dev, "%s: gpio_tlmm_config for %d failed\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700990 __func__, ATMEL_TS_GPIO_IRQ);
Justin Paupored98328e2011-08-19 13:48:31 -0700991 goto reg_free;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700992 }
993
994 /* configure touchscreen interrupt gpio */
995 rc = gpio_request(ATMEL_TS_GPIO_IRQ, "atmel_maxtouch_gpio");
996 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700997 dev_err(dev, "%s: unable to request gpio %d\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700998 __func__, ATMEL_TS_GPIO_IRQ);
999 goto ts_gpio_tlmm_unconfig;
1000 }
1001
1002 rc = gpio_direction_input(ATMEL_TS_GPIO_IRQ);
1003 if (rc < 0) {
Justin Paupored98328e2011-08-19 13:48:31 -07001004 dev_err(dev, "%s: unable to set the direction of gpio %d\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001005 __func__, ATMEL_TS_GPIO_IRQ);
1006 goto free_ts_gpio;
1007 }
1008 return 0;
1009
1010free_ts_gpio:
1011 gpio_free(ATMEL_TS_GPIO_IRQ);
1012ts_gpio_tlmm_unconfig:
1013 gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
1014 GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
1015 GPIO_CFG_2MA), GPIO_CFG_DISABLE);
Justin Paupored98328e2011-08-19 13:48:31 -07001016reg_free:
1017 regulator_bulk_free(ARRAY_SIZE(regs_atmel), regs_atmel);
1018out:
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001019 return rc;
1020}
1021
1022static int atmel_ts_platform_exit(struct i2c_client *client)
1023{
1024 gpio_free(ATMEL_TS_GPIO_IRQ);
1025 gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
1026 GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
1027 GPIO_CFG_2MA), GPIO_CFG_DISABLE);
Justin Paupored98328e2011-08-19 13:48:31 -07001028 regulator_bulk_free(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001029 return 0;
1030}
1031
1032static u8 atmel_ts_read_chg(void)
1033{
1034 return gpio_get_value(ATMEL_TS_GPIO_IRQ);
1035}
1036
1037static u8 atmel_ts_valid_interrupt(void)
1038{
1039 return !atmel_ts_read_chg();
1040}
1041
1042#define ATMEL_X_OFFSET 13
1043#define ATMEL_Y_OFFSET 0
1044
Mohan Pallaka4e9a94e2011-11-23 16:34:21 +05301045static struct maxtouch_platform_data atmel_ts_pdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001046 .numtouch = 4,
1047 .init_platform_hw = atmel_ts_platform_init,
1048 .exit_platform_hw = atmel_ts_platform_exit,
1049 .power_on = atmel_ts_power_on,
1050 .display_res_x = 480,
1051 .display_res_y = 864,
1052 .min_x = ATMEL_X_OFFSET,
1053 .max_x = (505 - ATMEL_X_OFFSET),
1054 .min_y = ATMEL_Y_OFFSET,
1055 .max_y = (863 - ATMEL_Y_OFFSET),
1056 .valid_interrupt = atmel_ts_valid_interrupt,
1057 .read_chg = atmel_ts_read_chg,
1058};
1059
1060static struct i2c_board_info atmel_ts_i2c_info[] __initdata = {
1061 {
1062 I2C_BOARD_INFO(ATMEL_TS_I2C_NAME, 0x4a),
1063 .platform_data = &atmel_ts_pdata,
1064 .irq = MSM_GPIO_TO_INT(ATMEL_TS_GPIO_IRQ),
1065 },
1066};
1067
1068#define KP_INDEX(row, col) ((row)*ARRAY_SIZE(kp_col_gpios) + (col))
1069
1070static unsigned int kp_row_gpios[] = {31, 32, 33, 34, 35};
1071static unsigned int kp_col_gpios[] = {36, 37, 38, 39, 40};
1072
1073static const unsigned short keymap[ARRAY_SIZE(kp_col_gpios) *
1074 ARRAY_SIZE(kp_row_gpios)] = {
1075 [KP_INDEX(0, 0)] = KEY_7,
1076 [KP_INDEX(0, 1)] = KEY_DOWN,
1077 [KP_INDEX(0, 2)] = KEY_UP,
1078 [KP_INDEX(0, 3)] = KEY_RIGHT,
1079 [KP_INDEX(0, 4)] = KEY_ENTER,
1080
1081 [KP_INDEX(1, 0)] = KEY_LEFT,
1082 [KP_INDEX(1, 1)] = KEY_SEND,
1083 [KP_INDEX(1, 2)] = KEY_1,
1084 [KP_INDEX(1, 3)] = KEY_4,
1085 [KP_INDEX(1, 4)] = KEY_CLEAR,
1086
1087 [KP_INDEX(2, 0)] = KEY_6,
1088 [KP_INDEX(2, 1)] = KEY_5,
1089 [KP_INDEX(2, 2)] = KEY_8,
1090 [KP_INDEX(2, 3)] = KEY_3,
1091 [KP_INDEX(2, 4)] = KEY_NUMERIC_STAR,
1092
1093 [KP_INDEX(3, 0)] = KEY_9,
1094 [KP_INDEX(3, 1)] = KEY_NUMERIC_POUND,
1095 [KP_INDEX(3, 2)] = KEY_0,
1096 [KP_INDEX(3, 3)] = KEY_2,
1097 [KP_INDEX(3, 4)] = KEY_SLEEP,
1098
1099 [KP_INDEX(4, 0)] = KEY_BACK,
1100 [KP_INDEX(4, 1)] = KEY_HOME,
1101 [KP_INDEX(4, 2)] = KEY_MENU,
1102 [KP_INDEX(4, 3)] = KEY_VOLUMEUP,
1103 [KP_INDEX(4, 4)] = KEY_VOLUMEDOWN,
1104};
1105
1106/* SURF keypad platform device information */
1107static struct gpio_event_matrix_info kp_matrix_info = {
1108 .info.func = gpio_event_matrix_func,
1109 .keymap = keymap,
1110 .output_gpios = kp_row_gpios,
1111 .input_gpios = kp_col_gpios,
1112 .noutputs = ARRAY_SIZE(kp_row_gpios),
1113 .ninputs = ARRAY_SIZE(kp_col_gpios),
1114 .settle_time.tv_nsec = 40 * NSEC_PER_USEC,
1115 .poll_time.tv_nsec = 20 * NSEC_PER_MSEC,
1116 .flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE |
1117 GPIOKPF_PRINT_UNMAPPED_KEYS,
1118};
1119
1120static struct gpio_event_info *kp_info[] = {
1121 &kp_matrix_info.info
1122};
1123
1124static struct gpio_event_platform_data kp_pdata = {
1125 .name = "7x27a_kp",
1126 .info = kp_info,
1127 .info_count = ARRAY_SIZE(kp_info)
1128};
1129
1130static struct platform_device kp_pdev = {
1131 .name = GPIO_EVENT_DEV_NAME,
1132 .id = -1,
1133 .dev = {
1134 .platform_data = &kp_pdata,
1135 },
1136};
1137
1138static struct msm_handset_platform_data hs_platform_data = {
1139 .hs_name = "7k_handset",
1140 .pwr_key_delay_ms = 500, /* 0 will disable end key */
1141};
1142
1143static struct platform_device hs_pdev = {
1144 .name = "msm-handset",
1145 .id = -1,
1146 .dev = {
1147 .platform_data = &hs_platform_data,
1148 },
1149};
1150
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001151static struct platform_device msm_proccomm_regulator_dev = {
1152 .name = PROCCOMM_REGULATOR_DEV_NAME,
1153 .id = -1,
1154 .dev = {
1155 .platform_data = &msm7x27a_proccomm_regulator_data
1156 }
1157};
1158
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301159static void msm_adsp_add_pdev(void)
1160{
1161 int rc = 0;
1162 struct rpc_board_dev *rpc_adsp_pdev;
1163
1164 rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL);
1165 if (rpc_adsp_pdev == NULL) {
1166 pr_err("%s: Memory Allocation failure\n", __func__);
1167 return;
1168 }
1169 rpc_adsp_pdev->prog = ADSP_RPC_PROG;
Taniya Dase3027e22012-02-27 16:32:27 +05301170
1171 if (cpu_is_msm8625())
1172 rpc_adsp_pdev->pdev = msm8625_device_adsp;
1173 else
1174 rpc_adsp_pdev->pdev = msm_adsp_device;
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301175 rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1);
1176 if (rc < 0) {
1177 pr_err("%s: return val: %d\n", __func__, rc);
1178 kfree(rpc_adsp_pdev);
1179 }
1180}
1181
Trilok Soni16f61af2011-07-26 16:06:58 +05301182static void __init msm7627a_rumi3_init(void)
1183{
1184 msm7x27a_init_ebi2();
1185 platform_add_devices(rumi_sim_devices,
1186 ARRAY_SIZE(rumi_sim_devices));
1187}
1188
Taniya Das43bcdd62011-12-02 17:33:27 +05301189static void __init msm8625_rumi3_init(void)
1190{
1191 msm7x2x_misc_init();
Taniya Dase3027e22012-02-27 16:32:27 +05301192 msm_adsp_add_pdev();
1193 msm8625_device_i2c_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301194 platform_add_devices(msm8625_rumi3_devices,
1195 ARRAY_SIZE(msm8625_rumi3_devices));
Murali Nalajala41786ab2012-03-06 10:47:32 +05301196
1197 BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
1198 msm8x25_spm_device_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301199}
1200
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001201#define LED_GPIO_PDM 96
1202#define UART1DM_RX_GPIO 45
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301203
1204#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
1205static int __init msm7x27a_init_ar6000pm(void)
1206{
Santosh Sajjan374d6592012-01-19 23:16:46 +05301207 msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power;
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301208 return platform_device_register(&msm_wlan_ar6000_pm_device);
1209}
1210#else
1211static int __init msm7x27a_init_ar6000pm(void) { return 0; }
1212#endif
1213
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001214static void __init msm7x27a_init_regulators(void)
1215{
1216 int rc = platform_device_register(&msm_proccomm_regulator_dev);
1217 if (rc)
1218 pr_err("%s: could not register regulator device: %d\n",
1219 __func__, rc);
1220}
1221
Taniya Dase3027e22012-02-27 16:32:27 +05301222static void __init msm7x27a_add_footswitch_devices(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001223{
Trilok Soni16f61af2011-07-26 16:06:58 +05301224 platform_add_devices(msm_footswitch_devices,
1225 msm_num_footswitch_devices);
Taniya Dase3027e22012-02-27 16:32:27 +05301226}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001227
Taniya Dase3027e22012-02-27 16:32:27 +05301228static void __init msm7x27a_add_platform_devices(void)
1229{
1230 if (machine_is_msm8625_surf()) {
1231 platform_add_devices(msm8625_surf_devices,
1232 ARRAY_SIZE(msm8625_surf_devices));
1233 } else {
1234 platform_add_devices(msm7627a_surf_ffa_devices,
1235 ARRAY_SIZE(msm7627a_surf_ffa_devices));
1236 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001237
Taniya Dase3027e22012-02-27 16:32:27 +05301238 platform_add_devices(common_devices,
1239 ARRAY_SIZE(common_devices));
1240}
1241
1242static void __init msm7x27a_uartdm_config(void)
1243{
1244 msm7x27a_cfg_uart2dm_serial();
1245 msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
1246 if (cpu_is_msm8625())
1247 msm8625_device_uart_dm1.dev.platform_data =
1248 &msm_uart_dm1_pdata;
1249 else
1250 msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
1251}
1252
1253static void __init msm7x27a_otg_gadget(void)
1254{
1255 msm_otg_pdata.swfi_latency =
1256 msm7x27a_pm_data[
1257 MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
1258 if (cpu_is_msm8625()) {
1259 msm8625_device_otg.dev.platform_data = &msm_otg_pdata;
1260 msm8625_device_gadget_peripheral.dev.platform_data =
1261 &msm_gadget_pdata;
1262 } else {
1263 msm_device_otg.dev.platform_data = &msm_otg_pdata;
1264 msm_device_gadget_peripheral.dev.platform_data =
1265 &msm_gadget_pdata;
1266 }
1267}
1268
1269static void __init msm7x27a_add_io_devices(void)
1270{
1271 /* touchscreen */
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301272 if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001273 atmel_ts_pdata.min_x = 0;
1274 atmel_ts_pdata.max_x = 480;
1275 atmel_ts_pdata.min_y = 0;
1276 atmel_ts_pdata.max_y = 320;
1277 }
1278
1279 i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
Taniya Dase3027e22012-02-27 16:32:27 +05301280 atmel_ts_i2c_info,
1281 ARRAY_SIZE(atmel_ts_i2c_info));
1282 /* keypad */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001283 platform_device_register(&kp_pdev);
Taniya Dase3027e22012-02-27 16:32:27 +05301284
1285 /* headset */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001286 platform_device_register(&hs_pdev);
1287
Taniya Dase3027e22012-02-27 16:32:27 +05301288 /* LED: configure it as a pdm function */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001289 if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
1290 GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
1291 GPIO_CFG_8MA), GPIO_CFG_ENABLE))
1292 pr_err("%s: gpio_tlmm_config for %d failed\n",
1293 __func__, LED_GPIO_PDM);
1294 else
1295 platform_device_register(&led_pdev);
1296
Taniya Dase3027e22012-02-27 16:32:27 +05301297 /* Vibrator */
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301298 if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001299 msm_init_pmic_vibrator();
Taniya Dase3027e22012-02-27 16:32:27 +05301300}
1301
1302static void __init msm7x27a_pm_init(void)
1303{
1304 if (machine_is_msm8625_surf())
1305 return;
1306
1307 msm_pm_set_platform_data(msm7x27a_pm_data,
1308 ARRAY_SIZE(msm7x27a_pm_data));
1309 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
1310}
1311
1312static void __init msm7x2x_init(void)
1313{
1314 msm7x2x_misc_init();
1315
1316 /* Initialize regulators first so that other devices can use them */
1317 msm7x27a_init_regulators();
1318 msm_adsp_add_pdev();
1319 if (cpu_is_msm8625())
1320 msm8625_device_i2c_init();
1321 else
1322 msm7x27a_device_i2c_init();
1323 msm7x27a_init_ebi2();
1324 msm7x27a_uartdm_config();
1325
1326 msm7x27a_otg_gadget();
1327 msm7x27a_cfg_smsc911x();
1328
1329 msm7x27a_add_footswitch_devices();
1330 msm7x27a_add_platform_devices();
1331 /* Ensure ar6000pm device is registered before MMC/SDC */
1332 msm7x27a_init_ar6000pm();
1333 msm7627a_init_mmc();
1334 msm_fb_add_devices();
1335 msm7x2x_init_host();
1336 msm7x27a_pm_init();
1337 register_i2c_devices();
1338 msm7627a_bt_power_init();
1339 msm7627a_camera_init();
1340 msm7x27a_add_io_devices();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001341 /*7x25a kgsl initializations*/
1342 msm7x25a_kgsl_3d0_init();
1343}
1344
1345static void __init msm7x2x_init_early(void)
1346{
Chintan Pandya250c2e52012-01-19 17:15:49 +05301347 msm_msm7627a_allocate_memory_regions();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001348}
1349
1350MACHINE_START(MSM7X27A_RUMI3, "QCT MSM7x27a RUMI3")
1351 .boot_params = PHYS_OFFSET + 0x100,
1352 .map_io = msm_common_io_init,
1353 .reserve = msm7x27a_reserve,
1354 .init_irq = msm_init_irq,
Trilok Soni16f61af2011-07-26 16:06:58 +05301355 .init_machine = msm7627a_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001356 .timer = &msm_timer,
1357 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301358 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001359MACHINE_END
1360MACHINE_START(MSM7X27A_SURF, "QCT MSM7x27a SURF")
1361 .boot_params = PHYS_OFFSET + 0x100,
1362 .map_io = msm_common_io_init,
1363 .reserve = msm7x27a_reserve,
1364 .init_irq = msm_init_irq,
1365 .init_machine = msm7x2x_init,
1366 .timer = &msm_timer,
1367 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301368 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001369MACHINE_END
1370MACHINE_START(MSM7X27A_FFA, "QCT MSM7x27a FFA")
1371 .boot_params = PHYS_OFFSET + 0x100,
1372 .map_io = msm_common_io_init,
1373 .reserve = msm7x27a_reserve,
1374 .init_irq = msm_init_irq,
1375 .init_machine = msm7x2x_init,
1376 .timer = &msm_timer,
1377 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301378 .handle_irq = vic_handle_irq,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001379MACHINE_END
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301380MACHINE_START(MSM7625A_SURF, "QCT MSM7625a SURF")
1381 .boot_params = PHYS_OFFSET + 0x100,
1382 .map_io = msm_common_io_init,
1383 .reserve = msm7x27a_reserve,
1384 .init_irq = msm_init_irq,
1385 .init_machine = msm7x2x_init,
1386 .timer = &msm_timer,
1387 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301388 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301389MACHINE_END
1390MACHINE_START(MSM7625A_FFA, "QCT MSM7625a FFA")
1391 .boot_params = PHYS_OFFSET + 0x100,
1392 .map_io = msm_common_io_init,
1393 .reserve = msm7x27a_reserve,
1394 .init_irq = msm_init_irq,
1395 .init_machine = msm7x2x_init,
1396 .timer = &msm_timer,
1397 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301398 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301399MACHINE_END
Taniya Das43bcdd62011-12-02 17:33:27 +05301400MACHINE_START(MSM8625_RUMI3, "QCT MSM8625 RUMI3")
1401 .boot_params = PHYS_OFFSET + 0x100,
1402 .map_io = msm8625_map_io,
Taniya Das2b16d1d2011-12-02 14:44:19 +05301403 .reserve = msm8625_reserve,
Taniya Das43bcdd62011-12-02 17:33:27 +05301404 .init_irq = msm8625_init_irq,
1405 .init_machine = msm8625_rumi3_init,
1406 .timer = &msm_timer,
1407 .handle_irq = gic_handle_irq,
1408MACHINE_END
Taniya Dase3027e22012-02-27 16:32:27 +05301409MACHINE_START(MSM8625_SURF, "QCT MSM8625 SURF")
1410 .boot_params = PHYS_OFFSET + 0x100,
1411 .map_io = msm8625_map_io,
1412 .reserve = msm8625_reserve,
1413 .init_irq = msm8625_init_irq,
1414 .init_machine = msm7x2x_init,
1415 .timer = &msm_timer,
1416 .init_early = msm7x2x_init_early,
1417 .handle_irq = gic_handle_irq,
1418MACHINE_END