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