Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'r8169-add-dash-and-ltr-support'

Javen Xu says:

====================
r8169: add dash and LTR support

From: Javen Xu <javen_xu@realsil.com.cn>

This series patch adds dash support for RTL8127AP and LTR support for
RTL8168FP/RTL8168EP/RTL8168H/RTL8125/RTL8126/RTL8127.
====================

Link: https://patch.msgid.link/20260109070415.1115-1-javen_xu@realsil.com.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+102
+102
drivers/net/ethernet/realtek/r8169_main.c
··· 313 313 IBIMR0 = 0xfa, 314 314 IBISR0 = 0xfb, 315 315 FuncForceEvent = 0xfc, 316 + 317 + ALDPS_LTR = 0xe0a2, 318 + LTR_OBFF_LOCK = 0xe032, 319 + LTR_SNOOP = 0xe034, 320 + 321 + #define ALDPS_LTR_EN BIT(0) 322 + #define LTR_OBFF_LOCK_EN BIT(0) 323 + #define LINK_SPEED_CHANGE_EN BIT(14) 324 + #define LTR_SNOOP_EN GENMASK(15, 14) 316 325 }; 317 326 318 327 enum rtl8168_8101_registers { ··· 407 398 #define PWM_EN (1 << 22) 408 399 #define RXDV_GATED_EN (1 << 19) 409 400 #define EARLY_TALLY_EN (1 << 16) 401 + COMBO_LTR_EXTEND = 0xb6, 402 + #define COMBO_LTR_EXTEND_EN BIT(0) 410 403 }; 411 404 412 405 enum rtl8125_registers { ··· 1570 1559 return RTL_DASH_EP; 1571 1560 case RTL_GIGA_MAC_VER_66: 1572 1561 return RTL_DASH_25_BP; 1562 + case RTL_GIGA_MAC_VER_80: 1563 + return (tp->pci_dev->revision == 0x04) 1564 + ? RTL_DASH_25_BP 1565 + : RTL_DASH_NONE; 1573 1566 default: 1574 1567 return RTL_DASH_NONE; 1575 1568 } ··· 3009 2994 } 3010 2995 } 3011 2996 2997 + static void rtl_enable_ltr(struct rtl8169_private *tp) 2998 + { 2999 + switch (tp->mac_version) { 3000 + case RTL_GIGA_MAC_VER_80: 3001 + r8168_mac_ocp_write(tp, 0xcdd0, 0x9003); 3002 + r8168_mac_ocp_modify(tp, LTR_SNOOP, 0x0000, LTR_SNOOP_EN); 3003 + r8168_mac_ocp_modify(tp, ALDPS_LTR, 0x0000, ALDPS_LTR_EN); 3004 + r8168_mac_ocp_write(tp, 0xcdd2, 0x8c09); 3005 + r8168_mac_ocp_write(tp, 0xcdd8, 0x9003); 3006 + r8168_mac_ocp_write(tp, 0xcdd4, 0x9003); 3007 + r8168_mac_ocp_write(tp, 0xcdda, 0x9003); 3008 + r8168_mac_ocp_write(tp, 0xcdd6, 0x9003); 3009 + r8168_mac_ocp_write(tp, 0xcddc, 0x9003); 3010 + r8168_mac_ocp_write(tp, 0xcde8, 0x887a); 3011 + r8168_mac_ocp_write(tp, 0xcdea, 0x9003); 3012 + r8168_mac_ocp_write(tp, 0xcdec, 0x8c09); 3013 + r8168_mac_ocp_write(tp, 0xcdee, 0x9003); 3014 + r8168_mac_ocp_write(tp, 0xcdf0, 0x8a62); 3015 + r8168_mac_ocp_write(tp, 0xcdf2, 0x9003); 3016 + r8168_mac_ocp_write(tp, 0xcdf4, 0x883e); 3017 + r8168_mac_ocp_write(tp, 0xcdf6, 0x9003); 3018 + r8168_mac_ocp_write(tp, 0xcdf8, 0x8849); 3019 + r8168_mac_ocp_write(tp, 0xcdfa, 0x9003); 3020 + r8168_mac_ocp_modify(tp, LTR_OBFF_LOCK, 0x0000, LINK_SPEED_CHANGE_EN); 3021 + break; 3022 + case RTL_GIGA_MAC_VER_70: 3023 + r8168_mac_ocp_write(tp, 0xcdd0, 0x9003); 3024 + r8168_mac_ocp_modify(tp, LTR_SNOOP, 0x0000, LTR_SNOOP_EN); 3025 + r8168_mac_ocp_modify(tp, ALDPS_LTR, 0x0000, ALDPS_LTR_EN); 3026 + r8168_mac_ocp_write(tp, 0xcdd2, 0x8c09); 3027 + r8168_mac_ocp_write(tp, 0xcdd8, 0x9003); 3028 + r8168_mac_ocp_write(tp, 0xcdd4, 0x9003); 3029 + r8168_mac_ocp_write(tp, 0xcdda, 0x9003); 3030 + r8168_mac_ocp_write(tp, 0xcdd6, 0x9003); 3031 + r8168_mac_ocp_write(tp, 0xcddc, 0x9003); 3032 + r8168_mac_ocp_write(tp, 0xcde8, 0x887a); 3033 + r8168_mac_ocp_write(tp, 0xcdea, 0x9003); 3034 + r8168_mac_ocp_write(tp, 0xcdec, 0x8c09); 3035 + r8168_mac_ocp_write(tp, 0xcdee, 0x9003); 3036 + r8168_mac_ocp_write(tp, 0xcdf0, 0x8a62); 3037 + r8168_mac_ocp_write(tp, 0xcdf2, 0x9003); 3038 + r8168_mac_ocp_write(tp, 0xcdf4, 0x883e); 3039 + r8168_mac_ocp_write(tp, 0xcdf6, 0x9003); 3040 + r8168_mac_ocp_modify(tp, LTR_OBFF_LOCK, 0x0000, LINK_SPEED_CHANGE_EN); 3041 + break; 3042 + case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_66: 3043 + r8168_mac_ocp_write(tp, 0xcdd0, 0x9003); 3044 + r8168_mac_ocp_modify(tp, LTR_SNOOP, 0x0000, LTR_SNOOP_EN); 3045 + r8168_mac_ocp_modify(tp, ALDPS_LTR, 0x0000, ALDPS_LTR_EN); 3046 + r8168_mac_ocp_write(tp, 0xcdd2, 0x889c); 3047 + r8168_mac_ocp_write(tp, 0xcdd8, 0x9003); 3048 + r8168_mac_ocp_write(tp, 0xcdd4, 0x8c30); 3049 + r8168_mac_ocp_write(tp, 0xcdda, 0x9003); 3050 + r8168_mac_ocp_write(tp, 0xcdd6, 0x9003); 3051 + r8168_mac_ocp_write(tp, 0xcddc, 0x9003); 3052 + r8168_mac_ocp_write(tp, 0xcde8, 0x883e); 3053 + r8168_mac_ocp_write(tp, 0xcdea, 0x9003); 3054 + r8168_mac_ocp_write(tp, 0xcdec, 0x889c); 3055 + r8168_mac_ocp_write(tp, 0xcdee, 0x9003); 3056 + r8168_mac_ocp_write(tp, 0xcdf0, 0x8C09); 3057 + r8168_mac_ocp_write(tp, 0xcdf2, 0x9003); 3058 + r8168_mac_ocp_modify(tp, LTR_OBFF_LOCK, 0x0000, LINK_SPEED_CHANGE_EN); 3059 + break; 3060 + case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: 3061 + case RTL_GIGA_MAC_VER_52: 3062 + r8168_mac_ocp_modify(tp, ALDPS_LTR, 0x0000, ALDPS_LTR_EN); 3063 + RTL_W8(tp, COMBO_LTR_EXTEND, RTL_R8(tp, COMBO_LTR_EXTEND) | COMBO_LTR_EXTEND_EN); 3064 + fallthrough; 3065 + case RTL_GIGA_MAC_VER_51: 3066 + r8168_mac_ocp_modify(tp, LTR_SNOOP, 0x0000, LTR_SNOOP_EN); 3067 + r8168_mac_ocp_write(tp, 0xe02c, 0x1880); 3068 + r8168_mac_ocp_write(tp, 0xe02e, 0x4880); 3069 + r8168_mac_ocp_write(tp, 0xcdd8, 0x9003); 3070 + r8168_mac_ocp_write(tp, 0xcdda, 0x9003); 3071 + r8168_mac_ocp_write(tp, 0xcddc, 0x9003); 3072 + r8168_mac_ocp_write(tp, 0xcdd2, 0x883c); 3073 + r8168_mac_ocp_write(tp, 0xcdd4, 0x8c12); 3074 + r8168_mac_ocp_write(tp, 0xcdd6, 0x9003); 3075 + break; 3076 + default: 3077 + return; 3078 + } 3079 + /* chip can trigger LTR */ 3080 + r8168_mac_ocp_modify(tp, LTR_OBFF_LOCK, 0x0003, LTR_OBFF_LOCK_EN); 3081 + } 3082 + 3012 3083 static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable) 3013 3084 { 3014 3085 u8 val8; ··· 3123 3022 break; 3124 3023 } 3125 3024 3025 + rtl_enable_ltr(tp); 3126 3026 switch (tp->mac_version) { 3127 3027 case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48: 3128 3028 case RTL_GIGA_MAC_VER_61 ... RTL_GIGA_MAC_VER_LAST: