[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250207024316.25334-2-Tristram.Ha@microchip.com>
Date: Thu, 6 Feb 2025 18:43:14 -0800
From: <Tristram.Ha@...rochip.com>
To: Russell King <linux@...linux.org.uk>, Woojung Huh
<woojung.huh@...rochip.com>, Andrew Lunn <andrew@...n.ch>, Vladimir Oltean
<olteanv@...il.com>, Heiner Kallweit <hkallweit1@...il.com>, "Maxime
Chevallier" <maxime.chevallier@...tlin.com>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, <UNGLinuxDriver@...rochip.com>,
<netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Tristram Ha
<tristram.ha@...rochip.com>
Subject: [PATCH RFC net-next v2 1/3] net: pcs: xpcs: Activate DW_XPCS_SGMII_MODE_MAC_MANUAL for KSZ9477
From: Tristram Ha <tristram.ha@...rochip.com>
Microchip KSZ9477 SGMII uses old XPCS IP and requires special code to
operate correctly. A special value from PMA device ids will be used to
activate DW_XPCS_SGMII_MODE_MAC_MANUL.
Signed-off-by: Tristram Ha <tristram.ha@...rochip.com>
---
drivers/net/pcs/pcs-xpcs.c | 2 ++
include/linux/pcs/pcs-xpcs.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index d522e4a5a138..5aad67ff4a4f 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -1482,6 +1482,8 @@ static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev)
xpcs->sgmii_10_100_8bit = DW_XPCS_SGMII_10_100_8BIT;
xpcs->sgmii_mode = DW_XPCS_SGMII_MODE_PHY_HW;
} else {
+ if (xpcs->info.pma == MICROCHIP_KSZ9477_PMA_ID)
+ xpcs->sgmii_mode = DW_XPCS_SGMII_MODE_MAC_MANUAL;
xpcs->need_reset = true;
}
diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h
index 733f4ddd2ef1..637d5356a961 100644
--- a/include/linux/pcs/pcs-xpcs.h
+++ b/include/linux/pcs/pcs-xpcs.h
@@ -39,6 +39,7 @@ enum dw_xpcs_pma_id {
DW_XPCS_PMA_GEN5_10G_ID,
DW_XPCS_PMA_GEN5_12G_ID,
WX_TXGBE_XPCS_PMA_10G_ID = 0x0018fc80,
+ MICROCHIP_KSZ9477_PMA_ID = 0x00229477,
};
struct dw_xpcs_info {
--
2.34.1
Powered by blists - more mailing lists