Hello Roger, On 28-11-2024 18:15, Roger Quadros wrote: > > > On 26/11/2024 14:03, Siddharth Vadapalli wrote: >> Hello, >> >> This series adds support for USB DFU boot on TI's AM62A SoC which has >> two instances of DWC3 USB Controllers namely USB0 and USB1. The USB0 >> instance of the USB Controller supports USB DFU boot: >> ROM => tiboot3.bin => tispl.bin => u-boot.img >> >> USB DFU Boot requires the USB Controller to be configured for Gadget >> mode of operation. Since the USB0 instance of the DWC3 USB Controller >> supports both Host and Gadget modes of operation via the Type-C interface >> on the AM62A7-SK board, the device-tree specifies the "dr_mode" as "OTG". >> However, there is currently no support for dynamically switching the "mode" >> from Host to Gadget and vice-versa with the help of a state-machine. >> The OTG mode is treated as a separate mode in itself rather than being >> treated as an intermediate stage before assuming the Host/Gadget mode. >> Due to this, USB DFU boot via the Type-C interface doesn't work as the >> USB Controller hasn't been appropriately configured for Device/Gadget >> mode of operation. One option is to change the device-tree to specify >> "dr_mode" as "peripheral" and force the controller to assume the Device >> role. This will imply that the U-Boot device-tree for AM62A diverges >> from its Linux counterpart. Therefore, with the intent of keeping the >> device-tree uniform across Linux and U-Boot, and at the same time, in >> order to enable USB DFU boot in "OTG" mode with the DWC3 Controller, >> the first patch in this series sets the "mode" on the basis of the >> caller function, rather than using the "dr_mode" property in the >> device-tree. There are only two callers of "dwc3_generic_probe()", >> each of which clearly specify the expected mode of configuration. >> This will enable both Host and Device mode of operation based on the >> command executed by the user, thereby truly supporting "OTG" >> functionality when the USB Controller supports it. > > We don't really support OTG state machine. All you are supporting is > user initiated role change.
I should have probably used the term "Dual Role" instead of "OTG". I meant to say that the controller can be used both as Host and Device based on the command executed by the user, if the controller's dr_mode is "otg". I am aware that we don't support the OTG state machine in U-Boot unlike Linux, which is why I have posted this series as a workaround to utilize both Host and Device modes in the interim. [...] -- Regards, Siddharth.