From patchwork Mon Oct 14 09:11:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13834422 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2052.outbound.protection.outlook.com [40.107.247.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B3B41BC58 for ; Mon, 14 Oct 2024 09:04:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728896655; cv=fail; b=PoaeKtKGN6wAgx3UpFDSCKPP7NRijnuzJeJOvmZzDs2zVlv//IM7uVcdpUaxd7tiAZwnBryoY5eOAFbCVxObbxcRTtzoFg7aTqw86jaCPrvq8iutc8Mq2yAYrsNPcbp2+5i9yA9LAsH0X7FHTKGtMIal6u0SvNKqpRJ5H86cqLw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728896655; c=relaxed/simple; bh=v8ksMBxvbeVAy80xC/9SxZUA+6+FZGxZgqOBK4nC2MI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=LhshuG4vi38EpJ+Q2Rk0iTGGVUdU6vt7PQ9gww22yqugLrwhBVSkrlHyuZ+UQ4o4Q056KScJoOrmfFHk0V+DfoNMJwSD/Lh31S2/oiEvAO6melALwr64E6z++JAWDkVoMg3XtsQsNaKcFGnJgawF48lCvoVHCZ3Eci6+kzfADDw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=saPI0gTJ; arc=fail smtp.client-ip=40.107.247.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="saPI0gTJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rw3mQQWRFYN3OK760Qm6amBGTx8MMpr5A6KreozADSVOL/kfZrxSUXaugRtpyjZEgsIIoCfQ3pKBmrXyz/Pe+qjRLwrxeFAAQxUEvHNzuAMYDEsrb5TLA6Rmluxgssh8ENS4vDb3/w+6nNYV9LSsP4SsHlLIidoxgUXZ1aMjxMBL+OqFczAz6RgfDp/w4kiUGRZXkA83SXAdxk9qIN6p8Yo55sQNAeCrxpTnYomqvnD60gnPoy8EHjCWqXaP+ZEKURcjW1C/boIpIvogAHfsXOJa4XEgdZFcqRasvYJyCpY1UgsQknIGL1ssybdgpA7ejzhjgwpJv+OXpdM12q3NXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tll9CQpoI2JYPFCpRJcMtd6vZ7urFG2dHGkXxAOPskU=; b=DptD5A05zeoEkqfd76+xq5E21bguA7/h4NySK8MEto3DhlI/JfKs/U3qI/GmxviXpAqa4U5LP8QJ5QFJKJ+XmGHesJpqKznP7PptWTa0Kv+bnNJ0BQ3Anddu82/Gc5pgtQLcMBrmEG4YtmUJX37YgX73dlNkhqKUrBaJTB0UrIoMZTuPAHbyCJPbvUJaCP7vUoe7NRQI00cff/FeRnjKPnClfWDNVrg2syossHmAr//jvaeltet+sKnRE6FwZEK7egOxNrwoyGVQxKSO2k9W/djgIipuiH6JA9w7Xil0VZ/VpNKsxw5MEsi6KuRCpnjnmJZm8kki9nnsQhlnM58fFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tll9CQpoI2JYPFCpRJcMtd6vZ7urFG2dHGkXxAOPskU=; b=saPI0gTJf911xgSKUcwNNMnfz4zfzwpYayiZI+cQ3/k2JIcZiBv1xWemTewN5CIfOuNVHPl3PoLxUUspA2Emt6oKmFDisLt/Fa2Yn62Thvd6honJr9iqq0/rZoneosq2/hZF2c+L4A+EJOqODdQTEfMgIUO2qgWobQ+pqAsH0TU1dQaNU0dH+jNcpK01DW28wZ8kN6+LsS/cNOKxiYI07xM+HimhrsbEF4qWepTYfjil9ahu7VslR0ZnMYp7y5KqpBL6gem1gzIQlbvrnuomh2m0PX27a7bAoSJiuv2ASrgSb96hzMOg/dnri9nRA7UF/1knEuPt+D7VNCnxnC1d8A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DB9PR04MB8461.eurprd04.prod.outlook.com (2603:10a6:10:2cf::20) by PAXPR04MB8765.eurprd04.prod.outlook.com (2603:10a6:102:20c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Mon, 14 Oct 2024 09:02:57 +0000 Received: from DB9PR04MB8461.eurprd04.prod.outlook.com ([fe80::b1b9:faa9:901b:c197]) by DB9PR04MB8461.eurprd04.prod.outlook.com ([fe80::b1b9:faa9:901b:c197%3]) with mapi id 15.20.8048.020; Mon, 14 Oct 2024 09:02:57 +0000 From: "Peng Fan (OSS)" Date: Mon, 14 Oct 2024 17:11:24 +0800 Subject: [PATCH 3/4] clk: imx: fracn-gppll: correct PLL initialization flow Message-Id: <20241014-imx-clk-v1-v1-3-ee75876d3102@nxp.com> References: <20241014-imx-clk-v1-v1-0-ee75876d3102@nxp.com> In-Reply-To: <20241014-imx-clk-v1-v1-0-ee75876d3102@nxp.com> To: Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Aisheng Dong Cc: linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan , Jacky Bai X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728897092; l=1523; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=Sv4CHyV16UexiFdZ+yIX03Ey/S7U3vzUPoU0hMATx6E=; b=Don9BLt1qZNpRnAE7hpt4WSRL7PiCdVd51Urgvhksw/MZFdrgL/IxtagQMHkQY7ElrL6GNtqO aMhQYmeGrrrCuR2ZfCeyyCZ8W92DP5KOyYWcV5LwxPEIu+H1eXLpoOF X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:1f4::15) To DB9PR04MB8461.eurprd04.prod.outlook.com (2603:10a6:10:2cf::20) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB8461:EE_|PAXPR04MB8765:EE_ X-MS-Office365-Filtering-Correlation-Id: e786ea21-fbd5-4716-4554-08dcec2eff44 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?5ve52UMrVI27U62fQGFOmK4R+xDvLGB?= =?utf-8?q?M7LRhJuSBAnfZU4CtbxXXvkzG9eOuDfTuYS1FDSrXDFNVuPQNI/IHlbYOj9SSvXiu?= =?utf-8?q?cyz4QOxI+YWgmpTNu+NODiGObQsCUmZw/iNvBtYXNQhJnVCgxsGE2cDN2a8sjSxof?= =?utf-8?q?ehbJWdaVS64K36gsksK5OjTJUHCw4U3yJ59FEsLwlyWYmgSS4GRIbxicsFsdmNFOU?= =?utf-8?q?e4EcLwe/47QyQFqM1AGr72XrkdFbL8lm+EIngi3+v2dOUR9CoZISyjHqqhgv4AiyI?= =?utf-8?q?3uSTMUCuKs//GYFbglwaBQkgyj40IYX51wuAFAtPqnPsMv1L9NCU2UANsHxtXaeqN?= =?utf-8?q?k4ci9/XfQswUb0X3UMWTUBUGSzRSkFQ+YfXRUM5n48VhVKVsgxEo6aMLUCdIbVWEW?= =?utf-8?q?KhSUY+ZLm8gJ9aiw+tfITSQznFphsauru6Nb7b3jChecfMRpyLg8zLPEsR+7b7A9k?= =?utf-8?q?u9DwZ9IPyUxxbstBiWOhZ84+dEpYGYwZsAJ6jmst6D+VGbQH5jrWyQwERordOB8Am?= =?utf-8?q?yupz9iq67nJlMEwJGhDI9CzQhWzd7q510ZsvEd0/soqQqcBrxUznknu82o2bHrMEm?= =?utf-8?q?rurTRUy1LQtG1oUvMqQUD2kVUk4yHHEMAdvpkN5AOB9yr4t/gv+tEeJu8siICh397?= =?utf-8?q?pKedr5s0NPoQh5O7kDeMDbUlo08PFO5SHFPTutC9gheRb8LXOnmJB83PsPrCSAb7f?= =?utf-8?q?E3pWqi9ODUt/SubnGhBQEnFf6U4PB+lRm4lxJ6h4IRlQ5XAAii6jg1b6xUSSYoowX?= =?utf-8?q?LpYwXUUebI1QEHcfO/LMd2ArBHmuLHofbibNVc4s/kfenf6d9tvMBa+btp6ynimxT?= =?utf-8?q?bZQJmtOtLTIH2CvlCcyrbPH5V9LLYoCTRiUjeTGmakTvGjuLKusoJ5qabEG7k9HDz?= =?utf-8?q?gLQvTR65pKwZlCeW7n/pkym9u0+j/Xu8IWrH3JPD9cmqipjV8iNHg0NQ9jcbQlqOo?= =?utf-8?q?9tCmqFcCR4fqKdfngiQTWcY7rZcNJmTKc6aaTfDADRXVJzeI2oV+1OKK3uNuRiAiy?= =?utf-8?q?zZLxYJVDJ0r9sF+7j8rCMiweZujlA2ei4rfEI45225nRYxNF/GHYeYWbd5hRVJyoW?= =?utf-8?q?pwAPcwqRlSFe7fcOsNDKtHRTjZmT2Jez1Uk+Au/LOlQRo7/uvLoep2uJAlDlzO9dJ?= =?utf-8?q?IKLQszscYAbeuLHAkWZxU8Ah0xkVhUy2PHk07+FbaPXYmulif3dG64+TwjCQj2AqA?= =?utf-8?q?OtXDCIFa69YwJv2ckFp6SOWLCvm3A5fDBvk8d0by5d/cnUcgAMnKLq2IA8XaXg9Nu?= =?utf-8?q?2ysWNPNBAQwR8TDU6k1qu5MnhVlX+Q2lP9A=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB8461.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QVQ/B1Dledq7w/6tT/xeZyF4Xava?= =?utf-8?q?Ba0AZiT8Ue6lShbkIObXyoGTWHYARGm4bqV6U8KLEFx+DusOXwzCd3lcdc7ihwHO3?= =?utf-8?q?C5sdQqMkLzI7VDFGsM4w9JubQ/Dwt8G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Ys2FyjiYORTrDGFIdS+DsF3wEfI4zP?= =?utf-8?q?TGLddP3PX8BxWcJSCxr4y4CBqqOx/iGQRM2R2+fGA6h1SPEKhXajSy4v44BrVxQ2Z?= =?utf-8?q?EI4fCZAQ1cAIFuWU/hFz3L+maNWhQZJseFMxd5Wvh1i4cWgBDuqvugdaIUBJN5mQ/?= =?utf-8?q?HcNa5zcmHbbFSsVlMAfDb7Ui6pZ/nI9O8AX4AKnkaWd40oBwDZLkdanHR32OFGbER?= =?utf-8?q?Dn8BPjyXIJUmZnthfYhCEzTQjB46iA9J1hH5l9unRtH0+FSRoKeqpXiK7LV0wptIH?= =?utf-8?q?A6pqCOrUyeuIqjv8aKdOQ6G4wSa8eMzqitYV7CsqGnji45eyPyNssb3LIcU01l9ik?= =?utf-8?q?eyY+K8pbf9jLfPgCe6jzYUZKcYIj7hYxb95bdk5eAImbC/B1ZYXCbOUKmf5KAtM78?= =?utf-8?q?QBjcChURGgb2kgcIVbEGEI3lcU71BCEKr6jOemmxa6uw101ht5v8e4Od1EOdSXEsZ?= =?utf-8?q?jujrYRbRwZAKBHogof3QflgNhbqak396k4Big8Wk4oASq7elkNEIfOY+JlHQ0zLca?= =?utf-8?q?tUVf20/HABXx?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e786ea21-fbd5-4716-4554-08dcec2eff44 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8461.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2024 09:02:57.6066 (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: Qs3S88VDgbywuuLAc9mc47CNwrdU5zbpCLGt+hi1nqXT3lUeyCjrO9hOSLdLW8VdW+b7eenqBLw7r/X79hGXkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8765 From: Peng Fan Per i.MX93 Reference Mannual 22.4 Initialization information 1. Program appropriate value of DIV[ODIV], DIV[RDIV] and DIV[MFI] as per Integer mode. 2. Wait for 5 μs. 3. Program the following field in CTRL register. Set CTRL[POWERUP] to 1'b1 to enable PLL block. 4. Poll PLL_STATUS[PLL_LOCK] register, and wait till PLL_STATUS[PLL_LOCK] is 1'b1 and pll_lock output signal is 1'b1. 5. Set CTRL[CLKMUX_EN] to 1'b1 to enable PLL output clock. So move the CLKMUX_EN operation after PLL locked. Fixes: 1b26cb8a77a4 ("clk: imx: support fracn gppll") Co-developed-by: Jacky Bai Signed-off-by: Jacky Bai Signed-off-by: Peng Fan --- drivers/clk/imx/clk-fracn-gppll.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c index 591e0364ee5c113859a7b6271c8c11e98a0e0ffc..4749c3e0b7051cf53876664808aa28742f6861f7 100644 --- a/drivers/clk/imx/clk-fracn-gppll.c +++ b/drivers/clk/imx/clk-fracn-gppll.c @@ -303,13 +303,13 @@ static int clk_fracn_gppll_prepare(struct clk_hw *hw) val |= POWERUP_MASK; writel_relaxed(val, pll->base + PLL_CTRL); - val |= CLKMUX_EN; - writel_relaxed(val, pll->base + PLL_CTRL); - ret = clk_fracn_gppll_wait_lock(pll); if (ret) return ret; + val |= CLKMUX_EN; + writel_relaxed(val, pll->base + PLL_CTRL); + val &= ~CLKMUX_BYPASS; writel_relaxed(val, pll->base + PLL_CTRL);