mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-10 23:12:48 +00:00
56b2d856a2
7a3bcd39ae1f r8169: use helper r8169_mod_reg8_cond to simplify rtl_jumbo_config
e3e9e9039fa6 r8169: align WAKE_PHY handling with r8125/r8126 vendor drivers
330dc2297c82 r8169: improve rtl_set_d3_pll_down
c507e96b5763 r8169: improve __rtl8169_set_wol
83cb4b470c66 r8169: remove leftover locks after reverted change
2cd02f2fdd8a r8169: improve initialization of RSS registers on RTL8125/RTL8126
a3d8520e6a19 r8169: align RTL8126 EEE config with vendor driver
4af2f60bf737 r8169: align RTL8125/RTL8126 PHY config with vendor driver
eb90f876b796 r8169: align RTL8125 EEE config with vendor driver
b8bd8c44a266 r8169: fix inconsistent indenting in rtl8169_get_eth_mac_stats
f75d1fbe7809 r8169: add support for RTL8125D
c4e64095c00c r8169: enable EEE at 2.5G per default on RTL8125B
d64113c6bb5e r8169: remove rtl_dash_loop_wait_high/low
1c105bacb160 r8169: avoid duplicated messages if loading firmware fails and switch to warn level
ac48430368c1 r8169: don't take RTNL lock in rtl_task()
e3fc5139bd8f r8169: implement additional ethtool stats ops
b8bf38440ba9 r8169: enable SG/TSO on selected chip versions per default
854d71c555df r8169: remove original workaround for RTL8125 broken rx issue
1ffcc8d41306 r8169: add support for the temperature sensor being available from RTL8125B
The following patches require backporting additional linux patches:
e2015942e90a r8169: replace custom flag with disable_work() et al
e340bff27e63 r8169: copy vendor driver 2.5G/5G EEE advertisement constraints
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
(cherry picked from commit 0eeba04a16
)
144 lines
5.1 KiB
Diff
144 lines
5.1 KiB
Diff
From f75d1fbe7809bc5ed134204b920fd9e2fc5db1df Mon Sep 17 00:00:00 2001
|
|
From: Heiner Kallweit <hkallweit1@gmail.com>
|
|
Date: Thu, 24 Oct 2024 22:42:33 +0200
|
|
Subject: [PATCH] r8169: add support for RTL8125D
|
|
|
|
This adds support for new chip version RTL8125D, which can be found on
|
|
boards like Gigabyte X870E AORUS ELITE WIFI7. Firmware rtl8125d-1.fw
|
|
for this chip version is available in linux-firmware already.
|
|
|
|
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
|
|
Reviewed-by: Simon Horman <horms@kernel.org>
|
|
Link: https://patch.msgid.link/d0306912-e88e-4c25-8b5d-545ae8834c0c@gmail.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
drivers/net/ethernet/realtek/r8169.h | 1 +
|
|
drivers/net/ethernet/realtek/r8169_main.c | 23 +++++++++++++------
|
|
.../net/ethernet/realtek/r8169_phy_config.c | 10 ++++++++
|
|
3 files changed, 27 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/realtek/r8169.h
|
|
+++ b/drivers/net/ethernet/realtek/r8169.h
|
|
@@ -68,6 +68,7 @@ enum mac_version {
|
|
/* support for RTL_GIGA_MAC_VER_60 has been removed */
|
|
RTL_GIGA_MAC_VER_61,
|
|
RTL_GIGA_MAC_VER_63,
|
|
+ RTL_GIGA_MAC_VER_64,
|
|
RTL_GIGA_MAC_VER_65,
|
|
RTL_GIGA_MAC_VER_66,
|
|
RTL_GIGA_MAC_NONE
|
|
--- a/drivers/net/ethernet/realtek/r8169_main.c
|
|
+++ b/drivers/net/ethernet/realtek/r8169_main.c
|
|
@@ -56,6 +56,7 @@
|
|
#define FIRMWARE_8107E_2 "rtl_nic/rtl8107e-2.fw"
|
|
#define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw"
|
|
#define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw"
|
|
+#define FIRMWARE_8125D_1 "rtl_nic/rtl8125d-1.fw"
|
|
#define FIRMWARE_8126A_2 "rtl_nic/rtl8126a-2.fw"
|
|
#define FIRMWARE_8126A_3 "rtl_nic/rtl8126a-3.fw"
|
|
|
|
@@ -139,6 +140,7 @@ static const struct {
|
|
[RTL_GIGA_MAC_VER_61] = {"RTL8125A", FIRMWARE_8125A_3},
|
|
/* reserve 62 for CFG_METHOD_4 in the vendor driver */
|
|
[RTL_GIGA_MAC_VER_63] = {"RTL8125B", FIRMWARE_8125B_2},
|
|
+ [RTL_GIGA_MAC_VER_64] = {"RTL8125D", FIRMWARE_8125D_1},
|
|
[RTL_GIGA_MAC_VER_65] = {"RTL8126A", FIRMWARE_8126A_2},
|
|
[RTL_GIGA_MAC_VER_66] = {"RTL8126A", FIRMWARE_8126A_3},
|
|
};
|
|
@@ -708,6 +710,7 @@ MODULE_FIRMWARE(FIRMWARE_8168FP_3);
|
|
MODULE_FIRMWARE(FIRMWARE_8107E_2);
|
|
MODULE_FIRMWARE(FIRMWARE_8125A_3);
|
|
MODULE_FIRMWARE(FIRMWARE_8125B_2);
|
|
+MODULE_FIRMWARE(FIRMWARE_8125D_1);
|
|
MODULE_FIRMWARE(FIRMWARE_8126A_2);
|
|
MODULE_FIRMWARE(FIRMWARE_8126A_3);
|
|
|
|
@@ -2080,10 +2083,7 @@ static void rtl_set_eee_txidle_timer(str
|
|
tp->tx_lpi_timer = timer_val;
|
|
r8168_mac_ocp_write(tp, 0xe048, timer_val);
|
|
break;
|
|
- case RTL_GIGA_MAC_VER_61:
|
|
- case RTL_GIGA_MAC_VER_63:
|
|
- case RTL_GIGA_MAC_VER_65:
|
|
- case RTL_GIGA_MAC_VER_66:
|
|
+ case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_66:
|
|
tp->tx_lpi_timer = timer_val;
|
|
RTL_W16(tp, EEE_TXIDLE_TIMER_8125, timer_val);
|
|
break;
|
|
@@ -2295,6 +2295,9 @@ static enum mac_version rtl8169_get_mac_
|
|
{ 0x7cf, 0x64a, RTL_GIGA_MAC_VER_66 },
|
|
{ 0x7cf, 0x649, RTL_GIGA_MAC_VER_65 },
|
|
|
|
+ /* 8125D family. */
|
|
+ { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64 },
|
|
+
|
|
/* 8125B family. */
|
|
{ 0x7cf, 0x641, RTL_GIGA_MAC_VER_63 },
|
|
|
|
@@ -2562,9 +2565,7 @@ static void rtl_init_rxcfg(struct rtl816
|
|
case RTL_GIGA_MAC_VER_61:
|
|
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST);
|
|
break;
|
|
- case RTL_GIGA_MAC_VER_63:
|
|
- case RTL_GIGA_MAC_VER_65:
|
|
- case RTL_GIGA_MAC_VER_66:
|
|
+ case RTL_GIGA_MAC_VER_63 ... RTL_GIGA_MAC_VER_66:
|
|
RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_DMA_BURST |
|
|
RX_PAUSE_SLOT_ON);
|
|
break;
|
|
@@ -3876,6 +3877,12 @@ static void rtl_hw_start_8125b(struct rt
|
|
rtl_hw_start_8125_common(tp);
|
|
}
|
|
|
|
+static void rtl_hw_start_8125d(struct rtl8169_private *tp)
|
|
+{
|
|
+ rtl_set_def_aspm_entry_latency(tp);
|
|
+ rtl_hw_start_8125_common(tp);
|
|
+}
|
|
+
|
|
static void rtl_hw_start_8126a(struct rtl8169_private *tp)
|
|
{
|
|
rtl_set_def_aspm_entry_latency(tp);
|
|
@@ -3924,6 +3931,7 @@ static void rtl_hw_config(struct rtl8169
|
|
[RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117,
|
|
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
|
|
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
|
|
+ [RTL_GIGA_MAC_VER_64] = rtl_hw_start_8125d,
|
|
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a,
|
|
[RTL_GIGA_MAC_VER_66] = rtl_hw_start_8126a,
|
|
};
|
|
@@ -3941,6 +3949,7 @@ static void rtl_hw_start_8125(struct rtl
|
|
/* disable interrupt coalescing */
|
|
switch (tp->mac_version) {
|
|
case RTL_GIGA_MAC_VER_61:
|
|
+ case RTL_GIGA_MAC_VER_64:
|
|
for (i = 0xa00; i < 0xb00; i += 4)
|
|
RTL_W32(tp, i, 0);
|
|
break;
|
|
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
|
|
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
|
|
@@ -1103,6 +1103,15 @@ static void rtl8125b_hw_phy_config(struc
|
|
rtl8125b_config_eee_phy(phydev);
|
|
}
|
|
|
|
+static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
|
|
+ struct phy_device *phydev)
|
|
+{
|
|
+ r8169_apply_firmware(tp);
|
|
+ rtl8125_legacy_force_mode(phydev);
|
|
+ rtl8168g_disable_aldps(phydev);
|
|
+ rtl8125b_config_eee_phy(phydev);
|
|
+}
|
|
+
|
|
static void rtl8126a_hw_phy_config(struct rtl8169_private *tp,
|
|
struct phy_device *phydev)
|
|
{
|
|
@@ -1159,6 +1168,7 @@ void r8169_hw_phy_config(struct rtl8169_
|
|
[RTL_GIGA_MAC_VER_53] = rtl8117_hw_phy_config,
|
|
[RTL_GIGA_MAC_VER_61] = rtl8125a_2_hw_phy_config,
|
|
[RTL_GIGA_MAC_VER_63] = rtl8125b_hw_phy_config,
|
|
+ [RTL_GIGA_MAC_VER_64] = rtl8125d_hw_phy_config,
|
|
[RTL_GIGA_MAC_VER_65] = rtl8126a_hw_phy_config,
|
|
[RTL_GIGA_MAC_VER_66] = rtl8126a_hw_phy_config,
|
|
};
|