Appendix · reference

Synopsys DWC3 USB controller

USB3 OTG block running as a CDC Ethernet gadget — the only path SSH currently flows through.

DWC3 is the Synopsys USB3 dual-role controller embedded in RK3399. On the PinePhone Pro, the FreeBSD port currently runs it locked in peripheral mode and exposes a CDC Ethernet gadget on ue0. Plug the phone into a host machine, configure 10.0.0.1 on the host and 10.0.0.2 on the phone, and ssh pinephone works. That gadget is the only persistent network path on the bench until WiFi or the modem take over — so this driver carries a lot of weight.

Identity

PropertyValue
BlockSynopsys DWC3 USB3 controller
MMIO base0xfe800000
GCTL register0xfe80c110 (PRTCAP bits [13:12]: 1=host, 2=device, 3=OTG)
DTS compatiblesnps,dwc3 + rockchip,rk3399-dwc3 glue
dr_modeperipheral — see DTS line 1353 of rk3399-pinephone-pro.dts
Linux driverdrivers/usb/dwc3/
FreeBSD baselinesys/dev/usb/controller/dwc3.c

Driver

● working CDC Ethernet gadget on ue0 is stable. A 2026-05-05 local HTTP sanity test downloaded a 64 MiB file from the host to the phone over ue0 three times:

23.30 MB/s
23.43 MB/s
23.49 MB/s

That is about 186-188 Mbit/s in the same direction as the WiFi HTTP fetch test, so the current 42-43 KB/s native-WiFi ceiling is not a generic TCP, userspace, or DWC3 gadget bottleneck.

Three files cooperate under our overlay:

What got built

The gadget path is local to this tree — there was no functional CDC Ethernet gadget in mainline FreeBSD’s DWC3 driver. Highlights from the commit log:

The full narrative is in Essay 04: USB-Ethernet up and Essay 05: DWC3 gadget from scratch.

Open work

Static role switching is now solved at the controller level via hw.dwc3.force_host=1 ( 16a9f5e dwc3: add host-mode boot override ), and the host attach path emits forensic registers and a success/failure line ( 5a1cb12 dwc3: log host-attach state unconditionally ). On 2026-05-08 a forced-host kernel attached xHCI cleanly, advertised SuperSpeed at the root, and — with the FUSB302 in source role — enumerated a real USB hub: a VIA Labs USB 2.0 hub IC, an ASIX AX88179A Gigabit-Ethernet adapter, a Norelsys NS1081 mass-storage bridge, a Chicony USB keyboard, and the Anker hub’s own management interface. See appendix: USB-C source role and host-mode bring-up.

Two of the three pieces from the morning’s open list landed on the same day:

What is still open:

  1. The DTS is still dr_mode = "peripheral". Changing it to otg is only useful once a runtime role-switch bridge can re-role the controller from FUSB302 state changes; the boot tunable is the right shape for now.
  2. The same boot-tunable shape applies to rk_typec_phy.flip. A cable reseat that flips orientation silently breaks SS until the next reboot. The right answer is a notifier from fusb302(4) that re- inits the phy with the live orientation.

Once the controller and PHY can stay in sync with the FUSB302 role, DisplayPort alt-mode is the next layer up — PD VDM negotiation, TCPHY DP lane reconfig, and a FreeBSD cdn_dp DRM bridge. See the cross-references in USB-PD / fusb302 and essay 15 — what’s next.

Status

QuestionAnswer
Probes?Yes
Gadget mode (ue0)?Working — CDC ECM stable
Host mode?Working — hw.dwc3.force_host=1 + xHCI attach + downstream USB-2 and USB-3 device enumeration on 2026-05-08
OTG / role switch?Boot-time only via hw.dwc3.force_host; no FUSB302-driven dynamic role switch yet
SuperSpeed lanes?Working with hw.rk_typec_phy.usb3_enable=1 + matching flip; downstream hub came up at 5.0 Gbps. Boot-tunable orientation, no dynamic flip on cable reseat
USB-PD coupling?Sink direction works; source role enables VBUS but does not yet drive PD VDM / alt-mode