Page MenuHomeFreeBSD

mvneta: no longer panic on boot when mii cannot attach
Needs ReviewPublic

Authored by bz on Aug 19 2021, 5:12 PM.

Details

Reviewers
loos
manu
Summary

In mvneta_fdt_phy_acquire() if we find a phy_addr add an extra
check if the device the phy node is attached to is different from
ourselves (mvneta).
If so remember the other device in the newly introduced "phy_dev"
variable in the softc (which otherwise defaults to ourselves) and
advertise the switch under bootverbose.

Use the phy_dev rather than self when attaching to mii to have the
correct device.

Add Marvell 88E151[0248] Gigabit PHY to mii framework so e1000phy
detects it and add the gpiomdio and mii_bitbang to the std.marvell
config. The latter is needed to fullfill the explicit requirement
of gpiomdio in conf/files.

With this mvneta no longer panics on boot (during detach, which is a
different problem) if it cannot probe/attach the PHY on this specific hw.
Previously I used the following line in loader as a workaround:
exec="fdt prop /soc/internal-regs@d0000000/ethernet@30000/status disabled"
but that cannot be shared with the Espressobin as there @30000 is
the switch (given no extra port(s)).

It seems the copper port is working nicely with this. The SPF port
remains untested and probably needs more logic in e1000phy to detect
media and switch and handle cables plugged into both ports.

Tested on: SG-2100

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 41141
Build 38030: arc lint + arc unit

Event Timeline

bz requested review of this revision.Aug 19 2021, 5:12 PM

You probably have a better and more complete solution to this problem already but I got tired that I couldn't boot plain HEAD on my SG-2100 without always having to add the fdt quirk to loader.conf.
I'll not commit this unless you think its a good idea to do so as I don't want to cause you any conflicts.

bz changed the visibility from "Public (No Login Required)" to "committers (Project)".Aug 19 2021, 5:18 PM
bz changed the edit policy from "All Users" to "committers (Project)".
bz changed the visibility from "committers (Project)" to "Public (No Login Required)".Oct 13 2021, 7:09 PM
bz added a subscriber: dsl_mcusim.org.
bz removed a subscriber: dsl_mcusim.org.

I know it's been almost 2 months, sorry for the delay. Luiz is about to go on vacation for a few days, hopefully he'll review this once he gets back