aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek/r8169_phy_config.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2020-06-28 23:17:07 +0200
committerDavid S. Miller <davem@davemloft.net>2020-06-28 20:56:38 -0700
commitcdafdc29ef75a5bca300cada5fd4a205d5ef29cf (patch)
treea798937eaafd87eca47c9c0277d22d9e700ce26b /drivers/net/ethernet/realtek/r8169_phy_config.c
parentr8169: merge handling of RTL8101e and RTL8100e (diff)
downloadlinux-cdafdc29ef75a5bca300cada5fd4a205d5ef29cf.tar.xz
linux-cdafdc29ef75a5bca300cada5fd4a205d5ef29cf.zip
r8169: sync support for RTL8401 with vendor driver
So far RTL8401 was treated like a RTL8101e, means we relied on the BIOS to configure MAC and PHY properly. Make RTL8401 a separate chip version and copy MAC / PHY config from r8101 vendor driver. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/realtek/r8169_phy_config.c')
-rw-r--r--drivers/net/ethernet/realtek/r8169_phy_config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_phy_config.c b/drivers/net/ethernet/realtek/r8169_phy_config.c
index a0c2b3330e1e..bc8bf48bdbb0 100644
--- a/drivers/net/ethernet/realtek/r8169_phy_config.c
+++ b/drivers/net/ethernet/realtek/r8169_phy_config.c
@@ -1091,6 +1091,13 @@ static void rtl8102e_hw_phy_config(struct rtl8169_private *tp,
rtl_writephy_batch(phydev, phy_reg_init);
}
+static void rtl8401_hw_phy_config(struct rtl8169_private *tp,
+ struct phy_device *phydev)
+{
+ phy_set_bits(phydev, 0x11, BIT(12));
+ phy_modify_paged(phydev, 0x0002, 0x0f, 0x0000, 0x0003);
+}
+
static void rtl8105e_hw_phy_config(struct rtl8169_private *tp,
struct phy_device *phydev)
{
@@ -1261,6 +1268,7 @@ void r8169_hw_phy_config(struct rtl8169_private *tp, struct phy_device *phydev,
[RTL_GIGA_MAC_VER_11] = rtl8168bb_hw_phy_config,
[RTL_GIGA_MAC_VER_12] = rtl8168bef_hw_phy_config,
[RTL_GIGA_MAC_VER_13] = NULL,
+ [RTL_GIGA_MAC_VER_14] = rtl8401_hw_phy_config,
[RTL_GIGA_MAC_VER_16] = NULL,
[RTL_GIGA_MAC_VER_17] = rtl8168bef_hw_phy_config,
[RTL_GIGA_MAC_VER_18] = rtl8168cp_1_hw_phy_config,