From patchwork Mon Nov 18 15:44:47 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: 13878800 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF54117758 for ; Mon, 18 Nov 2024 15:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944701; cv=fail; b=GRkLL9tJcqwKyx+TxlmsEdTypaEluAVSthI5kCnDIFcXu9SHcyKJQ80O7+IV0bd4Elq7RtJsGsO1AcGTkKvY2U8kNkQkWFYzWSoTiFmNS3X10rrVN5QtfZOgokPSLlFAPg7Rn+3o2u/oQp6Getr2RnqrAhWUH6+4z/uBzjgZbb8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944701; c=relaxed/simple; bh=gbSVMLexNNjr7WSJ01xKZ/fRYag/IlfQKqG5llfTlYc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=YQOuoOMjE6WdqUHzxGZ3jX9q5pJ25OIT4BM1fAVlt0ocqLuy0b63YaR0+2VW2qpEB2DqvSMM2yfCfLutdeik3hVsEp0GTIUDn2l9F3vmGNIV/umX446yVrXct420Rt7CSElfnwzVGtZ0iGHGnO4N5JX7c2hLh+Co77J1faC4qzY= 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=b1NRxHMv; arc=fail smtp.client-ip=40.107.22.59 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="b1NRxHMv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nSy76EExxdBUAdPaak9jyHY0cnHibwHbQtR5lGWmWuxzrkBVPUTPd6MF7lyQkZxeFLctl2l6UrsuMjxGVe1Hv1N1gVlpKwaoDfKlu6R9dmTGIqGPBijBnvZh+uPGbkobZ3x2IsImzxHB0DwMB0Q0uKx1DRSRfnzA5oJxHBmxtVgkNMkKrURML8vax/XCZkqaJzLYh6zE0cNNLR3WaEF4lHZ1XGtTYWdzH0t+VIAIusfO+PNdU/xq0qWhCFgAn+cUulT3mLOsy5/If3CBHySKlc0XHDktS3jL23fHaCkBTiX9CYwwS+g7mwdnzhgQfvt6KAobLftrJiCdNP3IG/pDOw== 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=qFQWVCfq8bh6QP6irQZGnkCZquVGjURVDxs60ESnDzY=; b=kzqIMnCFTpU1RLc/6n4KIgxYWgyCVAWx4aMdcbFJ097AH25Xj62vOiJ4ulzjs+GBy4QltW76lMFKCwREdui5ccJlwoeh5taOhKu0iQawG3KpivRYUufyPfg72g5lHQgXpZNmrtyxPvWKuH9Z/l9WTAkLyVgG0GSPIy6YnBmOLGsenCopm4HkLkMVXJuAan2xFWrDeGd4tN89WfpDwPAWxs2X7Qj7bI8oWujHfVYBUU88eb+zIMUq3GMx0UnatInWhrxcaqGi3ZYZHXAGTOBOz8FuYOYmDE7y0IXUv+cgV1R8QAW1+cjadDBi8gdsTy84pikBhqSdN0D/jXdYTr5l2w== 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=qFQWVCfq8bh6QP6irQZGnkCZquVGjURVDxs60ESnDzY=; b=b1NRxHMvpoX84mynUc/0Co8Z/HYi98zKpMVLUtoDbviOL+oL/uNl0XKZbDwpylxedFGgsddk4Hrr7k0nqqne9tkPFHcl757BDbyYHSc8eAW3ySrJucjXc0LQZncB048lG/ZMKlW6VvRnr3Il+PY3ldUrs4d1owhPPh0HoSctmSHOXYySwVxjb17MBvlcXi1Gr9YWm4xJL3C7sg3x/LHhH+3Nj4coZwIhjLtQpAFs0XDiofzVeiCG/6la5LBmubJytsn/S2RxlotFHnRMfki4mQ4Ga4bEbheEjdtO7rWnMukBRss+Dxbe4EvVbbyU91MXDEeEKy9+/qxQ2UBdYaPwgg== 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 AM7PR04MB7175.eurprd04.prod.outlook.com (2603:10a6:20b:111::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Mon, 18 Nov 2024 15:44:55 +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.8158.021; Mon, 18 Nov 2024 15:44:55 +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 , Conor Dooley Subject: [PATCH v5 1/2] dt-bindings: serial: fsl-linflexuart: add clock definitions Date: Mon, 18 Nov 2024 17:44:47 +0200 Message-ID: <20241118154449.3895692-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118154449.3895692-1-ciprianmarian.costea@oss.nxp.com> References: <20241118154449.3895692-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P190CA0001.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::7) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AM7PR04MB7175:EE_ X-MS-Office365-Filtering-Correlation-Id: 622ba5ca-9991-4615-42f4-08dd07e7f2e7 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|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?MCt+JFbbAOaVSCZ+8Kg2xVDFeF/5dLk?= =?utf-8?q?kVf/xBiNjxfw16FfQI0MWqun3jXmTcKiFYBfbtdC2fKpvoZhBWgpGmkX7U24MvA7r?= =?utf-8?q?ibteJwMZyxILMiyEjceVWBPez9g1fqXKyCPF5APu1PNprqn8JuJHV7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8gF?= =?utf-8?q?25IWuW1pbeucr9I3Z/Cm67czLJnIXPjY0uo7+IDPfKDexktofcPdeqY43LR574bMi?= =?utf-8?q?vox6yMJW+R/JEp9Ox3x3VNab9Dw6H5ZJnyLPbEUfpWHs0RXhBXWc76cES04AdbeNh?= =?utf-8?q?BkshIeYfgUUT2mvnsVQdeT+FntLpAyeD1oxWPyUwAlR6B0i0mrLGc1ioUhWRafDXS?= =?utf-8?q?/3qCzcaLQuxYas2aC/L5jj1Gv5Huhe/ScXfQ=3D=3D?= 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)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?lhaaNz4ae50v5lHd981CYlGJS1sN?= =?utf-8?q?nh0zctWoMVdJjMBcyVZw1I8Vvmh8P4oAtPiU728nO7aJOpFEdevJ4d1A81A9YWt6d?= =?utf-8?q?y3UJXCG6yuf55/CLZcXvt912KPd2O9oC2YQsH2rA/FXJ/z/Z/VYWjVBa4OnRuUPg9?= =?utf-8?q?VQMlmcI3ZX7krX6AUqWhIkvM/rsLHyTxU2uyGtLUe6oyUsokmVcGHsnmuIS32elKf?= =?utf-8?q?15hiPYcM2jjt57qIvHyoITAVa1FtF54ABRiGnTPDIiJo7rVLOacYy1aEBcEYnTnTE?= =?utf-8?q?Doy3mocQS9jn1ElCENLBliGdVD5J5l4+gjDmmtwYyrYyYP5Xe15pPPR/TkEU9qyV4?= =?utf-8?q?3fk6hBDUx8Fhj7NnEVvhBa2ku5MUbI7tl/cicYSLP4mQErDb8m3toOA794G4dHRo+?= =?utf-8?q?nBYv1mmtauqMlsvxqusDQKchbAQ/m07ovjeunSwOg/zhUlFvZblpEzcYIbVwfdrbm?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=?utf-8?q?vQ1SOw498mWqizhVMKKPkBsIzBSE8iwiQhBSNcKSYLacCZXire8BNE7H4RWzGy78r?= =?utf-8?q?l0TAowHQE5F9k3Ds/QNvecZPtkHIsaP4+s4mU34Lk/W+t4FkI0rtt64wdzx4rpb0w?= =?utf-8?q?EnNPZUMvMJY/SZgzHi2r4/+92U3lWTGjsuBaycbBXgO3eyJ3FINK21l5K+BdmeXrG?= =?utf-8?q?G+FZmQB8ospK3Ljb1KLNEAynL0hjB6B84g=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 622ba5ca-9991-4615-42f4-08dd07e7f2e7 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 15:44:55.2338 (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: yRZzb5h0PiG+8iI6LCkw26qGc/TuTDeCVtidcvyCcrc1YO3xTAezA8TkO1PobsRUOKH8ErzFaIJlCNAYk6D7tIDpYOBcqCroyUyqxqo83Pc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7175 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.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 18 15:44:48 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: 13878801 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2059.outbound.protection.outlook.com [40.107.22.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16EBC1BD4E2 for ; Mon, 18 Nov 2024 15:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944704; cv=fail; b=ago+6INNH+jFB8XfMpa/djHkyM9U9/Ca/QrPaNzHt8cDU9DsuBFqmiPGT2JcB+zuYNAhsQZJE9czUBI+WlHZv1iVu54xgx+zwJvxVd63dUdBpYnAyotafrsreLhirpzxzDsTXHajGu479JG7uERa4CBtspPUbypzfjV8OjZ3lTU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944704; c=relaxed/simple; bh=xB3YnWOPMf7vBRSv0QPmdkNaDPxOw1qbqN/0Mjto6e0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=mqAOUkqegwgruTDTLktrjbUxpTSZ9kyGVdZiWf5c/DNvqP8CjYvxlmf7TSzDOxvSIwt9PKm8oudEcDoBeshkLmS/Bs8TGEfxw0MVdHWaDhuO1LsjYObduyv+hGXoaHtyk5J5NzL9JoeZPAxKuqk0WCC97l97gp0JXRiQbWa89rA= 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=tWycAWsb; arc=fail smtp.client-ip=40.107.22.59 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="tWycAWsb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pGgs1que/YFM7ao053+l6CZXUKGSoDPJGEHn/W5IATEQAOOOzmY3QStOdF89yOruXfHij7MlepucFvCNUux5OE4UzEWHCr7MNdkDBRvML41y/Vx07PxOWvSVoKzglv3JG/J6fUZO56YkjuT2r7xYYkdqVMggQ0vSkslFB7zPjOn7vpsXo9WZpxSKgl3vxdBj4WKI6zIxRlNk+d4ChP0gd/LidV1HFzKdniiOSYUuG2qqdKicL+gDcsXuipLKWdhEzWYW0sL/P6Ox9PG2cD4bDM5wBWeQhzbhDIbd4p9F3lWwijenmWKX4eRlZIb0Tcx1yRE0HIBB65YWteqq9gm5OA== 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=Qz6tK5jtgpStWq0dqpcnv7/5+iLJYfbGydSFQ++J7Dk=; b=gndISZECZQcz9Lf3ssboZ1GPS5z00W2BIW1Z3bNQfxx00LI8NXYVOomUvZl/PPOcyGyJlAk4aJGap6QRslE+qMGUKW4yOLGlLNjTepTLxOkBNde8DSyI7MzYrxSj1ULQxTNV31ClPkLZ59ryVGxEb5BwZOXXFjCDPiceumgx5eY1oqIDHC6yTwk8cifRkkR/SDj6BCpsZwBreTbo5JdT6I2coBHaDETUScJfvaJupN1CcuRz/d4sQypf+jxobLAIWNwzidGEuuu92YhyAUzMf2cXF/8vWGAdZK82IxElNMGuEfJe53Bsr9oct88WIdNS1LZlhiterVfzDE5uEjQc+A== 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=Qz6tK5jtgpStWq0dqpcnv7/5+iLJYfbGydSFQ++J7Dk=; b=tWycAWsbVpU6s/3ebxbZ0dsW0oIvFKYYKQh/bwxgslBG31ySVK41po40/PZK+A5cVVH4OYAJMp0InPXPQT9C664qZ9BJEMg1BMy+6Bo3wa15+vp65OeCdvaQbbWuyj5O0VLEFk5tsEOKmu0462uaEnFMSytgXMq5xpmQviQTYJcrxMcGPPnGhJS0MNZjIu1FPh8MbF0jH0GKVOnkFiupb7u4kizElNBMXdXpwLp6SEXLgwnBVcKmOOxMQo74krdCf1frW39+nbWpuZQZRYGKqnMsyQgDcEhbZ8JqsiybRL9Dy0Ef5HD+jg7jJeN65hkt0zsolwHqjj0YbhLVHWE6mg== 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 AM7PR04MB7175.eurprd04.prod.outlook.com (2603:10a6:20b:111::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Mon, 18 Nov 2024 15:44:57 +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.8158.021; Mon, 18 Nov 2024 15:44:57 +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 v5 2/2] serial: fsl_linflexuart: add clock management Date: Mon, 18 Nov 2024 17:44:48 +0200 Message-ID: <20241118154449.3895692-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118154449.3895692-1-ciprianmarian.costea@oss.nxp.com> References: <20241118154449.3895692-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AS4P190CA0001.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::7) To DU0PR04MB9251.eurprd04.prod.outlook.com (2603:10a6:10:352::15) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9251:EE_|AM7PR04MB7175:EE_ X-MS-Office365-Filtering-Correlation-Id: a65347ee-cc41-4325-dd79-08dd07e7f405 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|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?q?kVTsieYY3hcY5GnTuEQf43wlO3islUv?= =?utf-8?q?GcQQJjJma1rDhjt2yOV+gGS3yR5p0/IB87dIvnCZh+sL/UuIfrCkX6Qqp9ZdCOS0f?= =?utf-8?q?Tw4r3W1kaQ0ns+gRzk+/TFbGMJsJGBaXuPQnwhwEbDgAiILIJtLSkuON0FyuYN14T?= =?utf-8?q?YsU/4WISgw4LXiPWrF7FwAD13FyJBynezM45QI1hSMqozglwVA3ToY3P7YCGWDbk4?= =?utf-8?q?zI4BnOZuqNbZsaExL05S4KbOORXJfOPRtc1hI1q3+Iagsc6zu9BNZn+08JYBiKWVe?= =?utf-8?q?GysLsUbwmbv8fGhC2XkfBdCSqcJnzxAnlS529ImSVQy9fAHiJGDpQRRXKD7Vkmgjn?= =?utf-8?q?tVLXS9RlXhFLyfAQH1t1p2gQ1jD/7YPFFdaZpqTdpbWqWtVzMVILpirv//2LWogew?= =?utf-8?q?7wSWHtLzIxxCpenRZLoSIt4VHAo+D1rPUQhergSr975r8Ux3nBKODj9Akx6hWJx4L?= =?utf-8?q?0CqPsIos+JdkoX6PF8VZkqwckjKEK8w2i6GApMb6psw0fSGXAIJzktO43f8npzf8d?= =?utf-8?q?+XYNAe5qZOVNu68ff+ve4saCSKcbJI3tilFCibxfy6M0PAhuCNZCQbZRFZsdj5R7+?= =?utf-8?q?nZ4uEqLwdtGaCmv7upk+t2z6K/IAm2uCimmIORoNRlAUOvtL9iAwlejGLYtyB9Tso?= =?utf-8?q?WqRA+X2CeMZzpfD/lns0FVAk2hL6JSNOEV4YfOmgvkOIbu/Aj+JOrMAkAT6Tf+fPj?= =?utf-8?q?s3Z+6c4DAFKTreXS7+2NmvGS28HLtfxrlFUxxl6LPDATGRgJIZ7OcHn+KoS53f1qu?= =?utf-8?q?Xz+q3Ix18jY8nIS7DK4oMuPrIB6Jap2kfmWawj7RA+pLjgwE8cwBvqj9XfCL63NxG?= =?utf-8?q?JoAGRwQLTK+N+tGxg1Y7QSjZAEeLtvVkIkYPmsmkC/8LBzd9X7XhAu0ySIXiZb0n5?= =?utf-8?q?yN4uneGMxE/rjokMrQYvaOK5//u01NwjaibSQwygipmAsc7NEomSCURrZBUEoYfCO?= =?utf-8?q?+Xn4e2svkEETJdm9qG0TaxKbsbFvTAHwZa9g388I/vw9eKEv0uT9Lq65N3PahkKdO?= =?utf-8?q?A6Dgt9TxhSJQij92INB02OUDyciTt9ILH6Ns6vNpOSBYJNirzso2PcT8h/55EYKqv?= =?utf-8?q?vb2cH0d6PZwrJfby1ib6ny7eMnC0gIjZ4u0DoIqhbraAWZaSh+CTVpWcU8IhAEI+u?= =?utf-8?q?eNe+ZRoIVVU+dC1JbAy5p0B8YrwnNYnysZ6e4INt+k6YXMnNYV92LobgSkN45S8a9?= =?utf-8?q?C33UU9ssUEsnKbqpu3kktsUc6/2iaigxxiaXTPp4EYsjpGboHTY7Tzy/y6VJtiaOZ?= =?utf-8?q?OZVwiNX873oLN?= 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)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5q5DFEwaI0I9Fp9c6chrdv5q9MvG?= =?utf-8?q?LgU0+phw4MpgCf8bT5N0trp0LVAozTwUXk/zkMZ2B/+e+kWEOHtRCL7FSujjiBc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q?ZRhc4IFitFSFVaTRKJDD1RVM/MOKVm3H4ZKv/MiopolleY45LqJoUa/gtXIhnVDud?= =?utf-8?q?RDFsOm4n71Jb0dAjS4/76YILhmxKMkrCY0Q3abXgT2C+r7lARPqB24ol1WNy6uKRk?= =?utf-8?q?WO8m8c6BKZ/Ee/MeILzlW/F4WdvaXtEn6gPYFmJEf4oazELmSzG67jrSAtJ/znYvI?= =?utf-8?q?ozoR+pRZH93So46f/mVI4WWe8DRNusRFFZN5kzNLZOJcFbK4QDnoff4W7yIN+EM8e?= =?utf-8?q?zU9qq6VcMDfcQk8o0Sactajuumd6Fttyh6Op6td3N/JK8zO/XImbRa3v/AoYRiDXL?= =?utf-8?q?RZrmzrBhbsji+M+l5uw1vxO8pGZFL4btA1efqxYSr7BvG7G+pffOJqHYgPKpItQNd?= =?utf-8?q?+6U0RPD9JrZ99Wb36bvdTLJCLNJbpaeVTEdACwzi7tbowdx1hwoP09i6d+a8zgTWa?= =?utf-8?q?frn7iBJZKYTedM2ZPnUESHnEragMNvjiGVrU8juffPiuDcw9AXIW7WTXk80DTMn5i?= =?utf-8?q?K7IItpZibo9IqaeDFdbN+FMxL64mp7i2seBCZNVsc3+D3G8QZTcyULCJQpOhPXGGl?= =?utf-8?q?FzkJnDujgmf72tSQVcrllWmi5178za47Ow=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a65347ee-cc41-4325-dd79-08dd07e7f405 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 15:44:57.0707 (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: jjHugFCj7eGCMbZAZPsx1Hv0GM5b8hpO42wr3KvvDL92EjY+gMQqc6axPt9AHFv1Bqh2fuSlGF3WrtfIRDDHgJkc4RLzbaUU6JmJdS3sUgM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7175 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 | 95 ++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c index e972df4b188d..394c2f66d4a2 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 */ } }; @@ -776,6 +797,14 @@ static void linflex_earlycon_write(struct console *con, const char *s, uart_console_write(&dev->port, s, n, linflex_earlycon_putchar); } +static void linflex_disable_clks(void *data) +{ + struct linflex_port *lfport = data; + + clk_bulk_disable_unprepare(lfport->devtype_data->n_clks, + lfport->clks); +} + static int __init linflex_early_console_setup(struct earlycon_device *device, const char *options) { @@ -807,12 +836,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 +856,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 +880,68 @@ 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"); - platform_set_drvdata(pdev, sport); + 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"); + + ret = devm_add_action_or_reset(&pdev->dev, + linflex_disable_clks, lfport); + if (ret) + return ret; + + 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, sport); + uart_suspend_port(&linflex_reg, &lfport->port); + + 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