From patchwork Mon Nov 11 11:29:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 842846 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> 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-serial@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?q?31dv2o/RWobg4GJBTmKpz+3Np7tfIkz?= =?utf-8?q?2ig2dqmLEXyCxItZzRwzKtSwqSJJeLYalVGzMmphGA6uUHfxcAsPeDPIUgD7E3Ysg?= =?utf-8?q?7mAubfg2O3CNUqewVgSHcyRFyRJobiSNvspN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DWbtG9i1cJCcN0Pj8iXTvS1SmsVLMVx0U?= =?utf-8?q?Q3RKu+DOPX8W283ZrUmKyQcSEUXT348ncgAXLIvUmgheogajmOIh6Ae0bsMr1o01I?= =?utf-8?q?0GFUangw5OtyVarqSHhBpS4pDeWhi5GetsK7cTeeXwyDECMEk0FGaIak76srJ3rvv?= =?utf-8?q?oFMrcV+fnr7v+jNWpEPXcGMBaq9ZeepwwMrVNsRqtCPD3CGOvL4tHQTXuxDgH4UKq?= =?utf-8?q?lnbJuqvX4oHHKuDMd4E3FcxLsiDCv8mBvQINNNlvGVdUfbMnOuX8g8if4iOmeBw1i?= =?utf-8?q?5rF4nuuJ08mS9?= 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?q?VoNeeX6f6H6oJIYOejWNFLxh7bOE?= =?utf-8?q?bLyMCjl8WW6VVkNc0xI68ZnKE0HEcootWXShrqaj5hMxJ5BYD45n73Fgwh6OG74yT?= =?utf-8?q?+WoG8/VLtAVWg6KPr/Fk1uz1t5PU/eoHkVKETsb1sfTDKgEXZOiSwq3CCZzq8vfWh?= =?utf-8?q?wgRIW8/+JJBXUW1G/tKEZVNVTu5rgb8vU/0iOmmrTBR5a3qfba7Kwxthxs8KUbXKf?= =?utf-8?q?5iLmgs8HT6AWDB5PIhjg+wlzl2UDkhS2V7N5WFlU801E35gpJAVPIAGsXbWwQ9kh7?= =?utf-8?q?wovv6Picvl4KACT0502VTroPDywsVYxWoLf0oH5eaZ3TJuPmNXBgzGZbtEc3PhyA0?= =?utf-8?q?mXpuArGuRTfHvhWRVyuLsd+ghcRg6ID4xlIl2q6PW/0ORjtgIIdKZp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aVLJTbRNCcj?= =?utf-8?q?uJjqwDv4drjXVW1zR5+kH/j5Cwk54NjieP0Cg3uQ8rAocNECk30B7DnnuZM5PqL/o?= =?utf-8?q?ciF6L7aFGAIwITnKSE56KKsvGzeaPUEPWZgFVocvmRR0DTMkUxap3NzjNvd90tAyJ?= =?utf-8?q?wNOEHGz1LwX80kRJ+ucoWSJYsu3nsW3TbdMdBGtVdU4/ClQkcKc5OgJKP8/7vP0VP?= =?utf-8?q?pp/MPn3bDsZGRavtaVy/glI5My58cguSHuE1vsJag5reHvXz7ZHixT4g3EW8q+ho0?= =?utf-8?q?JmyE4/Cg+/hiLa8qaCvCU4XNibuP+uss7w=3D=3D?= 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 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 --- .../bindings/serial/fsl,s32-linflexuart.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml 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 + 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 unevaluatedProperties: false @@ -47,4 +61,6 @@ examples: compatible = "fsl,s32v234-linflexuart"; reg = <0x40053000 0x1000>; interrupts = <0 59 4>; + clocks = <&clks 132>, <&clks 131>; + clock-names = "ipg", "lin"; }; From patchwork Mon Nov 11 11:29:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Marian Costea X-Patchwork-Id: 842647 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> 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-serial@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?q?gL5Lou09kD+z3QOK6/zMZQKtj48vrlI?= =?utf-8?q?tkf6mO54UhY5B+CtS3y4n0EShDq716fW39M5D+mZs2MjSHXOysRM3eovtHDGY1uqB?= =?utf-8?q?+NKYLROuuCuzzU8wT6H5rojqgEVwXvIzAZm2wmCek4xcNFJDg3gD2xKWB1a5icjK7?= =?utf-8?q?lFkAy5jLFOM/mXg9Z7ZsCfE2M4YbnOtMMdXd6O9JvnBfaEaMMlHeBkaV159YqLJU9?= =?utf-8?q?vZs5RAv/l7CBpzpolY+QFgeCeRNAKuaUwKt58LDyBOt7MzhVAjelJlXpxI4SziNN9?= =?utf-8?q?sVsko7jwXTB0mk6xebBynFYV2ImYf3TPxn54PrsS5s7y8qdBL7AjAgdl+5Q8gd2Ie?= =?utf-8?q?vEtNPHNJZ482Wfvzo+PH9VQQYeQhAgkgrCjMZBJQB8YXd3K2amBvc9Jy0qbqDgqUw?= =?utf-8?q?rtiZGuE++VcbdfI6rT0IqEpfhEykxl8oG4+tb5FHvOOsOwQnV3xosSPjs//Z+DQeD?= =?utf-8?q?sRBuelqptXAgx7hgsFMOiki9RZnKkD2qeUuSwXicLWxEy6pIyBbyKFmsJDQUBVCO2?= =?utf-8?q?hvLISjviJE5jPOAp8opQM+/1FbRS2LQBfF1S5OpPIKZihcYPH/rpktsl7uusoFxya?= =?utf-8?q?TXVyWKE7Bo60efAQ2EJ+B6tqUQ1d1kwKr/Kdsc6JS1zVcSPEMpUSwGXOrR5bKRRDp?= =?utf-8?q?k4gQljmtwfbo91Xac9fs8g1mXWiiKFNm4Io1YoFFhHWL2BuO0U/psd71BIpxfker1?= =?utf-8?q?wa2wop73DRFfJFi3iot9/zE7u6jEbKi0js+N9pyrewVYOtisVbvyha0yE21cUh5yT?= =?utf-8?q?reksCN4BKETmNO6PC5MzlNuG1v5LGF5kUI4eIDzweq8pSYqRVyacLHL/R411uv1Gc?= =?utf-8?q?SRP5EG3/urN8cVW5ojKg8gKgvI3my23PT2RaGwN9MX7vKldqnqDIx3n7E/REOx9+k?= =?utf-8?q?d7UyIQQ+AwjBwwwMnP9utOn4Wq1wU8X0ZY/Q7/+k45r7m4G2Z6C8H3z6Xs7C7eKTT?= =?utf-8?q?qa2ZSXRWm05GhBLW6G1S6hmrlvcaoZ+06jHLMXM1cM5LzEcqICBVj8OKcWIGm4z7A?= =?utf-8?q?Vcdb+qE0CtppB/xBcjuzKJAn+Ve64JIaFq0+uSsoI0W1YmCTQQNO57jhl/vIOMCw6?= =?utf-8?q?DvVjHdtShQhjBL99xgq+9talrFUaeItL2IxuuAGu8eRq7dxz6+cn2r+DGc+7KLyno?= =?utf-8?q?tQtiibS+0jh5mJaOcPT+9Vk33VvGtN26oK0Lh86/A6ocK3ti9WwGYc5tChMolzH9L?= =?utf-8?q?DN39tqjhii18BsELmQgcvXPF9Q8vDQJOcpsdGsFUVUhOzOi90iin7hDmsgzCdIrVe?= =?utf-8?q?utMVmiYJDXlox?= 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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3Nz4T9qO+cb2mqMUUHebQ4U/6rtt?= =?utf-8?q?h0qEPP2K4i46OHYC3G04NancjAj86HpeJjgtsjelgP40U5E3gnKdyQ1sG+bu75ueL?= =?utf-8?q?PbtQKCh5frs11c3XuGM2Ymkr6G4ztXqh7uae7Lnz1HF2NEfHr/o0G/bLNqY/3TY/Q?= =?utf-8?q?NxdlDnp7L88gNIuzk4QNNvFeii6D4vhRH+aG+H3KoViqk4Q6+OH1NDkA9izn8tl2t?= =?utf-8?q?oy+41zRLtMkF2d1tnAtBjPKofSX9/yM06hf0eVkFA782eIBRrC5E8zfov0Hf2tYMn?= =?utf-8?q?ZGmBvqYId/Dh7p7AV72Z9LS65ltlUhrQpviP6GiY00jWLICIyARjqvBGPNmiXE4tw?= =?utf-8?q?D27m7oQY1DbRxc9KN2N5CbWm8gv0F+yQM/5voFnSjLcFOuNipYMd+guGImN6wj1sX?= =?utf-8?q?LaohGIrkLccbS8wNj9sVjv1U3O42SAY870FJErRxVyct+KvJrgYtA3Pf8AFFqyGJC?= =?utf-8?q?a6CFUNjkzpmoiVBKEpOFrgM5p8NtytCVVGZ+MTIbXW8GHzqz3bes2Fc1zgmHDA786?= =?utf-8?q?/VOEGbmNYHMZdn31lH/RG5K6QlahtERyE580v9q/xrQkF3YvooxotGOwGrQZ+MQai?= =?utf-8?q?2oLdg+6gfuX7OyGSKqwOvsc6n8TbSs8/cSAXlbAswkbbjAA6ebZTeXHiD9oR55W92?= =?utf-8?q?IIF0XjltA1MjNubt0yaiOTw1VbHCidaADg=3D=3D?= 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 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 */ +#include #include #include #include @@ -120,9 +121,29 @@ #define PREINIT_DELAY 2000 /* us */ +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[] = { + "ipg", "lin", +}; + +static const struct linflex_devtype_data s32v234_data = { + .clks_names = s32v234_clk_names, + .n_clks = ARRAY_SIZE(s32v234_clk_names), +}; + static const struct of_device_id linflex_dt_ids[] = { { - .compatible = "fsl,s32v234-linflexuart", + .compatible = "fsl,s32v234-linflexuart", .data = &s32v234_data, }, { /* sentinel */ } }; @@ -807,12 +828,13 @@ static struct uart_driver linflex_reg = { static int linflex_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; + struct linflex_port *lfport; struct uart_port *sport; struct resource *res; - int ret; + int i, ret; - sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL); - if (!sport) + lfport = devm_kzalloc(&pdev->dev, sizeof(*lfport), GFP_KERNEL); + if (!lfport) return -ENOMEM; ret = of_alias_get_id(np, "serial"); @@ -826,8 +848,14 @@ static int linflex_probe(struct platform_device *pdev) return -ENOMEM; } + sport = &lfport->port; sport->line = ret; + lfport->devtype_data = 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 = 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 = UPF_BOOT_AUTOCONF; sport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE); - linflex_ports[sport->line] = sport; + lfport->clks = devm_kmalloc_array(&pdev->dev, lfport->devtype_data->n_clks, + sizeof(*lfport->clks), GFP_KERNEL); + if (!lfport->clks) + return -ENOMEM; + + for (i = 0; i < lfport->devtype_data->n_clks; i++) + lfport->clks[i].id = lfport->devtype_data->clks_names[i]; + + ret = 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 = 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"); - platform_set_drvdata(pdev, sport); + linflex_ports[sport->line] = sport; + platform_set_drvdata(pdev, lfport); return uart_add_one_port(&linflex_reg, sport); } static void linflex_remove(struct platform_device *pdev) { - struct uart_port *sport = platform_get_drvdata(pdev); + struct linflex_port *lfport = platform_get_drvdata(pdev); - uart_remove_one_port(&linflex_reg, sport); + uart_remove_one_port(&linflex_reg, &lfport->port); } #ifdef CONFIG_PM_SLEEP static int linflex_suspend(struct device *dev) { - struct uart_port *sport = dev_get_drvdata(dev); + struct linflex_port *lfport = dev_get_drvdata(dev); + + uart_suspend_port(&linflex_reg, &lfport->port); - uart_suspend_port(&linflex_reg, sport); + clk_bulk_disable_unprepare(lfport->devtype_data->n_clks, + lfport->clks); return 0; } static int linflex_resume(struct device *dev) { - struct uart_port *sport = dev_get_drvdata(dev); + struct linflex_port *lfport = dev_get_drvdata(dev); + int ret; - uart_resume_port(&linflex_reg, sport); + ret = clk_bulk_prepare_enable(lfport->devtype_data->n_clks, + lfport->clks); + if (ret) + return ret; - return 0; + return uart_resume_port(&linflex_reg, &lfport->port); } #endif