diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 5f2d4dfab8c5..09d7f3ff17a9 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -585,6 +585,26 @@ int spl_start_uboot(void) #endif #ifdef CONFIG_USB_DWC3 +static struct dwc3_device usb_otg_ss1 = { + .maximum_speed = USB_SPEED_SUPER, + .base = DRA7_USB_OTG_SS1_BASE, + .tx_fifo_resize = false, + .index = 0, +}; + +static struct dwc3_omap_device usb_otg_ss1_glue = { + .base = (void *)DRA7_USB_OTG_SS1_GLUE_BASE, + .utmi_mode = DWC3_OMAP_UTMI_MODE_SW, + .index = 0, +}; + +static struct ti_usb_phy_device usb_phy1_device = { + .pll_ctrl_base = (void *)DRA7_USB3_PHY1_PLL_CTRL, + .usb2_phy_power = (void *)DRA7_USB2_PHY1_POWER, + .usb3_phy_power = (void *)DRA7_USB3_PHY1_POWER, + .index = 0, +}; + static struct dwc3_device usb_otg_ss2 = { .maximum_speed = USB_SPEED_HIGH, .base = DRA7_USB_OTG_SS2_BASE, @@ -622,9 +642,13 @@ int board_usb_init(int index, enum usb_init_type init) switch (index) { case 0: if (init == USB_INIT_DEVICE) { - printf("port %d can't be used as device\n", index); - disable_usb_clocks(index); - return -EINVAL; +#ifdef CONFIG_USB_DWC3 + usb_otg_ss1.dr_mode = USB_DR_MODE_PERIPHERAL; + usb_otg_ss1_glue.vbus_id_status = OMAP_DWC3_VBUS_VALID; + ti_usb_phy_uboot_init(&usb_phy1_device); + dwc3_omap_uboot_init(&usb_otg_ss1_glue); + dwc3_uboot_init(&usb_otg_ss1); +#endif } break; case 1: