[PATCH 03/17] net: ravb: Reorder bb_miiphy functions
Marek Vasut
marek.vasut+renesas at mailbox.org
Sat Jan 18 07:53:07 CET 2025
Move the bb_miiphy functions before MDIO registration. This is a
preparatory patch, the functions will be referenced around the MDIO
registration in the follow up patches. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Christian Marangi <ansuelsmth at gmail.com>
Cc: Evgeny Bachinin <EABachinin at salutedevices.com>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Cc: Jerome Forissier <jerome.forissier at linaro.org>
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
---
drivers/net/ravb.c | 117 +++++++++++++++++++++++----------------------
1 file changed, 59 insertions(+), 58 deletions(-)
diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c
index f9c27f0f370..6e4baff658f 100644
--- a/drivers/net/ravb.c
+++ b/drivers/net/ravb.c
@@ -490,6 +490,65 @@ static void ravb_stop(struct udevice *dev)
ravb_reset(dev);
}
+/* Bitbang MDIO access */
+static int ravb_bb_mdio_active(struct bb_miiphy_bus *bus)
+{
+ struct ravb_priv *eth = bus->priv;
+
+ setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MMD);
+
+ return 0;
+}
+
+static int ravb_bb_mdio_tristate(struct bb_miiphy_bus *bus)
+{
+ struct ravb_priv *eth = bus->priv;
+
+ clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MMD);
+
+ return 0;
+}
+
+static int ravb_bb_set_mdio(struct bb_miiphy_bus *bus, int v)
+{
+ struct ravb_priv *eth = bus->priv;
+
+ if (v)
+ setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDO);
+ else
+ clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDO);
+
+ return 0;
+}
+
+static int ravb_bb_get_mdio(struct bb_miiphy_bus *bus, int *v)
+{
+ struct ravb_priv *eth = bus->priv;
+
+ *v = (readl(eth->iobase + RAVB_REG_PIR) & PIR_MDI) >> 3;
+
+ return 0;
+}
+
+static int ravb_bb_set_mdc(struct bb_miiphy_bus *bus, int v)
+{
+ struct ravb_priv *eth = bus->priv;
+
+ if (v)
+ setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDC);
+ else
+ clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDC);
+
+ return 0;
+}
+
+static int ravb_bb_delay(struct bb_miiphy_bus *bus)
+{
+ udelay(10);
+
+ return 0;
+}
+
static int ravb_probe(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_plat(dev);
@@ -560,64 +619,6 @@ static int ravb_remove(struct udevice *dev)
return 0;
}
-static int ravb_bb_mdio_active(struct bb_miiphy_bus *bus)
-{
- struct ravb_priv *eth = bus->priv;
-
- setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MMD);
-
- return 0;
-}
-
-static int ravb_bb_mdio_tristate(struct bb_miiphy_bus *bus)
-{
- struct ravb_priv *eth = bus->priv;
-
- clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MMD);
-
- return 0;
-}
-
-static int ravb_bb_set_mdio(struct bb_miiphy_bus *bus, int v)
-{
- struct ravb_priv *eth = bus->priv;
-
- if (v)
- setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDO);
- else
- clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDO);
-
- return 0;
-}
-
-static int ravb_bb_get_mdio(struct bb_miiphy_bus *bus, int *v)
-{
- struct ravb_priv *eth = bus->priv;
-
- *v = (readl(eth->iobase + RAVB_REG_PIR) & PIR_MDI) >> 3;
-
- return 0;
-}
-
-static int ravb_bb_set_mdc(struct bb_miiphy_bus *bus, int v)
-{
- struct ravb_priv *eth = bus->priv;
-
- if (v)
- setbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDC);
- else
- clrbits_le32(eth->iobase + RAVB_REG_PIR, PIR_MDC);
-
- return 0;
-}
-
-static int ravb_bb_delay(struct bb_miiphy_bus *bus)
-{
- udelay(10);
-
- return 0;
-}
-
struct bb_miiphy_bus bb_miiphy_buses[] = {
{
.name = "ravb",
--
2.45.2
More information about the U-Boot
mailing list