From nobody Wed Nov 27 00:26:20 2024 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2046.outbound.protection.outlook.com [40.107.241.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F8E01D5AC9; Tue, 15 Oct 2024 13:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998024; cv=fail; b=YP5Q+DVkif9WzFAI7PMs1nRyi4YHbPQMgG9Swy6D/uY+Li4GgdJtGeqm71wlOoBIIss7jl/fRAB8zg/6wdd/YjjXGrPlb+89Sv32Ej3VQ3BAfIxBTkxpF66O2JKr9kKsRoEQF63+ZS/CirkZIwPuJ0Ba/ZB36u4/iJrpp2Hsr80= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998024; c=relaxed/simple; bh=rWZH3otLH2Vgc/nQPhpcxfZVCaj+0vmIA3Y7E9O0VYo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HHLPO9ASeb3NWpF2wkW4FK/Vu7wBkO2x27X1OkgPdv/vV6LyFPK1J8N8du03acABCYi6idK6uc0yJyUb4GSiJ77NgfKhmBi18OrLJUUOD4a/7lk8/4EmNjih6MSQoUNxnBBs57WqOrzP1NPs98WClYw2KR3yZEJPrRg8gkyU64o= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=jmtWQ5io; arc=fail smtp.client-ip=40.107.241.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="jmtWQ5io" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fLURmgdrXXRq1zxQeI790G8GODvi5Mh0ytJ7iMD/dpvqpL9fjGLSKKc8AiKqgaNnBOlBYtARSkZN41RrsNmHH9n4JDmdYZefsRdeOuNyrim2UzSdYF60SSPKBwmsAa7zA+y/wlFjp51ZUzjrwLr/VrCt8GMpfGsZu2w1GuhaE4/+VYTk7xWcdH2brCghVy9GQBkS9D4mFmgDuR+MbkH++dz28wW6oebnBX87N9Grkefa6bS0WnUF7VgBLpMXRcckClPfvRLqRT6Gzgj2S4+lMllDtKTnjmiN8cFcXxsc/uuz1Z2rGgGpX3iqCAEXpmQ/1dh+14M7j7ahbWMaIuD5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3rWZjqMHjcsrEjEiwT4YROTt6gdb4/Ommk1YHIWm5wE=; b=opqi5pC1aULhl2+YBk1DZLEjE7i9S4hBSR0P8UM83vsRQ4V0vkgS6JF+qrEpfrZaUQLHE4l8znXyNysyhiidzExSXs0Ln75DAKb3c6LQ9R8iaaWM/LTQ4uTYsjTddCC8IlpLPFArScYZdajiD4FU72iqoE1X7OrUGnUnhJI+rMHkxNtbhFq+stqJC8NawdSMsA+7zDvbF0Aaj0h7zys8mUCeFfZtcmUDyn4RoqJhKOPUPl+JuJkwfnfGYlR+TPAVzxolV7VZEdPXpNYRQClPKCuuhxSqI1eI/wpwKJmOMYnGMpvdGqaLYwldOG3L7pXwKnxiHGII+hfN3WYeSSjdTQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3rWZjqMHjcsrEjEiwT4YROTt6gdb4/Ommk1YHIWm5wE=; b=jmtWQ5iok+6QjavBpnWF4BYc6C7NlGN7EYLHD76XCmAOrlSiLiCEES9RdtOCkHkCwzQASokP5lPt7mSLqYl6nqVAdHMovvk+KmcgEp/XiaLKYX8Fg3gG2F/oyAtjOSOWuZrKzhI6JHxxZPZN/2cAmvO9wMCRLNWURbMbRTgAPgIial+qizBMTCkwryrSHj0lg2GrPHnNUc6Yrgmssvnc0jtv2PNXufcQU1z/y7sHc3jAnEQxoXnm8xELv2gMNFANQ5FPsfWVD5LHgLAVSerORqUbleAYNPOmKIydP55RSo/QQ+N8RuzcHmlVAOFo76clMrvzYjxWXDo0SCS1rr5CBw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:13:38 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:13:38 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 01/13] dt-bindings: net: add compatible string for i.MX95 EMDIO Date: Tue, 15 Oct 2024 20:58:29 +0800 Message-Id: <20241015125841.1075560-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: 29994ffc-9c59-46e9-38c6-08dced1b2e9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YzI/gDiREx1GNPE38PnFhAYkeuQwnUJbR01Q+FKaehBHOcwz27g9iOEN7r1y?= =?us-ascii?Q?LHJCV6X6glppBkG0unn0luRBjc+82N5D6DDSoxqqJiWz5fdlFWuXm8rY9D+j?= =?us-ascii?Q?KemLzqkOe41chNllInzlrYb89W+HeVe+etmTJ3KvRDYUBPT3Or5w+ESWO2fY?= =?us-ascii?Q?aBA/MXGrGXZoiDTTRCsI3IdLRwJ6x9YWTqPdNyJW0kJkvVYdUZAjCDNHA4Rt?= =?us-ascii?Q?gtu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q2wkToab9mskYv+sC?= =?us-ascii?Q?UakUQgyXWuadHIJav+Sj6bhxSpMvMvSK32OX70aSAjrdbwON/AcZTv+DlPIL?= =?us-ascii?Q?dHEbAv2ZK+AMo25+0aoZEhPj5mASCdL/ELmO1jkFDIMVHMTy8sGfJKCfOk3M?= =?us-ascii?Q?Wyk8+xs3+vMTxfqezc1IKT3uJ443e6o3DzfFB9a62PikpXNU4o9hIeki07EF?= =?us-ascii?Q?RAYP+HK5JkJyqCLPGzV1/n7LRQ0hDqMORj+NM9Gd6Ar7+bTMmtASwWVvshMb?= =?us-ascii?Q?llgis5k=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Zot/0HA+Pn4kon2S19YYTimKtwqWwvAOmtrLbwEElmkKHy1H3byzjx4y56zS?= =?us-ascii?Q?IYI7Sl+cV++xAsVufEkfwUbwDcxg2598QRhRFVmwV1BV68HvamLIvYZNQL2M?= =?us-ascii?Q?2N4QRnkQ13UzcF2q1kEG7GDltleihBGJWiZYywvFKTIqBYyeebSB9cgl2HYv?= =?us-ascii?Q?nEqVyU3HxUDy0IigBCSK8d4/JyuR+a4hXtnfvL1pKkZ3B9mwRd/p0D7NpFtJ?= =?us-ascii?Q?2yGdBTTTNSiAsXGG0pyisAM8o0pavQgd2NZ5OGW62nK8NMtx6/TEjs6UYpXv?= =?us-ascii?Q?SVdAqLLQoUfYue2orTvM72zJz9RFtPgyeaak2Svmp0dcjpqEiL9fALdlr+U5?= =?us-ascii?Q?Tzmd9Um1XzP2av1Rl29ZEE3rxpQRBrwfHd2uPJUpkTeztA33xSRiMo1+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qKJ+Etgd2EEVObX7OXhimZO55k?= =?us-ascii?Q?gABnLq2kXB1GpR52v2snklnGX+9dRInCvxK40NyuvykiIzjoUlWdM0HKJ5LF?= =?us-ascii?Q?gixolrB89phg3g2PnzHrIbfskrZ8I/9LaCsumVmLJ+252MG4jMCUOtoHgRWs?= =?us-ascii?Q?t+lGMcQv+qzmRh+PTMQBJEE3NmKx+pYGw/ZJkOqw+rG0Y9fCAgPRm6rBd0Pm?= =?us-ascii?Q?NSZmTUN9B/M1vBIEswD6oKkmRcCoyOkXCSa3LCqmPwx5FnUYO1iN7H+pXxZ/?= =?us-ascii?Q?NU/x2LFsWUZfSrrncnkjb6zDq71dSVzvxwMwX7i0?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29994ffc-9c59-46e9-38c6-08dced1b2e9c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:13:38.7728 (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: h+ls5dBgpx516mKfGSbgFO56seci3avXeJiUYfChxRzZWfGXhsW/UiUPEzGiqctrZguecA/S9r4m5HetmhmHsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" The EMDIO of i.MX95 has been upgraded to revision 4.1, and the vendor ID and device ID have also changed, so add the new compatible strings for i.MX95 EMDIO. Signed-off-by: Wei Fang Reviewed-by: Frank Li Reviewed-by: Rob Herring (Arm) --- v2 changes: remove "nxp,netc-emdio" compatible string. --- .../devicetree/bindings/net/fsl,enetc-mdio.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml b/Do= cumentation/devicetree/bindings/net/fsl,enetc-mdio.yaml index c1dd6aa04321..71c43ece8295 100644 --- a/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml +++ b/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml @@ -20,10 +20,13 @@ maintainers: =20 properties: compatible: - items: - - enum: - - pci1957,ee01 - - const: fsl,enetc-mdio + oneOf: + - items: + - enum: + - pci1957,ee01 + - const: fsl,enetc-mdio + - items: + - const: pci1131,ee00 =20 reg: maxItems: 1 --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2050.outbound.protection.outlook.com [40.107.241.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C23B1E3790; Tue, 15 Oct 2024 13:13:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998029; cv=fail; b=eOL5w0lTP/1GK80GstfoYTHOBPm6S67L90X/gxCWd4lDFrTpTv3ogmOiOZNmlyuAxJiv5I4J01XYpF/Ae8FMffPoDfNB9r9XoK5NcNlHT5EVp8COuNr1XXiGhpaNXJVuqa1zz193E7DHDrhJS7H3qoucWF+zCCJNS3jAIx3Vpc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998029; c=relaxed/simple; bh=vOYt5pc9CLUk9g+61ym0JlfJ5NQ4N/HkRG2V7f0RPDg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=q+GxQGfDVWGt4zYFiLdHng1z+WXTRBZiHE1lP3GceN3JdpGi2Vt7JwPTR1o1cmBjc5AhSZqL4LBtYQbBeoeyCyQUPmlcTpL+jB/HegpSAKCK14J4s6e8zxcA6SL5KstuF/VNDZ/zBGjIITqTQc6UY9CdnFj4Hdh5YuP1YeruOdc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=XWbyL3Ss; arc=fail smtp.client-ip=40.107.241.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="XWbyL3Ss" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c5hmET8RNtvKNfRzpfdYJHGJ3ICMNmrTAuLbWA/+SWR8WbsrEdTPpfI+BhdWgtwWbDGfFlWijnEx9XzqSOxn1WQVzqhTDemm8UGeVOL5kflXDt2K4URAGyTndPiioD+7IGyyJ2kRHO8mKWHwBKt5JfH1wp8TItJdNWTkgaL3gMrsRSIIj4dFwSrZrWpSU2StEvsJuv7YpvpDmVjR7YmrEy/GULKaujKfAqVmIwUB1f7JuV7ecQlm83Hu+ete2Z4sBShrvBxaJNg3SkPhgd6ByYRNKQQBK7ozU1e8HBc4gGZgT98JRxDjuTGcYlQplHO9AoU7FQxC+elHr2WxvQ1eBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mpTDZ8jdwDxlJQiNlhbG3oBSIEbo9cWDP/D0msqeQlk=; b=KPH9BgDtaYDAX9mGovH/ri3//MknwmOylxTWHDnEEzdcSFiDc66scmQ/dxuS5XFwGoF6x5Q+hdX0R7hxTSdPN1WLnlZBvkzeFJ1S/GWqQYye9HyvuNMcBxCjtxD0i4+CA3Vy3qcnpDyP5Z8gDL6KQSlLpAbSnzINtGimwHeimGp9jPj+shXnR2M5cx0jEvSPSq4iZDDEObwSLUSxIKH1XlhSXbIbYKpyzyWOcNNRRE+iySnCptvkitUm8ARw0JhrTB/Z9tT2dpmWmH3RgqhWTqBIyLL1rFJh4r527CNFztOQQA0r+l3QEkbYdKJae8eIOjhSAcIjAO+unioPYPApbg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mpTDZ8jdwDxlJQiNlhbG3oBSIEbo9cWDP/D0msqeQlk=; b=XWbyL3SsmAw/EWIN3BEJBsJjc0lqfzXqXMvv+BCVPgzAiil91wSl49Xn+CpRRGqdWThNNLHcuRUPkfD4mBEp0CrkuOZ7zhDZXYDvnEPxFregTPmxcjH+QQFHqX+yE7HLKEsMRduwYeXda3382zU6REzvpmewpE6v2X/OETbvRihDR6R2sJjGO2SnQKd57SI055dxfumwn8MNd36ngrTyCFWnizV8bNG/dxN237t83+S/HyUVTC8pfBQbp8S7R7NvfSxbsmnvhz8bSUT3a16jo3Af3SqvH4XxkSQp4gxPg4Cz4J9EKqDjSEGItslsOyrF0V1CxNS8vNiRknrjI5ETKQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:13:44 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:13:44 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 02/13] dt-bindings: net: add i.MX95 ENETC support Date: Tue, 15 Oct 2024 20:58:30 +0800 Message-Id: <20241015125841.1075560-3-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: d7545c66-953b-4af0-b9f4-08dced1b3226 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Micro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XXFoVJ2URIOy7Ig9zOq/T5bmCaDN6YuzFeCbu4NJ?= =?us-ascii?Q?7/x0gqb4DtpTVEir8YJWtvXf9wWcIYyTHS5mTIjVFBPeo70SPmfng8rVUMvO?= =?us-ascii?Q?B2zvn7YBs6J7+R1g0zsvl8ZPnNZthDB8wFklD4kYRZOw5S2a9Cly6P0VjBVY?= =?us-ascii?Q?NooHE53OKFmCCUEdtI99kTH7XWyH4LP08LtTP+p7pHUzX/2pMjoCDFrlwAiy?= =?us-ascii?Q?amDe1hvdXxmTcNghRvZjrbK+N9afW13RNyejzo5Elmpkv6aCx5QEoK2VHMpu?= =?us-ascii?Q?RfQUA8GT98+HWyP3RQPu/jmdVFYsgpEfnPgYFk8yamUc+cgJLwI36Z1HkbKP?= =?us-ascii?Q?Xx3/eO3pk02scEhTWVOE3bEihxCyp6RlLeFOH3L5b1AUixb1N4BY4e5ukwJe?= =?us-ascii?Q?fMhFUG78yFA1/0uOBPYzQlJKRAvFodM+RFcsPj/VFllzelGCGNokIlASXOKd?= =?us-ascii?Q?EM8X2hUs0OE7YcQ4JKTgvdoENS5W4D+OPIHHqGI2Gh2WEHIhQRlf1CfE4YdS?= =?us-ascii?Q?MRFzmhY=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LbhE7oDuQA9wwmeF1ZvxHJja92ul7ZYJTM8yIIfFjvN9CphiRks1oC47z14y?= =?us-ascii?Q?M7D21GWNHM0kg9VWZlaDEB70PV54tlJWP/VAJMHOexvHErt8w8MzzoV+B+tk?= =?us-ascii?Q?5cEqnqP33Fck/cRAm7TqXvORIsbV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?Q?mH3m97WOnAi5geymgP5HDUXd+itRTlQrEfWL7VgYnbB6OHvQNC2F4dwvw1Bh?= =?us-ascii?Q?OR8qGFrMYt1ppaMlCqUpOOLT/gqBp8AgEp0Bs+MFwO1+NxBZ4fzEjR6V3Wbq?= =?us-ascii?Q?R1iPPMKBhff6N8OdO4KUSn9CSeoNgZyw+v0bhDAYX91EsB6kIqeHX/aSKATn?= =?us-ascii?Q?HdmPGGmDtbm3Pt9Wv5RqFNID3q7+5zgqYH0MkP+jJQLC/X1PVBnoTTEAYNDq?= =?us-ascii?Q?Wm8mC09XHKJNq9lbYMolI4B04jumBKjz5lHKLmAfUFrSOjqRxm+nKkgJwsIX?= =?us-ascii?Q?wHJ8N+qjbalaL0BNfqgDEeQOCJ/miTNankSNCJbByeOmwOatEcMXKRZCfw6d?= =?us-ascii?Q?YjSbVqJB7ZnjabGZvr4Mjw6lZ/m7s+iZXj3+o3pgkZT8p7aPBZk1QQODg1LX?= =?us-ascii?Q?aoqfvrftBiNBzORGz8H3RBChVwLobsoQE8A8aoNQxdcrU442k7ETsxVMJncK?= =?us-ascii?Q?+7p9/LFp1e4NRA1XncPUMg2gLurZrjyfB8oayUEonOwRQtzt0dplcngk7l1o?= =?us-ascii?Q?95aKMBBgWXa56XTPY59IYTiPCH86sqjxJcVFr4uf?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7545c66-953b-4af0-b9f4-08dced1b3226 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:13:44.5878 (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: q95x7SdLnAB5gMGfta04giP27HvnYMJ1S7QhXS2ziGRJNiLb/yMvoqux4HKjNlVw0DNoMiR4B4uNRl/Jg+A6Yg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" The ENETC of i.MX95 has been upgraded to revision 4.1, and the vendor ID and device ID have also changed, so add the new compatible strings for i.MX95 ENETC. In addition, i.MX95 supports configuration of RGMII or RMII reference clock. Signed-off-by: Wei Fang --- v2 changes: remove "nxp,imx95-enetc" compatible string. --- .../devicetree/bindings/net/fsl,enetc.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documen= tation/devicetree/bindings/net/fsl,enetc.yaml index e152c93998fe..409ac4c09f63 100644 --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml @@ -20,14 +20,25 @@ maintainers: =20 properties: compatible: - items: - - enum: - - pci1957,e100 - - const: fsl,enetc + oneOf: + - items: + - enum: + - pci1957,e100 + - const: fsl,enetc + - items: + - const: pci1131,e101 =20 reg: maxItems: 1 =20 + clocks: + items: + - description: MAC transmit/receiver reference clock + + clock-names: + items: + - const: enet_ref_clk + mdio: $ref: mdio.yaml unevaluatedProperties: false --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2065.outbound.protection.outlook.com [40.107.22.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5FD227B84; Tue, 15 Oct 2024 13:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998035; cv=fail; b=bYevlS0kT/OXZdP7b/qpHeLhhuWmvvCZWoYf0VBMy+/mh5QmNecJj9gwqaJI26WJkB7XlfzPB4mL+VpOmdHI4xxeBCJkHB87nC/U21cZVnM5gx1NmIqCck7Xe7eRHznrlD64tyQkaSZeyagBHExysEAHcSLIpvTOFE/yCHP9Zfc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998035; c=relaxed/simple; bh=m6QZd2W+FGDZ7/+DLRV6ptbnvayiFlpyLJ1PRo89eNM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HVbUL/gDQYN3b3r/UwaHL8YAfUPj6fxPXLqlgXc/vLzj9r5zMO3Jif4gfTZ5tQyb6JYam9rChVPStZBwzPefr/UTKeq5Rz+6LvrrciFq4lnAIyHkYLD1Ri5nN/215mKYY/YiPhIFVNpuGgV2RsfwzfXR+5MFR76L+WVNNVF2rbQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=C5/ns6uD; arc=fail smtp.client-ip=40.107.22.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="C5/ns6uD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vbgKDHMYgZuiGEoezfQP0pAJeZBGe8waLNsjhwh6QfZ95RETDSbANgzA+Nca2evYz2TwNGcdyhUq7DTmj0C+dAg9v06lN0CU7jSePUvAw8WjzHOR0HvgS5SBviz9GEohwG7qodG3PW1CZKeeex+ZXTOVSf1tNrKWsRTJMh+r/8mZXUlLcV+VswZaFAOTjfV/9UgwDfQrPZ5d9UFpQIwv7/Qiv51AgGRM46Tfu18js0Is/RHbaMcNJIXuVFbFdL+c2k6kCl6Aimq5k9u7I3bDZcxiWuliXBg5B8HxQGxFt/Efa3mDCmH2B2a0BOIx+OYnAZRrho8nc2oTufWQyanOhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=q33dEmPWNRXmhcrUMfWZDC19xxfRYpOcCFacPXnIzis=; b=Xc1K+hjM/KHdoqV8XxDESgP9c3XsKZrj7DxFVpTE5kkzIZ2dz4+gY5keKqCXjF0UbLEI69zrDTixob/PRolsqwwpcMM9UAmz09rtfzNHCPBQvzd7ViCxuzOYWP6wAVS13w3Y+LQkq8evticWlaMPtfD2a/4ns+q5jRRlEaPnZT/S3OGupQOcZZ98f6qnWavg4z7my+21+QYEfkqBcMwshJIMuKr+kCqwrbLjhlgzpX4TUTidwCEuJ8H7NqfODBS6KR95FqsRLdYvu+ECFcf14smZUaxrFYsQR9K4OVO0/2pPO3SmXoZ8Xk6DwlDZUDwCPoDJfTow6AMAtXurMixBLw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q33dEmPWNRXmhcrUMfWZDC19xxfRYpOcCFacPXnIzis=; b=C5/ns6uDelIJMc2JNxrJNxJ1MsEDJZzB5pP9EsloS2S4fL3D2WD3QXT98nlvKANFJLbv8poEnVjfrSJSMtCF8GfaR0sKs1W2G/8y120H04fvCPVAA6i887auucT5avYh8G+tlVrGNSWdP7xm8cp1ZTVAP6NlC7/P7JgSJi/lrI1JVlWUnmHs8hUvbwgrq7Q77mK/k5QokK9jryrICITs7iDOnrafeVbGBelAU0OSFk1lJFFSngbXnRwKtQpdkn5RhAbiGxCkYF9luq3RYCSqGJOyKimAzQjlvLTq+V42p8/F7HWNWnV0/Lo5Jx4p7KUGPjhgT41uwiay47wFifmrug== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:13:50 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:13:50 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 03/13] dt-bindings: net: add bindings for NETC blocks control Date: Tue, 15 Oct 2024 20:58:31 +0800 Message-Id: <20241015125841.1075560-4-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: b5be645e-a9f1-4b4b-bc2a-08dced1b35c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?L+QESobnR3vTY8E1603I5SuIGCApsYZGDIeB3MrNR+NaL5xKuBmAMgldRMW5?= =?us-ascii?Q?GvuzvDwdvBGuF+SVRs4vZux6lYoM2Dj6QiApBcK5+N7T/iGK6P1a9nuwhUUg?= =?us-ascii?Q?TwDA1QMdOPy+MmAYdYJF9w0UQ/0pEXOoBwNnaGf3D9bTMDdrQEYLYaMGEXhR?= =?us-ascii?Q?xKxOBuccxNP0+fUdAnF96+bD5LKYrYtyYghfHWy56D+nAAoHm3sfKsebMSmP?= =?us-ascii?Q?VaCnup4j3J95ibYAeMQK6XNCqXIgVeueKU9hwr9wJJgax8YwbYuyLJYuMJn8?= =?us-ascii?Q?f90ZURMifCDmVifvbivb/i/zWhBNsSEmlgCnvb6sBulTmB8dL+54oGqpJtk4?= =?us-ascii?Q?cCvsNFynb8Zh+FGl2mf3OxKyC5OrsncdM19kOE3EA6chsIzG5rQsrPA+Hk2l?= =?us-ascii?Q?FRsUGQs552mRqpxIvRpCbpLWQ3CvtTYplrfX6KjT9VIGjHdmKEj03F1rkg1+?= =?us-ascii?Q?shrX245ffOCkdrh2QYmpbWQ8QPu/EamCDjMCe+c6MZcFwHgKWPfw0HgmkhAc?= =?us-ascii?Q?9iioYKiigE+mPRQm+GvNVdcKsZhIxS8ayX+C8yC6N+INvUjYPwJ2qbjIrsn2?= =?us-ascii?Q?7yaaROY/UQeYz+W3kksjjJHwDyjYOKYnvX+g6EP459CztfLpnyv599hJfIjb?= =?us-ascii?Q?48+Pa1uAZ911DizQng3P9fYD6NglBLoYoLW9syD2YtT5wg3U8e8KwIESZWgI?= =?us-ascii?Q?z5sGtLu5VHuPQMY3xZx5h+5xlnWzOYVd7m3A4rYv37kovR1ZekUjMZDp2gIF?= =?us-ascii?Q?ptvBiYBVXOcvgi+Iy4qnoQF8L9ZJ/miKDLQB94nX8pw4xdN9ovPuuWY1E5Wz?= =?us-ascii?Q?hk3nYkXT2h52VK1MUT5f9jS6DThu/KoTv+DGBFezYUogPpMXQ7M1ZpmmX+C1?= =?us-ascii?Q?E+PgFIAS4+gFeo7lnI19r3SpwCfM8skan00gpNOSutQDnOJcQraQWhrHG6ws?= =?us-ascii?Q?o8A51x3lF0DgTfYdTFyV8hFEACAqkhjCuOTcGpMPYw+0td6Nfakm0yzB3AS0?= =?us-ascii?Q?NKmtDR8W89CBnhN3RkX+TxA4mL/Y4qniWMSbXKUkFmXD+3J9oeJ7oMYWXZ6f?= =?us-ascii?Q?iYtuWTaX6MwkKj54Uqs5QxOMRMmzbv4Tq2eC9RkxVqAwm++UO83cP5aXIJx7?= =?us-ascii?Q?uUpW1i8pmVbtpqak9egcikHW6zamOFBXzJNEIaeAayniSi8QbHMKGy9kTULk?= =?us-ascii?Q?rT3jgaNw7cI9MP5MPuD4AmgtItdjcMyAp+qLbanh+yKPbXsGeg3sQWJUqMs2?= =?us-ascii?Q?UqYoFQsiuuQwERVEHVrSkMaQcnCGyhakjZjlOgFMyK2nI3+JRUpyEWe5utz8?= =?us-ascii?Q?jPg=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vH9E/RymwlDeMLpsNSJLKpHaHIeNPhqZBDIz7PTgLoYmMlpdZrV5t61vINf9?= =?us-ascii?Q?UrRguhjCZFBmObYxpMPKZanNzJDA6BRq/7LuzPX1N4tG34mKXzvP1Cv914+K?= =?us-ascii?Q?fflCJwtAIb+hdUzg8XjxmNcWOgvolxNgvMZl7AhAqhOCGHTSzqhgawhSAcIq?= =?us-ascii?Q?ILUenQ4x20H0VHnswEFuv6ySkOwOMD3kbqeOXtE2+wqipo3I0OtisMXPaKt1?= =?us-ascii?Q?emTrjgQGS/stfU12DYKoPsGDX4UMs8EnKjljiO1gL5nNI1FsV5JCS5j1+M64?= =?us-ascii?Q?9Q4PcDhdui8rRROfjle0LBZ/c+fi0g/8fTtyv2isQezWxw5WrlEOt5uHgqs9?= =?us-ascii?Q?R7gnZK1mMtFb8xhVApwGvZGc/Ec/0QGTNMLVliMY5YR/FgJ9R/MpDxYK/RQR?= =?us-ascii?Q?1qHgC2buVHa1ZPsMKdFzO8GYwByezITouVSKn0pBHMKiYuoW9eTB8hoCydZt?= =?us-ascii?Q?xz0G8w5LC/IbY0dgGdDaDavYOJmWZCWplceMQDK+nfBOM3y/LIYAO1e+XhFV?= =?us-ascii?Q?9LcHtr/qvj3VpyxXAsIokeqZj5NqW05PdDiRsC3nd2J7PsHE3LIN6Fs+cra0?= =?us-ascii?Q?7ih0hHqqwfwLcowcM9Wu4HqNG46k4qS8FojBobD+9MFYoHCRmCbdkYLjpVrD?= =?us-ascii?Q?msAaU9MxJQG2dJ/LqrITuJszrsP9hCNeLieSIEsP3zZN+DMs6EdClF6Q/uL+?= =?us-ascii?Q?e6LMTA8sD8bID+BwAacShs+JnpsBGPvpMpsvQlu1Ixwjgn7riQwd9HeKHRmr?= =?us-ascii?Q?r1leFk/zDbDU3+2NoT3AnDHmxlZp6cYEdaCwNsEr3izZFdo8/e5AXH16JLnD?= =?us-ascii?Q?mqpKok+LD7X9lal+Ih9DrxbqANRx0XG8B6fjGmieplopY2epvxSifRhxc03k?= =?us-ascii?Q?KHJDtp8AG+0fozuuWIwJOMU6ueBublAzjuRa/IvSZjfNYkATWqO+rS7MM/Wc?= =?us-ascii?Q?/7PAqckNSvQxs8mnEFYf8b0Er2FvxBSYQtCyO2T5c9+yuQo3Q6PJdKnqgcdF?= =?us-ascii?Q?C/mW+tN77FRbL0vnBd8Cx8LrmuNShlpsNSI8COkqRuiU/j5DGPRMS9yPTHvy?= =?us-ascii?Q?tj2+OGwiiu/XgeWqA7EMcf7QocTQQgm071jqtT7cSPMIQZNmQ4KfBA/d/3d0?= =?us-ascii?Q?F4ULshL85D3pGTXKJXhlpAhgsUHXb18aelUvd6e3xvJD8VXOlsOkX4o6n276?= =?us-ascii?Q?5ZcgMzx0SnoMyiyU3owR8TsZHea3OUUZlSgtv2kvWJciifXBK9uV00wwkwwx?= =?us-ascii?Q?1KdFnkribqh9RxbvffGtdkUfymXZ6z5+yv7nWl6zlZBMSGtBYKUYJc5MObRn?= =?us-ascii?Q?T6f6+GmXqWasK1ox1iCWS4MIe2mWt6xg9rP3uDCKAK8S0mZpZ95j1dY6nyij?= =?us-ascii?Q?pziNAHT9HUUU8cvK/9XN9ixUvzn+8W/mwqlXuLSqcdgqn6FNjh5YJVXwZdCH?= =?us-ascii?Q?dcrivvxGoyvIo9+8EdhE+ABWTrXJw3ElfvnK3Ea48+zPX1+vIwwxTTMriKuW?= =?us-ascii?Q?u14lDHEPxcjmz3J1JGJRYML7+9qX4kOCHFPxlLj6HdyY/ZaFuGLvDWcPYOSJ?= =?us-ascii?Q?MKgYRcieFExqcB0sLWanxxv4RfqtLtg8Gxdeqsb4?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5be645e-a9f1-4b4b-bc2a-08dced1b35c2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:13:50.3488 (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: 9gptV7H4MWNuPCSoKoqnGIBuhh71DUfeOc2zUIvYZ48lMFePbDPNeiHwMkNNzjfBfp/eS4UMXxS4Hiff4uXrGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" Add bindings for NXP NETC blocks control. Usually, NETC has 2 blocks of 64KB registers, integrated endpoint register block (IERB) and privileged register block (PRB). IERB is used for pre-boot initialization for all NETC devices, such as ENETC, Timer, EMIDO and so on. And PRB controls global reset and global error handling for NETC. Moreover, for the i.MX platform, there is also a NETCMIX block for link configuration, such as MII protocol, PCS protocol, etc. Signed-off-by: Wei Fang --- v2 changes: 1. Rephrase the commit message. 2. Change unevaluatedProperties to additionalProperties. 3. Remove the useless lables from examples. --- .../bindings/net/nxp,netc-blk-ctrl.yaml | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl= .yaml diff --git a/Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl.yaml b= /Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl.yaml new file mode 100644 index 000000000000..18a6ccf6bc2e --- /dev/null +++ b/Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl.yaml @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/nxp,netc-blk-ctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NETC Blocks Control + +description: + Usually, NETC has 2 blocks of 64KB registers, integrated endpoint regist= er + block (IERB) and privileged register block (PRB). IERB is used for pre-b= oot + initialization for all NETC devices, such as ENETC, Timer, EMIDO and so = on. + And PRB controls global reset and global error handling for NETC. Moreov= er, + for the i.MX platform, there is also a NETCMIX block for link configurat= ion, + such as MII protocol, PCS protocol, etc. + +maintainers: + - Wei Fang + - Clark Wang + +properties: + compatible: + enum: + - nxp,imx95-netc-blk-ctrl + + reg: + minItems: 2 + maxItems: 3 + + reg-names: + minItems: 2 + items: + - const: ierb + - const: prb + - const: netcmix + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + ranges: true + + clocks: + items: + - description: NETC system clock + + clock-names: + items: + - const: ipg_clk + + power-domains: + maxItems: 1 + +patternProperties: + "^pcie@[0-9a-f]+$": + $ref: /schemas/pci/host-generic-pci.yaml# + +required: + - compatible + - "#address-cells" + - "#size-cells" + - reg + - reg-names + - ranges + +additionalProperties: false + +examples: + - | + bus { + #address-cells =3D <2>; + #size-cells =3D <2>; + + netc-blk-ctrl@4cde0000 { + compatible =3D "nxp,imx95-netc-blk-ctrl"; + reg =3D <0x0 0x4cde0000 0x0 0x10000>, + <0x0 0x4cdf0000 0x0 0x10000>, + <0x0 0x4c81000c 0x0 0x18>; + reg-names =3D "ierb", "prb", "netcmix"; + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + clocks =3D <&scmi_clk 98>; + clock-names =3D "ipg_clk"; + power-domains =3D <&scmi_devpd 18>; + + pcie@4cb00000 { + compatible =3D "pci-host-ecam-generic"; + reg =3D <0x0 0x4cb00000 0x0 0x100000>; + #address-cells =3D <3>; + #size-cells =3D <2>; + device_type =3D "pci"; + bus-range =3D <0x1 0x1>; + ranges =3D <0x82000000 0x0 0x4cce0000 0x0 0x4cce0000 0x0= 0x20000 + 0xc2000000 0x0 0x4cd10000 0x0 0x4cd10000 0x0 0= x10000>; + + mdio@0,0 { + compatible =3D "pci1131,ee00"; + reg =3D <0x010000 0 0 0 0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + }; + }; + }; + }; --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2079.outbound.protection.outlook.com [40.107.249.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D03DA1C07DF; Tue, 15 Oct 2024 13:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998049; cv=fail; b=UNMtBbySQxjXh1AGlkmWZc7ViE0Ouik1xXzCcyyE4r7DSdPxara+NFMVwm8Q8qREO5SaHA+nesTGYJuRVb9Wzj1k58AMQvFn92XPpaWK94dTMmpBEMAwhi+vodvRnXyT05oDeGIqn+AzTHKW5hxXh6CBVD6DC1yOqk/NESFsVa8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998049; c=relaxed/simple; bh=nMNstx8N/DHc34wc/epr1BcfPX/BDc+MTGNUyWSpM4U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=qf3aJyeTjJGO9dnyQcItPjHTKWbNNSj717v3V9H7ExA2LI9T88uMpd9SsNvqcfoi/wdeZWmFwLgFhC4XpfkRYk01zHCZx6em7hfUSryCGyfxLwUBm1bpmP3nPSRHnCmU1d9vQgJAw14tYqPUxIec/z1gaAa9sFnTq4F2q2hIuJo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=EvT2s/Sy; arc=fail smtp.client-ip=40.107.249.79 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="EvT2s/Sy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nwrSnjMOBK6fgwjTs+Tg5ehCydM/RKWUp0sI/7SW1zYHFyoJWkerJxb8uUqB89oMgk7n9GduZ+4VOd2KNSZmUCmEW7brmDeAl5pIij/S0g6fCMqF+BhK5khY2a84TlXg54s3Hl2fm2wGNbXVo29ZyF65ZdGjHFiaHQLdYXmzOyMtE7qWZn0kurVsFGpS8hwkJ8/UJN3Hoey4Ha2llQeJw7HMZtNqyA7bSZZYtWkhIdhdMPXJ5WUApPhtPSqNTZocGLt43hpqau8Mq0f6tNz2qeVA+oPIikgz7TPlRbwO+z37zqhCUlyvG41OUG1Ts73altVHe77If/B6YjSyRgMG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=et3/3713zFU3WJwXkhw0hKja9HoPGKS9rMBOmB0bplM=; b=mHrnjjDyQRaRASRubm0KRWb+jUybVm3ZVZjMsjkKUzwaFi6VkUCf6LAtAAw7tlgTcsneedRYyn5talYQ76Lcaw49d6aMCJ6bi4k4tbsYdoOCS2nX8h/JH5JxWWY98T7TCakCqB4gYH5Wr+Jl11/Q0MDFnmuVCZkv+M2cPRCtlbvPVcK2lGiJvs5kvxT2EWU+Uf9P5svAJHQXm7mBvKCzCPJrtitW9zAcB8HFdbipghXufTsCtuxt60/hNEPWuPgFYGijGZkC3hvRlN7z7l6dNRNPzNWkAq2IeZByPuN5kG/Xa9DEtUGWo5Q1RakKmOcLi5bKY0JGtMzdFm8wD7kK4g== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=et3/3713zFU3WJwXkhw0hKja9HoPGKS9rMBOmB0bplM=; b=EvT2s/SylMZjvJslrkxrEXVpPwVyqgHcKj/2wgF9y3+D8HvI5Tf5p6FygSq+DSKJJ6ILwQTCMW7zrjcOXywfUPFrdkRwHI/Gv5st8yeY2Jcy0c+hXY/CNTPeNSYCVm9n4TbfLTeq48FPmiBpzrho/CZmQsKl4PkEhxRYq3BJhx/IG+SPEq0W789+rgLu1rUo6d7jEhS1NfODlMAyAPl3hG5WmTY3MwBVnMus5Lp3jEI+PMR9cmLv0YdM7I/A6t5oZdzGcq9f/9sKnKg1dMXzrQs5DW30YZlsRagmq1BmvMlxLBJgcBENyzl2hoDB/LgbgvBCgumaX5IAPVRVgo6BfQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:14:02 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:13:56 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 04/13] net: enetc: add initial netc-blk-ctrl driver support Date: Tue, 15 Oct 2024 20:58:32 +0800 Message-Id: <20241015125841.1075560-5-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: 648e28ae-aaac-4ed1-1bfe-08dced1b3911 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FTUUW2F+KqBX+D/sTkVaUnljLppPidMWfbxwoNY6qdvQL00EnDGAn8+i69WM?= =?us-ascii?Q?OnunbS/tf0WDo4qalxd9Bw+Kmyh/rFWszrm3o6iXpU8ZLHpQH+O3Hey7aQyK?= =?us-ascii?Q?cxLqs1WRUMmJkZCtn/oNM4wVbOQo+7kUss65DcKWiB870aGih24Heo4PNbnh?= =?us-ascii?Q?Ft5gAON/8mZpSUnKldbWX6V19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q?ystxHbRCJxf0nXIEdLCNHreivI5cjgIDO41pnxIhTJ8Zwjh82QFe4+YrSizS?= =?us-ascii?Q?RnCVKVDcuVoR4cENlFE2tS13xkJp9FCz545F03GpE+PtGB2cpxMD9YeGGuDF?= =?us-ascii?Q?45HTvVJ340k1uRPmFCuq03h8cdoih1gVjqwMuoPIxjvYYMFnCToRKzVp/38S?= =?us-ascii?Q?OxQtc/VqoJdMir6cZGlS6TrVrB7GecyvZ2HwHa529jDqLRgJ38xXmN0GKzIb?= =?us-ascii?Q?JbRg9RxkdRSLXbw+/10I/85yV5KiNwdisxpK9/zfVzBeAGLA8CWvl4x6MG6W?= =?us-ascii?Q?7sQ0e4g=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WIckJxLTV4MCmPDkJMPDxpxFAQ08DpPKuysB7m4eAN3LFR03iuH3kVr57jw+?= =?us-ascii?Q?savJw3JvK6G8fgDuBivazAUvvNyIMWRtgP/8z7v7oemY5YeUqMgBZBN3nOJD?= =?us-ascii?Q?+uSV0lTLgxtYaAaLFORhDVWYotmfcgHf3tPqcU2kaNyXQUpR3PEUP6dFBfQO?= =?us-ascii?Q?67gCgHmJDLDYRH6Upididk4K7/RjJGpb9MGnoNnwKdk8VpmDiMmfUCvUD0gk?= =?us-ascii?Q?gvc+aQaxxE4K9UqO/QS8SJtu+xLTp8ZpvswK/yEhVIfgDh1zvZ5ozuosGnYe?= =?us-ascii?Q?YagyvMwMXvKcBo8lFAl5255pzd8NYKk7DYP9oxcFsxwY5ErJ/WTBWGZfzKJG?= =?us-ascii?Q?IeDzaTciZ2N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=?us-ascii?Q?ZqsSZALhzRrYzpiJny7puqKirZxm9TcaOuUby/F3haFeUTiht7hoNoF+L7sp?= =?us-ascii?Q?uJhrFGSBiMbAAzJ2w58+8ttk0XrbnNr9uTVs+9/rUXqxVLKhhvWQJaVGew40?= =?us-ascii?Q?9S0OBIlVhVmLJL0qT2Ojs+mQtJ0549zktcKuckRuSLxhVumTQ2GH2EdG6XSq?= =?us-ascii?Q?zGO/z8w5jSj/VA0j+SjT9/3N4EMItsC7Crz6KwPayyKrrfVtPyAjTpPIBHi6?= =?us-ascii?Q?4cmwSF1SHKtSwWRK+MPUdr9jRakGZYe4xuLpta0/jGuf2A5myw5rny3MbjE4?= =?us-ascii?Q?qWATPjQ4vHbmyQsymr5qNd6SWiKSsOL1aeG5pdnP?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 648e28ae-aaac-4ed1-1bfe-08dced1b3911 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:13:55.9648 (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: gGrFs0CEF9fIlVzq+4xzCmaBbg5ZZg5xYZFoO54LdwPgtBDu1W8GBjgxtOpAZtVPOAaxxMR0bCuGKLM4HoJNKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" The netc-blk-ctrl driver is used to configure Integrated Endpoint Register Block (IERB) and Privileged Register Block (PRB) of NETC. For i.MX platforms, it is also used to configure the NETCMIX block. The IERB contains registers that are used for pre-boot initialization, debug, and non-customer configuration. The PRB controls global reset and global error handling for NETC. The NETCMIX block is mainly used to set MII protocol and PCS protocol of the links, it also contains settings for some other functions. Note the IERB configuration registers can only be written after being unlocked by PRB, otherwise, all write operations are inhibited. A warm reset is performed when the IERB is unlocked, and it results in an FLR to all NETC devices. Therefore, all NETC device drivers must be probed or initialized after the warm reset is finished. Signed-off-by: Wei Fang --- v2 changes: 1. Add linux/bits.h 2. Remove the useless check at the beginning of netc_blk_ctrl_probe(). 3. Use dev_err_probe() in netc_blk_ctrl_probe(). --- drivers/net/ethernet/freescale/enetc/Kconfig | 14 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + .../ethernet/freescale/enetc/netc_blk_ctrl.c | 472 ++++++++++++++++++ include/linux/fsl/netc_global.h | 39 ++ 4 files changed, 528 insertions(+) create mode 100644 drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c create mode 100644 include/linux/fsl/netc_global.h diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/eth= ernet/freescale/enetc/Kconfig index 4d75e6807e92..51d80ea959d4 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -75,3 +75,17 @@ config FSL_ENETC_QOS enable/disable from user space via Qos commands(tc). In the kernel side, it can be loaded by Qos driver. Currently, it is only support taprio(802.1Qbv) and Credit Based Shaper(802.1Qbu). + +config NXP_NETC_BLK_CTRL + tristate "NETC blocks control driver" + help + This driver configures Integrated Endpoint Register Block (IERB) and + Privileged Register Block (PRB) of NETC. For i.MX platforms, it also + includes the configuration of NETCMIX block. + The IERB contains registers that are used for pre-boot initialization, + debug, and non-customer configuration. The PRB controls global reset + and global error handling for NETC. The NETCMIX block is mainly used + to set MII protocol and PCS protocol of the links, it also contains + settings for some other functions. + + If compiled as module (M), the module name is nxp-netc-blk-ctrl. diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/et= hernet/freescale/enetc/Makefile index b13cbbabb2ea..5c277910d538 100644 --- a/drivers/net/ethernet/freescale/enetc/Makefile +++ b/drivers/net/ethernet/freescale/enetc/Makefile @@ -19,3 +19,6 @@ fsl-enetc-mdio-y :=3D enetc_pci_mdio.o enetc_mdio.o =20 obj-$(CONFIG_FSL_ENETC_PTP_CLOCK) +=3D fsl-enetc-ptp.o fsl-enetc-ptp-y :=3D enetc_ptp.o + +obj-$(CONFIG_NXP_NETC_BLK_CTRL) +=3D nxp-netc-blk-ctrl.o +nxp-netc-blk-ctrl-y :=3D netc_blk_ctrl.o \ No newline at end of file diff --git a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c b/drivers= /net/ethernet/freescale/enetc/netc_blk_ctrl.c new file mode 100644 index 000000000000..62c912aeeb5d --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c @@ -0,0 +1,472 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * NXP NETC Blocks Control Driver + * + * Copyright 2024 NXP + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* NETCMIX registers */ +#define IMX95_CFG_LINK_IO_VAR 0x0 +#define IO_VAR_16FF_16G_SERDES 0x1 +#define IO_VAR(port, var) (((var) & 0xf) << ((port) << 2)) + +#define IMX95_CFG_LINK_MII_PROT 0x4 +#define CFG_LINK_MII_PORT_0 GENMASK(3, 0) +#define CFG_LINK_MII_PORT_1 GENMASK(7, 4) +#define MII_PROT_MII 0x0 +#define MII_PROT_RMII 0x1 +#define MII_PROT_RGMII 0x2 +#define MII_PROT_SERIAL 0x3 +#define MII_PROT(port, prot) (((prot) & 0xf) << ((port) << 2)) + +#define IMX95_CFG_LINK_PCS_PROT(a) (0x8 + (a) * 4) +#define PCS_PROT_1G_SGMII BIT(0) +#define PCS_PROT_2500M_SGMII BIT(1) +#define PCS_PROT_XFI BIT(3) +#define PCS_PROT_SFI BIT(4) +#define PCS_PROT_10G_SXGMII BIT(6) + +/* NETC privileged register block register */ +#define PRB_NETCRR 0x100 +#define NETCRR_SR BIT(0) +#define NETCRR_LOCK BIT(1) + +#define PRB_NETCSR 0x104 +#define NETCSR_ERROR BIT(0) +#define NETCSR_STATE BIT(1) + +/* NETC integrated endpoint register block register */ +#define IERB_EMDIOFAUXR 0x344 +#define IERB_T0FAUXR 0x444 +#define IERB_EFAUXR(a) (0x3044 + 0x100 * (a)) +#define IERB_VFAUXR(a) (0x4004 + 0x40 * (a)) +#define FAUXR_LDID GENMASK(3, 0) + +/* Platform information */ +#define IMX95_ENETC0_BUS_DEVFN 0x0 +#define IMX95_ENETC1_BUS_DEVFN 0x40 +#define IMX95_ENETC2_BUS_DEVFN 0x80 + +/* Flags for different platforms */ +#define NETC_HAS_NETCMIX BIT(0) + +struct netc_devinfo { + u32 flags; + int (*netcmix_init)(struct platform_device *pdev); + int (*ierb_init)(struct platform_device *pdev); +}; + +struct netc_blk_ctrl { + void __iomem *prb; + void __iomem *ierb; + void __iomem *netcmix; + struct clk *ipg_clk; + + const struct netc_devinfo *devinfo; + struct platform_device *pdev; + struct dentry *debugfs_root; +}; + +static void netc_reg_write(void __iomem *base, u32 offset, u32 val) +{ + netc_write(base + offset, val); +} + +static u32 netc_reg_read(void __iomem *base, u32 offset) +{ + return netc_read(base + offset); +} + +static int netc_of_pci_get_bus_devfn(struct device_node *np) +{ + u32 reg[5]; + int error; + + error =3D of_property_read_u32_array(np, "reg", reg, ARRAY_SIZE(reg)); + if (error) + return error; + + return (reg[0] >> 8) & 0xffff; +} + +static int netc_get_link_mii_protocol(phy_interface_t interface) +{ + switch (interface) { + case PHY_INTERFACE_MODE_MII: + return MII_PROT_MII; + case PHY_INTERFACE_MODE_RMII: + return MII_PROT_RMII; + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + return MII_PROT_RGMII; + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_2500BASEX: + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_USXGMII: + return MII_PROT_SERIAL; + default: + return -EINVAL; + } +} + +static int imx95_netcmix_init(struct platform_device *pdev) +{ + struct netc_blk_ctrl *priv =3D platform_get_drvdata(pdev); + struct device_node *np =3D pdev->dev.of_node; + phy_interface_t interface; + int bus_devfn, mii_proto; + u32 val; + int err; + + /* Default setting of MII protocol */ + val =3D MII_PROT(0, MII_PROT_RGMII) | MII_PROT(1, MII_PROT_RGMII) | + MII_PROT(2, MII_PROT_SERIAL); + + /* Update the link MII protocol through parsing phy-mode */ + for_each_available_child_of_node_scoped(np, child) { + for_each_available_child_of_node_scoped(child, gchild) { + if (!of_device_is_compatible(gchild, "nxp,imx95-enetc")) + continue; + + bus_devfn =3D netc_of_pci_get_bus_devfn(gchild); + if (bus_devfn < 0) + return -EINVAL; + + if (bus_devfn =3D=3D IMX95_ENETC2_BUS_DEVFN) + continue; + + err =3D of_get_phy_mode(gchild, &interface); + if (err) + continue; + + mii_proto =3D netc_get_link_mii_protocol(interface); + if (mii_proto < 0) + return -EINVAL; + + switch (bus_devfn) { + case IMX95_ENETC0_BUS_DEVFN: + val =3D u32_replace_bits(val, mii_proto, + CFG_LINK_MII_PORT_0); + break; + case IMX95_ENETC1_BUS_DEVFN: + val =3D u32_replace_bits(val, mii_proto, + CFG_LINK_MII_PORT_1); + break; + default: + return -EINVAL; + } + } + } + + /* Configure Link I/O variant */ + netc_reg_write(priv->netcmix, IMX95_CFG_LINK_IO_VAR, + IO_VAR(2, IO_VAR_16FF_16G_SERDES)); + /* Configure Link 2 PCS protocol */ + netc_reg_write(priv->netcmix, IMX95_CFG_LINK_PCS_PROT(2), + PCS_PROT_10G_SXGMII); + netc_reg_write(priv->netcmix, IMX95_CFG_LINK_MII_PROT, val); + + return 0; +} + +static bool netc_ierb_is_locked(struct netc_blk_ctrl *priv) +{ + return !!(netc_reg_read(priv->prb, PRB_NETCRR) & NETCRR_LOCK); +} + +static int netc_lock_ierb(struct netc_blk_ctrl *priv) +{ + u32 val; + + netc_reg_write(priv->prb, PRB_NETCRR, NETCRR_LOCK); + + return read_poll_timeout(netc_reg_read, val, !(val & NETCSR_STATE), + 100, 2000, false, priv->prb, PRB_NETCSR); +} + +static int netc_unlock_ierb_with_warm_reset(struct netc_blk_ctrl *priv) +{ + u32 val; + + netc_reg_write(priv->prb, PRB_NETCRR, 0); + + return read_poll_timeout(netc_reg_read, val, !(val & NETCRR_LOCK), + 1000, 100000, true, priv->prb, PRB_NETCRR); +} + +static int imx95_ierb_init(struct platform_device *pdev) +{ + struct netc_blk_ctrl *priv =3D platform_get_drvdata(pdev); + + /* EMDIO : No MSI-X intterupt */ + netc_reg_write(priv->ierb, IERB_EMDIOFAUXR, 0); + /* ENETC0 PF */ + netc_reg_write(priv->ierb, IERB_EFAUXR(0), 0); + /* ENETC0 VF0 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(0), 1); + /* ENETC0 VF1 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(1), 2); + /* ENETC1 PF */ + netc_reg_write(priv->ierb, IERB_EFAUXR(1), 3); + /* ENETC1 VF0 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(2), 5); + /* ENETC1 VF1 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(3), 6); + /* ENETC2 PF */ + netc_reg_write(priv->ierb, IERB_EFAUXR(2), 4); + /* ENETC2 VF0 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(4), 5); + /* ENETC2 VF1 */ + netc_reg_write(priv->ierb, IERB_VFAUXR(5), 6); + /* NETC TIMER */ + netc_reg_write(priv->ierb, IERB_T0FAUXR, 7); + + return 0; +} + +static int netc_ierb_init(struct platform_device *pdev) +{ + struct netc_blk_ctrl *priv =3D platform_get_drvdata(pdev); + const struct netc_devinfo *devinfo =3D priv->devinfo; + int err; + + if (netc_ierb_is_locked(priv)) { + err =3D netc_unlock_ierb_with_warm_reset(priv); + if (err) { + dev_err(&pdev->dev, "Unlock IERB failed.\n"); + return err; + } + } + + if (devinfo->ierb_init) { + err =3D devinfo->ierb_init(pdev); + if (err) + return err; + } + + err =3D netc_lock_ierb(priv); + if (err) { + dev_err(&pdev->dev, "Lock IERB failed.\n"); + return err; + } + + return 0; +} + +#if IS_ENABLED(CONFIG_DEBUG_FS) +static int netc_prb_show(struct seq_file *s, void *data) +{ + struct netc_blk_ctrl *priv =3D s->private; + u32 val; + + val =3D netc_reg_read(priv->prb, PRB_NETCRR); + seq_printf(s, "[PRB NETCRR] Lock:%d SR:%d\n", + (val & NETCRR_LOCK) ? 1 : 0, + (val & NETCRR_SR) ? 1 : 0); + + val =3D netc_reg_read(priv->prb, PRB_NETCSR); + seq_printf(s, "[PRB NETCSR] State:%d Error:%d\n", + (val & NETCSR_STATE) ? 1 : 0, + (val & NETCSR_ERROR) ? 1 : 0); + + return 0; +} +DEFINE_SHOW_ATTRIBUTE(netc_prb); + +static void netc_blk_ctrl_create_debugfs(struct netc_blk_ctrl *priv) +{ + struct dentry *root; + + root =3D debugfs_create_dir("netc_blk_ctrl", NULL); + if (IS_ERR(root)) + return; + + priv->debugfs_root =3D root; + + debugfs_create_file("prb", 0444, root, priv, &netc_prb_fops); +} + +static void netc_blk_ctrl_remove_debugfs(struct netc_blk_ctrl *priv) +{ + debugfs_remove_recursive(priv->debugfs_root); + priv->debugfs_root =3D NULL; +} + +#else + +static void netc_blk_ctrl_create_debugfs(struct netc_blk_ctrl *priv) +{ +} + +static void netc_blk_ctrl_remove_debugfs(struct netc_blk_ctrl *priv) +{ +} +#endif + +static int netc_prb_check_error(struct netc_blk_ctrl *priv) +{ + u32 val; + + val =3D netc_reg_read(priv->prb, PRB_NETCSR); + if (val & NETCSR_ERROR) + return -1; + + return 0; +} + +static const struct netc_devinfo imx95_devinfo =3D { + .flags =3D NETC_HAS_NETCMIX, + .netcmix_init =3D imx95_netcmix_init, + .ierb_init =3D imx95_ierb_init, +}; + +static const struct of_device_id netc_blk_ctrl_match[] =3D { + { .compatible =3D "nxp,imx95-netc-blk-ctrl", .data =3D &imx95_devinfo }, + {}, +}; +MODULE_DEVICE_TABLE(of, netc_blk_ctrl_match); + +static int netc_blk_ctrl_probe(struct platform_device *pdev) +{ + struct device_node *node =3D pdev->dev.of_node; + const struct netc_devinfo *devinfo; + struct device *dev =3D &pdev->dev; + const struct of_device_id *id; + struct netc_blk_ctrl *priv; + void __iomem *regs; + int err; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->pdev =3D pdev; + priv->ipg_clk =3D devm_clk_get_optional(dev, "ipg_clk"); + if (IS_ERR(priv->ipg_clk)) { + err =3D PTR_ERR(priv->ipg_clk); + dev_err_probe(dev, err, "Get ipg_clk failed\n"); + return err; + } + + err =3D clk_prepare_enable(priv->ipg_clk); + if (err) { + dev_err_probe(dev, err, "Enable ipg_clk failed\n"); + goto disable_ipg_clk; + } + + id =3D of_match_device(netc_blk_ctrl_match, dev); + if (!id) { + err =3D -EINVAL; + dev_err_probe(dev, err, "Cannot match device\n"); + goto disable_ipg_clk; + } + + devinfo =3D (struct netc_devinfo *)id->data; + if (!devinfo) { + err =3D -EINVAL; + dev_err_probe(dev, err, "No device information\n"); + goto disable_ipg_clk; + } + priv->devinfo =3D devinfo; + + regs =3D devm_platform_ioremap_resource_byname(pdev, "ierb"); + if (IS_ERR(regs)) { + err =3D PTR_ERR(regs); + dev_err_probe(dev, err, "Missing IERB resource\n"); + goto disable_ipg_clk; + } + priv->ierb =3D regs; + + regs =3D devm_platform_ioremap_resource_byname(pdev, "prb"); + if (IS_ERR(regs)) { + err =3D PTR_ERR(regs); + dev_err_probe(dev, err, "Missing PRB resource\n"); + goto disable_ipg_clk; + } + priv->prb =3D regs; + + if (devinfo->flags & NETC_HAS_NETCMIX) { + regs =3D devm_platform_ioremap_resource_byname(pdev, "netcmix"); + if (IS_ERR(regs)) { + err =3D PTR_ERR(regs); + dev_err_probe(dev, err, "Missing NETCMIX resource\n"); + goto disable_ipg_clk; + } + priv->netcmix =3D regs; + } + + platform_set_drvdata(pdev, priv); + + if (devinfo->netcmix_init) { + err =3D devinfo->netcmix_init(pdev); + if (err) { + dev_err_probe(dev, err, "Initializing NETCMIX failed\n"); + goto disable_ipg_clk; + } + } + + err =3D netc_ierb_init(pdev); + if (err) { + dev_err_probe(dev, err, "Initializing IERB failed\n"); + goto disable_ipg_clk; + } + + if (netc_prb_check_error(priv) < 0) + dev_warn(dev, "The current IERB configuration is invalid\n"); + + netc_blk_ctrl_create_debugfs(priv); + + err =3D of_platform_populate(node, NULL, NULL, dev); + if (err) { + dev_err_probe(dev, err, "of_platform_populate failed\n"); + goto remove_debugfs; + } + + return 0; + +remove_debugfs: + netc_blk_ctrl_remove_debugfs(priv); +disable_ipg_clk: + clk_disable_unprepare(priv->ipg_clk); + + return err; +} + +static void netc_blk_ctrl_remove(struct platform_device *pdev) +{ + struct netc_blk_ctrl *priv =3D platform_get_drvdata(pdev); + + of_platform_depopulate(&pdev->dev); + netc_blk_ctrl_remove_debugfs(priv); + clk_disable_unprepare(priv->ipg_clk); +} + +static struct platform_driver netc_blk_ctrl_driver =3D { + .driver =3D { + .name =3D "nxp-netc-blk-ctrl", + .of_match_table =3D netc_blk_ctrl_match, + }, + .probe =3D netc_blk_ctrl_probe, + .remove =3D netc_blk_ctrl_remove, +}; + +module_platform_driver(netc_blk_ctrl_driver); + +MODULE_DESCRIPTION("NXP NETC Blocks Control Driver"); +MODULE_LICENSE("Dual BSD/GPL"); diff --git a/include/linux/fsl/netc_global.h b/include/linux/fsl/netc_globa= l.h new file mode 100644 index 000000000000..f26b1b6f8813 --- /dev/null +++ b/include/linux/fsl/netc_global.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* Copyright 2024 NXP + */ +#ifndef __NETC_GLOBAL_H +#define __NETC_GLOBAL_H + +#include + +static inline u32 netc_read(void __iomem *reg) +{ + return ioread32(reg); +} + +#ifdef ioread64 +static inline u64 netc_read64(void __iomem *reg) +{ + return ioread64(reg); +} +#else +static inline u64 netc_read64(void __iomem *reg) +{ + u32 low, high; + u64 val; + + low =3D ioread32(reg); + high =3D ioread32(reg + 4); + + val =3D (u64)high << 32 | low; + + return val; +} +#endif + +static inline void netc_write(void __iomem *reg, u32 val) +{ + iowrite32(val, reg); +} + +#endif --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2045.outbound.protection.outlook.com [40.107.22.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAC172281D8; Tue, 15 Oct 2024 13:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998056; cv=fail; b=hgZfxKY33x5+X1HqFtra3cwEy2e+dj6nejs1g0M5eufZm24JtePr9dD/9r8BWyd8V3iG4LH8WM/lHxSD/DTeD373KyxC69vP+FEFMAWA0e+99pizoiEHQE+u0L4o1fvXyXBAUBC3US253KaZA/ywJwNDzaCor3anFzl5vr1yU84= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998056; c=relaxed/simple; bh=rmBKb/g1LIxBAei6hcbiymqGc9ncmmzjPEbBmArZjK4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LtOeCUMhMAChTPGReOgu1zgIcVbS/xKOonlf3JCzNaO3WXmR27WKuciRJ1OYaRITJIFP2y7M2GpUE7mG+qqxluztaFrP8pfL1i+YhXoFuUr3suuEZdIiCnSjnKkGB64C38yg4X8jhGTMKDuWaoSpbGS0gElhIkDbMLXNsm9f78E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Dj4glOPU; arc=fail smtp.client-ip=40.107.22.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Dj4glOPU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n3EI/AIcGK3YHG5lB2CxcFhCD210cCFxL/xTzrHKPV6cHwv5rzz9UHuwNreu2uJ/mfwS2ZJ2fz/9Ma0ItLdDM9FdrUdBcOE0Lkl0RG/h0qvs9JSRvOTZEBeaRPWqTKdkLtXZ3lMxLyt/0d2Y3P3Ql7crqNzg1zbYWiXEGqSSvje9BCRQ/7o4oZMwYBDX/jxNPuszUHwMgIqcRvicq0TKjtw6FVsczx9OGftSD15eLPZkV0+pDpwKWEaoqQbxHK91/TKCA/K3Zeh1R1oqjMGncsfnaI708EJiBg6/6YDNrfqff0TfIXJd0NYd23XzU4ZsmYjx6HY6FYBDOH/yh4B1vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=hRhAdL9GW3rTCSOeBdOXsogL4MAIz5gKonT1u4/rBUo=; b=qGnRwCY/VOjt8BQgqQimmR0ilZVRYLjVgYo6M2kKkL0JsA//sTx5ewCtgq1CgQCM6YgdnfN/gPms0b+QtjJACWcjvkXoOCE/M+/pVk/GRMPa7Mnxajg8xH7rpbWMZXUtzgXMmCy0nQo+0n5lAjdXiS7ozAZGtKbp7+janh1gqk/fw1vdI6TTRvBYHnYLjLdeLVZwAiKnXVr5Fgu+XTxqjsFfQTW1UNT8AHENm6XahLVZNBrZYplhqiLP9Gvxq1yC0cLZniZ2nhTXCOxP/XGTOPsMAlis5StpHOzRZhFmp6XZ+ywB8pv3Hf0Hhpm56vEC02go/g/cgL2OLBVRPyVBCw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hRhAdL9GW3rTCSOeBdOXsogL4MAIz5gKonT1u4/rBUo=; b=Dj4glOPUrdJny4NCXCgeHrnXp1p727CbV4+xd2/dQcVvVDhzstFADWBswxEGe5fIeixoqwol5Fx7Fade83qHMclVubnDmDiInb1BuxEUcxZfC6dPMnFHK+DP8buGBfHnItd0pPMB+/A00mS6PS6anwwU/heQ0jTiSW/NMTUY/vzRxjeXziWcGW8j+zaKOCVxJxJQp+EfK2eQRWQ2SdnZp3JM7GAlaJT2UUQ5mT9aff8VTxlTBy7qz+zyff+mbYoMAfdi4YZ9kAiTSRJTcHOnZgseO2R//mzki7oJLUe4P3vg2jRF6aIlXehhAyZxWWq7uDRzRrE6fXrdJ6aH86OVMQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:14:03 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:03 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 05/13] net: enetc: move some common interfaces to enetc_pf_common.c Date: Tue, 15 Oct 2024 20:58:33 +0800 Message-Id: <20241015125841.1075560-6-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e164b46-a21c-4652-2064-08dced1b3c6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?zx8rAnbkbli3X08W1NB3lbBX8R2xL7+ZDdaPLaN8QC2lCRLH+2tulmsD0y25?= =?us-ascii?Q?rI1KxRn1dh4999tqorX5pg2/MHSLDf7NHG9aMhqsMSmqNMJv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XxnVGl70lpEa/XAu79nvUy1ZqyiG2HxIJcJ4Ot3pYj0P1NEad1sFi?= =?us-ascii?Q?tdC0QlVGCWJ37VscmzxAS2OQxgtxfeumTs28vq5FlC2XSooJ6/xJxhbICny6?= =?us-ascii?Q?YYcu+Mi5AmiLvibizSdcF0Zj01lK3z1B0nQXykBJITTDdKwNEHvwB6oeDSv1?= =?us-ascii?Q?vxyMURokcKZCWDYeVXKT4IUrJjs9Fl5//N1F5OowVNXbjapDInWaAEGgGSeD?= =?us-ascii?Q?thNm2mbF2s3zVi5wz4e4AfCELBg2y15WNQJj9En+oXpPkjX+dU0V4LHc/EpC?= =?us-ascii?Q?b1HcxDgG6E6iGQK2xBo5YbQ2AX9r+pje/poqh652RfiMQihXACMSJSFksSDw?= =?us-ascii?Q?VVu3Z+HuEXij7KobxqKxa+GNBR0JQE5sI/Q2nuvlalPaWwCjfvudI/RZg3sp?= =?us-ascii?Q?9AukTkQ=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?V+vMtzwuIKgiiXNbTGrFTLLMhNNLZNsdx4BpaWVc6bMxmkANDG7S68gvWK3L?= =?us-ascii?Q?sXl4GdBveiqxhB2UcYRp99sg/Zolt7tBJVk/sPDdwfvU//l2pwJ9PyLc+Sve?= =?us-ascii?Q?vTIufj2tSgsbLfJrLkDIS9STYoIyxY05zKxZhVp1/UGU5ktHhMAKxLO3Sl8P?= =?us-ascii?Q?dr7s7eZB/j0GIKtdCd0+1tkopNxd8fnZoo7Z4V662fcemCYjClUU8C7hJd0t?= =?us-ascii?Q?BU+Gr92cL8ee9nZHC6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fq?= =?us-ascii?Q?sgpIjpntxiwmr41sbvRDy2CZVnY91vyOAWJrtehynOhzlAIHQe/p2gB2zUSn?= =?us-ascii?Q?OopNgDCB1EKO4qQiEUvM+gxLS2IJYMqY2vN+F0OK+T9D6H4OtFfM5pV5BkQX?= =?us-ascii?Q?eL7f6h2870VlSJOWB85rXQUgbIB0jDxTr4i2nCC/cXkgNcD+tGMi7tDagsqW?= =?us-ascii?Q?xKJBsyoCdv86fFkg5btrNUU77OcUK6IzCLK+ki/JqJ4u6ugEQDuEyxF9WZD+?= =?us-ascii?Q?GpQRbcrwAwKiKeWIN1dslgj59sKRjECPOZPcepOvXapuEraBdSy9khXIPWGT?= =?us-ascii?Q?mwxVm+d5lr4hItzrbbR7ysif+a6khD3pZrGHHX06Oa0OLM/ZIDe8bapNM/US?= =?us-ascii?Q?g+jzdNUlDPGYW+vx8Xc2DGnQSe9JJYvbHxgQU7p96ghPunPP9VLt83i+ZqJg?= =?us-ascii?Q?hwR9xqd1iaH+ScCwMh17utt2g3/SD6lmee14LLaD?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e164b46-a21c-4652-2064-08dced1b3c6b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:01.6171 (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: hb3F/DkhTvH1djWcf67woI4F4WhyOUA6sqcn4TimOA/1SSzrd4ns22P5VlMokMvWO0LlvqNEJjFjl+K9nCYoug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" The ENETC of LS1028A is revision 1.0. Now, ENETC is used on the i.MX95 platform and the revision is upgraded to version 4.1. The two versions are incompatible except for the station interface (SI) part. Therefore, A new driver is needed for ENETC revision 4.1 and later. However, the logic of some interfaces of the two drivers is basically the same, and the only difference is the hardware configuration. In order to reuse these interfaces and reduce code redundancy, so extract the interfaces from enetc_pf.c and move them to enetc_pf_common.c. This is just the first step, later enetc_pf_common.c will be compiled into a separate driver for use by both PF drivers. Signed-off-by: Wei Fang --- v2 changes: This patch is separated from v1 patch 5 ("net: enetc: add enetc-pf-common driver support"), it just moved some common functions from enetc_pf.c to enetc_pf_common.c. --- drivers/net/ethernet/freescale/enetc/Makefile | 2 +- .../net/ethernet/freescale/enetc/enetc_pf.c | 297 +----------------- .../net/ethernet/freescale/enetc/enetc_pf.h | 13 + .../freescale/enetc/enetc_pf_common.c | 294 +++++++++++++++++ 4 files changed, 312 insertions(+), 294 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_pf_common.c diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/et= hernet/freescale/enetc/Makefile index 5c277910d538..39675e9ff39d 100644 --- a/drivers/net/ethernet/freescale/enetc/Makefile +++ b/drivers/net/ethernet/freescale/enetc/Makefile @@ -4,7 +4,7 @@ obj-$(CONFIG_FSL_ENETC_CORE) +=3D fsl-enetc-core.o fsl-enetc-core-y :=3D enetc.o enetc_cbdr.o enetc_ethtool.o =20 obj-$(CONFIG_FSL_ENETC) +=3D fsl-enetc.o -fsl-enetc-y :=3D enetc_pf.o +fsl-enetc-y :=3D enetc_pf.o enetc_pf_common.o fsl-enetc-$(CONFIG_PCI_IOV) +=3D enetc_msg.o fsl-enetc-$(CONFIG_FSL_ENETC_QOS) +=3D enetc_qos.o =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/= ethernet/freescale/enetc/enetc_pf.c index 8f6b0bf48139..3cdd149056f9 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -2,11 +2,8 @@ /* Copyright 2017-2019 NXP */ =20 #include -#include #include -#include #include -#include #include #include #include "enetc_ierb.h" @@ -14,7 +11,7 @@ =20 #define ENETC_DRV_NAME_STR "ENETC PF driver" =20 -static void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 = *addr) +void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 *addr) { u32 upper =3D __raw_readl(hw->port + ENETC_PSIPMAR0(si)); u16 lower =3D __raw_readw(hw->port + ENETC_PSIPMAR1(si)); @@ -23,8 +20,8 @@ static void enetc_pf_get_primary_mac_addr(struct enetc_hw= *hw, int si, u8 *addr) put_unaligned_le16(lower, addr + 4); } =20 -static void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, - const u8 *addr) +void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, + const u8 *addr) { u32 upper =3D get_unaligned_le32(addr); u16 lower =3D get_unaligned_le16(addr + 4); @@ -33,20 +30,6 @@ static void enetc_pf_set_primary_mac_addr(struct enetc_h= w *hw, int si, __raw_writew(lower, hw->port + ENETC_PSIPMAR1(si)); } =20 -static int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr) -{ - struct enetc_ndev_priv *priv =3D netdev_priv(ndev); - struct sockaddr *saddr =3D addr; - - if (!is_valid_ether_addr(saddr->sa_data)) - return -EADDRNOTAVAIL; - - eth_hw_addr_set(ndev, saddr->sa_data); - enetc_pf_set_primary_mac_addr(&priv->si->hw, 0, saddr->sa_data); - - return 0; -} - static void enetc_set_vlan_promisc(struct enetc_hw *hw, char si_map) { u32 val =3D enetc_port_rd(hw, ENETC_PSIPVMR); @@ -393,56 +376,6 @@ static int enetc_pf_set_vf_spoofchk(struct net_device = *ndev, int vf, bool en) return 0; } =20 -static int enetc_setup_mac_address(struct device_node *np, struct enetc_pf= *pf, - int si) -{ - struct device *dev =3D &pf->si->pdev->dev; - struct enetc_hw *hw =3D &pf->si->hw; - u8 mac_addr[ETH_ALEN] =3D { 0 }; - int err; - - /* (1) try to get the MAC address from the device tree */ - if (np) { - err =3D of_get_mac_address(np, mac_addr); - if (err =3D=3D -EPROBE_DEFER) - return err; - } - - /* (2) bootloader supplied MAC address */ - if (is_zero_ether_addr(mac_addr)) - enetc_pf_get_primary_mac_addr(hw, si, mac_addr); - - /* (3) choose a random one */ - if (is_zero_ether_addr(mac_addr)) { - eth_random_addr(mac_addr); - dev_info(dev, "no MAC address specified for SI%d, using %pM\n", - si, mac_addr); - } - - enetc_pf_set_primary_mac_addr(hw, si, mac_addr); - - return 0; -} - -static int enetc_setup_mac_addresses(struct device_node *np, - struct enetc_pf *pf) -{ - int err, i; - - /* The PF might take its MAC from the device tree */ - err =3D enetc_setup_mac_address(np, pf, 0); - if (err) - return err; - - for (i =3D 0; i < pf->total_vfs; i++) { - err =3D enetc_setup_mac_address(NULL, pf, i + 1); - if (err) - return err; - } - - return 0; -} - static void enetc_port_assign_rfs_entries(struct enetc_si *si) { struct enetc_pf *pf =3D enetc_si_priv(si); @@ -775,187 +708,6 @@ static const struct net_device_ops enetc_ndev_ops =3D= { .ndo_xdp_xmit =3D enetc_xdp_xmit, }; =20 -static void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *= ndev, - const struct net_device_ops *ndev_ops) -{ - struct enetc_ndev_priv *priv =3D netdev_priv(ndev); - - SET_NETDEV_DEV(ndev, &si->pdev->dev); - priv->ndev =3D ndev; - priv->si =3D si; - priv->dev =3D &si->pdev->dev; - si->ndev =3D ndev; - - priv->msg_enable =3D (NETIF_MSG_WOL << 1) - 1; - ndev->netdev_ops =3D ndev_ops; - enetc_set_ethtool_ops(ndev); - ndev->watchdog_timeo =3D 5 * HZ; - ndev->max_mtu =3D ENETC_MAX_MTU; - - ndev->hw_features =3D NETIF_F_SG | NETIF_F_RXCSUM | - NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; - ndev->features =3D NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM | - NETIF_F_HW_VLAN_CTAG_TX | - NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; - ndev->vlan_features =3D NETIF_F_SG | NETIF_F_HW_CSUM | - NETIF_F_TSO | NETIF_F_TSO6; - - if (si->num_rss) - ndev->hw_features |=3D NETIF_F_RXHASH; - - ndev->priv_flags |=3D IFF_UNICAST_FLT; - ndev->xdp_features =3D NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | - NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG | - NETDEV_XDP_ACT_NDO_XMIT_SG; - - if (si->hw_features & ENETC_SI_F_PSFP && !enetc_psfp_enable(priv)) { - priv->active_offloads |=3D ENETC_F_QCI; - ndev->features |=3D NETIF_F_HW_TC; - ndev->hw_features |=3D NETIF_F_HW_TC; - } - - /* pick up primary MAC address from SI */ - enetc_load_primary_mac_addr(&si->hw, ndev); -} - -static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np) -{ - struct device *dev =3D &pf->si->pdev->dev; - struct enetc_mdio_priv *mdio_priv; - struct mii_bus *bus; - int err; - - bus =3D devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); - if (!bus) - return -ENOMEM; - - bus->name =3D "Freescale ENETC MDIO Bus"; - bus->read =3D enetc_mdio_read_c22; - bus->write =3D enetc_mdio_write_c22; - bus->read_c45 =3D enetc_mdio_read_c45; - bus->write_c45 =3D enetc_mdio_write_c45; - bus->parent =3D dev; - mdio_priv =3D bus->priv; - mdio_priv->hw =3D &pf->si->hw; - mdio_priv->mdio_base =3D ENETC_EMDIO_BASE; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(dev)); - - err =3D of_mdiobus_register(bus, np); - if (err) - return dev_err_probe(dev, err, "cannot register MDIO bus\n"); - - pf->mdio =3D bus; - - return 0; -} - -static void enetc_mdio_remove(struct enetc_pf *pf) -{ - if (pf->mdio) - mdiobus_unregister(pf->mdio); -} - -static int enetc_imdio_create(struct enetc_pf *pf) -{ - struct device *dev =3D &pf->si->pdev->dev; - struct enetc_mdio_priv *mdio_priv; - struct phylink_pcs *phylink_pcs; - struct mii_bus *bus; - int err; - - bus =3D mdiobus_alloc_size(sizeof(*mdio_priv)); - if (!bus) - return -ENOMEM; - - bus->name =3D "Freescale ENETC internal MDIO Bus"; - bus->read =3D enetc_mdio_read_c22; - bus->write =3D enetc_mdio_write_c22; - bus->read_c45 =3D enetc_mdio_read_c45; - bus->write_c45 =3D enetc_mdio_write_c45; - bus->parent =3D dev; - bus->phy_mask =3D ~0; - mdio_priv =3D bus->priv; - mdio_priv->hw =3D &pf->si->hw; - mdio_priv->mdio_base =3D ENETC_PM_IMDIO_BASE; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); - - err =3D mdiobus_register(bus); - if (err) { - dev_err(dev, "cannot register internal MDIO bus (%d)\n", err); - goto free_mdio_bus; - } - - phylink_pcs =3D lynx_pcs_create_mdiodev(bus, 0); - if (IS_ERR(phylink_pcs)) { - err =3D PTR_ERR(phylink_pcs); - dev_err(dev, "cannot create lynx pcs (%d)\n", err); - goto unregister_mdiobus; - } - - pf->imdio =3D bus; - pf->pcs =3D phylink_pcs; - - return 0; - -unregister_mdiobus: - mdiobus_unregister(bus); -free_mdio_bus: - mdiobus_free(bus); - return err; -} - -static void enetc_imdio_remove(struct enetc_pf *pf) -{ - if (pf->pcs) - lynx_pcs_destroy(pf->pcs); - if (pf->imdio) { - mdiobus_unregister(pf->imdio); - mdiobus_free(pf->imdio); - } -} - -static bool enetc_port_has_pcs(struct enetc_pf *pf) -{ - return (pf->if_mode =3D=3D PHY_INTERFACE_MODE_SGMII || - pf->if_mode =3D=3D PHY_INTERFACE_MODE_1000BASEX || - pf->if_mode =3D=3D PHY_INTERFACE_MODE_2500BASEX || - pf->if_mode =3D=3D PHY_INTERFACE_MODE_USXGMII); -} - -static int enetc_mdiobus_create(struct enetc_pf *pf, struct device_node *n= ode) -{ - struct device_node *mdio_np; - int err; - - mdio_np =3D of_get_child_by_name(node, "mdio"); - if (mdio_np) { - err =3D enetc_mdio_probe(pf, mdio_np); - - of_node_put(mdio_np); - if (err) - return err; - } - - if (enetc_port_has_pcs(pf)) { - err =3D enetc_imdio_create(pf); - if (err) { - enetc_mdio_remove(pf); - return err; - } - } - - return 0; -} - -static void enetc_mdiobus_destroy(struct enetc_pf *pf) -{ - enetc_mdio_remove(pf); - enetc_imdio_remove(pf); -} - static struct phylink_pcs * enetc_pl_mac_select_pcs(struct phylink_config *config, phy_interface_t ifa= ce) { @@ -1101,47 +853,6 @@ static const struct phylink_mac_ops enetc_mac_phylink= _ops =3D { .mac_link_down =3D enetc_pl_mac_link_down, }; =20 -static int enetc_phylink_create(struct enetc_ndev_priv *priv, - struct device_node *node) -{ - struct enetc_pf *pf =3D enetc_si_priv(priv->si); - struct phylink *phylink; - int err; - - pf->phylink_config.dev =3D &priv->ndev->dev; - pf->phylink_config.type =3D PHYLINK_NETDEV; - pf->phylink_config.mac_capabilities =3D MAC_ASYM_PAUSE | MAC_SYM_PAUSE | - MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD; - - __set_bit(PHY_INTERFACE_MODE_INTERNAL, - pf->phylink_config.supported_interfaces); - __set_bit(PHY_INTERFACE_MODE_SGMII, - pf->phylink_config.supported_interfaces); - __set_bit(PHY_INTERFACE_MODE_1000BASEX, - pf->phylink_config.supported_interfaces); - __set_bit(PHY_INTERFACE_MODE_2500BASEX, - pf->phylink_config.supported_interfaces); - __set_bit(PHY_INTERFACE_MODE_USXGMII, - pf->phylink_config.supported_interfaces); - phy_interface_set_rgmii(pf->phylink_config.supported_interfaces); - - phylink =3D phylink_create(&pf->phylink_config, of_fwnode_handle(node), - pf->if_mode, &enetc_mac_phylink_ops); - if (IS_ERR(phylink)) { - err =3D PTR_ERR(phylink); - return err; - } - - priv->phylink =3D phylink; - - return 0; -} - -static void enetc_phylink_destroy(struct enetc_ndev_priv *priv) -{ - phylink_destroy(priv->phylink); -} - /* Initialize the entire shared memory for the flow steering entries * of this port (PF + VFs) */ @@ -1338,7 +1049,7 @@ static int enetc_pf_probe(struct pci_dev *pdev, if (err) goto err_mdiobus_create; =20 - err =3D enetc_phylink_create(priv, node); + err =3D enetc_phylink_create(priv, node, &enetc_mac_phylink_ops); if (err) goto err_phylink_create; =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.h b/drivers/net/= ethernet/freescale/enetc/enetc_pf.h index c26bd66e4597..92a26b09cf57 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.h @@ -58,3 +58,16 @@ struct enetc_pf { int enetc_msg_psi_init(struct enetc_pf *pf); void enetc_msg_psi_free(struct enetc_pf *pf); void enetc_msg_handle_rxmsg(struct enetc_pf *pf, int mbox_id, u16 *status); + +void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 *addr); +void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, + const u8 *addr); +int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr); +int enetc_setup_mac_addresses(struct device_node *np, struct enetc_pf *pf); +void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, + const struct net_device_ops *ndev_ops); +int enetc_mdiobus_create(struct enetc_pf *pf, struct device_node *node); +void enetc_mdiobus_destroy(struct enetc_pf *pf); +int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node = *node, + const struct phylink_mac_ops *ops); +void enetc_phylink_destroy(struct enetc_ndev_priv *priv); diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drive= rs/net/ethernet/freescale/enetc/enetc_pf_common.c new file mode 100644 index 000000000000..be6aec19b1f3 --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -0,0 +1,294 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* Copyright 2024 NXP */ +#include +#include +#include +#include + +#include "enetc_pf.h" + +int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr) +{ + struct enetc_ndev_priv *priv =3D netdev_priv(ndev); + struct sockaddr *saddr =3D addr; + + if (!is_valid_ether_addr(saddr->sa_data)) + return -EADDRNOTAVAIL; + + eth_hw_addr_set(ndev, saddr->sa_data); + enetc_pf_set_primary_mac_addr(&priv->si->hw, 0, saddr->sa_data); + + return 0; +} + +static int enetc_setup_mac_address(struct device_node *np, struct enetc_pf= *pf, + int si) +{ + struct device *dev =3D &pf->si->pdev->dev; + struct enetc_hw *hw =3D &pf->si->hw; + u8 mac_addr[ETH_ALEN] =3D { 0 }; + int err; + + /* (1) try to get the MAC address from the device tree */ + if (np) { + err =3D of_get_mac_address(np, mac_addr); + if (err =3D=3D -EPROBE_DEFER) + return err; + } + + /* (2) bootloader supplied MAC address */ + if (is_zero_ether_addr(mac_addr)) + enetc_pf_get_primary_mac_addr(hw, si, mac_addr); + + /* (3) choose a random one */ + if (is_zero_ether_addr(mac_addr)) { + eth_random_addr(mac_addr); + dev_info(dev, "no MAC address specified for SI%d, using %pM\n", + si, mac_addr); + } + + enetc_pf_set_primary_mac_addr(hw, si, mac_addr); + + return 0; +} + +int enetc_setup_mac_addresses(struct device_node *np, struct enetc_pf *pf) +{ + int err, i; + + /* The PF might take its MAC from the device tree */ + err =3D enetc_setup_mac_address(np, pf, 0); + if (err) + return err; + + for (i =3D 0; i < pf->total_vfs; i++) { + err =3D enetc_setup_mac_address(NULL, pf, i + 1); + if (err) + return err; + } + + return 0; +} + +void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, + const struct net_device_ops *ndev_ops) +{ + struct enetc_ndev_priv *priv =3D netdev_priv(ndev); + + SET_NETDEV_DEV(ndev, &si->pdev->dev); + priv->ndev =3D ndev; + priv->si =3D si; + priv->dev =3D &si->pdev->dev; + si->ndev =3D ndev; + + priv->msg_enable =3D (NETIF_MSG_WOL << 1) - 1; + ndev->netdev_ops =3D ndev_ops; + enetc_set_ethtool_ops(ndev); + ndev->watchdog_timeo =3D 5 * HZ; + ndev->max_mtu =3D ENETC_MAX_MTU; + + ndev->hw_features =3D NETIF_F_SG | NETIF_F_RXCSUM | + NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK | + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + ndev->features =3D NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM | + NETIF_F_HW_VLAN_CTAG_TX | + NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + ndev->vlan_features =3D NETIF_F_SG | NETIF_F_HW_CSUM | + NETIF_F_TSO | NETIF_F_TSO6; + + if (si->num_rss) + ndev->hw_features |=3D NETIF_F_RXHASH; + + ndev->priv_flags |=3D IFF_UNICAST_FLT; + ndev->xdp_features =3D NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | + NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG | + NETDEV_XDP_ACT_NDO_XMIT_SG; + + if (si->hw_features & ENETC_SI_F_PSFP && !enetc_psfp_enable(priv)) { + priv->active_offloads |=3D ENETC_F_QCI; + ndev->features |=3D NETIF_F_HW_TC; + ndev->hw_features |=3D NETIF_F_HW_TC; + } + + /* pick up primary MAC address from SI */ + enetc_load_primary_mac_addr(&si->hw, ndev); +} + +static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np) +{ + struct device *dev =3D &pf->si->pdev->dev; + struct enetc_mdio_priv *mdio_priv; + struct mii_bus *bus; + int err; + + bus =3D devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); + if (!bus) + return -ENOMEM; + + bus->name =3D "Freescale ENETC MDIO Bus"; + bus->read =3D enetc_mdio_read_c22; + bus->write =3D enetc_mdio_write_c22; + bus->read_c45 =3D enetc_mdio_read_c45; + bus->write_c45 =3D enetc_mdio_write_c45; + bus->parent =3D dev; + mdio_priv =3D bus->priv; + mdio_priv->hw =3D &pf->si->hw; + mdio_priv->mdio_base =3D ENETC_EMDIO_BASE; + snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(dev)); + + err =3D of_mdiobus_register(bus, np); + if (err) + return dev_err_probe(dev, err, "cannot register MDIO bus\n"); + + pf->mdio =3D bus; + + return 0; +} + +static void enetc_mdio_remove(struct enetc_pf *pf) +{ + if (pf->mdio) + mdiobus_unregister(pf->mdio); +} + +static int enetc_imdio_create(struct enetc_pf *pf) +{ + struct device *dev =3D &pf->si->pdev->dev; + struct enetc_mdio_priv *mdio_priv; + struct phylink_pcs *phylink_pcs; + struct mii_bus *bus; + int err; + + bus =3D mdiobus_alloc_size(sizeof(*mdio_priv)); + if (!bus) + return -ENOMEM; + + bus->name =3D "Freescale ENETC internal MDIO Bus"; + bus->read =3D enetc_mdio_read_c22; + bus->write =3D enetc_mdio_write_c22; + bus->read_c45 =3D enetc_mdio_read_c45; + bus->write_c45 =3D enetc_mdio_write_c45; + bus->parent =3D dev; + bus->phy_mask =3D ~0; + mdio_priv =3D bus->priv; + mdio_priv->hw =3D &pf->si->hw; + mdio_priv->mdio_base =3D ENETC_PM_IMDIO_BASE; + snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); + + err =3D mdiobus_register(bus); + if (err) { + dev_err(dev, "cannot register internal MDIO bus (%d)\n", err); + goto free_mdio_bus; + } + + phylink_pcs =3D lynx_pcs_create_mdiodev(bus, 0); + if (IS_ERR(phylink_pcs)) { + err =3D PTR_ERR(phylink_pcs); + dev_err(dev, "cannot create lynx pcs (%d)\n", err); + goto unregister_mdiobus; + } + + pf->imdio =3D bus; + pf->pcs =3D phylink_pcs; + + return 0; + +unregister_mdiobus: + mdiobus_unregister(bus); +free_mdio_bus: + mdiobus_free(bus); + return err; +} + +static void enetc_imdio_remove(struct enetc_pf *pf) +{ + if (pf->pcs) + lynx_pcs_destroy(pf->pcs); + + if (pf->imdio) { + mdiobus_unregister(pf->imdio); + mdiobus_free(pf->imdio); + } +} + +static bool enetc_port_has_pcs(struct enetc_pf *pf) +{ + return (pf->if_mode =3D=3D PHY_INTERFACE_MODE_SGMII || + pf->if_mode =3D=3D PHY_INTERFACE_MODE_1000BASEX || + pf->if_mode =3D=3D PHY_INTERFACE_MODE_2500BASEX || + pf->if_mode =3D=3D PHY_INTERFACE_MODE_USXGMII); +} + +int enetc_mdiobus_create(struct enetc_pf *pf, struct device_node *node) +{ + struct device_node *mdio_np; + int err; + + mdio_np =3D of_get_child_by_name(node, "mdio"); + if (mdio_np) { + err =3D enetc_mdio_probe(pf, mdio_np); + + of_node_put(mdio_np); + if (err) + return err; + } + + if (enetc_port_has_pcs(pf)) { + err =3D enetc_imdio_create(pf); + if (err) { + enetc_mdio_remove(pf); + return err; + } + } + + return 0; +} + +void enetc_mdiobus_destroy(struct enetc_pf *pf) +{ + enetc_mdio_remove(pf); + enetc_imdio_remove(pf); +} + +int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node = *node, + const struct phylink_mac_ops *ops) +{ + struct enetc_pf *pf =3D enetc_si_priv(priv->si); + struct phylink *phylink; + int err; + + pf->phylink_config.dev =3D &priv->ndev->dev; + pf->phylink_config.type =3D PHYLINK_NETDEV; + pf->phylink_config.mac_capabilities =3D MAC_ASYM_PAUSE | MAC_SYM_PAUSE | + MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD; + + __set_bit(PHY_INTERFACE_MODE_INTERNAL, + pf->phylink_config.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_SGMII, + pf->phylink_config.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_1000BASEX, + pf->phylink_config.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_2500BASEX, + pf->phylink_config.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_USXGMII, + pf->phylink_config.supported_interfaces); + phy_interface_set_rgmii(pf->phylink_config.supported_interfaces); + + phylink =3D phylink_create(&pf->phylink_config, of_fwnode_handle(node), + pf->if_mode, ops); + if (IS_ERR(phylink)) { + err =3D PTR_ERR(phylink); + return err; + } + + priv->phylink =3D phylink; + + return 0; +} + +void enetc_phylink_destroy(struct enetc_ndev_priv *priv) +{ + phylink_destroy(priv->phylink); +} --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2045.outbound.protection.outlook.com [40.107.22.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 083231EBA0A; Tue, 15 Oct 2024 13:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998053; cv=fail; b=MWE78ckXdcMLqhWekUGcbBe/sn6XnV16yZFmf2l9yK9aSQUaOQqrvcYKktsyW7SPVAm9r90PXkpZK64XSQbz/T3bNGk65mctfgsIbnFW2aUTNbVDO6nsFiRigBM9VoEcq+YVlQWFxK2cAsNaags2r7lANvSYO9NVyztsOuoCO3A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998053; c=relaxed/simple; bh=DXxE5sdv9kHRGjXKOaKSZU5gwo4AoPZZDDFXX5BcVSk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XikuM6nvIFrGbJoVAsuJhqicg2fTjcovlZagQRxmuvtuqtyYIu2YqumkEcmjhhbiaaymkGZ+G4v38btayJGgJZg6QAX+3RCIw0x5ceQ1AeEZp55DziRsxl4Aiv7/0VRNyPjEu49EAFx8tPnuumV/k0g1/p9FldAb3D5JGzbnbNE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=VMb0YAoc; arc=fail smtp.client-ip=40.107.22.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="VMb0YAoc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gvq1YS+lp+Rh+okzDUGsP4Zf0nZ1J5qkNdUkxjcVg4KZIDlerJdoTXQRKixBtmGz8Jl+9aqJagQfuJavNkxD9bPZAbLajILjSfhvNVd7eZPlmwCDNPzlk5FzUEeWJrxiFV4lqcPUrqNijLUagWLT55ixF5FGCsuzTKEHYwSaWfUnZ8rMMJTjBZxUTf0BV0V5wFjqH2u9XM21mPkMedi07a3K8hkkZol8uG2Z5R+J5ZyZtnVGQ3bx7FOhL3AOKC13zcq0UN1f9ufiX27/w9Wz3XEBMSkdZdC4z+JNVegHcpHxa+sQOoDPJu5x5v27qCxFPKGsckHjp9e6uyD4JHZpZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XzgW82gh+W7ywGDGYHLoWXNKz9H9Maz2cK013I48Ogs=; b=g4MI9vpyTjeKv2bqjn7KyLeC+JW145F+5iqXe2xKOsN2eDOAz94mlh4p07x9j/yFTajiytLHKu3djDFM1gFpCtQWe+yHWuWpVhN2bE00VTWBjC5xP6Ht4QbroAvXxjNlVy4dGGpuqR65sMhi+/C7b9u2EOtxV8aO+h8HVW0f8Jr768hKWH+ca5StYkb/CNpMV2Or3GYT5FGH+xLHvJWldbCSqqpEQXzXK/YvEO41yQrhmhoOXJHO52Rs5YMVJ+4QK5XPISiga2UTLfZC3z3pALS71qqIIXeP61ieRIy/T8SEQW0eGDG1Xlqerm/zZpAMNFLbAOdJXMXStRhvU/Z8Lg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XzgW82gh+W7ywGDGYHLoWXNKz9H9Maz2cK013I48Ogs=; b=VMb0YAoc3pEabL5LXyEoVZoWA+4Kg2L+vCHlIMEUqlxZG/L0mxLYb9bIS/TZ6TDfPPiZz+Xqrb3vKpBAj8opI8VWDYNf/WgwMksZLY7R95Dr4whGeV2ZyML5AGIUQImlnGWqMxb3dOF5YxBUfXVGLQfa41OMfN8HrmTmBK1CSelEJOw8BtwK8PrShUMuBm+4JwtjTzX48gklf7gOqGZ4nml+aZSOTEjSlQsUex+QTtLwutmn6UYzrkkIoo+KdknWWpx41yfWSOoHq7asAKsyI6r9ib0Sdim60BYTimtVihYqp4EI1+6hoPlJvAABCLuNqQ/91HolRIfqTNLaCqTNLA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by GVXPR04MB11041.eurprd04.prod.outlook.com (2603:10a6:150:218::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:14:07 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:07 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 06/13] net: enetc: build enetc_pf_common.c as a separate module Date: Tue, 15 Oct 2024 20:58:34 +0800 Message-Id: <20241015125841.1075560-7-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GVXPR04MB11041:EE_ X-MS-Office365-Filtering-Correlation-Id: cf43f6b5-d4e1-40bf-ad93-08dced1b3fc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|7416014|52116014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?X6yCSZQlGrcKCe0cLiq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8YRBm6J?= =?us-ascii?Q?sKjB7XeyRGoz5PVY10IuJkzAfeOshv5ymxlmIkFWRmvL5tMAB0HFCdvLV/VY?= =?us-ascii?Q?DDjRZ5FF3E3g6uBTioDeaVFSD551GM5x1YdiNRaQJxOoHGxrmg2J1MQDDad7?= =?us-ascii?Q?2k5wL8Lj75+akJ/wq4D+5mlRqWQayKsktr2vBA/ZDus91Zek3zzLpcQ+lAiN?= =?us-ascii?Q?wdm1dv6Hh7NgaIs//MLq5M30HM0TyQUuzIWvR4cZJt4AMh3KcbOdl+b2Oi/M?= =?us-ascii?Q?kp5av2Tfz06Zsf0YxOjZ/UWuAzlmF/KwstEvOZXM17iHr31vPSmHW3QX6E82?= =?us-ascii?Q?XW2nnAuq18sTNOuDzsCRDI1j4/L0uf+okbmrNb7Gp5Srh52aFZ4zuxk/RyuA?= =?us-ascii?Q?ITbSRJcq0T5CZVoa2x/mu3vtK9+KJwRsqtiTvq0TKJnKaZKJrrOd+pYpSop5?= =?us-ascii?Q?XcfdCZ+yf+ZM+2Be8yPuPfpjhD225HSzZUkr9zezQwaQcT7UUluxBVlpK+Br?= =?us-ascii?Q?HLp4+Ps=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(7416014)(52116014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QcybJ0r/P9mExUK5M7UrzIgNnTtqGFeExl0FYmRejRa77+7Myl5vRf2BJnYE?= =?us-ascii?Q?TZWku21YIH4elgitKq0mP4zyfNNuRnTfG/ktY91+X6kFU5ZO57uUHcQtO5xk?= =?us-ascii?Q?WKtccBxvKZHNEDrHZs6WG2bHhQpJOR1Z9fLcHit0lXZeqrZXtGmv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ltmJtK8jRggpFb+6whrX1uZwndxJ4tEKSbrWKBs2?= =?us-ascii?Q?Df2dSvG3xAUjeMZkmpvbrV3ZDQlBzzPFbaU38fe3YcMEHgD3PMx4TY31Fa+r?= =?us-ascii?Q?+uaGQ6ewCpxwW8wTxbTvAE7x922tqXVTjbXsyVhun6232GVluOCpNO4ob4jt?= =?us-ascii?Q?j6tMXXG69ZO45sxvicyu+Ln7K12rRvefYAjHD23mEFGOIHVX1GphXUllMvlQ?= =?us-ascii?Q?vUBm/16OGUSvG9/goQl0/P6DBUuOvSB8BIWsqyOvf0oubqhozNsBPMHeE+Cy?= =?us-ascii?Q?uQOL3Dcy44+y8ZCW/QN5Iv1Sc4N1Xf9MsFCa5kUKsV0fC+0G25EJo4cksUYR?= =?us-ascii?Q?hDhp4N3H07w+xMNTXxsoSEwKlTjOkiahbyR6FcMuLfshmjTVC1tn2yPHmlq/?= =?us-ascii?Q?iwti3gCfSfBckgkERKyFNcJBgESyzM+3zoOXIaHRXrK3z/2gWnVxlXW4hFXI?= =?us-ascii?Q?taQGv3yqdygscKvEaThDHUO0PYmfB383M5glGKaT+qDSNjqkvhO3xXCXm6Q7?= =?us-ascii?Q?1usXMLc4iFRjc/hRzZb9Zs168WS5CHKNzzJtAQGv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf43f6b5-d4e1-40bf-ad93-08dced1b3fc2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:07.1978 (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: u6a/gad2EuaWXL0k/V5eEXY0EfiJVGg5cAvXJTPXXNOVekWteZU8UPUn4K2C0O+Sikg5pYGOqQtK/r9MsNOw+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11041 Content-Type: text/plain; charset="utf-8" enetc_pf_common.c provides the common interfaces for the PF drivers of ENETC v1 and v4. So it's better to make enetc_pf_common.c as a separate module in order to prepare to add support for ENETC v4 PF driver in subsequent patches. Because the ENETC of the two versions is different, so some hardware operations involved in these common interfaces will also be different, Therefore, struct enetc_pf_ops is added to register different hardware operation interfaces for both ENETC v1 and v4 PF drivers. Signed-off-by: Wei Fang --- v2 changes: This patch is separated from v1 patch 5 ("net: enetc: add enetc-pf-common driver support"), only the changes to compile enetc_pf_common.c into a separated driver are kept. --- drivers/net/ethernet/freescale/enetc/Kconfig | 9 ++++ drivers/net/ethernet/freescale/enetc/Makefile | 5 +- .../net/ethernet/freescale/enetc/enetc_pf.c | 26 ++++++++-- .../net/ethernet/freescale/enetc/enetc_pf.h | 21 ++++++-- .../freescale/enetc/enetc_pf_common.c | 50 ++++++++++++++++--- 5 files changed, 96 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/eth= ernet/freescale/enetc/Kconfig index 51d80ea959d4..fdd3ecbd1dbf 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -7,6 +7,14 @@ config FSL_ENETC_CORE =20 If compiled as module (M), the module name is fsl-enetc-core. =20 +config NXP_ENETC_PF_COMMON + tristate "ENETC PF common functionality driver" + help + This module supports common functionality between drivers of + different versions of NXP ENETC PF controllers. + + If compiled as module (M), the module name is nxp-enetc-pf-common. + config FSL_ENETC tristate "ENETC PF driver" depends on PCI_MSI @@ -14,6 +22,7 @@ config FSL_ENETC select FSL_ENETC_CORE select FSL_ENETC_IERB select FSL_ENETC_MDIO + select NXP_ENETC_PF_COMMON select PHYLINK select PCS_LYNX select DIMLIB diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/et= hernet/freescale/enetc/Makefile index 39675e9ff39d..b81ca462e358 100644 --- a/drivers/net/ethernet/freescale/enetc/Makefile +++ b/drivers/net/ethernet/freescale/enetc/Makefile @@ -3,8 +3,11 @@ obj-$(CONFIG_FSL_ENETC_CORE) +=3D fsl-enetc-core.o fsl-enetc-core-y :=3D enetc.o enetc_cbdr.o enetc_ethtool.o =20 +obj-$(CONFIG_NXP_ENETC_PF_COMMON) +=3D nxp-enetc-pf-common.o +nxp-enetc-pf-common-y :=3D enetc_pf_common.o + obj-$(CONFIG_FSL_ENETC) +=3D fsl-enetc.o -fsl-enetc-y :=3D enetc_pf.o enetc_pf_common.o +fsl-enetc-y :=3D enetc_pf.o fsl-enetc-$(CONFIG_PCI_IOV) +=3D enetc_msg.o fsl-enetc-$(CONFIG_FSL_ENETC_QOS) +=3D enetc_qos.o =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/= ethernet/freescale/enetc/enetc_pf.c index 3cdd149056f9..7522316ddfea 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -11,7 +11,7 @@ =20 #define ENETC_DRV_NAME_STR "ENETC PF driver" =20 -void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 *addr) +static void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 = *addr) { u32 upper =3D __raw_readl(hw->port + ENETC_PSIPMAR0(si)); u16 lower =3D __raw_readw(hw->port + ENETC_PSIPMAR1(si)); @@ -20,8 +20,8 @@ void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, i= nt si, u8 *addr) put_unaligned_le16(lower, addr + 4); } =20 -void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, - const u8 *addr) +static void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, + const u8 *addr) { u32 upper =3D get_unaligned_le32(addr); u16 lower =3D get_unaligned_le16(addr + 4); @@ -30,6 +30,17 @@ void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, = int si, __raw_writew(lower, hw->port + ENETC_PSIPMAR1(si)); } =20 +static struct phylink_pcs *enetc_pf_create_pcs(struct enetc_pf *pf, + struct mii_bus *bus) +{ + return lynx_pcs_create_mdiodev(bus, 0); +} + +static void enetc_pf_destroy_pcs(struct phylink_pcs *pcs) +{ + lynx_pcs_destroy(pcs); +} + static void enetc_set_vlan_promisc(struct enetc_hw *hw, char si_map) { u32 val =3D enetc_port_rd(hw, ENETC_PSIPVMR); @@ -970,6 +981,14 @@ static void enetc_psi_destroy(struct pci_dev *pdev) enetc_pci_remove(pdev); } =20 +static const struct enetc_pf_ops enetc_pf_ops =3D { + .set_si_primary_mac =3D enetc_pf_set_primary_mac_addr, + .get_si_primary_mac =3D enetc_pf_get_primary_mac_addr, + .create_pcs =3D enetc_pf_create_pcs, + .destroy_pcs =3D enetc_pf_destroy_pcs, + .enable_psfp =3D enetc_psfp_enable, +}; + static int enetc_pf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -997,6 +1016,7 @@ static int enetc_pf_probe(struct pci_dev *pdev, pf =3D enetc_si_priv(si); pf->si =3D si; pf->total_vfs =3D pci_sriov_get_totalvfs(pdev); + enetc_pf_ops_register(pf, &enetc_pf_ops); =20 err =3D enetc_setup_mac_addresses(node, pf); if (err) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.h b/drivers/net/= ethernet/freescale/enetc/enetc_pf.h index 92a26b09cf57..39db9d5c2e50 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.h @@ -28,6 +28,16 @@ struct enetc_vf_state { enum enetc_vf_flags flags; }; =20 +struct enetc_pf; + +struct enetc_pf_ops { + void (*set_si_primary_mac)(struct enetc_hw *hw, int si, const u8 *addr); + void (*get_si_primary_mac)(struct enetc_hw *hw, int si, u8 *addr); + struct phylink_pcs *(*create_pcs)(struct enetc_pf *pf, struct mii_bus *bu= s); + void (*destroy_pcs)(struct phylink_pcs *pcs); + int (*enable_psfp)(struct enetc_ndev_priv *priv); +}; + struct enetc_pf { struct enetc_si *si; int num_vfs; /* number of active VFs, after sriov_init */ @@ -50,6 +60,8 @@ struct enetc_pf { =20 phy_interface_t if_mode; struct phylink_config phylink_config; + + const struct enetc_pf_ops *ops; }; =20 #define phylink_to_enetc_pf(config) \ @@ -59,9 +71,6 @@ int enetc_msg_psi_init(struct enetc_pf *pf); void enetc_msg_psi_free(struct enetc_pf *pf); void enetc_msg_handle_rxmsg(struct enetc_pf *pf, int mbox_id, u16 *status); =20 -void enetc_pf_get_primary_mac_addr(struct enetc_hw *hw, int si, u8 *addr); -void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, - const u8 *addr); int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr); int enetc_setup_mac_addresses(struct device_node *np, struct enetc_pf *pf); void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, @@ -71,3 +80,9 @@ void enetc_mdiobus_destroy(struct enetc_pf *pf); int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node = *node, const struct phylink_mac_ops *ops); void enetc_phylink_destroy(struct enetc_ndev_priv *priv); + +static inline void enetc_pf_ops_register(struct enetc_pf *pf, + const struct enetc_pf_ops *ops) +{ + pf->ops =3D ops; +} diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drive= rs/net/ethernet/freescale/enetc/enetc_pf_common.c index be6aec19b1f3..2c6ce887f583 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -7,19 +7,37 @@ =20 #include "enetc_pf.h" =20 +static int enetc_set_si_hw_addr(struct enetc_pf *pf, int si, u8 *mac_addr) +{ + struct enetc_hw *hw =3D &pf->si->hw; + + if (pf->ops->set_si_primary_mac) + pf->ops->set_si_primary_mac(hw, si, mac_addr); + else + return -EOPNOTSUPP; + + return 0; +} + int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr) { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); + struct enetc_pf *pf =3D enetc_si_priv(priv->si); struct sockaddr *saddr =3D addr; + int err; =20 if (!is_valid_ether_addr(saddr->sa_data)) return -EADDRNOTAVAIL; =20 + err =3D enetc_set_si_hw_addr(pf, 0, saddr->sa_data); + if (err) + return err; + eth_hw_addr_set(ndev, saddr->sa_data); - enetc_pf_set_primary_mac_addr(&priv->si->hw, 0, saddr->sa_data); =20 return 0; } +EXPORT_SYMBOL_GPL(enetc_pf_set_mac_addr); =20 static int enetc_setup_mac_address(struct device_node *np, struct enetc_pf= *pf, int si) @@ -37,8 +55,8 @@ static int enetc_setup_mac_address(struct device_node *np= , struct enetc_pf *pf, } =20 /* (2) bootloader supplied MAC address */ - if (is_zero_ether_addr(mac_addr)) - enetc_pf_get_primary_mac_addr(hw, si, mac_addr); + if (is_zero_ether_addr(mac_addr) && pf->ops->get_si_primary_mac) + pf->ops->get_si_primary_mac(hw, si, mac_addr); =20 /* (3) choose a random one */ if (is_zero_ether_addr(mac_addr)) { @@ -47,7 +65,9 @@ static int enetc_setup_mac_address(struct device_node *np= , struct enetc_pf *pf, si, mac_addr); } =20 - enetc_pf_set_primary_mac_addr(hw, si, mac_addr); + err =3D enetc_set_si_hw_addr(pf, si, mac_addr); + if (err) + return err; =20 return 0; } @@ -69,11 +89,13 @@ int enetc_setup_mac_addresses(struct device_node *np, s= truct enetc_pf *pf) =20 return 0; } +EXPORT_SYMBOL_GPL(enetc_setup_mac_addresses); =20 void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, const struct net_device_ops *ndev_ops) { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); + struct enetc_pf *pf =3D enetc_si_priv(si); =20 SET_NETDEV_DEV(ndev, &si->pdev->dev); priv->ndev =3D ndev; @@ -106,7 +128,8 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct = net_device *ndev, NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG | NETDEV_XDP_ACT_NDO_XMIT_SG; =20 - if (si->hw_features & ENETC_SI_F_PSFP && !enetc_psfp_enable(priv)) { + if (si->hw_features & ENETC_SI_F_PSFP && pf->ops->enable_psfp && + !pf->ops->enable_psfp(priv)) { priv->active_offloads |=3D ENETC_F_QCI; ndev->features |=3D NETIF_F_HW_TC; ndev->hw_features |=3D NETIF_F_HW_TC; @@ -115,6 +138,7 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct = net_device *ndev, /* pick up primary MAC address from SI */ enetc_load_primary_mac_addr(&si->hw, ndev); } +EXPORT_SYMBOL_GPL(enetc_pf_netdev_setup); =20 static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np) { @@ -161,6 +185,9 @@ static int enetc_imdio_create(struct enetc_pf *pf) struct mii_bus *bus; int err; =20 + if (!pf->ops->create_pcs) + return -EOPNOTSUPP; + bus =3D mdiobus_alloc_size(sizeof(*mdio_priv)); if (!bus) return -ENOMEM; @@ -183,7 +210,7 @@ static int enetc_imdio_create(struct enetc_pf *pf) goto free_mdio_bus; } =20 - phylink_pcs =3D lynx_pcs_create_mdiodev(bus, 0); + phylink_pcs =3D pf->ops->create_pcs(pf, bus); if (IS_ERR(phylink_pcs)) { err =3D PTR_ERR(phylink_pcs); dev_err(dev, "cannot create lynx pcs (%d)\n", err); @@ -204,8 +231,8 @@ static int enetc_imdio_create(struct enetc_pf *pf) =20 static void enetc_imdio_remove(struct enetc_pf *pf) { - if (pf->pcs) - lynx_pcs_destroy(pf->pcs); + if (pf->pcs && pf->ops->destroy_pcs) + pf->ops->destroy_pcs(pf->pcs); =20 if (pf->imdio) { mdiobus_unregister(pf->imdio); @@ -245,12 +272,14 @@ int enetc_mdiobus_create(struct enetc_pf *pf, struct = device_node *node) =20 return 0; } +EXPORT_SYMBOL_GPL(enetc_mdiobus_create); =20 void enetc_mdiobus_destroy(struct enetc_pf *pf) { enetc_mdio_remove(pf); enetc_imdio_remove(pf); } +EXPORT_SYMBOL_GPL(enetc_mdiobus_destroy); =20 int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node = *node, const struct phylink_mac_ops *ops) @@ -287,8 +316,13 @@ int enetc_phylink_create(struct enetc_ndev_priv *priv,= struct device_node *node, =20 return 0; } +EXPORT_SYMBOL_GPL(enetc_phylink_create); =20 void enetc_phylink_destroy(struct enetc_ndev_priv *priv) { phylink_destroy(priv->phylink); } +EXPORT_SYMBOL_GPL(enetc_phylink_destroy); + +MODULE_DESCRIPTION("NXP ENETC PF common functionality driver"); +MODULE_LICENSE("Dual BSD/GPL"); --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062.outbound.protection.outlook.com [40.107.20.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DFA822910F; Tue, 15 Oct 2024 13:14:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998059; cv=fail; b=JcKGkwgtp0recjmHaE9GVN3+eGQ1Q/VrYGkzd/rUGZJKkjr3/8QTu9qOzEfqobrnEr9esk7wTt8UOU/492F/quyp7dAv0mrceVEoJMxF4ggGKhyYMCRaZoRyYs3Z+Iq6egYguTTHLH+Z5d/wh5mVTnRK3Gpbc+DppWttx5Q7UZo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998059; c=relaxed/simple; bh=uou1nui+PU10Yj9GprrdFQ8ElRvbPYAB8tO5gcsxj5Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hCq66TRBmlUboQQzgAgOL/zmuQfkaZPh+DTtLTTH23Y1tbHMDWQ2gFeABXl/o/G4aG76HeZ3xgVVdB5wKUAsxifyqNBj4QYB/KjaFEa7U4s1HqIlFNxPSJeegm960Yy6yTX97fwCGC2gAvUB4eBHpr9Wqn96Tehne8tihFKcwlY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=TPTpOjXE; arc=fail smtp.client-ip=40.107.20.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="TPTpOjXE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fmyVA9d0OcbDh32m/Sp6vhBckJLwpMjtYr04XNl5ghWm8wt+/GAV4x2XztWMWi8YQjpdt3/sGXMFneaGCFSHslrsEUYIwuWGdhdPyj9yijmcKuTgwh4xbLeNPBUc1sc8mZo88Dw+nXci9jS4A4w9z2qhVyckL6LH2ZJZFjbJJurvYJVx7pkh21RC/zB4dT9jG3UfuDuaofVBJNyidJfcnBobxuoTCGpru1Jd5Kj6Vc3sprYTJXzK1KJSO5LLXaYwOst8XKXf5pShJ+ds9G3qHLvYhS2sucNrpNY+DNiyW/Fp7VV8cV4TZdeuVlCkvEQOc02ztgAEFNhzRaCymuF+0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qUHeaK/qB1TBP4EDPjCJ+4CfLjC4+VET72XOwMXTzGM=; b=mSvYf7xnXzcSPdaxVaf3SpLyXa4OG12qwvczAa3cHSgsniJBtqDGYStA3nCMvFuQdXYsyqQFYJVt0DuJT+q/umiGP28tjL3zShqnSGkZUR4LmtxYlZ+/HH4GjBf1sz8hDpx+9w/Egn7U8xVl3AJ1SY9NJ5WkFWZw0pdNlbgkUUv0H9m/r68fcA1tztc9g23JPteeX3FaF/SBClmRD5J3ru1SiBLidchd2F6jNk3EbAhsGfeo1YfxvnsbkPJILdTyaD1DlvfY0bY8Biv6/V3G28mtCpRkg2JPdP4/vDsAUcnj+BeVy2xSRiLO480bGVUz9//4FpN0sGKTwQYjyEccYg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUHeaK/qB1TBP4EDPjCJ+4CfLjC4+VET72XOwMXTzGM=; b=TPTpOjXExOO6bTBJbg74zB+OhO6l7rQbgiB2uKzM9RjI+/oBzwvdC/gNs2Nb5z0NgGdPPp7opbWKzWOdWE3EGdwZT+ayAIbNGLj9sJy7WSoVGDq9T+Ew0JxyhlDrVlTVblixG0yXVqeCzCOr4L+a0Td6q3GbjfRFPPa3hYmbYwiDseQFj+glMfcIj0k0SkAqf0IgN9cClIdkjIufNR8ig6SLUMte3+CJ+9QFZIAL0XPBoJaWrRTZMdyyt7tqF9nU6yN6gu2uthV+TsFYE0orfftdID03tXXde3+h8H7AR0P/MC0jJkVxuyyhWd2OyteUHUEhEVKvN0k5m72dyxnzDA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:12 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:12 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 07/13] net: enetc: only enable ERR050089 workaround on LS1028A Date: Tue, 15 Oct 2024 20:58:35 +0800 Message-Id: <20241015125841.1075560-8-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: c259396c-df93-47f9-1775-08dced1b4318 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?POU/ldv7aPtOTduGmnxaKQKT2hDZv/e/kmCs7UBmoU1Y7DSj1v0zWl3mBNaN?= =?us-ascii?Q?7YbTsptkbK1H8x0uJMTtPCcXPZEUzCkabR5iIy/Yz9a8pezLO71doc23bPHF?= =?us-ascii?Q?EPU3GiSff95/fQDlSBy8q7BKSXnhChVkNvVa4q7lkLAE06t8dm+XL6pqhc0J?= =?us-ascii?Q?OUMWq4YPhJ/bPDqWRthAkv0WBUk6TaQfIXxOGS8vbPdvz2L4+B+8MeB8FZzD?= =?us-ascii?Q?ZLFr5HhOXXXc1e3U3S19YZBx2BHY+JT8n4Q8iBgIZurBBIDbgfHhircr2x4w?= =?us-ascii?Q?/y3DfanrCHPFppuhmQNqGqM6csorFuiNOl7k0OMbGTCFyXwc8JuPkS4lKbDM?= =?us-ascii?Q?82WYNtbiWkFznrlMWpk5F7cBB3KVEMd7v6lJNR6V1HkrRH+qWDa0/uWsXR/6?= =?us-ascii?Q?0vUvhGz0+IhD+5g9RVVW6ONOmVrxK2sKqmQhayF98eScO7qnEqFhLAo+7f47?= =?us-ascii?Q?v1TnyKPxJstaALx6Mi8bvAnhJN3/8NtsuErfGEzjSgCqpSjbgihbyt9SM5L8?= =?us-ascii?Q?oeRQscPR1DNewKPtzjeDUNK0oPdmp5oPl0bQkQOT6itoUlyMuzTlJZ8LCiKq?= =?us-ascii?Q?quNjM9wHpLvUyqt8i9eDwLYXPxW7+1xat1A9qWYO8M6ubfyiTOSRPCidnyF4?= =?us-ascii?Q?MErQUa7eX17OE/jHvCUFTvISczrtZGjotcBLG8w5gRzuu0h+s0Tj19npIQu/?= =?us-ascii?Q?Q9/iK3lUFEzx7ASDtMatMzgcVXgzNGudbP7JXYixmkOEA+TRwMyI13G5Dbbn?= =?us-ascii?Q?CaVF4Hkpbv5I2Wc2ZpjAaB1Jpt0S9LKxBteYe7UgFdrWYADUmP5FMbnPF1N7?= =?us-ascii?Q?wglwMUmqm7YNz/TA+0d9Zpf+yq/Je4cMBNimd4amRQy0xT93vpTObaqVjYmL?= =?us-ascii?Q?qJpnkqTglvJ8D4YAbNsJHXTCAcHQvMSwWla/gyRLRE78QK2Dlesyf7aTK6zJ?= =?us-ascii?Q?k9tolYHJQPXOqXw69QzhAe+saafZZKkpTAwv57AwbvDP1q+knK8Pu/caeJag?= =?us-ascii?Q?wOrTvqMIghwcD8B4MSasqFAA9yyVOUMaWX51hBkIBpGH5xSWjM4Amu1WhhmY?= =?us-ascii?Q?W7nSqsYlNjOqT70jCfEgRiXFLYFllZLMK8qj2iMgTEMIJcthgVRLcnFCx+Hv?= =?us-ascii?Q?QFw9ti5yzMgGa+kB4vZgvGlBd+1sCYeihyOJNzhy6K9DbUeur+aPCl04UrlM?= =?us-ascii?Q?xvahlwnUPkIEAmpBoPcB+zyGx/d+Z0VeOM/DJ97GwYgy1NG3CfUJ0XiHc2IO?= =?us-ascii?Q?Qo30SC9ngA+6AmzkZWbjRVX6aunLzUdbmlXdgDrzfMX2fwPNXqPJXJ1xSlbf?= =?us-ascii?Q?eJw1SSDpy1yMbeclaxkrvD1wg1RAiAO/uC18NVtEHdQMCVdjn1Ven+V6ktIM?= =?us-ascii?Q?hHudWEw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SkQbSukBrW67qcxx7f2B/G4VGcTOYf2CE7yVRA/7lzR6AUXIeZPLhZ58xQkX?= =?us-ascii?Q?4vAGBKjTLN3pzTx5sdXDGWI3CSraoPQPvUPzK4i07l3F+1NYGkC6BZ6K/PXs?= =?us-ascii?Q?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DmWZVyobCRDn981?= =?us-ascii?Q?GR3xP3bPU/5FXYtYuXeTGjnQMSv1gcpAR5HR69SAkVR83gadlURdKzONhUMh?= =?us-ascii?Q?ZnKZOV557Dcw8gDNIZIQ2l8tBIDrkXWLieUabHOWBktuHXC4P+TeARRrkGjE?= =?us-ascii?Q?vGz21x/V9eZjeiJA7ByLkSy/GzURKLnpwgPfCneblZV8ncCvPE8LDw1iyrAX?= =?us-ascii?Q?hBVDX6SCq/B7POCuOIFIBs0yNUHBDAfTdbLsQVEdtSlb6C26fOzpYBG9Z/xk?= =?us-ascii?Q?11ZEkKjuIxw+6RQdy3kMIDsxpAnFSRhMgqbVHBcxP+Sscjw549A7Cm9849yV?= =?us-ascii?Q?Gduz2nsDRA78kE0awjIYn6EBdpO01A5joBTaNo12iISPEFO+kG+LatZcoq4X?= =?us-ascii?Q?z/pKN3rsk91fzMYm7+AexCxW0s7VdVUiM+gBYMAZRWQ4N6cuILAY63Z2qefE?= =?us-ascii?Q?Yj0oLJDFKde5T4RzkfVMsVwKE+iSuqy6LpSKoomj1u69dHex7U6YuyEBfdhU?= =?us-ascii?Q?B1MQPv3YI72eYO4JdPOopC4i3+4MblXRaLFcQS3Z64o/qtYZECTFEtLpyzgU?= =?us-ascii?Q?7thTNJAZzj7UkfmAT9w14qdoTlnT4X5ljUe6Ef+z?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c259396c-df93-47f9-1775-08dced1b4318 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:12.7132 (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: ebkDMmd48Rg3Xk2QSKvBIIWUHleeEwk4twW5VX2gMaFXgfP8XcknCp1qWdrRZmX9cwfiknOSfAVtDhVgFVRJCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" From: Vladimir Oltean There are performance issues associated with the ERR050089 workaround, as well as potential functional issues (RCU stalls) under certain workloads. There is no reason why new SoCs like i.MX95 should even do anything in enetc_lock_mdio() and enetc_unlock_mdio(), so just use a static key so that they're compiled out at runtime. Signed-off-by: Vladimir Oltean Signed-off-by: Wei Fang --- v2 changes: no changes --- .../net/ethernet/freescale/enetc/enetc_hw.h | 34 +++++++++++++------ .../ethernet/freescale/enetc/enetc_pci_mdio.c | 17 ++++++++++ 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/= ethernet/freescale/enetc/enetc_hw.h index 1619943fb263..6a7b9b75d660 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h @@ -396,18 +396,22 @@ struct enetc_hw { */ extern rwlock_t enetc_mdio_lock; =20 +DECLARE_STATIC_KEY_FALSE(enetc_has_err050089); + /* use this locking primitive only on the fast datapath to * group together multiple non-MDIO register accesses to * minimize the overhead of the lock */ static inline void enetc_lock_mdio(void) { - read_lock(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + read_lock(&enetc_mdio_lock); } =20 static inline void enetc_unlock_mdio(void) { - read_unlock(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + read_unlock(&enetc_mdio_lock); } =20 /* use these accessors only on the fast datapath under @@ -416,14 +420,16 @@ static inline void enetc_unlock_mdio(void) */ static inline u32 enetc_rd_reg_hot(void __iomem *reg) { - lockdep_assert_held(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + lockdep_assert_held(&enetc_mdio_lock); =20 return ioread32(reg); } =20 static inline void enetc_wr_reg_hot(void __iomem *reg, u32 val) { - lockdep_assert_held(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + lockdep_assert_held(&enetc_mdio_lock); =20 iowrite32(val, reg); } @@ -452,9 +458,13 @@ static inline u32 _enetc_rd_mdio_reg_wa(void __iomem *= reg) unsigned long flags; u32 val; =20 - write_lock_irqsave(&enetc_mdio_lock, flags); - val =3D ioread32(reg); - write_unlock_irqrestore(&enetc_mdio_lock, flags); + if (static_branch_unlikely(&enetc_has_err050089)) { + write_lock_irqsave(&enetc_mdio_lock, flags); + val =3D ioread32(reg); + write_unlock_irqrestore(&enetc_mdio_lock, flags); + } else { + val =3D ioread32(reg); + } =20 return val; } @@ -463,9 +473,13 @@ static inline void _enetc_wr_mdio_reg_wa(void __iomem = *reg, u32 val) { unsigned long flags; =20 - write_lock_irqsave(&enetc_mdio_lock, flags); - iowrite32(val, reg); - write_unlock_irqrestore(&enetc_mdio_lock, flags); + if (static_branch_unlikely(&enetc_has_err050089)) { + write_lock_irqsave(&enetc_mdio_lock, flags); + iowrite32(val, reg); + write_unlock_irqrestore(&enetc_mdio_lock, flags); + } else { + iowrite32(val, reg); + } } =20 #ifdef ioread64 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/driver= s/net/ethernet/freescale/enetc/enetc_pci_mdio.c index a1b595bd7993..2445e35a764a 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c @@ -9,6 +9,9 @@ #define ENETC_MDIO_BUS_NAME ENETC_MDIO_DEV_NAME " Bus" #define ENETC_MDIO_DRV_NAME ENETC_MDIO_DEV_NAME " driver" =20 +DEFINE_STATIC_KEY_FALSE(enetc_has_err050089); +EXPORT_SYMBOL_GPL(enetc_has_err050089); + static int enetc_pci_mdio_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -62,6 +65,12 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev, goto err_pci_mem_reg; } =20 + if (pdev->vendor =3D=3D PCI_VENDOR_ID_FREESCALE && + pdev->device =3D=3D ENETC_MDIO_DEV_ID) { + static_branch_inc(&enetc_has_err050089); + dev_info(&pdev->dev, "Enabled ERR050089 workaround\n"); + } + err =3D of_mdiobus_register(bus, dev->of_node); if (err) goto err_mdiobus_reg; @@ -88,6 +97,14 @@ static void enetc_pci_mdio_remove(struct pci_dev *pdev) struct enetc_mdio_priv *mdio_priv; =20 mdiobus_unregister(bus); + + if (pdev->vendor =3D=3D PCI_VENDOR_ID_FREESCALE && + pdev->device =3D=3D ENETC_MDIO_DEV_ID) { + static_branch_dec(&enetc_has_err050089); + if (!static_key_enabled(&enetc_has_err050089.key)) + dev_info(&pdev->dev, "Disabled ERR050089 workaround\n"); + } + mdio_priv =3D bus->priv; iounmap(mdio_priv->hw->port); pci_release_region(pdev, 0); --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2061.outbound.protection.outlook.com [40.107.20.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD4582296C4; Tue, 15 Oct 2024 13:14:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998063; cv=fail; b=bwqv9+e6tGvd1WDdpcUkUCOnfF+/kassabZqtuLRVwWd8vVJQLyxnYOfUkJ34TorR5YUocOnv53JZbCLuDcaesgplJxq5xlUIE50nD3KunHZhqsDJQP1G858N4TBjhaFY4WoX+m9CuNSKGlEu+APM9Tj5iw7OvZKDcPl/B/4f+I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998063; c=relaxed/simple; bh=pU2YNBmHM+U2yQDpWC3Rl0BuMrBjCvTVm1O43zOFO3g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LrO/jQcBGhKKblrWMwdFXLBGVRfuPAMJWNP6inJwba8F1gLQXziS0tFBhl/uHD0pU6zCLc34DF9/KX/FBq5vbA4ca8Szs2LAJcFjQRoE6007l6FifRmZzY5dEGZ59FfIFJVuaeWI4hUHxm8eCFLSmCi6lD3vVZnJ9w0Ft8M5BR4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=GTfraEZd; arc=fail smtp.client-ip=40.107.20.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="GTfraEZd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lRPubp0QW8g072h8X3banPs8SzmtU+hhzHy6puEeNtUlwqftRsSFSZuOSTVFsxky6jI135JULMllbYhMo2+yWMK47dQarmDlcNdC5UQVtbx0FWalXDAKvzKL/Cxo3IDNwOBPA4zCd9xwIi1g7S6sfVPlJgKnXnFfbeIVlfn+US4pZMnt65yz97DxBMU+P1k+nylIOKI5K9YpvuHxyziAV4oB/r5cyTCra3jLlZpYfFXp+6p/HqfP/9RlUYbmgCEstvvuTtAX/k076+dGy/U7HVHY+hG3KZPqzpf/p6qt4eck6WXBrtC/I8ZUvgmjeteqbgAXc1JgUCrdaXHSk7grVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3End52Pxbygyt0TkRjAbFp67xxEV7s/gKNgMqwzW35o=; b=PMAIZbzeppMRAizUx/18/0ZgvV8mqNM1QhT5LZUGWXZisXFY89NgvSBwAqshyJSmMuJN9fHpm55TJeUBOLq1Bq8knMcAU6ZdORQnpXSA8Rz0B5BOa3VCTTSUOa4MYFUvgbE6H2/bCUfi6pyc0m/hbfceuNflWBfAtD2VoRYlVfOoaHF6bGy43HCSdK5XlAmpZAFQO1xLHdA3wAvCkpQGfUn5xPWaUAffwjsGJpELasqV1nOF+UVEdcUp0tQ3HaZg9fqEawnzpmqnhKKVpcwDFnhqusbCg7jrhpuXtv8eK9pIOVc1HSLqNFkUS95cCDUaIWYer+0diBdeWh6yt8eE/g== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3End52Pxbygyt0TkRjAbFp67xxEV7s/gKNgMqwzW35o=; b=GTfraEZddNEoZ88XaFcmTdvyYR76mbI3/U4XpXOr3smDFkoTEN0grpHTbuZvcAL0/yiv4lKsVJmhK8Mjn2gVlwPCAlhS1vs8eaf8dxEBYDSxtN4aPj7s3lgOXETw5aKfONBl4bq6Jw2mJRK7CswdwPLabCYVV016zEEWniz3hPJzNrnOlTZwtI+1zNIrr0bepCup/1THFXghLgNXF2KN9F4ze88iQa3TIZPskWE8oG9kbLb7EVP1SrudBy+aaIatlBan/cTrWqMuh/JKCb0E9jf3xmJLUvxsWWmsmyod5dQhzCWfoiYtUrKOdb1z4mWXHkxr2X8jyCCk5d6Uj1aYkg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:18 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:18 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 08/13] PCI: Add NXP NETC vendor ID and device IDs Date: Tue, 15 Oct 2024 20:58:36 +0800 Message-Id: <20241015125841.1075560-9-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b41275e-ad6d-4f5b-2452-08dced1b4693 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?h4Ejup050IFQTt7nklzCQK9uMsbBDohREFMZNYxonXkB4dreWGt8v+BgIWnY?= =?us-ascii?Q?sAJja5qSguQWOzAP3Biny2tJ17/uRPxp4jEhfdfEueFDDapjuz7W7lJzfU4e?= =?us-ascii?Q?LgmjKrtUXy42PXbd6AcKIh4dHBWWTtMpNh7xmyzxZ3G2Ws48vs8GRG0I5r3b?= =?us-ascii?Q?QocoDQYW2srWLW0tgX+2TUDfAJ1q150XLLNj3GS8SS99XFDsqDYOvhRMIvQj?= =?us-ascii?Q?gBkH4WXJeA0tVJ3qLbGtDvk4TymSYHsxruDXEDq0vqGbEIzO7xbItPLzZNF6?= =?us-ascii?Q?IUCNWR9Hkcdrn+98SClu9kTFXX/7JXV6/izms6bRnmSMDnnD3xOTCSHCWGQ+?= =?us-ascii?Q?WKwQ+QltUGNPcMRNH2WjlTsEOv49+Cre/qBHJadynX/q8CrKs8cptLrou1/A?= =?us-ascii?Q?IPvybZXn19F9yV1KJZfmFoquCUrHH8vf4z32BH7EIXm3LwvksxfIM2fk/VTG?= =?us-ascii?Q?Yltyg7zjeeC6H14VKjZx7c14uP2y5jrkpv+NmI98TKohmA61MBQP9Ik3GnZ+?= =?us-ascii?Q?uJfRFz+O72LUTft2oxo2IZLtfRP0zqAs21nzQcGW5aOphHQGQmzKEVmqGc02?= =?us-ascii?Q?YCE0Y3VFIfU7HjNxMA2DdY4LELDpqSFmyEEaRth9WYNGQJNGAC52RezTuJzT?= =?us-ascii?Q?XQY5q4/JKZrFtm/HuKUC+Ugo6eXXBUzdATbmN00R7YlWp/exOs+rarjej8iQ?= =?us-ascii?Q?20U+w4avutuKJrexmF2+JZsN7uZ8YzEFe7SnWiQXb+bHFgNI7ozkVKj4RACS?= =?us-ascii?Q?X0+uHaM+oWaCYEYLhe+lPPGgjmXIBHPMiofH1OfTnwbFFUaDiRikSnPlk6yM?= =?us-ascii?Q?uuAKFV2j5K5G0G5K3WCehbRQIKOnsKkl0wZWkcTb+qQn6gMJdKyV5FJXBJRd?= =?us-ascii?Q?KvoA/J9lRde1z1CfL7cr9OvZrh3pKZRfs1abOxW/pJl2q/ukczV1X8Ug8djR?= =?us-ascii?Q?b/UowjVWiHklVZWR+7diPIZHMP+4xg7NgIjPS4U1rys46Q+dj7oYWe83KmBz?= =?us-ascii?Q?Zx95ppKN5a5hzzzklUGn8t3V18WeZVyy7oTK4DckB1UuLaW7s7GPwGpiywAa?= =?us-ascii?Q?t00rECYcaFHt71g19a3oZNDpQyTZmSH0vnG3ESco9Q8GvMH4cgEKrU2c6whw?= =?us-ascii?Q?+3obvECP6uYU3rLTuyKG3gaoFavoqSlQ3yIm9NdSutEZTJ43Nb83BLB7mXC0?= =?us-ascii?Q?2+1SJpAz6TMJsg5JxDn63lskMIcU5O0t2+a73+P6FyOi2iF1S4mkR/JQkrpu?= =?us-ascii?Q?KkxTSD/DX9WI8AnDabJmfTQnoT2ukCPHF4NhJEaKu8w5/Dme/hijQWUa+8W2?= =?us-ascii?Q?nkBWCTQ47fp3JmJ2HK8QJvVDCu5mK+z0RndybyfEVPbG2rbEirrQVsbHlSEy?= =?us-ascii?Q?0JNpGa8=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?W2DEqh286uvTgfebXL1JbdT6FSRNHAgHK88VvwODYOCbbmCGE3xNqJpxlpwL?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iYsWJphiBoK1YbV9/NuBp?= =?us-ascii?Q?tLfv+eqC7db1x+vrZW2n41uFrJEFSYwUnbYeVTFPA/o2tG0dmOuWVUsOh1lw?= =?us-ascii?Q?FIB68eE5fpRcgLcBpfUT6BEhsihFUQo44oAFcaEU8l2AF0hS9BN7yoeqhrj6?= =?us-ascii?Q?vnWfohCCO+k8qlJBbv9S/SjW5iN5zAIn58A/Gik7Ow69P+2PWhMFF/zRNzli?= =?us-ascii?Q?Ml9kQEyRIpjM7Sq92RbL5OcblV7iSDV6IL/NdItlJKRpTqzINF17FCvm21wv?= =?us-ascii?Q?zlRtdZjqDsAVFEUtVE1GTR7EJJ1R/lPKvYFdEumtIqitmFtJtnKnLwdjv7rv?= =?us-ascii?Q?eaYKK0jXfze2Nal0Ncg5dDfXNG425xSVXszNmczkv4Y/UdiHCy/zebfNP3NZ?= =?us-ascii?Q?RTUgilVBGH29alTxXPGRIP4PMlvyub7kRrBgUNkhGhQXcu8/X4I9piLZOrQ7?= =?us-ascii?Q?V7Fd1CDtTJFw3C78AiEW0SpkLjYJpyMLdbsL/Sc3nwRm+2CqVZNS+uFHfTRR?= =?us-ascii?Q?VYBvVRXbDPerLjkzMcKUXPOgj/sQ7npC/sb6cmLYzginU6mZ5V3DlsGxHTi7?= =?us-ascii?Q?3EHhajLuBppQVdh5sTcRPj9ilbf13jlwwn9/2WdxUrZj7iHJPnpGlPeOL+D9?= =?us-ascii?Q?0lUTn7gGwhpV664F02GME1n3t8b6pgKrOGUVnIhE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b41275e-ad6d-4f5b-2452-08dced1b4693 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:18.6603 (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: fPyD1b7/tIN7TbdeVQU9yFAHV9l00cWp0aSbTjEBlF0ufmJeFjo4bqcFQKTilNf0YTt/uSwhvvxKLLduGE48DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" NXP NETC is a multi-function RCiEP and it contains multiple functions, such as EMDIO, PTP Timer, ENETC PF and VF. Therefore, add these device IDs to pci_ids.h. Below are the device IDs and corresponding drivers. PCI_DEVICE_ID_NXP2_ENETC_PF: nxp-enetc4 PCI_DEVICE_ID_NXP2_NETC_EMDIO: fsl-enetc-mdio PCI_DEVICE_ID_NXP2_NETC_TIMER: ptp_netc PCI_DEVICE_ID_NXP2_ENETC_VF: fsl-enetc-vf Signed-off-by: Wei Fang Acked-by: Bjorn Helgaas --- v2 changes: Refine the commit message. --- include/linux/pci_ids.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4cf6aaed5f35..acd7ae774913 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1556,6 +1556,13 @@ #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 #define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 =20 +/* NXP has two vendor IDs, the other one is 0x1957 */ +#define PCI_VENDOR_ID_NXP2 PCI_VENDOR_ID_PHILIPS +#define PCI_DEVICE_ID_NXP2_ENETC_PF 0xe101 +#define PCI_DEVICE_ID_NXP2_NETC_EMDIO 0xee00 +#define PCI_DEVICE_ID_NXP2_NETC_TIMER 0xee02 +#define PCI_DEVICE_ID_NXP2_ENETC_VF 0xef00 + #define PCI_VENDOR_ID_EICON 0x1133 #define PCI_DEVICE_ID_EICON_DIVA20 0xe002 #define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004 --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2059.outbound.protection.outlook.com [40.107.20.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA0DD22910F; Tue, 15 Oct 2024 13:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998070; cv=fail; b=bAK/tTgOBDvwr4b1qTvgLlai02MxDTYKaoSCGfPwOCFs8+nZ3lPPI+zzsyLOhPQRb6GYFaXOXyqlyhLpxED4Ld6tHt6z7AM6N7dsCPlbrFeJm+IhKd+9vakOIoqt6N3QHyjWxeX7UhWUCvZgZc5lmmdU3USBilYk3G9r4nq0Hu8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998070; c=relaxed/simple; bh=GL44PGLq9yRdyT5n1FeI9TLm5RBPksdUP8Yn6Lzks3g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ESpoKj6G/5+ncG7WMr/Aw3BZVhgFPKk4p4p1k2KrFr583JBzY0TuGhkXjUFgBCeX1TaY4BwuNHKDfD47/tVPS/syF6UZmMvj/BOEMKraH7yKUavx9JRJD2Acl486te017Ir8OUyey0dxMYFNnfUWRQc6sldBjuAthwHX4PIM4A0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=DqKhyXWi; arc=fail smtp.client-ip=40.107.20.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="DqKhyXWi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ehsd7+9rlOMqd3qsCXygL3NKlF/Ry72TfBD3yijGg5baS5YqG+RDS7fmjZwyxMSclPSl8jdpyEAG12WIIX8QFhUqdELZK/d7NGNPDv3637SzFFyu2tBTzaNDceA7dJa6Mf55qfKVZHsVGJ5NvNR4DclljrBP+V72Yt8OQDDjIP5YcNdT8BiynJz1NYl52t2v+728Yrrkx59cQIYyHka7WKSG9sorfuqf/FXC9pY0XuX++TewFlNOmfsN7yn+ZqIb01zRLkQ6ftVD7lpIrQEovQtQFOCR+xFGtjexMEMzJTD6YQH1xHZamHH8IkcBnzZFIoUh16WtuSKhrYtCrBDbkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=DmQbl/5l7dj9TKEuA4IXc+GLMs+sn/8OKVJuh29x5tw=; b=O5B7n71CLXhCnnEXrv3/TMryroiNAiTwt92pS98DHWIaQQE8VJ5f6xbwpxeTKtOeqdkeHOmtwyzdGIll17FTEQgP1RgHAhqjUFXfkAxAMTJhe9xsVWyzBSEC7V4fErdA11khlO036zHIHFj0ACRWPcuha5R7j9qCv6WpqRu2ps5wJQ0joMWEvZp6XnM4i0KcibEwUm7iu2nDlm5yG+Gvr4b3arTyowWgjJUO01Wgtpq/i59RVbvPyTmpdVFM418+8TStZiN/67iNpMG4bOSvgH5W0FnaogtGt9BQO+YlWgew8/TxHkJduMVtK1uWc04YhfTQr8/iJ/9mUkj0zejv9A== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DmQbl/5l7dj9TKEuA4IXc+GLMs+sn/8OKVJuh29x5tw=; b=DqKhyXWiLZWcWXztXSojmw71w+uadDcI2/q5UcHVUf2Hg2xeFq2rSLCOy3Onj2W9tQQMnsT/AlJSPxvuNiFs8PJ28n6MdNKp6fy8B5XdZ6ksbSO/13Rf7EoV/N6qaqLoMTW99jfU+0Ng4ZNkOLwd1GkwWKSlPdRZY+QaZRTDG0F09D9KIcRt/K1pjX3imBlNhyED5Nzdb8c9CldJd5Kuwry6znP94fQBACI4/dhw+zMiYj+ATmfJhQOXRv3WIxQTshfm4IYCJbp+PRhIPhWMR21rTjdbHUSiT/ma2qKIvlzFJHGF73Pheo+ToOQh0XsgHmvl9ge9KD4z2bRq6TqdEg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:24 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:24 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 09/13] net: enetc: add i.MX95 EMDIO support Date: Tue, 15 Oct 2024 20:58:37 +0800 Message-Id: <20241015125841.1075560-10-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: b60fcb81-0f4e-42e0-330d-08dced1b49f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?LzyxAUKzMVInM+DxX9tTruz97+ngBIwmZzy+CmB4JcJvzFS6FdgZC/imPfSE?= =?us-ascii?Q?MZ/caNcTXbf+1jBDQVpKycoLRUUciqeM1r4qjlDn3ypmF4eO3O4ejj7OgGVZ?= =?us-ascii?Q?hMQnznNa4u+flnIHNzx6QvaNwclcfjHS1u7pCNV4dPz5rVG3clDlwV4/oAWc?= =?us-ascii?Q?dQ059+IRTcQKY7GaiH700X8K0GzWVYisW5LfR4YLddUtlZlP7xV143h8W6Un?= =?us-ascii?Q?lP8aM27xN/MvFuDa9bqaDSTBMyWICuggOkyF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jMxSyX+PP0Kw6PGfH3qF3KW5Xbt+yjQPOmGEo5qaCWg60SnSXfa1z?= =?us-ascii?Q?ri6HIC9ImCgKWIFREwKAxVXIIOfjvpciY3Bno19PhFWqD3hwdvjPIoa5VIhl?= =?us-ascii?Q?W0stjRuIKdDe22MF1ADG1ZfckXuyK5+Ro9qEI2DLbz4xNYHLKmmUl5VJ5bUP?= =?us-ascii?Q?rGhM2i7Mor3DYhH+Nx9kgM7hSoOKTR+r/F4EaMuuJX3F64ZSRokYnPgzxVKY?= =?us-ascii?Q?SdDKehE=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/PzalbG4Q/mJyQ+KgbeD0uLV+tzA5CZFWR7I+EqW9EZfMtKAUEAijlyOzkHR?= =?us-ascii?Q?ARpSLXdo9jTy5YoUDUwQ0lvtpKKAqzXH/pLedxmZseV+PzVhYyCDJW+5WgAP?= =?us-ascii?Q?OzFLa6uKNtVbCxFi1746ZmxqFpOWECsWNuy74Jg7woB2qN9oW+qdmC57Rx2d?= =?us-ascii?Q?A9PJvGAxn32tY1242OjKdr2tS8OkX/S8pKksUXCX0hDVhBPQnXKXOK/M0Fct?= =?us-ascii?Q?PlCRVrT8hSe4iNvhTQOgoJojxy2kpRY/9Im29j7gmgQ+id0I1EmYvMs+RuSc?= =?us-ascii?Q?X57Rhz9ZD2OnwU1a9sxRcAy5kwpCollWKBZB0z8nYZ3pVWrBPp10ks66dh9p?= =?us-ascii?Q?rLCTX17Zltc+1yXej57u8NGhrkpKS8mZEA79zLUQVxOr+vGrkpypt1RC/knH?= =?us-ascii?Q?Wmb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SWCJEToMHE2r?= =?us-ascii?Q?SNDGmEpABmT4oP8DBp41Xyoh2EHawYe+fZc/s5uzYir1ew+GksMNefNhl4rc?= =?us-ascii?Q?Xxb4VDX1g/aA6n7CsvMvgX8KaQmOLFllJRH3ycBCGSbHS1CZQPut35hy4Hk3?= =?us-ascii?Q?Ui2+/uokp7E45m+zDPcYn2ps3iALLBJxp1uIDQQjFTgxJtEXVS22DapSlekb?= =?us-ascii?Q?RMBQwLNi704EC9XEehDIa3qKrRD4+1rbwu4jRUNCR3+75/+UfYYordY6s7ke?= =?us-ascii?Q?28BnaTVbeQJ+uheMUqK3ddy9BtjwPo3TqV/u2Ajl?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b60fcb81-0f4e-42e0-330d-08dced1b49f5 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:24.2419 (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: cXQunXfSPujnKC6KsUXiakOn5LJC3NmOEPro8x1uNO8w3cM7peuOBmJxBAGzShF1MHEnoH7hcRmlKZUZVPXIGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" The verdor ID and device ID of i.MX95 EMDIO are different from LS1028A EMDIO, so add new vendor ID and device ID to pci_device_id table to support i.MX95 EMDIO. And the i.MX95 EMDIO has two pins that need to be controlled, namely MDC and MDIO. Signed-off-by: Wei Fang Reviewed-by: Frank Li --- v2 changes: no changes --- drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/driver= s/net/ethernet/freescale/enetc/enetc_pci_mdio.c index 2445e35a764a..9968a1e9b5ef 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c @@ -2,6 +2,7 @@ /* Copyright 2019 NXP */ #include #include +#include #include "enetc_pf.h" =20 #define ENETC_MDIO_DEV_ID 0xee01 @@ -71,6 +72,8 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev, dev_info(&pdev->dev, "Enabled ERR050089 workaround\n"); } =20 + pinctrl_pm_select_default_state(dev); + err =3D of_mdiobus_register(bus, dev->of_node); if (err) goto err_mdiobus_reg; @@ -113,6 +116,7 @@ static void enetc_pci_mdio_remove(struct pci_dev *pdev) =20 static const struct pci_device_id enetc_pci_mdio_id_table[] =3D { { PCI_DEVICE(PCI_VENDOR_ID_FREESCALE, ENETC_MDIO_DEV_ID) }, + { PCI_DEVICE(PCI_VENDOR_ID_NXP2, PCI_DEVICE_ID_NXP2_NETC_EMDIO) }, { 0, } /* End of table. */ }; MODULE_DEVICE_TABLE(pci, enetc_pci_mdio_id_table); --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 394963DAC0A; Tue, 15 Oct 2024 13:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998075; cv=fail; b=clbBXfqgRN6WxscLezr8h2LnBfJFBFCbu+FfyeEc6RACFYrAq8i3d3CgegGTZkvkFVSypuCpNrkA9DK396ASiw/qhT/IjFmkO+cIOvx74Pt8d2IVNS1aL8T62UTTiTPRr4mhx3/xYr6eE46EowpkW6PaqazbDcbSLP7NRdFuB38= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998075; c=relaxed/simple; bh=MmDmIDm0jAWTDLlpIRqmWWIpOR6bw0N4k2dbVuAxM9k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ow6V7mrMmh64ZXpUCtMcGLFopxf2xxd2ZWMNnZlslSijTWHVvuTKteszYs4GhDiwkeZX+7ostkZEqcFjO8d0YWcvh7UdXmmzQlP+qUqDPl78LCFHkOYTBTTTYL41117Ei0k6unCbiWdaud5fi56RjdlOjoiVQjK5JyeSDFzGOYs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=hfKs2Wf7; arc=fail smtp.client-ip=40.107.22.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="hfKs2Wf7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jb87eQ8A964vB4J4lUgGiALFBjrZ7J/3zJ+VRUDRzgRTcsdXp1Q/OJPkPGZgWfaiLzbEmp7PR3nC67nuLvuRwq045xqnUE5vyRuBaoks+/v+eUfIjat2ophC1Rvy6cYthZULdIADuIKfqb4vpye1MIO0AEB47iWinL+X0nYYQ29GnoG9hCVJxHz/d/li/i5RPzFWw3BjchEMggTXlTkg3EYc4vNdhJkmWysijNhigbwGmq3EMCcWxiHAE6bVu4r6sm1hEzehxOLAcO4Yws9MUY5L79U54/GQvFVWCC3IPRAjJgTZ2mcRFOxSWHe4if6DTeJRnkfTns4pVSxiIlb/QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=J2cAAlZDdH6Vpfu7V08Yut44j65BcaePFXdV+RQWjuU=; b=TvwtKKH87c97NsMFwFMFQCzGwDZPf+X3+a3ZU0qE+6MteM1l+TQxCOSak1PyUvp47y25zHYf20jl/AV5uKapMXToRcHgv98bzAStkPQOGco41q7Z7WHOp/RrkzN01sPDmPRk3FKdFqv/UxOmji2Cm3ZfzMWgf6HQQML64wGSi0ehvN3JT3bCy56W1AGWL01NpnDk7g1vMyYy6nxO+a778ja7jHl3jSKlU5lqvjnGLaAgEeb2TDksJ9eGUoT0Z30GEHo0W56/x2wsyMeJIAei+7hmqatxDYF77yrdA+v4cgKliuQM0wvSps3Owfq2OTIsr2cc8qIyuvWazlSSj64lQg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J2cAAlZDdH6Vpfu7V08Yut44j65BcaePFXdV+RQWjuU=; b=hfKs2Wf7arllxEtiNXL4gl9MEyy+NUAUszywcKgVKO1VuYGbxEI/fJEBozKvG9KiEc25RpqcjX7ZNaNGwl6LUjP/EqgnUrS/d4HrdTCIJBhHVoTAX0HlSfdtdQr1OccrQyZ0M6xhB66trjg4B4h+vZ4AvwdepxMGBBWHvqRKJ6s3Sl5GrS8ei5JEHB0N+gV2ggIHAw2wPIniSqRo4GI7Pv+QQ/o5JP5jlcijfSjbl+W5JyDgSN56zThAluJUNauEev1lPd/AA0OvMbEBQrVi1tQ4MxuJxUINsb00fkZmSmSqvXURDSXTMCobila7cf8CWGxjCssuMWaoO+n2G6bvhA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:30 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:29 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 10/13] net: enetc: extract enetc_int_vector_init/destroy() from enetc_alloc_msix() Date: Tue, 15 Oct 2024 20:58:38 +0800 Message-Id: <20241015125841.1075560-11-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f68f8d6-546b-44c1-9bcd-08dced1b4d53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?xtPtQZV6S17801VrYcTfD/WzhAvgG87rehlrlJ279Tkk6ggteHVWvgrRLaKD?= =?us-ascii?Q?+8j7r2YYDoQK87AnRksRx+LHtXUgxb6ehxNdEqmQEg/B3R+7CeJJmaFa13ae?= =?us-ascii?Q?24HwGTxJq8NfdDEgx0Mi15/Q98xRwkuauxPrfOM6/YF3SC2LDxzpljeiue/s?= =?us-ascii?Q?gtssot+IbgWSa68ItrqvVxK2gXTgmONaYGkF3rAZM5p51Gdq6UpAUVVNMMeV?= =?us-ascii?Q?Daa5ICwjQkSCHFJG3zlB1BJ414ZakaRwTIrqT7cwNjA7up4NNWocWMZx83JR?= =?us-ascii?Q?wuzR4xmsHZf+sDxkOP3GEE9wqHCHuHTYmSOMj9+wpJQV0TaueTFxdLfxbLx8?= =?us-ascii?Q?/W/jRAAjbXTFgnJrz/JRI9TOpda6D/7NxqhBBT3ONcwHut0Lmj3bILarxjsB?= =?us-ascii?Q?D3bmrl5dEkNyndRpOMRi3tzEgZsUtvsFdw8mm9XEce02iKVuJOu2oBuN7aBV?= =?us-ascii?Q?9hp3wG1oG/IvgNlekaBxOv1+QudBiEqIky1tIbVBJQHg+DIi8iosl2crkYok?= =?us-ascii?Q?+QW3QazjXTymqbcwf1qAxmhSNmYM+zzzjW9Bz+GTxihqPJ0VIuxd3dm8/4t9?= =?us-ascii?Q?aFHEHtqlqMwVZ0d7WNL0+c96fvHMo3Wb2wcNnkp/QVMIHdUANQCZsJCu9aYB?= =?us-ascii?Q?2AyGp18uGgEsx8aCY7gfcU3+AfMdA+HoCIkX1lTrX+nCDCPEWJgxAjBZKCl9?= =?us-ascii?Q?CWL5by+6yhC7d/e7Prp7GKzoMoXPhwu6gm7AdqsIDXBHHfVpnHU80XvAUkdP?= =?us-ascii?Q?wgSD7hQSkwQaHD1QuYNYsI/8iOsW9u7ZkyLJKOaocFayxh0KtsDcGDT6rS6D?= =?us-ascii?Q?06iO5AG17w/2JvuWIivARXFpHPXM30Wvf3yyf/CC9ROthSF10JCOrVOGK2Ue?= =?us-ascii?Q?n7gt56ALVkAY1/ACYQ6a5U15yBi9ZkrkDlYKhYhHZdnIyE4i9vf6z71yMk4s?= =?us-ascii?Q?xVqDAm22NACNM+IvgvnYQzgaN28vLvg7ayOw5ZKoZMyagBWze2VyhIUjNjl/?= =?us-ascii?Q?dTMkfnyZPHykarWzAgen/UbHFtvuRJIgIl4ZbE8Eyk3TNQJRzj6VHtmV6ToE?= =?us-ascii?Q?0/nMaRPkr5LDzVDGieED4OAKtC+C9D+zm19cXw3BG2ywoeGitMIA+YKMsbWY?= =?us-ascii?Q?sMI4kJnMgfsfAiUJwFz55mNbZr7wgGZglO2nYjRMTFX/uKtn0NRQ528ukLWd?= =?us-ascii?Q?kLX7jCotzBxZOQ8eNUCUoupPTQ3d1qvXQFSAexQnuBy1cPI35WKTV//9zRqb?= =?us-ascii?Q?Cb7xjV2pD0L2nxZpmbOH8shvBaIibJEOvMWU/2aXmLozoXV5r3uFKwDVGiHO?= =?us-ascii?Q?0RciuaclkcPItR3wchXohJv29BNr/fTnSrQ4Tbh6Zr2IV8YuhWvAaM4PZN4t?= =?us-ascii?Q?bgi8jdw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CqmE5d9RdDpLYLmyZBMbz6sGo0+bMgbx5biYN7cS1y4kM/l15UmRsANHvqVE?= =?us-ascii?Q?A25kNIlNLl79QJfLjh8SciWCpjt0xm9WsortMyiOKqEyeoF1AJ+bMme8R9m5?= =?us-ascii?Q?ZNV/+JSznP5KVMkHMZjVXbf452iMUvS1nJShHWzgCyAyAiO/q7c8+RBTCFAT?= =?us-ascii?Q?H3SFPER9PEFz8CnRPVrhzbMPavOYaOYedLky32DkWkIlyvmNAbo7hY51LohG?= =?us-ascii?Q?UeA1kB9AMKJqC4ppqeS9uqCgN7saLYE9Dvtw2CutYnCMEPU62mZbAUzXW/WE?= =?us-ascii?Q?ro9Okt074qom3sDeZi5Sr81aqnY+zpj2dN7KUD+CUmz7KU/Z+Vi0HT5EvMFs?= =?us-ascii?Q?g+1FWqiMxuD+0Ng/f5DWdwcQI8H4QJg2CjKVmrssIymP+n7xJ7o5b8HmxTNw?= =?us-ascii?Q?gWJcJeR193ae1IsrE0o/e4+r02+0L57rA0rMfHP9JedjPuK0AqdhsQukufny?= =?us-ascii?Q?kS/VIpu3f2VjJc2aqhHhaOt4RJUMsq6FOczUfNNWpNfb5iTSEWBy1BNr808M?= =?us-ascii?Q?4pk2+w18+9F6yiGUXJPIVPa+fvbG+2e3kVQoZsNrpsakhQCoDBoqvm/dkyl/?= =?us-ascii?Q?ksWyzCsxl05W9APCDrTmMRnbd+fXCQIAeWD2GJX/ErHybdR9br54qovj+xFW?= =?us-ascii?Q?aRZjG+Ve0TGKEVem4WLpBMKprXenuUNQIOM/ndA68Cy+Xm1MIoYpWt2LYSqu?= =?us-ascii?Q?KEl6vJFb0ng5Ksaa/BN5jYKxbUvEONM1fhzNboHB7TPmRs9S/Csk9MyfEW66?= =?us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6-546b-44c1-9bcd-08dced1b4d53 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:29.9436 (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: NkHfBxgK2idUAClWGW06kStVrLQUl6xasMO5rzvpu76ypxSjd4AlNK1tYuT8QOGZYLQZmcIRgAEJjRIR0vXqrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" From: Clark Wang Extract enetc_int_vector_init() and enetc_int_vector_destroy() from enetc_alloc_msix() so that the code is more concise and readable. Signed-off-by: Clark Wang Signed-off-by: Wei Fang --- v2 changes: This patch is separated from v1 patch 9 ("net: enetc: optimize the allocation of tx_bdr"). Separate enetc_int_vector_init() from the original patch. In addition, add new help function enetc_int_vector_destroy(). --- drivers/net/ethernet/freescale/enetc/enetc.c | 174 +++++++++---------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/eth= ernet/freescale/enetc/enetc.c index 032d8eadd003..d36af3f8ba31 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2965,6 +2965,87 @@ int enetc_ioctl(struct net_device *ndev, struct ifre= q *rq, int cmd) } EXPORT_SYMBOL_GPL(enetc_ioctl); =20 +static int enetc_int_vector_init(struct enetc_ndev_priv *priv, int i, + int v_tx_rings) +{ + struct enetc_int_vector *v __free(kfree); + struct enetc_bdr *bdr; + int j, err; + + v =3D kzalloc(struct_size(v, tx_ring, v_tx_rings), GFP_KERNEL); + if (!v) + return -ENOMEM; + + bdr =3D &v->rx_ring; + bdr->index =3D i; + bdr->ndev =3D priv->ndev; + bdr->dev =3D priv->dev; + bdr->bd_count =3D priv->rx_bd_count; + bdr->buffer_offset =3D ENETC_RXB_PAD; + priv->rx_ring[i] =3D bdr; + + err =3D xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0); + if (err) + return err; + + err =3D xdp_rxq_info_reg_mem_model(&bdr->xdp.rxq, + MEM_TYPE_PAGE_SHARED, NULL); + if (err) { + xdp_rxq_info_unreg(&bdr->xdp.rxq); + return err; + } + + /* init defaults for adaptive IC */ + if (priv->ic_mode & ENETC_IC_RX_ADAPTIVE) { + v->rx_ictt =3D 0x1; + v->rx_dim_en =3D true; + } + + INIT_WORK(&v->rx_dim.work, enetc_rx_dim_work); + netif_napi_add(priv->ndev, &v->napi, enetc_poll); + v->count_tx_rings =3D v_tx_rings; + + for (j =3D 0; j < v_tx_rings; j++) { + int idx; + + /* default tx ring mapping policy */ + idx =3D priv->bdr_int_num * j + i; + __set_bit(idx, &v->tx_rings_map); + bdr =3D &v->tx_ring[j]; + bdr->index =3D idx; + bdr->ndev =3D priv->ndev; + bdr->dev =3D priv->dev; + bdr->bd_count =3D priv->tx_bd_count; + priv->tx_ring[idx] =3D bdr; + } + + priv->int_vector[i] =3D no_free_ptr(v); + + return 0; +} + +static void enetc_int_vector_destroy(struct enetc_ndev_priv *priv, int i) +{ + struct enetc_int_vector *v =3D priv->int_vector[i]; + struct enetc_bdr *rx_ring =3D &v->rx_ring; + int j, tx_ring_index; + + xdp_rxq_info_unreg_mem_model(&rx_ring->xdp.rxq); + xdp_rxq_info_unreg(&rx_ring->xdp.rxq); + netif_napi_del(&v->napi); + cancel_work_sync(&v->rx_dim.work); + + priv->rx_ring[i] =3D NULL; + + for (j =3D 0; j < v->count_tx_rings; j++) { + tx_ring_index =3D priv->bdr_int_num * j + i; + priv->tx_ring[tx_ring_index] =3D NULL; + } + + kfree(v); + priv->int_vector[i] =3D NULL; +} + int enetc_alloc_msix(struct enetc_ndev_priv *priv) { struct pci_dev *pdev =3D priv->si->pdev; @@ -2986,64 +3067,9 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv) /* # of tx rings per int vector */ v_tx_rings =3D priv->num_tx_rings / priv->bdr_int_num; =20 - for (i =3D 0; i < priv->bdr_int_num; i++) { - struct enetc_int_vector *v; - struct enetc_bdr *bdr; - int j; - - v =3D kzalloc(struct_size(v, tx_ring, v_tx_rings), GFP_KERNEL); - if (!v) { - err =3D -ENOMEM; + for (i =3D 0; i < priv->bdr_int_num; i++) + if (enetc_int_vector_init(priv, i, v_tx_rings)) goto fail; - } - - priv->int_vector[i] =3D v; - - bdr =3D &v->rx_ring; - bdr->index =3D i; - bdr->ndev =3D priv->ndev; - bdr->dev =3D priv->dev; - bdr->bd_count =3D priv->rx_bd_count; - bdr->buffer_offset =3D ENETC_RXB_PAD; - priv->rx_ring[i] =3D bdr; - - err =3D xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0); - if (err) { - kfree(v); - goto fail; - } - - err =3D xdp_rxq_info_reg_mem_model(&bdr->xdp.rxq, - MEM_TYPE_PAGE_SHARED, NULL); - if (err) { - xdp_rxq_info_unreg(&bdr->xdp.rxq); - kfree(v); - goto fail; - } - - /* init defaults for adaptive IC */ - if (priv->ic_mode & ENETC_IC_RX_ADAPTIVE) { - v->rx_ictt =3D 0x1; - v->rx_dim_en =3D true; - } - INIT_WORK(&v->rx_dim.work, enetc_rx_dim_work); - netif_napi_add(priv->ndev, &v->napi, enetc_poll); - v->count_tx_rings =3D v_tx_rings; - - for (j =3D 0; j < v_tx_rings; j++) { - int idx; - - /* default tx ring mapping policy */ - idx =3D priv->bdr_int_num * j + i; - __set_bit(idx, &v->tx_rings_map); - bdr =3D &v->tx_ring[j]; - bdr->index =3D idx; - bdr->ndev =3D priv->ndev; - bdr->dev =3D priv->dev; - bdr->bd_count =3D priv->tx_bd_count; - priv->tx_ring[idx] =3D bdr; - } - } =20 num_stack_tx_queues =3D enetc_num_stack_tx_queues(priv); =20 @@ -3062,16 +3088,8 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv) return 0; =20 fail: - while (i--) { - struct enetc_int_vector *v =3D priv->int_vector[i]; - struct enetc_bdr *rx_ring =3D &v->rx_ring; - - xdp_rxq_info_unreg_mem_model(&rx_ring->xdp.rxq); - xdp_rxq_info_unreg(&rx_ring->xdp.rxq); - netif_napi_del(&v->napi); - cancel_work_sync(&v->rx_dim.work); - kfree(v); - } + while (i--) + enetc_int_vector_destroy(priv, i); =20 pci_free_irq_vectors(pdev); =20 @@ -3083,26 +3101,8 @@ void enetc_free_msix(struct enetc_ndev_priv *priv) { int i; =20 - for (i =3D 0; i < priv->bdr_int_num; i++) { - struct enetc_int_vector *v =3D priv->int_vector[i]; - struct enetc_bdr *rx_ring =3D &v->rx_ring; - - xdp_rxq_info_unreg_mem_model(&rx_ring->xdp.rxq); - xdp_rxq_info_unreg(&rx_ring->xdp.rxq); - netif_napi_del(&v->napi); - cancel_work_sync(&v->rx_dim.work); - } - - for (i =3D 0; i < priv->num_rx_rings; i++) - priv->rx_ring[i] =3D NULL; - - for (i =3D 0; i < priv->num_tx_rings; i++) - priv->tx_ring[i] =3D NULL; - - for (i =3D 0; i < priv->bdr_int_num; i++) { - kfree(priv->int_vector[i]); - priv->int_vector[i] =3D NULL; - } + for (i =3D 0; i < priv->bdr_int_num; i++) + enetc_int_vector_destroy(priv, i); =20 /* disable all MSIX for this device */ pci_free_irq_vectors(priv->si->pdev); --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2072.outbound.protection.outlook.com [40.107.20.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D5F122737B; Tue, 15 Oct 2024 13:14:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998080; cv=fail; b=PY8yP6l+u0kI9JwqZqAyU7zbb7CyZHeUtEl/ZEMHyozNsyqhGN+LpJpoJCV/Pc2fdrmwei0IQFI9XGA/tK5pFhiii8ivKjFFEDX0cQEQqBpYFfh0ESPXy53xI01Nmgq6W3618RvDMm0qc3uC63GLG3A8uYsFkfUi0V1IAqJCNK8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998080; c=relaxed/simple; bh=sQLdV0v06zyyvLzB9Nv1+dtWHHhm+b8u8Jz1UJzn52w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Kv9BIF7wpvJUIPbVlwXFklnPfQqOXRTmE+5dM+EPl7RCmCoFcvKhGszsIhpcFAO7a5NUotTSOywglWmHkqor3gilxRsYYSsumgJf2IXbxCzFlWPyUCzMPqPZB9c0kA1VlSIb/wz2u3darc1L83Dyp94VWa8AA3BrGyOyMDzuCn8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=jjZ0zksH; arc=fail smtp.client-ip=40.107.20.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="jjZ0zksH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J9KS28CbWM0YmuUJ7wWY/ENFUHT1jwpgx5EfitvQ+YzI8Zz/CQAzGdWaXfFaezgyAPJYyuuqxTrIRzjIW82tv/FrwG2H0NgUMPQSNvnkd7WH8ZoIHt8GCAz3SHGPa7IM0QXZAiC4mCEPO5DZv631LczagKhJpon4Y6nlSosIZRMQT3eiVtM8BVbL3nH4ZFzV3E9gL5TcA7PJQYsyi10ToLldGkxOrtRyu4GfhUdrmHrBv371yXoqPXX2aJqrPu7JJG0LbjfMSTCeQNQuwcsO0as0h/wvBJLh1AjtuE4r5qjkdX+iUsyp/z3tNi83sQxlHkrQaff9FSIzIOIDQy42XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=FHPIArrijIa1XkRQC3JI75JkmI699A8/kvPPVkroewg=; b=tufoOw008+l34I56W2wFEV7roylPKgjuVzEVKc/4q+py7fH03ReHUge3B62s/vVi6TmA4jlDqTgtpXYUwsgqo0IUwyTmQmB9pgVXPakwnJ3BBDHeRCv+6flToNEOtuR3UH/u/VPegsCG9NkwfAUloU0BbRPCP5LhJcfO0HtDoRYvjk5aJPDxdemeki6TNpMgwoZ844xLFo5SzAI2TCuFczlGbcOZzcXYEI4gl99RQVvvmN1ArS+HPjWm3+ccPjKtHa1M0nMzuz8QaJ9TVIluV+7VlwgSrKY5RPokulX5/pBQo5Apr2RvGfccdBoF/iEcIlAVh/ZwBtNpcdL8i4wLJw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FHPIArrijIa1XkRQC3JI75JkmI699A8/kvPPVkroewg=; b=jjZ0zksH9CeiS2YWrDltypzkCbo8OX+CY6tyJHOsBgy7YOv4YstNrFkk95ITbgKg/6Z7KuSpxJz9dyrP0A+EhxKI/oDNtKyu/GBKQirnHWg64l/2HLKPPmHZeRPHfie7dP4flr2cq1pXJUWsG7jE3sZy0ulN6eyAM1xhRQhi9aKEMXiGDzOfC6cKGy+1wpe7evebsxl/C2bblckBW2tEE7Nvn3vpjQfPuxNiVbBt0UvWwJTooSpi26LDujPWv+WWjK4s4REUDRgxl3rhavusMWzruM96GMCwrRNOAM2uOGdpz5SUSHb++6uDVkNVQLp8YNqeG8IhXP/ygmDwMjmxbA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:35 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:35 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 11/13] net: enetc: optimize the allocation of tx_bdr Date: Tue, 15 Oct 2024 20:58:39 +0800 Message-Id: <20241015125841.1075560-12-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: 4491cf10-da53-43eb-5e23-08dced1b50ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?oM6SOMveA6PZWgteFpFYx6F2/61csWTw9D+jS8HhqPQmH/PkbpYbohhmPiSO?= =?us-ascii?Q?bY3qeE71EGTA4n4K2I1obZrRfEAYpihQv1ofJMDawXkEyJYzAjzfbGleCQbU?= =?us-ascii?Q?F6kbJbwKUabeYTiowc1PKX7HFQlw01R7Slvfit+YOKHRWjk7WKXg82i0KsPo?= =?us-ascii?Q?cq6xJTebWyeNd1lqMv4pTvkOKBqIt20uxtAvF8gIY3bgqqRX+hOStx+axnCZ?= =?us-ascii?Q?1dy6+KVjiQuPlkzZt10+XiNyFGoUM0R2TbfKhGWecOgd0Z9TLpUVqEOaoLHF?= =?us-ascii?Q?Bq17QQqzH4lFX5+1n7Mms4AhZ7cL+MKAz/V9jPp1hOPZElah/xM6o7g2gDwF?= =?us-ascii?Q?VvqfdLmWwmSQ42G5aMtGIi8iEh/2GETCie61PaH1FetDqppFLwIn5H1WdBIc?= =?us-ascii?Q?e2yF29IMDneO4FyEJ5lCx3Tjg21BDm/ya7kS5jitB9eS+nxuVGRaXz5QMS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ODnCqThIRGyLk0a7aUr6g=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?j2Wd9MlnApb339V6tYn2R6zNFiY7J4N+hn6G0JC7xj5nwMR7fzOyZU4wTRfn?= =?us-ascii?Q?MeQldO1cnOSHlwdmPXYTxL6MM4OwzpRkPO7NGeN2gGcZ5cEYrIixuu7Z5on4?= =?us-ascii?Q?ANoaOUkFdNGcMPF5xsQcgUQBH0pXofjCJ7FSqGJrFVHQ+BMtjZvK6CLoJJ7N?= =?us-ascii?Q?u5RbnaKDecTdDv2kAg0JZIFdtAtrKGvCbILS49WfP8jkVE09USGerOAr0idn?= =?us-ascii?Q?ppP7JS9GF+tU5N85lUapo6pInb0ChRFCv7wBzgVYEnwennpCNMvyZ603Dl/A?= =?us-ascii?Q?qtHOBibWqizEj9Aufu6yIcLgtSZUBWPQYlLYvdnZy2UCO9BKNbkIOQDjGOWm?= =?us-ascii?Q?TlpHb6j41qVWmtQgMWAo2ti8E0by4f4n61W5X2s4LKw6Ms3y+Ijl/oTZ17nT?= =?us-ascii?Q?/okLJOdjM1mr27ZwAGbuDlLA/tSY0qx7VBCHU/MvSFbw5xEqL4qQYp8jNNuo?= =?us-ascii?Q?yYAlrChiFhO/dxjy51p8kzfxvRxnSUZ4axrb2RMylFNNd/3cuhYVA78y4Il2?= =?us-ascii?Q?e79OZS4AqmHXdefpRA1ELuZdKofcOVgFX7ZrXbdSMRNDiautA3Ek0u03G42h?= =?us-ascii?Q?AzgYYuulpxrGi6uWhjIFszbuIisuQ7TKvqjOOlAbOU9jE7potcciwdtvL7gU?= =?us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YEgZnoiMoUm7KPcmsl2OTQ5eBk?= =?us-ascii?Q?2pRvokZ6GS9GfdACxwi6N8ESVMMJ9Zx4cMfKkwc8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4491cf10-da53-43eb-5e23-08dced1b50ae X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:35.5579 (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: OKZMAqT8JImtYCkY/v0MHeJLALRdiMTYeFIo/tG6Ytu2O3gjnBWEjqX/em9W3J0+vJMFaZSTCG8KmsF3pt83pA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" From: Clark Wang There is a situation where num_tx_rings cannot be divided by bdr_int_num. For example, num_tx_rings is 8 and bdr_int_num is 3. According to the previous logic, this results in two tx_bdr corresponding memories not being allocated, so when sending packets to tx ring 6 or 7, wild pointers will be accessed. Of course, this issue doesn't exist on LS1028A, because its num_tx_rings is 8, and bdr_int_num is either 1 or 2. However, there is a risk for the upcoming i.MX95. Therefore, it is necessary to ensure that each tx_bdr can be allocated to the corresponding memory. Signed-off-by: Clark Wang Signed-off-by: Wei Fang Reviewed-by: Frank Li --- v2 changes: This patch is separated from v1 patch 9 ("net: enetc: optimize the allocation of tx_bdr"). Only the optimized part is kept. --- drivers/net/ethernet/freescale/enetc/enetc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/eth= ernet/freescale/enetc/enetc.c index d36af3f8ba31..72ddf8b16271 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -3049,10 +3049,10 @@ static void enetc_int_vector_destroy(struct enetc_n= dev_priv *priv, int i) int enetc_alloc_msix(struct enetc_ndev_priv *priv) { struct pci_dev *pdev =3D priv->si->pdev; + int v_tx_rings, v_remainder; int num_stack_tx_queues; int first_xdp_tx_ring; int i, n, err, nvec; - int v_tx_rings; =20 nvec =3D ENETC_BDR_INT_BASE_IDX + priv->bdr_int_num; /* allocate MSIX for both messaging and Rx/Tx interrupts */ @@ -3066,10 +3066,14 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv) =20 /* # of tx rings per int vector */ v_tx_rings =3D priv->num_tx_rings / priv->bdr_int_num; + v_remainder =3D priv->num_tx_rings % priv->bdr_int_num; =20 - for (i =3D 0; i < priv->bdr_int_num; i++) - if (enetc_int_vector_init(priv, i, v_tx_rings)) + for (i =3D 0; i < priv->bdr_int_num; i++) { + int num_tx_rings =3D i < v_remainder ? v_tx_rings + 1 : v_tx_rings; + + if (enetc_int_vector_init(priv, i, num_tx_rings)) goto fail; + } =20 num_stack_tx_queues =3D enetc_num_stack_tx_queues(priv); =20 --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 868621B21AE; Tue, 15 Oct 2024 13:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998089; cv=fail; b=INe7CQoBDFcquQSowk1DeP/hV2wJTInzh+Dbnl8uxejP3XKGTEwgMz+ioqgPmJ9euZSpyTahjYyga7hB34GTK1na15hQSguMXPmNSJAxiBaItz29SdNZiGbgUP5AVWqKL5+qz0yZeZGSgqioyS7zkdbVeA9UzMR9thDNFPOmYoY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998089; c=relaxed/simple; bh=6TJLSHMobtuA5qbBaO/1aZa41MYkdwkjSPf8jbThMWw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=U9UQfus9n7RREmBGkOr09/nYqEZ0vIitC2AtxLIY8d14RnUfu0ngk2nytjdPPoHqwS4eV7VJ7WedlRinrOMsIuMXZ05sPkcb8JWJrMW5cAH2gQWNUpBTl0IFeFlkJheflJKseMwaBtWACPRh4i1RN5SlC3m38IdQWdyu6Ppgjas= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Rg1hxEyA; arc=fail smtp.client-ip=40.107.21.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Rg1hxEyA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X+CyGSK8Pda4ZuBubqKurUEZxKUT4zELigt4Fh/B5oTxErszMVDWyZqxRdhgNvoniTBP0wM3iqC4nbjnNke05QybrlkeaA0thmY2Psn8WGtHdKZqgFQImp01w5A6cj3wtKkcEuthwv3jswb/40ilHubF523vGUs++2bB/dQiFvrgsliVhUdKGJcR+rKsMaSnFZPjp0HVTAVfyYjYyPc1t0O+oXpI6lqk4HD2iQW+MUmKVAeiJS6nY9RzJO98MNZBCpx9RHcEqyl9ajaQAV0ay5oGmNV4Z3w58BE47Y8PpW3R80w1swkNWjc9ZIvA4Q8oNAcMY5fH5713kspOdTqitA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mNAVmboS3Sq7TLBeQrAIgV93YxMaE8w21gI4KK0O8d0=; b=ioTvnR03H13YKNFvzEQhrd5b+G1lbGGfR3YMBSLkW/LTBgHdEp5WjhLP1WP+Ng5L0Son/d2lnjXFq1qdRhbhDqtD3niCVoPfzTCjsZ1jt0iLYKdlxslkxoWJwxqech/u47PzrXiWBQ9sYeMKVlWRN1+1/JTfWN/LbiTPWe8rksV8Zs0S671+vvhxTt4bqGOaddcA2cFBecIUYQOR/g4TRaJvtoTGHVZ5vk+z0Eg9IcJtyCUZm7xG5Y6Mew+L9serWv0KsGgWjA/qa48xm6if+l6KEAEeTuoSM9rjR4tYAzBUORgAPWGHBNWyLC8iRMJ7jzlvPYlX0zf/506WuQO1Rg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mNAVmboS3Sq7TLBeQrAIgV93YxMaE8w21gI4KK0O8d0=; b=Rg1hxEyANR+0l3DRwWcZlujGU4IDLaHQJA8lfXY/xF1bzyFA7YSg5q+z4LHF674ot2XMR63rtu1+ieM3TR/1aQiHK3DDCV/cdARoJB51BcsPVq69dgSCQU9qzYJsFg3kbk/cPZgZjNiQULjRmDCqL7AfVO20G1i5WkHNttI718rGSCRws5uRnG3d8mCLX25ClC2S0JVkL4jSxr1RoJsE9l7hX9D4NvXNtca7FpQt4KJT8YIkr2WAr7EFqL96AGN2SLrbusU68IB9SqAjGW5k/e6DQvhsfIoDSpI3lvluZxQSimuwv5z/WH9uBekHVkuFVKzRx7aYqXIuOdXDDy0p2w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by AS5PR04MB9876.eurprd04.prod.outlook.com (2603:10a6:20b:678::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.25; Tue, 15 Oct 2024 13:14:41 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:41 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 12/13] net: enetc: add preliminary support for i.MX95 ENETC PF Date: Tue, 15 Oct 2024 20:58:40 +0800 Message-Id: <20241015125841.1075560-13-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|AS5PR04MB9876:EE_ X-MS-Office365-Filtering-Correlation-Id: cb6724fa-d766-4f2d-05ff-08dced1b5404 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|52116014|376014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YdxyBDA8gGEn4ixAnNlx1VeCl2de2I0r8KMaojeYCev7zv5cOyIHExVbDZHR?= =?us-ascii?Q?wGK0ps6aJpKtboh/VrBeq4KGgEvJnHymvYAZVUEUBVcCXgKH0jSrjoAvrJYH?= =?us-ascii?Q?Nzgin4/aTxgQeBIznRkKiDvZiEqd29iaZp3Zk8jtawIZ1W9Cz8jmZkAN7Dcx?= =?us-ascii?Q?tDXrccS29QSkaUE2AhP4yFrcVLwrZL4y5QVVfCkPM8fvNd7iC8BiPOrb1/yg?= =?us-ascii?Q?2ihWeihWw0yKHlpztnDB+G84L1P/9GEYGa9fuxJV6DwZooUzoYMkD7bh1z3U?= =?us-ascii?Q?w7798HePwEji9qZU566EVgNMKZlXRxMiaDx1V7Tp7pUdRy4+W+erZeOT9z6o?= =?us-ascii?Q?qX1ao4Vv7jb7V8koWF4wSUa38ZRAvxOXkOA/uUGGLnZP3i8BWHrxZOKrmRVm?= =?us-ascii?Q?JnX98Sw3ZJ5Vm6YhETURgyx6EfZ6mvJhbli8KuJlHkvljF6ZdQHQ8W+wzD3X?= =?us-ascii?Q?vad/7fA5BKLkdHZEUYLaZJ/z7gJdx/cwc8m+VunctLkLyA/6ZxPIxMmAu08+?= =?us-ascii?Q?gclnNekGgv37d/k6hoETXbo/ESGuP4/nprgQxFTEnVrV/mG7aFJGTcYFmgZ0?= =?us-ascii?Q?joKqzOlOfv74/gNpsUGVx5p8IzO/w3GvQJxXMUhoutO4rOtF2JDCq5d97ZNp?= =?us-ascii?Q?neF/spDAm+ueAAh3t5eQGKrZZPg9orJsV7RfLSKHMHGFipaklVnRoR58J6hO?= =?us-ascii?Q?Ah9n8izwB9/t8E4GCdltfWkcgCEpSmglcm0ESPlI4az53vDHP1LyxNIe6XKF?= =?us-ascii?Q?IU10/JS2/dqpKe2DMoLjbpfxN9kDhrnNqJh38kNDJI9Eda4YFlOBRMgnDkTO?= =?us-ascii?Q?FBgoJ7E8EM8QcygmpGQB4WyvXa/9bxObCP+WCCxF83AvJoEmlhBR0DLuLg/i?= =?us-ascii?Q?waSt/pHTn/uk6jDeJsPZxLqK+k0EQxGevoVhTU67k6012/eEMpXg9UddnGdL?= =?us-ascii?Q?I9QTvpRH+HuxKrKvOEJAl2GG1GAC7ylzDLbuKZeFcO+2FR8fAFe50SMIsFY8?= =?us-ascii?Q?oEzB4vVXEw5n4tnI6pRJX4ty30K/MVW6eERgUjMzroNsyLGkFFufpq94/mks?= =?us-ascii?Q?vIcJm00XCTy1EaeaMmO0TmGGJkhip2jdB/vM/SUmbcC1LeeTt2Vmp93qn4lb?= =?us-ascii?Q?bBkcJAyusxcf5CNVaHxyf+oYIHOPpN/Y7WG1UJJWaNIOgf012HV8EVIO+vlx?= =?us-ascii?Q?SbYoe5UloVstzqUtEHVYEfkj3YFUgEuMFIkTWM26TWel7hQmgslpLJ2dyLoY?= =?us-ascii?Q?hT0h3bHiClR/MlAQP3BrRLlZtTnSQLwZA8O28Qk6RIvoOkU9BoqL9q1jxqCF?= =?us-ascii?Q?uxNq+wEfyPpvqrG77hfvgerFa5AqIGmXGdCLLFFKLolsp+l6XWcj/xctUogW?= =?us-ascii?Q?up9SaT8=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(52116014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rwIsdIt7GKIL0nzRk1mZtttFVv3pt5Qhv3qFtCX+tAlLwykNZmcHgmHsDl+c?= =?us-ascii?Q?JO9eohy8fqbTLnkTnaf7yH6PzWLA8z9E2yC/VtK6xX833Kt7hFnbpNHxZNrh?= =?us-ascii?Q?RfsYq6EA/YJizVkoNYKmHq8b5Suq8E7Y0cbxRnZFWfVekmloCktwgDGbjIl6?= =?us-ascii?Q?xLE+4Y6M1QRkjfMLbJu4xpm2gjfOxC+4K3Mxg/oSXmqFygsFmjxn+ycZhHaY?= =?us-ascii?Q?DVZN9N/M6sTZgYov7xXIAb8S2Ol/anVogJidNAmsRnh/zDBSbFOGKWWt87oF?= =?us-ascii?Q?9uVJyBwk2zYwVWYy8lTRa8UyxKy5KTYbZ0YTbIfYoR6Z5RtCpOcROCnV/rf8?= =?us-ascii?Q?GuH6n8eSVAvXPkSJ6rBX9cI9NL3LHG9YZyPepW6ablLSmwOL44/AJ/n38aRx?= =?us-ascii?Q?ObQ20zu/WP8ukI9hKUjMFJlkArfw1iOxUOOwfCODG991ConSWqgmbdoIE+MS?= =?us-ascii?Q?0R4ZIp34r+naVTFwr8KGdK7umOuez/cwVONRpadLVTbwLIG4MRjbCj4E7ewF?= =?us-ascii?Q?BVOQI6ExRewMYTueeJ40urTe0Oc7ZI0C9aQRxKG/rBgG8V74xA/HBZg9dvr9?= =?us-ascii?Q?ob0xy7FL+Fawh4JP/yIyNM7K9dhmMCQuTNdHwzR/BDmglXbR0rZ6IGcG/moj?= =?us-ascii?Q?K1i1MgTzO3/x7GZGBvKOLE1DwWjYi/sVD3qzFQmhfYQyqj46nxarjtksWVZ5?= =?us-ascii?Q?hPcFHnkkta/egXIxUzxr+EbclIzU8aowXtNYlT6HreqWkaAChE404ZY3PBaa?= =?us-ascii?Q?FoQb6U3IkVd9SRTgZBVOSutEqXWtCvKPG0zamzDyeOmAE8PFafl+dyfhGbo9?= =?us-ascii?Q?slearFzQmiiuf69F3+HEcvf7rajYxP8bhpLk+myVAOqGyBZgtcZZtO9A5LBv?= =?us-ascii?Q?52LB1dCNMx85wGdqHZTn5I/35EqnvOy7mzNXqYGScTIZUZufXxi8WL+N94Ve?= =?us-ascii?Q?8FMRCcGWkE7iAsQ8f2cRgVBVX8+kK35h+zanZZYduUzQbNsAJxlq7gOrhf0t?= =?us-ascii?Q?OpPtujam5sL5cPhlrkGxrYpa3DOBjrXS/v+jF38dj6Y3ZNfLsiRrktfCuH5Z?= =?us-ascii?Q?Ejl5ld81wzXhNjL03wUs1iKz/4APcxhvoaal4SZKEYY3LifqJR2tZHNERZc7?= =?us-ascii?Q?RzxzH/NEHZFRb2r1RByxs3GlWAgqJUktT+6uYG5uoNjG8vFC0LYu1SNy6X70?= =?us-ascii?Q?bptMnBBAW07+KxiJ3xk4k6BTpdCyj/yAFCv5V8d0H5AeKuDC7KHQ2J2jxthb?= =?us-ascii?Q?ucNEkQVUKoWV/ELb3hDqfGMRQYXvxpG2T11niC6E+posu9kmL9c/mxQiooEa?= =?us-ascii?Q?dtnCBsJnx3acxowKBAx9SC10s8l1bUiF9qUvXPG6xvKEy4C659f93usZooc7?= =?us-ascii?Q?UmqSFyEOQvBi4syC88VogMoq0uLP9XJxLke88S9JStorJ+UQHUvB+joT5KG6?= =?us-ascii?Q?VpWPMCRBugoY/jCFkDGI+jtx6ErxKzdtYNBkOcreprgAhahqv0Vgvw7Ymrqa?= =?us-ascii?Q?01m1pBPGbiQh3ffwzzpzhz+TS8yL3T0fgMfc5KVUMmOKiQd8j16Ls1bnGqzz?= =?us-ascii?Q?uLq22TkwEUl5aCecScJgGfMRxMHiPtMzftXMMpJj?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb6724fa-d766-4f2d-05ff-08dced1b5404 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:41.3474 (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: FmA2RT+3ujKvp2sfNre3QfQJm5LSR7A/IgMtJM/ukrgtlPEdVyqvYDhYbeFdcURWDTTUY49Yzdz8lOdNGkAYJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9876 Content-Type: text/plain; charset="utf-8" The i.MX95 ENETC has been upgraded to revision 4.1, which is very different from the LS1028A ENETC (revision 1.0) except for the SI part. Therefore, the fsl-enetc driver is incompatible with i.MX95 ENETC PF. So add new nxp-enetc4 driver to support i.MX95 ENETC PF, and this driver will be used to support the ENETC PF with major revision 4 for other SoCs in the future. Currently, the nxp-enetc4 driver only supports basic transmission feature for i.MX95 ENETC PF, the more basic and advanced features will be added in the subsequent patches. Signed-off-by: Wei Fang --- v2 changes: 1. Refine the commit message. 2. Sort the header files. 3. Use dev_err_probe() in enetc4_pf_probe(). 4. Remove unused variable 'pf' from enetc4_pf_remove(). --- drivers/net/ethernet/freescale/enetc/Kconfig | 17 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + drivers/net/ethernet/freescale/enetc/enetc.c | 50 +- drivers/net/ethernet/freescale/enetc/enetc.h | 19 +- .../net/ethernet/freescale/enetc/enetc4_hw.h | 153 ++++ .../net/ethernet/freescale/enetc/enetc4_pf.c | 757 ++++++++++++++++++ .../ethernet/freescale/enetc/enetc_ethtool.c | 68 +- .../net/ethernet/freescale/enetc/enetc_hw.h | 12 +- .../net/ethernet/freescale/enetc/enetc_pf.h | 9 + .../freescale/enetc/enetc_pf_common.c | 10 +- 10 files changed, 1076 insertions(+), 22 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_hw.h create mode 100644 drivers/net/ethernet/freescale/enetc/enetc4_pf.c diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/eth= ernet/freescale/enetc/Kconfig index fdd3ecbd1dbf..750281e3d285 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -33,6 +33,23 @@ config FSL_ENETC =20 If compiled as module (M), the module name is fsl-enetc. =20 +config NXP_ENETC4 + tristate "ENETC4 PF driver" + depends on PCI_MSI + select MDIO_DEVRES + select FSL_ENETC_CORE + select FSL_ENETC_MDIO + select NXP_ENETC_PF_COMMON + select PHYLINK + select DIMLIB + help + This driver supports NXP ENETC devices with major revision 4. ENETC is + as the NIC functionality in NETC, it supports virtualization/isolation + based on PCIe Single Root IO Virtualization (SR-IOV) and a full range + of TSN standards and NIC offload capabilities. + + If compiled as module (M), the module name is nxp-enetc4. + config FSL_ENETC_VF tristate "ENETC VF driver" depends on PCI_MSI diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/et= hernet/freescale/enetc/Makefile index b81ca462e358..5417815957b5 100644 --- a/drivers/net/ethernet/freescale/enetc/Makefile +++ b/drivers/net/ethernet/freescale/enetc/Makefile @@ -11,6 +11,9 @@ fsl-enetc-y :=3D enetc_pf.o fsl-enetc-$(CONFIG_PCI_IOV) +=3D enetc_msg.o fsl-enetc-$(CONFIG_FSL_ENETC_QOS) +=3D enetc_qos.o =20 +obj-$(CONFIG_NXP_ENETC4) +=3D nxp-enetc4.o +nxp-enetc4-y :=3D enetc4_pf.o + obj-$(CONFIG_FSL_ENETC_VF) +=3D fsl-enetc-vf.o fsl-enetc-vf-y :=3D enetc_vf.o =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/eth= ernet/freescale/enetc/enetc.c index 72ddf8b16271..fd7a9dae9e14 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2,6 +2,7 @@ /* Copyright 2017-2019 NXP */ =20 #include "enetc.h" +#include #include #include #include @@ -21,7 +22,7 @@ void enetc_port_mac_wr(struct enetc_si *si, u32 reg, u32 = val) { enetc_port_wr(&si->hw, reg, val); if (si->hw_features & ENETC_SI_F_QBU) - enetc_port_wr(&si->hw, reg + ENETC_PMAC_OFFSET, val); + enetc_port_wr(&si->hw, reg + si->pmac_offset, val); } EXPORT_SYMBOL_GPL(enetc_port_mac_wr); =20 @@ -700,8 +701,10 @@ static void enetc_rx_dim_work(struct work_struct *w) net_dim_get_rx_moderation(dim->mode, dim->profile_ix); struct enetc_int_vector *v =3D container_of(dim, struct enetc_int_vector, rx_dim); + struct enetc_ndev_priv *priv =3D netdev_priv(v->rx_ring.ndev); + u64 clk_freq =3D priv->si->clk_freq; =20 - v->rx_ictt =3D enetc_usecs_to_cycles(moder.usec); + v->rx_ictt =3D enetc_usecs_to_cycles(moder.usec, clk_freq); dim->state =3D DIM_START_MEASURE; } =20 @@ -1721,14 +1724,25 @@ void enetc_get_si_caps(struct enetc_si *si) struct enetc_hw *hw =3D &si->hw; u32 val; =20 + if (is_enetc_rev1(si)) + si->clk_freq =3D ENETC_CLK; + else + si->clk_freq =3D ENETC_CLK_333M; + /* find out how many of various resources we have to work with */ val =3D enetc_rd(hw, ENETC_SICAPR0); si->num_rx_rings =3D (val >> 16) & 0xff; si->num_tx_rings =3D val & 0xff; =20 - val =3D enetc_rd(hw, ENETC_SIRFSCAPR); - si->num_fs_entries =3D ENETC_SIRFSCAPR_GET_NUM_RFS(val); - si->num_fs_entries =3D min(si->num_fs_entries, ENETC_MAX_RFS_SIZE); + val =3D enetc_rd(hw, ENETC_SIPCAPR0); + if (val & ENETC_SIPCAPR0_RFS) { + val =3D enetc_rd(hw, ENETC_SIRFSCAPR); + si->num_fs_entries =3D ENETC_SIRFSCAPR_GET_NUM_RFS(val); + si->num_fs_entries =3D min(si->num_fs_entries, ENETC_MAX_RFS_SIZE); + } else { + /* ENETC which not supports RFS */ + si->num_fs_entries =3D 0; + } =20 si->num_rss =3D 0; val =3D enetc_rd(hw, ENETC_SIPCAPR0); @@ -1742,8 +1756,11 @@ void enetc_get_si_caps(struct enetc_si *si) if (val & ENETC_SIPCAPR0_QBV) si->hw_features |=3D ENETC_SI_F_QBV; =20 - if (val & ENETC_SIPCAPR0_QBU) + if (val & ENETC_SIPCAPR0_QBU) { si->hw_features |=3D ENETC_SI_F_QBU; + si->pmac_offset =3D is_enetc_rev1(si) ? ENETC_PMAC_OFFSET : + ENETC4_PMAC_OFFSET; + } =20 if (val & ENETC_SIPCAPR0_PSFP) si->hw_features |=3D ENETC_SI_F_PSFP; @@ -2056,7 +2073,7 @@ int enetc_configure_si(struct enetc_ndev_priv *priv) /* enable SI */ enetc_wr(hw, ENETC_SIMR, ENETC_SIMR_EN); =20 - if (si->num_rss) { + if (si->num_rss && is_enetc_rev1(si)) { err =3D enetc_setup_default_rss_table(si, priv->num_rx_rings); if (err) return err; @@ -2080,9 +2097,15 @@ void enetc_init_si_rings_params(struct enetc_ndev_pr= iv *priv) */ priv->num_rx_rings =3D min_t(int, cpus, si->num_rx_rings); priv->num_tx_rings =3D si->num_tx_rings; - priv->bdr_int_num =3D cpus; + if (is_enetc_rev1(si)) { + priv->bdr_int_num =3D cpus; + priv->tx_ictt =3D enetc_usecs_to_cycles(600, ENETC_CLK); + } else { + priv->bdr_int_num =3D priv->num_rx_rings; + priv->tx_ictt =3D enetc_usecs_to_cycles(500, ENETC_CLK_333M); + } + priv->ic_mode =3D ENETC_IC_RX_ADAPTIVE | ENETC_IC_TX_MANUAL; - priv->tx_ictt =3D ENETC_TXIC_TIMETHR; } EXPORT_SYMBOL_GPL(enetc_init_si_rings_params); =20 @@ -2475,10 +2498,14 @@ int enetc_open(struct net_device *ndev) =20 extended =3D !!(priv->active_offloads & ENETC_F_RX_TSTAMP); =20 - err =3D enetc_setup_irqs(priv); + err =3D clk_prepare_enable(priv->ref_clk); if (err) return err; =20 + err =3D enetc_setup_irqs(priv); + if (err) + goto err_setup_irqs; + err =3D enetc_phylink_connect(ndev); if (err) goto err_phy_connect; @@ -2510,6 +2537,8 @@ int enetc_open(struct net_device *ndev) phylink_disconnect_phy(priv->phylink); err_phy_connect: enetc_free_irqs(priv); +err_setup_irqs: + clk_disable_unprepare(priv->ref_clk); =20 return err; } @@ -2559,6 +2588,7 @@ int enetc_close(struct net_device *ndev) enetc_assign_tx_resources(priv, NULL); =20 enetc_free_irqs(priv); + clk_disable_unprepare(priv->ref_clk); =20 return 0; } diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/eth= ernet/freescale/enetc/enetc.h index 97524dfa234c..7f1ea11c33a0 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.h +++ b/drivers/net/ethernet/freescale/enetc/enetc.h @@ -14,6 +14,7 @@ #include =20 #include "enetc_hw.h" +#include "enetc4_hw.h" =20 #define ENETC_MAC_MAXFRM_SIZE 9600 #define ENETC_MAX_MTU (ENETC_MAC_MAXFRM_SIZE - \ @@ -222,6 +223,7 @@ struct enetc_msg_swbd { }; =20 #define ENETC_REV1 0x1 +#define ENETC_REV4 0x4 enum enetc_errata { ENETC_ERR_VLAN_ISOL =3D BIT(0), ENETC_ERR_UCMCSWP =3D BIT(1), @@ -247,10 +249,22 @@ struct enetc_si { int num_rss; /* number of RSS buckets */ unsigned short pad; int hw_features; + int pmac_offset; /* Only valid for PSI which supports 802.1Qbu */ + u64 clk_freq; }; =20 #define ENETC_SI_ALIGN 32 =20 +static inline bool is_enetc_rev1(struct enetc_si *si) +{ + return si->pdev->revision =3D=3D ENETC_REV1; +} + +static inline bool is_enetc_rev4(struct enetc_si *si) +{ + return si->pdev->revision =3D=3D ENETC_REV4; +} + static inline void *enetc_si_priv(const struct enetc_si *si) { return (char *)si + ALIGN(sizeof(struct enetc_si), ENETC_SI_ALIGN); @@ -302,7 +316,7 @@ struct enetc_cls_rule { int used; }; =20 -#define ENETC_MAX_BDR_INT 2 /* fixed to max # of available cpus */ +#define ENETC_MAX_BDR_INT 6 /* fixed to max # of available cpus */ struct psfp_cap { u32 max_streamid; u32 max_psfp_filter; @@ -340,7 +354,6 @@ enum enetc_ic_mode { =20 #define ENETC_RXIC_PKTTHR min_t(u32, 256, ENETC_RX_RING_DEFAULT_SIZE / 2) #define ENETC_TXIC_PKTTHR min_t(u32, 128, ENETC_TX_RING_DEFAULT_SIZE / 2) -#define ENETC_TXIC_TIMETHR enetc_usecs_to_cycles(600) =20 struct enetc_ndev_priv { struct net_device *ndev; @@ -388,6 +401,8 @@ struct enetc_ndev_priv { * and link state updates */ struct mutex mm_lock; + + struct clk *ref_clk; /* RGMII/RMII reference clock */ }; =20 /* Messaging */ diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_hw.h b/drivers/net= /ethernet/freescale/enetc/enetc4_hw.h new file mode 100644 index 000000000000..0b2a35189e9d --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/enetc4_hw.h @@ -0,0 +1,153 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* + * This header file defines the register offsets and bit fields + * of ENETC4 PF and VFs. Note that the same registers as ENETC + * version 1.0 are defined in the enetc_hw.h file. + * + * Copyright 2024 NXP + */ +#ifndef __ENETC4_HW_H_ +#define __ENETC4_HW_H_ + +/***************************ENETC port registers**************************/ +#define ENETC4_ECAPR0 0x0 +#define ECAPR0_RFS BIT(2) +#define ECAPR0_TSD BIT(5) +#define ECAPR0_RSS BIT(8) +#define ECAPR0_RSC BIT(9) +#define ECAPR0_LSO BIT(10) +#define ECAPR0_WO BIT(13) + +#define ENETC4_ECAPR1 0x4 +#define ECAPR1_NUM_TCS GENMASK(6, 4) +#define ECAPR1_NUM_MCH GENMASK(9, 8) +#define ECAPR1_NUM_UCH GENMASK(11, 10) +#define ECAPR1_NUM_MSIX GENMASK(22, 12) +#define ECAPR1_NUM_VSI GENMASK(27, 24) +#define ECAPR1_NUM_IPV BIT(31) + +#define ENETC4_ECAPR2 0x8 +#define ECAPR2_NUM_TX_BDR GENMASK(9, 0) +#define ECAPR2_NUM_RX_BDR GENMASK(25, 16) + +#define ENETC4_PMR 0x10 +#define PMR_SI_EN(a) BIT((16 + (a))) + +/* Port Pause ON/OFF threshold register */ +#define ENETC4_PPAUONTR 0x108 +#define ENETC4_PPAUOFFTR 0x10c + +/* Port Station interface promiscuous MAC mode register */ +#define ENETC4_PSIPMMR 0x200 +#define PSIPMMR_SI0_MAC_UP BIT(0) +#define PSIPMMR_SI_MAC_UP GENMASK(2, 0) +#define PSIPMMR_SI0_MAC_MP BIT(16) +#define PSIPMMR_SI_MAC_MP GENMASK(18, 16) + +/* Port Station interface promiscuous VLAN mode register */ +#define ENETC4_PSIPVMR 0x204 + +/* Port RSS key register n. n =3D 0,1,2,...,9 */ +#define ENETC4_PRSSKR(n) ((n) * 0x4 + 0x250) + +/* Port station interface MAC address filtering capability register */ +#define ENETC4_PSIMAFCAPR 0x280 +#define PSIMAFCAPR_NUM_MAC_AFTE GENMASK(11, 0) + +/* Port station interface VLAN filtering capability register */ +#define ENETC4_PSIVLANFCAPR 0x2c0 +#define PSIVLANFCAPR_NUM_VLAN_FTE GENMASK(11, 0) + +/* Port station interface VLAN filtering mode register */ +#define ENETC4_PSIVLANFMR 0x2c4 +#define PSIVLANFMR_VS BIT(0) + +/* Port Station interface a primary MAC address registers */ +#define ENETC4_PSIPMAR0(a) ((a) * 0x80 + 0x2000) +#define ENETC4_PSIPMAR1(a) ((a) * 0x80 + 0x2004) + +/* Port station interface a configuration register 0/2 */ +#define ENETC4_PSICFGR0(a) ((a) * 0x80 + 0x2010) +#define PSICFGR0_VASE BIT(13) +#define PSICFGR0_ASE BIT(15) +#define PSICFGR0_ANTI_SPOOFING (PSICFGR0_VASE | PSICFGR0_ASE) + +#define ENETC4_PSICFGR2(a) ((a) * 0x80 + 0x2018) + +#define ENETC4_PMCAPR 0x4004 +#define PMCAPR_HD BIT(8) +#define PMCAPR_FP GENMASK(10, 9) + +/* Port configuration register */ +#define ENETC4_PCR 0x4010 +#define PCR_HDR_FMT BIT(0) +#define PCR_L2DOSE BIT(4) +#define PCR_TIMER_CS BIT(8) +#define PCR_PSPEED GENMASK(29, 16) +#define PCR_PSPEED_VAL(speed) (((speed) / 10 - 1) << 16) + +/* Port MAC address register 0/1 */ +#define ENETC4_PMAR0 0x4020 +#define ENETC4_PMAR1 0x4024 + +/* Port operational register */ +#define ENETC4_POR 0x4100 + +/* Port traffic class a transmit maximum SDU register */ +#define ENETC4_PTCTMSDUR(a) ((a) * 0x20 + 0x4208) +#define PTCTMSDUR_MAXSDU GENMASK(15, 0) +#define PTCTMSDUR_SDU_TYPE GENMASK(17, 16) +#define SDU_TYPE_PPDU 0 +#define SDU_TYPE_MPDU 1 +#define SDU_TYPE_MSDU 2 + +#define ENETC4_PMAC_OFFSET 0x400 +#define ENETC4_PM_CMD_CFG(mac) (0x5008 + (mac) * 0x400) +#define PM_CMD_CFG_TX_EN BIT(0) +#define PM_CMD_CFG_RX_EN BIT(1) +#define PM_CMD_CFG_PAUSE_FWD BIT(7) +#define PM_CMD_CFG_PAUSE_IGN BIT(8) +#define PM_CMD_CFG_TX_ADDR_INS BIT(9) +#define PM_CMD_CFG_LOOP_EN BIT(10) +#define PM_CMD_CFG_LPBK_MODE GENMASK(12, 11) +#define LPBCK_MODE_EXT_TX_CLK 0 +#define LPBCK_MODE_MAC_LEVEL 1 +#define LPBCK_MODE_INT_TX_CLK 2 +#define PM_CMD_CFG_CNT_FRM_EN BIT(13) +#define PM_CMD_CFG_TXP BIT(15) +#define PM_CMD_CFG_SEND_IDLE BIT(16) +#define PM_CMD_CFG_HD_FCEN BIT(18) +#define PM_CMD_CFG_SFD BIT(21) +#define PM_CMD_CFG_TX_FLUSH BIT(22) +#define PM_CMD_CFG_TX_LOWP_EN BIT(23) +#define PM_CMD_CFG_RX_LOWP_EMPTY BIT(24) +#define PM_CMD_CFG_SWR BIT(26) +#define PM_CMD_CFG_TS_MODE BIT(30) +#define PM_CMD_CFG_MG BIT(31) + +/* Port MAC 0/1 Maximum Frame Length Register */ +#define ENETC4_PM_MAXFRM(mac) (0x5014 + (mac) * 0x400) + +/* Port MAC 0/1 Pause Quanta Register */ +#define ENETC4_PM_PAUSE_QUANTA(mac) (0x5054 + (mac) * 0x400) + +/* Port MAC 0/1 Pause Quanta Threshold Register */ +#define ENETC4_PM_PAUSE_THRESH(mac) (0x5064 + (mac) * 0x400) + +/* Port MAC 0 Interface Mode Control Register */ +#define ENETC4_PM_IF_MODE(mac) (0x5300 + (mac) * 0x400) +#define PM_IF_MODE_IFMODE GENMASK(2, 0) +#define IFMODE_XGMII 0 +#define IFMODE_RMII 3 +#define IFMODE_RGMII 4 +#define IFMODE_SGMII 5 +#define PM_IF_MODE_REVMII BIT(3) +#define PM_IF_MODE_M10 BIT(4) +#define PM_IF_MODE_HD BIT(6) +#define PM_IF_MODE_SSP GENMASK(14, 13) +#define SSP_100M 0 +#define SSP_10M 1 +#define SSP_1G 2 +#define PM_IF_MODE_ENA BIT(15) + +#endif diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net= /ethernet/freescale/enetc/enetc4_pf.c new file mode 100644 index 000000000000..cde529a19f13 --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -0,0 +1,757 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* Copyright 2024 NXP */ +#include +#include +#include +#include +#include +#include +#include + +#include "enetc_pf.h" + +#define ENETC_SI_MAX_RING_NUM 8 + +static void enetc4_get_port_caps(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + u32 val; + + val =3D enetc_port_rd(hw, ENETC4_ECAPR1); + pf->caps.num_vsi =3D (val & ECAPR1_NUM_VSI) >> 24; + pf->caps.num_msix =3D ((val & ECAPR1_NUM_MSIX) >> 12) + 1; + + val =3D enetc_port_rd(hw, ENETC4_ECAPR2); + pf->caps.num_rx_bdr =3D (val & ECAPR2_NUM_RX_BDR) >> 16; + pf->caps.num_tx_bdr =3D val & ECAPR2_NUM_TX_BDR; + + val =3D enetc_port_rd(hw, ENETC4_PMCAPR); + pf->caps.half_duplex =3D (val & PMCAPR_HD) ? 1 : 0; +} + +static void enetc4_pf_set_si_primary_mac(struct enetc_hw *hw, int si, + const u8 *addr) +{ + u16 lower =3D get_unaligned_le16(addr + 4); + u32 upper =3D get_unaligned_le32(addr); + + if (si !=3D 0) { + __raw_writel(upper, hw->port + ENETC4_PSIPMAR0(si)); + __raw_writew(lower, hw->port + ENETC4_PSIPMAR1(si)); + } else { + __raw_writel(upper, hw->port + ENETC4_PMAR0); + __raw_writew(lower, hw->port + ENETC4_PMAR1); + } +} + +static void enetc4_pf_get_si_primary_mac(struct enetc_hw *hw, int si, + u8 *addr) +{ + u32 upper; + u16 lower; + + upper =3D __raw_readl(hw->port + ENETC4_PSIPMAR0(si)); + lower =3D __raw_readw(hw->port + ENETC4_PSIPMAR1(si)); + + put_unaligned_le32(upper, addr); + put_unaligned_le16(lower, addr + 4); +} + +static const struct enetc_pf_ops enetc4_pf_ops =3D { + .set_si_primary_mac =3D enetc4_pf_set_si_primary_mac, + .get_si_primary_mac =3D enetc4_pf_get_si_primary_mac, +}; + +static int enetc4_pf_struct_init(struct enetc_si *si) +{ + struct enetc_pf *pf =3D enetc_si_priv(si); + + pf->si =3D si; + pf->total_vfs =3D pci_sriov_get_totalvfs(si->pdev); + + enetc4_get_port_caps(pf); + enetc_pf_ops_register(pf, &enetc4_pf_ops); + + return 0; +} + +static u32 enetc4_psicfgr0_val_construct(bool is_vf, u32 num_tx_bdr, u32 n= um_rx_bdr) +{ + u32 val; + + val =3D ENETC_PSICFGR0_SET_TXBDR(num_tx_bdr); + val |=3D ENETC_PSICFGR0_SET_RXBDR(num_rx_bdr); + val |=3D ENETC_PSICFGR0_SIVC(ENETC_VLAN_TYPE_C | ENETC_VLAN_TYPE_S); + + if (is_vf) + val |=3D ENETC_PSICFGR0_VTE | ENETC_PSICFGR0_SIVIE; + + return val; +} + +static void enetc4_default_rings_allocation(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + u32 num_rx_bdr, num_tx_bdr, val; + u32 vf_tx_bdr, vf_rx_bdr; + int i, rx_rem, tx_rem; + + if (pf->caps.num_rx_bdr < ENETC_SI_MAX_RING_NUM + pf->caps.num_vsi) + num_rx_bdr =3D pf->caps.num_rx_bdr - pf->caps.num_vsi; + else + num_rx_bdr =3D ENETC_SI_MAX_RING_NUM; + + if (pf->caps.num_tx_bdr < ENETC_SI_MAX_RING_NUM + pf->caps.num_vsi) + num_tx_bdr =3D pf->caps.num_tx_bdr - pf->caps.num_vsi; + else + num_tx_bdr =3D ENETC_SI_MAX_RING_NUM; + + val =3D enetc4_psicfgr0_val_construct(false, num_tx_bdr, num_rx_bdr); + enetc_port_wr(hw, ENETC4_PSICFGR0(0), val); + + num_rx_bdr =3D pf->caps.num_rx_bdr - num_rx_bdr; + rx_rem =3D num_rx_bdr % pf->caps.num_vsi; + num_rx_bdr =3D num_rx_bdr / pf->caps.num_vsi; + + num_tx_bdr =3D pf->caps.num_tx_bdr - num_tx_bdr; + tx_rem =3D num_tx_bdr % pf->caps.num_vsi; + num_tx_bdr =3D num_tx_bdr / pf->caps.num_vsi; + + for (i =3D 0; i < pf->caps.num_vsi; i++) { + vf_tx_bdr =3D (i < tx_rem) ? num_tx_bdr + 1 : num_tx_bdr; + vf_rx_bdr =3D (i < rx_rem) ? num_rx_bdr + 1 : num_rx_bdr; + val =3D enetc4_psicfgr0_val_construct(true, vf_tx_bdr, vf_rx_bdr); + enetc_port_wr(hw, ENETC4_PSICFGR0(i + 1), val); + } +} + +static void enetc4_allocate_si_rings(struct enetc_pf *pf) +{ + enetc4_default_rings_allocation(pf); +} + +static void enetc4_pf_set_si_vlan_promisc(struct enetc_hw *hw, int si, boo= l en) +{ + u32 val =3D enetc_port_rd(hw, ENETC4_PSIPVMR); + + if (en) + val |=3D BIT(si); + else + val &=3D ~BIT(si); + + enetc_port_wr(hw, ENETC4_PSIPVMR, val); +} + +static void enetc4_set_default_si_vlan_promisc(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + int num_si =3D pf->caps.num_vsi + 1; + int i; + + /* enforce VLAN promisc mode for all SIs */ + for (i =3D 0; i < num_si; i++) + enetc4_pf_set_si_vlan_promisc(hw, i, true); +} + +/* Allocate the number of MSI-X vectors for per SI. */ +static void enetc4_set_si_msix_num(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + int i, num_msix, total_si; + u32 val; + + total_si =3D pf->caps.num_vsi + 1; + + num_msix =3D pf->caps.num_msix / total_si + + pf->caps.num_msix % total_si - 1; + val =3D num_msix & 0x3f; + enetc_port_wr(hw, ENETC4_PSICFGR2(0), val); + + num_msix =3D pf->caps.num_msix / total_si - 1; + val =3D num_msix & 0x3f; + for (i =3D 0; i < pf->caps.num_vsi; i++) + enetc_port_wr(hw, ENETC4_PSICFGR2(i + 1), val); +} + +static void enetc4_enable_all_si(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + int num_si =3D pf->caps.num_vsi + 1; + u32 si_bitmap =3D 0; + int i; + + /* Master enable for all SIs */ + for (i =3D 0; i < num_si; i++) + si_bitmap |=3D PMR_SI_EN(i); + + enetc_port_wr(hw, ENETC4_PMR, si_bitmap); +} + +static void enetc4_configure_port_si(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + + enetc4_allocate_si_rings(pf); + + /* Outer VLAN tag will be used for VLAN filtering */ + enetc_port_wr(hw, ENETC4_PSIVLANFMR, PSIVLANFMR_VS); + + enetc4_set_default_si_vlan_promisc(pf); + + /* Disable SI MAC multicast & unicast promiscuous */ + enetc_port_wr(hw, ENETC4_PSIPMMR, 0); + + enetc4_set_si_msix_num(pf); + + enetc4_enable_all_si(pf); +} + +static void enetc4_pf_reset_tc_msdu(struct enetc_hw *hw) +{ + u32 val =3D ENETC_MAC_MAXFRM_SIZE; + int tc; + + val =3D u32_replace_bits(val, SDU_TYPE_MPDU, PTCTMSDUR_SDU_TYPE); + + for (tc =3D 0; tc < 8; tc++) + enetc_port_wr(hw, ENETC4_PTCTMSDUR(tc), val); +} + +static void enetc4_set_trx_frame_size(struct enetc_pf *pf) +{ + struct enetc_si *si =3D pf->si; + + enetc_port_mac_wr(si, ENETC4_PM_MAXFRM(0), + ENETC_SET_MAXFRM(ENETC_MAC_MAXFRM_SIZE)); + + enetc4_pf_reset_tc_msdu(&si->hw); +} + +static void enetc4_set_rss_key(struct enetc_hw *hw, const u8 *bytes) +{ + int i; + + for (i =3D 0; i < ENETC_RSSHASH_KEY_SIZE / 4; i++) + enetc_port_wr(hw, ENETC4_PRSSKR(i), ((u32 *)bytes)[i]); +} + +static void enetc4_set_default_rss_key(struct enetc_pf *pf) +{ + u8 hash_key[ENETC_RSSHASH_KEY_SIZE] =3D {0}; + struct enetc_hw *hw =3D &pf->si->hw; + + /* set up hash key */ + get_random_bytes(hash_key, ENETC_RSSHASH_KEY_SIZE); + enetc4_set_rss_key(hw, hash_key); +} + +static void enetc4_enable_trx(struct enetc_pf *pf) +{ + struct enetc_hw *hw =3D &pf->si->hw; + + /* Enable port transmit/receive */ + enetc_port_wr(hw, ENETC4_POR, 0); +} + +static void enetc4_configure_port(struct enetc_pf *pf) +{ + enetc4_configure_port_si(pf); + enetc4_set_trx_frame_size(pf); + enetc4_set_default_rss_key(pf); + enetc4_enable_trx(pf); +} + +static int enetc4_pf_init(struct enetc_pf *pf) +{ + struct device *dev =3D &pf->si->pdev->dev; + int err; + + /* Initialize the MAC address for PF and VFs */ + err =3D enetc_setup_mac_addresses(dev->of_node, pf); + if (err) { + dev_err(dev, "Failed to set MAC addresses\n"); + return err; + } + + enetc4_configure_port(pf); + + return 0; +} + +static const struct net_device_ops enetc4_ndev_ops =3D { + .ndo_open =3D enetc_open, + .ndo_stop =3D enetc_close, + .ndo_start_xmit =3D enetc_xmit, + .ndo_get_stats =3D enetc_get_stats, + .ndo_set_mac_address =3D enetc_pf_set_mac_addr, +}; + +static struct phylink_pcs * +enetc4_pl_mac_select_pcs(struct phylink_config *config, phy_interface_t if= ace) +{ + struct enetc_pf *pf =3D phylink_to_enetc_pf(config); + + return pf->pcs; +} + +static void enetc4_mac_config(struct enetc_pf *pf, unsigned int mode, + phy_interface_t phy_mode) +{ + struct enetc_ndev_priv *priv =3D netdev_priv(pf->si->ndev); + struct enetc_si *si =3D pf->si; + u32 val; + + val =3D enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val &=3D ~(PM_IF_MODE_IFMODE | PM_IF_MODE_ENA); + + switch (phy_mode) { + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_RXID: + case PHY_INTERFACE_MODE_RGMII_TXID: + val |=3D IFMODE_RGMII; + /* We need to enable auto-negotiation for the MAC + * if its RGMII interface support In-Band status. + */ + if (phylink_autoneg_inband(mode)) + val |=3D PM_IF_MODE_ENA; + break; + case PHY_INTERFACE_MODE_RMII: + val |=3D IFMODE_RMII; + break; + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_2500BASEX: + val |=3D IFMODE_SGMII; + break; + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_USXGMII: + val |=3D IFMODE_XGMII; + break; + default: + dev_err(priv->dev, + "Unsupported PHY mode:%d\n", phy_mode); + return; + } + + enetc_port_mac_wr(si, ENETC4_PM_IF_MODE(0), val); +} + +static void enetc4_pl_mac_config(struct phylink_config *config, unsigned i= nt mode, + const struct phylink_link_state *state) +{ + struct enetc_pf *pf =3D phylink_to_enetc_pf(config); + + enetc4_mac_config(pf, mode, state->interface); +} + +static void enetc4_set_port_speed(struct enetc_ndev_priv *priv, int speed) +{ + u32 old_speed =3D priv->speed; + u32 val; + + if (speed =3D=3D old_speed) + return; + + val =3D enetc_port_rd(&priv->si->hw, ENETC4_PCR); + val &=3D ~PCR_PSPEED; + + switch (speed) { + case SPEED_100: + case SPEED_1000: + case SPEED_2500: + case SPEED_10000: + val |=3D (PCR_PSPEED & PCR_PSPEED_VAL(speed)); + break; + case SPEED_10: + default: + val |=3D (PCR_PSPEED & PCR_PSPEED_VAL(SPEED_10)); + } + + priv->speed =3D speed; + enetc_port_wr(&priv->si->hw, ENETC4_PCR, val); +} + +static void enetc4_set_rgmii_mac(struct enetc_pf *pf, int speed, int duple= x) +{ + struct enetc_si *si =3D pf->si; + u32 old_val, val; + + old_val =3D enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val =3D old_val & ~(PM_IF_MODE_ENA | PM_IF_MODE_M10 | PM_IF_MODE_REVMII); + + switch (speed) { + case SPEED_1000: + val =3D u32_replace_bits(val, SSP_1G, PM_IF_MODE_SSP); + break; + case SPEED_100: + val =3D u32_replace_bits(val, SSP_100M, PM_IF_MODE_SSP); + break; + case SPEED_10: + val =3D u32_replace_bits(val, SSP_10M, PM_IF_MODE_SSP); + } + + val =3D u32_replace_bits(val, duplex =3D=3D DUPLEX_FULL ? 0 : 1, + PM_IF_MODE_HD); + + if (val =3D=3D old_val) + return; + + enetc_port_mac_wr(si, ENETC4_PM_IF_MODE(0), val); +} + +static void enetc4_set_rmii_mac(struct enetc_pf *pf, int speed, int duplex) +{ + struct enetc_si *si =3D pf->si; + u32 old_val, val; + + old_val =3D enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val =3D old_val & ~(PM_IF_MODE_ENA | PM_IF_MODE_SSP); + + switch (speed) { + case SPEED_100: + val &=3D ~PM_IF_MODE_M10; + break; + case SPEED_10: + val |=3D PM_IF_MODE_M10; + } + + val =3D u32_replace_bits(val, duplex =3D=3D DUPLEX_FULL ? 0 : 1, + PM_IF_MODE_HD); + + if (val =3D=3D old_val) + return; + + enetc_port_mac_wr(si, ENETC4_PM_IF_MODE(0), val); +} + +static void enetc4_set_hd_flow_control(struct enetc_pf *pf, bool enable) +{ + struct enetc_si *si =3D pf->si; + u32 old_val, val; + + if (!pf->caps.half_duplex) + return; + + old_val =3D enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val =3D u32_replace_bits(old_val, enable ? 1 : 0, PM_CMD_CFG_HD_FCEN); + if (val =3D=3D old_val) + return; + + enetc_port_mac_wr(si, ENETC4_PM_CMD_CFG(0), val); +} + +static void enetc4_set_rx_pause(struct enetc_pf *pf, bool rx_pause) +{ + struct enetc_si *si =3D pf->si; + u32 old_val, val; + + old_val =3D enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val =3D u32_replace_bits(old_val, rx_pause ? 0 : 1, PM_CMD_CFG_PAUSE_IGN); + if (val =3D=3D old_val) + return; + + enetc_port_mac_wr(si, ENETC4_PM_CMD_CFG(0), val); +} + +static void enetc4_set_tx_pause(struct enetc_pf *pf, int num_rxbdr, bool t= x_pause) +{ + u32 pause_off_thresh =3D 0, pause_on_thresh =3D 0; + u32 init_quanta =3D 0, refresh_quanta =3D 0; + struct enetc_hw *hw =3D &pf->si->hw; + u32 rbmr, old_rbmr; + int i; + + for (i =3D 0; i < num_rxbdr; i++) { + old_rbmr =3D enetc_rxbdr_rd(hw, i, ENETC_RBMR); + rbmr =3D u32_replace_bits(old_rbmr, tx_pause ? 1 : 0, ENETC_RBMR_CM); + if (rbmr =3D=3D old_rbmr) + continue; + + enetc_rxbdr_wr(hw, i, ENETC_RBMR, rbmr); + } + + if (tx_pause) { + /* When the port first enters congestion, send a PAUSE request + * with the maximum number of quanta. When the port exits + * congestion, it will automatically send a PAUSE frame with + * zero quanta. + */ + init_quanta =3D 0xffff; + + /* Also, set up the refresh timer to send follow-up PAUSE + * frames at half the quanta value, in case the congestion + * condition persists. + */ + refresh_quanta =3D 0xffff / 2; + + /* Start emitting PAUSE frames when 3 large frames (or more + * smaller frames) have accumulated in the FIFO waiting to be + * DMAed to the RX ring. + */ + pause_on_thresh =3D 3 * ENETC_MAC_MAXFRM_SIZE; + pause_off_thresh =3D 1 * ENETC_MAC_MAXFRM_SIZE; + } + + enetc_port_mac_wr(pf->si, ENETC4_PM_PAUSE_QUANTA(0), init_quanta); + enetc_port_mac_wr(pf->si, ENETC4_PM_PAUSE_THRESH(0), refresh_quanta); + enetc_port_wr(hw, ENETC4_PPAUONTR, pause_on_thresh); + enetc_port_wr(hw, ENETC4_PPAUOFFTR, pause_off_thresh); +} + +static void enetc4_enable_mac(struct enetc_pf *pf, bool en) +{ + struct enetc_si *si =3D pf->si; + u32 val; + + val =3D enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val &=3D ~(PM_CMD_CFG_TX_EN | PM_CMD_CFG_RX_EN); + val |=3D en ? (PM_CMD_CFG_TX_EN | PM_CMD_CFG_RX_EN) : 0; + + enetc_port_mac_wr(si, ENETC4_PM_CMD_CFG(0), val); +} + +static void enetc4_pl_mac_link_up(struct phylink_config *config, + struct phy_device *phy, unsigned int mode, + phy_interface_t interface, int speed, + int duplex, bool tx_pause, bool rx_pause) +{ + struct enetc_pf *pf =3D phylink_to_enetc_pf(config); + struct enetc_si *si =3D pf->si; + struct enetc_ndev_priv *priv; + bool hd_fc =3D false; + + priv =3D netdev_priv(si->ndev); + enetc4_set_port_speed(priv, speed); + + if (!phylink_autoneg_inband(mode) && + phy_interface_mode_is_rgmii(interface)) + enetc4_set_rgmii_mac(pf, speed, duplex); + + if (interface =3D=3D PHY_INTERFACE_MODE_RMII) + enetc4_set_rmii_mac(pf, speed, duplex); + + if (duplex =3D=3D DUPLEX_FULL) { + /* When preemption is enabled, generation of PAUSE frames + * must be disabled, as stated in the IEEE 802.3 standard. + */ + if (priv->active_offloads & ENETC_F_QBU) + tx_pause =3D false; + } else { /* DUPLEX_HALF */ + if (tx_pause || rx_pause) + hd_fc =3D true; + + /* As per 802.3 annex 31B, PAUSE frames are only supported + * when the link is configured for full duplex operation. + */ + tx_pause =3D false; + rx_pause =3D false; + } + + enetc4_set_hd_flow_control(pf, hd_fc); + enetc4_set_tx_pause(pf, priv->num_rx_rings, tx_pause); + enetc4_set_rx_pause(pf, rx_pause); + enetc4_enable_mac(pf, true); +} + +static void enetc4_pl_mac_link_down(struct phylink_config *config, + unsigned int mode, + phy_interface_t interface) +{ + struct enetc_pf *pf =3D phylink_to_enetc_pf(config); + + enetc4_enable_mac(pf, false); +} + +static const struct phylink_mac_ops enetc_pl_mac_ops =3D { + .mac_select_pcs =3D enetc4_pl_mac_select_pcs, + .mac_config =3D enetc4_pl_mac_config, + .mac_link_up =3D enetc4_pl_mac_link_up, + .mac_link_down =3D enetc4_pl_mac_link_down, +}; + +static int enetc4_link_init(struct enetc_ndev_priv *priv, + struct device_node *node) +{ + struct enetc_pf *pf =3D enetc_si_priv(priv->si); + struct device *dev =3D priv->dev; + int err; + + err =3D of_get_phy_mode(node, &pf->if_mode); + if (err) { + dev_err(dev, "Failed to get PHY mode\n"); + return err; + } + + err =3D enetc_mdiobus_create(pf, node); + if (err) { + dev_err(dev, "Failed to create MDIO bus\n"); + return err; + } + + err =3D enetc_phylink_create(priv, node, &enetc_pl_mac_ops); + if (err) { + dev_err(dev, "Failed to create phylink\n"); + goto err_phylink_create; + } + + return 0; + +err_phylink_create: + enetc_mdiobus_destroy(pf); + + return err; +} + +static void enetc4_link_deinit(struct enetc_ndev_priv *priv) +{ + struct enetc_pf *pf =3D enetc_si_priv(priv->si); + + enetc_phylink_destroy(priv); + enetc_mdiobus_destroy(pf); +} + +static int enetc4_pf_netdev_create(struct enetc_si *si) +{ + struct device *dev =3D &si->pdev->dev; + struct enetc_ndev_priv *priv; + struct net_device *ndev; + int err; + + ndev =3D alloc_etherdev_mqs(sizeof(struct enetc_ndev_priv), + si->num_tx_rings, si->num_rx_rings); + if (!ndev) + return -ENOMEM; + + priv =3D netdev_priv(ndev); + priv->ref_clk =3D devm_clk_get_optional(dev, "enet_ref_clk"); + if (IS_ERR(priv->ref_clk)) { + dev_err(dev, "Get enet_ref_clk failed\n"); + err =3D PTR_ERR(priv->ref_clk); + goto err_clk_get; + } + + enetc_pf_netdev_setup(si, ndev, &enetc4_ndev_ops); + + enetc_init_si_rings_params(priv); + + err =3D enetc_configure_si(priv); + if (err) { + dev_err(dev, "Failed to configure SI\n"); + goto err_config_si; + } + + err =3D enetc_alloc_msix(priv); + if (err) { + dev_err(dev, "Failed to alloc MSI-X\n"); + goto err_alloc_msix; + } + + err =3D enetc4_link_init(priv, dev->of_node); + if (err) + goto err_link_init; + + err =3D register_netdev(ndev); + if (err) { + dev_err(dev, "Failed to register netdev\n"); + goto err_reg_netdev; + } + + return 0; + +err_reg_netdev: + enetc4_link_deinit(priv); +err_link_init: + enetc_free_msix(priv); +err_alloc_msix: +err_config_si: +err_clk_get: + mutex_destroy(&priv->mm_lock); + free_netdev(ndev); + + return err; +} + +static void enetc4_pf_netdev_destroy(struct enetc_si *si) +{ + struct net_device *ndev =3D si->ndev; + struct enetc_ndev_priv *priv; + + priv =3D netdev_priv(ndev); + unregister_netdev(ndev); + enetc_free_msix(priv); + free_netdev(ndev); +} + +static int enetc4_pf_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct device *dev =3D &pdev->dev; + struct enetc_si *si; + struct enetc_pf *pf; + int err; + + err =3D enetc_pci_probe(pdev, KBUILD_MODNAME, sizeof(*pf)); + if (err) { + dev_err_probe(dev, err, "PCIe probing failed\n"); + return err; + } + + /* si is the private data. */ + si =3D pci_get_drvdata(pdev); + if (!si->hw.port || !si->hw.global) { + err =3D -ENODEV; + dev_err_probe(dev, err, "Couldn't map PF only space\n"); + goto err_enetc_pci_probe; + } + + err =3D enetc4_pf_struct_init(si); + if (err) + goto err_pf_struct_init; + + pf =3D enetc_si_priv(si); + err =3D enetc4_pf_init(pf); + if (err) + goto err_pf_init; + + pinctrl_pm_select_default_state(dev); + enetc_get_si_caps(si); + err =3D enetc4_pf_netdev_create(si); + if (err) + goto err_netdev_create; + + return 0; + +err_netdev_create: +err_pf_init: +err_pf_struct_init: +err_enetc_pci_probe: + enetc_pci_remove(pdev); + + return err; +} + +static void enetc4_pf_remove(struct pci_dev *pdev) +{ + struct enetc_si *si =3D pci_get_drvdata(pdev); + + enetc4_pf_netdev_destroy(si); + enetc_pci_remove(pdev); +} + +static const struct pci_device_id enetc4_pf_id_table[] =3D { + { PCI_DEVICE(PCI_VENDOR_ID_NXP2, PCI_DEVICE_ID_NXP2_ENETC_PF) }, + { 0, } /* End of table. */ +}; +MODULE_DEVICE_TABLE(pci, enetc4_pf_id_table); + +static struct pci_driver enetc4_pf_driver =3D { + .name =3D KBUILD_MODNAME, + .id_table =3D enetc4_pf_id_table, + .probe =3D enetc4_pf_probe, + .remove =3D enetc4_pf_remove, +}; +module_pci_driver(enetc4_pf_driver); + +MODULE_DESCRIPTION("ENETC4 PF Driver"); +MODULE_LICENSE("Dual BSD/GPL"); diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers= /net/ethernet/freescale/enetc/enetc_ethtool.c index 2563eb8ac7b6..13ce771e0c43 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c @@ -44,6 +44,9 @@ static int enetc_get_reglen(struct net_device *ndev) struct enetc_hw *hw =3D &priv->si->hw; int len; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + len =3D ARRAY_SIZE(enetc_si_regs); len +=3D ARRAY_SIZE(enetc_txbdr_regs) * priv->num_tx_rings; len +=3D ARRAY_SIZE(enetc_rxbdr_regs) * priv->num_rx_rings; @@ -68,6 +71,9 @@ static void enetc_get_regs(struct net_device *ndev, struc= t ethtool_regs *regs, int i, j; u32 addr; =20 + if (is_enetc_rev4(priv->si)) + return; + for (i =3D 0; i < ARRAY_SIZE(enetc_si_regs); i++) { *buf++ =3D enetc_si_regs[i]; *buf++ =3D enetc_rd(hw, enetc_si_regs[i]); @@ -229,6 +235,9 @@ static int enetc_get_sset_count(struct net_device *ndev= , int sset) struct enetc_ndev_priv *priv =3D netdev_priv(ndev); int len; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + if (sset !=3D ETH_SS_STATS) return -EOPNOTSUPP; =20 @@ -250,6 +259,9 @@ static void enetc_get_strings(struct net_device *ndev, = u32 stringset, u8 *data) u8 *p =3D data; int i, j; =20 + if (is_enetc_rev4(priv->si)) + return; + switch (stringset) { case ETH_SS_STATS: for (i =3D 0; i < ARRAY_SIZE(enetc_si_counters); i++) { @@ -290,6 +302,9 @@ static void enetc_get_ethtool_stats(struct net_device *= ndev, struct enetc_hw *hw =3D &priv->si->hw; int i, o =3D 0; =20 + if (is_enetc_rev4(priv->si)) + return; + for (i =3D 0; i < ARRAY_SIZE(enetc_si_counters); i++) data[o++] =3D enetc_rd64(hw, enetc_si_counters[i].reg); =20 @@ -331,6 +346,9 @@ static void enetc_get_pause_stats(struct net_device *nd= ev, struct enetc_hw *hw =3D &priv->si->hw; struct enetc_si *si =3D priv->si; =20 + if (is_enetc_rev4(si)) + return; + switch (pause_stats->src) { case ETHTOOL_MAC_STATS_SRC_EMAC: enetc_pause_stats(hw, 0, pause_stats); @@ -418,6 +436,9 @@ static void enetc_get_eth_mac_stats(struct net_device *= ndev, struct enetc_hw *hw =3D &priv->si->hw; struct enetc_si *si =3D priv->si; =20 + if (is_enetc_rev4(si)) + return; + switch (mac_stats->src) { case ETHTOOL_MAC_STATS_SRC_EMAC: enetc_mac_stats(hw, 0, mac_stats); @@ -439,6 +460,9 @@ static void enetc_get_eth_ctrl_stats(struct net_device = *ndev, struct enetc_hw *hw =3D &priv->si->hw; struct enetc_si *si =3D priv->si; =20 + if (is_enetc_rev4(si)) + return; + switch (ctrl_stats->src) { case ETHTOOL_MAC_STATS_SRC_EMAC: enetc_ctrl_stats(hw, 0, ctrl_stats); @@ -461,6 +485,9 @@ static void enetc_get_rmon_stats(struct net_device *nde= v, struct enetc_hw *hw =3D &priv->si->hw; struct enetc_si *si =3D priv->si; =20 + if (is_enetc_rev4(si)) + return; + *ranges =3D enetc_rmon_ranges; =20 switch (rmon_stats->src) { @@ -593,6 +620,9 @@ static int enetc_get_rxnfc(struct net_device *ndev, str= uct ethtool_rxnfc *rxnfc, struct enetc_ndev_priv *priv =3D netdev_priv(ndev); int i, j; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + switch (rxnfc->cmd) { case ETHTOOL_GRXRINGS: rxnfc->data =3D priv->num_rx_rings; @@ -643,6 +673,9 @@ static int enetc_set_rxnfc(struct net_device *ndev, str= uct ethtool_rxnfc *rxnfc) struct enetc_ndev_priv *priv =3D netdev_priv(ndev); int err; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + switch (rxnfc->cmd) { case ETHTOOL_SRXCLSRLINS: if (rxnfc->fs.location >=3D priv->si->num_fs_entries) @@ -678,6 +711,9 @@ static u32 enetc_get_rxfh_key_size(struct net_device *n= dev) { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); =20 + if (is_enetc_rev4(priv->si)) + return 0; + /* return the size of the RX flow hash key. PF only */ return (priv->si->hw.port) ? ENETC_RSSHASH_KEY_SIZE : 0; } @@ -686,6 +722,9 @@ static u32 enetc_get_rxfh_indir_size(struct net_device = *ndev) { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); =20 + if (is_enetc_rev4(priv->si)) + return 0; + /* return the size of the RX flow hash indirection table */ return priv->si->num_rss; } @@ -697,6 +736,9 @@ static int enetc_get_rxfh(struct net_device *ndev, struct enetc_hw *hw =3D &priv->si->hw; int err =3D 0, i; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + /* return hash function */ rxfh->hfunc =3D ETH_RSS_HASH_TOP; =20 @@ -731,6 +773,9 @@ static int enetc_set_rxfh(struct net_device *ndev, struct enetc_hw *hw =3D &priv->si->hw; int err =3D 0; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + /* set hash key, if PF */ if (rxfh->key && hw->port) enetc_set_rss_key(hw, rxfh->key); @@ -775,9 +820,10 @@ static int enetc_get_coalesce(struct net_device *ndev, { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); struct enetc_int_vector *v =3D priv->int_vector[0]; + u64 clk_freq =3D priv->si->clk_freq; =20 - ic->tx_coalesce_usecs =3D enetc_cycles_to_usecs(priv->tx_ictt); - ic->rx_coalesce_usecs =3D enetc_cycles_to_usecs(v->rx_ictt); + ic->tx_coalesce_usecs =3D enetc_cycles_to_usecs(priv->tx_ictt, clk_freq); + ic->rx_coalesce_usecs =3D enetc_cycles_to_usecs(v->rx_ictt, clk_freq); =20 ic->tx_max_coalesced_frames =3D ENETC_TXIC_PKTTHR; ic->rx_max_coalesced_frames =3D ENETC_RXIC_PKTTHR; @@ -793,12 +839,13 @@ static int enetc_set_coalesce(struct net_device *ndev, struct netlink_ext_ack *extack) { struct enetc_ndev_priv *priv =3D netdev_priv(ndev); + u64 clk_freq =3D priv->si->clk_freq; u32 rx_ictt, tx_ictt; int i, ic_mode; bool changed; =20 - tx_ictt =3D enetc_usecs_to_cycles(ic->tx_coalesce_usecs); - rx_ictt =3D enetc_usecs_to_cycles(ic->rx_coalesce_usecs); + tx_ictt =3D enetc_usecs_to_cycles(ic->tx_coalesce_usecs, clk_freq); + rx_ictt =3D enetc_usecs_to_cycles(ic->rx_coalesce_usecs, clk_freq); =20 if (ic->rx_max_coalesced_frames !=3D ENETC_RXIC_PKTTHR) return -EOPNOTSUPP; @@ -843,8 +890,12 @@ static int enetc_set_coalesce(struct net_device *ndev, static int enetc_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts_info *info) { + struct enetc_ndev_priv *priv =3D netdev_priv(ndev); int *phc_idx; =20 + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + phc_idx =3D symbol_get(enetc_phc_index); if (phc_idx) { info->phc_index =3D *phc_idx; @@ -942,6 +993,9 @@ static void enetc_get_mm_stats(struct net_device *ndev, struct enetc_hw *hw =3D &priv->si->hw; struct enetc_si *si =3D priv->si; =20 + if (is_enetc_rev4(si)) + return; + if (!(si->hw_features & ENETC_SI_F_QBU)) return; =20 @@ -960,6 +1014,9 @@ static int enetc_get_mm(struct net_device *ndev, struc= t ethtool_mm_state *state) struct enetc_hw *hw =3D &si->hw; u32 lafs, rafs, val; =20 + if (is_enetc_rev4(si)) + return -EOPNOTSUPP; + if (!(si->hw_features & ENETC_SI_F_QBU)) return -EOPNOTSUPP; =20 @@ -1090,6 +1147,9 @@ static int enetc_set_mm(struct net_device *ndev, stru= ct ethtool_mm_cfg *cfg, u32 val, add_frag_size; int err; =20 + if (is_enetc_rev4(si)) + return -EOPNOTSUPP; + if (!(si->hw_features & ENETC_SI_F_QBU)) return -EOPNOTSUPP; =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_hw.h b/drivers/net/= ethernet/freescale/enetc/enetc_hw.h index 6a7b9b75d660..230e94986091 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h @@ -25,6 +25,7 @@ #define ENETC_SIPCAPR0_RSS BIT(8) #define ENETC_SIPCAPR0_QBV BIT(4) #define ENETC_SIPCAPR0_QBU BIT(3) +#define ENETC_SIPCAPR0_RFS BIT(2) #define ENETC_SIPCAPR1 0x24 #define ENETC_SITGTGR 0x30 #define ENETC_SIRBGCR 0x38 @@ -971,15 +972,16 @@ struct enetc_cbd { u8 status_flags; }; =20 -#define ENETC_CLK 400000000ULL -static inline u32 enetc_cycles_to_usecs(u32 cycles) +#define ENETC_CLK 400000000ULL +#define ENETC_CLK_333M 333000000ULL +static inline u32 enetc_cycles_to_usecs(u32 cycles, u64 clk_freq) { - return (u32)div_u64(cycles * 1000000ULL, ENETC_CLK); + return (u32)div_u64(cycles * 1000000ULL, clk_freq); } =20 -static inline u32 enetc_usecs_to_cycles(u32 usecs) +static inline u32 enetc_usecs_to_cycles(u32 usecs, u64 clk_freq) { - return (u32)div_u64(usecs * ENETC_CLK, 1000000ULL); + return (u32)div_u64(usecs * clk_freq, 1000000ULL); } =20 /* Port traffic class frame preemption register */ diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.h b/drivers/net/= ethernet/freescale/enetc/enetc_pf.h index 39db9d5c2e50..5ed97137e5c5 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.h @@ -28,6 +28,14 @@ struct enetc_vf_state { enum enetc_vf_flags flags; }; =20 +struct enetc_port_caps { + u32 half_duplex:1; + int num_vsi; + int num_msix; + int num_rx_bdr; + int num_tx_bdr; +}; + struct enetc_pf; =20 struct enetc_pf_ops { @@ -61,6 +69,7 @@ struct enetc_pf { phy_interface_t if_mode; struct phylink_config phylink_config; =20 + struct enetc_port_caps caps; const struct enetc_pf_ops *ops; }; =20 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drive= rs/net/ethernet/freescale/enetc/enetc_pf_common.c index 2c6ce887f583..18fe7861a6fe 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -120,10 +120,17 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struc= t net_device *ndev, ndev->vlan_features =3D NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; =20 + ndev->priv_flags |=3D IFF_UNICAST_FLT; + + /* TODO: currently, i.MX95 ENETC driver does not support advanced feature= s */ + if (is_enetc_rev4(si)) { + ndev->hw_features &=3D ~(NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK); + goto end; + } + if (si->num_rss) ndev->hw_features |=3D NETIF_F_RXHASH; =20 - ndev->priv_flags |=3D IFF_UNICAST_FLT; ndev->xdp_features =3D NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG | NETDEV_XDP_ACT_NDO_XMIT_SG; @@ -135,6 +142,7 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct = net_device *ndev, ndev->hw_features |=3D NETIF_F_HW_TC; } =20 +end: /* pick up primary MAC address from SI */ enetc_load_primary_mac_addr(&si->hw, ndev); } --=20 2.34.1 From nobody Wed Nov 27 00:26:20 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2059.outbound.protection.outlook.com [40.107.20.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCCD1227B86; Tue, 15 Oct 2024 13:14:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998091; cv=fail; b=ecBEm1G0XwbXO/VU6W4UWVDBRSmFBnHQuvAg/c//y0lZXafAvCnn+DWuTXDsgb6jnGqNyiKRhwTbfRdMTkBHUqXiW7sWNaXBIAWdM5sB2ka9AJf3GXyzsrEqU6vtI0Huw8gshtPye1PGpMr8kt5ffyK2guZFaTgJm3ShiTA/iIs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728998091; c=relaxed/simple; bh=YgZNB/EmSVJPLKDYKi47AleOk5ikPYICbIRo2U2baf4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tSN/EyN4NFJU+qQfF7I+78yBMF+l8EqHumBySTh7aQxVYLKAGbPCb8YnTe9jSsjFgs24NCWnHfFsPY6forqcfNpReSZ9lPC//bnxIE2mNb5dVs5S3jCWqpUU7VM97G4xk3ev+h+fJIRybLeppgBitTH5nsOK+i9lxC2SfZDXumE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=EVQBh0ml; arc=fail smtp.client-ip=40.107.20.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="EVQBh0ml" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GEre3735zEUkg+KvJ3AC0h+pga26Do6kJ2TzgtJHV59/hYw7diYEth29onTKma59hzPiYMYzYfa3/ONgTOhDLKSdNzRtz3KL8bh/ZjZHN341J39hs0oRlAyBQlNevVj3u4rLRL7XVQN9BaVvS2ATYmbNeYIkSlkLLadgAfb0+GVi8W+FV3YGjeajh7H7lvUVvDa71L2ITSnEuJ2sIll64YOj7nifhliSKlItoV/1DJZhMLfqbLJyMvCaMrglwZHh/d2VMFwAIZscpUf7fQuGUv0PkPOYphGhF4aeKVLmuzWO81wZn/egL+QtxRhVenGL/7eUF1Fk/7I19iZrq+xytw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NVtYO/fn4p2g/u3b2G4C8Nt+g+55vkATBe26/TZIf1g=; b=lIUdfUpoBJr/9aGjSzDaQLBuNymnO+3kZyQewZNVtoO5orRiz9Vi+y0XDFe+mskyGTAolYAJatTeTxsqoSRpFrq8djBwhiDRVZH6bXrqHSV5eY/Jk2MGRb7+uXkkVnsjL+V+ZJeYyMqPSFf5fXQJRad12B7poDX+Wk/++4MUreYcEPOCzgo1FEZN4DO/B9OYzlInw9LlAgkUolg1gX5YJ4aT4wYGOpbGRs/63hKzv0fxQckCq79dBlaPcPqLazBx/XkWEsMLgdcK6GGKbmeCrd+xif7RkaRnQqIW4I51bN0nFxkU+Yrya/CiJXQrbGI6RfuSliRppsauUrQxPpTcuw== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NVtYO/fn4p2g/u3b2G4C8Nt+g+55vkATBe26/TZIf1g=; b=EVQBh0mlAO9rTofsSkPknL9uyDk9E1Y8EBOubr8KEg2lTa8uGW5WC3w+19gV2VJwAb8ukpswXlNGEHomXERo7mp/dD7Coh1TgsNGMrLzfz51n2iwi8LuewVHHfycH/JxWpBHWLuX/qqF42GqNiIQd4U+Q0P/xx2esovwyxYyp1jYRgKFV46ZMBwx+lMw9IR57ZhQ6WTEcegaWBEqfNhVxkt6JGUolcW1knQsNgpl1toHHh9C8Wt7iYiCW0288n9k3rfmiRp53GfdkNXjPugujUrEzCBCRI4g/wycXqc2NhAOTg8Ly+jfPp5WszHYg6jIq7ms1fBlWzIpuLLMit3hdA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by PAWPR04MB9988.eurprd04.prod.outlook.com (2603:10a6:102:38b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 13:14:47 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8026.019; Tue, 15 Oct 2024 13:14:47 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, vladimir.oltean@nxp.com, claudiu.manoil@nxp.com, xiaoning.wang@nxp.com, Frank.Li@nxp.com, christophe.leroy@csgroup.eu, linux@armlinux.org.uk, bhelgaas@google.com, horms@kernel.org Cc: imx@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 net-next 13/13] MAINTAINERS: update ENETC driver files and maintainers Date: Tue, 15 Oct 2024 20:58:41 +0800 Message-Id: <20241015125841.1075560-14-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015125841.1075560-1-wei.fang@nxp.com> References: <20241015125841.1075560-1-wei.fang@nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SI1PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:1f7::14) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9988:EE_ X-MS-Office365-Filtering-Correlation-Id: 16f04ea6-d5a0-4f05-8ccd-08dced1b5779 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|366016|7416014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?OodAkMIoGsTe3CInzM7/o+L4UePet/S67hVgOvC0ORQ6iJrEpODvbB02KkkL?= =?us-ascii?Q?8vKoZeo01e6HFhLBKUa5MLK9XKhB2TZ/Xh6wOEXrlhqtZw4gf5+B+VCS9Hrt?= =?us-ascii?Q?MOH49O93XsSiZJt9AgGJ5RFxI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?sm/wEKQavxieuE7rZTrzzRRGCztW+gIvyvKtprkeEopENAj5mpxZ6f60J0EQ?= =?us-ascii?Q?eA6jTW2LH1/VJyDBBkIJY85A+rorqb0uatRKg0PXelmd8Sjm4I3w/P99+rly?= =?us-ascii?Q?P9YZwJI7NM0cIkLpfyZrJUV80QlPmbePAZ0gFzht1oR1HunCw6FvxiaB5MvC?= =?us-ascii?Q?QZ0fIG8eJxWgnFKcDqbxxhTYJjGLw8HOoiS6/Ajgkv+VNRuSUF+odJYNC9vQ?= =?us-ascii?Q?R1tTnabrAcborbJQlYTYz6o4M9gmO/2p5Wppom2+KXLEUAzgQ4Of/WzN+8f3?= =?us-ascii?Q?84MDJKe15o07y2p8IlqAtt607Tchr3TDpdVGpoLG6d2XQ4i2BOn2fI+gxhxf?= =?us-ascii?Q?9Ls7xog=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(376014)(366016)(7416014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2Tfsp1fxMXqnBpOjsMVB2KUTTGY5yFDc6BUe2jut9VCbi3H7dhc7wcDTq2cr?= =?us-ascii?Q?5uHOdDsYMOarwn4CVx29+V4crVYQFhxOq+0BktaB+Fq7oncCWm2+LZ22avnk?= =?us-ascii?Q?1IUr3zQWewBvMyUcAH25MY3dzRqmZa7jfw1XSVxokN6OpdHf0X1X/N0wq3TA?= =?us-ascii?Q?ZE3mMNoPlOB6c48783wyhTwpPDMVNfj929ZK7bJ9OlvPbRYCy7Z0CSUmPFPP?= =?us-ascii?Q?ugflla7zG22WpM8tw5bJ4K52NahrFxcwtemsRNtZBS4zP9iAgKTXw2wtNsmd?= =?us-ascii?Q?0s5Fnyx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Et5QDHq+F?= =?us-ascii?Q?GS7/QAedMo623S4H9bYwhQ/nymax/oM6aQxWA6oRxy6JPolpd1N0LXoGGSCv?= =?us-ascii?Q?eBWAo4nAvC2yvJdwl01YGJcOfnSx1o0+WTZg8uPtmRH5Aq97CE8t/etUxXGB?= =?us-ascii?Q?Sz7JJOXppSwz81WbhpYt441NQfPdSjQOUc5A9mjSWltkWW2o8m5TpGewOR33?= =?us-ascii?Q?N7msbg6D5BPEa7Uwmkqm9X6jQqp1blrw+jZzUbCDK/emdncSD8T4k1wx2Uwf?= =?us-ascii?Q?u59aFSAGxSZRQKentlDJLLUqPmkHXK2eoxw6NXj28jUtIGlsdF6mW9fnrDTW?= =?us-ascii?Q?x7JF82tsPrLhYCQw6pUDEdNZ8tESTa1rjZHyAwVTiaxXgf9ZrbQSbXbQH4gk?= =?us-ascii?Q?g1UaTXI6h3EgrRBr+8wsmYZJcP9DLidcu60vnlTO?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16f04ea6-d5a0-4f05-8ccd-08dced1b5779 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 13:14:47.0014 (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: tq+r9FGnIG621JsA3+qE66Qay1IrBlG6BurOm5CSmu+dzd2g4Ikv2kpP1vgkc3+Jq8MYFAL+xQLzAj3J5HoSwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9988 Content-Type: text/plain; charset="utf-8" Add related YAML documentation and header files. Also, add maintainers from the i.MX side as ENETC starts to be used on i.MX platforms. Signed-off-by: Wei Fang --- v2 changes: Use regular expressions to match related files. --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 560a65b85297..cf442fcb9b49 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9018,9 +9018,16 @@ F: drivers/dma/fsl-edma*.* FREESCALE ENETC ETHERNET DRIVERS M: Claudiu Manoil M: Vladimir Oltean +M: Wei Fang +M: Clark Wang +L: imx@lists.linux.dev L: netdev@vger.kernel.org S: Maintained +F: Documentation/devicetree/bindings/net/fsl,enetc*.yaml +F: Documentation/devicetree/bindings/net/nxp,netc-blk-ctrl.yaml F: drivers/net/ethernet/freescale/enetc/ +F: include/linux/fsl/enetc_mdio.h +F: include/linux/fsl/netc_global.h =20 FREESCALE eTSEC ETHERNET DRIVER (GIANFAR) M: Claudiu Manoil --=20 2.34.1