From patchwork Tue Apr 18 11:14:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 674897 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 72427C6FD18 for ; Tue, 18 Apr 2023 11:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231445AbjDRLP4 (ORCPT ); Tue, 18 Apr 2023 07:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231381AbjDRLPZ (ORCPT ); Tue, 18 Apr 2023 07:15:25 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2045.outbound.protection.outlook.com [40.107.104.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C897131; Tue, 18 Apr 2023 04:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDZbPMVD82F12xzVzqa8I80rv+MDfV5tsXEBsK3y6ETP/EWYpAvb9tcqFas6TIX1IiKhXOQL3CvDT7zv0eTyOvobzIj2REcOlLlDaGl9FNImbe7riCiZ7UooLWcUbptULWJc3OMtsXYjnjn/JZ2nfszSblEFmUkexqocYleDBD1SxOwpCQKNvP9Dcgigr14jLbRjKOJ3dXTyRDqUWdaU8RdzzoukxclqorlBVy+wNlGhwmTweUYRERb136be6Of5r6RCGjiv3ZieZhXnI30IssJam8Tw0kxp3Se1+PyyoK1dje52ql85r0qtQA50meM3DulOYf0B7s0KPuLBEIeVvQ== 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=zT70HQvHEGA9i75ZWy4R/BZdgkENulL3EBYoUIpUZ2I=; b=XEMmXrPhlnzPxHqu5V10aHthfPNcS7kjURmHnplhnLiOrF1odJyXMK/6Kd94HfeXiGubuNdSwwRc6vMacdKiDqMEClTMfPUsD2pO4qB7XhP1iFW3ayuiBN0AgQZAs9Eagtws3ov5oJteE0tUEbFn8IfrnL1BbI2/K9ZLI7QR4KTQ14J58T6007oyhGzK3zm/QH8gTplCUzKe5U0MwY55j6ikxJIDw6hHkOa6yIEIb6dZdV24A50UX7p0SV4dNbQbsQdfbyQD0+GUrw31yQNPjF7ylNm7dOlBUnoaPF7LukmXqI1t2m9pEItOL50GuzCG6vciqi6jwdTJZkmnE/+PkQ== 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=zT70HQvHEGA9i75ZWy4R/BZdgkENulL3EBYoUIpUZ2I=; b=nkadiEDDHJiMinm5wn6K6K2ms+wjaVyd2Qvc7fAMubG02yYjVXt/rosYdgJ1wNJDIdIV0TXsYZnlR7HF1CINhZf6QKg5+F0DgCIahF4pFHor8y9ZpYqvg0lDT33/H4PuHPqs/Ba9slKYjy/wAn/ntztyZ+bBALemqy7Mo3kzA1U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AS8PR04MB8659.eurprd04.prod.outlook.com (2603:10a6:20b:42a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 11:15:20 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Tue, 18 Apr 2023 11:15:20 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Michal Kubecek , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Xiaoliang Yang , Petr Machata , Danielle Ratson , Pranavi Somisetty , Harini Katakam , Vinicius Costa Gomes , Kurt Kanzenbach , Gerhard Engleder , Ferenc Fejes , Aaron Conole , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 net-next 4/9] net: enetc: include MAC Merge / FP registers in register dump Date: Tue, 18 Apr 2023 14:14:54 +0300 Message-Id: <20230418111459.811553-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418111459.811553-1-vladimir.oltean@nxp.com> References: <20230418111459.811553-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR2P281CA0152.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:98::19) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AS8PR04MB8659:EE_ X-MS-Office365-Filtering-Correlation-Id: cb5c1b4b-edbe-4ec7-5469-08db3ffe32a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iR17Ikgoq6rfgEzSW78tCP6+37VdNNH3V2hzV7IY/dMpe19ZEsApoYTWZDZ50vZThYXJAg3ND8ElEDs+cENOsE6NBlRYTzFiyce9vea1L+d9w/aq3tEEyxe12UorglqxNNgX2yc4YhSDy1yGkxii7d50rTQa6iem+afIYV01QN8Eh/7zRt2x8R2WdXA25x/Elc3xR+Ihly/7EGLtzuHRWte5zii9pj27LqgzljDV/MJAtddy0F7l8wAQFU4j8KCXLlfK6XolrSUrW2BN48PNcKntJdDXRP6aS6+OLdSWzQ+MlIIoipm1ZFDe6hw8pe3P9XnQncausEcheo7SG5E4CX2zHyqLenv8qD1Hv/YvMZowIReXrfHwYKO8l0Rk4HK5EJYyh4DHV4MAWFpC36dxNYpeH48yHKkBxpuNAZtPi4oj3y9wYfrKEUIBmzQblkFtkV4pwNDXouw3JoM6frsqLm5VGS/q0A2Jj/eZvDo+yRXPQqfDB+AMtHLb/L3KlqQ40Yq/hcIYNw/QuG4Yp5xRp4OLfvGpAe2urfOPHg53M19Ehf/3sPYqQ704meKS99egd7kfdYYuLJ9jBcjx8yFIpzkaxmGQFUMwUkOXqY8MM99y/UsTVBXY2L7epiH38rxd X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB6452.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(136003)(346002)(396003)(39860400002)(366004)(451199021)(6666004)(6486002)(478600001)(86362001)(2616005)(36756003)(26005)(6512007)(1076003)(6506007)(186003)(38100700002)(38350700002)(52116002)(66556008)(66946007)(66476007)(316002)(2906002)(4326008)(6916009)(8936002)(5660300002)(8676002)(7416002)(44832011)(41300700001)(54906003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +Vw+4De4qcxxduc8gJ7USblIhRZ8OXs2dCDRqG7kmO3aqps/PelCi9vSYN9EXOIovjdB3TgSVL2EQsFjKuMVz1LTK4e7/jueCAh9/SbBM38tOiNGDYr60mOi5v3qdP5WuE1rwhRfqpL4LtiZ0rOJaOszJugcG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+3a6pwyjTxcRTIkUz9gAtDQs8juyVZnnkTk4E96ZeqBgrrKmi8O9HQ3iBmC5U8YFNVnuLwPpOwdQpNgUHgiTgyLk7wjJ2uDNInqOWOM4/iaJw5Z0Ws9bPJXwBlv93ew80Yg2dFig+LjpaL0+iGM6ukfIzhFjczRre0OSphNQXCMlqeZWvV9Utulwu/Laqt6dCL3u7UTOJTN7/vPEcZs4F+IydSBQ88tsaPRVWxXsE51Lp/yBLU1sXWol7OLOBI/R0HLPc5raFOMOK76qjoTDNYdwjd/S0ruXFuC9asWYovbOmDXK7DBQroxvlTou58ojv6tfaKCBI87vpxzN95E08ieR6/Y9NYfV/HQ+QQ5g0JHNxNmx26qUuw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb5c1b4b-edbe-4ec7-5469-08db3ffe32a9 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 11:15:20.8751 (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: eVeGsBjt1W4QSsIQ3+FKpe/zeJu3nDF47b+gk0r46UdiU8Y3vFI/jEkHE4DUK94ijy+WSmGgBkD/dilz4/i1JA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8659 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org These have been useful in debugging various problems related to frame preemption, so make them available through ethtool --register-dump for later too. Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman --- v1->v2: patch is new .../ethernet/freescale/enetc/enetc_ethtool.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c index 838a92131963..e993ed04ab57 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c @@ -32,6 +32,12 @@ static const u32 enetc_port_regs[] = { ENETC_PM0_CMD_CFG, ENETC_PM0_MAXFRM, ENETC_PM0_IF_MODE }; +static const u32 enetc_port_mm_regs[] = { + ENETC_MMCSR, ENETC_PFPMR, ENETC_PTCFPR(0), ENETC_PTCFPR(1), + ENETC_PTCFPR(2), ENETC_PTCFPR(3), ENETC_PTCFPR(4), ENETC_PTCFPR(5), + ENETC_PTCFPR(6), ENETC_PTCFPR(7), +}; + static int enetc_get_reglen(struct net_device *ndev) { struct enetc_ndev_priv *priv = netdev_priv(ndev); @@ -45,6 +51,9 @@ static int enetc_get_reglen(struct net_device *ndev) if (hw->port) len += ARRAY_SIZE(enetc_port_regs); + if (hw->port && !!(priv->si->hw_features & ENETC_SI_F_QBU)) + len += ARRAY_SIZE(enetc_port_mm_regs); + len *= sizeof(u32) * 2; /* store 2 entries per reg: addr and value */ return len; @@ -90,6 +99,14 @@ static void enetc_get_regs(struct net_device *ndev, struct ethtool_regs *regs, *buf++ = addr; *buf++ = enetc_rd(hw, addr); } + + if (priv->si->hw_features & ENETC_SI_F_QBU) { + for (i = 0; i < ARRAY_SIZE(enetc_port_mm_regs); i++) { + addr = ENETC_PORT_BASE + enetc_port_mm_regs[i]; + *buf++ = addr; + *buf++ = enetc_rd(hw, addr); + } + } } static const struct {