Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/gpio_event.h> |
Taniya Das | 2b16d1d | 2011-12-02 14:44:19 +0530 | [diff] [blame] | 15 | #include <linux/memblock.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 16 | #include <asm/mach-types.h> |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 17 | #include <linux/memblock.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | #include <asm/mach/arch.h> |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 19 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | #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> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 41 | #include <linux/bootmem.h> |
| 42 | #include <linux/mfd/marimba.h> |
| 43 | #include <mach/vreg.h> |
| 44 | #include <linux/power_supply.h> |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 45 | #include <linux/regulator/consumer.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 46 | #include <mach/rpc_pmapp.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | #include <mach/msm_battery.h> |
| 48 | #include <linux/smsc911x.h> |
| 49 | #include <linux/atmel_maxtouch.h> |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 50 | #include <linux/msm_adc.h> |
Mitchel Humpherys | 592bb58 | 2012-09-06 11:34:47 -0700 | [diff] [blame] | 51 | #include <linux/msm_ion.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 52 | #include "devices.h" |
| 53 | #include "timer.h" |
Justin Paupore | b3a33b7 | 2011-08-23 15:30:32 -0700 | [diff] [blame] | 54 | #include "board-msm7x27a-regulator.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 55 | #include "devices-msm7x2xa.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 56 | #include "pm.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 57 | #include <mach/rpc_server_handset.h> |
| 58 | #include <mach/socinfo.h> |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 59 | #include "pm-boot.h" |
Chintan Pandya | cf467fc | 2011-12-01 17:11:11 +0530 | [diff] [blame] | 60 | #include "board-msm7627a.h" |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 61 | #include "platsmp.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 62 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 63 | #define RESERVE_KERNEL_EBI1_SIZE 0x3A000 |
| 64 | #define MSM_RESERVE_AUDIO_SIZE 0x1F4000 |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 65 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 66 | #if defined(CONFIG_GPIO_SX150X) |
| 67 | enum { |
| 68 | SX150X_CORE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | static 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 kumar | c5c0139 | 2011-08-12 13:44:05 +0530 | [diff] [blame] | 76 | .io_pulldn_ena = 0x02, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 77 | .io_open_drain_ena = 0xfef8, |
| 78 | .irq_summary = -1, |
| 79 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 80 | }; |
| 81 | #endif |
| 82 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 83 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 84 | #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE) |
Santosh Sajjan | 6822c68 | 2011-07-26 10:49:36 +0530 | [diff] [blame] | 85 | static struct platform_device msm_wlan_ar6000_pm_device = { |
| 86 | .name = "wlan_ar6000_pm_dev", |
| 87 | .id = -1, |
| 88 | }; |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 89 | #endif |
Santosh Sajjan | 6822c68 | 2011-07-26 10:49:36 +0530 | [diff] [blame] | 90 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 91 | #if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X) |
| 92 | static struct i2c_board_info core_exp_i2c_info[] __initdata = { |
| 93 | { |
| 94 | I2C_BOARD_INFO("sx1509q", 0x3e), |
| 95 | }, |
| 96 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 97 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 98 | static void __init register_i2c_devices(void) |
| 99 | { |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 100 | if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() || |
| 101 | machine_is_msm8625_surf()) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 102 | sx150x_data[SX150X_CORE].io_open_drain_ena = 0xe0f0; |
| 103 | |
| 104 | core_exp_i2c_info[0].platform_data = |
| 105 | &sx150x_data[SX150X_CORE]; |
| 106 | |
| 107 | i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID, |
| 108 | core_exp_i2c_info, |
| 109 | ARRAY_SIZE(core_exp_i2c_info)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 110 | } |
| 111 | #endif |
| 112 | |
| 113 | static struct msm_gpio qup_i2c_gpios_io[] = { |
| 114 | { GPIO_CFG(60, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 115 | "qup_scl" }, |
| 116 | { GPIO_CFG(61, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 117 | "qup_sda" }, |
| 118 | { GPIO_CFG(131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 119 | "qup_scl" }, |
| 120 | { GPIO_CFG(132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 121 | "qup_sda" }, |
| 122 | }; |
| 123 | |
| 124 | static struct msm_gpio qup_i2c_gpios_hw[] = { |
| 125 | { GPIO_CFG(60, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 126 | "qup_scl" }, |
| 127 | { GPIO_CFG(61, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 128 | "qup_sda" }, |
| 129 | { GPIO_CFG(131, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 130 | "qup_scl" }, |
| 131 | { GPIO_CFG(132, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), |
| 132 | "qup_sda" }, |
| 133 | }; |
| 134 | |
| 135 | static void gsbi_qup_i2c_gpio_config(int adap_id, int config_type) |
| 136 | { |
| 137 | int rc; |
| 138 | |
| 139 | if (adap_id < 0 || adap_id > 1) |
| 140 | return; |
| 141 | |
| 142 | /* Each adapter gets 2 lines from the table */ |
| 143 | if (config_type) |
| 144 | rc = msm_gpios_request_enable(&qup_i2c_gpios_hw[adap_id*2], 2); |
| 145 | else |
| 146 | rc = msm_gpios_request_enable(&qup_i2c_gpios_io[adap_id*2], 2); |
| 147 | if (rc < 0) |
| 148 | pr_err("QUP GPIO request/enable failed: %d\n", rc); |
| 149 | } |
| 150 | |
| 151 | static struct msm_i2c_platform_data msm_gsbi0_qup_i2c_pdata = { |
| 152 | .clk_freq = 100000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 153 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 154 | }; |
| 155 | |
| 156 | static struct msm_i2c_platform_data msm_gsbi1_qup_i2c_pdata = { |
| 157 | .clk_freq = 100000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 158 | .msm_i2c_config_gpio = gsbi_qup_i2c_gpio_config, |
| 159 | }; |
| 160 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 161 | #ifdef CONFIG_ARCH_MSM7X27A |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 162 | #define MSM_RESERVE_MDP_SIZE 0x1B00000 |
| 163 | #define MSM7x25A_MSM_RESERVE_MDP_SIZE 0x1500000 |
| 164 | #define MSM_RESERVE_ADSP_SIZE 0x1200000 |
| 165 | #define MSM7x25A_MSM_RESERVE_ADSP_SIZE 0xB91000 |
| 166 | #define CAMERA_ZSL_SIZE (SZ_1M * 60) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 167 | #endif |
| 168 | |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 169 | #ifdef CONFIG_ION_MSM |
| 170 | #define MSM_ION_HEAP_NUM 4 |
| 171 | static struct platform_device ion_dev; |
| 172 | static int msm_ion_camera_size; |
| 173 | static int msm_ion_audio_size; |
| 174 | static int msm_ion_sf_size; |
| 175 | #endif |
| 176 | |
| 177 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 178 | static struct android_usb_platform_data android_usb_pdata = { |
| 179 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 180 | }; |
| 181 | |
| 182 | static struct platform_device android_usb_device = { |
| 183 | .name = "android_usb", |
| 184 | .id = -1, |
| 185 | .dev = { |
| 186 | .platform_data = &android_usb_pdata, |
| 187 | }, |
| 188 | }; |
| 189 | |
| 190 | #ifdef CONFIG_USB_EHCI_MSM_72K |
| 191 | static void msm_hsusb_vbus_power(unsigned phy_info, int on) |
| 192 | { |
| 193 | int rc = 0; |
| 194 | unsigned gpio; |
| 195 | |
| 196 | gpio = GPIO_HOST_VBUS_EN; |
| 197 | |
| 198 | rc = gpio_request(gpio, "i2c_host_vbus_en"); |
| 199 | if (rc < 0) { |
| 200 | pr_err("failed to request %d GPIO\n", gpio); |
| 201 | return; |
| 202 | } |
| 203 | gpio_direction_output(gpio, !!on); |
| 204 | gpio_set_value_cansleep(gpio, !!on); |
| 205 | gpio_free(gpio); |
| 206 | } |
| 207 | |
| 208 | static struct msm_usb_host_platform_data msm_usb_host_pdata = { |
| 209 | .phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_45NM), |
| 210 | }; |
| 211 | |
| 212 | static void __init msm7x2x_init_host(void) |
| 213 | { |
| 214 | msm_add_host(0, &msm_usb_host_pdata); |
| 215 | } |
| 216 | #endif |
| 217 | |
| 218 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 219 | static int hsusb_rpc_connect(int connect) |
| 220 | { |
| 221 | if (connect) |
| 222 | return msm_hsusb_rpc_connect(); |
| 223 | else |
| 224 | return msm_hsusb_rpc_close(); |
| 225 | } |
| 226 | |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 227 | static struct regulator *reg_hsusb; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | static int msm_hsusb_ldo_init(int init) |
| 229 | { |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 230 | int rc = 0; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 231 | |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 232 | if (init) { |
| 233 | reg_hsusb = regulator_get(NULL, "usb"); |
| 234 | if (IS_ERR(reg_hsusb)) { |
| 235 | rc = PTR_ERR(reg_hsusb); |
| 236 | pr_err("%s: could not get regulator: %d\n", |
| 237 | __func__, rc); |
| 238 | goto out; |
| 239 | } |
| 240 | |
| 241 | rc = regulator_set_voltage(reg_hsusb, 3300000, 3300000); |
| 242 | if (rc) { |
| 243 | pr_err("%s: could not set voltage: %d\n", |
| 244 | __func__, rc); |
| 245 | goto reg_free; |
| 246 | } |
| 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | /* else fall through */ |
| 251 | reg_free: |
| 252 | regulator_put(reg_hsusb); |
| 253 | out: |
| 254 | reg_hsusb = NULL; |
| 255 | return rc; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | static int msm_hsusb_ldo_enable(int enable) |
| 259 | { |
| 260 | static int ldo_status; |
| 261 | |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 262 | if (IS_ERR_OR_NULL(reg_hsusb)) |
| 263 | return reg_hsusb ? PTR_ERR(reg_hsusb) : -ENODEV; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 264 | |
| 265 | if (ldo_status == enable) |
| 266 | return 0; |
| 267 | |
| 268 | ldo_status = enable; |
| 269 | |
Justin Paupore | d98328e | 2011-08-19 13:48:31 -0700 | [diff] [blame] | 270 | return enable ? |
| 271 | regulator_enable(reg_hsusb) : |
| 272 | regulator_disable(reg_hsusb); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | #ifndef CONFIG_USB_EHCI_MSM_72K |
| 276 | static int msm_hsusb_pmic_notif_init(void (*callback)(int online), int init) |
| 277 | { |
| 278 | int ret = 0; |
| 279 | |
| 280 | if (init) |
| 281 | ret = msm_pm_app_rpc_init(callback); |
| 282 | else |
| 283 | msm_pm_app_rpc_deinit(callback); |
| 284 | |
| 285 | return ret; |
| 286 | } |
| 287 | #endif |
| 288 | |
| 289 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 290 | #ifndef CONFIG_USB_EHCI_MSM_72K |
| 291 | .pmic_vbus_notif_init = msm_hsusb_pmic_notif_init, |
| 292 | #else |
| 293 | .vbus_power = msm_hsusb_vbus_power, |
| 294 | #endif |
| 295 | .rpc_connect = hsusb_rpc_connect, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 296 | .pemp_level = PRE_EMPHASIS_WITH_20_PERCENT, |
| 297 | .cdr_autoreset = CDR_AUTO_RESET_DISABLE, |
| 298 | .drv_ampl = HS_DRV_AMPLITUDE_DEFAULT, |
| 299 | .se1_gating = SE1_GATING_DISABLE, |
| 300 | .ldo_init = msm_hsusb_ldo_init, |
| 301 | .ldo_enable = msm_hsusb_ldo_enable, |
| 302 | .chg_init = hsusb_chg_init, |
| 303 | .chg_connected = hsusb_chg_connected, |
| 304 | .chg_vbus_draw = hsusb_chg_vbus_draw, |
| 305 | }; |
| 306 | #endif |
| 307 | |
| 308 | static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = { |
| 309 | .is_phy_status_timer_on = 1, |
| 310 | }; |
| 311 | |
| 312 | static struct resource smc91x_resources[] = { |
| 313 | [0] = { |
| 314 | .start = 0x90000300, |
| 315 | .end = 0x900003ff, |
| 316 | .flags = IORESOURCE_MEM, |
| 317 | }, |
| 318 | [1] = { |
| 319 | .start = MSM_GPIO_TO_INT(4), |
| 320 | .end = MSM_GPIO_TO_INT(4), |
| 321 | .flags = IORESOURCE_IRQ, |
| 322 | }, |
| 323 | }; |
| 324 | |
| 325 | static struct platform_device smc91x_device = { |
| 326 | .name = "smc91x", |
| 327 | .id = 0, |
| 328 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 329 | .resource = smc91x_resources, |
| 330 | }; |
| 331 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 332 | #ifdef CONFIG_SERIAL_MSM_HS |
| 333 | static struct msm_serial_hs_platform_data msm_uart_dm1_pdata = { |
| 334 | .inject_rx_on_wakeup = 1, |
| 335 | .rx_to_inject = 0xFD, |
| 336 | }; |
| 337 | #endif |
| 338 | static struct msm_pm_platform_data msm7x27a_pm_data[MSM_PM_SLEEP_MODE_NR] = { |
Murali Nalajala | b10363d | 2012-01-12 16:29:01 +0530 | [diff] [blame] | 339 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 340 | .idle_supported = 1, |
| 341 | .suspend_supported = 1, |
| 342 | .idle_enabled = 1, |
| 343 | .suspend_enabled = 1, |
| 344 | .latency = 16000, |
| 345 | .residency = 20000, |
| 346 | }, |
Murali Nalajala | b10363d | 2012-01-12 16:29:01 +0530 | [diff] [blame] | 347 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 348 | .idle_supported = 1, |
| 349 | .suspend_supported = 1, |
| 350 | .idle_enabled = 1, |
| 351 | .suspend_enabled = 1, |
| 352 | .latency = 12000, |
| 353 | .residency = 20000, |
| 354 | }, |
Murali Nalajala | b10363d | 2012-01-12 16:29:01 +0530 | [diff] [blame] | 355 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT)] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 356 | .idle_supported = 1, |
| 357 | .suspend_supported = 1, |
| 358 | .idle_enabled = 0, |
| 359 | .suspend_enabled = 1, |
| 360 | .latency = 2000, |
| 361 | .residency = 0, |
| 362 | }, |
Murali Nalajala | b10363d | 2012-01-12 16:29:01 +0530 | [diff] [blame] | 363 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 364 | .idle_supported = 1, |
| 365 | .suspend_supported = 1, |
| 366 | .idle_enabled = 1, |
| 367 | .suspend_enabled = 1, |
| 368 | .latency = 2, |
| 369 | .residency = 0, |
| 370 | }, |
| 371 | }; |
| 372 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 373 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
Sravan Kumar Ambapuram | b22cf4d | 2012-01-02 21:45:04 +0530 | [diff] [blame] | 374 | .mode = MSM_PM_BOOT_CONFIG_RESET_VECTOR_PHYS, |
| 375 | .p_addr = 0, |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 376 | }; |
| 377 | |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 378 | /* 8625 PM platform data */ |
Murali Nalajala | 28ced1b | 2012-10-19 13:48:44 +0530 | [diff] [blame] | 379 | static struct msm_pm_platform_data |
| 380 | msm8625_pm_data[MSM_PM_SLEEP_MODE_NR * CONFIG_NR_CPUS] = { |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 381 | /* CORE0 entries */ |
| 382 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 383 | .idle_supported = 1, |
| 384 | .suspend_supported = 1, |
| 385 | .idle_enabled = 0, |
| 386 | .suspend_enabled = 0, |
| 387 | .latency = 16000, |
| 388 | .residency = 20000, |
| 389 | }, |
| 390 | |
| 391 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_NO_XO_SHUTDOWN)] = { |
| 392 | .idle_supported = 1, |
| 393 | .suspend_supported = 1, |
| 394 | .idle_enabled = 0, |
| 395 | .suspend_enabled = 0, |
| 396 | .latency = 12000, |
| 397 | .residency = 20000, |
| 398 | }, |
| 399 | |
| 400 | /* picked latency & redisdency values from 7x30 */ |
| 401 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 402 | .idle_supported = 1, |
| 403 | .suspend_supported = 1, |
| 404 | .idle_enabled = 0, |
| 405 | .suspend_enabled = 0, |
| 406 | .latency = 500, |
Krishna Vanka | d89bcd2 | 2012-12-11 10:32:31 +0530 | [diff] [blame] | 407 | .residency = 500, |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 408 | }, |
| 409 | |
| 410 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 411 | .idle_supported = 1, |
| 412 | .suspend_supported = 1, |
| 413 | .idle_enabled = 1, |
| 414 | .suspend_enabled = 1, |
| 415 | .latency = 2, |
| 416 | .residency = 10, |
| 417 | }, |
| 418 | |
| 419 | /* picked latency & redisdency values from 7x30 */ |
| 420 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 421 | .idle_supported = 1, |
| 422 | .suspend_supported = 1, |
| 423 | .idle_enabled = 0, |
| 424 | .suspend_enabled = 0, |
| 425 | .latency = 500, |
Krishna Vanka | d89bcd2 | 2012-12-11 10:32:31 +0530 | [diff] [blame] | 426 | .residency = 500, |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 427 | }, |
| 428 | |
| 429 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 430 | .idle_supported = 1, |
| 431 | .suspend_supported = 1, |
| 432 | .idle_enabled = 1, |
| 433 | .suspend_enabled = 1, |
| 434 | .latency = 2, |
| 435 | .residency = 10, |
| 436 | }, |
| 437 | |
Murali Nalajala | 28ced1b | 2012-10-19 13:48:44 +0530 | [diff] [blame] | 438 | /* picked latency & redisdency values from 7x30 */ |
| 439 | [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 440 | .idle_supported = 1, |
| 441 | .suspend_supported = 1, |
| 442 | .idle_enabled = 0, |
| 443 | .suspend_enabled = 0, |
| 444 | .latency = 500, |
Krishna Vanka | d89bcd2 | 2012-12-11 10:32:31 +0530 | [diff] [blame] | 445 | .residency = 500, |
Murali Nalajala | 28ced1b | 2012-10-19 13:48:44 +0530 | [diff] [blame] | 446 | }, |
| 447 | |
| 448 | [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 449 | .idle_supported = 1, |
| 450 | .suspend_supported = 1, |
| 451 | .idle_enabled = 1, |
| 452 | .suspend_enabled = 1, |
| 453 | .latency = 2, |
| 454 | .residency = 10, |
| 455 | }, |
| 456 | |
| 457 | /* picked latency & redisdency values from 7x30 */ |
| 458 | [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 459 | .idle_supported = 1, |
| 460 | .suspend_supported = 1, |
| 461 | .idle_enabled = 0, |
| 462 | .suspend_enabled = 0, |
| 463 | .latency = 500, |
Krishna Vanka | d89bcd2 | 2012-12-11 10:32:31 +0530 | [diff] [blame] | 464 | .residency = 500, |
Murali Nalajala | 28ced1b | 2012-10-19 13:48:44 +0530 | [diff] [blame] | 465 | }, |
| 466 | |
| 467 | [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 468 | .idle_supported = 1, |
| 469 | .suspend_supported = 1, |
| 470 | .idle_enabled = 1, |
| 471 | .suspend_enabled = 1, |
| 472 | .latency = 2, |
| 473 | .residency = 10, |
| 474 | }, |
| 475 | |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 476 | }; |
| 477 | |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 478 | static struct msm_pm_boot_platform_data msm_pm_8625_boot_pdata __initdata = { |
| 479 | .mode = MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR, |
| 480 | .v_addr = MSM_CFG_CTL_BASE, |
| 481 | }; |
| 482 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 483 | static unsigned reserve_mdp_size = MSM_RESERVE_MDP_SIZE; |
| 484 | static int __init reserve_mdp_size_setup(char *p) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 485 | { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 486 | reserve_mdp_size = memparse(p, NULL); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 487 | return 0; |
| 488 | } |
| 489 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 490 | early_param("reserve_mdp_size", reserve_mdp_size_setup); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 491 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 492 | static unsigned reserve_adsp_size = MSM_RESERVE_ADSP_SIZE; |
| 493 | static int __init reserve_adsp_size_setup(char *p) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 494 | { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 495 | reserve_adsp_size = memparse(p, NULL); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 496 | return 0; |
| 497 | } |
| 498 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 499 | early_param("reserve_adsp_size", reserve_adsp_size_setup); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 500 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 501 | static u32 msm_calculate_batt_capacity(u32 current_voltage); |
| 502 | |
| 503 | static struct msm_psy_batt_pdata msm_psy_batt_data = { |
Krishna Vanka | 9a265e1 | 2012-06-04 23:24:26 +0530 | [diff] [blame] | 504 | .voltage_min_design = 3200, |
| 505 | .voltage_max_design = 4200, |
| 506 | .voltage_fail_safe = 3340, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 507 | .avail_chg_sources = AC_CHG | USB_CHG , |
| 508 | .batt_technology = POWER_SUPPLY_TECHNOLOGY_LION, |
| 509 | .calculate_capacity = &msm_calculate_batt_capacity, |
| 510 | }; |
| 511 | |
| 512 | static u32 msm_calculate_batt_capacity(u32 current_voltage) |
| 513 | { |
| 514 | u32 low_voltage = msm_psy_batt_data.voltage_min_design; |
| 515 | u32 high_voltage = msm_psy_batt_data.voltage_max_design; |
| 516 | |
Krishna Vanka | b349469 | 2012-06-12 15:06:43 +0530 | [diff] [blame] | 517 | if (current_voltage <= low_voltage) |
| 518 | return 0; |
| 519 | else if (current_voltage >= high_voltage) |
| 520 | return 100; |
| 521 | else |
| 522 | return (current_voltage - low_voltage) * 100 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 523 | / (high_voltage - low_voltage); |
| 524 | } |
| 525 | |
| 526 | static struct platform_device msm_batt_device = { |
| 527 | .name = "msm-battery", |
| 528 | .id = -1, |
| 529 | .dev.platform_data = &msm_psy_batt_data, |
| 530 | }; |
| 531 | |
| 532 | static struct smsc911x_platform_config smsc911x_config = { |
| 533 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
| 534 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 535 | .flags = SMSC911X_USE_16BIT, |
| 536 | }; |
| 537 | |
| 538 | static struct resource smsc911x_resources[] = { |
| 539 | [0] = { |
| 540 | .start = 0x90000000, |
| 541 | .end = 0x90007fff, |
| 542 | .flags = IORESOURCE_MEM, |
| 543 | }, |
| 544 | [1] = { |
| 545 | .start = MSM_GPIO_TO_INT(48), |
| 546 | .end = MSM_GPIO_TO_INT(48), |
| 547 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
| 548 | }, |
| 549 | }; |
| 550 | |
| 551 | static struct platform_device smsc911x_device = { |
| 552 | .name = "smsc911x", |
| 553 | .id = 0, |
| 554 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 555 | .resource = smsc911x_resources, |
| 556 | .dev = { |
| 557 | .platform_data = &smsc911x_config, |
| 558 | }, |
| 559 | }; |
| 560 | |
| 561 | static struct msm_gpio smsc911x_gpios[] = { |
| 562 | { GPIO_CFG(48, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA), |
| 563 | "smsc911x_irq" }, |
| 564 | { GPIO_CFG(49, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_6MA), |
| 565 | "eth_fifo_sel" }, |
| 566 | }; |
| 567 | |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 568 | static char *msm_adc_surf_device_names[] = { |
| 569 | "XO_ADC", |
| 570 | }; |
| 571 | |
| 572 | static struct msm_adc_platform_data msm_adc_pdata = { |
| 573 | .dev_names = msm_adc_surf_device_names, |
| 574 | .num_adc = ARRAY_SIZE(msm_adc_surf_device_names), |
| 575 | .target_hw = MSM_8x25, |
| 576 | }; |
| 577 | |
| 578 | static struct platform_device msm_adc_device = { |
| 579 | .name = "msm_adc", |
| 580 | .id = -1, |
| 581 | .dev = { |
| 582 | .platform_data = &msm_adc_pdata, |
| 583 | }, |
| 584 | }; |
| 585 | |
Utsab Bose | 9a34117 | 2012-08-07 13:07:28 +0530 | [diff] [blame] | 586 | #ifdef CONFIG_MSM_RTB |
| 587 | static struct msm_rtb_platform_data msm7x27a_rtb_pdata = { |
| 588 | .size = SZ_1M, |
| 589 | }; |
| 590 | |
| 591 | static int __init msm_rtb_set_buffer_size(char *p) |
| 592 | { |
| 593 | int s; |
| 594 | |
| 595 | s = memparse(p, NULL); |
| 596 | msm7x27a_rtb_pdata.size = ALIGN(s, SZ_4K); |
| 597 | return 0; |
| 598 | } |
| 599 | early_param("msm_rtb_size", msm_rtb_set_buffer_size); |
| 600 | |
| 601 | struct platform_device msm7x27a_rtb_device = { |
| 602 | .name = "msm_rtb", |
| 603 | .id = -1, |
| 604 | .dev = { |
| 605 | .platform_data = &msm7x27a_rtb_pdata, |
| 606 | }, |
| 607 | }; |
| 608 | #endif |
| 609 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 610 | #define ETH_FIFO_SEL_GPIO 49 |
| 611 | static void msm7x27a_cfg_smsc911x(void) |
| 612 | { |
| 613 | int res; |
| 614 | |
| 615 | res = msm_gpios_request_enable(smsc911x_gpios, |
| 616 | ARRAY_SIZE(smsc911x_gpios)); |
| 617 | if (res) { |
| 618 | pr_err("%s: unable to enable gpios for SMSC911x\n", __func__); |
| 619 | return; |
| 620 | } |
| 621 | |
| 622 | /* ETH_FIFO_SEL */ |
| 623 | res = gpio_direction_output(ETH_FIFO_SEL_GPIO, 0); |
| 624 | if (res) { |
| 625 | pr_err("%s: unable to get direction for gpio %d\n", __func__, |
| 626 | ETH_FIFO_SEL_GPIO); |
| 627 | msm_gpios_disable_free(smsc911x_gpios, |
| 628 | ARRAY_SIZE(smsc911x_gpios)); |
| 629 | return; |
| 630 | } |
| 631 | gpio_set_value(ETH_FIFO_SEL_GPIO, 0); |
| 632 | } |
| 633 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 634 | #if defined(CONFIG_SERIAL_MSM_HSL_CONSOLE) \ |
| 635 | && defined(CONFIG_MSM_SHARED_GPIO_FOR_UART2DM) |
| 636 | static struct msm_gpio uart2dm_gpios[] = { |
| 637 | {GPIO_CFG(19, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), |
| 638 | "uart2dm_rfr_n" }, |
| 639 | {GPIO_CFG(20, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), |
| 640 | "uart2dm_cts_n" }, |
| 641 | {GPIO_CFG(21, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), |
| 642 | "uart2dm_rx" }, |
| 643 | {GPIO_CFG(108, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), |
| 644 | "uart2dm_tx" }, |
| 645 | }; |
| 646 | |
| 647 | static void msm7x27a_cfg_uart2dm_serial(void) |
| 648 | { |
| 649 | int ret; |
| 650 | ret = msm_gpios_request_enable(uart2dm_gpios, |
| 651 | ARRAY_SIZE(uart2dm_gpios)); |
| 652 | if (ret) |
| 653 | pr_err("%s: unable to enable gpios for uart2dm\n", __func__); |
| 654 | } |
| 655 | #else |
| 656 | static void msm7x27a_cfg_uart2dm_serial(void) { } |
| 657 | #endif |
| 658 | |
| 659 | static struct platform_device *rumi_sim_devices[] __initdata = { |
| 660 | &msm_device_dmov, |
| 661 | &msm_device_smd, |
| 662 | &smc91x_device, |
| 663 | &msm_device_uart1, |
| 664 | &msm_device_nand, |
| 665 | &msm_device_uart_dm1, |
| 666 | &msm_gsbi0_qup_i2c_device, |
| 667 | &msm_gsbi1_qup_i2c_device, |
| 668 | }; |
| 669 | |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 670 | static struct platform_device *msm8625_rumi3_devices[] __initdata = { |
| 671 | &msm8625_device_dmov, |
Angshuman Sarkar | fb1cce9 | 2012-02-21 15:20:43 +0530 | [diff] [blame] | 672 | &msm8625_device_smd, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 673 | &msm8625_device_uart1, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 674 | &msm8625_gsbi0_qup_i2c_device, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 675 | }; |
| 676 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 677 | static struct platform_device *msm7627a_surf_ffa_devices[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 678 | &msm_device_dmov, |
| 679 | &msm_device_smd, |
| 680 | &msm_device_uart1, |
| 681 | &msm_device_uart_dm1, |
| 682 | &msm_device_uart_dm2, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 683 | &msm_gsbi0_qup_i2c_device, |
| 684 | &msm_gsbi1_qup_i2c_device, |
| 685 | &msm_device_otg, |
| 686 | &msm_device_gadget_peripheral, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 687 | &smsc911x_device, |
| 688 | &msm_kgsl_3d0, |
| 689 | }; |
| 690 | |
| 691 | static struct platform_device *common_devices[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 692 | &android_usb_device, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 693 | &msm_device_nand, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 694 | &msm_device_snd, |
Manish Dewangan | 1c0fa49 | 2012-08-22 10:33:11 +0530 | [diff] [blame] | 695 | &msm_device_cad, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 696 | &msm_device_adspdec, |
Manish Dewangan | 3a26099 | 2011-06-24 18:01:34 +0530 | [diff] [blame] | 697 | &asoc_msm_pcm, |
| 698 | &asoc_msm_dai0, |
| 699 | &asoc_msm_dai1, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 700 | &msm_batt_device, |
Siddartha Mohanadoss | bc2103f | 2012-03-20 11:41:48 -0700 | [diff] [blame] | 701 | &msm_adc_device, |
Utsab Bose | 9a34117 | 2012-08-07 13:07:28 +0530 | [diff] [blame] | 702 | #ifdef CONFIG_MSM_RTB |
| 703 | &msm7x27a_rtb_device, |
| 704 | #endif |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 705 | #ifdef CONFIG_ION_MSM |
| 706 | &ion_dev, |
| 707 | #endif |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 708 | }; |
| 709 | |
| 710 | static struct platform_device *msm8625_surf_devices[] __initdata = { |
| 711 | &msm8625_device_dmov, |
| 712 | &msm8625_device_uart1, |
| 713 | &msm8625_device_uart_dm1, |
| 714 | &msm8625_device_uart_dm2, |
| 715 | &msm8625_gsbi0_qup_i2c_device, |
| 716 | &msm8625_gsbi1_qup_i2c_device, |
Taniya Das | f266530 | 2012-02-28 16:54:54 +0530 | [diff] [blame] | 717 | &msm8625_device_smd, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 718 | &msm8625_device_otg, |
| 719 | &msm8625_device_gadget_peripheral, |
Ranjhith Kalisamy | 4ec2e10 | 2012-03-06 12:27:50 +0530 | [diff] [blame] | 720 | &msm8625_kgsl_3d0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 721 | }; |
| 722 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 723 | static unsigned reserve_kernel_ebi1_size = RESERVE_KERNEL_EBI1_SIZE; |
| 724 | static int __init reserve_kernel_ebi1_size_setup(char *p) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 725 | { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 726 | reserve_kernel_ebi1_size = memparse(p, NULL); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 727 | return 0; |
| 728 | } |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 729 | early_param("reserve_kernel_ebi1_size", reserve_kernel_ebi1_size_setup); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 730 | |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 731 | static unsigned reserve_audio_size = MSM_RESERVE_AUDIO_SIZE; |
| 732 | static int __init reserve_audio_size_setup(char *p) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 733 | { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 734 | reserve_audio_size = memparse(p, NULL); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 735 | return 0; |
| 736 | } |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 737 | early_param("reserve_audio_size", reserve_audio_size_setup); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 738 | |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 739 | static void fix_sizes(void) |
| 740 | { |
| 741 | if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 742 | reserve_mdp_size = MSM7x25A_MSM_RESERVE_MDP_SIZE; |
| 743 | reserve_adsp_size = MSM7x25A_MSM_RESERVE_ADSP_SIZE; |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 744 | } else { |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 745 | reserve_mdp_size = MSM_RESERVE_MDP_SIZE; |
| 746 | reserve_adsp_size = MSM_RESERVE_ADSP_SIZE; |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 747 | } |
Chintan Pandya | d841376 | 2012-08-17 13:30:45 +0530 | [diff] [blame] | 748 | |
| 749 | if (get_ddr_size() > SZ_512M) |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 750 | reserve_adsp_size = CAMERA_ZSL_SIZE; |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 751 | #ifdef CONFIG_ION_MSM |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 752 | msm_ion_camera_size = reserve_adsp_size; |
| 753 | msm_ion_audio_size = (MSM_RESERVE_AUDIO_SIZE + |
| 754 | RESERVE_KERNEL_EBI1_SIZE); |
| 755 | msm_ion_sf_size = reserve_mdp_size; |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 756 | #endif |
| 757 | } |
| 758 | |
| 759 | #ifdef CONFIG_ION_MSM |
| 760 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 761 | static struct ion_co_heap_pdata co_ion_pdata = { |
| 762 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 763 | .align = PAGE_SIZE, |
| 764 | }; |
| 765 | #endif |
| 766 | |
| 767 | /** |
| 768 | * These heaps are listed in the order they will be allocated. |
| 769 | * Don't swap the order unless you know what you are doing! |
| 770 | */ |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 771 | struct ion_platform_heap msm7627a_heaps[] = { |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 772 | { |
| 773 | .id = ION_SYSTEM_HEAP_ID, |
| 774 | .type = ION_HEAP_TYPE_SYSTEM, |
| 775 | .name = ION_VMALLOC_HEAP_NAME, |
| 776 | }, |
| 777 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 778 | /* ION_ADSP = CAMERA */ |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 779 | { |
| 780 | .id = ION_CAMERA_HEAP_ID, |
| 781 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 782 | .name = ION_CAMERA_HEAP_NAME, |
| 783 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 784 | .extra_data = (void *)&co_ion_pdata, |
| 785 | }, |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 786 | /* ION_AUDIO */ |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 787 | { |
| 788 | .id = ION_AUDIO_HEAP_ID, |
| 789 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 790 | .name = ION_AUDIO_HEAP_NAME, |
| 791 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 792 | .extra_data = (void *)&co_ion_pdata, |
| 793 | }, |
Utsab Bose | 158d2b3 | 2012-09-03 17:59:52 +0530 | [diff] [blame] | 794 | /* ION_MDP = SF */ |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 795 | { |
| 796 | .id = ION_SF_HEAP_ID, |
| 797 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 798 | .name = ION_SF_HEAP_NAME, |
| 799 | .memory_type = ION_EBI_TYPE, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 800 | .extra_data = (void *)&co_ion_pdata, |
| 801 | }, |
| 802 | #endif |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 803 | }; |
| 804 | |
| 805 | static struct ion_platform_data ion_pdata = { |
| 806 | .nr = MSM_ION_HEAP_NUM, |
| 807 | .has_outer_cache = 1, |
| 808 | .heaps = msm7627a_heaps, |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 809 | }; |
| 810 | |
| 811 | static struct platform_device ion_dev = { |
| 812 | .name = "ion-msm", |
| 813 | .id = 1, |
| 814 | .dev = { .platform_data = &ion_pdata }, |
| 815 | }; |
| 816 | #endif |
| 817 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 818 | static struct memtype_reserve msm7x27a_reserve_table[] __initdata = { |
| 819 | [MEMTYPE_SMI] = { |
| 820 | }, |
| 821 | [MEMTYPE_EBI0] = { |
| 822 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 823 | }, |
| 824 | [MEMTYPE_EBI1] = { |
| 825 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 826 | }, |
| 827 | }; |
| 828 | |
Utsab Bose | 9a34117 | 2012-08-07 13:07:28 +0530 | [diff] [blame] | 829 | #ifdef CONFIG_MSM_RTB |
| 830 | static void __init reserve_rtb_memory(void) |
| 831 | { |
| 832 | msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm7x27a_rtb_pdata.size; |
| 833 | } |
| 834 | #else |
| 835 | static void __init reserve_rtb_memory(void) |
| 836 | { |
| 837 | } |
| 838 | #endif |
| 839 | |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 840 | static void __init size_ion_devices(void) |
| 841 | { |
| 842 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 843 | ion_pdata.heaps[1].size = msm_ion_camera_size; |
| 844 | ion_pdata.heaps[2].size = msm_ion_audio_size; |
| 845 | ion_pdata.heaps[3].size = msm_ion_sf_size; |
| 846 | #endif |
| 847 | } |
| 848 | |
| 849 | static void __init reserve_ion_memory(void) |
| 850 | { |
| 851 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 852 | msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_camera_size; |
| 853 | msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_audio_size; |
| 854 | msm7x27a_reserve_table[MEMTYPE_EBI1].size += msm_ion_sf_size; |
| 855 | #endif |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 856 | } |
| 857 | |
| 858 | static void __init msm7x27a_calculate_reserve_sizes(void) |
| 859 | { |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 860 | fix_sizes(); |
Chintan Pandya | 43d0a34 | 2012-06-08 19:45:56 +0530 | [diff] [blame] | 861 | size_ion_devices(); |
| 862 | reserve_ion_memory(); |
Utsab Bose | 9a34117 | 2012-08-07 13:07:28 +0530 | [diff] [blame] | 863 | reserve_rtb_memory(); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 864 | } |
| 865 | |
| 866 | static int msm7x27a_paddr_to_memtype(unsigned int paddr) |
| 867 | { |
| 868 | return MEMTYPE_EBI1; |
| 869 | } |
| 870 | |
| 871 | static struct reserve_info msm7x27a_reserve_info __initdata = { |
| 872 | .memtype_reserve_table = msm7x27a_reserve_table, |
| 873 | .calculate_reserve_sizes = msm7x27a_calculate_reserve_sizes, |
| 874 | .paddr_to_memtype = msm7x27a_paddr_to_memtype, |
| 875 | }; |
| 876 | |
| 877 | static void __init msm7x27a_reserve(void) |
| 878 | { |
| 879 | reserve_info = &msm7x27a_reserve_info; |
| 880 | msm_reserve(); |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 881 | } |
| 882 | |
Taniya Das | 2b16d1d | 2011-12-02 14:44:19 +0530 | [diff] [blame] | 883 | static void __init msm8625_reserve(void) |
| 884 | { |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 885 | msm7x27a_reserve(); |
Taniya Das | 46c964e | 2012-09-24 17:59:14 +0530 | [diff] [blame] | 886 | memblock_remove(MSM8625_CPU_PHYS, SZ_8); |
Murali Nalajala | feedeae | 2012-03-28 16:15:32 +0530 | [diff] [blame] | 887 | memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32); |
Taniya Das | 2b16d1d | 2011-12-02 14:44:19 +0530 | [diff] [blame] | 888 | } |
| 889 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 890 | static void __init msm7x27a_device_i2c_init(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 891 | { |
| 892 | msm_gsbi0_qup_i2c_device.dev.platform_data = &msm_gsbi0_qup_i2c_pdata; |
| 893 | msm_gsbi1_qup_i2c_device.dev.platform_data = &msm_gsbi1_qup_i2c_pdata; |
| 894 | } |
| 895 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 896 | static void __init msm8625_device_i2c_init(void) |
| 897 | { |
| 898 | msm8625_gsbi0_qup_i2c_device.dev.platform_data = |
| 899 | &msm_gsbi0_qup_i2c_pdata; |
| 900 | msm8625_gsbi1_qup_i2c_device.dev.platform_data = |
| 901 | &msm_gsbi1_qup_i2c_pdata; |
| 902 | } |
| 903 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 904 | #define MSM_EBI2_PHYS 0xa0d00000 |
| 905 | #define MSM_EBI2_XMEM_CS2_CFG1 0xa0d10030 |
| 906 | |
| 907 | static void __init msm7x27a_init_ebi2(void) |
| 908 | { |
| 909 | uint32_t ebi2_cfg; |
| 910 | void __iomem *ebi2_cfg_ptr; |
| 911 | |
| 912 | ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_PHYS, sizeof(uint32_t)); |
| 913 | if (!ebi2_cfg_ptr) |
| 914 | return; |
| 915 | |
| 916 | ebi2_cfg = readl(ebi2_cfg_ptr); |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 917 | if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf() || |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 918 | machine_is_msm7625a_surf() || machine_is_msm8625_surf()) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 919 | ebi2_cfg |= (1 << 4); /* CS2 */ |
| 920 | |
| 921 | writel(ebi2_cfg, ebi2_cfg_ptr); |
| 922 | iounmap(ebi2_cfg_ptr); |
| 923 | |
| 924 | /* Enable A/D MUX[bit 31] from EBI2_XMEM_CS2_CFG1 */ |
| 925 | ebi2_cfg_ptr = ioremap_nocache(MSM_EBI2_XMEM_CS2_CFG1, |
| 926 | sizeof(uint32_t)); |
| 927 | if (!ebi2_cfg_ptr) |
| 928 | return; |
| 929 | |
| 930 | ebi2_cfg = readl(ebi2_cfg_ptr); |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 931 | if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 932 | ebi2_cfg |= (1 << 31); |
| 933 | |
| 934 | writel(ebi2_cfg, ebi2_cfg_ptr); |
| 935 | iounmap(ebi2_cfg_ptr); |
| 936 | } |
| 937 | |
Justin Paupore | b3a33b7 | 2011-08-23 15:30:32 -0700 | [diff] [blame] | 938 | static struct platform_device msm_proccomm_regulator_dev = { |
| 939 | .name = PROCCOMM_REGULATOR_DEV_NAME, |
| 940 | .id = -1, |
| 941 | .dev = { |
| 942 | .platform_data = &msm7x27a_proccomm_regulator_data |
| 943 | } |
| 944 | }; |
| 945 | |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 946 | static void msm_adsp_add_pdev(void) |
| 947 | { |
| 948 | int rc = 0; |
| 949 | struct rpc_board_dev *rpc_adsp_pdev; |
| 950 | |
| 951 | rpc_adsp_pdev = kzalloc(sizeof(struct rpc_board_dev), GFP_KERNEL); |
| 952 | if (rpc_adsp_pdev == NULL) { |
| 953 | pr_err("%s: Memory Allocation failure\n", __func__); |
| 954 | return; |
| 955 | } |
| 956 | rpc_adsp_pdev->prog = ADSP_RPC_PROG; |
| 957 | |
Utsab Bose | 4ed4ba1 | 2012-11-08 18:52:38 +0530 | [diff] [blame] | 958 | if (cpu_is_msm8625() || cpu_is_msm8625q()) |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 959 | rpc_adsp_pdev->pdev = msm8625_device_adsp; |
| 960 | else |
| 961 | rpc_adsp_pdev->pdev = msm_adsp_device; |
| 962 | rc = msm_rpc_add_board_dev(rpc_adsp_pdev, 1); |
| 963 | if (rc < 0) { |
| 964 | pr_err("%s: return val: %d\n", __func__, rc); |
| 965 | kfree(rpc_adsp_pdev); |
| 966 | } |
| 967 | } |
| 968 | |
Trilok Soni | 16f61af | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 969 | static void __init msm7627a_rumi3_init(void) |
| 970 | { |
| 971 | msm7x27a_init_ebi2(); |
| 972 | platform_add_devices(rumi_sim_devices, |
| 973 | ARRAY_SIZE(rumi_sim_devices)); |
| 974 | } |
| 975 | |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 976 | static void __init msm8625_rumi3_init(void) |
| 977 | { |
| 978 | msm7x2x_misc_init(); |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 979 | msm_adsp_add_pdev(); |
| 980 | msm8625_device_i2c_init(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 981 | platform_add_devices(msm8625_rumi3_devices, |
| 982 | ARRAY_SIZE(msm8625_rumi3_devices)); |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 983 | |
Murali Nalajala | d1f67b0 | 2012-02-10 00:23:49 +0530 | [diff] [blame] | 984 | msm_pm_set_platform_data(msm8625_pm_data, |
| 985 | ARRAY_SIZE(msm8625_pm_data)); |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 986 | BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata)); |
| 987 | msm8x25_spm_device_init(); |
Murali Nalajala | ff723ec | 2012-07-13 16:54:40 +0530 | [diff] [blame] | 988 | msm_pm_register_cpr_ops(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 989 | } |
| 990 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 991 | #define UART1DM_RX_GPIO 45 |
Santosh Sajjan | b479f0f | 2011-08-18 21:00:44 +0530 | [diff] [blame] | 992 | |
| 993 | #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE) |
| 994 | static int __init msm7x27a_init_ar6000pm(void) |
| 995 | { |
Santosh Sajjan | 374d659 | 2012-01-19 23:16:46 +0530 | [diff] [blame] | 996 | msm_wlan_ar6000_pm_device.dev.platform_data = &ar600x_wlan_power; |
Santosh Sajjan | b479f0f | 2011-08-18 21:00:44 +0530 | [diff] [blame] | 997 | return platform_device_register(&msm_wlan_ar6000_pm_device); |
| 998 | } |
| 999 | #else |
| 1000 | static int __init msm7x27a_init_ar6000pm(void) { return 0; } |
| 1001 | #endif |
| 1002 | |
Justin Paupore | b3a33b7 | 2011-08-23 15:30:32 -0700 | [diff] [blame] | 1003 | static void __init msm7x27a_init_regulators(void) |
| 1004 | { |
| 1005 | int rc = platform_device_register(&msm_proccomm_regulator_dev); |
| 1006 | if (rc) |
| 1007 | pr_err("%s: could not register regulator device: %d\n", |
| 1008 | __func__, rc); |
| 1009 | } |
| 1010 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1011 | static void __init msm7x27a_add_footswitch_devices(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1012 | { |
Trilok Soni | 16f61af | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1013 | platform_add_devices(msm_footswitch_devices, |
| 1014 | msm_num_footswitch_devices); |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1015 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1016 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1017 | static void __init msm7x27a_add_platform_devices(void) |
| 1018 | { |
Aparna Mallavarapu | 9f000a7 | 2012-04-20 15:37:57 +0530 | [diff] [blame] | 1019 | if (machine_is_msm8625_surf() || machine_is_msm8625_ffa()) { |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1020 | platform_add_devices(msm8625_surf_devices, |
| 1021 | ARRAY_SIZE(msm8625_surf_devices)); |
| 1022 | } else { |
| 1023 | platform_add_devices(msm7627a_surf_ffa_devices, |
| 1024 | ARRAY_SIZE(msm7627a_surf_ffa_devices)); |
| 1025 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1026 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1027 | platform_add_devices(common_devices, |
| 1028 | ARRAY_SIZE(common_devices)); |
| 1029 | } |
| 1030 | |
| 1031 | static void __init msm7x27a_uartdm_config(void) |
| 1032 | { |
| 1033 | msm7x27a_cfg_uart2dm_serial(); |
| 1034 | msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO); |
Utsab Bose | 4ed4ba1 | 2012-11-08 18:52:38 +0530 | [diff] [blame] | 1035 | if (cpu_is_msm8625() || cpu_is_msm8625q()) |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1036 | msm8625_device_uart_dm1.dev.platform_data = |
| 1037 | &msm_uart_dm1_pdata; |
| 1038 | else |
| 1039 | msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata; |
| 1040 | } |
| 1041 | |
| 1042 | static void __init msm7x27a_otg_gadget(void) |
| 1043 | { |
Utsab Bose | 4ed4ba1 | 2012-11-08 18:52:38 +0530 | [diff] [blame] | 1044 | if (cpu_is_msm8625() || cpu_is_msm8625q()) { |
Murali Nalajala | 6ff8fb1 | 2012-05-02 18:50:50 +0530 | [diff] [blame] | 1045 | msm_otg_pdata.swfi_latency = |
| 1046 | msm8625_pm_data[MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT].latency; |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1047 | msm8625_device_otg.dev.platform_data = &msm_otg_pdata; |
| 1048 | msm8625_device_gadget_peripheral.dev.platform_data = |
| 1049 | &msm_gadget_pdata; |
| 1050 | } else { |
Murali Nalajala | 6ff8fb1 | 2012-05-02 18:50:50 +0530 | [diff] [blame] | 1051 | msm_otg_pdata.swfi_latency = |
| 1052 | msm7x27a_pm_data[ |
| 1053 | MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency; |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1054 | msm_device_otg.dev.platform_data = &msm_otg_pdata; |
| 1055 | msm_device_gadget_peripheral.dev.platform_data = |
| 1056 | &msm_gadget_pdata; |
| 1057 | } |
| 1058 | } |
| 1059 | |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1060 | static void __init msm7x27a_pm_init(void) |
| 1061 | { |
Aparna Mallavarapu | 9f000a7 | 2012-04-20 15:37:57 +0530 | [diff] [blame] | 1062 | if (machine_is_msm8625_surf() || machine_is_msm8625_ffa()) { |
Murali Nalajala | 8ee084e | 2012-03-07 00:09:38 +0530 | [diff] [blame] | 1063 | msm_pm_set_platform_data(msm8625_pm_data, |
| 1064 | ARRAY_SIZE(msm8625_pm_data)); |
| 1065 | BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata)); |
| 1066 | msm8x25_spm_device_init(); |
Murali Nalajala | ff723ec | 2012-07-13 16:54:40 +0530 | [diff] [blame] | 1067 | msm_pm_register_cpr_ops(); |
Murali Nalajala | 8ee084e | 2012-03-07 00:09:38 +0530 | [diff] [blame] | 1068 | } else { |
| 1069 | msm_pm_set_platform_data(msm7x27a_pm_data, |
| 1070 | ARRAY_SIZE(msm7x27a_pm_data)); |
| 1071 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
| 1072 | } |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 1073 | |
| 1074 | msm_pm_register_irqs(); |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1075 | } |
| 1076 | |
| 1077 | static void __init msm7x2x_init(void) |
| 1078 | { |
| 1079 | msm7x2x_misc_init(); |
| 1080 | |
| 1081 | /* Initialize regulators first so that other devices can use them */ |
| 1082 | msm7x27a_init_regulators(); |
| 1083 | msm_adsp_add_pdev(); |
Utsab Bose | 4ed4ba1 | 2012-11-08 18:52:38 +0530 | [diff] [blame] | 1084 | if (cpu_is_msm8625() || cpu_is_msm8625q()) |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1085 | msm8625_device_i2c_init(); |
| 1086 | else |
| 1087 | msm7x27a_device_i2c_init(); |
| 1088 | msm7x27a_init_ebi2(); |
| 1089 | msm7x27a_uartdm_config(); |
| 1090 | |
| 1091 | msm7x27a_otg_gadget(); |
| 1092 | msm7x27a_cfg_smsc911x(); |
| 1093 | |
| 1094 | msm7x27a_add_footswitch_devices(); |
| 1095 | msm7x27a_add_platform_devices(); |
| 1096 | /* Ensure ar6000pm device is registered before MMC/SDC */ |
| 1097 | msm7x27a_init_ar6000pm(); |
| 1098 | msm7627a_init_mmc(); |
| 1099 | msm_fb_add_devices(); |
| 1100 | msm7x2x_init_host(); |
| 1101 | msm7x27a_pm_init(); |
| 1102 | register_i2c_devices(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1103 | #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE) |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1104 | msm7627a_bt_power_init(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1105 | #endif |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1106 | msm7627a_camera_init(); |
Chintan Pandya | 0d45319 | 2012-03-09 13:20:33 +0530 | [diff] [blame] | 1107 | msm7627a_add_io_devices(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1108 | /*7x25a kgsl initializations*/ |
| 1109 | msm7x25a_kgsl_3d0_init(); |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 1110 | /*8x25 kgsl initializations*/ |
| 1111 | msm8x25_kgsl_3d0_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1112 | } |
| 1113 | |
| 1114 | static void __init msm7x2x_init_early(void) |
| 1115 | { |
Chintan Pandya | 250c2e5 | 2012-01-19 17:15:49 +0530 | [diff] [blame] | 1116 | msm_msm7627a_allocate_memory_regions(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1117 | } |
| 1118 | |
| 1119 | MACHINE_START(MSM7X27A_RUMI3, "QCT MSM7x27a RUMI3") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1120 | .atag_offset = 0x100, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1121 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1122 | .reserve = msm7x27a_reserve, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1123 | .init_irq = msm_init_irq, |
Trilok Soni | 16f61af | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1124 | .init_machine = msm7627a_rumi3_init, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1125 | .timer = &msm_timer, |
| 1126 | .init_early = msm7x2x_init_early, |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 1127 | .handle_irq = vic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1128 | MACHINE_END |
| 1129 | MACHINE_START(MSM7X27A_SURF, "QCT MSM7x27a SURF") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1130 | .atag_offset = 0x100, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1131 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1132 | .reserve = msm7x27a_reserve, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1133 | .init_irq = msm_init_irq, |
| 1134 | .init_machine = msm7x2x_init, |
| 1135 | .timer = &msm_timer, |
| 1136 | .init_early = msm7x2x_init_early, |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 1137 | .handle_irq = vic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1138 | MACHINE_END |
| 1139 | MACHINE_START(MSM7X27A_FFA, "QCT MSM7x27a FFA") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1140 | .atag_offset = 0x100, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1141 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1142 | .reserve = msm7x27a_reserve, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1143 | .init_irq = msm_init_irq, |
| 1144 | .init_machine = msm7x2x_init, |
| 1145 | .timer = &msm_timer, |
| 1146 | .init_early = msm7x2x_init_early, |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 1147 | .handle_irq = vic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1148 | MACHINE_END |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1149 | MACHINE_START(MSM7625A_SURF, "QCT MSM7625a SURF") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1150 | .atag_offset = 0x100, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1151 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1152 | .reserve = msm7x27a_reserve, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1153 | .init_irq = msm_init_irq, |
| 1154 | .init_machine = msm7x2x_init, |
| 1155 | .timer = &msm_timer, |
| 1156 | .init_early = msm7x2x_init_early, |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 1157 | .handle_irq = vic_handle_irq, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1158 | MACHINE_END |
| 1159 | MACHINE_START(MSM7625A_FFA, "QCT MSM7625a FFA") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1160 | .atag_offset = 0x100, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1161 | .map_io = msm_common_io_init, |
Trilok Soni | b941079 | 2012-04-07 15:37:13 +0530 | [diff] [blame] | 1162 | .reserve = msm7x27a_reserve, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1163 | .init_irq = msm_init_irq, |
| 1164 | .init_machine = msm7x2x_init, |
| 1165 | .timer = &msm_timer, |
| 1166 | .init_early = msm7x2x_init_early, |
Taniya Das | 86e0e13 | 2011-10-19 11:32:00 +0530 | [diff] [blame] | 1167 | .handle_irq = vic_handle_irq, |
Trilok Soni | 3d0f6c5 | 2011-07-26 16:06:58 +0530 | [diff] [blame] | 1168 | MACHINE_END |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1169 | MACHINE_START(MSM8625_RUMI3, "QCT MSM8625 RUMI3") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1170 | .atag_offset = 0x100, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1171 | .map_io = msm8625_map_io, |
Taniya Das | 2b16d1d | 2011-12-02 14:44:19 +0530 | [diff] [blame] | 1172 | .reserve = msm8625_reserve, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1173 | .init_irq = msm8625_init_irq, |
| 1174 | .init_machine = msm8625_rumi3_init, |
| 1175 | .timer = &msm_timer, |
| 1176 | .handle_irq = gic_handle_irq, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 1177 | .smp = &msm8625_smp_ops, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1178 | MACHINE_END |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1179 | MACHINE_START(MSM8625_SURF, "QCT MSM8625 SURF") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1180 | .atag_offset = 0x100, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1181 | .map_io = msm8625_map_io, |
| 1182 | .reserve = msm8625_reserve, |
| 1183 | .init_irq = msm8625_init_irq, |
| 1184 | .init_machine = msm7x2x_init, |
| 1185 | .timer = &msm_timer, |
| 1186 | .init_early = msm7x2x_init_early, |
| 1187 | .handle_irq = gic_handle_irq, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 1188 | .smp = &msm8625_smp_ops, |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1189 | MACHINE_END |
Aparna Mallavarapu | 9f000a7 | 2012-04-20 15:37:57 +0530 | [diff] [blame] | 1190 | MACHINE_START(MSM8625_FFA, "QCT MSM8625 FFA") |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1191 | .atag_offset = 0x100, |
Aparna Mallavarapu | 9f000a7 | 2012-04-20 15:37:57 +0530 | [diff] [blame] | 1192 | .map_io = msm8625_map_io, |
| 1193 | .reserve = msm8625_reserve, |
| 1194 | .init_irq = msm8625_init_irq, |
| 1195 | .init_machine = msm7x2x_init, |
| 1196 | .timer = &msm_timer, |
| 1197 | .init_early = msm7x2x_init_early, |
| 1198 | .handle_irq = gic_handle_irq, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 1199 | .smp = &msm8625_smp_ops, |
Aparna Mallavarapu | 9f000a7 | 2012-04-20 15:37:57 +0530 | [diff] [blame] | 1200 | MACHINE_END |