* [PATCH net-next] r8169: add support for RTL8125D
@ 2024-10-24 20:42 Heiner Kallweit
2024-10-25 11:25 ` Simon Horman
2024-10-29 23:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Heiner Kallweit @ 2024-10-24 20:42 UTC (permalink / raw)
To: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
Jakub Kicinski, David Miller, Eric Dumazet
Cc: netdev@vger.kernel.org
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>
---
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(-)
diff --git a/drivers/net/ethernet/realtek/r8169.h b/drivers/net/ethernet/realtek/r8169.h
index e2db944e6..be4c96226 100644
--- 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
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 79e7b223b..3da0f6be7 100644
--- 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},
};
@@ -707,6 +709,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);
@@ -2079,10 +2082,7 @@ static void rtl_set_eee_txidle_timer(struct rtl8169_private *tp)
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;
@@ -2293,6 +2293,9 @@ static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii)
{ 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 },
@@ -2558,9 +2561,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
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;
@@ -3872,6 +3873,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
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);
@@ -3920,6 +3927,7 @@ static void rtl_hw_config(struct rtl8169_private *tp)
[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,
};
@@ -3937,6 +3945,7 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)
/* 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;
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
index d504abba7..8739f4b42 100644
--- 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(struct rtl8169_private *tp,
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_private *tp, struct phy_device *phydev,
[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,
};
--
2.47.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: add support for RTL8125D
2024-10-24 20:42 [PATCH net-next] r8169: add support for RTL8125D Heiner Kallweit
@ 2024-10-25 11:25 ` Simon Horman
2024-10-25 11:44 ` Heiner Kallweit
2024-10-29 23:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2024-10-25 11:25 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
Jakub Kicinski, David Miller, Eric Dumazet,
netdev@vger.kernel.org
On Thu, Oct 24, 2024 at 10:42:33PM +0200, Heiner Kallweit wrote:
> 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>
...
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
...
> @@ -3872,6 +3873,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
> 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)
Maybe as a follow-up, rtl_hw_start_8125d and rtl_hw_start_8126a could
be consolidated. They seem to be the same.
...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: add support for RTL8125D
2024-10-25 11:25 ` Simon Horman
@ 2024-10-25 11:44 ` Heiner Kallweit
2024-10-25 12:17 ` Simon Horman
0 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2024-10-25 11:44 UTC (permalink / raw)
To: Simon Horman
Cc: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
Jakub Kicinski, David Miller, Eric Dumazet,
netdev@vger.kernel.org
On 25.10.2024 13:25, Simon Horman wrote:
> On Thu, Oct 24, 2024 at 10:42:33PM +0200, Heiner Kallweit wrote:
>> 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>
>
> ...
>
>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
>
> ...
>
>> @@ -3872,6 +3873,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
>> 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)
>
> Maybe as a follow-up, rtl_hw_start_8125d and rtl_hw_start_8126a could
> be consolidated. They seem to be the same.
>
Thanks for the review. Yes, for now they are the same. Both chip versions are new
and once there are enough users, I wouldn't be surprised if we need version-specific
tweaks to work around compatibility issues on certain systems.
Therefore the separate versions for the time being.
> ...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: add support for RTL8125D
2024-10-25 11:44 ` Heiner Kallweit
@ 2024-10-25 12:17 ` Simon Horman
0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2024-10-25 12:17 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
Jakub Kicinski, David Miller, Eric Dumazet,
netdev@vger.kernel.org
On Fri, Oct 25, 2024 at 01:44:48PM +0200, Heiner Kallweit wrote:
> On 25.10.2024 13:25, Simon Horman wrote:
> > On Thu, Oct 24, 2024 at 10:42:33PM +0200, Heiner Kallweit wrote:
> >> 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>
> >
> > ...
> >
> >> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> >
> > ...
> >
> >> @@ -3872,6 +3873,12 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
> >> 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)
> >
> > Maybe as a follow-up, rtl_hw_start_8125d and rtl_hw_start_8126a could
> > be consolidated. They seem to be the same.
> >
> Thanks for the review. Yes, for now they are the same. Both chip versions are new
> and once there are enough users, I wouldn't be surprised if we need version-specific
> tweaks to work around compatibility issues on certain systems.
> Therefore the separate versions for the time being.
Thanks, understood.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] r8169: add support for RTL8125D
2024-10-24 20:42 [PATCH net-next] r8169: add support for RTL8125D Heiner Kallweit
2024-10-25 11:25 ` Simon Horman
@ 2024-10-29 23:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-29 23:50 UTC (permalink / raw)
To: Heiner Kallweit
Cc: nic_swsd, andrew+netdev, pabeni, kuba, davem, edumazet, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 24 Oct 2024 22:42:33 +0200 you wrote:
> 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>
> ---
> 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(-)
Here is the summary with links:
- [net-next] r8169: add support for RTL8125D
https://git.kernel.org/netdev/net-next/c/f75d1fbe7809
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-29 23:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-24 20:42 [PATCH net-next] r8169: add support for RTL8125D Heiner Kallweit
2024-10-25 11:25 ` Simon Horman
2024-10-25 11:44 ` Heiner Kallweit
2024-10-25 12:17 ` Simon Horman
2024-10-29 23:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).