From patchwork Fri Mar 31 06:38:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13195269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8299EC76196 for ; Fri, 31 Mar 2023 06:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjCaGdo (ORCPT ); Fri, 31 Mar 2023 02:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230076AbjCaGdn (ORCPT ); Fri, 31 Mar 2023 02:33:43 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9377F779; Thu, 30 Mar 2023 23:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dXruWynAoC+FJ88pb1l2Ed4ToBUI38DQ/YUejEeGGQ//HUamilc90HEJ/OgSOQTgCrBiykWXvG+g3Gy6Bp69906gpxCCVjryjUFs4yngRu7AGFTZ72IRYM++8rAKTo941oiHkYm8N31iW7BtU8E/A4zZKvjUlAA8TBGwjLeVM9BzoEOVycgE+LVB2AiEsapbIJ7AnK8ze+AROOZTlKt/j19y5LV8MVKkQwq4fKi4DlwECkDusNKFbpYs8pVQ1/4ETEfEH5guEpIQ9jikOzb25G2/reFwxpcq8w1xFsKy3v+tbsSqnv4H4zICAw5G0e72uFunJ1EHcx/ytr3NnjZMtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=KlR8D+X0Cd/2yXH6oInv5JiG8UoVO03J9Zpnrn7l3XM=; b=O8oiYqpZi5EKl3MBvolIsWYbYHWI2SwzxsDfwQBqFzUvt1JYAKwThNQ/8104LRDgeONQzf9o3QChgTI4RFntDNCOLVhp/ILT23iM/veSmq1zkRMhf1b8J6gmUmEMX9k5JCZUkE3Zhh4wq9rTlyoNXdlM/JuFNrYPCb4HyMF9Byj/o++7SYHYYuePRquJ2gDEozw1md3U1KrsTLhlTB4d/dgEOvFZbj/5aGlT3vSKBr/DNAZKabeS3gpdkFbXL4aFulsuVfgBTp+izZOwSCqFmM3LU/wVttXBnlZRS98pdbq5fgeit7R+K5sYeawzBJ63IQKzKsHsZpEFCTrLTskXbg== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KlR8D+X0Cd/2yXH6oInv5JiG8UoVO03J9Zpnrn7l3XM=; b=Fsk3Efi9APPsL3DxXpfOgT0X73YZQ3W49mn4okGIzGKn2gT6PLiBy8jbbJP1fQVe29uO8Y4Om6djGB1pemUSF2x2MvhpZrqfQE02TCCSLv2FX72Thxe39uDc2/J17F9WbX83yD4be7VStd2IfyEEMWfRwHqxvsP7AqmCkbyRHw8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Fri, 31 Mar 2023 06:33:33 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0%4]) with mapi id 15.20.6222.028; Fri, 31 Mar 2023 06:33:32 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Jacky Bai , Ye Li Subject: [PATCH 1/5] clk: imx: imx8ulp: Fix XBAR_DIVBUS and AD_SLOW clock parents Date: Fri, 31 Mar 2023 14:38:10 +0800 Message-Id: <20230331063814.2462059-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230331063814.2462059-1-peng.fan@oss.nxp.com> References: <20230331063814.2462059-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::17) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PR3PR04MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ea3aeef-99fe-41ae-537d-08db31b1d938 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c069GgcPbJhZ7FKl1Ff7uwv/xnVuN/6n8X7B6+BATJj6qx0FHeR1SmLXCBECXw8hxCIwoLtYUVePCCVMCxqMuVsKYHcHYqjcTCceNkXcPIHBFtzZViOHd6XVSIkFJ7qaY71xWCYxa/NIWo2N8ylFsQt53920TcL+Sdn5FM/K5yAqpjtQfrZedUYiQSvbneLbnt5jtH2UVK5xTu7D678s0g4M/54glZ+O0FAIBOsOjM9Ddd4NHRrUkZTiz82XelID4XA2wFs4Tk9/oxI6RTMi4QSUUyy7o9DCbAn+lt3AAZbm0+II6UBgTQ9IJze0Tz7l+TVErYIEaM6SuK4s+Vv5utqVA0+hSuQHAyFf+xjlxcR0SIvFWmTBZRPNoyVJyEcT3yVuNX2lomGEWjpqY1V9gcoTxfn9Miew/VZ+DnEy+j0TeBdCYv2qr+A1HbeLTUr2s+l2/UxnbdkU7tRM/0EWZ3ZSF6e/zgWnDcS0q/MnvXb4ZcinZs0e+VzClEzZRCTuGj2DmngrShPDtkDnJYNq+JPvUZKxcSmOE4fs3cWV9lpdLc/nhmNrjTweKquEO7JBX9lG5p+v9H428Htp53OlGYzKenkhc6rv4c3fO8OYj1Xo6939NpV3MnyAAqcuRw+OV870QmP7PIbUwy1uoHaGGQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(38100700002)(5660300002)(8936002)(7416002)(66946007)(41300700001)(38350700002)(4326008)(8676002)(66476007)(66556008)(6486002)(83380400001)(2616005)(54906003)(6512007)(26005)(1076003)(186003)(6666004)(86362001)(6506007)(2906002)(52116002)(478600001)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l8fn/FgqTA/UFHdNlQCa7nhXeNoYT5hfnwvvLF9qJaOccURwHrVa7O6u2RLo3P4fTfEu7nHDJ1s+M6fIhwJNYS6SWoPHScjMxbbYi0+3rs4ofZlqrpHGPcHBTiLOrK5+EGFOdl/eHIX3SIT2ItjM8NTTGRGbdGuONPSCHEYzv5Pqg4jypt1Fdj4th8Gp+1sOx7DKBwax7lfB2IQ7Rd6uDYLyju/gjGVXsp5EUHGmVIHCEcdQzVeSVqmRm84aHKVPrAzTsVT5Hpgq6MLVSw2FfTemHoHUVmJKPJyLrGhh5PSDLEyLqA73QU9coqXPDTerjVGhxwrofwkbNyGkRb8JiB+nHoc6NLefZTxwJ//tgZoyPsUaK480/ErYHoVYO3UFE1Bvw+F4ko1GtHMSZkHJeYK9X81g1ITcyQ9d/cAZ/6cCpyRfsMlZ+0C8C+twS/BPO5FzxnmveYXoR8yl4ZN7t3LVGsjo+ilGrQ0B3d8OYrwPbJdpZwaLnLGRcZlrYFadcSBWlRH/03v29d9ilugW7C9jw/4iUN/eBfib65NCtab2gATopRKJ5g7oRitdlkd5uqz3Nhx4eBNGJVvwyZ/TlqwqUfcLJK5oFLrWRGHwgWZe7/BIe695fArgtmpMydAf/MDTbKPpGQDEOR8JIRdNVnq9qlB5tDC8Uy5i34ppl0nds6fkTLF3Y9qRjlpsIGGsqazGUTvUQ2hN5NGpytAd5ko5iSyOp4PE9RXCnxH30AROylGSlYxsz0qWCg6w2uCpLIyixBpF8ex9apH0rN+kvE6N23uJ4m6jKlYnr058bTfoj+jqlBYrDQyn9Ca06Zpop9XB2q9MNVJCsz6HAbHxUxwSac25XCVXatlX0X8EGdywlWFzeAU7Hp6MUFAB/YPLIEQGF9CNeBvyBHg4ddWuQrEK2zJ/z6k4VHSVMV4OBQkhrl3egPG1dPgw/BXPhu95QbA91Tl5uVnitgonfKI3mi0whDdAaXtKoHDsUpSgdW3QhH4vG6RSanUAgChkQNqGVKfIfTIQodNLHxfvIKsX3mOYkd+m8aXW9584uNbIjd5alKZS/Dwq3jt505VaiOhzYB6/1U7pZcGneRzxINkhNmHxN7jCzHAHQ9it8/EGyGx5qtpHsaElX4ZltSBRzEq6uK+RHbUWt5TVKzGTdEYK8HjArFb0zJi3CqEp5SVAeFQF1J4NlH2wcJizkXFs4EBhN9FsQjgtIcx5DwO/wVHzn/Dp+utj6EjHmhd63/pEHS9TL+UOYls2gPnLAHBmNPb0xDqkZoo40m2PXpuXDLnw4cwv7PaZWtwShPMwi3J4cWH297CnrRgLrod26bdo0Ra76zbzRz6IptRQ/fDxje9m5N09S6xZ8c2YbKBoXYjqj7J4Cbpe+nOw6k3sIm9g9+v3B2RVBIJUdCRGVkAUxKdLNXCMKYJLUpSICrTEL1nRfyfTZOcAkru9lWDNGjnDs5KVoWqMfB2215JKbvRpJ1gxnvLD1YKWet19T+mB60oFaEHGW+nBSCJb4pZNTCVsKNjsTmOSklcA06wWpQQgpNUGSKQdh14vVxz5vqQClVcDH1uBafqB4ZdGRFyYFd6mPHmR X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ea3aeef-99fe-41ae-537d-08db31b1d938 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 06:33:32.9507 (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: /NIgzJjXkZI9D2tcP+boXkmwkF9GYqKZ7eZcTDPETiepjNrV8aNMZpYOSpB7yUwPcQfq5ByS6qNMthTrBbyPLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Peng Fan XBAR_DIVBUS and AD_SLOW should set parent to XBAR_AD_DIVPLAT and XBAR_DIVBUS respectively, not the NIC_AD. otherwise we will get wrong clock rate. Fixes: c43a801a5789 ("clk: imx: Add clock driver for imx8ulp") Reviewed-by: Jacky Bai Signed-off-by: Ye Li Signed-off-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8ulp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8ulp.c b/drivers/clk/imx/clk-imx8ulp.c index a07df3b44703..89121037a8f0 100644 --- a/drivers/clk/imx/clk-imx8ulp.c +++ b/drivers/clk/imx/clk-imx8ulp.c @@ -200,8 +200,8 @@ static int imx8ulp_clk_cgc1_init(struct platform_device *pdev) clks[IMX8ULP_CLK_NIC_AD_DIVPLAT] = imx_clk_hw_divider_flags("nic_ad_divplat", "nic_sel", base + 0x34, 21, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); clks[IMX8ULP_CLK_NIC_PER_DIVPLAT] = imx_clk_hw_divider_flags("nic_per_divplat", "nic_ad_divplat", base + 0x34, 14, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); clks[IMX8ULP_CLK_XBAR_AD_DIVPLAT] = imx_clk_hw_divider_flags("xbar_ad_divplat", "nic_ad_divplat", base + 0x38, 14, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_XBAR_DIVBUS] = imx_clk_hw_divider_flags("xbar_divbus", "nic_ad_divplat", base + 0x38, 7, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_XBAR_AD_SLOW] = imx_clk_hw_divider_flags("xbar_ad_slow", "nic_ad_divplat", base + 0x38, 0, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); + clks[IMX8ULP_CLK_XBAR_DIVBUS] = imx_clk_hw_divider_flags("xbar_divbus", "xbar_ad_divplat", base + 0x38, 7, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); + clks[IMX8ULP_CLK_XBAR_AD_SLOW] = imx_clk_hw_divider_flags("xbar_ad_slow", "xbar_divbus", base + 0x38, 0, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); clks[IMX8ULP_CLK_SOSC_DIV1_GATE] = imx_clk_hw_gate_dis("sosc_div1_gate", "sosc", base + 0x108, 7); clks[IMX8ULP_CLK_SOSC_DIV2_GATE] = imx_clk_hw_gate_dis("sosc_div2_gate", "sosc", base + 0x108, 15); From patchwork Fri Mar 31 06:38:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13195270 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C699C76196 for ; Fri, 31 Mar 2023 06:33:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbjCaGdw (ORCPT ); Fri, 31 Mar 2023 02:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbjCaGds (ORCPT ); Fri, 31 Mar 2023 02:33:48 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 125E2191ED; Thu, 30 Mar 2023 23:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=at6QYGqrf3+06h6UIwS24VVJ73AUxUT1zJq0vCXCwj+YT7g/x9dxL0kIsE/P92iA2pNotV71vho8rXaejq+LAzDeSai+FoiEAh+4n9lFjQ02QQ55fPZ3eFq0nLqy+tSSEaALwJpDQUVvNvK+jy6sIm87WjG1YUN4RdGgWqmnivc6y9JkjV/vOMnPOlGwwErNH/xYK8DUHAyB4vTT9VkZi6KFukH74pfkLeBUDSh+mXx/HGZZrnYI4Pi2WJjpxrPqP9qn4vJ5oXAc8nhizmVXgQOtcPGMtzSTlrhJsfmvRt4j+6RHQraeeck9k1GAvXS2AHI/UeRrXw7a1DvIWEP9HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=nCAlVrf7WPXxM4Ec216kAXvFV8loseSRMwzFKq9O5OM=; b=BkwEizVJolug3Jd81OFN17fIAazBZpSdoOeMG9PWFTSw1b0SykEy0eddes+bn5Bg0DeunJ/BDxL97hZfTjUQOuZScDX7uMM61EvSNKbNRMcxXsQhmX1qgaFcZ2sORrzVf6lj5XN/0Fd1ZR8KunG3HuMbYInNWcdVf+P47ULXP5VgFOQNadycMxYa9pYyz/Crg0Olbwk7go3tMn/u4OeHiG7ortgl4MF/kcXT6XC8DRDFAan+2zFtuDcdDCC0+XRzBtwDyYwGWHEz9a8EKc/OxihkK0/eqvfUluPgjPu+nLNqJibPZhHPcuRUKGtPDijJdiLawvebylA8NrqEdfkC5A== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nCAlVrf7WPXxM4Ec216kAXvFV8loseSRMwzFKq9O5OM=; b=knQG5LqMY/Ggq4OEXWxFGKWJrvC0HkKw/z7r6XuXnZh7/vASuLcfkblvZYp1JGXlFS9hGQCz2SrUhDdDJZFEZ1YFnFyVG9bfZ8E7eWJC0NZj96G99t1NNCR6A3JKCLd8bUdfa603DV+ndthpnFrZEC15JU2DzzX/E6mlq7Xw1XY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Fri, 31 Mar 2023 06:33:37 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0%4]) with mapi id 15.20.6222.028; Fri, 31 Mar 2023 06:33:37 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacky Bai , Peng Fan Subject: [PATCH 2/5] clk: imx: imx8ulp: Add divider closest support to get more accurate clock rate Date: Fri, 31 Mar 2023 14:38:11 +0800 Message-Id: <20230331063814.2462059-3-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230331063814.2462059-1-peng.fan@oss.nxp.com> References: <20230331063814.2462059-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::17) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PR3PR04MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: aa69b31c-d622-4d32-486d-08db31b1dbde X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: slm04YQXoxr+gjzit94xe5gn3aja30p5+VHYNXwixD72/GHyMLpMXuQ74VX6wAegWuUrgXN+USgAKkX/e9AsVg/YqsXkq3OiRmg/4EW2l0Ao4M01Vo+6QEZlU4kwxW8P/jkfBX1kPuFUdzSR+3FZVWvsHzf4xMOjiSAZXgYDvL1y6WvuK3nhoEJvpegnmpzXrPgdcFLaiLlTfKGw5QJ9SJaKhrbzCh55zVuuqTalQ6tlNBmnR9Q0obOfegn/LOxzRBWlCdBN1zNBJvgsQyXB59W9R9znxt28+HuYvSZ2JSSsMfr4tpFQWY33of3sw9wlmMXqA/GBg++rSrqgx503VgCWTiCHhhijXoUqNNwB+v2PIoSP7D61Sv+OWO0woMHaGh4c8HUvFiDGRcMRHZqmm9mHdzDPDEQ5RTjt3Dxl1JlXkwAcnYIvPGu8GdK2t6KOup/96KyN/maw7qTIcBz71IY16vjtcjCjZz3XA+sVvIyk7h4WzANaGgfWIvJ09m4hia2ieuqCPuCb8imRpALCxzztWku3QotKN3ja7z+Gxqge7z/JCiW2oZ835uv7Ic9EcHa3v9yKAbUe3qGYb9snQbX3d8O8vwt1OwND/tq/Ld8IRoOKW9C6X8FQlz5N6GdNYlH7zX3TuPXmaMe6p5q8fg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(38100700002)(5660300002)(8936002)(7416002)(66946007)(41300700001)(38350700002)(4326008)(8676002)(66476007)(66556008)(6486002)(83380400001)(2616005)(54906003)(6512007)(26005)(1076003)(186003)(6666004)(86362001)(6506007)(2906002)(52116002)(478600001)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LODTunL2bRxGj8K1jiLlbf2NA4uDzWVuwn3Qo4zZDiPH7SN5MMuW1IW07HKX78ghJ/J+CtltWJwmt1vJhcf0f2kbcoMlqd+n6JZCedLgp6FcBe0RBfzc7NDc0A288YQP5V+lIpvRVuWuSaG87kiT+UYDWzl7ebVf9OWA74MvUejDiW0UbF627ucnBFc9qEYbl8Rc+f4j/qB9eVCR4KcYK/6xj4lRumT+21DBzrSvQ4JUBCvv03sXBr+eGPUaRg5AqNfbX0t60ICpK2cGVB8ndT3cqmJaPKyss3AAlSpuFyPXo5pqnz36LjGJXTEtJfLxToC6IY/4JVQn4n1+herQDVDEXuMIT9w+SiihAnDrluz7GKV4gy4H/49pIIioIBvt0qsPjqUnLaUZAHryIp4YtifXgoG/rZ78oOjUe7VOzqacYSlGicwHjdJz6wdG/W5Df/OhK05M3Gfif2V/cfYAmPqeDNAYnBd8AHPizg+vdY8IDvqXM/u7cjMWRzq9fp7LRcDTAjsuaeDGECZ+wZfFeUBBzjcnPxrmlh81wPOqRBxvrlbKNDOw0ymf7A8zGw0/HnOWOabrh3wj7YHpHmon8trX3cd3HJFSe9bFzx9yeSupwWvv4/6/SRoz4DhDrbP1BtEaBOrZPxqdJJQQtR8cxJq23oyymfoAD1UITP1iiCERD2NZvxW2LYO2bl+o5oJbdqIncmnnMFbTqx+Y7aYt3jJnY0zB2ensewymajs7R2npbRhjqHeYe73VX7R+625+1fDNXdSLLW+7hwxWc5YZgzRqGFwaQs5ru5dEP5e9cPZXBT+lLGr3drHm+lidKNhAkydh4okpsusaZmRSMVuKgt1j1oQEABKW7Wy5ZLWDnyqKRGnMTN0NJHtr2Saqro4302/JRUrbBEgBk7Af4DNNINqHEQMm+TL080+y87EM2RYKF+AfT5tpAvxh1X9+NRefOVvFhr2SUzUajHmV7UdVALa8qk8ghYVxsopxEKIvEIM9LyCTKqLBZeA2aLo+cISvH5cUAutm4imIXZksvMK3A9IbzAFf3jlbC2Zq6UdyALPstlgq8QJ//iAOnT4m43B6FdGYmizziYP+aZrKArGnX49CTecru+1Dr7t8rAhM0cV675FFMCGHkD2r9fsY4fWpdiE3xSp7RIN0Wd7Z6JF0xoKkj+slAFfJI7PhO+fcMNsv8HVrcR0F1rHKHbqyk7CsXzqqOWITguLrJPowGK1drrF8YnCIGh9GhAtjBnCZu/YXCEwsJzywJtSBY2oTtsGxCO2m0L6/ADZjVKFIEa5Ea+cfqN5uesiAiFSxt0yX/Hg5IP6HqZrisHDtoM+3bjSpVBilV/+GCW95ERytcvxytmZCYDkwPe07Wa2pWygS98mJp4JrcgmlKHg+w0XV6VUdRp2PjF4eoKskQwBLG9QDObvfNVYXxv0S90GZUPe5OCWoq0kDAw9TzK+6SRYahqFALqS1cXL1fdbKp9lwiNUckivEuJhY3KDBr2cTK4sElPbXImcPgwMGBH1QdCrUhPSub5OsaJj3/gfsbYIJU07tUiAx+6KmRo/S1hfxWFEoYicxsTtOXsfTjNmKL3k8zzx5 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa69b31c-d622-4d32-486d-08db31b1dbde X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 06:33:37.4104 (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: pTqe7ll0Uh7cfrj3yU78I02GYfIafA3bVg6d/Ulj5aG4p2eXe4/LeFZBOTJFIdfk3NT8IHdv4hnDqR7mmusoVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Jacky Bai If a divider's parent clock has fractional part, it will hard to round out a more accurate clock rate for this divider, add the 'CLK_DIVIDER_ROUND_CLOSEST' flags for such divider to get a more accurate clock rate. Reviewed-by: Peng Fan Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8ulp.c | 16 ++++++++-------- drivers/clk/imx/clk.h | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/clk/imx/clk-imx8ulp.c b/drivers/clk/imx/clk-imx8ulp.c index 89121037a8f0..3cf4b094dfff 100644 --- a/drivers/clk/imx/clk-imx8ulp.c +++ b/drivers/clk/imx/clk-imx8ulp.c @@ -275,14 +275,14 @@ static int imx8ulp_clk_cgc2_init(struct platform_device *pdev) clks[IMX8ULP_CLK_PLL4_PFD2_DIV2_GATE] = imx_clk_hw_gate_dis("pll4_pfd2_div2_gate", "pll4_pfd2", base + 0x60c, 15); clks[IMX8ULP_CLK_PLL4_PFD3_DIV1_GATE] = imx_clk_hw_gate_dis("pll4_pfd3_div1_gate", "pll4_pfd3", base + 0x60c, 23); clks[IMX8ULP_CLK_PLL4_PFD3_DIV2_GATE] = imx_clk_hw_gate_dis("pll4_pfd3_div2_gate", "pll4_pfd3", base + 0x60c, 31); - clks[IMX8ULP_CLK_PLL4_PFD0_DIV1] = imx_clk_hw_divider("pll4_pfd0_div1", "pll4_pfd0_div1_gate", base + 0x608, 0, 6); - clks[IMX8ULP_CLK_PLL4_PFD0_DIV2] = imx_clk_hw_divider("pll4_pfd0_div2", "pll4_pfd0_div2_gate", base + 0x608, 8, 6); - clks[IMX8ULP_CLK_PLL4_PFD1_DIV1] = imx_clk_hw_divider("pll4_pfd1_div1", "pll4_pfd1_div1_gate", base + 0x608, 16, 6); - clks[IMX8ULP_CLK_PLL4_PFD1_DIV2] = imx_clk_hw_divider("pll4_pfd1_div2", "pll4_pfd1_div2_gate", base + 0x608, 24, 6); - clks[IMX8ULP_CLK_PLL4_PFD2_DIV1] = imx_clk_hw_divider("pll4_pfd2_div1", "pll4_pfd2_div1_gate", base + 0x60c, 0, 6); - clks[IMX8ULP_CLK_PLL4_PFD2_DIV2] = imx_clk_hw_divider("pll4_pfd2_div2", "pll4_pfd2_div2_gate", base + 0x60c, 8, 6); - clks[IMX8ULP_CLK_PLL4_PFD3_DIV1] = imx_clk_hw_divider("pll4_pfd3_div1", "pll4_pfd3_div1_gate", base + 0x60c, 16, 6); - clks[IMX8ULP_CLK_PLL4_PFD3_DIV2] = imx_clk_hw_divider("pll4_pfd3_div2", "pll4_pfd3_div2_gate", base + 0x60c, 24, 6); + clks[IMX8ULP_CLK_PLL4_PFD0_DIV1] = imx_clk_hw_divider_closest("pll4_pfd0_div1", "pll4_pfd0_div1_gate", base + 0x608, 0, 6); + clks[IMX8ULP_CLK_PLL4_PFD0_DIV2] = imx_clk_hw_divider_closest("pll4_pfd0_div2", "pll4_pfd0_div2_gate", base + 0x608, 8, 6); + clks[IMX8ULP_CLK_PLL4_PFD1_DIV1] = imx_clk_hw_divider_closest("pll4_pfd1_div1", "pll4_pfd1_div1_gate", base + 0x608, 16, 6); + clks[IMX8ULP_CLK_PLL4_PFD1_DIV2] = imx_clk_hw_divider_closest("pll4_pfd1_div2", "pll4_pfd1_div2_gate", base + 0x608, 24, 6); + clks[IMX8ULP_CLK_PLL4_PFD2_DIV1] = imx_clk_hw_divider_closest("pll4_pfd2_div1", "pll4_pfd2_div1_gate", base + 0x60c, 0, 6); + clks[IMX8ULP_CLK_PLL4_PFD2_DIV2] = imx_clk_hw_divider_closest("pll4_pfd2_div2", "pll4_pfd2_div2_gate", base + 0x60c, 8, 6); + clks[IMX8ULP_CLK_PLL4_PFD3_DIV1] = imx_clk_hw_divider_closest("pll4_pfd3_div1", "pll4_pfd3_div1_gate", base + 0x60c, 16, 6); + clks[IMX8ULP_CLK_PLL4_PFD3_DIV2] = imx_clk_hw_divider_closest("pll4_pfd3_div2", "pll4_pfd3_div2_gate", base + 0x60c, 24, 6); clks[IMX8ULP_CLK_CGC2_SOSC_DIV1_GATE] = imx_clk_hw_gate_dis("cgc2_sosc_div1_gate", "sosc", base + 0x108, 7); clks[IMX8ULP_CLK_CGC2_SOSC_DIV2_GATE] = imx_clk_hw_gate_dis("cgc2_sosc_div2_gate", "sosc", base + 0x108, 15); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index bb105d6e5b39..ca1f75eb3197 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -356,6 +356,15 @@ static inline struct clk_hw *imx_clk_hw_fixed_factor(const char *name, CLK_SET_RATE_PARENT, mult, div); } +static inline struct clk_hw *imx_clk_hw_divider_closest(const char *name, + const char *parent, + void __iomem *reg, u8 shift, + u8 width) +{ + return clk_hw_register_divider(NULL, name, parent, 0, + reg, shift, width, CLK_DIVIDER_ROUND_CLOSEST, &imx_ccm_lock); +} + static inline struct clk_hw *__imx_clk_hw_divider(const char *name, const char *parent, void __iomem *reg, u8 shift, From patchwork Fri Mar 31 06:38:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13195271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72098C76196 for ; Fri, 31 Mar 2023 06:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230216AbjCaGe0 (ORCPT ); Fri, 31 Mar 2023 02:34:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbjCaGeH (ORCPT ); Fri, 31 Mar 2023 02:34:07 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE751CB80; Thu, 30 Mar 2023 23:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDRgD2Ed3tq6pC0XXk2aNNQt34EnVsIom+UieSSBL0PdhoJe/ZcSIG+fVXUckUkWhzSUtW5DNxsFAdo5Yp7IXxXkLtaXgH0owm370lH2/fe6ihaUs2gBXiRg2eOJY9+ze6cABvGZ2XSTYIB66qsQmZd02SLjJuxCBJJBY77YcMHrN83Jo3L1ZxYWHYHSt+e/9tlplWFMwD6vu4AmvlIHq7sPeNt/0Rvya7a35xIaCacwwuRqBtxup4qlBQe4oZt4WPL2oly6yyYuJByU25QXSJQAATUYjLyoIV7ESYZdbv0ZxVEMWTiJHemd7WlQUpdScsJS3Uw3u8BzkN6AUc5WWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=PY5uwQC9+WsuyirzBJZcLQntfeLaO9VQUhQhxE+Kbf8=; b=HPm7i7F/a0B6E3QKn7BOa0SaU9nUqlz9zI5uL8BZjPmYFcAwGrNmekli54rT1oqrYJJ7jNrcIB61oxzhGEaJUCMRqFtctqKPTFjyHptupxOoW//WJbvfsHSSwDE0lEGcAueqSzMIA5IxqECHDJ1iN/Gn7r65zCbBODfTvHGQ7WkHzffv1bdusegyEUQD2gM9jfqQf1XmiSBAwC6nPlN1RwjotVoDnP8e2wlaewXkUK6s3cQgucXb6ZYFRA2yXcRnsxRC8q2zkmXF+hwJyXnv0PKO30Mevi0n++AAUVT0Qe2srDhrhFQL02pShunCTmo+X68217FSzrWVhLQEoad4Lg== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PY5uwQC9+WsuyirzBJZcLQntfeLaO9VQUhQhxE+Kbf8=; b=le691XHMZIl7Du+cmC/Tb9GhxzY2nQPWiubztAbmFQBX2lXralPeGR+EqQwC33z4jDY+0klT2lnBmZxr4+3KSPi9VX+XnbVrTczOfZqV6hzx9wjZ72SEeFrNPsUVw9HeEDMyQSon5I5HprRCC/K0MqhFM3riVJS1JZA2WTqv9BM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Fri, 31 Mar 2023 06:33:41 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0%4]) with mapi id 15.20.6222.028; Fri, 31 Mar 2023 06:33:41 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacky Bai , Peng Fan Subject: [PATCH 3/5] clk: imx: imx8ulp: keep MU0_B clock enabled always Date: Fri, 31 Mar 2023 14:38:12 +0800 Message-Id: <20230331063814.2462059-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230331063814.2462059-1-peng.fan@oss.nxp.com> References: <20230331063814.2462059-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::17) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PR3PR04MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: 01a83280-091c-429c-4861-08db31b1de81 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iTs4s61CJJRXse5zk5XYxVcC3jIqrL4GooI1qqMyMOOSRJQWyX3iQpiLHPJFqqPNbM2z0ePTTY/XFZfZqflyrOt7iorDq9v7rdWbbMLRgLIZCO1MQhtLAqo9ahgJqvjQJLpEqdoOHGEJK6yeNEoRVI1/gFl3O533t9YFbvzoU3SyTM14uMb5atmcToi5iYUrSSztR3YsxuXQjS7n5FDxB5FbStioIq/GwYetQb87JaiA4Y6CDIndL97Vh33iHX/IiekXWTYCDq3KW6m79p9mf+c2feDOXoKUy4AOe0JbFKA3TH4WkSQmKmioSZNJKOhb2B2Prvx3BFYE3Zjwa1TaTYtNPw2+0rwj/hEDg0oYBqeLpTpv6DV9JOoMuAxb9UmEjIx3cjhlMowDzAL62x8de0jKxiTX6s3cOKibg7V4hOZo6ho8RNi+oiWzslB6Lv35VbTZNGic93hYY6qcuMSidrTwYpvgr7l6tHxhseot92Ou69kj7HR+letwWE2H/C18TXj9B+Nv/m1dVIlqvhAYJgnk9qkQtC9+3Xzy2r8UVnnkHqfCNWDoyTLSn4ZfSQ1gaBfGrHySQqmS2PVTKtC/oSAi/GLTEjPXeBkpTmPqY4upvZNP5BuygBMKxMKn1J6xZRUiyctnRiB+zsAHBWcQfA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(38100700002)(5660300002)(8936002)(7416002)(66946007)(41300700001)(38350700002)(4326008)(8676002)(66476007)(66556008)(6486002)(83380400001)(2616005)(54906003)(6512007)(26005)(1076003)(186003)(6666004)(86362001)(6506007)(2906002)(52116002)(478600001)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /kfmnYCY+Xn+T4IulkjhyiYZzpWAuSV384MHmA+w5HN26EyiY4VcN+CH8/m9mwyqhcIs+ta0jWhIr9P3ixBqbkRPCMBfE2k7p+12dmRCDKEegU0Ddx1H5cr6lmkqAM+GKDdImg/AT/7WMngVmIfo69RVCHdgAaHCt46f7aSHOk1oOnKuc5tz+OjfUvZWkelI1iEhy/0feOFNWtgIkLQJ8u+FEttNhLwwUmWAVHvJi7F9c6dwmF+xqIaguz50O10GKYmBjU0WsWeE1ml7XZQyp72/s4VnRInomxNv59OfW7DHMOSkDCd2v3CpeUOs86Fg1Qz8nR/tqtnjts4v30+bLBm8Q4fDpe5FS7mk5MqnvyHVgNBd+H90XWG2yfo1OxrrgXWaXjJlpC/5pvvhHGLAh99gZfJBvMDdEDgI3+3u0NERmtb/8Ay+0Qxsd6lZOXd7RXOXD9Bi7sae7FRPaSqVUAeVmuZlmrE3BXfYyjUC2LIXo+07dYncdk47cu7FecVhx0hO8L061/3wua8xQmBEMN771td/TpPI4VdN+U5Fur9AFbzG590+hXoyKVgvzPQBFgsS7EZ9vnm9ePp3c1QO5wD5zictHaKouvSIQUGFb5EIIxWM+eKv+lwGwGyfOuXJr/VhFOwTKoHr8N5ZGuRuL9wWQNBh37eHldx9QFdiKxJhHcBSt89WFZlPqw4RA7RcbCEGOqPasP++gCxR8fkywuMjudzFAowWIGqZ3QUDCYqaNaaB2kQx6n5OPQKqih4wZNdiBaEBXZrLyjlUlDt4fWdwJV26KPeE9A6lLaaL20kpKmaQz9ZKZZuppTRMIEoYtk+9e7y+HHhqzs/U2TFd6fHBVC2ur/AlbOKm4hjk1z7gIo0vRyGDBo2h4QjMjfQ8HbY0EWoyYXG0G7o9Ue4wxplHPUn2cFuvpcURX7QUqdXArZcds74PSvaEtgiQQFjqAZWwc9p/5mnuQdKp+MeO9fVu329RqoSPKEUHmv9jvUrecZ0JTC4e9Byt+ZrfHMumv20NdOaVei8SsferCiJwubEzHVW/fsvTVSN7PAsqyYsH+IYkYhWaDwquC4RKUEzs3MUnoKCGyDsz7W5F70hCduXNx075Wu4tTWU6AEyg1ybXykDDyEd/oCukwLU5nBnP/7pKO6CNkDQAs4+x2oRh7FAwjXCCwNS1sPI0Apov6du3RvmNkCKwv5QuHf3V2xdC8BUG+9E7q1Fcc+h2p9oPsBvEQr+uarEqt/aIa0UCq2Qu8dWJ/Cw1wC5rf30/Yl8zTjjITjC6FQ/E3Hk5rnLMQd1lnkklqDknm/D9XkkINg3OcKNaWHA76aqQU3c9StREKVqsQmoYSFJvdcyPB89ZzjClCdpf3WVXIJ+GyWRee4Le5bPkvSKjNwdqxN+k16EwHKpXsGe4E8xYyzhjPA5A/0+SALqYOu9wX6mMDCPt5enyLUpXK6GDYU1fEufMzKSRV1vsIa4zwwRN7vQMVYv8XUGV3gzeNM0+VGIVrHBdfFwo1zxrEnOI+OBSYKQQ6oIEEBKj1tF/HTOUF7lsgt7SrmGCfONKVBLhQM+9LQ8PAmzHArFKkPvKKMlQ4PG0yVS0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01a83280-091c-429c-4861-08db31b1de81 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 06:33:41.8626 (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: ya82YARoqyKN4HFEGYFHKNVTDxuud3II3PlSo6stcwR/K2AnE2BCvd5IhWtQdYa2ULjmaV6e45HMsQFNMw/9uQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Jacky Bai Keep the A35<->M33 MU0_B clock enabled always for low power communication. Reviewed-by: Peng Fan Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8ulp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8ulp.c b/drivers/clk/imx/clk-imx8ulp.c index 3cf4b094dfff..0dd48e8159ee 100644 --- a/drivers/clk/imx/clk-imx8ulp.c +++ b/drivers/clk/imx/clk-imx8ulp.c @@ -376,7 +376,7 @@ static int imx8ulp_clk_pcc3_init(struct platform_device *pdev) clks[IMX8ULP_CLK_DMA1_CH29] = imx_clk_hw_gate("pcc_dma1_ch29", "xbar_ad_divplat", base + 0x7c, 30); clks[IMX8ULP_CLK_DMA1_CH30] = imx_clk_hw_gate("pcc_dma1_ch30", "xbar_ad_divplat", base + 0x80, 30); clks[IMX8ULP_CLK_DMA1_CH31] = imx_clk_hw_gate("pcc_dma1_ch31", "xbar_ad_divplat", base + 0x84, 30); - clks[IMX8ULP_CLK_MU0_B] = imx_clk_hw_gate("mu0_b", "xbar_ad_divplat", base + 0x88, 30); + clks[IMX8ULP_CLK_MU0_B] = imx_clk_hw_gate_flags("mu0_b", "xbar_ad_divplat", base + 0x88, 30, CLK_IS_CRITICAL); clks[IMX8ULP_CLK_MU3_A] = imx_clk_hw_gate("mu3_a", "xbar_ad_divplat", base + 0x8c, 30); imx_check_clk_hws(clks, clk_data->num); From patchwork Fri Mar 31 06:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13195272 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF7F0C6FD18 for ; Fri, 31 Mar 2023 06:34:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230076AbjCaGel (ORCPT ); Fri, 31 Mar 2023 02:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjCaGeb (ORCPT ); Fri, 31 Mar 2023 02:34:31 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB0E191FC; Thu, 30 Mar 2023 23:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S1N8CdvycLCkZMzLknB92BJLSwkP/MKOww+bXJaWy7PVla/dJDCMT/olF9A/6cciefXQuQ+vSTVyEALL1TUp1OP2h7QYtkFsXRl6BiA0joUFs2eLksmjfJKk7fAJrdfmqoJDHYN7X1DfVKKpbZGPTEYIPi8LGwTOIEBDzyCYnE40TwOaUBf3TwTBLt52+EemPpMXhsBHbQIhxLgqN6LtG6ztD+Nnb1qbIE41wAMPdYEG+uqQLXlXrtY3dIOJ+4dcXMFCi7Hkv5mj231IaRQS3ceHZzg9RZMuycgK0k9kfw6yM+eKueMy3VRF4C4HwyPYUCl3sxSG+s1UEGZ8IpNEcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=g52e/gArTcO74d8AJAS9yrysCvbKh/YZMc+MCbysIW4=; b=YlSwl9OMtcpeU6gA2tHpG7hQAcLvrqMC0XkS/tNmjhNXo2TdcB3081O3aR+b1WaVXqZlVJkebARMkRXnB+rzOkHNm3LJaunKvci5r4f4LM2wD4eQVSaSIWKxRgeOH3vjmn+9v06uBm4b3XKnO32084zM8r3t0oPPuDiFtSHxyuPHLlzyN3OQF1pUWS4Uo9qryVET5y2rwuAPygkSos7etelo3K7Kd9joPui20UFGAfjr5xY7I8Hz8jCfgTQD9Y+9oQqnfRmkbzM4DdxtyoheXcfl2n4q2NLzsBRUdMJ2Yh8qqt1uf82z/pQmHgvs0i8EY2ehz40s0eb1HZOvAAjkiA== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g52e/gArTcO74d8AJAS9yrysCvbKh/YZMc+MCbysIW4=; b=K2W9JHqEBcw9zkRzqG9BSt58bgDeMwMmlfTAx/JeD78YmBu1QX5z3DbA2OXJKFLNgbMwTSEzCLLx29ha5mpZxfeyuTk+PkkbfKQ+dN7cJvilS0YiNNoaO1LoIWucgTSx4sPmMXQOx7bsv0Cwjs5Gf5KrBrLdKMl+akB0atQPblg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Fri, 31 Mar 2023 06:33:46 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0%4]) with mapi id 15.20.6222.028; Fri, 31 Mar 2023 06:33:46 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacky Bai , Peng Fan Subject: [PATCH 4/5] clk: imx: imx8ulp: Add tpm5 clock as critical gate clock Date: Fri, 31 Mar 2023 14:38:13 +0800 Message-Id: <20230331063814.2462059-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230331063814.2462059-1-peng.fan@oss.nxp.com> References: <20230331063814.2462059-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::17) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PR3PR04MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: c03f6511-e737-4f7c-7162-08db31b1e14f X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0E35tkqs7n609v8Xt9YPC9wlaDCBTacZyn/6553ChM43m6HyKDsepB66tZS8c7pR78MZaVNGTJX56wMP3TuLbvp7aDx2xFqort6lqFxtNpiNKkZvJOUVPiFDfHiVLIpmWR+4ebp5fZUQ5V6A0nM8Z+VnwSlttuo7cVZuOktMgm4vFL0OaF91rE8UnhDxlD2kPUuwVsGqm3R562+SuxTacc+HDCqrb9gUAslSgEccu1DZDu49HOR+9nS2tbg2RpdENsDVY51mrYyygYXDjrWc78lu2CJsBRETNjaM4JFtOoXX+Hp2yeRvhJgCdlrh4LrIRjgimMNBksBYfcZo/MQh/OqxK72cReEDyLJo2dMXetV5ONMqpazLgwww0cDFDLqDqE7jIHYXb7M2jbcrOBPD0B6bHp4aGE//hjw8Nm7X1HzlzW1MNF5MU/lVsFaUIyBAG+mg9l1DrSza+ZCI1p3gx8QW+xp9GSHTOjqe3FUlOjGGpdh1fwQhNxrgCh7aYZ27msyCAxEjvV+6OnrlwChIjmzkaSBo66yFG+WBDO4aZ3ZE7vkX0xx2esqMw2gg7+QWvg/Onk35sjnOGeDgku1kterkSrht1RBVw5jO7rYMKIhPNZ9DgDUDgvw/ma4L9sXd5MH5yF+flZQxQz2+vRAzoA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(38100700002)(5660300002)(8936002)(7416002)(66946007)(41300700001)(38350700002)(4326008)(8676002)(66476007)(66556008)(6486002)(83380400001)(2616005)(54906003)(6512007)(26005)(1076003)(186003)(6666004)(86362001)(6506007)(2906002)(52116002)(478600001)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vmMKAfyl7Ypl2gEaAoi/9ASB0HOsnGoLtyV9BrxlEdkq5RevR4N/hEUDUQQJFrJ1H28iIQ2gEvEbaL+ky2sp0zG89pq2Yfho+tuRHHHp5Ed3nmHHE22yM6zOqvGubE6j7WtTRxfjVNnzQsovGoK3Ts52j5dzAWbWL/Y8boQCVSV5607geshLylejepSWvkQM/54HozISaNBF7ufj+PNJZrDAwhryOAnp+6gO0/XQZyqJEj/81ugVVJmnaX7jdK+M3WfXB7Cw5uKINVlLEKAE0wapjS4xOaPi7DCYBMbZm7AEIS3VAfpTjmO0mk4vGsJYsjA3ItduJc6/sSinjSvQTyZ1fR4HVERpUex65XZmMuzPuQcN7LSqKVGQGO7kH1IQFPKhEOqrxJHkqQJ+JzhcxudRzHo887k50etx3OUAQF17tt1yZKA4e+0rFuA+I4tIXT8YFN/2M7Y+5p/wbG7c5MIcX/2snGU5tKReNcz7Y42GyR3FEIHSNzeQcYT83+fktb6YT8rW7kpaMz8rN67p2zB2//uXeMXz6v9gKcMQD/jMGJai0+nsYmx6cWUZ7lXoWW+GalRmizG2lN2IIV995UyyiXZSfCLZiowK7fmSG7+d/qWS+Vo6w/o4ELS/5aRN/rjB9zPdHHeBtb+3bQE9rUwG1Ftf3jU4Fz82LSeW2Q+frXS+PgVQjer/EoGAFqmgtbcME1B61g3rErBfg4k1XZ597JpSbR8yjvpdQiGfEsDdZMyPMCcRBMvtCGgU7pc2azIKVvsGdc+Aoe3GX+GufzKEjj8l8pRxqGnknhjZY9wrcxCqySYTj1KJe4XALCSLta21hdzAN8h+30C5eWI9tQbb99JdrCWfi3sCsuwGw2SassTTeFxMnCeoFjSsLdA4ZwHssIeaTwzI39AmF6+l05GVD47Rir4CtEE0PEoE/ikM5kq2Gk6CGP3wpKnaZKBgISzY2RlaxBm47WcUL7vll+i6MaT4buII5bsvlacX3gedJKMUiVkrpKqenW+7GmDYY0IK6ueDCBxPxnOU1PkCUHg21VDDBS8oaULxJ+PRrzfY20+AgSaXFzJ0kbRs9qDKQRHdlCyPS/qBVnPb7xovh6KZKHozfirOoD2/HXrfNqzTmRLgJ/33iYc6OFE33+4DCixCQa9hCCSpsza9TwsHw1L8xPWZfDL3DOypsNcwObLKDGWGr6Dhc7OkTVF/q2Z9vNskrxn/ABRiAnC9jEyft+wgMOzEzdDcZlNVGyujOU9jIohvDvv4iJdV7xv7rc0mHAQpn4qi9sr3vL7y+e2wLMQe0Wb2dCeCfeZgEhOYZQTIh9fCSN0obfXuFYVjiOkA8RdKmYvd5SGBZ/TIrfiCNvYoH6MtuRzrobruWszSLkGmxTsbTOmlOq7KI9nP87HEevWtpWySjznU+ivFt4vGVoWjhXnO2iz+bIpGEGmtWfF/5DaFExZUWfH1r5+MVCDaFbDhn1ky1xQNDBDuNWmW5Ww/fPEo6RcAnHLO5UJy/9CzrryDvuiy8YtZaecZ3MX/g9aZJ++8MpkEEqHzPoBaL0brR/9mYScuMRkzN4KHIZfbt02RkKLr8k+WiKJGsZJx X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c03f6511-e737-4f7c-7162-08db31b1e14f X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 06:33:46.4273 (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: YBLGSYH/rkfJm9GMIqeJ/H2xUqbU3JDCeGjV+Jg73P9KnSKVjo4im2VE69QopvuovtISMutNFFDPKqm/AKfKAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Jacky Bai The TPM5 is used for broadcast timer purpose and registered with TIMER_OF_DECLARE. As the clock driver is not ready at that stage, so the TPM5 clock is configured in bootloader(TF-A). if we just remove the TPM5 clock from linux will introduce a risk that the TPM5's parent clock will be gated, then lead to TPM's channel control config can NOT be written into register successfully. Due to the above reason, we still need to add the TPM5 clock into linux clock but register it as a simple critical gate clock to make sure its parent is always on. Reviewed-by: Peng Fan Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8ulp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8ulp.c b/drivers/clk/imx/clk-imx8ulp.c index 0dd48e8159ee..6a8a9e50d826 100644 --- a/drivers/clk/imx/clk-imx8ulp.c +++ b/drivers/clk/imx/clk-imx8ulp.c @@ -333,7 +333,6 @@ static int imx8ulp_clk_pcc3_init(struct platform_device *pdev) clks[IMX8ULP_CLK_WDOG4] = imx8ulp_clk_hw_composite("wdog4", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xac, 1); clks[IMX8ULP_CLK_LPIT1] = imx8ulp_clk_hw_composite("lpit1", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xc8, 1); clks[IMX8ULP_CLK_TPM4] = imx8ulp_clk_hw_composite("tpm4", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xcc, 1); - clks[IMX8ULP_CLK_TPM5] = imx8ulp_clk_hw_composite("tpm5", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xd0, 1); clks[IMX8ULP_CLK_FLEXIO1] = imx8ulp_clk_hw_composite("flexio1", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xd4, 1); clks[IMX8ULP_CLK_I3C2] = imx8ulp_clk_hw_composite("i3c2", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xd8, 1); clks[IMX8ULP_CLK_LPI2C4] = imx8ulp_clk_hw_composite("lpi2c4", pcc3_periph_bus_sels, ARRAY_SIZE(pcc3_periph_bus_sels), true, true, true, base + 0xdc, 1); @@ -378,6 +377,7 @@ static int imx8ulp_clk_pcc3_init(struct platform_device *pdev) clks[IMX8ULP_CLK_DMA1_CH31] = imx_clk_hw_gate("pcc_dma1_ch31", "xbar_ad_divplat", base + 0x84, 30); clks[IMX8ULP_CLK_MU0_B] = imx_clk_hw_gate_flags("mu0_b", "xbar_ad_divplat", base + 0x88, 30, CLK_IS_CRITICAL); clks[IMX8ULP_CLK_MU3_A] = imx_clk_hw_gate("mu3_a", "xbar_ad_divplat", base + 0x8c, 30); + clks[IMX8ULP_CLK_TPM5] = imx_clk_hw_gate_flags("tpm5", "sosc_div2", base + 0xd0, 30, CLK_IS_CRITICAL); imx_check_clk_hws(clks, clk_data->num); From patchwork Fri Mar 31 06:38:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13195273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90D4EC77B60 for ; Fri, 31 Mar 2023 06:34:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbjCaGe5 (ORCPT ); Fri, 31 Mar 2023 02:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbjCaGez (ORCPT ); Fri, 31 Mar 2023 02:34:55 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2058.outbound.protection.outlook.com [40.107.8.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85333191E2; Thu, 30 Mar 2023 23:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QHpoK7oxxdXXtFtjO+yp+qLOJEugTnZG/EemMROlStLjoPRrp6hB1A2LoSUstQ2eSaip+g+KIFopNajPS5GdP9CbeuTvNWYoFRgkplPbc8Pl35/7048Kw9Ue9HdLunpVCTYYvuICsZysbw7XfOvqNrDkOPFA1gQeWhKi6FTzYVInYhaQQXm6xYFOQmhVcMOVLAwGEHbatjsw0WqJUuymdX8AoKEOG6c7xPjSLl8vB1Lupsm0ZaWYOORNN+Ao/0PN7SBRbjUQlbrroeGoUW6Of1E8iYYbV+K3pc+Mimu9Ey8eI8hzAcu8iPtfulsPQbGfFH5Gn9PrIDnPk2+fkOFygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/+kk5vVtHszPsy7VkfxiCED1bhqOtpUvT/dSaLfIVvI=; b=FAECDbrsqDw+vJcqn2NLra19ys2LTV9G/6Fzp+ejZV8rhdEn8LAWfE0EcFq0cWr93dTpgHVOUDga26Sy/3DdFCO3NHVqvJqwGseysim6qoa8Uarmert1G8a7Bg+AU30V4tWfxCOcsrOKb3324rjpzj8E/tAIC1rDF6CTqxWzxZYFoXeKb+hXXLjOpr9BwqPa5F7fYYVT+tkrzFNDk+8DaqRkp9vs6YCO5yTMFulyFfkyAnYtlxtxCyosFXYAqFVninso+N7ZBaltajvRcuDLEtyW2uG8YAAK7TAimA8XrxXJPrQYeXdJ5mXWOKMf5CJCKrQPS/0aUZbedh1PHIETeQ== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/+kk5vVtHszPsy7VkfxiCED1bhqOtpUvT/dSaLfIVvI=; b=RFAk6etxMdW7QrUXEA0paQrwDapWKzr7m4Uz4gbpfLpQ1jc5OO+RpCi6k2Q5yMZi8E3FcPI4R9pZsf4nNa+ABBujpyBh05BNZUBv8XLV66BSaKa3dcUnrtq+zwYAGi92lKWFD7cAj3d6QN81ABpyM2CvsBeMSeQ46NQbXC1bVaY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by PR3PR04MB7356.eurprd04.prod.outlook.com (2603:10a6:102:8d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.21; Fri, 31 Mar 2023 06:33:51 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::778e:19d0:cba0:5cc0%4]) with mapi id 15.20.6222.028; Fri, 31 Mar 2023 06:33:51 +0000 From: "Peng Fan (OSS)" To: abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-imx@nxp.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacky Bai , Ye Li , Peng Fan Subject: [PATCH 5/5] clk: imx: imx8ulp: update clk flag for system critical clock Date: Fri, 31 Mar 2023 14:38:14 +0800 Message-Id: <20230331063814.2462059-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230331063814.2462059-1-peng.fan@oss.nxp.com> References: <20230331063814.2462059-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2P153CA0030.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::17) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PR3PR04MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: d0607f0a-0e05-4b8f-e432-08db31b1e40e X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qhEo31x2WaZktsy/3iOsQ3gF5BIXO/KkwG17Ad6lhpmK7Qbu8nNHAQeyXYQUZpMX0Df331+pO8j7QdT1lfoW3/Yb6WUes3YIjBpdtSNeRf6EOet+vMVTivzc/wFQ8VBOBwlNShsB38hmZebdfA7xcvFroSy/hV4OQ4NziswA45K7/i/whZygus4sYAeKhMiRP7hHIcVIjxbTSumUlVEXD/Kw8q+5tHiy7FHK+Dmr9PknzFv9qX0W1k7z89I5An9hUwp0pPThNbmFnZrghbvv7tpk0fqGx94M6Fnqu91xBiaiQtmFPs9opgIiJgyshHnqmpCjnw4aSRHVrYFX+0ibIjiOJUEY3FJZtvbo8IsIWDnYBSdHKBBpskfAXXV/UhLenOiuYSWADmAz9hx7j0ky01wqjGBnvgrQNq6przwT4q1mvmxxKx8/bzEsq2HnsEHA9AN0DzyC/BU2IcvaiAR41AnRZwE8fO1Do9rTl0RY1drPu0x8tnvh9QgDzWrojY1gR7a7oxu6WYwfd0KYniFxprASuU+p2gFLexqSgMaFSDBRYq6vFtEuW4J1F0dcsL5PMZGuzaaRUz1+T5LMhYTS91vt8XdjM+CEX0G5TrBxrQ78pp5qPKrNPA0JPGtZXFnMTs45pCrKSVE6FWbbPIZvnQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(451199021)(38100700002)(5660300002)(8936002)(7416002)(66946007)(41300700001)(38350700002)(4326008)(8676002)(66476007)(66556008)(6486002)(83380400001)(2616005)(54906003)(6512007)(26005)(1076003)(186003)(6666004)(86362001)(6506007)(2906002)(52116002)(15650500001)(478600001)(316002)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eE4HPr24Pba9F9mPqQxIZD0L0rctOQ0tq0y/bBszFatG1jW+kw1C7iMqT0aFWmmcO6zz7IFEdA9XqMGywr1KYBN8FOSLeyuuRjb2f8NoME2LgV2+BYsCSi0wmWEvbsprWgBXlyiRzubQdNhZJjsB4TRwKx4TN6kZTN9Jav7YivfETMcKeWG1HzR7lkpLQ56W+tDO95bZIT+0R9GBCktF6SnyOS/gBJ5f3WwgDncwLNYmn5m6cG5Z9vtxk+epUIsRKsW3xe1U0Jdjc88rTXnS82xAOIuhUO3ctLGL82+LphHwaFW+GM/R78cHB1tHIQMX8NxGVvR79aRWVlMLUHYRDUNTN9/meq/xLWaE2p+Dv9CUUOyVfj6dAvesnCdAuuQhNOlbYK6f1RpJk7SQxZL4dCmmOLH0U/LASEjKCZniV3BkTIImOy5NTc/cLx1gQ8s9QiWtHSy0mINVTWkd+NiVMaQFgLC1tntMTQreEcIS/pEf8NryHmjMy/BxZWfXs8BGlg7emwrPdHvBR19Ywm5FqB+cqaWykmi0ouZTH9dGOZzd4ICeS7QGukarva4zC3Zo2heLztfVLGp5JW9oDA42lp24GB4mQXKK5i/Up1mvGsYnjIJ1ze2rjrmFGzk5z8GOVWuip/bxH3VZd4IeXfNegaEnsNK1hsallByXeaWXVXcnR2yAnUMiCWFtDhA+a0DXfDcV0RyJVX1JJpfPseUa5e3xnL+K91nJFP5RHRogpZmY+Bsl0X3j1jBnN68QQhuw1CNwFSRVM2R3f0U6gq8EAYUaK+j9/1VWdyoPT9PBzLq0+cKQdQ5IcxfIJGxJ2j0CPjVXtPlljDIaLOqMVxOz+WdYdXApBWnjO0DQIM6fZRNgAFp0qEQ03+77b/ki5zF6d7u93uTzi3oN/dtsFECdwoPbkmMNYvPTOO6QW8Tej/g1qA2dNp3f/W0VF+1FO2/SRu7Mmxc+8KrO+8zrr6e3x23q3LdbHoavo/diD58VXAh+kzNBRdMdxsKZsrmwkocoBG3LjAdt4OB+4MsK7T5S8unk8YrgikSnTQazxKJxQQnkIfgJLTr7bpF3O4AcPRBTyFsu6CQl4SIjJnuNxNaSGG7n2XP5KtZAUBA10LWtN3Js6j06tiNhpVCHl0EANCU5A63paWgQFm8NuLl2JpbwBthbEv20QCm7Ee7Q7BMjtRlaWmGTKYOxQ8M7di78mEfBZdajkQPMUrnxhIw0L8Ln3Ju3pBSM77OnSk8Ilg//Vo+xqKeh0FE9aA0uxyE1LCIj9C2K1638uiE3KSM+jCxuj05RUVr5hXFhU4To9a3qodNNstLRujwLaxmKNFE64IaauW5HWU2aaIuo9anIEC9rozYnOe/rzNmm7yHwGlHPfDpTQLaGHKVAVV4Xr5NxgyIzD8Jey7RKowV/mtIZlEDPTQ/CJ5zqDeJLEtW/LYkMEmQWSjLdvNRxi2ABRYmuM6ubLcW+Hvz+barA8G/utjDwVcbhQ7h8ebma2zScqzQcFDHGHzYV/1/jbBK9WGNFVJCPJ6efbNKVCVyuzdIkrTKwcluWy509FNv2vH43uMW8WfjAySlMXEthNc6fLwqlBnZs X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0607f0a-0e05-4b8f-e432-08db31b1e40e X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2023 06:33:51.0744 (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: QMZxVO24i50YZ4LvYFIFK9XYLm8lXi2fleU8m/4OMSNh+KpJlZFfUoQVTSatBFzTjXBR5013GCnkW1YZthtkVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR04MB7356 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org From: Jacky Bai In order to support bus fabric clock frequency changed on the fly, need to update some bus clocks'flags to make sure these clocks'frequency and parent can be changed on the fly. For these clocks, HW can make sure no glitch will be introduced when changing on the fly. In order to support DDR DFS, the HW register bit for DDR_SEL and DDR_DIV clock will be modified by TF-A. So need to update these two clock's flag to make sure that the linux kernel side can correct these clocks' SW state to reflect the actual HW state. Reviewed-by: Ye Li Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8ulp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/clk/imx/clk-imx8ulp.c b/drivers/clk/imx/clk-imx8ulp.c index 6a8a9e50d826..e308c88cb801 100644 --- a/drivers/clk/imx/clk-imx8ulp.c +++ b/drivers/clk/imx/clk-imx8ulp.c @@ -198,10 +198,10 @@ static int imx8ulp_clk_cgc1_init(struct platform_device *pdev) clks[IMX8ULP_CLK_NIC_SEL] = imx_clk_hw_mux2("nic_sel", base + 0x34, 28, 2, nic_sels, ARRAY_SIZE(nic_sels)); clks[IMX8ULP_CLK_NIC_AD_DIVPLAT] = imx_clk_hw_divider_flags("nic_ad_divplat", "nic_sel", base + 0x34, 21, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_NIC_PER_DIVPLAT] = imx_clk_hw_divider_flags("nic_per_divplat", "nic_ad_divplat", base + 0x34, 14, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_XBAR_AD_DIVPLAT] = imx_clk_hw_divider_flags("xbar_ad_divplat", "nic_ad_divplat", base + 0x38, 14, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_XBAR_DIVBUS] = imx_clk_hw_divider_flags("xbar_divbus", "xbar_ad_divplat", base + 0x38, 7, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_XBAR_AD_SLOW] = imx_clk_hw_divider_flags("xbar_ad_slow", "xbar_divbus", base + 0x38, 0, 6, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); + clks[IMX8ULP_CLK_NIC_PER_DIVPLAT] = imx_clk_hw_divider_flags("nic_per_divplat", "nic_ad_divplat", base + 0x34, 14, 6, CLK_SET_RATE_PARENT); + clks[IMX8ULP_CLK_XBAR_AD_DIVPLAT] = imx_clk_hw_divider_flags("xbar_ad_divplat", "nic_ad_divplat", base + 0x38, 14, 6, CLK_SET_RATE_PARENT); + clks[IMX8ULP_CLK_XBAR_DIVBUS] = imx_clk_hw_divider_flags("xbar_divbus", "xbar_ad_divplat", base + 0x38, 7, 6, CLK_SET_RATE_PARENT); + clks[IMX8ULP_CLK_XBAR_AD_SLOW] = imx_clk_hw_divider_flags("xbar_ad_slow", "xbar_divbus", base + 0x38, 0, 6, CLK_SET_RATE_PARENT); clks[IMX8ULP_CLK_SOSC_DIV1_GATE] = imx_clk_hw_gate_dis("sosc_div1_gate", "sosc", base + 0x108, 7); clks[IMX8ULP_CLK_SOSC_DIV2_GATE] = imx_clk_hw_gate_dis("sosc_div2_gate", "sosc", base + 0x108, 15); @@ -255,9 +255,9 @@ static int imx8ulp_clk_cgc2_init(struct platform_device *pdev) clks[IMX8ULP_CLK_HIFI_DIVCORE] = imx_clk_hw_divider("hifi_core_div", "hifi_sel", base + 0x14, 21, 6); clks[IMX8ULP_CLK_HIFI_DIVPLAT] = imx_clk_hw_divider("hifi_plat_div", "hifi_core_div", base + 0x14, 14, 6); - clks[IMX8ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x40, 28, 3, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_SET_PARENT_GATE); - clks[IMX8ULP_CLK_DDR_DIV] = imx_clk_hw_divider_flags("ddr_div", "ddr_sel", base + 0x40, 21, 6, CLK_IS_CRITICAL); - clks[IMX8ULP_CLK_LPAV_AXI_SEL] = imx_clk_hw_mux("lpav_sel", base + 0x3c, 28, 2, lpav_sels, ARRAY_SIZE(lpav_sels)); + clks[IMX8ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x40, 28, 3, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_GET_RATE_NOCACHE); + clks[IMX8ULP_CLK_DDR_DIV] = imx_clk_hw_divider_flags("ddr_div", "ddr_sel", base + 0x40, 21, 6, CLK_IS_CRITICAL | CLK_GET_RATE_NOCACHE); + clks[IMX8ULP_CLK_LPAV_AXI_SEL] = imx_clk_hw_mux2("lpav_sel", base + 0x3c, 28, 2, lpav_sels, ARRAY_SIZE(lpav_sels)); clks[IMX8ULP_CLK_LPAV_AXI_DIV] = imx_clk_hw_divider_flags("lpav_axi_div", "lpav_sel", base + 0x3c, 21, 6, CLK_IS_CRITICAL); clks[IMX8ULP_CLK_LPAV_AHB_DIV] = imx_clk_hw_divider_flags("lpav_ahb_div", "lpav_axi_div", base + 0x3c, 14, 6, CLK_IS_CRITICAL); clks[IMX8ULP_CLK_LPAV_BUS_DIV] = imx_clk_hw_divider_flags("lpav_bus_div", "lpav_axi_div", base + 0x3c, 7, 6, CLK_IS_CRITICAL);