From: Fabio Estevam <[email protected]> Configure the USB0 DWC3 controller for peripheral mode and enable the required USB gadget options to support the U-Boot 'ums' command on the ROC-RK3399-PC Plus.
The 'ums' command provides a convenient way to expose the on-board eMMC as a USB Mass Storage device to a host computer, simplifying development, image installation and recovery without requiring removable media or network access. Limit the controller to High-Speed operation by using the USB2 OTG PHY. Signed-off-by: Fabio Estevam <[email protected]> --- Changes since v1: - None. arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi | 7 +++++++ configs/roc-pc-plus-rk3399_defconfig | 3 +++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi index 7d5af3e234da..f613d75646c3 100644 --- a/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi +++ b/arch/arm/dts/rk3399-roc-pc-plus-u-boot.dtsi @@ -7,3 +7,10 @@ &dc_12v { /delete-property/ vin-supply; }; + +&usbdrd_dwc3_0 { + dr_mode = "peripheral"; + maximum-speed = "high-speed"; + phys = <&u2phy0_otg>; + phy-names = "usb2-phy"; +}; diff --git a/configs/roc-pc-plus-rk3399_defconfig b/configs/roc-pc-plus-rk3399_defconfig index 4ec2f7d44b5f..f3d78c53e672 100644 --- a/configs/roc-pc-plus-rk3399_defconfig +++ b/configs/roc-pc-plus-rk3399_defconfig @@ -2,3 +2,6 @@ CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-roc-pc-plus" CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-plus.dtb" CONFIG_SPI_FLASH_XMC=y +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_USB_FUNCTION_FASTBOOT is not set +CONFIG_USB_GADGET_DOWNLOAD=y -- 2.43.0

