board-mop500.c 20 KB

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