board-mop500.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. /*
  2. * Copyright (C) 2008-2012 ST-Ericsson
  3. *
  4. * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2, as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/clk.h>
  16. #include <linux/io.h>
  17. #include <linux/i2c.h>
  18. #include <linux/platform_data/i2c-nomadik.h>
  19. #include <linux/platform_data/db8500_thermal.h>
  20. #include <linux/gpio.h>
  21. #include <linux/amba/bus.h>
  22. #include <linux/amba/pl022.h>
  23. #include <linux/amba/serial.h>
  24. #include <linux/spi/spi.h>
  25. #include <linux/mfd/abx500/ab8500.h>
  26. #include <linux/regulator/ab8500.h>
  27. #include <linux/regulator/fixed.h>
  28. #include <linux/regulator/driver.h>
  29. #include <linux/regulator/gpio-regulator.h>
  30. #include <linux/mfd/tc3589x.h>
  31. #include <linux/mfd/tps6105x.h>
  32. #include <linux/mfd/abx500/ab8500-gpio.h>
  33. #include <linux/mfd/abx500/ab8500-codec.h>
  34. #include <linux/platform_data/leds-lp55xx.h>
  35. #include <linux/input.h>
  36. #include <linux/smsc911x.h>
  37. #include <linux/gpio_keys.h>
  38. #include <linux/delay.h>
  39. #include <linux/leds.h>
  40. #include <linux/pinctrl/consumer.h>
  41. #include <linux/platform_data/pinctrl-nomadik.h>
  42. #include <linux/platform_data/dma-ste-dma40.h>
  43. #include <asm/mach-types.h>
  44. #include "setup.h"
  45. #include "devices.h"
  46. #include "irqs.h"
  47. #include <linux/platform_data/crypto-ux500.h>
  48. #include "ste-dma40-db8500.h"
  49. #include "db8500-regs.h"
  50. #include "devices-db8500.h"
  51. #include "board-mop500.h"
  52. #include "board-mop500-regulators.h"
  53. static struct gpio_led snowball_led_array[] = {
  54. {
  55. .name = "user_led",
  56. .default_trigger = "heartbeat",
  57. .gpio = 142,
  58. },
  59. };
  60. static struct gpio_led_platform_data snowball_led_data = {
  61. .leds = snowball_led_array,
  62. .num_leds = ARRAY_SIZE(snowball_led_array),
  63. };
  64. static struct platform_device snowball_led_dev = {
  65. .name = "leds-gpio",
  66. .dev = {
  67. .platform_data = &snowball_led_data,
  68. },
  69. };
  70. static struct fixed_voltage_config snowball_gpio_en_3v3_data = {
  71. .supply_name = "EN-3V3",
  72. .gpio = SNOWBALL_EN_3V3_ETH_GPIO,
  73. .microvolts = 3300000,
  74. .enable_high = 1,
  75. .init_data = &gpio_en_3v3_regulator,
  76. .startup_delay = 5000, /* 1200us */
  77. };
  78. static struct platform_device snowball_gpio_en_3v3_regulator_dev = {
  79. .name = "reg-fixed-voltage",
  80. .id = 1,
  81. .dev = {
  82. .platform_data = &snowball_gpio_en_3v3_data,
  83. },
  84. };
  85. /* Dynamically populated. */
  86. static struct gpio sdi0_reg_gpios[] = {
  87. { 0, GPIOF_OUT_INIT_LOW, "mmci_vsel" },
  88. };
  89. static struct gpio_regulator_state sdi0_reg_states[] = {
  90. { .value = 2900000, .gpios = (0 << 0) },
  91. { .value = 1800000, .gpios = (1 << 0) },
  92. };
  93. static struct gpio_regulator_config sdi0_reg_info = {
  94. .supply_name = "ext-mmc-level-shifter",
  95. .gpios = sdi0_reg_gpios,
  96. .nr_gpios = ARRAY_SIZE(sdi0_reg_gpios),
  97. .states = sdi0_reg_states,
  98. .nr_states = ARRAY_SIZE(sdi0_reg_states),
  99. .type = REGULATOR_VOLTAGE,
  100. .enable_high = 1,
  101. .enabled_at_boot = 0,
  102. .init_data = &sdi0_reg_init_data,
  103. .startup_delay = 100,
  104. };
  105. static struct platform_device sdi0_regulator = {
  106. .name = "gpio-regulator",
  107. .id = -1,
  108. .dev = {
  109. .platform_data = &sdi0_reg_info,
  110. },
  111. };
  112. static struct abx500_gpio_platform_data ab8500_gpio_pdata = {
  113. .gpio_base = MOP500_AB8500_PIN_GPIO(1),
  114. };
  115. /* ab8500-codec */
  116. static struct ab8500_codec_platform_data ab8500_codec_pdata = {
  117. .amics = {
  118. .mic1_type = AMIC_TYPE_DIFFERENTIAL,
  119. .mic2_type = AMIC_TYPE_DIFFERENTIAL,
  120. .mic1a_micbias = AMIC_MICBIAS_VAMIC1,
  121. .mic1b_micbias = AMIC_MICBIAS_VAMIC1,
  122. .mic2_micbias = AMIC_MICBIAS_VAMIC2
  123. },
  124. .ear_cmv = EAR_CMV_0_95V
  125. };
  126. static struct gpio_keys_button snowball_key_array[] = {
  127. {
  128. .gpio = 32,
  129. .type = EV_KEY,
  130. .code = KEY_1,
  131. .desc = "userpb",
  132. .active_low = 1,
  133. .debounce_interval = 50,
  134. .wakeup = 1,
  135. },
  136. {
  137. .gpio = 151,
  138. .type = EV_KEY,
  139. .code = KEY_2,
  140. .desc = "extkb1",
  141. .active_low = 1,
  142. .debounce_interval = 50,
  143. .wakeup = 1,
  144. },
  145. {
  146. .gpio = 152,
  147. .type = EV_KEY,
  148. .code = KEY_3,
  149. .desc = "extkb2",
  150. .active_low = 1,
  151. .debounce_interval = 50,
  152. .wakeup = 1,
  153. },
  154. {
  155. .gpio = 161,
  156. .type = EV_KEY,
  157. .code = KEY_4,
  158. .desc = "extkb3",
  159. .active_low = 1,
  160. .debounce_interval = 50,
  161. .wakeup = 1,
  162. },
  163. {
  164. .gpio = 162,
  165. .type = EV_KEY,
  166. .code = KEY_5,
  167. .desc = "extkb4",
  168. .active_low = 1,
  169. .debounce_interval = 50,
  170. .wakeup = 1,
  171. },
  172. };
  173. static struct gpio_keys_platform_data snowball_key_data = {
  174. .buttons = snowball_key_array,
  175. .nbuttons = ARRAY_SIZE(snowball_key_array),
  176. };
  177. static struct platform_device snowball_key_dev = {
  178. .name = "gpio-keys",
  179. .id = -1,
  180. .dev = {
  181. .platform_data = &snowball_key_data,
  182. }
  183. };
  184. static struct smsc911x_platform_config snowball_sbnet_cfg = {
  185. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
  186. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  187. .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
  188. .shift = 1,
  189. };
  190. static struct resource sbnet_res[] = {
  191. {
  192. .name = "smsc911x-memory",
  193. .start = (0x5000 << 16),
  194. .end = (0x5000 << 16) + 0xffff,
  195. .flags = IORESOURCE_MEM,
  196. },
  197. {
  198. .start = NOMADIK_GPIO_TO_IRQ(140),
  199. .end = NOMADIK_GPIO_TO_IRQ(140),
  200. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  201. },
  202. };
  203. static struct platform_device snowball_sbnet_dev = {
  204. .name = "smsc911x",
  205. .num_resources = ARRAY_SIZE(sbnet_res),
  206. .resource = sbnet_res,
  207. .dev = {
  208. .platform_data = &snowball_sbnet_cfg,
  209. },
  210. };
  211. struct ab8500_platform_data ab8500_platdata = {
  212. .irq_base = MOP500_AB8500_IRQ_BASE,
  213. .regulator = &ab8500_regulator_plat_data,
  214. .gpio = &ab8500_gpio_pdata,
  215. .codec = &ab8500_codec_pdata,
  216. };
  217. static struct platform_device u8500_cpufreq_cooling_device = {
  218. .name = "db8500-cpufreq-cooling",
  219. };
  220. /*
  221. * TPS61052
  222. */
  223. static struct tps6105x_platform_data mop500_tps61052_data = {
  224. .mode = TPS6105X_MODE_VOLTAGE,
  225. .regulator_data = &tps61052_regulator,
  226. };
  227. /*
  228. * TC35892
  229. */
  230. static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
  231. {
  232. struct device *parent = NULL;
  233. #if 0
  234. /* FIXME: Is the sdi actually part of tc3589x? */
  235. parent = tc3589x->dev;
  236. #endif
  237. mop500_sdi_tc35892_init(parent);
  238. }
  239. static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
  240. .gpio_base = MOP500_EGPIO(0),
  241. .setup = mop500_tc35892_init,
  242. };
  243. static struct tc3589x_platform_data mop500_tc35892_data = {
  244. .block = TC3589x_BLOCK_GPIO,
  245. .gpio = &mop500_tc35892_gpio_data,
  246. .irq_base = MOP500_EGPIO_IRQ_BASE,
  247. };
  248. static struct lp55xx_led_config lp5521_pri_led[] = {
  249. [0] = {
  250. .chan_nr = 0,
  251. .led_current = 0x2f,
  252. .max_current = 0x5f,
  253. },
  254. [1] = {
  255. .chan_nr = 1,
  256. .led_current = 0x2f,
  257. .max_current = 0x5f,
  258. },
  259. [2] = {
  260. .chan_nr = 2,
  261. .led_current = 0x2f,
  262. .max_current = 0x5f,
  263. },
  264. };
  265. static struct lp55xx_platform_data __initdata lp5521_pri_data = {
  266. .label = "lp5521_pri",
  267. .led_config = &lp5521_pri_led[0],
  268. .num_channels = 3,
  269. .clock_mode = LP55XX_CLOCK_EXT,
  270. };
  271. static struct lp55xx_led_config lp5521_sec_led[] = {
  272. [0] = {
  273. .chan_nr = 0,
  274. .led_current = 0x2f,
  275. .max_current = 0x5f,
  276. },
  277. [1] = {
  278. .chan_nr = 1,
  279. .led_current = 0x2f,
  280. .max_current = 0x5f,
  281. },
  282. [2] = {
  283. .chan_nr = 2,
  284. .led_current = 0x2f,
  285. .max_current = 0x5f,
  286. },
  287. };
  288. static struct lp55xx_platform_data __initdata lp5521_sec_data = {
  289. .label = "lp5521_sec",
  290. .led_config = &lp5521_sec_led[0],
  291. .num_channels = 3,
  292. .clock_mode = LP55XX_CLOCK_EXT,
  293. };
  294. /* I2C0 devices only available on the first HREF/MOP500 */
  295. static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
  296. {
  297. I2C_BOARD_INFO("tc3589x", 0x42),
  298. .irq = NOMADIK_GPIO_TO_IRQ(217),
  299. .platform_data = &mop500_tc35892_data,
  300. },
  301. {
  302. I2C_BOARD_INFO("tps61052", 0x33),
  303. .platform_data = &mop500_tps61052_data,
  304. },
  305. };
  306. static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
  307. {
  308. /* lp5521 LED driver, 1st device */
  309. I2C_BOARD_INFO("lp5521", 0x33),
  310. .platform_data = &lp5521_pri_data,
  311. },
  312. {
  313. /* lp5521 LED driver, 2st device */
  314. I2C_BOARD_INFO("lp5521", 0x34),
  315. .platform_data = &lp5521_sec_data,
  316. },
  317. {
  318. /* Light sensor Rohm BH1780GLI */
  319. I2C_BOARD_INFO("bh1780", 0x29),
  320. },
  321. };
  322. static int __init mop500_i2c_board_init(void)
  323. {
  324. if (machine_is_u8500())
  325. mop500_uib_i2c_add(0, mop500_i2c0_devices,
  326. ARRAY_SIZE(mop500_i2c0_devices));
  327. mop500_uib_i2c_add(2, mop500_i2c2_devices,
  328. ARRAY_SIZE(mop500_i2c2_devices));
  329. return 0;
  330. }
  331. device_initcall(mop500_i2c_board_init);
  332. static void __init mop500_i2c_init(struct device *parent)
  333. {
  334. db8500_add_i2c0(parent, NULL);
  335. db8500_add_i2c1(parent, NULL);
  336. db8500_add_i2c2(parent, NULL);
  337. db8500_add_i2c3(parent, NULL);
  338. }
  339. static struct gpio_keys_button mop500_gpio_keys[] = {
  340. {
  341. .desc = "SFH7741 Proximity Sensor",
  342. .type = EV_SW,
  343. .code = SW_FRONT_PROXIMITY,
  344. .active_low = 0,
  345. .can_disable = 1,
  346. }
  347. };
  348. static struct regulator *prox_regulator;
  349. static int mop500_prox_activate(struct device *dev);
  350. static void mop500_prox_deactivate(struct device *dev);
  351. static struct gpio_keys_platform_data mop500_gpio_keys_data = {
  352. .buttons = mop500_gpio_keys,
  353. .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
  354. .enable = mop500_prox_activate,
  355. .disable = mop500_prox_deactivate,
  356. };
  357. static struct platform_device mop500_gpio_keys_device = {
  358. .name = "gpio-keys",
  359. .id = 0,
  360. .dev = {
  361. .platform_data = &mop500_gpio_keys_data,
  362. },
  363. };
  364. static int mop500_prox_activate(struct device *dev)
  365. {
  366. prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
  367. "vcc");
  368. if (IS_ERR(prox_regulator)) {
  369. dev_err(&mop500_gpio_keys_device.dev,
  370. "no regulator\n");
  371. return PTR_ERR(prox_regulator);
  372. }
  373. return regulator_enable(prox_regulator);
  374. }
  375. static void mop500_prox_deactivate(struct device *dev)
  376. {
  377. regulator_disable(prox_regulator);
  378. regulator_put(prox_regulator);
  379. }
  380. static struct cryp_platform_data u8500_cryp1_platform_data = {
  381. .mem_to_engine = {
  382. .dir = DMA_MEM_TO_DEV,
  383. .dev_type = DB8500_DMA_DEV48_CAC1,
  384. .mode = STEDMA40_MODE_LOGICAL,
  385. },
  386. .engine_to_mem = {
  387. .dir = DMA_DEV_TO_MEM,
  388. .dev_type = DB8500_DMA_DEV48_CAC1,
  389. .mode = STEDMA40_MODE_LOGICAL,
  390. }
  391. };
  392. static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
  393. .dir = DMA_MEM_TO_DEV,
  394. .dev_type = DB8500_DMA_DEV50_HAC1_TX,
  395. .mode = STEDMA40_MODE_LOGICAL,
  396. };
  397. static struct hash_platform_data u8500_hash1_platform_data = {
  398. .mem_to_engine = &u8500_hash_dma_cfg_tx,
  399. .dma_filter = stedma40_filter,
  400. };
  401. /* add any platform devices here - TODO */
  402. static struct platform_device *mop500_platform_devs[] __initdata = {
  403. &mop500_gpio_keys_device,
  404. &sdi0_regulator,
  405. };
  406. #ifdef CONFIG_STE_DMA40
  407. static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
  408. .mode = STEDMA40_MODE_LOGICAL,
  409. .dir = DMA_DEV_TO_MEM,
  410. .dev_type = DB8500_DMA_DEV8_SSP0,
  411. };
  412. static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
  413. .mode = STEDMA40_MODE_LOGICAL,
  414. .dir = DMA_MEM_TO_DEV,
  415. .dev_type = DB8500_DMA_DEV8_SSP0,
  416. };
  417. #endif
  418. struct pl022_ssp_controller ssp0_plat = {
  419. .bus_id = 0,
  420. #ifdef CONFIG_STE_DMA40
  421. .enable_dma = 1,
  422. .dma_filter = stedma40_filter,
  423. .dma_rx_param = &ssp0_dma_cfg_rx,
  424. .dma_tx_param = &ssp0_dma_cfg_tx,
  425. #else
  426. .enable_dma = 0,
  427. #endif
  428. /* on this platform, gpio 31,142,144,214 &
  429. * 224 are connected as chip selects
  430. */
  431. .num_chipselect = 5,
  432. };
  433. static void __init mop500_spi_init(struct device *parent)
  434. {
  435. db8500_add_ssp0(parent, &ssp0_plat);
  436. }
  437. #ifdef CONFIG_STE_DMA40
  438. static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
  439. .mode = STEDMA40_MODE_LOGICAL,
  440. .dir = DMA_DEV_TO_MEM,
  441. .dev_type = DB8500_DMA_DEV13_UART0,
  442. };
  443. static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
  444. .mode = STEDMA40_MODE_LOGICAL,
  445. .dir = DMA_MEM_TO_DEV,
  446. .dev_type = DB8500_DMA_DEV13_UART0,
  447. };
  448. static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
  449. .mode = STEDMA40_MODE_LOGICAL,
  450. .dir = DMA_DEV_TO_MEM,
  451. .dev_type = DB8500_DMA_DEV12_UART1,
  452. };
  453. static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
  454. .mode = STEDMA40_MODE_LOGICAL,
  455. .dir = DMA_MEM_TO_DEV,
  456. .dev_type = DB8500_DMA_DEV12_UART1,
  457. };
  458. static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
  459. .mode = STEDMA40_MODE_LOGICAL,
  460. .dir = DMA_DEV_TO_MEM,
  461. .dev_type = DB8500_DMA_DEV11_UART2,
  462. };
  463. static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
  464. .mode = STEDMA40_MODE_LOGICAL,
  465. .dir = DMA_MEM_TO_DEV,
  466. .dev_type = DB8500_DMA_DEV11_UART2,
  467. };
  468. #endif
  469. struct amba_pl011_data uart0_plat = {
  470. #ifdef CONFIG_STE_DMA40
  471. .dma_filter = stedma40_filter,
  472. .dma_rx_param = &uart0_dma_cfg_rx,
  473. .dma_tx_param = &uart0_dma_cfg_tx,
  474. #endif
  475. };
  476. struct amba_pl011_data uart1_plat = {
  477. #ifdef CONFIG_STE_DMA40
  478. .dma_filter = stedma40_filter,
  479. .dma_rx_param = &uart1_dma_cfg_rx,
  480. .dma_tx_param = &uart1_dma_cfg_tx,
  481. #endif
  482. };
  483. struct amba_pl011_data uart2_plat = {
  484. #ifdef CONFIG_STE_DMA40
  485. .dma_filter = stedma40_filter,
  486. .dma_rx_param = &uart2_dma_cfg_rx,
  487. .dma_tx_param = &uart2_dma_cfg_tx,
  488. #endif
  489. };
  490. static void __init mop500_uart_init(struct device *parent)
  491. {
  492. db8500_add_uart0(parent, &uart0_plat);
  493. db8500_add_uart1(parent, &uart1_plat);
  494. db8500_add_uart2(parent, &uart2_plat);
  495. }
  496. static void __init u8500_cryp1_hash1_init(struct device *parent)
  497. {
  498. db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
  499. db8500_add_hash1(parent, &u8500_hash1_platform_data);
  500. }
  501. static struct platform_device *snowball_platform_devs[] __initdata = {
  502. &snowball_led_dev,
  503. &snowball_key_dev,
  504. &snowball_sbnet_dev,
  505. &snowball_gpio_en_3v3_regulator_dev,
  506. &u8500_cpufreq_cooling_device,
  507. &sdi0_regulator,
  508. };
  509. static void __init mop500_init_machine(void)
  510. {
  511. struct device *parent = NULL;
  512. int i;
  513. platform_device_register(&db8500_prcmu_device);
  514. mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
  515. sdi0_reg_info.enable_gpio = GPIO_SDMMC_EN;
  516. sdi0_reg_info.gpios[0].gpio = GPIO_SDMMC_1V8_3V_SEL;
  517. mop500_pinmaps_init();
  518. parent = u8500_init_devices();
  519. for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
  520. mop500_platform_devs[i]->dev.parent = parent;
  521. platform_add_devices(mop500_platform_devs,
  522. ARRAY_SIZE(mop500_platform_devs));
  523. mop500_i2c_init(parent);
  524. mop500_sdi_init(parent);
  525. mop500_spi_init(parent);
  526. mop500_audio_init(parent);
  527. mop500_uart_init(parent);
  528. u8500_cryp1_hash1_init(parent);
  529. /* This board has full regulator constraints */
  530. regulator_has_full_constraints();
  531. }
  532. static void __init snowball_init_machine(void)
  533. {
  534. struct device *parent = NULL;
  535. int i;
  536. platform_device_register(&db8500_prcmu_device);
  537. sdi0_reg_info.enable_gpio = SNOWBALL_SDMMC_EN_GPIO;
  538. sdi0_reg_info.gpios[0].gpio = SNOWBALL_SDMMC_1V8_3V_GPIO;
  539. snowball_pinmaps_init();
  540. parent = u8500_init_devices();
  541. for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
  542. snowball_platform_devs[i]->dev.parent = parent;
  543. platform_add_devices(snowball_platform_devs,
  544. ARRAY_SIZE(snowball_platform_devs));
  545. mop500_i2c_init(parent);
  546. snowball_sdi_init(parent);
  547. mop500_spi_init(parent);
  548. mop500_audio_init(parent);
  549. mop500_uart_init(parent);
  550. u8500_cryp1_hash1_init(parent);
  551. /* This board has full regulator constraints */
  552. regulator_has_full_constraints();
  553. }
  554. static void __init hrefv60_init_machine(void)
  555. {
  556. struct device *parent = NULL;
  557. int i;
  558. platform_device_register(&db8500_prcmu_device);
  559. /*
  560. * The HREFv60 board removed a GPIO expander and routed
  561. * all these GPIO pins to the internal GPIO controller
  562. * instead.
  563. */
  564. mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
  565. sdi0_reg_info.enable_gpio = HREFV60_SDMMC_EN_GPIO;
  566. sdi0_reg_info.gpios[0].gpio = HREFV60_SDMMC_1V8_3V_GPIO;
  567. hrefv60_pinmaps_init();
  568. parent = u8500_init_devices();
  569. for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
  570. mop500_platform_devs[i]->dev.parent = parent;
  571. platform_add_devices(mop500_platform_devs,
  572. ARRAY_SIZE(mop500_platform_devs));
  573. mop500_i2c_init(parent);
  574. hrefv60_sdi_init(parent);
  575. mop500_spi_init(parent);
  576. mop500_audio_init(parent);
  577. mop500_uart_init(parent);
  578. /* This board has full regulator constraints */
  579. regulator_has_full_constraints();
  580. }
  581. MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
  582. /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
  583. .atag_offset = 0x100,
  584. .smp = smp_ops(ux500_smp_ops),
  585. .map_io = u8500_map_io,
  586. .init_irq = ux500_init_irq,
  587. /* we re-use nomadik timer here */
  588. .init_time = ux500_timer_init,
  589. .init_machine = mop500_init_machine,
  590. .init_late = ux500_init_late,
  591. .restart = ux500_restart,
  592. MACHINE_END
  593. MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
  594. .atag_offset = 0x100,
  595. .map_io = u8500_map_io,
  596. .init_irq = ux500_init_irq,
  597. .init_time = ux500_timer_init,
  598. .init_machine = mop500_init_machine,
  599. .init_late = ux500_init_late,
  600. .restart = ux500_restart,
  601. MACHINE_END
  602. MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
  603. .atag_offset = 0x100,
  604. .smp = smp_ops(ux500_smp_ops),
  605. .map_io = u8500_map_io,
  606. .init_irq = ux500_init_irq,
  607. .init_time = ux500_timer_init,
  608. .init_machine = hrefv60_init_machine,
  609. .init_late = ux500_init_late,
  610. .restart = ux500_restart,
  611. MACHINE_END
  612. MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
  613. .atag_offset = 0x100,
  614. .smp = smp_ops(ux500_smp_ops),
  615. .map_io = u8500_map_io,
  616. .init_irq = ux500_init_irq,
  617. /* we re-use nomadik timer here */
  618. .init_time = ux500_timer_init,
  619. .init_machine = snowball_init_machine,
  620. .init_late = NULL,
  621. .restart = ux500_restart,
  622. MACHINE_END