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 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/4WISgw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UDyciTt9ILH6Ns6vNpOSBYJNirzso2PcT8h/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+kWEOHtRCL7FSujjiBcrg?= =?utf-8?q?7wsAnTASEa+mfqX63DkKERBXepnBUBzXNW2SZQxF/42uwurFhrGSYyLQyUAjKhHsb?= =?utf-8?q?c9aQ4jV2OWDrBbM5wYAPueP+C19y+337yTSyltDVXnCngWzNkcePG02rVHvXElNgd?= =?utf-8?q?iieOKmYwYveFdRd/TrRAhsX/ZD3eQFyfDy4SoDbrQuLkLKfrCgRIqctwW18UFzEdW?= =?utf-8?q?cAR0vUtNL1bkTIXVF3/VIji0MZYN5chECfmIOPl2HQ3wc3lk1kKuSYlHVwkam5AIz?= =?utf-8?q?dxbYnXo5tFufekNCGMW3I37l49D1bfAcS8mnltDh9X/o+xuFor0W6QtLTXUlQW1mk?= =?utf-8?q?XWAVmF0V65lElYWumRedjyvtbbVRS9ez5lD0XLeoVEpgsp7ip/gzInlMtzwcY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= =?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