From 3ac8316e09b0a0fd299fb40a27546de9e1a48216 Mon Sep 17 00:00:00 2001 From: Radhey Shyam Pandey Date: Wed, 20 Apr 2022 16:33:09 +0530 Subject: [PATCH 1/2] dt-bindings: net: cdns,macb: Drop phy-names property for ZynqMP SGMII PHY In zynqmp SGMII initialization, there is a single PHY so remove phy-names property as there is no real need of having it. Signed-off-by: Radhey Shyam Pandey Signed-off-by: David S. Miller --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index 6cd3d853dcba..e5b628736930 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -84,13 +84,6 @@ properties: phys: maxItems: 1 - phy-names: - const: sgmii-phy - description: - Required with ZynqMP SoC when in SGMII mode. - Should reference PS-GTR generic PHY device for this controller - instance. See ZynqMP example. - resets: maxItems: 1 description: @@ -204,7 +197,6 @@ examples: reset-names = "gem1_rst"; status = "okay"; phy-mode = "sgmii"; - phy-names = "sgmii-phy"; phys = <&psgtr 1 PHY_TYPE_SGMII 1 1>; fixed-link { speed = <1000>; From 29e96fe9e0ec0f0fe1dd306a4ccb7b8983eae67a Mon Sep 17 00:00:00 2001 From: Radhey Shyam Pandey Date: Wed, 20 Apr 2022 16:33:10 +0530 Subject: [PATCH 2/2] net: macb: In ZynqMP initialization make SGMII phy configuration optional In the macb binding documentation "phys" is an optional property. Make implementation in line with it. This change allows the traditional flow in which first stage bootloader does PS-GT configuration to work along with newer use cases in which PS-GT configuration is managed by the phy-zynqmp driver. It fixes below macb probe failure when macb DT node doesn't have SGMII phys handle. "macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY" Signed-off-by: Radhey Shyam Pandey Reviewed-by: Michal Simek Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index a5140d4d3baf..6434e74c04f1 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4588,7 +4588,7 @@ static int zynqmp_init(struct platform_device *pdev) if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) { /* Ensure PS-GTR PHY device used in SGMII mode is ready */ - bp->sgmii_phy = devm_phy_get(&pdev->dev, "sgmii-phy"); + bp->sgmii_phy = devm_phy_optional_get(&pdev->dev, NULL); if (IS_ERR(bp->sgmii_phy)) { ret = PTR_ERR(bp->sgmii_phy);