From patchwork Wed Aug 3 08:17:09 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: 595155 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 E857AC25B06 for ; Wed, 3 Aug 2022 08:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234883AbiHCIQJ (ORCPT ); Wed, 3 Aug 2022 04:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237387AbiHCIPz (ORCPT ); Wed, 3 Aug 2022 04:15:55 -0400 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30077.outbound.protection.outlook.com [40.107.3.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323DD60E2; Wed, 3 Aug 2022 01:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOeK5WzLRroSvJIiHmp8LGIY969fr/ELC5OzqfbIYaakJARYpJhlkCSpFpL0yvPYD/qZo6Xdg5HfD2RvosWEAOIvm1ms1tl7gHzJumNy/Ds706xYIQobLgpQx15B+OcHr+IrbaFnmE0MWtzm4Uc7U+Fh9c4SRW20qq7dJ/ILQ0jvN957ysJJ1OKnnyi20eELuVTAfyGQ6/duXS+ygTPraahwxaiMu0/mLLbz0nVe0jcChhri/q0zoifpM1BmotFEx/Vs+BhXIdEd55fHTOGdvJDHmfs4RIUJo2pidfSMgLRHQ5mcY/P+mqNVXEBMrgmGHg6pfK6Foh1WqGvi8o4Xww== 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=upM2od+mQGjjSmS5JPbpNT0pfKtT2eOu+RlUCIGonr8=; b=WlbMBcdx6+mKZsI2RroaU8HdIDq4LkYgCKynhp2p4urYW84zGTddUYplvd9hucUrq3m4imyGZCp7FHoc7bxAqhfcW0DmJd2dBSRl6yen4UIy2rudRCWZm6YcV2VrtxvQDWc5TEPfAAw9J0RsDCn3E9LLxEu817as1dbtCmd1zHKIsqvDj+y5itkNxwrbrKZX15Ka3ab0JFnLRN34PYWWlyweMPkmvPzJ2RzpxuTrKPzpJsQ8YTav8dk6/sOUSiGexm9iblNkSB3c1LnqBdESKplQBRVg68vbfmMVD5iXUZ8MlT8dh/XQtXbkp4vbLmSSRFIlJIHKkO/YTRzmOF10Xw== 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=upM2od+mQGjjSmS5JPbpNT0pfKtT2eOu+RlUCIGonr8=; b=Dqg4HBxkMr/xCIAHuevejS0GR4JOcqLnLBis0dgMJ3WghvbOGyoB8bDxZpNXmvotwL0GZlzUVGxKEoqfHMZ0fff6+CsDgNIbk/3TttB7rTfrBbtIhpjpbtyTUhrqcyK/uqbQUzU99XC4AidqgGtues8YCpEzWaAflBtyoNIQcN0= 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 AM6PR04MB5560.eurprd04.prod.outlook.com (2603:10a6:20b:9f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.16; Wed, 3 Aug 2022 08:15:50 +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.5504.014; Wed, 3 Aug 2022 08:15:50 +0000 From: "Peng Fan (OSS)" To: abel.vesa@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan , Ye Li , Jacky Bai Subject: [PATCH 3/7] clk: imx: clk-composite-93: check white_list Date: Wed, 3 Aug 2022 16:17:09 +0800 Message-Id: <20220803081713.3504699-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220803081713.3504699-1-peng.fan@oss.nxp.com> References: <20220803081713.3504699-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR01CA0011.apcprd01.prod.exchangelabs.com (2603:1096:4:191::6) 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: ebdb9db0-5ae8-40b8-a67b-08da7528604e X-MS-TrafficTypeDiagnostic: AM6PR04MB5560: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: WOdpER6b3EbNCPOMlT0xwn++GXCLZFXkW2qeXhICMnSGdd7hmI3e4tPj2tjHOkykAjHWZYVNXvtr0MqNqj353vRd1ijLOlMqWZuDpNeh/GNEprBdmAQo33Iepz5cDypTw+9yVgQv1pFm8SpYx6OZISN+gwHWMu/mKFrlL4JCQ9XTZYwr0hRSHb5gS+bLoBYeafgWfPR1Kw7wXFA/KpxwB3I7lpD5SDGdNJ49bAcx4zcU9ROIsxTQjHsbJdMrkoDVqYE+6GcFD71bIzAccsmi7QWKHvB9BMpphHVqjvtNYCoyCFvg6HVHTnGz0xX+FpoeZQh5lexay2fxejjtnuYYle2MjZecTlMKcTGpYrEmVXm3csgeiahq3QTTDnShmwMx+pTe/yFwikAof71+YiYg5UAxOSfoK6fK0jb1Fl5E79XWX34QFs3SvNqdhz6AlDpEqgbgtNl1bj0X4UsQzm8qFGWt6aNthElYQACMkSFxRyDRRSEzpFsioyzLLwF4of5TnOVvDhjJgBv8/z4xYBYnsRilhvnNemybt+XWPvvylN5ZgGEBqzwRQv+IQqzD6V/2S2BB0IsZFeAyGP+VcDk7hLy4IIijs1rQys5QLmMO2cryWWFK/S+wSiTKlXgloejn/wyFvFVeD7o4rJvwl2F0JPepxBFW3F3xm8l8A3fPgAUyy+8OYY6EEPoPNz6Ge0a6Q2bAUnJHUI2J1T2qRH6MSkzXopBL6Tb+u7OtsMq8uwodZVJpqUe/qiGYpHX/CDDzD8rxAL3y/KUV9voUR7YW8S+USR/AyUqCUB4kPOzHoQT8ZL6HdJYPr3IHrUnuXpZp 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)(346002)(376002)(396003)(136003)(39860400002)(38100700002)(38350700002)(52116002)(6486002)(6506007)(6666004)(26005)(6512007)(66556008)(41300700001)(478600001)(66476007)(5660300002)(7416002)(2906002)(86362001)(83380400001)(8676002)(8936002)(4326008)(54906003)(316002)(1076003)(186003)(2616005)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cjGKsn7EByyIjPSY5z4EScORl4yG7AZ/UINGkUHhiWlgxHNkUAK1MnIsEcc95vhhYgpdBCHOkRuZZl6bhgW+bb8yAu12xJS8JM6hRB551GvfSWN/FiZCA82i23xaCiKMD2TZzvrn4Ybn9rjstyi8acL+SeNPUAzHxWQRdCs60C2OUjwecSoyGqq44m2nTIbN1IlSLcHRYIaex5jWsbHdpXoARuWI9EEPuFOFW0A23eZoZCo7gli4L25Sg+2Ioimi/SEUfrHoAHzAhcMSYaKY/tXBhfW5eQ/DvO1V3l5mSNvReoMnigWy3v05btAN2ei+u5oV9ZYHk4DzHShlm7CM8Os7WtaWwxmAhwM5k+N+SC9lOzxQ/R0WUtmOeXrR0Q/tR0Bh2e2S2lex2CJ3Z97VPeiZ2cmACl35m2DIHrnyzeUH//Zm3Uzcvenz9TmF5qsnIiMF/hU66FJw6O9Q604NtYqW3DEyto4+XMbiJMSTFu6PmPWMzcZtf29hdrO+xXYUdL12Ffl59KGKUr/YRH5eDErlOILzwHriZPW4Vl8A08qJ3m5GU9ww6ktJOnNQrokOEdpHfhDGnZG4gcMVqa6Bp3kPII9jkqg1su9KLW/duI/rolZp/FD9vgAE4TWoePnESFosuHZvguwQ7jgjKqJQfzN8k4Kr9SgpdKsKMbL23n4NBLLWWK+lel4Y9oxtVga3gN9uxAA28pxFYW2YJdbRxp9qHdcjqDbTxGx8WeAC9KZK95rlFLhwWc2yVpDTQpOKu+FpZMzEIZyg3tTvVjJA939NUjU/sdxkvur2lZBh+haQhsK0EQUBX7CcQ8iGvwTTVRqxyziqrYE70oRj0N5BK8j69f2/jc/nQJSCSYtZjrhXJNg8PQFTOP9qvADmIKP4pnSUiqFvbA6oQBwKFjnjTI8jkyNChkCX5B/XfCAQCTLdoJtvG/O2QkdpYABG+f5VGMeply5YhzIjp42x8X7Qno7Vx3IZEnbmNQr6s6uagnzk3NiMJB/TYSPRv8WwVVjOC6nnrWI5kL5iQZlUT/Hvb6rxQ7mxK6cGeEnYF5PFL4EYRAi4eo62iuz8TdiTZypVewCEWEjbz+iQvNGOlNmXnIJdtyZpElKwIodDNI5fPIfq8CgUXn5biwKN4ezPm1yk92iLuNSg90OqcpEtWP/1jYZ16JdytkyxFfi6SHHHar0fs7ASlPdqWK20l1rV2LmhHQDuqmB+5k0OHZvae46aZac60KrZWP6MZ1NARO1fiJ6S4CEWX77FC1RFWsngMKJjzfvq32jHTJWcMm7fb1lmQJVHZF5pOl5QiLrQcMRPCmR0v6hSSkG9cOz44MsvmosWklgLAPQN2P5XaoIfHF1Z5Fbo/g3h6Lovokgsf1GLM2vfYPcmMpnGHBTcV+WJw/ZMjRfe+f6xnhFqJz5YnBlJ3V6h88dZbrY9tBHuuWkJeqmx2VPWfqwTCF/BUYS6bZZK/NDClB+53rWTTEsWygrIvTYmUFkWyuC2bclHFDW6LxPGB2dXC0GZBORMSCNW6VtgqU4qqKeEvZD4YyfV9M5pXymXSE8jqcgs8pM03ujxO84TXvnswpjDHnSa1qoc1NAf X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebdb9db0-5ae8-40b8-a67b-08da7528604e X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 08:15:50.5004 (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: 4TasCtsvoV4fmqJj1eu1C9QcIZKP4/+SysknvIRXCcGba0iG0VNRcbdmSChzPmk8qq3S6X7AM8UkovKIKO1N4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5560 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The CCM ROOT AUTHEN register WHITE_LIST indicate: Each bit in this field represent for one domain. Bit16~Bit31 represent for DOMAIN0~DOMAIN15 respectively. Only corresponding bit of the domains is set to 1 can change the registers of this Clock Root. i.MX93 DID is 3, so if BIT(3 + WHITE_LIST_SHIFT) is 0, the clk should be set to read only. To make the imx93_clk_composite_flags be reusable, add a new parameter named did(domain id); Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai --- drivers/clk/imx/clk-composite-93.c | 8 ++++++-- drivers/clk/imx/clk-imx93.c | 2 +- drivers/clk/imx/clk.h | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/clk/imx/clk-composite-93.c b/drivers/clk/imx/clk-composite-93.c index 19f4037e6cca..74a66b0203e4 100644 --- a/drivers/clk/imx/clk-composite-93.c +++ b/drivers/clk/imx/clk-composite-93.c @@ -28,6 +28,8 @@ #define TZ_NS_SHIFT 9 #define TZ_NS_MASK BIT(9) +#define WHITE_LIST_SHIFT 16 + static int imx93_clk_composite_wait_ready(struct clk_hw *hw, void __iomem *reg) { int ret; @@ -180,7 +182,7 @@ static const struct clk_ops imx93_clk_composite_mux_ops = { }; struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *parent_names, - int num_parents, void __iomem *reg, + int num_parents, void __iomem *reg, u32 domain_id, unsigned long flags) { struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw; @@ -189,6 +191,7 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p struct clk_gate *gate = NULL; struct clk_mux *mux = NULL; bool clk_ro = false; + u32 authen; mux = kzalloc(sizeof(*mux), GFP_KERNEL); if (!mux) @@ -211,7 +214,8 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *p div->lock = &imx_ccm_lock; div->flags = CLK_DIVIDER_ROUND_CLOSEST; - if (!(readl(reg + AUTHEN_OFFSET) & TZ_NS_MASK)) + authen = readl(reg + AUTHEN_OFFSET); + if (!(authen & TZ_NS_MASK) || !(authen & BIT(WHITE_LIST_SHIFT + domain_id))) clk_ro = true; if (clk_ro) { diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index f5c9fa40491c..151b2051a5e6 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -293,7 +293,7 @@ static int imx93_clocks_probe(struct platform_device *pdev) root = &root_array[i]; clks[root->clk] = imx93_clk_composite_flags(root->name, parent_names[root->sel], - 4, base + root->off, + 4, base + root->off, 3, root->flags); } diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index 5061a06468df..396a5ea75083 100644 --- a/drivers/clk/imx/clk.h +++ b/drivers/clk/imx/clk.h @@ -445,9 +445,10 @@ struct clk_hw *imx93_clk_composite_flags(const char *name, const char * const *parent_names, int num_parents, void __iomem *reg, + u32 domain_id, unsigned long flags); -#define imx93_clk_composite(name, parent_names, num_parents, reg) \ - imx93_clk_composite_flags(name, parent_names, num_parents, reg, \ +#define imx93_clk_composite(name, parent_names, num_parents, reg, domain_id) \ + imx93_clk_composite_flags(name, parent_names, num_parents, reg, domain_id \ CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE) struct clk_hw *imx_clk_hw_divider_gate(const char *name, const char *parent_name, From patchwork Wed Aug 3 08:17:11 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: 595154 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 5727CC19F28 for ; Wed, 3 Aug 2022 08:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235152AbiHCIQL (ORCPT ); Wed, 3 Aug 2022 04:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235533AbiHCIQE (ORCPT ); Wed, 3 Aug 2022 04:16:04 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60085.outbound.protection.outlook.com [40.107.6.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC35A60E5; Wed, 3 Aug 2022 01:16:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfdxoiCBH1Dsl9rO7mM6FZxRkt8Neu9KMOuThQW6YCCVR7suf7PM40JaoQJQZFHOQLkhKeCsY2L+UG3dSdyO/mWNBmuAt8d2nRcwSGgk7wWKb1I6N2IUQmBwEiiIBYxnOJCETt1Ccjd9ypCOFCABlPxnKf7C9iFZv+X1XXG9ZURDTFaXkaiDwdtzAcoNLG8UZrV47HsSdyfdLMzkvf4f20SSweArDlYgpdXnfLfzVYsQd2TQLPPsYyh0+hXQIJJvBhlJr8/wV3mKl1sHMY0bnP37DtBQWQLbr+LwrioRvW65R+5GX+sM4d5GXb2AAtGD7vB6eZVELolTRQigdIDRQw== 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=GcjgV67dZf50cMFZ3tZHxVpbssck2FNfd0GqtMhg22E=; b=Lo2gzwK934LFERrlDTzXRwE1SpwkQOXh1EzgWGtkBEO4pDgQXv3fFiulP2mJKmNU/FV/dzt2d3E/+i7RlBY7iMM81Plh46qo+myxcYeyS6nQwWUoYD7hjYiirWKPvInpDhccVVZaqbuEZMBgTjyznatErpzZd5j4OWnDD6Ay8uR63Ymvk4IvZlnW+Qko/lVC2Wb74emoNq0OUmFdkrQSuSG18xB7Ja4VLm9/rb+lLa6PU/zRZ0xRqdiK5UA+FzFF48FhpzVglKLZaw19bX+CtqFbYZCpOOA5RX2qiF46i6LgoOJq9AWQXrg02Xoj3vNUtwIaruLBr7jnn0rOqJUPbQ== 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=GcjgV67dZf50cMFZ3tZHxVpbssck2FNfd0GqtMhg22E=; b=eiF+B0zSm4dk0/JW40sapNwEwtcmHRbJJkN1Y8Ry5x2/QijscoQC8y8f7Ymqsm8bIXMfargSJyW6dPUbtl2ht0gOwYMqhx0sFlDfw0lCSHnpnRwYwzvU8Y6ziInqJFfqjOeyz2551r0rFK6z3pT33S6uEYruAp90zfK45xgbvLw= 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 DB6PR04MB3127.eurprd04.prod.outlook.com (2603:10a6:6:c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.25; Wed, 3 Aug 2022 08:16:00 +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.5504.014; Wed, 3 Aug 2022 08:16:00 +0000 From: "Peng Fan (OSS)" To: abel.vesa@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan , Ye Li , Jacky Bai Subject: [PATCH 5/7] clk: imx93: switch to use new clk gate API Date: Wed, 3 Aug 2022 16:17:11 +0800 Message-Id: <20220803081713.3504699-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220803081713.3504699-1-peng.fan@oss.nxp.com> References: <20220803081713.3504699-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR01CA0011.apcprd01.prod.exchangelabs.com (2603:1096:4:191::6) 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: 485e0357-1f60-4f02-6240-08da752865e3 X-MS-TrafficTypeDiagnostic: DB6PR04MB3127: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: i7StGQBOnGad4nYdvRrrhGGkOWMui4BlZ4J9phaXx6AX32yrfv8+PS6FbzcmSw46SR/Tb56gEH9XQ0/C/JLQqkexLGg7rsyNvyq8FyfiHXaiujZpK09aeLYQbNs/ZXU0vOP+ercpORzNvJi/Z684bkBScvlhp4l0uSOmFa6pT3HIO/BIr3lF5/MVLGgijsSG2H+kW4GmfE3IRBog+XBTdy9kkB4NvLAf/iXyLLdnX5hxWPVtZRyU26j54B8tlugyxdLjnhasPg9RxU3MdS2CNHVR4+SrFAPKuw8/FP8P2peNrx5rYjodlPJ6Ot/Gcdn6/hZlh1pgne7LzVXxA5HPQY+c/N75JOBPP5eZXObIzODuFwWS1TK1OprU0GSj8XLxDSUjRKoIjs6TO/eCJPMhEXDOexpHvEfSIi+V5RgQqaFn4H8Sw46mSVPeWarMGZvC5HBcWQ77SR7SI8Ekcl/yNpmnKaGAjQVxmk8AEQdpRVVF7/i/zrXo4MCMsm9wpRCnH0z8rYadzuNMiCTwr9nLsjilVgbjgTK7CqyKQYqhHIOVxTjZ406jWFg/M6VEAU4XxgV3D+O+r4ZDhgAU8kMSuLfst0rIoSXkqwA8Y98TQLsIxa5GSLKm1lpgf6gPuPKhwpA6rXLRpA7578wAoZFNHUfr2FMpd01yrz0W3XJ3kVAtLDwnVfurmJE7R/Nh1xg+0QBCbVQEjzUl3HCsajdZuxP+RKCWy1EOqFvaVbxWcgNNxQSd4EEithWCHk7IZ3vrElyuQYuDWA/WCgOU7Pmk7amyo03OVzX3qFB2rJCO+HwNn2feJu0JTXrIlKp0eQUK 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)(136003)(376002)(39860400002)(366004)(396003)(346002)(1076003)(54906003)(186003)(83380400001)(316002)(38100700002)(6506007)(38350700002)(52116002)(2906002)(5660300002)(6666004)(26005)(478600001)(6512007)(66946007)(66556008)(6486002)(66476007)(4326008)(8676002)(8936002)(86362001)(2616005)(7416002)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KJuZiFh0z6x2hl6AeuRT+m808MCoR931mQeHTBBbS8cZDPF0m04qydnJZgXmU6Kz405XkbwMIkG6mci5RPG0qr9Ryt6sz/JPaVGuNyOSbX69AdiKJq/vyWgODJFkLoziOOGIyWTxUT0tZt2NfADJitDX7iCwdm8Sr5+7gMEEy2a50uwpQGcx2p+xl/jY/e+hnTYko4oXXYHWLezyNKUU1s95VKNXDIvFq0Vbf2Vb5EU+8saGVfLwnph1WFLlJszX3q7vHmE2vngb177bEOxMwEjiUi+bR23mN6myhh2CzQl7XKIC1IPocIxgbbQUBaCa88M5N/3gNgK4xOCCzSVWmV3MdY0GYk1lTQ2QmSFP2xibeO+bcuvUtzbHoqqIGGS96VGRFg67ziqVV7KHujpDXnnd282WQuthGXBQrKeWYz4n1f3pGTAzeBlibm0BIuIOi16UgSI1CLOrKD9Ero5h7zjOSkSwsxVD+2VU300rra7HVLp+fqrK5cWFDatrbn4P/ljLWKimVtJHJVTSXU/aKhY7MO12+QgcBa3IZvWks9Y0uVsZUDMzod9sMi3ZID+nATKLM03Mij6JhGGxCRJ7vyKESLXqBq4huBUQhwCzdUh6ym/a12qmK1zethO5LvokayBPumgFXYlQCxyBb0l09QG2ZfkEdHjJ++P4k9tmkfPdkaBaXHEge6YqRNW3ueGodQsykwK4EgoxRwuEdYNiEts8BnBDhObVxA+1ushrhsH1GNO6bIe0GbzwosaHHL8c4VCLLkAvtodx1at0bdyu/3rYWCvzdmyUxCZeD8NT4SnW41fACGVDGBWEAS38DxmNCYNBtnJYNHtyxLAU7SZgwEc0+7+ArjOevpOBzl+/L6eF+g08YqPcCNte/fugBANShOMPSW10gxoGQrFUuD5gEG1tvN6eiUsD8oxKEnRCgcFOJ2PCQZbemEXxRvffL8JNMe4RyI5OgGv4xxlRsIBhUJQQyzHZdAIio2gQEJprfN9yugbdmjkc4sV8J01iyOUJw6s/PeaV8JYvGHYJynbI8yss3xGGshOUcam5hSCEwkrys0jVwq0VOMKTaPuiazMmyLv4mnmcwApsC4PEC/AaFRf9WOb6Cmza+DD6Tn67mlbHCdNL7La58qmwB++DcU5Ob4OPoP7OoUgjPSNUVHfwrcxuGjyT/d6AjmsRsSVX/lk/NZaHY5uBXEASXvdYIfsh+jCxpf4v45RPbdgHhf9lbxQzjEXGkI7LgYgXkeYHEqbB1puCvBE4PETUsdOM0NMMgYJ4zb9jyyVRry1jD/Rf835EyI2B8QdugIfXe1kqzCKbjgx+QHH5CxWe5nV5xvA2gq3ZoguvYfpV2zv3usX9o9ZJrgoiYmQ9/6yLstsdhIN7ENRVpzb1QGQgn7q29luccq48HJaLD20Omq4c4eIqVfwMa+M61detokCEDKyTAmJoxOYIXspp89cDkFH7YO8t1M3ADLGRU6FTfQOIa0e2HuNLOulWyM7svpGRrjuhRaDvAdp/dw0yzJjF93JeYKpjYAIYKxh+KDJcU0TM3VorzheKuGNzDW7W6mG3sI4RpMYoyHsmicdo/kkcL7fFhLN9 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 485e0357-1f60-4f02-6240-08da752865e3 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 08:16:00.4426 (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: BbI0Amfio8SpXr8GodKYmCyWTDdE2CDsHiG98fL0/pF9XyxV+YQE47CPBwpgAf/E2yhttxs7rFanbAqtjr5BMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3127 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan Use i.MX93 specific clk gate API Signed-off-by: Peng Fan Reviewed-by: Ye Li Reviewed-by: Jacky Bai --- drivers/clk/imx/clk-imx93.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index 151b2051a5e6..ebe553c6ca95 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -146,6 +146,7 @@ static const struct imx93_clk_ccgr { char *parent_name; u32 off; unsigned long flags; + u32 *shared_count; } ccgr_array[] = { { IMX93_CLK_A55_GATE, "a55", "a55_root", 0x8000, }, /* M33 critical clk for system run */ @@ -299,10 +300,9 @@ static int imx93_clocks_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(ccgr_array); i++) { ccgr = &ccgr_array[i]; - clks[ccgr->clk] = imx_clk_hw_gate4_flags(ccgr->name, - ccgr->parent_name, - base + ccgr->off, 0, - ccgr->flags); + clks[ccgr->clk] = imx93_clk_gate(NULL, ccgr->name, ccgr->parent_name, + ccgr->flags, base + ccgr->off, 0, 1, 1, 3, + ccgr->shared_count); } imx_check_clk_hws(clks, IMX93_CLK_END); From patchwork Wed Aug 3 08:17:13 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: 595153 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 9E34DC19F2C for ; Wed, 3 Aug 2022 08:16:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237412AbiHCIQS (ORCPT ); Wed, 3 Aug 2022 04:16:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237052AbiHCIQN (ORCPT ); Wed, 3 Aug 2022 04:16:13 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60060.outbound.protection.outlook.com [40.107.6.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F5C863F6; Wed, 3 Aug 2022 01:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ad3EpPlacDa+q19Xe56XN/pAFQ9yImXDO5wE3+G5gEkDRXJOU3ZeR+y40Xh6jeyXaLX85AGqLNgrL9RWvI5c/wxcFgls3odfm6IZWkm0GehB7Cb4uI+fSb+uj8Hts2rDkme4fABagERTB0t7e7Q07mLxfKvjJnkDTHnn3IdwPf1ZXUopRKKwfRu0AGwZXp/CHxDPZZ/u1eOJqYwg+JVsd8e3rGH+pHSX+S9RxCqlSa1zCuzTGyiKoutlRp5j2nDNMVy2UT9Hz4FXJT/POzjVhta4NJzVlzMFwGs70v/pVEd3i0qgCtv5jJNNI3MTzvi/ONY2RBCov7yw1UkyxdrN3g== 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=L1+zfEdOW8POG8SMit3wbN0TOoY4OSI8uq5SebYSjCw=; b=RDRyXm4Sjs9xbZThBYT7ZFPdwyeKI8GkqXfv8Kfq5n+kVV/mC6Fg+lh/HUuof5fys6WYRL1vp7zUccbjw+a4HxN8cig7fbjOJUhtmY4759g9lb2r62butZ9TmQj78vVAO9Z3bphToLVYovzgDorpDSnq5GToDbueZUtXo2AZ2FR3yWvJYZ5nUk/2QptnWmJs1jRMj475+aiPn8bF+XlL0iGA3OjrvVitS/kWE0SnM4SmkEKV/nPRWlE0FzsuaZKpFaRvjzPpFIvBixKU+Ef73jGY+Owmi4u7lm2gEo8xQykYfSE11GHWscP6cCarQSFfnUcuGD8q9ixDXsUpcWeWvQ== 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=L1+zfEdOW8POG8SMit3wbN0TOoY4OSI8uq5SebYSjCw=; b=Uz2qsUyYwdeN3HWIHUblJWO6YPKi+VDA7+Zs/u4oujGunpL8M3fMXTJBrcpss3wIFkrOBXh2Rz5J7AUdRYE0YRoqCcJhRoSroVWoKkG+19ZyYVlOORttFOli6fXBbYvUmANgwc0l5D9bqPHrVx3Q03v5bYh2KdInRQZUwzDPeEE= 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 DB6PR04MB3127.eurprd04.prod.outlook.com (2603:10a6:6:c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.25; Wed, 3 Aug 2022 08:16:09 +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.5504.014; Wed, 3 Aug 2022 08:16:08 +0000 From: "Peng Fan (OSS)" To: abel.vesa@nxp.com, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Peng Fan Subject: [PATCH 7/7] clk: imx93: add SAI IPG clk Date: Wed, 3 Aug 2022 16:17:13 +0800 Message-Id: <20220803081713.3504699-8-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220803081713.3504699-1-peng.fan@oss.nxp.com> References: <20220803081713.3504699-1-peng.fan@oss.nxp.com> X-ClientProxiedBy: SI2PR01CA0011.apcprd01.prod.exchangelabs.com (2603:1096:4:191::6) 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: 0e21921e-e57d-40f5-b183-08da75286b5c X-MS-TrafficTypeDiagnostic: DB6PR04MB3127: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: BiOdMvvJiXQIbJJxLNeXGiCyYQlLJUhUWxfq6HIKUdMwzrZw960wsDjv0qOqKgQXokjHAlgca0kI79QjRploTFR/sgTEh+zGzV24dBHX6MNdWbMXqWLVkiTSi4vMVuwI4YtkBTlSskMx0+pGYTnZ+I5qfUDeOuLBkPDRQv1xEZt09ck7Sk6pnI/RzMjOJ1U/DsP/ORI1tnVw1GY/mZvA/Iu/zu620nv9Rw9hvViNzdNI21dzn1NcYbz7zTa2s9u1Err4LKZH2EkM502FqcXCCKImVjW62D9c2lbWpkfq3SQsZQxFz7PSmeo+p8z3F2RQ9a1Wy7sPs3CXPYobso0jrfF10J7pRSmXypmxlLLtl7EWM/BZvqYlK+vfwFT9aIPVJR1emh+J9pXhP+BL3jelsWydmg33N96HLwhWqwebIVE9oWDm1G/B7jFm4JFUMEfooltMoO0N3h8UzmTyFk6ynErB7HSnSkN+i0Q/bLbqGy0b+LIWU1fqZFh8eT6NiSQftYO9FpOD3awh46HLKjycbzN/xgxuD+JDyLAKT3AWHPnUfdQ2rzNojJK8+Kzpi2XRyXlvE0i8+boo+qt6TdIq1bQyfetKKlbqNdRrEyF4X4sJCtOospKKZIRAbVJd1+iTNGxoGA5+fOKV2T1kHTPLOr1GaXKnXVeTOCwAmE0IfTj/k1Y6qbJ90cabD94KgNb8R+OAcnLkwd1g1JZ1bEc+Ag/EBYiPKxBKAjFRWLS4tTm4wFjTsdRNhZhaA5Q4MTp0kXzWK+TAj3Sg6AJnPe+xf93GVyEVKe+1KjsijdQwJLlRY1DjNUwJ6tVPBM5k3gBg 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)(136003)(376002)(39860400002)(366004)(396003)(346002)(1076003)(186003)(83380400001)(316002)(38100700002)(6506007)(38350700002)(52116002)(2906002)(5660300002)(6666004)(26005)(478600001)(6512007)(66946007)(66556008)(6486002)(66476007)(4326008)(8676002)(8936002)(86362001)(2616005)(7416002)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: //jB6eVEts+sQMKnmE2hiNJjH+iION4N/IkaTEXYTh0yQ4alrZueXo5QBlHPDEtRefq0WX+yI151xZi2JoqdQeRLaxkMxqH/lhCpEiqaXEQoIt3EzTjB0HJ/awCu1mIfaLa10GhIexi1gqAfscAXxomdr40oUY2mpw+U3LhVND/jdXWPWQzVnT9ke5of9AY36KpmaT+Y6VziJJnANey56t5r5Gj25kd53QkhgwX3Q0o2o9Uzphxw2uBSr1yC+XX8cuLT0EFFr+n5r+vDcTS9aY92pD443kLd1f3dBWTCimEzcIEXbvDW0bFxdwDx5WvveIEOqJFB7T2dq7BdHblPWMza7FcuyxwvF/pr2W6zh8heeMadGyrO6L8EpNRpleS9+Ms30WnAGGPyDFKn5epvubpBc/ICXSsACGQgG4PD4CVjBmYKvEOlpU3BUS4d6QLWH4LqB9KMmAOHAvaIMyXKJJaY0JPCPnkDmaukrSPTc5nTxINSMZ8spth3KaWXbOC+q85GLEkhVKls+46JeXf4AtrpH3xZNsRhUn6/jFoYb2cPe363PHUlvOU5Ds9i9mhQFky4+ClpcA0+B21fLlBiWjxDohTN9fvllKunL8RQALGsSA1bSLDiurMLlxxEjFGKpTy9vWQLvWdJU0JjgUFuZ+GkUwpOlkI7GoZg1D5g0GMWr/skirryex+V9ERjrdngxjmuOfKbD0WtPcLihkve5aRoNMLEMA9tj4Uguy/sJrcryhNGGNs7B+lbOqOL3jNPsvCmADazs8rPyI/lwTpMAMko2qRwsFVOdR5rCy0ewk8z7mCPnQd+pz4An7zNl9cXCNIqI79KVRE6c0VScmYDJO5pROuXwuUnSp5NrgqxrOZb1vh0XdCH6FvvQnP5gAXKt6N9LIyYaJsQKb0X8FrjeeweObPaiVX399EOTkqp6H3KshQEmFw/gi6DjZBiUN486NZKKn7R+trJwTOD2EGBFAn8RJpeZHoRrPqwotcRFRm5/Rr91GgSkFHNNu/E1LSpI6KkmEOoeM2Nb5MyfKE/MXE82mZoHusjHruYsvF/Obdn8kGXEnCC8776O2Wp22NOZf6Lt+RISa4SJDEQxdHKt0cm7fSv2uroP5FP+dISwoa/l0BTIgekjaPP/3nCcov9EFpqVJyHW3k1asKvEmu1PgahCweph/mcbdmlsFrnMIbWWOfYPl3yJimlYW1I4UP4Zre6N/WOuwPh0ANE0VVatQSDgzeYHK042c0h29O7iCIkDs4nV6Ti+Zf5zKtVLLpeFz0/dNxz+NvpeTB+8uG60tWzLF9rJ2AJinlGDyemLUSjyZOxcVhrs6l6EEMmhmN6hgAXWFRpACExsMFdJn/QhWj8mcOq65TMWw/0fBSwPngtdh2Mn9x39AK6/IjQ9rZUUeLj4OKUlqLwYCvc+sudGrt6rUkXcU2lPESmGvZ+JzGl8ffozLNMqJgyhp9MONR2rEXNBo80IbC7SzKy/i/AjHzDDKjyZBPq7T8kj/goGlWcn4SMPAEo7QvQKQtRTZPkGoozepNHYGB1fT9bI7qM25o+7FKirGVt/LzxmZEn96kU07UwDJ7Mb/hABNvPB9Ck X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e21921e-e57d-40f5-b183-08da75286b5c X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 08:16:08.9068 (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: Hme3Hb9OxslgRqTAq2qUvp47kSZV7dz2cK7ultIHeqmi08urzI/jqMKJGOCbt8GpuMIW8wH2qet8fJMUAMHFuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3127 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Peng Fan The clk topology is as below: bus_aon_root------>\ /--->SAI IPG -->SAI LPCG gate--> sai[x]_clk_root--->/ \--->SAI MCLK So use shared count as i.MX93 MU_B gate. Signed-off-by: Peng Fan --- drivers/clk/imx/clk-imx93.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index 79ec46a91ed8..f6a9e7718418 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -28,6 +28,9 @@ enum clk_sel { MAX_SEL }; +static u32 share_count_sai1; +static u32 share_count_sai2; +static u32 share_count_sai3; static u32 share_count_mub; static const char *parent_names[MAX_SEL][4] = { @@ -215,9 +218,12 @@ static const struct imx93_clk_ccgr { { IMX93_CLK_USDHC1_GATE, "usdhc1", "usdhc1_root", 0x9380, }, { IMX93_CLK_USDHC2_GATE, "usdhc2", "usdhc2_root", 0x93c0, }, { IMX93_CLK_USDHC3_GATE, "usdhc3", "usdhc3_root", 0x9400, }, - { IMX93_CLK_SAI1_GATE, "sai1", "sai1_root", 0x9440, }, - { IMX93_CLK_SAI2_GATE, "sai2", "sai2_root", 0x9480, }, - { IMX93_CLK_SAI3_GATE, "sai3", "sai3_root", 0x94c0, }, + { IMX93_CLK_SAI1_GATE, "sai1", "sai1_root", 0x9440, 0, &share_count_sai1}, + { IMX93_CLK_SAI1_IPG, "sai1_ipg_clk", "bus_aon_root", 0x9440, 0, &share_count_sai1}, + { IMX93_CLK_SAI2_GATE, "sai2", "sai2_root", 0x9480, 0, &share_count_sai2}, + { IMX93_CLK_SAI2_IPG, "sai2_ipg_clk", "bus_wakeup_root", 0x9480, 0, &share_count_sai2}, + { IMX93_CLK_SAI3_GATE, "sai3", "sai3_root", 0x94c0, 0, &share_count_sai3}, + { IMX93_CLK_SAI3_IPG, "sai3_ipg_clk", "bus_wakeup_root", 0x94c0, 0, &share_count_sai3}, { IMX93_CLK_MIPI_CSI_GATE, "mipi_csi", "media_apb_root", 0x9580, }, { IMX93_CLK_MIPI_DSI_GATE, "mipi_dsi", "media_apb_root", 0x95c0, }, { IMX93_CLK_LVDS_GATE, "lvds", "media_ldb_root", 0x9600, },