From patchwork Mon Aug 15 01:30:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 597361 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 1B469C25B0F for ; Mon, 15 Aug 2022 01:29:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232680AbiHOB3S (ORCPT ); Sun, 14 Aug 2022 21:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232704AbiHOB3P (ORCPT ); Sun, 14 Aug 2022 21:29:15 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70055.outbound.protection.outlook.com [40.107.7.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FFA81277C; Sun, 14 Aug 2022 18:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RrAJusjHPeC6XQOZn38D5WQmxW9k8HTr24s4nxyAWEThLD/xAYbTFODVc1fbD8J0LvNL5R8EiSOJryoHBaLoVdan5YrVqop5gkO6v+So6dfDXeeQ/FH5HNH3NBg41i0MVrO8Vnz/lzYMbhLgwKJRCZPkxL9Nw7EleYBUsIGDkeqjH8t0kC0OneoSQvrkr2xnh8R0gcf5SAuu6BRND/YN1cEjGEzlNeR18zQAhLi3MHJxqhEbek6aN9YHN3i4dsNAPc/i+LxdpbCYQZ7wZTvv2RiWtbyYTDPEoKl3bg66PSTJ8j0qOKv51nR6DYv8HNsJgqzi3PGWnFLe+oofUNNYLA== 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=UQdrXYbCpt2AIq5hLIrTY8Tv7M41vNXpp82+rvN1BlU=; b=nWv60MG7Bda+sPL8prch8LeblathTc2DLDCGbhv/2mVCxyknxO8CxnApqqxjtU8EWH1FY14G+VL6GcDhmZmIK54h/21J68dmpX3SuvZJnzWSb9O+y8q6sKlIBAJwZ8w0ElDW4OgAYPkz+2QBfE6QQ/Lm7aOQ0I8YmDzzr/H/ug2pMYsxutCawRcf+dm5Zt8xrdpmvL2ywcYvgtHnLlxyPGf3Y9mOqctqm9WdR45U1JN9bmrXNH6Ucu7cikTZ6H5UJ7T6MyUjgYUM17/F6AjO04jSjRQwrceiMh5KKZBBZBd592sCXRVFBCabxHysqVzE71XImYYMlkz5k9PESz65Eg== 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=UQdrXYbCpt2AIq5hLIrTY8Tv7M41vNXpp82+rvN1BlU=; b=FCpKCtJSxfcY6AoiieMctZaArpHOPB/bYYLyp/qrhO8bWYzee81TcBya9zLhdFQwfuwChw2fCnvBwzU+rkuHseF6d/04AsSYfX5yc+EoKYhLDB+iaRQd4Lar0ULA+GOmw/fx0jSFcjZnvCpDykHUvzSId1QZsVIEbPiAeOu01FE= 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 AM6PR0402MB3734.eurprd04.prod.outlook.com (2603:10a6:209:1b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Mon, 15 Aug 2022 01:29:11 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442%4]) with mapi id 15.20.5525.011; Mon, 15 Aug 2022 01:29:11 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Peng Fan , Rob Herring Subject: [PATCH V2 1/8] dt-bindings: clock: imx93-clock: add more MU/SAI clocks Date: Mon, 15 Aug 2022 09:30:32 +0800 Message-Id: <20220815013039.474970-2-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220815013039.474970-1-peng.fan@oss.nxp.com> References: <20220815013039.474970-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0112.apcprd02.prod.outlook.com (2603:1096:4:92::28) 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-Office365-Filtering-Correlation-Id: 7e0c32e2-59b4-4717-0018-08da7e5d8e39 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3734:EE_ 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: QShw4fafGbjpXItV3bPG7ohZdnrAkhdthKaM9eb6vFeIGVs8HkRmSm5FC3KilTIC4DNsEYbSutZRz1DbzCZGhNzRuzDNIw681bo8kkDyjl/P5HVmWlmMkhmFazJJ1V3nCIDbli8PLkTHYB7qRnafAuRLnBLv4wkQsJArn07Jh+sudVkF75arsyW4F5vfTDv8DPzRy/5s2DrdJZ4KpNfNNuF4T5iTOQLj+fZt6mNIUMonCznzPAPmL1ODGO4wE6/XESfU5abuioB+AA4lgb5yh8b0vfgF1b1uGneDoxp1k7aeCGiTmeqOfW6eTRJscBcIczYhNVewnNTkrYhPPKyC04U/BbjJyod4aAsUgb3lT7lfg7LLYRNY5ihhzRxcRrin0XNzrXWxJfZNQgLwXp/ouodSlhegQmlt9OvOoKajQHyhkoj1k6AmJEo/FwumWBQJpzzlvn89DdTRvkgxnEzY9LOUqysZ6UKnmTh8TpXotyut5NbKGGj4FOWKtEaVe0xT9NPXzIaX+hkHHwPSxouor60mOZV3As4BwV7GqzKYQhXlB3OZ8EeN4vSQrxbZwc+R2ACDPA52GbjtMT+8cqMgkSDKcac+vsD3ugtTqLT9mMw/GY5VKljVO+zEUGySomQHbIPkjm2C3p3qM8wMrM9iE4ko5d6JsYq67feKjd9KekC90yvygQ21ZI26PzSWUhxDH+XBq8mNyedgljEB0UTl/YEOmGYR2c48HSoNDz+A2tize6rZ9oJ8vYcBOiWfxk6zsGyjUaPxnp8xtJ9lftDcG5sklO64kOYww3+iWjfebMzgVs8SLRnEy5PySDU4rLGk 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:(13230016)(4636009)(366004)(376002)(39860400002)(396003)(346002)(136003)(38350700002)(86362001)(52116002)(186003)(2616005)(26005)(83380400001)(6506007)(6512007)(1076003)(6666004)(6486002)(54906003)(41300700001)(478600001)(316002)(8936002)(5660300002)(7416002)(8676002)(66946007)(38100700002)(66556008)(66476007)(4326008)(2906002)(4744005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9VdR+3YXFWjj2rVLN7lb2suSGZUNm3lr5nmyoOJZa47uYXAjgtudYPpY7Fxf1nZNazpF27+abSV1c77A6SzZiW8ldITZplBTgeAs2r1kShJajGeIKNA66dEQTNsv+qh7gwK0d13eejaa++Y7CxsVUymf0DP2oEtIn6G/xeD14Q29NesZx2xOoSZ26uMDv7sggwb9iKmHk9TubRIQw4XY/VV3tpKePqCqAnSKZVPwvMx03u0fN5cs0a37HB9qwn+nNI7Y3zMTWMsfT6CbICEUNsFRgliXqBJiIOIwgmQjz8Ea8tvpyGj4AUIlDI/AYyxcUVowHD6ZF7fnShDmQMa8HZvgwcMWjWu6EqINMxtYk2fcDk0Jd0v/xdKm4uT4U2Tdos0NvB0NkOzS8BfNJZE2bA5SkKmoachegNW+26Wrf2nBUtM8M5NUImwrJthgG+no6PkMxAQpZn+2mzCXreAUtwkDNCj8mnWj6HlntHVX0QM3JD3vSwvb8ScMz4ZqdIb5E6Lfw5d45DUekrVhmX3cOgEv/ycpeI3BNS5rH0SXocQszjeULQLLP4vokNRFYNVWBsfn0FLVbG1xXflAU8aurL46hPVWYuWJF424+3K1+twS+19HCixdY9WCNQn1iFyIvvrPPxpWFwtnY6sx3FSYztgjSzDmX1ZjTJmpTn/VfDiht3Q3kaQyL3RUFEfwZBuEcT2+/7fAxHy970rU2K+TU+jryeMfA37YjFg+oW9lYnEPl/CsGr9zIUWQaulHI9gTxDPuvqGclhrpwDTHZVAJXSYg3gv0m8rIFixDClvggDWQVO+wbztZEIUY8MwpXy2yrnl24VBx2+xmtxCmB1zl2uA1TkvN9rax+ii+lEd6z6EvngaL33+eoaXPhSPSTYcDP1+9iiWB6eu1FhH3cmgzBGyinspcncPVva7hUOB4HYJs+HMCN+ZIRoLC2hlxNiF6EgB/nPgMI3ChQATL03xetsnYjcm33a8prXuU8/HNfba5kwwUNx+ndrnw6ScDesTLgnc0DXKn4aRQCb5KcIJcPScDw4fFnzX0QGpFnXAXq59014SPTxp+OyT3F0ZmX9dY25TTeE2dKS4HDswbv9FhE40DHsaKqWoccz56t+xR/5u04IY1M9IZryd5KdKoU4DYz8Qc6smeAx8vgDL2Shpasp4a4To/TCFeZ7sKlhzEPwFegURRdYr+5kQZK/OlfId3YRovWue37MYiT2/LoawqU64DXaYVmcdHzm38OyBScilcj0MsZ+XMxTHGyjzxAIixWBhhTlsYG53kVShVNHYUUpifXn0DxFtTrTB88utKz7cCvgw7BePEUU4Q/dyBXxs8Hv3BH72vx/cx1gkCYmlEfwyikGtTc+xlPJeSNL6ODp+/c8z+2fc20GZgTcAwzHOnYXjvMi29UxibXaGtJ/Xs6HIWr7axJ03818+Ccfzy7T1qdKANFTnBxTzL4YwKTw1sMal3ymvC1fscebRHuiLYu1g2gEO5T5GMyHq0TNbmCjd7l3G0wSN9YdQ8xZ2RameU/wIfAo1b5JzpPAjUGj8dpViNY04T2y1gpR77ccN4wZdGseHNFtmRysi95AstZYg1 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e0c32e2-59b4-4717-0018-08da7e5d8e39 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2022 01:29:11.3098 (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: q7nc5K0ZIEE0k2aWbPRqtC5BAoGj95v1iJz7Br3jZZSnlJXqiikCz4sK8Q84MXtRA5JqiT+bIW+ltPgY3WzFsg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3734 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Add MU[1,2]_[A,B] clock entries. Add SAI IPG clock entries. Acked-by: Rob Herring Signed-off-by: Peng Fan --- include/dt-bindings/clock/imx93-clock.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/dt-bindings/clock/imx93-clock.h b/include/dt-bindings/clock/imx93-clock.h index 21fda9c5cb5e..19bc32788d81 100644 --- a/include/dt-bindings/clock/imx93-clock.h +++ b/include/dt-bindings/clock/imx93-clock.h @@ -196,6 +196,13 @@ #define IMX93_CLK_TMC_GATE 187 #define IMX93_CLK_PMRO_GATE 188 #define IMX93_CLK_32K 189 -#define IMX93_CLK_END 190 +#define IMX93_CLK_SAI1_IPG 190 +#define IMX93_CLK_SAI2_IPG 191 +#define IMX93_CLK_SAI3_IPG 192 +#define IMX93_CLK_MU1_A_GATE 193 +#define IMX93_CLK_MU1_B_GATE 194 +#define IMX93_CLK_MU2_A_GATE 195 +#define IMX93_CLK_MU2_B_GATE 196 +#define IMX93_CLK_END 197 #endif From patchwork Mon Aug 15 01:30:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 597360 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 82CD5C25B08 for ; Mon, 15 Aug 2022 01:29:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238945AbiHOB3f (ORCPT ); Sun, 14 Aug 2022 21:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232831AbiHOB32 (ORCPT ); Sun, 14 Aug 2022 21:29:28 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70048.outbound.protection.outlook.com [40.107.7.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB89E12ACF; Sun, 14 Aug 2022 18:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kdQvnht9MjzeWCG9NFxO5nfIkdHvGxlHH9mmleivSGIrcKBCeNrD329bv+8jMgPk/adTt2eaBFsAObSds4oicdsSZeDTpDu0gVRHH1PWelG8hewTeCOQpeU7XMRhO62QlHvKbES0FE7zFkYBkfp/U+DIRueiXoABScBSL/qBQjO741J6oJUopUEkc7brzVgG2fi0sFJ5Bm+3Ksk6Ck02oshd+n/xxp2v6sF3WDBBHTnXIIiHC3hWPpktv26GsAfLKCpaiiX9M7GVnb/RlhJaH7JfdIT5H6/utdtzPehMhBZTfXhazA0Vp6zDMl/KRw2yPGNixCOgV7UO6T51gfNEUw== 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=ivgKUzjDKNEQ0r5X3TQv2v5Y8znbdxKl89Cf0P7ewYE=; b=mXjLICghd8yznXFrLnuyTic/Yitkhi13Gwvy1mLRIxRteCvS58xLaANzVs052EpDf0NUKniXmE8r8qPIMRopTcGXfrQZ1gdOHKPmJkgYTXTIxMEp0n8AZ/fbvu1mOAfsPxzQpTqzzI8uCBCwRr7tK9NH88hWwgDfS2pKVa0GHFty4IwpuRPf4eYEXqFCTyJwdwyv3y95JPKskOe74948uRn+CeJNP30MjEXZMC6+GItWsDrdpg+dzJa5xlTbvogbnNAW5Ga+mJCj8W776SclJ+mBNCsJ4WXnA9vp8pUK2NXx4b0y4sj7PG0UiGypHPCt2MeLUvRkvbYwWwaNSFAbmw== 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=ivgKUzjDKNEQ0r5X3TQv2v5Y8znbdxKl89Cf0P7ewYE=; b=gL9GrbaJcldKZzXLpBBALO97RsCUFjH/TmfBbBWGh85NH1z7kkP4CiWCBYWKSdPxLXrTUFucjEE6C/gp5SQCiyUXRWNf/K+4jsDSR3FW5lGzLFlRGfBUwiBpjU6DMISlAdFzSZvlgOiCTsjhxEINJhTc5WPKGhWnHu55zfKKm5U= 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 AM6PR0402MB3734.eurprd04.prod.outlook.com (2603:10a6:209:1b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Mon, 15 Aug 2022 01:29:21 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442%4]) with mapi id 15.20.5525.011; Mon, 15 Aug 2022 01:29:21 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Peng Fan , Ye Li , Jacky Bai Subject: [PATCH V2 3/8] clk: imx: clk-composite-93: check slice busy Date: Mon, 15 Aug 2022 09:30:34 +0800 Message-Id: <20220815013039.474970-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220815013039.474970-1-peng.fan@oss.nxp.com> References: <20220815013039.474970-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0112.apcprd02.prod.outlook.com (2603:1096:4:92::28) 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-Office365-Filtering-Correlation-Id: f35a3eb5-8adf-4f7b-adbe-08da7e5d9467 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3734:EE_ 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: Ri5GgJddhKxWchH490DnpSr6Ayd47xENYO97On1VKNoTBZG/RsJo9FXK0dCXeTkrQn0nh6J7J4Io19nR/5A3rw9oubVJoJJB7gN9jNo9dxeHaCZpLlrUk3WF6uXWMddTCZFdldNHSU6ZETg+joBgmLQZ6y0lBV6IXoGieeAEgbCsdcvDHsnw7vTDo3BxQry5E4oa5/9as/uAQNbXkAFruPjb0r4qlVAh5GdkYbfLi+fjaANnj9geqOlPYIBjPN4R/+jxUsjzYDPTIZUYV+LLavzxYYyZBrrNezM0nD0C13RAfkcV6EE7RbwFma8JS7OeRp4EwGKmtuOZ5BzwFePgYuT3cNoDRuP50zuYVR7XRfMOrdwv+8s6wm3MiyKrtG2WXUl5jkVqJTA/Z6ZelMP+Bm+LQooGVVCDbyi50/ncvSeIMEEw5KZ8+QZe1KvGvBXeLwmwz91La9jDsLuRge7KV7+eW0LnZZ4p+VVylEFHBOzluQTMHTBite1RvxtymA0Ga7hUmgc/9CG/TK5vFvkWRS7xr4aRHFvqeOgkVnsKA8Yn7xYqmBM3h3xfkFLkeK+c3IUfOjtkSe/F3khJDRSSVm+78O3037xMLYSBFGtjmBHVWoD+Tvp0RFTmKQ4H5ESUCeftz2PX/pRDr4nLxENNZKB14zFCGhk7PDpvTHE+4XDolZUKsVBo3kl+buAilfVX0UjVOiimvFzW5BH+gYIKv3FDVWQc3r/fLSZ1frHD10SyT6R7djPiQdzaMOthTuQC/SZwHhagENr1tufskI6+Swcd/N/U7/esj16SUF7lF+RP1Rvsjuw4CHMKECwXNnog 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:(13230016)(4636009)(366004)(376002)(39860400002)(396003)(346002)(136003)(38350700002)(86362001)(52116002)(186003)(2616005)(26005)(83380400001)(6506007)(6512007)(1076003)(6666004)(6486002)(54906003)(41300700001)(478600001)(316002)(8936002)(5660300002)(7416002)(8676002)(66946007)(38100700002)(66556008)(66476007)(4326008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MnI5MHqNRAIbkPjE7pG1HAiFBTCUx4WLPfXsUDEMLRcAd4gci+sufVIUUsB61D8pgAxrGyVDcW1JVOEHbvFGWR2rw1CwJP/+7hPqZmIGM7hHEktwqZqXbKGvbEAFjo2R2bxIJnEASJZRi9c3mdZX7Zawo4OlzViPeYFr9/TNLnzLu6yWW7rFKgZh1tP2aGKS1VFBzf2OO2C56+0ULol5tyVPDU47Yj8CNvmtbHOUOYCziDKpxXrG6KGgUVS2Pr+B5q5YZ/lTJxthOacFoNl5ByPAmKDMPLkD6PsJFLAw3nEuaYeQRjQcxGg+A39647ntEW0pPhq+r/ay2PoCTVrF8C6XEtDtR/3CearLOhfAjoWlmFVWgTUD5FRLIZt4jipEGE5dSGkU/PwvP6Cnhqpo1MZ/SY1YBRXBv2PW9TTsl8DSoitYpahIXLZF+psdBu7HdmZBRn+ES7E8LYZXg5Pk3kTJmW0fN+QNwfPbiwG1zc3WZdvWr2RimeJsIHnjcrb4VrQN0JLYWueMWQnmTQ4VffKC5meMNmaFtqsGfJhio15NTAo//jffdfxtUbseArO1qicTIZnnXDhoRx7ZUia8qxU9Mhr2ON7UWXVxvtEC0VZlo22rd4jKqhbaQlcAd3Er4lgfN72dH5tG1FaJ23WIQ0yi7+PvAhjVje2aNH0xZ13Vk9iG14pMvh9ovvN/TREvmT7x2714FMeTrRKOiB4F3FunAy6T4t4JBXSN45sd49OYOTFwfUyjvPbp/v0GI8vcjYj/r2WRnvaygIbtc/ADVK0Yi0l6DW4+J0PMIxySVA9tNfn3QjnG6Zongn2ViUVjW8UW2OsHNq+iwTFeeW4+tR9Mn9Xqr7JU93aM4lcHvY0k6EotqNhlicpHdzyb8SuQfoROWT51ucujFznIoStjOZErR1RdQhMyTE7IS+VljcbkkRrhN8i/d0MvyxO+c13jc6Gg8F+5leUFGmcZQQchvpbIoMMdCVd+1xSz/lPSZve4NbC/BSiZnLecsu6Hn4I9lYDVgG7pQdIfDhY86MhRLjX4DzBBrj5e8wriNELY1xGpRceFjxbs0949OKybl6YN6trcBkL04X6vRcdAEsJXuTPPgfb8hQiohUBVVTPwD/iWzog8UuZB39UAd01+OzGftAEVI22933H/LXMB3KUyF6xyvm1QaKsg3O8SCmIQ3wY+niaI/4CHAjw5y6Bn33yqtQQj/0/1ra17TKzj/UWtUF93xjsiyPcJsJdORcA09imRwHDFq29K0fFOKB9weP/Ror60/0+BpHWchbAB1Lpci2+gdFKW0ySXuIi7AAk7BB0lypT+1KW7z0sBOFZrHfswEyKIh0WXR2x3WnbZZ4gtblM59swfOHgZOV1xBtXW5ig9+mlzWxKqTBkx/FQiRe0oFWeHm6RJ+VThDyC/N7VFIR31hP8e5tRJ/c9JMrZ+4fPux8uaX+r/bMJpHbLUBtk08kDHNivHxFwhNZvhz8tm+7BXjAREjr1LPSb1WJE3N3DNv4SVXeVsWJz4sfnZEuALQaFWZoWryLnIEHisS+kQungD1F1QJvKSNmzRim80ZFTySJVvplKJ7P2UyyIJnorq X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f35a3eb5-8adf-4f7b-adbe-08da7e5d9467 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2022 01:29:21.5727 (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: 92PacVlsQEUlTu2q7STVnt/d9KIFf0/jnZtRQKwp4vSI2+wmbvs5AdgLBCHi328ONHNp925kTYZf2LatHXUXpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3734 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan i.MX93 CCM ROOT STAT register has a SLICE_BUSY bit: indication for clock generation logic is applying new setting. 0b - Clock generation logic is not busy. 1b - Clock generation logic is applying new setting. So when set parent/rate/gate, need check this bit. Introduce specific ops to do the work. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai --- drivers/clk/imx/clk-composite-93.c | 163 ++++++++++++++++++++++++++++- 1 file changed, 160 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imx/clk-composite-93.c b/drivers/clk/imx/clk-composite-93.c index b44619aa5ca5..19f4037e6cca 100644 --- a/drivers/clk/imx/clk-composite-93.c +++ b/drivers/clk/imx/clk-composite-93.c @@ -9,20 +9,176 @@ #include #include #include +#include #include #include "clk.h" +#define TIMEOUT_US 500U + #define CCM_DIV_SHIFT 0 #define CCM_DIV_WIDTH 8 #define CCM_MUX_SHIFT 8 #define CCM_MUX_MASK 3 #define CCM_OFF_SHIFT 24 +#define CCM_BUSY_SHIFT 28 +#define STAT_OFFSET 0x4 #define AUTHEN_OFFSET 0x30 #define TZ_NS_SHIFT 9 #define TZ_NS_MASK BIT(9) +static int imx93_clk_composite_wait_ready(struct clk_hw *hw, void __iomem *reg) +{ + int ret; + u32 val; + + ret = readl_poll_timeout_atomic(reg + STAT_OFFSET, val, !(val & BIT(CCM_BUSY_SHIFT)), + 0, TIMEOUT_US); + if (ret) + pr_err("Slice[%s] busy timeout\n", clk_hw_get_name(hw)); + + return ret; +} + +static void imx93_clk_composite_gate_endisable(struct clk_hw *hw, int enable) +{ + struct clk_gate *gate = to_clk_gate(hw); + unsigned long flags; + u32 reg; + + if (gate->lock) + spin_lock_irqsave(gate->lock, flags); + + reg = readl(gate->reg); + + if (enable) + reg &= ~BIT(gate->bit_idx); + else + reg |= BIT(gate->bit_idx); + + writel(reg, gate->reg); + + imx93_clk_composite_wait_ready(hw, gate->reg); + + if (gate->lock) + spin_unlock_irqrestore(gate->lock, flags); +} + +static int imx93_clk_composite_gate_enable(struct clk_hw *hw) +{ + imx93_clk_composite_gate_endisable(hw, 1); + + return 0; +} + +static void imx93_clk_composite_gate_disable(struct clk_hw *hw) +{ + imx93_clk_composite_gate_endisable(hw, 0); +} + +static const struct clk_ops imx93_clk_composite_gate_ops = { + .enable = imx93_clk_composite_gate_enable, + .disable = imx93_clk_composite_gate_disable, + .is_enabled = clk_gate_is_enabled, +}; + +static unsigned long +imx93_clk_composite_divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) +{ + return clk_divider_ops.recalc_rate(hw, parent_rate); +} + +static long +imx93_clk_composite_divider_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *prate) +{ + return clk_divider_ops.round_rate(hw, rate, prate); +} + +static int +imx93_clk_composite_divider_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) +{ + return clk_divider_ops.determine_rate(hw, req); +} + +static int imx93_clk_composite_divider_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_divider *divider = to_clk_divider(hw); + int value; + unsigned long flags = 0; + u32 val; + int ret; + + value = divider_get_val(rate, parent_rate, divider->table, divider->width, divider->flags); + if (value < 0) + return value; + + if (divider->lock) + spin_lock_irqsave(divider->lock, flags); + + val = readl(divider->reg); + val &= ~(clk_div_mask(divider->width) << divider->shift); + val |= (u32)value << divider->shift; + writel(val, divider->reg); + + ret = imx93_clk_composite_wait_ready(hw, divider->reg); + + if (divider->lock) + spin_unlock_irqrestore(divider->lock, flags); + + return ret; +} + +static const struct clk_ops imx93_clk_composite_divider_ops = { + .recalc_rate = imx93_clk_composite_divider_recalc_rate, + .round_rate = imx93_clk_composite_divider_round_rate, + .determine_rate = imx93_clk_composite_divider_determine_rate, + .set_rate = imx93_clk_composite_divider_set_rate, +}; + +static u8 imx93_clk_composite_mux_get_parent(struct clk_hw *hw) +{ + return clk_mux_ops.get_parent(hw); +} + +static int imx93_clk_composite_mux_set_parent(struct clk_hw *hw, u8 index) +{ + struct clk_mux *mux = to_clk_mux(hw); + u32 val = clk_mux_index_to_val(mux->table, mux->flags, index); + unsigned long flags = 0; + u32 reg; + int ret; + + if (mux->lock) + spin_lock_irqsave(mux->lock, flags); + + reg = readl(mux->reg); + reg &= ~(mux->mask << mux->shift); + val = val << mux->shift; + reg |= val; + writel(reg, mux->reg); + + ret = imx93_clk_composite_wait_ready(hw, mux->reg); + + if (mux->lock) + spin_unlock_irqrestore(mux->lock, flags); + + return ret; +} + +static int +imx93_clk_composite_mux_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) +{ + return clk_mux_ops.determine_rate(hw, req); +} + +static const struct clk_ops imx93_clk_composite_mux_ops = { + .get_parent = imx93_clk_composite_mux_get_parent, + .set_parent = imx93_clk_composite_mux_set_parent, + .determine_rate = imx93_clk_composite_mux_determine_rate, +}; + struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *parent_names, int num_parents, void __iomem *reg, unsigned long flags) @@ -74,9 +230,10 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p gate->flags = CLK_GATE_SET_TO_DISABLE; hw = clk_hw_register_composite(NULL, name, parent_names, num_parents, - mux_hw, &clk_mux_ops, div_hw, - &clk_divider_ops, gate_hw, - &clk_gate_ops, flags | CLK_SET_RATE_NO_REPARENT); + mux_hw, &imx93_clk_composite_mux_ops, div_hw, + &imx93_clk_composite_divider_ops, gate_hw, + &imx93_clk_composite_gate_ops, + flags | CLK_SET_RATE_NO_REPARENT); } if (IS_ERR(hw)) From patchwork Mon Aug 15 01:30:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 597359 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 C1D5DC25B06 for ; Mon, 15 Aug 2022 01:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240503AbiHOBaB (ORCPT ); Sun, 14 Aug 2022 21:30:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239893AbiHOB3i (ORCPT ); Sun, 14 Aug 2022 21:29:38 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70077.outbound.protection.outlook.com [40.107.7.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39CF012AAC; Sun, 14 Aug 2022 18:29:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SD5zGy/B5fCAu819Qy57lmybRGtdRqh1InEG5olcJTU6GY7WPPwJqPw6NjPkQDlSoRpwQ3L4F7ki1FCPjNqU5c1zfQqIEZIZLnFkqyMdGvBidSjTExoM07Ek9BqWOtjPXtCUPd08684tASnag75XgnfW/lZO4GBmovcFlEJNtaJ6gqb6VDBBJz0d5zNzOw4heWl5xvkGUq0jHWMXAx4bGk9ZRc7ovJDnhYcdQRzdAQBehvlNridZQ+YhuDWWngXS7TLHPEsR4HJi7OmjQslntW4aS6mTYnbJBuc8DDLT7ZPW0UtXBNq2u/zteXqYPQKm4pQ+52Zkoef/cJGfy19vGw== 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=nCQCaAr8HHthjGkAWhpi/N8DbRuObr7hZbfRNu6zGCA=; b=Hk0XQWCqrkFKtRE4R6+chRL0z7VQjSOZ/Cwj0yOnjqC8PA5lNwvFvx6Na+NqDF7b9RKfvxYDyL0OxVmId8IBq4mXU7YiAmguR6OQDvP2LvbGf8eRv/7AQKP+N15lMrUhGdy+JFfpJZruSLp+sfVJt/bRxjGcv8eDmdPbdN4vvAD+ahisO85e+h9SghxHmIlNwg1qOMo+N+FBrcI+E3CO6zAd2SlByVGL3yXTsIrAB0fI1wji9tw+RurA6xEoQuFdq3qsSGNY48xL0DTegn/2NBajd85Dw2xc9ewoKwioxkIxvNdWaJ4vrbJkqAhKg7BR/RD8UnJ+iCidRgg75auzdg== 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=nCQCaAr8HHthjGkAWhpi/N8DbRuObr7hZbfRNu6zGCA=; b=dp9gmb8jUJy6SBQydxzzn1aDhBr/d7m4ZIyJ4yxhvqVHvdvErU1aDLZ1bhyz4AZpBJJgmsrOvR5ougoum5bD59C+hwabcruMYyLFGfIv/ngF++RQGOez8uzL8hYVRmiyE2xsEgttltTtgO+76Mpsl0fAK+pTuFJN2izkI5C6/iM= 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 AM6PR0402MB3734.eurprd04.prod.outlook.com (2603:10a6:209:1b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Mon, 15 Aug 2022 01:29:32 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442%4]) with mapi id 15.20.5525.011; Mon, 15 Aug 2022 01:29:32 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Peng Fan , Ye Li , Jacky Bai Subject: [PATCH V2 5/8] clk: imx: add i.MX93 clk gate Date: Mon, 15 Aug 2022 09:30:36 +0800 Message-Id: <20220815013039.474970-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220815013039.474970-1-peng.fan@oss.nxp.com> References: <20220815013039.474970-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0112.apcprd02.prod.outlook.com (2603:1096:4:92::28) 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-Office365-Filtering-Correlation-Id: c6be0db7-254f-4a2c-9914-08da7e5d9a92 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3734:EE_ 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: pxgexLdBq6uv6ytmK3Fo8GANV5Zs3cFHHTosvnfxVLlt9O1GH5oCKEdVJeA600evSGGazkuXLZxAL1BtoS5yCXhRgb2jXjXysyyZPabecv8KJsbP+tmiYry7wjfzzWD+9O7O4BYAtMYNA1jpVcrURpN6W9ArY0LOrV35dO7zuU/MKIU8axZKvy+js5CUxRmpxX+dPbYmbpKixtbzBs5AXbzIPsgTNatxHjFZbp4P+iMHCrE3GkczbIPcwWkvlIL39Fajf7n0odf8lkqbMUyO+/zkq/jKe6w2eKA1pE7HBEf4/XDo7yEB4qK44fZITSKieBuoEFZNbjU8O3AYMKMzGLByrVk+ClyQC68fvRMWY9A0HiVwO+hR9GZ4dAJlu2raQhq0nlQsqsnZSXQialz+YDbKEmolUHqy0H/fLdEal63Gsm6TyMlNxjPyw4l2020EJ3zy59A3YlWy4Kf5gtgJ78e6xEVbld73066YJXX8G6YAJw30WrFergOGxXdCHN4WcsDaBpnCmUNszQflUfKdF/UD46S9qiOQM4Vlk7Cc0McpTwPsL+m1TrXC/GmpMvnCijyG6YR/DjwhAF+MEthE6AEnzxK7aGIHBZlrSuFFojnCEy9+d6OIf5ds6CaRuehKNNKlcEugoyxsL/I7djJ4wXfY8X7xw9yF4ji9H6JmXirCcOerg2LiRU7T4YKGd4cRCO+S5RBgv4fUuqYthUp4YBeByX1gVjc0M9A+gyrBx0JRvaf/qPLIaafNNDF9IUvOn4FD3V5E0kZhHSlmhUqfVK7TWMtAvA9lfSl8Vs5IiSc= 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:(13230016)(4636009)(366004)(376002)(39860400002)(396003)(346002)(136003)(38350700002)(86362001)(52116002)(186003)(2616005)(26005)(83380400001)(6506007)(6512007)(1076003)(6486002)(54906003)(41300700001)(478600001)(316002)(8936002)(5660300002)(7416002)(8676002)(66946007)(38100700002)(66556008)(66476007)(4326008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g2TcHjyB4KM5hQtr3SuohJ7snl/s0QsE4qVR4mlMT6gJIej+4WCcIA/oL+GUmjMdQXPjmdci7YbuLW8UtUUjDQoGl3EM8uJqV3Bc/aYnx9TtJMogxxrhqJpSjji+HNMPcUK+YVymq3kYm7yP9gbho6e9gCDd3tJYvGriwwcZ7XmUc2InI6PyKmOTA9xY8V2QqYZrVK1LHy42Q/pgHd3VyxQgFXPZy0VU6HuUBwYSauO5Q5P86FDOmJynvdE8sj1JudjTLmaU0RUBLGBpXuGdqZNzjyYiNWk44PE4C3GYy02o5pcEDp1jDbT4UMfqU6IrFLJDLgzhPCcM0pQd8VgW9mhHYLuUCmbgCaAJfoffGKXbIUHS74qdhhz1LgQfiEqZFE+g1xyL/QFBTTrE8LEunf6LVYNsyNpJNA7xcB2iXGlvp/NE7ez6IBOJNKSbbC7c5PBZ10EVTwsimxCKwZYbabOdjxcUJy6iCQgUPVWXLOkewB0F+8Iyjcj9E4I2fjZYw+L0U0fkIQPYRZL5Jd8KXU6sgBu8HHbvBCMluQZaWjn9ysSYDyveWA6/PxvSnwbRCyVA+UDlgepsAfY3UFE9rNMpVNCycyOuFoULD7DpdIRV8RxCINifSN1o1jlfkqakRQ6Isi8tfw4/O69iGyznxxchsvHLJGJj00T6YsasUMZ4LrkOioWzZiGOEZm/rI6Ij8QM0U4obY/IMLJ4Vw2w+5BiAs3Xhlmi7GMl7GMgqz+71/A7UmjwbH6XxfqXKZMG4MYSFHxGRI34647yCQxgXS88Aevws7jMEBdj+X09izMUgLhjmpeCBZdUhDA7xLpy0Q67EZl2PHJsbXVlQqW+AyHVEC8WzUWENd2W6MDDXkge6+kFIgl5TC2ajL4tRrs1Vo6k9NcIweg0zuePdZmVmIpTZKZVzDQjHFsChDMz/BYZ7FkiAyg7WGYMvvZ/PuKfnfktRDRUPvJBubaLhK99Mox3sRPu4OGTXcyQw8Ho7Qt09/r5JiIU+eImmZqzTxjBASM41OvFhPjPZSBpllT3NciZoOoEGHhlrNPPW2yDNakeydegzGdXDWQ6glJIXPQ7p4akZ+C+urL+jeuRoYIcPDvEeOGqUu8Bdkce4prmg1tqSHG8CaX7OCAxWTHft046sAqmByc9rKY5dlHSn4SUBp2O8NsgLQkA1C0B7/aU6jS1/p4kyOvK12YmoRnLCdJNyvRAFzErO5k54K1Z1ahdi0PpLP09QQUjKgVl7TUaIJop+UJqHksI7Ube8tn4ZZtUstPFin8X5NMpWjrasFkVIkARqzBP79L2xqF29SuNsbSR0HkgJuhIPW+DIaFLarX1UtWPPzvCI5tNTThLPqfFtZmAzmVimPqC9zwYOdMjJxYwuYzNq3a9e2IXhRWLjGyyCqn8u5K6R/85+z4ZZKYSV7uPIbm9Gf9XXfBCJkb9j+KC+3NF1ZFhe1Z59OqE1V18DeJSoJYtJ6rUS/9Uvi3KDLjHSrXNKqLdleQKbJdYUy2RoHsMzfLUVgWEP9MiT4EZ/CV3HTsTDQHKw+osy7NhN814pz6oyjtMr17fjMrZihADp0XglyL1o3v9UQM6o5NH X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6be0db7-254f-4a2c-9914-08da7e5d9a92 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2022 01:29:31.9827 (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: eWtcbzLrf2KkJUiZBiTN9gd/W3Z6wbvSYwIkww+LDHWTgrdct/tQWEJWYmZmbWF2odBXiAkQgBNm4s4JFJcELw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3734 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan i.MX93 LPCG is different from i.MX8M CCGR. Although imx_clk_hw_gate4_flags is used here, it not strictly match i.MX93. i.MX93 has such design: - LPCG_DIRECT use BIT0 as on/off gate when LPCG_AUTHEN CPU_LPM is 0 - LPCG_LPM_CUR use BIT[2:0] as on/off gate when LPCG_AUTHEN CPU_LPM is 1 The current implementation suppose CPU_LPM is 0, and use LPCG_DIRECT BIT[1:0] as on/off gate. Although BIT1 is touched, actually BIT1 is reserved. And imx_clk_hw_gate4_flags use mask 0x3 to determine whether the clk is enabled or not, but i.MX93 LPCG only use BIT0 to control when CPU_LPM is 0. So clk disabled unused during kernel boot not able to gate off the unused clocks. To match i.MX93 LPCG, introduce imx93_clk_gate. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai --- drivers/clk/imx/Makefile | 2 +- drivers/clk/imx/clk-gate-93.c | 199 ++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 4 + 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/imx/clk-gate-93.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 88b9b9285d22..89fe72327788 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -28,7 +28,7 @@ obj-$(CONFIG_CLK_IMX8MN) += clk-imx8mn.o obj-$(CONFIG_CLK_IMX8MP) += clk-imx8mp.o obj-$(CONFIG_CLK_IMX8MQ) += clk-imx8mq.o -obj-$(CONFIG_CLK_IMX93) += clk-imx93.o +obj-$(CONFIG_CLK_IMX93) += clk-imx93.o clk-gate-93.o obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o \ diff --git a/drivers/clk/imx/clk-gate-93.c b/drivers/clk/imx/clk-gate-93.c new file mode 100644 index 000000000000..ceb56b290394 --- /dev/null +++ b/drivers/clk/imx/clk-gate-93.c @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2022 NXP + * + * Peng Fan + */ + +#include +#include +#include +#include +#include +#include + +#include "clk.h" + +#define DIRECT_OFFSET 0x0 + +/* + * 0b000 - LPCG will be OFF in any CPU mode. + * 0b100 - LPCG will be ON in any CPU mode. + */ +#define LPM_SETTING_OFF 0x0 +#define LPM_SETTING_ON 0x4 + +#define LPM_CUR_OFFSET 0x1c + +#define AUTHEN_OFFSET 0x30 +#define CPULPM_EN BIT(2) +#define TZ_NS_SHIFT 9 +#define TZ_NS_MASK BIT(9) + +#define WHITE_LIST_SHIFT 16 + +struct imx93_clk_gate { + struct clk_hw hw; + void __iomem *reg; + u32 bit_idx; + u32 val; + u32 mask; + spinlock_t *lock; + unsigned int *share_count; +}; + +#define to_imx93_clk_gate(_hw) container_of(_hw, struct imx93_clk_gate, hw) + +static void imx93_clk_gate_do_hardware(struct clk_hw *hw, bool enable) +{ + struct imx93_clk_gate *gate = to_imx93_clk_gate(hw); + u32 val; + + val = readl(gate->reg + AUTHEN_OFFSET); + if (val & CPULPM_EN) { + val = enable ? LPM_SETTING_ON : LPM_SETTING_OFF; + writel(val, gate->reg + LPM_CUR_OFFSET); + } else { + val = readl(gate->reg + DIRECT_OFFSET); + val &= ~(gate->mask << gate->bit_idx); + if (enable) + val |= (gate->val & gate->mask) << gate->bit_idx; + writel(val, gate->reg + DIRECT_OFFSET); + } +} + +static int imx93_clk_gate_enable(struct clk_hw *hw) +{ + struct imx93_clk_gate *gate = to_imx93_clk_gate(hw); + unsigned long flags; + + spin_lock_irqsave(gate->lock, flags); + + if (gate->share_count && (*gate->share_count)++ > 0) + goto out; + + imx93_clk_gate_do_hardware(hw, true); +out: + spin_unlock_irqrestore(gate->lock, flags); + + return 0; +} + +static void imx93_clk_gate_disable(struct clk_hw *hw) +{ + struct imx93_clk_gate *gate = to_imx93_clk_gate(hw); + unsigned long flags; + + spin_lock_irqsave(gate->lock, flags); + + if (gate->share_count) { + if (WARN_ON(*gate->share_count == 0)) + goto out; + else if (--(*gate->share_count) > 0) + goto out; + } + + imx93_clk_gate_do_hardware(hw, false); +out: + spin_unlock_irqrestore(gate->lock, flags); +} + +static int imx93_clk_gate_reg_is_enabled(struct imx93_clk_gate *gate) +{ + u32 val = readl(gate->reg + AUTHEN_OFFSET); + + if (val & CPULPM_EN) { + val = readl(gate->reg + LPM_CUR_OFFSET); + if (val == LPM_SETTING_ON) + return 1; + } else { + val = readl(gate->reg); + if (((val >> gate->bit_idx) & gate->mask) == gate->val) + return 1; + } + + return 0; +} + +static int imx93_clk_gate_is_enabled(struct clk_hw *hw) +{ + struct imx93_clk_gate *gate = to_imx93_clk_gate(hw); + unsigned long flags; + int ret; + + spin_lock_irqsave(gate->lock, flags); + + ret = imx93_clk_gate_reg_is_enabled(gate); + + spin_unlock_irqrestore(gate->lock, flags); + + return ret; +} + +static void imx93_clk_gate_disable_unused(struct clk_hw *hw) +{ + struct imx93_clk_gate *gate = to_imx93_clk_gate(hw); + unsigned long flags; + + spin_lock_irqsave(gate->lock, flags); + + if (!gate->share_count || *gate->share_count == 0) + imx93_clk_gate_do_hardware(hw, false); + + spin_unlock_irqrestore(gate->lock, flags); +} + +static const struct clk_ops imx93_clk_gate_ops = { + .enable = imx93_clk_gate_enable, + .disable = imx93_clk_gate_disable, + .disable_unused = imx93_clk_gate_disable_unused, + .is_enabled = imx93_clk_gate_is_enabled, +}; + +static const struct clk_ops imx93_clk_gate_ro_ops = { + .is_enabled = imx93_clk_gate_is_enabled, +}; + +struct clk_hw *imx93_clk_gate(struct device *dev, const char *name, const char *parent_name, + unsigned long flags, void __iomem *reg, u32 bit_idx, u32 val, + u32 mask, u32 domain_id, unsigned int *share_count) +{ + struct imx93_clk_gate *gate; + struct clk_hw *hw; + struct clk_init_data init; + int ret; + u32 authen; + + gate = kzalloc(sizeof(struct imx93_clk_gate), GFP_KERNEL); + if (!gate) + return ERR_PTR(-ENOMEM); + + gate->reg = reg; + gate->lock = &imx_ccm_lock; + gate->bit_idx = bit_idx; + gate->val = val; + gate->mask = mask; + gate->share_count = share_count; + + init.name = name; + init.ops = &imx93_clk_gate_ops; + init.flags = flags | CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE; + init.parent_names = parent_name ? &parent_name : NULL; + init.num_parents = parent_name ? 1 : 0; + + gate->hw.init = &init; + hw = &gate->hw; + + authen = readl(reg + AUTHEN_OFFSET); + if (!(authen & TZ_NS_MASK) || !(authen & BIT(WHITE_LIST_SHIFT + domain_id))) + init.ops = &imx93_clk_gate_ro_ops; + + ret = clk_hw_register(dev, hw); + if (ret) { + kfree(gate); + return ERR_PTR(ret); + } + + return hw; +} +EXPORT_SYMBOL_GPL(imx93_clk_gate); diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 396a5ea75083..dd49f90110e8 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -451,6 +451,10 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, imx93_clk_composite_flags(name, parent_names, num_parents, reg, domain_id \ CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE) +struct clk_hw *imx93_clk_gate(struct device *dev, const char *name, const char *parent_name, + unsigned long flags, void __iomem *reg, u32 bit_idx, u32 val, + u32 mask, u32 domain_id, unsigned int *share_count); + struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, const struct clk_div_table *table, From patchwork Mon Aug 15 01:30:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 597358 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 98F91C25B06 for ; Mon, 15 Aug 2022 01:30:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbiHOBaY (ORCPT ); Sun, 14 Aug 2022 21:30:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240447AbiHOB36 (ORCPT ); Sun, 14 Aug 2022 21:29:58 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80070.outbound.protection.outlook.com [40.107.8.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A2813CCD; Sun, 14 Aug 2022 18:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XwsUrtS7S2ix5vPN3uscacY+6Gmd3iyOPa5cpyZ/ILnaBEiRvxQVv24AmRHdUlrRZ1yxjhNIEts/B5tmysRs2mvQuDUVnTzRDfvNqMisfp9ek2ra36cVHmunO+cr9iS6LTZ+3S2Yc7Azn7iB9RIadEVZ24zyvbA7IBahKe06qL+583+shiPlYKpo1I6NXcpY13s1nn0ACdrJTPcVB1ff9pz2uBmgxrqy/a6FppAys+rAFshUA7+hP5bLJE8gPoj2K2nPA3lw3xtDJoi4lovBX5sPs61VF4idfjj8t7kYKFM81OoBYQRiwe2zViaYlLG15g7R4zBAozCxlJUcQo3Jsw== 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=ooWsHNXuOu7qEVLoAyWWYR3N60VI4BMJLcgz5XR7ATU=; b=EfRAdHL3142uFmufA4u8xj1w7z4Ujh/0kk3xmy6W7zgnNOWfcGeWtGYf46aLHOUUc6pCMC0aObd1buBKSmiejsfq3pUpHadn20thUdL3zbDJ1qHJqc/ibi23MuSh7jRJ6qvRExku1NPrhPTo9ik3WbNlR1FF5cn+RY9dJKdId0U/gj7DLjznKEr1t7QapXu6swavFp/9YaLa/a7/Z6gI+twj8pwfUBivGyHjE68JASINIUXUxqd4ijTh+QjdOXOxE6HDLp9ss/xxmkRQ4ZgLXFqxjZz58Tf0qZ4gxhHg4zwNbhhovK62rPPvyADXE5cJXt5T3gufR5zN12LYW6TeNg== 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=ooWsHNXuOu7qEVLoAyWWYR3N60VI4BMJLcgz5XR7ATU=; b=Vvmet/AbIDCww9jORuwgOIEaiMTVqVsdBF7LureomTS1JGCWfvkfw4U8bqEWMmI6QTHitTRUx1uniTqiGooDy4QMz2aDMoSGh2U0Sroz3k72kx/Yse4/M8LI5ryGM1WdL/brE0SrCZWeRNpImcG3CL+mk84GNjBHmc86kFxq1Ls= 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 PAXPR04MB8751.eurprd04.prod.outlook.com (2603:10a6:102:20d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.10; Mon, 15 Aug 2022 01:29:42 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::3c6c:b7e6:a93d:d442%4]) with mapi id 15.20.5525.011; Mon, 15 Aug 2022 01:29:42 +0000 From: "Peng Fan (OSS)" To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, shawnguo@kernel.org, s.hauer@pengutronix.de, abelvesa@kernel.org, abel.vesa@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Peng Fan , Ye Li , Jacky Bai Subject: [PATCH V2 7/8] clk: imx93: add MU1/2 clock Date: Mon, 15 Aug 2022 09:30:38 +0800 Message-Id: <20220815013039.474970-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220815013039.474970-1-peng.fan@oss.nxp.com> References: <20220815013039.474970-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SG2PR02CA0112.apcprd02.prod.outlook.com (2603:1096:4:92::28) 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-Office365-Filtering-Correlation-Id: f0a31ada-f9bc-4de3-fe7f-08da7e5da0e1 X-MS-TrafficTypeDiagnostic: PAXPR04MB8751:EE_ 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: a3/oanDfMNaVQBGC1liBF/BPLLRcP+/0LVJ+w5MKwb/R4dWXSlKN76FiwjwMaa3PG2CiDBYAJSTGJn3kwsCSBHlGuCb+K33aAxv9pgutCzBG6ypsXGwNrDFjiWpcGOFzUg60WIVK7Jhc853jZBb6Aeag1HmXNfjExrJKClrgW5UTuDtidtkJs5AT0z7Dt77zREPC3AuZbVMS3Hwu7QUHf1HxojQNK/lb3ncQ2OHn74/Hl/ETcBoOFFmQmdYNEvHUSIMEfAof864vSyuQuGAI3Xyq0FYZqH0/JF7ytQvvvwXy62kF/rdOZ29xs9O2Qaenl4GLPY40gTWh5IwAvQISa6VwArWCSK/NvssefIc8B1CcnDPxJ8mVVv1GPZ78K9i+NdzbFmwZZOFIwh5qUTTfsHD4Nyah1cSuDhVlWhW9hWAbiwRWhf9htgGGYJqPDcFcU8zwSuSbIfPN4Sik6CCzkKLPjylBDKtnRU6bV+aw69uJHZJi9MJFOHseFimPqemlsGC19cCCUeXfE8DOwS7Xu628Strwk8tX5i06hkTvZLClUSZ9fbejNEijjf1hUyTb8VFe/TBsNtUmKmRRlSa/+mv5RAN6xqwH1M4hzOy+Vemy7u1/shHE6miw66/p9V6fqUEII4PkDHdZYmy6B5c7WQRHRNlz6W9pR2o9Or1GqstC/US8zpNwVH3+Zlvsm6Wf7J4mpXdRnilkeQCk8y7zzw5KwGVmHWzvLIA6y4bSh+9GZSbMdkwdigi9JgryoWK5AJB3q7yW7Tp+VeV+A9uKsOCLzj/oWIRT3kRwk6pzt1g= 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:(13230016)(4636009)(396003)(376002)(366004)(136003)(39860400002)(346002)(26005)(6506007)(52116002)(54906003)(316002)(6666004)(7416002)(6512007)(83380400001)(1076003)(478600001)(2616005)(186003)(41300700001)(2906002)(38350700002)(86362001)(6486002)(4326008)(5660300002)(8936002)(66476007)(66556008)(38100700002)(66946007)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nAsnescgYCrxtttK1n9i/t9AGGRQnGAYX/NStbr+UvnACNDFHMVaDjSsZTTY/bTukMPoYBkDJrHA+EnMTWS4IYr8TLc0CFX6Xy2vIP8pYmHYVxIkAXNdfWagkJXeNosQ42WtH74QLXkgQIs85QSPBA2/LrpbNuWNwiOvgQUqqjpPG+ethjilznsqrBEBgJ6KhTrIbk0qrsUSLou9JvhXTZTe8Y933RmkH1djnSTF2vm+D2yagRM1YP9lZH+tbMgOBhaM1KoyIkJm5A7I28D2hvpqUYb66yxUqgT4c4ZbayBqvAAizK3mQuNjjGl6+4hC5P8uXOrBvLhEIwv1clMfY63mxLSzUIQGz9pQ1urnyKXj581VydUo8/SE1k2LFhXC9jTQOLNRJAkN+Amgvvc+5crpYJpzDITkMy0k5zd488sDVrWHZmOhuoeTSVmijpBNTiiE9KyaadsE7ToPbrsqaR3VIZ1Cu3bM+m6Cr5u+/df0884Yg//sG16iRxCtz0ZyunBiz0ObW4gRMSH10meTMzu/oXw4G/tZDDCAlhoe/7NiN8zmq3g+w4yoqZfn+QCnSuHNJypgeaYpK1hSPkJtfeeseIdyOpSHHcffrxWIzhvcrCbJYEVLOnWugOtkPS/s6xbrQqkL95Bmve67AL/wQLR6reEo9xEpYVZiP13HOwwJ+sgX4skjEQXk4gHonQ6sPm5UjshfZ6XWs0rGhrVBdmg38CCtI0yC1SQrMm2vUhMlSZ6VAzwKceya40mWmJpZMhLj9iPVxaNZPacadoXJN5LwoE3sO6o7alN5FkaxJgy5iYeoEVz9NKW85IXS6hUB4bLcUcV0V9OoH0OVqvkCP5b55TMnCX5oh83/WktQzh2B3LO/9buoMo0nZQawOiFYWZPlXAWttVjkITCZLAMDRmGpmng9wwJYKxa/ga7pwtcs4p30UWl0UOB+5l3fr/EqHSZiK06UINQqwCzAEUo1sQc+MG9kIdzzIXvRRRzRLhcgWkODnC36dyTRY0s0L+jYRimkPU1ebel1Cc8bQZ+I/c/0pOatSzVr1b7dllhgu1OX1GxdnIzEG1tYsQVDLDGxPvUo31B8Hnc+9uOP/zd4f/qhrwdo+iIzRy8peEWLJ2gZtnGKi5Qtj3gN90SLN8f8zMxVDFbMVvFSGubhNkLyX2DJxUXDCfehZHc9UhwsWa+rJyOdGyBskxgcMAs+Sbp83hM49M2ygudAILrkd/WZN29WJGKo5vXh1Iw02GVd9xFjgsdPbjSt+sS/AVqs7CaRbU0XTlqkEDEdmyBoJvdjUfQdC5Fk7V4mQTItb/uEzQttTqAs6D3mbMPUjDpQUMXmYCcm+C1uWeaOv0ZvD7g4k5bGOC/CJ1ztOKlsEhcAim8vcluHUJEnrDuIc8Nx2nwcQ+rgBT1vxzGQ7XrW+MIOrzHny0LNdgSfghWxK7SN1I0+XaodYkhKJLG5xn2mCA0O3f8M2Mv8b8VmrFJU2m4NTsVIRcnPrKzB6dGiRrd+ipvyhi46TF3nnqlegTrEFZzmpEHbLwcsn/wbGzLQFLgSFZrSCF+66nGho3bIrgTHLYw9AnurpxXeNgkGqbrKwsNW X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0a31ada-f9bc-4de3-fe7f-08da7e5da0e1 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2022 01:29:42.4288 (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: 2hLCLJHQRnVHdwqb7FHeW13a7n/tieYn2JKC1ZNBw+SdOoebIplLl6yA4ifOKxEPjJVTqibmDS4CKMEDm22GSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8751 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The clk tree should be as: bus_aon_root------>\ /--->MU1_B IP -->MU_B gate--> bus_wakeup_root--->/ \--->MU2_B IP bus_aon_root------>\ /--->MU1_A IP -->MU_A gate--> bus_wakeup_root--->/ \--->MU2_A IP So need use shared count gate. And linux use MU_B, so set MU_A clk as CLK_IGNORE_UNUSED. Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai --- drivers/clk/imx/clk-imx93.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index 73d30a2e64b0..4008ab075dfe 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -28,6 +28,8 @@ enum clk_sel { MAX_SEL }; +static u32 share_count_mub; + static const char *parent_names[MAX_SEL][4] = { {"osc_24m", "sys_pll_pfd0_div2", "sys_pll_pfd1_div2", "video_pll"}, {"osc_24m", "sys_pll_pfd0_div2", "sys_pll_pfd1_div2", "sys_pll_pfd2_div2"}, @@ -159,8 +161,10 @@ static const struct imx93_clk_ccgr { { IMX93_CLK_WDOG5_GATE, "wdog5", "osc_24m", 0x8400, }, { IMX93_CLK_SEMA1_GATE, "sema1", "bus_aon_root", 0x8440, }, { IMX93_CLK_SEMA2_GATE, "sema2", "bus_wakeup_root", 0x8480, }, - { IMX93_CLK_MU_A_GATE, "mu_a", "bus_aon_root", 0x84c0, }, - { IMX93_CLK_MU_B_GATE, "mu_b", "bus_aon_root", 0x8500, }, + { IMX93_CLK_MU1_A_GATE, "mu1_a", "bus_aon_root", 0x84c0, CLK_IGNORE_UNUSED }, + { IMX93_CLK_MU2_A_GATE, "mu2_a", "bus_wakeup_root", 0x84c0, CLK_IGNORE_UNUSED }, + { IMX93_CLK_MU1_B_GATE, "mu1_b", "bus_aon_root", 0x8500, 0, &share_count_mub }, + { IMX93_CLK_MU2_B_GATE, "mu2_b", "bus_wakeup_root", 0x8500, 0, &share_count_mub }, { IMX93_CLK_EDMA1_GATE, "edma1", "m33_root", 0x8540, }, { IMX93_CLK_EDMA2_GATE, "edma2", "wakeup_axi_root", 0x8580, }, { IMX93_CLK_FLEXSPI1_GATE, "flexspi", "flexspi_root", 0x8640, },