From nobody Fri Nov 22 04:07:32 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2089.outbound.protection.outlook.com [40.107.20.89]) (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 6F9511AA1E5; Mon, 18 Nov 2024 15:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944701; cv=fail; b=H/EHz8dUCImz1dLhGkmyZKAzD7Evn2PVtmareE45TQnLqozoLEQam2ZlCqxvUuP8xGR8zbHLsErnVEDwZcFUqdq6EHgah+jG/WlbRo9S2HLmmsC7mVtsoHOvpUapZ+KH2FljasS6P2SeTsD+yJo5YFDR84TbJQ0LUJTCHDylvX8= 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.20.89 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> Content-Transfer-Encoding: quoted-printable 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: 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_|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?B?TUN0K0pGYmJBT2FWU0NaKzhLZzJ4VkRGZUYvNWRMa2tWZi94QmlOanhmdzE2?= =?utf-8?B?RmZRSTBNV3F1bjNqWG1UY0tpRllCZmJ0ZEMyZktwdm9aaEJXZ3BHbWtYN1Uy?= =?utf-8?B?NE12QTdyaWJ0ZUp3TVp5eElMTWl5RWpjZVZXQlBlejlnMWZxWEt5Q1BGNUFQ?= =?utf-8?B?dTFQTnBycW44SnVKSFY3a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3p5Nk03?= =?utf-8?B?RUcxN2tUODZUMVZCTno2VVpLd0FYL0FKSVFTMCthNVB3V3hkVCsyMlFmekov?= =?utf-8?B?dWJoclBZZ205b2tXTEN5cnRJcUgvMC9BZFFOUERUclBPRmQvNVlLL0lrTDJI?= =?utf-8?B?K0N5ODRTMjRrUy9zZmtXVWJNekR2N0xpSi9UN1o5R1EvQzNDYUIzYmVEelQw?= =?utf-8?B?QVk0VmxGSkthRjUvMjVBUmVEeHRRMlVnVVl3U2o3UjNyM2QzNWFWc2YwVFBz?= =?utf-8?B?YlY3VGlnVzIyNnlKQkZ3UCtTUEE4MTdZd2hEajV6Z1RtZzAzdEh4b0J4K2c4?= =?utf-8?B?QVRMZjdRUDZVc3NDUzhNWVNJeUNHS2ZrcWw0ckNlaXdQOGdGMjVJV3VXMXBi?= =?utf-8?B?ZXVjcjlJM1ovQ202N2N6TEpuSVhQalkwdW83K0lEUGZLRGV4a3RvZmNQZGVx?= =?utf-8?B?WTQzTFI1NzRiTWl2b3g2eU1KVytSL0pFcDlPeDN4M1ZOYWI5RHc2SDVaSm55?= =?utf-8?B?TFBiRVVmcFdIczBSWGhCWFdjNzZjRVMwNEFkYmVOaEJrc2hJZVlmZ1VVVDJt?= =?utf-8?B?dm5zVlFkZVQrRm50THBBeWVEMW94V1B5VXdBbFI2QjBpMG1yTEdjMWlvVWhX?= =?utf-8?B?UmFmRFhTLzNxQ3pjYUxRdXhZYXMyYUMvTDVqajFHdjVIdWhlL1NjWGZRPT0=?= 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?B?bGhhYU56NGFlNTB2NWxIZDk4MUNZbEdKUz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rOFF3RlNYc1g3b0JHcnBkaVAwVS94b0J2QXM5aEtjWTl5SHZtOVZhVnZR?= =?utf-8?B?MVNPdzQ5OG1XcWl6aFZNS0tQa0JzSXpCU0U4aXdpUWhCU05jS1NZTGFjQ1pY?= =?utf-8?B?aXJlOEJORTdINFJXekd5NzhybDBUQW93SFFFNUY5azNEcy9RTnZlY1pQdGtI?= =?utf-8?B?SXNhUDQrczRtVTM0TGsvVyt0NEZrSTBydHQ2NHdkeng0cnBiMHdFbk5QWlVN?= =?utf-8?B?dk1KWS9TWmd6SGkycjQvKzkyVTNsV1RHanN1QmF5Y2JCWGdPM2V5SjNGSU5L?= =?utf-8?B?MjFsNUsrQmRtZVhyR0crRlptUUI4b3NwSzNMamIxS0xORUF5bkwwaGpCNkI4?= =?utf-8?B?NGc9PQ==?= 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 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 Fri Nov 22 04:07:32 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2089.outbound.protection.outlook.com [40.107.20.89]) (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 B87371BC09A; Mon, 18 Nov 2024 15:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944703; cv=fail; b=epm8dqOYJsYFg0t3BBIC4hxizP3hAq77vNZpjgaYJGatmnFxEGd8bDW4TlNop+BHxZElMgn0dsIUtyAMwDS4k8vxtPga25mrIHz9nWQ6ndKVvkT5cs1wMw3A0p54G0TbDZQD9emhG9ObrMLWIAaJH5a7ffqqAEvoDMGRiXJci+g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731944703; c=relaxed/simple; bh=xB3YnWOPMf7vBRSv0QPmdkNaDPxOw1qbqN/0Mjto6e0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=C1A9NphXMNP983ijdT/G6eSfCklF7zxB10mq9Gza963xapu/aQP2urkCh9XnrICbsbCi7lOKU2TPstMgBUI/Yd+28zGexmy57+UmSfmydD1MWRa/qItb2xkRZsNInWKdyoL9l+pcN6o3GOevQbQtJP8nj4nwY/vzJufM/gZ2DqY= 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.20.89 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> Content-Transfer-Encoding: quoted-printable 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: 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_|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?B?a1ZUc2llWVkzaGNZNUduVHVFUWY0M3dsTzNpc2xVdkdjUVFKakptYTFyRGhq?= =?utf-8?B?dDJ5T1YrZ0dTM3lSNXAwL0lCODdkSXZuQ1poK3NML1V1SWZyQ2tYNlFxcDla?= =?utf-8?B?ZENPUzBmVHc0cjNXMWthUTBucytnUnprKy9URmJHTUpzSkdCYVh1UFFud2h3?= =?utf-8?B?RWJEZ0FpSUxJSnRMU2t1T04wRnl1WU4xNFRZc1UvNFdJU2d3NExYaVBXckY3?= =?utf-8?B?RndBRDEzRnlKQnluZXpNNDVRSTFoU01xb3pnbHdWQTNUb1kzUDdZQ0dXRGJr?= =?utf-8?B?NHpJNEJuT1p1cU5iWnNhRXhMMDVTNEtiT09SWEpmT1BSdGMxaEkxcTMrSWFn?= =?utf-8?B?c2M2enU5Qk5abiswOEpZQmlLV1ZlR3lzTHNVYndtYnY4ZkdoQzJYa2ZCZENT?= =?utf-8?B?cWNKbnp4QW5sUzUyOUltU1ZReTlmQUhpSkdEcFFSUlhLRDdWa21nam50VkxY?= =?utf-8?B?UzlSbFhoRkx5ZkFRSDF0MXAyZ1ExakQvN1lQRkZkYVpwcVRkcGJXcVd0VnpN?= =?utf-8?B?VklMcGlydi8vMkxXb2dldzd3U1dIdEx6SXh4Q3BlblJaTG9TSXQ0Vkh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9TQllKTmlyenNvMlBj?= =?utf-8?B?VDhoLzU1RVlLcXZ2YjJjSDBkNlBad3JKZmJ5MWliNm55N2VNbkMwZ0lqWjR1?= =?utf-8?B?MERvSXFoYnJhQVdaYVNoK0NUVnBXY1U4SWhBRUkrdWVOZStaUm9JVlZVK2RD?= =?utf-8?B?MUpiQXk1cDBCOFlyd25OWW55c1o2ZTRJTnQrazZZWE1uTllWOTJMb2JnU2tO?= =?utf-8?B?NDVTOGE5QzMzVVU5c3NVRXNuS2JxcHUza2t0c1VjNi8yaWFpZ3h4aWFYVFBw?= =?utf-8?Q?4EYsjpGboHTY7Tzy/y6VJtiaOZOZVwiNX873oLN?= 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?B?NXE1REZFd2FJMEk5RnA5YzZjaHJkdjVxOU12R0xnVTArcGh3NE1wZ0NmOGJU?= =?utf-8?B?NU4wdHJwMExWQW96VHdVWGsvemtNWjJCLytlK2tXRU9IdFJDTDdGU3VqamlC?= =?utf-8?B?Y3JnN3dzQW5UQVNFYSttZnFYNjNEa0tFUkJYZXBuQlVCelhOVzJTWlF4Ri80?= =?utf-8?B?MnV3dXJGaHJHU1l5TFF5VUFqS2hIc2JjOWFRNGpWMk9XRHJCYk01d1lBUHVl?= =?utf-8?B?UCtDMTl5KzMzN3lUU3lsdERWWG5DbmdXek5rY2VQRzAyclZIdlhFbE5nZGlp?= =?utf-8?B?ZU9LbVl3WXZlRmRSZC9UclJBaHNYL1pEM2VRRnlmRHk0U29EYnJRdUxrTEtm?= =?utf-8?B?ckNnUklxY3R3VzE4VUZ6RWRXY0FSMHZVdE5MMWJrVElYVkYzL1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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 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 | 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 */ =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 */ } }; @@ -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); } =20 +static void linflex_disable_clks(void *data) +{ + struct linflex_port *lfport =3D data; + + clk_bulk_disable_unprepare(lfport->devtype_data->n_clks, + lfport->clks); +} + static int __init linflex_early_console_setup(struct earlycon_device *devi= ce, const char *options) { @@ -807,12 +836,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 +856,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 +880,68 @@ 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"); =20 - platform_set_drvdata(pdev, sport); + 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"); + + ret =3D devm_add_action_or_reset(&pdev->dev, + linflex_disable_clks, lfport); + if (ret) + return ret; + + 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); =20 - uart_suspend_port(&linflex_reg, sport); + uart_suspend_port(&linflex_reg, &lfport->port); + + 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