board-mop500.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. /*
  2. * Copyright (C) 2008-2009 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/gpio.h>
  18. #include <linux/amba/bus.h>
  19. #include <linux/amba/pl022.h>
  20. #include <linux/amba/serial.h>
  21. #include <linux/spi/spi.h>
  22. #include <linux/mfd/ab8500.h>
  23. #include <linux/regulator/ab8500.h>
  24. #include <linux/mfd/tc3589x.h>
  25. #include <linux/mfd/tps6105x.h>
  26. #include <linux/mfd/ab8500/gpio.h>
  27. #include <linux/leds-lp5521.h>
  28. #include <linux/input.h>
  29. #include <linux/smsc911x.h>
  30. #include <linux/gpio_keys.h>
  31. #include <linux/delay.h>
  32. #include <linux/leds.h>
  33. #include <asm/mach-types.h>
  34. #include <asm/mach/arch.h>
  35. #include <plat/i2c.h>
  36. #include <plat/ste_dma40.h>
  37. #include <plat/pincfg.h>
  38. #include <plat/gpio-nomadik.h>
  39. #include <mach/hardware.h>
  40. #include <mach/setup.h>
  41. #include <mach/devices.h>
  42. #include <mach/irqs.h>
  43. #include "pins-db8500.h"
  44. #include "ste-dma40-db8500.h"
  45. #include "devices-db8500.h"
  46. #include "board-mop500.h"
  47. #include "board-mop500-regulators.h"
  48. static struct gpio_led snowball_led_array[] = {
  49. {
  50. .name = "user_led",
  51. .default_trigger = "none",
  52. .gpio = 142,
  53. },
  54. };
  55. static struct gpio_led_platform_data snowball_led_data = {
  56. .leds = snowball_led_array,
  57. .num_leds = ARRAY_SIZE(snowball_led_array),
  58. };
  59. static struct platform_device snowball_led_dev = {
  60. .name = "leds-gpio",
  61. .dev = {
  62. .platform_data = &snowball_led_data,
  63. },
  64. };
  65. static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
  66. .gpio_base = MOP500_AB8500_GPIO(0),
  67. .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
  68. /* config_reg is the initial configuration of ab8500 pins.
  69. * The pins can be configured as GPIO or alt functions based
  70. * on value present in GpioSel1 to GpioSel6 and AlternatFunction
  71. * register. This is the array of 7 configuration settings.
  72. * One has to compile time decide these settings. Below is the
  73. * explanation of these setting
  74. * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO
  75. * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO
  76. * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO
  77. * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO
  78. * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO
  79. * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO
  80. * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured
  81. * as GPIO then this register selectes the alternate fucntions
  82. */
  83. .config_reg = {0x00, 0x1E, 0x80, 0x01,
  84. 0x7A, 0x00, 0x00},
  85. };
  86. static struct gpio_keys_button snowball_key_array[] = {
  87. {
  88. .gpio = 32,
  89. .type = EV_KEY,
  90. .code = KEY_1,
  91. .desc = "userpb",
  92. .active_low = 1,
  93. .debounce_interval = 50,
  94. .wakeup = 1,
  95. },
  96. {
  97. .gpio = 151,
  98. .type = EV_KEY,
  99. .code = KEY_2,
  100. .desc = "extkb1",
  101. .active_low = 1,
  102. .debounce_interval = 50,
  103. .wakeup = 1,
  104. },
  105. {
  106. .gpio = 152,
  107. .type = EV_KEY,
  108. .code = KEY_3,
  109. .desc = "extkb2",
  110. .active_low = 1,
  111. .debounce_interval = 50,
  112. .wakeup = 1,
  113. },
  114. {
  115. .gpio = 161,
  116. .type = EV_KEY,
  117. .code = KEY_4,
  118. .desc = "extkb3",
  119. .active_low = 1,
  120. .debounce_interval = 50,
  121. .wakeup = 1,
  122. },
  123. {
  124. .gpio = 162,
  125. .type = EV_KEY,
  126. .code = KEY_5,
  127. .desc = "extkb4",
  128. .active_low = 1,
  129. .debounce_interval = 50,
  130. .wakeup = 1,
  131. },
  132. };
  133. static struct gpio_keys_platform_data snowball_key_data = {
  134. .buttons = snowball_key_array,
  135. .nbuttons = ARRAY_SIZE(snowball_key_array),
  136. };
  137. static struct platform_device snowball_key_dev = {
  138. .name = "gpio-keys",
  139. .id = -1,
  140. .dev = {
  141. .platform_data = &snowball_key_data,
  142. }
  143. };
  144. static struct smsc911x_platform_config snowball_sbnet_cfg = {
  145. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
  146. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  147. .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
  148. .shift = 1,
  149. };
  150. static struct resource sbnet_res[] = {
  151. {
  152. .name = "smsc911x-memory",
  153. .start = (0x5000 << 16),
  154. .end = (0x5000 << 16) + 0xffff,
  155. .flags = IORESOURCE_MEM,
  156. },
  157. {
  158. .start = NOMADIK_GPIO_TO_IRQ(140),
  159. .end = NOMADIK_GPIO_TO_IRQ(140),
  160. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
  161. },
  162. };
  163. static struct platform_device snowball_sbnet_dev = {
  164. .name = "smsc911x",
  165. .num_resources = ARRAY_SIZE(sbnet_res),
  166. .resource = sbnet_res,
  167. .dev = {
  168. .platform_data = &snowball_sbnet_cfg,
  169. },
  170. };
  171. static struct ab8500_platform_data ab8500_platdata = {
  172. .irq_base = MOP500_AB8500_IRQ_BASE,
  173. .regulator_reg_init = ab8500_regulator_reg_init,
  174. .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init),
  175. .regulator = ab8500_regulators,
  176. .num_regulator = ARRAY_SIZE(ab8500_regulators),
  177. .gpio = &ab8500_gpio_pdata,
  178. };
  179. static struct resource ab8500_resources[] = {
  180. [0] = {
  181. .start = IRQ_DB8500_AB8500,
  182. .end = IRQ_DB8500_AB8500,
  183. .flags = IORESOURCE_IRQ
  184. }
  185. };
  186. struct platform_device ab8500_device = {
  187. .name = "ab8500-i2c",
  188. .id = 0,
  189. .dev = {
  190. .platform_data = &ab8500_platdata,
  191. },
  192. .num_resources = 1,
  193. .resource = ab8500_resources,
  194. };
  195. /*
  196. * TPS61052
  197. */
  198. static struct tps6105x_platform_data mop500_tps61052_data = {
  199. .mode = TPS6105X_MODE_VOLTAGE,
  200. .regulator_data = &tps61052_regulator,
  201. };
  202. /*
  203. * TC35892
  204. */
  205. static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base)
  206. {
  207. mop500_sdi_tc35892_init();
  208. }
  209. static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = {
  210. .gpio_base = MOP500_EGPIO(0),
  211. .setup = mop500_tc35892_init,
  212. };
  213. static struct tc3589x_platform_data mop500_tc35892_data = {
  214. .block = TC3589x_BLOCK_GPIO,
  215. .gpio = &mop500_tc35892_gpio_data,
  216. .irq_base = MOP500_EGPIO_IRQ_BASE,
  217. };
  218. static struct lp5521_led_config lp5521_pri_led[] = {
  219. [0] = {
  220. .chan_nr = 0,
  221. .led_current = 0x2f,
  222. .max_current = 0x5f,
  223. },
  224. [1] = {
  225. .chan_nr = 1,
  226. .led_current = 0x2f,
  227. .max_current = 0x5f,
  228. },
  229. [2] = {
  230. .chan_nr = 2,
  231. .led_current = 0x2f,
  232. .max_current = 0x5f,
  233. },
  234. };
  235. static struct lp5521_platform_data __initdata lp5521_pri_data = {
  236. .label = "lp5521_pri",
  237. .led_config = &lp5521_pri_led[0],
  238. .num_channels = 3,
  239. .clock_mode = LP5521_CLOCK_EXT,
  240. };
  241. static struct lp5521_led_config lp5521_sec_led[] = {
  242. [0] = {
  243. .chan_nr = 0,
  244. .led_current = 0x2f,
  245. .max_current = 0x5f,
  246. },
  247. [1] = {
  248. .chan_nr = 1,
  249. .led_current = 0x2f,
  250. .max_current = 0x5f,
  251. },
  252. [2] = {
  253. .chan_nr = 2,
  254. .led_current = 0x2f,
  255. .max_current = 0x5f,
  256. },
  257. };
  258. static struct lp5521_platform_data __initdata lp5521_sec_data = {
  259. .label = "lp5521_sec",
  260. .led_config = &lp5521_sec_led[0],
  261. .num_channels = 3,
  262. .clock_mode = LP5521_CLOCK_EXT,
  263. };
  264. static struct i2c_board_info __initdata mop500_i2c0_devices[] = {
  265. {
  266. I2C_BOARD_INFO("tc3589x", 0x42),
  267. .irq = NOMADIK_GPIO_TO_IRQ(217),
  268. .platform_data = &mop500_tc35892_data,
  269. },
  270. /* I2C0 devices only available prior to HREFv60 */
  271. {
  272. I2C_BOARD_INFO("tps61052", 0x33),
  273. .platform_data = &mop500_tps61052_data,
  274. },
  275. };
  276. #define NUM_PRE_V60_I2C0_DEVICES 1
  277. static struct i2c_board_info __initdata mop500_i2c2_devices[] = {
  278. {
  279. /* lp5521 LED driver, 1st device */
  280. I2C_BOARD_INFO("lp5521", 0x33),
  281. .platform_data = &lp5521_pri_data,
  282. },
  283. {
  284. /* lp5521 LED driver, 2st device */
  285. I2C_BOARD_INFO("lp5521", 0x34),
  286. .platform_data = &lp5521_sec_data,
  287. },
  288. {
  289. /* Light sensor Rohm BH1780GLI */
  290. I2C_BOARD_INFO("bh1780", 0x29),
  291. },
  292. };
  293. #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, t_out, _sm) \
  294. static struct nmk_i2c_controller u8500_i2c##id##_data = { \
  295. /* \
  296. * slave data setup time, which is \
  297. * 250 ns,100ns,10ns which is 14,6,2 \
  298. * respectively for a 48 Mhz \
  299. * i2c clock \
  300. */ \
  301. .slsu = _slsu, \
  302. /* Tx FIFO threshold */ \
  303. .tft = _tft, \
  304. /* Rx FIFO threshold */ \
  305. .rft = _rft, \
  306. /* std. mode operation */ \
  307. .clk_freq = clk, \
  308. /* Slave response timeout(ms) */\
  309. .timeout = t_out, \
  310. .sm = _sm, \
  311. }
  312. /*
  313. * The board uses 4 i2c controllers, initialize all of
  314. * them with slave data setup time of 250 ns,
  315. * Tx & Rx FIFO threshold values as 8 and standard
  316. * mode of operation
  317. */
  318. U8500_I2C_CONTROLLER(0, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  319. U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  320. U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  321. U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST);
  322. static void __init mop500_i2c_init(void)
  323. {
  324. db8500_add_i2c0(&u8500_i2c0_data);
  325. db8500_add_i2c1(&u8500_i2c1_data);
  326. db8500_add_i2c2(&u8500_i2c2_data);
  327. db8500_add_i2c3(&u8500_i2c3_data);
  328. }
  329. static struct gpio_keys_button mop500_gpio_keys[] = {
  330. {
  331. .desc = "SFH7741 Proximity Sensor",
  332. .type = EV_SW,
  333. .code = SW_FRONT_PROXIMITY,
  334. .active_low = 0,
  335. .can_disable = 1,
  336. }
  337. };
  338. static struct regulator *prox_regulator;
  339. static int mop500_prox_activate(struct device *dev);
  340. static void mop500_prox_deactivate(struct device *dev);
  341. static struct gpio_keys_platform_data mop500_gpio_keys_data = {
  342. .buttons = mop500_gpio_keys,
  343. .nbuttons = ARRAY_SIZE(mop500_gpio_keys),
  344. .enable = mop500_prox_activate,
  345. .disable = mop500_prox_deactivate,
  346. };
  347. static struct platform_device mop500_gpio_keys_device = {
  348. .name = "gpio-keys",
  349. .id = 0,
  350. .dev = {
  351. .platform_data = &mop500_gpio_keys_data,
  352. },
  353. };
  354. static int mop500_prox_activate(struct device *dev)
  355. {
  356. prox_regulator = regulator_get(&mop500_gpio_keys_device.dev,
  357. "vcc");
  358. if (IS_ERR(prox_regulator)) {
  359. dev_err(&mop500_gpio_keys_device.dev,
  360. "no regulator\n");
  361. return PTR_ERR(prox_regulator);
  362. }
  363. regulator_enable(prox_regulator);
  364. return 0;
  365. }
  366. static void mop500_prox_deactivate(struct device *dev)
  367. {
  368. regulator_disable(prox_regulator);
  369. regulator_put(prox_regulator);
  370. }
  371. /* add any platform devices here - TODO */
  372. static struct platform_device *mop500_platform_devs[] __initdata = {
  373. &mop500_gpio_keys_device,
  374. &ab8500_device,
  375. };
  376. #ifdef CONFIG_STE_DMA40
  377. static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
  378. .mode = STEDMA40_MODE_LOGICAL,
  379. .dir = STEDMA40_PERIPH_TO_MEM,
  380. .src_dev_type = DB8500_DMA_DEV8_SSP0_RX,
  381. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  382. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  383. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  384. };
  385. static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
  386. .mode = STEDMA40_MODE_LOGICAL,
  387. .dir = STEDMA40_MEM_TO_PERIPH,
  388. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  389. .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX,
  390. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  391. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  392. };
  393. #endif
  394. static struct pl022_ssp_controller ssp0_platform_data = {
  395. .bus_id = 0,
  396. #ifdef CONFIG_STE_DMA40
  397. .enable_dma = 1,
  398. .dma_filter = stedma40_filter,
  399. .dma_rx_param = &ssp0_dma_cfg_rx,
  400. .dma_tx_param = &ssp0_dma_cfg_tx,
  401. #else
  402. .enable_dma = 0,
  403. #endif
  404. /* on this platform, gpio 31,142,144,214 &
  405. * 224 are connected as chip selects
  406. */
  407. .num_chipselect = 5,
  408. };
  409. static void __init mop500_spi_init(void)
  410. {
  411. db8500_add_ssp0(&ssp0_platform_data);
  412. }
  413. #ifdef CONFIG_STE_DMA40
  414. static struct stedma40_chan_cfg uart0_dma_cfg_rx = {
  415. .mode = STEDMA40_MODE_LOGICAL,
  416. .dir = STEDMA40_PERIPH_TO_MEM,
  417. .src_dev_type = DB8500_DMA_DEV13_UART0_RX,
  418. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  419. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  420. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  421. };
  422. static struct stedma40_chan_cfg uart0_dma_cfg_tx = {
  423. .mode = STEDMA40_MODE_LOGICAL,
  424. .dir = STEDMA40_MEM_TO_PERIPH,
  425. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  426. .dst_dev_type = DB8500_DMA_DEV13_UART0_TX,
  427. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  428. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  429. };
  430. static struct stedma40_chan_cfg uart1_dma_cfg_rx = {
  431. .mode = STEDMA40_MODE_LOGICAL,
  432. .dir = STEDMA40_PERIPH_TO_MEM,
  433. .src_dev_type = DB8500_DMA_DEV12_UART1_RX,
  434. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  435. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  436. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  437. };
  438. static struct stedma40_chan_cfg uart1_dma_cfg_tx = {
  439. .mode = STEDMA40_MODE_LOGICAL,
  440. .dir = STEDMA40_MEM_TO_PERIPH,
  441. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  442. .dst_dev_type = DB8500_DMA_DEV12_UART1_TX,
  443. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  444. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  445. };
  446. static struct stedma40_chan_cfg uart2_dma_cfg_rx = {
  447. .mode = STEDMA40_MODE_LOGICAL,
  448. .dir = STEDMA40_PERIPH_TO_MEM,
  449. .src_dev_type = DB8500_DMA_DEV11_UART2_RX,
  450. .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
  451. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  452. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  453. };
  454. static struct stedma40_chan_cfg uart2_dma_cfg_tx = {
  455. .mode = STEDMA40_MODE_LOGICAL,
  456. .dir = STEDMA40_MEM_TO_PERIPH,
  457. .src_dev_type = STEDMA40_DEV_SRC_MEMORY,
  458. .dst_dev_type = DB8500_DMA_DEV11_UART2_TX,
  459. .src_info.data_width = STEDMA40_BYTE_WIDTH,
  460. .dst_info.data_width = STEDMA40_BYTE_WIDTH,
  461. };
  462. #endif
  463. static pin_cfg_t mop500_pins_uart0[] = {
  464. GPIO0_U0_CTSn | PIN_INPUT_PULLUP,
  465. GPIO1_U0_RTSn | PIN_OUTPUT_HIGH,
  466. GPIO2_U0_RXD | PIN_INPUT_PULLUP,
  467. GPIO3_U0_TXD | PIN_OUTPUT_HIGH,
  468. };
  469. #define PRCC_K_SOFTRST_SET 0x18
  470. #define PRCC_K_SOFTRST_CLEAR 0x1C
  471. static void ux500_uart0_reset(void)
  472. {
  473. void __iomem *prcc_rst_set, *prcc_rst_clr;
  474. prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
  475. PRCC_K_SOFTRST_SET);
  476. prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE +
  477. PRCC_K_SOFTRST_CLEAR);
  478. /* Activate soft reset PRCC_K_SOFTRST_CLEAR */
  479. writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr);
  480. udelay(1);
  481. /* Release soft reset PRCC_K_SOFTRST_SET */
  482. writel((readl(prcc_rst_set) | 0x1), prcc_rst_set);
  483. udelay(1);
  484. }
  485. static void ux500_uart0_init(void)
  486. {
  487. int ret;
  488. ret = nmk_config_pins(mop500_pins_uart0,
  489. ARRAY_SIZE(mop500_pins_uart0));
  490. if (ret < 0)
  491. pr_err("pl011: uart pins_enable failed\n");
  492. }
  493. static void ux500_uart0_exit(void)
  494. {
  495. int ret;
  496. ret = nmk_config_pins_sleep(mop500_pins_uart0,
  497. ARRAY_SIZE(mop500_pins_uart0));
  498. if (ret < 0)
  499. pr_err("pl011: uart pins_disable failed\n");
  500. }
  501. static struct amba_pl011_data uart0_plat = {
  502. #ifdef CONFIG_STE_DMA40
  503. .dma_filter = stedma40_filter,
  504. .dma_rx_param = &uart0_dma_cfg_rx,
  505. .dma_tx_param = &uart0_dma_cfg_tx,
  506. #endif
  507. .init = ux500_uart0_init,
  508. .exit = ux500_uart0_exit,
  509. .reset = ux500_uart0_reset,
  510. };
  511. static struct amba_pl011_data uart1_plat = {
  512. #ifdef CONFIG_STE_DMA40
  513. .dma_filter = stedma40_filter,
  514. .dma_rx_param = &uart1_dma_cfg_rx,
  515. .dma_tx_param = &uart1_dma_cfg_tx,
  516. #endif
  517. };
  518. static struct amba_pl011_data uart2_plat = {
  519. #ifdef CONFIG_STE_DMA40
  520. .dma_filter = stedma40_filter,
  521. .dma_rx_param = &uart2_dma_cfg_rx,
  522. .dma_tx_param = &uart2_dma_cfg_tx,
  523. #endif
  524. };
  525. static void __init mop500_uart_init(void)
  526. {
  527. db8500_add_uart0(&uart0_plat);
  528. db8500_add_uart1(&uart1_plat);
  529. db8500_add_uart2(&uart2_plat);
  530. }
  531. static struct platform_device *snowball_platform_devs[] __initdata = {
  532. &snowball_led_dev,
  533. &snowball_key_dev,
  534. &snowball_sbnet_dev,
  535. &ab8500_device,
  536. };
  537. static void __init mop500_init_machine(void)
  538. {
  539. int i2c0_devs;
  540. mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
  541. u8500_init_devices();
  542. mop500_pins_init();
  543. platform_add_devices(mop500_platform_devs,
  544. ARRAY_SIZE(mop500_platform_devs));
  545. mop500_i2c_init();
  546. mop500_sdi_init();
  547. mop500_spi_init();
  548. mop500_uart_init();
  549. i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  550. i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  551. i2c_register_board_info(2, mop500_i2c2_devices,
  552. ARRAY_SIZE(mop500_i2c2_devices));
  553. /* This board has full regulator constraints */
  554. regulator_has_full_constraints();
  555. }
  556. static void __init snowball_init_machine(void)
  557. {
  558. int i2c0_devs;
  559. u8500_init_devices();
  560. snowball_pins_init();
  561. platform_add_devices(snowball_platform_devs,
  562. ARRAY_SIZE(snowball_platform_devs));
  563. mop500_i2c_init();
  564. snowball_sdi_init();
  565. mop500_spi_init();
  566. mop500_uart_init();
  567. i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  568. i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  569. i2c_register_board_info(2, mop500_i2c2_devices,
  570. ARRAY_SIZE(mop500_i2c2_devices));
  571. /* This board has full regulator constraints */
  572. regulator_has_full_constraints();
  573. }
  574. static void __init hrefv60_init_machine(void)
  575. {
  576. int i2c0_devs;
  577. /*
  578. * The HREFv60 board removed a GPIO expander and routed
  579. * all these GPIO pins to the internal GPIO controller
  580. * instead.
  581. */
  582. mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
  583. u8500_init_devices();
  584. hrefv60_pins_init();
  585. platform_add_devices(mop500_platform_devs,
  586. ARRAY_SIZE(mop500_platform_devs));
  587. mop500_i2c_init();
  588. mop500_sdi_init();
  589. mop500_spi_init();
  590. mop500_uart_init();
  591. i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
  592. i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
  593. i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
  594. i2c_register_board_info(2, mop500_i2c2_devices,
  595. ARRAY_SIZE(mop500_i2c2_devices));
  596. /* This board has full regulator constraints */
  597. regulator_has_full_constraints();
  598. }
  599. MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
  600. /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */
  601. .atag_offset = 0x100,
  602. .map_io = u8500_map_io,
  603. .init_irq = ux500_init_irq,
  604. /* we re-use nomadik timer here */
  605. .timer = &ux500_timer,
  606. .init_machine = mop500_init_machine,
  607. MACHINE_END
  608. MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
  609. .atag_offset = 0x100,
  610. .map_io = u8500_map_io,
  611. .init_irq = ux500_init_irq,
  612. .timer = &ux500_timer,
  613. .init_machine = hrefv60_init_machine,
  614. MACHINE_END
  615. MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
  616. .atag_offset = 0x100,
  617. .map_io = u8500_map_io,
  618. .init_irq = ux500_init_irq,
  619. /* we re-use nomadik timer here */
  620. .timer = &ux500_timer,
  621. .init_machine = snowball_init_machine,
  622. MACHINE_END