From patchwork Thu Nov 7 11:46:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13866242 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (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 1961520B1FC for ; Thu, 7 Nov 2024 11:46:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730979985; cv=fail; b=P2qU25qwuyYrWIDf9ltwXfNHNrOiGwom1aANvgZ+cgCX+EFoI5qDs6mlqSu7jViim1lYrULNJYaHuM4gIjj3nQIywC+Sg+jWw0UfJneDAnwKEAX0PQ+W4jbrVzwdu0CEUvHQgCBe5CacRCUGkcHSqT7oKta3APKYBiqEZr0TYTU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730979985; c=relaxed/simple; bh=qlbiEqkLCwITcySrvE+0Rg/6vCX5fsz8SwhMLZjMxlE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=lu4I4DQXl4QYnBkDhFteBZa1c0/MSMkSAsEVMre41XTBeLwGAVCeFSc4WPw3Ts31j4oU8TQnXc5eelv4Onz08+e6OJXxeAkF7DmpsCgZdMJjSLW73npQEbS8/sYUqtC4sqbS4CLBSil7eMcT/BBCozBdFOdMLfCL1CvT/32YmQU= 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=YdyeDxW5; arc=fail smtp.client-ip=40.107.22.74 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="YdyeDxW5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K3ciTkNVdzO6TX7CtsHR4kE+g+9MmYsi5/BWlKzwy93yQFeWRGUHAkWHquAB9D4FhlBej4jMH8KTjqIkXRk4jBJ4zhw61xKwpFOViesqAUoYlSlLb5IIQdMBmb87PtD1/jiPc1B35hwWttfpSn6W1i6My62wu96RimZ1ygj33Yb0k6myL7pnkJwZSsGuehuRoYpdB/dKePU96Z3P/d13b9b0KwxfHXQpx+UWEiovkqdkvy3Me/xB/2o8YttdQZHxofdlOpS1OTU11GFnXynig30WwnkVAB7lmO60ngVmzI0Tl3NTFrstF9oxlkBwWKDaw66O+oIENaf4mLiSDsRWFQ== 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=yr1y9s3NxgYDBvfbMlqSm2pPtBHvj61Qk9HTt1Oy440=; b=bbtulcj5+obYX8FfZjek8ThcjwMk9ibAMdtAJwDhFaBDPFPxe7Czvn9Cfpm0vUglCR+HVdpNQqMUu3VDptrsOzwDzQTgZA1gGyhhynkacCc72VDnXNvcF6tqJPzsOoiK5Ruw00lP8CXVq1wJdCrercPWIC9ZA2ZiIfKQut/enbe+V4uGGGEZalq1Lbvg/RbssK5RNY18HtDEET9TFhwTcCJJvAD46fOGy6tg9Y6b1+BzIZ9P4SJ1msakjV/UyFt4Cq2j1rW1aWEb09zp8XrytWZtEZFqApg2Di2UqgRVHtZK4WLoP3qNEuy6OHlGdOvyXOtjqscrePmIjADl9/I52A== 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=yr1y9s3NxgYDBvfbMlqSm2pPtBHvj61Qk9HTt1Oy440=; b=YdyeDxW5DGenyUp9dLFU+HBRs0iIhJEuNRayNYPCoWHLU7PZCbzYPPRcJT1XAlPrmlBBsZFRMRWQHu8unRocMdrCjHhlFUbTcXHnc6gHDa9WyIZsHRwtVGi+gzlYlhKlk/YlcZV8gXNd8hX3IZ1hHnTgSnyaexoH20fKNAPmiD1WFT1plUGazt0hLT9h2XPv76zjQqczMtFhG+EsgF/htheYO2xvXlo8+4L82zj0yGnB02zo5suF2cRSIMqjAp3VWMHKRrgDECB9sulaevFVTWYBdt7zx6g+ADvewib3iSOSW1AzUfuR+2heSzuVNEDUgYyfibiTtchOJa2+dzpk/A== 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 AM9PR04MB8762.eurprd04.prod.outlook.com (2603:10a6:20b:409::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 11:46:18 +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; Thu, 7 Nov 2024 11:46:18 +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, NXP S32 Linux Team , imx@lists.linux.dev, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v3 1/2] dt-bindings: linflexuart: add clock definitions Date: Thu, 7 Nov 2024 13:46:10 +0200 Message-ID: <20241107114611.758433-2-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241107114611.758433-1-ciprianmarian.costea@oss.nxp.com> References: <20241107114611.758433-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM0PR04CA0117.eurprd04.prod.outlook.com (2603:10a6:208:55::22) 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_|AM9PR04MB8762:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a161659-81ba-40fd-999d-08dcff21caf7 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|7416014|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?W+DAfAmpm9i8/UeMFi4Fd7D5ahsZ1lv?= =?utf-8?q?WXo6cDvharsctw18l5l0XAKxjwmE5yhcvLM0I/Ccozq+7PQZrjf5MTTHNoGuPYx5i?= =?utf-8?q?NwEAt/ORDD687Xx9dmnY1KvqpWmU//ohd3bAb4C3IzhERS1bgMOPUllUBm07jvEzw?= =?utf-8?q?jreve8SPA8DwFg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kZhxrqzQw0/v7mQn4fEu4blpNF4BFha64N9s42woimetbFOSXua?= =?utf-8?q?UgkTKMt827Zq0GzG4vjAfeR9IS9o+YiBgE0VliY1uz6PwTjcvox9lRNbO0xQU3TkQ?= =?utf-8?q?YM2JvXuJ58tFXka1KtXYCHDAeOK4mQABkl93js4nKap3Vj1QAGp2DpZITCoWjKZB8?= =?utf-8?q?4MUxb7S3NIA8hsVTCp/r5Ii8v0rDfcAwTH54hCum+tn1EnhZ3fPiLHxJoNAnNACtn?= =?utf-8?q?Y1RW6deB35kPg?= 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)(7416014)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?p7TuIvkHPe1Hb3iDgfQGNMuxT77+?= =?utf-8?q?goR78NpG3wsFNiXE4vt8uow43axpCfN1G4ckLVkEYgDbJCJ/6OhTls6Z+6XAmxMTo?= =?utf-8?q?0e5Z3zOkFuWZTrbITZBsNFYf8VWiEBQY8pFM5OOr3b4JvvdLsOEtGpzBa9TAFDK8A?= =?utf-8?q?wgdjM9kZCH20YEp2peu92s6+tX6YA7SSZWhXEOO64sogiedyGZwas2q39xbsrpsxn?= =?utf-8?q?GuAh93fAMxE1+8/sxCdiKDLWTvxbBDU1ItpQeEGWUL9wfl0Cg2BWRc9MnbefnZxXU?= =?utf-8?q?5ryrWCvZy3NAli+NGgfZDrsBBbR6IsBACjTBksKF2TWm60Id9TIIsx8qu8aHDreef?= =?utf-8?q?Tf2mnOLZ3Q7NfxSDRDL5I+ow5OVnYcqrJP1A2QouZ//vTH/9cMvVKMOM8P36iFRoY?= =?utf-8?q?FGXg/2VYdswbB9F3a5hfi8e88Jz2vnwTo8S2hXNpwsL6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?= =?utf-8?q?0X9v86JrVcRJOr393lkG/1dV/2jUFRzhBQXGLeDvuJ/iukoLQkUbfR/yZbbZcfhuK?= =?utf-8?q?PYxbGKoy5zSSdARfl5aHMXYikgi+oDUKtoz05M3wKTSjVtOajq1ZXm6agxOnHYXIh?= =?utf-8?q?8wBoTESfAFO1Daa26/dyAwQb1XNPOmKfImJDH4htqyCsrwrmtwKufp9FQOdIfXxa/?= =?utf-8?q?jOnxgx8Fr2Wd1cCKrQR53dkVbHmRGykPgA=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a161659-81ba-40fd-999d-08dcff21caf7 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 11:46:18.6612 (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: 1KOpZ5E6ri3AWC9w9/+Lhfn5x38XZ4Y4IuiI+tUj0Fb9tYahRbJ2i5VMc6+go1Fc3C5XVsI/t8WrLfBNlomhIUjuGpUzqIPHDQ7jWAoyqtg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8762 From: Ciprian Marian Costea Add clock definitions for NXP LINFlexD UART bindings and update the binding examples with S32G2 node. Signed-off-by: Ciprian Marian Costea --- .../bindings/serial/fsl,s32-linflexuart.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml b/Documentation/devicetree/bindings/serial/fsl,s32-linflexuart.yaml index 4171f524a928..2716a9cd6c22 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,19 @@ examples: compatible = "fsl,s32v234-linflexuart"; reg = <0x40053000 0x1000>; interrupts = <0 59 4>; + clocks = <&clks 132>, <&clks 131>; + clock-names = "ipg", "lin"; + }; + + - | + #include + #include + + serial@401c8000 { + compatible = "nxp,s32g2-linflexuart", + "fsl,s32v234-linflexuart"; + reg = <0x401c8000 0x3000>; + interrupts = ; + clocks = <&clks 13>, <&clks 14>; + clock-names = "ipg", "lin"; }; From patchwork Thu Nov 7 11:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ciprian Costea X-Patchwork-Id: 13866243 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (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 5704420E33D for ; Thu, 7 Nov 2024 11:46:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730979987; cv=fail; b=RuTfOfEkGqArVWgalnJDC5V8oUGXosvo2DF2jeiWTJR54b6SWABeNQSHrJDxC8C/skDvQH6eMXLzF6pzJqAd9pFScQHQiQUMJVDVtbQZtS+TiiJRD1/n5+EwU5PrJQ0x0QpREgHZnDsfBRIUxXQl5Yi16SMiPPs4NURDRgKmDno= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730979987; c=relaxed/simple; bh=9BS8rkL1QTTXNs58BG8bOTv58bYul+z+3qK+ATtGVwQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ttcM1rZ0Jn+azoVU7UB2HB/bA5efE1SJ7bDOj+ojIisoOY/8ZrdCVy7/IuoTQXGilUhiELLgolCvtWKpzjw1XP1nvR9HtLqj2ezf+TfzubHf0Fqyz/nT5L/0WiQ94ek39mB/7FelxzPA1PApv4RmgCsrPAWTcYcPvwpYCZ0ucco= 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=Aa247MX+; arc=fail smtp.client-ip=40.107.22.74 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="Aa247MX+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kIhTLDgj4LNyYwZJoPOdfcerFmqlHecrG8WWkoicek3Of6xAzfjQUJZBwQbtnizaeb2x0yXOexFTrVdVEOtRFUJvhp+W6xgpsoxy5zP0mR5IKvK26tUYQpJj/AISMMdJAVWGmLzIdtGQSdLZ/q+vpvjQrngeTwUPN7BthAJZH4bAu3PwURNTD9YLTPDg4jVkKOoJeGJVZDiBQZnDomsxK/QLG5jBqHaS2UUgkdk3CkSoTf/LOZMcOPRAw95RiMfIvc79LeB6SNsM8/z7bQWcU86kVet+7znbtazqK+K+JaCb9SDyWleoFJ0w366rpZ6OtEbCgyAGy2DTXJMF51IJaQ== 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=yspjoETqEAdBLiFSRO+LbYk8sVc/EX4lsqm7Ql8O2EM=; b=hLn9ci0cQSgBteF78wEgCZyyIrQebPY2S3dNjNovnano6yYDHvUI212xJaYSMLj3RKl4mHedfjShRwezad5KcU1NtknDBhYS/KQ5uOXQ1Gr6ov2rZwqQal7HVcDkAoYPR0BKD4013jSQ7roivh1fuBChdlk6uYM0nLCBNClzAIWk0fzZ8PYhgxKsjYljJtDsW8pCnoVw/aBXMzHADxYQqWS3qjUFtfKxdHPofeTWric6sn1+Y66nGwN8mLc8sY2R4yv40a/yDgz20aT0YHeKMDxGtrPgBJ3yvdBGabmoaDdNtj6u+SYxi2v6MdnY5isKCEJpzSeFB3k/oSIWi/DASA== 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=yspjoETqEAdBLiFSRO+LbYk8sVc/EX4lsqm7Ql8O2EM=; b=Aa247MX+UByWEDmmg8oVEHTaVLpSM3nhy35/Pgt2ZW7OoRsiN4INZ3YY2GNhrHQKlYe93DV84F02JbFzOvy2exktURhrwJEW8OXyjzSgpcZhpP8NUeV37PbMKa7+JN8h8soDalSiwvd4qSVWSlsM6pVzO55SKqd+p9ZMgnsyCMv9kS1gbzNX0NR5lF1xzcUYORL+ppRHcoEaum4RtnkQZFmMOMBRP0HH7cdW6iqGgi4nEb5L8dUvsG/g6jmdW3JbHaNTcaeN/2pVu8MMX7udlxZbr8CQN0uxb3MnJWaaHmyBXyA7MUvD8mOcG/b1C1O8kXwNsgoNA7A9w/BEvGgB/g== 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 AM9PR04MB8762.eurprd04.prod.outlook.com (2603:10a6:20b:409::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.19; Thu, 7 Nov 2024 11:46:21 +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; Thu, 7 Nov 2024 11:46:21 +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, NXP S32 Linux Team , imx@lists.linux.dev, Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Ciprian Marian Costea Subject: [PATCH v3 2/2] serial: fsl_linflexuart: add clock support Date: Thu, 7 Nov 2024 13:46:11 +0200 Message-ID: <20241107114611.758433-3-ciprianmarian.costea@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241107114611.758433-1-ciprianmarian.costea@oss.nxp.com> References: <20241107114611.758433-1-ciprianmarian.costea@oss.nxp.com> X-ClientProxiedBy: AM0PR04CA0114.eurprd04.prod.outlook.com (2603:10a6:208:55::19) 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_|AM9PR04MB8762:EE_ X-MS-Office365-Filtering-Correlation-Id: c9045ccc-782e-470e-82b4-08dcff21cc3b 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|7416014|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jAk8CyzLDMPNaWr7iy/829C1lafr3mz?= =?utf-8?q?E6DcdiQb4Qy/IuZGmZ54FWspD+rM3mOV8KNjsAIZDBW+kvQiADIEfhNiT/YQ9YHD9?= =?utf-8?q?wTrIyMF9aj3zx3+XVsBxQrlTfpgbo0MDjGmdBDwLUuS59oqrJ+XjPu+B913ko/0rc?= =?utf-8?q?LwnJpzBA0zbp3UmlxvCqz1LI9iTc/aEcCszpkohAxHkxV/6KIuBL+2P3C6CU39/Bl?= =?utf-8?q?yLkzlxK4RQT0ZsF8Q51Ig5F8x9W24+3ZjJUi5oXBUdx5nOkC8PSCT2u/L75BmcLH0?= =?utf-8?q?QtPLOaB8pBnDd/VGnki1lbFsj7BhO8fah2zTKHcXG8i0nkVj2DbVP0MQfx5dzRvhS?= =?utf-8?q?oorTLlyFuY4usISlQCiPULVH2/3UvXYNyYvG5j0R8F4UHs/sN6XV8S1iOcPh8xsQ6?= =?utf-8?q?7qtJeZq95USOsDCX3wHOvRTslV+gCxp1rFeKv1qMenE5XkEglr0VuymArpy06QLCQ?= =?utf-8?q?Frw3DXfLXGZyvslD+3JLcDi7olTckmPE5AycFqPoNdDuftYLOT9B+PG9QcarVgB+4?= =?utf-8?q?YDtJZRaAVHP2ibIDmbITN5IvbDX0ZLbyD9PSuq7G3fjhv3NiwsyogrV2dSt0/JxFT?= =?utf-8?q?lfOpXqMOjaBgviyknhJpiNB3WlCjvo5RNFSMbcUj45Thzk7i8cVuMSaMfjfpjehF3?= =?utf-8?q?rLwYsrwnP2EvOfvAtjPiNd2rI14wXIP30HyPCtXPwVrVzEsPs6AaQA4GwQTK04C4c?= =?utf-8?q?lA235KymMInGvcQfLrJYL9SWqKdzaMDdfI9nh6dYrw37TSvjZQbWnVUWIlkoZAvEK?= =?utf-8?q?Uwew7I42TG5fDvOrUoEPQ4sSAgTq/M6iha+aTcR1KxKVBB2d6xJlZl5mqvn1YLjHA?= =?utf-8?q?vIBtl4C8gtFvtUwIJiSg/NjOglJ6wWr2jw9jen5cyEYuALrLMozMdm3X4XD54X75m?= =?utf-8?q?4w1HJsWNQxd//AFDxZbFc6MqI3rWvPB7oDp873U3lRK6aWmDDPJN6rBE9zRvGiEA0?= =?utf-8?q?vkeG6/UCTs0Cmx3K2Qcbih15BNDKxuH1YkDDUy0o3G78Qo/9awb3ln2shyvLt7jWf?= =?utf-8?q?N39T+Ve8vvdpORaqb+r9XfSa+INDAWGkSEyIBw2mMLVe1WSyfXqELTkzeJd6sMpwx?= =?utf-8?q?jEhis0mGhKRjWyJN+bEgDmFD/3KPFhMCLPopPviJzdNeCcMoIliCLJhbrOtKoxTVg?= =?utf-8?q?ny1+hj2F3lvHQlr0ZD+nTAOAyuNr92SMCeY0kXovW0OeLg2odGaC6ZImHmyxncx9r?= =?utf-8?q?BQyFOBGDDcVio7iQpn8hBjx2AAYO3Gr6Xtpo/nebLGTYI72aRW8D5RtnHQqa7oHyN?= =?utf-8?q?m5CeD4toTQ1gZ?= 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)(7416014)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?LuLRPM+P6A9chkrXMQgskxFChQX4?= =?utf-8?q?z0OCGAwHgkDOq4ZXdLbDjcdh7yDg/aOj9bJL58Pe46ZPgb/IT4v4qFKewFzZ9R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f-8?q?MSnr2b1tnSE+90vXIQOTpEHzAFKGiStFajU/Xi5ceSuRJMkpRSnKoh//N3pCeicLM?= =?utf-8?q?RmI5NP9fdkBKByCM1J4tiR61IO2xYfPTdWHJJYaJrcq3SXsSiveVR1DP2wmt4itXm?= =?utf-8?q?/Ib26ZJjp2bZW2gG03SvV4I6Z6cEeoX6mmu26mJwUrdTV0soSdz/BjrB8rPLOGjzS?= =?utf-8?q?CCh9ppxBGEe2xv/00TT815Wk2AFxZS723O3gl2/PdlaYCx3ab2SKEptZbldW641e6?= =?utf-8?q?c+tr0/BWh7CA8168vZ/w9pwYiq66g+LlGclppgfTU7Fe/2QTUePjG3hhhwZSp+6ot?= =?utf-8?q?WBeIG7puWh4Y1gvhjuvq1pibjKV7ScHmEQTYqr7t3ynrL3VH9OFG7ZAKvfhj4BCpD?= =?utf-8?q?QexevSmDayFKSJKCbFASMW1CYM4AtIEBittKHmyovTZn46mPt0boVzNSEgYoiReuL?= =?utf-8?q?GP9S4/+kpifkFDDQEerM6nwx4RIvyVm4goSGRlECI3myxfYilMJ60jfH9dXb9nauJ?= =?utf-8?q?7a/WiVbm44DekmNk3DyTIe5gN/DLv4bEOSGXHQ/CcWnGOJbHXEL1skIYSFFyzMemr?= =?utf-8?q?ctIIbWta0NaWPtDaxf17hiPT+/emcIMlfQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9045ccc-782e-470e-82b4-08dcff21cc3b X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9251.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2024 11:46:20.8180 (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: 78T45TPhxU9UJjkecnTa+l0Sm1lgOton/iS1gHYtD98U4AUS8a3XWUFtZFKh9nxvtAO85vBzqjcnplu7JpvVhppJAPH0kGNKxZg2lp0BzBQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8762 From: Ciprian Marian Costea Add clocking support to the NXP LINFlexD UART driver. It is used by S32G2 and S32G3 SoCs. Clocking support is added as optional in order to not break existing support for S32V234 SoC. Signed-off-by: Ciprian Marian Costea --- drivers/tty/serial/fsl_linflexuart.c | 67 +++++++++++++++++++++------- 1 file changed, 51 insertions(+), 16 deletions(-) diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c index e972df4b188d..23aed3bbff6c 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,6 +121,12 @@ #define PREINIT_DELAY 2000 /* us */ +struct linflex_port { + struct uart_port port; + struct clk *clk_lin; + struct clk *clk_ipg; +}; + static const struct of_device_id linflex_dt_ids[] = { { .compatible = "fsl,s32v234-linflexuart", @@ -807,12 +814,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; - 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,6 +834,7 @@ static int linflex_probe(struct platform_device *pdev) return -ENOMEM; } + sport = &lfport->port; sport->line = ret; sport->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res); @@ -844,39 +853,65 @@ 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->clk_lin = devm_clk_get_optional_enabled(&pdev->dev, "lin"); + if (IS_ERR(lfport->clk_lin)) + return dev_err_probe(&pdev->dev, PTR_ERR(lfport->clk_lin), + "Failed to get linflexuart clk\n"); - platform_set_drvdata(pdev, sport); + lfport->clk_ipg = devm_clk_get_optional_enabled(&pdev->dev, "ipg"); + if (IS_ERR(lfport->clk_ipg)) + return dev_err_probe(&pdev->dev, PTR_ERR(lfport->clk_ipg), + "Failed to get linflexuart ipg clk\n"); + + 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) +static int __maybe_unused 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_disable_unprepare(lfport->clk_lin); + clk_disable_unprepare(lfport->clk_ipg); return 0; } -static int linflex_resume(struct device *dev) +static int __maybe_unused 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); + if (lfport->clk_lin) { + ret = clk_prepare_enable(lfport->clk_lin); + if (ret) { + dev_err(dev, "Failed to enable linflexuart clk: %d\n", ret); + return ret; + } + } - return 0; + if (lfport->clk_ipg) { + ret = clk_prepare_enable(lfport->clk_ipg); + if (ret) { + dev_err(dev, "Failed to enable linflexuart ipg clk: %d\n", ret); + clk_disable_unprepare(lfport->clk_lin); + return ret; + } + } + + return uart_resume_port(&linflex_reg, &lfport->port); } -#endif static SIMPLE_DEV_PM_OPS(linflex_pm_ops, linflex_suspend, linflex_resume);