of: mdio: Support fixed links in of_phy_get_and_connect()
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 11 Jul 2018 17:45:11 +0000 (19:45 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Jul 2018 01:25:14 +0000 (18:25 -0700)
commit6eb9c9dafd02b6a0236074e3ee7acee9e2271308
tree10a337487910709daaf09ceef4dd863dcbb350a2
parent01683a1469995cc7aaf833d6f8b3f1c1d2fc3b92
of: mdio: Support fixed links in of_phy_get_and_connect()

By a simple extension of of_phy_get_and_connect() drivers
that have a fixed link on e.g. RGMII can support also
fixed links, so in addition to:

ethernet-port {
phy-mode = "rgmii";
phy-handle = <&foo>;
};

This setup with a fixed-link node and no phy-handle will
now also work just fine:

ethernet-port {
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
pause;
};
};

This is very helpful for connecting random ethernet ports
to e.g. DSA switches that typically reside on fixed links.

The phy-mode is still there as the fixes link in this case
is still an RGMII link.

Tested on the Cortina Gemini driver with the Vitesse DSA
router chip on a fixed 1Gbit link.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_mdio.c