From patchwork Sat May 4 00:48:57 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: 13653706 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2042.outbound.protection.outlook.com [40.107.105.42]) (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 D8354125A9 for ; Sat, 4 May 2024 00:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714783288; cv=fail; b=CNepcQT6GmP4XZsIdJ5xCYVLacgfY2+752iEz2cGt+566zkU2/39il8JxEKX3gzhZnWfe3Tnf+3hOXrOXryoJEmycbosgAX6aVL7fNfxmW25YMDM9F01U7RzwsARJCJ13dGKjZyojlucYZtch1gNYFs41Mycghy+p/rkcRaDhXw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714783288; c=relaxed/simple; bh=3/ebBXKy2EoNIVdw7nEZvhT7omyA06RAqLLNddA8Y0E=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=b16/cLQ+Kxyph5SGT1SdcE6PP2uKhIngLjQMgQ13XQkHKsNVkeaIqNQy4VBRQ3pPGzwx9HJephdSBOmpRZJbjSawrEA5oV8xyPu+dsQGFyvC89uo/BdHOfRzr9Gn4S0R0W5Ge/+oBfI+2LiVegzRZ0tRumergPuBRMsEKJjThzc= 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=KzuYL9/K; arc=fail smtp.client-ip=40.107.105.42 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="KzuYL9/K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+rqCrS8Hyd7TH4m0u4V0b37wl/n0AxHFRY65ko6CoXIG/WplV91G3vrJZg7iriWAb4fmCvKtM4sqkjDphwTi3H2tc3YadE7hTT45JItYWDCcaWuVuyvmNdtUPcQUB7WcUbdRq7NnmxOokeG9+vFOvFtziuzHhZXN/8AKEZ1Hq7aSBsptAhB+NWlpBSyDxJcxjDYyLEGS2msg6kPhe+obGeq8z4Hyg/JM7022qc1q7eN3n6k9NC+mPq/s9lr7D9Lf4PcKLqwMfL+QNRGAWCN+Enia7kZFdMT2yP689VFxJuzBEdVei0mU2VlpOjIazSPOAgIedexIhqjV0NmlIX2cw== 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=U9E5F5su/Zqvuki44gpEBTsSgQ6vXPRLf/BxsbPzG9ZRUtMGC62uaDy8yed7SruV1d/1JMs06d4uKjQqD9sBTbXiLHzaD129+yNXd7pAK99bKIdn9fhAI2YZ4LyYcKH/zojRisbSnNFeB4rhF3JS6oWx3VvWH7vhln3W9URMEhx3gfiHYAbt+dILY9Jm9quvtHh12vL32MAZ978T5pMVeqBX/WlCVQ7s1rtxqfbRK1WJXRme8bJEG0yl67vVhWNn4rQWdfyXelpu3wBA3+iqPBxQjuykPeTQz00PRAlIYtI29+1mbje6iQ15H5T72lp1GGpM9SJ++BbkP4UCsQf7uA== 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=KzuYL9/KXQBhL37KJnAL5cHJGCUmphtaKOIZxXT4EuI61mS407Njty6SDMff615yzZFK2KbwzHifQg9o8FSydzVOc3o+KJWsLei/gvWDlr0KUsL0OwjyypS7QDM953HCjCq2Ye1kXpeSwtOwVZ0Xw1h3JfT+LNXF7wwrMuP2nEA= 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 PA4PR04MB7726.eurprd04.prod.outlook.com (2603:10a6:102:ea::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.29; Sat, 4 May 2024 00:41:24 +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.029; Sat, 4 May 2024 00:41:24 +0000 From: "Peng Fan (OSS)" Date: Sat, 04 May 2024 08:48:57 +0800 Subject: [PATCH 04/18] clk: imx: fracn-gppll: fix fractional part of PLL getting lost Message-Id: <20240504-imx-clk-v1-4-f7915489d58d@nxp.com> References: <20240504-imx-clk-v1-0-f7915489d58d@nxp.com> In-Reply-To: <20240504-imx-clk-v1-0-f7915489d58d@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=1714783747; l=1031; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=YbtICGkfjNb9cX1EM8cRO+LQzM8n6WyxoMB7kWtrQtY=; b=jrvhcFI5A0TDVLYiN93pgFRnHBfEzaAtZottJqh9N0mJZSMZZbq6jKsIjspzFpIijQ8VNvsEK 9dyqy2dHRWFBYRw3SuV7F77UIb90YppE2mLaJMt0tu5PmT+pHxFE5OM X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI1PR02CA0055.apcprd02.prod.outlook.com (2603:1096:4:1f5::16) 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_|PA4PR04MB7726:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f9278a4-1356-4a5a-8146-08dc6bd2ecd6 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|7416005|52116005|366007|1800799015|376005|921011|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?59GxjnUde2TQcl5Q4kKmE1t4rSwvynr?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CMljpLQBs8P8Yxro2NST8S1wUW6CJVxFr/qIcrQ+5eSuw76RbK0mzMbtIDZIFnjL?= =?utf-8?q?+QV0r73b4NaY7VQFtN7bvYbqOmgXg9OCoVRduyAlkQn2iLIvwOcVYHEycoveHWhs5?= =?utf-8?q?FZ0AoER1MRUocfSXWgXnoj8uoSxUxWVKdeu6LtMYci2ADow8dGc0WTZ/4y+ghLlRa?= =?utf-8?q?zFtWq5X3ZuYgsV6TmWvgTn/4RBj4u/A6RHl/JdHkgH/B02fvvwe1067a63DTDcgLq?= =?utf-8?q?R6EHlnSCclyvRP+A7GmTUc8OPmG8PG24nXrNII/iZqLRlmMxgmX/eIv4W2NWtMm6o?= =?utf-8?q?PnBJAMxD1KNgWoJrhCGu76O7l3i8JD8Z+PsdhaSaCr32NeSnLiZl0yKH63AE2lUR4?= =?utf-8?q?5yQ7A/1QcPAm0cpWWXHUFcbtdcHp2UNhwXj/s5yGek0P6m9eygQEZ9ik=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)(7416005)(52116005)(366007)(1800799015)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?B6C4Xg7jqmD0vZ2vKdG8BrEUfnB6?= =?utf-8?q?ePXpzzc0xjJWhJgcuT99cJ4k4iWC/EdUzVQ6GWrnFAY9qNtCEvOnqoj/mcOG6SiGY?= =?utf-8?q?VLR5vv9a23inEyG1VhGUsphgSvYFfCicybhD9yk6RanG+IOpdAffMwnt3IPjKA3x7?= =?utf-8?q?UOnamGd/BcsIc+yAIAa94qFLLTBZv7WfGuYMuA0F8hWGxLkXeZj9ilnS5sg5nlmyt?= =?utf-8?q?M7sxanEQ4DzZ5scB98hSOwKIU7Yqeomjvl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HENQ7cdGG6KlLJ0RqByl2MS2y9BI0EMZVRPO9jzI3sd?= =?utf-8?q?5CzEnivhAi9JY/1tgGOzI9lHREtZUhfWgkJ4gnXE4luUMaimf3kaTlEeMlocfFkKj?= =?utf-8?q?rSmjxaI2i3Fi4VypU+lqZ+Ym6kdnCYQiQEAwfLP5PMGhvkcTpAIxRU0swcoXztSVO?= =?utf-8?q?OUU1hQfeuuwc2qp0SJ9kbm1/GbqGae1f2bEOryDD3/RMO65qDcBkhl4HyhdNIMTom?= =?utf-8?q?DfK+mMQYFemMEUS5ikro7YN8vMjw5tkEVZFYHjxJ+zIUoIi7T8lCKpGiRxdWZXmON?= =?utf-8?q?YLZzGSnoGXLanA57/oC/P73wiiitochVNLOuq7qlGTSoL2tPO0GPAOVPNbTx9nomH?= =?utf-8?q?1yPee1CfbcVzDXQypBQJnYjC94OyGRjICPipJSM3th6bRsInOwwd5bGd8d7yxo8AR?= =?utf-8?q?zg2YLDHQq5Et?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f9278a4-1356-4a5a-8146-08dc6bd2ecd6 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2024 00:41:24.1246 (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: Iw/6m/C2uAUBhJ9QVYPYLvd96EgI9w3xw71VL9HviQ09AGG19yW5KgTSyeFhdMtzCygQNSjc2WsPydgN7s4uTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7726 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);