beagle.c 15 KB

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