Skip to content

Commit 6a30118

Browse files
phy: ti: gmii-sel: Add support for SGMII mode
Add support to configure the CPSW MAC's PHY in SGMII mode if the SoC supports it. The extra_modes member of the phy_gmii_sel_soc_data struct corresponding to the SoC is used to determine whether or not the SoC supports SGMII mode. Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Link: https://lore.kernel.org/r/20230309063514.398705-2-s-vadapalli@ti.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 1541fba commit 6a30118

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/phy/ti/phy-gmii-sel.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define AM33XX_GMII_SEL_MODE_RGMII 2
2424

2525
/* J72xx SoC specific definitions for the CONTROL port */
26+
#define J72XX_GMII_SEL_MODE_SGMII 3
2627
#define J72XX_GMII_SEL_MODE_QSGMII 4
2728
#define J72XX_GMII_SEL_MODE_QSGMII_SUB 6
2829

@@ -106,6 +107,13 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode)
106107
gmii_sel_mode = J72XX_GMII_SEL_MODE_QSGMII_SUB;
107108
break;
108109

110+
case PHY_INTERFACE_MODE_SGMII:
111+
if (!(soc_data->extra_modes & BIT(PHY_INTERFACE_MODE_SGMII)))
112+
goto unsupported;
113+
else
114+
gmii_sel_mode = J72XX_GMII_SEL_MODE_SGMII;
115+
break;
116+
109117
default:
110118
goto unsupported;
111119
}

0 commit comments

Comments
 (0)