board-mop500.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771
  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_reg_init = ab8500_regulator_reg_init,
  185. .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
  186. .regulator = ab8500_regulators,
  187. .num_regulator = ARRAY_SIZE(ab8500_regulators),
  188. .gpio = &ab8500_gpio_pdata,
  189. .codec = &ab8500_codec_pdata,
  190. };
  191. /*
  192. * Thermal Sensor
  193. */
  194. static struct resource db8500_thsens_resources[] = {
  195. {
  196. .name = "IRQ_HOTMON_LOW",
  197. .start = IRQ_PRCMU_HOTMON_LOW,
  198. .end = IRQ_PRCMU_HOTMON_LOW,
  199. .flags = IORESOURCE_IRQ,
  200. },
  201. {
  202. .name = "IRQ_HOTMON_HIGH",
  203. .start = IRQ_PRCMU_HOTMON_HIGH,
  204. .end = IRQ_PRCMU_HOTMON_HIGH,
  205. .flags = IORESOURCE_IRQ,
  206. },
  207. };
  208. static struct db8500_thsens_platform_data db8500_thsens_data = {
  209. .trip_points[0] = {
  210. .temp = 70000,
  211. .type = THERMAL_TRIP_ACTIVE,
  212. .cdev_name = {
  213. [0] = "thermal-cpufreq-0",
  214. },
  215. },
  216. .trip_points[1] = {
  217. .temp = 75000,
  218. .type = THERMAL_TRIP_ACTIVE,
  219. .cdev_name = {
  220. [0] = "thermal-cpufreq-0",
  221. },
  222. },
  223. .trip_points[2] = {
  224. .temp = 80000,
  225. .type = THERMAL_TRIP_ACTIVE,
  226. .cdev_name = {
  227. [0] = "thermal-cpufreq-0",
  228. },
  229. },
  230. .trip_points[3] = {
  231. .temp = 85000,
  232. .type = THERMAL_TRIP_CRITICAL,
  233. },
  234. .num_trips = 4,
  235. };
  236. static struct platform_device u8500_thsens_device = {
  237. .name = "db8500-thermal",
  238. .resource = db8500_thsens_resources,
  239. .num_resources = ARRAY_SIZE(db8500_thsens_resources),
  240. .dev = {
  241. .platform_data = &db8500_thsens_data,
  242. },
  243. };
  244. static struct platform_device u8500_cpufreq_cooling_device = {
  245. .name = "db8500-cpufreq-cooling",
  246. };
  247. /*
  248. * TPS61052
  249. */
  250. static struct tps6105x_platform_data mop500_tps61052_data = {
  251. .mode = TPS6105X_MODE_VOLTAGE,
  252. .regulator_data = &tps61052_regulator,
  253. };
  254. /*
  255. * TC35892
  256. */
  257. static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
  258. {
  259. struct device *parent = NULL;
  260. #if 0
  261. /* FIXME: Is the sdi actually part of tc3589x? */
  262. parent = tc3589x->dev;
  263. #endif
  264. mop500_sdi_tc35892_init(parent);
  265. }
  266. static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
  267. .gpio_base = MOP500_EGPIO(0),
  268. .setup = mop500_tc35892_init,
  269. };
  270. static struct tc3589x_platform_data mop500_tc35892_data = {
  271. .block = TC3589x_BLOCK_GPIO,
  272. .gpio = &mop500_tc35892_gpio_data,
  273. .irq_base = MOP500_EGPIO_IRQ_BASE,
  274. };
  275. static struct lp55xx_led_config lp5521_pri_led[] = {
  276. [0] = {
  277. .chan_nr = 0,
  278. .led_current = 0x2f,
  279. .max_current = 0x5f,
  280. },
  281. [1] = {
  282. .chan_nr = 1,
  283. .led_current = 0x2f,
  284. .max_current = 0x5f,
  285. },
  286. [2] = {
  287. .chan_nr = 2,
  288. .led_current = 0x2f,
  289. .max_current = 0x5f,
  290. },
  291. };
  292. static struct lp55xx_platform_data __initdata lp5521_pri_data = {
  293. .label = "lp5521_pri",
  294. .led_config = &lp5521_pri_led[0],
  295. .num_channels = 3,
  296. .clock_mode = LP55XX_CLOCK_EXT,
  297. };
  298. static struct lp55xx_led_config lp5521_sec_led[] = {
  299. [0] = {
  300. .chan_nr = 0,
  301. .led_current = 0x2f,
  302. .max_current = 0x5f,
  303. },
  304. [1] = {
  305. .chan_nr = 1,
  306. .led_current = 0x2f,
  307. .max_current = 0x5f,
  308. },
  309. [2] = {
  310. .chan_nr = 2,
  311. .led_current = 0x2f,
  312. .max_current = 0x5f,
  313. },
  314. };
  315. static struct lp55xx_platform_data __initdata lp5521_sec_data = {
  316. .label = "lp5521_sec",
  317. .led_config = &lp5521_sec_led[0],
  318. .num_channels = 3,
  319. .clock_mode = LP55XX_CLOCK_EXT,
  320. };
  321. static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
  322. {
  323. I2C_BOARD_INFO("tc3589x", 0x42),
  324. .irq = NOMADIK_GPIO_TO_IRQ(217),
  325. .platform_data = &mop500_tc35892_data,
  326. },
  327. /* I2C0 devices only available prior to HREFv60 */
  328. {
  329. I2C_BOARD_INFO("tps61052", 0x33),
  330. .platform_data = &mop500_tps61052_data,
  331. },
  332. };
  333. #define NUM_PRE_V60_I2C0_DEVICES 1
  334. static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
  335. {
  336. /* lp5521 LED driver, 1st device */
  337. I2C_BOARD_INFO("lp5521", 0x33),
  338. .platform_data = &lp5521_pri_data,
  339. },
  340. {
  341. /* lp5521 LED driver, 2st device */
  342. I2C_BOARD_INFO("lp5521", 0x34),
  343. .platform_data = &lp5521_sec_data,
  344. },
  345. {
  346. /* Light sensor Rohm BH1780GLI */
  347. I2C_BOARD_INFO("bh1780", 0x29),
  348. },
  349. };
  350. static void __init mop500_i2c_init(struct device *parent)
  351. {
  352. db8500_add_i2c0(parent, NULL);
  353. db8500_add_i2c1(parent, NULL);
  354. db8500_add_i2c2(parent, NULL);
  355. db8500_add_i2c3(parent, NULL);
  356. }
  357. static struct gpio_keys_button mop500_gpio_keys[] = {
  358. {
  359. .desc = "SFH7741 Proximity Sensor",
  360. .type = EV_SW,
  361. .code = SW_FRONT_PROXIMITY,
  362. .active_low = 0,
  363. .can_disable = 1,
  364. }
  365. };
  366. static struct regulator *prox_regulator;
  367. static int mop500_prox_activate(struct device *dev);
  368. static void mop500_prox_deactivate(struct device *dev);
  369. static struct gpio_keys_platform_data mop500_gpio_keys_data = {
  370. .buttons = mop500_gpio_keys,
  371. .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
  372. .enable = mop500_prox_activate,
  373. .disable = mop500_prox_deactivate,
  374. };
  375. static struct platform_device mop500_gpio_keys_device = {
  376. .name = "gpio-keys",
  377. .id = 0,
  378. .dev = {
  379. .platform_data = &mop500_gpio_keys_data,
  380. },
  381. };
  382. static int mop500_prox_activate(struct device *dev)
  383. {
  384. prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
  385. "vcc");
  386. if (IS_ERR(prox_regulator)) {
  387. dev_err(&mop500_gpio_keys_device.dev,
  388. "no regulator\n");
  389. return PTR_ERR(prox_regulator);
  390. }
  391. regulator_enable(prox_regulator);
  392. return 0;
  393. }
  394. static void mop500_prox_deactivate(struct device *dev)
  395. {
  396. regulator_disable(prox_regulator);
  397. regulator_put(prox_regulator);
  398. }
  399. static struct cryp_platform_data u8500_cryp1_platform_data = {
  400. .mem_to_engine = {
  401. .dir = STEDMA40_MEM_TO_PERIPH,
  402. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  403. .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX,
  404. .src_info.data_width = STEDMA40_WORD_WIDTH,
  405. .dst_info.data_width = STEDMA40_WORD_WIDTH,
  406. .mode = STEDMA40_MODE_LOGICAL,
  407. .src_info.psize = STEDMA40_PSIZE_LOG_4,
  408. .dst_info.psize = STEDMA40_PSIZE_LOG_4,
  409. },
  410. .engine_to_mem = {
  411. .dir = STEDMA40_PERIPH_TO_MEM,
  412. .src_dev_type = DB8500_DMA_DEV48_CAC1_RX,
  413. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  414. .src_info.data_width = STEDMA40_WORD_WIDTH,
  415. .dst_info.data_width = STEDMA40_WORD_WIDTH,
  416. .mode = STEDMA40_MODE_LOGICAL,
  417. .src_info.psize = STEDMA40_PSIZE_LOG_4,
  418. .dst_info.psize = STEDMA40_PSIZE_LOG_4,
  419. }
  420. };
  421. static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = {
  422. .dir = STEDMA40_MEM_TO_PERIPH,
  423. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  424. .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX,
  425. .src_info.data_width = STEDMA40_WORD_WIDTH,
  426. .dst_info.data_width = STEDMA40_WORD_WIDTH,
  427. .mode = STEDMA40_MODE_LOGICAL,
  428. .src_info.psize = STEDMA40_PSIZE_LOG_16,
  429. .dst_info.psize = STEDMA40_PSIZE_LOG_16,
  430. };
  431. static struct hash_platform_data u8500_hash1_platform_data = {
  432. .mem_to_engine = &u8500_hash_dma_cfg_tx,
  433. .dma_filter = stedma40_filter,
  434. };
  435. /* add any platform devices here - TODO */
  436. static struct platform_device *mop500_platform_devs[] __initdata = {
  437. &mop500_gpio_keys_device,
  438. };
  439. #ifdef CONFIG_STE_DMA40
  440. static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
  441. .mode = STEDMA40_MODE_LOGICAL,
  442. .dir = STEDMA40_PERIPH_TO_MEM,
  443. .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
  444. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  445. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  446. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  447. };
  448. static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
  449. .mode = STEDMA40_MODE_LOGICAL,
  450. .dir = STEDMA40_MEM_TO_PERIPH,
  451. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  452. .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
  453. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  454. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  455. };
  456. #endif
  457. struct pl022_ssp_controller ssp0_plat = {
  458. .bus_id = 0,
  459. #ifdef CONFIG_STE_DMA40
  460. .enable_dma = 1,
  461. .dma_filter = stedma40_filter,
  462. .dma_rx_param = &ssp0_dma_cfg_rx,
  463. .dma_tx_param = &ssp0_dma_cfg_tx,
  464. #else
  465. .enable_dma = 0,
  466. #endif
  467. /* on this platform, gpio 31,142,144,214 &
  468. * 224 are connected as chip selects
  469. */
  470. .num_chipselect = 5,
  471. };
  472. static void __init mop500_spi_init(struct device *parent)
  473. {
  474. db8500_add_ssp0(parent, &ssp0_plat);
  475. }
  476. #ifdef CONFIG_STE_DMA40
  477. static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
  478. .mode = STEDMA40_MODE_LOGICAL,
  479. .dir = STEDMA40_PERIPH_TO_MEM,
  480. .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
  481. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  482. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  483. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  484. };
  485. static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
  486. .mode = STEDMA40_MODE_LOGICAL,
  487. .dir = STEDMA40_MEM_TO_PERIPH,
  488. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  489. .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
  490. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  491. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  492. };
  493. static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
  494. .mode = STEDMA40_MODE_LOGICAL,
  495. .dir = STEDMA40_PERIPH_TO_MEM,
  496. .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
  497. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  498. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  499. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  500. };
  501. static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
  502. .mode = STEDMA40_MODE_LOGICAL,
  503. .dir = STEDMA40_MEM_TO_PERIPH,
  504. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  505. .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
  506. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  507. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  508. };
  509. static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
  510. .mode = STEDMA40_MODE_LOGICAL,
  511. .dir = STEDMA40_PERIPH_TO_MEM,
  512. .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
  513. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  514. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  515. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  516. };
  517. static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
  518. .mode = STEDMA40_MODE_LOGICAL,
  519. .dir = STEDMA40_MEM_TO_PERIPH,
  520. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  521. .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
  522. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  523. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  524. };
  525. #endif
  526. struct amba_pl011_data uart0_plat = {
  527. #ifdef CONFIG_STE_DMA40
  528. .dma_filter = stedma40_filter,
  529. .dma_rx_param = &uart0_dma_cfg_rx,
  530. .dma_tx_param = &uart0_dma_cfg_tx,
  531. #endif
  532. };
  533. struct amba_pl011_data uart1_plat = {
  534. #ifdef CONFIG_STE_DMA40
  535. .dma_filter = stedma40_filter,
  536. .dma_rx_param = &uart1_dma_cfg_rx,
  537. .dma_tx_param = &uart1_dma_cfg_tx,
  538. #endif
  539. };
  540. struct amba_pl011_data uart2_plat = {
  541. #ifdef CONFIG_STE_DMA40
  542. .dma_filter = stedma40_filter,
  543. .dma_rx_param = &uart2_dma_cfg_rx,
  544. .dma_tx_param = &uart2_dma_cfg_tx,
  545. #endif
  546. };
  547. static void __init mop500_uart_init(struct device *parent)
  548. {
  549. db8500_add_uart0(parent, &uart0_plat);
  550. db8500_add_uart1(parent, &uart1_plat);
  551. db8500_add_uart2(parent, &uart2_plat);
  552. }
  553. static void __init u8500_cryp1_hash1_init(struct device *parent)
  554. {
  555. db8500_add_cryp1(parent, &u8500_cryp1_platform_data);
  556. db8500_add_hash1(parent, &u8500_hash1_platform_data);
  557. }
  558. static struct platform_device *snowball_platform_devs[] __initdata = {
  559. &snowball_led_dev,
  560. &snowball_key_dev,
  561. &snowball_sbnet_dev,
  562. &snowball_gpio_en_3v3_regulator_dev,
  563. &u8500_thsens_device,
  564. &u8500_cpufreq_cooling_device,
  565. };
  566. static void __init mop500_init_machine(void)
  567. {
  568. struct device *parent = NULL;
  569. int i2c0_devs;
  570. int i;
  571. platform_device_register(&db8500_prcmu_device);
  572. mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
  573. mop500_pinmaps_init();
  574. parent = u8500_init_devices(&ab8500_platdata);
  575. for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
  576. mop500_platform_devs[i]->dev.parent = parent;
  577. platform_add_devices(mop500_platform_devs,
  578. ARRAY_SIZE(mop500_platform_devs));
  579. mop500_i2c_init(parent);
  580. mop500_sdi_init(parent);
  581. mop500_spi_init(parent);
  582. mop500_audio_init(parent);
  583. mop500_uart_init(parent);
  584. u8500_cryp1_hash1_init(parent);
  585. i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  586. i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  587. i2c_register_board_info(2, mop500_i2c2_devices,
  588. ARRAY_SIZE(mop500_i2c2_devices));
  589. /* This board has full regulator constraints */
  590. regulator_has_full_constraints();
  591. }
  592. static void __init snowball_init_machine(void)
  593. {
  594. struct device *parent = NULL;
  595. int i;
  596. platform_device_register(&db8500_prcmu_device);
  597. snowball_pinmaps_init();
  598. parent = u8500_init_devices(&ab8500_platdata);
  599. for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++)
  600. snowball_platform_devs[i]->dev.parent = parent;
  601. platform_add_devices(snowball_platform_devs,
  602. ARRAY_SIZE(snowball_platform_devs));
  603. mop500_i2c_init(parent);
  604. snowball_sdi_init(parent);
  605. mop500_spi_init(parent);
  606. mop500_audio_init(parent);
  607. mop500_uart_init(parent);
  608. /* This board has full regulator constraints */
  609. regulator_has_full_constraints();
  610. }
  611. static void __init hrefv60_init_machine(void)
  612. {
  613. struct device *parent = NULL;
  614. int i2c0_devs;
  615. int i;
  616. platform_device_register(&db8500_prcmu_device);
  617. /*
  618. * The HREFv60 board removed a GPIO expander and routed
  619. * all these GPIO pins to the internal GPIO controller
  620. * instead.
  621. */
  622. mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
  623. hrefv60_pinmaps_init();
  624. parent = u8500_init_devices(&ab8500_platdata);
  625. for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
  626. mop500_platform_devs[i]->dev.parent = parent;
  627. platform_add_devices(mop500_platform_devs,
  628. ARRAY_SIZE(mop500_platform_devs));
  629. mop500_i2c_init(parent);
  630. hrefv60_sdi_init(parent);
  631. mop500_spi_init(parent);
  632. mop500_audio_init(parent);
  633. mop500_uart_init(parent);
  634. i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  635. i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
  636. i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  637. i2c_register_board_info(2, mop500_i2c2_devices,
  638. ARRAY_SIZE(mop500_i2c2_devices));
  639. /* This board has full regulator constraints */
  640. regulator_has_full_constraints();
  641. }
  642. MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
  643. /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
  644. .atag_offset = 0x100,
  645. .smp = smp_ops(ux500_smp_ops),
  646. .map_io = u8500_map_io,
  647. .init_irq = ux500_init_irq,
  648. /* we re-use nomadik timer here */
  649. .init_time = ux500_timer_init,
  650. .init_machine = mop500_init_machine,
  651. .init_late = ux500_init_late,
  652. MACHINE_END
  653. MACHINE_START(U8520, "ST-Ericsson U8520 Platform HREFP520")
  654. .atag_offset = 0x100,
  655. .map_io = u8500_map_io,
  656. .init_irq = ux500_init_irq,
  657. .init_time = ux500_timer_init,
  658. .init_machine = mop500_init_machine,
  659. .init_late = ux500_init_late,
  660. MACHINE_END
  661. MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
  662. .atag_offset = 0x100,
  663. .smp = smp_ops(ux500_smp_ops),
  664. .map_io = u8500_map_io,
  665. .init_irq = ux500_init_irq,
  666. .init_time = ux500_timer_init,
  667. .init_machine = hrefv60_init_machine,
  668. .init_late = ux500_init_late,
  669. MACHINE_END
  670. MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
  671. .atag_offset = 0x100,
  672. .smp = smp_ops(ux500_smp_ops),
  673. .map_io = u8500_map_io,
  674. .init_irq = ux500_init_irq,
  675. /* we re-use nomadik timer here */
  676. .init_time = ux500_timer_init,
  677. .init_machine = snowball_init_machine,
  678. .init_late = NULL,
  679. MACHINE_END