From patchwork Fri May 10 09:19:03 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: 13661131 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF938C25B4F for ; Fri, 10 May 2024 09:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=3sPCLI2ykzA2NjZ5RjTksVprghUvrwE26+01DAjDysE=; b=izK1IyqXS25cPXm0/+qaktMVp8 hCxUvqrzAenlERf5e+fyRuJCyghZ5I4HLGGnOXf7ogsCGwXWBVmIxcUF5DiE3a91HSgqGXvPtxrxn yYX8YXE6uk5IgkCfMzHJhOrcqhw14ilchpZSKu+SKb9/8ugZXqEuir2qeUrsqkH1CWr7UtoZWzPaI 7FucNOsh/6egJisM5Wi9c/jCQlgnBlq3Rfav05OFnbvETjDdX6/YWfMgxHUe+VwPu4kFljS6F32c1 FMCkjCmqijchhAS/AwH0LePIlX5J77ul2G22WZZcol+vdihDBiV1/1Fd9HZzbr3TYNNHbYovlZ8nU +a5ALTMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5MIj-00000004ct3-3ShQ; Fri, 10 May 2024 09:12:25 +0000 Received: from mail-am6eur05on20601.outbound.protection.outlook.com ([2a01:111:f403:2612::601] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5MID-00000004cNq-38NZ for linux-arm-kernel@lists.infradead.org; Fri, 10 May 2024 09:12:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FphXK06iXuYZJgInURNh06p/6j85+z04juU94iJPJV66MQV1quIoQoXgj9MxfFJhqWhSflhe1xYfp2qFlhEk/tvIDV4ehnUxHT0O2f8TJbTlMB5Fwulj8uQTHm//Ko1qyZ3K5b+IZl4czt6GFU3oI2E0haPmL3WnE/OVWsDOfpiEq/rqh6uYOqthoudTc7LSwU5LlU1AS2x53Gzs+rCnpuVqMAE0d2BxjHn0lZsMzigYRiL1NSbkXF+6I/4tdMvNU1gjylSwbxnHjVzw4Mc5mp+57QNF6CEfyf/cAuf/F5bvssujugV+y16LmAcM0kRI2PWYqxSnk6WJF0Va1+mFPQ== 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=usPxMF+abDDxGyg9lU1ffDPQeliZbPP71G7yzsYJVQ8=; b=E3LPeYBeUc9PxrKgiG6MIqx44Hpu5nlFJwJYvhIja4GKvoMkSvy+we6Hy1RStJsf/EUJFIG/C51QrJ0735J+a7M4zmAp7wWUpDxWpr99P2cOpfv44MY94OXkLihDOm5zUrl6QV6bmkhR0huvBig9Ua67r/SI7f0sb3kCLGhAaav5fx5KQiMg8NJw9hkMgzFl219vCynLO54qqTeJ6+D8IwymkCQiQ6E4wQkRJq5HaHGMcWq8vZ72xpYrqP71W6kYBXoSYMc345SpkKzMt3r4CTKdMC+oI005PO2+Mc1R2LPRJ4Sm0QRNpemF9y59NlZ3G4LNDN3ZPBU3HmENTW74VA== 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=usPxMF+abDDxGyg9lU1ffDPQeliZbPP71G7yzsYJVQ8=; b=XGVeI+HPi6vcP2n2UHKyRNZzuzOXwiLR7Z7xkhmfoxHJbTUN6WD8XA+t7h0IBsah7RdFw9fAMPY+sJO9w+A3UGd8fH9yb6nDBrpEaHhJL2O/Mwf5V1KFHMox7KoUSpSE3oBJ2/Uf38sxq1QJN/wZsjYKdQKmk1Nhk7H3oQdAQi8= 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 PA1PR04MB10399.eurprd04.prod.outlook.com (2603:10a6:102:452::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.47; Fri, 10 May 2024 09:11:50 +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:50 +0000 From: "Peng Fan (OSS)" Date: Fri, 10 May 2024 17:19:03 +0800 Subject: [PATCH v2 08/17] clk: imx: imx8mp: fix clock tree update of TF-A managed clocks Message-Id: <20240510-imx-clk-v2-8-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 , Zhipeng Wang X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1715332748; l=2375; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=a0EXy0fZ6h4g3hX/vQwYN1ZZTioQoMQK+mQT/+3QweE=; b=XwJxC9OUx2jRhp+GlBmHpmQv4o447U6v4NK8sIdXX6d2Y//GrTvS3y1qyOEtgEX39Bp6XxigC aAioSvpPVkdBOQt1FpFdiWFALd8sg1s7fD5y1d6dd2pqfOznDR5xk4O 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) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|PA1PR04MB10399:EE_ X-MS-Office365-Filtering-Correlation-Id: 80c19b88-699f-4421-9070-08dc70d139d0 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|376005|1800799015|52116005|7416005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: =?utf-8?q?l3t/fMDLnUnuMKlZFQS4FKJ+AZzItwt?= =?utf-8?q?vWafxowBAESf6edjzg2ndtioh9/qRmc5wh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IXXyPDfXmeu6IsjjNa/X2izVB1jeEAGrZxp2i?= =?utf-8?q?TdH09e9md1pRggAZ2Zc9E541vcZHmlliACNGNA0yELIBMgsSwkzmGPssvsF8bxWIO?= =?utf-8?q?ZKrrdge+5I/rb7yG8SqMiaJT0iqOcFLQ9AMvELbM53dknuhIMIFYVZm39qTVyrzN2?= =?utf-8?q?/+RtkbLXzobSCiXHXaM4p4+fk7yqtCtaDmZA6LyJ3AaRD9eT2O0XqfJ4MZpSj2urJ?= =?utf-8?q?xklodLIqDoJUrGzSCiFjWoqqpnOfyZ02iz7JQio/l9UsAdMRt3kU5T113yCapKfph?= =?utf-8?q?HoPxluxiM17Naa+1xInoTp3EqJPxb+NmKSjuxIDGyw5yAa1EQOA4j/yehXc3ZkAuK?= =?utf-8?q?VzDcyeXByYvu0mEtMfWLRFLchAkA2USJkkQIOUPtIHaL7VrFedTBLea0=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)(376005)(1800799015)(52116005)(7416005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?TEcrOaWVKpr/Jvg4Sh1HZITvC3Ls?= =?utf-8?q?wUM8zim9milyVYQljsUXu6ThbVt2aloB4tp2mbwBzzsq3SkIE+qKY0Hb3Gx4GEg3M?= =?utf-8?q?Nrl4Eypd2ugP5f3PexJZnCj3VJ0YGYZeZWt5VD4sr+aRpPBPOjE9Lj8iaVcXog6Vu?= =?utf-8?q?qVhNCKkYMV2breOYED89rFWCvon57A1Z4H1EwNIEMhQTSvA1shwLUcC+GtqwRBtdo?= =?utf-8?q?gdZmEAxwRDMH3waSccXEvk6bmvrTg4Ip1AufOEg1uesBPcKvAVqD2EiTulRsoWulg?= =?utf-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g/eB6FRih3bOgi2ZQVNw3kYzY2rMzigwcMwAPtq3WQN0SdwiwlDibDWjZGGZY?= =?utf-8?q?0JjW3M6NrwjFxrE6Xdh9NANn9F1rLlRxtl+mdlgNylOBCqFN6OE2RAzDTja3yOgoy?= =?utf-8?q?iN5ls9Ly41nUdZ5GzMIaT1jWoCv1MW64Wwh3ejy2b1m462blf4t55mbmbWNF6rHAB?= =?utf-8?q?M+ic/fMjfBjFUUWHknkAATuis+Ny83i2CEQ4uuZoNnjARc/zXpRC8lXoVDbj05Xzj?= =?utf-8?q?Iip8a/I/rzhz+eywAsUjabBNkIs9T22paTsI5rChXMjNOZEamOOIcaSYIa6wmG8kB?= =?utf-8?q?voFXnX/O0LTb9G+LDWfNhvmzcRYF85gigdIUiA853FC+sbqu4HBariBDntCxw8mvr?= =?utf-8?q?xhBNKBlzjUlt?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80c19b88-699f-4421-9070-08dc70d139d0 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:50.1832 (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: x94WhFat2nc0WGnjTBU2GwZHxMCZGZQK3e6SHrnT3fnc9Px7nY9pMtJchtDS2RJcFpP0Xw+zt+pE+4EeZlFJNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10399 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240510_021154_095388_CED4DE7E X-CRM114-Status: GOOD ( 14.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Zhipeng Wang On the i.MX8M*, the TF-A exposes a SiP (Silicon Provider) service for DDR frequency scaling. The imx8m-ddrc-devfreq driver calls the SiP and then does clk_set_parent on the DDR muxes to synchronize the clock tree. since commit 936c383673b9 ("clk: imx: fix composite peripheral flags"), these TF-A managed muxes have SET_PARENT_GATE set, which results in imx8m-ddrc-devfreq's clk_set_parent after SiP failing with -EBUSY: clk_set_parent(dram_apb_src, sys1_pll_40m);(busfreq-imx8mq.c) This is safe to do, because updating the Linux clock tree to reflect reality will always be glitch-free. commit 926bf91248dd ("clk: imx8m: fix clock tree update of TF-A managed clocks") adds this method and enables 8mm, 8mn and 8mq. i.MX8MP also needs it. Another reason to this patch is that powersave image BT music requires dram to be 400MTS, so clk_set_parent(dram_alt_src, sys1_pll_800m); is required. Without this patch, it will not succeed. Fixes: 936c383673b9 ("clk: imx: fix composite peripheral flags") Signed-off-by: Zhipeng Wang Signed-off-by: Peng Fan Reviewed-by: Ahmad Fatoum --- drivers/clk/imx/clk-imx8mp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c index 670aa2bab301..e561ff7b135f 100644 --- a/drivers/clk/imx/clk-imx8mp.c +++ b/drivers/clk/imx/clk-imx8mp.c @@ -551,8 +551,8 @@ static int imx8mp_clocks_probe(struct platform_device *pdev) hws[IMX8MP_CLK_IPG_ROOT] = imx_clk_hw_divider2("ipg_root", "ahb_root", ccm_base + 0x9080, 0, 1); - hws[IMX8MP_CLK_DRAM_ALT] = imx8m_clk_hw_composite("dram_alt", imx8mp_dram_alt_sels, ccm_base + 0xa000); - hws[IMX8MP_CLK_DRAM_APB] = imx8m_clk_hw_composite_critical("dram_apb", imx8mp_dram_apb_sels, ccm_base + 0xa080); + hws[IMX8MP_CLK_DRAM_ALT] = imx8m_clk_hw_fw_managed_composite("dram_alt", imx8mp_dram_alt_sels, ccm_base + 0xa000); + hws[IMX8MP_CLK_DRAM_APB] = imx8m_clk_hw_fw_managed_composite_critical("dram_apb", imx8mp_dram_apb_sels, ccm_base + 0xa080); hws[IMX8MP_CLK_VPU_G1] = imx8m_clk_hw_composite("vpu_g1", imx8mp_vpu_g1_sels, ccm_base + 0xa100); hws[IMX8MP_CLK_VPU_G2] = imx8m_clk_hw_composite("vpu_g2", imx8mp_vpu_g2_sels, ccm_base + 0xa180); hws[IMX8MP_CLK_CAN1] = imx8m_clk_hw_composite("can1", imx8mp_can1_sels, ccm_base + 0xa200);