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 ED8CEA04A4; Wed, 19 Jan 2022 10:26:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78FFF40E5A; Wed, 19 Jan 2022 10:26:12 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by mails.dpdk.org (Postfix) with ESMTP id 109834013F for ; Wed, 19 Jan 2022 10:26:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7kr42tYtIr25JJ+rxksorpv3OLiF4ggXJd0QzV74F6nRMkBMWMNXsKDd8kiqwE7vJO8toizQyDBE0KCYqe9SwN0vidXPXh8UmpC5Ng5TIQtMxbM8B5uksv+SDAEGuz9DQWIVp5ceAOVp8GciN3gK1b55+OvR3j8ChZlVUra5FcUWP47SG3Agoy/zPZgxVQpjnCLCBn2ZkUXbiOI2fKugRr78V0KuovwvQ7+MkxAVi+O5SWVSG+uPLrmaFnIcDUNG/DnHBOU9O29Ut2hFufegbRieHlqI0rW0RePlPEfWQe5tAYTRODF26odAVLSxLfQ5heDX+WorlbPUxyGZby67w== 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=ylk4avg6uMDNkFjtEt3XnImARo8TJEdBAfx/RSzlkas=; b=BD73dpTevyB3mB3wUtfSsDpDAX3Er8Qy5ia2B0KJ7IBJbKV0HQGYlKBWM6oY2w1qy0R3VCtt8tcGcWTcerbref9NG+de09a437Ex+c0ZO9gMyDpQ5klPXtH26rSd3OfFVj2BXe7s5XX52SaJy3TOCX5cM1OHYX+mH5u4InDSoC2wzV34uuLPKFNDz526hFVUeBPqTbY7NFwg7RCs/azMFm/CmK1TwupzwUqTnN5Ggruz1yuFp7BjEEwKh6O1usnVdOK+qFX94vXgfV+dzFOP5FSTEcEb2Al79Xy+PL2EWM5HXNHIuf+qzInwskI06aI+Cokz4OElV4/aHQCm2PTULg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ylk4avg6uMDNkFjtEt3XnImARo8TJEdBAfx/RSzlkas=; b=Z+ryFLUUwPlQo1RB1PbB/dB+x6YkPGKi14nU3lpR5El7KyeL9i3htvGdo0xpq79F82U+yuGtLEw32vCVZGkK6TH2rUfJJ9AIiGMXcRpULrnHpA2DL7s+bc9KI5fjgJXmV0gd83K7QhC9UHRFj8DQKiK4FRSjfRS1M6S/w9QcgIM= Received: from MW2PR12MB2538.namprd12.prod.outlook.com (2603:10b6:907:5::14) by BN6PR12MB1843.namprd12.prod.outlook.com (2603:10b6:404:101::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Wed, 19 Jan 2022 09:26:06 +0000 Received: from MW2PR12MB2538.namprd12.prod.outlook.com ([fe80::ad98:6ba4:7d63:fd6a]) by MW2PR12MB2538.namprd12.prod.outlook.com ([fe80::ad98:6ba4:7d63:fd6a%4]) with mapi id 15.20.4909.007; Wed, 19 Jan 2022 09:26:05 +0000 From: "Namburu, Chandu-babu" To: "Sebastian, Selwin" , "dev@dpdk.org" Subject: RE: [PATCH v1 2/6] net/axgbe: toggle PLL settings during rate change Thread-Topic: [PATCH v1 2/6] net/axgbe: toggle PLL settings during rate change Thread-Index: AQHYBhY7lgRhyfeOEEG1N2gjIGgGU6xqHn0g Date: Wed, 19 Jan 2022 09:26:05 +0000 Message-ID: References: <20220110113509.553184-1-ssebasti@amd.com> <20220110113509.553184-3-ssebasti@amd.com> In-Reply-To: <20220110113509.553184-3-ssebasti@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=true; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2022-01-19T09:17:11Z; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ActionId=3afe89c2-693a-46d1-a73f-06cda32a9e56; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=1 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_enabled: true msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_setdate: 2022-01-19T09:26:01Z msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_method: Privileged msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_name: Public-AIP 2.0 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_actionid: 64401f88-7aae-442a-a501-d947c4e5880a msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_contentbits: 0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b0a330a1-8a13-4101-e2a5-08d9db2db813 x-ms-traffictypediagnostic: BN6PR12MB1843:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: q75WQNHpYg0oT8hW7M4H8a/GYJlJF8oxpMh0GLgRYt5IqPsNJXaL3PQ58LlZFxD4VXTDyG4HhBZTXd1PZh9kqQjr9cwrzMV6eyRBVAr/LuMmwJIvvDsY6V6CYA6nYvhdytA47C5HGALFOkIYNWuYPBsFnhMDSfYP35WwGV6K4dezVP8bsJ6dRoD0Y+IegJwSYtbyXtvE+kCgX37aiK4GG3dJzxLmVkbS9+QMOwWpsYtXiUNgE1TeB0cQMD/1/MN0lk+S5fMAU8IZNAgmgN4cwB7gV5pEw0t/Wqgo8xFjRqI0BePNTscdCM8ssE/iToXHjU1tF3KIb6pzhgEDgAstrcCd8cFHOMFzzXo38xsh339VRcOhrFBEOO7UvUVt912aup/AR+A7VVLrEj4vvXvhX8O6bDzkx26Lcm5NoneRlydJJE84thvVEGCnBopoZ8cDl9MUyqbOtYNCCYCK+9cEUmT6tQR8F0kVWGJAz9eIYj1+Umg9t9hl+PnzahfZcF6oBlBufXHodhRU7mGBGCXXM3nXmzaB5PTGvK+co1ylceg/r/vnl6Crnzm8GvJJUys5H4JN8h1aO7oLYodg+YR9s4dIcyET82YKAJ6rKFRnWSz4/CIR/uGVSMxBiPgXM6lh/74OxgmFIBvwVUHrvBP6gua0NX2m8YvsMMIvyWdfo8VaZjd/49xh/GeOhSBb4T13ZVKPD05ZBjjVyzb0Hmynsw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2538.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016003)(38070700005)(5660300002)(110136005)(71200400001)(316002)(8936002)(52536014)(53546011)(6506007)(38100700002)(26005)(66946007)(2906002)(9686003)(86362001)(76116006)(66556008)(64756008)(66446008)(66476007)(33656002)(122000001)(186003)(508600001)(55236004)(7696005)(83380400001)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?fJxKn2irqpFxVxmOFeQasKQ1vHodtZJ+HqA4E8T3dkQuHRnJgJtvubgAW4LI?= =?us-ascii?Q?y7tfEgHYsslnVMEg8EQ83e2DO2busmLp9Hssm0QnorPVfMLrPM9rIvTsiXnB?= =?us-ascii?Q?Pnco8uHKwkhAxp6vNqPWSeNK8wcamUmUIngpb1soaK3XbAkDiSzCu9/flLU0?= =?us-ascii?Q?6yoqUEaJDGZcG/L6WOrQmclK9+7R2KgdHS7nmIQ+zh+nDPXNWh0MpjU8hDNc?= =?us-ascii?Q?/xWsE6oFJ1ntgcGyzjZRZDdrBq7y/ShtjOBgOcpLRQG6XxiM+wMGwRjfWIFJ?= =?us-ascii?Q?kkX3EXXRF86er2AXWU3Xz8Xl0d2ufVj4nLxDzsknp1+Gbh3aAQONEDR+mYo+?= =?us-ascii?Q?4xZ9iqHzyuw8fiZCQ8wC9Yx+2FAXIjp9JPmzmE9NbDVRtzfpRBFivAVNNgXX?= =?us-ascii?Q?F7LOMbHr/YM80+ZlaISAqu+1ePcx29QlpG1vjSl9AI051RdXnJoCIrAPYW2B?= =?us-ascii?Q?Cb9HSQ6z6bWVZ6Hha0mMLMbF9Af2txVfXKLjRBDBArM4+ODzng3NzVH/ZULU?= =?us-ascii?Q?4eKrX2TPZjy0ZqRfYGa/cRJvsJTH73yFO5YZVgYzj7MxD5GQuDmHzfCmAzpb?= =?us-ascii?Q?efY4bDmHc+BfcUmSNsZyTXe86Ia7Nq2DzCpLz9lkSadyXhztD0TiWCST/+Nv?= =?us-ascii?Q?iFcnAQrW65FSQGwaJiJQkbwictQadxXjxe7W7CgCcBf3ziumnPKhCIZYIQl5?= =?us-ascii?Q?+bDsSS42oTmHf4UT0R46ZKthYocTXVQ7QnX7MRIxIJwrglk5RP0pYAjUzkVE?= =?us-ascii?Q?VvN71lHT7DLfqVlICaZRQAHuW3gFgWX1umpfTzt5eW2dFZfhrc1XEwjlzoQP?= =?us-ascii?Q?MgsxYR8r6OA0M6fIOU/DflMGkU1Rhuzz9aju0gW2EXZjVYk9STgsOvpEWYX9?= =?us-ascii?Q?VAs3WzHCu0vvCkiyTV3af0c1kwcGiSpnk6NEhde7LQc80zA3iMnScb/taed/?= =?us-ascii?Q?76x+l16+RwtL5yppdwGlaN7GMtBdo9dcIqLzUkBVABcgN0sx/2/blgfWgjm1?= =?us-ascii?Q?4d+i1atoAygR5khSIc8noemJUeO/NliKia8jiCOwz/TgDgmj/nFIAt/FIDuX?= =?us-ascii?Q?hVJdge1lDgz/hWrHH3I8XnFbsWE3ox6PY0mIluYF/NoFpKDntgBh1RLF3IIl?= =?us-ascii?Q?HJqIEt2c90vLrmUcbBV1gcwlTQ2pXjY6gbxhGWn2nAqur253TILus2AEc9Q7?= =?us-ascii?Q?1mNEJHzrh9CsH4VZVfoDnIowNO1Cmrf1nGYvoZCGUTpw7qea5Lg9iho+nsCa?= =?us-ascii?Q?DMfe/HeA5N52OpgvlkV5NH7E130113a5MHaTyE6tcaTLZwvxM1ZRLzgR8GgO?= =?us-ascii?Q?rWx3juDvrLoA1bIbLVWZsEVn3IfjG8TaneafRrd6AxcTYkjQLuqbuplpUv/P?= =?us-ascii?Q?SzC/3SC64PqwH9jpQIvZ58kswtgziakh2WmsS4+B4XWK/1B7CfcZvCVKJ57i?= =?us-ascii?Q?MLixq391sYe8Dq1l826iETUP51G8W+kcm/tPYkkq36WZD6/4etcxQBphnd/J?= =?us-ascii?Q?wrdhV9BvmtBclxWCDt5Zt+IWHiQniFEruI+gq2bfZ7go1u5Tf3ge6N7DmQrY?= =?us-ascii?Q?iemBsD4JjjXvCnlnzCZRCGDDjUxackzyXZccDRYnco4MlyhPNi+aRB2tJDH6?= =?us-ascii?Q?3mI2ugND9UyPtwc1QE0F7Ig=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB2538.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0a330a1-8a13-4101-e2a5-08d9db2db813 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2022 09:26:05.6864 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XpWAilQW7KP6a1LKQUBoZgNiSTayhVMWAJfcDJ/NKOVLGISt9EgaPGqTlvDy0O0DHE2O25K22n7XPzzwPEEHJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1843 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 [Public] For series, Acked-by: Chandubabu Namburu -----Original Message----- From: ssebasti@amd.com =20 Sent: Monday, January 10, 2022 5:05 PM To: dev@dpdk.org Subject: [PATCH v1 2/6] net/axgbe: toggle PLL settings during rate change From: Selwin Sebastian For each rate change command submission, the FW has to do a phy power off s= equence internally. For this to happen correctly, the PLL re-initialization= control setting has to be turned off before sending mailbox commands and r= e-enabled once the command submission is complete. Without the PLL control = setting, the link up takes longer time in a fixed phy configuration. Signed-off-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_common.h | 9 +++++++++ drivers/net/axgbe/axgbe_phy_impl.c | 22 ++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_com= mon.h index df0aa21a9b..5a7ac35b6a 100644 --- a/drivers/net/axgbe/axgbe_common.h +++ b/drivers/net/axgbe/axgbe_common.h @@ -1314,6 +1314,11 @@ #define MDIO_VEND2_PMA_CDR_CONTROL 0x8056 #endif =20 +#ifndef MDIO_VEND2_PMA_MISC_CTRL0 +#define MDIO_VEND2_PMA_MISC_CTRL0 0x8090 +#endif + + #ifndef MDIO_CTRL1_SPEED1G #define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100) #endif @@ -1392,6 +1397,10 @@ static inline uint32_t high32_value(uint64_t addr) return (addr >> 32) & 0x0ffffffff; } =20 +#define XGBE_PMA_PLL_CTRL_MASK BIT(15) +#define XGBE_PMA_PLL_CTRL_SET BIT(15) +#define XGBE_PMA_PLL_CTRL_CLEAR 0x0000 + /*END*/ =20 /* Bit setting and getting macros diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_p= hy_impl.c index 02236ec192..dc9489f0aa 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -1196,8 +1196,22 @@ static void axgbe_phy_set_redrv_mode(struct axgbe_po= rt *pdata) axgbe_phy_put_comm_ownership(pdata); } =20 +static void axgbe_phy_pll_ctrl(struct axgbe_port *pdata, bool enable) { + XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0, + XGBE_PMA_PLL_CTRL_MASK, + enable ? XGBE_PMA_PLL_CTRL_SET + : XGBE_PMA_PLL_CTRL_CLEAR); + + /* Wait for command to complete */ + rte_delay_us(150); +} + static void axgbe_phy_start_ratechange(struct axgbe_port *pdata) { + /* Clear the PLL so that it helps in power down sequence */ + axgbe_phy_pll_ctrl(pdata, false); + /* Log if a previous command did not complete */ if (XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) PMD_DRV_LOG(NOTICE, "firmware mailbox not ready for command\n"); @@ -121= 3,10 +1227,14 @@ static void axgbe_phy_complete_ratechange(struct axgbe_por= t *pdata) wait =3D AXGBE_RATECHANGE_COUNT; while (wait--) { if (!XP_IOREAD_BITS(pdata, XP_DRIVER_INT_RO, STATUS)) - return; - + goto reenable_pll; rte_delay_us(1500); } + +reenable_pll: + /* Re-enable the PLL control */ + axgbe_phy_pll_ctrl(pdata, true); + PMD_DRV_LOG(NOTICE, "firmware mailbox command did not complete\n"); } =20 -- 2.25.1