board-mop500.c 20 KB

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