Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5239801rwe; Tue, 18 Apr 2023 04:16:21 -0700 (PDT) X-Google-Smtp-Source: AKy350bZodG+ChmUG1ipb5npszC+hsPOYQeL8u0AsUN3RvZxCPCMFYNh6Eqf2sGoCInhMwQW+W5Y X-Received: by 2002:a05:6a20:918a:b0:ec:86a7:4fa5 with SMTP id v10-20020a056a20918a00b000ec86a74fa5mr21371297pzd.30.1681816581494; Tue, 18 Apr 2023 04:16:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681816581; cv=pass; d=google.com; s=arc-20160816; b=yBa9VFT06+hkpe+/F8XaZd6wUpQC3+Nl+Cd3eKsP6mQQmyYPyTqjsctMBAUjTSbZ7i 4xtZdqJ/+OKJsKobUdxWn9OFjyHwA97CsGz+cDruJfcenspUfONUW9M3ONHohbsb8+0v RBPt80HJZZgFOTWk1sD2T2878mUD9CYiJrfEe/5XfVL5b7crSsqoxtf7tD2vFqJa+3uK DKKPU/dWE9dVPQP4VvQiUqZGvDpXkbclveyKo/VNj2Xo7qGORF2//QXWaaIkEFK5tQaq einBdeYJJE9ozh3TIbyVqnG2/ncmL5zRCfFEHJEho7FSRenYZbhmxWRUkOUBBsOiKERo E7Mw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zT70HQvHEGA9i75ZWy4R/BZdgkENulL3EBYoUIpUZ2I=; b=UkjHz7FePgYC+6mKZLd54PfZs6qT22H2S1o0/VcpvSSsCgIoEmH4K7dihrOSRP0ITM YDOp4TREwMApun24jugeQyen+2Z8aX9UwZ544F24cTv/A6m5vGYEdWZcM+xBwyQcasw6 M2WP79hXavaKcNNMT8bD6B1L5Pd4YGQYugMo/TwV4/wufnkig+kSedbKUIUEaN5ckA8+ MbGKDWeQ1WiMmD7b+o9x7kF7ClborkIjVjljOn5SmuqzBKZ17eOW8uL3b5GerBdgC20c c+y5LAifHRjDzmgrr1cQg9uv84T0Wt3ZMc9mdvN+q2bolalV6IwWmAl/82QQOabsJUxa M/4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nkadiEDD; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a631907000000b004df18fa49aesi14506594pgl.796.2023.04.18.04.16.07; Tue, 18 Apr 2023 04:16:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nkadiEDD; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbjDRLP5 (ORCPT + 99 others); Tue, 18 Apr 2023 07:15:57 -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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: =?us-ascii?Q?+Vw+4De4qcxxduc8gJ7USblIhRZ8OXs2dCDRqG7kmO3aqps/PelCi9vSYN9E?= =?us-ascii?Q?XOIovjdB3TgSVL2EQsFjKuMVz1LTK4e7/jueCAh9/SbBM38tOiNGDYr60mOi?= =?us-ascii?Q?5v3qdP5WuE1rwhRfqpL4LtiZ0rOJaOszJugcGDPwIHHRJjsJ0RV/UPaXqugs?= =?us-ascii?Q?xIcBcUCrhK0YB8ej0HMYw5tpNgLB20MdlrOtjBGjGBKv1XW/FFtV1NXv5g40?= =?us-ascii?Q?x5JayiBpauwtBDvCF8K4gKB9x/PAwrDIpY0OFcu8K4ZwREJo4i7OI0cjof+P?= =?us-ascii?Q?Gs00vlGh8m/Dn5IIFepytQdvIaUbIBs7D7Ll+k8YdL1xf90OPzLT6G7JQKcG?= =?us-ascii?Q?O81jg7QINQsWSfqIbvWELdov/cikh4gLfG3HenX3K3rnC9svku/YPrv4mn5g?= =?us-ascii?Q?vH+pv9erVnUDWotGflQ4SLKDlofOVaRO0WMNZVOOBoyl5TFt1g08o103DqPW?= =?us-ascii?Q?DXHJ4E7yhNEvHrd8ELB9h8urrPgvNtZPP/lcmDs0Aw464pkHJ0Ch0sPs+Fsl?= =?us-ascii?Q?GQ7OH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qt6d?= =?us-ascii?Q?CL3u7UTOJTN7/vPEcZs4F+IydSBQ88tsaPRVWxXsE51Lp/yBLU1sXWol7OLO?= =?us-ascii?Q?BI/R0HLPc5raFOMOK76qjoTDNYdwjd/S0ruXFuC9asWYovbOmDXK7DBQroxv?= =?us-ascii?Q?lTou58ojv6tfaKCBI87vpxzN95E08ieR6/Y9NYfV/HQ+QQ5g0JHNxNmx26qU?= =?us-ascii?Q?uw=3D=3D?= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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 { -- 2.34.1