beagle.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2004-2011
  4. * Texas Instruments, <www.ti.com>
  5. *
  6. * Author :
  7. * Sunil Kumar <sunilsaini05@gmail.com>
  8. * Shashi Ranjan <shashiranjanmca05@gmail.com>
  9. *
  10. * Derived from Beagle Board and 3430 SDP code by
  11. * Richard Woodruff <r-woodruff2@ti.com>
  12. * Syed Mohammed Khasim <khasim@ti.com>
  13. *
  14. */
  15. #include <common.h>
  16. #include <bootstage.h>
  17. #include <dm.h>
  18. #include <env.h>
  19. #include <net.h>
  20. #include <ns16550.h>
  21. #include <serial.h>
  22. #ifdef CONFIG_LED_STATUS
  23. #include <status_led.h>
  24. #endif
  25. #include <twl4030.h>
  26. #include <linux/mtd/rawnand.h>
  27. #include <asm/io.h>
  28. #include <asm/arch/mmc_host_def.h>
  29. #include <asm/arch/mux.h>
  30. #include <asm/arch/mem.h>
  31. #include <asm/arch/sys_proto.h>
  32. #include <asm/gpio.h>
  33. #include <asm/mach-types.h>
  34. #include <asm/omap_musb.h>
  35. #include <linux/errno.h>
  36. #include <linux/usb/ch9.h>
  37. #include <linux/usb/gadget.h>
  38. #include <linux/usb/musb.h>
  39. #include "beagle.h"
  40. #include <command.h>
  41. #ifdef CONFIG_USB_EHCI_HCD
  42. #include <usb.h>
  43. #include <asm/ehci-omap.h>
  44. #endif
  45. #define TWL4030_I2C_BUS 0
  46. #define EXPANSION_EEPROM_I2C_BUS 1
  47. #define EXPANSION_EEPROM_I2C_ADDRESS 0x50
  48. #define TINCANTOOLS_ZIPPY 0x01000100
  49. #define TINCANTOOLS_ZIPPY2 0x02000100
  50. #define TINCANTOOLS_TRAINER 0x04000100
  51. #define TINCANTOOLS_SHOWDOG 0x03000100
  52. #define KBADC_BEAGLEFPGA 0x01000600
  53. #define LW_BEAGLETOUCH 0x01000700
  54. #define BRAINMUX_LCDOG 0x01000800
  55. #define BRAINMUX_LCDOGTOUCH 0x02000800
  56. #define BBTOYS_WIFI 0x01000B00
  57. #define BBTOYS_VGA 0x02000B00
  58. #define BBTOYS_LCD 0x03000B00
  59. #define BCT_BRETTL3 0x01000F00
  60. #define BCT_BRETTL4 0x02000F00
  61. #define LSR_COM6L_ADPT 0x01001300
  62. #define BEAGLE_NO_EEPROM 0xffffffff
  63. DECLARE_GLOBAL_DATA_PTR;
  64. static struct {
  65. unsigned int device_vendor;
  66. unsigned char revision;
  67. unsigned char content;
  68. char fab_revision[8];
  69. char env_var[16];
  70. char env_setting[64];
  71. } expansion_config;
  72. /*
  73. * Routine: board_init
  74. * Description: Early hardware init.
  75. */
  76. int board_init(void)
  77. {
  78. gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
  79. /* board id for Linux */
  80. gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE;
  81. /* boot param addr */
  82. gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
  83. #if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
  84. status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON);
  85. #endif
  86. return 0;
  87. }
  88. #if defined(CONFIG_SPL_OS_BOOT)
  89. int spl_start_uboot(void)
  90. {
  91. /* break into full u-boot on 'c' */
  92. if (serial_tstc() && serial_getc() == 'c')
  93. return 1;
  94. return 0;
  95. }
  96. #endif /* CONFIG_SPL_OS_BOOT */
  97. /*
  98. * Routine: get_board_revision
  99. * Description: Detect if we are running on a Beagle revision Ax/Bx,
  100. * C1/2/3, C4, xM Ax/Bx or xM Cx. This can be done by reading
  101. * the level of GPIO173, GPIO172 and GPIO171. This should
  102. * result in
  103. * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx
  104. * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3
  105. * GPIO173, GPIO172, GPIO171: 1 0 1 => C4
  106. * GPIO173, GPIO172, GPIO171: 0 1 0 => xM Cx
  107. * GPIO173, GPIO172, GPIO171: 0 0 0 => xM Ax/Bx
  108. */
  109. static int get_board_revision(void)
  110. {
  111. static int revision = -1;
  112. if (revision == -1) {
  113. if (!gpio_request(171, "rev0") &&
  114. !gpio_request(172, "rev1") &&
  115. !gpio_request(173, "rev2")) {
  116. gpio_direction_input(171);
  117. gpio_direction_input(172);
  118. gpio_direction_input(173);
  119. revision = gpio_get_value(173) << 2 |
  120. gpio_get_value(172) << 1 |
  121. gpio_get_value(171);
  122. } else {
  123. printf("Error: unable to acquire board revision GPIOs\n");
  124. }
  125. }
  126. return revision;
  127. }
  128. #ifdef CONFIG_SPL_BUILD
  129. /*
  130. * Routine: get_board_mem_timings
  131. * Description: If we use SPL then there is no x-loader nor config header
  132. * so we have to setup the DDR timings ourself on both banks.
  133. */
  134. void get_board_mem_timings(struct board_sdrc_timings *timings)
  135. {
  136. int pop_mfr, pop_id;
  137. /*
  138. * We need to identify what PoP memory is on the board so that
  139. * we know what timings to use. If we can't identify it then
  140. * we know it's an xM. To map the ID values please see nand_ids.c
  141. */
  142. identify_nand_chip(&pop_mfr, &pop_id);
  143. timings->mr = MICRON_V_MR_165;
  144. switch (get_board_revision()) {
  145. case REVISION_C4:
  146. if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) {
  147. /* 512MB DDR */
  148. timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
  149. timings->ctrla = NUMONYX_V_ACTIMA_165;
  150. timings->ctrlb = NUMONYX_V_ACTIMB_165;
  151. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  152. break;
  153. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) {
  154. /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/
  155. timings->mcfg = MICRON_V_MCFG_165(128 << 20);
  156. timings->ctrla = MICRON_V_ACTIMA_165;
  157. timings->ctrlb = MICRON_V_ACTIMB_165;
  158. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  159. break;
  160. } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) {
  161. /* Beagleboard Rev C5, 256MB DDR */
  162. timings->mcfg = MICRON_V_MCFG_200(256 << 20);
  163. timings->ctrla = MICRON_V_ACTIMA_200;
  164. timings->ctrlb = MICRON_V_ACTIMB_200;
  165. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  166. break;
  167. }
  168. case REVISION_XM_AB:
  169. case REVISION_XM_C:
  170. if (pop_mfr == 0) {
  171. /* 256MB DDR */
  172. timings->mcfg = MICRON_V_MCFG_200(256 << 20);
  173. timings->ctrla = MICRON_V_ACTIMA_200;
  174. timings->ctrlb = MICRON_V_ACTIMB_200;
  175. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz;
  176. } else {
  177. /* 512MB DDR */
  178. timings->mcfg = NUMONYX_V_MCFG_165(512 << 20);
  179. timings->ctrla = NUMONYX_V_ACTIMA_165;
  180. timings->ctrlb = NUMONYX_V_ACTIMB_165;
  181. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  182. }
  183. break;
  184. default:
  185. /* Assume 128MB and Micron/165MHz timings to be safe */
  186. timings->mcfg = MICRON_V_MCFG_165(128 << 20);
  187. timings->ctrla = MICRON_V_ACTIMA_165;
  188. timings->ctrlb = MICRON_V_ACTIMB_165;
  189. timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz;
  190. }
  191. }
  192. #endif
  193. /*
  194. * Routine: get_expansion_id
  195. * Description: This function checks for expansion board by checking I2C
  196. * bus 1 for the availability of an AT24C01B serial EEPROM.
  197. * returns the device_vendor field from the EEPROM
  198. */
  199. static unsigned int get_expansion_id(void)
  200. {
  201. i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
  202. /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */
  203. if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
  204. i2c_set_bus_num(TWL4030_I2C_BUS);
  205. return BEAGLE_NO_EEPROM;
  206. }
  207. /* read configuration data */
  208. i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
  209. sizeof(expansion_config));
  210. /* retry reading configuration data with 16bit addressing */
  211. if ((expansion_config.device_vendor == 0xFFFFFF00) ||
  212. (expansion_config.device_vendor == 0xFFFFFFFF)) {
  213. printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n");
  214. i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config,
  215. sizeof(expansion_config));
  216. }
  217. i2c_set_bus_num(TWL4030_I2C_BUS);
  218. return expansion_config.device_vendor;
  219. }
  220. #ifdef CONFIG_VIDEO_OMAP3
  221. /*
  222. * Configure DSS to display background color on DVID
  223. * Configure VENC to display color bar on S-Video
  224. */
  225. static void beagle_display_init(void)
  226. {
  227. omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
  228. switch (get_board_revision()) {
  229. case REVISION_AXBX:
  230. case REVISION_CX:
  231. case REVISION_C4:
  232. omap3_dss_panel_config(&dvid_cfg);
  233. break;
  234. case REVISION_XM_AB:
  235. case REVISION_XM_C:
  236. default:
  237. omap3_dss_panel_config(&dvid_cfg_xm);
  238. break;
  239. }
  240. }
  241. /*
  242. * Enable DVI power
  243. */
  244. static void beagle_dvi_pup(void)
  245. {
  246. uchar val;
  247. switch (get_board_revision()) {
  248. case REVISION_AXBX:
  249. case REVISION_CX:
  250. case REVISION_C4:
  251. gpio_request(170, "dvi");
  252. gpio_direction_output(170, 0);
  253. gpio_set_value(170, 1);
  254. break;
  255. case REVISION_XM_AB:
  256. case REVISION_XM_C:
  257. default:
  258. #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3)
  259. #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
  260. i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  261. val |= 4;
  262. i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
  263. i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  264. val |= 4;
  265. i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1);
  266. break;
  267. }
  268. }
  269. #endif
  270. #ifdef CONFIG_USB_MUSB_OMAP2PLUS
  271. static struct musb_hdrc_config musb_config = {
  272. .multipoint = 1,
  273. .dyn_fifo = 1,
  274. .num_eps = 16,
  275. .ram_bits = 12,
  276. };
  277. static struct omap_musb_board_data musb_board_data = {
  278. .interface_type = MUSB_INTERFACE_ULPI,
  279. };
  280. static struct musb_hdrc_platform_data musb_plat = {
  281. #if defined(CONFIG_USB_MUSB_HOST)
  282. .mode = MUSB_HOST,
  283. #elif defined(CONFIG_USB_MUSB_GADGET)
  284. .mode = MUSB_PERIPHERAL,
  285. #else
  286. #error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET"
  287. #endif
  288. .config = &musb_config,
  289. .power = 100,
  290. .platform_ops = &omap2430_ops,
  291. .board_data = &musb_board_data,
  292. };
  293. #endif
  294. /*
  295. * Routine: misc_init_r
  296. * Description: Configure board specific parts
  297. */
  298. int misc_init_r(void)
  299. {
  300. struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
  301. struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
  302. struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
  303. bool generate_fake_mac = false;
  304. u32 value;
  305. /* Enable i2c2 pullup resisters */
  306. value = readl(&prog_io_base->io1);
  307. value &= ~(PRG_I2C2_PULLUPRESX);
  308. writel(value, &prog_io_base->io1);
  309. switch (get_board_revision()) {
  310. case REVISION_AXBX:
  311. printf("Beagle Rev Ax/Bx\n");
  312. env_set("beaglerev", "AxBx");
  313. break;
  314. case REVISION_CX:
  315. printf("Beagle Rev C1/C2/C3\n");
  316. env_set("beaglerev", "Cx");
  317. MUX_BEAGLE_C();
  318. break;
  319. case REVISION_C4:
  320. printf("Beagle Rev C4\n");
  321. env_set("beaglerev", "C4");
  322. MUX_BEAGLE_C();
  323. /* Set VAUX2 to 1.8V for EHCI PHY */
  324. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  325. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  326. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  327. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  328. break;
  329. case REVISION_XM_AB:
  330. printf("Beagle xM Rev A/B\n");
  331. env_set("beaglerev", "xMAB");
  332. MUX_BEAGLE_XM();
  333. /* Set VAUX2 to 1.8V for EHCI PHY */
  334. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  335. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  336. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  337. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  338. generate_fake_mac = true;
  339. break;
  340. case REVISION_XM_C:
  341. printf("Beagle xM Rev C\n");
  342. env_set("beaglerev", "xMC");
  343. MUX_BEAGLE_XM();
  344. /* Set VAUX2 to 1.8V for EHCI PHY */
  345. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  346. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  347. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  348. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  349. generate_fake_mac = true;
  350. break;
  351. default:
  352. printf("Beagle unknown 0x%02x\n", get_board_revision());
  353. MUX_BEAGLE_XM();
  354. /* Set VAUX2 to 1.8V for EHCI PHY */
  355. twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
  356. TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
  357. TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
  358. TWL4030_PM_RECEIVER_DEV_GRP_P1);
  359. generate_fake_mac = true;
  360. }
  361. switch (get_expansion_id()) {
  362. case TINCANTOOLS_ZIPPY:
  363. printf("Recognized Tincantools Zippy board (rev %d %s)\n",
  364. expansion_config.revision,
  365. expansion_config.fab_revision);
  366. MUX_TINCANTOOLS_ZIPPY();
  367. env_set("buddy", "zippy");
  368. break;
  369. case TINCANTOOLS_ZIPPY2:
  370. printf("Recognized Tincantools Zippy2 board (rev %d %s)\n",
  371. expansion_config.revision,
  372. expansion_config.fab_revision);
  373. MUX_TINCANTOOLS_ZIPPY();
  374. env_set("buddy", "zippy2");
  375. break;
  376. case TINCANTOOLS_TRAINER:
  377. printf("Recognized Tincantools Trainer board (rev %d %s)\n",
  378. expansion_config.revision,
  379. expansion_config.fab_revision);
  380. MUX_TINCANTOOLS_ZIPPY();
  381. MUX_TINCANTOOLS_TRAINER();
  382. env_set("buddy", "trainer");
  383. break;
  384. case TINCANTOOLS_SHOWDOG:
  385. printf("Recognized Tincantools Showdow board (rev %d %s)\n",
  386. expansion_config.revision,
  387. expansion_config.fab_revision);
  388. /* Place holder for DSS2 definition for showdog lcd */
  389. env_set("defaultdisplay", "showdoglcd");
  390. env_set("buddy", "showdog");
  391. break;
  392. case KBADC_BEAGLEFPGA:
  393. printf("Recognized KBADC Beagle FPGA board\n");
  394. MUX_KBADC_BEAGLEFPGA();
  395. env_set("buddy", "beaglefpga");
  396. break;
  397. case LW_BEAGLETOUCH:
  398. printf("Recognized Liquidware BeagleTouch board\n");
  399. env_set("buddy", "beagletouch");
  400. break;
  401. case BRAINMUX_LCDOG:
  402. printf("Recognized Brainmux LCDog board\n");
  403. env_set("buddy", "lcdog");
  404. break;
  405. case BRAINMUX_LCDOGTOUCH:
  406. printf("Recognized Brainmux LCDog Touch board\n");
  407. env_set("buddy", "lcdogtouch");
  408. break;
  409. case BBTOYS_WIFI:
  410. printf("Recognized BeagleBoardToys WiFi board\n");
  411. MUX_BBTOYS_WIFI()
  412. env_set("buddy", "bbtoys-wifi");
  413. break;
  414. case BBTOYS_VGA:
  415. printf("Recognized BeagleBoardToys VGA board\n");
  416. break;
  417. case BBTOYS_LCD:
  418. printf("Recognized BeagleBoardToys LCD board\n");
  419. break;
  420. case BCT_BRETTL3:
  421. printf("Recognized bct electronic GmbH brettl3 board\n");
  422. break;
  423. case BCT_BRETTL4:
  424. printf("Recognized bct electronic GmbH brettl4 board\n");
  425. break;
  426. case LSR_COM6L_ADPT:
  427. printf("Recognized LSR COM6L Adapter Board\n");
  428. MUX_BBTOYS_WIFI()
  429. env_set("buddy", "lsr-com6l-adpt");
  430. break;
  431. case BEAGLE_NO_EEPROM:
  432. printf("No EEPROM on expansion board\n");
  433. env_set("buddy", "none");
  434. break;
  435. default:
  436. printf("Unrecognized expansion board: %x\n",
  437. expansion_config.device_vendor);
  438. env_set("buddy", "unknown");
  439. }
  440. if (expansion_config.content == 1)
  441. env_set(expansion_config.env_var, expansion_config.env_setting);
  442. twl4030_power_init();
  443. switch (get_board_revision()) {
  444. case REVISION_XM_AB:
  445. twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
  446. break;
  447. default:
  448. twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
  449. break;
  450. }
  451. /* Set GPIO states before they are made outputs */
  452. writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1,
  453. &gpio6_base->setdataout);
  454. writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  455. GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);
  456. /* Configure GPIOs to output */
  457. writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe);
  458. writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 |
  459. GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe);
  460. omap_die_id_display();
  461. #ifdef CONFIG_VIDEO_OMAP3
  462. beagle_dvi_pup();
  463. beagle_display_init();
  464. omap3_dss_enable();
  465. #endif
  466. #ifdef CONFIG_USB_MUSB_OMAP2PLUS
  467. musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE);
  468. #endif
  469. if (generate_fake_mac)
  470. omap_die_id_usbethaddr();
  471. #if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT)
  472. if (strlen(CONFIG_MTDIDS_DEFAULT))
  473. env_set("mtdids", CONFIG_MTDIDS_DEFAULT);
  474. if (strlen(CONFIG_MTDPARTS_DEFAULT))
  475. env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT);
  476. #endif
  477. return 0;
  478. }
  479. /*
  480. * Routine: set_muxconf_regs
  481. * Description: Setting up the configuration Mux registers specific to the
  482. * hardware. Many pins need to be moved from protect to primary
  483. * mode.
  484. */
  485. void set_muxconf_regs(void)
  486. {
  487. MUX_BEAGLE();
  488. }
  489. #if defined(CONFIG_MMC)
  490. int board_mmc_init(bd_t *bis)
  491. {
  492. return omap_mmc_init(0, 0, 0, -1, -1);
  493. }
  494. #endif
  495. #if defined(CONFIG_MMC)
  496. void board_mmc_power_init(void)
  497. {
  498. twl4030_power_mmc_init(0);
  499. }
  500. #endif
  501. #if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD)
  502. /* Call usb_stop() before starting the kernel */
  503. void show_boot_progress(int val)
  504. {
  505. if (val == BOOTSTAGE_ID_RUN_OS)
  506. usb_stop();
  507. }
  508. static struct omap_usbhs_board_data usbhs_bdata = {
  509. .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
  510. .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
  511. .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
  512. };
  513. int ehci_hcd_init(int index, enum usb_init_type init,
  514. struct ehci_hccr **hccr, struct ehci_hcor **hcor)
  515. {
  516. return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
  517. }
  518. int ehci_hcd_stop(int index)
  519. {
  520. return omap_ehci_hcd_stop();
  521. }
  522. #endif /* CONFIG_USB_EHCI_HCD */
  523. #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET)
  524. int board_eth_init(bd_t *bis)
  525. {
  526. return usb_eth_initialize(bis);
  527. }
  528. #endif