Extending sys/dev/mii

Adrian Chadd adrian at freebsd.org
Sun Feb 12 05:20:22 UTC 2012


On 11 February 2012 21:06, Juli Mallett <jmallett at freebsd.org> wrote:

>> The PHYs don't sit on arge1.  They sit on another device that the driver bogusly assumes is tightly coupled to arge1, when in fact it isn't.
>
> YES!  Thank you!  And even if it were tightly coupled in hardware,
> there's no reason our device tree needs to mirror that, FDT or not.
> Just break out an "arge controller" device, attach arge0 and arge1 to
> it, and let it manage the MDIO bus.  No shortcomings, as far as I can
> tell.  You can even be extra clever and say that the switch is
> attached to that device, not either of the arge devices, and that one
> of the arge devices happens to be connected to the switch's CPU/host
> port.  But that's probably a bit much to ask for.

I'm tempted to just go ahead and do this, and have:

* argec: initial device probe/attach, handle mdio/miibus configuration
* if_arge: child of argec (with all register accesses going via it),
doing the rest of ethernet stuff

.. then what, we have argec0/argec1 first probe/attach, then have
if_arge0/if_arge1 probe/attach with the relevant miibus PHYs attach to
wherever they need to?

There'll need to be some kind of locking there so both the argecX and
the if_argeX don't clash.



Adrian


More information about the freebsd-arch mailing list