[U-Boot] [PATCH] phy: atheros: add some debug output

Michael Walle michael at walle.cc
Sun Oct 27 20:37:20 UTC 2019


The network driver has to set the PHY node correctly. If that is not the
case, ar803x_of_init() will fail. Add some debugging output.

If the device tree binding is not working for you have a look at the
  ar803x_of_init: found PHY node: phy at 0
output. In the case above "phy at 0" is the phy node in the device tree. If
instead the node of your network device is displayed, you have to set
the phydev->node property in your network device driver. For example,
the following patch adds it to the fsl_enetc driver:
  https://patchwork.ozlabs.org/patch/1184523/

Signed-off-by: Michael Walle <michael at walle.cc>
---
 drivers/net/phy/atheros.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c
index 922dc91835..f68e5f2cab 100644
--- a/drivers/net/phy/atheros.c
+++ b/drivers/net/phy/atheros.c
@@ -191,6 +191,8 @@ static int ar803x_of_init(struct phy_device *phydev)
 	if (!ofnode_valid(node))
 		return -EINVAL;
 
+	debug("%s: found PHY node: %s\n", __func__, ofnode_get_name(node));
+
 	if (ofnode_read_bool(node, "atheros,keep-pll-enabled"))
 		priv->flags |= AR803x_FLAG_KEEP_PLL_ENABLED;
 	if (ofnode_read_bool(node, "atheros,rgmii-io-1v8"))
@@ -236,6 +238,9 @@ static int ar803x_of_init(struct phy_device *phydev)
 			return -EINVAL;
 		}
 	}
+
+	debug("%s: flags=%x clk_25m_reg=%04x\n", __func__, priv->flags,
+			priv->clk_25m_reg);
 #endif
 
 	return 0;
-- 
2.20.1



More information about the U-Boot mailing list