Jump to content

USB Device Mode on RockPro64


R0b0t1

Recommended Posts

Hello, using the image provided at https://www.armbian.com/rockpro64/ the board works when booted via uSD card but not via MMC. There appears to be no device mode USB drivers installed. I pulled the kernel sources with `armbian-config` and compiled them myself making sure to select dual-mode support for the DWC2 and DWC3 drivers. The kernel boots after install, but I still see nothing in /sys/class/udc and am unable to see any dwc2/3 drivers (save dwc2_pci and some dwc3 i3c drivers).

 

I'm able to load libcomposite, the configfs driver, but that does not pull in a USB device mode driver. I'm unable to attach armbian monitor status right now but will update my post with it.

Board: Not on the list
Link to comment
Share on other sites

I made progress. The default device tree sets the first dwc3 controller as "otg." Unfortunately this seems to not have much effect. I've tried looking for a software switch and also tried plugging the board in as a device. How do you set this without needing a reboot?

 

Changing the two DWC3 nodes in the file "arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi:"

 

&usbdrd3_0 {
        status = "okay";
};

&usbdrd_dwc3_0 {
        status = "okay";
        dr_mode = "peripheral";
};

&usbdrd3_1 {
        status = "okay";
};

&usbdrd_dwc3_1 {
        status = "okay";
        dr_mode = "peripheral";
};

 

They are both listed in /sys/class/udc:

# ls /sys/class/udc
fe800000.usb  fe900000.usb

 

But, again, I'd like to change mode without needing to reboot. I'm also unsure how compatible the Type-C port is.

Link to comment
Share on other sites

I've some more observations. Checking the code in drivers/usb/dwc3/core.c I was

unable to find what actually allows you to select the mode if specifying OTG.

I have devices in /sys/class/udc and they function properly via configfs when
plugged into a USB2 only port. If I plug them into a superspeed port I get
nothing in dmesg on the host side. At first, I did get a response on the host, in
the form of:

[591550.770819] usb 1-1.2: new full-speed USB device number 76 using xhci_hcd
[591550.870962] usb 1-1.2: device descriptor read/64, error -32
[591551.078865] usb 1-1.2: device descriptor read/64, error -32
[591551.286875] usb 1-1.2: new full-speed USB device number 77 using xhci_hcd
[591551.386873] usb 1-1.2: device descriptor read/64, error -32
[591551.594859] usb 1-1.2: device descriptor read/64, error -32
[591551.703160] usb 1-1-port2: attempt power cycle


However now I get no driver activity when binding the UDC in configfs or
loading or unloading the respective modules. Kernel is 5.7.15 w/ patches.

It doesn't seem like bad USB-C wiring fried port or tripped a polyfuse, the

port still works after attempting USB3 device mode.

Link to comment
Share on other sites

I got this working on an M4B but should be the same for you.

fe800000.usb is USB phy 0

fe900000.usb is USB phy 1

 

Make sure you're setting up the UDC with the correct phy. When I setup my gadgets manually I do :

echo fe800000.usb > UDC # phy 0

 

This is the output of dmesg on my PC when I connect :

 

[970432.082528] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[970432.082529] usb 1-2.3: Product: Ethernet/audio
[970432.082530] usb 1-2.3: Manufacturer: Audio Injector.net

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines