From nobody Sat Nov 23 20:54:13 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2065.outbound.protection.outlook.com [40.107.20.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7D4B19ADA6; Mon, 11 Nov 2024 11:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324575; cv=fail; b=lIE+aevQSNznvCLf3IVNTcLFQWP7wMTcBXIWXBH28LlJ3D+cuaNVdT4k/6encxkfK2tfjW6CBsJQim6f3C3ZsIKRWEnTPNkNzhSIkGJ5OZWde6ixzKNfbvMGEUniq2i9dJidiCBJPWpN4tG0LM+Wbvq5T9gTc+TGtBgdxlbPNVw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324575; c=relaxed/simple; bh=U3aKSTfkIfX8ziAzTwiXevPZFl/XIYiQaKlBFU2Eamw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=dh7qkReqv4SEbiRYTQe2p41t7xaN0hRJNFBnuKs1yqv+7zzC/PbsA7cj1CZL2xTpHnB+CY4fcHvzYumbrATmHEnU/VFpOMhgwNPRpxgLSep5AnGkMt+owOWPaZPFGK5B3WSqtm8YYb5Hs+no1C44Vh9bC4fQEUIZJn8S2UNtv6I= 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=pk1PJy+8; arc=fail smtp.client-ip=40.107.20.65 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="pk1PJy+8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qtMRg5B50ICl9BfX65vaIlmkRGJpEwlb3JdYnFX3kzYdG/m4owi24x/7Uyfh2ni1l4/KqVXXHdDOg4LIWHtLLgcWll1AneggJzLIy2WIGr7Jo5kRe0umHk+iiJGuP9f38jErCUWgrtajs458TxVuIH2oeMPEWNQM657QVbRZwbwC8OhrQVfDD+kgxjPFiWk4uogV/UhhXdMqAkiuXq/4AuQfUOzWZgxZOqxM3Yk3d8+sMpxw7GirehhJv6KxcNCvyZdmghyxfwEXJvrHkTPOdmd91IUffXswd5rjkMzybS8P5mOUxBbOQ2bv5z2QyYHga7CMDZbVMpxuC4DoH9k7Fg== 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=Vu0oE1GIGr5qQhuxhEibYhKhPHEqwX6ErErQQhbkEp4=; b=uCUFscuCSuE+Gv9eacKaOU91PHbPe8oyQgbuI2SAaHxLgEcSNiiXE+LDnrKmJTTI0PCjLe+Z4gbWCYsasmw0knAYWV2Q2Cn1D4cWW7vEhdxZSWLOBHc4fszec/zrjyo11NiGuXO5xaCFul0ufF1aS5RWkPIgzYUCisCY14f2ZpLLNfVDQS5xbnlJsHgrzo6xai8AT+mgyx+X4s8RJOEpL/p/tsPIgZIpwAGk1nvy1LvtDSpoNsi9KN50YD4bCKXZKJetpnVVqOP6saicQDgW+Etz1d4uRRohaDSXA5nox8eFaEUdtbwW8dRSbJ4p/N6t9WnySvGIT6nNiLi9CNgcXA== 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=Vu0oE1GIGr5qQhuxhEibYhKhPHEqwX6ErErQQhbkEp4=; b=pk1PJy+8ZdafsRdRGdaXOUyjq/W0Llo9hjx+JXmP+XUxaJnVANiAQzjv0qwiKtHD7cUnWA0CAAFmKhbP7Jrz0ubNrZYj2ukXY+YfV80h8Yf2pwHyixGZsq0o0oVQ7BN0mKVLlKqhGzi8f2rQ4kbUMzuPJzcXXndNlG9ZNWRJDiSDTuxPaBl6db8FGwBwvRF9Bgh3RZgcm6/Jw45HSpu1jRb+AF9PKuTQYLKiY6dzn1ywV/XzkUwodwn0zwuBLPZZh/AyyT+lB+xbBR7ePQLtFpblMRgYPWTrYFg7MoNC66S75sVCIgbWrd3GM2oo9zFVxjammptsrlmZAYdkixgZtQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by DB9PR04MB9428.eurprd04.prod.outlook.com (2603:10a6:10:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27; Mon, 11 Nov 2024 11:29:29 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8137.018; Mon, 11 Nov 2024 11:29:29 +0000 From: Ciprian Costea To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, NXP S32 Linux , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v4 1/2] dt-bindings: serial: fsl-linflexuart: add clock definitions Date: Mon, 11 Nov 2024 13:29:20 +0200 Message-ID: <20241111112921.2411242-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111112921.2411242-1-ciprianmarian.costea@oss.nxp.com> References: <20241111112921.2411242-1-ciprianmarian.costea@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS4P190CA0011.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::13) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|DB9PR04MB9428:EE_ X-MS-Office365-Filtering-Correlation-Id: f1d3b5a8-4796-4d74-5880-08dd02441ae8 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|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MzFkdjJvL1JXb2JnNEdKQlRtS3B6KzNOcDd0ZklrejJpZzJkcW1MRVh5Q3hJ?= =?utf-8?B?dFp6Und6S3RTd3FTSkplTFlhbFZHek1tcGhHQTZ1VUhmeGNBc1BlRFBJVWdE?= =?utf-8?B?N0UzWXNnN21BdWJmZzJPM0NOVXFld1ZnU0hjeVJGeVJKb2JpU052c3BOczVK?= =?utf-8?B?VjZNanR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TjNzSUpr?= =?utf-8?B?NDlrajBZcldQMnV2amx0R1FLMWo3ek9rWHo4UUFBUUxLVzVFYnk1cDE5UEUw?= =?utf-8?B?NGxZaFo0Sk1ueU04cEREM0dKTnJ5eFk2bW1VN2NzOEtzb1dUNkoxSUtuQTdT?= =?utf-8?B?UXAwUUJEMDY5WWFGSWhrTStOc1QwR2dLR1NyTVNzbVQwNU5MR1lNSzZ5dlAx?= =?utf-8?B?V01rT2w0aFBzN1FDcEV3Rkk3bmVydkhFN1ZTbG15VGZaWWNYYlV4UUxJUFYw?= =?utf-8?B?UFVQZzRkaHpqbWJBeGprOHdFWDJmV2JMTDc2T05OSENwTldMTXNYc1Jad1d0?= =?utf-8?B?dE8zRFdidEc5aTFjSkNjTjBQajhpWFR2UzFTbXNWTE1WeDBVUTNSS3UrRE9Q?= =?utf-8?B?WDhXMjgzWnJVbUt5UWNTRVVYVDM0OG5jZ0FYTEl2VW1naGVvZ2FqbU9JaDZB?= =?utf-8?B?ZTBic01yMW8wMUkwR0ZVYW5ndzVPdHlWYXJxU0hoQnBTNHBEZVdoaTVHZXRz?= =?utf-8?B?SzdjVGVlWHd5REVDTUVrMEZHYUlhazc2c3JKM3J2dm9GTXJjVitmbnI3ditq?= =?utf-8?B?TldwRVBYY0dNQmFxOVplZXB3d01yVk5zUnF0Q1BEM0NHT3ZMNHRIUVRYdXhE?= =?utf-8?B?Z0g0VUtxbG5iSnVxdlg0b0hIS3VETWQ0RTNGY3hMc2lEQ3Y4bUJ2UUlOTk5s?= =?utf-8?Q?vGVdUfbMnOuX8g8if4iOmeBw1i5rF4nuuJ08mS9?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange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4Rmc2QUFEYVZMSlRiUk5DY2p1Smpxd0R2NGRyalhWVzF6UjUra0gv?= =?utf-8?B?ajVDd2s1NE5qaWVQMENnM3VROHJBb2NORUNrMzBCN0RubnVaTTVQcUwvb2Np?= =?utf-8?B?RjZMN2FGR0FJd0lUbktTRTU2S0tzdkd6ZWFQVUVQV1pnRlZvY3ZtUlIwRFRN?= =?utf-8?B?a1V4YXAzTnpqTnZkOTB0QXlKd05PRUhHejFMd1g4MGtSSit1Y29XU0pZc3Uz?= =?utf-8?B?bnNXM1RiZE1kQkd0VmRVNC9DbFFrY0tjNU9nSktQOC83dlAwVlBwcC9NUG4z?= =?utf-8?B?YkRzWkdSYXZ0YVZ5L2dsSTVNeTU4Y2d1U0h1RTF2c0phZzVyZUh2WHo3Wkhp?= =?utf-8?B?eFQ0ZzNFVzhxK2hvMEpteUU0L0NnKy9oaUxhOHFhQ3ZDVTRYTmlidVArdXNz?= =?utf-8?B?N3c9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1d3b5a8-4796-4d74-5880-08dd02441ae8 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 11:29:29.0263 (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: runY9l9qD5oj2/dBIfyvWlXRNAvaqZBNlcKsJnC8XHWEn6fcy2Y7zen1vdvz1dGLWZQL+cvsJy5DIJJCP0i+JEPxKofARJ3FiE9c1OfSHNM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9428 Content-Type: text/plain; charset="utf-8" From: Ciprian Marian Costea Add clock definitions for NXP LINFlexD UART bindings. The LINFlexD driver was working because the LINFlexD clocks were configured and kept enabled by the downstream bootloader (TF-A [1] and U-Boot [2]). This is not ideal since LINFlexD Linux driver should manage its clocks independently and not rely on a previous bootloader configuration. [1] https://github.com/nxp-auto-linux/arm-trusted-firmware [2] https://github.com/nxp-auto-linux/u-boot Signed-off-by: Ciprian Marian Costea Acked-by: Conor Dooley --- .../bindings/serial/fsl,s32-linflexuart.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.y= aml b/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml index 4171f524a928..ca3146d9b872 100644 --- a/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml +++ b/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml @@ -34,10 +34,24 @@ properties: interrupts: maxItems: 1 =20 + clocks: + items: + - description: + ipg clock drives the access to the LINFlexD + iomapped registers + - description: lin is the frequency of the baud clock + + clock-names: + items: + - const: ipg + - const: lin + required: - compatible - reg - interrupts + - clocks + - clock-names =20 unevaluatedProperties: false =20 @@ -47,4 +61,6 @@ examples: compatible =3D "fsl,s32v234-linflexuart"; reg =3D <0x40053000 0x1000>; interrupts =3D <0 59 4>; + clocks =3D <&clks 132>, <&clks 131>; + clock-names =3D "ipg", "lin"; }; --=20 2.45.2 From nobody Sat Nov 23 20:54:13 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2065.outbound.protection.outlook.com [40.107.20.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9A3619C549; Mon, 11 Nov 2024 11:29:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324578; cv=fail; b=J+QBT5wuCkRDt9CaVjhUBH27AHrPmqKfi7Dyyy4TXFXcDHAGejWjjOQLOtS5uMEqe/4/NwzdPoKxqCor4MhicKs+dNDYu2nNVRrydZNWqdkbUxNRC+SXd1hciQd3Ah7v/tlvAaqd+L+geOtTUFW5g+aYeA81scc/+43+DdC/utc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731324578; c=relaxed/simple; bh=x+SQ4LkHPihEEdpRbCpmHgA0UzGSE+LNZZr9L6b890s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=jhzesQQdiYBcVfOiWJ4uhB7tkBq4IOMmCTcyNKgyNo+SSKUgExkGFJM490FY5UT5VRRD4VXIok0JiSfXjbp07gPYVB8NxcVQ5bfUqMUnqwMvBxdu5ydCwiLH4hZIvUiiQ+9iwy2jW8joK6RjhdM/r6Y0oGl3dtRyqllfSdMifyI= 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=JnHhrxFQ; arc=fail smtp.client-ip=40.107.20.65 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="JnHhrxFQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=unta92UfXOk3/U1c54CVI7zlgPzX+eO6FTX57+BlJtRoIZyMv2fecpwm3Z8eVcVJHCCVaZ46KgkDoQ455aUYDSgL1SIfFctHHNvzNTqmiFQXkPAdTol/BaX/lRQYtg0gxqT2f+gtOlCkLj9yhmKOPrhZT10eD8S3AFWUBWFVZOmI9fgLWnks5bQYXXA9boMGZ1gMHuCUUwRmR3Z1Br+F+IW0gNlxESnMFnn3bMK7r/R6WeOyRjyLG5GsRQMH8R86TdyuLNKCl0soFHnbFGdTHqB7ifec5xQGj5tobePBatZrgQ9fyYMDrlNC7ngvyJ+i1LRQ9+KIzJvsH5LtVY+6Tw== 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=fG+Hj1fahqHiHaIj7XnHjzSDHuLftIqClYYXKEdUchw=; b=IWeRTDlZ6ai0fHQKzX7ylvJ15xNd9jCXEk7dKjQiCMr7X456IoTOD5Vhk1XmtaY/mecnZKERxC7EE2HNJtm2F3CzhflDMqd8lxawTN6SPD5Ind+iLNG7+PgdPC5DC7MsJQPvf5P7CtjFj8N1VjSAj6f8IQthKSGeuCXlhAPnx84P5SAhrMivFwHGHbeRFcyHDelGhWD5p7q35K6jNjbNnomUxt+NY46eoxjCmZA83Ap1UTeX8wSv3hxFgVvCuYov77ePh2wkIxnezVRB0icGNo7hqsBqhbY1H90Hkpe0cl78YX9aZmZUoK7LZ4PSzB6F89VLBx5fKxZY9Hu4Sw8G2Q== 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=fG+Hj1fahqHiHaIj7XnHjzSDHuLftIqClYYXKEdUchw=; b=JnHhrxFQIE21h3NJj2fAU9hrTeIAMoar2Spt3tUL1OiZqHT5fl9BnZr69q/I/uzEKYVySVtFmmSDM/nWBrVq4V7iJp958nQK6y3l5B4noNrTyqhMPEE2KMPMXFgPXcSvpfgCn7zuJZyHmakDgFfCddxA3ZkDogLiaGiP60cF6u5QvKkoNlS62FGX5ZkOtlYTucMKdi1Qp0wM3hEuRwaur4Ygu4qgvEj3KJeOd70K8Rs6th7LtViR+rXEYdqM/qPSV+WsjXs6Zs8sxAUNWyH7CG8Fk20xDPL2bgsUKzj5QFOFf+dxIPm7iUvKGpKisEbn7PtkQFeJVUtK07lliQAeaQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) by DB9PR04MB9428.eurprd04.prod.outlook.com (2603:10a6:10:368::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27; Mon, 11 Nov 2024 11:29:30 +0000 Received: from DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd]) by DU0PR04MB9251.eurprd04.prod.outlook.com ([fe80::708f:69ee:15df:6ebd%6]) with mapi id 15.20.8137.018; Mon, 11 Nov 2024 11:29:30 +0000 From: Ciprian Costea To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, imx@lists.linux.dev, NXP S32 Linux , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v4 2/2] serial: fsl_linflexuart: add clock management Date: Mon, 11 Nov 2024 13:29:21 +0200 Message-ID: <20241111112921.2411242-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241111112921.2411242-1-ciprianmarian.costea@oss.nxp.com> References: <20241111112921.2411242-1-ciprianmarian.costea@oss.nxp.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS4P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::12) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|DB9PR04MB9428:EE_ X-MS-Office365-Filtering-Correlation-Id: aea894f7-ec02-472b-d4e0-08dd02441bea 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|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?Z0w1TG91MDlrRCt6M1FPSzYvek1aUUt0ajQ4dnJsSXRrZjZtTzU0VWhZNUIr?= =?utf-8?B?Q3RTM3k0bjBFU2hEcTcxNmZXMzlNNUQrbVpzMk1qU0hYT3lzUk0zZW92dEhE?= =?utf-8?B?R1kxdXFCK05LWUxST3V1Q3V6elU4d1Q2SDVyb2pxZ0VWd1h2SXpBWm0yd21D?= =?utf-8?B?ZWs0eGNORkpEZzNnRDJ4S1dCMWE1aWNqSzdsRmtBeTVqTEZPTS9tWGc5Wjda?= =?utf-8?B?c0NmRTJNNFlibk90TU1kWGQ2TzlKdm5CZmFFYU1NbEhlQmthVjE1OVlxTEpV?= =?utf-8?B?OXZaczVSQXYvbDdDQnB6cG9sWStRRmdlQ2VSTkFLdWFVd0t0NThMRHlCT3Q3?= =?utf-8?B?TXpoVkFqZWxKbFhweEk0U3ppTk45c1Zza283andYVEIwbWs2eGViQnluRllW?= =?utf-8?B?MkltWWYzVFB4bjU0UHJzUzVzN3k4cWRCTDdBakFnZGwrNVE4Z2QySWV2RXRO?= =?utf-8?B?UEhOS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Nmhtcmx2Y2Fv?= =?utf-8?B?WiswNmpITE1YTTFjTTVMekVjcUlDQlZqOE9LY1dJR200ejdBVmNkYitxRTBD?= =?utf-8?B?dHBwQi94QmNqdXpLSkFuK1ZlNjRKSWFGcTArdVNzb0kwVzFZbUNUUVFOTzU3?= =?utf-8?B?amhsL3ZJT01DdzZEdlZqSGR0U2hRaGpCTDk5eGdxKzl0YWxyRlVhZUl0TDJJ?= =?utf-8?B?eHV1QUd1OGVScTdkeHo2K2NuMnIrREdjKzdLTHlub3RRdGlpYlMrMGpoNW1K?= =?utf-8?B?YU9jUFQrOVZrMzNWdkd0TjI2b0swTGg4Ni9BNm9jSzN0aTlXd0dZYzV0Q2hN?= =?utf-8?B?b2x6SDlMRE4zOXRxamhpaTE4QnNFTG1RZ2N2WFBGOVE4dkRRSk9jcHNkR3NG?= =?utf-8?Q?UVUhOzOi90iin7hDmsgzCdIrVeutMVmiYJDXlox?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9251.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VnhPQThQbXRmT0ZSS3hSeXV6VWdqRnFGaUVjamxFSmFZUWJrQ2xPQmJHUElr?= =?utf-8?B?SGZDQ0VvQThTN25QbG1GS2N2ZHhORVhFR0ZEYSt0MWU1UGFwUUdIYmN3Tk9O?= =?utf-8?B?RHhmZmlLaFF5TnNDWmREU0FVejNieEVsWVVhNnRqMWNtUmxsNzU2aHppZjdx?= =?utf-8?B?c1A1R1lYb21RV0tHU3pnU1N2a25SdXFZa0VvaTFFTWVNejA4VE9nV3NBeFFF?= =?utf-8?B?djVoTHFaanM3RnZmRTFRbzVIMzdMeFVxNFVMamdZUkZ2UExkSnBJamF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dTS3F3T3ZzYzZuOFRiU3M4L2NTQVhsYkFzd2tiYmpBQTZlYlpU?= =?utf-8?B?ZVhIaUQ5b1I1NVc5MklJRjBYamx0QTFNak51YnQweWFpT1R3MVZiSENpZGFB?= =?utf-8?B?RGc9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aea894f7-ec02-472b-d4e0-08dd02441bea X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 11:29:30.7392 (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: THEt37wruZ42uNy2d1igJcI4r8+5dtZls2J6gDGj+xGoKuRz7I8/mv93VK0ESKTAygvqqRr81be2PLgRQX6YfMZzpAbilLa69/qjWQclyKo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9428 Content-Type: text/plain; charset="utf-8" From: Ciprian Marian Costea Add optional clock 'ipg' and 'lin' support to NXP LINFlexD UART driver, which is used by S32G2 and S32G3 SoCs. LINFlex driver should perform clock management and not rely on a previous bootloader configuration. Clocking support is added as optional in order to not break existing support for S32V234 SoC. Therefore, there should be no impact if not providing LINFlexD clocks and continue to rely on a bootloader clock configuration and enablement. Signed-off-by: Ciprian Marian Costea --- drivers/tty/serial/fsl_linflexuart.c | 82 +++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_= linflexuart.c index e972df4b188d..66b822f36d06 100644 --- a/drivers/tty/serial/fsl_linflexuart.c +++ b/drivers/tty/serial/fsl_linflexuart.c @@ -3,9 +3,10 @@ * Freescale LINFlexD UART serial port driver * * Copyright 2012-2016 Freescale Semiconductor, Inc. - * Copyright 2017-2019 NXP + * Copyright 2017-2019, 2024 NXP */ =20 +#include #include #include #include @@ -120,9 +121,29 @@ =20 #define PREINIT_DELAY 2000 /* us */ =20 +struct linflex_devtype_data { + const char * const *clks_names; + int n_clks; +}; + +struct linflex_port { + struct uart_port port; + struct clk_bulk_data *clks; + const struct linflex_devtype_data *devtype_data; +}; + +static const char * const s32v234_clk_names[] =3D { + "ipg", "lin", +}; + +static const struct linflex_devtype_data s32v234_data =3D { + .clks_names =3D s32v234_clk_names, + .n_clks =3D ARRAY_SIZE(s32v234_clk_names), +}; + static const struct of_device_id linflex_dt_ids[] =3D { { - .compatible =3D "fsl,s32v234-linflexuart", + .compatible =3D "fsl,s32v234-linflexuart", .data =3D &s32v234_data, }, { /* sentinel */ } }; @@ -807,12 +828,13 @@ static struct uart_driver linflex_reg =3D { static int linflex_probe(struct platform_device *pdev) { struct device_node *np =3D pdev->dev.of_node; + struct linflex_port *lfport; struct uart_port *sport; struct resource *res; - int ret; + int i, ret; =20 - sport =3D devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL); - if (!sport) + lfport =3D devm_kzalloc(&pdev->dev, sizeof(*lfport), GFP_KERNEL); + if (!lfport) return -ENOMEM; =20 ret =3D of_alias_get_id(np, "serial"); @@ -826,8 +848,14 @@ static int linflex_probe(struct platform_device *pdev) return -ENOMEM; } =20 + sport =3D &lfport->port; sport->line =3D ret; =20 + lfport->devtype_data =3D of_device_get_match_data(&pdev->dev); + if (!lfport->devtype_data) + return dev_err_probe(&pdev->dev, -ENODEV, + "Failed to get linflexuart driver data\n"); + sport->membase =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(sport->membase)) return PTR_ERR(sport->membase); @@ -844,37 +872,63 @@ static int linflex_probe(struct platform_device *pdev) sport->flags =3D UPF_BOOT_AUTOCONF; sport->has_sysrq =3D IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE); =20 - linflex_ports[sport->line] =3D sport; + lfport->clks =3D devm_kmalloc_array(&pdev->dev, lfport->devtype_data->n_c= lks, + sizeof(*lfport->clks), GFP_KERNEL); + if (!lfport->clks) + return -ENOMEM; + + for (i =3D 0; i < lfport->devtype_data->n_clks; i++) + lfport->clks[i].id =3D lfport->devtype_data->clks_names[i]; + + ret =3D devm_clk_bulk_get_optional(&pdev->dev, + lfport->devtype_data->n_clks, lfport->clks); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Failed to get linflexuart clocks\n"); + + ret =3D clk_bulk_prepare_enable(lfport->devtype_data->n_clks, + lfport->clks); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Failed to enable linflexuart clocks\n"); =20 - platform_set_drvdata(pdev, sport); + linflex_ports[sport->line] =3D sport; + platform_set_drvdata(pdev, lfport); =20 return uart_add_one_port(&linflex_reg, sport); } =20 static void linflex_remove(struct platform_device *pdev) { - struct uart_port *sport =3D platform_get_drvdata(pdev); + struct linflex_port *lfport =3D platform_get_drvdata(pdev); =20 - uart_remove_one_port(&linflex_reg, sport); + uart_remove_one_port(&linflex_reg, &lfport->port); } =20 #ifdef CONFIG_PM_SLEEP static int linflex_suspend(struct device *dev) { - struct uart_port *sport =3D dev_get_drvdata(dev); + struct linflex_port *lfport =3D dev_get_drvdata(dev); + + uart_suspend_port(&linflex_reg, &lfport->port); =20 - uart_suspend_port(&linflex_reg, sport); + clk_bulk_disable_unprepare(lfport->devtype_data->n_clks, + lfport->clks); =20 return 0; } =20 static int linflex_resume(struct device *dev) { - struct uart_port *sport =3D dev_get_drvdata(dev); + struct linflex_port *lfport =3D dev_get_drvdata(dev); + int ret; =20 - uart_resume_port(&linflex_reg, sport); + ret =3D clk_bulk_prepare_enable(lfport->devtype_data->n_clks, + lfport->clks); + if (ret) + return ret; =20 - return 0; + return uart_resume_port(&linflex_reg, &lfport->port); } #endif =20 --=20 2.45.2