Open kakurasan opened 3 years ago
@ghollingworth @timg236 This firmware changed an usb_mdio_write. The value in the "good" firmware was unconditionally set to the value that is now set when in USB_MODE_DEVICE.
Does this ring a bell? Is this caused by wrong type of cable?
I'm not familiar with this PHY but from the commit comments, it looks like it could by a combination of board + cable from the git history
I'm running g_ether on a Pi Zero and Pi 3B+ as a reference for Pi 4B. I don't have a PiZero W to hand, although, it might only impact some boards because g_ether on Pi Zero W is quite popular and lots of people will be running this on newer firmware.
This firmware changed an usb_mdio_write.
is there any information on why PHY is in use? why cant linux just manage the PHY directly?
Because there is no driver and no documentation (yes even we don't have any documentation for this)!
The bug looks exactly the same as the one I was diagnosing and went away when I changed the USB cable for a good quality one. The single-ended impedance of the poor cable was 2x what the USB spec said it was supposed to be.
Even without this change I still found some Pi zeroes would not enumerate, so the change pointed at here is not a fix, only 'a fix for this particular device'
The issue is actually in the Pi 3's USB hub, it is detecting a disconnect shortly after a connection because a reflection from the Pi Zero makes the signal drop below the minimum level (which normally signifies a disconnect). The hub is supposed to ignore this within some time of the initial connection but clearly doesn't.
I was unable to reproduce this if I stuck a hub in the way or used a better quality USB cable.
semi-related, if i let the closed/official bootcode.bin
do a network boot on a pi2, and then the custom start.elf
doesnt change the PHY configs
linux is able to do usb activity, but its silently corrupting all tcp packets coming over the network!
but i did find a set of phy configs elsewhere, that entirely eliminate that issue
that implies that its a problem between the phy and dwc? and that the phy was validating the checksums on the usb packets, but then corrupting on-route to the dwc?
Because there is no driver
a driver could be written for linux, but without the things rpi engineers have figured out, it would just be a big ugly ball of magic numbers with no reason behind their choices
Describe the bug Only when
*.{bin,dat,elf}
firmware files (in/boot
) are newer than 32c2899, my PC or Pi 3B+ doesn't detect my Zero WH (USB Ethernet Gadget).When I replace these files with 32c2899, my PC/3B+ successfully detects USB Ethernet Gadget (kernel 5.4.83+ from Raspberry Pi OS "2021-01-11" works). Without the old firmware files, it doesn't work. That's why I think this is a bug in firmware.
To reproduce
dtoverlay=dwc2,dr_mode=peripheral
toconfig.txt
g_ether
module, and setup networkingdmesg
on PC and check whether it detects USB Ethernet GadgetExpected behaviour USB Ethernet Gadget is detected.
Actual behaviour USB Ethernet Gadget is not detected.
System
Raspberry Pi Zero W Rev 1.1
fromdmesg
output)Logs When problematic firmware is used, there is no related
dmesg
output.Additional context The last "good" firmware files are:
"2017-06-21" release contains them and it works out of the box.
The first "problematic" firmware is 0f315f8 (firmware: Revert Change USB PHY settings to make device mode work correctly.).