From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>, stable@dpdk.org
Subject: [PATCH 8/9] net/txgbe: fix SGMII mode to link up
Date: Mon, 30 May 2022 17:30:15 +0800 [thread overview]
Message-ID: <20220530093016.16326-9-jiawenwu@trustnetic.com> (raw)
In-Reply-To: <20220530093016.16326-1-jiawenwu@trustnetic.com>
Fix SGMII mode to link up.
Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/base/txgbe_phy.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c
index da2bbc43e0..9f46d5bdb0 100644
--- a/drivers/net/txgbe/base/txgbe_phy.c
+++ b/drivers/net/txgbe/base/txgbe_phy.c
@@ -1367,9 +1367,17 @@ static void
txgbe_set_sgmii_an37_ability(struct txgbe_hw *hw)
{
u32 value;
+ u8 device_type = hw->subsystem_device_id & 0xF0;
wr32_epcs(hw, VR_XS_OR_PCS_MMD_DIGI_CTL1, 0x3002);
- wr32_epcs(hw, SR_MII_MMD_AN_CTL, 0x0105);
+ /* for sgmii + external phy, set to 0x0105 (phy sgmii mode) */
+ /* for sgmii direct link, set to 0x010c (mac sgmii mode) */
+ if (device_type == TXGBE_DEV_ID_MAC_SGMII ||
+ hw->phy.media_type == txgbe_media_type_fiber)
+ wr32_epcs(hw, SR_MII_MMD_AN_CTL, 0x010C);
+ else if (device_type == TXGBE_DEV_ID_SGMII ||
+ device_type == TXGBE_DEV_ID_XAUI)
+ wr32_epcs(hw, SR_MII_MMD_AN_CTL, 0x0105);
wr32_epcs(hw, SR_MII_MMD_DIGI_CTL, 0x0200);
value = rd32_epcs(hw, SR_MII_MMD_CTL);
value = (value & ~0x1200) | (0x1 << 12) | (0x1 << 9);
@@ -2280,6 +2288,8 @@ void txgbe_autoc_write(struct txgbe_hw *hw, u64 autoc)
}
} else if (hw->phy.media_type == txgbe_media_type_fiber) {
txgbe_set_link_to_sfi(hw, speed);
+ if (speed == TXGBE_LINK_SPEED_1GB_FULL)
+ txgbe_set_sgmii_an37_ability(hw);
}
if (speed == TXGBE_LINK_SPEED_10GB_FULL)
--
2.27.0
next prev parent reply other threads:[~2022-05-30 9:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-30 9:30 [PATCH 0/9] Wangxun fixes and new supports Jiawen Wu
2022-05-30 9:30 ` [PATCH 1/9] net/ngbe: fix to set force speed Jiawen Wu
2022-05-30 9:30 ` [PATCH 2/9] net/ngbe: add support for yt8531s PHY Jiawen Wu
2022-05-30 9:30 ` [PATCH 3/9] net/ngbe: fix occasional failure of reading PHY ID Jiawen Wu
2022-05-30 9:30 ` [PATCH 4/9] net/ngbe: fix external PHY to power down Jiawen Wu
2022-05-30 9:30 ` [PATCH 5/9] net/ngbe: fix to read M88E1512 PHY mode Jiawen Wu
2022-05-30 9:30 ` [PATCH 6/9] net/ngbe: change PCIe related operations to use rte API Jiawen Wu
2022-05-30 9:30 ` [PATCH 7/9] net/ngbe: redesign internal PHY init flow Jiawen Wu
2022-05-30 9:30 ` Jiawen Wu [this message]
2022-05-30 9:30 ` [PATCH 9/9] net/txgbe: fix max number of queues for SRIOV Jiawen Wu
2022-05-31 7:45 ` [PATCH 0/9] Wangxun fixes and new supports Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220530093016.16326-9-jiawenwu@trustnetic.com \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).