[A06] Type-C USB port peripheral mode tested working

What does it do?

You can now connect A06 to a computer via the type-c port.
It will show up on the computer as… nothing. Read on.

Is this USB-otg functionality?

No. OTG is dual-role, which can function as both a host and a peripheral device.
DevTerm lacks the hardware (e.g. fusb302) to support the host role.
Peripheral only.

What does it do?

Enable USB gadget subsystem and libcomposite kernel module. It allows DevTerm to present itself to the computer as:

  • USB network adapter
  • Thumbdrive
  • Audio/midi interface
  • Serial port/GSM modem
  • Camera
  • Video adapter
  • Keyboard/mouse
  • Printer

I’ve done some preliminary test in mass storage mode. Bandwidth looks pretty good for usb2.0, some 35MB/s on wire.

A little bit of technical details

Each dwc3 controller is wired up to two PHYs:

(Image taken from [RK3399][Android7.1] USB模块中的控制器和PHY_KrisFei的博客-CSDN博客)

Because DevTerm does not hook up usb3.0 signals, we should only activate the USB2.0 OTG PHY, which is provided by u2phy0.

@guu @m4xm4n


Interesting, and looks to be a useful thing.

Can only the A06 do this or will A04 or the rPi adapter be capable of it as well?

1 Like

We don’t know until clockworkpi releases the schematics for them :slight_smile:

Does anyone know what’s holding them back?

Type-C Port: TYPEC0_DP/DM → USB0_DP/DM
Type-A Port: HOST0_DP/DM → USB0_DP/DM → GL850G (USB Hub) → DP1/DM1

Amazing work, can’t wait to try all the patches you provided. I think it would be nice to mention also @Armbian so they can include them in future releases.

Just finished compiling the kernel on my frankenstein system in about 4 hours :joy:

Linux clockworkpi-a06 5.15.82-rockchip64 #trunk SMP PREEMPT Wed Dec 14 14:39:13 WET 2022 aarch64 aarch64 aarch64 GNU/Linux

OS: Armbian (23.02.0-trunk) aarch64 
Host: Clockworkpi A06 
Kernel: 5.15.82-rockchip64