[PATCH v3 00/23] net: miiphybb: Get rid of global bb_miiphy_buses[]

Marek Vasut marek.vasut+renesas at mailbox.org
Sat Feb 22 21:33:10 CET 2025


Get rid of global bb_miiphy_buses[] which does not fit well with U-Boot
DM in favor of usual per-ethernet-MAC-driver-instance MDIO bus accessors.

Introduce the ability to allocate struct bb_miiphy_bus {} and make it wrap
struct mii_dev {}, so the struct mii_dev can be passed into MDIO bus access
infrastructure as usual. When the MDIO bus access infrastructure attempts to
access the MDIO bus and invokes any of the bbmiiphy accessors, those accessors
are passed the structu mii_dev {}, but can also access struct bb_miiphy_bus
using plain container_of() .

Clean up the drivers and update them to match.

Marek Vasut (23):
  net: ravb: Drop empty init callback
  net: sh_eth: Drop empty init callback
  net: designware: Drop NULL priv assignment
  net: ravb: Reorder bb_miiphy functions
  net: sh_eth: Reorder bb_miiphy functions
  arm: mvebu: a38x: Reorder bb_miiphy functions
  net: designware: Reorder bb_miiphy functions
  arm: mvebu: a38x: Call bb_miiphy init directly in driver probe
  net: miiphybb: Drop bb_miiphy_init() and .init callback
  net: designware: Drop bus index
  net: designware: Extract bbmiiphy initialization into dedicated
    function
  net: miiphy: Introduce mdio_init()
  net: miiphybb: Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers
  arm: mvebu: a38x: Allocate bb_miiphy using bb_miiphy_alloc() and fill
    in callbacks
  net: ravb: Allocate bb_miiphy using bb_miiphy_alloc() and fill in
    callbacks
  net: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in
    callbacks
  net: designware: Allocate bb_miiphy using bb_miiphy_alloc() and fill
    in callbacks
  net: miiphybb: Use container_of() in bb_miiphy_getbus()
  net: miiphybb: Drop name field from struct bb_miiphy_bus
  arm: mvebu: a38x: Drop use of miiphy_get_dev_by_name()
  net: ravb: Drop use of miiphy_get_dev_by_name()
  net: sh_eth: Drop use of miiphy_get_dev_by_name()
  net: miiphybb: Drop bb_miiphy_buses and bb_miiphy_buses_num

 board/gdsys/a38x/ihs_phys.c | 237 ++++++++++++++------------------
 common/board_r.c            |   3 -
 common/miiphyutil.c         |  13 +-
 drivers/net/designware.c    | 263 ++++++++++++++++++++----------------
 drivers/net/phy/miiphybb.c  |  36 ++---
 drivers/net/ravb.c          | 159 ++++++++++------------
 drivers/net/sh_eth.c        | 179 ++++++++++++------------
 include/miiphy.h            |  17 +--
 8 files changed, 438 insertions(+), 469 deletions(-)

---
Cc: Christian Marangi <ansuelsmth at gmail.com>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Cc: Jerome Forissier <jerome.forissier at linaro.org>
Cc: Jim Liu <JJLIU0 at nuvoton.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Mario Six <mario.six at gdsys.cc>
Cc: Michal Simek <michal.simek at amd.com>
Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Cc: Paul Barker <paul.barker.ct at bp.renesas.com>
Cc: Ramon Fried <rfried.dev at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Sughosh Ganu <sughosh.ganu at linaro.org>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de

-- 
2.47.2



More information about the U-Boot mailing list