Extending sys/dev/mii

Adrian Chadd adrian at freebsd.org
Sun Feb 12 04:49:32 UTC 2012


On 11 February 2012 17:15, Warner Losh <imp at bsdimp.com> wrote:
>
> On Feb 11, 2012, at 6:00 PM, Adrian Chadd wrote:
>> I'd like to try and finally bring some sanity to the hardcoded PHY
>> mask handling in if_arge (and make it actually work for AR71xx and
>> AR724x - where AR71xx has one shared MDIO bus between both MACs, but
>> AR724x has two independent MDIO busses..)
>
> FDT would do that...

.. how would it bring sanity to the device driver?

Right now the driver assumes that both arge0 and arge1 mdiobus are the
same and uses the phymask setting to determine how/when to access
registers (ie, trying to read/write from phy registers not in the
phymask of argeX are denied.) It is one of the annoying issues with
the AR7241 internal switch support as that switch hangs off of arge1's
MII bus.

It may make it easier to specify the configuration but it doesn't fix
the fundamentally wrong assumption.

The trouble in this whole mess (where FDT may help) is that phy's for
arge0 may actually sit on arge1. So you can't probe/attach the miibus
on arge0 until you've probe/attached arge1, so the arge1 MII registers
can be tickled.

Ray/Stefan/others: if anything, I'd like to try and bring sanity to
this particular thorny issue in -HEAD before we worry about switch PHY
devices.



Adrian


More information about the freebsd-arch mailing list