Skip to content

Retrieving Ethernet PHY wireup from the OF device tree

Grant Likely linuxppc-dev lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drivers/base: Add bus_register_notifier_alldev() variantdrivers/base/bus.c include/linux/device.h+49 -00 replies
2/5phylib: rework to prepare for OF registration of PHYsdrivers/net/phy/mdio_bus.c drivers/net/phy/phy_device.c include/linux/phy.h+43 -300 replies
3/5phylib: add *_direct() variants of phy_connect and phy_attach functionsdrivers/net/phy/phy_device.c include/linux/phy.h+90 -330 replies
4/5openfirmware: Add OF phylib support codedrivers/of/Kconfig drivers/of/Makefile drivers/of/of_mdio.c +1 more+97 -00 replies
5/5net: make mpc5200 fec driver use of_mdio infrastructuredrivers/net/Kconfig drivers/net/fec_mpc52xx.c drivers/net/fec_mpc52xx_phy.c+109 -1434 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] Retrieving Ethernet PHY wireup from the OF device tree

Hi all,

This series reworks some of the phylib code to allow PHY descriptions and connections to be extracted from the OF device tree. MDIO bus drivers gain a common helper function for parsing the PHY data and registering new phy_devices to match. Ethernet controller drivers gain the ability to resolve to a phy_device from a device tree phandle.

One notable aspect is that the Ethernet controller driver doesn't know if the phy_device is registered before or after the Ethernet driver. This series adds a function to the device model core code to make it simple for the driver to register a bus notifier (mdio_bus in this case), which gets called both for existing devices and for future device registrations. The advantage of this is that the driver doesn't need to know or care when the device actually shows up. It just knows that its callback will get called when the device is available. I think this is a good approach, but I'd appreciate some feedback on it.

Cheers,
g.

drivers/base/bus.c | 47 +++++++++

 drivers/net/Kconfig           |    2 +-
 drivers/net/fec_mpc52xx.c     |  220 ++++++++++++++++++-----------------------
 drivers/net/fec_mpc52xx_phy.c |   30 +++---
 drivers/net/phy/mdio_bus.c    |   29 +-----
 drivers/net/phy/phy_device.c  |  161 +++++++++++++++++++++++-------
 drivers/of/Kconfig            |    6 +
 drivers/of/Makefile           |    1 +
 drivers/of/of_mdio.c          |   70 +++++++++++++
 include/linux/device.h        |    2 +
 include/linux/of_mdio.h       |   20 ++++
 include/linux/phy.h           |    6 +
 12 files changed, 388 insertions(+), 206 deletions(-)

--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.