Hi,
I am currently using the USB OTG port on the Rock Pi 4 as a mass storage device. I got the port to work as OTG, however it only works if I flip the OTG selector switch on and off (or if I start the Rock Pi with the switch as host and then flip it to device).
This behavior can be observed both with the Ubuntu Server and Debian images. After booting I configure the g_mass_storage module so that a file can be used as a partition:
sudo modprobe g_mass_storage file=/mnt/mass_storage stall=1 iSerialNumber=aaaaaaa removable=y
However, it does not get detected until the switch has been flipped.
After some investigation, it seems to me that something in here regarding the phy-ff770000.syscon:usb2 is not working properly:
[ 1.662051] phy phy-ff770000.syscon:usb2-phy@e450.0: Looking up phy-supply from device tree
[ 1.662200] vcc5v0_host: could not add device link phy-ff770000.syscon:usb2-phy@e450.0 err -2
[ 1.662534] phy phy-ff770000.syscon:usb2-phy@e450.1: Looking up phy-supply from device tree
[ 1.662546] phy phy-ff770000.syscon:usb2-phy@e450.1: Looking up phy-supply property in node /syscon@ff770000/usb2-phy@e450/otg-port failed
[ 1.662765] phy phy-ff770000.syscon:usb2-phy@e450.1: Looking up vbus-supply from device tree
[ 1.662775] phy phy-ff770000.syscon:usb2-phy@e450.1: Looking up vbus-supply property in node /syscon@ff770000/usb2-phy@e450/otg-port failed
[ 1.662788] phy phy-ff770000.syscon:usb2-phy@e450.1: Failed to get VBUS supply regulator
[ 1.663531] phy phy-ff770000.syscon:usb2-phy@e460.2: Looking up phy-supply from device tree
[ 1.663588] vcc5v0_host: could not add device link phy-ff770000.syscon:usb2-phy@e460.2 err -2
[ 1.663853] phy phy-ff770000.syscon:usb2-phy@e460.3: Looking up phy-supply from device tree
[ 1.663864] phy phy-ff770000.syscon:usb2-phy@e460.3: Looking up phy-supply property in node /syscon@ff770000/usb2-phy@e460/otg-port failed
[ 1.664076] phy phy-ff770000.syscon:usb2-phy@e460.3: Looking up vbus-supply from device tree
[ 1.664086] phy phy-ff770000.syscon:usb2-phy@e460.3: Looking up vbus-supply property in node /syscon@ff770000/usb2-phy@e460/otg-port failed`
Because once I flip the switch charger is set to USB_FLOATING_CHARGER and everything starts to work again:
[ 691.550549] rockchip-dwc3 usb0: USB HOST connected
[ 692.423924] xhci-hcd xhci-hcd.8.auto: remove, state 4
[ 692.423984] usb usb8: USB disconnect, device number 1
[ 692.429824] xhci-hcd xhci-hcd.8.auto: USB bus 8 deregistered
[ 692.430410] xhci-hcd xhci-hcd.8.auto: remove, state 4
[ 692.430453] usb usb7: USB disconnect, device number 1
[ 692.431561] xhci-hcd xhci-hcd.8.auto: USB bus 7 deregistered
[ 692.432267] rockchip-dwc3 usb0: USB unconnected
[ 694.068386] phy phy-ff770000.syscon:usb2-phy@e450.1: charger = USB_FLOATING_CHARGER
For reference this is the uname -a of the system currently:
Linux rockpi4b 4.4.154-112-rockchip-gfdb18c8bab17 #1 SMP Thu Jan 21 04:50:13 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
What can be done here?, I have been trying to disable the usb subsystem at runtime, but no cigar. I have also tried to recompile the kernel from source using radaxa’s tutorial (4.4 and mainline) but the behavior is the same.
Any help will be greatly appreciated. Thank a lot.
Have a nice day.
Edit: I will also add the whole dmesg output, it has to be a pastebin since there is a character limit: