/arch/arm/mach-msm/board-fsm9xxx.c

https://github.com/AICP/kernel_google_msm · C · 995 lines · 833 code · 112 blank · 50 comment · 18 complexity · f2cb220875565f42d2f49ae4508a8026 MD5 · raw file

  1. /* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  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. */
  13. #include <linux/kernel.h>
  14. #include <linux/irq.h>
  15. #include <linux/gpio.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/delay.h>
  18. #include <linux/io.h>
  19. #include <linux/msm_ssbi.h>
  20. #include <linux/mfd/pmic8058.h>
  21. #include <linux/regulator/pmic8058-regulator.h>
  22. #include <linux/i2c.h>
  23. #include <linux/dma-mapping.h>
  24. #include <linux/dmapool.h>
  25. #include <linux/regulator/pm8058-xo.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/setup.h>
  29. #include <mach/board.h>
  30. #include <mach/memory.h>
  31. #include <mach/msm_iomap.h>
  32. #include <mach/dma.h>
  33. #include <mach/sirc.h>
  34. #include <mach/restart.h>
  35. #include <mach/socinfo.h>
  36. #include "devices.h"
  37. #include "timer.h"
  38. #include "clock.h"
  39. #include "pm.h"
  40. #include "spm.h"
  41. #include <linux/regulator/consumer.h>
  42. #include <linux/regulator/machine.h>
  43. #include <linux/msm_adc.h>
  44. #include <linux/m_adcproc.h>
  45. #include <linux/platform_data/qcom_crypto_device.h>
  46. #define PMIC_GPIO_INT 144
  47. #define PMIC_VREG_WLAN_LEVEL 2900
  48. #define PMIC_GPIO_SD_DET 165
  49. #define GPIO_EPHY_RST_N 37
  50. #define GPIO_MAC_TXD_3 119
  51. #define GPIO_MAC_TXD_2 120
  52. #define GPIO_MAC_TXD_1 121
  53. #define GPIO_MAC_TXD_0 122
  54. #define GPIO_MAC_TX_EN 123
  55. #define GPIO_MAC_MDIO 127
  56. #define GPIO_MAC_MDC 128
  57. #define GPIO_MAC_TX_CLK 133
  58. #define GPIO_GRFC_FTR0_0 136 /* GRFC 20 */
  59. #define GPIO_GRFC_FTR0_1 137 /* GRFC 21 */
  60. #define GPIO_GRFC_FTR1_0 145 /* GRFC 22 */
  61. #define GPIO_GRFC_FTR1_1 93 /* GRFC 19 */
  62. #define GPIO_GRFC_2 110
  63. #define GPIO_GRFC_3 109
  64. #define GPIO_GRFC_4 108
  65. #define GPIO_GRFC_5 107
  66. #define GPIO_GRFC_6 106
  67. #define GPIO_GRFC_7 105
  68. #define GPIO_GRFC_8 104
  69. #define GPIO_GRFC_9 103
  70. #define GPIO_GRFC_10 102
  71. #define GPIO_GRFC_11 101
  72. #define GPIO_GRFC_13 99
  73. #define GPIO_GRFC_14 98
  74. #define GPIO_GRFC_15 97
  75. #define GPIO_GRFC_16 96
  76. #define GPIO_GRFC_17 95
  77. #define GPIO_GRFC_18 94
  78. #define GPIO_GRFC_24 150
  79. #define GPIO_GRFC_25 151
  80. #define GPIO_GRFC_26 152
  81. #define GPIO_GRFC_27 153
  82. #define GPIO_GRFC_28 154
  83. #define GPIO_GRFC_29 155
  84. #define GPIO_USER_FIRST 58
  85. #define GPIO_USER_LAST 63
  86. #define GPIO_UIM_RESET 75
  87. #define GPIO_UIM_DATA_IO 76
  88. #define GPIO_UIM_CLOCK 77
  89. #define GPIO_PM_UIM_M_RST 26 /* UIM_RST input */
  90. #define GPIO_PM_UIM_RST 27 /* UIM_RST output */
  91. #define GPIO_PM_UIM_M_CLK 28 /* UIM_CLK input */
  92. #define GPIO_PM_UIM_CLK 29 /* UIM_CLK output */
  93. #define FPGA_SDCC_STATUS 0x8E0001A8
  94. /* Macros assume PMIC GPIOs start at 0 */
  95. #define PM8058_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio + NR_MSM_GPIOS)
  96. #define PM8058_GPIO_SYS_TO_PM(sys_gpio) (sys_gpio - NR_MSM_GPIOS)
  97. #define PM8058_MPP_BASE (NR_MSM_GPIOS + PM8058_GPIOS)
  98. #define PM8058_MPP_PM_TO_SYS(pm_gpio) (pm_gpio + PM8058_MPP_BASE)
  99. #define PM8058_MPP_SYS_TO_PM(sys_gpio) (sys_gpio - PM8058_MPP_BASE)
  100. #define PMIC_GPIO_5V_PA_PWR 21 /* PMIC GPIO Number 22 */
  101. #define PMIC_GPIO_4_2V_PA_PWR 22 /* PMIC GPIO Number 23 */
  102. #define PMIC_MPP_UIM_M_DATA 0 /* UIM_DATA input */
  103. #define PMIC_MPP_UIM_DATA 1 /* UIM_DATA output */
  104. #define PMIC_MPP_3 2 /* PMIC MPP Number 3 */
  105. #define PMIC_MPP_6 5 /* PMIC MPP Number 6 */
  106. #define PMIC_MPP_7 6 /* PMIC MPP Number 7 */
  107. #define PMIC_MPP_10 9 /* PMIC MPP Number 10 */
  108. /*
  109. * PM8058
  110. */
  111. struct pm8xxx_mpp_init_info {
  112. unsigned mpp;
  113. struct pm8xxx_mpp_config_data config;
  114. };
  115. #define PM8XXX_MPP_INIT(_mpp, _type, _level, _control) \
  116. { \
  117. .mpp = PM8058_MPP_PM_TO_SYS(_mpp), \
  118. .config = { \
  119. .type = PM8XXX_MPP_TYPE_##_type, \
  120. .level = _level, \
  121. .control = PM8XXX_MPP_##_control, \
  122. } \
  123. }
  124. static int pm8058_gpios_init(void)
  125. {
  126. int i;
  127. int rc;
  128. struct pm8058_gpio_cfg {
  129. int gpio;
  130. struct pm_gpio cfg;
  131. };
  132. struct pm8058_gpio_cfg gpio_cfgs[] = {
  133. { /* 5V PA Power */
  134. PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_5V_PA_PWR),
  135. {
  136. .vin_sel = 0,
  137. .direction = PM_GPIO_DIR_BOTH,
  138. .output_value = 1,
  139. .output_buffer = PM_GPIO_OUT_BUF_CMOS,
  140. .pull = PM_GPIO_PULL_DN,
  141. .out_strength = PM_GPIO_STRENGTH_HIGH,
  142. .function = PM_GPIO_FUNC_NORMAL,
  143. .inv_int_pol = 0,
  144. },
  145. },
  146. { /* 4.2V PA Power */
  147. PM8058_GPIO_PM_TO_SYS(PMIC_GPIO_4_2V_PA_PWR),
  148. {
  149. .vin_sel = 0,
  150. .direction = PM_GPIO_DIR_BOTH,
  151. .output_value = 1,
  152. .output_buffer = PM_GPIO_OUT_BUF_CMOS,
  153. .pull = PM_GPIO_PULL_DN,
  154. .out_strength = PM_GPIO_STRENGTH_HIGH,
  155. .function = PM_GPIO_FUNC_NORMAL,
  156. .inv_int_pol = 0,
  157. },
  158. },
  159. };
  160. for (i = 0; i < ARRAY_SIZE(gpio_cfgs); ++i) {
  161. rc = pm8xxx_gpio_config(gpio_cfgs[i].gpio, &gpio_cfgs[i].cfg);
  162. if (rc < 0) {
  163. pr_err("%s pmic gpio config failed\n", __func__);
  164. return rc;
  165. }
  166. }
  167. return 0;
  168. }
  169. static int pm8058_mpps_init(void)
  170. {
  171. int rc, i;
  172. struct pm8xxx_mpp_init_info pm8058_mpps[] = {
  173. PM8XXX_MPP_INIT(PMIC_MPP_3, A_OUTPUT,
  174. PM8XXX_MPP_AOUT_LVL_1V25_2, AOUT_CTRL_ENABLE),
  175. PM8XXX_MPP_INIT(PMIC_MPP_6, A_OUTPUT,
  176. PM8XXX_MPP_AOUT_LVL_1V25_2, AOUT_CTRL_ENABLE),
  177. PM8XXX_MPP_INIT(PMIC_MPP_UIM_M_DATA, D_BI_DIR,
  178. PM8058_MPP_DIG_LEVEL_S3, BI_PULLUP_1KOHM),
  179. PM8XXX_MPP_INIT(PMIC_MPP_UIM_DATA, D_BI_DIR,
  180. PM8058_MPP_DIG_LEVEL_L3, BI_PULLUP_30KOHM),
  181. };
  182. for (i = 0; i < ARRAY_SIZE(pm8058_mpps); i++) {
  183. rc = pm8xxx_mpp_config(pm8058_mpps[i].mpp,
  184. &pm8058_mpps[i].config);
  185. if (rc) {
  186. pr_err("%s: Config %d mpp pm 8058 failed\n",
  187. __func__, pm8058_mpps[i].mpp);
  188. return rc;
  189. }
  190. }
  191. return 0;
  192. }
  193. static struct regulator_consumer_supply pm8058_vreg_supply[PM8058_VREG_MAX] = {
  194. [PM8058_VREG_ID_L3] = REGULATOR_SUPPLY("8058_l3", NULL),
  195. [PM8058_VREG_ID_L8] = REGULATOR_SUPPLY("8058_l8", NULL),
  196. [PM8058_VREG_ID_L9] = REGULATOR_SUPPLY("8058_l9", NULL),
  197. [PM8058_VREG_ID_L14] = REGULATOR_SUPPLY("8058_l14", NULL),
  198. [PM8058_VREG_ID_L15] = REGULATOR_SUPPLY("8058_l15", NULL),
  199. [PM8058_VREG_ID_L18] = REGULATOR_SUPPLY("8058_l18", NULL),
  200. [PM8058_VREG_ID_S4] = REGULATOR_SUPPLY("8058_s4", NULL),
  201. [PM8058_VREG_ID_LVS0] = REGULATOR_SUPPLY("8058_lvs0", NULL),
  202. };
  203. #define PM8058_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \
  204. _always_on, _pull_down) \
  205. { \
  206. .init_data = { \
  207. .constraints = { \
  208. .valid_modes_mask = _modes, \
  209. .valid_ops_mask = _ops, \
  210. .min_uV = _min_uV, \
  211. .max_uV = _max_uV, \
  212. .apply_uV = _apply_uV, \
  213. .always_on = _always_on, \
  214. }, \
  215. .num_consumer_supplies = 1, \
  216. .consumer_supplies = &pm8058_vreg_supply[_id], \
  217. }, \
  218. .id = _id, \
  219. .pull_down_enable = _pull_down, \
  220. .pin_ctrl = 0, \
  221. .pin_fn = PM8058_VREG_PIN_FN_ENABLE, \
  222. }
  223. #define PM8058_VREG_INIT_LDO(_id, _min_uV, _max_uV) \
  224. PM8058_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL | \
  225. REGULATOR_MODE_IDLE | REGULATOR_MODE_STANDBY, \
  226. REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS | \
  227. REGULATOR_CHANGE_MODE, 1, 1, 1)
  228. #define PM8058_VREG_INIT_SMPS(_id, _min_uV, _max_uV) \
  229. PM8058_VREG_INIT(_id, _min_uV, _max_uV, REGULATOR_MODE_NORMAL | \
  230. REGULATOR_MODE_IDLE | REGULATOR_MODE_STANDBY, \
  231. REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS | \
  232. REGULATOR_CHANGE_MODE, 1, 1, 1)
  233. #define PM8058_VREG_INIT_LVS(_id, _min_uV, _max_uV) \
  234. PM8058_VREG_INIT(_id, _min_uV, _min_uV, REGULATOR_MODE_NORMAL, \
  235. REGULATOR_CHANGE_STATUS, 0, 0, 1)
  236. static struct pm8058_vreg_pdata pm8058_vreg_init[] = {
  237. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L3, 3000000, 3000000),
  238. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L8, 2200000, 2200000),
  239. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L9, 2050000, 2050000),
  240. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L14, 2850000, 2850000),
  241. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L15, 2200000, 2200000),
  242. PM8058_VREG_INIT_LDO(PM8058_VREG_ID_L18, 2200000, 2200000),
  243. PM8058_VREG_INIT_LVS(PM8058_VREG_ID_LVS0, 1800000, 1800000),
  244. PM8058_VREG_INIT_SMPS(PM8058_VREG_ID_S4, 1300000, 1300000),
  245. };
  246. #ifdef CONFIG_SENSORS_MSM_ADC
  247. static struct adc_access_fn xoadc_fn = {
  248. pm8058_xoadc_select_chan_and_start_conv,
  249. pm8058_xoadc_read_adc_code,
  250. pm8058_xoadc_get_properties,
  251. pm8058_xoadc_slot_request,
  252. pm8058_xoadc_restore_slot,
  253. pm8058_xoadc_calibrate,
  254. };
  255. static struct msm_adc_channels msm_adc_channels_data[] = {
  256. {"pmic_therm", CHANNEL_ADC_DIE_TEMP, 0, &xoadc_fn, CHAN_PATH_TYPE12,
  257. ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE1, scale_pmic_therm},
  258. {"ref_1250mv", CHANNEL_ADC_1250_REF, 0, &xoadc_fn, CHAN_PATH_TYPE13,
  259. ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE2, scale_default},
  260. {"xo_therm", CHANNEL_ADC_XOTHERM, 0, &xoadc_fn, CHAN_PATH_TYPE_NONE,
  261. ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE5, tdkntcgtherm},
  262. {"fsm_therm", CHANNEL_ADC_FSM_THERM, 0, &xoadc_fn, CHAN_PATH_TYPE6,
  263. ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE5, tdkntcgtherm},
  264. {"pa_therm", CHANNEL_ADC_PA_THERM, 0, &xoadc_fn, CHAN_PATH_TYPE7,
  265. ADC_CONFIG_TYPE2, ADC_CALIB_CONFIG_TYPE5, tdkntcgtherm},
  266. };
  267. static struct msm_adc_platform_data msm_adc_pdata = {
  268. .channel = msm_adc_channels_data,
  269. .num_chan_supported = ARRAY_SIZE(msm_adc_channels_data),
  270. .target_hw = FSM_9xxx,
  271. };
  272. static struct platform_device msm_adc_device = {
  273. .name = "msm_adc",
  274. .id = -1,
  275. .dev = {
  276. .platform_data = &msm_adc_pdata,
  277. },
  278. };
  279. static void pmic8058_xoadc_mpp_config(void)
  280. {
  281. int rc, i;
  282. struct pm8xxx_mpp_init_info xoadc_mpps[] = {
  283. PM8XXX_MPP_INIT(PMIC_MPP_7, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH5,
  284. AOUT_CTRL_DISABLE),
  285. PM8XXX_MPP_INIT(PMIC_MPP_10, A_INPUT, PM8XXX_MPP_AIN_AMUX_CH6,
  286. AOUT_CTRL_DISABLE),
  287. };
  288. for (i = 0; i < ARRAY_SIZE(xoadc_mpps); i++) {
  289. rc = pm8xxx_mpp_config(xoadc_mpps[i].mpp,
  290. &xoadc_mpps[i].config);
  291. if (rc) {
  292. pr_err("%s: Config MPP %d of PM8058 failed\n",
  293. __func__, xoadc_mpps[i].mpp);
  294. }
  295. }
  296. }
  297. static struct regulator *vreg_ldo18_adc;
  298. static int pmic8058_xoadc_vreg_config(int on)
  299. {
  300. int rc;
  301. if (on) {
  302. rc = regulator_enable(vreg_ldo18_adc);
  303. if (rc)
  304. pr_err("%s: Enable of regulator ldo18_adc "
  305. "failed\n", __func__);
  306. } else {
  307. rc = regulator_disable(vreg_ldo18_adc);
  308. if (rc)
  309. pr_err("%s: Disable of regulator ldo18_adc "
  310. "failed\n", __func__);
  311. }
  312. return rc;
  313. }
  314. static int pmic8058_xoadc_vreg_setup(void)
  315. {
  316. int rc;
  317. vreg_ldo18_adc = regulator_get(NULL, "8058_l18");
  318. if (IS_ERR(vreg_ldo18_adc)) {
  319. pr_err("%s: vreg get failed (%ld)\n",
  320. __func__, PTR_ERR(vreg_ldo18_adc));
  321. rc = PTR_ERR(vreg_ldo18_adc);
  322. goto fail;
  323. }
  324. rc = regulator_set_voltage(vreg_ldo18_adc, 2200000, 2200000);
  325. if (rc) {
  326. pr_err("%s: unable to set ldo18 voltage to 2.2V\n", __func__);
  327. goto fail;
  328. }
  329. return rc;
  330. fail:
  331. regulator_put(vreg_ldo18_adc);
  332. return rc;
  333. }
  334. static void pmic8058_xoadc_vreg_shutdown(void)
  335. {
  336. regulator_put(vreg_ldo18_adc);
  337. }
  338. /* usec. For this ADC,
  339. * this time represents clk rate @ txco w/ 1024 decimation ratio.
  340. * Each channel has different configuration, thus at the time of starting
  341. * the conversion, xoadc will return actual conversion time
  342. * */
  343. static struct adc_properties pm8058_xoadc_data = {
  344. .adc_reference = 2200, /* milli-voltage for this adc */
  345. .bitresolution = 15,
  346. .bipolar = 0,
  347. .conversiontime = 54,
  348. };
  349. static struct xoadc_platform_data pm8058_xoadc_pdata = {
  350. .xoadc_prop = &pm8058_xoadc_data,
  351. .xoadc_mpp_config = pmic8058_xoadc_mpp_config,
  352. .xoadc_vreg_set = pmic8058_xoadc_vreg_config,
  353. .xoadc_num = XOADC_PMIC_0,
  354. .xoadc_vreg_setup = pmic8058_xoadc_vreg_setup,
  355. .xoadc_vreg_shutdown = pmic8058_xoadc_vreg_shutdown,
  356. };
  357. #endif
  358. #define XO_CONSUMERS(_id) \
  359. static struct regulator_consumer_supply xo_consumers_##_id[]
  360. /*
  361. * Consumer specific regulator names:
  362. * regulator name consumer dev_name
  363. */
  364. XO_CONSUMERS(A0) = {
  365. REGULATOR_SUPPLY("8058_xo_a0", NULL),
  366. REGULATOR_SUPPLY("a0_clk_buffer", "fsm_xo_driver"),
  367. };
  368. XO_CONSUMERS(A1) = {
  369. REGULATOR_SUPPLY("8058_xo_a1", NULL),
  370. REGULATOR_SUPPLY("a1_clk_buffer", "fsm_xo_driver"),
  371. };
  372. #define PM8058_XO_INIT(_id, _modes, _ops, _always_on) \
  373. { \
  374. .init_data = { \
  375. .constraints = { \
  376. .valid_modes_mask = _modes, \
  377. .valid_ops_mask = _ops, \
  378. .boot_on = 1, \
  379. .always_on = _always_on, \
  380. }, \
  381. .num_consumer_supplies = \
  382. ARRAY_SIZE(xo_consumers_##_id),\
  383. .consumer_supplies = xo_consumers_##_id, \
  384. }, \
  385. .id = PM8058_XO_ID_##_id, \
  386. }
  387. #define PM8058_XO_INIT_AX(_id) \
  388. PM8058_XO_INIT(_id, REGULATOR_MODE_NORMAL, REGULATOR_CHANGE_STATUS, 0)
  389. static struct pm8058_xo_pdata pm8058_xo_init_pdata[] = {
  390. PM8058_XO_INIT_AX(A0),
  391. PM8058_XO_INIT_AX(A1),
  392. };
  393. #define PM8058_GPIO_INT 47
  394. static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata = {
  395. .irq_base = PMIC8058_IRQ_BASE,
  396. .devirq = MSM_GPIO_TO_INT(PM8058_GPIO_INT),
  397. .irq_trigger_flag = IRQF_TRIGGER_LOW,
  398. };
  399. static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata = {
  400. .gpio_base = PM8058_GPIO_PM_TO_SYS(0),
  401. };
  402. static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata = {
  403. .mpp_base = PM8058_MPP_PM_TO_SYS(0),
  404. };
  405. static struct pm8058_platform_data pm8058_fsm9xxx_data = {
  406. .irq_pdata = &pm8xxx_irq_pdata,
  407. .gpio_pdata = &pm8xxx_gpio_pdata,
  408. .mpp_pdata = &pm8xxx_mpp_pdata,
  409. .regulator_pdatas = pm8058_vreg_init,
  410. .num_regulators = ARRAY_SIZE(pm8058_vreg_init),
  411. .xo_buffer_pdata = pm8058_xo_init_pdata,
  412. .num_xo_buffers = ARRAY_SIZE(pm8058_xo_init_pdata),
  413. #ifdef CONFIG_SENSORS_MSM_ADC
  414. .xoadc_pdata = &pm8058_xoadc_pdata,
  415. #endif
  416. };
  417. #ifdef CONFIG_MSM_SSBI
  418. static struct msm_ssbi_platform_data fsm9xxx_ssbi_pm8058_pdata = {
  419. .controller_type = FSM_SBI_CTRL_SSBI,
  420. .slave = {
  421. .name = "pm8058-core",
  422. .platform_data = &pm8058_fsm9xxx_data,
  423. },
  424. };
  425. #endif
  426. static int __init buses_init(void)
  427. {
  428. if (gpio_tlmm_config(GPIO_CFG(PMIC_GPIO_INT, 5, GPIO_CFG_INPUT,
  429. GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE))
  430. pr_err("%s: gpio_tlmm_config (gpio=%d) failed\n",
  431. __func__, PMIC_GPIO_INT);
  432. return 0;
  433. }
  434. /*
  435. * EPHY
  436. */
  437. static struct msm_gpio phy_config_data[] = {
  438. { GPIO_CFG(GPIO_EPHY_RST_N, 0, GPIO_CFG_OUTPUT,
  439. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_RST_N" },
  440. { GPIO_CFG(GPIO_MAC_TXD_3, 0, GPIO_CFG_OUTPUT,
  441. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_TXD_3"},
  442. { GPIO_CFG(GPIO_MAC_TXD_2, 0, GPIO_CFG_OUTPUT,
  443. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_TXD_2"},
  444. { GPIO_CFG(GPIO_MAC_TXD_1, 0, GPIO_CFG_OUTPUT,
  445. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_TXD_1"},
  446. { GPIO_CFG(GPIO_MAC_TXD_0, 0, GPIO_CFG_OUTPUT,
  447. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_TXD_0"},
  448. { GPIO_CFG(GPIO_MAC_TX_EN, 0, GPIO_CFG_OUTPUT,
  449. GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "MAC_TX_EN"},
  450. { GPIO_CFG(GPIO_MAC_TX_CLK, 0, GPIO_CFG_OUTPUT,
  451. GPIO_CFG_NO_PULL, GPIO_CFG_10MA), "MAC_TX_CLK"},
  452. { GPIO_CFG(GPIO_MAC_MDIO, 0, GPIO_CFG_OUTPUT,
  453. GPIO_CFG_NO_PULL, GPIO_CFG_6MA), "MDIO_MAC_MDIO"},
  454. { GPIO_CFG(GPIO_MAC_MDC, 0, GPIO_CFG_OUTPUT,
  455. GPIO_CFG_NO_PULL, GPIO_CFG_6MA), "MDC_MAC_MDC"},
  456. };
  457. static int __init phy_init(void)
  458. {
  459. msm_gpios_request_enable(phy_config_data, ARRAY_SIZE(phy_config_data));
  460. gpio_direction_output(GPIO_EPHY_RST_N, 0);
  461. udelay(100);
  462. gpio_set_value(GPIO_EPHY_RST_N, 1);
  463. return 0;
  464. }
  465. /*
  466. * RF
  467. */
  468. static struct msm_gpio grfc_config_data[] = {
  469. { GPIO_CFG(GPIO_GRFC_FTR0_0, 7, GPIO_CFG_OUTPUT,
  470. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "HH_RFMODE1_0" },
  471. { GPIO_CFG(GPIO_GRFC_FTR0_1, 7, GPIO_CFG_OUTPUT,
  472. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "HH_RFMODE1_1" },
  473. { GPIO_CFG(GPIO_GRFC_FTR1_0, 7, GPIO_CFG_OUTPUT,
  474. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "HH_RFMODE2_0" },
  475. { GPIO_CFG(GPIO_GRFC_FTR1_1, 7, GPIO_CFG_OUTPUT,
  476. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "HH_RFMODE2_1" },
  477. { GPIO_CFG(GPIO_GRFC_2, 7, GPIO_CFG_OUTPUT,
  478. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_2" },
  479. { GPIO_CFG(GPIO_GRFC_3, 7, GPIO_CFG_OUTPUT,
  480. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_3" },
  481. { GPIO_CFG(GPIO_GRFC_4, 7, GPIO_CFG_OUTPUT,
  482. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_4" },
  483. { GPIO_CFG(GPIO_GRFC_5, 7, GPIO_CFG_OUTPUT,
  484. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_5" },
  485. { GPIO_CFG(GPIO_GRFC_6, 7, GPIO_CFG_OUTPUT,
  486. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_6" },
  487. { GPIO_CFG(GPIO_GRFC_7, 7, GPIO_CFG_OUTPUT,
  488. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_7" },
  489. { GPIO_CFG(GPIO_GRFC_8, 7, GPIO_CFG_OUTPUT,
  490. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_8" },
  491. { GPIO_CFG(GPIO_GRFC_9, 7, GPIO_CFG_OUTPUT,
  492. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_9" },
  493. { GPIO_CFG(GPIO_GRFC_10, 7, GPIO_CFG_OUTPUT,
  494. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_10" },
  495. { GPIO_CFG(GPIO_GRFC_11, 7, GPIO_CFG_OUTPUT,
  496. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_11" },
  497. { GPIO_CFG(GPIO_GRFC_13, 7, GPIO_CFG_OUTPUT,
  498. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_13" },
  499. { GPIO_CFG(GPIO_GRFC_14, 7, GPIO_CFG_OUTPUT,
  500. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_14" },
  501. { GPIO_CFG(GPIO_GRFC_15, 7, GPIO_CFG_OUTPUT,
  502. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_15" },
  503. { GPIO_CFG(GPIO_GRFC_16, 7, GPIO_CFG_OUTPUT,
  504. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_16" },
  505. { GPIO_CFG(GPIO_GRFC_17, 7, GPIO_CFG_OUTPUT,
  506. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_17" },
  507. { GPIO_CFG(GPIO_GRFC_18, 7, GPIO_CFG_OUTPUT,
  508. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_18" },
  509. { GPIO_CFG(GPIO_GRFC_24, 7, GPIO_CFG_OUTPUT,
  510. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_24" },
  511. { GPIO_CFG(GPIO_GRFC_25, 7, GPIO_CFG_OUTPUT,
  512. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_25" },
  513. { GPIO_CFG(GPIO_GRFC_26, 7, GPIO_CFG_OUTPUT,
  514. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_26" },
  515. { GPIO_CFG(GPIO_GRFC_27, 7, GPIO_CFG_OUTPUT,
  516. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_27" },
  517. { GPIO_CFG(GPIO_GRFC_28, 7, GPIO_CFG_OUTPUT,
  518. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_28" },
  519. { GPIO_CFG(GPIO_GRFC_29, 7, GPIO_CFG_OUTPUT,
  520. GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA), "GPIO_GRFC_29" },
  521. { GPIO_CFG(39, 1, GPIO_CFG_OUTPUT,
  522. GPIO_CFG_NO_PULL, GPIO_CFG_2MA), "PP2S_EXT_SYNC" },
  523. };
  524. static int __init grfc_init(void)
  525. {
  526. msm_gpios_request_enable(grfc_config_data,
  527. ARRAY_SIZE(grfc_config_data));
  528. return 0;
  529. }
  530. /*
  531. * UART
  532. */
  533. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  534. static struct msm_gpio uart1_config_data[] = {
  535. { GPIO_CFG(138, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
  536. "UART1_Rx" },
  537. { GPIO_CFG(139, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
  538. "UART1_Tx" },
  539. };
  540. static void fsm9xxx_init_uart1(void)
  541. {
  542. msm_gpios_request_enable(uart1_config_data,
  543. ARRAY_SIZE(uart1_config_data));
  544. }
  545. #endif
  546. static struct msm_gpio uart3_uim_config_data[] = {
  547. { GPIO_CFG(GPIO_UIM_RESET, 0, GPIO_CFG_OUTPUT,
  548. GPIO_CFG_PULL_UP, GPIO_CFG_2MA), "UIM_Reset" },
  549. { GPIO_CFG(GPIO_UIM_DATA_IO, 2, GPIO_CFG_OUTPUT,
  550. GPIO_CFG_PULL_UP, GPIO_CFG_2MA), "UIM_Data" },
  551. { GPIO_CFG(GPIO_UIM_CLOCK, 2, GPIO_CFG_OUTPUT,
  552. GPIO_CFG_PULL_UP, GPIO_CFG_2MA), "UIM_Clock" },
  553. };
  554. static void fsm9xxx_init_uart3_uim(void)
  555. {
  556. struct pm_gpio pmic_uim_gpio_in = {
  557. .direction = PM_GPIO_DIR_IN,
  558. .pull = PM_GPIO_PULL_NO,
  559. .out_strength = PM_GPIO_STRENGTH_HIGH,
  560. .function = PM_GPIO_FUNC_PAIRED,
  561. .vin_sel = PM8058_GPIO_VIN_L3,
  562. };
  563. struct pm_gpio pmic_uim_gpio_out = {
  564. .direction = PM_GPIO_DIR_OUT,
  565. .pull = PM_GPIO_PULL_NO,
  566. .out_strength = PM_GPIO_STRENGTH_HIGH,
  567. .function = PM_GPIO_FUNC_PAIRED,
  568. .vin_sel = PM8058_GPIO_VIN_L3,
  569. };
  570. /* TLMM */
  571. msm_gpios_request_enable(uart3_uim_config_data,
  572. ARRAY_SIZE(uart3_uim_config_data));
  573. /* Put UIM to reset state */
  574. gpio_direction_output(GPIO_UIM_RESET, 0);
  575. gpio_set_value(GPIO_UIM_RESET, 0);
  576. gpio_export(GPIO_UIM_RESET, false);
  577. /* PMIC */
  578. pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(GPIO_PM_UIM_M_RST),
  579. &pmic_uim_gpio_in);
  580. pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(GPIO_PM_UIM_RST),
  581. &pmic_uim_gpio_out);
  582. pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(GPIO_PM_UIM_M_CLK),
  583. &pmic_uim_gpio_in);
  584. pm8xxx_gpio_config(PM8058_GPIO_PM_TO_SYS(GPIO_PM_UIM_CLK),
  585. &pmic_uim_gpio_out);
  586. }
  587. /*
  588. * SSBI
  589. */
  590. #ifdef CONFIG_I2C_SSBI
  591. static struct msm_i2c_ssbi_platform_data msm_i2c_ssbi2_pdata = {
  592. .controller_type = FSM_SBI_CTRL_SSBI,
  593. };
  594. static struct msm_i2c_ssbi_platform_data msm_i2c_ssbi3_pdata = {
  595. .controller_type = FSM_SBI_CTRL_SSBI,
  596. };
  597. #endif
  598. #if defined(CONFIG_I2C_SSBI) || defined(CONFIG_MSM_SSBI)
  599. /* Intialize GPIO configuration for SSBI */
  600. static struct msm_gpio ssbi_gpio_config_data[] = {
  601. { GPIO_CFG(140, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA),
  602. "SSBI_1" },
  603. { GPIO_CFG(141, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA),
  604. "SSBI_2" },
  605. { GPIO_CFG(92, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA),
  606. "SSBI_3" },
  607. };
  608. static void
  609. fsm9xxx_init_ssbi_gpio(void)
  610. {
  611. msm_gpios_request_enable(ssbi_gpio_config_data,
  612. ARRAY_SIZE(ssbi_gpio_config_data));
  613. }
  614. #endif
  615. /*
  616. * User GPIOs
  617. */
  618. static void user_gpios_init(void)
  619. {
  620. unsigned int gpio;
  621. for (gpio = GPIO_USER_FIRST; gpio <= GPIO_USER_LAST; ++gpio)
  622. gpio_tlmm_config(GPIO_CFG(gpio, 0, GPIO_CFG_INPUT,
  623. GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
  624. }
  625. /*
  626. * Crypto
  627. */
  628. #define QCE_SIZE 0x10000
  629. #define QCE_0_BASE 0x80C00000
  630. #define QCE_1_BASE 0x80E00000
  631. #define QCE_2_BASE 0x81000000
  632. #define QCE_NO_HW_KEY_SUPPORT 0 /* No shared HW key with external */
  633. #define QCE_NO_SHARE_CE_RESOURCE 0 /* No CE resource shared with TZ */
  634. #define QCE_NO_CE_SHARED 0 /* CE not shared with TZ */
  635. #define QCE_NO_SHA_HMAC_SUPPORT 0 /* No SHA-HMAC by SHA operation */
  636. static struct resource qcrypto_resources[] = {
  637. [0] = {
  638. .start = QCE_0_BASE,
  639. .end = QCE_0_BASE + QCE_SIZE - 1,
  640. .flags = IORESOURCE_MEM,
  641. },
  642. [1] = {
  643. .name = "crypto_channels",
  644. .start = DMOV_CE1_IN_CHAN,
  645. .end = DMOV_CE1_OUT_CHAN,
  646. .flags = IORESOURCE_DMA,
  647. },
  648. [2] = {
  649. .name = "crypto_crci_in",
  650. .start = DMOV_CE1_IN_CRCI,
  651. .end = DMOV_CE1_IN_CRCI,
  652. .flags = IORESOURCE_DMA,
  653. },
  654. [3] = {
  655. .name = "crypto_crci_out",
  656. .start = DMOV_CE1_OUT_CRCI,
  657. .end = DMOV_CE1_OUT_CRCI,
  658. .flags = IORESOURCE_DMA,
  659. },
  660. [4] = {
  661. .name = "crypto_crci_hash",
  662. .start = DMOV_CE1_HASH_CRCI,
  663. .end = DMOV_CE1_HASH_CRCI,
  664. .flags = IORESOURCE_DMA,
  665. },
  666. };
  667. static struct msm_ce_hw_support qcrypto_ce_hw_suppport = {
  668. .ce_shared = QCE_NO_CE_SHARED,
  669. .shared_ce_resource = QCE_NO_SHARE_CE_RESOURCE,
  670. .hw_key_support = QCE_NO_HW_KEY_SUPPORT,
  671. .sha_hmac = QCE_NO_SHA_HMAC_SUPPORT,
  672. .bus_scale_table = NULL,
  673. };
  674. struct platform_device qcrypto_device = {
  675. .name = "qcrypto",
  676. .id = 0,
  677. .num_resources = ARRAY_SIZE(qcrypto_resources),
  678. .resource = qcrypto_resources,
  679. .dev = {
  680. .coherent_dma_mask = DMA_BIT_MASK(32),
  681. .platform_data = &qcrypto_ce_hw_suppport,
  682. },
  683. };
  684. static struct resource qcedev_resources[] = {
  685. [0] = {
  686. .start = QCE_0_BASE,
  687. .end = QCE_0_BASE + QCE_SIZE - 1,
  688. .flags = IORESOURCE_MEM,
  689. },
  690. [1] = {
  691. .name = "crypto_channels",
  692. .start = DMOV_CE1_IN_CHAN,
  693. .end = DMOV_CE1_OUT_CHAN,
  694. .flags = IORESOURCE_DMA,
  695. },
  696. [2] = {
  697. .name = "crypto_crci_in",
  698. .start = DMOV_CE1_IN_CRCI,
  699. .end = DMOV_CE1_IN_CRCI,
  700. .flags = IORESOURCE_DMA,
  701. },
  702. [3] = {
  703. .name = "crypto_crci_out",
  704. .start = DMOV_CE1_OUT_CRCI,
  705. .end = DMOV_CE1_OUT_CRCI,
  706. .flags = IORESOURCE_DMA,
  707. },
  708. [4] = {
  709. .name = "crypto_crci_hash",
  710. .start = DMOV_CE1_HASH_CRCI,
  711. .end = DMOV_CE1_HASH_CRCI,
  712. .flags = IORESOURCE_DMA,
  713. },
  714. };
  715. static struct msm_ce_hw_support qcedev_ce_hw_suppport = {
  716. .ce_shared = QCE_NO_CE_SHARED,
  717. .shared_ce_resource = QCE_NO_SHARE_CE_RESOURCE,
  718. .hw_key_support = QCE_NO_HW_KEY_SUPPORT,
  719. .sha_hmac = QCE_NO_SHA_HMAC_SUPPORT,
  720. .bus_scale_table = NULL,
  721. };
  722. static struct platform_device qcedev_device = {
  723. .name = "qce",
  724. .id = 0,
  725. .num_resources = ARRAY_SIZE(qcedev_resources),
  726. .resource = qcedev_resources,
  727. .dev = {
  728. .coherent_dma_mask = DMA_BIT_MASK(32),
  729. .platform_data = &qcedev_ce_hw_suppport,
  730. },
  731. };
  732. static struct resource ota_qcrypto_resources[] = {
  733. [0] = {
  734. .start = QCE_1_BASE,
  735. .end = QCE_1_BASE + QCE_SIZE - 1,
  736. .flags = IORESOURCE_MEM,
  737. },
  738. [1] = {
  739. .name = "crypto_channels",
  740. .start = DMOV_CE2_IN_CHAN,
  741. .end = DMOV_CE2_OUT_CHAN,
  742. .flags = IORESOURCE_DMA,
  743. },
  744. [2] = {
  745. .name = "crypto_crci_in",
  746. .start = DMOV_CE2_IN_CRCI,
  747. .end = DMOV_CE2_IN_CRCI,
  748. .flags = IORESOURCE_DMA,
  749. },
  750. [3] = {
  751. .name = "crypto_crci_out",
  752. .start = DMOV_CE2_OUT_CRCI,
  753. .end = DMOV_CE2_OUT_CRCI,
  754. .flags = IORESOURCE_DMA,
  755. },
  756. [4] = {
  757. .name = "crypto_crci_hash",
  758. .start = DMOV_CE2_HASH_CRCI,
  759. .end = DMOV_CE2_HASH_CRCI,
  760. .flags = IORESOURCE_DMA,
  761. },
  762. };
  763. struct platform_device ota_qcrypto_device = {
  764. .name = "qcota",
  765. .id = 0,
  766. .num_resources = ARRAY_SIZE(ota_qcrypto_resources),
  767. .resource = ota_qcrypto_resources,
  768. .dev = {
  769. .coherent_dma_mask = DMA_BIT_MASK(32),
  770. },
  771. };
  772. static struct platform_device fsm9xxx_device_acpuclk = {
  773. .name = "acpuclk-9xxx",
  774. .id = -1,
  775. };
  776. /*
  777. * Devices
  778. */
  779. static struct platform_device *devices[] __initdata = {
  780. &fsm9xxx_device_acpuclk,
  781. &msm_device_smd,
  782. &msm_device_dmov,
  783. &msm_device_nand,
  784. #ifdef CONFIG_MSM_SSBI
  785. &msm_device_ssbi_pmic1,
  786. #endif
  787. #ifdef CONFIG_I2C_SSBI
  788. &msm_device_ssbi2,
  789. &msm_device_ssbi3,
  790. #endif
  791. #ifdef CONFIG_SENSORS_MSM_ADC
  792. &msm_adc_device,
  793. #endif
  794. #ifdef CONFIG_I2C_QUP
  795. &msm_gsbi1_qup_i2c_device,
  796. #endif
  797. #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
  798. &msm_device_uart1,
  799. #endif
  800. &msm_device_uart3,
  801. #if defined(CONFIG_QFP_FUSE)
  802. &fsm_qfp_fuse_device,
  803. #endif
  804. &qfec_device,
  805. &qcrypto_device,
  806. &qcedev_device,
  807. &ota_qcrypto_device,
  808. &fsm_xo_device,
  809. &fsm9xxx_device_watchdog,
  810. };
  811. static void __init fsm9xxx_init_irq(void)
  812. {
  813. msm_init_irq();
  814. msm_init_sirc();
  815. }
  816. #ifdef CONFIG_MSM_SPM
  817. static struct msm_spm_platform_data msm_spm_data __initdata = {
  818. .reg_base_addr = MSM_SAW_BASE,
  819. .reg_init_values[MSM_SPM_REG_SAW_CFG] = 0x05,
  820. .reg_init_values[MSM_SPM_REG_SAW_SPM_CTL] = 0x18,
  821. .reg_init_values[MSM_SPM_REG_SAW_SPM_SLP_TMR_DLY] = 0x00006666,
  822. .reg_init_values[MSM_SPM_REG_SAW_SPM_WAKE_TMR_DLY] = 0xFF000666,
  823. .reg_init_values[MSM_SPM_REG_SAW_SPM_PMIC_CTL] = 0xE0F272,
  824. .reg_init_values[MSM_SPM_REG_SAW_SLP_CLK_EN] = 0x01,
  825. .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_PRECLMP_EN] = 0x03,
  826. .reg_init_values[MSM_SPM_REG_SAW_SLP_HSFS_POSTCLMP_EN] = 0x00,
  827. .reg_init_values[MSM_SPM_REG_SAW_SLP_CLMP_EN] = 0x01,
  828. .reg_init_values[MSM_SPM_REG_SAW_SLP_RST_EN] = 0x00,
  829. .reg_init_values[MSM_SPM_REG_SAW_SPM_MPM_CFG] = 0x00,
  830. .awake_vlevel = 0xF2,
  831. .retention_vlevel = 0xE0,
  832. .collapse_vlevel = 0x72,
  833. .retention_mid_vlevel = 0xE0,
  834. .collapse_mid_vlevel = 0xE0,
  835. };
  836. #endif
  837. static void __init fsm9xxx_init(void)
  838. {
  839. regulator_has_full_constraints();
  840. #if defined(CONFIG_I2C_SSBI) || defined(CONFIG_MSM_SSBI)
  841. fsm9xxx_init_ssbi_gpio();
  842. #endif
  843. #ifdef CONFIG_MSM_SSBI
  844. msm_device_ssbi_pmic1.dev.platform_data =
  845. &fsm9xxx_ssbi_pm8058_pdata;
  846. #endif
  847. buses_init();
  848. platform_add_devices(devices, ARRAY_SIZE(devices));
  849. #ifdef CONFIG_MSM_SPM
  850. msm_spm_init(&msm_spm_data, 1);
  851. #endif
  852. pm8058_gpios_init();
  853. pm8058_mpps_init();
  854. phy_init();
  855. grfc_init();
  856. user_gpios_init();
  857. #ifdef CONFIG_SERIAL_MSM_CONSOLE
  858. fsm9xxx_init_uart1();
  859. #endif
  860. fsm9xxx_init_uart3_uim();
  861. #ifdef CONFIG_I2C_SSBI
  862. msm_device_ssbi2.dev.platform_data = &msm_i2c_ssbi2_pdata;
  863. msm_device_ssbi3.dev.platform_data = &msm_i2c_ssbi3_pdata;
  864. #endif
  865. }
  866. static void __init fsm9xxx_map_io(void)
  867. {
  868. msm_shared_ram_phys = 0x00100000;
  869. msm_map_fsm9xxx_io();
  870. msm_clock_init(&fsm9xxx_clock_init_data);
  871. if (socinfo_init() < 0)
  872. pr_err("%s: socinfo_init() failed!\n",
  873. __func__);
  874. }
  875. MACHINE_START(FSM9XXX_SURF, "QCT FSM9XXX")
  876. .atag_offset = 0x100,
  877. .map_io = fsm9xxx_map_io,
  878. .init_irq = fsm9xxx_init_irq,
  879. .handle_irq = vic_handle_irq,
  880. .init_machine = fsm9xxx_init,
  881. .timer = &msm_timer,
  882. .restart = fsm_restart,
  883. MACHINE_END