From patchwork Tue Jun 18 07:11:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawen Wu X-Patchwork-Id: 141236 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 751C345489; Tue, 18 Jun 2024 09:13:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4548940E35; Tue, 18 Jun 2024 09:12:33 +0200 (CEST) Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by mails.dpdk.org (Postfix) with ESMTP id E1F9540DD6; Tue, 18 Jun 2024 09:12:13 +0200 (CEST) X-QQ-mid: bizesmtpsz1t1718694731tn3cyko X-QQ-Originating-IP: wbnitRnMeLb9cIZ1XNSmN3rSg9VpV2CTDBIvhL2uroA= Received: from lap-jiawenwu.trustnetic.com ( [183.159.97.141]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 18 Jun 2024 15:12:10 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 7557259968748814712 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Subject: [PATCH 07/19] net/ngbe: special config for YT8531SH-CA PHY Date: Tue, 18 Jun 2024 15:11:38 +0800 Message-Id: <20240618071150.21564-8-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20240618071150.21564-1-jiawenwu@trustnetic.com> References: <20240618071150.21564-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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: stable@dpdk.org Signed-off-by: Jiawen Wu --- 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