board-mop500.c 19 KB

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