From patchwork Wed Sep 21 14:43:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12983795 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D6A1C6FA8E for ; Wed, 21 Sep 2022 14:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbiIUOoL (ORCPT ); Wed, 21 Sep 2022 10:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbiIUOoG (ORCPT ); Wed, 21 Sep 2022 10:44:06 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150080.outbound.protection.outlook.com [40.107.15.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0F29750F; Wed, 21 Sep 2022 07:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GYjOedMI1jTQah/U3yTzLentxswByFqtxEqMjtcWZ/EKGSwqEUkVHN4aj2E/6Svvf1bIk8QSNyVEMhqg8kMiMNk8IAuHcTzXHucFJqUaWdw2G+LBvBq1dmAemzH8ILlxdAbuNa9lKxVP5iuvjKHsEe8QH8uKvMzGyK17rlRWG8bsue65lMqq9HMg6nWlDzExiNjQ8iZ2aXj+c68qWaDVSOh+V8gro5Qacn6GRcy/QlZ4X9Xw3n1s3rtM426djkLZlA7cMh5XhjkVgOTiiGdCapl3EUNR54ShDei/s6VZjSDrhx9Mn32tCX2CWGALI4f4FtGhhA0JVlk9s9/96EYqUA== 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=KQuMc2h0jaBDVHC7d355Nam85t05IScwR13A7awbt1o=; b=msZVGU41G9+PLYQn08/UgE0RzDWXTorXWJ96/1jmdryuSqWAuamXEn/Ss7KIi6JrHXCY8+g5g2Bd8/izzyqlTYpZ7HYYV7k7ovnFjuE88P5TBCjzeZ6oq4gqGWZ46xJeyyUU6Vj/5CmpOdeRgMmjXLyxhsBn7fG8vl6J+rb4U0qI6CoaWGrnW5rpAWgA4HW/KhGZRwig5JuGXgztmKmzo91uA4AZmjL7IhsAlTo0IWfHbPX8FzcFxwfTr3CCThJyVNbdLIxQYkrE9e8ou84W8psFFnU4EbmNdpI+K8FKPLXQb7spWrSM31t4YOdILCg9tA7d0gAcY8btj+6h17Qkhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KQuMc2h0jaBDVHC7d355Nam85t05IScwR13A7awbt1o=; b=TEuBFlvTQAaiQyka1csWXPYgM7h8cU0PclTKJ21K9xiOZWuRDNPlVQuacMx9obMVRiLGgY25RJwSaT7j0WEHNNReX/YLlvn7YJ+KYTAeQesl63Fk/O5GM5L7+/IiAl9vPC+sf4MFYcVBbYn2O4+Vu17Ilu0HtTAuS7pvHlYWSto= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by DU2PR04MB8661.eurprd04.prod.outlook.com (2603:10a6:10:2dc::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Wed, 21 Sep 2022 14:44:01 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::a67a:849c:aeff:cad1%7]) with mapi id 15.20.5632.021; Wed, 21 Sep 2022 14:44:01 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xiaoliang Yang , Claudiu Manoil , linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] net: enetc: use common naming scheme for PTGCR and PTGCAPR registers Date: Wed, 21 Sep 2022 17:43:49 +0300 Message-Id: <20220921144349.1529150-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220921144349.1529150-1-vladimir.oltean@nxp.com> References: <20220921144349.1529150-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM8P191CA0023.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:21a::28) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DU2PR04MB8661:EE_ X-MS-Office365-Filtering-Correlation-Id: a3171bb7-3910-42c9-959e-08da9bdfb927 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FGt5/7a8b3UnMezLKC2GT5TW0ykye+5T645FMv4FZjxEAEUHmXicBcBt5oUy0YBooy/3nynd3PX0xkySorUxqZCNrHNoU0mSbjbV/8GWrEi53NhYeZrYdUR6+2Pi1bx8aHPNSqBwGmoYlV7PEVWdaMRuP+Qu7LmkOI95JRawBhTf9lKNNLhT+Oog4Cx1NMvxVdtT1m03RnsLiPdK2P2jOZqTdkXURsl25s7CoVCaRTLA0eOLjhr/g+QRycCwhBHKnSrK1K+fKlxpylJqY1xVORU9HT8blzGoN75z4xeEZgeyLN9qCtfBLdolWmOBpFga2srEfjLKpME3booIKM0iGSY7EwusOjIHI6d6ghH7lRZO9KdH5ESAanp2CP4TfJ4ofJtGMztW8YSs5IWX19jIj2chVtAExgrGii1HHOhewZH+DK2Ok9GF/JWiwIcxm+BIKlQAc/DCs6JCdosQQsWzplXbYpfPacYGqxs8ZRDkykGgHZeOuLlvF/NsPakZiY/njlLzRkC4g8jCHJJMKmAlehPbrNRzmx4Jd03Ke4UxrZuetFH3enhmOui+63rcI2SXvLh1zrNpiyHlqw9NNaMGQgFMjpH3treh+1tIYmvVHUGfy55EBY7klMG6vt70DFWnyAAgkeZFLGOnM+GN/fi7yBYBxfB2HGFOfIAEuGfmTa4EqCmafYqySm7tLK7Ytz4GbHZkOixwrp/VK/HktVkRbim8EEwwHyWxeraieYYcyq0Rbdu3dOON6O4wgfOmF82fPsEVCPOTcGzN4MRRJUYeYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199015)(6486002)(6666004)(2906002)(6512007)(52116002)(26005)(66476007)(316002)(86362001)(66946007)(66556008)(8676002)(4326008)(44832011)(186003)(1076003)(6916009)(8936002)(5660300002)(54906003)(36756003)(478600001)(6506007)(38350700002)(38100700002)(2616005)(41300700001)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3NK0DVMVpGHYHSC9M+pLvboHYf+vc7k5Rwd/QLt4botUkPl4ikV1OF2G9kOx7VukzYxWu8AGJhQVLoCeNA0m+m7EdK5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5fqwFFjNPBIAW2PsqGlNcVPKXiMEamx25SRB2MIL22l31aVdc/QYLtQlp+Loc2T6BtABm1fguyEEaBKSS5tgDWqkL4wsZGcafAL/XXz97ZqUtmN/0QGgEK0nZWgyXUUE7Tj1FSuqjuCbRJaNVlCxZL4Aw2rpHdXdjSBCvi6L4LSMjvibcv/TeHl6+4vnycO+zw7FF1dqhN25d8byp6neYY7T7r2jS0pSzkdXl5iwwDmVGW7uoqowcXCm/jj2bx1aLzKypMmyw/HCe74pTlM0vK9x6F5gfEm5tV1AXo/8a8Yzb0toLo9CByUot9JGocRUvTZYP5k2f9Mz6NX0H6SFZu1Pi8truU/apu5gJK2ayeUGV8gtkiwxVN2Of39ryYC8rKPkjYkOAJEHUNupb5Me9/TFaft6l5F27A2KZztZxD/CiCPfQnbuGEwho10VBKW+t6pmQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3171bb7-3910-42c9-959e-08da9bdfb927 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 14:44:01.4612 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eeW+e/Mi91fNB0ON4Npvlmrpcg5c//h7FVsUw8ucPSCTZ6QqyeCr+L3+FduO6MnHtOSHo1i0DXkAZRQbLMToWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8661 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The Port Time Gating Control Register (PTGCR) and Port Time Gating Capability Register (PTGCAPR) have definitions in the driver which aren't in line with the other registers. Rename these. Signed-off-by: Vladimir Oltean --- drivers/net/ethernet/freescale/enetc/enetc_hw.h | 10 +++++----- drivers/net/ethernet/freescale/enetc/enetc_qos.c | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/ethernet/freescale/enetc/enetc_hw.h index 0b85e37a00eb..18ca1f42b1f7 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h @@ -945,13 +945,13 @@ static inline u32 enetc_usecs_to_cycles(u32 usecs) } /* port time gating control register */ -#define ENETC_QBV_PTGCR_OFFSET 0x11a00 -#define ENETC_QBV_TGE BIT(31) -#define ENETC_QBV_TGPE BIT(30) +#define ENETC_PTGCR 0x11a00 +#define ENETC_PTGCR_TGE BIT(31) +#define ENETC_PTGCR_TGPE BIT(30) /* Port time gating capability register */ -#define ENETC_QBV_PTGCAPR_OFFSET 0x11a08 -#define ENETC_QBV_MAX_GCL_LEN_MASK GENMASK(15, 0) +#define ENETC_PTGCAPR 0x11a08 +#define ENETC_PTGCAPR_MAX_GCL_LEN_MASK GENMASK(15, 0) /* Port time specific departure */ #define ENETC_PTCTSDR(n) (0x1210 + 4 * (n)) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_qos.c b/drivers/net/ethernet/freescale/enetc/enetc_qos.c index 2e783ef73690..ee28cb62afe8 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_qos.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_qos.c @@ -11,8 +11,7 @@ static u16 enetc_get_max_gcl_len(struct enetc_hw *hw) { - return enetc_rd(hw, ENETC_QBV_PTGCAPR_OFFSET) - & ENETC_QBV_MAX_GCL_LEN_MASK; + return enetc_rd(hw, ENETC_PTGCAPR) & ENETC_PTGCAPR_MAX_GCL_LEN_MASK; } void enetc_sched_speed_set(struct enetc_ndev_priv *priv, int speed) @@ -65,9 +64,9 @@ static int enetc_setup_taprio(struct net_device *ndev, return -EINVAL; gcl_len = admin_conf->num_entries; - tge = enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET); + tge = enetc_rd(hw, ENETC_PTGCR); if (!admin_conf->enable) { - enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); + enetc_wr(hw, ENETC_PTGCR, tge & ~ENETC_PTGCR_TGE); priv->active_offloads &= ~ENETC_F_QBV; @@ -115,11 +114,11 @@ static int enetc_setup_taprio(struct net_device *ndev, cbd.cls = BDCR_CMD_PORT_GCL; cbd.status_flags = 0; - enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge | ENETC_QBV_TGE); + enetc_wr(hw, ENETC_PTGCR, tge | ENETC_PTGCR_TGE); err = enetc_send_cmd(priv->si, &cbd); if (err) - enetc_wr(hw, ENETC_QBV_PTGCR_OFFSET, tge & ~ENETC_QBV_TGE); + enetc_wr(hw, ENETC_PTGCR, tge & ~ENETC_PTGCR_TGE); enetc_cbd_free_data_mem(priv->si, data_size, tmp, &dma); @@ -299,7 +298,7 @@ int enetc_setup_tc_txtime(struct net_device *ndev, void *type_data) return -EINVAL; /* TSD and Qbv are mutually exclusive in hardware */ - if (enetc_rd(hw, ENETC_QBV_PTGCR_OFFSET) & ENETC_QBV_TGE) + if (enetc_rd(hw, ENETC_PTGCR) & ENETC_PTGCR_TGE) return -EBUSY; priv->tx_ring[tc]->tsd_enable = qopt->enable;