Hello Jose,
This patch works fine with my Tinker Board. Thanks a lot!
Tested-by: Katsuhiro Suzuki <[email protected]>
BTW, from network guys point of view, is it better to add a phy node
into device trees that have no phy node such as the Tinker Board?
Best Regards,
Katsuhiro Suzuki
On 2019/06/25 22:11, Jose Abreu wrote:
++ Katsuhiro
From: Jose Abreu <[email protected]>
Some DT bindings do not have the PHY handle. Let's fallback to manually
discovery in case phylink_of_phy_connect() fails.
Reported-by: Katsuhiro Suzuki <[email protected]>
Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Jose Abreu <[email protected]>
Cc: Joao Pinto <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>
Cc: Alexandre Torgue <[email protected]>
---
Hello Katsuhiro,
Can you please test this patch ?
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a48751989fa6..f4593d2d9d20 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -950,9 +950,12 @@ static int stmmac_init_phy(struct net_device *dev)
node = priv->plat->phylink_node;
- if (node) {
+ if (node)
ret = phylink_of_phy_connect(priv->phylink, node, 0);
- } else {
+
+ /* Some DT bindings do not set-up the PHY handle. Let's try to
+ * manually parse it */
+ if (!node || ret) {
int addr = priv->plat->phy_addr;
struct phy_device *phydev;
--
2.7.4