board-da830-evm.c 16 KB

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