r8169: merge chip versions
Heiner Kallweit
maintainercover r8169: merge chip versions
After 2b065c098c37 ("r8169: refactor chip version detection") we can merge handling of few chip versions.
Heiner Kallweit (3):
r8169: merge chip versions 70 and 71 (RTL8126A)
r8169: merge chip versions 64 and 65 (RTL8125D)
r8169: merge chip versions 52 and 53 (RTL8117)
drivers/net/ethernet/realtek/r8169.h | 3 -- drivers/net/ethernet/realtek/r8169_main.c | 36 +++++++------------ .../net/ethernet/realtek/r8169_phy_config.c | 3 -- 3 files changed, 12 insertions(+), 30 deletions(-)
Signature · 1 line
2.49.0
Heiner Kallweit
maintainerPATCH 1/3 r8169: merge chip versions 70 and 71 (RTL8126A)
Handling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
--- drivers/net/ethernet/realtek/r8169.h | 1 - drivers/net/ethernet/realtek/r8169_main.c | 15 ++++----------- drivers/net/ethernet/realtek/r8169_phy_config.c | 1 - 3 files changed, 4 insertions(+), 13 deletions(-)
drivers/net/ethernet/realtek/r8169.h +0 -1
@@ -72,7 +72,6 @@ enum mac_version {RTL_GIGA_MAC_VER_65 ,RTL_GIGA_MAC_VER_66 ,RTL_GIGA_MAC_VER_70 , -RTL_GIGA_MAC_VER_71 ,RTL_GIGA_MAC_NONE , RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1 };
drivers/net/ethernet/realtek/r8169_main.c +4 -11
@@ -99,7 +99,7 @@ static const struct rtl_chip_info {const char *fw_name; } rtl_chip_infos[] = {/* 8126A family. */ - { 0x7cf, 0x64a, RTL_GIGA_MAC_VER_71, "RTL8126A", FIRMWARE_8126A_3 }, + { 0x7cf, 0x64a, RTL_GIGA_MAC_VER_70, "RTL8126A", FIRMWARE_8126A_3 }, { 0x7cf, 0x649, RTL_GIGA_MAC_VER_70, "RTL8126A", FIRMWARE_8126A_2 }, /* 8125BP family. */
@@ -2940,7 +2940,6 @@ static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)rtl_mod_config5 (tp,0 , ASPM_en);switch (tp->mac_version) {case RTL_GIGA_MAC_VER_70 : -case RTL_GIGA_MAC_VER_71 : val8 =RTL_R8 (tp,INT_CFG0_8125 ) |INT_CFG0_CLKREQEN ;RTL_W8 (tp,INT_CFG0_8125 , val8);break ;
@@ -2972,7 +2971,6 @@ static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)switch (tp->mac_version) {case RTL_GIGA_MAC_VER_70 : -case RTL_GIGA_MAC_VER_71 : val8 =RTL_R8 (tp,INT_CFG0_8125 ) & ~INT_CFG0_CLKREQEN ;RTL_W8 (tp,INT_CFG0_8125 , val8);break ;
@@ -3692,12 +3690,10 @@ static void rtl_hw_start_8125_common(struct rtl8169_private *tp)/* disable new tx descriptor format */ r8168_mac_ocp_modify (tp,0xeb58 ,0x0001 ,0x0000 ); -if (tp->mac_version ==RTL_GIGA_MAC_VER_70 || - tp->mac_version ==RTL_GIGA_MAC_VER_71 ) +if (tp->mac_version ==RTL_GIGA_MAC_VER_70 )RTL_W8 (tp,0xD8 ,RTL_R8 (tp,0xD8 ) & ~0x02 ); -if (tp->mac_version ==RTL_GIGA_MAC_VER_70 || - tp->mac_version ==RTL_GIGA_MAC_VER_71 ) +if (tp->mac_version ==RTL_GIGA_MAC_VER_70 )r8168_mac_ocp_modify (tp,0xe614 ,0x0700 ,0x0400 );else if (tp->mac_version ==RTL_GIGA_MAC_VER_63 )r8168_mac_ocp_modify (tp,0xe614 ,0x0700 ,0x0200 );
@@ -3715,8 +3711,7 @@ static void rtl_hw_start_8125_common(struct rtl8169_private *tp)r8168_mac_ocp_modify (tp,0xe056 ,0x00f0 ,0x0030 );r8168_mac_ocp_modify (tp,0xe040 ,0x1000 ,0x0000 );r8168_mac_ocp_modify (tp,0xea1c ,0x0003 ,0x0001 ); -if (tp->mac_version ==RTL_GIGA_MAC_VER_70 || - tp->mac_version ==RTL_GIGA_MAC_VER_71 ) +if (tp->mac_version ==RTL_GIGA_MAC_VER_70 )r8168_mac_ocp_modify (tp,0xea1c ,0x0300 ,0x0000 );else r8168_mac_ocp_modify (tp,0xea1c ,0x0004 ,0x0000 );
@@ -3839,7 +3834,6 @@ static void rtl_hw_config(struct rtl8169_private *tp) [RTL_GIGA_MAC_VER_65] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_66] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a, - [RTL_GIGA_MAC_VER_71] = rtl_hw_start_8126a, };if (hw_configs[tp->mac_version])
@@ -3863,7 +3857,6 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)break ;case RTL_GIGA_MAC_VER_63 :case RTL_GIGA_MAC_VER_70 : -case RTL_GIGA_MAC_VER_71 :for (i =0xa00 ; i <0xa80 ; i +=4 )RTL_W32 (tp, i,0 );RTL_W16 (tp,INT_CFG1_8125 ,0x0000 );
drivers/net/ethernet/realtek/r8169_phy_config.c +0 -1
@@ -1183,7 +1183,6 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, [RTL_GIGA_MAC_VER_65] = rtl8125d_hw_phy_config, [RTL_GIGA_MAC_VER_66] = rtl8125bp_hw_phy_config, [RTL_GIGA_MAC_VER_70] = rtl8126a_hw_phy_config, - [RTL_GIGA_MAC_VER_71] = rtl8126a_hw_phy_config, };if (phy_configs[ver])
Signature · 1 line
2.49.0
Re: [PATCH net-next 1/3] r8169: merge chip versions 70 and 71 (RTL8126A)
Quoted 4 lines · Heiner Kallweit
Handling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
Signed-off-by Heiner Kallweit <[email protected]>
Heiner Kallweit
maintainerPATCH 2/3 r8169: merge chip versions 64 and 65 (RTL8125D)
In reply to Heiner KallweitHandling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
--- drivers/net/ethernet/realtek/r8169.h | 1 - drivers/net/ethernet/realtek/r8169_main.c | 4 +--- drivers/net/ethernet/realtek/r8169_phy_config.c | 1 - 3 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/realtek/r8169.h +0 -1
@@ -69,7 +69,6 @@ enum mac_version {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_VER_70 , RTL_GIGA_MAC_NONE,
drivers/net/ethernet/realtek/r8169_main.c +1 -3
@@ -106,7 +106,7 @@ static const struct rtl_chip_info { { 0x7cf, 0x681, RTL_GIGA_MAC_VER_66, "RTL8125BP", FIRMWARE_8125BP_2 },/* 8125D family. */ - { 0x7cf, 0x689, RTL_GIGA_MAC_VER_65, "RTL8125D", FIRMWARE_8125D_2 }, + { 0x7cf, 0x689, RTL_GIGA_MAC_VER_64, "RTL8125D", FIRMWARE_8125D_2 }, { 0x7cf, 0x688, RTL_GIGA_MAC_VER_64, "RTL8125D", FIRMWARE_8125D_1 }, /* 8125B family. */
@@ -3831,7 +3831,6 @@ static void rtl_hw_config(struct rtl8169_private *tp) [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_8125d, [RTL_GIGA_MAC_VER_66] = rtl_hw_start_8125d, [RTL_GIGA_MAC_VER_70] = rtl_hw_start_8126a, };
@@ -3850,7 +3849,6 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)switch (tp->mac_version) {case RTL_GIGA_MAC_VER_61 :case RTL_GIGA_MAC_VER_64 : -case RTL_GIGA_MAC_VER_65 :case RTL_GIGA_MAC_VER_66 :for (i =0xa00 ; i <0xb00 ; i +=4 )RTL_W32 (tp, i,0 );
drivers/net/ethernet/realtek/r8169_phy_config.c +0 -1
@@ -1180,7 +1180,6 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, [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] = rtl8125d_hw_phy_config, [RTL_GIGA_MAC_VER_66] = rtl8125bp_hw_phy_config, [RTL_GIGA_MAC_VER_70] = rtl8126a_hw_phy_config, };
Signature · 1 line
2.49.0
Re: [PATCH net-next 2/3] r8169: merge chip versions 64 and 65 (RTL8125D)
Quoted 4 lines · Heiner Kallweit
Handling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
Signed-off-by Heiner Kallweit <[email protected]>
Heiner Kallweit
maintainerPATCH 3/3 r8169: merge chip versions 52 and 53 (RTL8117)
In reply to Heiner KallweitHandling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
--- drivers/net/ethernet/realtek/r8169.h | 1 - drivers/net/ethernet/realtek/r8169_main.c | 17 +++++++---------- drivers/net/ethernet/realtek/r8169_phy_config.c | 1 - 3 files changed, 7 insertions(+), 12 deletions(-)
drivers/net/ethernet/realtek/r8169.h +0 -1
@@ -64,7 +64,6 @@ enum mac_version {/* support for RTL_GIGA_MAC_VER_50 has been removed */ RTL_GIGA_MAC_VER_51 ,RTL_GIGA_MAC_VER_52 , -RTL_GIGA_MAC_VER_53 ,/* support for RTL_GIGA_MAC_VER_60 has been removed */ RTL_GIGA_MAC_VER_61 , RTL_GIGA_MAC_VER_63,
drivers/net/ethernet/realtek/r8169_main.c +7 -10
@@ -116,7 +116,7 @@ static const struct rtl_chip_info { { 0x7cf, 0x609, RTL_GIGA_MAC_VER_61, "RTL8125A", FIRMWARE_8125A_3 },/* RTL8117 */ - { 0x7cf, 0x54b, RTL_GIGA_MAC_VER_53, "RTL8168fp/RTL8117" }, + { 0x7cf, 0x54b, RTL_GIGA_MAC_VER_52, "RTL8168fp/RTL8117" }, { 0x7cf, 0x54a, RTL_GIGA_MAC_VER_52, "RTL8168fp/RTL8117", FIRMWARE_8168FP_3 },
@@ -831,7 +831,7 @@ static bool rtl_is_8168evl_up(struct rtl8169_private *tp) {return tp->mac_version >=RTL_GIGA_MAC_VER_34 && tp->mac_version !=RTL_GIGA_MAC_VER_39 && - tp->mac_version <=RTL_GIGA_MAC_VER_53 ; + tp->mac_version <=RTL_GIGA_MAC_VER_52 ; }static bool rtl_supports_eee (struct rtl8169_private *tp)
@@ -999,9 +999,7 @@ void r8169_get_led_name(struct rtl8169_private *tp, int idx,static void r8168fp_adjust_ocp_cmd (struct rtl8169_private *tp,u32 *cmd,int type) {/* based on RTL8168FP_OOBMAC_BASE in vendor driver */ -if (type ==ERIAR_OOB && - (tp->mac_version ==RTL_GIGA_MAC_VER_52 || - tp->mac_version ==RTL_GIGA_MAC_VER_53 )) +if (type ==ERIAR_OOB && tp->mac_version ==RTL_GIGA_MAC_VER_52 ) *cmd |=0xf70 <<18 ; }
@@ -1501,7 +1499,7 @@ static enum rtl_dash_type rtl_get_dash_type(struct rtl8169_private *tp)case RTL_GIGA_MAC_VER_28 :case RTL_GIGA_MAC_VER_31 :return RTL_DASH_DP ; - case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_53: + case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_52:return RTL_DASH_EP ;case RTL_GIGA_MAC_VER_66 :return RTL_DASH_25_BP ;
@@ -2486,7 +2484,7 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)case RTL_GIGA_MAC_VER_38 :RTL_W32 (tp, RxConfig,RX128_INT_EN |RX_MULTI_EN |RX_DMA_BURST );break ; - case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_53: + case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_52:RTL_W32 (tp, RxConfig,RX128_INT_EN |RX_MULTI_EN |RX_DMA_BURST |RX_EARLY_OFF );break ;case RTL_GIGA_MAC_VER_61 :
@@ -2617,7 +2615,7 @@ DECLARE_RTL_COND(rtl_rxtx_empty_cond_2)static void rtl_wait_txrx_fifo_empty (struct rtl8169_private *tp) {switch (tp->mac_version) { - case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_53: + case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_52:rtl_loop_wait_high (tp, &rtl_txcfg_empty_cond,100 ,42 );rtl_loop_wait_high (tp, &rtl_rxtx_empty_cond,100 ,42 );break ;
@@ -3827,7 +3825,6 @@ static void rtl_hw_config(struct rtl8169_private *tp) [RTL_GIGA_MAC_VER_48] = rtl_hw_start_8168h_1, [RTL_GIGA_MAC_VER_51] = rtl_hw_start_8168ep_3, [RTL_GIGA_MAC_VER_52] = rtl_hw_start_8117, - [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,
@@ -5288,7 +5285,7 @@ static void rtl_hw_init_8125(struct rtl8169_private *tp)static void rtl_hw_initialize (struct rtl8169_private *tp) {switch (tp->mac_version) { - case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_53: + case RTL_GIGA_MAC_VER_51 ... RTL_GIGA_MAC_VER_52:rtl8168ep_stop_cmac (tp); fallthrough; case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
drivers/net/ethernet/realtek/r8169_phy_config.c +0 -1
@@ -1176,7 +1176,6 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev, [RTL_GIGA_MAC_VER_48] = rtl8168h_2_hw_phy_config, [RTL_GIGA_MAC_VER_51] = rtl8168ep_2_hw_phy_config, [RTL_GIGA_MAC_VER_52] = rtl8117_hw_phy_config, - [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,
Signature · 1 line
2.49.0
Re: [PATCH net-next 3/3] r8169: merge chip versions 52 and 53 (RTL8117)
Quoted 4 lines · Heiner Kallweit
Handling of both chip versions is the same, only difference is the firmware. So we can merge handling of both chip versions.
Signed-off-by Heiner Kallweit <[email protected]>
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Fri, 18 Apr 2025 11:22:54 +0200 you wrote:
After
2b065c098c37("r8169: refactor chip version detection") we can merge handling of few chip versions.Heiner Kallweit (3):
r8169: merge chip versions 70 and 71 (RTL8126A)
r8169: merge chip versions 64 and 65 (RTL8125D)
r8169: merge chip versions 52 and 53 (RTL8117)[...]
Here is the summary with links:
- [net-next,1/3] r8169: merge chip versions 70 and 71 (RTL8126A)
https://git.kernel.org/netdev/net-next/c/4dec0702b862 - [net-next,2/3] r8169: merge chip versions 64 and 65 (RTL8125D) https://git.kernel.org/netdev/net-next/c/f372ef6ed5a6 - [net-next,3/3] r8169: merge chip versions 52 and 53 (RTL8117) https://git.kernel.org/netdev/net-next/c/4f51e7d370a0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html