* [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP
@ 2026-12-05 4:00 Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode Hee-Suk Kim
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 4:00 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Maxime Chevallier, Daniel Golle, nic_swsd,
Andrew Lunn, linux-kernel, javen, Björn Töpel,
Hee-Suk Kim
Giga Lite is a Realtek proprietary mode which allows links of up to
500 Mbps over two-pair cabling. In South Korea, it is widely used to
support 500 Mbps plans by most ISPs. The vendor driver [1] sets PHY
page 0xa42, reg 0x14, bit 9 to allow it on RTL8168H and FP. The driver
does not handle RTL8168EP but I confirmed the same works for it by
setting the PHY register via SIOCSMIIREG on an SK Broadband 500 Mbps
plan [2].
With bit 9 set, the link still came up at about 470 Mbps even when
only 10/100 was advertised. As suggested by Heiner and Andrew, this
series exposes it as a new link mode,
ETHTOOL_LINK_MODE_500baseT2_Full, with SPEED_500. The PHY driver sets
bit 9 when 500baseT2/Full is advertised with autonegotiation enabled,
and clears it otherwise. The mode is advertised by default, and users
can turn it off with ethtool without touching the other modes.
Bit 9 is not reflected in any C22 advertisement register, and the PHY
negotiates Giga Lite on its own. As a result, the link partner's
support for it is not visible, and 500baseT2/Full never appears in the
link partner advertised modes. This only affects reporting, as the
resolved speed is read from PHYSR.
The vendor drivers for RTL8125, RTL8126 and RTL8127 set the same bit,
but they read the link speed from the MAC, so it is not confirmed
that PHYSR reports 0x30 on those chips. They also use a different
PHY driver entry. They are left out of this series, as are the other
Lite modes (OCP 0xa5ea) and 1000baseT2/Full.
[1] https://github.com/mtorromeo/r8168/blob/b3e24e4aa74a3561618d0abf01b708bd55def57a/src/r8168_n.c#L6375-L6390
[2] https://www.tworld.co.kr/web/product/callplan/NI00000567
---
Test results on a ThinkPad T14 Gen 5 (RTL8168ep/8111ep, XID 502) with
an SK Broadband 500 Mbps plan ("before"/"after" = without/with this
series, throughput by fast.com):
kernel advertised bit 9 PHYSR reported throughput
------ --------------------- ------------ ----- ----------- ----------
before 10/100/1000 clear 0x10 100 94 Mbps
before 10/100/1000 set manually 0x30 100 or 1000 470 Mbps
after 10/100/500T2/1000 set 0x30 500 462 Mbps
after 10/100/1000 clear 0x10 100 93 Mbps
after 10/100/500T2 set 0x30 500 461 Mbps
after 10/100 clear 0x10 100 93 Mbps
after autoneg off, 100/Full clear 0x10 100 93 Mbps
As ethtool cannot show Giga Lite for the link partner, it reported
only 10/100 in the link partner advertised modes in all "after" cases,
even on a Giga Lite link. The advertisement set with ethtool, with and
without 500baseT2/Full, was kept across ip link down/up and across
suspend/resume (s2idle).
---
Changes in v2:
- Split into ethtool, phylink, PHY and MAC patches (Heiner)
- Add ETHTOOL_LINK_MODE_500baseT2_Full and SPEED_500, and report a
Giga Lite link as 500 instead of 1000 (Andrew, Heiner)
- Gate bit 9 on 500baseT2/Full instead of 1000baseT/Full
- Enable on RTL8168H and RTL8168FP as well (Heiner)
- Explain Giga Lite in a code comment (Heiner)
- Link to v1: https://lore.kernel.org/r/20261010135356.85454-1-hskim@dilluti0n.com
---
Hee-Suk Kim (4):
net: ethtool: add 500baseT2 link mode
net: phylink: add MAC_500FD
net: phy: realtek: add Giga Lite support
r8169: enable Giga Lite on RTL8168H/EP/FP
MAINTAINERS | 1 +
drivers/net/ethernet/realtek/r8169_main.c | 24 ++++++++++++++
drivers/net/phy/phy-caps.h | 1 +
drivers/net/phy/phy-core.c | 4 ++-
drivers/net/phy/phy_caps.c | 7 +++++
drivers/net/phy/phylink.c | 1 +
drivers/net/phy/realtek/realtek_main.c | 52 +++++++++++++++++++++++++++++++
include/linux/phylink.h | 29 ++++++++---------
include/linux/realtek_phy.h | 10 ++++++
include/uapi/linux/ethtool.h | 2 ++
net/ethtool/common.c | 3 ++
11 files changed, 119 insertions(+), 15 deletions(-)
---
base-commit: d5cf954cebe4f175dfd834e1dc471a3aa203ec7d
change-id: 20261116-giga-lite-2cf802c97bd4
Best regards,
--
Hee-Suk Kim <hskim@dilluti0n.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode
2026-12-05 4:00 [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP Hee-Suk Kim
@ 2026-12-05 4:00 ` Hee-Suk Kim
2026-12-05 8:18 ` Maxime Chevallier
2026-12-05 4:00 ` [PATCH net-next v2 2/4] net: phylink: add MAC_500FD Hee-Suk Kim
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 4:00 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Maxime Chevallier, Daniel Golle, nic_swsd,
Andrew Lunn, linux-kernel, javen, Björn Töpel,
Hee-Suk Kim
Add ETHTOOL_LINK_MODE_500baseT2_Full_BIT and SPEED_500 for 500 Mbps
over two pairs, together with the matching phylib link capability.
Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
---
drivers/net/phy/phy-caps.h | 1 +
drivers/net/phy/phy-core.c | 4 +++-
drivers/net/phy/phy_caps.c | 7 +++++++
include/uapi/linux/ethtool.h | 2 ++
net/ethtool/common.c | 3 +++
5 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy-caps.h b/drivers/net/phy/phy-caps.h
index ec3d39a0ae06..0b39e0e7aca9 100644
--- a/drivers/net/phy/phy-caps.h
+++ b/drivers/net/phy/phy-caps.h
@@ -15,6 +15,7 @@ enum {
LINK_CAPA_10FD,
LINK_CAPA_100HD,
LINK_CAPA_100FD,
+ LINK_CAPA_500FD,
LINK_CAPA_1000HD,
LINK_CAPA_1000FD,
LINK_CAPA_2500FD,
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index d7a4a977fc8a..0c464e0d971e 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -18,7 +18,7 @@
*/
const char *phy_speed_to_str(int speed)
{
- BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 125,
+ BUILD_BUG_ON_MSG(__ETHTOOL_LINK_MODE_MASK_NBITS != 126,
"Enum ethtool_link_mode_bit_indices and phylib are out of sync. "
"If a speed or mode has been added please update phy_speed_to_str "
"and the PHY settings array.\n");
@@ -28,6 +28,8 @@ const char *phy_speed_to_str(int speed)
return "10Mbps";
case SPEED_100:
return "100Mbps";
+ case SPEED_500:
+ return "500Mbps";
case SPEED_1000:
return "1Gbps";
case SPEED_2500:
diff --git a/drivers/net/phy/phy_caps.c b/drivers/net/phy/phy_caps.c
index 558e4df4d63c..3112e9034566 100644
--- a/drivers/net/phy/phy_caps.c
+++ b/drivers/net/phy/phy_caps.c
@@ -11,6 +11,7 @@ static struct link_capabilities link_caps[__LINK_CAPA_MAX] __ro_after_init = {
{ SPEED_10, DUPLEX_FULL, {0} }, /* LINK_CAPA_10FD */
{ SPEED_100, DUPLEX_HALF, {0} }, /* LINK_CAPA_100HD */
{ SPEED_100, DUPLEX_FULL, {0} }, /* LINK_CAPA_100FD */
+ { SPEED_500, DUPLEX_FULL, {0} }, /* LINK_CAPA_500FD */
{ SPEED_1000, DUPLEX_HALF, {0} }, /* LINK_CAPA_1000HD */
{ SPEED_1000, DUPLEX_FULL, {0} }, /* LINK_CAPA_1000FD */
{ SPEED_2500, DUPLEX_FULL, {0} }, /* LINK_CAPA_2500FD */
@@ -40,6 +41,8 @@ static int speed_duplex_to_capa(int speed, unsigned int duplex)
LINK_CAPA_10FD : LINK_CAPA_10HD;
case SPEED_100: return duplex == DUPLEX_FULL ?
LINK_CAPA_100FD : LINK_CAPA_100HD;
+ case SPEED_500: return duplex == DUPLEX_FULL ?
+ LINK_CAPA_500FD : -EINVAL;
case SPEED_1000: return duplex == DUPLEX_FULL ?
LINK_CAPA_1000FD : LINK_CAPA_1000HD;
case SPEED_2500: return LINK_CAPA_2500FD;
@@ -295,6 +298,10 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
{
unsigned long link_caps = 0;
+ /* The only PHYs known to support 500baseT2 are attached over GMII */
+ if (interface == PHY_INTERFACE_MODE_GMII)
+ link_caps |= BIT(LINK_CAPA_500FD);
+
switch (interface) {
case PHY_INTERFACE_MODE_USXGMII:
link_caps |= BIT(LINK_CAPA_10000FD) | BIT(LINK_CAPA_5000FD);
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 9e60c17b48c8..aa978de7390a 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -2105,6 +2105,7 @@ enum ethtool_link_mode_bit_indices {
ETHTOOL_LINK_MODE_1600000baseKR8_Full_BIT = 122,
ETHTOOL_LINK_MODE_1600000baseDR8_Full_BIT = 123,
ETHTOOL_LINK_MODE_1600000baseDR8_2_Full_BIT = 124,
+ ETHTOOL_LINK_MODE_500baseT2_Full_BIT = 125,
/* must be last entry */
__ETHTOOL_LINK_MODE_MASK_NBITS
@@ -2204,6 +2205,7 @@ enum ethtool_link_mode_bit_indices {
*/
#define SPEED_10 10
#define SPEED_100 100
+#define SPEED_500 500
#define SPEED_1000 1000
#define SPEED_2500 2500
#define SPEED_5000 5000
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index ec67fbd6bb86..f8fc67e1f3a2 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -242,6 +242,7 @@ const char link_mode_names[][ETH_GSTRING_LEN] = {
__DEFINE_LINK_MODE_NAME(1600000, KR8, Full),
__DEFINE_LINK_MODE_NAME(1600000, DR8, Full),
__DEFINE_LINK_MODE_NAME(1600000, DR8_2, Full),
+ __DEFINE_LINK_MODE_NAME(500, T2, Full),
};
static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
@@ -289,6 +290,7 @@ static_assert(ARRAY_SIZE(link_mode_names) == __ETHTOOL_LINK_MODE_MASK_NBITS);
#define __LINK_MODE_LANES_VR8 8
#define __LINK_MODE_LANES_DR8_2 8
#define __LINK_MODE_LANES_T1BRR 1
+#define __LINK_MODE_LANES_T2 1
#define __DEFINE_LINK_MODE_PARAMS_PAIRS(_speed, _type, _min_pairs, _pairs, _duplex, _medium) \
[ETHTOOL_LINK_MODE(_speed, _type, _duplex)] = { \
@@ -469,6 +471,7 @@ const struct link_mode_info link_mode_params[] = {
__DEFINE_LINK_MODE_PARAMS(1600000, KR8, Full, K),
__DEFINE_LINK_MODE_PARAMS(1600000, DR8, Full, D),
__DEFINE_LINK_MODE_PARAMS(1600000, DR8_2, Full, D),
+ __DEFINE_LINK_MODE_PARAMS_PAIRS(500, T2, 2, 2, Full, T),
};
static_assert(ARRAY_SIZE(link_mode_params) == __ETHTOOL_LINK_MODE_MASK_NBITS);
EXPORT_SYMBOL_GPL(link_mode_params);
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 2/4] net: phylink: add MAC_500FD
2026-12-05 4:00 [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode Hee-Suk Kim
@ 2026-12-05 4:00 ` Hee-Suk Kim
2026-12-05 8:19 ` Maxime Chevallier
2026-12-05 4:00 ` [PATCH net-next v2 3/4] net: phy: realtek: add Giga Lite support Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP Hee-Suk Kim
3 siblings, 1 reply; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 4:00 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Maxime Chevallier, Daniel Golle, nic_swsd,
Andrew Lunn, linux-kernel, javen, Björn Töpel,
Hee-Suk Kim
Add a MAC capability for 500 Mbps full duplex. It is placed between
MAC_100FD and MAC_1000HD because the capability bits are expected to be
ordered by speed.
Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
---
drivers/net/phy/phylink.c | 1 +
include/linux/phylink.h | 29 +++++++++++++++--------------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 6f5af388210d..c6aef11f544e 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -327,6 +327,7 @@ static struct {
{ MAC_2500FD, SPEED_2500, DUPLEX_FULL, BIT(LINK_CAPA_2500FD) },
{ MAC_1000FD, SPEED_1000, DUPLEX_FULL, BIT(LINK_CAPA_1000FD) },
{ MAC_1000HD, SPEED_1000, DUPLEX_HALF, BIT(LINK_CAPA_1000HD) },
+ { MAC_500FD, SPEED_500, DUPLEX_FULL, BIT(LINK_CAPA_500FD) },
{ MAC_100FD, SPEED_100, DUPLEX_FULL, BIT(LINK_CAPA_100FD) },
{ MAC_100HD, SPEED_100, DUPLEX_HALF, BIT(LINK_CAPA_100HD) },
{ MAC_10FD, SPEED_10, DUPLEX_FULL, BIT(LINK_CAPA_10FD) },
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index a7b6294cc4a0..d03634d8ab70 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -79,21 +79,22 @@ enum {
MAC_100HD = BIT(4),
MAC_100FD = BIT(5),
MAC_100 = MAC_100HD | MAC_100FD,
- MAC_1000HD = BIT(6),
- MAC_1000FD = BIT(7),
+ MAC_500FD = BIT(6),
+ MAC_1000HD = BIT(7),
+ MAC_1000FD = BIT(8),
MAC_1000 = MAC_1000HD | MAC_1000FD,
- MAC_2500FD = BIT(8),
- MAC_5000FD = BIT(9),
- MAC_10000FD = BIT(10),
- MAC_20000FD = BIT(11),
- MAC_25000FD = BIT(12),
- MAC_40000FD = BIT(13),
- MAC_50000FD = BIT(14),
- MAC_56000FD = BIT(15),
- MAC_80000FD = BIT(16),
- MAC_100000FD = BIT(17),
- MAC_200000FD = BIT(18),
- MAC_400000FD = BIT(19),
+ MAC_2500FD = BIT(9),
+ MAC_5000FD = BIT(10),
+ MAC_10000FD = BIT(11),
+ MAC_20000FD = BIT(12),
+ MAC_25000FD = BIT(13),
+ MAC_40000FD = BIT(14),
+ MAC_50000FD = BIT(15),
+ MAC_56000FD = BIT(16),
+ MAC_80000FD = BIT(17),
+ MAC_100000FD = BIT(18),
+ MAC_200000FD = BIT(19),
+ MAC_400000FD = BIT(20),
};
static inline bool phylink_autoneg_inband(unsigned int mode)
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 3/4] net: phy: realtek: add Giga Lite support
2026-12-05 4:00 [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 2/4] net: phylink: add MAC_500FD Hee-Suk Kim
@ 2026-12-05 4:00 ` Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP Hee-Suk Kim
3 siblings, 0 replies; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 4:00 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Maxime Chevallier, Daniel Golle, nic_swsd,
Andrew Lunn, linux-kernel, javen, Björn Töpel,
Hee-Suk Kim
Giga Lite is a Realtek proprietary mode which runs at 500 Mbps over two
pairs. Expose it as 500baseT2/Full on the generic FE-GE PHY when the MAC
driver sets RTL_PHY_F_GIGA_LITE, and report SPEED_500 for it.
The PHY enables Giga Lite when page 0xa42, reg 0x14, bit 9 is set, and
negotiates it on its own regardless of the C22 advertisement. With the
bit set, the link came up at Giga Lite even when only 10/100 was
advertised. So set the bit only when autonegotiating with
500baseT2/Full advertised, and clear it otherwise, so that the
advertisement set with ethtool is respected.
500baseT2/Full is advertised by default. It is added in config_init()
rather than get_features(), as dev_flags is not yet set when the PHY is
probed.
Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
---
MAINTAINERS | 1 +
drivers/net/phy/realtek/realtek_main.c | 52 ++++++++++++++++++++++++++++++++++
include/linux/realtek_phy.h | 10 +++++++
3 files changed, 63 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index bfa5a7248973..07e4c8f80682 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10066,6 +10066,7 @@ F: include/linux/phy_fixed.h
F: include/linux/phy_link_topology.h
F: include/linux/phylib_stubs.h
F: include/linux/platform_data/mdio-bcm-unimac.h
+F: include/linux/realtek_phy.h
F: include/net/phy/
F: include/trace/events/mdio.h
F: include/uapi/linux/mdio.h
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index a39ad18382f2..bf62823252d9 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -14,6 +14,7 @@
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/pm_wakeirq.h>
+#include <linux/realtek_phy.h>
#include <linux/netdevice.h>
#include <linux/module.h>
#include <linux/delay.h>
@@ -1708,6 +1709,9 @@ static void rtlgen_decode_physr(struct phy_device *phydev, int val)
case 0x0020:
phydev->speed = SPEED_1000;
break;
+ case 0x0030: /* Giga Lite */
+ phydev->speed = SPEED_500;
+ break;
case 0x0200:
phydev->speed = SPEED_10000;
break;
@@ -1735,6 +1739,52 @@ static void rtlgen_decode_physr(struct phy_device *phydev, int val)
}
}
+/* Giga Lite is a Realtek proprietary mode which runs at 500 Mbps over
+ * two pairs. It is negotiated on its own and does not depend on 1000baseT
+ * being advertised, so it is exposed as the 500baseT2/Full link mode.
+ *
+ * The PHY ID is shared by all PHYs integrated into the RTL8168 family, so
+ * the MAC driver tells us whether the chip supports it. dev_flags is not
+ * known before the MAC driver has attached, hence the link mode is added
+ * here instead of in get_features().
+ */
+static int rtlgen_config_init(struct phy_device *phydev)
+{
+ if (!(phydev->dev_flags & RTL_PHY_F_GIGA_LITE))
+ return 0;
+
+ /* Advertise it by default, but only the first time, so that the
+ * user setting survives a later phy_init_hw().
+ */
+ if (!linkmode_test_bit(ETHTOOL_LINK_MODE_500baseT2_Full_BIT,
+ phydev->supported)) {
+ linkmode_set_bit(ETHTOOL_LINK_MODE_500baseT2_Full_BIT,
+ phydev->supported);
+ linkmode_set_bit(ETHTOOL_LINK_MODE_500baseT2_Full_BIT,
+ phydev->advertising);
+ }
+
+ return 0;
+}
+
+static int rtlgen_config_aneg(struct phy_device *phydev)
+{
+ int ret = 0;
+
+ if (phydev->dev_flags & RTL_PHY_F_GIGA_LITE) {
+ bool en = phydev->autoneg == AUTONEG_ENABLE &&
+ linkmode_test_bit(ETHTOOL_LINK_MODE_500baseT2_Full_BIT,
+ phydev->advertising);
+
+ ret = phy_modify_paged_changed(phydev, 0xa42, 0x14, BIT(9),
+ en ? BIT(9) : 0);
+ if (ret < 0)
+ return ret;
+ }
+
+ return __genphy_config_aneg(phydev, ret > 0);
+}
+
static int rtlgen_read_status(struct phy_device *phydev)
{
int ret, val;
@@ -3286,6 +3336,8 @@ static struct phy_driver realtek_drvs[] = {
}, {
.name = "Generic FE-GE Realtek PHY",
.match_phy_device = rtlgen_match_phy_device,
+ .config_init = rtlgen_config_init,
+ .config_aneg = rtlgen_config_aneg,
.read_status = rtlgen_read_status,
.suspend = genphy_suspend,
.resume = rtlgen_resume,
diff --git a/include/linux/realtek_phy.h b/include/linux/realtek_phy.h
new file mode 100644
index 000000000000..7fcde616c070
--- /dev/null
+++ b/include/linux/realtek_phy.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _REALTEK_PHY_H
+#define _REALTEK_PHY_H
+
+#include <linux/bits.h>
+
+/* phy_device::dev_flags */
+#define RTL_PHY_F_GIGA_LITE BIT(0)
+
+#endif /* _REALTEK_PHY_H */
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP
2026-12-05 4:00 [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP Hee-Suk Kim
` (2 preceding siblings ...)
2026-12-05 4:00 ` [PATCH net-next v2 3/4] net: phy: realtek: add Giga Lite support Hee-Suk Kim
@ 2026-12-05 4:00 ` Hee-Suk Kim
3 siblings, 0 replies; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 4:00 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Maxime Chevallier, Daniel Golle, nic_swsd,
Andrew Lunn, linux-kernel, javen, Björn Töpel,
Hee-Suk Kim
Giga Lite is a Realtek proprietary mode which runs at 500 Mbps over two
pairs. Set RTL_PHY_F_GIGA_LITE and MAC_500FD on RTL8168H, RTL8168EP and
RTL8168FP, so that the PHY driver exposes it as 500baseT2/Full.
The vendor driver enables Giga Lite on RTL8168H and RTL8168FP, but not
on RTL8168M, which shares its chip version with RTL8168H in r8169. So
exclude RTL8168M by its XID. RTL8168EP is not handled by the vendor
driver, but Giga Lite was tested to work on it.
Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 1da64c6e39e2..59a6c3a5a645 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -28,6 +28,7 @@
#include <linux/bitfield.h>
#include <linux/phylink.h>
#include <linux/prefetch.h>
+#include <linux/realtek_phy.h>
#include <linux/ipv6.h>
#include <linux/unaligned.h>
#include <linux/u64_stats_sync.h>
@@ -884,6 +885,7 @@ struct rtl8169_private {
struct mutex led_lock; /* serialize LED ctrl RMW access */
unsigned supports_gmii:1;
+ unsigned supports_giga_lite:1;
unsigned aspm_manageable:1;
unsigned dash_enabled:1;
dma_addr_t counters_phys_addr;
@@ -2290,6 +2292,7 @@ static const struct rtl_coalesce_info rtl_coalesce_info_8169[] = {
static const struct rtl_coalesce_info rtl_coalesce_info_8168_8136[] = {
{ SPEED_1000, COALESCE_DELAY(5000) },
+ { SPEED_500, COALESCE_DELAY(5000) },
{ SPEED_100, COALESCE_DELAY(2560) },
{ SPEED_10, COALESCE_DELAY(40960) },
{ 0 },
@@ -2662,6 +2665,20 @@ static const struct rtl_chip_info *rtl8169_get_chip_version(u32 xid, bool gmii)
return p;
}
+static bool rtl_supports_giga_lite(struct rtl8169_private *tp, u32 xid)
+{
+ switch (tp->mac_version) {
+ case RTL_GIGA_MAC_VER_46:
+ /* RTL8168M */
+ return (xid & 0x7cf) != 0x6c0;
+ case RTL_GIGA_MAC_VER_51:
+ case RTL_GIGA_MAC_VER_52:
+ return true;
+ default:
+ return false;
+ }
+}
+
static const struct rtl_chip_info *rtl8169_get_extended_chip_version(u32 xid2)
{
const struct rtl_chip_info *p = rtl_chip_infos_extended;
@@ -6291,6 +6308,9 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
return -EUNATCH;
}
+ if (tp->supports_giga_lite)
+ tp->phydev->dev_flags |= RTL_PHY_F_GIGA_LITE;
+
/* Keep EEE off but the version stays EEE-capable so that link-up
* still clears the MAC TX-LPI bits.
*/
@@ -6664,6 +6684,9 @@ static int rtl_init_phylink(struct rtl8169_private *tp)
if (tp->supports_gmii)
tp->phylink_config.mac_capabilities |= MAC_1000FD;
+ if (tp->supports_giga_lite)
+ tp->phylink_config.mac_capabilities |= MAC_500FD;
+
if (tp->mac_version < RTL_GIGA_MAC_VER_61)
phy_mode = tp->supports_gmii ? PHY_INTERFACE_MODE_GMII :
PHY_INTERFACE_MODE_MII;
@@ -6869,6 +6892,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
"unknown chip %sXID %x, contact r8169 maintainers (see MAINTAINERS file)\n",
ext_xid_str, xid);
tp->mac_version = chip->mac_version;
+ tp->supports_giga_lite = rtl_supports_giga_lite(tp, xid);
tp->fw_name = chip->fw_name;
tp->speed = SPEED_UNKNOWN;
--
2.56.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode
2026-12-05 4:00 ` [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode Hee-Suk Kim
@ 2026-12-05 8:18 ` Maxime Chevallier
2026-12-05 16:23 ` Hee-Suk Kim
0 siblings, 1 reply; 8+ messages in thread
From: Maxime Chevallier @ 2026-12-05 8:18 UTC (permalink / raw)
To: Hee-Suk Kim, netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Daniel Golle, nic_swsd, Andrew Lunn, linux-kernel,
javen, Björn Töpel
Hi,
On 12/5/26 05:00, Hee-Suk Kim wrote:
> Add ETHTOOL_LINK_MODE_500baseT2_Full_BIT and SPEED_500 for 500 Mbps
> over two pairs, together with the matching phylib link capability.
>
> Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
[...]
> @@ -295,6 +298,10 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
> {
> unsigned long link_caps = 0;
>
> + /* The only PHYs known to support 500baseT2 are attached over GMII */
> + if (interface == PHY_INTERFACE_MODE_GMII)
> + link_caps |= BIT(LINK_CAPA_500FD);
> +
This whole patch seems good to me, with all the phy_caps and all, the only question
I have is about the xMII mode used. Is it really GMII, or some tweaked version of it ?
I guess the MAC to PHY mode on these setups isn't pure GMII, but likely a modified
of it, with a different clock rate ? at 1G the GMII is clocked at 125MHz, do you know
what's going on at 500M ?
Does a PHY that supports 500BaseT2 also support other 2-pair modes, like 100BaseTX ?
IOW, can the xMII used here adapt for multiple speeds like GMII ?
We may need a dedicated phy_interface_t value for the xMII here is what I mean :)
Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/4] net: phylink: add MAC_500FD
2026-12-05 4:00 ` [PATCH net-next v2 2/4] net: phylink: add MAC_500FD Hee-Suk Kim
@ 2026-12-05 8:19 ` Maxime Chevallier
0 siblings, 0 replies; 8+ messages in thread
From: Maxime Chevallier @ 2026-12-05 8:19 UTC (permalink / raw)
To: Hee-Suk Kim, netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Daniel Golle, nic_swsd, Andrew Lunn, linux-kernel,
javen, Björn Töpel
Hi,
On 12/5/26 05:00, Hee-Suk Kim wrote:
> Add a MAC capability for 500 Mbps full duplex. It is placed between
> MAC_100FD and MAC_1000HD because the capability bits are expected to be
> ordered by speed.
>
> Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
> ---
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Maxime
> drivers/net/phy/phylink.c | 1 +
> include/linux/phylink.h | 29 +++++++++++++++--------------
> 2 files changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 6f5af388210d..c6aef11f544e 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -327,6 +327,7 @@ static struct {
> { MAC_2500FD, SPEED_2500, DUPLEX_FULL, BIT(LINK_CAPA_2500FD) },
> { MAC_1000FD, SPEED_1000, DUPLEX_FULL, BIT(LINK_CAPA_1000FD) },
> { MAC_1000HD, SPEED_1000, DUPLEX_HALF, BIT(LINK_CAPA_1000HD) },
> + { MAC_500FD, SPEED_500, DUPLEX_FULL, BIT(LINK_CAPA_500FD) },
> { MAC_100FD, SPEED_100, DUPLEX_FULL, BIT(LINK_CAPA_100FD) },
> { MAC_100HD, SPEED_100, DUPLEX_HALF, BIT(LINK_CAPA_100HD) },
> { MAC_10FD, SPEED_10, DUPLEX_FULL, BIT(LINK_CAPA_10FD) },
> diff --git a/include/linux/phylink.h b/include/linux/phylink.h
> index a7b6294cc4a0..d03634d8ab70 100644
> --- a/include/linux/phylink.h
> +++ b/include/linux/phylink.h
> @@ -79,21 +79,22 @@ enum {
> MAC_100HD = BIT(4),
> MAC_100FD = BIT(5),
> MAC_100 = MAC_100HD | MAC_100FD,
> - MAC_1000HD = BIT(6),
> - MAC_1000FD = BIT(7),
> + MAC_500FD = BIT(6),
> + MAC_1000HD = BIT(7),
> + MAC_1000FD = BIT(8),
> MAC_1000 = MAC_1000HD | MAC_1000FD,
> - MAC_2500FD = BIT(8),
> - MAC_5000FD = BIT(9),
> - MAC_10000FD = BIT(10),
> - MAC_20000FD = BIT(11),
> - MAC_25000FD = BIT(12),
> - MAC_40000FD = BIT(13),
> - MAC_50000FD = BIT(14),
> - MAC_56000FD = BIT(15),
> - MAC_80000FD = BIT(16),
> - MAC_100000FD = BIT(17),
> - MAC_200000FD = BIT(18),
> - MAC_400000FD = BIT(19),
> + MAC_2500FD = BIT(9),
> + MAC_5000FD = BIT(10),
> + MAC_10000FD = BIT(11),
> + MAC_20000FD = BIT(12),
> + MAC_25000FD = BIT(13),
> + MAC_40000FD = BIT(14),
> + MAC_50000FD = BIT(15),
> + MAC_56000FD = BIT(16),
> + MAC_80000FD = BIT(17),
> + MAC_100000FD = BIT(18),
> + MAC_200000FD = BIT(19),
> + MAC_400000FD = BIT(20),
> };
>
> static inline bool phylink_autoneg_inband(unsigned int mode)
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode
2026-12-05 8:18 ` Maxime Chevallier
@ 2026-12-05 16:23 ` Hee-Suk Kim
0 siblings, 0 replies; 8+ messages in thread
From: Hee-Suk Kim @ 2026-12-05 16:23 UTC (permalink / raw)
To: Maxime Chevallier, netdev
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
Simon Horman, Daniel Golle, nic_swsd, Andrew Lunn, linux-kernel,
javen, Björn Töpel
Maxime Chevallier <maxime.chevallier@bootlin.com> writes:
> Hi,
>
> On 12/5/26 05:00, Hee-Suk Kim wrote:
>> Add ETHTOOL_LINK_MODE_500baseT2_Full_BIT and SPEED_500 for 500 Mbps
>> over two pairs, together with the matching phylib link capability.
>>
>> Signed-off-by: Hee-Suk Kim <hskim@dilluti0n.com>
>
> [...]
>
>> @@ -295,6 +298,10 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
>> {
>> unsigned long link_caps = 0;
>>
>> + /* The only PHYs known to support 500baseT2 are attached over GMII */
>> + if (interface == PHY_INTERFACE_MODE_GMII)
>> + link_caps |= BIT(LINK_CAPA_500FD);
>> +
>
> This whole patch seems good to me, with all the phy_caps and all, the only question
> I have is about the xMII mode used. Is it really GMII, or some tweaked version of it ?
>
> I guess the MAC to PHY mode on these setups isn't pure GMII, but likely a modified
> of it, with a different clock rate ? at 1G the GMII is clocked at 125MHz, do you know
> what's going on at 500M ?
>
I don't think it's really GMII. On these Realtek chips the PHY and MAC
are integrated on a single chip, and r8169 just labels older chips as
GMII/MII in rtl_init_phylink():
if (tp->mac_version < RTL_GIGA_MAC_VER_61)
phy_mode = tp->supports_gmii ? PHY_INTERFACE_MODE_GMII :
PHY_INTERFACE_MODE_MII;
else
phy_mode = PHY_INTERFACE_MODE_INTERNAL;
That comment meant that the Realtek chips needing 500baseT2 are labeled
GMII (all below VER_61 in this series), not that the xMII is really
GMII.
Giga Lite is the only known (and Realtek proprietary) way to do 500 Mbps
over two pairs, so they are the only users of 500baseT2.
> Does a PHY that supports 500BaseT2 also support other 2-pair modes, like 100BaseTX ?
> IOW, can the xMII used here adapt for multiple speeds like GMII ?
>
> We may need a dedicated phy_interface_t value for the xMII here is what I mean :)
Yes, it's a regular 10/100/1000 PHY with Giga Lite added on top.
Since the MAC and PHY are integrated, I can't tell how the chip carries
500 Mbps between them. It seems to handle that internally. In the v1
tests [1], the link ran at ~94 or ~470 Mbps depending only on the Giga
Lite enable bit (page 0xa42, reg 0x14, bit 9), regardless of the speed
the kernel reported.
A dedicated value would make sense if we knew what the bus is, but I
have no information beyond the above, not even whether a standalone
Realtek PHY with Giga Lite (if any) would use the same protocol as the
integrated chips.
The current patch works fine, since Realtek is the only user as
mentioned above. So, unless you'd prefer a dedicated value, I'm thinking
of rewording the comment to something like:
/* Realtek's Giga Lite is the only supported 500baseT2 hardware. Its
* PHY is integrated with the MAC and labeled as GMII by r8169.
*/
if (interface == PHY_INTERFACE_MODE_GMII)
link_caps |= BIT(LINK_CAPA_500FD);
A third option would be to switch the Giga Lite capable chips in r8169
to PHY_INTERFACE_MODE_INTERNAL, but I couldn't find what the GMII/MII
labeling there is for, so I'm hesitant to drop it. Heiner or Javen may
know more.
[1] https://lore.kernel.org/r/20261010135356.85454-1-hskim@dilluti0n.com
Thanks,
hsk
>
> Maxime
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-12-05 16:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 4:00 [PATCH net-next v2 0/4] net: add Giga Lite (500baseT2) support for RTL8168H/EP/FP Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 1/4] net: ethtool: add 500baseT2 link mode Hee-Suk Kim
2026-12-05 8:18 ` Maxime Chevallier
2026-12-05 16:23 ` Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 2/4] net: phylink: add MAC_500FD Hee-Suk Kim
2026-12-05 8:19 ` Maxime Chevallier
2026-12-05 4:00 ` [PATCH net-next v2 3/4] net: phy: realtek: add Giga Lite support Hee-Suk Kim
2026-12-05 4:00 ` [PATCH net-next v2 4/4] r8169: enable Giga Lite on RTL8168H/EP/FP Hee-Suk Kim
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.