Add 100Mbps link speed support to the axgbe driver. This update enables
the MAC and PHY configuration required to operate at 100M, including
proper mode selection and link handling.

Signed-off-by: Ashok Kumar Natarajan <[email protected]>
---
 drivers/net/axgbe/axgbe_mdio.c     |  4 ++--
 drivers/net/axgbe/axgbe_phy_impl.c | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c
index 952a0add62..a37cd8b80d 100644
--- a/drivers/net/axgbe/axgbe_mdio.c
+++ b/drivers/net/axgbe/axgbe_mdio.c
@@ -155,8 +155,8 @@ static void axgbe_sgmii_10_mode(struct axgbe_port *pdata)
 static void axgbe_sgmii_100_mode(struct axgbe_port *pdata)
 {
 
-       /* Set MAC to 1G speed */
-       pdata->hw_if.set_speed(pdata, SPEED_1000);
+       /* Set MAC to 100M speed */
+       pdata->hw_if.set_speed(pdata, SPEED_100);
 
        /* Call PHY implementation support to complete rate change */
        pdata->phy_if.phy_impl.set_mode(pdata, AXGBE_MODE_SGMII_100);
diff --git a/drivers/net/axgbe/axgbe_phy_impl.c 
b/drivers/net/axgbe/axgbe_phy_impl.c
index 20cfdcc796..3dbbee15b0 100644
--- a/drivers/net/axgbe/axgbe_phy_impl.c
+++ b/drivers/net/axgbe/axgbe_phy_impl.c
@@ -1534,6 +1534,18 @@ static void axgbe_phy_sgmii_1000_mode(struct axgbe_port 
*pdata)
        phy_data->cur_mode = AXGBE_MODE_SGMII_1000;
 }
 
+static void axgbe_phy_sgmii_100_mode(struct axgbe_port *pdata)
+{
+       struct axgbe_phy_data *phy_data = pdata->phy_data;
+
+       axgbe_phy_set_redrv_mode(pdata);
+
+       /* 100M/SGMII */
+       axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_1G, 
AXGBE_MB_SUBCMD_100MBITS);
+
+       phy_data->cur_mode = AXGBE_MODE_SGMII_100;
+}
+
 static void axgbe_phy_sgmii_10_mode(struct axgbe_port *pdata)
 {
        struct axgbe_phy_data *phy_data = pdata->phy_data;
@@ -1731,6 +1743,9 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, 
enum axgbe_mode mode)
        case AXGBE_MODE_SGMII_1000:
                axgbe_phy_sgmii_1000_mode(pdata);
                break;
+       case AXGBE_MODE_SGMII_100:
+               axgbe_phy_sgmii_100_mode(pdata);
+               break;
        case AXGBE_MODE_SGMII_10:
                axgbe_phy_sgmii_10_mode(pdata);
                break;
-- 
2.34.1

Reply via email to