diff --git a/board/emcraft/imx8m_som/imx8m_som.c b/board/emcraft/imx8m_som/imx8m_som.c index 1ad2c0f04259bb896ba10d521443b5be89b92810..fe6c06c70058c49a9973ef5fded797b4fe8c340c 100644 --- a/board/emcraft/imx8m_som/imx8m_som.c +++ b/board/emcraft/imx8m_som/imx8m_som.c @@ -145,7 +145,6 @@ int board_phy_config(struct phy_device *phydev) #endif #ifdef CONFIG_USB_DWC3 -#if 0 #define USB_PHY_CTRL0 0xF0040 #define USB_PHY_CTRL0_REF_SSP_EN BIT(2) @@ -190,7 +189,6 @@ static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3) writel(RegData, dwc3->base + USB_PHY_CTRL1); } #endif -#endif int usb_gadget_handle_interrupts(void) { @@ -198,7 +196,6 @@ int usb_gadget_handle_interrupts(void) return 0; } -#if 0 #ifdef CONFIG_USB_TCPC struct tcpc_port port; struct tcpc_port_config port_config = { @@ -280,7 +277,6 @@ int board_usb_cleanup(int index, enum usb_init_type init) return ret; } #endif -#endif int board_init(void) diff --git a/board/emcraft/imx8m_som/spl.c b/board/emcraft/imx8m_som/spl.c index c0284621dcafa7f067d4a2b8f66e6c1c540cc6dd..450ad6f2664734c2fdf177e12a99294d9c3f241e 100644 --- a/board/emcraft/imx8m_som/spl.c +++ b/board/emcraft/imx8m_som/spl.c @@ -368,100 +368,6 @@ static int setup_typec(void) } #endif -#ifdef CONFIG_SPL_USB_GADGET_SUPPORT -static struct dwc3_device dwc3_device_data = { - .maximum_speed = USB_SPEED_SUPER, - .base = USB1_BASE_ADDR, - .dr_mode = USB_DR_MODE_PERIPHERAL, - .index = 0, - .power_down_scale = 2, -}; - -#define USB_PHY_CTRL0 0xF0040 -#define USB_PHY_CTRL0_REF_SSP_EN BIT(2) - -#define USB_PHY_CTRL1 0xF0044 -#define USB_PHY_CTRL1_RESET BIT(0) -#define USB_PHY_CTRL1_COMMONONN BIT(1) -#define USB_PHY_CTRL1_ATERESET BIT(3) -#define USB_PHY_CTRL1_VDATSRCENB0 BIT(19) -#define USB_PHY_CTRL1_VDATDETENB0 BIT(20) - -#define USB_PHY_CTRL2 0xF0048 -#define USB_PHY_CTRL2_TXENABLEN0 BIT(8) - -#if 0 -int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) -{ - put_unaligned(CONFIG_G_DNL_PRODUCT_NUM + 0xfff, &dev->idProduct); - - return 0; -} -#endif - -static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3) -{ - u32 RegData; - - RegData = readl(dwc3->base + USB_PHY_CTRL1); - RegData &= ~(USB_PHY_CTRL1_VDATSRCENB0 | USB_PHY_CTRL1_VDATDETENB0 | - USB_PHY_CTRL1_COMMONONN); - RegData |= USB_PHY_CTRL1_RESET | USB_PHY_CTRL1_ATERESET; - writel(RegData, dwc3->base + USB_PHY_CTRL1); - - RegData = readl(dwc3->base + USB_PHY_CTRL0); - RegData |= USB_PHY_CTRL0_REF_SSP_EN; - writel(RegData, dwc3->base + USB_PHY_CTRL0); - - RegData = readl(dwc3->base + USB_PHY_CTRL2); - RegData |= USB_PHY_CTRL2_TXENABLEN0; - writel(RegData, dwc3->base + USB_PHY_CTRL2); - - RegData = readl(dwc3->base + USB_PHY_CTRL1); - RegData &= ~(USB_PHY_CTRL1_RESET | USB_PHY_CTRL1_ATERESET); - writel(RegData, dwc3->base + USB_PHY_CTRL1); -} - -#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_IMX8M) -int board_usb_init(int index, enum usb_init_type init) -{ - int ret = 0; - imx8m_usb_power(index, true); - - if (index == 0 && init == USB_INIT_DEVICE) { -#ifdef CONFIG_USB_TCPC - ret = tcpc_setup_ufp_mode(&port); -#endif - dwc3_nxp_usb_phy_init(&dwc3_device_data); - return dwc3_uboot_init(&dwc3_device_data); - } else if (index == 0 && init == USB_INIT_HOST) { -#ifdef CONFIG_USB_TCPC - ret = tcpc_setup_dfp_mode(&port); -#endif - return ret; - } - - return 0; -} - -int board_usb_cleanup(int index, enum usb_init_type init) -{ - int ret = 0; - if (index == 0 && init == USB_INIT_DEVICE) { - dwc3_uboot_exit(index); - } else if (index == 0 && init == USB_INIT_HOST) { -#ifdef CONFIG_USB_TCPC - ret = tcpc_disable_src_vbus(&port); -#endif - } - - imx8m_usb_power(index, false); - - return ret; -} -#endif - -#endif void board_init_f(ulong dummy) {