Skip to contentSkip to conversation

Add support for DM_USB and DM_USB_DEV to TI's am335x and am43xx_evm platforms

PATCH Superseded Jean-Jacques Hiblot 5 participants 44 messages Nov 21, 2018 – Nov 27, 2018

Subsystems (8)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add support for DM_USB and DM_USB_DEV to TI's am335x and am43xx_evm platforms

This series applies on top of the series "Add support for DM_USB and DM_USB_DEV to TI's K2G platforms" and "Add support for DM_USB and DM_USB_DEV for TI's DRA7 EVMs and AM57 EVMs platforms."

The am433x platforms can use the generic DWC3 driver instead of relying on the dwc3-xhci driver.
The am335x platforms use the musb controller. With a bit of work it can be made to support DM as well. This series only enables DM_USB and DM_USB_GADGET on am335x_boneblack_vboot. The changes for the other am335x based platforms will come in a subsequent series that reworks the configs of several TI boards.

This is part of a work to move all TI's platforms to support DM_USB and DM_USB_DEV.
As a side effect it makes it easy to support the full USB RDNIS bootflow (bootrom loads SPL over RNDIS, SPL loads u-boot over RNDIS, u-boot loads the images over RNDIS)

This series is made of 3 parts:
- some generic changes: rename DM_USB_DEV in DM_USB_GADGET and create UCLASS_USB_GADGET for the USB peripheral drivers.
- am437x support for DM_USB and DM_USB_GADGET
- am335x support for DM_USB and DM_USB_GADGET

Tested on:
- am4372 evm
- beaglebone black
- am335x evm (to verify that it doesn't break anything)

Jean-Jacques Hiblot (16):
usb: rename CONFIG_DM_USB_DEV as CONFIG_DM_USB_GADGET
dm: usb: create a new UCLASS ID for USB gadget devices
spl: drivers: Link usb common library to SPL if USB gadget is enabled
spl: net: dm: usb: bind the gadget before attempting to load the image
phy: omap_usb2: Add support for am437x
dwc3-generic: Add support for the am437x
board: ti: am43xx: turn on USB clocks
dts: Add a u-boot specific dtsi file for the am4372
dts: am4372: Enable USB1 in SPL
configs: am43xx_evm: Enable DM_USB and DM_USB_GADGET
configs: am43xx: Enable RNDIS support in SPL
usb: musb-new: Allow the diver not to use the set_phy_power() callback
usb: musb-new: Add support for DM_USB_GADGET
arm: am33xx: Register USB controllers if DM_USB is used but not
OF_CONTROL
configs: am335x_evm: Do not disable DM_USB in SPL
configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPl

 arch/arm/Kconfig                         |   4 +-
 arch/arm/dts/am4372-generic-u-boot.dtsi  |   2 +
 arch/arm/dts/am4372-u-boot.dtsi          |  40 +++++++
 arch/arm/dts/am437x-gp-evm-u-boot.dtsi   |   2 +
 arch/arm/dts/am437x-idk-evm-u-boot.dtsi  |   2 +
 arch/arm/dts/am437x-sk-evm-u-boot.dtsi   |   2 +
 arch/arm/include/asm/omap_musb.h         |   8 ++
 arch/arm/mach-omap2/am33xx/board.c       |  58 ++++++++--
 board/sunxi/board.c                      |   2 +-
 board/ti/am43xx/board.c                  |  22 ++++
 common/Makefile                          |   3 +
 common/spl/spl_net.c                     |   4 +-
 configs/am335x_boneblack_vboot_defconfig |   8 ++
 configs/am43xx_evm_defconfig             |  17 +++
 configs/am57xx_evm_defconfig             |   2 +-
 configs/am57xx_hs_evm_defconfig          |   2 +-
 configs/dra7xx_evm_defconfig             |   2 +-
 configs/dra7xx_hs_evm_defconfig          |   2 +-
 configs/k2g_evm_defconfig                |   2 +-
 configs/k2g_hs_evm_defconfig             |   2 +-
 drivers/Makefile                         |   1 +
 drivers/phy/omap-usb2-phy.c              |  45 ++++++--
 drivers/usb/Kconfig                      |   2 +-
 drivers/usb/dwc3/core.c                  |   2 +-
 drivers/usb/dwc3/dwc3-generic.c          |   7 +-
 drivers/usb/gadget/ether.c               |   2 +-
 drivers/usb/gadget/udc/Makefile          |   4 +
 drivers/usb/gadget/udc/udc-core.c        |  41 -------
 drivers/usb/musb-new/am35x.c             |   8 +-
 drivers/usb/musb-new/musb_dsps.c         |   8 +-
 drivers/usb/musb-new/musb_gadget.c       |  11 ++
 drivers/usb/musb-new/musb_uboot.c        |   4 +-
 drivers/usb/musb-new/omap2430.c          |   2 +-
 drivers/usb/musb-new/sunxi.c             |   2 +-
 drivers/usb/musb-new/ti-musb.c           | 179 +++++++++++++++++++++++--------
 include/configs/am335x_evm.h             |   1 -
 include/dm/uclass-id.h                   |   1 +
 include/linux/usb/gadget.h               |   2 +-
 38 files changed, 375 insertions(+), 133 deletions(-)
 create mode 100644 arch/arm/dts/am4372-u-boot.dtsi
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/16 usb: rename CONFIG_DM_USB_DEV as CONFIG_DM_USB_GADGET

DM_USB_DEV is ambiguous as it could be interpreted as USB host device. Renaming it as DM_USB_GADGET to make it clear that is related to gadget devices.

---

 arch/arm/Kconfig                  | 4 ++--
 configs/am57xx_evm_defconfig      | 2 +-
 configs/am57xx_hs_evm_defconfig   | 2 +-
 configs/dra7xx_evm_defconfig      | 2 +-
 configs/dra7xx_hs_evm_defconfig   | 2 +-
 configs/k2g_evm_defconfig         | 2 +-
 configs/k2g_hs_evm_defconfig      | 2 +-
 drivers/usb/Kconfig               | 2 +-
 drivers/usb/dwc3/core.c           | 2 +-
 drivers/usb/dwc3/dwc3-generic.c   | 4 ++--
 drivers/usb/gadget/udc/udc-core.c | 2 +-
 include/linux/usb/gadget.h        | 2 +-
 12 files changed, 14 insertions(+), 14 deletions(-)
arch/arm/Kconfig +2 -2
index 9e232d7..05b6ebf 100644
@@ -917,7 +917,7 @@ config ARCH_ZYNQMP_R5
 	select DM_SERIAL
 	select OF_CONTROL
 	imply CMD_DM
-	imply DM_USB_DEV
+	imply DM_USB_GADGET
 
 config ARCH_ZYNQMP
 	bool "Xilinx ZynqMP based platform"
@@ -934,7 +934,7 @@ config ARCH_ZYNQMP
 	imply CMD_DM
 	imply FAT_WRITE
 	imply MP
-	imply DM_USB_DEV
+	imply DM_USB_GADGET
 
 config TEGRA
 	bool "NVIDIA Tegra"
configs/am57xx_evm_defconfig +1 -1
index 038c3ba..a6feae7 100644
@@ -75,7 +75,7 @@ CONFIG_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
configs/am57xx_hs_evm_defconfig +1 -1
index a3eedca..e9897d8 100644
@@ -78,7 +78,7 @@ CONFIG_DM_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
configs/dra7xx_evm_defconfig +1 -1
index 943ae71..19a5f98 100644
@@ -89,7 +89,7 @@ CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
configs/dra7xx_hs_evm_defconfig +1 -1
index 9137ee7..150d70b 100644
@@ -88,7 +88,7 @@ CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
configs/k2g_evm_defconfig +1 -1
index b71edf0..8a07039 100644
@@ -62,7 +62,7 @@ CONFIG_DM_SPI=y
 CONFIG_DAVINCI_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
configs/k2g_hs_evm_defconfig +1 -1
index 16872f4..5f91f11 100644
@@ -55,7 +55,7 @@ CONFIG_DM_SPI=y
 CONFIG_DAVINCI_SPI=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
-CONFIG_DM_USB_DEV=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
drivers/usb/Kconfig +1 -1
index 3587ba4..91a431d 100644
@@ -47,7 +47,7 @@ config DM_USB
 	  declared with the U_BOOT_USB_DEVICE() macro and will be
 	  automatically probed when found on the bus.
 
-config DM_USB_DEV
+config DM_USB_GADGET
 	bool "Enable driver model for USB (Peripheral mode)"
 	depends on DM_USB
 	help
drivers/usb/dwc3/core.c +1 -1
index 325fe8c..e226f06 100644
@@ -875,7 +875,7 @@ int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys)
 }
 #endif
 
