Thread (11 messages) 11 messages, 3 authors, 2026-06-05

Re: [PATCH net-next v2 3/4] net: phy: realtek: add support for RTL8261C_CG

From: Nicolai Buchwitz <hidden>
Date: 2026-06-04 08:57:13
Also in: lkml

Hi Javen

On 4.6.2026 09:42, javen wrote:
quoted hunk ↗ jump to hunk
From: Javen Xu <redacted>

This patch adds support for Realtek phy chip RTL8261C_CG. Its PHY ID is
0x001cc898.

Signed-off-by: Javen Xu <redacted>
---
Changes in v2:
 - remove RTL8261D, only support RTL8261C_CG
 - remove speed 500, rarely used
 - add helper function, genphy_c45_soft_reset() and 
genphy_c45_config_master_slave()
---
 drivers/net/phy/realtek/realtek_main.c | 178 +++++++++++++++++++++++++
 1 file changed, 178 insertions(+)
diff --git a/drivers/net/phy/realtek/realtek_main.c 
b/drivers/net/phy/realtek/realtek_main.c
[...]
+
+#define RTL8261C_CE_MODEL		0x00
+#define RTL8261X_GBCR_REG		0xa412
IMHO this is just RTL822X_VND2_C22_REG(MII_CTRL1000) (= 0xa412), already
used elsewhere in the file. Drop the define and reuse the macro, as
Aleksander suggested on v1.
[...]
+struct rtl8261x_priv {
+	u8 sub_phy_id;
+};
sub_phy_id is only written, never read. Andrew already asked about the
unused priv fields on v1. A local in probe() is enough, drop the field?
[...]
+
+	if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+			      phydev->advertising))
+		adv_1g = ADVERTISE_1000FULL;
+
+	ret = phy_modify_mmd_changed(phydev, MDIO_MMD_VEND2,
+				     RTL8261X_GBCR_REG,
+				     ADVERTISE_1000FULL, adv_1g);
See above and replace with RTL822X_VND2_C22_REG(MII_CTRL1000).

The aneg-restart handling looks correct now, thanks for picking up the 
v1
comment.
[...]
Thanks,
Nicolai
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help