From patchwork Sun Aug 18 21:50:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC976C52D7C for ; Sun, 18 Aug 2024 21:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=NeGHiw6Ghl60knBj+BqgNq9zaj30hmdQARuSIwkAFC0=; b=YIiY7M3MFa0QvLjqfvIReZRScf uv8LXLYUs+Vaotxt4J3yFyTAR2WiKdoSZqRdHx8c1AnfyWxXnA+utSFHif0PcsB9bU5ZDqfhu535i hI7AvAOqomrVYYyJ9e6ffQw2eExUg5aFC7fENqX+Plxt26aeERGZQYX0zDOYgHcJ/7MjQgGL5V0F6 wM+viWbU3zABLj20YNlqs7t62Jq4C/fA8OwIheL9EcnllIR/KG9809jumPQOxcvqYax2HONDhxD5c xD1qXKgtnWR88E4wY+OqiQt1Nc//aSxdikm8Xb9BBIdnUvkXKdYyFvuKeB52Q87ZQzSCZO3dCEvTI kI+bWndQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sfnnk-0000000HMI0-2VJz; Sun, 18 Aug 2024 21:51:04 +0000 Received: from mail-westeuropeazlp170110003.outbound.protection.outlook.com ([2a01:111:f403:c201::3] helo=AS8PR04CU009.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sfnn4-0000000HM49-0acv for linux-arm-kernel@lists.infradead.org; Sun, 18 Aug 2024 21:50:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=frzFTJyggfX0gN+5hq1zkWPjrDOevh3Cmd/T3DRgtI2gnkqO+XhrbCNZtnImCY8qhCYokeu2fU/LSY+B/yXVeW0CY1qfBKu9Mrtx3Z6YwPMxeZc5Vw23MukVylqh5D0huyhWS5pfPsVAPnxqzmMygcv7FRMCmRdys3rmKHoTXRgGapSzHoVqKSrbbv8FqBeMkaJEhATViEshqEFqU3Jwtr2n2KvGVGU6pf+rucB0RmGaC5shIbnS+X6BUjzZ5uvQ62Lol8XDbizcLVtvvC3Bap7Em2S9H6A1oIrDYcrPNQ4BxLoaHP/76qXjtbo7VShqWzI2hi8AQ0jK06+QNtW0cA== 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=NeGHiw6Ghl60knBj+BqgNq9zaj30hmdQARuSIwkAFC0=; b=Wcz5z44v4ai19zpvMdtSfRxv9rwV9SC6KrCVzNXicY/IKrN+lsU3r5ZRTM9HkKRjmQ982vqEDnr4ZTAdHGc16y0EECTSOZx5LQFhcFkxVo6yOFxNq9zn4Ovzu8JVgvIWUn1kiWyG5mciwdG35whJVSxpEiyy/v338BKTjO5V5FEQSMQ3itz3ms2w+FsDwYhJGySj82gfd9gtuXMU3hpGNouzZQPeS+Z9Um1cEFXzKjVc+D5YUKLXXgmsXtBkFpNcaZisI0g21LRtVyBsHSog+i1MA9VEJCQ0utZNH6PGB5OBlQAIEoSjLBBJJP2Rs+gkZo9Y2lIsRYgGcZVBoC5/GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NeGHiw6Ghl60knBj+BqgNq9zaj30hmdQARuSIwkAFC0=; b=a56GWnap0MDMTx1gib/T0uwgRhgeO3w9opFkKfFIBA7Kz30KA8Wej1ZhgwxNA1J69p9Uk53khp6/kKG04f+8Csd4/o5D4rVhtvTwXnLBz5sj8q7YfNXglXRLHARtwobfYiDOBVtZI82T1vXXKO0pI2GabNETLDtkwVSBXe12xnK+qMlPzLqCqQ1X5ldQk0caK4eYDCOnb4BElU5IvwUdqHbZrZ7f6MKXbnNwLm6mR87uvEMBQj5qOGd0gV47Pyc4fLkobjYW01NXZ4mB6eSyeHD0q3Qf1TzSle3kWba+etSJ/PD/TX9B4ejIFPTYFnOqPA0lEVHRyMqGEq6sUhqxcg== Received: from AM9PR04MB8506.eurprd04.prod.outlook.com (2603:10a6:20b:431::16) by AS8PR04MB8183.eurprd04.prod.outlook.com (2603:10a6:20b:3f1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Sun, 18 Aug 2024 21:50:10 +0000 Received: from AM9PR04MB8506.eurprd04.prod.outlook.com ([fe80::5f7:9bab:66a3:fe27]) by AM9PR04MB8506.eurprd04.prod.outlook.com ([fe80::5f7:9bab:66a3:fe27%4]) with mapi id 15.20.7875.019; Sun, 18 Aug 2024 21:50:10 +0000 From: "Jan Petrous (OSS)" To: "Jan Petrous (OSS)" , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Vinod Koul , Andrew Lunn , Heiner Kallweit , Russell King , Richard Cochran , Giuseppe Cavallaro CC: "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-arm-msm@vger.kernel.org" , dl-S32 Subject: [PATCH v2 0/7] Add support for Synopsis DWMAC IP on NXP Automotive SoCs S32G2xx/S32G3xx/S32R45 Thread-Topic: [PATCH v2 0/7] Add support for Synopsis DWMAC IP on NXP Automotive SoCs S32G2xx/S32G3xx/S32R45 Thread-Index: Adrxt0q6n4YzrDyuQQ2gRM/4umb8Hg== Date: Sun, 18 Aug 2024 21:50:10 +0000 Message-ID: Accept-Language: cs-CZ, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM9PR04MB8506:EE_|AS8PR04MB8183:EE_ x-ms-office365-filtering-correlation-id: be45e14d-ae65-4a9d-23bf-08dcbfcfbb81 x-ms-exchange-sharedmailbox-routingagent-processed: True x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|7416014|921020|38070700018; x-microsoft-antispam-message-info: zCe4wABEA/MEthcY0Ns8TKcQ9+8aXuyinJfIt9Oys7YrikBUSRJx4pSn/nf8Weq4Y3LF8OxaBE+NOh9JFRnxYYISiiuctfWkSVPQ6tvYbhUBkJox/u9XKxcb5tpEP2WEuaIrMuVs/kazdvE7hyGqfT19FDrIbQnokvmrw8j0Q9/jCrH8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ToN/1wFkVijafaOfFKZ81zdQymYQsPzuZ4nskfuc2xOuzrZWtXYXu02HnvaAjTqIwt1TKsENBQ635gVpGiB9N6pB5Bim/KvfMYrCtMKI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8506.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(7416014)(921020)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: EogGcbuKhbsGfS7SARZO68wDWngp1y0nnKfzWq4pG+aClBYI7H50MjZ7eK9L7WfZn72AAd4F0ZJm3/OXpZee/2v9/ZoMHjb4efdsm31gFE4ytodXZg+A5fyW/8zTyjfs+fv5o+tVgimxpwDDuJNGCxgzOwFyt39NSjY4iYhSasIIjtlGiAIpQW0d/jBe6Dha4t5O9j0PsKmOZSHkuxP1dd8Wr4HFgIQ4d8L7DjGRuVqhf9U2L5Y1ulJYaSshmFnwIx5kRXuXVg2Ol+gBQBJcF3yKxsIbCHMgIslr/ZagSv0Gkhr6a228ojVkCsKwbMd9LWK6i/hVO6MyoB+nofZYUgzCL6uvp1F48oQoyakEtfpvrqWjQX3w1HkJZLOWSkzL2v77Efing2gwmkACaP22arzklBNkLts/GWa4umxd4xUKc2wNaxp+eh+zIkmDUHsaHP3NUeuoQwaTw2woqNVI+qVgmiEoMzABWcrXuRLYoIX9lPghKYxunXcYPUbt7Zawf1rIjT04X2QWepbFkUHp5KGykNNYTo8udFTdwWFnq53h+q221EIyC4B2omSdAzyzwXZWEf+rj0gBZSHewAbzBJqGXAj9ikCofjjxMIrViAaEzXFTmV8OFD58gobMP5jcE5EIh4Xp6rz4Dqnx3Vzz/UfllbKysvpbF4md0xyDDEr2Ava5uK1seohcEBXFH7Bg4mVaOeL+m6MnCw2+gaN1/o4uAxDPLOtC8YgsaIRviYiMTVDClCMOQKrcGyjWzfYtNQ0nUWgDazAkUs1sgzNIHKcnfaXxvwInnCFtqsMz78jVJTYHmZ5ga/WY8zrl/C11J29cZ3R79ADpj5ElaUELcb3p6MOJxVuVqBv0RUJz9vdOeKZtqtmVoDU6h7d0DNikycydjV+YikFlQJBtTJrLp4gk/VfA7XtBFBBFdsUJiZq+vJYNYcs9Q+22gZDtdERZDWIk0rStTeAW3ZqORZzgDo9rORuPF8A45u7fYBSCgfYJGm+NtS5/TTzwm0Z7+lFSHkBWmKDCP1cZkG33ZYHZgU8cCcdglZd8E73N3gq1oWn0uL0+GyCNokrzrJgDAkNDVMUYz+IqD+mD9r0Kda0hZQryuhEPVO5NvCMB7clJs8yo11zgnTWWfXDJpA8rO6ksgjrJRADwkXYH2rX3UMmESeMplFp+f8birqw3GiyXMZqGDmKz4A052Jq8a55Vxxq/wVbRc09dXwGU7eED02QMuneCRza/EC7/ZHBYn/d09DS85UpV2LLa2PHP/RTHqiUr2Ew5T5mVMSBoR9/aaLX96ZUVdsBw9ZtEX1RKmjmubplDGW1KvPA/WeQ6qR7J+ql/hbdIbvubF78JReAqi3CNVaKkbxpjcT91EK1Uah2rIbaYjl+Jaumn06kqb398Quw3kb8L00x+viiiDLGNBZQoAPQMK7C7yQ5yV+xFi5id6OZcboEgQlSQ5vXVkn5AmCyofuKDpj9GfTIl4rkBDeuncG+cUR8odimT85QiyVW3y+7e1WA7LsO0nXuGRvJkc2IPajBKUaKZsg4hWwrJuJQ7LufcU1wfEqI+hp3tSwrdD2Y8N+9hZE9Cb+fwIHDmQ/Hg MIME-Version: 1.0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8506.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be45e14d-ae65-4a9d-23bf-08dcbfcfbb81 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:10.4566 (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: eDP4Qv3tkVMvKqbgzgoOnARmTZ3qf3eoCMBSiN1XlKkiIcFu2ewOxMuc1wxtfvJFyopInvo6Za9e5lgmPd4ETA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240818_145022_220668_D84BD4DD X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SoC series S32G2xx and S32G3xx feature one DWMAC instance, the SoC S32R45 has two instances. The devices can use RGMII/RMII/MII interface over Pinctrl device or the output can be routed to the embedded SerDes for SGMII connectivity. The provided stmmac glue code implements only basic functionality, interface support is restricted to RGMII only. This patchset adds stmmac glue driver based on downstream NXP git [0]. [0] https://github.com/nxp-auto-linux/linux v2: - send to wider audience as first version missed many maintainers - created rgmi_clk() helper as Russell suggested (see patch#4) - address Andrew's, Russell's, Serge's and Simon's comments Jan Petrous (OSS) (7): net: driver: stmmac: extend CSR calc support net: stmmac: Expand clock rate variables dt-bindings: net: Add DT bindings for DWMAC on NXP S32G/R SoCs net: phy: add helper for mapping RGMII link speed to clock rate net: stmmac: dwmac-s32cc: add basic NXP S32G/S32R glue driver MAINTAINERS: Add Jan Petrous as the NXP S32G/R DWMAC driver maintainer net: stmmac: dwmac-s32cc: Read PTP clock rate when ready .../bindings/net/nxp,s32cc-dwmac.yaml | 127 +++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 1 + MAINTAINERS | 7 + drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 + drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + drivers/net/ethernet/stmicro/stmmac/common.h | 2 + .../stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- .../net/ethernet/stmicro/stmmac/dwmac-s32cc.c | 248 ++++++++++++++++++ .../net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +- .../ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- include/linux/phy.h | 21 ++ include/linux/stmmac.h | 10 +- 13 files changed, 433 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c