public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: <Tristram.Ha@microchip.com>
To: Russell King <linux@armlinux.org.uk>,
	Woojung Huh <woojung.huh@microchip.com>,
	Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"Maxime Chevallier" <maxime.chevallier@bootlin.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<UNGLinuxDriver@microchip.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Tristram Ha <tristram.ha@microchip.com>
Subject: [PATCH RFC net-next v2 1/3] net: pcs: xpcs: Activate DW_XPCS_SGMII_MODE_MAC_MANUAL for KSZ9477
Date: Thu, 6 Feb 2025 18:43:14 -0800	[thread overview]
Message-ID: <20250207024316.25334-2-Tristram.Ha@microchip.com> (raw)
In-Reply-To: <20250207024316.25334-1-Tristram.Ha@microchip.com>

From: Tristram Ha <tristram.ha@microchip.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@microchip.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


  reply	other threads:[~2025-02-07  2:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07  2:43 [PATCH RFC net-next v2 0/3] Add SGMII port support to KSZ9477 switch Tristram.Ha
2025-02-07  2:43 ` Tristram.Ha [this message]
2025-02-07  2:43 ` [PATCH RFC net-next v2 2/3] net: dsa: microchip: " Tristram.Ha
2025-02-07 16:52   ` Vladimir Oltean
2025-02-07 19:03     ` Tristram.Ha
2025-02-07  2:43 ` [PATCH RFC net-next v2 3/3] " Tristram.Ha
2025-02-07  9:32 ` [PATCH RFC net-next v2 0/3] " Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250207024316.25334-2-Tristram.Ha@microchip.com \
    --to=tristram.ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox