Page MenuHomeFreeBSD

Add support for bcm54213PE in brgphy.

Authored by on Jun 13 2020, 12:25 AM.



This chip is used in the Rasperry Pi 4, and is supported by the if_genet
driver. Currently we use the ukphy mii driver, this patch switches over
to the brgphy mii driver instead. To support the rgmii-rxid phy mode,
which is now the default in the Linux dtb, we add support for clock

These changes are taken from OpenBSD and NetBSD, except for the bailout
in brgphy_bcm54xx_clock_delay() in rgmii mode, which I found necessary
after testing.

Test Plan

I tested this on a Raspberry Pi 4, 8 GB model, with two dtbs. One dtb was the latest dtb with the rgmii-rxid phy mode, the other was an older dtb with the rgmii phy mode. I transfered some data over a local network with iperf3 and also sent a few hundred pings to a remote server.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

karels added inline comments.
318 ↗(On Diff #73055)

Did you experiment with leaving out MIIF_DOPAUSE? I see that NetBSD does not use it, and it is only set now because a driver that I copied used it. But I never went back to test it.

  • if_genet: remove MIFF_DOPAUSE mode. added inline comments.
318 ↗(On Diff #73055)

You are right, it seems to have no effect. I removed it.

318 ↗(On Diff #73055)


137 ↗(On Diff #73066)

My only quibble with the changes is the naming of MIIF_RXID and MIIF_TXID, although they are the same as NetBSD and OpenBSD. I don't know which is better, compatibility or clarity. MIIF_xDELAY would be much more obvious. Any other opinions? They could also be numbered sequentially. marked an inline comment as done.
  • if_genet: rename MIIF_RXID, MIIF_TXID. added inline comments.
137 ↗(On Diff #73066)


Looks good to me, I'm ready to approve. I'd also like to see a reviewer who knows the brgphy code.

This revision is now accepted and ready to land.Jun 18 2020, 12:25 AM
This revision was automatically updated to reflect the committed changes.