Ravaz Posted October 22, 2018 Posted October 22, 2018 Hello, I'm enabling g_ether driver on tinker board. The driver works and I'm able to emulate an Ethernet adapter on my PC when I connect it to the tinker micro USB port. This only works if the micro USB connection exists before powering ON the board. If I connect it while the device is already running nothing happens. This behavior may be related to the following kernel path: https://patchwork.kernel.org/patch/10535905/ Is there any parameter I can add to avoid the USB from going to hibernate state? Or would it be possible to add the mentioned patch to armbian build tool? Thanks!
Ravaz Posted October 23, 2018 Author Posted October 23, 2018 When I stat the board without the USB cable connected I get this error on dmesg (running on kernel 4.4.161-rockchip): [ 1.016700] dwc2 ff580000.usb: dwc2_core_reset() HANG! Soft Reset GRSTCTL=80000001 [ 1.127654] dwc2 ff580000.usb: dwc2_wait_for_mode: Couldn't set device mode Googling this message brought me to those bugs: https://www.spinics.net/lists/arm-kernel/msg564614.html Any patch to solve this issue?
TonyMac32 Posted October 23, 2018 Posted October 23, 2018 Hello, I have been re configuring my build environment and trying to fix some bugs, I should be able to begin messing with this. Do you have the ability to build a kernel yourself? Check out docs.armbian.com for details.
Ravaz Posted October 24, 2018 Author Posted October 24, 2018 Yes I'm able to compile it myself, I already did it to add few drivers (g_ether and RTC PCF2127) and to create an image using btrfs file system. Thanks a lot.
Ravaz Posted December 17, 2018 Author Posted December 17, 2018 I recompiled the full image with default and next kernel, but still no luck. I also modified the device tree to force USB to peripheral. (dr_mode="peripheral"): usb@ff580000 { compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2"; reg = <0x0 0xff580000 0x0 0x40000>; interrupts = <0x0 0x17 0x4>; clocks = <0x7 0x1c1>; clock-names = "otg"; dr_mode = "peripheral"; g-np-tx-fifo-size = <0x10>; g-rx-fifo-size = <0x118>; g-tx-fifo-size = <0x100 0x80 0x80 0x40 0x20 0x10>; g-use-dma; phys = <0x50>; phy-names = "usb2-phy"; status = "okay"; phandle = <0xcf>; }; The g_ether gadget only works if the cable is connected during boot, connecting the USB cable afterward has no effect. not even a single message on dmesg. It seems that the USB ID pin must be tied to GND during boot process, otherwise the USB OTG cannot enter peripheral mode anymore. Any suggestion on what I should try next?
Recommended Posts