From patchwork Wed Oct 9 09:51:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828077 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013029.outbound.protection.outlook.com [52.101.67.29]) (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 6925C18E750; Wed, 9 Oct 2024 10:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.29 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468389; cv=fail; b=SCT0haf3Vok6OLdyOSBEhWKcZVpraE07n7PQkv7HXDvu6yNOMhJHvgiZH5gMQy5QyqsFHtQRuWIvpMrdj2rivEm9qY7zElTxgYiAWesZx40GVDsifwSicYlF3yM0ORr/HdhFOmkzWkPKi029KbTCIQjR2XxOpiP/87+krS1Q7l8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468389; c=relaxed/simple; bh=bU4t1BrcpsRX8u67hF88gahv9X5uWqpyRMHvLxkavxI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=OvuwHQQk8SXrFzad9/0hvqckKR5DLIXn23Z1TmQxMf6gtGHMBY9Bm0ECia1Gehf5LlC8her8W89no3j2N/21RojohnBnjW/sUYEw/TsSq1ZF9qgF2eUBzgm6OMSotbh/wNt5wmLEGxBYu9KVWOBBtEdyoyPeYGEQTThJC02b6jk= 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=WSriArsq; arc=fail smtp.client-ip=52.101.67.29 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="WSriArsq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jm1q18w5O0wtKi2eZ3mIQTRr5bOHYmovte7rl+/Z2WlH+leXqT3XNCpHdPMoZgy1GdeZ+Irxc89bmzPFpYni5Ui3ZSal2DD4Od+ovSXpxez/Q9sb4hIgIIbq3aNEmnrYCUerfL2fhDyUC7UgHDKxCCdKabMcoJQzevEHN88V9pZhOizZMJU6V4dDOSAbP4w6mt1A/1Ud3EcGKwd36/CSUSch1DvlD+V6xB/iOCg3loS+1mcvrJMvxoS70Lpb3Sm2V6gRIAs9d+HPNQIGzC2GYDVq2jgylutCjETFrJK+EUOlL1To1ceQD/kpCTpE7sB3kxWCTrqUiw4LPesw4ji/nw== 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=A4rBvBJbJjsiQCZxJ4p+lWnFEeDeDtba8geYeZvBMcs=; b=KEN1wudJRFCp9pLt3uYfEB175boc6a0YmCapOFn7bEGDBNnSEBkH+9GCEqLpIBWaXlWw4Y28rERPca1Gp3q0cAmwd2qWLbi7aexo9AvepA7js+hZ6q5MA9PAgtlNw7Sz48pRiFG8Kl/K5IIT2IZ5ITyhNfRPT/9IwcEsQ08jgUHM7CBd84ASWcfH1W82Wg2xi7olNh+hqUDM4AnW9nXxlwJ1ucVEj5Y3/x6XlNwL/t/Vyz5rb+KVRpR6FeM59fswUVT22vUk/oeoMWEZenjRCJaqxHsHtXcjhlPiBiJiY6p6sob6h29VXf6DFW4BE/U+2GqJXwbbDy8SkeKPpqJ3Pw== 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=A4rBvBJbJjsiQCZxJ4p+lWnFEeDeDtba8geYeZvBMcs=; b=WSriArsqGp5mG2EVmUtbqv/u0yNB7OGrnKkzOlCWdOz2uQiyNV5rb5TipdiLm1iy71RZXsHWd+66WmCyoi6tSX8AYE0xaBckxErncQ1vYMjwYxn5hAO5dfxz2xmnuNicNV7erPI5QqA7SZtAOYTELP1h698eOwuzl0NN45vamC25OrkfvjVGn1CBONw4cOJe799WORZvzmBr+YJNwSEBMcorYckEx87zkKYQIEUC2l10pm+nhO5Bel0zShorJ6PdRy3xK24bTxRMcsEjzuNdE0ec/9GHofiI3XqCS1eQY2utJDE+EpDpLVZGJOU6JTGN0sFme7xBMzc6hKLI35XMAw== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06: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; Wed, 9 Oct 2024 10:06: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 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 net-next 01/11] dt-bindings: net: add compatible string for i.MX95 EMDIO Date: Wed, 9 Oct 2024 17:51:06 +0800 Message-Id: <20241009095116.147412-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: 08952c40-0759-4070-4a4d-08dce84a0846 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: q69C7XuTi6FrgI3iqTGXcAHC4Ht2PBxH7RExhKP0O46+gr+mg7kIUHZ528gYp5roAaXkuGD4J03cj7V4kbD1R+Slzs8cZsVfe4MweE/LI2kX3SmkN3b1YDoYNJKYySNVimizGKRP/ZpiG4cjmE5JqGMr+feN/5O+1IM/ZeR5REz+8hOwPRNNZtaMsApNduCzBpd9jmcsRFvT3mU30dkkzwdRPc3SVG4/ME1MwDMnJskAhXEdWU+W6JX8w+FzyCKG8/VorfFKu6q4MbjCjXEeqUZcwClRmDj4Jr6LkplFef9hohTKfb1fVDnGizm+oeNRf/YStacrbj5YYa9v/gW/URNUy39YEtwzFW8PowS7L2drfXSAs48bMEsFIa6M5o0dc8EVfD32L97DKAUivvn3/GqguQjZYJjMO2Ny6lVILV0ioVY591mxLuz73cjtqg3/FIMsVqE1YzmKVXxR2QCylG+NCat13x6ST1CnXGhoYKzhkhldfevqKlLo0s+Q8gn7vrk5kdGkbd3DWZ2cNoQPBgWuiOgCemoJFAUgayRaXr58o0JBXdR7ZAaLEhr0tjV/GJWQM9XadLYFUEw/n0KVJZgdi6vZ4pzKRoau/9Esbrp2BCXFc2MaesqQeGB806V2fDvYO7gMv5v3qA1JtD84b8szPciHfCR3dVOqz133mphi9z5Ul3Tv0SGek19kgoVZCTiCqr3IySGJbjv7nPacJReC6BiuJEyfOYYAGt8zw76S0sT8G7F8eenmFBtwDF8/QDACVBc9nBimHMe+u4CqQnl0LbQ2uCCp6MCM0zrqozcu39IAl8qsO9Ttsp2F95nfVKXb1qqWlVVleeAGMUXyqIlC+FMtud9gVAaC5GKu0z2iFX4EgI1/tvqDo/MhnLf0s8HR86wJTaAHolpjFKrbNA5+WjklEvH9yIvuCBx5hx9S5gi3YQh2ArdujAhF5bCbkhcqK9Ut/NeWERKGySMSSLO1S0uThrufgIREMYENfGuZpjWfW6q6Ss23KjQpj2ksTS95ixVY1T+EgyIyXmSgQKDUdf6Z/IDPQLWxZ5qY3/FadhOG0nBm6ehUAoQR9I9FsoFGOw3NNvzFyHdq4CR1QhwhtffyPYCl6JyTDPlUEaTv4MBg5ThekLWlPrGLIVuikYZeCDlRNAfCHwevWD5/rbl2mEq/N7ncu4+VZvmsqTW4kO+TqSa17butfmHYeCwEnIlPlY7rD1FdY7w6LS7QJ+qxhKow5CRzaAuvhra1yHpDWgZ8016feJbj6qNUwRk+TRKSfICiBnWEwV7lfLAdvrQAC4MgCGXCJAcDEojkoUG37YbfavgJpTvq0jjZD07QqlSYnC08/G+hO/V5864PU/BtCssRKkAo3wpkswQ2udM= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lO31Oic1VlJVfvc0QXDvZzTBr9RK5JM1s78Zm09BIBAxfHgSL4aaOi2sqyULX82sJhmyj9ciJp14txZ57i6g+R7oO4j/hUBTaCBV5P5kiQmvnEfqr2cHgrMn8DR3Ozl8fGKxuItTX79G0aLkGsp+NS6EAw3aB+Xhqpy+CVWNbpEqpEUbBLVx1r8R1utzKYGmi/vGY9mQ7TBO9Nz/lafGG2lWMJRkWlLg2XY8PF6v8ukvsdXvnRFQfLPwArCqL2o+UT7EA0cthkrUgH8SUYGS7WxZOzrOPH2Ib0O1ywNhB/pWM7q+U+mTKX1y5fWZY0wuiJ6sH3441wWpDXEwZzORZI7ybzc4nXxuc5bc3FVSHsBYpdDnb5y/yaVDI3qE1ovZDan5YutdTRzUuIA9srXWQy0O+tZ6tgLoV2TBFJM2y5c6xMG9Af7WbZfsReyCH4T7K5LJ81Gvc3Drx12y9PUHDx1IgeBzrGtXPLM/U8jqi2uLpox6TFNRzG9gB6jDOLa/vb/3/arIKI4K+SP5AZCuK2iW7UpuPXyRMxFDQlz1ynCqjDZRbNTc81Ln4H9SLq9QsM9Q+jIrqNZbXiCimkRBuR7kk3c7BoqGs624j9HJh/pHabi2hCZBp8WSdfSEz8HjgZaDds7BqHx/C+P4pcCksFkYbZM2o78SEeIB2FXtWPGz8xYR8uV9uUJrFcdo1WEpKCp/tpe/w7v2x1gYPxvMbxoBGBH14AyV6oAcd7kp4cSCPKdLrR2IOJVFsT2cD6yY9UwRgh3f5YfmFgebKkoeNmT2V94qu0gUHFIkSplkbMO3ZntlLUiZz86mxOOcf2KzsWwu4KaVkJ6LOQHHX/RQJ8T4JyxfpUDaQJKknlxyNRbaolZbpZZQUQfPMNN+gjQ5KCSE/loOrvujxNR9yAXMrktXj3NONWAT5HAxxmxd0rmJXXdNpu+jKtZvIUmaN8HuPQ/8nENWLYKgfg2tKYW8vAd8qY3EPdReTWTOkPHOz0WrLiO1QRPisKTwIeTqz+KCqdFHDLF/CvN9L2E+/WhHesCz3KljT7tgcQiry0izgEEyGSAPgNSCZhXf43i8GKYDE9S7ooBxYMnAiOqobr7iYw+jdiHxGJLzltNyPF9bQyq4z7fCBlKoFegqFWJY2StrTmCpfWA6nr+C6xCHTJPJCf4JWMbGwqvBcYP0fG8cm7H4b4qhC+nvIi6Yf4pWXavcjpTFXp1VfZeR8aOfZ0F8knyntpFN6cv3Z/B0ZsIrB7E2a6jLZ3XZhccfvu5BFF8BiME/Srl6k7y8t/U7gOFi7o7oxDWEXmN0h+kA9T/nNsLqSr2f7GYTIX2SCzZeK0vA8oYYvbYQkVivhP36j4mYtqmotyK0TBpTifWKuCjNkH6yxd7dLUzhhHDeCTOGilrefguFc82XHn3g1jLTOhPYypsmWLo2N/kIA36mVQhx4Ul7ZdOtyhm1E3oxFiV02abTAi9RLgRqjvIImiWgsCcYdAapKhriwFXCiMafJaokLlGhL2ApBN/WIf76yFnshmbcX/Rsdq3kXfjXL1IKap9mXwYwUEUG15M72oyUThYNg+b4545BrSRbst+K93FZ1ka0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08952c40-0759-4070-4a4d-08dce84a0846 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:24.6557 (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: GA0rVbDuCA1aNBky3E2TzVb9B0jGV+nbrOwaMGln0vOx8luHqA9VOpDHKbMLJNZ7BPFMJ9GhGpqOy9MA3bO/Pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 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 --- .../devicetree/bindings/net/fsl,enetc-mdio.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml b/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml index c1dd6aa04321..71f1e32b00dc 100644 --- a/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml +++ b/Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml @@ -20,10 +20,17 @@ maintainers: properties: compatible: - items: - - enum: - - pci1957,ee01 - - const: fsl,enetc-mdio + oneOf: + - items: + - enum: + - pci1957,ee01 + - const: fsl,enetc-mdio + - items: + - const: pci1131,ee00 + - items: + - enum: + - nxp,netc-emdio + - const: pci1131,ee00 reg: maxItems: 1 From patchwork Wed Oct 9 09:51:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828078 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011053.outbound.protection.outlook.com [52.101.65.53]) (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 D8F8B18F2FD; Wed, 9 Oct 2024 10:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468394; cv=fail; b=iF6WinOUNlxkuM8zjKuNuw3E0r0XkYdp1/1lY74wgOP3Hx4aJyvlc9ImSpGRXgLQqtMTmY4wZziEC44E5cbyfuIPQr5k5ug9nyOoth7kWTJ7PshI9AO6AFMwpVAP4dEd9KAKYXsbFSLPwUdV3uK6RvMVQGTU+R50mc3hHUIJvGI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468394; c=relaxed/simple; bh=fp/DKnvgckUKE3mwPVlywelYf5XtyKidRbcMLQAt2lk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=KavEePZ+TF8dvV5WQiB9s4sikZ3E2wxzK30H1GKpj7ievDsuQt6Ah7tMV4ECUp3zwbSji/QjCXQivKy/y6c9pgIv5G6GEMr0A70ufloJta5ByLUTjPN5wJwLbGSj9rYXaixo2ArHdd23PnOMLDcZ3xzV7YVCYwifiQI++KogoDI= 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=W/PA3AtK; arc=fail smtp.client-ip=52.101.65.53 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="W/PA3AtK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mimbkIEA4a6HFYhHilN3BHVD7wlB816ecNjCOs4Yeu3D4pjZ5+i0F/sLj6pAK4t7bCzOjlZFk9cygj4yOATeN/Y/7x87Th0jESDBj3KIOXzribY+eIUImaI2VmQqUHvdwc3ctXdbv0MM5DZ5B1jBaXsst3X9jMCcHaNfgX4Z3+uRi4/LTb+LVZPt8B93Gagw9rUl5nxqc2GC4/mqjYJSkX1+rRmXXg6exNufBR0lVzIXBtzpJSKGE/lpDo8QH3khB69DtVGphnurVQ0V0jW6SICtAYBOPspdIICY5JRKdkh8nVwaUevcdZG2iSqggZV01qFNOcebWd3K3ZgWETsw6A== 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=9Gh8xImuw0v68N5GeWbLFNz5b1/PMJEJmTFzwGvIy1I=; b=QLrGZ+RecDxPeaqXcugRFHgPmyyajso9xPI7a8ceOXrKN+en8ai+4fF14q9vpnvHXDlEoOKSkPCHWHXCe1eEQHFMVlP05dBWjr2fdglMrgNvLKBFITmf/lsVxDhDJiE0SC/ticO1becC/B1kmR1NDcQJ/DJzPgxWLomRUkNTxEgZ5V9d2LtT6BpKH7Fj4t3rAR850XOLrgwTxGfpmmgTCasnLSVJVh2GB7E948u4ZGru4wwOLbKNviQ8L7uaRSBlbf6aAeafvrR5hSFiFhfGDX6rPZrs7gY8F9IgiWBsy1OfU7xQkv4MEK+ejwikhy+4kKCYwTcDz12xpau/hbHk0w== 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=9Gh8xImuw0v68N5GeWbLFNz5b1/PMJEJmTFzwGvIy1I=; b=W/PA3AtKo0cjCSSE3S0zXs9Ag2qAGlO5pJ1ufsRVHBYPkw8BtMKHfrsFPu6jJvrBu/RrUTJvUKQsVku7fvD1reL4PRzDWtGZcEMJtDfCUyhLuApPReejZpR4ZJMdmxRhXciIgGksv8vbaVwWZdwqqR/rltsvo/uX7AOMDfSa7IE9uWxE1KOJ0GQl2N2fx+Wg6CpD31e715TCCYtxPjfcMSv4wj285xTlPG7IRhEyXF8vlyy6IrE+jNDMj9NbytAQbzeQsz5RgPupCmUXCJ4/4EeRClAzMKifcoT37/FJtXw0lCNGchWl33GPiKxNVzga+ZO8PBhHdkEAcvTpThvZ7A== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06: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; Wed, 9 Oct 2024 10:06:30 +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 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 net-next 02/11] dt-bindings: net: add i.MX95 ENETC support Date: Wed, 9 Oct 2024 17:51:07 +0800 Message-Id: <20241009095116.147412-3-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: 448df2a5-1095-4ef5-8f69-08dce84a0b71 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: AQyrVPkjGJGPvBuSXaL25UCMACUmxgrwSNwgcvEBKZeTy3d/gGBxAHIbjrjtB0Ml2YCi7ihqp4Y6VA56sUmBnpPVU5z8ys8dBs0FWFylcgwoycCY6BWfpIzQ6sJ+A1RT9SRzGvQy6cdpo6WoXVqEp9k0erTslqSvRFIxw9WiC+1InjLR6HqAHZ/hQBOFajYa4U+ZwtQlbv+1cEChlOzxhRc1TrWHURQJcUAI3Y8GZSuGsjLsY2zh0NRge18VIqxknr6ZNo1G0hqUsJCZI16aZleXru2OaH6JlvHxxYs52I8pZ62IzHAygeg8Bs7JYyMT4IiasIdDY1m5Hih5FEjyf2RIzbRASKrmMIht2u6JpskqSRS5SvRqx5HtCI4UfuEDCJtTDBuox2VcrRus8uit8IBh50A+NUMArRbo76BgIwZaONaGzJPJ3GYmvasgNGhE4wVk58seCj8Iu3B73wG1naON28dXjPQ9UdUSP5PQgPRTJxePFdHbGz+jlQDizmSZItJg4/RIYzXYIzQ/lPGFxS6XIuO6OZwGi/DeH7VKS5BStuMCkeSYz7cSCOwsVmpnjCuxmyefIjmf9aB/Bf9lWQCAFvTsdTANJhQbtVwKr/7jS3lCamc7XBCcsakIQ1Mmt9C2UQ46kjXg/AzSm3Qgvs8Q/1WGqMnJpVO8u+3y3Cm/vQP131X0IYaSzgaVcCTKHgzW6CVXRRqRrCV+2kGHX34doI+Y7lY0gkCmBS9tGc36YU884bXxmaSM2JSxowreL+opgiP5NRfCZxppuDKqqiaVwWvKx8+srnznq7NRqmMIuDgJxq3NxImaUZBwAnGAUYYUVsovtvphJjinUeQdd3IXbSlV5MGnm1NRKypLJyNWL7TRQZRgbOKrCq317qihA1A2bEIq2vxPZeEqPBZ+l4IUuUrrbusY6cAzia7NplTe96XbhuYmDV3caVZu9jQx2x4zm0kO+PRLfWZ+0YZkz0rUzYxh1MVbruK7TGJZioy85S2VUm9Ks4N1VPP13uJYfTSpDbT0tVgYyU8vr7MlG2prwCSYOE3Ovcw2kCJGyHl/zAIE7dmZbZ1krcae7Y0XvZjGbwwX6+xfurrxd7YCXPZXTKWbOW8tJueutlP7XwGcQzmVDkwgBYEpIn00cZYUCU6KoNaPDx/Atb2ac+3JiPK9IrkdUhoj9S+IcrGASkCwdqpJW+DVizTX+mcpz06r/hvlE5xLMYKFEuMhAhJBZnD9Q3MT7xIqE5LFPgQwmBgyguazjx7yNjNkfCHlGVTt3Q4UfzXf9NtGOH+IR4DfWxtzk4XgS39sX8LemUnmNBsntSIlDd22l5TUIPdE5JSj0vPjPTnKgDFsBlMQUH681D48plTlXUiyzeF/Eg1vkAo= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J0idqEBwZ6511As5N6Ae3G5D6coOoOnD+5+QLKRSUo6HpDS5Zk3DqxRQTJeGBJfCTVete5c3M8dzl6+HE+hndIi20Vi7OMt3uyjp4Rx5axQ8adMnerAwZY5A61wFfRme2s+zTNTT0CQUs/4j96XXtSmYLUbc4NKe5jOckKMv81B1H1Ln18S26/8XxR9suzB65DWme00kW3z+FD+6qnK3F/wPmJlzjuoIUG6lWUaH1qtQQ03iBxqyyEpUhWZzpIjayLUMO8g09Je99ttEXqAx1x/zCYG/pttZbyR8oUHshCcAlS2dwWYwMihZXvrRC2CgAZbUo3IdXP1zRabgVLB93GSkxOvZ+g4mBuGpxnWIDg6bDrraThkowxOwa7Puo9nPLjV+amgHF1wwyId54cFkpPOcO1ncMo/XmPaToO3Yfr3gqb2qfo2lCzM3pI9UF05jZjwbVG1WZBpsWSRARJwZ6wz0BTVKqTrAvABPmyZF+jbSXuCeELiuVnes4eTql4et4qM8ZEw4vT+RO78u3fLvhzWZXUeYWhC+VGGLnoi5wDCMTlBReAPjZ4935wwIN7jh+HM/Ey93KoqXBKKe3MR/Wlcz5tmC12CKZRjMrLxpE7Hspok85gVOPm68qe4cenLXJD4137y5ArJ7w9zX4vpGg6jmI3RIt9FYdAH8UwzqL4MyLGZcrdcN3M5fscimRVWOpRJju9INxmS/3Zxyu1MkKUcNKJJI1kUVrQH+63J0vCMby8FUfpdxinnzkaTdRexBpAc0sK8UTquwkDpnRbSeYJsrTqSnEpp/tpEknZIR6rgmLcSnDGU1ir8ZEH7YwNFi4PcJE4DR+vW3tA/T9R1ks3azkDkVp/KysPp6dOkgFvDaYqeUwQIuf6abRQVCPVvEG5JxNTsw01tfFFaPnzC4Ymr/gpgrO9uqKLNbHDZOHpkMr11J1UE09E5u7lEZEdeqWZySrXV7dHsW0rrndsDxH3N2lvvOe6rQTp6NUD/TtFDt9FzxQ7Q0+KHk1Zik53F7nNrgS0NgryILcj4m8wCIyIS3PUN3BbSyNkfzZ0baKTo/lK55HINRfpOwUh+ZmqX7oh7ui4naBVZNicrEI7xyv4GwX4fWBGirT0iXM4pzleiSwCuzbEMQiJr3YkFby+5ZVqA6NdxyMEiquzq4VMjYbXRn0ELJ5aDAx2YdFuQK85/NOvgPocB8sYj0QABa6JhroVMTzVYpkUdOZsb58p6z3YMwDkbSG6nzqDIMPkIGWv8Wsfos6NnSlODM+5ZErxfQ1TkNbx18FK5+xaR9drN1fu5wisXtx3/iZl1A9ME1zCWFcXMBSoNkQ23LeXAr6oZkRNaWMMmLjIaiplwOQWcRjOB8bzb8D/fPZ04aVLpSQpdZKlYxmagfvd4st8kAH8yCNDVWQMGXDVvh82qDfqUqZVGSIIgH+gnQX5Z/pJ4t3ls3/Iavld8WMH8O+T++/ScaTLHPeYdlDVoqOdi8u8QapNO6RGWHYKLQy3h9jiIs+Q2/kZIlCrjvO/wDSHyzy55EzIifuDvrfgQCkIywUZPCOyNjz4mwO9fRfVuanMfHtYNQbs7E783n5v/7Wo4+k3YX X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 448df2a5-1095-4ef5-8f69-08dce84a0b71 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:30.0004 (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: uwvlaqfrNRsrPeQoDAnd7E2WZi0FT8AD1rwqi72N0WOeIuPgFkfO9ywx9MdP3O1Fn146Q6GWZy6nXz5DcqHwuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 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 --- .../devicetree/bindings/net/fsl,enetc.yaml | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/fsl,enetc.yaml b/Documentation/devicetree/bindings/net/fsl,enetc.yaml index e152c93998fe..1a6685bb7230 100644 --- a/Documentation/devicetree/bindings/net/fsl,enetc.yaml +++ b/Documentation/devicetree/bindings/net/fsl,enetc.yaml @@ -20,14 +20,29 @@ maintainers: properties: compatible: - items: - - enum: - - pci1957,e100 - - const: fsl,enetc + oneOf: + - items: + - enum: + - pci1957,e100 + - const: fsl,enetc + - items: + - const: pci1131,e101 + - items: + - enum: + - nxp,imx95-enetc + - const: pci1131,e101 reg: maxItems: 1 + clocks: + items: + - description: MAC transmit/receiver reference clock + + clock-names: + items: + - const: enet_ref_clk + mdio: $ref: mdio.yaml unevaluatedProperties: false From patchwork Wed Oct 9 09:51:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828079 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012036.outbound.protection.outlook.com [52.101.66.36]) (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 3A60518FDC2; Wed, 9 Oct 2024 10:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.36 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468400; cv=fail; b=sLb/WyBbSoBf6fXoDoQfejekjTkCob4m/5c3vYqgDG8tFBr/aa0dSHVul1d3GZDGk3okmu06IXoWOOaZ1/+AaWBJhwvEq6GwdPlCJs5kueR+u7rcXHUDWkMDuFFNIj/Kk8qj6O+xhgW3TlXKyFIels+h20L1Gp/NRv62Qrgt2Wc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468400; c=relaxed/simple; bh=CaWyKiunnXGdynJBcUs/O/rlLyQZ7RwbB4yRqWomEXo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lV7uy/bdj3EWRYBHqHU10qWKfj2+kUvDgXa5nUCkf5L1uce7pxH+slp+xzyRm0SxPaUY+gfkMGcXjwCM8P0HrR8fOV6cHkT5HgkF2uHGwBp6posxNEWVrJpZAJX02jr8zxN6igQu/4ApgdWf4uCe1rNL7uHGbWh/OkzE4WA9Km8= 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=cR5RRkq9; arc=fail smtp.client-ip=52.101.66.36 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="cR5RRkq9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P0iQSghrGW/3OO9g4kJQ67QoLplkn/ufkAMqL+0ekgRX1XlpEcrmXwyWagKe4fG5K+Ml+EIWQVavPj+tDhSrGiH+th2Vm8n74g1eIIdITkmQUpVMv56EsCf9gOofoo/u5OVlNFCSuMUqd3O9QTDQ/wnV0xXJR/+kSIblk1bFJFB/TJr02kXj84fJhv4vXY9/zM5BvU1dDeLRBFk+1mEQQwBnt7G4wzbLB5LuWwWgjizhi5PGdJAWpL39FUOFY/VyRVDyPgjsVzdOGRqnqrO7fmvJjjS/EDHTCgL7+CTVPE9l/W1S7cNiL56NEd5NvF7PlELa3fCrRMlHtaa7pHtK2g== 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=QJN9lcSp1kjVXoCCjR0SMfer9/CG6KAkkvc50/LCOIo=; b=SNjCaXfMXlsYZBrCzb012CqFgNjm6Y2w7sB9DSPM5hOw7hbGjF5i3Vb8NkLFjiN9SryIyIXQrgKMqVCP052T96QF+QQKw2p/1UQ7f3Io+Epe8FytCZQstkjiW0zBIXpleRN0ncloFzEVAxWiI21ASBDv8UDTl4iPnWWTDxgFV14Sf1beMhabommXKoa0HrzhgZxK0Agh5cbjUAYTyUIbx471vce4njlZwHV44VFRSt3eJMhUsE/sjk+ziae1WvotaoHJ7kGvNrMi+Q5MJ/XEpO8ygfOizTEF0B4+y6ox0rTluW+ggThP+IQt8z7fZ+ccW0oMbJiPcMT2hMq1mKKT0A== 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=QJN9lcSp1kjVXoCCjR0SMfer9/CG6KAkkvc50/LCOIo=; b=cR5RRkq97Q0rgZ5+GBVPmVcrsi2oaaU+5DcCcTJzICoZf+h+vboL748i7sxTbySkIcOqyRoM1N2bJlhCuxJx2Kk6Hj5aIDXn2EhJ5wxxIbQ2+sYrxVlVvAd2TVIzJaua5myG/zGz9QssUNtXZUxLKry3c/yzckdzcYaykaezMs7UibkR21DIX4ry6OslORbr5yjkxqrkGpNknP7yDGq7mSMUNuXsXuqXLdbgVHkWNKXAIAkAtP5C9H4QWJmVIOgIJ+3Dxj5zzIVKVidee0+HjufRlvnDc7FF9Wvw0h8Au03Mptbj7kPkt1sjAgq3W7XRXA+XLI04az36Jxtysba10Q== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06: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; Wed, 9 Oct 2024 10:06: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 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 net-next 03/11] dt-bindings: net: add bindings for NETC blocks control Date: Wed, 9 Oct 2024 17:51:08 +0800 Message-Id: <20241009095116.147412-4-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: 179d701e-1377-4934-8e98-08dce84a0ea3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: mJIIS38jXyKtNSc/bDuoEVUOEt80B+FvXN6GgCz9Xd71WU//HRJzoC00v942I45YpDO6WEJjMkDobjudSJdDEvd1DZDDY6KPwogxFdIbSLBS2Wu+63ypd15b+cSJFiSuHjQ3IR6WirlHzqE/l3gujkXiOZvGEORZMoQ3RDIpVO7SVWRz8nx7z55cdZZ0pYw8tjh3FKY3dmZSAmlcYHuH6jgC60FWzt0D+2d85C+cpZSoRSJw48ZALEZsZgYGOHSw1iYj4fhC+UXdjsjMV2mhPn3tE5bwshlGNGZLibQoO78mc6FrG1dbh7udGpMaiqVxT2RUBM0lLiKndGy/y7q8W+/rdIkuYLm/wnmzma65MqY3QnSVDyOZr75FZ8yJAlYWNSGjspkoC1l5wiylJInrfRN8nzImWskU1+xDyda4QIkKdQG26JcXu+DD09NZEtFJrw4RuwAo7nre4QO7KUatuGZKWJ+YX6P4fnbWElIlHu0bZBE1iyee84F+Ozs73SfKEGRs17L12byx75fFTO2mhOs+IsBaxZLUmw8wTE5QL6TyM1WWaNCmjYEZKn26GMz+JC9ESvZ4Fu1G7uqvi7Z9pl2pF6h7wEOhrXGTwmpcwtjU4aQyO1ytXurAif9kDs7CPsfPLaZS2owA2xX7VIciF2N0Yt+PrmFd9FefTxHQ1nU9xXvu3nyYZO9NXKYsVb9JbYCPJF6K0Io2hx+82ECrBCodmOGkOH7xvSLiFP2BZsrRU1eTxyeR/o8IeuqTg0OUK7ST4ZSwZZXYiThSVtaYC94E7QtV1ZOGWXj9HvMSt8oD0fu9/dqifoo0xfNYoavwUXkKLzZYBzkaESFJitNdO3kR0VzOlsuzqER66f10hO2ZEpnm5wMktEwxW5fGIa3Zv4cfnE+VmreAo9d9aWMF0a/jRXGpbw3JXAZGiR9JyE1HCe033vAz46EaCZl1fXe116Xfo9Io6mp42ivWjxcoKUJTVDgnBrDtIo6txj850c4qHsDR76/W+Gs9vkQoeKFMbkWIos6Y/a46UEdV8vFU5qdrnqJalg5ZHJ8ouAKB/IzugkYj9PlNBCUMi3S09f35yCP6d7uDwiyhqWKEL3M41KmFKSPouLWmTWcZKoIemPHziPw04DJKbi+8WjqHkJz0a2IGgix2oXkXv8Qce3zCKhhaz5g1BpN4Wwba3gXkfix9EeuX2NK7wZd6TDSJVcODCl/uauZCktu3dCDBTjyzS/2BhrUxMZ1JX7t/+qCOy8Odt8RT87epBkXCkVjr6ssu9YKe03PMdrWHn3En8L+m1/eRSX7IjBvhQxZaFrxGOwQ= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lt1gtHWqtChsa1Kx0+quZL1Isvmbl6XZKRajIK6yn/wvYkj7No8lhCqoGdyKNQUc9YSGlYjB0Kv86VqGKVfZC0DkeghUv2q3SRdDhsW0rSQ72C9JhgYp/midd+G6h9I7I1pjLZyXrWop4JSx+V5dJDLHBfsNVo5oEMyMGiR07kmFCmL5pOpViivSjtRhLtFsRZbtgSDeYfrFRB6w3aqZ6ZiDlMYMLXZrKJ+CFZW77yExshdtUNu12vro9x0YyonN3ZJ0sm7avaWrYpiBrNHtZSRJKLplNqLFW6w6rdywJEgNJ5qTPMM1tLym2xJ6qg7vuUx5cj26IGIAK7dv/TsG2RFysfb4DSF8jdzRTmgB90bcUODazMP5BQbG64eW1zDmdZRZXCI6nTiIrFG0C2PKxR04F2j7K2KJegguCny7UYu4CVPB7W36m4qjBNByOzID0VR/oty1/IX5T7cFJLA8Lys4F/k7qS6+/cJmOGICsA8bvv3eSe+90/GLU61I9LZAWDnGzl45LNctdli2xy7AMzyg7ndTIw91kpdf33FWrJMBCNULE6jItwfeoZvK8/HsgZ6VZwEwsdHbLqaIo6uY9f51pLbUuS+Rfmi32T+7wwPAsfgICUTLdem/S2urVDG12h0buW6Ejvjjc91u/7+F1/vT5lMfZP1s3Jqfj1PIbHhnlANnZkbV7XWS8He8dJt58t2hMu6hERGD0rQypOb8Iyet2YpoaQyWjYOep53nKWfWIZ1jLi3p5EA9EUTa0agQ4iRKZkXuAtT/dbYp50BTf5ExMOIermsqi7XpTLtlUsjjz5t9W+fho9WsU84AcT88uuYc2rVTVlI1yXNq2HbpdTxnZggXsQ5vZ89uIZXbP/DC3NOlpMiHRFGEI1Eyn9bissnESsz4UmTrLQOIfeJRgPV1Efz9yuTLJ4W2iPIA/5WXRvJi7OdKKVkMKnRuRbHzZwkyVlIXVanCySXsjbm/XTxoWnhoktmlUc681MGiCjvqzGg5elI3jqrx0fHdC32ii9cnw+7ur4q+Ed6n7a1/72NYr+jECNe2wfaG/7aqPRGn2uax4fk362nV8MPpdT597our99e4hJIIdphf1XOpk6xnZZFPgS0yik9kMk+k14wZ/xCoOKqOggJybk4CvSgz4/iXFDuYlfJSq5MdSQr7sGiyoo9TP7l6BXRgCWuxnq2ulwcGJkK1/a/kdrsJrlk2gRHII49JHlvnEmbR03LkkPR03DgMYA0IC1PGp8s7eNAhJYqblYEKlglpB0VFn1Tn2NSq4g1NicucwnYmWI6KUNI4SxDcO0GKQpUQuuiEOZ9lA9ITRXiiBgpptbApuE/uWKeaKQiTyn1ok4EncQ2V4XxH31B9sEma97UZahXMlk4YU1IC86/22jOcnpw1oPua9KkfpbOrrBELgjHPYcPQ4t/yAYy9MZu+5MECKYF/vjSc0HJbehJTJ3GwipZeueYxeRJfV7UDTqnw/HAFcOlxBstsKGYIp3ANaNihg2Co/T0E1wZ7T/AK8BoTT5uLEIpuA6ZN/vkfJLnx41UYS4irlpaaXubqxh9mSA3SbANv+RKDFd+PH7WCPdIIGiPG6Mgt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 179d701e-1377-4934-8e98-08dce84a0ea3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:35.2228 (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: 3TC6Nar+SkdX0DQtapG/Xu1l6D+22+/7nQsDG8FVECvfEfu/jaQGmmOZUuBhWAq2hZ3Ieu/Yoxt0tL1gwbDq7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 Add bindings for NXP NETC blocks control. Signed-off-by: Wei Fang --- .../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..7d20ed1e722c --- /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 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. + +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 + +unevaluatedProperties: false + +examples: + - | + bus { + #address-cells = <2>; + #size-cells = <2>; + + netc_blk_ctrl: netc-blk-ctrl@4cde0000 { + compatible = "nxp,imx95-netc-blk-ctrl"; + reg = <0x0 0x4cde0000 0x0 0x10000>, + <0x0 0x4cdf0000 0x0 0x10000>, + <0x0 0x4c81000c 0x0 0x18>; + reg-names = "ierb", "prb", "netcmix"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + clocks = <&scmi_clk 98>; + clock-names = "ipg_clk"; + power-domains = <&scmi_devpd 18>; + + pcie_4cb00000: pcie@4cb00000 { + compatible = "pci-host-ecam-generic"; + reg = <0x0 0x4cb00000 0x0 0x100000>; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + bus-range = <0x1 0x1>; + ranges = <0x82000000 0x0 0x4cce0000 0x0 0x4cce0000 0x0 0x20000 + 0xc2000000 0x0 0x4cd10000 0x0 0x4cd10000 0x0 0x10000>; + + netc_emdio: mdio@0,0 { + compatible = "nxp,netc-emdio", "pci1131,ee00"; + reg = <0x010000 0 0 0 0>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + }; From patchwork Wed Oct 9 09:51:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828080 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011060.outbound.protection.outlook.com [52.101.65.60]) (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 7B0B618E354; Wed, 9 Oct 2024 10:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468411; cv=fail; b=WqvBfyO1kzA7FImwTN4CqVG7/A41i7/fCmAmyKPv5ZFN/xlNy0AcLoGYZg4RA5reWWkRDN2HKex+vA/jRm3I08EWxdlIWZwJgtyYtsRv2a5CyZKiO8jyV8bxK8viZ6w/+fZikub74mevJwWPAX3KlIKKrpgs2o7o43BYkafPRUU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468411; c=relaxed/simple; bh=Md+ckmUz0NRVKqq9DdMLSqwcm7vr5oUvp8RzFFTrCQE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=R7U3m8W5reHtiEspFCJxl0Ex7VC+afxn7pNzawfl2X+DW/nnLkwOuzOuHqcIuXCUxGij3sAUCB7rqGzAnORYk2ki5NljikqK7fz5YoO07Y0FPBFgXVKNf9+Cmdx/dDsykNBk8ImRXdvU/6kwcHb4THVR2HMltDhm8PPlKdg2/9U= 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=KITbfP/K; arc=fail smtp.client-ip=52.101.65.60 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="KITbfP/K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ilEVUTdMyVwScKX9zWIckiAooY5GtUDOiIT/kECVwqaEV3WgReo+vEOc+drcgDAdgMPThJVe4PZagtAYgdRqkluRP/XWuTiNYe4BEnoBjw0rDpNCJBKP0Qhy2nMMKZ6Egq/vF5UjZvOToPqC3SpJvPoYKCVw0fMA8BK5bNLrmVpeFyJmuG8W49DxnZqHisNFtpRSQ8+mt3d19Nz+AiYMYT6kBl/dgYy7YulOLSO34+7bogJNaPhyam0CaUCeTohLtWwmxTUyNL2cSJdf6W2HR33Mg5P7bJ7zrM001CLdPS0l1ll+vcRHq3dh2KmqS8ipvXxlRs050WxnV/jo4rhWIQ== 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=ycU0wNh20KnF0RlOA6bdchKNrqgyQvwWgnHeyi1qmAo=; b=VajpKBbf0m9ZqbJHhyMuLvGlVet8fSRFAn6Djz/2hhV19LLZa6TAkiUqcUfaDT9HIA9upWgqRptBhY/QKkulglwz4J/h10DErv1v9IrUd2ME3alSPGaz9yawsstQ5pK9K2ACGri+CPuY8BzEQrLd+uDmJ4Pxn+IHJdSex7mNwIsU+BTZ5JluEmY66pc2jIr9a/tp8205/2q9uD57GbF6O//ZXDxsWoRTkSKo1ipLXT7wUu1Y7a3p1Gv+BbYndTCaogvqphOh/rRYVOW0PArzcoL/B31sQJKxNSkmMb5SlEGwoa7MP9OStxH9xT2QRe4SRnOqakitrC2vzGAAxOQJFw== 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=ycU0wNh20KnF0RlOA6bdchKNrqgyQvwWgnHeyi1qmAo=; b=KITbfP/Kuf19qlwdMbXWUB/RsryX/LntdeRAxPDR4Vxca8MdeVJZ5y1F20Wt3vjet3S29WtvHmjCILhnzCy7vsjhRwAvs6nzGRezpzd+qiEkjTTlMeeAL1afZJsG81/0NM7PTX3k6GTqtcsN2QtDGGysnBFk8u7oR0haeatBMe6HFyqFgr90310+Gybp3qtcJz1Tltl4Fw3Tzaz1bc7BhF1Y04tqGgcRs+pQq9CYwRzMZK8kHbKTsvTRzSf0rhhi1SLUNmThrtAfMNfss+xxIWBMwplpcBqWcWSxxdtZ0h+/RNPqnGmenNGf0nskpF4j0IizmvD6hfruO+VktHF3NA== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06:40 +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; Wed, 9 Oct 2024 10:06:40 +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 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 net-next 04/11] net: enetc: add initial netc-blk-ctrl driver support Date: Wed, 9 Oct 2024 17:51:09 +0800 Message-Id: <20241009095116.147412-5-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: 4404ec3e-8a56-40c3-093c-08dce84a11c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: mAm9V0Gv9dfXl9onVmPVR6FzJSG9+3JVRiYICbK8cLI0Wm/XMYvhi780RvD9s0VFLlnN4qMUBUxTAgtYrMihnd4AuDbQBIySuXeVkC9FCmD428jtAq5wmdQZf1ljsIQ04c6v0XFy//Ikn8eM4wnLUNplpCJug76OjmOOUBPaifoq5BaEtq74xb5XVcIi0TFyZGYU0vZn6RUctvTAjPwxTiqsnoku4OaFOCbfvOIlgxIofK/hOLOwkbGk8dAtUepFviyh6GJfzV8o6xZPqFKmyvsQX12iRrOWdlYWOOrD+UdOYkx2XH+OLj+uMDuN6dFJakiAJYXICb7gYuXPZgT1xH21CFjW+74qTPqZ5d6kUKFH3Z/68w0dhwVJAE+hUcBvnKEwYKlVZUtAAyAEYEHuV9Se8bgOQeM62uXZFxIwGJxypCnYVCIBcQY/xivN9k52bwYkTAmwP2TP2QdiYZt0cP7vGhtq8RqcftRFWvQTO6nP2nbzEfbCB/rZykA0V661uC3BbmE0hem7SejRJJ4k1igf9blgnoZtsVJSXr9+pIVu6EkML9ITXed2Gf9CLsRDnZI8+S1BtJv89JQ2Lbh37Z0ixBg8dmLQFW1ijM8eiZ4gqqGaLiX+iV18/NTOelvmg/1TYJgVHvozFkH56o+8Tnm4+eRlz1h1fjd+0pmwo5gcSrDuYQY4pNgKPpB9G3qxiDR8t+j/8xnMuqFRg0GviuU3iyxX5gfFZLAlpL8qcVjesYyQ+cqH1OlJdavZvLT3zMK4kq2OsczWvMEEDLD/Zv5JbfVTJuzq5KPZSU5S6WO7sUgq3ntO42ES62I2za1IrXqH+HFCYKwM06kBMjQpPuTCsuuHfLxVNWk+qtFsvutItnWytb8Xd4PsE8ta1RLqt0nAamzUGonAY/0I0Hv9vWoL29kZyGGxXniWCsI/mGM1847iUJMWSC6pu2wzr7cyw1c8/2q/+P8NUKk5cVaJ62Cu7dFdOsDBp3o86pDlLjukJgHV0i82WlVcNxMH1oKi7mKzwUoaJu0CoRk5kKljPO1i6nL1u3VNBsiXasJROlm3Tl5EA3PR9lpwmPrda3ABelCskfFi92ig0blFIYzURTSYo4Uv+p3a8r/TpKmojB4tBieClNH1gNOBiQXuVbFPO8yjW/9zm8laPiLaPSc9eQlsbBTHAkKj/pmXnZKy3YpaSvz1SGyosraQ3F3A33wWvAcplfdpkEn4pjQbkeApVCaWQ9vw+CpHya1rlfWbM5Snxadcx4nccw5NuE+42t9ZADo8N7wEHf0ka8aDXmF9rIeaKjYzJ1ps5UU7gZ+8Qswdke9sAvAg0VGKfHbhkK8JJp+q/U+5QknJ4HV5Br7O0zj+w6GY3NVypNaa2wgUc1s= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bkGY+o36SAtXQ3suBdEuVaYYAlXrBEY8ZiO2lQNaN4gIhvVXexbVJbaAg4dgxCOKHbLzqLjezLbSqLLOSvSbMV+7U3S3C/QyfPK3RirgxQMasN4A5lZTTOfzlMJH6wOxY3EeZnocT47VVfCypczP8ctcBHVQHcWjptJrfyFN+p+mysLOAtTn9IlGqJVO2Hkpfe26JktkRjsa/L8oe/Ku/GXpkhXtvB/d2dFYl0iippTRuZ6FNvQnHjeJG73bzoxvXWP0faBzRom9slHRUCiBPnkTYDqWMc1RJsTtKPjtWCAeJP6o2tPbxZuqworGZ/P5HGKkOEuvo3Jg1AeCKJ8AmHhFEKfStL0cnpRmrJ/iRV9md6SgHxWYeqPo7sZIPH7rY6RzWUXaZGYBG+s81i0HtNFSQmFQkkeq9NoDASwOB3418u1nDLty6iOA4CA4DhRRKQ/5ZbwVPaUAehdw1qe4gnszadftXnyhgPUiAkF/LDIK0nqRJ9iXxVEG9HDRQtZjl0L71AlYbYz+U3x1/OHncZ4j42LEQSWTGp86OH+k0gZQzxBXKDcmp7vXSBWEuQAs192p7Zd8gJ3s6/2I2vsqQZFgXJyL8F8f/moTnuaw6s9PpL3FHbwbmDc0BfXH/KNqIU10CGYg4dUBMuKby93bK8ampbRkupdEt2mCLSeCtIY26clVbRopYALVxnlP6pcQobYH3EXgY6ZjORDnFUck6KHEcGviPBLTlk2nNX16YSx7Ihc+vu5gPE83benbduAVoavo6twwMUhv1l1D2NzRJ9rG9dPDpsGd/mWG8mis9VOggVd8fv47rG/rZyeyVJrgROhGMgJjaOr+VAtrhimPFKt5fWm1I/rXesiuVNWv8mgDVAlfvLMFgoEBG36R5ebZAeuQeEXpfMYk8rmmbHTGsOpyXpvQ2mtfCwsO0+2fUTZ7wdTY5cGUqa48zDya/3HemtXrt3u7xXWtr9gTf3AmMb/VL6Bg1jeUxIJz0FB1ip3u4TmKhuG8CK4mOw/e9AoW2D1v1xcF5k6ZNgZRycCtGZwTNwTgzRhf2QzO8ijpNBlXMIqV/KbpHUBVVdJzC9m8JmzpgMcme756bmJNFa203pDIJLXYgSanPSY7smcmzPTyuEVQeGqNbRs8nawn5fw6lUxSNU6DlLmn7tq/U0RxZyt5hyjIsd+G+cScM9tEqKLy/W7EdzGv6ubx8CqL+wPbLQn7Ezed2dz5bw5sSf6WL5FDEykp76gjdGHOHnG0PpdbMcswpDEO1Vv3GVbSd98LtZSP1G72X62RKcxGhQsKYIXtHcbeHeJxnNZOmaL+agd2UdYO4bte7Fb+5BqrHozd/jRsMaWmpqIHCxRQRF4SUWy/7Yy9AR2SIeOuv+e+DoI1aZwhxQ+J8J432J2IT7boU+JXu9BePjP4B5pAF+vRjnMwa3djDuv7D7QMB63MzKcvy1shl8zKdXVSZmSqQyeFUWxdy2ZLnD+RvMdiDCBmnBx7BCM+satEsWhTxMEiXfP48UIXu5ZiW33t2pTLit0hQvG08FodIwuQVWyekI/m2l63eG3jaCHQqZMGUcmuDZ/JezLjv/GshSgtqZ2HgTHo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4404ec3e-8a56-40c3-093c-08dce84a11c3 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:40.5564 (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: izLajfMRDfwCZrEkAPxM3iaZ8WE5BjLMTzTJ9JMPAC/tQS0z2D8cb3io3YAeHrkqwXROBdh+7fyKQ1dgY/R7iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 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 --- drivers/net/ethernet/freescale/enetc/Kconfig | 14 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + .../ethernet/freescale/enetc/netc_blk_ctrl.c | 476 ++++++++++++++++++ include/linux/fsl/netc_global.h | 39 ++ 4 files changed, 532 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/ethernet/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/ethernet/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 := enetc_pci_mdio.o enetc_mdio.o obj-$(CONFIG_FSL_ENETC_PTP_CLOCK) += fsl-enetc-ptp.o fsl-enetc-ptp-y := enetc_ptp.o + +obj-$(CONFIG_NXP_NETC_BLK_CTRL) += nxp-netc-blk-ctrl.o +nxp-netc-blk-ctrl-y := 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..b8eec980c199 --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c @@ -0,0 +1,476 @@ +// 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 + +/* 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 = 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 = platform_get_drvdata(pdev); + struct device_node *np = pdev->dev.of_node; + phy_interface_t interface; + int bus_devfn, mii_proto; + u32 val; + int err; + + /* Default setting of MII protocol */ + val = 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 = netc_of_pci_get_bus_devfn(gchild); + if (bus_devfn < 0) + return -EINVAL; + + if (bus_devfn == IMX95_ENETC2_BUS_DEVFN) + continue; + + err = of_get_phy_mode(gchild, &interface); + if (err) + continue; + + mii_proto = netc_get_link_mii_protocol(interface); + if (mii_proto < 0) + return -EINVAL; + + switch (bus_devfn) { + case IMX95_ENETC0_BUS_DEVFN: + val = u32_replace_bits(val, mii_proto, + CFG_LINK_MII_PORT_0); + break; + case IMX95_ENETC1_BUS_DEVFN: + val = 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 = 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 = platform_get_drvdata(pdev); + const struct netc_devinfo *devinfo = priv->devinfo; + int err; + + if (netc_ierb_is_locked(priv)) { + err = netc_unlock_ierb_with_warm_reset(priv); + if (err) { + dev_err(&pdev->dev, "Unlock IERB failed.\n"); + return err; + } + } + + if (devinfo->ierb_init) { + err = devinfo->ierb_init(pdev); + if (err) + return err; + } + + err = 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 = s->private; + u32 val; + + val = 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 = 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 = debugfs_create_dir("netc_blk_ctrl", NULL); + if (IS_ERR(root)) + return; + + priv->debugfs_root = 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 = 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 = netc_reg_read(priv->prb, PRB_NETCSR); + if (val & NETCSR_ERROR) + return -1; + + return 0; +} + +static const struct netc_devinfo imx95_devinfo = { + .flags = NETC_HAS_NETCMIX, + .netcmix_init = imx95_netcmix_init, + .ierb_init = imx95_ierb_init, +}; + +static const struct of_device_id netc_blk_ctrl_match[] = { + { .compatible = "nxp,imx95-netc-blk-ctrl", .data = &imx95_devinfo }, + {}, +}; +MODULE_DEVICE_TABLE(of, netc_blk_ctrl_match); + +static int netc_blk_ctrl_probe(struct platform_device *pdev) +{ + struct device_node *node = pdev->dev.of_node; + const struct netc_devinfo *devinfo; + struct device *dev = &pdev->dev; + const struct of_device_id *id; + struct netc_blk_ctrl *priv; + void __iomem *regs; + int err; + + if (!node || !of_device_is_available(node)) { + dev_info(dev, "Device is disabled, skipping\n"); + return -ENODEV; + } + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->pdev = pdev; + priv->ipg_clk = devm_clk_get_optional(dev, "ipg_clk"); + if (IS_ERR(priv->ipg_clk)) { + dev_err(dev, "Get ipg_clk failed\n"); + err = PTR_ERR(priv->ipg_clk); + return err; + } + + err = clk_prepare_enable(priv->ipg_clk); + if (err) { + dev_err(dev, "Enable ipg_clk failed\n"); + goto disable_ipg_clk; + } + + id = of_match_device(netc_blk_ctrl_match, dev); + if (!id) { + dev_err(dev, "Cannot match device\n"); + err = -EINVAL; + goto disable_ipg_clk; + } + + devinfo = (struct netc_devinfo *)id->data; + if (!devinfo) { + dev_err(dev, "No device information\n"); + err = -EINVAL; + goto disable_ipg_clk; + } + priv->devinfo = devinfo; + + regs = devm_platform_ioremap_resource_byname(pdev, "ierb"); + if (IS_ERR(regs)) { + err = PTR_ERR(regs); + dev_err(dev, "Missing IERB resource\n"); + goto disable_ipg_clk; + } + priv->ierb = regs; + + regs = devm_platform_ioremap_resource_byname(pdev, "prb"); + if (IS_ERR(regs)) { + err = PTR_ERR(regs); + dev_err(dev, "Missing PRB resource\n"); + goto disable_ipg_clk; + } + priv->prb = regs; + + if (devinfo->flags & NETC_HAS_NETCMIX) { + regs = devm_platform_ioremap_resource_byname(pdev, "netcmix"); + if (IS_ERR(regs)) { + err = PTR_ERR(regs); + dev_err(dev, "Missing NETCMIX resource\n"); + goto disable_ipg_clk; + } + priv->netcmix = regs; + } + + platform_set_drvdata(pdev, priv); + + if (devinfo->netcmix_init) { + err = devinfo->netcmix_init(pdev); + if (err) { + dev_err(dev, "Initializing NETCMIX failed\n"); + goto disable_ipg_clk; + } + } + + err = netc_ierb_init(pdev); + if (err) { + dev_err(dev, "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 = of_platform_populate(node, NULL, NULL, dev); + if (err) { + dev_err(dev, "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 = 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 = { + .driver = { + .name = "nxp-netc-blk-ctrl", + .of_match_table = netc_blk_ctrl_match, + }, + .probe = netc_blk_ctrl_probe, + .remove = 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_global.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 = ioread32(reg); + high = ioread32(reg + 4); + + val = (u64)high << 32 | low; + + return val; +} +#endif + +static inline void netc_write(void __iomem *reg, u32 val) +{ + iowrite32(val, reg); +} + +#endif From patchwork Wed Oct 9 09:51:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828081 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011060.outbound.protection.outlook.com [52.101.65.60]) (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 676B7191473; Wed, 9 Oct 2024 10:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468413; cv=fail; b=mSFaGbxI1zgGTopHvgLyFa6q1lU8vrseNKjPf5/iypi8mAm99GotIHeP4kuDLFTLK4mXDS5KPB5DuNdDWC1W0zk5Aug3uSsXxnqCbt2DxABG50Tx5c40VlXjPchE25PMNxhHCnJauEBjnvxoD33LIB8yFOJYXlKs0K8v2PQnzw0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468413; c=relaxed/simple; bh=vHTo+gaCL8dEEkDBk+6Dc48jwI7Zon6gjkRf2kpYt2Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XzMO/TEe77Qg84FYyoBViMO5kgvOepjg7OVk+j1eGTzxDpk6KHbJubbJi+rVQEsoccptkPhNUto9JsJ4eM/bWotrI0gbD9vcoHXlKYmLEqT4HDPYGVg3fCYETa+rU++jRpMI+y7dixz19zJ+bR0x8HmnOk1TeOf2c6P/rdrFtmI= 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=MJtvXnJB; arc=fail smtp.client-ip=52.101.65.60 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="MJtvXnJB" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ozIZlqb24hfykFHk9IwAVqImhIlUg9f/ttzn0uZM8Mfw263vGhMoiQdUZWe2yTD0x/tH9koOFC6rHwaUmuaPfkDdnCwW1mzI6+kMLBg0hs/DC09Rsba2pLlJGbFw2XETwOl6XxLRkCkuTjN8reoP/I9vs9fsSjpTGYQ2xPSEETlyuNyBPQb+TpU6NgfM14E4sZ1voTVDAmxVLgwRvOLKtxDAACzMHGYRQ9SZFcnmdMxKCZrnsYowDRcRNvIogHCOyI45caSLMoV4hP1gw+5IIHjzOiUWw1dEYu7GbojnFMtASUe6oIRYRpakuh4RRFEBkRPis+hrkmly5Q/rWM7/gw== 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=TCbdjvFGHrXrYZNOMDAbRaTbjL+J0xtXKV4QP/8PAw0=; b=ZaXILWFpMMc/Y+bPR43Wq946n2mEE02bxee6kW8mPGDmcjksou6NTwa4Jv0PE6K+M9vDu7Is1NNxhwox5jAiFAoyQEp6peD+KIQP45dn72hm3pNKRhxS6vMvRCTr9VqWlfdQAsLSeW/9gWJfn9WQBEiO0CJAzQS5fqHTlxe3AanZcomLZs+4VfkugmXk6LpwX89ykerxua3gyv/oNg//bwhl+uOWfuMUlYLUFQKEyo9qL5B/iDcrx6Dzygx4f4/hltUBkRMQ4eK4kqfo2ryrJbsCFDrikIpo4jLa3gAGZGzWvzdEbeFVP4UbnRd1Vc5x6btdDsGZdsRoAaFf/xTUqA== 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=TCbdjvFGHrXrYZNOMDAbRaTbjL+J0xtXKV4QP/8PAw0=; b=MJtvXnJBnBiizPty4MiV+PB4HbmGfnSzRyXE8Rsh0u4CzcizEdC/1yUlNKuuvJUWc4rKPWEV5HVC2ubGniQT8APYX8TomBxwfIkbNv5b+Lzf9rA2go2NOFhCQ8TY6nrnbReUomCzttJ4vcODl7VcEwbP++8+Ep+3BHXyROOGfw99ngzjmsSoFv1GtybAgUdFz3iByva27iIUtrgylkL7cgig2sm/n8QULBYdCrihopA3NrcWlDVbmyckKiL682P6U/h8tz74fYkyyo6qHILfXhFzDWY7AuHH49cMprdX6mckloYaTGJr1xupWX3gH9vDfel/nyrjj/g9NTRaquGWeQ== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06:46 +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; Wed, 9 Oct 2024 10:06:46 +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 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 net-next 05/11] net: enetc: add enetc-pf-common driver support Date: Wed, 9 Oct 2024 17:51:10 +0800 Message-Id: <20241009095116.147412-6-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: a7f892e5-ebcf-4363-b1a5-08dce84a14ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: jOQur7ZwsCZkFkl+NiSj+x+edTajucrojknzXXizDj198EinfAgQNlnWaz6EoYAppB9vR5Ur2SmtR1lq+9ZoGx2QCTTsYmhGSC/bYO7KVnXdk/sxwVkhPPZrM+IdBaeCLaFoaPCsoruIb52yDrdPeQGSIE40YJEeQrfzzYE/8Pv3O6BeyquIK3xbqzRJsCNHM2raxKU2bANsShyAjy4v9Isn6S2vs90Hs/488KmsR5NSKs1pV8xDuKO86uZsIXbK5HbRjnZCfao5Kyn3/SGU3+Ogf20BpyRMr7koZdrBni15b2Oq1nPLBvSIWcOUDbe3aZSjhAKNEmcMA4sKd2spzjtX8wl+G1oo+SDXSfOOx8E6tvx58jbrddULV7F8wPav6aCCkF0i9hFRFvP8jpTSySS1oUj2lF+14ilPtYwZ60sZQGJu+OC9+6WfRgf/dQCs6qkIB8aEr/VR90evKtZ+L/NDLak3xdczOAQxfmMG32kd/sVMeI9L9/vm/XMRDU2QFTTl1yUGi44ISuNAARwS36wOLEFZKWfAPs1y+EgeFEKWRklAzMRhh1kuJnw1m4QgUq1cw1/npuBuzOYACCe3yuqhaOXkkF4seW3acA5DI1yvdLnerjtMg7WfcTmiUrP+GbhEGtEymXuNynTZfNgTD6d22w2cUBL+x3kA/h81MoCAlXQxdIEQpgw6ZlaRgzXCpvbI7si+OtdKLt+8La/6uSBX9AX7JRMM54LRxaQP9iMPbacQRa97iV25/z9PKf2+GgNQessvyl1lchKO6gW4j+XYYNXjybY/V9r+GZTWd04QDbCDO6r1wwWiH4qYqJgwBIhjLAJWE1jYLzTs94ToHpYLPJ/boJawze9P4JwP5u4g6T1Q+g2Y1L78GgDbs2IiiRM+lC/ML7J4dKDaMCbNdMxIRXEWqZm1ZTV5pOcfkeqYh1qZ4xVAXDh6plojOK5o5PISwl2eYZ4FSdIzT1RjsPPnigAC4KBZG3FGjBA2GHJWZVpul1RldxUm2dD6uE2KZ5rzJGXjiy0Osi9MI0hlO8UPOWF6IRjmGSBLi/IK16XTbIqsGTjJgtGyb2ahOTUd/f8idqcg8SlNKYvMIfdu+dQbpdQJba665BVULl3TfGUUqf/SejDmmS3azgO/xEoTiEqcoDCp+LHKzhB62mbo5ykFuaysC+tvBi6hpdiSiEOuXfa6GRy9ccnV33k4snZOiLQirLTqZN6Y3mBWa1mBHPne4heIIGupCqIbva+Jz4Ib4ELAr2lLIk8VgidV0dlJbENrn6vIgopc1eQXCMg1WoLrp0bt+DDI6SEwU1clNXTxZnj2TEYenGTxTM7/RH12lNfQY5cA8OGPxnyLjkApqwC2aFI+uRQQQjzx8RSgD60= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Oh88tQ7twIBj7m0jufHui4NuvQujwEKzoMWqCCUk7IOPP40XZMf3mqqugiMTuU6GhBn83zLBvge0Lj6OWVd+7UA+yiCR30hJ3IN2mW00TOqzIs8lVbph5Fl9iyX3cj8xNn+6lzN6Lac0IU3q96Vn55Ii4bbtnUlNaBZkoMMjCYwCtkg7S/6vcL8g0RplgCKfYvwrnsvzfm7b85zGTd7LQvkEnbUMK1Ibqsl22NRwmH1OBqUeWbIp1Eq0UxyWE0DEK5gmv9xNXV+farhzHgrdwXsaB4p+Tn3EwgvO+vQzgh6rMt82X5c7QFtgmjHu7/0xSdrEtsOlbTIaC/QT1bN5hrm6TELFaUl9vGyGKIqsS8IxPzWiEMr6eTmktbcFfr6bFQR74ESd2K75kPScc6xFYjfG3FoLCi9vQlLXK1lZT8S+LdATSyRRvRmvynx6xqarhTRivkcL1/qbEnAxrJwAB7vxBcRFwlYAgpDfEnyQfPU6lwLxBE9IW6oKimoueVTIem7ETQaRd/IahqrIXP+4vSOGB2qOXmJEJFun8xEtitISmB+9TwGPuDbvZaVidPrFs1eZ0/mzAVYTlPD7ZbhRgdukGlfe1Wf9e+FQ/tUUCkjDUxFbnmXIwmkvmj4HyDJdBKcWfBTFcnoanntr7XlLKYq3oSrh3Rrnmcz/zpsnU0iDk6ItEKgjyB4DSrCdIoNL8mpWQEX/C5+1AsbV/1Q0M/oqfUdCt5Gynw3VYklDdaPehqGdrUM1BfhsIOsFCC+cH8zpspHD4Ct2MKtKHZ2+B4McZ3jGTKozovyscdtFc1Y6udr6MNKclChiUY41mOE5PhR5aUx0y6c7rNodq4JkiZ6RgYkGIdBpg+BZ4x6ipuozp6YF1rkih0pKAX9tV2pcI9jFw1u77yGDUHAyM0kr6y4wslOeHwrXEBvVRQNj0/7oGPWnw1+uDxHni1eLQ4Jh89VjBvlHxPMEg4nL1VXQJrEDTh0ae80Cy4riUFSoLJB8uvK0fCltxOZpKA/fRMl2rUS3rNR8GLrlETsSGjgxVVvsMhx4DnsjMeFwMZuW0P34i3lcx4VjBE2v5ihs8aRpU4Hd1DPbGtSLj3WtvHa63y6kUo01OtLh26UfjTb2lpafOXPTzY3imvA/ejxuAak3bGJCbi+WXt2oNkl7u8GjMv2rb62RnYGp2aGAkgJtgwsRUDntGzvqU3h6m7lo0q8Io6YIV3qShJKH87Pe6OtS6Nlr0VStfIjor2T+lLbvaUjQaCCugEcz3na6lw1qPV1E66kX4hIz02Qxwq1ilmmmJtcSk/tuJRmyOTh/fYMNJVRCNimn8pMSh03POergjYcx+HfjeBus5lI0Jnxk2x97qsJ3V8rXnTEJfgZamCU2fozcRYCv5Vtob2r4dOwlGl/IDVnknyCdtWq3FO9qCzvZx0McZrbpg3q/ICt3j9HIXBjNhIPVva12qNTeTb7SKV6tUfgS5IXaVNwrAiLSzjL7vJKWtRF/UjiaNGE7zgCQlzVbf7SAwhuHegd59qZG6Qw4vvWZtUmsat77dp885E4jIs9T1CE7JmAEoyp4/c6Y/I+gqpxo/Ol1mg2ZhCDFx+R4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7f892e5-ebcf-4363-b1a5-08dce84a14ee X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:45.9285 (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: FvYLBAnd97WVc+28ua+CbryBX/YwYBqsDhtRM2LJv9WF+h+ukP1IJcATUsnc4s8nzJBZBZYtUqUcg4t3lIuN1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 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, we need to add a new driver 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. So in order to reuse these interfaces and reduce code redundancy, we extract these interfaces and compile them into a separate enetc-pf-common driver for use by these two PF drivers. Note that the ENETC PF 4.1 driver will be supported in subsequent patches. Signed-off-by: Wei Fang --- drivers/net/ethernet/freescale/enetc/Kconfig | 9 + drivers/net/ethernet/freescale/enetc/Makefile | 3 + .../net/ethernet/freescale/enetc/enetc_pf.c | 350 +--------------- .../net/ethernet/freescale/enetc/enetc_pf.h | 28 ++ .../freescale/enetc/enetc_pf_common.c | 375 ++++++++++++++++++ 5 files changed, 431 insertions(+), 334 deletions(-) create mode 100644 drivers/net/ethernet/freescale/enetc/enetc_pf_common.c diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig index 51d80ea959d4..6f3306f14060 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -7,10 +7,19 @@ config FSL_ENETC_CORE If compiled as module (M), the module name is fsl-enetc-core. +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 select MDIO_DEVRES + select NXP_ENETC_PF_COMMON select FSL_ENETC_CORE select FSL_ENETC_IERB select FSL_ENETC_MDIO diff --git a/drivers/net/ethernet/freescale/enetc/Makefile b/drivers/net/ethernet/freescale/enetc/Makefile index 5c277910d538..b81ca462e358 100644 --- a/drivers/net/ethernet/freescale/enetc/Makefile +++ b/drivers/net/ethernet/freescale/enetc/Makefile @@ -3,6 +3,9 @@ obj-$(CONFIG_FSL_ENETC_CORE) += fsl-enetc-core.o fsl-enetc-core-y := enetc.o enetc_cbdr.o enetc_ethtool.o +obj-$(CONFIG_NXP_ENETC_PF_COMMON) += nxp-enetc-pf-common.o +nxp-enetc-pf-common-y := enetc_pf_common.o + obj-$(CONFIG_FSL_ENETC) += fsl-enetc.o fsl-enetc-y := enetc_pf.o fsl-enetc-$(CONFIG_PCI_IOV) += enetc_msg.o diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c index 8f6b0bf48139..dae8be4a1607 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c @@ -33,18 +33,15 @@ static void enetc_pf_set_primary_mac_addr(struct enetc_hw *hw, int si, __raw_writew(lower, hw->port + ENETC_PSIPMAR1(si)); } -static int enetc_pf_set_mac_addr(struct net_device *ndev, void *addr) +static struct phylink_pcs *enetc_pf_create_pcs(struct enetc_pf *pf, + struct mii_bus *bus) { - struct enetc_ndev_priv *priv = netdev_priv(ndev); - struct sockaddr *saddr = 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 lynx_pcs_create_mdiodev(bus, 0); +} - return 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) @@ -393,56 +390,6 @@ static int enetc_pf_set_vf_spoofchk(struct net_device *ndev, int vf, bool en) return 0; } -static int enetc_setup_mac_address(struct device_node *np, struct enetc_pf *pf, - int si) -{ - struct device *dev = &pf->si->pdev->dev; - struct enetc_hw *hw = &pf->si->hw; - u8 mac_addr[ETH_ALEN] = { 0 }; - int err; - - /* (1) try to get the MAC address from the device tree */ - if (np) { - err = of_get_mac_address(np, mac_addr); - if (err == -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 = enetc_setup_mac_address(np, pf, 0); - if (err) - return err; - - for (i = 0; i < pf->total_vfs; i++) { - err = 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 = enetc_si_priv(si); @@ -656,55 +603,6 @@ void enetc_msg_handle_rxmsg(struct enetc_pf *pf, int vf_id, u16 *status) } } -#ifdef CONFIG_PCI_IOV -static int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs) -{ - struct enetc_si *si = pci_get_drvdata(pdev); - struct enetc_pf *pf = enetc_si_priv(si); - int err; - - if (!num_vfs) { - enetc_msg_psi_free(pf); - kfree(pf->vf_state); - pf->num_vfs = 0; - pci_disable_sriov(pdev); - } else { - pf->num_vfs = num_vfs; - - pf->vf_state = kcalloc(num_vfs, sizeof(struct enetc_vf_state), - GFP_KERNEL); - if (!pf->vf_state) { - pf->num_vfs = 0; - return -ENOMEM; - } - - err = enetc_msg_psi_init(pf); - if (err) { - dev_err(&pdev->dev, "enetc_msg_psi_init (%d)\n", err); - goto err_msg_psi; - } - - err = pci_enable_sriov(pdev, num_vfs); - if (err) { - dev_err(&pdev->dev, "pci_enable_sriov err %d\n", err); - goto err_en_sriov; - } - } - - return num_vfs; - -err_en_sriov: - enetc_msg_psi_free(pf); -err_msg_psi: - kfree(pf->vf_state); - pf->num_vfs = 0; - - return err; -} -#else -#define enetc_sriov_configure(pdev, num_vfs) (void)0 -#endif - static int enetc_pf_set_features(struct net_device *ndev, netdev_features_t features) { @@ -775,187 +673,6 @@ static const struct net_device_ops enetc_ndev_ops = { .ndo_xdp_xmit = enetc_xdp_xmit, }; -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 = netdev_priv(ndev); - - SET_NETDEV_DEV(ndev, &si->pdev->dev); - priv->ndev = ndev; - priv->si = si; - priv->dev = &si->pdev->dev; - si->ndev = ndev; - - priv->msg_enable = (NETIF_MSG_WOL << 1) - 1; - ndev->netdev_ops = ndev_ops; - enetc_set_ethtool_ops(ndev); - ndev->watchdog_timeo = 5 * HZ; - ndev->max_mtu = ENETC_MAX_MTU; - - ndev->hw_features = 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 = 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 = NETIF_F_SG | NETIF_F_HW_CSUM | - NETIF_F_TSO | NETIF_F_TSO6; - - if (si->num_rss) - ndev->hw_features |= NETIF_F_RXHASH; - - ndev->priv_flags |= IFF_UNICAST_FLT; - ndev->xdp_features = 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 |= ENETC_F_QCI; - ndev->features |= NETIF_F_HW_TC; - ndev->hw_features |= 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 = &pf->si->pdev->dev; - struct enetc_mdio_priv *mdio_priv; - struct mii_bus *bus; - int err; - - bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); - if (!bus) - return -ENOMEM; - - bus->name = "Freescale ENETC MDIO Bus"; - bus->read = enetc_mdio_read_c22; - bus->write = enetc_mdio_write_c22; - bus->read_c45 = enetc_mdio_read_c45; - bus->write_c45 = enetc_mdio_write_c45; - bus->parent = dev; - mdio_priv = bus->priv; - mdio_priv->hw = &pf->si->hw; - mdio_priv->mdio_base = ENETC_EMDIO_BASE; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(dev)); - - err = of_mdiobus_register(bus, np); - if (err) - return dev_err_probe(dev, err, "cannot register MDIO bus\n"); - - pf->mdio = 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 = &pf->si->pdev->dev; - struct enetc_mdio_priv *mdio_priv; - struct phylink_pcs *phylink_pcs; - struct mii_bus *bus; - int err; - - bus = mdiobus_alloc_size(sizeof(*mdio_priv)); - if (!bus) - return -ENOMEM; - - bus->name = "Freescale ENETC internal MDIO Bus"; - bus->read = enetc_mdio_read_c22; - bus->write = enetc_mdio_write_c22; - bus->read_c45 = enetc_mdio_read_c45; - bus->write_c45 = enetc_mdio_write_c45; - bus->parent = dev; - bus->phy_mask = ~0; - mdio_priv = bus->priv; - mdio_priv->hw = &pf->si->hw; - mdio_priv->mdio_base = ENETC_PM_IMDIO_BASE; - snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); - - err = mdiobus_register(bus); - if (err) { - dev_err(dev, "cannot register internal MDIO bus (%d)\n", err); - goto free_mdio_bus; - } - - phylink_pcs = lynx_pcs_create_mdiodev(bus, 0); - if (IS_ERR(phylink_pcs)) { - err = PTR_ERR(phylink_pcs); - dev_err(dev, "cannot create lynx pcs (%d)\n", err); - goto unregister_mdiobus; - } - - pf->imdio = bus; - pf->pcs = 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 == PHY_INTERFACE_MODE_SGMII || - pf->if_mode == PHY_INTERFACE_MODE_1000BASEX || - pf->if_mode == PHY_INTERFACE_MODE_2500BASEX || - pf->if_mode == PHY_INTERFACE_MODE_USXGMII); -} - -static int enetc_mdiobus_create(struct enetc_pf *pf, struct device_node *node) -{ - struct device_node *mdio_np; - int err; - - mdio_np = of_get_child_by_name(node, "mdio"); - if (mdio_np) { - err = enetc_mdio_probe(pf, mdio_np); - - of_node_put(mdio_np); - if (err) - return err; - } - - if (enetc_port_has_pcs(pf)) { - err = 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 iface) { @@ -1101,47 +818,6 @@ static const struct phylink_mac_ops enetc_mac_phylink_ops = { .mac_link_down = enetc_pl_mac_link_down, }; -static int enetc_phylink_create(struct enetc_ndev_priv *priv, - struct device_node *node) -{ - struct enetc_pf *pf = enetc_si_priv(priv->si); - struct phylink *phylink; - int err; - - pf->phylink_config.dev = &priv->ndev->dev; - pf->phylink_config.type = PHYLINK_NETDEV; - pf->phylink_config.mac_capabilities = 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 = phylink_create(&pf->phylink_config, of_fwnode_handle(node), - pf->if_mode, &enetc_mac_phylink_ops); - if (IS_ERR(phylink)) { - err = PTR_ERR(phylink); - return err; - } - - priv->phylink = 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) */ @@ -1259,6 +935,13 @@ static void enetc_psi_destroy(struct pci_dev *pdev) enetc_pci_remove(pdev); } +static const struct enetc_pf_ops enetc_pf_ops = { + .set_si_primary_mac = enetc_pf_set_primary_mac_addr, + .get_si_primary_mac = enetc_pf_get_primary_mac_addr, + .create_pcs = enetc_pf_create_pcs, + .destroy_pcs = enetc_pf_destroy_pcs, +}; + static int enetc_pf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -1286,6 +969,7 @@ static int enetc_pf_probe(struct pci_dev *pdev, pf = enetc_si_priv(si); pf->si = si; pf->total_vfs = pci_sriov_get_totalvfs(pdev); + enetc_pf_ops_register(pf, &enetc_pf_ops); err = enetc_setup_mac_addresses(node, pf); if (err) @@ -1338,7 +1022,7 @@ static int enetc_pf_probe(struct pci_dev *pdev, if (err) goto err_mdiobus_create; - err = enetc_phylink_create(priv, node); + err = enetc_phylink_create(priv, node, &enetc_mac_phylink_ops); if (err) goto err_phylink_create; @@ -1422,9 +1106,7 @@ static struct pci_driver enetc_pf_driver = { .id_table = enetc_pf_id_table, .probe = enetc_pf_probe, .remove = enetc_pf_remove, -#ifdef CONFIG_PCI_IOV .sriov_configure = enetc_sriov_configure, -#endif }; module_pci_driver(enetc_pf_driver); diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.h b/drivers/net/ethernet/freescale/enetc/enetc_pf.h index c26bd66e4597..ad7dab0eb752 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf.h +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.h @@ -28,6 +28,15 @@ struct enetc_vf_state { enum enetc_vf_flags flags; }; +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 *bus); + void (*destroy_pcs)(struct phylink_pcs *pcs); +}; + struct enetc_pf { struct enetc_si *si; int num_vfs; /* number of active VFs, after sriov_init */ @@ -50,6 +59,8 @@ struct enetc_pf { phy_interface_t if_mode; struct phylink_config phylink_config; + + const struct enetc_pf_ops *ops; }; #define phylink_to_enetc_pf(config) \ @@ -58,3 +69,20 @@ 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); + +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 *pl_mac_ops); +void enetc_phylink_destroy(struct enetc_ndev_priv *priv); +int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs); + +static inline void enetc_pf_ops_register(struct enetc_pf *pf, + const struct enetc_pf_ops *ops) +{ + pf->ops = ops; +} diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c new file mode 100644 index 000000000000..bbfb5c1ffd13 --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -0,0 +1,375 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* Copyright 2024 NXP */ +#include +#include +#include + +#include "enetc_pf.h" + +static int enetc_set_si_hw_addr(struct enetc_pf *pf, int si, u8 *mac_addr) +{ + struct enetc_hw *hw = &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 = netdev_priv(ndev); + struct enetc_pf *pf = enetc_si_priv(priv->si); + struct sockaddr *saddr = addr; + int err; + + if (!is_valid_ether_addr(saddr->sa_data)) + return -EADDRNOTAVAIL; + + err = enetc_set_si_hw_addr(pf, 0, saddr->sa_data); + if (err) + return err; + + eth_hw_addr_set(ndev, saddr->sa_data); + + return 0; +} +EXPORT_SYMBOL_GPL(enetc_pf_set_mac_addr); + +static int enetc_setup_mac_address(struct device_node *np, struct enetc_pf *pf, + int si) +{ + struct device *dev = &pf->si->pdev->dev; + struct enetc_hw *hw = &pf->si->hw; + u8 mac_addr[ETH_ALEN] = { 0 }; + int err; + + /* (1) try to get the MAC address from the device tree */ + if (np) { + err = of_get_mac_address(np, mac_addr); + if (err == -EPROBE_DEFER) + return err; + } + + /* (2) bootloader supplied MAC address */ + if (is_zero_ether_addr(mac_addr) && pf->ops->get_si_primary_mac) + pf->ops->get_si_primary_mac(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); + } + + err = enetc_set_si_hw_addr(pf, si, mac_addr); + if (err) + return err; + + 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 = enetc_setup_mac_address(np, pf, 0); + if (err) + return err; + + for (i = 0; i < pf->total_vfs; i++) { + err = enetc_setup_mac_address(NULL, pf, i + 1); + if (err) + return err; + } + + return 0; +} +EXPORT_SYMBOL_GPL(enetc_setup_mac_addresses); + +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 = netdev_priv(ndev); + + SET_NETDEV_DEV(ndev, &si->pdev->dev); + priv->ndev = ndev; + priv->si = si; + priv->dev = &si->pdev->dev; + si->ndev = ndev; + + priv->msg_enable = (NETIF_MSG_WOL << 1) - 1; + ndev->netdev_ops = ndev_ops; + enetc_set_ethtool_ops(ndev); + ndev->watchdog_timeo = 5 * HZ; + ndev->max_mtu = ENETC_MAX_MTU; + + ndev->hw_features = 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 | + NETIF_F_GSO_UDP_L4; + ndev->features = 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 | + NETIF_F_GSO_UDP_L4; + ndev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | + NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4; + + if (si->num_rss) + ndev->hw_features |= NETIF_F_RXHASH; + + ndev->priv_flags |= IFF_UNICAST_FLT; + ndev->xdp_features = 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 |= ENETC_F_QCI; + ndev->features |= NETIF_F_HW_TC; + ndev->hw_features |= NETIF_F_HW_TC; + } + + /* pick up primary MAC address from SI */ + enetc_load_primary_mac_addr(&si->hw, ndev); +} +EXPORT_SYMBOL_GPL(enetc_pf_netdev_setup); + +static int enetc_mdio_probe(struct enetc_pf *pf, struct device_node *np) +{ + struct device *dev = &pf->si->pdev->dev; + struct enetc_mdio_priv *mdio_priv; + struct mii_bus *bus; + int err; + + bus = devm_mdiobus_alloc_size(dev, sizeof(*mdio_priv)); + if (!bus) + return -ENOMEM; + + bus->name = "Freescale ENETC MDIO Bus"; + bus->read = enetc_mdio_read_c22; + bus->write = enetc_mdio_write_c22; + bus->read_c45 = enetc_mdio_read_c45; + bus->write_c45 = enetc_mdio_write_c45; + bus->parent = dev; + mdio_priv = bus->priv; + mdio_priv->hw = &pf->si->hw; + mdio_priv->mdio_base = ENETC_EMDIO_BASE; + snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(dev)); + + err = of_mdiobus_register(bus, np); + if (err) + return dev_err_probe(dev, err, "cannot register MDIO bus\n"); + + pf->mdio = bus; + + return 0; +} + +static void enetc_mdio_remove(struct enetc_pf *pf) +{ + if (pf->mdio) + mdiobus_unregister(pf->mdio); +} + +static bool enetc_port_has_pcs(struct enetc_pf *pf) +{ + return (pf->if_mode == PHY_INTERFACE_MODE_SGMII || + pf->if_mode == PHY_INTERFACE_MODE_1000BASEX || + pf->if_mode == PHY_INTERFACE_MODE_2500BASEX || + pf->if_mode == PHY_INTERFACE_MODE_USXGMII); +} + +static int enetc_imdio_create(struct enetc_pf *pf) +{ + struct device *dev = &pf->si->pdev->dev; + struct enetc_mdio_priv *mdio_priv; + struct phylink_pcs *phylink_pcs; + struct mii_bus *bus; + int err; + + if (!pf->ops->create_pcs) + return -EOPNOTSUPP; + + bus = mdiobus_alloc_size(sizeof(*mdio_priv)); + if (!bus) + return -ENOMEM; + + bus->name = "Freescale ENETC internal MDIO Bus"; + bus->read = enetc_mdio_read_c22; + bus->write = enetc_mdio_write_c22; + bus->read_c45 = enetc_mdio_read_c45; + bus->write_c45 = enetc_mdio_write_c45; + bus->parent = dev; + bus->phy_mask = ~0; + mdio_priv = bus->priv; + mdio_priv->hw = &pf->si->hw; + mdio_priv->mdio_base = ENETC_PM_IMDIO_BASE; + snprintf(bus->id, MII_BUS_ID_SIZE, "%s-imdio", dev_name(dev)); + + err = mdiobus_register(bus); + if (err) { + dev_err(dev, "cannot register internal MDIO bus (%d)\n", err); + goto free_mdio_bus; + } + + phylink_pcs = pf->ops->create_pcs(pf, bus); + if (IS_ERR(phylink_pcs)) { + err = PTR_ERR(phylink_pcs); + dev_err(dev, "cannot create pcs (%d)\n", err); + goto unregister_mdiobus; + } + + pf->imdio = bus; + pf->pcs = 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 && pf->ops->destroy_pcs) + pf->ops->destroy_pcs(pf->pcs); + + if (pf->imdio) { + mdiobus_unregister(pf->imdio); + mdiobus_free(pf->imdio); + } +} + +int enetc_mdiobus_create(struct enetc_pf *pf, struct device_node *node) +{ + struct device_node *mdio_np; + int err; + + mdio_np = of_get_child_by_name(node, "mdio"); + if (mdio_np) { + err = enetc_mdio_probe(pf, mdio_np); + + of_node_put(mdio_np); + if (err) + return err; + } + + if (enetc_port_has_pcs(pf)) { + err = enetc_imdio_create(pf); + if (err) { + enetc_mdio_remove(pf); + return err; + } + } + + return 0; +} +EXPORT_SYMBOL_GPL(enetc_mdiobus_create); + +void enetc_mdiobus_destroy(struct enetc_pf *pf) +{ + enetc_mdio_remove(pf); + enetc_imdio_remove(pf); +} +EXPORT_SYMBOL_GPL(enetc_mdiobus_destroy); + +int enetc_phylink_create(struct enetc_ndev_priv *priv, struct device_node *node, + const struct phylink_mac_ops *pl_mac_ops) +{ + struct enetc_pf *pf = enetc_si_priv(priv->si); + struct phylink *phylink; + int err; + + pf->phylink_config.dev = &priv->ndev->dev; + pf->phylink_config.type = PHYLINK_NETDEV; + pf->phylink_config.mac_capabilities = 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 = phylink_create(&pf->phylink_config, of_fwnode_handle(node), + pf->if_mode, pl_mac_ops); + if (IS_ERR(phylink)) { + err = PTR_ERR(phylink); + return err; + } + + priv->phylink = phylink; + + return 0; +} +EXPORT_SYMBOL_GPL(enetc_phylink_create); + +void enetc_phylink_destroy(struct enetc_ndev_priv *priv) +{ + phylink_destroy(priv->phylink); +} +EXPORT_SYMBOL_GPL(enetc_phylink_destroy); + +int enetc_sriov_configure(struct pci_dev *pdev, int num_vfs) +{ + struct enetc_si *si = pci_get_drvdata(pdev); + struct enetc_pf *pf = enetc_si_priv(si); + int err; + + if (!IS_ENABLED(CONFIG_PCI_IOV)) + return 0; + + if (!num_vfs) { + pci_disable_sriov(pdev); + enetc_msg_psi_free(pf); + kfree(pf->vf_state); + pf->num_vfs = 0; + } else { + pf->num_vfs = num_vfs; + + pf->vf_state = kcalloc(num_vfs, sizeof(struct enetc_vf_state), + GFP_KERNEL); + if (!pf->vf_state) { + pf->num_vfs = 0; + return -ENOMEM; + } + + err = enetc_msg_psi_init(pf); + if (err) { + dev_err(&pdev->dev, "enetc_msg_psi_init (%d)\n", err); + goto err_msg_psi; + } + + err = pci_enable_sriov(pdev, num_vfs); + if (err) { + dev_err(&pdev->dev, "pci_enable_sriov err %d\n", err); + goto err_en_sriov; + } + } + + return num_vfs; + +err_en_sriov: + enetc_msg_psi_free(pf); +err_msg_psi: + kfree(pf->vf_state); + pf->num_vfs = 0; + + return err; +} +EXPORT_SYMBOL_GPL(enetc_sriov_configure); + +MODULE_DESCRIPTION("NXP ENETC PF common functionality driver"); +MODULE_LICENSE("Dual BSD/GPL"); From patchwork Wed Oct 9 09:51:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828082 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011060.outbound.protection.outlook.com [52.101.65.60]) (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 29C571917E9; Wed, 9 Oct 2024 10:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468416; cv=fail; b=itBVbD5odOLy0jRedK0Za6tA0EsJW3xdd7Ob7iV88gKLDeT6DmO7Q8I6t8Z+nzfmoFxEd7Ua7rHc646ebU25Ti4tHzloVvXYJoihFt0VBlIOUZHfrueJhbg0GCjB55gk4GMNzVKkjRd04fGIk8bvy5gnUVaMQPBBrf3TOYFCMYQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468416; c=relaxed/simple; bh=XTi9Up4PRSEaUoK9K7iQF+uFrIWBJZ0jgJcB+HtQvpM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=TTBeYpdIt4LX7IUDFV5swvpCQeQ01+krB4GE21/bJkLJh9p908WdimFTwHwNzV0YFMm5AocEhEjpPU5flhMtc9lZchWSmtpqD4NE/ezbotKCmoMMarH7UjUic1pVnl6z6IWsaKbGkS9akVlyG5nIq8QsSCsZ+naSvbVHpwA0E40= 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=ZBYtOyxS; arc=fail smtp.client-ip=52.101.65.60 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="ZBYtOyxS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vTfPGNJbZDt6YCuQBufQwCbCG2Ka6dA+04GA+AHtv1jmYNQ6jtUH7LPiWfYd2QZjvqhSTvkhjXx9ctw/TF+2sjCPJId2uorDi/oagqLrXyT/Dn3wjBSOx3k+i8ijad+VcAO+jQ7gipp8MI9DD1WMqae+90FbUYhbULqU3kvTD/VKk17r4XDAsn7ff4Ns6pbK/1MKC8A7aUoRtUnYZ+iVEk836hr80eduDL9Ai/qZA2fb6lCyd+19efiiLpiEIpn0K2j+R0qlYEa/ixWVGOiC+pNiCYixSmPOuHOraqhkvQ30u2CJ0yqQzWuJcRY0NyRbY+bZlH1Af/V2hcUaQFtzfQ== 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=nKDZa1Ot52gYjDanyl3kPaluXq5pJJ0Vixrqz2nTD/I=; b=hFbeiHJrdUem8roarNiv5cQwqJ6Nj8cnU9sRccT3QzJj4iq3em9wyMm5GPVi+Hr0M5s1q6OfOuiRDCsPgIakbzny2s3ZP6Vvhlhvge2l0LbSx6netRXtZ00F76ddlY86dkCElJPF8MzOT9iZyXePOCMOp7hKf6375eMej0YX2rJHv5fAgnvQW5wnyZMxaStKL4DrdFSuhZ1Au37yUdZxq/asnL2FtrbFZCs9a3SOgiGcwhW7bEFz4p//P3ZG/ucOOtK+/tQlYLVod3I+vXHGTLxmb4TJG3eGZMUkEJIoJhtqs+l6RXw8w8rdSoyj+Rxf5MFj2ac86OI7XN8gcHVd7Q== 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=nKDZa1Ot52gYjDanyl3kPaluXq5pJJ0Vixrqz2nTD/I=; b=ZBYtOyxS6sxROPWsPi4LIavOFC4w+vdro102rpHnIz7yZyul3OQDPzPkp7EGNW5o+8a/fShbWamghaYzsWI+PKYjyenjwU+SkPQdvBsnl07FBjVzoxBI/L+L1IQhVPnTdp3KWJ1c8L55UHG6jTz5oePDZSEtBQOz36qu8eINfA5yWdoyobG6bP1/0R9EzOxDmNcixtcxzoaLBXQVhFNbYVIWIX53dWRvfZ+Dwt4v8vuc+GTBMrzYjWe8BY/7wdvu3fpWmFo+AVbLiuyWEZR7QLgKzXnR8shZWeBrfmDurM13PnXitrlmxoIxiayz2tcNRuW1L59oOJ3+l24V7vrCbA== 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 PAWPR04MB9933.eurprd04.prod.outlook.com (2603:10a6:102:385::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.24; Wed, 9 Oct 2024 10:06:51 +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; Wed, 9 Oct 2024 10:06:51 +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 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 net-next 06/11] net: enetc: only enable ERR050089 workaround on LS1028A Date: Wed, 9 Oct 2024 17:51:11 +0800 Message-Id: <20241009095116.147412-7-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|PAWPR04MB9933:EE_ X-MS-Office365-Filtering-Correlation-Id: a1f64e84-d373-4035-79c7-08dce84a181d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: uND/B+NKxQTVBe1JeQd6e51oQVdcIkLzl8DCuzKCvkRWcoqGoXVTJKCkUBsGCn55NyJxQpa6hWoldDDZKNYplcvDZRUWJulNy3wLx71037uS5k+jgVCmmhZXEIaBBsArzojvz8SKcfP//8LWMOuTrJU9BUVCjRlsQwQYOixdbL9skuUZkiyCS76O8TcJgwjyugJBJh+YKK31rBSvLl/39iUJoPRWjHEhZDGALZG0N+wks6jhlqa3uTSI0meFRmh3fJynttKZKQtqcUYfRnQjHVXD5+GHembYjt0awnKzuPMpy8+lac3iZpjwI8p/4YmWHui4+Th/k2peZdttPHQDYg6k21iYevUsrC3lbN694n34RVCTvLLwotvQRa7pfjnmaT1oL6rdFkPPwN4WNpG7L9w/o4i9BXnaZce2fGDHkZYcXJLw3zeO2jbCn39hY8TN/qJ/vfPRy2Ws0qhMZ7p7YmrEoam968X/Evw2K13AqLsfUon3/RV5N1TXC5B7Ui2VWORv16Km5clz6GKgUin1C8Gfi5rsjWGizwmgrIlqr0VuDQ2UnWr2F2zL8tapAknd9beA1esEhNpDZtGdHh8DTuAuJN4tigarF0Exp0xaecNBMUM3AbSzE1W0RD25mLTI8P87aZ2lvMW9LZ5tzjzgQQS0OJsqntPfAgIN07blBGEHIRcfuBxUj2A28VHxA8C73nZu3gDuHePl5VUdNO7LLvDn1fBQhMmeO9B2X5tsVaL2vX2pTTAJ4+VSAU4P1Np0Vm5P+9xK8sajMQ9yPncwV/FLvQEXk8VduFkvka9VjCPZ8NzmGhknrNkh3ILVQ1dutFPa67DEy+RITMyiyxRcHsygL/ih2gvOc+lckTrJdx80nJzxD4fCrv4YtQmFCmAxOunmknvjvywj9RhmHmzVx7VAvKm1elTRAKTHbzNF/ywJ9YKDq63vfZx8QKg5cGUUHKEmE44+cecl9R6ehUZJuxgf1y27cV0DVIBwaA/cLMLKPqKS00CrIB7GfH+NfrW+z0lgqfD8PwvgH2cpNM3l+EFXtNMEZcndsHPwdW86xThVZGUGSz+odmHfXfO1WUcIH1A85AWEXu7e0VHqSXoW3I4OfHPWiaX1PaFOhn47ZpPgzAigg75ro8o6wIeDyusJkbARvgQnWQ+Sfe23pHFHYc5swXdtpJBMp6d839j6SsSOopvS+AlgoAXsHrNJHUMZSEvqHFyDi3N+4qw/kpBli53hXySYEqfBZ+QY4Xwx3A+8RGbskROEzvFfbIH5QRGHON5edxz366Jw8I/j/X/6hivVomoXjGlydwA9DZTLqsR5GUo3bSAoRj7Sxalr+lq6u0yTPyxDXMOb3XEITOAvXiIs2chJ+GSEHZpw5TnJ9Bs= 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)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tjE5RtltYoJJs81NX6s5aL684ljrswgT/vQWqVzxQx2fXmy04aVoaleqiIb4LS1dA7aTcbn9jJ0i/cYZZ26Rk+kvoW8sJlkUhtUDi6jqiosdcR+ptmnBI3JvOtyYyWBW+EtjAcHkQHaxR4X3nSQBDWoT9w0zX6SUZfwVsFcCySn73kHW+9Kt+r+A/uyeomGCzPKyiUz37Yo1SCsbBuub+WZmVmCBaIzXi0I0NvOS1ASMdA408oZlJ9uUhZQBq1i4crAVDRjw6oUeKrxkGxWNSGyW/Jjb3vC9CfCzmHPZ8sHlR0vk2StwJFLEKf4qtOVmXKZKhalKQlupE/dxD+rj5UDE7335Xz89ysS2lcLEdY89E6qwFDqQ/mxuJVIYDE3h64Bdu4mVq+PVuNRrZQIX/7+me/lj6LL91473wmC3NRey2fQzUxj+kXphklhB6EgQBEjuUz1NEvsWBOcvtciFTNcdc1dN6PFiVuZoc+nqAKULedEZDRDfcu8zJFF0Sp4mR4Kkn5WhZojP0C8dXzZ0V3tbG+fs72BjZ5KKb/xa7vNJPAOA+En8WIZDzRLqfjgGgGMrpisCNMuVmyrxYpgsnwZ3JMw9vqdI67lcy7B5cMQJEPG7znXzhenpZzd/IBWQVhC6a2fjeAV8vxGyLee7QXxIG4w3UiDeVTwVxpgguc3yXQm4skoL3Pd5XN4PGX7FVr4XbmtGB7XTU/bwPgUXlG4QzwOHgC8vwoAaG8ShGK/6q+k/bWWlbb308GxB/WKGSplS2S18EmapznOIHAZ20koD1P0oZ4+Wnsyc5ZyIUHNERbRkzXMtYpJsknQvV6SdaCVgTLgCgVXqb6lNzt2eQ0XHsxDutfHmLn0QIko9AK4SWDQC7xEOXg6B21qoPDYRIZDTYEY+669lrYrRJkvEQ3/VWrSuCkJrzdeGzWQNHlbTDLqYVE6uG//IvRPDq5/SQrFuvYr/Y7OB0+nl5vsFyOG89jSuK8LYiRXeNmK7S4eXuuYHLEkfKgBDtUFsZbyswYix5nbP3S03WbcGv/sDydfCuVEv896Ty3GdB4CSVMKq5XayIFxPs9ANypcbbsuus1HFfEAZjOv9JMcUGw5UrgRhEor4rzHq8Hj8rqr++8q7OIGRRMXBc0+CGFbld/ijIc9yGjUXtB1J9Ka5+zNP5BbRUM3ye6oNUElqZWVeAw0+SiVORFWaG8gtQ7ayOb9P2J18+BJnKYYIiJVM5JoErYjgaypgp7xgJzLZh9mvw3Twwqnyn8rTJd2oID6K2e9ZaoeAnQ+AvjMCmVSMqqncQ0xc3rwSPBUMnRLv9dJAW1y9L3tEPldYUkcdo1+fyEPCwQTcLN07eRtJbh5rNkR6urXmt3sdSyZpK16j5eHkBCkcYDI5dcd8NunW8ttHbPqqO+ejd96ZO3xhnMNMYaZpOdgCR0jjlebqG4gSBaPrMBQ+uBKTRZjj52t06xKJRGb9a9v70g8Pz/XQPNKg3mJ1vW6jal9wG9jMkMRMn+euzVf+/+JyWDumCCC/NOTePmMMqFdjha2Of5KqJDxcaJhqKZQFwbFwQRVPshdx5qOzOY50XZvntBLpd6dfjZq1ZGjW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1f64e84-d373-4035-79c7-08dce84a181d X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:51.1352 (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: Y45zNK/s/JAPB7QaydjJV5+rOzcm7YdPUTrnSjAN7olrHreGxhd9DbA2To3qJPKosHfXj1S2Y9cj5shM7vV++w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9933 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 --- .../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; +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); } static inline void enetc_unlock_mdio(void) { - read_unlock(&enetc_mdio_lock); + if (static_branch_unlikely(&enetc_has_err050089)) + read_unlock(&enetc_mdio_lock); } /* 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); return ioread32(reg); } 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); iowrite32(val, reg); } @@ -452,9 +458,13 @@ static inline u32 _enetc_rd_mdio_reg_wa(void __iomem *reg) unsigned long flags; u32 val; - write_lock_irqsave(&enetc_mdio_lock, flags); - val = ioread32(reg); - write_unlock_irqrestore(&enetc_mdio_lock, flags); + if (static_branch_unlikely(&enetc_has_err050089)) { + write_lock_irqsave(&enetc_mdio_lock, flags); + val = ioread32(reg); + write_unlock_irqrestore(&enetc_mdio_lock, flags); + } else { + val = ioread32(reg); + } return val; } @@ -463,9 +473,13 @@ static inline void _enetc_wr_mdio_reg_wa(void __iomem *reg, u32 val) { unsigned long flags; - 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); + } } #ifdef ioread64 diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c b/drivers/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" +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; } + if (pdev->vendor == PCI_VENDOR_ID_FREESCALE && + pdev->device == ENETC_MDIO_DEV_ID) { + static_branch_inc(&enetc_has_err050089); + dev_info(&pdev->dev, "Enabled ERR050089 workaround\n"); + } + err = 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; mdiobus_unregister(bus); + + if (pdev->vendor == PCI_VENDOR_ID_FREESCALE && + pdev->device == 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 = bus->priv; iounmap(mdio_priv->hw->port); pci_release_region(pdev, 0); From patchwork Wed Oct 9 09:51:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828083 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010059.outbound.protection.outlook.com [52.101.69.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 AEF3E18F2D4; Wed, 9 Oct 2024 10:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468428; cv=fail; b=jOJwa44EOyh6+a9B278pZXop2tWJu1lqA1BbmuZkwQ7ak2cvPreDibrWwcMRzBMsPvDOHsJZ69YaWKR/wGDZzMyzZ6/g2pHUCNuglfH+mzgLRH/FkVPRFLKFjYzRtsSPgIXkLb/0bBh/0Lb598avUPE6sgyAH4y8/lE+2cXRYRY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468428; c=relaxed/simple; bh=ivBpcJ2SCZ0haFIfaO0WHqrg5WxHhL2KGehjbDcpqes=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=FKbcdxotrD193xpVEiW6ETkNZ8CM9BlkPdLpCp3fIJv4ohhHreham2+kQNyU5XwPH9lYw8djT9uDsqE5U505QnE6QICvA4uDG6vdz8HwcsshS8wPcQcl5ZXkWZFgzj5kRrTn5sBN+Kv8iHx9ddQX69Qyhw13CmiYHYnrmghckvs= 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=Lzt6/rWe; arc=fail smtp.client-ip=52.101.69.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="Lzt6/rWe" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HSE/ldxOTCho61kV68bMp+S/HYoWhDFY3f61XJ/9tZcSqoqGujvuLsRdSmi464gmknmiXZePI0oqHwBQp+Upqh4bx6++go6pkESpuvfeBIxkdk9aUgqQiwtI/w3q02LOZMi4mspRcGDPjKXxsh1tXf4xVYIs1jSudxifGO8TMD8uzGpfNrYyXWTEsjtqJoNwGd5gBpTY8MWZwKm9elHBxTdGtf6FssWIanX/8brZDbSO7Oo/YjdLXUwfqldOD8u/8MKPJC9QUtUCi7W0pWxgwuLDIwJQsNGNlKBQgfvN2agHvxwecQ9x5HzG0cRH6FvFYVCAog8uIAq2Q4Jp16peOg== 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=Cx3seEEpKe34KsMUC8CLUiN3V8WBcwJm17eLUO7vDyI=; b=EiHAikIMu6EvwM3/QtPuBc9LUATtU/y/c53mmKb9/Z5CBx6HcGAztJK2+Xdjm7oEVFi6/mp0CGzIbhesXy/L4nhqzkGVCK+MVXfq4JypPp9WC/2DkTljZzedVcAr8eeGg3hplThKdEe9kFTsJ03ussiai9e2A9ggwJI5GfaLqkl7lggfzQbsm82NmKHMTRQ0RV2mzUGt8v+LuyDn1w1aMtws3GA988ZJJNI9ZNKh/dPhNjfHj24YDwl2YATgDa9ja5+rTlbdvbBRhqlH3p1hmS/Vjq4RKalnbt/JabYM+cNoV/bKdEWaoPgjGY/wNYrNHAjK/G6mJ+Bnw2NDFCq/oA== 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=Cx3seEEpKe34KsMUC8CLUiN3V8WBcwJm17eLUO7vDyI=; b=Lzt6/rWeWM3BkdD7mbPobtHkx2T3hoxZ+2dh/SBjnxGSvdae67+RjVvED2NcEGn91mXZ0hqB9Kh6VKcuZMGQbGPoefk3xOQTzc+FvTJ7ApXKa5mOyxMUfM/yyzIsWoZCZ8lHYKgvmYia6VXEBoGJPDqS52KZv3AiMphsGP7mHYQZ1GH5wefcxYvds4vxeONwPoHcixWIG8N/OvURYSyweQ1NeZ4aEZ0N+EWbZl54+OjS++ZfRNm92JFlB0HoklumeQ6NdyPxTvvdSDUR6a1HpiwG0ycHj5Go8PtV1UZy3Qfgl26R2gTxUNEWXNDlL09l4GF4yOgIWCf1uCAbPn49MQ== 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 GV1PR04MB10154.eurprd04.prod.outlook.com (2603:10a6:150:1ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 10:06:56 +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; Wed, 9 Oct 2024 10:06: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 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 net-next 07/11] PCI: Add NXP NETC vendor ID and device IDs Date: Wed, 9 Oct 2024 17:51:12 +0800 Message-Id: <20241009095116.147412-8-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GV1PR04MB10154:EE_ X-MS-Office365-Filtering-Correlation-Id: c0950e16-8eb7-4494-a6dc-08dce84a1b35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: 5MUSQSFKjC4JQkujCxW/oSHeNeLC3oOZ3CnJs2RVpQs7ER+RqnyZZEQ51Dq4HG41hOrealIBU4fURNYQt7zYF/xDU/IQl8Fa7n4KcPcM26Xh5JFDELU9ldB/O3KAfi3ao36aSE3GvGPV5IC+qlDT14X/gZm9f3jzi7HXG+P7HedZI4djEeLdmZeZiU7IdhXwtEjyORTMK+Z+pg30mfC02H7+NiTTa7XgckEPDe/HUePfHd+GxjL28+nGt3lknf8IlMda1LMEZyuCvA/lxkBjP6kxibWfWaUkNXMkiVOMdesch9kDfa582RVqGx1nSFGy4VwfwCRZMnYacaZb2LsLlh7UMVxyDb0t75+c6z2aQLUDZk5t6pQ0Ve73XGgNndLXgPcSKZWVemHQXm9OIT28A5MHHjXwwkHjxGnsUFLfhNFYtIHny3pT2VYdgOOghXBZJI3egD17IxavaVpzb28qLbpQIJliK5qXg2Q1znDcuR3ZdDAE6SAVP9YTu014PcaM/o68wUE/Okf1pOjWkSOBe/UnSPOg4H+hFMtJfeVus2isVWPGKNlvH6xv+4sY6H7e9VTxd8r0Ozk5LOaHpEfzydE2uGvDsxv0Pb0InKgYB5sXkRP8cP5XSrDp3UFz5NK1mXbzzJz5+uCtlzGhyxVfZGWbWN6jThQZSu5sKharttQcl0fvnJrgs/UHGeH7oDNFL41q/3J69Yzk384sk+IuzUieX1u3UgxHzRKyf31WHcbjQJdQvT19S9jv8BYjWqJ5O663+616PCpmL6L1J3CTJy0tByhDm/qLkw8d12m3+ghiOB35D7qb0xswVrCO2lZAX5n7T7XyxKPn1VPiFCWmhmZ3Au/CwT5YRfr2TFQU+CKJXQnMKFyO3z3+/GCPnXZWYtI1Ii3M0cEl2BJC0o0ZAeARuUbUAvAxlVzkGkbJGxWl4SFfktcb5s9MtjTivees5bNWVn2yS4CSfvIqSngDrTV2AiqUn2mYWb7D1D5hW08CdAAnDkIIvtytQMnCQBaz7xcb0PwV6xE6W4o3JyXIrMTzT1Lmnei7ag8YFPvY/p16FSjWThzjiGhH58GOibpbqDIn+162O1YHwVTOEdduxVqsMWB5Vgmz7O5/SueBYt+AqJ5ZMbcZVOYopoThRLahyQDvYae0kpJ52rp6W2XT7CSiVir0+oAMxH/MnKgaYD09uuIMquRBCRz+mLqJhsf979B8faMpVGtDECs2yk85NA6lXRVrZR8D8v83rav7OUhlAfd0FwM4I7V4lLS8fpIcd6D2wOUufZnrOT4jbbvLWy/LgkFuWWh/h8qjLXJrIO3WiJvhN4HrvTXIxcmFZ+TA6dU36rzuN8oWMnUH3Ck1nqLfj/KtUvmp6fpvzv03vMM= 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)(1800799024)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i7BHmiwi10yxS/lhdK17M/90Dj6NfahOMVWzHPX2/DA9BUYbHDB3HfMqvfWtLxk4wW74ecWBs1JsTLo/95/M26FpBTZGBuDxGtgWDA0Ui9+5qoWMGyJYiUl/eDE6e3nBjPBdznPp6ZPqh3WAx0zYtjQqxWQbAU5psjOm5BJJxbRDxVWVNV/EESKid4wSAevtt5NBAHbOFoCdYkqv8cE84VoOwxw+UERl+ap1TTkWXFMfSCYsyrlJvQgh2JH46REmA8svTU8gDjsslktd2EJdBf7XCCB4YeIkf0oT6BwWQ5kmEzUxZUrge3OIuHtNFqFQgikpqe1JmBEAO6wBG0WuoRO4LYe2Fk38kUN9WC7mUCqLcLb0OmYEUFMXMQxAZ0scZylCQSacB9Q2dbJUiBQcNugD0g4+X7hXROGqSGVgzXbYWcYUZypDyHU7jtwXzyqxyK/i+hGhJxPIRcepZ1vqltex1pv+kjodfqwwpnQtothfnFY67jvGNohrRO0l03Ys1jBXwEsiFiUjVqd5bNfY7m6djAHfrzxeIwcuUR7iNGqAYMa06YbO20PohQ6O1jGT+ywpdw5/KVhNDn17w7ZcsHbpWq8TOA1thD0rXppqdzYT9NbyzNM8t80N3pOOAAdCCorAqMbkcKcb7XxVUHcKk/Vro806EYL+hrfLvrVQxyThwm2xypzCpiUGEGz5jjpwPfowqW+2hBMzDahf8CVPe0HkZn3NnmKWhqNHBXT5B4Z0sBeIWjSWVWB8oeiXsHp33WLOSG6W9v/Woz18aTp3eqn/mN6DwBHmW6P4qBcRD9LKpvtyYHGn+33oCh4rFnzQVVgfAk1yuJ09/tpDZ+BqpR9VvOGtOMD6y+YPim2W5mSYrAm7VV9piEdEDCQQxQlRt5P/c5IZPoawJhGA1Dff+ecnPIbGxOMvCR3/tGLkEcKXPEU6s2Y5fR0Y8idaXxYCheM2kp/kYzLLZsK4IuV2UDLfnjcQT1es+rDkcmWOTHgeWlLWwZPy0z03i/QmZudD5FIVw4xjUGfizms8Ro4+7KBsB86IcZ4zXDIDUzaVrcT1mT9C/XNnHmn5GXGHi407rc/G0p99HKQpoXi1hFW5S7U1V343PVm+qOq3oJswvSoEtVCivAWXO4sNHMUvep6sIl+LfDVEdB1iBGWKwa+yZPBhM2EU3Vwa2HCKaT0Hbzmx4q3deaXX8PjgFUB89Qgz//nI2IYgGB7ed8awaJjAUE0LQPO0s69G7RpW99xM2CwOMnoc+cEynBz9nQYR+W92hI9XTmAEFTXY9nBCsEyj0uyDsIIiZY/KdMy4Sv1iojEjaRVDoTi5AgNCwSrKlHTZ/MsVoXGrGSvHfD7UDR9ezYR44WlM6PSqT3r8Q76DtBMoltdJWCUcIw1EMYCMzfRZv7VWNpA0yLF8x42Em8UcBDJ+TsUN/WloHyOVU0aMafzdrWFeB/277ihRkG0EWRtpgF8M5upNr36EHcezPIYH0NfgGu2/rxgHlcKfz4IJX53OWpoyMzkVC7Vz+c9LXL30QnsFh8ryEc39eUmDmhrwCvmnMRSlNYVG3UV4lXYLZOV5AxviPpLSHT8k/GhN1lwh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0950e16-8eb7-4494-a6dc-08dce84a1b35 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:06:56.4627 (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: kZlgP/hhEA7No2nkT0GQqzCcmJM9EqxvbgChhL/s9Sg+dnl0CK6K33xtg9m+brQWL4Qlfyr3gs+H97eCqA2qNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10154 NXP NETC is a multi-function PCIe Root Complex Integrated Endpoint (RCiEP) and it contains multiple PCIe functions, such as EMDIO, PTP Timer, ENETC PF and VF. Therefore, add these device IDs to pci_ids.h Signed-off-by: Wei Fang Acked-by: Bjorn Helgaas --- 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 +/* 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 From patchwork Wed Oct 9 09:51:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828084 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010059.outbound.protection.outlook.com [52.101.69.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 06A101922F6; Wed, 9 Oct 2024 10:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468430; cv=fail; b=U+jhvKcWupjRvE1H7MUNYa2TuRsgS72aUFDJ7vxcWx+7y01UYngv4KneDhQ6TAZMbNmITHOSnVpIuMvjM/kgItM+X6va5TQ2XWjeYBVjkiv+cVO7ygB88/MeS2pDvlSsa1uJ5ueHVa+CYPL3+MrmT2y79Y4we7ML1CwK6l+r4jA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468430; c=relaxed/simple; bh=bavqQl0aoqUHAjRcsFCoVvqDURe79oU9IwJ5VOEOnas=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XO8tD36opm7lOp005zpNMzMnE/TKFfITrOYv65btxpK1F2PU7cHWNpvrqHIip1aKsgHiUR5FYPDjYWyKWP4ZedpSJRcDUYs9GiusnKXESNLPeT6cqWswn4VQit/UVoZe/wl8cP2/kOYZ7Op1aVtjLRu/YxDHev+cdlScu7GWFMY= 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=lrSqWVf0; arc=fail smtp.client-ip=52.101.69.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="lrSqWVf0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YsbVj0EV60gFWAhSNqsdsxgZpjSJuzabhqZbwAvctP5XVWkhQgIY5G8vMo/yCvfkqmwDn7pBCEE/El1zmh+7a7nXUafKF+whM4tdm9/HSzdMjmYQ1FAwUy3hNob1DjxiSR6NRFb+r/n6GfdeVktowD0w1QYBNWEOa7WIxrLCHfGcMDqks9mMmEcJMsVPDq3/DIrjJLrzX4MHYlEMtYk9/d8U0C0bUhAAhjrR3IfOBSPI/+0xNZ8YMxDKpH5GAZAPVnWmcWgsLc9wn0P4QFxjm8gO/iNWhCLVyCwJUwT5Dx8pGPYXhcq37qX6pE2vfYyHNQP8oOEQZ7umhUBekHo6DQ== 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=QPliVlTAjyRM1Tuq9GY+56O5XqgUPKRcUQVD4O4fa3g=; b=oePdVR31cKHkZ26b+N08srihT9vGF6sCuc+n+MP02ljTLbc8GH+dscmYZujQAgNzaRSN2qAYI2FCOQidHZjaGoLOHDABhxSytwQvIMV9oGceAAl98S+Cnu77m1qmPD2jLGozDz4qv6yCT0/a5/+jF371RsDUvNSMUlS3pl9yA4mDg4ansqDns3r8EdJhJ9DQJIUIK8EmaHrguCL7oDn9pl0GqKt7srxH4ECBqz8FF87bfxCYEUPbpSj1juumjW3r0klSpG56CHT2BA2b7NWN/FFgNPG8UdOes+EIqtgkgTnDOK5N2VqUugpBepilxGfDQkQqeTwKbgaeZxdIZFNiYw== 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=QPliVlTAjyRM1Tuq9GY+56O5XqgUPKRcUQVD4O4fa3g=; b=lrSqWVf0PJiqdd9WqpBOtknwcUGmWFPER/hycBauN3JAgIY8tJX8O9svCxfdrfc/9L9TIrzaqSTuAL0VF+u10M3bHcdIbGqpSGBPUVbxDGh5fQuJ0n3t5vAOi+/pAL/6gg7uvBRSvukoIqqwnxpEVDTNPgufAstBRZOsmWgDBuEghhKXBSvAwQJAxYY/U+rb5r0bR10T/Kf0OyYK+KGJhZoPVfQCu3bD1NXYr6w00Tva5dZmSeeL1STvGO/uJcijvK9i2wVrAqk5lGjFYNRed2zWSR3JOhgpdJSzhwXtkvZ3A5lcg8/PNU2mGYZ+SNnyYux3V+nXEjWvIdtV3BR7rg== 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 GV1PR04MB10154.eurprd04.prod.outlook.com (2603:10a6:150:1ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 10:07:01 +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; Wed, 9 Oct 2024 10:07:01 +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 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 net-next 08/11] net: enetc: add i.MX95 EMDIO support Date: Wed, 9 Oct 2024 17:51:13 +0800 Message-Id: <20241009095116.147412-9-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GV1PR04MB10154:EE_ X-MS-Office365-Filtering-Correlation-Id: dd5c38f3-501a-44d6-233b-08dce84a1e6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: FEdHiFuKdhN8l86bndPPnctkFY/fZUCNE9FA24DYGW/2o+Rzu0eBjptTxSzItnsKn787C42auMXBqH3xp0YBx+NpNynrDT8nlBq0h3U0KD5ayt3Km67WgC+If/S5hi/qqOwq2fQAJ59hQ9xZJpnq7icUxhfVOjwkgXfmV3538eUDI5thFNOgkOmzJTmGjiQgfysDjekqdaeFhzSoB+hXfvpCid0AHzk6ohbVtpgtGZ+H/gq3OdBh6n1OuymdMDbARWvcEBOk8McTa570jhei5wyGjZcQMful+yD+VrGvO5jW724eWvD8ybSLIQEnBWLkSphSVeq9wkQx+3rlWcfozfo54KsVTlTzWlT3DJluWU9DEz+36PR60/kEqjWfaiBkkRGXO5RFcNYw9Tsq0nsFZpvPWzDONKf4X2UOoejyvQDI43IsOrguIC2+JERC3LtV+4JEc7Z7Op9BxA9pfLOzL7aao1u4gwLjVbYv0qHVdYdJGGupbsjlqz9BeTGPGzO/tX1aSLKEJRIhkoyXelRm6gzuaEMR2COcuqqH7dtMTSYyJA+cOTZWOVJ21AfELl5+m0welEFJrm4LfL0L/b5Dh0cGHwwnJE91g1s2R8MXUK4PKEv4F7KaKpwGJ4gEQ6L1u6mOD9r+rEcy0jWdGkWeQtdPnPqLyBSy+TXdMUtIrCX/je5ah/5VMfOfgwiFrNd+tYKyJIqZXzGlFoQ16FqufmvfRoJ14Ev9crr5UOXLxh7xYkWGFndeb4CpyFRNaIWP+38tGV/fiRw1tM1I6TZK87R6pFjTxQqS0NvXaDoWrtT4ph1YopxD+IFAAYUQu7U12mAmrnECmBOm8gUWKq/ntom4yllOVdNvHtqnZ5dAx7f03SMn2rOlhgdDPAHLyFQDy/EGqEPKRFDotS9htuP6whV4CStP/Oyc7TMwDxxlkHETNcgP+vgOn4o2+2lkBMlBRYUCVD9QeBSf7HOPQD7FdTpcqauYUhjcxVTYmzM3dpflL9UhtBqUHs5ffDJf4phFUhZAY6iueeAeF0jdw30YOkN0l6pRV5YYlpTETaj3p1lUAq88tgL2WfFQgMnAc+UeOWMBjkzM31pMHwr9exT0nMvFG6PLA3ESZ6Qgo1UyIgcX8oYkDfvPh+fv18FG03PF5HTBI0mHfY2qHVjcJq0YmLogKDVMnM4DeN21iUxIeYPzucLXh1gDMwkCiI/VgJ0EgXZERWsjF/esLRL7rxBRCEnfipISfSDRl9TTQrcwnzP9vIVeQzg6bOI21tDQXZw88QsKnt8g1LbmTP9YV2sJKLMZTH9OG2iorYyd7wFB7bHkL9Z/uFgsezz97Cz/p2E/HfT9u504eA89wtWccJYLq9IpnX0qDePaDPoZRTN9y00= 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)(1800799024)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qJrSLMgUFF/R2UxsbU8/fnQxQ5TY1SsacuGBg66ta5sk0SzZF0TCNjGSkVz0NYtsEVNKTrffIa5WOCd9y1RpVT2n4Ge4iE4khDGIs8EnSe2pIc0u3p8IdpTkmmAGEGCi7RHKVnMPswGezdpk7dSIjhRHtgw1scVbVFnA8sDsbbSKKA/JgkUxsDLsAvJlckM+XANSHPRHV4C5fF50cIyMapoUQ4JYIMru60HyOhHyWyiweaAK+dpv1KLiTMxu5OYlNubdopMvK63KPk/Jf8kKNv08vPLRT3ODQGRz2dDQFAjNdiqR4yk6PqOW+6Ni0o8Dgj1+8eHpPb+BMYCxOFBW4SwgnyY0RqJ6rdEEJ8rGxhFr02MOm1KAUeu5tCC3qdELjLLXYfvOiydLUFsQTjYraQ1EqcaQBMfC0IOpyXofotToX5EW/GY5oV9m8WT7V4sJrhq941RJO506LRYGT1JFm9m/eM34q5HZkfWqXgxBxMWfqOam01B67Gi94GEQJY2q5+7YPFsif3fGRtcHeTxQneSxytPJoh07qgsUDU/37DBA1+tLY8tmXY/3RH1sEP9G7bdtgUcoY9CVsgg2fIq21tsoQZZ5y7Ivk7A7So8MvfoQmrTdrUHOBVyX6zAfN8BwYxJDEAAXfO6JOVZuX0l8ju21kDfGmxAc4GphxNh4xxhwFwjhtWSUAcDbKe3xBtqvCXcV2sM8AwfOavBiUcKCLUA14uLIIiOBuFjDmbwwEtjBfp5fCEK8KyqUMtSet0NoaltPlhN743ketn4vMILZMPRrHQ2w18Bh6zQo811sxB4Gybi4hUWRHXidtWDLvDW9LCSREN6Bp93UBsK5N8s/HwTIjds5VDH8bX5KB1NfE+Ug4RUF57AknZvx0y/NojrnzIf3fNqdJeBQJvGPMn+4Baze7ngFr4FWG+Mp9Gl6SxPyJl4QyTtTOjP9oVGaS+dUHP/RdSaydbu3bVMDSUtVokR9a9psbbvPRUegcKgvQC5onCFpPyGynhKVHZ6uCzwz1Og83sb2WixNqe0ZVyj8kKyz3ctVUh4cXYjLBt07nZ9dCA+Dr0InPa61BahAeQQo1c2KgeVM4IfmTe8It1NG8hBUJlxKH3HzKflvjUQpHhNNnp6KUJ/+GBvtrwtGmgnOHLuqW14etkA8J9WdOwZnRDgu+t1ylINbnmN9ebrhYlb6JEkOQbCio6FMs27hEegNgWxwapgBkPv88xgEiqh4OfLThTyIqyjjHPpy0e2EiH3Urlvk6rTGbR+9BKHXC+teKYzlwld7hmklesBA+636GW6jbqBBTGozGdnrhHK6BUTg5dWU6BLtD+ah/Sr/sU4740CRMYFh+cl73I/29FqavSoCnMKfiFR1Qk5wtq8PjrEQdl6MEJjgZgq7O61jknAE0Qfp3xV5wFcxj8FEXbNFr+gz6pPr2BfWlzre1A6sqcAOZunu9tQS0J596aKAaSkHaYv0uXv5LQWCLTnveomHJa5dLYZ7fwQYXPb3cDvbrIXOX9WWzjG6fgNoekqDPdEPhkzqzTSm+uYd4u43zyN/Cs7cYAKYlVY5va6Sye/dKIhNxsyu4LpA+9G6gAKEHpj2 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd5c38f3-501a-44d6-233b-08dce84a1e6b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:07:01.7082 (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: 6R1DmBfHXRJKJuYR5NTu3aJCEVZT9F++BXD4bF/J91mIzrr9WQHVo0N+K3h6GdjVqQZxkU2Lg6TRzTsqWEtm4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10154 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 --- 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/drivers/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" #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"); } + pinctrl_pm_select_default_state(dev); + err = 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) static const struct pci_device_id enetc_pci_mdio_id_table[] = { { 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); From patchwork Wed Oct 9 09:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828085 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010059.outbound.protection.outlook.com [52.101.69.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 1D0CC1925B3; Wed, 9 Oct 2024 10:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468433; cv=fail; b=uSMuQoKZCGm58Wfxq14pQBKFEIO+IsjD7xIewiWv4KtgVWzlZW9/qnhqYvrmWux88pOnLBiKFVWbcnZSZI3o4TcDOXnKyArpqMMv5TRGOnWz66Qu5846sOdtHEGDeit8lnvUeGCU1akl7oo1gpqQIPHSUMt0Wia4ieOW9eINjoo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468433; c=relaxed/simple; bh=HgdiGxu0YyPBHtGQm/HNdj44RjqX8TRi3UJ8UwrI3LY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NAIYUhm0z59/E2zvr3w/HHc6648RNdG1/QJAfYUXMBYArH8w/jQUobpNHggkfhZwKOQMpoExwIEuRV86h1QQB8YcywaSs3vjrGwyKOQKkJEJkJ2dvgAamJrzMWNZYIa/SpCoUrzC30wqbEeOOgkyPvjAMODeMtHZPX1q8HfjPVg= 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=IPFJrVEd; arc=fail smtp.client-ip=52.101.69.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="IPFJrVEd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=itWMPJ3f5isIJ6muBYsv+x2PMK/KKoaqpendTIRNdXVNlrW6IakUOVLOrh8ljhjXIXa6AZRPDxxFVbg3It9HPsgmdeheP64iJc8wyOZ2eAkU88u4pBdOf6l9/4KTUr+h4ErNqeSmi0tbTmHOnzTWyHUbvx+0vHqqI0wACnvb1HJE9TVX3ZFGNbNfDWSGVVt8I26N0Du/XDZ/iaZNGJu9bK4bbsrXAM+Je8NwHkQH0Nc9g0waiYFYTNHSMumKtLw8tAOdFOaF7lIB4Wvp6uG3NRQVJfeWZNP2lVqQnXG++SKqUftTjsoxgbUoVG+cMzd/qHnEUnrP8DrueB8SVojuvw== 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=/lMC+55lOI7/5/l9WvM/rktTuysWxbj9m15WnWyNdUM=; b=Xj16GTv314hCnPUCulRsWtwxu7wi7Ew7S1E7LNOUwOvkT6PrcPKDjjWpFHuuHvAR2Lvw3YO7fC+gytLTqGN5RleXqL4UpTKYzHbrKS9kxupNoBsMZlBmu/Vj+7faSHxAgepHYpzXPBsPC+Mml3o7M9GbjHIBVw6X7ftjGddkwn8haqHw4WiY5TbB44HazHkDIQ/M+GhxCZvs+KdEpKai9FU2PClPc+nXPqmY9GiU/00sxK2vooxJHBCsqr5BhqRd+NuHWL6VWsUnCnkmo0ziU4kGmfVDBZen5Dmv+JCKKjW2ubPi+hjmGRcEDDxodO41c4vPHikuCqgC6b1q7gN7zA== 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=/lMC+55lOI7/5/l9WvM/rktTuysWxbj9m15WnWyNdUM=; b=IPFJrVEdxJpI7KpJMvtCfbf5RDoshvmQuHK8Ik1NbN7lIVI0vq4s4fLHaJaFKniAOR0wFJp/deToLWSic2p4MB2NjOa0S18xx4SqtQlKKNXqfDR0yanF3QT/xP5EBTDxlnMAF5JWeEGmCWG4Mc7WA4jFa9ZFkNUwObyo6vMSi8PHB7UnClXwUTbFPwe4lCBTQr6cUkGB0AcuLPamSzb2u84QKXwzBJ1I/6iDtXAjaTVwX650TgMV6YD3z8nKKl9gNox6Qe9CZWBteVoKiTu/liIeJl/ZzU2w8rDkXArAiZFzA7XVBFxnnTH8MeRF5rRbpG8NQfGfUM1Qrpba0L+stQ== 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 GV1PR04MB10154.eurprd04.prod.outlook.com (2603:10a6:150:1ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 10:07: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; Wed, 9 Oct 2024 10:07: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 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 net-next 09/11] net: enetc: optimize the allocation of tx_bdr Date: Wed, 9 Oct 2024 17:51:14 +0800 Message-Id: <20241009095116.147412-10-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GV1PR04MB10154:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fdf895e-832a-45ff-53be-08dce84a218b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: +B8Y+QJxMW1I7kJ7WUpac0ir6hPm4YAtRnlbUOZKfD1bkjKMTtnYJtc/+/26vHTDpFGlwmLbKKvfQhYqRq70JYDDcm7rWvQexcqFP3B5KN1F/Uu8fAefP5GpSXuZIGQN3vqmoKU04VL0yTWFFKZz8PqJ61TyNrQFnMcObA2fdoZWVYDu0FIGb9DNeGMeCdAxJuMkGecBOmg28/W9Fxg37v6Sz6AVVr1Y7FpTB9BBHIaQzzUdIjUqeWV09nY84Qv9bW+h4JPkNw8k2k3fDySTgXKu5KnkabZOYI/W8pTSONvVz1/lSPKAyTQElluft+OSMVZM8OfgetZnK+zt33B29FIUh6Qe2HL8ZqFVeFI5Ij1kHOj0zfb216WsCBj30ltAN/A6h/YPJML35CztOYfSDnQNR9ws/wqGwm06T9rp2JN6Ftrci3St7xXsFJu9JiPJ6gndSxzHb8QyJmTMz42fZ6UORInIYHJPFSYrc7ybkI2p6X5vWYeI1QKUou6ZTUU0w7EY6de6datUyWX/6KSt1hDoG9jIo9Smrz6BWf3bVNqe4kPtL8zj3T9fZGAGaInnfZ8jYyuaICKUHbNz+N0PJoSNNIhUF5uNPbGLnxNAmpy3mGaSOaDE6EGnhnOpP8vbyRGEKPuxIUqYM4ew9KxzmxvSX4B8D9sSNbciy74oLaXl8X5htaH3wXDUdOsBXDS+DhMqMS6/og6uDuW4fzIk5b7RZjLvcqOJHSWnUOw0X17VGx6NBh1ISjf2HUhwonTTAXZe9rYbILKD3FuGfYCt45vANDOLDgC2aJ7rlO4EAjbL2IIfLkanlhrBHAgwI2A4WQ/fdxUhpUSH7L6XVQmmastwhNEFi3C2rB4Doz8/QBlbRIjC7edAQUYXoSbSyW01qYjtNkozovUS4KsTPKQ02VL2aZGWOBkK+KoDXTnKXwQyfKZI9/80lihk+hN0r7BO9z52sdLdU26JEyYmnpRfJ9LKnIY39QPE5WTPIkhZoC9nXSHxHQ8s48mhAnEVnqW8ab6fSJxYTJp9V5Wbw3TZxg7HB462em7TVpVPgBkOj8ZOmZCk1mZPSZNF9uTdemaEroQzsFBisE46aYhnDqsQ4dlTgcooXUSwq5F5ha/SgShYDMM2uRdZYKgBneJfT+Kt8sjQks//XvwTWUTzFCckFEe2pm7IpuspiUgooGbqbQVSRxsF8Z5MiDXYIeyC/A/b0f0zYt5P7MAEaKNXBFfrtjl5/95KrTDz26guh1Zw0aI7NjvYJdkC2mNivCFLWazLIKAMM4DZ5ojEp3zJ5IpkFrDDfOIeug3J1aQuWTx1HhKkd4BL8vHz0g3/pdYgWe3uAk7SVsoDTfW67MJQFJQK5/zfyNS0SkEVi0pf04F1yaE= 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)(1800799024)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E55gQ+aEe7LdK/JGckQpoH8Kg7palifI0F6MVVYq3t6z+O5wSZn/JY3ik53xJxdMl/neAFsiWqh26zcQw3ErkYN7jV3wAzPv3cbOrRKjYR7vYsJOM5luRDVjrbhoYubu/Syh9tyZBsgKQ2AlkoxliHMUre2W9KjRjMRbJEcEFzDWZ90su5GUAwClO3zOOlBqXZMovLXQWqptzh4EmgFyAclHSZjU31BY/1h9/GTkLyeRkSpf5+fI3MJ5S7gXPKw5b4Q0tGqjTJ8LOElAw/v09BSOvQuCl0qBCSPWvq21YcW+7vKK/PlvZBBm9sUEX3SzjSAAKnr5a+S5RrK+U5vQ2VfP8zOp5tRjPftAC5oig6LDWcfN21Xi2mgvMNJeYFTN5YWzUydFPB4vv08Yg7ZidJZPSH2dmktv+W9hRf/MfyTM/fzPrT/genpLjYx+RlZUKXK4j11hbTOfIjXL5661Mbm0G343vjBrqCvk5pyq7dgGEbZ022KZhfomlnW332MKCrg02THUoICsBJMN5w4qeQTYtQ2N6rKaEsl4oPpWTHqqUM1m/j9GV5zlPQXpJS3ZL1bPcVG74T1odKDI2PRwmhyLy9nj2AYuOmB1yxQsUu0FKfGYTAYxtXwL2UHBCTFbG843ONika3Scg5Ajbc0mlSPaSEbc1bxhlQ+C6HLMILO1Ciih5fwGeRy/YioMcgI5e2iRslt4dKdcdEdfOMLbkCFBcqN0vSe3aE+j8xb1ywnGjSubZypdWR78+Yixe/bNPyjqOU+K0iiG//Y3OxNg8Ap66Wfu+P3ba4p9+1qXxYIfNN/2jbrSsGTW0SqP8c7Oecz+soeVmzTsagBBlqZAjN7IBXXWFAvzUl4DbbQH4klZqkqnZpt78tnSBryZP3ds/6jIMzk17vD+z7JUFRV2vPNMLF57nCjLhdg7yRcFtAyCXZRAzEsZhxDDfWz/bUz2UcHkQeUH8jf2BJtDGP8HuTDPP8e8DLxmk/BS8XArN99fFT3Ppf9huAe1QJo47JlZASV2gK7VFVD9krEzUIRtgelDVSj7dIBgoLwtwCfyQMgNumsZVqm1fe/5GO2jRed6SZ3TmvYevWhnF3InCS4mKvgDMfy9qNHBjNSsa+0rmlg8r+Ilt66CVdU1PTmcxtiG/FqTrtAr1ZXkaP5T/CJsWA8PYXtuGsFYxxtDMqXd/E3ODcZkcrbLiUkyV0KP5gsuN9ekjD0HG16gUt9M0JU+roEkDsmds0SNsW0rvKZjh2Uz0bqnjycXOedPILS+O5ivcwqEna9cZ89yShEST1PYcv+UkNA/73Pwc/7Cv5e/Jgm6GTFNVV2wFpJBfAaIUdqmCu8JMTVQfg64p2jhHRc65rcwnjrPBFwC+/r9DSlk3KUCGyzx6GoUU3e1ef5uSwm8TwzCSA1glvqB2TMuxIxO5nKRlNn78Bm39TJ3TRsoeIlmiRyVlESB656KxtTmFpq3eIkMtzr8NOPEXngszrrbqPShCM0tLardYATNUA7XY+ZotkltY7GfK9Wdj9a8iY0lGbb/BiK0S1gxe+m9AqThKSUJri4WhzS9V00jX5wAkIg7n+SA9mIrzY3P1uyefW03 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fdf895e-832a-45ff-53be-08dce84a218b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:07:06.9752 (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: SM9jar9RHu381CyZO0q5+uweXZejFSSkJHNnW+VYxrKXzAobpez/QkgMLV7FxOk3n9LDjJQV5ErCnocuiQqPmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10154 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 BD ring 6 or 7, wild pointers will be accessed. Of course, this issue does not exist for LS1028A, because its num_tx_rings is 8, and bdr_int_num is either 1 or 2. So there is no situation where it cannot be divided. However, there is a risk for the upcoming i.MX95, so the allocation of tx_bdr is optimized 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: Claudiu Manoil --- drivers/net/ethernet/freescale/enetc/enetc.c | 121 ++++++++++--------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index 032d8eadd003..b84c88a76762 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc.c +++ b/drivers/net/ethernet/freescale/enetc/enetc.c @@ -2965,13 +2965,70 @@ int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) } EXPORT_SYMBOL_GPL(enetc_ioctl); +static int enetc_bdr_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 = kzalloc(struct_size(v, tx_ring, v_tx_rings), GFP_KERNEL); + if (!v) + return -ENOMEM; + + bdr = &v->rx_ring; + bdr->index = i; + bdr->ndev = priv->ndev; + bdr->dev = priv->dev; + bdr->bd_count = priv->rx_bd_count; + bdr->buffer_offset = ENETC_RXB_PAD; + priv->rx_ring[i] = bdr; + + err = xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0); + if (err) + return err; + + err = 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 = 0x1; + v->rx_dim_en = true; + } + INIT_WORK(&v->rx_dim.work, enetc_rx_dim_work); + netif_napi_add(priv->ndev, &v->napi, enetc_poll); + v->count_tx_rings = v_tx_rings; + + for (j = 0; j < v_tx_rings; j++) { + int idx; + + /* default tx ring mapping policy */ + idx = priv->bdr_int_num * j + i; + __set_bit(idx, &v->tx_rings_map); + bdr = &v->tx_ring[j]; + bdr->index = idx; + bdr->ndev = priv->ndev; + bdr->dev = priv->dev; + bdr->bd_count = priv->tx_bd_count; + priv->tx_ring[idx] = bdr; + } + + priv->int_vector[i] = no_free_ptr(v); + + return 0; +} + int enetc_alloc_msix(struct enetc_ndev_priv *priv) { struct pci_dev *pdev = 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; nvec = ENETC_BDR_INT_BASE_IDX + priv->bdr_int_num; /* allocate MSIX for both messaging and Rx/Tx interrupts */ @@ -2985,65 +3042,11 @@ int enetc_alloc_msix(struct enetc_ndev_priv *priv) /* # of tx rings per int vector */ v_tx_rings = priv->num_tx_rings / priv->bdr_int_num; + v_remainder = priv->num_tx_rings % priv->bdr_int_num; - for (i = 0; i < priv->bdr_int_num; i++) { - struct enetc_int_vector *v; - struct enetc_bdr *bdr; - int j; - - v = kzalloc(struct_size(v, tx_ring, v_tx_rings), GFP_KERNEL); - if (!v) { - err = -ENOMEM; - goto fail; - } - - priv->int_vector[i] = v; - - bdr = &v->rx_ring; - bdr->index = i; - bdr->ndev = priv->ndev; - bdr->dev = priv->dev; - bdr->bd_count = priv->rx_bd_count; - bdr->buffer_offset = ENETC_RXB_PAD; - priv->rx_ring[i] = bdr; - - err = xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0); - if (err) { - kfree(v); - goto fail; - } - - err = 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 = 0x1; - v->rx_dim_en = true; - } - INIT_WORK(&v->rx_dim.work, enetc_rx_dim_work); - netif_napi_add(priv->ndev, &v->napi, enetc_poll); - v->count_tx_rings = v_tx_rings; - - for (j = 0; j < v_tx_rings; j++) { - int idx; - - /* default tx ring mapping policy */ - idx = priv->bdr_int_num * j + i; - __set_bit(idx, &v->tx_rings_map); - bdr = &v->tx_ring[j]; - bdr->index = idx; - bdr->ndev = priv->ndev; - bdr->dev = priv->dev; - bdr->bd_count = priv->tx_bd_count; - priv->tx_ring[idx] = bdr; - } - } + for (i = 0; i < priv->bdr_int_num; i++) + enetc_bdr_init(priv, i, + i < v_remainder ? v_tx_rings + 1 : v_tx_rings); num_stack_tx_queues = enetc_num_stack_tx_queues(priv); From patchwork Wed Oct 9 09:51:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828086 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010041.outbound.protection.outlook.com [52.101.69.41]) (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 1DB1E192D93; Wed, 9 Oct 2024 10:07:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468439; cv=fail; b=gFyr/3VIPmJsJkQLfikxEMWAWbBjGG352xfrdnHdOpaOnA3TnmTQJ3y7SG5g1tiPwtLIqnDRCwDWshMLW14dphIH2X+CXFjDtgLp/ni1VmKoiM2TzSJ46szy0ANYrKcWEEgz972JGlvKRNHwEcHYVRXijJOpOph1/oO7VnHV9wQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468439; c=relaxed/simple; bh=VOJ5ncUdOON206MAiCkRd9FDbRHU9GkXHWFnu0UHgHk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=J+fUPmpcf8KNz/PoTj0EooCiM36OX02EMJh257pp4JwbJqVmhxVKmogFCbCdGHb1H9VDC6BFuPBpE0Rc2oAp2munRJ7FtbgLPg9hXY3AAej+2FeUKNL2R+ZagMOD59oVnyGIZoWLtBgdpkjzz7izmex+T9JvBWJID0FQbiiirwA= 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=akdEawUm; arc=fail smtp.client-ip=52.101.69.41 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="akdEawUm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Dd8Yvyh1oyrOoYwSMxTbkdzseMGE0HmnK6XvqQLyu/DmAN3fFRlTuZKiHfAwGWaIpfbAzYJwhXqDYg399GR+UnBX9SfbQrdqWq2X5+fqPcgncWBcCHpcH5qPvl9bCtIotXMZjcOB4xh2S18uuY5nIkZvUx+7wQD9phnNl0Xh03hr8iWZCix+ityp22YqUMtt3wD3Ch2GkIYmrp2z71GlCr5rz/PeTo7Bi75z8ziAKsn/W9cK/NJgc6XpgcFi13mvrEZUBTg5mq5K8KcSVoKFX/ec6cxWUmOV9e8YHQorXYCcGUHvT+pbYBpagLjJOZdYgeemSUEONcaZnEMI4HMQog== 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=//Q4IQ+IU22wwZOQjpjt8FzH/mX8d1PmtbapHlUGSsI=; b=XK3T0GMnIPFiwA0J4lUmwpk58Tn/PF9p9VZWFVwEHaTBf6YKO0JxrDXtiPyGm5cdcD+V+F3tR0awPhNnDUO8QaUFrmd50Ek4v5ZdIaRpA2VWG6Bjg9wBWk889g6ahh05GkH2Dt+l7vfGj2EBpiW7dwjfLQBRtun2l9n7yvGFZ3MBIXYaSLxRe1REdIH8ikOtuXY/64gyXcKS/Ru7mE0JzYU2RLrT9RLyau/QjHUQye8Pvp594DkFvLY5zaqq87/E/4p0L9J8wmX+FjRVbdFE8JGhX1th3rAbxks6ExE5h4kZwANRLGqHqPqUraxzXdDW19dm7gKUKzJyeNUTmGnGfQ== 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=//Q4IQ+IU22wwZOQjpjt8FzH/mX8d1PmtbapHlUGSsI=; b=akdEawUmpILNnl2NXqkKLrzR2VBcKmio3YxHMJ28eKvtOGM2OWPKPJWBCSctu2vMEvn3rpfeeD5EjcJA1VWnHjqjM/3acVB7NHCr9UL0WUEUfh20Q1MDshLmqOaggnwkamIuZx3U1+972QUOFmbTO/ubJ/Gn/IbzO6/BhClP/Ca4KntX6FvtLvg+bDAomFAmt2cKtm/a5c/cHw8A24RSVE5MzYwgoW6znmzwg+UAq2T5NOZnN7K1gPzpAMb2DyxYmpomiyOB3Wfz/BhHy3fz9cBdXvlNKFpD2FtAI0DofmWmtW3HXsLWV29JIf56XvE6a7ENUqJ5RZ1LZufz6gkHsA== 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 GV1PR04MB10154.eurprd04.prod.outlook.com (2603:10a6:150:1ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 10:07: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; Wed, 9 Oct 2024 10:07: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 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 net-next 10/11] net: enetc: add preliminary support for i.MX95 ENETC PF Date: Wed, 9 Oct 2024 17:51:15 +0800 Message-Id: <20241009095116.147412-11-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GV1PR04MB10154:EE_ X-MS-Office365-Filtering-Correlation-Id: 37de2a01-d14f-4a09-0435-08dce84a24ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: DbHEuXmR/S/KrlR05j0dplW21p5uDr2Kt9DBjuvfUzoJ5MGDcc+X2wVAhG7RWpxMchwsYTY5K6VD+0818QWlfDS2BWvfmpThyPFatC9oFvjlelgPR7ShwoFLNgDkSMNOGw85tkuY9HUT8Hqm26H13LnvbAAVf8IYLPgYWQn9SoK3lycigZUrmq3TCZGextzi4uoLC36DlEHRWuPwHJSczo7QNBRICDzr1d1zVqMysJvimkgUi5xqtL3Fdb7G76Whz+2TBqglb66cK1hp0WhHb4jdG/PaEWxm/Ou3g9xD+KktoDlYeptxLg0UwnCa1ElFBOGFw6UuYpuf+QDXffd+U1H4LCiAZZuVTkYGtbf22Wgctny72tmEVaXkwjIZb4alnSuSf98+iQAflr0ihs+UMahvnVGS2G1AcGCLsgjXcDyxRKDuBD8Vloov61RYqMYbaL2L0Mec6Kej1D+b3YrvMRpvpJic0XynBg4N0K4Z+8SFNEPVngdgZuhpsOc1+Ix1Fb3LQr+a37nvtPGYgkMsJYYdsrVkR0TAP2X9xIEUA6LqLC6vMXlQfHvP8U+0GK86wKY80hnu2Up2120R25w0r4MeRLzV8vjZsLEax40ZQsVoWvrL0pRA0Fhp8WLllwJMgXtaa4/83QjXjdRU+brn21QX9ed/epNak0O7wVbIk2kYX2sNlAqY7SCJqWuIlfTjov9j371DwL+eIojIlHf/ZRJW2eZuv5bthsJy4uwh4GVUgx+Of7VFP9v9uBDnSFur0JQAYH4Y+eoRBfzAUrwqRfuJ9gUxGTGhzPdlgUFdT8mcUY1ysRueWvRxwwJx7f+utglmKPsKlrnRhQH4lUzONYws0y+5SHYblK4i5NRbIyWh6rNTzkgbtXWK25gNU/KwcI1pm+sbVVTk8wrKHHJVv2gJYfLm60ZscYMYgLzQamRIcf5SNk3nI8iVzM7cLft7cCT/0MMt+S4BOeBgt0f6BbP2Rfqdk3vzYBZhHrn5lPKLAAkzQ3p0KBBe0Jz3jF2xxRAyhdlCnEWL4GfdY6uLI4aTbXwNjFusVOXIhZnNkoI8w5lZEDRcD9T/q/3Bs2/gdmnSmYAMF8RwiC5N4EkEMYLKRz52KddBViwNhmNR2IGY6v1Oy3NGZz2kbuLiQ9YnB5+uLniNu/EXoIcKw84uc/jJUgKqwr2qduxcpc2L7I5zbfPh1XlvrRz/FY86yleQ6gMhD97upXitubmgoNG/rDpisXTFdv4d4sF/Jt2g7L3l8nSgLLW6NzoOXHaqooxEkmmhO4OhJ1duMrCw/WGFIa3oYjyOJobxE93ynJF3u5DLY1Kkm8e44GSPhBsQDtU4jLlToqMLddaFZQWKzHJE5IAuDc//L/6KrlrZj27Dev4= 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)(1800799024)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dYcjXd/NsK7bsSZ/f89UQwxYGytDTYy4pEFF2i0r3gD0SKWWgu49BwXeQpssMrUnMOhkxKtswaGUo2NX+XtMW6RF05kZlrNexGSPz6VsI0+sj6hC7SiS0OExfLEVdQSsQfxuLtSfl8Iy2pwxtgLtaeumQLvOxn9CnmtUbgmyePOmYZCw/XuZ97GdyJFvyY1RasqNOVNkX9XLRSULsF8FQX9j11b3KdLt+ASM4EdzdZPTGjxmT/xYVc7JD/L8viwkzeDpg3l4rZlU4f4HOtA3bU3os2pA24dE6gih9Wh9R/8v1kPb+LVSVN15rv0QQqTKOdys811Y999HN2UKiFZhSfLek5UDREUEhdYil/fI+iA5Od6+Yu8SsE21rQLiwYnJgMN4vap3IVNjz+tSplFEPExWcQeYyfC+fYGv/ot2fjgZd8QFnTzSvqJADn9QgRB4ymCZuY9JfckX5YW4Vpoa6YLYCEfpH89NdOjsrNIjp6giMPhzey4XbDVLMTpcY3XiSSzkYq72c7THQSaDo8y+X9kaQDXWJBV7spy1qHsGtVqj3r6irtu/KdX0N57p6wEBFcUv6iwX8++yUtpDnkTvYXlveWgUZRaFYS3dh1dxpoG7feVu4IcrW2ZnQG6LwxSgwQtcAcerCjCcirqPhZTHnJ4nfLuGNG2ab0lo3ayFYgKwL/WBLg1Y69V3S6MoFXNA/Q8A1yR2MLLPqqKPxrNrY8p74kU3LmZ8wpMfYfz42xKwUHUrGw8mgIQ+xbiW00XPiGtbAX8gg3363vgzaDgvRzOtG3EuZpC4OTxrDS7Jrs6R2RfixZqmmncnLTWu7lCD33QtO9XmFMS2QS55gRk/q4BW9NeusTFLM4EnV6WS/7HahfjBvsgReoFX8ufj0fIAkJpkqUyFq67In6r7S0NRYntX4HuNtgfuqkmN30ZPyTb4wDOy3tZfhi8rqgdT/fjSdBcChwLMudt+/U+8EZbIFH+EueL001v1drDaraemBgDkzXTxyV/wBN1xdOZEQf5OXFdpH55enhIsJTGWyUW7OBPzJoxOrWv1j+cLyV8r5fU394IGTfae/Iio2260ycitN+6XJ/QFm5uL0HbnaQXPEbMogoglCczH5jjrzH2MGb/lIQzKfFXSHsYxHl5x+VnFLmBlA8Af0BXUgEdKBYCF3Cp7ZAVM5kWV+AmpyAX4dNOws/KN9yWKSXqmqI/v1lnpKBrVpt0TG1ZSxw8u7SiDRGBiYDo2o88tEdIBf3arcvC1+8ugcNUCj3Fb0yVM99RJlGP56h5YDuuZdiX3kI7EGqVn7wzE3VMj0RU2OgQDTwDdTorzkeYVkZBkL3Gnv82Hb46Utsz7Xj08KHYofq0PrkW7o/d8vUjaetCQ/LxeLN8soO8UkskIDGEI30Bh9FQBuAsQlfwdEHKqaNnF5V0z1DJ3rhITo3ytSBjVFV8PyzoK06Tv2FfZvzVRqHheYt6LEuCRMIY2XThXoz4Qz+wbFWZBCrSp82LHbe/tVjeKFvp8wQb24/XSWLs5WVvJBHSMy/6Gs6rBGCJCpADk9iDRQ48VRH22nmoEBN/U0qswh0F7nJtZ6SIi1SqI9kXaQD0+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37de2a01-d14f-4a09-0435-08dce84a24ad X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:07:12.4384 (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: Mpc+0YPPsq2rqW3Dr0N2Zu+EGXxf2QfGSqv6wbbAMqge0vl9xVBaisUT01ZjxZa4fhinvnD69WCp3+fVod89jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10154 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 we developed the nxp-enetc4 driver for i.MX95 ENETC PF, and this driver will be used to support the ENETC PF with major revision 4 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 --- 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 | 761 ++++++++++++++++++ .../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, 1080 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/ethernet/freescale/enetc/Kconfig index 6f3306f14060..357c42efc4fb 100644 --- a/drivers/net/ethernet/freescale/enetc/Kconfig +++ b/drivers/net/ethernet/freescale/enetc/Kconfig @@ -33,6 +33,23 @@ config FSL_ENETC If compiled as module (M), the module name is fsl-enetc. +config NXP_ENETC4 + tristate "ENETC4 PF driver" + depends on PCI_MSI + select MDIO_DEVRES + select NXP_ENETC_PF_COMMON + select FSL_ENETC_CORE + select FSL_ENETC_MDIO + 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/ethernet/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 := enetc_pf.o fsl-enetc-$(CONFIG_PCI_IOV) += enetc_msg.o fsl-enetc-$(CONFIG_FSL_ENETC_QOS) += enetc_qos.o +obj-$(CONFIG_NXP_ENETC4) += nxp-enetc4.o +nxp-enetc4-y := enetc4_pf.o + obj-$(CONFIG_FSL_ENETC_VF) += fsl-enetc-vf.o fsl-enetc-vf-y := enetc_vf.o diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c index b84c88a76762..4e672089e260 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 */ #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); @@ -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 = container_of(dim, struct enetc_int_vector, rx_dim); + struct enetc_ndev_priv *priv = netdev_priv(v->rx_ring.ndev); + u64 clk_freq = priv->si->clk_freq; - v->rx_ictt = enetc_usecs_to_cycles(moder.usec); + v->rx_ictt = enetc_usecs_to_cycles(moder.usec, clk_freq); dim->state = DIM_START_MEASURE; } @@ -1721,14 +1724,25 @@ void enetc_get_si_caps(struct enetc_si *si) struct enetc_hw *hw = &si->hw; u32 val; + if (is_enetc_rev1(si)) + si->clk_freq = ENETC_CLK; + else + si->clk_freq = ENETC_CLK_333M; + /* find out how many of various resources we have to work with */ val = enetc_rd(hw, ENETC_SICAPR0); si->num_rx_rings = (val >> 16) & 0xff; si->num_tx_rings = val & 0xff; - val = enetc_rd(hw, ENETC_SIRFSCAPR); - si->num_fs_entries = ENETC_SIRFSCAPR_GET_NUM_RFS(val); - si->num_fs_entries = min(si->num_fs_entries, ENETC_MAX_RFS_SIZE); + val = enetc_rd(hw, ENETC_SIPCAPR0); + if (val & ENETC_SIPCAPR0_RFS) { + val = enetc_rd(hw, ENETC_SIRFSCAPR); + si->num_fs_entries = ENETC_SIRFSCAPR_GET_NUM_RFS(val); + si->num_fs_entries = min(si->num_fs_entries, ENETC_MAX_RFS_SIZE); + } else { + /* ENETC which not supports RFS */ + si->num_fs_entries = 0; + } si->num_rss = 0; val = 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 |= ENETC_SI_F_QBV; - if (val & ENETC_SIPCAPR0_QBU) + if (val & ENETC_SIPCAPR0_QBU) { si->hw_features |= ENETC_SI_F_QBU; + si->pmac_offset = is_enetc_rev1(si) ? ENETC_PMAC_OFFSET : + ENETC4_PMAC_OFFSET; + } if (val & ENETC_SIPCAPR0_PSFP) si->hw_features |= 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); - if (si->num_rss) { + if (si->num_rss && is_enetc_rev1(si)) { err = 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_priv *priv) */ priv->num_rx_rings = min_t(int, cpus, si->num_rx_rings); priv->num_tx_rings = si->num_tx_rings; - priv->bdr_int_num = cpus; + if (is_enetc_rev1(si)) { + priv->bdr_int_num = cpus; + priv->tx_ictt = enetc_usecs_to_cycles(600, ENETC_CLK); + } else { + priv->bdr_int_num = priv->num_rx_rings; + priv->tx_ictt = enetc_usecs_to_cycles(500, ENETC_CLK_333M); + } + priv->ic_mode = ENETC_IC_RX_ADAPTIVE | ENETC_IC_TX_MANUAL; - priv->tx_ictt = ENETC_TXIC_TIMETHR; } EXPORT_SYMBOL_GPL(enetc_init_si_rings_params); @@ -2475,10 +2498,14 @@ int enetc_open(struct net_device *ndev) extended = !!(priv->active_offloads & ENETC_F_RX_TSTAMP); - err = enetc_setup_irqs(priv); + err = clk_prepare_enable(priv->ref_clk); if (err) return err; + err = enetc_setup_irqs(priv); + if (err) + goto err_setup_irqs; + err = 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); return err; } @@ -2559,6 +2588,7 @@ int enetc_close(struct net_device *ndev) enetc_assign_tx_resources(priv, NULL); enetc_free_irqs(priv); + clk_disable_unprepare(priv->ref_clk); return 0; } diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/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 #include "enetc_hw.h" +#include "enetc4_hw.h" #define ENETC_MAC_MAXFRM_SIZE 9600 #define ENETC_MAX_MTU (ENETC_MAC_MAXFRM_SIZE - \ @@ -222,6 +223,7 @@ struct enetc_msg_swbd { }; #define ENETC_REV1 0x1 +#define ENETC_REV4 0x4 enum enetc_errata { ENETC_ERR_VLAN_ISOL = BIT(0), ENETC_ERR_UCMCSWP = 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; }; #define ENETC_SI_ALIGN 32 +static inline bool is_enetc_rev1(struct enetc_si *si) +{ + return si->pdev->revision == ENETC_REV1; +} + +static inline bool is_enetc_rev4(struct enetc_si *si) +{ + return si->pdev->revision == 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; }; -#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 { #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) 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 */ }; /* 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 = 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..e38ade76260b --- /dev/null +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c @@ -0,0 +1,761 @@ +// 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 = &pf->si->hw; + u32 val; + + val = enetc_port_rd(hw, ENETC4_ECAPR1); + pf->caps.num_vsi = (val & ECAPR1_NUM_VSI) >> 24; + pf->caps.num_msix = ((val & ECAPR1_NUM_MSIX) >> 12) + 1; + + val = enetc_port_rd(hw, ENETC4_ECAPR2); + pf->caps.num_rx_bdr = (val & ECAPR2_NUM_RX_BDR) >> 16; + pf->caps.num_tx_bdr = val & ECAPR2_NUM_TX_BDR; + + val = enetc_port_rd(hw, ENETC4_PMCAPR); + pf->caps.half_duplex = (val & PMCAPR_HD) ? 1 : 0; +} + +static void enetc4_pf_set_si_primary_mac(struct enetc_hw *hw, int si, + const u8 *addr) +{ + u16 lower = get_unaligned_le16(addr + 4); + u32 upper = get_unaligned_le32(addr); + + if (si != 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 = __raw_readl(hw->port + ENETC4_PSIPMAR0(si)); + lower = __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 = { + .set_si_primary_mac = enetc4_pf_set_si_primary_mac, + .get_si_primary_mac = enetc4_pf_get_si_primary_mac, +}; + +static int enetc4_pf_struct_init(struct enetc_si *si) +{ + struct enetc_pf *pf = enetc_si_priv(si); + + pf->si = si; + pf->total_vfs = 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 num_rx_bdr) +{ + u32 val; + + val = ENETC_PSICFGR0_SET_TXBDR(num_tx_bdr); + val |= ENETC_PSICFGR0_SET_RXBDR(num_rx_bdr); + val |= ENETC_PSICFGR0_SIVC(ENETC_VLAN_TYPE_C | ENETC_VLAN_TYPE_S); + + if (is_vf) + val |= ENETC_PSICFGR0_VTE | ENETC_PSICFGR0_SIVIE; + + return val; +} + +static void enetc4_default_rings_allocation(struct enetc_pf *pf) +{ + struct enetc_hw *hw = &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 = pf->caps.num_rx_bdr - pf->caps.num_vsi; + else + num_rx_bdr = ENETC_SI_MAX_RING_NUM; + + if (pf->caps.num_tx_bdr < ENETC_SI_MAX_RING_NUM + pf->caps.num_vsi) + num_tx_bdr = pf->caps.num_tx_bdr - pf->caps.num_vsi; + else + num_tx_bdr = ENETC_SI_MAX_RING_NUM; + + val = enetc4_psicfgr0_val_construct(false, num_tx_bdr, num_rx_bdr); + enetc_port_wr(hw, ENETC4_PSICFGR0(0), val); + + num_rx_bdr = pf->caps.num_rx_bdr - num_rx_bdr; + rx_rem = num_rx_bdr % pf->caps.num_vsi; + num_rx_bdr = num_rx_bdr / pf->caps.num_vsi; + + num_tx_bdr = pf->caps.num_tx_bdr - num_tx_bdr; + tx_rem = num_tx_bdr % pf->caps.num_vsi; + num_tx_bdr = num_tx_bdr / pf->caps.num_vsi; + + for (i = 0; i < pf->caps.num_vsi; i++) { + vf_tx_bdr = (i < tx_rem) ? num_tx_bdr + 1 : num_tx_bdr; + vf_rx_bdr = (i < rx_rem) ? num_rx_bdr + 1 : num_rx_bdr; + val = 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, bool en) +{ + u32 val = enetc_port_rd(hw, ENETC4_PSIPVMR); + + if (en) + val |= BIT(si); + else + val &= ~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 = &pf->si->hw; + int num_si = pf->caps.num_vsi + 1; + int i; + + /* enforce VLAN promisc mode for all SIs */ + for (i = 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 = &pf->si->hw; + int i, num_msix, total_si; + u32 val; + + total_si = pf->caps.num_vsi + 1; + + num_msix = pf->caps.num_msix / total_si + + pf->caps.num_msix % total_si - 1; + val = num_msix & 0x3f; + enetc_port_wr(hw, ENETC4_PSICFGR2(0), val); + + num_msix = pf->caps.num_msix / total_si - 1; + val = num_msix & 0x3f; + for (i = 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 = &pf->si->hw; + int num_si = pf->caps.num_vsi + 1; + u32 si_bitmap = 0; + int i; + + /* Master enable for all SIs */ + for (i = 0; i < num_si; i++) + si_bitmap |= 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 = &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 = ENETC_MAC_MAXFRM_SIZE; + int tc; + + val = u32_replace_bits(val, SDU_TYPE_MPDU, PTCTMSDUR_SDU_TYPE); + + for (tc = 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 = 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 = 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] = {0}; + struct enetc_hw *hw = &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 = &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 = &pf->si->pdev->dev; + int err; + + /* Initialize the MAC address for PF and VFs */ + err = 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 = { + .ndo_open = enetc_open, + .ndo_stop = enetc_close, + .ndo_start_xmit = enetc_xmit, + .ndo_get_stats = enetc_get_stats, + .ndo_set_mac_address = enetc_pf_set_mac_addr, +}; + +static struct phylink_pcs * +enetc4_pl_mac_select_pcs(struct phylink_config *config, phy_interface_t iface) +{ + struct enetc_pf *pf = 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 = netdev_priv(pf->si->ndev); + struct enetc_si *si = pf->si; + u32 val; + + val = enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val &= ~(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 |= 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 |= PM_IF_MODE_ENA; + break; + case PHY_INTERFACE_MODE_RMII: + val |= IFMODE_RMII; + break; + case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_2500BASEX: + val |= IFMODE_SGMII; + break; + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_XGMII: + case PHY_INTERFACE_MODE_USXGMII: + val |= 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 int mode, + const struct phylink_link_state *state) +{ + struct enetc_pf *pf = 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 = priv->speed; + u32 val; + + if (speed == old_speed) + return; + + val = enetc_port_rd(&priv->si->hw, ENETC4_PCR); + val &= ~PCR_PSPEED; + + switch (speed) { + case SPEED_100: + case SPEED_1000: + case SPEED_2500: + case SPEED_10000: + val |= (PCR_PSPEED & PCR_PSPEED_VAL(speed)); + break; + case SPEED_10: + default: + val |= (PCR_PSPEED & PCR_PSPEED_VAL(SPEED_10)); + } + + priv->speed = speed; + enetc_port_wr(&priv->si->hw, ENETC4_PCR, val); +} + +static void enetc4_set_rgmii_mac(struct enetc_pf *pf, int speed, int duplex) +{ + struct enetc_si *si = pf->si; + u32 old_val, val; + + old_val = enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val = old_val & ~(PM_IF_MODE_ENA | PM_IF_MODE_M10 | PM_IF_MODE_REVMII); + + switch (speed) { + case SPEED_1000: + val = u32_replace_bits(val, SSP_1G, PM_IF_MODE_SSP); + break; + case SPEED_100: + val = u32_replace_bits(val, SSP_100M, PM_IF_MODE_SSP); + break; + case SPEED_10: + val = u32_replace_bits(val, SSP_10M, PM_IF_MODE_SSP); + } + + val = u32_replace_bits(val, duplex == DUPLEX_FULL ? 0 : 1, + PM_IF_MODE_HD); + + if (val == 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 = pf->si; + u32 old_val, val; + + old_val = enetc_port_mac_rd(si, ENETC4_PM_IF_MODE(0)); + val = old_val & ~(PM_IF_MODE_ENA | PM_IF_MODE_SSP); + + switch (speed) { + case SPEED_100: + val &= ~PM_IF_MODE_M10; + break; + case SPEED_10: + val |= PM_IF_MODE_M10; + } + + val = u32_replace_bits(val, duplex == DUPLEX_FULL ? 0 : 1, + PM_IF_MODE_HD); + + if (val == 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 = pf->si; + u32 old_val, val; + + if (!pf->caps.half_duplex) + return; + + old_val = enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val = u32_replace_bits(old_val, enable ? 1 : 0, PM_CMD_CFG_HD_FCEN); + if (val == 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 = pf->si; + u32 old_val, val; + + old_val = enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val = u32_replace_bits(old_val, rx_pause ? 0 : 1, PM_CMD_CFG_PAUSE_IGN); + if (val == 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 tx_pause) +{ + u32 pause_off_thresh = 0, pause_on_thresh = 0; + u32 init_quanta = 0, refresh_quanta = 0; + struct enetc_hw *hw = &pf->si->hw; + u32 rbmr, old_rbmr; + int i; + + for (i = 0; i < num_rxbdr; i++) { + old_rbmr = enetc_rxbdr_rd(hw, i, ENETC_RBMR); + rbmr = u32_replace_bits(old_rbmr, tx_pause ? 1 : 0, ENETC_RBMR_CM); + if (rbmr == 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 = 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 = 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 = 3 * ENETC_MAC_MAXFRM_SIZE; + pause_off_thresh = 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 = pf->si; + u32 val; + + val = enetc_port_mac_rd(si, ENETC4_PM_CMD_CFG(0)); + val &= ~(PM_CMD_CFG_TX_EN | PM_CMD_CFG_RX_EN); + val |= 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 = phylink_to_enetc_pf(config); + struct enetc_si *si = pf->si; + struct enetc_ndev_priv *priv; + bool hd_fc = false; + + priv = 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 == PHY_INTERFACE_MODE_RMII) + enetc4_set_rmii_mac(pf, speed, duplex); + + if (duplex == 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 = false; + } else { /* DUPLEX_HALF */ + if (tx_pause || rx_pause) + hd_fc = true; + + /* As per 802.3 annex 31B, PAUSE frames are only supported + * when the link is configured for full duplex operation. + */ + tx_pause = false; + rx_pause = 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 = phylink_to_enetc_pf(config); + + enetc4_enable_mac(pf, false); +} + +static const struct phylink_mac_ops enetc_pl_mac_ops = { + .mac_select_pcs = enetc4_pl_mac_select_pcs, + .mac_config = enetc4_pl_mac_config, + .mac_link_up = enetc4_pl_mac_link_up, + .mac_link_down = enetc4_pl_mac_link_down, +}; + +static int enetc4_link_init(struct enetc_ndev_priv *priv, + struct device_node *node) +{ + struct enetc_pf *pf = enetc_si_priv(priv->si); + struct device *dev = priv->dev; + int err; + + err = of_get_phy_mode(node, &pf->if_mode); + if (err) { + dev_err(dev, "Failed to get PHY mode\n"); + return err; + } + + err = enetc_mdiobus_create(pf, node); + if (err) { + dev_err(dev, "Failed to create MDIO bus\n"); + return err; + } + + err = 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 = 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 = &si->pdev->dev; + struct enetc_ndev_priv *priv; + struct net_device *ndev; + int err; + + ndev = alloc_etherdev_mqs(sizeof(struct enetc_ndev_priv), + si->num_tx_rings, si->num_rx_rings); + if (!ndev) + return -ENOMEM; + + priv = netdev_priv(ndev); + priv->ref_clk = devm_clk_get_optional(dev, "enet_ref_clk"); + if (IS_ERR(priv->ref_clk)) { + dev_err(dev, "Get enet_ref_clk failed\n"); + err = 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 = enetc_configure_si(priv); + if (err) { + dev_err(dev, "Failed to configure SI\n"); + goto err_config_si; + } + + err = enetc_alloc_msix(priv); + if (err) { + dev_err(dev, "Failed to alloc MSI-X\n"); + goto err_alloc_msix; + } + + err = enetc4_link_init(priv, dev->of_node); + if (err) + goto err_link_init; + + err = 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 = si->ndev; + struct enetc_ndev_priv *priv; + + priv = 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 = &pdev->dev; + struct enetc_si *si; + struct enetc_pf *pf; + int err; + + err = enetc_pci_probe(pdev, KBUILD_MODNAME, sizeof(*pf)); + if (err) { + dev_err(dev, "PCIe probing failed\n"); + return err; + } + + /* si is the private data. */ + si = pci_get_drvdata(pdev); + if (!si->hw.port || !si->hw.global) { + err = -ENODEV; + dev_err(dev, "Couldn't map PF only space!\n"); + goto err_enetc_pci_probe; + } + + err = enetc4_pf_struct_init(si); + if (err) + goto err_pf_struct_init; + + pf = enetc_si_priv(si); + err = enetc4_pf_init(pf); + if (err) + goto err_pf_init; + + pinctrl_pm_select_default_state(dev); + enetc_get_si_caps(si); + err = 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; + struct enetc_pf *pf; + + si = pci_get_drvdata(pdev); + pf = enetc_si_priv(si); + + enetc4_pf_netdev_destroy(si); + enetc_pci_remove(pdev); +} + +static const struct pci_device_id enetc4_pf_id_table[] = { + { 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 = { + .name = KBUILD_MODNAME, + .id_table = enetc4_pf_id_table, + .probe = enetc4_pf_probe, + .remove = 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 = &priv->si->hw; int len; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + len = ARRAY_SIZE(enetc_si_regs); len += ARRAY_SIZE(enetc_txbdr_regs) * priv->num_tx_rings; len += ARRAY_SIZE(enetc_rxbdr_regs) * priv->num_rx_rings; @@ -68,6 +71,9 @@ static void enetc_get_regs(struct net_device *ndev, struct ethtool_regs *regs, int i, j; u32 addr; + if (is_enetc_rev4(priv->si)) + return; + for (i = 0; i < ARRAY_SIZE(enetc_si_regs); i++) { *buf++ = enetc_si_regs[i]; *buf++ = 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 = netdev_priv(ndev); int len; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + if (sset != ETH_SS_STATS) return -EOPNOTSUPP; @@ -250,6 +259,9 @@ static void enetc_get_strings(struct net_device *ndev, u32 stringset, u8 *data) u8 *p = data; int i, j; + if (is_enetc_rev4(priv->si)) + return; + switch (stringset) { case ETH_SS_STATS: for (i = 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 = &priv->si->hw; int i, o = 0; + if (is_enetc_rev4(priv->si)) + return; + for (i = 0; i < ARRAY_SIZE(enetc_si_counters); i++) data[o++] = enetc_rd64(hw, enetc_si_counters[i].reg); @@ -331,6 +346,9 @@ static void enetc_get_pause_stats(struct net_device *ndev, struct enetc_hw *hw = &priv->si->hw; struct enetc_si *si = priv->si; + 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 = &priv->si->hw; struct enetc_si *si = priv->si; + 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 = &priv->si->hw; struct enetc_si *si = priv->si; + 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 *ndev, struct enetc_hw *hw = &priv->si->hw; struct enetc_si *si = priv->si; + if (is_enetc_rev4(si)) + return; + *ranges = enetc_rmon_ranges; switch (rmon_stats->src) { @@ -593,6 +620,9 @@ static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc, struct enetc_ndev_priv *priv = netdev_priv(ndev); int i, j; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + switch (rxnfc->cmd) { case ETHTOOL_GRXRINGS: rxnfc->data = priv->num_rx_rings; @@ -643,6 +673,9 @@ static int enetc_set_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc) struct enetc_ndev_priv *priv = netdev_priv(ndev); int err; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + switch (rxnfc->cmd) { case ETHTOOL_SRXCLSRLINS: if (rxnfc->fs.location >= priv->si->num_fs_entries) @@ -678,6 +711,9 @@ static u32 enetc_get_rxfh_key_size(struct net_device *ndev) { struct enetc_ndev_priv *priv = netdev_priv(ndev); + 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 = netdev_priv(ndev); + 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 = &priv->si->hw; int err = 0, i; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + /* return hash function */ rxfh->hfunc = ETH_RSS_HASH_TOP; @@ -731,6 +773,9 @@ static int enetc_set_rxfh(struct net_device *ndev, struct enetc_hw *hw = &priv->si->hw; int err = 0; + 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 = netdev_priv(ndev); struct enetc_int_vector *v = priv->int_vector[0]; + u64 clk_freq = priv->si->clk_freq; - ic->tx_coalesce_usecs = enetc_cycles_to_usecs(priv->tx_ictt); - ic->rx_coalesce_usecs = enetc_cycles_to_usecs(v->rx_ictt); + ic->tx_coalesce_usecs = enetc_cycles_to_usecs(priv->tx_ictt, clk_freq); + ic->rx_coalesce_usecs = enetc_cycles_to_usecs(v->rx_ictt, clk_freq); ic->tx_max_coalesced_frames = ENETC_TXIC_PKTTHR; ic->rx_max_coalesced_frames = 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 = netdev_priv(ndev); + u64 clk_freq = priv->si->clk_freq; u32 rx_ictt, tx_ictt; int i, ic_mode; bool changed; - tx_ictt = enetc_usecs_to_cycles(ic->tx_coalesce_usecs); - rx_ictt = enetc_usecs_to_cycles(ic->rx_coalesce_usecs); + tx_ictt = enetc_usecs_to_cycles(ic->tx_coalesce_usecs, clk_freq); + rx_ictt = enetc_usecs_to_cycles(ic->rx_coalesce_usecs, clk_freq); if (ic->rx_max_coalesced_frames != 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 = netdev_priv(ndev); int *phc_idx; + if (is_enetc_rev4(priv->si)) + return -EOPNOTSUPP; + phc_idx = symbol_get(enetc_phc_index); if (phc_idx) { info->phc_index = *phc_idx; @@ -942,6 +993,9 @@ static void enetc_get_mm_stats(struct net_device *ndev, struct enetc_hw *hw = &priv->si->hw; struct enetc_si *si = priv->si; + if (is_enetc_rev4(si)) + return; + if (!(si->hw_features & ENETC_SI_F_QBU)) return; @@ -960,6 +1014,9 @@ static int enetc_get_mm(struct net_device *ndev, struct ethtool_mm_state *state) struct enetc_hw *hw = &si->hw; u32 lafs, rafs, val; + if (is_enetc_rev4(si)) + return -EOPNOTSUPP; + if (!(si->hw_features & ENETC_SI_F_QBU)) return -EOPNOTSUPP; @@ -1090,6 +1147,9 @@ static int enetc_set_mm(struct net_device *ndev, struct ethtool_mm_cfg *cfg, u32 val, add_frag_size; int err; + if (is_enetc_rev4(si)) + return -EOPNOTSUPP; + if (!(si->hw_features & ENETC_SI_F_QBU)) return -EOPNOTSUPP; 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; }; -#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); } -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); } /* 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 ad7dab0eb752..91f2b5afb506 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; }; +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; struct enetc_pf_ops { @@ -60,6 +68,7 @@ struct enetc_pf { phy_interface_t if_mode; struct phylink_config phylink_config; + struct enetc_port_caps caps; const struct enetc_pf_ops *ops; }; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c index bbfb5c1ffd13..d00e1ddadb43 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -119,10 +119,17 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, ndev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4; + ndev->priv_flags |= IFF_UNICAST_FLT; + + /* TODO: currently, i.MX95 ENETC driver does not support advanced features */ + if (is_enetc_rev4(si)) { + ndev->hw_features &= ~(NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK); + goto end; + } + if (si->num_rss) ndev->hw_features |= NETIF_F_RXHASH; - ndev->priv_flags |= IFF_UNICAST_FLT; ndev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | NETDEV_XDP_ACT_NDO_XMIT | NETDEV_XDP_ACT_RX_SG | NETDEV_XDP_ACT_NDO_XMIT_SG; @@ -133,6 +140,7 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, ndev->hw_features |= NETIF_F_HW_TC; } +end: /* pick up primary MAC address from SI */ enetc_load_primary_mac_addr(&si->hw, ndev); } From patchwork Wed Oct 9 09:51:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13828087 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010041.outbound.protection.outlook.com [52.101.69.41]) (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 DE0FE192D9C; Wed, 9 Oct 2024 10:07:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468441; cv=fail; b=PjPmUpjh61PRPRV+214hVkBi1JLEBk70gjZsokxcfuswMPjBHn4IAVOHNwRogW/lfv/2KOVV3pLQq6Dtph8zjDoDUztsxti2/hj3zXhVtubeOuOHy+EIYy1LOyCJlNtaQmtZzEXtySqMgwv8SW3E7XKZ8HXFWnmkM2zlC05Y3N8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728468441; c=relaxed/simple; bh=weSCN9zG7iBIp6zrkmqLo7QdDUNzCWe8o4NV1naB9cw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oH1hP9BOqlhgRAI/h9S5ggamojFAJ+kkhZPWCKQO0XqULX7jE6hPNJJR2W9XPM8/JjXEekHgDgJIvvCDVYiXmOFxHQSQ6Rz2Ae6wN2kIwCS7QNfupZnfConxHgtZY2xOjnjocIEZ8UfzpbODu5K7Z32LBhpb2iuWBaRsMfNjPtk= 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=ft1aZ0DZ; arc=fail smtp.client-ip=52.101.69.41 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="ft1aZ0DZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Q1/LqTZrXPWplfLPLZEcimsMYMeJUMcDSEVJExOBFAoVp2ftD8qmusNl2B0iRVK6eys1KaqeLF2kpZFPREsW6/rPWuuGKAEi8aR/PrhVmplApqSEjlwQWqdxATs+icTIJ9rzcI7YtY4nATVDC9gZxfCU0NkiGK2iXZ0+NLTVyoUwFGbdD9gb8HMAJ86z7OxXM0vamstpIxYmt5UNdjFGWSmbK23kZK7PBv0HAshqT4qkT5AW0q+vffoCBMlyrJLBtVoxm+f//JGuW05YQrTnWXZIu6mjVaFIgQLVwSPEgPn5cnrmY0cU2ut+MMKSbwdB8uqmZwmA61b9qysDw4Ajbw== 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=ouYYEcN7jMGRej2v2Wseaqn3H1P7s68N2zSaFdvODm4=; b=LRbj6HE1ZGOCFGkaOL6yb1h1olLaO1OcNw+nXswJryYh7Y3+/mWm8jV6mhmIRHn8MwPonLIlL7RzXY74fOYxQAHjl0fLigFaf6chqv/EJB9th/OuNgHwtJp9kAbDEMaL2dRtsDaW8BKoCKe/r8vhIy4bFYcQln5RUxcqJSfKKLF+p1nL+YSI+PzV8UN7HXhwtTlk7YI5ZUb02O25Ku1+P/HoKjEtWK66QMQPwbgAHnAoEETTJKK+63lBoEQcOulTKSDF3DH46sgDma5CvIhjmOW59VSZeuPL3sN9X01zTl7Kqsq7bcBgKTbosJ2/YNqkGjfAXefWoSNw36De9xETkw== 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=ouYYEcN7jMGRej2v2Wseaqn3H1P7s68N2zSaFdvODm4=; b=ft1aZ0DZHPiEt9gpVJ0VT7tKe9PIfCGQLNT3clUsmo8jDR8MXJhrOrOd0xjBOTGp5Gx+CDijkVGOuEoojqaD7usXN7EfTQluucvenS/Mu6eKSFT7tn1qHFQHzFcNx/lN9Cc4LF5jUJxN6YmwXlsuMTJT2+6QJA21y+FcYh2YwJvq9dXoveMB67dcV6P/dM4InIZMpaM2z3tEqhi62RkKFZ2OG0vt7/pAAm4100P6/jiiG2R4/gFcdjt75KrmCCwfBuPhvWAr9YmM/3VjjPwtKbxVgIVVfB5/3NWmmPlcOwxNfCYRBmtK31luM6c6Koi+57x+1bhBP5vnn8QEqhabcA== 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 GV1PR04MB10154.eurprd04.prod.outlook.com (2603:10a6:150:1ac::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Wed, 9 Oct 2024 10:07: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; Wed, 9 Oct 2024 10:07: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 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 net-next 11/11] MAINTAINERS: update ENETC driver files and maintainers Date: Wed, 9 Oct 2024 17:51:16 +0800 Message-Id: <20241009095116.147412-12-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009095116.147412-1-wei.fang@nxp.com> References: <20241009095116.147412-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0175.apcprd01.prod.exchangelabs.com (2603:1096:4:28::31) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|GV1PR04MB10154:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d3b6281-b50c-4f04-d1fa-08dce84a285b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|7416014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: OaV2M3rVNzb3uGu0w2uCB2EZSjn4foNHSHxysDATLJ/BODMOHkwRiau/QY/OjHl1mRrsycTAfP2q8fEXuTm2LV6TjQDzJf+ZgT4mBRa9oUnLcPll3MVu/WTIsysGPjgS/jXRAfDDthgCooFIWZzDaObo2q1TezaC9hWEa3WltgAXZi98AITM6+wSbs8iqNpMR97hxMfZI/I7GJ46tvdIbigohLnNtMezVoW/InW28Mijhc7lDtdGrU4wDvTn5DySBcC6ArQoznOZJTN4TUIAL6/i5bLlsPzjPVTiYxvS/T6U5d3BA3ywikMj1r1AvVkBXIj0lCe3GTsuPz2QBho8SWV+lcIAQgXoc6/tvUT0vZDkxA4/Oqa5ne7xhQh8EmtkNanNA8XdrtBslFe0nfjubJ9J7yVadYfQhLlBYHlsDsZMTNUebnx1ATiuw/HNnRMI0hXmL6bQh/BNxhxF/W9aHPl2XfIclp5B24/Yry7iBFlhUE7MxqIHidoriu4FxhL5eIIEqk2xOMqJeDH0s8WtliMZYgf2YmHWJdBMm8xkAywaKxvGh5N8zs3z79e3uDtyyhDO/s3kZQ0QyDzqahFP95+SRaZHOQhQaKTvKuDii+rqIRsAske8NDzGUiiYohJDqZUNRT/Dk1Kt4OeM/LB9+VZW2iYMFbg0PcfzLTEflxSvNw3ATrA9+WkxeJMBHm7SVBV85IOSBfCTVjiUPhvWHvfZPEAg8M5OcpQuNQtTyEWXJMCydlPaVvu1j/cutG49FlvLKbgQBlIFefYUdfXkKlzl5MywLcGCbvOzqAXB5dp//U+5JbxSN5uKsbavXkEMXqp5gtb10a8sousabcZgU/il51tUEK15CrI0+XHS9G93AKgE2PIQnxBNbF1OV1ek/Bgs38LOZQNNMFEQ8Q+LktG4haiZGOXNMm7uxRAsAfKafV5dkvFj8HQJzc3T+emhA+mXJWxoWaR4Knd543YFzugN1oh4mjjMtG4Im1h/6iEU7KV5aoWgoJ/WAkmhFONqYexW03Mq4cGSBBf6fxAFR0yA5S6lB9UNiqvAJqvD0/Gey+2h9TA2+C3CG7UwXhO+B/pUI4FWTkUa8+tZozAl141R8Z/qwy2nzSF3zzV/VDvwjc3hs2/NnpibEU+Vg85aNt2D+rRFS9FrJ9MN9wRhtoGlMQOlLXuoL0LfVjaJfruqvx7aDYSVMkE0D04lncM5z5T1ghHNIYvkHYIsEEsNeEf+4WChT0JH9CKEM7CWjme71ONUXvInVx4MDnCbhqsdHmmgexLD59HhlJMzuk0N2K7Lx/0ak/z9v4T/DOabfaxzsF2E/hALEExknEncarqBtjGsXvEyl/V73SyQriiix5APm79qpjH5EJu1z3pCFRY= 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)(1800799024)(7416014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OWFp0Jfh14S/dQryiFz19fdUCaI3HOt3qtJj51mUcDcKOO1xcMIF1F3Y+BK8nTIie/21X/fZQysuOEZeu5S9zpflQfAqZlljCoBy0OWUTtVGhEhDNenRKZoZSn6y4GdmpC8nZUmV2Wlqyd8udb+c+h0VfIe5vTDoyiFVc1XnkXcwlPCWsowWzCR0+pTcurF7ScvIsmkzvmtHWjZj3AqiHWAgS6IbQ0SGdrM6t36j78YAEipUId6ypzesqFyNPJxqnOMU2VdVqcETOmPPYxtJCbQmbhYUzYZoniDyM+cLHtoDHOholtkuKo3hxkJ84uebz5pHWiGtxkRhnQ2ViHhWFEYPh08vvQkgpN6qU8GKQ/fhbk5bFbu094MbqCEzehFdi8kIWGovg3B66FxCT9thyWIhIpoMhnDfwG1Fa25Q6cjnrQzl+NVB72Uns8vlVcWfNsQa38phJd0Vy+8Oq7IJp8MW+3ryjxQjMdW3JcWRxW9d10sbVVgzbC69AaZzhqTtD0qVBHhF78ZOmSmpuiYjJfV1DLx8s9fpRZW1IJKR1vI6f4OWNO6cwzp2BAMHK7b2/4kiUAXyV+Afg9BDVERtsHHfGY4iuvpcJzbwkCqEevFPknN/xFU4yAa/fVxVwnswg1LKih9upFkyEnwwUhus2b3pf9GUjy/3ExVvG9iWE2o+tu6afGCz8cNPsqiMTUP3AA4zq4R/HVHf7SWTEw03IJoIuEVJK3reCdyBjyJyC2io7OTKMQ/wHXdBAOTzqwtUI/19jf2Dzxxg/8Vn0uTFg3SafRqkMvDyFJPjy/DARs12XU9GoKgdqGMuJ1yorbHGlfupoGnAmGwME6iR+LuDKdhuLyU6d++hmpC5+a+1Xjw0342AWiFINNTneCHOUEjDeJKfAYR69OZb4hfHITEW7/Rz9bD/opeg1C1ByX+YKM9l8o3TKk+zQNLCQyDFQoR2Qz6NV+KVOfCpwp0A6Ak+E3yBup4naRIYZlBFv7u5zPBkgHAFysZHhYURBMT7gTjHGn+DZ3bOt4ak3TOoAeXT/z/SfetPJziLEkH/jLmOzwylPoQj8yT13Fkv0l0FDAC5fcfR//FHagMTU9NjhJr7nYeMXLg6SMOCG9AmZEHjJ8W7wyPrLbqxcN8H9sQPoUAoC7IXBJJkk7PNcXDzqd8Cv9BnIpa9x5agDE+A5JJH64MmXlGmQ++MyE+FkljGWvhXcMLHSqnTOvLacx2PHLG3ZQ24qka9Sge7rLhx9mL5Hn+uduIgMFOqLe7qcEXj+AAA95QdEIexrkOne1fdYeAUNoUlfzVClY+nXbKwRamzm1GUJYko07CMwddgz/pRMdW6EdM1Klq46c5oZJHAb+haIlHeHw7hUx2j13XPiusu2W0P4sPkJADMg4WgL1MwjXMVvuMbB5n6k7WOSzDyUg/Euy+lwELSPFES001GAYCk5hECKs6xdccH2+7qsnc8tCLQfIpkra4JPsHLD0FMqXcRVjtYlZ6zrxoIsa5Kp1YhkEBQpJW0nbNlxgJqluXluAb42VPp1iUxGMpnXSKNneO4KPP0N/XE87Ex0gjqR54HheYC0V0ZyRy416H8tR9rthJs X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d3b6281-b50c-4f04-d1fa-08dce84a285b X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 10:07:18.4864 (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: F2PxH42ktUYjBDeYIfs2Ae4vWYgxEeTiHG0nii3sdn/uzHOz4NG+Qz4LWAAaLZZI1wVl/+59u6XDhHIO4dED8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10154 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 --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index af635dc60cfe..355b81b642a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9015,9 +9015,18 @@ 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-ierb.yaml +F: Documentation/devicetree/bindings/net/fsl,enetc-mdio.yaml +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 FREESCALE eTSEC ETHERNET DRIVER (GIANFAR) M: Claudiu Manoil