board-da850-evm.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. /*
  2. * TI DA850/OMAP-L138 EVM board
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * Derived from: arch/arm/mach-davinci/board-da830-evm.c
  7. * Original Copyrights follow:
  8. *
  9. * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
  10. * the terms of the GNU General Public License version 2. This program
  11. * is licensed "as is" without any warranty of any kind, whether express
  12. * or implied.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/console.h>
  17. #include <linux/i2c.h>
  18. #include <linux/i2c/at24.h>
  19. #include <linux/i2c/pca953x.h>
  20. #include <linux/mfd/tps6507x.h>
  21. #include <linux/gpio.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/nand.h>
  25. #include <linux/mtd/partitions.h>
  26. #include <linux/mtd/physmap.h>
  27. #include <linux/regulator/machine.h>
  28. #include <linux/mfd/tps6507x.h>
  29. #include <linux/input/tps6507x-ts.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <mach/cp_intc.h>
  33. #include <mach/da8xx.h>
  34. #include <mach/nand.h>
  35. #include <mach/mux.h>
  36. #define DA850_EVM_PHY_MASK 0x1
  37. #define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
  38. #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
  39. #define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
  40. #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
  41. #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
  42. #define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
  43. static struct mtd_partition da850_evm_norflash_partition[] = {
  44. {
  45. .name = "bootloaders + env",
  46. .offset = 0,
  47. .size = SZ_512K,
  48. .mask_flags = MTD_WRITEABLE,
  49. },
  50. {
  51. .name = "kernel",
  52. .offset = MTDPART_OFS_APPEND,
  53. .size = SZ_2M,
  54. .mask_flags = 0,
  55. },
  56. {
  57. .name = "filesystem",
  58. .offset = MTDPART_OFS_APPEND,
  59. .size = MTDPART_SIZ_FULL,
  60. .mask_flags = 0,
  61. },
  62. };
  63. static struct physmap_flash_data da850_evm_norflash_data = {
  64. .width = 2,
  65. .parts = da850_evm_norflash_partition,
  66. .nr_parts = ARRAY_SIZE(da850_evm_norflash_partition),
  67. };
  68. static struct resource da850_evm_norflash_resource[] = {
  69. {
  70. .start = DA8XX_AEMIF_CS2_BASE,
  71. .end = DA8XX_AEMIF_CS2_BASE + SZ_32M - 1,
  72. .flags = IORESOURCE_MEM,
  73. },
  74. };
  75. static struct platform_device da850_evm_norflash_device = {
  76. .name = "physmap-flash",
  77. .id = 0,
  78. .dev = {
  79. .platform_data = &da850_evm_norflash_data,
  80. },
  81. .num_resources = 1,
  82. .resource = da850_evm_norflash_resource,
  83. };
  84. static struct davinci_pm_config da850_pm_pdata = {
  85. .sleepcount = 128,
  86. };
  87. static struct platform_device da850_pm_device = {
  88. .name = "pm-davinci",
  89. .dev = {
  90. .platform_data = &da850_pm_pdata,
  91. },
  92. .id = -1,
  93. };
  94. /* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash
  95. * (128K blocks). It may be used instead of the (default) SPI flash
  96. * to boot, using TI's tools to install the secondary boot loader
  97. * (UBL) and U-Boot.
  98. */
  99. struct mtd_partition da850_evm_nandflash_partition[] = {
  100. {
  101. .name = "u-boot env",
  102. .offset = 0,
  103. .size = SZ_128K,
  104. .mask_flags = MTD_WRITEABLE,
  105. },
  106. {
  107. .name = "UBL",
  108. .offset = MTDPART_OFS_APPEND,
  109. .size = SZ_128K,
  110. .mask_flags = MTD_WRITEABLE,
  111. },
  112. {
  113. .name = "u-boot",
  114. .offset = MTDPART_OFS_APPEND,
  115. .size = 4 * SZ_128K,
  116. .mask_flags = MTD_WRITEABLE,
  117. },
  118. {
  119. .name = "kernel",
  120. .offset = 0x200000,
  121. .size = SZ_2M,
  122. .mask_flags = 0,
  123. },
  124. {
  125. .name = "filesystem",
  126. .offset = MTDPART_OFS_APPEND,
  127. .size = MTDPART_SIZ_FULL,
  128. .mask_flags = 0,
  129. },
  130. };
  131. static struct davinci_nand_pdata da850_evm_nandflash_data = {
  132. .parts = da850_evm_nandflash_partition,
  133. .nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
  134. .ecc_mode = NAND_ECC_HW,
  135. .ecc_bits = 4,
  136. .options = NAND_USE_FLASH_BBT,
  137. };
  138. static struct resource da850_evm_nandflash_resource[] = {
  139. {
  140. .start = DA8XX_AEMIF_CS3_BASE,
  141. .end = DA8XX_AEMIF_CS3_BASE + SZ_512K + 2 * SZ_1K - 1,
  142. .flags = IORESOURCE_MEM,
  143. },
  144. {
  145. .start = DA8XX_AEMIF_CTL_BASE,
  146. .end = DA8XX_AEMIF_CTL_BASE + SZ_32K - 1,
  147. .flags = IORESOURCE_MEM,
  148. },
  149. };
  150. static struct platform_device da850_evm_nandflash_device = {
  151. .name = "davinci_nand",
  152. .id = 1,
  153. .dev = {
  154. .platform_data = &da850_evm_nandflash_data,
  155. },
  156. .num_resources = ARRAY_SIZE(da850_evm_nandflash_resource),
  157. .resource = da850_evm_nandflash_resource,
  158. };
  159. static struct platform_device *da850_evm_devices[] __initdata = {
  160. &da850_evm_nandflash_device,
  161. &da850_evm_norflash_device,
  162. };
  163. #define DA8XX_AEMIF_CE2CFG_OFFSET 0x10
  164. #define DA8XX_AEMIF_ASIZE_16BIT 0x1
  165. static void __init da850_evm_init_nor(void)
  166. {
  167. void __iomem *aemif_addr;
  168. aemif_addr = ioremap(DA8XX_AEMIF_CTL_BASE, SZ_32K);
  169. /* Configure data bus width of CS2 to 16 bit */
  170. writel(readl(aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET) |
  171. DA8XX_AEMIF_ASIZE_16BIT,
  172. aemif_addr + DA8XX_AEMIF_CE2CFG_OFFSET);
  173. iounmap(aemif_addr);
  174. }
  175. static u32 ui_card_detected;
  176. #if defined(CONFIG_MMC_DAVINCI) || \
  177. defined(CONFIG_MMC_DAVINCI_MODULE)
  178. #define HAS_MMC 1
  179. #else
  180. #define HAS_MMC 0
  181. #endif
  182. static __init void da850_evm_setup_nor_nand(void)
  183. {
  184. int ret = 0;
  185. if (ui_card_detected & !HAS_MMC) {
  186. ret = davinci_cfg_reg_list(da850_nand_pins);
  187. if (ret)
  188. pr_warning("da850_evm_init: nand mux setup failed: "
  189. "%d\n", ret);
  190. ret = davinci_cfg_reg_list(da850_nor_pins);
  191. if (ret)
  192. pr_warning("da850_evm_init: nor mux setup failed: %d\n",
  193. ret);
  194. da850_evm_init_nor();
  195. platform_add_devices(da850_evm_devices,
  196. ARRAY_SIZE(da850_evm_devices));
  197. }
  198. }
  199. #ifdef CONFIG_DA850_UI_RMII
  200. static inline void da850_evm_setup_emac_rmii(int rmii_sel)
  201. {
  202. struct davinci_soc_info *soc_info = &davinci_soc_info;
  203. soc_info->emac_pdata->rmii_en = 1;
  204. gpio_set_value(rmii_sel, 0);
  205. }
  206. #else
  207. static inline void da850_evm_setup_emac_rmii(int rmii_sel) { }
  208. #endif
  209. static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio,
  210. unsigned ngpio, void *c)
  211. {
  212. int sel_a, sel_b, sel_c, ret;
  213. sel_a = gpio + 7;
  214. sel_b = gpio + 6;
  215. sel_c = gpio + 5;
  216. ret = gpio_request(sel_a, "sel_a");
  217. if (ret) {
  218. pr_warning("Cannot open UI expander pin %d\n", sel_a);
  219. goto exp_setup_sela_fail;
  220. }
  221. ret = gpio_request(sel_b, "sel_b");
  222. if (ret) {
  223. pr_warning("Cannot open UI expander pin %d\n", sel_b);
  224. goto exp_setup_selb_fail;
  225. }
  226. ret = gpio_request(sel_c, "sel_c");
  227. if (ret) {
  228. pr_warning("Cannot open UI expander pin %d\n", sel_c);
  229. goto exp_setup_selc_fail;
  230. }
  231. /* deselect all functionalities */
  232. gpio_direction_output(sel_a, 1);
  233. gpio_direction_output(sel_b, 1);
  234. gpio_direction_output(sel_c, 1);
  235. ui_card_detected = 1;
  236. pr_info("DA850/OMAP-L138 EVM UI card detected\n");
  237. da850_evm_setup_nor_nand();
  238. da850_evm_setup_emac_rmii(sel_a);
  239. return 0;
  240. exp_setup_selc_fail:
  241. gpio_free(sel_b);
  242. exp_setup_selb_fail:
  243. gpio_free(sel_a);
  244. exp_setup_sela_fail:
  245. return ret;
  246. }
  247. static int da850_evm_ui_expander_teardown(struct i2c_client *client,
  248. unsigned gpio, unsigned ngpio, void *c)
  249. {
  250. /* deselect all functionalities */
  251. gpio_set_value(gpio + 5, 1);
  252. gpio_set_value(gpio + 6, 1);
  253. gpio_set_value(gpio + 7, 1);
  254. gpio_free(gpio + 5);
  255. gpio_free(gpio + 6);
  256. gpio_free(gpio + 7);
  257. return 0;
  258. }
  259. static struct pca953x_platform_data da850_evm_ui_expander_info = {
  260. .gpio_base = DAVINCI_N_GPIO,
  261. .setup = da850_evm_ui_expander_setup,
  262. .teardown = da850_evm_ui_expander_teardown,
  263. };
  264. static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
  265. {
  266. I2C_BOARD_INFO("tlv320aic3x", 0x18),
  267. },
  268. {
  269. I2C_BOARD_INFO("tca6416", 0x20),
  270. .platform_data = &da850_evm_ui_expander_info,
  271. },
  272. };
  273. static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
  274. .bus_freq = 100, /* kHz */
  275. .bus_delay = 0, /* usec */
  276. };
  277. static struct davinci_uart_config da850_evm_uart_config __initdata = {
  278. .enabled_uarts = 0x7,
  279. };
  280. /* davinci da850 evm audio machine driver */
  281. static u8 da850_iis_serializer_direction[] = {
  282. INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
  283. INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
  284. INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, TX_MODE,
  285. RX_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
  286. };
  287. static struct snd_platform_data da850_evm_snd_data = {
  288. .tx_dma_offset = 0x2000,
  289. .rx_dma_offset = 0x2000,
  290. .op_mode = DAVINCI_MCASP_IIS_MODE,
  291. .num_serializer = ARRAY_SIZE(da850_iis_serializer_direction),
  292. .tdm_slots = 2,
  293. .serial_dir = da850_iis_serializer_direction,
  294. .eventq_no = EVENTQ_1,
  295. .version = MCASP_VERSION_2,
  296. .txnumevt = 1,
  297. .rxnumevt = 1,
  298. };
  299. static int da850_evm_mmc_get_ro(int index)
  300. {
  301. return gpio_get_value(DA850_MMCSD_WP_PIN);
  302. }
  303. static int da850_evm_mmc_get_cd(int index)
  304. {
  305. return !gpio_get_value(DA850_MMCSD_CD_PIN);
  306. }
  307. static struct davinci_mmc_config da850_mmc_config = {
  308. .get_ro = da850_evm_mmc_get_ro,
  309. .get_cd = da850_evm_mmc_get_cd,
  310. .wires = 4,
  311. .max_freq = 50000000,
  312. .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
  313. .version = MMC_CTLR_VERSION_2,
  314. };
  315. static void da850_panel_power_ctrl(int val)
  316. {
  317. /* lcd backlight */
  318. gpio_set_value(DA850_LCD_BL_PIN, val);
  319. /* lcd power */
  320. gpio_set_value(DA850_LCD_PWR_PIN, val);
  321. }
  322. static int da850_lcd_hw_init(void)
  323. {
  324. int status;
  325. status = gpio_request(DA850_LCD_BL_PIN, "lcd bl\n");
  326. if (status < 0)
  327. return status;
  328. status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr\n");
  329. if (status < 0) {
  330. gpio_free(DA850_LCD_BL_PIN);
  331. return status;
  332. }
  333. gpio_direction_output(DA850_LCD_BL_PIN, 0);
  334. gpio_direction_output(DA850_LCD_PWR_PIN, 0);
  335. /* Switch off panel power and backlight */
  336. da850_panel_power_ctrl(0);
  337. /* Switch on panel power and backlight */
  338. da850_panel_power_ctrl(1);
  339. return 0;
  340. }
  341. /* TPS65070 voltage regulator support */
  342. /* 3.3V */
  343. struct regulator_consumer_supply tps65070_dcdc1_consumers[] = {
  344. {
  345. .supply = "usb0_vdda33",
  346. },
  347. {
  348. .supply = "usb1_vdda33",
  349. },
  350. };
  351. /* 3.3V or 1.8V */
  352. struct regulator_consumer_supply tps65070_dcdc2_consumers[] = {
  353. {
  354. .supply = "dvdd3318_a",
  355. },
  356. {
  357. .supply = "dvdd3318_b",
  358. },
  359. {
  360. .supply = "dvdd3318_c",
  361. },
  362. };
  363. /* 1.2V */
  364. struct regulator_consumer_supply tps65070_dcdc3_consumers[] = {
  365. {
  366. .supply = "cvdd",
  367. },
  368. };
  369. /* 1.8V LDO */
  370. struct regulator_consumer_supply tps65070_ldo1_consumers[] = {
  371. {
  372. .supply = "sata_vddr",
  373. },
  374. {
  375. .supply = "usb0_vdda18",
  376. },
  377. {
  378. .supply = "usb1_vdda18",
  379. },
  380. {
  381. .supply = "ddr_dvdd18",
  382. },
  383. };
  384. /* 1.2V LDO */
  385. struct regulator_consumer_supply tps65070_ldo2_consumers[] = {
  386. {
  387. .supply = "sata_vdd",
  388. },
  389. {
  390. .supply = "pll0_vdda",
  391. },
  392. {
  393. .supply = "pll1_vdda",
  394. },
  395. {
  396. .supply = "usbs_cvdd",
  397. },
  398. {
  399. .supply = "vddarnwa1",
  400. },
  401. };
  402. struct regulator_init_data tps65070_regulator_data[] = {
  403. /* dcdc1 */
  404. {
  405. .constraints = {
  406. .min_uV = 3150000,
  407. .max_uV = 3450000,
  408. .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
  409. REGULATOR_CHANGE_STATUS),
  410. .boot_on = 1,
  411. },
  412. .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc1_consumers),
  413. .consumer_supplies = tps65070_dcdc1_consumers,
  414. },
  415. /* dcdc2 */
  416. {
  417. .constraints = {
  418. .min_uV = 1710000,
  419. .max_uV = 3450000,
  420. .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
  421. REGULATOR_CHANGE_STATUS),
  422. .boot_on = 1,
  423. },
  424. .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers),
  425. .consumer_supplies = tps65070_dcdc2_consumers,
  426. },
  427. /* dcdc3 */
  428. {
  429. .constraints = {
  430. .min_uV = 950000,
  431. .max_uV = 1320000,
  432. .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
  433. REGULATOR_CHANGE_STATUS),
  434. .boot_on = 1,
  435. },
  436. .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers),
  437. .consumer_supplies = tps65070_dcdc3_consumers,
  438. },
  439. /* ldo1 */
  440. {
  441. .constraints = {
  442. .min_uV = 1710000,
  443. .max_uV = 1890000,
  444. .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
  445. REGULATOR_CHANGE_STATUS),
  446. .boot_on = 1,
  447. },
  448. .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo1_consumers),
  449. .consumer_supplies = tps65070_ldo1_consumers,
  450. },
  451. /* ldo2 */
  452. {
  453. .constraints = {
  454. .min_uV = 1140000,
  455. .max_uV = 1320000,
  456. .valid_ops_mask = (REGULATOR_CHANGE_VOLTAGE |
  457. REGULATOR_CHANGE_STATUS),
  458. .boot_on = 1,
  459. },
  460. .num_consumer_supplies = ARRAY_SIZE(tps65070_ldo2_consumers),
  461. .consumer_supplies = tps65070_ldo2_consumers,
  462. },
  463. };
  464. static struct touchscreen_init_data tps6507x_touchscreen_data = {
  465. .poll_period = 30, /* ms between touch samples */
  466. .min_pressure = 0x30, /* minimum pressure to trigger touch */
  467. .vref = 0, /* turn off vref when not using A/D */
  468. .vendor = 0, /* /sys/class/input/input?/id/vendor */
  469. .product = 65070, /* /sys/class/input/input?/id/product */
  470. .version = 0x100, /* /sys/class/input/input?/id/version */
  471. };
  472. static struct tps6507x_board tps_board = {
  473. .tps6507x_pmic_init_data = &tps65070_regulator_data[0],
  474. .tps6507x_ts_init_data = &tps6507x_touchscreen_data,
  475. };
  476. static struct i2c_board_info __initdata da850evm_tps65070_info[] = {
  477. {
  478. I2C_BOARD_INFO("tps6507x", 0x48),
  479. .platform_data = &tps_board,
  480. },
  481. };
  482. static int __init pmic_tps65070_init(void)
  483. {
  484. return i2c_register_board_info(1, da850evm_tps65070_info,
  485. ARRAY_SIZE(da850evm_tps65070_info));
  486. }
  487. static const short da850_evm_lcdc_pins[] = {
  488. DA850_GPIO2_8, DA850_GPIO2_15,
  489. -1
  490. };
  491. static int __init da850_evm_config_emac(void)
  492. {
  493. void __iomem *cfg_chip3_base;
  494. int ret;
  495. u32 val;
  496. struct davinci_soc_info *soc_info = &davinci_soc_info;
  497. u8 rmii_en = soc_info->emac_pdata->rmii_en;
  498. if (!machine_is_davinci_da850_evm())
  499. return 0;
  500. cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG);
  501. val = __raw_readl(cfg_chip3_base);
  502. if (rmii_en) {
  503. val |= BIT(8);
  504. ret = davinci_cfg_reg_list(da850_rmii_pins);
  505. pr_info("EMAC: RMII PHY configured, MII PHY will not be"
  506. " functional\n");
  507. } else {
  508. val &= ~BIT(8);
  509. ret = davinci_cfg_reg_list(da850_cpgmac_pins);
  510. pr_info("EMAC: MII PHY configured, RMII PHY will not be"
  511. " functional\n");
  512. }
  513. if (ret)
  514. pr_warning("da850_evm_init: cpgmac/rmii mux setup failed: %d\n",
  515. ret);
  516. /* configure the CFGCHIP3 register for RMII or MII */
  517. __raw_writel(val, cfg_chip3_base);
  518. ret = davinci_cfg_reg(DA850_GPIO2_6);
  519. if (ret)
  520. pr_warning("da850_evm_init:GPIO(2,6) mux setup "
  521. "failed\n");
  522. ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
  523. if (ret) {
  524. pr_warning("Cannot open GPIO %d\n",
  525. DA850_MII_MDIO_CLKEN_PIN);
  526. return ret;
  527. }
  528. /* Enable/Disable MII MDIO clock */
  529. gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
  530. soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
  531. soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
  532. ret = da8xx_register_emac();
  533. if (ret)
  534. pr_warning("da850_evm_init: emac registration failed: %d\n",
  535. ret);
  536. return 0;
  537. }
  538. device_initcall(da850_evm_config_emac);
  539. static __init void da850_evm_init(void)
  540. {
  541. int ret;
  542. ret = pmic_tps65070_init();
  543. if (ret)
  544. pr_warning("da850_evm_init: TPS65070 PMIC init failed: %d\n",
  545. ret);
  546. ret = da8xx_register_edma();
  547. if (ret)
  548. pr_warning("da850_evm_init: edma registration failed: %d\n",
  549. ret);
  550. ret = davinci_cfg_reg_list(da850_i2c0_pins);
  551. if (ret)
  552. pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
  553. ret);
  554. ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
  555. if (ret)
  556. pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
  557. ret);
  558. ret = da8xx_register_watchdog();
  559. if (ret)
  560. pr_warning("da830_evm_init: watchdog registration failed: %d\n",
  561. ret);
  562. if (HAS_MMC) {
  563. ret = davinci_cfg_reg_list(da850_mmcsd0_pins);
  564. if (ret)
  565. pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
  566. " %d\n", ret);
  567. ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
  568. if (ret)
  569. pr_warning("da850_evm_init: can not open GPIO %d\n",
  570. DA850_MMCSD_CD_PIN);
  571. gpio_direction_input(DA850_MMCSD_CD_PIN);
  572. ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
  573. if (ret)
  574. pr_warning("da850_evm_init: can not open GPIO %d\n",
  575. DA850_MMCSD_WP_PIN);
  576. gpio_direction_input(DA850_MMCSD_WP_PIN);
  577. ret = da8xx_register_mmcsd0(&da850_mmc_config);
  578. if (ret)
  579. pr_warning("da850_evm_init: mmcsd0 registration failed:"
  580. " %d\n", ret);
  581. }
  582. davinci_serial_init(&da850_evm_uart_config);
  583. i2c_register_board_info(1, da850_evm_i2c_devices,
  584. ARRAY_SIZE(da850_evm_i2c_devices));
  585. /*
  586. * shut down uart 0 and 1; they are not used on the board and
  587. * accessing them causes endless "too much work in irq53" messages
  588. * with arago fs
  589. */
  590. __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
  591. __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
  592. ret = davinci_cfg_reg_list(da850_mcasp_pins);
  593. if (ret)
  594. pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
  595. ret);
  596. da8xx_register_mcasp(0, &da850_evm_snd_data);
  597. ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
  598. if (ret)
  599. pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
  600. ret);
  601. /* Handle board specific muxing for LCD here */
  602. ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
  603. if (ret)
  604. pr_warning("da850_evm_init: evm specific lcd mux setup "
  605. "failed: %d\n", ret);
  606. ret = da850_lcd_hw_init();
  607. if (ret)
  608. pr_warning("da850_evm_init: lcd initialization failed: %d\n",
  609. ret);
  610. sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl,
  611. ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata);
  612. if (ret)
  613. pr_warning("da850_evm_init: lcdc registration failed: %d\n",
  614. ret);
  615. ret = da8xx_register_rtc();
  616. if (ret)
  617. pr_warning("da850_evm_init: rtc setup failed: %d\n", ret);
  618. ret = da850_register_cpufreq();
  619. if (ret)
  620. pr_warning("da850_evm_init: cpufreq registration failed: %d\n",
  621. ret);
  622. ret = da8xx_register_cpuidle();
  623. if (ret)
  624. pr_warning("da850_evm_init: cpuidle registration failed: %d\n",
  625. ret);
  626. ret = da850_register_pm(&da850_pm_device);
  627. if (ret)
  628. pr_warning("da850_evm_init: suspend registration failed: %d\n",
  629. ret);
  630. }
  631. #ifdef CONFIG_SERIAL_8250_CONSOLE
  632. static int __init da850_evm_console_init(void)
  633. {
  634. return add_preferred_console("ttyS", 2, "115200");
  635. }
  636. console_initcall(da850_evm_console_init);
  637. #endif
  638. static void __init da850_evm_map_io(void)
  639. {
  640. da850_init();
  641. }
  642. MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM")
  643. .phys_io = IO_PHYS,
  644. .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
  645. .boot_params = (DA8XX_DDR_BASE + 0x100),
  646. .map_io = da850_evm_map_io,
  647. .init_irq = cp_intc_init,
  648. .timer = &davinci_timer,
  649. .init_machine = da850_evm_init,
  650. MACHINE_END