board-da830-evm.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /*
  2. * TI DA830/OMAP L137 EVM board
  3. *
  4. * Author: Mark A. Greer <mgreer@mvista.com>
  5. * Derived from: arch/arm/mach-davinci/board-dm644x-evm.c
  6. *
  7. * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
  8. * the terms of the GNU General Public License version 2. This program
  9. * is licensed "as is" without any warranty of any kind, whether express
  10. * or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/console.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/gpio.h>
  17. #include <linux/gpio/machine.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/i2c.h>
  20. #include <linux/i2c/pcf857x.h>
  21. #include <linux/platform_data/at24.h>
  22. #include <linux/mtd/mtd.h>
  23. #include <linux/mtd/partitions.h>
  24. #include <linux/spi/spi.h>
  25. #include <linux/spi/flash.h>
  26. #include <linux/platform_data/gpio-davinci.h>
  27. #include <linux/platform_data/mtd-davinci.h>
  28. #include <linux/platform_data/mtd-davinci-aemif.h>
  29. #include <linux/platform_data/spi-davinci.h>
  30. #include <linux/platform_data/usb-davinci.h>
  31. #include <linux/regulator/machine.h>
  32. #include <asm/mach-types.h>
  33. #include <asm/mach/arch.h>
  34. #include <mach/common.h>
  35. #include "cp_intc.h"
  36. #include <mach/mux.h>
  37. #include <mach/da8xx.h>
  38. #define DA830_EVM_PHY_ID ""
  39. /*
  40. * USB1 VBUS is controlled by GPIO1[15], over-current is reported on GPIO2[4].
  41. */
  42. #define ON_BD_USB_DRV GPIO_TO_PIN(1, 15)
  43. #define ON_BD_USB_OVC GPIO_TO_PIN(2, 4)
  44. static const short da830_evm_usb11_pins[] = {
  45. DA830_GPIO1_15, DA830_GPIO2_4,
  46. -1
  47. };
  48. static da8xx_ocic_handler_t da830_evm_usb_ocic_handler;
  49. static int da830_evm_usb_set_power(unsigned port, int on)
  50. {
  51. gpio_set_value(ON_BD_USB_DRV, on);
  52. return 0;
  53. }
  54. static int da830_evm_usb_get_power(unsigned port)
  55. {
  56. return gpio_get_value(ON_BD_USB_DRV);
  57. }
  58. static int da830_evm_usb_get_oci(unsigned port)
  59. {
  60. return !gpio_get_value(ON_BD_USB_OVC);
  61. }
  62. static irqreturn_t da830_evm_usb_ocic_irq(int, void *);
  63. static int da830_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
  64. {
  65. int irq = gpio_to_irq(ON_BD_USB_OVC);
  66. int error = 0;
  67. if (handler != NULL) {
  68. da830_evm_usb_ocic_handler = handler;
  69. error = request_irq(irq, da830_evm_usb_ocic_irq,
  70. IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
  71. "OHCI over-current indicator", NULL);
  72. if (error)
  73. pr_err("%s: could not request IRQ to watch over-current indicator changes\n",
  74. __func__);
  75. } else
  76. free_irq(irq, NULL);
  77. return error;
  78. }
  79. static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
  80. .set_power = da830_evm_usb_set_power,
  81. .get_power = da830_evm_usb_get_power,
  82. .get_oci = da830_evm_usb_get_oci,
  83. .ocic_notify = da830_evm_usb_ocic_notify,
  84. /* TPS2065 switch @ 5V */
  85. .potpgt = (3 + 1) / 2, /* 3 ms max */
  86. };
  87. static irqreturn_t da830_evm_usb_ocic_irq(int irq, void *dev_id)
  88. {
  89. da830_evm_usb_ocic_handler(&da830_evm_usb11_pdata, 1);
  90. return IRQ_HANDLED;
  91. }
  92. static __init void da830_evm_usb_init(void)
  93. {
  94. int ret;
  95. /* USB_REFCLKIN is not used. */
  96. ret = da8xx_register_usb20_phy_clk(false);
  97. if (ret)
  98. pr_warn("%s: USB 2.0 PHY CLK registration failed: %d\n",
  99. __func__, ret);
  100. ret = da8xx_register_usb11_phy_clk(false);
  101. if (ret)
  102. pr_warn("%s: USB 1.1 PHY CLK registration failed: %d\n",
  103. __func__, ret);
  104. ret = da8xx_register_usb_phy();
  105. if (ret)
  106. pr_warn("%s: USB PHY registration failed: %d\n",
  107. __func__, ret);
  108. ret = davinci_cfg_reg(DA830_USB0_DRVVBUS);
  109. if (ret)
  110. pr_warn("%s: USB 2.0 PinMux setup failed: %d\n", __func__, ret);
  111. else {
  112. /*
  113. * TPS2065 switch @ 5V supplies 1 A (sustains 1.5 A),
  114. * with the power on to power good time of 3 ms.
  115. */
  116. ret = da8xx_register_usb20(1000, 3);
  117. if (ret)
  118. pr_warn("%s: USB 2.0 registration failed: %d\n",
  119. __func__, ret);
  120. }
  121. ret = davinci_cfg_reg_list(da830_evm_usb11_pins);
  122. if (ret) {
  123. pr_warn("%s: USB 1.1 PinMux setup failed: %d\n", __func__, ret);
  124. return;
  125. }
  126. ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
  127. if (ret) {
  128. pr_err("%s: failed to request GPIO for USB 1.1 port power control: %d\n",
  129. __func__, ret);
  130. return;
  131. }
  132. gpio_direction_output(ON_BD_USB_DRV, 0);
  133. ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
  134. if (ret) {
  135. pr_err("%s: failed to request GPIO for USB 1.1 port over-current indicator: %d\n",
  136. __func__, ret);
  137. return;
  138. }
  139. gpio_direction_input(ON_BD_USB_OVC);
  140. ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
  141. if (ret)
  142. pr_warn("%s: USB 1.1 registration failed: %d\n", __func__, ret);
  143. }
  144. static const short da830_evm_mcasp1_pins[] = {
  145. DA830_AHCLKX1, DA830_ACLKX1, DA830_AFSX1, DA830_AHCLKR1, DA830_AFSR1,
  146. DA830_AMUTE1, DA830_AXR1_0, DA830_AXR1_1, DA830_AXR1_2, DA830_AXR1_5,
  147. DA830_ACLKR1, DA830_AXR1_6, DA830_AXR1_7, DA830_AXR1_8, DA830_AXR1_10,
  148. DA830_AXR1_11,
  149. -1
  150. };
  151. static u8 da830_iis_serializer_direction[] = {
  152. RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
  153. INACTIVE_MODE, TX_MODE, INACTIVE_MODE, INACTIVE_MODE,
  154. INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
  155. };
  156. static struct snd_platform_data da830_evm_snd_data = {
  157. .tx_dma_offset = 0x2000,
  158. .rx_dma_offset = 0x2000,
  159. .op_mode = DAVINCI_MCASP_IIS_MODE,
  160. .num_serializer = ARRAY_SIZE(da830_iis_serializer_direction),
  161. .tdm_slots = 2,
  162. .serial_dir = da830_iis_serializer_direction,
  163. .asp_chan_q = EVENTQ_0,
  164. .version = MCASP_VERSION_2,
  165. .txnumevt = 1,
  166. .rxnumevt = 1,
  167. };
  168. /*
  169. * GPIO2[1] is used as MMC_SD_WP and GPIO2[2] as MMC_SD_INS.
  170. */
  171. static const short da830_evm_mmc_sd_pins[] = {
  172. DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2,
  173. DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5,
  174. DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK,
  175. DA830_MMCSD_CMD, DA830_GPIO2_1, DA830_GPIO2_2,
  176. -1
  177. };
  178. static struct gpiod_lookup_table mmc_gpios_table = {
  179. .dev_id = "da830-mmc.0",
  180. .table = {
  181. /* gpio chip 1 contains gpio range 32-63 */
  182. GPIO_LOOKUP("davinci_gpio.1", 2, "cd", GPIO_ACTIVE_LOW),
  183. GPIO_LOOKUP("davinci_gpio.1", 1, "wp", GPIO_ACTIVE_LOW),
  184. },
  185. };
  186. static struct davinci_mmc_config da830_evm_mmc_config = {
  187. .wires = 8,
  188. .max_freq = 50000000,
  189. .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
  190. };
  191. static inline void da830_evm_init_mmc(void)
  192. {
  193. int ret;
  194. ret = davinci_cfg_reg_list(da830_evm_mmc_sd_pins);
  195. if (ret) {
  196. pr_warn("%s: mmc/sd mux setup failed: %d\n", __func__, ret);
  197. return;
  198. }
  199. gpiod_add_lookup_table(&mmc_gpios_table);
  200. ret = da8xx_register_mmcsd0(&da830_evm_mmc_config);
  201. if (ret) {
  202. pr_warn("%s: mmc/sd registration failed: %d\n", __func__, ret);
  203. gpiod_remove_lookup_table(&mmc_gpios_table);
  204. }
  205. }
  206. /*
  207. * UI board NAND/NOR flashes only use 8-bit data bus.
  208. */
  209. static const short da830_evm_emif25_pins[] = {
  210. DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3,
  211. DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7,
  212. DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3,
  213. DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7,
  214. DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11,
  215. DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE,
  216. DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0,
  217. -1
  218. };
  219. #define HAS_MMC IS_ENABLED(CONFIG_MMC_DAVINCI)
  220. #ifdef CONFIG_DA830_UI_NAND
  221. static struct mtd_partition da830_evm_nand_partitions[] = {
  222. /* bootloader (U-Boot, etc) in first sector */
  223. [0] = {
  224. .name = "bootloader",
  225. .offset = 0,
  226. .size = SZ_128K,
  227. .mask_flags = MTD_WRITEABLE, /* force read-only */
  228. },
  229. /* bootloader params in the next sector */
  230. [1] = {
  231. .name = "params",
  232. .offset = MTDPART_OFS_APPEND,
  233. .size = SZ_128K,
  234. .mask_flags = MTD_WRITEABLE, /* force read-only */
  235. },
  236. /* kernel */
  237. [2] = {
  238. .name = "kernel",
  239. .offset = MTDPART_OFS_APPEND,
  240. .size = SZ_2M,
  241. .mask_flags = 0,
  242. },
  243. /* file system */
  244. [3] = {
  245. .name = "filesystem",
  246. .offset = MTDPART_OFS_APPEND,
  247. .size = MTDPART_SIZ_FULL,
  248. .mask_flags = 0,
  249. }
  250. };
  251. /* flash bbt decriptors */
  252. static uint8_t da830_evm_nand_bbt_pattern[] = { 'B', 'b', 't', '0' };
  253. static uint8_t da830_evm_nand_mirror_pattern[] = { '1', 't', 'b', 'B' };
  254. static struct nand_bbt_descr da830_evm_nand_bbt_main_descr = {
  255. .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
  256. NAND_BBT_WRITE | NAND_BBT_2BIT |
  257. NAND_BBT_VERSION | NAND_BBT_PERCHIP,
  258. .offs = 2,
  259. .len = 4,
  260. .veroffs = 16,
  261. .maxblocks = 4,
  262. .pattern = da830_evm_nand_bbt_pattern
  263. };
  264. static struct nand_bbt_descr da830_evm_nand_bbt_mirror_descr = {
  265. .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE |
  266. NAND_BBT_WRITE | NAND_BBT_2BIT |
  267. NAND_BBT_VERSION | NAND_BBT_PERCHIP,
  268. .offs = 2,
  269. .len = 4,
  270. .veroffs = 16,
  271. .maxblocks = 4,
  272. .pattern = da830_evm_nand_mirror_pattern
  273. };
  274. static struct davinci_aemif_timing da830_evm_nandflash_timing = {
  275. .wsetup = 24,
  276. .wstrobe = 21,
  277. .whold = 14,
  278. .rsetup = 19,
  279. .rstrobe = 50,
  280. .rhold = 0,
  281. .ta = 20,
  282. };
  283. static struct davinci_nand_pdata da830_evm_nand_pdata = {
  284. .parts = da830_evm_nand_partitions,
  285. .nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
  286. .ecc_mode = NAND_ECC_HW,
  287. .ecc_bits = 4,
  288. .bbt_options = NAND_BBT_USE_FLASH,
  289. .bbt_td = &da830_evm_nand_bbt_main_descr,
  290. .bbt_md = &da830_evm_nand_bbt_mirror_descr,
  291. .timing = &da830_evm_nandflash_timing,
  292. };
  293. static struct resource da830_evm_nand_resources[] = {
  294. [0] = { /* First memory resource is NAND I/O window */
  295. .start = DA8XX_AEMIF_CS3_BASE,
  296. .end = DA8XX_AEMIF_CS3_BASE + PAGE_SIZE - 1,
  297. .flags = IORESOURCE_MEM,
  298. },
  299. [1] = { /* Second memory resource is AEMIF control registers */
  300. .start = DA8XX_AEMIF_CTL_BASE,
  301. .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
  302. .flags = IORESOURCE_MEM,
  303. },
  304. };
  305. static struct platform_device da830_evm_nand_device = {
  306. .name = "davinci_nand",
  307. .id = 1,
  308. .dev = {
  309. .platform_data = &da830_evm_nand_pdata,
  310. },
  311. .num_resources = ARRAY_SIZE(da830_evm_nand_resources),
  312. .resource = da830_evm_nand_resources,
  313. };
  314. static inline void da830_evm_init_nand(int mux_mode)
  315. {
  316. int ret;
  317. if (HAS_MMC) {
  318. pr_warn("WARNING: both MMC/SD and NAND are enabled, but they share AEMIF pins\n"
  319. "\tDisable MMC/SD for NAND support\n");
  320. return;
  321. }
  322. ret = davinci_cfg_reg_list(da830_evm_emif25_pins);
  323. if (ret)
  324. pr_warn("%s: emif25 mux setup failed: %d\n", __func__, ret);
  325. ret = platform_device_register(&da830_evm_nand_device);
  326. if (ret)
  327. pr_warn("%s: NAND device not registered\n", __func__);
  328. if (davinci_aemif_setup(&da830_evm_nand_device))
  329. pr_warn("%s: Cannot configure AEMIF\n", __func__);
  330. gpio_direction_output(mux_mode, 1);
  331. }
  332. #else
  333. static inline void da830_evm_init_nand(int mux_mode) { }
  334. #endif
  335. #ifdef CONFIG_DA830_UI_LCD
  336. static inline void da830_evm_init_lcdc(int mux_mode)
  337. {
  338. int ret;
  339. ret = davinci_cfg_reg_list(da830_lcdcntl_pins);
  340. if (ret)
  341. pr_warn("%s: lcdcntl mux setup failed: %d\n", __func__, ret);
  342. ret = da8xx_register_lcdc(&sharp_lcd035q3dg01_pdata);
  343. if (ret)
  344. pr_warn("%s: lcd setup failed: %d\n", __func__, ret);
  345. gpio_direction_output(mux_mode, 0);
  346. }
  347. #else
  348. static inline void da830_evm_init_lcdc(int mux_mode) { }
  349. #endif
  350. static struct at24_platform_data da830_evm_i2c_eeprom_info = {
  351. .byte_len = SZ_256K / 8,
  352. .page_size = 64,
  353. .flags = AT24_FLAG_ADDR16,
  354. .setup = davinci_get_mac_addr,
  355. .context = (void *)0x7f00,
  356. };
  357. static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
  358. int gpio, unsigned ngpio, void *context)
  359. {
  360. gpio_request(gpio + 6, "UI MUX_MODE");
  361. /* Drive mux mode low to match the default without UI card */
  362. gpio_direction_output(gpio + 6, 0);
  363. da830_evm_init_lcdc(gpio + 6);
  364. da830_evm_init_nand(gpio + 6);
  365. return 0;
  366. }
  367. static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
  368. unsigned ngpio, void *context)
  369. {
  370. gpio_free(gpio + 6);
  371. return 0;
  372. }
  373. static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
  374. .gpio_base = DAVINCI_N_GPIO,
  375. .setup = da830_evm_ui_expander_setup,
  376. .teardown = da830_evm_ui_expander_teardown,
  377. };
  378. static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
  379. {
  380. I2C_BOARD_INFO("24c256", 0x50),
  381. .platform_data = &da830_evm_i2c_eeprom_info,
  382. },
  383. {
  384. I2C_BOARD_INFO("tlv320aic3x", 0x18),
  385. },
  386. {
  387. I2C_BOARD_INFO("pcf8574", 0x3f),
  388. .platform_data = &da830_evm_ui_expander_info,
  389. },
  390. };
  391. static struct davinci_i2c_platform_data da830_evm_i2c_0_pdata = {
  392. .bus_freq = 100, /* kHz */
  393. .bus_delay = 0, /* usec */
  394. };
  395. /*
  396. * The following EDMA channels/slots are not being used by drivers (for
  397. * example: Timer, GPIO, UART events etc) on da830/omap-l137 EVM, hence
  398. * they are being reserved for codecs on the DSP side.
  399. */
  400. static const s16 da830_dma_rsv_chans[][2] = {
  401. /* (offset, number) */
  402. { 8, 2},
  403. {12, 2},
  404. {24, 4},
  405. {30, 2},
  406. {-1, -1}
  407. };
  408. static const s16 da830_dma_rsv_slots[][2] = {
  409. /* (offset, number) */
  410. { 8, 2},
  411. {12, 2},
  412. {24, 4},
  413. {30, 26},
  414. {-1, -1}
  415. };
  416. static struct edma_rsv_info da830_edma_rsv[] = {
  417. {
  418. .rsv_chans = da830_dma_rsv_chans,
  419. .rsv_slots = da830_dma_rsv_slots,
  420. },
  421. };
  422. static struct mtd_partition da830evm_spiflash_part[] = {
  423. [0] = {
  424. .name = "DSP-UBL",
  425. .offset = 0,
  426. .size = SZ_8K,
  427. .mask_flags = MTD_WRITEABLE,
  428. },
  429. [1] = {
  430. .name = "ARM-UBL",
  431. .offset = MTDPART_OFS_APPEND,
  432. .size = SZ_16K + SZ_8K,
  433. .mask_flags = MTD_WRITEABLE,
  434. },
  435. [2] = {
  436. .name = "U-Boot",
  437. .offset = MTDPART_OFS_APPEND,
  438. .size = SZ_256K - SZ_32K,
  439. .mask_flags = MTD_WRITEABLE,
  440. },
  441. [3] = {
  442. .name = "U-Boot-Environment",
  443. .offset = MTDPART_OFS_APPEND,
  444. .size = SZ_16K,
  445. .mask_flags = 0,
  446. },
  447. [4] = {
  448. .name = "Kernel",
  449. .offset = MTDPART_OFS_APPEND,
  450. .size = MTDPART_SIZ_FULL,
  451. .mask_flags = 0,
  452. },
  453. };
  454. static struct flash_platform_data da830evm_spiflash_data = {
  455. .name = "m25p80",
  456. .parts = da830evm_spiflash_part,
  457. .nr_parts = ARRAY_SIZE(da830evm_spiflash_part),
  458. .type = "w25x32",
  459. };
  460. static struct davinci_spi_config da830evm_spiflash_cfg = {
  461. .io_type = SPI_IO_TYPE_DMA,
  462. .c2tdelay = 8,
  463. .t2cdelay = 8,
  464. };
  465. static struct spi_board_info da830evm_spi_info[] = {
  466. {
  467. .modalias = "m25p80",
  468. .platform_data = &da830evm_spiflash_data,
  469. .controller_data = &da830evm_spiflash_cfg,
  470. .mode = SPI_MODE_0,
  471. .max_speed_hz = 30000000,
  472. .bus_num = 0,
  473. .chip_select = 0,
  474. },
  475. };
  476. static __init void da830_evm_init(void)
  477. {
  478. struct davinci_soc_info *soc_info = &davinci_soc_info;
  479. int ret;
  480. ret = da8xx_register_cfgchip();
  481. if (ret)
  482. pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret);
  483. ret = da830_register_gpio();
  484. if (ret)
  485. pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
  486. ret = da830_register_edma(da830_edma_rsv);
  487. if (ret)
  488. pr_warn("%s: edma registration failed: %d\n", __func__, ret);
  489. ret = davinci_cfg_reg_list(da830_i2c0_pins);
  490. if (ret)
  491. pr_warn("%s: i2c0 mux setup failed: %d\n", __func__, ret);
  492. ret = da8xx_register_i2c(0, &da830_evm_i2c_0_pdata);
  493. if (ret)
  494. pr_warn("%s: i2c0 registration failed: %d\n", __func__, ret);
  495. da830_evm_usb_init();
  496. soc_info->emac_pdata->rmii_en = 1;
  497. soc_info->emac_pdata->phy_id = DA830_EVM_PHY_ID;
  498. ret = davinci_cfg_reg_list(da830_cpgmac_pins);
  499. if (ret)
  500. pr_warn("%s: cpgmac mux setup failed: %d\n", __func__, ret);
  501. ret = da8xx_register_emac();
  502. if (ret)
  503. pr_warn("%s: emac registration failed: %d\n", __func__, ret);
  504. ret = da8xx_register_watchdog();
  505. if (ret)
  506. pr_warn("%s: watchdog registration failed: %d\n",
  507. __func__, ret);
  508. davinci_serial_init(da8xx_serial_device);
  509. i2c_register_board_info(1, da830_evm_i2c_devices,
  510. ARRAY_SIZE(da830_evm_i2c_devices));
  511. ret = davinci_cfg_reg_list(da830_evm_mcasp1_pins);
  512. if (ret)
  513. pr_warn("%s: mcasp1 mux setup failed: %d\n", __func__, ret);
  514. da8xx_register_mcasp(1, &da830_evm_snd_data);
  515. da830_evm_init_mmc();
  516. ret = da8xx_register_rtc();
  517. if (ret)
  518. pr_warn("%s: rtc setup failed: %d\n", __func__, ret);
  519. ret = spi_register_board_info(da830evm_spi_info,
  520. ARRAY_SIZE(da830evm_spi_info));
  521. if (ret)
  522. pr_warn("%s: spi info registration failed: %d\n",
  523. __func__, ret);
  524. ret = da8xx_register_spi_bus(0, ARRAY_SIZE(da830evm_spi_info));
  525. if (ret)
  526. pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret);
  527. regulator_has_full_constraints();
  528. }
  529. #ifdef CONFIG_SERIAL_8250_CONSOLE
  530. static int __init da830_evm_console_init(void)
  531. {
  532. if (!machine_is_davinci_da830_evm())
  533. return 0;
  534. return add_preferred_console("ttyS", 2, "115200");
  535. }
  536. console_initcall(da830_evm_console_init);
  537. #endif
  538. static void __init da830_evm_map_io(void)
  539. {
  540. da830_init();
  541. }
  542. MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
  543. .atag_offset = 0x100,
  544. .map_io = da830_evm_map_io,
  545. .init_irq = cp_intc_init,
  546. .init_time = davinci_timer_init,
  547. .init_machine = da830_evm_init,
  548. .init_late = davinci_init_late,
  549. .dma_zone_size = SZ_128M,
  550. .restart = da8xx_restart,
  551. MACHINE_END