Article View: linux.kernel.netdev
Article #25460[PATCH net-next 2/2] net: phy: realtek: add support for the RTL8251B 5Gbps PHY
From: John-Michael Mulesa
Date: Tue, 01 Dec 2026 20:31
Date: Tue, 01 Dec 2026 20:31
65 lines
13559 bytes
13559 bytes
The mass production RTL8251B reports the PHY ID 0x001cc86a, unlike the
RTL8251BE engineering sample (0x001cc862) the driver already supports.
On the Sirivision SR-S5G3008, an RTL9303 switch with eight RTL8251B,
the switch's MDIO buses run Clause 45 only and Clause 22 accesses fail.
Without a matching driver the PHYs bind to the generic Clause 45 driver.
As devices-in-package bit 0 is set, phylib then falls back to Clause 22
autonegotiation, which fails and leaves the PHY in the error state.
Add a Clause 45 driver built from the helpers the RTL8224 driver already
uses: standard MMD 7 advertisement and link status, with the 1000BASE-T
registers and the resolved speed read through the vendor register
mirror in MMD 31.
The code and this changelog were drafted with the help of an AI coding
assistant (Claude, claude-opus-5-5).
Signed-off-by: John-Michael Mulesa <jmulesa@gmail.com>
---
drivers/net/phy/realtek/realtek_main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index ece327d3c..1a91b62a8 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -265,6 +265,7 @@
#define RTL_8221B_VB_CG 0x001cc849
#define RTL_8221B_VM_CG 0x001cc84a
#define RTL_8251BE 0x001cc862
+#define RTL_8251B 0x001cc86a
#define RTL_8261C 0x001cc890
#define RTL_8261C_CG 0x001cc898
#define RTL_8261CE_CG 0x001cc899
@@ -2924,6 +2925,12 @@ static int rtl8251be_c45_match_phy_device(struct phy_device *phydev,
return rtlgen_is_c45_match(phydev, RTL_8251BE, true);
}
+static int rtl8251b_c45_match_phy_device(struct phy_device *phydev,
+ const struct phy_driver *phydrv)
+{
+ return rtlgen_is_c45_match(phydev, RTL_8251B, true);
+}
+
static int rtlgen_resume(struct phy_device *phydev)
{
int ret = genphy_resume(phydev);
@@ -3409,6 +3416,14 @@ static struct phy_driver realtek_drvs[] = {
.resume = rtlgen_resume,
.read_page = rtl821x_read_page,
.write_page = rtl821x_write_page,
+ }, {
+ .match_phy_device = rtl8251b_c45_match_phy_device,
+ .name = "RTL8251B 5Gbps PHY",
+ .get_features = rtl822x_c45_get_features,
+ .config_aneg = rtl822x_c45_config_aneg,
+ .read_status = rtl822x_c45_read_status,
+ .suspend = genphy_c45_pma_suspend,
+ .resume = rtlgen_c45_resume,
}, {
.match_phy_device = rtl_internal_nbaset_match_phy_device,
.name = "Realtek Internal NBASE-T PHY",
--
2.56.1
Technical Details
Message-ID:
<20261201203114.1274260-3-jmulesa@gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375347-linux-kernel-netdev=dewy.ruReferences:
<20261201203114.1274260-1-jmulesa@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375347-linux-kernel-netdev=dewy.ru
From: jmulesa@gmail.com (John-Michael Mulesa)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 2/2] net: phy: realtek: add support for the RTL8251B 5Gbps PHY
Date: Tue, 1 Dec 2026 15:31:14 -0500
Organization: Usenet Network
Sender: thesaxophonist@gmail.com (John-Michael Mulesa)
Message-ID: <20261201203114.1274260-3-jmulesa@gmail.com>
References: <20261201203114.1274260-1-jmulesa@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1813761"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eLO5qOFk+s2za9GYJM9V2WKVXcU= sha256:E76MzPnGSwzq8CZuvce+tkJHHdbFT4Mwl6YXkc2V68g=
sha1:MHISzTlxHHkO/m2htI9WoJVZd2g= sha256:LnMMbJKpWyZfzKRy1X/9bcx3L0Dfgfqx5o4Qfy2VPps=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 25EF9117493; Tue, 1 Dec 2026 23:32:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id FOJptZZW1rqo;
Tue, 1 Dec 2026 23:31:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375347-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 3928511743F; Tue, 1 Dec 2026 23:31:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 2945329ED1; Tue, 1 Dec 2026 20:31:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796157104;
b=oUjquoSfQs7k7EExcvgAR9WabqgBm30Xn8pKBSVZUE/om9Q9SwdsbrR0uwBVOpHN8vmN
JN/PwHnkWq4+HCDUET32Bw/iSd83XxaHLmedtpfc17wXeteCBgo/j77jEMDfvnogjY+97
vx/Zk1FYIUnwfAPwiJdSsbm2Qz16Hh6308VkUtck3GeemsbV+f6H2EzH7EzddPLObTc6l
ZQthhhzr/jWG9AdQDQLqdHHoTiJzBEXn1L9yD/LUfLFX1HBRq072kEhEi8pNtskokYvdH
DzhzdYASP1wot3UOB0QFNjCEFBKLul4VDTr9o8bL6Nunb8KZJxAwjYXvHL/keuLZSvg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796157104;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:Sender:From:To:Cc:Subject:Date:Message-ID:X-Mailer:
In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=UFvWDirfQ4H+WmnMXDfsUU4XTWKjg2JPZFo2KiwIM4w=;
b=YHVxBXVB9fFUIPBRzfR/O3ePL8lL7CKKCn5WdhTGjk/Njf9g5W9msmbaQ76w1u527zH5
wq+Ij1WTHVFzw3CoGmGwL5zvaaSZikdKC95xEdGFXZz7e4LEEIC7VR6/6ZFB7uAu1AVZy
uWI++3susZrBlpUuWv9HOydE94GPNvlqIWy3v+cixH/VuJDX0O50c9a8aHH+poaHnkmvH
nue/G0PLiXGlzDChgbPOEIN5MtSnOkhc0TjMh1HYq903V2B0/2TZ7ikBEuDtrFYRFtucc
Z/snPVWQZ5TYlqj9Ue3VWdV7XOtU217pKstDPIHA6/WH3CA/RIROjlth+Iv8YVL2EkA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="afro/byl";
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 01CCD606A32D;
Tue, 1 Dec 2026 20:31:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=afro/byl
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796157103;
b=4dtPgnFgc/mgBNjfX/S3VgtA6rlZav48G5JBXbsrb/NYiwQPe7QduseH/FbtIXVV41l0
OSA7G2w50jJnz5zJuQBjvnpNFLZGDJc1pLZfIpb9S94+SI5QeHNBt/jGQROobf2pDiXpF
QfYXE6jvxmHceuBoSf05qwpihoECBquiaewjvrte8s3yaR2jem+4mSGXRoSqbX7K3wcLD
GrRYWHQmGYeqKQRkkVER6+gVUn2NbRV3qLkP7S9DbUFCAYz71mSqCKVwAEB8MgsDKYqDs
CO+yiHfFtCBKWIwgu6EWFowpFSk2qZ0rEYaHj0HhlxYzgN2cmiWWDcuO6oK0vMKQlxQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796157103;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Sender:From:To:Cc:
Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=UFvWDirfQ4H+WmnMXDfsUU4XTWKjg2JPZFo2KiwIM4w=;
b=lnerqQ82kjJNV6IlVcGE/fWLguVUemHH0rEwyK3Dk69XX3IkbszAkhF5Zc+anZBYwm2j
61dkjmeNytFyUnq7EaqtRyXxYbt69IhTQqyDdhNEgaPdoxZ5VjJetn/PUoss6XacH4qeg
3sRCSKMJMGhNjiU7It5xp1wPEtckJydLKQMQ1quHcYNvJyRHW2VFijdcIJPVb63UfWs7F
M4a/Tq4Gw+1O8A81nXykTli1x3C2V9mWGnlUP5kB9inWfOz5BxpWw/DU99GwC7UFfzyR/
+GVNVotnYTYSZ6dYj8Phdo2Cw0v5Eq2h8HN7iVs7ulf3FlDaqPG/KE5pVbIEEeDLvag==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="afro/byl";
arc=none smtp.remote-ip=209.85.160.45
X-Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id C70E9606A325
for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 20:31:42 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C70E9606A325
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-4bd734cf350so7102289fac.1
for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 12:31:42 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796157102; x=1796761902; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=UFvWDirfQ4H+WmnMXDfsUU4XTWKjg2JPZFo2KiwIM4w=;
b=afro/byl7HpiS5GK/TpWubKKYeVUjbcg6vn0xs0kPYlmMNy9A4djsd8tO9P9KRpq6h
vPLA1jgefDaT6vEqgmf/u10DlpL+rWhD+AwIvRFwil/eGW0K5jcOXD95IXHFNAcxYRYF
VMg0QMDAmdXAM4wy8+ny/wHfDDcG18y1D//FsJm3D3eF7a5+ixylyuMM2RhrA4xfOfMw
prWz5jkjc+wRUeygCV36HqIH8bPCMZhfyKxTCgZspWNxV3VgDd3EVQTbwnFdPW/xfzp8
C4EylGTqUjfGHlmsWCBgB4J9yc0yppRJTpZcfoKq9UC4hr8yduJWWuLR5F/HvAU+uXQD
Si7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796157102; x=1796761902;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:sender:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=UFvWDirfQ4H+WmnMXDfsUU4XTWKjg2JPZFo2KiwIM4w=;
b=jhhtqRtIde09NDhln/eNXs4RDn3i0L5YFGtRYVYIBnh7/lZNusCFK8sbgQ2aHxV4iv
poKjgfJ9QoUuiWFlM8H5B+0/fdTgiPnCjV8IVF9U89A1tFemf1y8St0ZcqRAJnAPooav
LA9qIvhuqBvKFZhVVGeJBDMCMbKJXKIe07HaZAwQvVFCj3lXbI4jaVojRDXxG+k5GfWI
l3cRXI8AlE6Jyd1uz7o2leH6fN1shhaynMO0tfuC9mX9kzBfc1/uArgkA792QyOVBRPy
yiHv991xttaq/CcoM/H8Ty3qRALkKpoPdmWAowVxfVKDh4Bl4xy8IDuEVGs/uXqMJkBD
JwOw==
X-Gm-Message-State: APuU4Z+UvBfFwtbhKGxxl87DHZfeLr81G8++VEaH+Cnfjp/6GqtoFE+O
52EVe0I8D9C5fc2NKKItRehkREo0flCGrUEv+MxdezApvdQRWJ0ACg/ZTJcEHJtTve9veQ==
X-Gm-Gg: AZFdTZfkRBEDdoiZYBnpvyFyPzrvhVobP8sZn8gxbBW6HhMO+om3DHGHOxYNyFgWc7v
Y848V60neC5uP41+mwWOUDEpBWKvaF1XnoDx0QFjm+dUGYuOsBtJErhzSsZZ0hzQNs35S+0sstd
luyCCVLsldhwKMf4ssURFZDejYXElH0sPoww6B9LSandQQsrArUlTsmHXQlgrShf2/ix4+OArvG
fXjgWTgkV16UNUV5uvYBC0PILgYrGUOwnaCM333BhKVvdyYTFE+gm8AsHcnuw4EcCS6zvUS+GT9
rRgryPuGFdzyqpjpr6gHkqtCA5DKTmBGgsEJC+8m7bDMXjeBeRcUCybM7BjVJ/QXwejhffsnSmz
7PRuTEW3ItMTmWpNuPxWJLkK9mYa4P3FzaA+KNicweJnthX+fcnt/LvtSloGpDgiXVxF3hGAQQ3
0/ieqDqexKroYdU0jMeYpruHpbOl7j1KSri3AcQKge/047GNMtjS8MnBobBpssDuRxflN0bHZt5
Sza8duRjiRIHvlhwNEIVVIEli6xnyalRhEIlMTf+b3BrMjGQD+dmKi9RDCHdTS8eHErw9DPqvzc
pZEedSFOeywcxWFcbRNf0o9M4zkBHbHpB+lTSX6nTRY09yyBbjiJqkCLZnICMS7fbJCR+bb+q1P
GsSai3o1yIpDo2nNQwQeQS/uvTVGd6A==
X-Received: by 2002:a05:687c:40cd:20b0:4be:87c0:875e with SMTP id 586e51a60fabf-4be87c094cbmr23220891fac.41.1796157101627;
Tue, 01 Dec 2026 12:31:41 -0800 (PST)
X-Received: from antec.lan (184-17-118-137.bng01.lfyt.in.frontiernet.net. [184.17.118.137])
by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4bc60491337sm31860366fac.12.2026.12.01.12.31.40
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 01 Dec 2026 12:31:41 -0800 (PST)
X-Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Markus Stockhausen <markus.stockhausen@gmx.de>,
John-Michael Mulesa <jmulesa@gmail.com>
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <20261201203114.1274260-1-jmulesa@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list