* [PATCH] arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus
@ 2026-07-21 3:00 Fabio Estevam
2026-07-21 3:13 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2026-07-21 3:00 UTC (permalink / raw)
To: heiko
Cc: robh, krzk+dt, conor+dt, devicetree, linux-arm-kernel,
linux-rockchip, Fabio Estevam
From: Fabio Estevam <festevam@nabladev.com>
The USB3 OTG controller on the rk3399-roc-pc-plus is forced to host
mode. As a result, it does not register a UDC and USB gadget drivers
fail with:
UDC core: g_mass_storage: couldn't find an available UDC
Describe the controller as a USB role switch and select peripheral as
the default role. This makes DWC3 register a UDC when no external role
provider has selected a host role, while retaining OTG operation and
both the USB2 and USB3 PHYs inherited from the SoC dtsi.
Tested by binding g_mass_storage and exposing the onboard eMMC to a
Linux host.
Fixes: 6d9a7bd6a13c ("arm64: dts: rockchip: add support for Firefly ROC-RK3399-PC-PLUS")
Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
index 7e8039b19be7..c733429fd5d9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
@@ -270,7 +270,9 @@ bluetooth {
};
&usbdrd_dwc3_0 {
- dr_mode = "host";
+ dr_mode = "otg";
+ role-switch-default-mode = "peripheral";
+ usb-role-switch;
status = "okay";
};
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus
2026-07-21 3:00 [PATCH] arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus Fabio Estevam
@ 2026-07-21 3:13 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-07-21 3:13 UTC (permalink / raw)
To: Fabio Estevam; +Cc: devicetree, conor+dt, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Adding `usb-role-switch` breaks existing host mode and automatic OTG role switching for the DWC3 controller due to a missing OF graph connection.
--
--- Patch [1]: [PATCH] arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus ---
commit 083559b8c4d210ad85e3dc07a4f89e6cd4079c56
Author: Fabio Estevam <festevam@nabladev.com>
arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus
This commit describes the DWC3 controller as a USB role switch and selects
peripheral as the default role. This allows DWC3 to register a UDC while
retaining OTG operation.
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
> --- a/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
[ ... ]
> @@ -203,7 +203,9 @@ &uart0 {
> };
>
> &usbdrd_dwc3_0 {
> - dr_mode = "host";
> + dr_mode = "otg";
> + role-switch-default-mode = "peripheral";
> + usb-role-switch;
[Severity: High]
Does adding the usb-role-switch property here break existing host mode
functionality on the Type-C port?
When usb-role-switch is present, dwc3_drd_init() bypasses its internal
hardware OTG initialization and waits indefinitely for a software role switch
event.
Without an OF graph connection (a port/endpoint mapping) from the fusb0
Type-C controller to this dwc3 node, the tcpm framework won't be able to
locate the USB role switch via fwnode_usb_role_switch_get() when a user
plugs in a host adapter.
As a result, the role switch lookup fails and the controller might get
permanently stuck in the default peripheral mode.
Should an OF graph connection be added between the Type-C controller and
this dwc3 node so the role switch events can be delivered correctly?
> status = "okay";
> };
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260721030043.84691-1-festevam@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-21 3:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 3:00 [PATCH] arm64: dts: rockchip: Enable USB device mode on rk3399-roc-pc-plus Fabio Estevam
2026-07-21 3:13 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox