|
@@ -882,6 +882,7 @@ static int ravb_phy_init(struct net_device *ndev)
|
|
struct ravb_private *priv = netdev_priv(ndev);
|
|
struct ravb_private *priv = netdev_priv(ndev);
|
|
struct phy_device *phydev;
|
|
struct phy_device *phydev;
|
|
struct device_node *pn;
|
|
struct device_node *pn;
|
|
|
|
+ int err;
|
|
|
|
|
|
priv->link = 0;
|
|
priv->link = 0;
|
|
priv->speed = 0;
|
|
priv->speed = 0;
|
|
@@ -889,6 +890,17 @@ static int ravb_phy_init(struct net_device *ndev)
|
|
|
|
|
|
/* Try connecting to PHY */
|
|
/* Try connecting to PHY */
|
|
pn = of_parse_phandle(np, "phy-handle", 0);
|
|
pn = of_parse_phandle(np, "phy-handle", 0);
|
|
|
|
+ if (!pn) {
|
|
|
|
+ /* In the case of a fixed PHY, the DT node associated
|
|
|
|
+ * to the PHY is the Ethernet MAC DT node.
|
|
|
|
+ */
|
|
|
|
+ if (of_phy_is_fixed_link(np)) {
|
|
|
|
+ err = of_phy_register_fixed_link(np);
|
|
|
|
+ if (err)
|
|
|
|
+ return err;
|
|
|
|
+ }
|
|
|
|
+ pn = of_node_get(np);
|
|
|
|
+ }
|
|
phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0,
|
|
phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0,
|
|
priv->phy_interface);
|
|
priv->phy_interface);
|
|
if (!phydev) {
|
|
if (!phydev) {
|