board-da830-evm.c 15 KB

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