Skip to content

Commit 19c7a43

Browse files
AndybnACTdavem330
authored andcommitted
net: axiemac: use a phandle to reference pcs_phy
In some SGMII use cases where both a fixed link external PHY and the internal PCS/PMA PHY need to be configured, we should explicitly use a phandle "pcs-phy" to get the reference to the PCS/PMA PHY. Otherwise, the driver would use "phy-handle" in the DT as the reference to both the external and the internal PCS/PMA PHY. In other cases where the core is connected to a SFP cage, we could still point phy-handle to the intenal PCS/PMA PHY, and let the driver connect to the SFP module, if exist, via phylink. Signed-off-by: Andy Chiu <andy.chiu@sifive.com> Reviewed-by: Greentime Hu <greentime.hu@sifive.com> Reviewed-by: Robert Hancock <robert.hancock@calian.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent dc48f04 commit 19c7a43

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/net/ethernet/xilinx/xilinx_axienet_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,9 +2071,16 @@ static int axienet_probe(struct platform_device *pdev)
20712071

20722072
if (lp->phy_mode == PHY_INTERFACE_MODE_SGMII ||
20732073
lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX) {
2074-
np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
2074+
np = of_parse_phandle(pdev->dev.of_node, "pcs-handle", 0);
20752075
if (!np) {
2076-
dev_err(&pdev->dev, "phy-handle required for 1000BaseX/SGMII\n");
2076+
/* Deprecated: Always use "pcs-handle" for pcs_phy.
2077+
* Falling back to "phy-handle" here is only for
2078+
* backward compatibility with old device trees.
2079+
*/
2080+
np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
2081+
}
2082+
if (!np) {
2083+
dev_err(&pdev->dev, "pcs-handle (preferred) or phy-handle required for 1000BaseX/SGMII\n");
20772084
ret = -EINVAL;
20782085
goto cleanup_mdio;
20792086
}

0 commit comments

Comments
 (0)