atom feed43 messages in org.freebsd.freebsd-archRe: Extending sys/dev/mii
FromSent OnAttachments
Stefan BethkeJan 4, 2012 8:03 am 
Adrian ChaddJan 4, 2012 9:07 am 
Marius StroblJan 4, 2012 1:59 pm 
Stefan BethkeJan 5, 2012 12:52 pm 
Stefan BethkeJan 6, 2012 4:56 am 
Stefan BethkeJan 6, 2012 5:02 am.diff
Marius StroblJan 6, 2012 10:27 am 
Stefan BethkeJan 6, 2012 12:35 pm 
Marius StroblJan 6, 2012 1:47 pm 
Stefan BethkeJan 6, 2012 1:52 pm 
Marius StroblJan 8, 2012 5:00 am 
Stefan BethkeJan 8, 2012 2:27 pm 
Adrian ChaddJan 10, 2012 5:18 pm 
Marius StroblJan 11, 2012 11:37 am 
Adrian ChaddJan 14, 2012 8:15 pm 
Warner LoshJan 14, 2012 9:13 pm 
Stefan BethkeJan 20, 2012 3:08 pm.patch
Warner LoshJan 20, 2012 5:43 pm 
Oleksandr TymoshenkoJan 20, 2012 8:12 pm 
Stefan BethkeJan 21, 2012 4:02 am 
Aleksandr RybalkoJan 21, 2012 5:12 am 
Oleksandr TymoshenkoJan 23, 2012 11:45 pm 
Aleksandr RybalkoJan 24, 2012 5:53 am 
Marius StroblJan 25, 2012 2:17 pm 
Warner LoshJan 25, 2012 2:28 pm 
Marius StroblJan 25, 2012 3:21 pm 
Hans Petter SelaskyJan 26, 2012 8:24 am 
Stefan BethkeJan 26, 2012 8:24 am 
Stefan BethkeJan 26, 2012 8:30 am 
Marius StroblJan 27, 2012 6:15 am 
Adrian ChaddFeb 10, 2012 9:22 pm 
Marius StroblFeb 11, 2012 3:17 am 
Aleksandr RybalkoFeb 11, 2012 4:45 am 
Adrian ChaddFeb 11, 2012 4:59 pm 
Warner LoshFeb 11, 2012 5:15 pm 
Adrian ChaddFeb 11, 2012 8:48 pm 
Warner LoshFeb 11, 2012 8:58 pm 
Juli MallettFeb 11, 2012 9:05 pm 
Adrian ChaddFeb 11, 2012 9:19 pm 
Aleksandr RybalkoFeb 12, 2012 9:51 am 
Aleksandr RybalkoFeb 12, 2012 10:04 am 
Juli MallettFeb 12, 2012 10:30 am 
Aleksandr RybalkoFeb 12, 2012 10:38 am 
Subject:Re: Extending sys/dev/mii
From:Adrian Chadd (adr@freebsd.org)
Date:Jan 4, 2012 9:07:51 am
List:org.freebsd.freebsd-arch

I'm including -net here so we can try and pull in further feedback from network-cluey people.

On 4 January 2012 08:03, Stefan Bethke <st@lassitu.de> wrote:

As discussed recently, ray@, adrian@ and myself are trying to get a framework
and utility into the tree that allows the use and configuration of ethernet
switch chips.  The switch controllers we've looked at so far share a number of
features, in particular they use 802.3 MII, MDIO and PHYs to implement and
configure the ports they offer.  In addition to being a switch, some of them
also offer one of the built-in PHYs to the ethernet controller as a classical
PHY.

[snip]

I'd like to extend miibus in such a way that the one-to-one mapping between MDIO
and MII is broken up.  For that, I propose to add a new bus driver "mdiobus"
(with appropriate resource management) that uses methods similar to miibus_if.m
readreg and writereg to access an ethernet controllers' MDIO master.  miibus
then attaches to it as a child, claims one or more PHY addresses and attaches
PHYs to itself (as currently implemented).

This sounds like a good idea. I wonder what's stopping us from doing that. :)

There's one issue that I don't have a proposal for yet: in one platform
(AR7241), we have PHY4 of the SoC talking via MII to arge0's MAC, while it is
being controlled via the switch controller's MDIO master, and the switch
controller being attached to arge1's MDIO.  If we want to attach an miibus for
PHY4, we'd have to defer attachment of arge0 until arge1 has been probed and can
provide the MDIO attachment (and transitively the switch and it's mdio).  Note
that we also have boards without a switch, but the two PHYs still being attached
to only a single MDIO.  One possible way would be for the MDIO driver to be
separate from the ethernet driver, so that the normal newbus dependency
resolution can be used to ensure that mdio1 is attached before arge0 is probed.
 For the time being, I've worked around this through hackery in if_arge.c.

juli@ proposed something quite similar a few weeks ago. Now that I'm a little more clued up on this whole area, I now understand why she suggested it.

I'm happy with "hacky" being in if_arge for now (I mean, there already _is_ ..) but this work seems like the right path to take to bring sanity to this whole setup in the longer term.

Thanks for tackling this!

Adrian