From patchwork Sun Aug 18 21:50:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767625 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010025.outbound.protection.outlook.com [52.101.69.25]) (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 23F2F12B93; Sun, 18 Aug 2024 21:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017824; cv=fail; b=LXW9hgRMhCCkFPrJbpBmhnl/8CRE3Pwf+buZJdMtxLwM1MqHf20jPMP/py0vu9fsMIINu6bi+qUYzXTDPk9thX3JpuTBPB+mK6l8DepcX5s38sbUDmbmaz3O1t51EZsNWS0UxRDvjCiu+hwleji14hP2CokBWGnXSAQ27pX2Hto= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017824; c=relaxed/simple; bh=A2VdpNMrkVyCiBoKzgPuQCz1UndtZRwYf448cq+nS/A=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=LOKK3rgdVSP1B0oBVoGmOkd1HPdpBvC7viX9uWjugwwOaO6TKtD9HKf38y5nI7Edi3BsiwEoXbT58PXJTe2k1FxxWkbB9xIDmqV+fZDFVQWwCKptbFFJAFpijWGxoMjLNaPwJ7omK3hGtK0LMLO6MwTgGRMJiPmwuUwHmmHH7BM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=gEDO0sgf; arc=fail smtp.client-ip=52.101.69.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="gEDO0sgf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RAXZiMQm0vuUuVGt3HL4wRW+gviIviT2im4ExV2sw+zedBR/pY2Nr/SxT7DvUDib9cqROmVj5XYavvDiTAIUetbvnYPh8yGKDBAm0t9g+P4ve4O680JY0tAYr+506McY5YZZ56gZeFuhiS/WDY9UssMBvQEaeCI8Ateefje0AenD6fDr/DoDuG258geTcKlSpzDAbNwlY5CZwdAPfgMyJLoXdKi4OjL+ckVLn+JutlHag58lYmhXoLCpsOI0Wc6rKNGLLAFBC/Sr8qHwTU1zBuqST4x5Zfl+zWie3MLkdoQXYMeysUZPN/v3qHK5l84PvUo7Jp52ZAzEPKovG/rA+Q== 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=x3Pksx8KqxVNKrFJRl+o68DtVs5WwvMiJQOuFvqMRM8=; b=RfJpmgminC97RE6hw2HH4anql65Ydc6uTqJJsedJLpSUU5bqW8g1S23LgjxjlHOfzjsxHz2ZZbB+mHG0foIgruiKmIwPnA6oTE3fvHAVkhgEg8kd/JJAgGhgFu4il4rlIF+IBpGSsw9MRpgDlecYZE+z6vJGbHOvdD8LPMnR5/LY5EoG9FVt0Jv+l3Tx4bHVnoE5SlTusNofFzPFxzasAN0oxM970uGxUL6nEKIUJZvvHmgdKzbgmqx2rzZZVNR+cuiiXC2cM92A/6tlEPgeZn9eZY7o3W7Waz/0iRaVY6nhpUGxbRhqrca/8maDfAps24O4T7RLD0U685z3TPWEtg== 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=x3Pksx8KqxVNKrFJRl+o68DtVs5WwvMiJQOuFvqMRM8=; b=gEDO0sgfiLVb1v7rI709J3uer103jLUw0iiz5xUC3+HBeZ5vZLATtfJr/XG0jNug5hpnnCCQP+kJvaTky4WvwnzIyOvX33hxetjf4oNPm6lKsXt72xG38+1rYPq1d6ASRNRNdJSYx4OkWj6nULRuQZHNtd7Gns+2qhP2JpEyjjv/Ba6CI1piHgoC08+TI1Z1dvvA1gdshUQ4pEPGfrn8qhsGRzAuGSflY1uiQgKspicDEQF7vaa4/0HDOUbnxvAPTUg6XW/PJa19RjCJdeuRsNdKoyv5cZuoLVKX0Oojh0gn5t9lg6C/qceIGZWysP+LG9HDQQpDjUSJW++9EBEs4Q== 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:19 +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:19 +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 1/7] net: driver: stmmac: extend CSR calc support Thread-Topic: [PATCH v2 1/7] net: driver: stmmac: extend CSR calc support Thread-Index: AdrxtQ4W/YDQwJHKRK6EOcoVPCOQ7w== Date: Sun, 18 Aug 2024 21:50:19 +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: df9ed5b0-c600-4139-d499-08dcbfcfc0ae 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: 88jzSiI6QX+9qXYbJEHRs2zgxvKX09Isszp0z7dBqrLts5V+gLusEli/IupHaMkaRrGhTjsnWk/3uVH1BSz4f6vnFRCGZ9/eqSCjmtdz3R9OM4SLH2W2fJtH9vWd/7wWZHYnmITrpaC3wudGWqklVar0LJZ7waGivnVEGBFdSwNUpgPWIQBQTQS3y7M8UDZvdAuKNpAB76JJSaUGHl+pZ1bYen0PdxYuNk66+HoUhBcpL5vEH/JZ3keblGz/vLn7PxdLK+AMslY69/cxq5m8f3k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3U3DCHV0eCCYBb/NeQGFECOOYKSIS2uU9An2sEFSe6KYikVp5ERDwQ1dSHhd5+MFe+UfXNVPcL3gzVVYv9XPRMm/Xl6j4= 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: xKiziUD2oAGZImQYxAbW3ESWgCV8vFX0qcZNPYPyiVcvJ7/KXA8sjiGy5r8CcA5Sb+Zo17tLDnjlAsDzbhLRA2hGO0c2hp5uY1vNeuhRyZ3U8j5yh2wAt43WWKi2Rm/bp9K1/UTWMsk1ut1wkFMaCW+Ps+XfuJKsYes1/bpAgcBL92YRUeM8VAI6eVl+5QDhmVogWzvoWoF9lr32Ny57TLcClyphqSGpP2SCNbVY5dJs138IHuBlze9mio2WfyPu2hbJAKwbhY3RQ+5hsA5oylt+U9zKe3k7uIwhsFQxiqDEIH96DgoSZLZE3Yn/Lr3jSabHbuL8KEXwwPa5aZLXxxjRvMxkDd62tEyxMSmmkHiea0KFUF3kIQ41Lv0MOL+ulZRwWshiA956Olx+8OgMoJrjVXSZ2erqfYDU9BEukVl+jOlgPxH2PFbXRrGsLTCfzi7oXh1ehMVmALg1UuCc6wLE///DmCG2vMtoeHkiX9AoG5VkEixi99jVKrWz3PztIIn9j/dpRERAdf1ESDBMLDTFMf98HP6tYXdu0ESUEU5+pRA7nA9H0QT84h8UPnq6o/Gpy0k84wcpuxxhKRd+mTcbXL3lnbHD3rCBi1laKaqXNXNeNlrWEb/ufo402YTHmfFuLOXpKkQoElnyKsdU+7AhKmjTdmtdyFB/RVzy0Qs6VyzvT2EgCVugjWy47YEa5ABFG4CFvT1Bqnt9yZcZhZaplg3yx5BHBUzYnLEMR5b/Bw/HAHEH2vhMpVAlpa5jUl8pER+5vq+ZaPktIBDDXuDRNugXxlKbDgLgHf7q0nBaSontf4l6EWMcxQDejBU4AInkVUY5x+mYxQXf/51rNmFU1wHFp/AAV/3PGWsGLMFvfye7+UbVO6a0cN2AyJBDouftGF1ExG88apQRgNJRTkMJTFji9BJMqg6dT9F5fWznP/GGNMDeQvKWRPZxoItfQN30uD/YkmRr5IL1eHW3BBTiKpE5hL+7y9CsAqdX9dato0sHUKFYz1j5TLiXlI9tN9uQ6ouxlOYwUK30Xs4q0wIgoKIs8T/WpyshsMtV9FAjc4udRiqCyVo+725FBJrJb/vZn02rU47UZIWNU04/FTXcG5/mAdiO9qAprPZtGlE73lmKkfEVEDkXNpzU98zQQ820O0txyDGx/rvvMX5dfbe5IyZhhL1Uc95ec4DxshFJW6O37EdbBmDlUwLadLwZbbBfSRGAZuw5uq2HJmQ/FBS/8KTlogYoRpxOdFN/zpuqAevcnGVAkjt3V3Izi8RKEszZ4IZOWj228vp1dMuDxmJ1rVs5i1jzEdF5obFWRATTgl9DFG/ZfuThFgYlaLBBf/P7doJcn1duWaTuSnLEp1WLSZORbo2C7Sj1O0NeZvZTf9kSV8AACYk+MPt4uVYFiCgbIVvbyhF2VKJvB/1+S+X10afniLrckUaLdxps4ubuoO00kWBOTtQ3Y8N2sGBZRIaRM2zPXaPCYqufJif+QPMGY4iYxPKwFjUy6Gos90r5Fy2MPPi/ZJZGEf81Neef/PJXleQYxLeYezFd146IgBk6D1JtaVoY3J8MRI9dg9s2+XMJTsDBCBvBtbRj3PNW Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: df9ed5b0-c600-4139-d499-08dcbfcfc0ae X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:19.1222 (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: KYABlX4saHOzFm43DdnntjJRD5c6HqieBYalzJDXjvt/vXffwKftQJCowlxe6XGdegqbnPZXS6Nr95QUaqjNOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 Add support for CSR clock range up to 800 MHz. When in, fix STMMAC_CSR_250_300M divider comment. Signed-off-by: Jan Petrous (OSS) Reviewed-by: Jacob Keller --- drivers/net/ethernet/stmicro/stmmac/common.h | 2 ++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++ include/linux/stmmac.h | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index cd36ff4da68c..e90d3c5ac917 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h @@ -256,6 +256,8 @@ struct stmmac_safety_stats { #define CSR_F_150M 150000000 #define CSR_F_250M 250000000 #define CSR_F_300M 300000000 +#define CSR_F_500M 500000000 +#define CSR_F_800M 800000000 #define MAC_CSR_H_FRQ_MASK 0x20 diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f3a1b179aaea..ac80d8a2b743 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -324,6 +324,10 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) priv->clk_csr = STMMAC_CSR_150_250M; else if ((clk_rate >= CSR_F_250M) && (clk_rate <= CSR_F_300M)) priv->clk_csr = STMMAC_CSR_250_300M; + else if ((clk_rate >= CSR_F_300M) && (clk_rate < CSR_F_500M)) + priv->clk_csr = STMMAC_CSR_300_500M; + else if ((clk_rate >= CSR_F_500M) && (clk_rate < CSR_F_800M)) + priv->clk_csr = STMMAC_CSR_500_800M; } if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) { diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 84e13bd5df28..7caaa5ae6674 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -33,7 +33,9 @@ #define STMMAC_CSR_20_35M 0x2 /* MDC = clk_scr_i/16 */ #define STMMAC_CSR_35_60M 0x3 /* MDC = clk_scr_i/26 */ #define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */ -#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/122 */ +#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/124 */ +#define STMMAC_CSR_300_500M 0x6 /* MDC = clk_scr_i/204 */ +#define STMMAC_CSR_500_800M 0x7 /* MDC = clk_scr_i/324 */ /* MTL algorithms identifiers */ #define MTL_TX_ALGORITHM_WRR 0x0 From patchwork Sun Aug 18 21:50:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767626 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013058.outbound.protection.outlook.com [52.101.67.58]) (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 01187155C94; Sun, 18 Aug 2024 21:50:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017835; cv=fail; b=iL7M3TIdwXVKpr2P4SHYnM5CgNnyhxovWKpSd70s5uy7//bUC8Kke9dfJhPkm1r6Ieh1QivS2m01SVLXfFztiOrQxiSyge/mrj6+q4xcAgueMt14VmqeX/yKExTZTAL91i752Dj8jS3A1xpEVTAqwiXk8cXd6v8by4kHXUfdULs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017835; c=relaxed/simple; bh=iRqankLAXuQiYNzZ8rtVhDwqW23ovkglwHZ4pD9nypM=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=SOZSuFizgKdMWA1E6p9xRuGrXfp8znWdBurCWUujprDzqveorIVkFDtAoPJk6csAJiIFz0lfLciWrbf7/nSljZuCL20zs5tE93yk1nPUqQhwyLUA2alOQzjXtzOtZkgWkiWEpuowvFebHnZtIDut6r8tWMX1v2nVX1v86cC9n+w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=uLNKEpx0; arc=fail smtp.client-ip=52.101.67.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="uLNKEpx0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xvM2fbTGQZ5T+G4kPJ1qcNY86KKzAnUnsypD25C60ELiimpsG3XLhj7elEzuyJSsJEe+yWfQ67cs/n62VdvLmj8AV4FHF73z14b8I4tlB8IhT+Qh0shfh/NuMb75b8+ku1kG0pVHcLDQxKzTFpt5aZtj9l/nwIqj1jsJF+GC5IkbtlxNedrl4IjUA87fJytQqMWHFNruS/8J2k6jIa8BXIzoWyLkejpaQh7n2NyOI1lxP5g8NTCVdVwW+1aNFQgFWWRCO8qtCWwNSaWzaV1yjiQwL7SqflqO7ux3FX/hcHBnnNR65SKyziCJia9KX3WNKcedmkjOo613p5U0o1/nTg== 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=XfNkawFp1Rk9p112g0TRi12UXdfkHBlxgcWqiq1glDE=; b=MtYa2tUoGt7dTjb0cMi/84qcoEdiL5FFrRkwbLZCznmd/naK8w/Oqvmiw76i3LQJiW6qXReAmrVKOEC6JWTWvzn87BRpdrtVZyOHACtEyuCi0iUWM9p+gM9KAiShxMdVya2c9kLN8T3M60ZITmVLnw9k0CA2lNwXTyA6TzRM17mJUVpIr3VGj7pDnbRPOkMaK6ke3JnMTfj3GaSd5oWeZlLuYyIQQ3G22Iq2bJ92rFNducOyrfS4Fz03Zj+TWK56XDpZtReRwTYqTxFiwYzki0A8w65KFg+X7vun6kmJPt6fWg0F2xliIxYnC6NPYjXHBe3xG7lRxVhToDFL3Jyngw== 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=XfNkawFp1Rk9p112g0TRi12UXdfkHBlxgcWqiq1glDE=; b=uLNKEpx0o5+QhrWAeGbQ10DpB56PDFWtvkTVOA4cDBSWIFQA6q/X5gik1aXuCBqvvrm4QmwJeU1cGsWb4iErt/zLRlOSXqzdi/OMhQgwkjFIqyv49JiH5g9POoUQN7v7LoB7s9+qlPjoRJs6DcvT/T1fle9t4hU4hBc4BHiLh4VoXhL+4d3XfPvGlpzIbzn9IExAtiAg+fmEDTW43rqIhTombd3Caf7vcOp/9W3JiOkzV5zqReBoQaURVv2duyXeKuTP6w7pCWZ63oIWkxESFzzVVH718w+GRUfZnwSt05FsMx7XwmcdqRm5nO93tCH4tv1kicxuOjoPoiyJCdTBCg== 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:30 +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:30 +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 2/7] net: stmmac: Expand clock rate variables Thread-Topic: [PATCH v2 2/7] net: stmmac: Expand clock rate variables Thread-Index: AdrxtUOqu8labnA+TUKEes18Ol/IZw== Date: Sun, 18 Aug 2024 21:50:30 +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: 5978d163-af02-43e2-e460-08dcbfcfc73f 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: 4A2gQpQPsMNFswy8qA9eHEJf4GN8U1TnyeeGi9vUQAvj+fjGNUAZI0eMGhb07HQnk4a7mG6aSWWvMG6lyWmlfqTvvcRinv86gqPGQaZE3xw/RDiAe+W54ab2cHg2DiTNrX4FpKycbwQqzTqeY6n3Bx/2Iu7j08zCT99sW72BoORCg2dnCf8BYUHwG1DAyPO8CT4kCjqf3djdwB30FId7bKP/NIQGnGhjBCb6k1MpPYQG8WXkDwM70uRJS5W2BZ3bvwkkfgVvu013VJBGrZbCz6M7E8WeLJqoZbOa48ItVOaXGBor0a2C/YL+qXDxqNWopg/PAZszs2YTv/QJ+9WvOBf+iAaSO1T5CKUjwunt4HCDJ/iS08aTj3KDtFXrau7H095j/r2C77+2rQMZGdwFITcqH4O33qCfqqqf7KtxRQ2/do0VeMXwQY49Y5QKr6YlepHGkMJelkcxhKaDldOkSmy4gWNOxjmpEpIHgDXHjUoSFiEwqLY1JBA1sdu6zJ+C5REMQAX80XGbbyfEL0qi9bY3nWFHBIRzkJTh6CYs3vNrop0YjOkxSoDUq6kmDPLkFwJnuWgTifm6sTMXCQySndqVhon9FUpSmhdtLqxkZmrMpydaZJTDhoN7GtULu67ufk24b2kCAl4MG57AZQoCnHACt4MMjtxlquotqxDU9fLYacOBNiIkMbTpEyx71TJpPswMf1ZFvuteJYwRjqfyPQQMGv2n3dkaT3V8hWSzbLDZ/gyhUVYLglN5WPHghhZr2WWjZQEfwPz2fnlQwD//1CaCQY2CnCMwJkAUiF4tpe85zbRZgnj7ZQ5PoMksOynpKTip/eyrAotqqk7eu0q7aTJyCqv6cZfnNnsmA78TObVXAZ71oyKaFvYwJWt2eAqhnWD5IonMSoMh5mjVnqeiAAkuc8ZuoAN5x2VTJ8sKc6HqPi6MprusgWdZYXUL8agS9jaZKVDKqI0ozGpqGCerO0VxSNE8APcaFZsS7OXBlo36S1X30iz7BKQ5UB8zlXoNJUSnXPl7cNNWNwYj6S3ciGTuh/WHgMTamRIm7TxHekS3b+u7DXeIKOPY71frlDsBz2GhAiqn6l9HCU+yAVqO2f2l7FY3hut/VV6OegbtzPMRBXa/7n3p5EdgZzuYrD0PFExb9HwBaZqYD10IJTeJO+OOJdEqa30QX5OAxw2+LfzjTRFek1KG6lPjSz0clvYq/7JdFLQylQZd9GTuiyHpJhsoB7tYuw50hjs1oOupCu1K+WOO414yaNUXTC3cNN/V/WaaazT3jxAa7+kIRUmX9zPXAudNcSk15S124kNxWHpOlGPFUvDCvMmajWDUhu3eeJ/YRadInObUQSfufndkQgbSm1WfwVyynQq02U/DA+X2Zhpj3ATlisFBh5ckclMEy91qYtbjez+DyynrsmYyCrrhlUSreV6MHjMqMP8DvKM= 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: dSJcnkImlEfSijvLz/n2xmElGoEskDrHu6LmJDdaCgyKaRTy7OO71ljO21qeiDqujC0FicREwg1XFt27KsH3E0Xn7iHTs+OgcBgK0aJ7oKlxQYmjE6q8xWdPOygi5cKo6J8gGQWllHLHcvURpUgAtIo7Cr6RM5t6U3tGN3vZdLOvI97E/3u7T8+KQ45kYECr8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DPK635osFdUpr51vOIi7aN3E3f2qraV3MFxY4ZdBO4SR+jubs6F6vQucupSdhJusXZjj7ud21QQAJnDG0FEm3WbJ55g/tAQB0UDPgQjDB53OXv8LS+zk63w2OjPoYkIz3UbFKnr0owrjkAVdci0rd6rOt+4T6Ynyo6DJ74gl5zOH6W1VK7H6WueqxXPRKE7QA506X+eOanSEWNv6MImuGsx7EGcq2mhhC8CzOhfDGY07vnaoa3/n9aZQPraqFErEtUydpDKDMaO3bsLYDgtEaJj42ONuJtGzJG1PWT7yFL/ZStIpift5nEPerm2KhMSkSI6pUeJ Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 5978d163-af02-43e2-e460-08dcbfcfc73f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:30.1549 (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: /GEy7FhY4lvA7zhtF0UYDg+dQsh/ChsiCOKS4iSgKFSPfuo/ZqnC6wyNI5gnk7LGXpD6VKMnDjJjkBFcDPKsrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 The clock API clk_get_rate() returns unsigned long value. Expand affected members of stmmac platform data and convert the stmmac_clk_csr_set() and dwmac4_core_init() methods to defining the unsigned long clk_rate local variables. Signed-off-by: Jan Petrous (OSS) Reviewed-by: Andrew Lunn Reviewed-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- include/linux/stmmac.h | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c index 901a3c1959fa..2a5b38723635 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c @@ -777,7 +777,7 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv) netdev_err(priv->dev, "Failed to max out clk_ptp_ref: %d\n", err); plat_dat->clk_ptp_rate = clk_get_rate(plat_dat->clk_ptp_ref); - netdev_dbg(priv->dev, "PTP rate %d\n", plat_dat->clk_ptp_rate); + netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate); } static int qcom_ethqos_probe(struct platform_device *pdev) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index 31c387cc5f26..82b102108478 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -25,7 +25,7 @@ static void dwmac4_core_init(struct mac_device_info *hw, struct stmmac_priv *priv = netdev_priv(dev); void __iomem *ioaddr = hw->pcsr; u32 value = readl(ioaddr + GMAC_CONFIG); - u32 clk_rate; + unsigned long clk_rate; value |= GMAC_CORE_INIT; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index ac80d8a2b743..398a33bce00f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -300,7 +300,7 @@ static void stmmac_global_err(struct stmmac_priv *priv) */ static void stmmac_clk_csr_set(struct stmmac_priv *priv) { - u32 clk_rate; + unsigned long clk_rate; clk_rate = clk_get_rate(priv->plat->stmmac_clk); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index ad868e8d195d..b1e4df1a86a0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -639,7 +639,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) dev_info(&pdev->dev, "PTP uses main clock\n"); } else { plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); - dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); + dev_dbg(&pdev->dev, "PTP rate %lu\n", plat->clk_ptp_rate); } plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev, diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 7caaa5ae6674..47a763699916 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -279,8 +279,8 @@ struct plat_stmmacenet_data { struct clk *stmmac_clk; struct clk *pclk; struct clk *clk_ptp_ref; - unsigned int clk_ptp_rate; - unsigned int clk_ref_rate; + unsigned long clk_ptp_rate; + unsigned long clk_ref_rate; unsigned int mult_fact_100ns; s32 ptp_max_adj; u32 cdc_error_adj; @@ -292,7 +292,7 @@ struct plat_stmmacenet_data { int mac_port_sel_speed; int has_xgmac; u8 vlan_fail_q; - unsigned int eee_usecs_rate; + unsigned long eee_usecs_rate; struct pci_dev *pdev; int int_snapshot_num; int msi_mac_vec; From patchwork Sun Aug 18 21:50:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767627 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011051.outbound.protection.outlook.com [52.101.70.51]) (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 1FA74155C94; Sun, 18 Aug 2024 21:50:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017844; cv=fail; b=J94fG3mkIIh1JzNc0cUqTYc9+rzt4E14QS12ueaeGSMiJRUTaKcMYR6KZxjZmDnU6NeUcRojh6wKcnZyvC6DqNZcQzZ6Dc0fz2yX3ZeO84Pe93EBZCtWasXvqSEBY6Eiikkvd5znewsEGdkGWpSpH6VrXO4ctw+xxfadD2zkLmc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017844; c=relaxed/simple; bh=9N0hCa/Wq2TX9bE3yhxBz9FulLKgd3egsgkJoonrbBw=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=GM+Z9wTKgg8BV7DNoZ+gYp2m5uObu7YLOiN+wM6QCY0M4yr7ZU97dLWAxgRdbx5HlyPfMa2wJK3fHLbUzK0MDeyTxgXfZQHr8sRzmztCCmARY0w8wJZYsdTyuAP+VSTRwHcTzN6y39bcGxcYw79uMdU+u2/wci1a6N4QoUal1G0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=ElkzTPH7; arc=fail smtp.client-ip=52.101.70.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="ElkzTPH7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NJXKJE1oTpHu3ZyK59rrTFQnIsGJ15ol7jfxUwrKxE97rKvmegICi7UCHv9SWtDKhSVDCG9FBDW+rCawcWAxikJJSTNrNS+sd9rSrX0UIdJ2aPPZYkF08n4nNHqNgiLKWQXgBwfPRZGf0yiQHFNzphQgaqIgHTOpajI9tdbGjpIuhr985of5TBTWWnkkbFFzLgygTJOC43vDX7DPY5Zxt6C8+rY0q71ked4j2Krak2ogRLwO63Z0lbBWw2UgQr2xRAgz+n28AXxh+t6H8DxoS7FaDJaWofl1JaBKX9r2Kpq20s0Xeck/wFzA5yFzZx885mNBkR6xLPJnKS3Uf8FDGg== 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=u/ZDtX2BkysGxJ2ScBhNQ9MWWpo4etrvQpMjxVjEk3Q=; b=PiW0IcLmZ+e3wjbhdKSjN3ZISz72fNK/VxZh6Jg8KXhOeLpIPncV2KPOLGUBwDUJPowgcPAFB5kMYFRTSd0LyzFEYoCMzBVYF3WVSn/mCjOMEY39EdkMKG6i+a3dMFPpMAxEobDGnKFUeGIFlmdieUPtVjGzw6vNm0OzaDfmxjpEw33DUeTussiGKSSamt1uCn8UWKWyARMTB2UjvZHMY8wCEo0MzvFmNqmeJfQoiQ3HLvwqSBSmIbZIvoDZvBOCTtHe7taVl3YoPl280/XGGDFoxOmk1SUI4ogmg7/6nQ4DYPVmyrC9T/3rRF/JQh5sjNhDoTSaxqrly1WNMOsXPA== 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=u/ZDtX2BkysGxJ2ScBhNQ9MWWpo4etrvQpMjxVjEk3Q=; b=ElkzTPH7spzZR0Vd9sXrFJHBqKkVHsfh31epuSSD/UYp5Q3y39poNUukSCTDBzjw7eqlOKUHfTpXJUCBCQJ3AS/xDRcluzALmqRZwol6rbFXVVbZC+bNabg7A9V2hPtjorIw+kZ801dwrMp5g/R9oQQR6wnlZ9r2kfUFATA5ktZRtDzzAhAoDsPWUZqeaf+ZosuzPvw+P6SCZUE7GuHIKQmx/HAQQ8UBA91b4nIHtkbiBFaMh2j+RE2zlzUM3D7hrkCLpwcWASwMUldpsC+zlqtgBnJSP9A6YVnQpvrQLDJIk1TUhoGB/F9ILNroD+rd2KiFwOZGkRxaQyq62r8InA== 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:39 +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:39 +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 3/7] dt-bindings: net: Add DT bindings for DWMAC on NXP S32G/R SoCs Thread-Topic: [PATCH v2 3/7] dt-bindings: net: Add DT bindings for DWMAC on NXP S32G/R SoCs Thread-Index: Adrxtw3iVWAiNiK/RnOHrO7OVzo9Nw== Date: Sun, 18 Aug 2024 21:50:39 +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: 5413048a-27d7-41ce-d5f8-08dcbfcfcca6 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: mvr9iYM4Stou2a4MSU+bmB9qMKWmWijYChDVUhmV4AU97SITtEA3STJqpcHvxFWAuTVvfl+HtRDqFsfT2eIvoO+a9mAf4hSbm/BY3SoOG3gxqAIWU3hSdqH8xnsAw8XtOyZrmRGB1/4yOGwMB7ZqSYW95Sbl2K3HmJSzjj3piN++EyNEG08H3hNoa7MoWB1yRWRsG5G4IVO8AS8H3hPrj73Wqr26EZex4puUPDIIbGvp5FHfQnxxezyqMNPTCkn+KHmn6X47XMr9xY6ciiT+9guSwSv0lZsIbgYadIGd9S1Hd4bLmS7yCprQ0+RBiMgiYI41P3KFVvbdZ64V52Yh2OW+xsdXw0Cv923QW6CK9iV3H0alsVVHyEd1d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V: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: UjwtStTbFOiKFkNB+DhtKAz9/0tyqHCqCnSvcz1ICpvc0mt2iIxRMfqpiHHJQcN/g25kh//yT0s1EOZAnVSyoFQEJYS9zIVo5LNXunaUth8hz+lQ9j+/vUlQj4mRi2qF8leQwuoGnSQGeuZZxTXudDi2WVCmZhoIXKFeAWgJMXO+OHzFPv7L8G7/FkWflqfrcjw1y3x6agS5gKpl+VkMiYtJ5vXIWxg96HVMmW4HRGLQO4/R1Gcav2tRJuu9okaxU9XF70vYq4Khtgo+EOCv99tCMoA35aniTCvu0KJGt/qXEm2dgLGSLXAry2dNpmuDa2f+rwGaJxPK2Nya0Kq6UDVbAlJVW1O0SM1agq47css65Ft0sJz/snXDfVai2qayQnjzCKl8vMh/le1+nGg0V/3W5JrSYGs+EfsejD8NsfEqqc5TPT530rYR6cjzOHQ9YVksHoWsXxn+b0KqxUZDMTZD3fvaQMlth23KlalBIJBL9QcVBLOxJ4icnPfvD25nrR57YNoAAm674O6n38BSrYfJzTvov2POh7/xAwyGzdQjdtgWI/uoslJgITZ9EsLiSa7ntLVt992bzD8+kwxaD+zB5urSJoNiU7hw+nN9AygVklfpFuF6s6cmL5xSD3e4rD3j84T6tUpHxgP/wYp17UzHLijnWN/0TNp6YuQ/m80miLFYyFaTOpiWQhh1+EheuaUs+jmt0loavNDmhATP+GHi+W2b86Qj0/VBIY76k8/tNoLbUioH9YVmdNZQg2UR24IbRFlOumqudSVOJLlCJ11QRR8nQYqh4F+8M22c4/Q1Pu9CFUrl4XCHV+dS6bYAsDWc1bqD00aKMR0kbLnC9/72ic33VSLZXTb2mzpWs7Wfnj+pbP1gI1W1htdttYM4WDauhnSMemR2fmNVdCxxw8RHHtWRgNjTruSUg6gp8cf4HaeolDScJrCI6o2Pp7jnrMQ0wUWRuFMzug1SXOxCKZqPH38JXVvwjoZqFms5C+/cCYU5GIAd+DuRqOPT85mJNT6S0gLQ+pFPEGOSIXuuUZq4bCVMdWN9AAwQ4GCLXCObuAMeIos7CftNh66bMSl4RYEzLmdRSoCJ0Q9NVpNe7kqGd0kPC8ElgOeXSt1tfQSzW0vKwdX2ch/L1qrpVTBsyJMcOCPdyTxaUsK9pW35kaRopgytBd2eHkNIagOQJWv4siU6hmBIkIPko3pQ1hpQpXvoEeVkp6A6GqUSd4yP7lax/+pdNnoaAAnkhhwrYr64VWnxfxImRGfxFoow0S1jGzC4sZJGAvstxVQVwVur43EsJzwOzHAas8WMZcU8s1Oy4YImXi/7fEUqi20tt2yGfTbElq2aMKPKAxix+gmvwLB33S0lBUFOOzxn8JiRVJPFykmxrrX/PFucMHukO8RmipZk7hISyNbF9do8wi1s5+IP+I/JeS7Ts/dp9reTWyPXAUFxBwj5AE8VnF7SCoBgrcXPa8el8/Ye3qSPzHtYR/rj0mmh86qzrXCGkPU7lP1JHZaH/e1w8pmoe5ctfBbv0ADMNjuTSsHB/+LDSvg6OwWAxj9y8Ta68AwXnI2TJaXru0LNDDYoOBqLAt16bmua Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 5413048a-27d7-41ce-d5f8-08dcbfcfcca6 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:39.1807 (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: JrljW79P3vm0Uv57aUihAh71LrpG9k/jL3E8QtRU68CF/ZNNFtlxj81ajZPPuOV9fFUMSy0YKqEbpiuMvQU3EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 Add basic description for DWMAC ethernet IP on NXP S32G2xx, S32G3xx and S32R45 automotive series SoCs. Signed-off-by: Jan Petrous (OSS) --- .../bindings/net/nxp,s32cc-dwmac.yaml | 127 ++++++++++++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 1 + 2 files changed, 128 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml diff --git a/Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml b/Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml new file mode 100644 index 000000000000..443ad918a9a5 --- /dev/null +++ b/Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml @@ -0,0 +1,127 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright 2021-2024 NXP +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/nxp,s32cc-dwmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP S32G2xx/S32G3xx/S32R45 GMAC ethernet controller + +maintainers: + - Jan Petrous (OSS) + +description: | + This device is a platform glue layer for stmmac. + Please see snps,dwmac.yaml for the other unchanged properties. + +properties: + compatible: + enum: + - nxp,s32g2-dwmac + - nxp,s32g3-dwmac + - nxp,s32r45-dwmac + + reg: + items: + - description: Main GMAC registers + - description: GMAC PHY mode control register + + interrupts: + description: Common GMAC interrupt + + interrupt-names: + const: macirq + + clocks: + items: + - description: Main GMAC clock + - description: Transmit clock + - description: Receive clock + - description: PTP reference clock + + clock-names: + items: + - const: stmmaceth + - const: tx + - const: rx + - const: ptp_ref + +required: + - compatible + - reg + - interrupts + - interrupt-names + - clocks + - clock-names + - phy-mode + +allOf: + - $ref: snps,dwmac.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + bus { + #address-cells = <2>; + #size-cells = <2>; + + ethernet@4033c000 { + compatible = "nxp,s32cc-dwmac"; + reg = <0x0 0x4033c000 0x0 0x2000>, /* gmac IP */ + <0x0 0x4007c004 0x0 0x4>; /* GMAC_0_CTRL_STS */ + interrupt-parent = <&gic>; + interrupts = ; + interrupt-names = "macirq"; + snps,mtl-rx-config = <&mtl_rx_setup>; + snps,mtl-tx-config = <&mtl_tx_setup>; + clocks = <&clks 24>, <&clks 17>, <&clks 16>, <&clks 15>; + clock-names = "stmmaceth", "tx", "rx", "ptp_ref"; + phy-mode = "rgmii-id"; + phy-handle = <&phy0>; + + mtl_rx_setup: rx-queues-config { + snps,rx-queues-to-use = <5>; + + queue0 { + }; + queue1 { + }; + queue2 { + }; + queue3 { + }; + queue4 { + }; + }; + + mtl_tx_setup: tx-queues-config { + snps,tx-queues-to-use = <5>; + + queue0 { + }; + queue1 { + }; + queue2 { + }; + queue3 { + }; + queue4 { + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + + phy0: ethernet-phy@0 { + reg = <0>; + }; + + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index 3eb65e63fdae..3311438f67ee 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -66,6 +66,7 @@ properties: - ingenic,x2000-mac - loongson,ls2k-dwmac - loongson,ls7a-dwmac + - nxp,s32cc-dwmac - qcom,qcs404-ethqos - qcom,sa8775p-ethqos - qcom,sc8280xp-ethqos From patchwork Sun Aug 18 21:50:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767628 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011033.outbound.protection.outlook.com [52.101.70.33]) (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 7D1F2155C94; Sun, 18 Aug 2024 21:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.33 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017851; cv=fail; b=E5r0wf6GFj7hHWUelHYilAWrCrV9EuBdYqMj/Om9z6EGwYDvchbjOmk3GBseyWm8/rTlxicrgmmRqi2VzeTfih8XD4MhPuTjMYJJwXTBCas5j497eLB0GR1CcvhH9BL9nS2nxplrwb4Kp8KZmN8yhBqzaStSL7YZt+pcx13Dy8I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017851; c=relaxed/simple; bh=oKCfR80I+yFW/sz7oErM3eB1fSK/+A8xK2voiyyop9A=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=YRJaTS5NsdQtYKw/1YCykE1npxTF2zhFaZe7BxyHLhElWXrorjPWJh1T/GFzb7/oUfi8SuEYbg/OLC6GRU9lyFdxwszQYfijfM19x70qDyS4qUPUSPXwj6IPUi+D67MNPMUo2xDg/OHBdmsINrK2c2B55+ecCC5RdU1UB7G/nDI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=NNIyv90a; arc=fail smtp.client-ip=52.101.70.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="NNIyv90a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NvRUlX0RkHA2ao1gWY+5I6Bii6HrmeWanIoxH+u/GiUMXZQNZdL2ICBE8HcrXVyoKMrrd5MJfoOEiISru85nPzaucb78FAXRtSG8Hkb1/z0SkVTV1yRg/dZCMGSGQnWMROPJe+chBFjo1FdU+sjFEYXu1RYsW5wf4ThQemCEI3DPmq48IsAoTcx2LRDrXEH2w/4ufbRGc/0oRMMK7ataSFELFazcfro3Njd6kjgzK6rqsw88mHSdWBfmFAJgxoIPHKTn8geelrZ7sbdinViOKWX72HmTus5dNfhBrRJBaVYDvcekJS8LN6EIAMWX/Qsoh4pNOpmz1Mk9Kfh9zWBnDg== 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=1e/A8FIZQaHkh4tVpBQ6ccEOQsPH2pXsQibQfnMmdmI=; b=e3R78aiLToc4B36ffEl9NKXpPmuM9fdpJuYj3lzWpprfuIo2Tt4bjqvQ1Ddn8vWiRY6D2gzRjfjfyLOUpgEOjgcP5sAKKwTFVu+2fZ/8TKb7w1ciAqwOpP3VvQv0dCKOTHzhS9/IuZnQshwMUCXz+PMm72SZ4pLG+wozL/xyAdmNiwhvgGsPlHnosTqUhNjO37XDyo6RFwDlXrDLRk4qyk7ZxOiaykyOa5iKfuC6PMs5p1xwhsvP2PLCOvIQzc2ov10jwMVIkrxfQg1ejhoKZSwLr3Hq/WuXfQEbr9ubak7auh8y5d0gY0Wxkmw0bFGSKVmmnrMNbIy2FeRI59DsRQ== 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=1e/A8FIZQaHkh4tVpBQ6ccEOQsPH2pXsQibQfnMmdmI=; b=NNIyv90a857Mrd867rkxkZcOfOB9hF90ZFXushMu8/R7dAzR32VCu1Jb64doBCWiGfkixoEjz+GAdtVPWh/8MjZciLRES1we2XZgHALZy2xRzssQd80hB5UVvu1++2iN7ly84Ic2P8p38V3uxJIIlWHMJfL1Yv4JQ4KrGj8mkzrbNvlkb/cAoc3QY9dNh8IHc+ujk6addz6rgGRaGLWL7EPakA4T306ZQ+Ix1TsCE56Ng/o9ssVmSURksgx6u+kh42/gWJY4BUW1bvAjg+Qx+KKCcpniJyPh4ryxu672bl/8PnkRawJ/D+VRuJ+CqwD4liwUaTI5iBz0uqM3BwVevw== 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:46 +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:46 +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 4/7] net: phy: add helper for mapping RGMII link speed to clock rate Thread-Topic: [PATCH v2 4/7] net: phy: add helper for mapping RGMII link speed to clock rate Thread-Index: AdrxtrnuvZ0fK2vxTE+ePeStPoNIVA== Date: Sun, 18 Aug 2024 21:50:46 +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: 43ef6c50-52ec-486f-5685-08dcbfcfd11f 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: N0UMW6KWNyfrNo9lhb3klqJAMOwBnKTNKddbftNb0S2Gh3rrNelzUntAk/7f1BI2w3I0ecJ039DeDeuUE6OgwUGsQzJZY66qKjIc/bTm9H6cjBM6ZWSUuDdB0/YGF+DNp3UkBg/huGkoi0eTJO/G3LNYWGY+Nm9zRIwmNoymhy+TnitzbAshA6z2/nBevzdbxTQ0c9EKbe5fxeSu1iE2KCpNKVfnrVYdE2RNng3eGv+xlflhovi4k/ejLOXJ3yUpZXzdgzxP6hu7QtlaLRjRx3nwAX+3wFbR6Z/wg4dAo7rkCHewYzsvJn7cIbtQgv1OZXkjsNfjpIay44CklO3qyPrLl6f13Jbmt6YQTjgvQdBy4EC+uMbQQUO0UiEmkVr35XwCLH99ZDF1wNVQCjxeMvsr/ZdhVyLEFjmeYHsFyjoWia15BkAsP1KAkQdbCKf0cCI+sFqEjNbHw6qSjEcFe06YC44jCPXq85F7XJtcpDtBMFvLe319jKXThQLQbG4eqWj0HLIZfv9QHWlutBem+1pg2mzU50bvpbTST7LTxitflY3hY41GbP6GTKQeQoJ0UUIe/3OMECcc2z75h5vhocyUeEhnEtM0lFoR01+l/DioKnuC0mUCoIqXksAlJJZW56277zyvak+HOi5oR4dTgm6yczxa67g26S1bRAmA42lXXUVl0K/Fne/7IyCQIqfLo0rONlhh9rl480KFsyNXweW10WOibiICex/uvwWnk7PpmV4j5FgKhBgOxtz0XZKquAfHNVLIL/0IvhXuDbayyFn4jkldM86arMNMU7vosTrdd05ehN4xE7H5AyHUrZ84fy8s9DmcOCbRQ0SVpJIPastMhKNpfzMjg79d85Jr9bm40jDmWLK4fsK5shbmxZ8UCfBSSgjnuEQnC/7IGpuQpM5zyWUTy2YZdnqte02zdPp8EqdiS/FrVNONiCQb9l+yfkDTUuO2pFBoeErT8gwAxCbZqhe4f8Hrz47q9zNejRcUnjZGEaE8gj63dRlVF9NQMImlq/A+jcErphJ1hYiRjHO3nwIhjR2RRDvpi74CI8/kgLNvFooWJwpAFEqcp3sTsoXhFd62Gd4Newb2MfGWstNvmJfLeR6X1euIQidYjCUFkZH8fSqmJeUovfktb1zkfYCqu1ZIR7AsZ0dsaQnVfscD24b9U6PirMHWmBc0zAcnl+b9gGTOoQWO4q9m5xN5rgdas64vSgIbiSMcGpl1Cu8hh/t9UPvm+bg+LjxVckclAn8vRZiSci1lmmK2y7S8JNVIRK2gq2nd6LNDMgexrb6LpqsY5hLFEiTFjByJsq2xSnPHF/uAUomxr7N0Esuu+GKqkaLeAbuNlzB4Ug7o53njAwpeZfph/93lzPty0BiaWP/vsbwmrGC5N1T4ukneTk9RW8Ych7hJMg41idhELp6q9qJxL5LhGKZy4viRDZY= 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: 54r+n8AWobCR+WLHZTmEVnPjPxetnWicclmcnYcvmB3LGl7Hjr8XgfSrYxqxsrdI1y+b4+zTAEhWTV7kcXN7/NAfDIRLDdvHm0OS82stAxhbzufv9eYftJNuaWeOiDi9CXIyWvoCFWymRTAqr0u5QCVQodC6jLX6io2zb1jzEFwjw91KOvIdfw98EEQSjzm0jlLZBgujA9qOK11Jbjq8qrMf6fa6XFOpSBEQnMFenhajljkgqapa+lldVCDK8NXpS4lXHoJjtYPxzXkFldnqhAgr7ebI44bnacFoNR+v1+C2vM0YmA2ukUr4uwBY9WWXOJEPatMo84rtCd8DzBhnqcv5fgdrVmH/pVRjZi9o/JDuexq0xQAEwRK7huURMJpTYWMt+XxbBjfIBQwm9Ar5j0qw4nxblU1CkkuuMciljh1n9DKO0eCRjoHi3lXpdInLuU0356JgppdzUORhWMD8Sj9BQKPbP5+dCGTPo+e/5RF+01DmqQ/Q/0iSs5V96ctOfReM9KKjCPNwGDSOMF8ZDjHCVg8ANsRrvGbepFJnKjiqbRRzcRyCPaSDkRdEOlzj/MfD0ZcjOxpwjX/wGvZD0/yBXGyGYeh7f1id5v3UiIxgVDyaQZ9ElfkAZAGCSZvF9eGiM+ro2SB1GSoz6dpKUA5DjeULGh1Ns/iV0UIePB4B4LbLf6zEzscVvFmOtgDQkXH5U0ZukoTOdp+1WhieFEiQ362z7gTiU5ny7gJl1or/S9PzC0tpCaMgONjtSPZ98wGFfg8PViqV7HCj4jdNESpqDkeGr+yH1uJdz6sfBDcCMmjbv+dUo5JaiwUN45ahPKkRuBQopeexALyYwenlYq1ef+smEGIUndQBrf2fPvDKJAe7+mcCGWR7IG72Mac3Nig8BgoaFpNmBnCMhXibVb9VlpSz8NeoUIVUUF0KyAVfO2FJDEWfHRdZVXXUyNwdecfumAG6YdCORjVwrVJi4VruJZ/xbBlRGTrWMuZR2odzMLgbYEu0bz6zf0OXl3bqDB00pqRfI6BHHLoprl8ym6uoCXDQQHjHgA4FARasv2/asMbhyJsjqtMAQ1D7S/q185E/EXpx56FRtrt/Ud578RVzbSpTNzXHdTYNTsatGt1OM5cmz0ORCYfGDjEDJ4KckgGecmbUOIxorH71n28G2+UvsgSp7R8sG/9I1dYkmVqA8dUOuPrC4ioegof1J0dqIEJSpPM7/KuXMrqCAeRdE4shUM83Lz6jh/JJGGtAVd95AHFtzoTO3iIjhlDML9pkJ3YIYWLFf71bqsJBm+gRtRl0BlMMkhDqHYQ1qi6Sm+0CQLQUL7khu9UlD8zshMnW4DUY7bnnjHtTwt5UUNWMQsDjnM1AicjBGwXrWWuBg35fP1Y5597P64OnBw4JDi7KP43hQ0/TEE5Ftf47yVJDYRucXlxLSdTe2F17EjyzhSxA7CZ1ls+QBqTcobmwpG334Z45dMxUOojQrLPTKYus2tKiBirA0Qd9VcpPmEOXtO0VuRZYmemC9MjyFQbHsRU6V0Zo5498q56Sj+T6Oxfv4lCDEcjeXwG9wH4/8Y1F+fttdnBgrLaVmsaCUfjNLK4B Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 43ef6c50-52ec-486f-5685-08dcbfcfd11f X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:46.7086 (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: dYnMJQKRu2R9yba/XVzKGbWBgtGQpkxcjMXj3M1vebvWNNW+eCLJj+KOtO/drU/XWoIMnDowEdeBeb9zd9+L0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 The helper rgmii_clock() implemented Russel's hint during stmmac glue driver review: --- We seem to have multiple cases of very similar logic in lots of stmmac platform drivers, and I think it's about time we said no more to this. So, what I think we should do is as follows: add the following helper - either in stmmac, or more generically (phylib? - in which case its name will need changing.) static long stmmac_get_rgmii_clock(int speed) { switch (speed) { case SPEED_10: return 2500000; case SPEED_100: return 25000000; case SPEED_1000: return 125000000; default: return -ENVAL; } } Then, this can become: long tx_clk_rate; ... tx_clk_rate = stmmac_get_rgmii_clock(speed); if (tx_clk_rate < 0) { dev_err(gmac->dev, "Unsupported/Invalid speed: %d\n", speed); return; } ret = clk_set_rate(gmac->tx_clk, tx_clk_rate); --- Signed-off-by: Jan Petrous (OSS) --- include/linux/phy.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/phy.h b/include/linux/phy.h index 6b7d40d49129..bb797364d91c 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -298,6 +298,27 @@ static inline const char *phy_modes(phy_interface_t interface) } } +/** + * rgmi_clock - map link speed to the clock rate + * @speed: link speed value + * + * Description: maps RGMII supported link speeds + * into the clock rates. + */ +static inline long rgmii_clock(int speed) +{ + switch (speed) { + case SPEED_10: + return 2500000; + case SPEED_100: + return 25000000; + case SPEED_1000: + return 125000000; + default: + return -EINVAL; + } +} + #define PHY_INIT_TIMEOUT 100000 #define PHY_FORCE_TIMEOUT 10 From patchwork Sun Aug 18 21:50:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767629 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011029.outbound.protection.outlook.com [52.101.70.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 245F6158DA9; Sun, 18 Aug 2024 21:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.29 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017860; cv=fail; b=FGQEr4Px5Gq5Ov4rdnj6oBgySlNU+WxnK0L6KdPtnE+lB7ueaKUl2J8N2oG3bbkuVOZXYwqAeANjFlMJTkzPMJ0RIaj0hyuri1wN2GLMEe/n9EcRdPyA5Dle3xeIMngNYqBxU7OL2IvAEqQhww2HPBP2sgykfCiNV+B/UMOCk5Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017860; c=relaxed/simple; bh=Ke2PYi5lHotnYKyHRsQLvOqtsjVFqVnn4pjZH9ypI8o=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=gAnQ1xNTmbEw5OnJU6n6tXT7LhPeQ0ICW2oA+Gala6eTWflFPL7si2Ye2K1Np5zIjYhC1BqAbFZEDchDAjPkl1tCDuVMrOoM9SfB5Vt/EgY07CVwotDgKGUZr4pxzTlHEzip0ctDZOKT8k9oaLQMC27uL9C0kX0LLgXpGPKQYSw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=kkx4gYUv; arc=fail smtp.client-ip=52.101.70.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="kkx4gYUv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=glhbd4ZT6H4F0mLAK5h1iT/cN2whUIEPxgOF6YPb/lNinTD7UJDeH41bEioClBrbtAU8HmKGZArFYhMVxK2E08b9z0qy3ogaV0tOX18RFEZyWl2xvl4/eKPyvAZQeC9YJ7iHg5vN4lxMUJkdhHxcLlsRAHXtlL55lEXiJecSdOrHceeGqasbpnYoj29U/ZAJCn2Ua/jlgUvj9/0mp6n12UiiDgph6lGYwkd0zVeio3/BSsPjJb/CfiGHOXz8Ks8xGR0vK1FSLdub9jDi9lF5g8ZZF5Y3k2SezqnXVGn6hhmawbFrnA0oMQqouTI3uRp2scs/HUktRlUev4qncRG2Rg== 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=riL7IzsqVcPW/+gfOKKOOovR33BBnPDeeIsjyUQFllo=; b=ywMkxmsO80bfH/oJkvoI2QlUnHcCDgKYBc67a9KfKFd50ydJtXc1Gx2CmK9rEoAU/jnLJUaWtD+N1roKfxk/2ivmd/RK5zALLneTDu35sYsDHWBk5eOII1uYVcb96PwbX8Eqfpqb9XeN+X5J/EbJEEr6UQg0Fr2NeGbRw++n2AbRm104OiQ3XlakBJvv+FUD7crNZAFd14BsLdpch2ZzWR5RLgxoXH32LN5CIkAjfIFCggtaN3AMrFMzkuWaW3HjHMwz42A0NFiAN2Nr10NdbIMx/LwVDbnilSwFBJ1437usJFBjtLmuFp6OPKYpZYNsqB7GJQQcSL0qL4fC8UBkbw== 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=riL7IzsqVcPW/+gfOKKOOovR33BBnPDeeIsjyUQFllo=; b=kkx4gYUv+Z+TCEhnR4L02by23YhHvtOpFWjaJzzf1bXTqvKmWkNEzMRsUGI3KV3pM+UXWZPSiL61gGPWijPM3+ZeSa0gydr++qTo3VxzNicJyOOlqRi1wgsyTlZBUAX6jLYOU//xQGmuSHPnD/Sr7bj16m02XCD6/BxwKXHL2DBYsp1xNlW4gqaTQSItvlHIH0Bd44e+peRBQE0wE4UiNuXK/it2SafgJw9X3RaW6yIuSdz8LY+Ute8Y2/9S7SX2u0MXTZP0PIIzfq6/w/LWUvXwpL8CKm5gfW4URMkvyaWYBiFxxNOklQkWBs0O3GZ2brqsFJLtrdEojoGZ5xBsEg== 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:55 +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:55 +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 5/7] net: stmmac: dwmac-s32cc: add basic NXP S32G/S32R glue driver Thread-Topic: [PATCH v2 5/7] net: stmmac: dwmac-s32cc: add basic NXP S32G/S32R glue driver Thread-Index: Adrxt8FapI9v/GsDS1qUz5lqcPWX/w== Date: Sun, 18 Aug 2024 21:50:55 +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: 55e642c0-b11a-412e-f0fb-08dcbfcfd626 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: qJQ5+gIBahzx5n+AdsNpNrHR6qnmfj0zIEsPfARewhVEnF2zpkcQZwmMy1TFHM8NswU6n1+n6PO9dKnEwgGsMzgghPbFX6DxM628dATJTXLoUZD17NT5jfO6kzeAKz45V2uMpuHAbLcQD53h9apSJWRbLuOniE0BjCdmAAePgljxjsQuY+S0LJgtUzXCDESHOJJ+zs5r/78EmPRaxGFFbKHREeuClB8V+SWzdfE6BaNg4TafbCIX5FjUpbDHWunG3mI1PJBjx+paqVvgkUp05f0qCjke6yXMr9XleP+fE+Tb7TYBDDNpGyX9YLFLLKlZt8NielIy3c6AzbN0OfJo495iIaLXWbyTkXHnwAoDe0eLBZ8Hh75wC04eQloQa1EwAuu98rFR74xFfPzRtcyvc8FGnrNvYwv6fm/pUh6Epa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;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: fDSTZxICpWMQBE//pcGu0AXTZzGOXWedKjhmd6Ch1C34dyBGeirlSwSd0fiQes3ygErCQueFs5aExnqBbV4fm2A8sup224Wz+kMgduxvZxFW6pLcc8dPsglkNRQo5VtmbKFR4eYU3jXSvh9+vhuQk/A9AyO2To3Eg6DbjYCSS6BO9bTtlQJ9wit+ynV61lZNsgTmV9MyEzivEJtcRwh0AL5azPqYvNnPKpJwXs3RE043SmGrA0TPNl6yKQywOlbBqLg2z9pD7Uci7taCSNoDvuoimVfiiKkzJ7diVlbRi5GAJVkC+PeuGcEjd6twTy+vnboC/HCb5ktmNXA3M0nFfn0HUn3yrPAMEF8W9ztFyXCnZi7/D5zXEHMp+aNS+e3sFfs+8kiOzPytc2H4Ir/ZMiegqK5XmiOM7jXF+qMmbg8hGFD6ZX63F7gXh2kKHRzyKbh7ZbNuAOZv+lmvmG/m1m/I95y54ClrOKD5TmxQlrMdjDN5hqnZULhXphVs2Q73Kn+tqs+yZEoK3GLuWgyAYp8dwiMv8YtUrGFKUlSsW5zbLj4NOQ6Cudl9Hka8LbzznoOjtG2AvQIE03SGgaHtdSUhhC8xCEo5NSbwts+dzigNk0dQYYtU7t2XR4K9yQ2HW4ZalcQKZu4rQsVxxGK1V8QSmBZ58Dz1YQnMjdxlPjzX/V8kt3tu/PLd3QIIYJxDXYciEYchMPThoqumFD95iUW5BhVBRTP8lGw2C3jH7AeuOL82wPG8RR6zD3CuBd5ydeSnmeQnVnElJ1eqx1XvkuqsR4HdSLgT6FotADu8g9ArK2/mzCW8hsQg+KiDATUVjf8aPYFhQh/Nw4cCVy/78xz29dRsY05N9PmNQgHokgf6xJ/e0nknFqt1vE/pYgOpEaY9M/vj7TqJCxg/c3y1LAcHF1Byr6RqZnF1ZfpABJFy8Fh6O6+DYdecrychDRS+QeImvQPA0fD50HtVoal+9jK8ZPpJzI3dVyq+V/6E+0cz7XWOHTJhwb04UNXdAlAqUvYlQ/ocXYyY87ZwKrLXq+lk820b704lLPXZuhN1h9VNONI4HlD4gnGaUYBiw2ybj9mbvahwVzzW7TwgPex3D8nI4wju1eMIPqSCKnIT99k3YTicluN6UC43UKeOb2JJ/gtwMs6u9SM7jpkKnK1VGQjlvuJim0qNxK6SPf0i7JRTywy9/U0OUg6j9hLh4yXPHK+F7kFnCibOQw15lNur5nAbF4GCSBbj5Z9Pk//IeD90SubqT1mugnveUQco+EYvr6LYmi/U16arGCN/3/wNkgOoDA+936m2clufbdfjmR6d3tkd35i90RMjJyvLCePSnkz4pCrGEbEkFWQf0FT+nY/pF3gkifBi1pjeTpMIcMW6PijzU9wNWkW3MgfRNYrKgUhhXa0MzQhS5iLzB8jFUh8VM2L4CdsKJA1+goyMJMk0ky0VcFIqt8iZyjAqJW5sbkpnBXztUHQosFx7x5Sj0SVyYeVs8gNhNfO3tvabmPEaBqJ0Jh9er9vfmcbhslgp8UyNFi1+hWrFgTDwzBUiKUaeG+AybJnYtNpvybNVlQBAeqbmET2ZbXImilcwIdcu Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: 55e642c0-b11a-412e-f0fb-08dcbfcfd626 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:50:55.1252 (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: ghAcSUHXXNpdfyAp5OZNxsWdj8tOdxQeTe7ARLfykZEfeADjDuzyySYBDgNYqQKoHycY2nfWtZviTrgye+d4SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 NXP S32G2xx/S32G3xx and S32R45 are automotive grade SoCs that integrate one or two Synopsys DWMAC 5.10/5.20 IPs. The basic driver supports only RGMII interface. Signed-off-by: Jan Petrous (OSS) --- drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 + drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + .../net/ethernet/stmicro/stmmac/dwmac-s32cc.c | 235 ++++++++++++++++++ 3 files changed, 248 insertions(+) create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 05cc07b8f48c..b2ba72a0b8dc 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -154,6 +154,18 @@ config DWMAC_RZN1 the stmmac device driver. This support can make use of a custom MII converter PCS device. +config DWMAC_S32CC + tristate "NXP S32G/S32R GMAC support" + default ARCH_S32 + depends on OF && (ARCH_S32 || COMPILE_TEST) + help + Support for ethernet controller on NXP S32CC SOCs. + + This selects NXP SoC glue layer support for the stmmac + device driver. This driver is used for the S32CC series + SOCs GMAC ethernet controller, ie. S32G2xx, S32G3xx and + S32R45. + config DWMAC_SOCFPGA tristate "SOCFPGA dwmac support" default ARCH_INTEL_SOCFPGA diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index c2f0e91f6bf8..089ef3c1c45b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -22,6 +22,7 @@ obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o +obj-$(CONFIG_DWMAC_S32CC) += dwmac-s32cc.o obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c new file mode 100644 index 000000000000..8daa01d01f29 --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * NXP S32G/R GMAC glue layer + * + * Copyright 2019-2024 NXP + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "stmmac_platform.h" + +#define GMAC_TX_RATE_125M 125000000 /* 125MHz */ +#define GMAC_TX_RATE_25M 25000000 /* 25MHz */ +#define GMAC_TX_RATE_2M5 2500000 /* 2.5MHz */ + +/* SoC PHY interface control register */ +#define PHY_INTF_SEL_MII 0x00 +#define PHY_INTF_SEL_SGMII 0x01 +#define PHY_INTF_SEL_RGMII 0x02 +#define PHY_INTF_SEL_RMII 0x08 + +struct s32cc_priv_data { + void __iomem *ioaddr; + void __iomem *ctrl_sts; + struct device *dev; + phy_interface_t intf_mode; + struct clk *tx_clk; + struct clk *rx_clk; + bool rx_clk_enabled; +}; + +static int s32cc_gmac_write_phy_intf_select(struct s32cc_priv_data *gmac) +{ + u32 intf_sel; + + switch (gmac->intf_mode) { + case PHY_INTERFACE_MODE_SGMII: + intf_sel = PHY_INTF_SEL_SGMII; + break; + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_TXID: + case PHY_INTERFACE_MODE_RGMII_RXID: + intf_sel = PHY_INTF_SEL_RGMII; + break; + case PHY_INTERFACE_MODE_RMII: + intf_sel = PHY_INTF_SEL_RMII; + break; + case PHY_INTERFACE_MODE_MII: + intf_sel = PHY_INTF_SEL_MII; + break; + default: + dev_err(gmac->dev, "Unsupported PHY interface: %s\n", + phy_modes(gmac->intf_mode)); + return -EINVAL; + } + + writel(intf_sel, gmac->ctrl_sts); + + dev_dbg(gmac->dev, "PHY mode set to %s\n", phy_modes(gmac->intf_mode)); + + return 0; +} + +static int s32cc_gmac_init(struct platform_device *pdev, void *priv) +{ + struct s32cc_priv_data *gmac = priv; + int ret; + + ret = clk_set_rate(gmac->tx_clk, GMAC_TX_RATE_125M); + if (!ret) + ret = clk_prepare_enable(gmac->tx_clk); + + if (ret) { + dev_err(&pdev->dev, "Can't set tx clock\n"); + return ret; + } + + ret = clk_prepare_enable(gmac->rx_clk); + if (ret) + dev_dbg(&pdev->dev, "Can't set rx, clock source is disabled.\n"); + else + gmac->rx_clk_enabled = true; + + ret = s32cc_gmac_write_phy_intf_select(gmac); + if (ret) { + clk_disable_unprepare(gmac->tx_clk); + if (gmac->rx_clk_enabled) { + clk_disable_unprepare(gmac->rx_clk); + gmac->rx_clk_enabled = false; + } + + dev_err(&pdev->dev, "Can't set PHY interface mode\n"); + return ret; + } + + return 0; +} + +static void s32cc_gmac_exit(struct platform_device *pdev, void *priv) +{ + struct s32cc_priv_data *gmac = priv; + + clk_disable_unprepare(gmac->tx_clk); + + if (gmac->rx_clk_enabled) { + clk_disable_unprepare(gmac->rx_clk); + gmac->rx_clk_enabled = false; + } +} + +static void s32cc_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode) +{ + struct s32cc_priv_data *gmac = priv; + long tx_clk_rate; + int ret; + + if (!gmac->rx_clk_enabled) { + ret = clk_prepare_enable(gmac->rx_clk); + if (ret) { + dev_err(gmac->dev, "Can't set rx clock\n"); + return; + } + dev_dbg(gmac->dev, "rx clock enabled\n"); + gmac->rx_clk_enabled = true; + } + + tx_clk_rate = rgmii_clock(speed); + if (tx_clk_rate < 0) { + dev_err(gmac->dev, "Unsupported/Invalid speed: %d\n", speed); + return; + } + + dev_dbg(gmac->dev, "Set tx clock to %ld Hz\n", tx_clk_rate); + ret = clk_set_rate(gmac->tx_clk, tx_clk_rate); + if (ret) + dev_err(gmac->dev, "Can't set tx clock\n"); +} + +static int s32cc_dwmac_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat; + struct device *dev = &pdev->dev; + struct s32cc_priv_data *gmac; + struct stmmac_resources res; + int ret; + + gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL); + if (!gmac) + return -ENOMEM; + + gmac->dev = &pdev->dev; + + ret = stmmac_get_platform_resources(pdev, &res); + if (ret) + return dev_err_probe(dev, ret, + "Failed to get platform resources\n"); + + plat = devm_stmmac_probe_config_dt(pdev, res.mac); + if (IS_ERR(plat)) + return dev_err_probe(dev, PTR_ERR(plat), + "dt configuration failed\n"); + + /* PHY interface mode control reg */ + gmac->ctrl_sts = devm_platform_get_and_ioremap_resource(pdev, 1, NULL); + if (IS_ERR(gmac->ctrl_sts)) + return dev_err_probe(dev, PTR_ERR(gmac->ctrl_sts), + "S32CC config region is missing\n"); + + /* tx clock */ + gmac->tx_clk = devm_clk_get(&pdev->dev, "tx"); + if (IS_ERR(gmac->tx_clk)) + return dev_err_probe(dev, PTR_ERR(gmac->tx_clk), + "tx clock not found\n"); + + /* rx clock */ + gmac->rx_clk = devm_clk_get(&pdev->dev, "rx"); + if (IS_ERR(gmac->rx_clk)) + return dev_err_probe(dev, PTR_ERR(gmac->rx_clk), + "rx clock not found\n"); + + gmac->intf_mode = plat->phy_interface; + gmac->ioaddr = res.addr; + + /* S32CC core feature set */ + plat->has_gmac4 = true; + plat->pmt = 1; + plat->flags |= STMMAC_FLAG_SPH_DISABLE; + plat->rx_fifo_size = 20480; + plat->tx_fifo_size = 20480; + + plat->init = s32cc_gmac_init; + plat->exit = s32cc_gmac_exit; + plat->fix_mac_speed = s32cc_fix_mac_speed; + + plat->bsp_priv = gmac; + + return stmmac_pltfr_probe(pdev, plat, &res); +} + +static const struct of_device_id s32cc_dwmac_match[] = { + { .compatible = "nxp,s32g2-dwmac" }, + { .compatible = "nxp,s32g3-dwmac" }, + { .compatible = "nxp,s32r45-dwmac" }, + { } +}; +MODULE_DEVICE_TABLE(of, s32cc_dwmac_match); + +static struct platform_driver s32cc_dwmac_driver = { + .probe = s32cc_dwmac_probe, + .remove_new = stmmac_pltfr_remove, + .driver = { + .name = "s32cc-dwmac", + .pm = &stmmac_pltfr_pm_ops, + .of_match_table = s32cc_dwmac_match, + }, +}; +module_platform_driver(s32cc_dwmac_driver); + +MODULE_AUTHOR("Jan Petrous (OSS) "); +MODULE_DESCRIPTION("NXP S32G/R common chassis GMAC driver"); +MODULE_LICENSE("GPL"); + From patchwork Sun Aug 18 21:51:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767636 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010020.outbound.protection.outlook.com [52.101.69.20]) (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 7B64115622E; Sun, 18 Aug 2024 21:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.20 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017901; cv=fail; b=AEZmX0lk+qiv2kaZQjBkajA1vagySQz+0Bsa6n/ueY4Qr+Hl8pI/7ugaiGF8C3X2QlxLLc07IEp1O48zbcMH21uwe6Mx4bVxx64IuasWaAWPK3WZDg/BjxiTMkRR5zx0lQ38NZ0gUtG3yccITCM7sdNBEPE1JzuT8WXrNJRtGx4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017901; c=relaxed/simple; bh=xc1833uow6TZS9SxVD90ZO2PTONyLtHE9saJ8Lbc8O0=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ZdROyINjBNG3wtvgP61NtBjpqi9ZzXvF4YQgDfUayclEfM/E9toLS+o0Mah0JQf8MaC14xxdmEDYDiFjV3iIM2whVfXlLGx8utegZo9KPva+F1+1PnaLewxeDBZ1N4rCIo+CUJDiQv9/0gNB0VbYDcaTxyCpYGMnfx/EuuRHnHA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=EmjBMkaD; arc=fail smtp.client-ip=52.101.69.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="EmjBMkaD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wFq8Hm7d9pQUhCAY5dCab3s3SC2EwUwHLDVjvTsLGz19RYEVRvVEN0sd0ijX0zUbzhavbQID9txcawKkGbjK1ocC4LMrnBl7y6uEfq/UvYuQjYfBXQpTyAUH7fbObcHsw2q252n1b5BkwhpVXb2/++OtviRA8/NI7C6zsh/GZzKZYnXbgVs9BJa6IX0jHpD0CQ2n/bMiFamZeRa2FV4ASK7rKX+iWxdCJc4tHB/kY7kDI+x7KKCtPn2azhx/OmLRE0w7oKKXZ6da2VS93/h0IO338tSdZg+/iGT8r4caFDZedTnWCPH/ucIRaD50/a21hv9Y2wwmkhmLOYoqXWLOKQ== 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=49LtjNIpKPxyY1OYaNx66JFFNLMlW0AMvclijvGrjxE=; b=SZhLjgmyVgko10+ledRy1lGeExgzvC6qrMRT6SppKyHCwj1aLDiE0VqGMjPjHvWVKEeQklmoTFVZfas5WB/ROO7HAP5Io9CR5hmzDCIxOlr75jc5K8mSDAFG6PHaT7F/pCLW5B60JZXbMKfZLHE+Htj/eK2TFujq78nbKmvVqgO0dfdwEz33XGYJ4Tu11Pxc+WYBuUTvHxXF64LDCEo/dqOXDK1n0s39rFHuY8gDGvNu2FuD850rDz6gtVGCrqdAuv+zxTQ6qxeEfirDg1Bycs9rk7EaKD3v2/HMcEb//dxyE0/CPEMLhUViD3Or3zbQwlMDsnWNTemeWEzPzO002Q== 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=49LtjNIpKPxyY1OYaNx66JFFNLMlW0AMvclijvGrjxE=; b=EmjBMkaDmgdNy+ffKJTMYJ/tJVCCeMPmKxAtmLLXu3rrJv9JnJJH/fv3RldkLN1eOJjywwng54amCFwf36IpLun89nhTc03v5mD5JT29ZReLmEBqNprVnm/jJAT3yCVIz14yHCiaLwihBfketWl21g87qEJdVGfiWIffQ7Z9jNylUXk0NXMJTyut71iDzHdKpku9dDlpkFmNfhMutQlysk+dyP8KqnkUIw193h4WTk4g2eX9dfwsyQAts4RhduUy3jiCifm+V1AEM3dSwczDiJceSJV+U30//OO2Y/PoPUGVY8MYsVa3GZNqIiYxAAc5/18zmT2eo2zOd0jZYJz+8A== 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:51:35 +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:51:35 +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 6/7] MAINTAINERS: Add Jan Petrous as the NXP S32G/R DWMAC driver maintainer Thread-Topic: [PATCH v2 6/7] MAINTAINERS: Add Jan Petrous as the NXP S32G/R DWMAC driver maintainer Thread-Index: Adrxt5rDI92WVLvSRZGBnyb4KDvPEA== Date: Sun, 18 Aug 2024 21:51:35 +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: c2d85e3c-ef18-4aff-0913-08dcbfcfee5c 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: yNJIPjAlR6M1BqUprRwkMQdiJOsUr76dy1FKAuWqNwb5D1ltS9I+WstS9GJ6+Ppte9WLUTr7VmM7wsttUMB4pngpVF8Pw2CvMGgVtwH07fLMs9z726mFw3w+XJvVdM8bZ56Va7dHIG4Ni20GU8/hnaxhO4qOCNkzG4VDVl0ii+lpThB8LxUGugFUegI/UfuDEiBRiei+zuzsel3J47YkutiskLBUuocVJL/ShcuKbu5QZRgPOtvionylpB9ptLnO3ss3y8aV88WrpZJ/lMbI221zY87w+Dxcwz6gxG4tSv9kHuRMDhNrrj/ad0GIDWMchN/SO/dYzq0/fRV6ijoKC91lr066wp3gV9vX8L1FtuwZuRPIe/Z5kv7kUyQszwQk7LmJ7HbewYPe82xTi4Rmz7tEiXPHJIuu5q+f+M4MM36E1ZWC6XEFNczSnzUoyLpi1jRqcgnJsTbftq824G5Bg/sdN947C0J76rooZmNnIOFMWIOfO1geEIHtn2Qh9XUA5fyVxlA3eSjVvZZ8w5qoGcyttgBO5axQXu3HbKKpJL4iNhtqfxQo63vP87iwqEHlARIjOB2pu8VbMl/1v0nEdI6kYOurKR/krrNX6FesVfN3wM6/kHBFtxVlBKZ6fYqJ0QX3dqO6UxOCJPrOsxHIVsL6HV3biCt2qS5Tf/GTDw+t8ZihlCfeOBeRfvx67Z3ZXwTsOGxusR+RcWCjMvVxP6csdDhNqMuy1BuPIoBg0vfJhjhQ9gXMtoxzJDQvkhTr8L3vVaf9sxDj6xSmfH8OmhY8T5lAQgEetPi+gNei0tVIuXF1bD2VZvf06Yd2Z7Sh/4FUt9tg/FY69L849vLFxL+v0NGoaGbTooSAVwDyc3WoP+BDRtDCPQZ8y9Cauuwyn6bYyD+Pa4r9cmcYVAJ92Xlzir12ERk46D3huizD2WD7xqFf8CsaptHeUC9IMFzPbqV+dLTZdmZcLO6HzyU9qodeMNN3mVKAr1Oka7FX14vR+ZzYHhf7DkSkgOP7bk/aXtxt8RYgZ4c8pTiEw7B2d5/Oa08aVFZl07DgWBNFSKxBGRv9/A8AcOQVJDI1z5Fi/ep7hgLNYXyNh/Afk14Hj+Dn3xEjhqb3qhk1IXh5TFDAHfJNwhxb9mjyI9yMt8vsI73zrAT3FIrTMklClkhdb78aVc11OXLML4riqGZEraQBxFY6x6J2CS+nqSkxsd+CorSkMYnOfzZjWoj1QGgJrPAC26C+BBSfOYsDDF7XGpceBkbPSShSLAUF6aIrsJ4ucF01jJ5uJjKh3CUJAksn/Qr3sfmBrrNBdO9jyIxqd5kZ2qlwTfvGG6FZokl/2FEByHU0GkcO0eEJwQJxdMwx/mrEcXnVInh8daLHTTKmxGydgVsX5lmoZ3SQFsOIXL57y7UmNbqbhbrGQbZ4syzUP2fmNQQp0XDcmHwm25FUcKc= 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: O31+46uS0VlgrczDTwpXLQShnimZ0SpTod56eVr/GqYktyja0EltoJh+BrB5Jyx8MBwhwl10k0zcWIfxO8LRju1EJimPReOK6mm5n950CnHbZ5TRCxJ8AzC0SFhUUrfcwgd7DmBETt742oiGbf5AOwMwdYsVU8qEYMrJR9z+SxPBRoC6RAuDpFVIWLuEc6vV+l55qZNrSCw2aXB9qp8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XRyDrDm+h53cJ+Frp+aXlsUMMTWOjXku/9Yqmf+Hga0cUinXWd4QpGYrECf6PyBhv5vYkwQWsAC5/zYcozcDr9zZ4ok1AlN9hW1kGxV6VVDATevPojS1bI+mYG4brI7D+T9Gg26syi4wX+oWo1X/quF3rKu3FyXfcVODuPLwTsMPFZuWHBBgTiKnuHZZVqdI1Ct82uG0/pCy5tLsCPicd86RfjQkRaH7hPLmgxUeGAVM3D3oLbZBKCRqD0Orq5/3S0xsJzy+g65HdhE364SglZASqX8upR4vBUxDELwIwjrlNKFM3QqW Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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: c2d85e3c-ef18-4aff-0913-08dcbfcfee5c X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:51:35.7440 (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: ImzLH04iBz7Gx/vZREaF+XDwmKZoIQhEa1CdoeQL6UOdkZj/giPi0K+1BltDj4nDrkBhZwWbnOYzRL1eHMydVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8183 Add myself as NXP S32G/R DWMAC Ethernet driver maintainer. Signed-off-by: Jan Petrous (OSS) --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f328373463b0..372dc4305f9c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2692,6 +2692,13 @@ S: Maintained F: arch/arm64/boot/dts/freescale/s32g*.dts* F: drivers/pinctrl/nxp/ +ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER +M: Jan Petrous +L: NXP S32 Linux Team +S: Maintained +F: Documentation/devicetree/bindings/net/nxp,s32cc-dwmac.yaml +F: drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c + ARM/Orion SoC/Technologic Systems TS-78xx platform support M: Alexander Clouter L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) From patchwork Sun Aug 18 21:52:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous X-Patchwork-Id: 13767637 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012039.outbound.protection.outlook.com [52.101.66.39]) (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 5A219155741; Sun, 18 Aug 2024 21:52:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.39 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017979; cv=fail; b=SA/3sx39158yNXHdHbDI9AZrdggUb5DA2zIWdbLVTEbj6+YxoXnZ4SuaCT1Q2SS/hwqFfDySCqdsalY1gau872FqrefomCE3aeIk3bMn3szE2prazibzeRb84QcxgX0uw9kK93VqPXwcL2MvGcc2RlG+dyNCHygxA0bzKriGHWk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724017979; c=relaxed/simple; bh=J2/b6M2wIRbl0bTlXhn5Uu9a7DjjemTTeRo9tdedMBs=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=TULRvyshv9ZEC9trrhwiOfrG3jvyRZCPBRnkb3o0vjR1LFwugz8IKdNdVBca/XoW3UIAyFq7h9+yZcoB4TRYqKAL53nMZRoDUMzeejmEOGPhTAZFd8i++RvxI5TMqZ8H0yfKgHrgjHOUlTUCIPLzLVvF8hrshiNyvberwQVxs70= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=q5ZjGJ0f; arc=fail smtp.client-ip=52.101.66.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="q5ZjGJ0f" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VQQPOm6D+FbeDxfHcW0jjXeKtlmC9wQeOe7h7Ka/523ukgV4XL4bMtucFm9RFBCpqJ1rice9UCPSshvVcOLi2JQn+/ISptTA5tuoRxmmyf3qeOeI9pVPEcXosn7jFWO+SE6F+urlb0m8iIS77c5FSY09Ewg5e6wvb5hNt9NDQEjdjtAbjoKgGYFckkUB8Trj28Eh01lLzWksluyZ3Piol+So6Qy3bmZynL5aWX1ulYcpFLOIAkyjo49Tb2TjTNvIXZAe4DRlRwmj/R/qSBT8x4Mha4p/+pFC0vmE31c0gs8byjPcc1cMpccslCbZDrpM9lZ7YLqLn75LuS7ePNkQNg== 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=XrgaenJF3Vak4aJ1hkHd01mPCEuY/EYO0gYmy0g+HI0=; b=X7SMj6CjJbW2jyKPDFu5Oiov2XFxBBNxUpeWOD7xQL5hrD+JicxrM3nIru4sjKlUHyuwfnRKYvnIkEQ7arRUvvWQRMC8iFyLdHfiDzxsdkMWtA+onj1Gt+ibji9+NpeCS7smcbP10bxHTNPfj8gt6pVqKTIvM/5YMxGjwu4tcahgo73fofodLxoeUjLUITr8aOEVa4ZXYD219Gyut6+rduFfLDBw/AauPi+oRn7u1S+mNT8snBKh/oGXIecfy3JE7Rq1Vksnl1Jr0GPWRlSyKKn2Eceqh6iopSDu6Jt/s6NbZbOUgKPFNgm0eM/ZeWmylAoMb7Mit3VtOvev+/h1Ig== 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=XrgaenJF3Vak4aJ1hkHd01mPCEuY/EYO0gYmy0g+HI0=; b=q5ZjGJ0fBZEpWW3GVoGJTqwPYIrwrQDpVHQo3yRo3KNqIO1nF2dDdFskYFVlAtEYT4R9gYyIJVx9yBinX18KCCBfoYiwZwcpaL0ZWdACmkPCeGOKQnz6jbhw1h9AVrCJTtSCvLHfHoNkpa4Cnp5D7C0H2h+38vD3zM0cqvyLb2PPtsZt6Lf4Pu9t348eDjX7ZQu10XMOn28J6IjrvG7CMqGYrRoF39idGOQTkDTnY15n4xJDrF+Ac6eULdMd9C0L4A8m19tDzl718jRz7qioL0NPvMgMF37IzpReTuL9cbZ5VnwUtS6loe05xDGfLdnH1z0vaeXIphGD3xkGeG9+6Q== Received: from AM9PR04MB8506.eurprd04.prod.outlook.com (2603:10a6:20b:431::16) by AS5PR04MB9856.eurprd04.prod.outlook.com (2603:10a6:20b:678::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Sun, 18 Aug 2024 21:52:53 +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:52:53 +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 7/7] net: stmmac: dwmac-s32cc: Read PTP clock rate when ready Thread-Topic: [PATCH v2 7/7] net: stmmac: dwmac-s32cc: Read PTP clock rate when ready Thread-Index: Adrxt+I1bcYKj11CSHK5cfqUXnIxlw== Date: Sun, 18 Aug 2024 21:52:53 +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_|AS5PR04MB9856:EE_ x-ms-office365-filtering-correlation-id: 143b2633-3059-4e06-e238-08dcbfd01cbb 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|1800799024|7416014|376014|921020|38070700018; x-microsoft-antispam-message-info: 62f6pI54jnimIx0+UtnIM34bn+/5Ne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OXREid18bC8rndThpwjPY0I+37ItpQR3P4XLm180MfGuehjPghGt3PlUqlRB6DjNzfyXgBPRNjsF6O5kqIi9ymJzcAZcN09XGcskRKx08xNclExwGVa1dr8zQlBUsSWvhASaRDVwsIdUEIFLsEVfbdpYE9j6z9QlZcuHlVtBThPOUomg6IzRa/OulMePyCR1UhpQttA1+LWShcIaD/C48XsDokWo1/SsQmuj/fNxeANTcamGwbFeT4b7UXpgcOpY5wyvkMKAdDKrRA09XmiGeAi8uD0Xkml3sHjjV3AIoUiACbm4Xee9MMWbhLxaFKo= 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)(1800799024)(7416014)(376014)(921020)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: seufR7ruVI/5jIz30dwBZrSRQz1YxTz2LGDqPxtyUgisVsx0FIdT+kISjWl7MB1G+OnSvLvABrkPomrSTfH/10HMoyQsZ/qACzHDzaXAyNH/G1OHMDRGQhKRWpUGKIAYcheFamAXKY7/Uc7PYfU2evpvvk8nfVTGrnPzsI8J9vkJbij2c9Ku5Rezkw0+jGokfKNrB5D5vlR8qENiVevUP4MMKWk8LvAoKR3D62ggKPa9zsTKtDzSbjNfn7SPkaEyadtPk6D8KFdGjPPXAWy9QvaM1gvTiXpqncTdaT3UWwiVsBIYMfqxvd3bm2VDcBiIxJR2Nd6CPF8ct0xEZwUo42m+Xm0P5iAOlb59sQC6cewXABJs26tLSfWU19zr+SaNg7vhgTJzF2w3mGsxHUroI1AsybgnrH/OYenmxgYx0/5L0skhpblX4hb3JPMmO8juhIb7NBObfQbJdWgSv+NYLSYMzS9Fw+Z66UWypkyKNeiRGxeEUqvDYu0aS/FjXrby41c02PwNr6POzkb/6L+G0xnW9ks8hBF8lAx9wZh/aTGD0y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Id: List-Subscribe: List-Unsubscribe: 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: 143b2633-3059-4e06-e238-08dcbfd01cbb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2024 21:52:53.5811 (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: QGu8oogTPlv1mNWXfp7l8IOulCmE+A3sqq0sZCPTnWrFoughJhKtVE0wiy0kDKCkJZEdulYHBePP+lYmK5EQCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS5PR04MB9856 The PTP clock is read by stmmac_platform during DT parse. On S32G/R the clock is not ready and returns 0. Postpone reading of the clock on PTP init. Co-developed-by: Andrei Botila Signed-off-by: Andrei Botila Signed-off-by: Jan Petrous (OSS) Reviewed-by: Jacob Keller --- drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c index 8daa01d01f29..92c51005cbed 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32cc.c @@ -149,6 +149,18 @@ static void s32cc_fix_mac_speed(void *priv, unsigned int speed, unsigned int mod dev_err(gmac->dev, "Can't set tx clock\n"); } +static void s32cc_gmac_ptp_clk_freq_config(struct stmmac_priv *priv) +{ + struct plat_stmmacenet_data *plat = priv->plat; + + if (!plat->clk_ptp_ref) + return; + + plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); + + netdev_dbg(priv->dev, "PTP rate %lu\n", plat->clk_ptp_rate); +} + static int s32cc_dwmac_probe(struct platform_device *pdev) { struct plat_stmmacenet_data *plat; @@ -204,6 +216,7 @@ static int s32cc_dwmac_probe(struct platform_device *pdev) plat->init = s32cc_gmac_init; plat->exit = s32cc_gmac_exit; plat->fix_mac_speed = s32cc_fix_mac_speed; + plat->ptp_clk_freq_config = s32cc_gmac_ptp_clk_freq_config; plat->bsp_priv = gmac;