YT8531SH-CA PHY will switch to SDS space automatically when UTP and
SDS media are not present, causing failure to link up. Add the special
configuration to fix it.

Fixes: 3d0af7066759 ("net/ngbe: setup PHY link")
Fixes: 1c44384fce76 ("net/ngbe: support custom PHY interfaces")
Cc: sta...@dpdk.org

Signed-off-by: Jiawen Wu <jiawe...@trustnetic.com>
---
 drivers/net/ngbe/base/ngbe_phy_yt.c | 4 ++++
 drivers/net/ngbe/base/ngbe_phy_yt.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/ngbe/base/ngbe_phy_yt.c 
b/drivers/net/ngbe/base/ngbe_phy_yt.c
index ea313cd9a5..a374b015fd 100644
--- a/drivers/net/ngbe/base/ngbe_phy_yt.c
+++ b/drivers/net/ngbe/base/ngbe_phy_yt.c
@@ -320,6 +320,10 @@ s32 ngbe_setup_phy_link_yt(struct ngbe_hw *hw, u32 speed,
                        value |= value_r4;
                        ngbe_write_phy_reg_mdi(hw, YT_ANA, 0, value);
 
+                       /* config for yt8531sh-ca */
+                       ngbe_write_phy_reg_ext_yt(hw, YT_SPEC_CONF, 0,
+                                               YT_SPEC_CONF_8531SH_CA);
+
                        /* software reset to make the above configuration
                         * take effect
                         */
diff --git a/drivers/net/ngbe/base/ngbe_phy_yt.h 
b/drivers/net/ngbe/base/ngbe_phy_yt.h
index ddf992e79a..c45bec7ce7 100644
--- a/drivers/net/ngbe/base/ngbe_phy_yt.h
+++ b/drivers/net/ngbe/base/ngbe_phy_yt.h
@@ -32,6 +32,8 @@
 #define YT_MISC                                0xA006
 #define   YT_MISC_FIBER_PRIO           MS16(8, 0x1) /* 0 for UTP */
 #define   YT_MISC_RESV                 MS16(0, 0x1)
+#define YT_SPEC_CONF                   0xA023
+#define   YT_SPEC_CONF_8531SH_CA       0x4031
 
 /* SDS EXT */
 #define YT_AUTO                                0xA5
-- 
2.27.0

Reply via email to