u-boot: GENIO: Fix USB Ethernet Gadget driver bind
Link: https://phabricator.collabora.com/T54811
This commit picks upstream patch series refactoring the USB ethernet driver to allow manually binding the gadget driver.
As mentioned in commit ed62305b ("u-boot: GENIO: configs: 510/700/1200 EVK: Disable USB Ethernet Gadget") USB Ethernet Gadget is causing enumaration errors on the host side.
To workaround this issue, upstream [0] approach is followed, i.e.:
- drop usb_ether_init() from board files, as it is deprecated and causing the enumeration errors.
- use bind command to enable usb ethernet when required.
However, while binding the driver, a NULL deref bug was hit. See the following error log testing on Genio 700 EVK:
=> bind /soc/usb@11200000/ssusb@11200000 usb_ether
=> dhcp
ethernet@11021000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110using mtu3-gadget, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready
dev_get_priv: null device
"Synchronous Abort" handler, esr 0x96000004
elr: 000000004c060200 lr : 000000004c05f9a0 (reloc)
elr: 00000000fff50200 lr : 00000000fff4f9a0
x0 : eafffffeeafffffe x1 : 0000000000000000
x2 : 00000000ff9eedb0 x3 : 000000000000007b
x4 : 00000000ff9eee70 x5 : 00000000ff9f34a0
x6 : 000000000000007b x7 : 00000000ff9e9240
x8 : 0000000000000010 x9 : 0000000000000008
x10: fffffffffffffff0 x11: 0000000000000000
x12: 0000000000000002 x13: 00000000ff9f96c0
x14: 0000000000000000 x15: 0000000000000200
x16: 00000000fff35bac x17: 0000000000000000
x18: 00000000ff9eedb0 x19: 0000000000000000
x20: 0000000000000bb8 x21: 000000000002773b
x22: 0000000100001000 x23: 000000010000b000
x24: 000000010000b000 x25: 00000000ff9fdf50
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000ff9e9230
Code: a90153f3 aa0103f3 f90013f5 f9400820 (b9500000)
[0] https://patchwork.ozlabs.org/project/uboot/patch/20240726083102.380719-1-admin@hifiphile.com/
Signed-off-by: Ariel D'Alessandro ariel.dalessandro@collabora.com
Edited by Ariel D'Alessandro