-#ifdef CONFIG_DM_USB_DEV
+#ifdef CONFIG_DM_USB_GADGET
 int dwc3_init(struct dwc3 *dwc)
 {
 	int ret;
drivers/usb/dwc3/dwc3-generic.c +2 -2
index d54a25c..f908d7f 100644
@@ -22,7 +22,7 @@
 #include <reset.h>
 #include <clk.h>
 
-#ifdef CONFIG_DM_USB_DEV
+#ifdef CONFIG_DM_USB_GADGET
 
 struct dwc3_generic_peripheral {
 	struct dwc3 dwc3;
@@ -224,7 +224,7 @@ static int dwc3_glue_bind(struct udevice *parent)
 		switch (dr_mode) {
 		case USB_DR_MODE_PERIPHERAL:
 		case USB_DR_MODE_OTG:
-#ifdef CONFIG_DM_USB_DEV
+#ifdef CONFIG_DM_USB_GADGET
 			debug("%s: dr_mode: OTG or Peripheral\n", __func__);
 			driver = "dwc3-generic-peripheral";
 #endif
drivers/usb/gadget/udc/udc-core.c +1 -1
index 42c9ea9..bae71a2 100644
@@ -353,7 +353,7 @@ MODULE_DESCRIPTION("UDC Framework");
 MODULE_AUTHOR("Felipe Balbi <[email protected]>");
 MODULE_LICENSE("GPL v2");
 
-#ifdef CONFIG_DM_USB_DEV
+#ifdef CONFIG_DM_USB_GADGET
 #define MAX_UDC_DEVICES 4
 static struct udevice *dev_array[MAX_UDC_DEVICES];
 int usb_gadget_initialize(int index)
include/linux/usb/gadget.h +1 -1
index a094e31..78407c9 100644
@@ -927,7 +927,7 @@ extern void usb_ep_autoconfig_reset(struct usb_gadget *);
 
 extern int usb_gadget_handle_interrupts(int index);
 
-#ifdef CONFIG_DM_USB_DEV
+#ifdef CONFIG_DM_USB_GADGET
 int usb_gadget_initialize(int index);
 int usb_gadget_release(int index);
 int dm_usb_gadget_handle_interrupts(struct udevice *dev);
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/16 usb: rename CONFIG_DM_USB_DEV as CONFIG_DM_USB_GADGET

Quoted 5 lines · Jean-Jacques Hiblot

DM_USB_DEV is ambiguous as it could be interpreted as USB host device. Renaming it as DM_USB_GADGET to make it clear that is related to gadget devices.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/7534adbc/attachment.sig>
#3 lore raw

PATCH 2/16 dm: usb: create a new UCLASS ID for USB gadget devices

In reply to Jean-Jacques Hiblot

UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host controllers, not gadget devices.
Adding a new UCLASS for gadget devices alone.

Also move the generic DM code for USB gadgets in a separate file for clarity.

---

 board/sunxi/board.c               |  2 +-
 drivers/usb/dwc3/dwc3-generic.c   |  2 +-
 drivers/usb/gadget/ether.c        |  2 +-
 drivers/usb/gadget/udc/Makefile   |  4 ++++
 drivers/usb/gadget/udc/udc-core.c | 41 ---------------------------------------
 drivers/usb/musb-new/omap2430.c   |  2 +-
 drivers/usb/musb-new/sunxi.c      |  2 +-
 include/dm/uclass-id.h            |  1 +
 8 files changed, 10 insertions(+), 46 deletions(-)
board/sunxi/board.c +1 -1
index 64ccbc7..9b36cc7 100644
@@ -663,7 +663,7 @@ int g_dnl_board_usb_cable_connected(void)
 	struct phy phy;
 	int ret;
 
-	ret = uclass_get_device(UCLASS_USB_DEV_GENERIC, 0, &dev);
+	ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
 	if (ret) {
 		pr_err("%s: Cannot find USB device\n", __func__);
 		return ret;
drivers/usb/dwc3/dwc3-generic.c +1 -1
index f908d7f..bfd5bf3 100644
@@ -101,7 +101,7 @@ static int dwc3_generic_peripheral_ofdata_to_platdata(struct udevice *dev)
 
 U_BOOT_DRIVER(dwc3_generic_peripheral) = {
 	.name	= "dwc3-generic-peripheral",
-	.id	= UCLASS_USB_DEV_GENERIC,
+	.id	= UCLASS_USB_GADGET_GENERIC,
 	.ofdata_to_platdata = dwc3_generic_peripheral_ofdata_to_platdata,
 	.probe = dwc3_generic_peripheral_probe,
 	.remove = dwc3_generic_peripheral_remove,
drivers/usb/gadget/ether.c +1 -1
index 5a9ffd7..3b3d9af 100644
@@ -2671,7 +2671,7 @@ int usb_ether_init(void)
 	struct udevice *usb_dev;
 	int ret;
 
-	ret = uclass_first_device(UCLASS_USB_DEV_GENERIC, &usb_dev);
+	ret = uclass_first_device(UCLASS_USB_GADGET_GENERIC, &usb_dev);
 	if (!usb_dev || ret) {
 		pr_err("No USB device found\n");
 		return ret;
drivers/usb/gadget/udc/Makefile +4 -0
index 449339f..d1a5963 100644
@@ -2,4 +2,8 @@
 #
 # USB peripheral controller drivers
 
+ifndef CONFIG_DM_USB_GADGET
 obj-$(CONFIG_USB_DWC3_GADGET)	+= udc-core.o
+endif
+
+obj-$(CONFIG_DM_USB_GADGET)	+= udc-uclass.o udc-core.o
drivers/usb/gadget/udc/udc-core.c +0 -41

44 lines not on this page · raw message

drivers/usb/musb-new/omap2430.c +1 -1
index 342d76b..971f953 100644
@@ -263,7 +263,7 @@ U_BOOT_DRIVER(omap2430_musb) = {
 #ifdef CONFIG_USB_MUSB_HOST
 	.id		= UCLASS_USB,
 #else
-	.id		= UCLASS_USB_DEV_GENERIC,
+	.id		= UCLASS_USB_GADGET_GENERIC,
 #endif
 	.of_match = omap2430_musb_ids,
 	.ofdata_to_platdata = omap2430_musb_ofdata_to_platdata,
drivers/usb/musb-new/sunxi.c +1 -1
index 6cf9826..d7170a3 100644
@@ -535,7 +535,7 @@ U_BOOT_DRIVER(usb_musb) = {
 #ifdef CONFIG_USB_MUSB_HOST
 	.id		= UCLASS_USB,
 #else
-	.id		= UCLASS_USB_DEV_GENERIC,
+	.id		= UCLASS_USB_GADGET_GENERIC,
 #endif
 	.of_match	= sunxi_musb_ids,
 	.probe		= musb_usb_probe,
include/dm/uclass-id.h +1 -0
index c91dca1..1601100 100644
@@ -92,6 +92,7 @@ enum uclass_id {
 	UCLASS_USB,		/* USB bus */
 	UCLASS_USB_DEV_GENERIC,	/* USB generic device */
 	UCLASS_USB_HUB,		/* USB hub */
+	UCLASS_USB_GADGET_GENERIC,	/* USB generic device */
 	UCLASS_VIDEO,		/* Video or LCD device */
 	UCLASS_VIDEO_BRIDGE,	/* Video bridge, e.g. DisplayPort to LVDS */
 	UCLASS_VIDEO_CONSOLE,	/* Text console driver for video device */
Signature · 1 line
2.7.4
#4 lore raw

PATCH 2/16 dm: usb: create a new UCLASS ID for USB gadget devices

Quoted 11 lines · Jean-Jacques Hiblot

UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host controllers, not gadget devices.
Adding a new UCLASS for gadget devices alone.

Also move the generic DM code for USB gadgets in a separate file for clarity.

---

Quoted 9 lines
 board/sunxi/board.c               |  2 +-
 drivers/usb/dwc3/dwc3-generic.c   |  2 +-
 drivers/usb/gadget/ether.c        |  2 +-
 drivers/usb/gadget/udc/Makefile   |  4 ++++
 drivers/usb/gadget/udc/udc-core.c | 41 ---------------------------------------
 drivers/usb/musb-new/omap2430.c   |  2 +-
 drivers/usb/musb-new/sunxi.c      |  2 +-
 include/dm/uclass-id.h            |  1 +
 8 files changed, 10 insertions(+), 46 deletions(-)
#5 lore raw

PATCH 3/16 spl: drivers: Link usb common library to SPL if USB gadget is enabled

In reply to Jean-Jacques Hiblot

Some drivers might need to access common USB functions such as usb_get_maximum_speed() or usb_get_dr_mode().

---

 drivers/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/Makefile +1 -0
index 4453c62..b5c64d9 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_SPL_PCH_SUPPORT) += pch/
 obj-$(CONFIG_SPL_RTC_SUPPORT) += rtc/
 obj-$(CONFIG_SPL_MUSB_NEW_SUPPORT) += usb/musb-new/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/
+obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/common/
 obj-$(CONFIG_SPL_USB_GADGET_SUPPORT) += usb/gadget/udc/
 obj-$(CONFIG_SPL_DFU_SUPPORT) += dfu/
 obj-$(CONFIG_SPL_WATCHDOG_SUPPORT) += watchdog/
Signature · 1 line
2.7.4
#6 lore raw

PATCH 3/16 spl: drivers: Link usb common library to SPL if USB gadget is enabled

Quoted 4 lines · Jean-Jacques Hiblot

Some drivers might need to access common USB functions such as usb_get_maximum_speed() or usb_get_dr_mode().

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/7a0c6e41/attachment.sig>
#7 lore raw

PATCH 4/16 spl: net: dm: usb: bind the gadget before attempting to load the image

In reply to Jean-Jacques Hiblot

If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a controller before the image can be downloaded over the network. In u-boot this can be done with the bind command. In SPL it must be done programmatically.

---

 common/spl/spl_net.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_net.c +3 -1
index b6967ff..15d7915 100644
@@ -85,7 +85,9 @@ int spl_net_load_image_usb(struct spl_image_info *spl_image,
 			   struct spl_boot_device *bootdev)
 {
 	bootdev->boot_device_name = "usb_ether";
-
+#ifdef CONFIG_DM_USB_GADGET
+	usb_ether_init();
+#endif
 	return spl_net_load_image(spl_image, bootdev);
 }
 SPL_LOAD_IMAGE_METHOD("USB eth", 0, BOOT_DEVICE_USBETH, spl_net_load_image_usb);
Signature · 1 line
2.7.4
#8 lore raw

PATCH 4/16 spl: net: dm: usb: bind the gadget before attempting to load the image

Quoted 6 lines · Jean-Jacques Hiblot

If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a controller before the image can be downloaded over the network. In u-boot this can be done with the bind command. In SPL it must be done programmatically.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/0c70eddb/attachment.sig>
#9 lore raw

PATCH 5/16 phy: omap_usb2: Add support for am437x

In reply to Jean-Jacques Hiblot

---

 drivers/phy/omap-usb2-phy.c | 45 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 11 deletions(-)
drivers/phy/omap-usb2-phy.c +34 -11
index 671539b..a8d3ccd 100644
@@ -19,6 +19,11 @@
 #define OMAP_DEV_PHY_PD		BIT(0)
 #define OMAP_USB2_PHY_PD	BIT(28)
 
+#define AM437X_USB2_PHY_PD		BIT(0)
+#define AM437X_USB2_OTG_PD		BIT(1)
+#define AM437X_USB2_OTGVDET_EN		BIT(19)
+#define AM437X_USB2_OTGSESSEND_EN	BIT(20)
+
 #define USB2PHY_DISCON_BYP_LATCH	BIT(31)
 #define USB2PHY_ANA_CONFIG1		(0x4c)
 
@@ -60,6 +65,15 @@ static const struct usb_phy_data dra7x_usb2_phy2_data = {
 	.power_off = OMAP_USB2_PHY_PD,
 };
 
+static const struct usb_phy_data am437x_usb2_data = {
+	.label = "am437x_usb2",
+	.flags =  0,
+	.mask = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD |
+		AM437X_USB2_OTGVDET_EN | AM437X_USB2_OTGSESSEND_EN,
+	.power_on = AM437X_USB2_OTGVDET_EN | AM437X_USB2_OTGSESSEND_EN,
+	.power_off = AM437X_USB2_PHY_PD | AM437X_USB2_OTG_PD,
+};
+
 static const struct udevice_id omap_usb2_id_table[] = {
 	{
 		.compatible = "ti,omap5-usb2",
@@ -73,6 +87,10 @@ static const struct udevice_id omap_usb2_id_table[] = {
 		.compatible = "ti,dra7x-usb2-phy2",
 		.data = (ulong)&dra7x_usb2_phy2_data,
 	},
+	{
+		.compatible = "ti,am437x-usb2",
+		.data = (ulong)&am437x_usb2_data,
+	},
 	{},
 };
 
@@ -170,20 +188,25 @@ int omap_usb2_phy_probe(struct udevice *dev)
 	}
 
 	regmap = syscon_regmap_lookup_by_phandle(dev, "syscon-phy-power");
-	if (IS_ERR(regmap)) {
-		printf("can't get regmap (err %ld)\n", PTR_ERR(regmap));
-		return PTR_ERR(regmap);
+	if (!IS_ERR(regmap)) {
+		priv->pwr_regmap = regmap;
+		rc =  dev_read_u32_array(dev, "syscon-phy-power", tmp, 2);
+		if (rc) {
+			printf("couldn't get power reg. offset (err %d)\n", rc);
+			return rc;
+		}
+		priv->pwr_reg_offset = tmp[1];
+		return 0;
 	}
-	priv->pwr_regmap = regmap;
-
-	rc =  dev_read_u32_array(dev, "syscon-phy-power", tmp, 2);
-	if (rc) {
-		printf("couldn't get power reg. offset (err %d)\n", rc);
-		return rc;
+	regmap = syscon_regmap_lookup_by_phandle(dev, "ctrl-module");
+	if (!IS_ERR(regmap)) {
+		priv->pwr_regmap = regmap;
+		priv->pwr_reg_offset = 0;
+		return 0;
 	}
-	priv->pwr_reg_offset = tmp[1];
 
-	return 0;
+	printf("can't get regmap (err %ld)\n", PTR_ERR(regmap));
+	return PTR_ERR(regmap);
 }
 
 U_BOOT_DRIVER(omap_usb2_phy) = {
Signature · 1 line
2.7.4
#10 lore raw

PATCH 5/16 phy: omap_usb2: Add support for am437x

Quoted 1 line · Jean-Jacques Hiblot
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/47fbf266/attachment.sig>
#11 lore raw

PATCH 6/16 dwc3-generic: Add support for the am437x

In reply to Jean-Jacques Hiblot

---

 drivers/usb/dwc3/dwc3-generic.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-generic.c +1 -0
index bfd5bf3..095f336 100644
@@ -345,6 +345,7 @@ static const struct udevice_id dwc3_glue_ids[] = {
 	{ .compatible = "xlnx,zynqmp-dwc3" },
 	{ .compatible = "ti,keystone-dwc3"},
 	{ .compatible = "ti,dwc3", .data = (ulong)&ti_ops },
+	{ .compatible = "ti,am437x-dwc3", .data = (ulong)&ti_ops },
 	{ }
 };
 
Signature · 1 line
2.7.4
#12 lore raw

PATCH 6/16 dwc3-generic: Add support for the am437x

Quoted 1 line · Jean-Jacques Hiblot
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/baae7457/attachment.sig>
#13 lore raw

PATCH 7/16 board: ti: am43xx: turn on USB clocks

In reply to Jean-Jacques Hiblot

Enable USB clocks in late init stage to support ports under DM_USB.

---

 board/ti/am43xx/board.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
board/ti/am43xx/board.c +22 -0
index 2a59b06..be12b30 100644
@@ -681,6 +681,19 @@ int board_init(void)
 }
 
 #ifdef CONFIG_BOARD_LATE_INIT
+#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL)
+static int device_okay(const char *path)
+{
+	int node;
+
+	node = fdt_path_offset(gd->fdt_blob, path);
+	if (node < 0)
+		return 0;
+
+	return fdtdec_get_is_enabled(gd->fdt_blob, node);
+}
+#endif
+
 int board_late_init(void)
 {
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
@@ -693,10 +706,18 @@ int board_late_init(void)
 	if (get_device_type() == HS_DEVICE)
 		env_set("boot_fit", "1");
 #endif
+
+#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL)
+	if (device_okay("/ocp/omap_dwc3 at 48380000"))
+		enable_usb_clocks(0);
+	if (device_okay("/ocp/omap_dwc3 at 483c0000"))
+		enable_usb_clocks(1);
+#endif
 	return 0;
 }
 #endif
 
+#ifndef CONFIG_DM_USB_GADGET
 #ifdef CONFIG_USB_DWC3
 static struct dwc3_device usb_otg_ss1 = {
 	.maximum_speed = USB_SPEED_HIGH,
@@ -799,6 +820,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
 	return 0;
 }
 #endif /* defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP) */
+#endif
 
 #ifdef CONFIG_DRIVER_TI_CPSW
 
Signature · 1 line
2.7.4
#14 lore raw

PATCH 7/16 board: ti: am43xx: turn on USB clocks

Quoted 3 lines · Jean-Jacques Hiblot

Enable USB clocks in late init stage to support ports under DM_USB.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/5dea10f2/attachment.sig>
#15 lore raw

PATCH 8/16 dts: Add a u-boot specific dtsi file for the am4372

In reply to Jean-Jacques Hiblot

This file is used to override the values found in am4372.dtsi Use it to fix the "compatible" options for the controllers used to support the USB (parent bus and syscons).

---

 arch/arm/dts/am4372-generic-u-boot.dtsi |  2 ++
 arch/arm/dts/am4372-u-boot.dtsi         | 20 ++++++++++++++++++++
 arch/arm/dts/am437x-gp-evm-u-boot.dtsi  |  2 ++
 arch/arm/dts/am437x-idk-evm-u-boot.dtsi |  2 ++
 arch/arm/dts/am437x-sk-evm-u-boot.dtsi  |  2 ++
 5 files changed, 28 insertions(+)
 create mode 100644 arch/arm/dts/am4372-u-boot.dtsi
arch/arm/dts/am4372-generic-u-boot.dtsi +2 -0
index d485679..6ba5c16 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#include "am4372-u-boot.dtsi"
+
 /{
 	ocp {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am4372-u-boot.dtsi new file +20 -0
new file mode 100644
index 0000000..cda4214
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
+ */
+
+&am43xx_control_usb2phy1 {
+	compatible = "ti,control-phy-usb2-am437", "syscon";
+};
+
+&am43xx_control_usb2phy2 {
+	compatible = "ti,control-phy-usb2-am437", "syscon";
+};
+
+&ocp2scp0 {
+	compatible = "ti,am437x-ocp2scp", "ti,omap-ocp2scp", "simple-bus";
+};
+
+&ocp2scp1 {
+	compatible = "ti,am437x-ocp2scp", "ti,omap-ocp2scp", "simple-bus";
+};
arch/arm/dts/am437x-gp-evm-u-boot.dtsi +2 -0
index 530f549..616debe 100644
@@ -7,6 +7,8 @@
  * Based on "dra7.dtsi"
  */
 
+#include "am4372-u-boot.dtsi"
+
 /{
 	ocp {
 		u-boot,dm-spl;
arch/arm/dts/am437x-idk-evm-u-boot.dtsi +2 -0
index 0a3d79a..3aa9195 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#include "am4372-u-boot.dtsi"
+
 /{
 	ocp {
 		u-boot,dm-spl;
arch/arm/dts/am437x-sk-evm-u-boot.dtsi +2 -0
index 0a3d79a..3aa9195 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#include "am4372-u-boot.dtsi"
+
 /{
 	ocp {
 		u-boot,dm-spl;
Signature · 1 line
2.7.4
#16 lore raw

PATCH 8/16 dts: Add a u-boot specific dtsi file for the am4372

Quoted 5 lines · Jean-Jacques Hiblot

This file is used to override the values found in am4372.dtsi Use it to fix the "compatible" options for the controllers used to support the USB (parent bus and syscons).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/57c970a0/attachment.sig>
#17 lore raw

PATCH 9/16 dts: am4372: Enable USB1 in SPL

In reply to Jean-Jacques Hiblot

USB1 can be used by the romboot on all am4372 platforms to download a firmware (SPL in our case).
It makes sense to enable USB1 in the SPL to download u-boot.

---

 arch/arm/dts/am4372-u-boot.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm/dts/am4372-u-boot.dtsi +20 -0
index cda4214..99922ca 100644
@@ -18,3 +18,23 @@
 &ocp2scp1 {
 	compatible = "ti,am437x-ocp2scp", "ti,omap-ocp2scp", "simple-bus";
 };
+
+&dwc3_1 {
+	u-boot,dm-spl;
+};
+
+&usb1 {
+	u-boot,dm-spl;
+};
+
+&usb2_phy1 {
+	u-boot,dm-spl;
+};
+
+&am43xx_control_usb2phy1 {
+	u-boot,dm-spl;
+};
+
+&ocp2scp0 {
+	u-boot,dm-spl;
+};
Signature · 1 line
2.7.4
#18 lore raw

PATCH 9/16 dts: am4372: Enable USB1 in SPL

Quoted 5 lines · Jean-Jacques Hiblot

USB1 can be used by the romboot on all am4372 platforms to download a firmware (SPL in our case).
It makes sense to enable USB1 in the SPL to download u-boot.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/dbb199f9/attachment.sig>
#19 lore raw

PATCH 10/16 configs: am43xx_evm: Enable DM_USB and DM_USB_GADGET

In reply to Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for AM43xx EVM boards.

---

 configs/am43xx_evm_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/am43xx_evm_defconfig +8 -0
index 7601263..aeecdc2 100644
@@ -27,11 +27,14 @@ CONFIG_DEFAULT_DEVICE_TREE="am437x-gp-evm"
 CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
 # CONFIG_BLK is not set
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
 CONFIG_DM_GPIO=y
+CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
@@ -40,17 +43,22 @@ CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
+CONFIG_PHY=y
+CONFIG_OMAP_USB2_PHY=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
 CONFIG_TI_QSPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GADGET=y
 CONFIG_USB_DWC3_OMAP=y
+CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_DWC3_PHY_OMAP=y
 CONFIG_OMAP_USB_PHY=y
 CONFIG_USB_STORAGE=y
Signature · 1 line
2.7.4
#20 lore raw

PATCH 10/16 configs: am43xx_evm: Enable DM_USB and DM_USB_GADGET

Quoted 3 lines · Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for AM43xx EVM boards.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/f33065c5/attachment.sig>
#21 lore raw

PATCH 11/16 configs: am43xx: Enable RNDIS support in SPL

In reply to Jean-Jacques Hiblot

The AM43xx SOCs have the ability to download the SPl through USB (RNDIS). Adding support for RNDIS in SPL allows to also download u-boot through USB.

---

 configs/am43xx_evm_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
configs/am43xx_evm_defconfig +9 -0
index aeecdc2..537a794 100644
@@ -3,6 +3,7 @@ CONFIG_ARCH_OMAP2PLUS=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_AM43XX=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
@@ -12,7 +13,11 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 # CONFIG_MISC_INIT_R is not set
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SPL_NET_SUPPORT=y
+CONFIG_SPL_NET_VCI_STRING="AM43xx U-Boot SPL"
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_ETHER=y
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_NAND_OFS=0x00100000
 CONFIG_CMD_SPL_WRITE_SIZE=0x40000
@@ -28,7 +33,9 @@ CONFIG_OF_LIST="am437x-gp-evm am437x-sk-evm am43x-epos-evm am437x-idk-evm"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
 CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
 # CONFIG_BLK is not set
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
@@ -44,6 +51,7 @@ CONFIG_DRIVER_TI_CPSW=y
 CONFIG_PHY_GIGE=y
 CONFIG_MII=y
 CONFIG_PHY=y
+CONFIG_SPL_PHY=y
 CONFIG_OMAP_USB2_PHY=y
 CONFIG_DM_SERIAL=y
 CONFIG_SPI=y
@@ -67,3 +75,4 @@ CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0403
 CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_ETHER=y
Signature · 1 line
2.7.4
#22 lore raw

PATCH 11/16 configs: am43xx: Enable RNDIS support in SPL

Quoted 4 lines · Jean-Jacques Hiblot

The AM43xx SOCs have the ability to download the SPl through USB (RNDIS). Adding support for RNDIS in SPL allows to also download u-boot through USB.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/db9ad5e3/attachment.sig>
#23 lore raw

PATCH 12/16 usb: musb-new: Allow the diver not to use the set_phy_power() callback

In reply to Jean-Jacques Hiblot

The set_phy_power() callback is part of struct omap_musb_board_data. This structure is part of the platform data passed to the musb-new driver. This does not really fit with the Driver Model, so allow not to use struct omap_musb_board_data to turn the phy on or off.

---

 drivers/usb/musb-new/am35x.c     | 8 ++++----
 drivers/usb/musb-new/musb_dsps.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/usb/musb-new/am35x.c +4 -4
index 251b4e9..bda099c 100644
@@ -406,7 +406,7 @@ static int am35x_musb_init(struct musb *musb)
 	musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
 
 	/* Start the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 1);
 
 	msleep(5);
@@ -437,7 +437,7 @@ static int am35x_musb_exit(struct musb *musb)
 #endif
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 0);
 
 #ifndef __UBOOT__
@@ -628,7 +628,7 @@ static int am35x_suspend(struct device *dev)
 	struct omap_musb_board_data *data = plat->board_data;
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 0);
 
 	clk_disable(glue->phy_clk);
@@ -645,7 +645,7 @@ static int am35x_resume(struct device *dev)
 	int			ret;
 
 	/* Start the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 1);
 
 	ret = clk_enable(glue->phy_clk);
drivers/usb/musb-new/musb_dsps.c +4 -4
index 9b814f4..0c794b3 100644
@@ -450,7 +450,7 @@ static int dsps_musb_init(struct musb *musb)
 	dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
 
 	/* Start the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 1);
 
 	musb->isr = dsps_interrupt;
@@ -491,7 +491,7 @@ static int dsps_musb_exit(struct musb *musb)
 #endif
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 0);
 
 #ifndef __UBOOT__
@@ -691,7 +691,7 @@ static int dsps_suspend(struct device *dev)
 	struct omap_musb_board_data *data = plat->board_data;
 
 	/* Shutdown the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 0);
 
 	return 0;
@@ -703,7 +703,7 @@ static int dsps_resume(struct device *dev)
 	struct omap_musb_board_data *data = plat->board_data;
 
 	/* Start the on-chip PHY and its PLL. */
-	if (data->set_phy_power)
+	if (data && data->set_phy_power)
 		data->set_phy_power(data->dev, 1);
 
 	return 0;
Signature · 1 line
2.7.4
#24 lore raw

PATCH 12/16 usb: musb-new: Allow the diver not to use the set_phy_power() callback

Quoted 6 lines · Jean-Jacques Hiblot

The set_phy_power() callback is part of struct omap_musb_board_data. This structure is part of the platform data passed to the musb-new driver. This does not really fit with the Driver Model, so allow not to use struct omap_musb_board_data to turn the phy on or off.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/5c9db713/attachment.sig>
#25 lore raw

PATCH 13/16 usb: musb-new: Add support for DM_USB_GADGET

In reply to Jean-Jacques Hiblot

Enable DM for USB peripheral in the musb-new driver. Also make sure that the driver can be used in the SPL. This implies that:
* the driver must work with and without the OF_CONTROL option. That in turn, implies that the platform data can be passed in a struct ti_musb_platdata or be read from the dtb
* usb.o is linked in the SPL if host support is enabled

---

 arch/arm/include/asm/omap_musb.h   |   8 ++
 common/Makefile                    |   3 +
 drivers/usb/musb-new/musb_gadget.c |  11 +++
 drivers/usb/musb-new/musb_uboot.c  |   4 +-
 drivers/usb/musb-new/ti-musb.c     | 179 ++++++++++++++++++++++++++++---------
 5 files changed, 160 insertions(+), 45 deletions(-)
arch/arm/include/asm/omap_musb.h +8 -0
index 875f100..b40ea00 100644
@@ -7,6 +7,7 @@
 
 #ifndef __ASM_ARM_OMAP_MUSB_H
 #define __ASM_ARM_OMAP_MUSB_H
+#include <linux/usb/musb.h>
 
 extern struct musb_platform_ops musb_dsps_ops;
 extern const struct musb_platform_ops am35x_ops;
@@ -21,4 +22,11 @@ struct omap_musb_board_data {
 };
 
 enum musb_interface    {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
+
+struct ti_musb_platdata {
+	void *base;
+	void *ctrl_mod_base;
+	struct musb_hdrc_platform_data plat;
+};
+
 #endif /* __ASM_ARM_OMAP_MUSB_H */
common/Makefile +3 -0
index a238836..44fdb92 100644
@@ -72,9 +72,12 @@ obj-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
 obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o
 obj-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
+
 ifdef CONFIG_SPL_USB_HOST_SUPPORT
 obj-$(CONFIG_SPL_USB_SUPPORT) += usb.o usb_hub.o
 obj-$(CONFIG_USB_STORAGE) += usb_storage.o
+else
+obj-$(CONFIG_USB_MUSB_HOST) += usb.o
 endif
 endif
 #others
drivers/usb/musb-new/musb_gadget.c +11 -0
index 8b6cec1..b35d33f 100644
@@ -1775,6 +1775,14 @@ static int musb_gadget_start(struct usb_gadget *g,
 		struct usb_gadget_driver *driver);
 static int musb_gadget_stop(struct usb_gadget *g,
 		struct usb_gadget_driver *driver);
+#else
+static int musb_gadget_stop(struct usb_gadget *g)
+{
+	struct musb	*musb = gadget_to_musb(g);
+
+	musb_stop(musb);
+	return 0;
+}
 #endif
 
 static const struct usb_gadget_ops musb_gadget_operations = {
@@ -1787,6 +1795,9 @@ static const struct usb_gadget_ops musb_gadget_operations = {
 #ifndef __UBOOT__
 	.udc_start		= musb_gadget_start,
 	.udc_stop		= musb_gadget_stop,
+#else
+	.udc_start		= musb_gadget_start,
+	.udc_stop		= musb_gadget_stop,
 #endif
 };
 
drivers/usb/musb-new/musb_uboot.c +2 -2
index 2bf918e..90db5ef 100644
@@ -367,7 +367,7 @@ struct dm_usb_ops musb_usb_ops = {
 #endif /* CONFIG_DM_USB */
 #endif /* CONFIG_USB_MUSB_HOST */
 
-#ifdef CONFIG_USB_MUSB_GADGET
+#if defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_DM_USB_GADGET)
 static struct musb *gadget;
 
 int usb_gadget_handle_interrupts(int index)
@@ -430,7 +430,7 @@ struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
 		musbp = &musb_host.host;
 		break;
 #endif
-#ifdef CONFIG_USB_MUSB_GADGET
+#if defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_DM_USB_GADGET)
 	case MUSB_PERIPHERAL:
 		musbp = &gadget;
 		break;
drivers/usb/musb-new/ti-musb.c +136 -43

294 lines not on this page · raw message

Signature · 1 line
2.7.4
#26 lore raw

PATCH 13/16 usb: musb-new: Add support for DM_USB_GADGET

Quoted 9 lines · Jean-Jacques Hiblot

Enable DM for USB peripheral in the musb-new driver. Also make sure that the driver can be used in the SPL. This implies that:
* the driver must work with and without the OF_CONTROL option. That in turn, implies that the platform data can be passed in a struct ti_musb_platdata or be read from the dtb
* usb.o is linked in the SPL if host support is enabled

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/d291f7fc/attachment.sig>
#27 lore raw

PATCH 14/16 arm: am33xx: Register USB controllers if DM_USB is used but not OF_CONTROL

In reply to Jean-Jacques Hiblot

When DM_USB is used, either the USB controllers are bound when the DTB is parsed (when OF_CONTROL is enabled) or they are bound using the U_BOOT_DEVICES() macro.
In the later case, the platform data is passed in a struct ti_musb_platdata because it cannot be read from the DTB.

---

 arch/arm/mach-omap2/am33xx/board.c | 58 ++++++++++++++++++++++++++++++++------
 1 file changed, 50 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/am33xx/board.c +50 -8
index f5f2bd5..001c668 100644
@@ -159,7 +159,55 @@ int cpu_mmc_init(bd_t *bis)
 /* AM33XX has two MUSB controllers which can be host or gadget */
 #if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \
 	(defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \
-	(!defined(CONFIG_DM_USB))
+	(!defined(CONFIG_DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)) && \
+	(!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_MUSB_NEW_SUPPORT))
+
+static struct musb_hdrc_config musb_config = {
+	.multipoint     = 1,
+	.dyn_fifo       = 1,
+	.num_eps        = 16,
+	.ram_bits       = 12,
+};
+
+#if defined(CONFIG_DM_USB) && !CONFIG_IS_ENABLED(OF_CONTROL)
+static struct ti_musb_platdata usb0 = {
+	.base = (void *)USB0_OTG_BASE,
+	.ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl0,
+	.plat = {
+		.config         = &musb_config,
+		.power          = 50,
+		.platform_ops	= &musb_dsps_ops,
+		},
+};
+
+static struct ti_musb_platdata usb1 = {
+	.base = (void *)USB1_OTG_BASE,
+	.ctrl_mod_base = &((struct ctrl_dev *)CTRL_DEVICE_BASE)->usb_ctrl1,
+	.plat = {
+		.config         = &musb_config,
+		.power          = 50,
+		.platform_ops	= &musb_dsps_ops,
+		},
+};
+
+U_BOOT_DEVICES(am33xx_usbs) = {
+#if CONFIG_AM335X_USB0_MODE == MUSB_PERIPHERAL
+	{ "ti-musb-peripheral", &usb0 },
+#elif CONFIG_AM335X_USB0_MODE == MUSB_HOST
+	{ "ti-musb-host", &usb0 },
+#endif
+#if CONFIG_AM335X_USB1_MODE == MUSB_PERIPHERAL
+	{ "ti-musb-peripheral", &usb1 },
+#elif CONFIG_AM335X_USB1_MODE == MUSB_HOST
+	{ "ti-musb-host", &usb1 },
+#endif
+};
+
+int arch_misc_init(void)
+{
+	return 0;
+}
+#else
 static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
 /* USB 2.0 PHY Control */
@@ -178,13 +226,6 @@ static void am33xx_usb_set_phy_power(u8 on, u32 *reg_addr)
 	}
 }
 
-static struct musb_hdrc_config musb_config = {
-	.multipoint     = 1,
-	.dyn_fifo       = 1,
-	.num_eps        = 16,
-	.ram_bits       = 12,
-};
-
 #ifdef CONFIG_AM335X_USB0
 static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on)
 {
@@ -235,6 +276,7 @@ int arch_misc_init(void)
 #endif
 	return 0;
 }
+#endif
 
 #else	/* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */
 
Signature · 1 line
2.7.4
#28 lore raw

PATCH 14/16 arm: am33xx: Register USB controllers if DM_USB is used but not OF_CONTROL

Quoted 7 lines · Jean-Jacques Hiblot

When DM_USB is used, either the USB controllers are bound when the DTB is parsed (when OF_CONTROL is enabled) or they are bound using the U_BOOT_DEVICES() macro.
In the later case, the platform data is passed in a struct ti_musb_platdata because it cannot be read from the DTB.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/b646d824/attachment.sig>
#29 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

In reply to Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

 include/configs/am335x_evm.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/am335x_evm.h +0 -1
index 5d5b09b..3bd96b9 100644
@@ -253,7 +253,6 @@
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_DM_MMC
 #undef CONFIG_TIMER
-#undef CONFIG_DM_USB
 #endif
 
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER)
Signature · 1 line
2.7.4
#30 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

Thanks and regards,
Lokesh

Quoted 17 lines
  include/configs/am335x_evm.h | 1 -
  1 file changed, 1 deletion(-)
include/configs/am335x_evm.h +0 -1
index 5d5b09b..3bd96b9 100644
@@ -253,7 +253,6 @@
  #ifdef CONFIG_SPL_BUILD
  #undef CONFIG_DM_MMC
  #undef CONFIG_TIMER
-#undef CONFIG_DM_USB
  #endif
 
  #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER)
#31 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 10 lines · Lokesh Vutla
Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/7508b8d4/attachment.sig>
#32 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Hi Tom,

Quoted 5 lines · Tom Rini
Quoted 4 lines · Lokesh Vutla
Quoted 2 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

I'm working on reducing the difference between the am335x evm defconfigs, and also reduce their numbers if possible.

I'm having trouble testing the NOR and SPI configurations. Even with the u-boot/master branch, I can't boot.

Have you tried them recently ? If so can you provide some guidelines?

JJ

#33 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 17 lines · Jean-Jacques Hiblot

Hi Tom,

Quoted 5 lines · Tom Rini
Quoted 4 lines · Lokesh Vutla
Quoted 2 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

Quoted 7 lines

I'm working on reducing the difference between the am335x evm defconfigs, and also reduce their numbers if possible.

I'm having trouble testing the NOR and SPI configurations. Even with the u-boot/master branch, I can't boot.

Have you tried them recently ? If so can you provide some guidelines?

I haven't tried the NOR one in years (I'm not 100% sure I have a functional BBW + NOR cape honestly) and it's been a while since I did the SPI one either. You did write MLO.byteswap right?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/a75e2289/attachment.sig>
#34 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 19 lines · Tom Rini
Quoted 18 lines · Jean-Jacques Hiblot

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 7 lines · Lokesh Vutla
Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

I'm working on reducing the difference between the am335x evm defconfigs, and also reduce their numbers if possible.

Quoted 7 lines
Quoted 4 lines

I'm having trouble testing the NOR and SPI configurations. Even with the u-boot/master branch, I can't boot.

Have you tried them recently ? If so can you provide some guidelines?

I haven't tried the NOR one in years (I'm not 100% sure I have a functional BBW + NOR cape honestly) and it's been a while since I did the SPI one either. You did write MLO.byteswap right?

Haven't been this far. I can't even write to the SPI flash (not detected)

Maybe I'm not using the right platform (am335x evm + GP daughter board).

What board did you use to test those configurations ?

JJ

Quoted 1 line
#35 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 29 lines · Jean-Jacques Hiblot
Quoted 19 lines · Tom Rini
Quoted 18 lines · Jean-Jacques Hiblot

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 7 lines · Lokesh Vutla
Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

I'm working on reducing the difference between the am335x evm defconfigs, and also reduce their numbers if possible.

Quoted 7 lines
Quoted 4 lines

I'm having trouble testing the NOR and SPI configurations. Even with the u-boot/master branch, I can't boot.

Have you tried them recently ? If so can you provide some guidelines?

I haven't tried the NOR one in years (I'm not 100% sure I have a functional BBW + NOR cape honestly) and it's been a while since I did the SPI one either. You did write MLO.byteswap right?

Quoted 5 lines

Haven't been this far. I can't even write to the SPI flash (not detected)

Maybe I'm not using the right platform (am335x evm + GP daughter board).

What board did you use to test those configurations ?

... the one thing at the back of my mind is that you may need to set DIP switches for SPI flash to be present, on that board?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/00c46e8f/attachment.sig>
#36 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

Quoted 28 lines · Tom Rini
Quoted 27 lines · Jean-Jacques Hiblot
Quoted 26 lines · Tom Rini
Quoted 15 lines · Jean-Jacques Hiblot

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 7 lines · Lokesh Vutla
Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

The main reason for _usbspl_defconfig is size constraints, we can't (or at least, couldn't before) fit all the various methods into a single binary.

Quoted 7 lines

I'm working on reducing the difference between the am335x evm defconfigs, and also reduce their numbers if possible.

I'm having trouble testing the NOR and SPI configurations. Even with the u-boot/master branch, I can't boot.

Have you tried them recently ? If so can you provide some guidelines?

I haven't tried the NOR one in years (I'm not 100% sure I have a functional BBW + NOR cape honestly) and it's been a while since I did the SPI one either. You did write MLO.byteswap right?

Quoted 7 lines
Quoted 5 lines

Haven't been this far. I can't even write to the SPI flash (not detected)

Maybe I'm not using the right platform (am335x evm + GP daughter board).

What board did you use to test those configurations ?

... the one thing at the back of my mind is that you may need to set DIP switches for SPI flash to be present, on that board?

I found it. There is a DIP switch on the daughter board too that you need to set.

For the record, in case someone needs it someday: on AM335x EVM, SPI boot work with Profile #2. The profile is selected with the DIP switch located on the GP daughter board.

Thanks,

JJ

Quoted 1 line
#37 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

In reply to Lokesh Vutla
Quoted 10 lines · Lokesh Vutla
Quoted 4 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

---

With this, I guess we can merge am335x_evm_usbspl_defconfig into am335x_evm_defconfig? or am I missing something?

Yes I'm working on it.

I'm hoping to be able to reduce the number of defconfigs.

JJ

Quoted 21 lines

Thanks and regards,
Lokesh

Quoted 16 lines

  include/configs/am335x_evm.h | 1 -

  1 file changed, 1 deletion(-)
include/configs/am335x_evm.h +0 -1
index 5d5b09b..3bd96b9 100644
@@ -253,7 +253,6 @@
   #ifdef CONFIG_SPL_BUILD
   #undef CONFIG_DM_MMC
   #undef CONFIG_TIMER
-#undef CONFIG_DM_USB
   #endif
     #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USB_ETHER)
 
#38 lore raw

PATCH 15/16 configs: am335x_evm: Do not disable DM_USB in SPL

In reply to Jean-Jacques Hiblot
Quoted 3 lines · Jean-Jacques Hiblot

DM_USB is now supported in the SPL. Do not undef it

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/bac7f219/attachment.sig>
#39 lore raw

PATCH 16/16 configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPl

In reply to Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for this platform. Also enable RNDIS boot support (SPL load u-boot over USB RNDIS)

---

 configs/am335x_boneblack_vboot_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/am335x_boneblack_vboot_defconfig +8 -0
index d625599..2a7e72c 100644
@@ -13,7 +13,11 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 # CONFIG_SPL_NAND_SUPPORT is not set
+CONFIG_SPL_NET_SUPPORT=y
+CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL"
 CONFIG_SPL_OS_BOOT=y
+CONFIG_SPL_USB_GADGET_SUPPORT=y
+CONFIG_SPL_USB_ETHER=y
 CONFIG_AUTOBOOT_KEYED=y
 CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
 CONFIG_AUTOBOOT_DELAY_STR="d"
@@ -31,6 +35,7 @@ CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_DM_I2C=y
+CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_SPI_FLASH=y
@@ -44,8 +49,11 @@ CONFIG_OMAP3_SPI=y
 CONFIG_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_TI=y
 CONFIG_USB_MUSB_DSPS=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
Signature · 1 line
2.7.4
#40 lore raw

PATCH 16/16 configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPl

Quoted 8 lines · Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for this platform. Also enable RNDIS boot support (SPL load u-boot over USB RNDIS)

---

 configs/am335x_boneblack_vboot_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)

In _this_ case I don't think it's worthwhile. We should probably do it for the main boneblack config tho.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/434f576e/attachment.sig>
#41 lore raw

PATCH 16/16 configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPl

Quoted 5 lines · Tom Rini
Quoted 3 lines · Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for this platform. Also enable RNDIS boot support (SPL load u-boot over USB RNDIS)

Quoted 9 lines
Quoted 5 lines

---

  configs/am335x_boneblack_vboot_defconfig | 8 ++++++++
  1 file changed, 8 insertions(+)

In _this_ case I don't think it's worthwhile. We should probably do it for the main boneblack config tho.

Actually I was thinking that we can drop both the beaglebone specific configs. am335x_evm_defconfig support BBB and all other variants.. Any reason to still have these specific configs?

Thanks and regards,
Lokesh

#42 lore raw

PATCH 16/16 configs: am335x_boneblack_vboot: enable DM_USB and RNDIS boot in SPl

Quoted 14 lines · Lokesh Vutla
Quoted 11 lines · Tom Rini
Quoted 8 lines · Jean-Jacques Hiblot

Enable DM_USB and DM_USB_GADGET for this platform. Also enable RNDIS boot support (SPL load u-boot over USB RNDIS)

---

 configs/am335x_boneblack_vboot_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
Quoted 7 lines
Quoted 3 lines

In _this_ case I don't think it's worthwhile. We should probably do it for the main boneblack config tho.

Actually I was thinking that we can drop both the beaglebone specific configs. am335x_evm_defconfig support BBB and all other variants.. Any reason to still have these specific configs?

So, since we have _evm defaulting to FAT env now, I think we only need the, or a, _vboot example config still.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181122/d54af09b/attachment.sig>
#43 lore raw

cover Add support for DM_USB and DM_USB_DEV to TI's am335x and am43xx_evm platforms

In reply to Jean-Jacques Hiblot
Quoted 19 lines · Jean-Jacques Hiblot

This series applies on top of the series "Add support for DM_USB and DM_USB_DEV to TI's K2G platforms" and "Add support for DM_USB and DM_USB_DEV for TI's DRA7 EVMs and AM57 EVMs platforms."

The am433x platforms can use the generic DWC3 driver instead of relying on the dwc3-xhci driver.
The am335x platforms use the musb controller. With a bit of work it can be made to support DM as well. This series only enables DM_USB and DM_USB_GADGET on am335x_boneblack_vboot. The changes for the other am335x based platforms will come in a subsequent series that reworks the configs of several TI boards.

This is part of a work to move all TI's platforms to support DM_USB and DM_USB_DEV.
As a side effect it makes it easy to support the full USB RDNIS bootflow (bootrom loads SPL over RNDIS, SPL loads u-boot over RNDIS, u-boot loads the images over RNDIS)

Quoted 5 lines

This series is made of 3 parts:
- some generic changes: rename DM_USB_DEV in DM_USB_GADGET and create UCLASS_USB_GADGET for the USB peripheral drivers.
- am437x support for DM_USB and DM_USB_GADGET
- am335x support for DM_USB and DM_USB_GADGET

Real glad to see this work happening, thanks for that. I'll let Lukasz handle the reviews since he's doing the gadget stuff.

Signature · 2 lines
Best regards,
Marek Vasut