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 E16F9A0032; Wed, 16 Mar 2022 19:16:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D781410EC; Wed, 16 Mar 2022 19:16:06 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60117.outbound.protection.outlook.com [40.107.6.117]) by mails.dpdk.org (Postfix) with ESMTP id C53F140395 for ; Wed, 16 Mar 2022 19:16:04 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lxnlUVe5j3BI1j6y6h3e8tgt3OhQsrPCDuk/JhGmROzcZ0O+MtlSk/IeaTMsFK7yuv6D2XclcwQOBUEfXXKl6+a/NPXG+hTP6DjmP1KoT4/dlSGCB2Su1qYClKsCUa16EipErOnZwqv0zhFm8EDe9UWYaS01CLjjqliOZ/YyBfmicz7/HkO8eybJrbFMnFC4UdsBFcOlWvzYlnaL0ztnmocxLEW9S/7L6KMF2GdT65DAy8ljHRjkSDWkP0Q4TXiTNGjWMZGeBZlZ8P7EhvmmTISYbgC56SVhdpmOX/jJHGgMVdxdESgu/Wenhj0bqNnqtLHxHRm82r58QT9kl9J4vw== 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=I5GeQpx/kymHJEloZ/LwHmbOT0GdWoCbFkn08SStoUo=; b=OkJHSzrcr9SfpjmOSsfdMAI/K9Mjwgu4Qoco7vhX2aXqt8CleDv9GaVoZl59jmOHiGGSEC6yfa7b4GGGgRp4R0/OVtmJplPiDAKrPM1LzbWilipy7+SU2jmp/ivFk4+gxA0d9dxI/BgjwZtAZesjO179qCYDUuvMiDP9WiKcsIBs9Lhp1t6TwPyvfm5G5KYDhAzDdfqKmdGFRbO0o5PqkWvuX3R9gJ9namp1HxZhSg94QTZ9DTKO5o5TI2Oa5g0R9cewlbKx5jSoPKbIMeG8OqNNEJfPOlGiEBdRQ22VnIBXoQmLDivlZC8XqAv/EWXlApho1XzCdmwHNNAzRZDqKQ== 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=I5GeQpx/kymHJEloZ/LwHmbOT0GdWoCbFkn08SStoUo=; b=HBZjtzOxLKLwdFP+Xtd4VPzgEzT4QVvuRoztacO13bYX4YtQMsFFVljs5HWSLLchAm7Igp9GCj5W0svAbPQOTBmrFS4+bkAkZq3gb8vgnBZLiC5kld1GV5skUpPz8gN+CtHDOC7V/h2tBUvyXq80cLax62O7YGD3+rdnY2W/4R0= 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 AM0PR04MB5730.eurprd04.prod.outlook.com (2603:10a6:208:12c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.15; Wed, 16 Mar 2022 18:16:03 +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:16:02 +0000 From: Jeff Daly To: dev@dpdk.org Cc: Haiyue Wang Subject: [PATCH] ixgbe/base: Manual AN-37 for troublesome link partners for X550 SFI Date: Wed, 16 Mar 2022 14:15:44 -0400 Message-Id: <20220316181544.7251-1-jeffd@silicom-usa.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR16CA0013.namprd16.prod.outlook.com (2603:10b6:208:134::26) 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: cc6dc1b1-2dfa-4ecc-86a2-08da07790753 X-MS-TrafficTypeDiagnostic: AM0PR04MB5730: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: YrRNmmGYmLie5Zy8EcFtsD2+TE19rafhhK32LMfL0XAziNMdUUhp1YuHkK3kOOUbG8m0Jz7cxnr6CAJAT+Rjb31kd3SyXBOMXJNm0WNSCYi/rN/t0gsCiP205PDk1j3HZWlc5X2LiX3KcD3PNmqJb/VxfkSRFU52967iVwIl4ZbXvBOtboXEpc5qGP2NXoeKXKEkk/ab7VCtkY3EuVuVIpJJCUhIIA6K4yGrvc0BpuqRMaDtFi9moV18WcYDr9PRM3fM1jQjyoZ4pYHmhUc/OzXb0EQKKWszLBk5JVMg+0TFyDgcdneN7k+ROTdlLwARCO7b5pKVDc8+qZbVKAEOU2d0f4uwhoL4IUo6GpZfiinuuecyReYx7Lzt50ZxvmOsUq70QX/bEaGpj2+LgqXSQKb67rYZUHJyE9IUePUPVHCctJL/EhOWwtj2nhdkP1Cb3wcq2VV7G6JRvsfw5GNz+nlc7ZIuuV326Il9Yp4xxq4DRONrUIjP0whHeIm3bOQnTSaWO1cLpi5QL6GgdNAHnhZiSWmXxe3JvuDx8FSX7hNW2u3QJ/Nt1Bx65PgVtMxpPuDx+BkicwqAntYr4j4FuDR58GznMgnG6JuxteetAmqBODb1mAiLvr4gqkSQni5DK0vw+XK2pLBDW9G1emOKWeZ7ijepSgk353L2wRqyqYQvPEnFMCaS7mHUOijjtGOveVN8OGvZ/7PnNltc9I7dLw== 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)(8936002)(2616005)(36756003)(2906002)(86362001)(6666004)(1076003)(52116002)(6512007)(6506007)(186003)(26005)(66946007)(38350700002)(38100700002)(6916009)(6486002)(4326008)(8676002)(66476007)(5660300002)(66556008)(316002)(508600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?d0LMDYD0saj2XCgz+bQmQAOKgvD7t51uYDQs+k4yk8muwOQT6O1ZyNCoFosr?= =?us-ascii?Q?OoHlcY7L4cnsaRdmOHAYrwK/d7tDIxLkIFtGfxgbKcjr67ftUUJWGbmaLSxH?= =?us-ascii?Q?cZRhulcRS4POzxmSdM4bGMeu79dXGu1sYYDYAy8nAKGF4KYf3jFgeK7ssopP?= =?us-ascii?Q?yekWzJjeMFFE30zJsXnAv4rRMaxRJl3tNNNVugvhkd5y3JMysP618G9Lv8dI?= =?us-ascii?Q?Bhyma4rx8UcUNqDHDt3nJ8tunhtd8cX5vYvbAXqjf/HcW0OndbMEosLhkeK6?= =?us-ascii?Q?7MUqECXlibaRTFoO7f1A/49FHg/f415UrI6FmMbac/0oeDxKBGh2D3o0n5Ua?= =?us-ascii?Q?0nnH6lMgUWH1/Nq5gOyfvFFlOn4J8IV51VTxoo3NkAoxZhmUuLEvCg/Lw0fS?= =?us-ascii?Q?8Ir1avOqRjWfcYgA9S9WRm0nMC1CcYE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XpUYJNf+IJ45hcE6njLiHGq0WZJC/+EZTEIYWdpnHCXfped8Y2G?= =?us-ascii?Q?PF3SWAON99tNhrKrMUqFAoUAZXztfBP/r0J/0srTdezADLhvVqBRUB9NPnYb?= =?us-ascii?Q?GCI1teCtytLeXQfW55/4w1PYTjV5BHnt?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc6dc1b1-2dfa-4ecc-86a2-08da07790753 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:16:02.4666 (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: OoiSTvYTckBthq37FmHygLL+xFAEozNoOfd9Dnb5lWwFA48PdgR8LnjgcrsYOIA8Bzul0X63SuyZpwJH9gSntQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5730 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. Signed-off-by: Jeff Daly --- drivers/net/ixgbe/base/ixgbe_type.h | 1 + drivers/net/ixgbe/base/ixgbe_x550.c | 51 +++++++++++++++++++++++++++++ 2 files changed, 52 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..649d834715 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -2676,6 +2676,57 @@ 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