From patchwork Fri May 10 09:18:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan (OSS)" X-Patchwork-Id: 13661105 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2056.outbound.protection.outlook.com [40.107.241.56]) (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 01E5C16D31E for ; Fri, 10 May 2024 09:11:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332292; cv=fail; b=h/hobLcw3/ogaUfGbKVB8c9Z+C1fCp0qT2HyT27DxP/xu/8c9TN79exH67Wwj2MUom+WabzoBsj7Sr2acmZ+rij78w8jRvC+24pvsAh3/l5KEMGDPJ82D54i6X28JGYw5OGtZwY3cFYhOyemYcwTRFmPgqnjKkx3gZ714Nae6Xc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715332292; c=relaxed/simple; bh=3/ebBXKy2EoNIVdw7nEZvhT7omyA06RAqLLNddA8Y0E=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=q3DA77qHGTs2rfVogqLr3E1FHyg4G5ATvna+Ocfco3s4Xw/d5mn/ih6/PN4Zw2CjOJfENUu8Gv4K96+NX2MMRjJlmQganidrCmKfCtEWF9fORF0nEVUt5e8iNClKDfN3THXXv5feJsN8+DxD7EIzyuEaTJ9p8o1iHiIXUViBpxw= 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 (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=GF84DOWn; arc=fail smtp.client-ip=40.107.241.56 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 (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="GF84DOWn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HhSnCkA8V2SiHuMh5fMJdJJNzo3QtYdybz4uRiF0+GfawmKwwb6ER6zP+wvYcKsorr7MaiinoEy1zzlZUhyAAltLi5jGXsY3U+YtteR76OGGL/C7q8pOEQESOO0+8uIfr0Prw06kduAlM8kah2+j9bj7mliMS6yR2EsDLUmzRqqYcbs1121iy3KH+J0u1jr8AvBRz+NxIn/oD3YDhzMV53JIYlI+jbNvJReW2HQIhV+mk5FfPmQz4Sm0zYBkFHMGmFUFJ1yAPODKD35aWioTgJn5rYm55iRTxybfVp/KlyviEDvKzmGI3T7RA4qnhYYBSt9k146zwKGTNXRnVpevVg== 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=KuO7Ij7e1bLmWdg4m5AsnXdVhWvgoEiSvYg9UuypLak=; b=COtSLV5RAOdi4KYWvHodAfTubYUVJOj2Tlg3OB8mOK4WPBLWMWdCWFVXnwmn6vGIbqUf6aaLqkAuziPIJ2I0xTmCLC0b/HGuZQXvxkVrJHVwwtg+RrjaxYQ5P3m9zTmj/7sEIzQOm0eK7yc2YVqQO+nUN/OtCkgw65KeyIvQk01VsGTgU8NzTagOC1hmPAHkJ89hyd1y5DcvNbil7+WqydoX9F5anaMTTou4Q5BJWebxINaOaaDnCeikWterrk9wZB3T6l8I3YSdEUq5FjSgqJoTHcfqJnGP+lkXciIlL2MPx1SErk4oHaTFtRv4fXAWMNt9ZKB+g3+GPez8agoMiw== 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=KuO7Ij7e1bLmWdg4m5AsnXdVhWvgoEiSvYg9UuypLak=; b=GF84DOWn448z+w0+dqQjsQOLUfXFuUcMJyYWXEdmfg3QQ5LqBiHahGKz9vBon9R+iEZzT/3pwJw22LXfPtNDF4nMU/WcWD0xz0FGqm9I+ky7wVsR/PzyxOz6ottd1ezgkSwXFI5pk4b4lO3nfNGj78nRp694Mcu1WURg+fyYe08= 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 AM9PR04MB8065.eurprd04.prod.outlook.com (2603:10a6:20b:3ee::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.49; Fri, 10 May 2024 09:11:26 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::d30b:44e7:e78e:662d%4]) with mapi id 15.20.7544.046; Fri, 10 May 2024 09:11:26 +0000 From: "Peng Fan (OSS)" Date: Fri, 10 May 2024 17:18:59 +0800 Subject: [PATCH v2 04/17] clk: imx: fracn-gppll: fix fractional part of PLL getting lost Message-Id: <20240510-imx-clk-v2-4-c998f315d29c@nxp.com> References: <20240510-imx-clk-v2-0-c998f315d29c@nxp.com> In-Reply-To: <20240510-imx-clk-v2-0-c998f315d29c@nxp.com> To: Abel Vesa , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Jacky Bai , Ye Li , Dong Aisheng Cc: linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Abel Vesa , Peng Fan , Pengfei Li X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715332748; l=1031; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=YbtICGkfjNb9cX1EM8cRO+LQzM8n6WyxoMB7kWtrQtY=; b=LeZ/FGA0DEdEa12W6Gzb7X6btvdYVAKZfB4qQZ8oi4Ly9xh1uxnEbg48Q7k1B3Pt/U7Gwqs/E DunKDVWgLzuBV+tlqu0R838Ni8gdpU3AQ3Ac79/e4y3F6r/HTaQ1wu3 X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR02CA0008.apcprd02.prod.outlook.com (2603:1096:4:194::12) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) 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: DU0PR04MB9417:EE_|AM9PR04MB8065:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d9f87d8-99d4-4474-18ed-08dc70d12ba8 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|366007|1800799015|376005|7416005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?tDZ5nEk3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nuP5vzQ2W8/ezvNDk?= =?utf-8?q?5O96D6ryo0vq+1x3CerjZDSzUs3oX9w3JcP0fT7MZSRrV4z/0/ab7GsFTKqzuC6gu?= =?utf-8?q?hfd+XtV62LX+k1eTXtt68D7ET/nvJt7jwxVMLTZy6Abzd5NGdBwZY/UBzUfbGdkSA?= =?utf-8?q?Ul7aBKshyGSV9Gk6Bo641c547Aa0V41d/4fU2WBVHgJJMzA7KH/T5km0euORsxAD1?= =?utf-8?q?r5BZlfU/4SlUJD9b8t8nXXbm5UUk/w8z/YEU0+IjvFdmFa1gspXLSq4MJ5l/ib2yV?= =?utf-8?q?4ImCWlEAg3HlU3oRRLW4l3nhGGCrAO0dowAR/RH6CvZw+Aiti95h8kRk6AGSPReKB?= =?utf-8?q?cqFBTHaLgbKQi2PdQrXMxxb+pfJEe94BlR71M2i8SCvpOBafhbQJ++8nKzOM5eKPB?= =?utf-8?q?pwefu/p4NaVk1EbUHM3wy6tYHgFtpCjwLLfP71jBaVIqVfPKwWQfSVq0=3D?= 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:(13230031)(52116005)(366007)(1800799015)(376005)(7416005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?L9pn0Gh4SfZlMH4C2XrjyJUPTCdU?= =?utf-8?q?8UpDnwur6qONBtPYDlk1prt79JR1i3jVE4aR7q3E+GMwZ/i7uU6c3qfCwOzhzcsJ0?= =?utf-8?q?hFAFKIahwoj19A4JX5yC3hyJU/MKFBduZOfCfBDWUBM5jhQthc7Yrc+tn0vY7w2Eh?= =?utf-8?q?+QX0jk1+m58d94SESmF0F4/nwFEtYQ9ZsSfQLHKl6SGMdlEjIKhWwcyCNxURO4UPN?= =?utf-8?q?vv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Ek6zqxWi6t3k16bZIdjn/zMXbfOBjg2zsUeUFfkIGbM2SjaEfJhEwE?= =?utf-8?q?0EWUWSW5WnhoF3LUuF3WxPniQdKoFGZ1BjDXYmxpkqo+GaCpzMKwAlInTRup6SYcf?= =?utf-8?q?fWlnnunhD5kILZv+fHCboPygCLb2TtViwu2eCQuuwpqDWoZKa6kN+ij0QcyO8LIlF?= =?utf-8?q?lo46i389WTp4Si21lVYnYM7A2DbHuaha4IXeVkjxrTrnsKcj7WX7ajU6yQHxJurK8?= =?utf-8?q?Vw4jwab0Y8auNgVgwdSFK5RUApRJ9zagh/iDUzmLJF4ua07lzPgOHpB9EAzxebz5X?= =?utf-8?q?rfQs6HflNu4QoCBmf3N/pSIF7m1xSiqBvGLB5XjYAFp6etvrAMNlGQeu/JRtO/CBj?= =?utf-8?q?pxF3PtCQC+VWNwzp6n08qVm5b4dY3fGbvl8gaYSbLCKroIp/tJiRgqaxLsVG3Ydb+?= =?utf-8?q?3S1KEA9wsmrP?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d9f87d8-99d4-4474-18ed-08dc70d12ba8 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2024 09:11:26.4111 (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: CtyCIsQ2A0dTgIxdhb86uoH+kRQtEabY3rqz+T1FDyBO0iUWDq/ujbponglSWKh8OAuEPYBwtATtZ3mR//7pTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8065 From: Pengfei Li Fractional part of PLL gets lost after re-enabling the PLL. the MFN can NOT be automatically loaded when doing frac PLL enable/disable, So when re-enable PLL, configure mfn explicitly. Fixes: 1b26cb8a77a4 ("clk: imx: support fracn gppll") Signed-off-by: Pengfei Li Reviewed-by: Jacky Bai Signed-off-by: Peng Fan --- drivers/clk/imx/clk-fracn-gppll.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/imx/clk-fracn-gppll.c b/drivers/clk/imx/clk-fracn-gppll.c index 44462ab50e51..1becba2b62d0 100644 --- a/drivers/clk/imx/clk-fracn-gppll.c +++ b/drivers/clk/imx/clk-fracn-gppll.c @@ -291,6 +291,10 @@ static int clk_fracn_gppll_prepare(struct clk_hw *hw) if (val & POWERUP_MASK) return 0; + if (pll->flags & CLK_FRACN_GPPLL_FRACN) + writel_relaxed(readl_relaxed(pll->base + PLL_NUMERATOR), + pll->base + PLL_NUMERATOR); + val |= CLKMUX_BYPASS; writel_relaxed(val, pll->base + PLL_CTRL);