blob: 9bcac2c7aaff1d8c5b50c33208e73c1149363272 [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>
17#include <asm/mach/arch.h>
Taniya Das43bcdd62011-12-02 17:33:27 +053018#include <asm/hardware/gic.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070019#include <mach/board.h>
20#include <mach/msm_iomap.h>
21#include <mach/msm_hsusb.h>
22#include <mach/rpc_hsusb.h>
23#include <mach/rpc_pmapp.h>
24#include <mach/usbdiag.h>
25#include <mach/msm_memtypes.h>
26#include <mach/msm_serial_hs.h>
27#include <linux/usb/android.h>
28#include <linux/platform_device.h>
29#include <linux/io.h>
30#include <linux/gpio.h>
31#include <mach/vreg.h>
32#include <mach/pmic.h>
33#include <mach/socinfo.h>
34#include <linux/mtd/nand.h>
35#include <linux/mtd/partitions.h>
36#include <asm/mach/mmc.h>
37#include <linux/i2c.h>
38#include <linux/i2c/sx150x.h>
39#include <linux/gpio.h>
40#include <linux/android_pmem.h>
41#include <linux/bootmem.h>
42#include <linux/mfd/marimba.h>
43#include <mach/vreg.h>
44#include <linux/power_supply.h>
Justin Paupored98328e2011-08-19 13:48:31 -070045#include <linux/regulator/consumer.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070046#include <mach/rpc_pmapp.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047#include <mach/msm_battery.h>
48#include <linux/smsc911x.h>
49#include <linux/atmel_maxtouch.h>
Laura Abbott8f3d58b2011-12-18 10:47:03 -080050#include <linux/fmem.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070051#include "devices.h"
52#include "timer.h"
Justin Pauporeb3a33b72011-08-23 15:30:32 -070053#include "board-msm7x27a-regulator.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054#include "devices-msm7x2xa.h"
Matt Wagantall7cca4642012-02-01 16:43:24 -080055#include "pm.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056#include <mach/rpc_server_handset.h>
57#include <mach/socinfo.h>
Maheshkumar Sivasubramanian8ccc16e2011-10-25 15:59:57 -060058#include "pm-boot.h"
Chintan Pandyacf467fc2011-12-01 17:11:11 +053059#include "board-msm7627a.h"
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070060
61#define PMEM_KERNEL_EBI1_SIZE 0x3A000
62#define MSM_PMEM_AUDIO_SIZE 0x5B000
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +053063#define ADSP_RPC_PROG 0x3000000a
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070064
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065#if defined(CONFIG_GPIO_SX150X)
66enum {
67 SX150X_CORE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070068};
69
70static struct sx150x_platform_data sx150x_data[] __initdata = {
71 [SX150X_CORE] = {
72 .gpio_base = GPIO_CORE_EXPANDER_BASE,
73 .oscio_is_gpo = false,
74 .io_pullup_ena = 0,
pankaj kumarc5c01392011-08-12 13:44:05 +053075 .io_pulldn_ena = 0x02,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070076 .io_open_drain_ena = 0xfef8,
77 .irq_summary = -1,
78 },
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070079};
80#endif
81
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070082
Santosh Sajjan6822c682011-07-26 10:49:36 +053083static struct platform_device msm_wlan_ar6000_pm_device = {
84 .name = "wlan_ar6000_pm_dev",
85 .id = -1,
86};
87
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070088#if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X)
89static struct i2c_board_info core_exp_i2c_info[] __initdata = {
90 {
91 I2C_BOARD_INFO("sx1509q", 0x3e),
92 },
93};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070094
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070095static void __init register_i2c_devices(void)
96{
Taniya Dase3027e22012-02-27 16:32:27 +053097 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
98 machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070099 sx150x_data[SX150X_CORE].io_open_drain_ena = 0xe0f0;
100
101 core_exp_i2c_info[0].platform_data =
102 &sx150x_data[SX150X_CORE];
103
104 i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
105 core_exp_i2c_info,
106 ARRAY_SIZE(core_exp_i2c_info));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700107}
108#endif
109
110static struct msm_gpio qup_i2c_gpios_io[] = {
111 { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
112 "qup_scl" },
113 { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
114 "qup_sda" },
115 { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
116 "qup_scl" },
117 { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
118 "qup_sda" },
119};
120
121static struct msm_gpio qup_i2c_gpios_hw[] = {
122 { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
123 "qup_scl" },
124 { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
125 "qup_sda" },
126 { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
127 "qup_scl" },
128 { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA),
129 "qup_sda" },
130};
131
132static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type)
133{
134 int rc;
135
136 if (adap_id < 0 || adap_id > 1)
137 return;
138
139 /* Each adapter gets 2 lines from the table */
140 if (config_type)
141 rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2);
142 else
143 rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2);
144 if (rc < 0)
145 pr_err("QUP GPIO request/enable failed: %d\n", rc);
146}
147
148static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = {
149 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700150 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
151};
152
153static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = {
154 .clk_freq = 100000,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700155 .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config,
156};
157
158#ifdef CONFIG_ARCH_MSM7X27A
Neti Ravi Kumar061726e2011-12-08 15:14:57 +0530159#define MSM_PMEM_MDP_SIZE 0x2300000
160#define MSM7x25A_MSM_PMEM_MDP_SIZE 0x1500000
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530161
Mahesh Lankaa2f6df12012-01-05 16:54:40 +0530162#define MSM_PMEM_ADSP_SIZE 0x1100000
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530163#define MSM7x25A_MSM_PMEM_ADSP_SIZE 0xB91000
164
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700165#endif
166
167static struct android_usb_platform_data android_usb_pdata = {
168 .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num,
169};
170
171static struct platform_device android_usb_device = {
172 .name = "android_usb",
173 .id = -1,
174 .dev = {
175 .platform_data = &android_usb_pdata,
176 },
177};
178
179#ifdef CONFIG_USB_EHCI_MSM_72K
180static void msm_hsusb_vbus_power(unsigned phy_info, int on)
181{
182 int rc = 0;
183 unsigned gpio;
184
185 gpio = GPIO_HOST_VBUS_EN;
186
187 rc = gpio_request(gpio, "i2c_host_vbus_en");
188 if (rc < 0) {
189 pr_err("failed to request %d GPIO\n", gpio);
190 return;
191 }
192 gpio_direction_output(gpio, !!on);
193 gpio_set_value_cansleep(gpio, !!on);
194 gpio_free(gpio);
195}
196
197static struct msm_usb_host_platform_data msm_usb_host_pdata = {
198 .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM),
199};
200
201static void __init msm7x2x_init_host(void)
202{
203 msm_add_host(0, &msm_usb_host_pdata);
204}
205#endif
206
207#ifdef CONFIG_USB_MSM_OTG_72K
208static int hsusb_rpc_connect(int connect)
209{
210 if (connect)
211 return msm_hsusb_rpc_connect();
212 else
213 return msm_hsusb_rpc_close();
214}
215
Justin Paupored98328e2011-08-19 13:48:31 -0700216static struct regulator *reg_hsusb;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700217static int msm_hsusb_ldo_init(int init)
218{
Justin Paupored98328e2011-08-19 13:48:31 -0700219 int rc = 0;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700220
Justin Paupored98328e2011-08-19 13:48:31 -0700221 if (init) {
222 reg_hsusb = regulator_get(NULL, "usb");
223 if (IS_ERR(reg_hsusb)) {
224 rc = PTR_ERR(reg_hsusb);
225 pr_err("%s: could not get regulator: %d\n",
226 __func__, rc);
227 goto out;
228 }
229
230 rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000);
231 if (rc) {
232 pr_err("%s: could not set voltage: %d\n",
233 __func__, rc);
234 goto reg_free;
235 }
236
237 return 0;
238 }
239 /* else fall through */
240reg_free:
241 regulator_put(reg_hsusb);
242out:
243 reg_hsusb = NULL;
244 return rc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700245}
246
247static int msm_hsusb_ldo_enable(int enable)
248{
249 static int ldo_status;
250
Justin Paupored98328e2011-08-19 13:48:31 -0700251 if (IS_ERR_OR_NULL(reg_hsusb))
252 return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700253
254 if (ldo_status == enable)
255 return 0;
256
257 ldo_status = enable;
258
Justin Paupored98328e2011-08-19 13:48:31 -0700259 return enable ?
260 regulator_enable(reg_hsusb) :
261 regulator_disable(reg_hsusb);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700262}
263
264#ifndef CONFIG_USB_EHCI_MSM_72K
265static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init)
266{
267 int ret = 0;
268
269 if (init)
270 ret = msm_pm_app_rpc_init(callback);
271 else
272 msm_pm_app_rpc_deinit(callback);
273
274 return ret;
275}
276#endif
277
278static struct msm_otg_platform_data msm_otg_pdata = {
279#ifndef CONFIG_USB_EHCI_MSM_72K
280 .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init,
281#else
282 .vbus_power = msm_hsusb_vbus_power,
283#endif
284 .rpc_connect = hsusb_rpc_connect,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700285 .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT,
286 .cdr_autoreset = CDR_AUTO_RESET_DISABLE,
287 .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT,
288 .se1_gating = SE1_GATING_DISABLE,
289 .ldo_init = msm_hsusb_ldo_init,
290 .ldo_enable = msm_hsusb_ldo_enable,
291 .chg_init = hsusb_chg_init,
292 .chg_connected = hsusb_chg_connected,
293 .chg_vbus_draw = hsusb_chg_vbus_draw,
294};
295#endif
296
297static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = {
298 .is_phy_status_timer_on = 1,
299};
300
301static struct resource smc91x_resources[] = {
302 [0] = {
303 .start = 0x90000300,
304 .end = 0x900003ff,
305 .flags = IORESOURCE_MEM,
306 },
307 [1] = {
308 .start = MSM_GPIO_TO_INT(4),
309 .end = MSM_GPIO_TO_INT(4),
310 .flags = IORESOURCE_IRQ,
311 },
312};
313
314static struct platform_device smc91x_device = {
315 .name = "smc91x",
316 .id = 0,
317 .num_resources = ARRAY_SIZE(smc91x_resources),
318 .resource = smc91x_resources,
319};
320
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700321#ifdef CONFIG_SERIAL_MSM_HS
322static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = {
323 .inject_rx_on_wakeup = 1,
324 .rx_to_inject = 0xFD,
325};
326#endif
327static struct msm_pm_platform_data msm7x27a_pm_data[MSM_PM_SLEEP_MODE_NR] = {
Murali Nalajalab10363d2012-01-12 16:29:01 +0530328 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700329 .idle_supported = 1,
330 .suspend_supported = 1,
331 .idle_enabled = 1,
332 .suspend_enabled = 1,
333 .latency = 16000,
334 .residency = 20000,
335 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530336 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700337 .idle_supported = 1,
338 .suspend_supported = 1,
339 .idle_enabled = 1,
340 .suspend_enabled = 1,
341 .latency = 12000,
342 .residency = 20000,
343 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530344 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700345 .idle_supported = 1,
346 .suspend_supported = 1,
347 .idle_enabled = 0,
348 .suspend_enabled = 1,
349 .latency = 2000,
350 .residency = 0,
351 },
Murali Nalajalab10363d2012-01-12 16:29:01 +0530352 [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700353 .idle_supported = 1,
354 .suspend_supported = 1,
355 .idle_enabled = 1,
356 .suspend_enabled = 1,
357 .latency = 2,
358 .residency = 0,
359 },
360};
361
Sujit Reddy Thummaca0c1062012-02-24 14:47:05 +0530362u32 msm7627a_power_collapse_latency(enum msm_pm_sleep_mode mode)
363{
364 switch (mode) {
365 case MSM_PM_SLEEP_MODE_POWER_COLLAPSE:
366 return msm7x27a_pm_data
367 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE].latency;
368 case MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN:
369 return msm7x27a_pm_data
370 [MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN].latency;
371 case MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT:
372 return msm7x27a_pm_data
373 [MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
374 case MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT:
375 return msm7x27a_pm_data
376 [MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency;
377 default:
378 return 0;
379 }
380}
381
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600382static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = {
Sravan Kumar Ambapuramb22cf4d2012-01-02 21:45:04 +0530383 .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS,
384 .p_addr = 0,
Maheshkumar Sivasubramanianc6c55032011-10-25 16:01:32 -0600385};
386
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700387static struct android_pmem_platform_data android_pmem_adsp_pdata = {
388 .name = "pmem_adsp",
389 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
Mahesh Lankac6af7eb2011-08-02 18:00:35 +0530390 .cached = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700391 .memory_type = MEMTYPE_EBI1,
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800392 .request_region = request_fmem_c_region,
393 .release_region = release_fmem_c_region,
394 .reusable = 1,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700395};
396
397static struct platform_device android_pmem_adsp_device = {
398 .name = "android_pmem",
399 .id = 1,
400 .dev = { .platform_data = &android_pmem_adsp_pdata },
401};
402
403static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE;
404static int __init pmem_mdp_size_setup(char *p)
405{
406 pmem_mdp_size = memparse(p, NULL);
407 return 0;
408}
409
410early_param("pmem_mdp_size", pmem_mdp_size_setup);
411
412static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
413static int __init pmem_adsp_size_setup(char *p)
414{
415 pmem_adsp_size = memparse(p, NULL);
416 return 0;
417}
418
419early_param("pmem_adsp_size", pmem_adsp_size_setup);
420
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700421#define SND(desc, num) { .name = #desc, .id = num }
422static struct snd_endpoint snd_endpoints_list[] = {
423 SND(HANDSET, 0),
424 SND(MONO_HEADSET, 2),
425 SND(HEADSET, 3),
426 SND(SPEAKER, 6),
427 SND(TTY_HEADSET, 8),
428 SND(TTY_VCO, 9),
429 SND(TTY_HCO, 10),
430 SND(BT, 12),
431 SND(IN_S_SADC_OUT_HANDSET, 16),
432 SND(IN_S_SADC_OUT_SPEAKER_PHONE, 25),
433 SND(FM_DIGITAL_STEREO_HEADSET, 26),
434 SND(FM_DIGITAL_SPEAKER_PHONE, 27),
435 SND(FM_DIGITAL_BT_A2DP_HEADSET, 28),
Shashi Kumar64e07602011-10-11 13:18:57 +0530436 SND(STEREO_HEADSET_AND_SPEAKER, 31),
Sidipotu Ashokab34ca42011-07-22 16:34:20 +0530437 SND(CURRENT, 0x7FFFFFFE),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700438 SND(FM_ANALOG_STEREO_HEADSET, 35),
439 SND(FM_ANALOG_STEREO_HEADSET_CODEC, 36),
440};
441#undef SND
442
443static struct msm_snd_endpoints msm_device_snd_endpoints = {
444 .endpoints = snd_endpoints_list,
445 .num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint)
446};
447
448static struct platform_device msm_device_snd = {
449 .name = "msm_snd",
450 .id = -1,
451 .dev = {
452 .platform_data = &msm_device_snd_endpoints
453 },
454};
455
456#define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
457 (1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
458 (1<<MSM_ADSP_CODEC_WMAPRO)|(1<<MSM_ADSP_CODEC_AMRWB)| \
459 (1<<MSM_ADSP_CODEC_AMRNB)|(1<<MSM_ADSP_CODEC_WAV)| \
460 (1<<MSM_ADSP_CODEC_ADPCM)|(1<<MSM_ADSP_CODEC_YADPCM)| \
461 (1<<MSM_ADSP_CODEC_EVRC)|(1<<MSM_ADSP_CODEC_QCELP))
462#define DEC1_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 DEC2_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 DEC3_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 DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI)
481
482static unsigned int dec_concurrency_table[] = {
483 /* Audio LP */
484 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DMA)), 0,
485 0, 0, 0,
486
487 /* Concurrency 1 */
488 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
489 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
490 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
491 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
492 (DEC4_FORMAT),
493
494 /* Concurrency 2 */
495 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
496 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
497 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
498 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
499 (DEC4_FORMAT),
500
501 /* Concurrency 3 */
502 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
503 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
504 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
505 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
506 (DEC4_FORMAT),
507
508 /* Concurrency 4 */
509 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
510 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
511 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
512 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
513 (DEC4_FORMAT),
514
515 /* Concurrency 5 */
516 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_TUNNEL)|(1<<MSM_ADSP_OP_DM)),
517 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
518 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
519 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
520 (DEC4_FORMAT),
521
522 /* Concurrency 6 */
523 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
524 0, 0, 0, 0,
525
526 /* Concurrency 7 */
527 (DEC0_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
528 (DEC1_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
529 (DEC2_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
530 (DEC3_FORMAT|(1<<MSM_ADSP_MODE_NONTUNNEL)|(1<<MSM_ADSP_OP_DM)),
531 (DEC4_FORMAT),
532};
533
534#define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \
535 .module_queueid = queueid, .module_decid = decid, \
536 .nr_codec_support = nr_codec}
537
538static struct msm_adspdec_info dec_info_list[] = {
539 DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* AudPlay0BitStreamCtrlQueue */
540 DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* AudPlay1BitStreamCtrlQueue */
541 DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* AudPlay2BitStreamCtrlQueue */
542 DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* AudPlay3BitStreamCtrlQueue */
543 DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* AudPlay4BitStreamCtrlQueue */
544};
545
546static struct msm_adspdec_database msm_device_adspdec_database = {
547 .num_dec = ARRAY_SIZE(dec_info_list),
548 .num_concurrency_support = (ARRAY_SIZE(dec_concurrency_table) / \
549 ARRAY_SIZE(dec_info_list)),
550 .dec_concurrency_table = dec_concurrency_table,
551 .dec_info_list = dec_info_list,
552};
553
554static struct platform_device msm_device_adspdec = {
555 .name = "msm_adspdec",
556 .id = -1,
557 .dev = {
558 .platform_data = &msm_device_adspdec_database
559 },
560};
561
562static struct android_pmem_platform_data android_pmem_audio_pdata = {
563 .name = "pmem_audio",
564 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
565 .cached = 0,
566 .memory_type = MEMTYPE_EBI1,
567};
568
569static struct platform_device android_pmem_audio_device = {
570 .name = "android_pmem",
571 .id = 2,
572 .dev = { .platform_data = &android_pmem_audio_pdata },
573};
574
575static struct android_pmem_platform_data android_pmem_pdata = {
576 .name = "pmem",
577 .allocator_type = PMEM_ALLOCATORTYPE_BITMAP,
578 .cached = 1,
579 .memory_type = MEMTYPE_EBI1,
580};
581static struct platform_device android_pmem_device = {
582 .name = "android_pmem",
583 .id = 0,
584 .dev = { .platform_data = &android_pmem_pdata },
585};
586
587static u32 msm_calculate_batt_capacity(u32 current_voltage);
588
589static struct msm_psy_batt_pdata msm_psy_batt_data = {
590 .voltage_min_design = 2800,
591 .voltage_max_design = 4300,
592 .avail_chg_sources = AC_CHG | USB_CHG ,
593 .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
594 .calculate_capacity = &msm_calculate_batt_capacity,
595};
596
597static u32 msm_calculate_batt_capacity(u32 current_voltage)
598{
599 u32 low_voltage = msm_psy_batt_data.voltage_min_design;
600 u32 high_voltage = msm_psy_batt_data.voltage_max_design;
601
602 return (current_voltage - low_voltage) * 100
603 / (high_voltage - low_voltage);
604}
605
606static struct platform_device msm_batt_device = {
607 .name = "msm-battery",
608 .id = -1,
609 .dev.platform_data = &msm_psy_batt_data,
610};
611
612static struct smsc911x_platform_config smsc911x_config = {
613 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
614 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
615 .flags = SMSC911X_USE_16BIT,
616};
617
618static struct resource smsc911x_resources[] = {
619 [0] = {
620 .start = 0x90000000,
621 .end = 0x90007fff,
622 .flags = IORESOURCE_MEM,
623 },
624 [1] = {
625 .start = MSM_GPIO_TO_INT(48),
626 .end = MSM_GPIO_TO_INT(48),
627 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
628 },
629};
630
631static struct platform_device smsc911x_device = {
632 .name = "smsc911x",
633 .id = 0,
634 .num_resources = ARRAY_SIZE(smsc911x_resources),
635 .resource = smsc911x_resources,
636 .dev = {
637 .platform_data = &smsc911x_config,
638 },
639};
640
641static struct msm_gpio smsc911x_gpios[] = {
642 { GPIO_CFG(48, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
643 "smsc911x_irq" },
644 { GPIO_CFG(49, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA),
645 "eth_fifo_sel" },
646};
647
648#define ETH_FIFO_SEL_GPIO 49
649static void msm7x27a_cfg_smsc911x(void)
650{
651 int res;
652
653 res = msm_gpios_request_enable(smsc911x_gpios,
654 ARRAY_SIZE(smsc911x_gpios));
655 if (res) {
656 pr_err("%s: unable to enable gpios for SMSC911x\n", __func__);
657 return;
658 }
659
660 /* ETH_FIFO_SEL */
661 res = gpio_direction_output(ETH_FIFO_SEL_GPIO, 0);
662 if (res) {
663 pr_err("%s: unable to get direction for gpio %d\n", __func__,
664 ETH_FIFO_SEL_GPIO);
665 msm_gpios_disable_free(smsc911x_gpios,
666 ARRAY_SIZE(smsc911x_gpios));
667 return;
668 }
669 gpio_set_value(ETH_FIFO_SEL_GPIO, 0);
670}
671
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700672#if defined(CONFIG_SERIAL_MSM_HSL_CONSOLE) \
673 && defined(CONFIG_MSM_SHARED_GPIO_FOR_UART2DM)
674static struct msm_gpio uart2dm_gpios[] = {
675 {GPIO_CFG(19, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
676 "uart2dm_rfr_n" },
677 {GPIO_CFG(20, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
678 "uart2dm_cts_n" },
679 {GPIO_CFG(21, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
680 "uart2dm_rx" },
681 {GPIO_CFG(108, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
682 "uart2dm_tx" },
683};
684
685static void msm7x27a_cfg_uart2dm_serial(void)
686{
687 int ret;
688 ret = msm_gpios_request_enable(uart2dm_gpios,
689 ARRAY_SIZE(uart2dm_gpios));
690 if (ret)
691 pr_err("%s: unable to enable gpios for uart2dm\n", __func__);
692}
693#else
694static void msm7x27a_cfg_uart2dm_serial(void) { }
695#endif
696
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800697struct fmem_platform_data fmem_pdata;
698
699struct platform_device fmem_device = {
700 .name = "fmem",
701 .id = -1,
702 .dev = { .platform_data = &fmem_pdata },
703};
704
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700705static struct platform_device *rumi_sim_devices[] __initdata = {
706 &msm_device_dmov,
707 &msm_device_smd,
708 &smc91x_device,
709 &msm_device_uart1,
710 &msm_device_nand,
711 &msm_device_uart_dm1,
712 &msm_gsbi0_qup_i2c_device,
713 &msm_gsbi1_qup_i2c_device,
714};
715
Taniya Das43bcdd62011-12-02 17:33:27 +0530716static struct platform_device *msm8625_rumi3_devices[] __initdata = {
717 &msm8625_device_dmov,
Angshuman Sarkarfb1cce92012-02-21 15:20:43 +0530718 &msm8625_device_smd,
Taniya Das43bcdd62011-12-02 17:33:27 +0530719 &msm8625_device_uart1,
Taniya Dase3027e22012-02-27 16:32:27 +0530720 &msm8625_gsbi0_qup_i2c_device,
Taniya Das43bcdd62011-12-02 17:33:27 +0530721};
722
Taniya Dase3027e22012-02-27 16:32:27 +0530723static struct platform_device *msm7627a_surf_ffa_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700724 &msm_device_dmov,
725 &msm_device_smd,
726 &msm_device_uart1,
727 &msm_device_uart_dm1,
728 &msm_device_uart_dm2,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700729 &msm_gsbi0_qup_i2c_device,
730 &msm_gsbi1_qup_i2c_device,
731 &msm_device_otg,
732 &msm_device_gadget_peripheral,
Taniya Dase3027e22012-02-27 16:32:27 +0530733 &smsc911x_device,
734 &msm_kgsl_3d0,
735};
736
737static struct platform_device *common_devices[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700738 &android_usb_device,
739 &android_pmem_device,
740 &android_pmem_adsp_device,
741 &android_pmem_audio_device,
Taniya Dase3027e22012-02-27 16:32:27 +0530742 &fmem_device,
743 &msm_device_nand,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700744 &msm_device_snd,
745 &msm_device_adspdec,
Manish Dewangan3a260992011-06-24 18:01:34 +0530746 &asoc_msm_pcm,
747 &asoc_msm_dai0,
748 &asoc_msm_dai1,
Taniya Dase3027e22012-02-27 16:32:27 +0530749 &msm_batt_device,
750};
751
752static struct platform_device *msm8625_surf_devices[] __initdata = {
753 &msm8625_device_dmov,
754 &msm8625_device_uart1,
755 &msm8625_device_uart_dm1,
756 &msm8625_device_uart_dm2,
757 &msm8625_gsbi0_qup_i2c_device,
758 &msm8625_gsbi1_qup_i2c_device,
759 &msm8625_device_otg,
760 &msm8625_device_gadget_peripheral,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700761};
762
763static unsigned pmem_kernel_ebi1_size = PMEM_KERNEL_EBI1_SIZE;
764static int __init pmem_kernel_ebi1_size_setup(char *p)
765{
766 pmem_kernel_ebi1_size = memparse(p, NULL);
767 return 0;
768}
769early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup);
770
771static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
772static int __init pmem_audio_size_setup(char *p)
773{
774 pmem_audio_size = memparse(p, NULL);
775 return 0;
776}
777early_param("pmem_audio_size", pmem_audio_size_setup);
778
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700779static struct memtype_reserve msm7x27a_reserve_table[] __initdata = {
780 [MEMTYPE_SMI] = {
781 },
782 [MEMTYPE_EBI0] = {
783 .flags = MEMTYPE_FLAGS_1M_ALIGN,
784 },
785 [MEMTYPE_EBI1] = {
786 .flags = MEMTYPE_FLAGS_1M_ALIGN,
787 },
788};
789
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800790#ifdef CONFIG_ANDROID_PMEM
791static struct android_pmem_platform_data *pmem_pdata_array[] __initdata = {
792 &android_pmem_adsp_pdata,
793 &android_pmem_audio_pdata,
794 &android_pmem_pdata,
795};
796#endif
797
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700798static void __init size_pmem_devices(void)
799{
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800800#ifdef CONFIG_ANDROID_PMEM
801 unsigned int i;
802 unsigned int reusable_count = 0;
Jeevan Shriramf40764e2011-10-31 23:28:26 +0530803
804 if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
805 pmem_mdp_size = MSM7x25A_MSM_PMEM_MDP_SIZE;
806 pmem_adsp_size = MSM7x25A_MSM_PMEM_ADSP_SIZE;
807 } else {
808 pmem_mdp_size = MSM_PMEM_MDP_SIZE;
809 pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
810 }
811
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700812 android_pmem_adsp_pdata.size = pmem_adsp_size;
813 android_pmem_pdata.size = pmem_mdp_size;
814 android_pmem_audio_pdata.size = pmem_audio_size;
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800815
816 fmem_pdata.size = 0;
817
818 /* Find pmem devices that should use FMEM (reusable) memory.
819 */
820 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
821 struct android_pmem_platform_data *pdata = pmem_pdata_array[i];
822
823 if (!reusable_count && pdata->reusable)
824 fmem_pdata.size += pdata->size;
825
826 reusable_count += (pdata->reusable) ? 1 : 0;
827
828 if (pdata->reusable && reusable_count > 1) {
829 pr_err("%s: Too many PMEM devices specified as reusable. PMEM device %s was not configured as reusable.\n",
830 __func__, pdata->name);
831 pdata->reusable = 0;
832 }
833 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700834#endif
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800835
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700836}
837
838static void __init reserve_memory_for(struct android_pmem_platform_data *p)
839{
840 msm7x27a_reserve_table[p->memory_type].size += p->size;
841}
842
843static void __init reserve_pmem_memory(void)
844{
845#ifdef CONFIG_ANDROID_PMEM
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800846 unsigned int i;
847 for (i = 0; i < ARRAY_SIZE(pmem_pdata_array); ++i) {
848 if (!pmem_pdata_array[i]->reusable)
849 reserve_memory_for(pmem_pdata_array[i]);
850 }
851
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700852 msm7x27a_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size;
853#endif
854}
855
856static void __init msm7x27a_calculate_reserve_sizes(void)
857{
858 size_pmem_devices();
859 reserve_pmem_memory();
860}
861
862static int msm7x27a_paddr_to_memtype(unsigned int paddr)
863{
864 return MEMTYPE_EBI1;
865}
866
867static struct reserve_info msm7x27a_reserve_info __initdata = {
868 .memtype_reserve_table = msm7x27a_reserve_table,
869 .calculate_reserve_sizes = msm7x27a_calculate_reserve_sizes,
870 .paddr_to_memtype = msm7x27a_paddr_to_memtype,
871};
872
873static void __init msm7x27a_reserve(void)
874{
875 reserve_info = &msm7x27a_reserve_info;
876 msm_reserve();
Laura Abbott8f3d58b2011-12-18 10:47:03 -0800877 fmem_pdata.phys = reserve_memory_for_fmem(fmem_pdata.size);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700878}
879
Taniya Das2b16d1d2011-12-02 14:44:19 +0530880static void __init msm8625_reserve(void)
881{
882 memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
Taniya Dase3027e22012-02-27 16:32:27 +0530883 msm7x27a_reserve();
Taniya Das2b16d1d2011-12-02 14:44:19 +0530884}
885
Taniya Dase3027e22012-02-27 16:32:27 +0530886static void __init msm7x27a_device_i2c_init(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700887{
888 msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata;
889 msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata;
890}
891
Taniya Dase3027e22012-02-27 16:32:27 +0530892static void __init msm8625_device_i2c_init(void)
893{
894 msm8625_gsbi0_qup_i2c_device.dev.platform_data =
895 &msm_gsbi0_qup_i2c_pdata;
896 msm8625_gsbi1_qup_i2c_device.dev.platform_data =
897 &msm_gsbi1_qup_i2c_pdata;
898}
899
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700900#define MSM_EBI2_PHYS 0xa0d00000
901#define MSM_EBI2_XMEM_CS2_CFG1 0xa0d10030
902
903static void __init msm7x27a_init_ebi2(void)
904{
905 uint32_t ebi2_cfg;
906 void __iomem *ebi2_cfg_ptr;
907
908 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_PHYS, sizeof(uint32_t));
909 if (!ebi2_cfg_ptr)
910 return;
911
912 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +0530913 if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf() ||
Taniya Dase3027e22012-02-27 16:32:27 +0530914 machine_is_msm7625a_surf() || machine_is_msm8625_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700915 ebi2_cfg |= (1 << 4); /* CS2 */
916
917 writel(ebi2_cfg, ebi2_cfg_ptr);
918 iounmap(ebi2_cfg_ptr);
919
920 /* Enable A/D MUX[bit 31] from EBI2_XMEM_CS2_CFG1 */
921 ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_XMEM_CS2_CFG1,
922 sizeof(uint32_t));
923 if (!ebi2_cfg_ptr)
924 return;
925
926 ebi2_cfg = readl(ebi2_cfg_ptr);
Trilok Soni3d0f6c52011-07-26 16:06:58 +0530927 if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700928 ebi2_cfg |= (1 << 31);
929
930 writel(ebi2_cfg, ebi2_cfg_ptr);
931 iounmap(ebi2_cfg_ptr);
932}
933
934#define ATMEL_TS_I2C_NAME "maXTouch"
Justin Paupored98328e2011-08-19 13:48:31 -0700935
936static struct regulator_bulk_data regs_atmel[] = {
937 { .supply = "ldo2", .min_uV = 2850000, .max_uV = 2850000 },
938 { .supply = "smps3", .min_uV = 1800000, .max_uV = 1800000 },
939};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700940
941#define ATMEL_TS_GPIO_IRQ 82
942
943static int atmel_ts_power_on(bool on)
944{
Justin Paupored98328e2011-08-19 13:48:31 -0700945 int rc = on ?
946 regulator_bulk_enable(ARRAY_SIZE(regs_atmel), regs_atmel) :
947 regulator_bulk_disable(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700948
Justin Paupored98328e2011-08-19 13:48:31 -0700949 if (rc)
950 pr_err("%s: could not %sable regulators: %d\n",
951 __func__, on ? "en" : "dis", rc);
952 else
953 msleep(50);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700954
Justin Paupored98328e2011-08-19 13:48:31 -0700955 return rc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700956}
957
958static int atmel_ts_platform_init(struct i2c_client *client)
959{
960 int rc;
Justin Paupored98328e2011-08-19 13:48:31 -0700961 struct device *dev = &client->dev;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700962
Justin Paupored98328e2011-08-19 13:48:31 -0700963 rc = regulator_bulk_get(dev, ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700964 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700965 dev_err(dev, "%s: could not get regulators: %d\n",
966 __func__, rc);
967 goto out;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700968 }
969
Justin Paupored98328e2011-08-19 13:48:31 -0700970 rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700971 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700972 dev_err(dev, "%s: could not set voltages: %d\n",
973 __func__, rc);
974 goto reg_free;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700975 }
976
977 rc = gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
978 GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
979 GPIO_CFG_8MA), GPIO_CFG_ENABLE);
980 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700981 dev_err(dev, "%s: gpio_tlmm_config for %d failed\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700982 __func__, ATMEL_TS_GPIO_IRQ);
Justin Paupored98328e2011-08-19 13:48:31 -0700983 goto reg_free;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700984 }
985
986 /* configure touchscreen interrupt gpio */
987 rc = gpio_request(ATMEL_TS_GPIO_IRQ, "atmel_maxtouch_gpio");
988 if (rc) {
Justin Paupored98328e2011-08-19 13:48:31 -0700989 dev_err(dev, "%s: unable to request gpio %d\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700990 __func__, ATMEL_TS_GPIO_IRQ);
991 goto ts_gpio_tlmm_unconfig;
992 }
993
994 rc = gpio_direction_input(ATMEL_TS_GPIO_IRQ);
995 if (rc < 0) {
Justin Paupored98328e2011-08-19 13:48:31 -0700996 dev_err(dev, "%s: unable to set the direction of gpio %d\n",
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700997 __func__, ATMEL_TS_GPIO_IRQ);
998 goto free_ts_gpio;
999 }
1000 return 0;
1001
1002free_ts_gpio:
1003 gpio_free(ATMEL_TS_GPIO_IRQ);
1004ts_gpio_tlmm_unconfig:
1005 gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
1006 GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
1007 GPIO_CFG_2MA), GPIO_CFG_DISABLE);
Justin Paupored98328e2011-08-19 13:48:31 -07001008reg_free:
1009 regulator_bulk_free(ARRAY_SIZE(regs_atmel), regs_atmel);
1010out:
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001011 return rc;
1012}
1013
1014static int atmel_ts_platform_exit(struct i2c_client *client)
1015{
1016 gpio_free(ATMEL_TS_GPIO_IRQ);
1017 gpio_tlmm_config(GPIO_CFG(ATMEL_TS_GPIO_IRQ, 0,
1018 GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
1019 GPIO_CFG_2MA), GPIO_CFG_DISABLE);
Justin Paupored98328e2011-08-19 13:48:31 -07001020 regulator_bulk_free(ARRAY_SIZE(regs_atmel), regs_atmel);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001021 return 0;
1022}
1023
1024static u8 atmel_ts_read_chg(void)
1025{
1026 return gpio_get_value(ATMEL_TS_GPIO_IRQ);
1027}
1028
1029static u8 atmel_ts_valid_interrupt(void)
1030{
1031 return !atmel_ts_read_chg();
1032}
1033
1034#define ATMEL_X_OFFSET 13
1035#define ATMEL_Y_OFFSET 0
1036
Mohan Pallaka4e9a94e2011-11-23 16:34:21 +05301037static struct maxtouch_platform_data atmel_ts_pdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001038 .numtouch = 4,
1039 .init_platform_hw = atmel_ts_platform_init,
1040 .exit_platform_hw = atmel_ts_platform_exit,
1041 .power_on = atmel_ts_power_on,
1042 .display_res_x = 480,
1043 .display_res_y = 864,
1044 .min_x = ATMEL_X_OFFSET,
1045 .max_x = (505 - ATMEL_X_OFFSET),
1046 .min_y = ATMEL_Y_OFFSET,
1047 .max_y = (863 - ATMEL_Y_OFFSET),
1048 .valid_interrupt = atmel_ts_valid_interrupt,
1049 .read_chg = atmel_ts_read_chg,
1050};
1051
1052static struct i2c_board_info atmel_ts_i2c_info[] __initdata = {
1053 {
1054 I2C_BOARD_INFO(ATMEL_TS_I2C_NAME, 0x4a),
1055 .platform_data = &atmel_ts_pdata,
1056 .irq = MSM_GPIO_TO_INT(ATMEL_TS_GPIO_IRQ),
1057 },
1058};
1059
1060#define KP_INDEX(row, col) ((row)*ARRAY_SIZE(kp_col_gpios) + (col))
1061
1062static unsigned int kp_row_gpios[] = {31, 32, 33, 34, 35};
1063static unsigned int kp_col_gpios[] = {36, 37, 38, 39, 40};
1064
1065static const unsigned short keymap[ARRAY_SIZE(kp_col_gpios) *
1066 ARRAY_SIZE(kp_row_gpios)] = {
1067 [KP_INDEX(0, 0)] = KEY_7,
1068 [KP_INDEX(0, 1)] = KEY_DOWN,
1069 [KP_INDEX(0, 2)] = KEY_UP,
1070 [KP_INDEX(0, 3)] = KEY_RIGHT,
1071 [KP_INDEX(0, 4)] = KEY_ENTER,
1072
1073 [KP_INDEX(1, 0)] = KEY_LEFT,
1074 [KP_INDEX(1, 1)] = KEY_SEND,
1075 [KP_INDEX(1, 2)] = KEY_1,
1076 [KP_INDEX(1, 3)] = KEY_4,
1077 [KP_INDEX(1, 4)] = KEY_CLEAR,
1078
1079 [KP_INDEX(2, 0)] = KEY_6,
1080 [KP_INDEX(2, 1)] = KEY_5,
1081 [KP_INDEX(2, 2)] = KEY_8,
1082 [KP_INDEX(2, 3)] = KEY_3,
1083 [KP_INDEX(2, 4)] = KEY_NUMERIC_STAR,
1084
1085 [KP_INDEX(3, 0)] = KEY_9,
1086 [KP_INDEX(3, 1)] = KEY_NUMERIC_POUND,
1087 [KP_INDEX(3, 2)] = KEY_0,
1088 [KP_INDEX(3, 3)] = KEY_2,
1089 [KP_INDEX(3, 4)] = KEY_SLEEP,
1090
1091 [KP_INDEX(4, 0)] = KEY_BACK,
1092 [KP_INDEX(4, 1)] = KEY_HOME,
1093 [KP_INDEX(4, 2)] = KEY_MENU,
1094 [KP_INDEX(4, 3)] = KEY_VOLUMEUP,
1095 [KP_INDEX(4, 4)] = KEY_VOLUMEDOWN,
1096};
1097
1098/* SURF keypad platform device information */
1099static struct gpio_event_matrix_info kp_matrix_info = {
1100 .info.func = gpio_event_matrix_func,
1101 .keymap = keymap,
1102 .output_gpios = kp_row_gpios,
1103 .input_gpios = kp_col_gpios,
1104 .noutputs = ARRAY_SIZE(kp_row_gpios),
1105 .ninputs = ARRAY_SIZE(kp_col_gpios),
1106 .settle_time.tv_nsec = 40 * NSEC_PER_USEC,
1107 .poll_time.tv_nsec = 20 * NSEC_PER_MSEC,
1108 .flags = GPIOKPF_LEVEL_TRIGGERED_IRQ | GPIOKPF_DRIVE_INACTIVE |
1109 GPIOKPF_PRINT_UNMAPPED_KEYS,
1110};
1111
1112static struct gpio_event_info *kp_info[] = {
1113 &kp_matrix_info.info
1114};
1115
1116static struct gpio_event_platform_data kp_pdata = {
1117 .name = "7x27a_kp",
1118 .info = kp_info,
1119 .info_count = ARRAY_SIZE(kp_info)
1120};
1121
1122static struct platform_device kp_pdev = {
1123 .name = GPIO_EVENT_DEV_NAME,
1124 .id = -1,
1125 .dev = {
1126 .platform_data = &kp_pdata,
1127 },
1128};
1129
1130static struct msm_handset_platform_data hs_platform_data = {
1131 .hs_name = "7k_handset",
1132 .pwr_key_delay_ms = 500, /* 0 will disable end key */
1133};
1134
1135static struct platform_device hs_pdev = {
1136 .name = "msm-handset",
1137 .id = -1,
1138 .dev = {
1139 .platform_data = &hs_platform_data,
1140 },
1141};
1142
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001143static struct platform_device msm_proccomm_regulator_dev = {
1144 .name = PROCCOMM_REGULATOR_DEV_NAME,
1145 .id = -1,
1146 .dev = {
1147 .platform_data = &msm7x27a_proccomm_regulator_data
1148 }
1149};
1150
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301151static void msm_adsp_add_pdev(void)
1152{
1153 int rc = 0;
1154 struct rpc_board_dev *rpc_adsp_pdev;
1155
1156 rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL);
1157 if (rpc_adsp_pdev == NULL) {
1158 pr_err("%s: Memory Allocation failure\n", __func__);
1159 return;
1160 }
1161 rpc_adsp_pdev->prog = ADSP_RPC_PROG;
Taniya Dase3027e22012-02-27 16:32:27 +05301162
1163 if (cpu_is_msm8625())
1164 rpc_adsp_pdev->pdev = msm8625_device_adsp;
1165 else
1166 rpc_adsp_pdev->pdev = msm_adsp_device;
Laxminath Kasam5faa1ca2012-02-15 12:06:45 +05301167 rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1);
1168 if (rc < 0) {
1169 pr_err("%s: return val: %d\n", __func__, rc);
1170 kfree(rpc_adsp_pdev);
1171 }
1172}
1173
Trilok Soni16f61af2011-07-26 16:06:58 +05301174static void __init msm7627a_rumi3_init(void)
1175{
1176 msm7x27a_init_ebi2();
1177 platform_add_devices(rumi_sim_devices,
1178 ARRAY_SIZE(rumi_sim_devices));
1179}
1180
Taniya Das43bcdd62011-12-02 17:33:27 +05301181static void __init msm8625_rumi3_init(void)
1182{
1183 msm7x2x_misc_init();
Taniya Dase3027e22012-02-27 16:32:27 +05301184 msm_adsp_add_pdev();
1185 msm8625_device_i2c_init();
Taniya Das43bcdd62011-12-02 17:33:27 +05301186 platform_add_devices(msm8625_rumi3_devices,
1187 ARRAY_SIZE(msm8625_rumi3_devices));
1188}
1189
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001190#define LED_GPIO_PDM 96
1191#define UART1DM_RX_GPIO 45
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301192
1193#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
1194static int __init msm7x27a_init_ar6000pm(void)
1195{
Santosh Sajjan374d6592012-01-19 23:16:46 +05301196 msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power;
Santosh Sajjanb479f0f2011-08-18 21:00:44 +05301197 return platform_device_register(&msm_wlan_ar6000_pm_device);
1198}
1199#else
1200static int __init msm7x27a_init_ar6000pm(void) { return 0; }
1201#endif
1202
Justin Pauporeb3a33b72011-08-23 15:30:32 -07001203static void __init msm7x27a_init_regulators(void)
1204{
1205 int rc = platform_device_register(&msm_proccomm_regulator_dev);
1206 if (rc)
1207 pr_err("%s: could not register regulator device: %d\n",
1208 __func__, rc);
1209}
1210
Taniya Dase3027e22012-02-27 16:32:27 +05301211static void __init msm7x27a_add_footswitch_devices(void)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001212{
Trilok Soni16f61af2011-07-26 16:06:58 +05301213 platform_add_devices(msm_footswitch_devices,
1214 msm_num_footswitch_devices);
Taniya Dase3027e22012-02-27 16:32:27 +05301215}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001216
Taniya Dase3027e22012-02-27 16:32:27 +05301217static void __init msm7x27a_add_platform_devices(void)
1218{
1219 if (machine_is_msm8625_surf()) {
1220 platform_add_devices(msm8625_surf_devices,
1221 ARRAY_SIZE(msm8625_surf_devices));
1222 } else {
1223 platform_add_devices(msm7627a_surf_ffa_devices,
1224 ARRAY_SIZE(msm7627a_surf_ffa_devices));
1225 }
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001226
Taniya Dase3027e22012-02-27 16:32:27 +05301227 platform_add_devices(common_devices,
1228 ARRAY_SIZE(common_devices));
1229}
1230
1231static void __init msm7x27a_uartdm_config(void)
1232{
1233 msm7x27a_cfg_uart2dm_serial();
1234 msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
1235 if (cpu_is_msm8625())
1236 msm8625_device_uart_dm1.dev.platform_data =
1237 &msm_uart_dm1_pdata;
1238 else
1239 msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
1240}
1241
1242static void __init msm7x27a_otg_gadget(void)
1243{
1244 msm_otg_pdata.swfi_latency =
1245 msm7x27a_pm_data[
1246 MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
1247 if (cpu_is_msm8625()) {
1248 msm8625_device_otg.dev.platform_data = &msm_otg_pdata;
1249 msm8625_device_gadget_peripheral.dev.platform_data =
1250 &msm_gadget_pdata;
1251 } else {
1252 msm_device_otg.dev.platform_data = &msm_otg_pdata;
1253 msm_device_gadget_peripheral.dev.platform_data =
1254 &msm_gadget_pdata;
1255 }
1256}
1257
1258static void __init msm7x27a_add_io_devices(void)
1259{
1260 /* touchscreen */
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301261 if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001262 atmel_ts_pdata.min_x = 0;
1263 atmel_ts_pdata.max_x = 480;
1264 atmel_ts_pdata.min_y = 0;
1265 atmel_ts_pdata.max_y = 320;
1266 }
1267
1268 i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
Taniya Dase3027e22012-02-27 16:32:27 +05301269 atmel_ts_i2c_info,
1270 ARRAY_SIZE(atmel_ts_i2c_info));
1271 /* keypad */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001272 platform_device_register(&kp_pdev);
Taniya Dase3027e22012-02-27 16:32:27 +05301273
1274 /* headset */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001275 platform_device_register(&hs_pdev);
1276
Taniya Dase3027e22012-02-27 16:32:27 +05301277 /* LED: configure it as a pdm function */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001278 if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
1279 GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
1280 GPIO_CFG_8MA), GPIO_CFG_ENABLE))
1281 pr_err("%s: gpio_tlmm_config for %d failed\n",
1282 __func__, LED_GPIO_PDM);
1283 else
1284 platform_device_register(&led_pdev);
1285
Taniya Dase3027e22012-02-27 16:32:27 +05301286 /* Vibrator */
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301287 if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001288 msm_init_pmic_vibrator();
Taniya Dase3027e22012-02-27 16:32:27 +05301289}
1290
1291static void __init msm7x27a_pm_init(void)
1292{
1293 if (machine_is_msm8625_surf())
1294 return;
1295
1296 msm_pm_set_platform_data(msm7x27a_pm_data,
1297 ARRAY_SIZE(msm7x27a_pm_data));
1298 BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
1299}
1300
1301static void __init msm7x2x_init(void)
1302{
1303 msm7x2x_misc_init();
1304
1305 /* Initialize regulators first so that other devices can use them */
1306 msm7x27a_init_regulators();
1307 msm_adsp_add_pdev();
1308 if (cpu_is_msm8625())
1309 msm8625_device_i2c_init();
1310 else
1311 msm7x27a_device_i2c_init();
1312 msm7x27a_init_ebi2();
1313 msm7x27a_uartdm_config();
1314
1315 msm7x27a_otg_gadget();
1316 msm7x27a_cfg_smsc911x();
1317
1318 msm7x27a_add_footswitch_devices();
1319 msm7x27a_add_platform_devices();
1320 /* Ensure ar6000pm device is registered before MMC/SDC */
1321 msm7x27a_init_ar6000pm();
1322 msm7627a_init_mmc();
1323 msm_fb_add_devices();
1324 msm7x2x_init_host();
1325 msm7x27a_pm_init();
1326 register_i2c_devices();
1327 msm7627a_bt_power_init();
1328 msm7627a_camera_init();
1329 msm7x27a_add_io_devices();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001330 /*7x25a kgsl initializations*/
1331 msm7x25a_kgsl_3d0_init();
1332}
1333
1334static void __init msm7x2x_init_early(void)
1335{
Chintan Pandya250c2e52012-01-19 17:15:49 +05301336 msm_msm7627a_allocate_memory_regions();
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001337}
1338
1339MACHINE_START(MSM7X27A_RUMI3, "QCT MSM7x27a RUMI3")
1340 .boot_params = PHYS_OFFSET + 0x100,
1341 .map_io = msm_common_io_init,
1342 .reserve = msm7x27a_reserve,
1343 .init_irq = msm_init_irq,
Trilok Soni16f61af2011-07-26 16:06:58 +05301344 .init_machine = msm7627a_rumi3_init,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001345 .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
1349MACHINE_START(MSM7X27A_SURF, "QCT MSM7x27a SURF")
1350 .boot_params = PHYS_OFFSET + 0x100,
1351 .map_io = msm_common_io_init,
1352 .reserve = msm7x27a_reserve,
1353 .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,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001358MACHINE_END
1359MACHINE_START(MSM7X27A_FFA, "QCT MSM7x27a FFA")
1360 .boot_params = PHYS_OFFSET + 0x100,
1361 .map_io = msm_common_io_init,
1362 .reserve = msm7x27a_reserve,
1363 .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,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001368MACHINE_END
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301369MACHINE_START(MSM7625A_SURF, "QCT MSM7625a SURF")
1370 .boot_params = PHYS_OFFSET + 0x100,
1371 .map_io = msm_common_io_init,
1372 .reserve = msm7x27a_reserve,
1373 .init_irq = msm_init_irq,
1374 .init_machine = msm7x2x_init,
1375 .timer = &msm_timer,
1376 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301377 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301378MACHINE_END
1379MACHINE_START(MSM7625A_FFA, "QCT MSM7625a FFA")
1380 .boot_params = PHYS_OFFSET + 0x100,
1381 .map_io = msm_common_io_init,
1382 .reserve = msm7x27a_reserve,
1383 .init_irq = msm_init_irq,
1384 .init_machine = msm7x2x_init,
1385 .timer = &msm_timer,
1386 .init_early = msm7x2x_init_early,
Taniya Das86e0e132011-10-19 11:32:00 +05301387 .handle_irq = vic_handle_irq,
Trilok Soni3d0f6c52011-07-26 16:06:58 +05301388MACHINE_END
Taniya Das43bcdd62011-12-02 17:33:27 +05301389MACHINE_START(MSM8625_RUMI3, "QCT MSM8625 RUMI3")
1390 .boot_params = PHYS_OFFSET + 0x100,
1391 .map_io = msm8625_map_io,
Taniya Das2b16d1d2011-12-02 14:44:19 +05301392 .reserve = msm8625_reserve,
Taniya Das43bcdd62011-12-02 17:33:27 +05301393 .init_irq = msm8625_init_irq,
1394 .init_machine = msm8625_rumi3_init,
1395 .timer = &msm_timer,
1396 .handle_irq = gic_handle_irq,
1397MACHINE_END
Taniya Dase3027e22012-02-27 16:32:27 +05301398MACHINE_START(MSM8625_SURF, "QCT MSM8625 SURF")
1399 .boot_params = PHYS_OFFSET + 0x100,
1400 .map_io = msm8625_map_io,
1401 .reserve = msm8625_reserve,
1402 .init_irq = msm8625_init_irq,
1403 .init_machine = msm7x2x_init,
1404 .timer = &msm_timer,
1405 .init_early = msm7x2x_init_early,
1406 .handle_irq = gic_handle_irq,
1407MACHINE_END