[U-Boot] [PATCH v2 03/13] am437x: board: do not register usb devices when CONFIG_DM_USB is defined

Vignesh R vigneshr at ti.com
Tue Jun 13 12:09:59 UTC 2017


From: Mugunthan V N <mugunthanvnm at ti.com>

Do not register usb devices when CONFIG_DM_USB is define.

Signed-off-by: Mugunthan V N <mugunthanvnm at ti.com>
Signed-off-by: Vignesh R <vigneshr at ti.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 board/ti/am43xx/board.c                   | 10 ++--------
 configs/am43xx_evm_usbhost_boot_defconfig |  1 +
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 0bbe366a362c..a2aefc08530a 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -632,7 +632,7 @@ int board_late_init(void)
 }
 #endif
 
-#ifdef CONFIG_USB_DWC3
+#if defined(CONFIG_USB_DWC3) && !defined(CONFIG_DM_USB)
 static struct dwc3_device usb_otg_ss1 = {
 	.maximum_speed = USB_SPEED_HIGH,
 	.base = USB_OTG_SS1_BASE,
@@ -668,13 +668,10 @@ static struct ti_usb_phy_device usb_phy2_device = {
 	.usb2_phy_power = (void *)USB2_PHY2_POWER,
 	.index = 1,
 };
-#endif /* CONFIG_USB_DWC3 */
 
-#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
 int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 {
 	enable_usb_clocks(index);
-#ifdef CONFIG_USB_DWC3
 	switch (index) {
 	case 0:
 		if (init == USB_INIT_DEVICE) {
@@ -697,14 +694,12 @@ int omap_xhci_board_usb_init(int index, enum usb_init_type init)
 	default:
 		printf("Invalid Controller Index\n");
 	}
-#endif
 
 	return 0;
 }
 
 int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 {
-#ifdef CONFIG_USB_DWC3
 	switch (index) {
 	case 0:
 	case 1:
@@ -717,12 +712,11 @@ int omap_xhci_board_usb_cleanup(int index, enum usb_init_type init)
 	default:
 		printf("Invalid Controller Index\n");
 	}
-#endif
 	disable_usb_clocks(index);
 
 	return 0;
 }
-#endif /* defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP) */
+#endif /* defined(CONFIG_USB_DWC3) && !defined(CONFIG_DM_USB) */
 
 #ifdef CONFIG_DRIVER_TI_CPSW
 
diff --git a/configs/am43xx_evm_usbhost_boot_defconfig b/configs/am43xx_evm_usbhost_boot_defconfig
index 870ed0fb24ab..e810b86c671c 100644
--- a/configs/am43xx_evm_usbhost_boot_defconfig
+++ b/configs/am43xx_evm_usbhost_boot_defconfig
@@ -69,6 +69,7 @@ CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
 CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
 CONFIG_G_DNL_VENDOR_NUM=0x0403
 CONFIG_G_DNL_PRODUCT_NUM=0xbd00
-- 
2.13.0



More information about the U-Boot mailing list