U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: kever.yang@rock-chips.com
Cc: djw@t-chip.com.cn, u-boot@lists.denx.de,
	Fabio Estevam <festevam@nabladev.com>
Subject: [PATCH v2 5/5] roc-pc-plus-rk3399: Enable USB Mass Storage support
Date: Wed,  1 Jul 2026 14:58:00 -0300	[thread overview]
Message-ID: <20260701175800.40141-5-festevam@gmail.com> (raw)
In-Reply-To: <20260701175800.40141-1-festevam@gmail.com>

From: Fabio Estevam <festevam@nabladev.com>

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 <festevam@nabladev.com>
---
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


      parent reply	other threads:[~2026-07-01 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 17:57 [PATCH v2 1/5] roc-pc-rk3399: Enable redundant SPI flash environment Fabio Estevam
2026-07-01 17:57 ` [PATCH v2 2/5] roc-pc-rk3399: Introduce a common defconfig Fabio Estevam
2026-07-01 17:57 ` [PATCH v2 3/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam
2026-07-01 17:57 ` [PATCH v2 4/5] roc-pc-plus-rk3399: Introduce new variant Fabio Estevam
2026-07-01 17:58 ` Fabio Estevam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260701175800.40141-5-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=djw@t-chip.com.cn \
    --cc=festevam@nabladev.com \
    --cc=kever.yang@rock-chips.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox