Skip to content

Commit 9d1cdb9

Browse files
Ashok Kumar NatarajanShani Peretz
authored andcommitted
net/axgbe: fix 100M SGMII mode
[ upstream commit 11b9189 ] In SGMII 100M mode, set MAC speed to 100M instead of 1G, and add the PHY implementation for SGMII 100 mode. Fixes: a5c7273 ("net/axgbe: add phy programming APIs") Signed-off-by: Ashok Kumar Natarajan <ashokkumar.natarajan@amd.com>
1 parent d5df26d commit 9d1cdb9

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

drivers/net/axgbe/axgbe_mdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ static void axgbe_sgmii_1000_mode(struct axgbe_port *pdata)
146146
static void axgbe_sgmii_100_mode(struct axgbe_port *pdata)
147147
{
148148

149-
/* Set MAC to 1G speed */
150-
pdata->hw_if.set_speed(pdata, SPEED_1000);
149+
/* Set MAC to 100M speed */
150+
pdata->hw_if.set_speed(pdata, SPEED_100);
151151

152152
/* Call PHY implementation support to complete rate change */
153153
pdata->phy_if.phy_impl.set_mode(pdata, AXGBE_MODE_SGMII_100);

drivers/net/axgbe/axgbe_phy_impl.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,18 @@ static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata)
13621362
phy_data->cur_mode = AXGBE_MODE_SGMII_1000;
13631363
}
13641364

1365+
static void axgbe_phy_sgmii_100_mode(struct axgbe_port *pdata)
1366+
{
1367+
struct axgbe_phy_data *phy_data = pdata->phy_data;
1368+
1369+
axgbe_phy_set_redrv_mode(pdata);
1370+
1371+
/* 100M/SGMII */
1372+
axgbe_phy_perform_ratechange(pdata, 1, 1);
1373+
1374+
phy_data->cur_mode = AXGBE_MODE_SGMII_100;
1375+
}
1376+
13651377
static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata)
13661378
{
13671379
struct axgbe_phy_data *phy_data = pdata->phy_data;
@@ -1540,6 +1552,9 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode)
15401552
case AXGBE_MODE_SGMII_1000:
15411553
axgbe_phy_sgmii_1000_mode(pdata);
15421554
break;
1555+
case AXGBE_MODE_SGMII_100:
1556+
axgbe_phy_sgmii_100_mode(pdata);
1557+
break;
15431558
default:
15441559
break;
15451560
}

0 commit comments

Comments
 (0)