From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BF2CEA0032; Wed, 16 Mar 2022 19:59:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50216410F3; Wed, 16 Mar 2022 19:59:37 +0100 (CET) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50139.outbound.protection.outlook.com [40.107.5.139]) by mails.dpdk.org (Postfix) with ESMTP id CDD97410EC for ; Wed, 16 Mar 2022 19:59:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y3CPVQofx50+SYSCP+x7WTwlYe0Jz/RxQ8C9CDHu+mOr0F+soy26rQgcUotZA3tCwwkMd56CBeaHUBC8VF0nu2Y7On5YV2PuoG9eWuEvSxAyg9yokPx65hiqz1Q+a7oGcCx6WfdTPnU2ApzA7kvoHFnLWc9I4csp4tPkwi4xvThjvGDMSdeSCMhEcHK2rTLkexGIjvnqx+t5yTJjvnz6UYQ7R/Q5xPSEOFRJexiSTTSpn94C7PUH425XGvOK+RuvuL8hm7Y4ou8HuN3JJN/8yvCvCM/LnDEyPrTC1Tr0+TOH4494h4lYS2OIi4sEs7ytz6/AzWxZEEaGMTUGwBKR0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TJgoj8THqjHcwIgYrX+97YBY8RMbnv2SHCNx/5kBM6M=; b=nwyiqVuI1uS6qhrdeVHEkBTg6y7pqoRNlMLYl6KsTKmrw9QM6ql3sznk9hOPNDDmuWhi1SZw0ge4/JAVSy5/ccUJt7fQQJQIxcxRGfnu0kDtvzYowrZ32fxic1M9AdeTDhlHWEVrEMxE4axqer7wztyhslbKHXogUSn6bd7+w03USp+FKfrvfMDx9TRVWblfrWayVwV01vRhE8yrc8eGJygtJPsMHHQHf87o6ahoxtVle9gOVCK+lDh8q3nQSat+F57eEOqinNnFsZisGA9ZAnjIQ8Ia3RnsiILtgZ80XgRqdWlqLi7vhQ3HrJk5Gm7lnoCV3vJo4/M37apu9uv4fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silicom-usa.com; dmarc=pass action=none header.from=silicom-usa.com; dkim=pass header.d=silicom-usa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SILICOMLTD.onmicrosoft.com; s=selector2-SILICOMLTD-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TJgoj8THqjHcwIgYrX+97YBY8RMbnv2SHCNx/5kBM6M=; b=CNiDTlVgr8Nu7Gc5MTWoOnij9Ecz/fXrcYprLUn7OOjaC42xre8SRV/+9oOX+/tJhSc0hr1bmziTvWj3kag28s70p44HOLciC5TVm6lUnVBO3FA9IycMfeFz9uJAYTucAIlsONg4nFM5EbfOQvBc8HBSXDetPAXiyxJbTMhX3+s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silicom-usa.com; Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16) by VI1PR0402MB2816.eurprd04.prod.outlook.com (2603:10a6:800:b7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.29; Wed, 16 Mar 2022 18:59:33 +0000 Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::3c4b:12e1:8c6b:dbb5]) by VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::3c4b:12e1:8c6b:dbb5%6]) with mapi id 15.20.5081.015; Wed, 16 Mar 2022 18:59:32 +0000 From: Jeff Daly To: dev@dpdk.org Cc: Haiyue Wang Subject: [PATCH v2] ixgbe/base: Manual AN-37 for troublesome link partners for X550 SFI Date: Wed, 16 Mar 2022 14:59:17 -0400 Message-Id: <20220316185917.4448-1-jeffd@silicom-usa.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220316181544.7251-1-jeffd@silicom-usa.com> References: <20220316181544.7251-1-jeffd@silicom-usa.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BL1PR13CA0237.namprd13.prod.outlook.com (2603:10b6:208:2bf::32) To VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cff6d29-02cd-42a8-f3dc-08da077f1b40 X-MS-TrafficTypeDiagnostic: VI1PR0402MB2816:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6X6tYAPdm5e0iqBRqK5LuCXfRV6fb5bevZEIoPx+74SZwHUtf03rlFqpAWjBgy9TXUHbMTxeucay5VQaBkhYF7VngPhoMtVmFMrtFHkFYmxoorsaIEX3SVwpPeW7wnoAVUswzVHnMw5MkI/wDUsqUN3pubZUd7kohB2pJOIMjoNhXBdq53zGcHjYV78oeW+3blpi+qZsU2N/575qcx7PlEjmxAhwzTw3mKEiFZGRYBg94BwAHTOdGJJHdIea2smLkg56yEZrRWXJ6P6wtYd36DxJYMTG1nC+Ax8Iu8eS5X8gJCBOkvt1bhnq6HEb+CWbclL2/IQNGbFReJDnB7UCaq7VAZJqJyo5L4En8tnE2dpFxqoxO9YfhqdOtHgR/TcMansHS1rWHPt/zAYCLOMUcQ3gGGdWYu/QAsM3dgqg5PA7LjqNdCEGjGyjHgsBI8kYJJV0T+nTsKMSaRybRf9p670NhJvSDCbWUP71TcnppptSQAS5AM6psSF51kLGfUbUmTJ2l/M5zKL/ovmctKoe4SztzEx0lqo81kwoCxKwiA2NfTYmG+vlngswHXpFRKXrnndmMj1yzEYXGPAzqOx8dg48NXhVDRGZOutokcXTMIvHBY4KXYrcvvq0PUFsm1G/7H+iENzMtdMVjRjLJcIsELNihGbsia/LLZwHvwqHXvV9OEzv1iTQm3kLSbHDz2aEB2f30HrtEWSGrHBt07A+IQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3517.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(38100700002)(38350700002)(86362001)(66556008)(66946007)(66476007)(8676002)(5660300002)(4326008)(6916009)(316002)(8936002)(2906002)(2616005)(1076003)(186003)(26005)(508600001)(6486002)(52116002)(6512007)(6666004)(6506007)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ID8+AF7ZXatibGjPriuXS96JqtGC8bn87yRD5xuRoV7H5qdPnzx9fUZBKt6n?= =?us-ascii?Q?KzBDw4ze+FP7IhMpx5LmbGdy1AbWs3LxJMdSuhKI7p6EWGcngabOUVF7Txaf?= =?us-ascii?Q?92WcjJxWlha9KeZHr9mFrA7ZLNcQ9WEZrm3x4p5cmX+U1XjNaLDtz3wYLibe?= =?us-ascii?Q?ub+52BQN9aCH3XsIPX0maYo7R7WMs1NoFGrPiMMycDJwCkdnQ0vjEHoElFWV?= =?us-ascii?Q?APQfJ1soLQfOWf7uyL18AfsKS5Ma6mZS65voAMT4FY+D+C080JzWH0gEQzYh?= =?us-ascii?Q?7wTJ54nLHYn2XjB4sgoqfdjIGly1SH0sFJ7JcYSts4eRMPm1p0jJtZBYb+ln?= =?us-ascii?Q?VypOO5eDeFgdP06URYAAl0FXjLozc9DfEU4VFMw9ZMMm/xizUAE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bkLLZb0D1diGQpl05FpxopKwbjUpVqZgvitldrU+yh0N/FZ?= =?us-ascii?Q?DqCq0OU8hOB+ZisIc2dnAHzG8vMiXmduzriLZcI1rxacPGkeygdrNW9Lt94m?= =?us-ascii?Q?bQUwVKqZiuY6pbYASPV0TRF4oo5y0T3mNIdGrYv7HX7OsMKBJtddPLVTbsiO?= =?us-ascii?Q?kfWHM8cLvRkc8EpLfUDCLyGbbrfP7q+u?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cff6d29-02cd-42a8-f3dc-08da077f1b40 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3517.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2022 18:59:32.8172 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c9e326d8-ce47-4930-8612-cc99d3c87ad1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ve+jIujDfXGKDOeLCuZdZ4Q0GtFooE9BG8mgPJ4c6tSTh753P6pPfKLHcMcAIkmXeGr7tZ2GMZYXRO2/Nb308w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB2816 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 Some SFP link partners exhibit a disinclination to autonegotiate with X550 configured in SFI mode. This patch enables a manual AN-37 restart to work around the problem. -- v2 fixed whitespace Signed-off-by: Jeff Daly --- drivers/net/ixgbe/base/ixgbe_type.h | 1 + drivers/net/ixgbe/base/ixgbe_x550.c | 50 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h index b7eec45635..9278b1e64c 100644 --- a/drivers/net/ixgbe/base/ixgbe_type.h +++ b/drivers/net/ixgbe/base/ixgbe_type.h @@ -4260,6 +4260,7 @@ struct ixgbe_hw { #define IXGBE_KRM_PMD_FLX_MASK_ST20(P) ((P) ? 0x9054 : 0x5054) #define IXGBE_KRM_TX_COEFF_CTRL_1(P) ((P) ? 0x9520 : 0x5520) #define IXGBE_KRM_RX_ANA_CTL(P) ((P) ? 0x9A00 : 0x5A00) +#define IXGBE_KRM_FLX_TMRS_CTRL_ST31(P) ((P) ? 0x9180 : 0x5180) #define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA ~(0x3 << 20) #define IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_SR (1u << 20) diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 8810d1658e..a88546f98f 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -2676,6 +2676,56 @@ STATIC s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + /* change mode enforcement rules to hybrid */ + status = mac->ops.read_iosf_sb_reg(hw, + IXGBE_KRM_FLX_TMRS_CTRL_ST31(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, ®_val); + status |= 0x0400; + + status = mac->ops.write_iosf_sb_reg(hw, + IXGBE_KRM_FLX_TMRS_CTRL_ST31(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + + /* manually control the config */ + status = mac->ops.read_iosf_sb_reg(hw, + IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, ®_val); + status |= 0x20002240; + + status = mac->ops.write_iosf_sb_reg(hw, + IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + + /* move the AN base page values */ + status = mac->ops.read_iosf_sb_reg(hw, + IXGBE_KRM_PCS_KX_AN(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, ®_val); + status |= 0x1; + + status = mac->ops.write_iosf_sb_reg(hw, + IXGBE_KRM_PCS_KX_AN(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + + /* set the AN37 over CB mode */ + status = mac->ops.read_iosf_sb_reg(hw, + IXGBE_KRM_AN_CNTL_4(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, ®_val); + status |= 0x20000000; + + status = mac->ops.write_iosf_sb_reg(hw, + IXGBE_KRM_AN_CNTL_4(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + + /* restart AN manually */ + status = mac->ops.read_iosf_sb_reg(hw, + IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, ®_val); + status |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_RESTART; + + status = mac->ops.write_iosf_sb_reg(hw, + IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), + IXGBE_SB_IOSF_TARGET_KR_PHY, reg_val); + /* Toggle port SW reset by AN reset. */ status = ixgbe_restart_an_internal_phy_x550em(hw); -- 2.25.1