From patchwork Mon Oct 14 18:24:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pengfei Li X-Patchwork-Id: 13834068 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 59923CF259C for ; Mon, 14 Oct 2024 02:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=JRz9LDeDCS8uHYwuZ5jm+hLyanYM/G7FTb4tvvbVrH8=; b=FI7/e+V35OzwYGEM/x+mkdFCd9 lsHhWfGp89bbqgIY2BDsqMpcHFvwg0r7dbIVM03cAMelQrorQUs4J8HaN5kzGqfQ2qP4xK7kyqs3V ONlA+xxVS/1wR4Eg2WK4ZLQhHsTNz4jat90rZzWBejeNeXNlJoWXorSt+sJoyysrdtOqYAbiYtyzx Y+5qf2YR1GefevozRQ1L266/2MI/G/qHumDhs5YbjuGbBqCZPyW4vnFHWiDs/j9oKAiJfpxM9SiJP 8cZNOJOCi+C8W8FDRMnVhDj0ePe5WdPMdx4CzSXjVucXNYhkTZ3RAku/q8xmkvnn5IpoRoVJjtIvh Mmsrbj7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Ar7-00000003YVY-1CR1; Mon, 14 Oct 2024 02:30:45 +0000 Received: from mail-db8eur05on20601.outbound.protection.outlook.com ([2a01:111:f403:2614::601] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Akg-00000003Xja-3Po6 for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 02:24:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iWQJriXLMkzI8sBwsyvJIxs6fegy3ek91ZqJeC5NwjL6kpAQOfjGsq2E40rJG1kxoZlv2iQlDjdXUoQnCSU9EvgCnL300PTdrp4LyMSy8S5rp9fgs1bL4y5vkCu/qqZUN5bElvpBGkwlXSlReJ9C4SGIPLdqH5hTHmX/02vW7CD8XkHpLIbIU9Tzwn4NKzOrFEXJe85geUIYHA32u25fXBcPxvov5dwh3z0ZvWycsDVxaREtub5G5GxRVuzIfnVnOQP+Jy2QbcA3HjdrdwvWUxhy0NUTkw2ZownssZL1hceY27zzPPh/BzatO9SVjPw5DU3zJWWMS+Q9py/057zbrA== 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=JRz9LDeDCS8uHYwuZ5jm+hLyanYM/G7FTb4tvvbVrH8=; b=UgBxb6UoKhWszzuEE+KeRgpyNTOUZnbsDlA1MPf9x0B3yrFgZ2L4NiSjMMzpFt/wpKSxAbb1K0+MIP+NCtTo6eRkIz9dPgdSeuvNlK8g0kyeJ/SNDbxwCLeu20fRWU6szc1Q/iY0SMpvFJ+m5ojqID9UjJ0FRjshVwqLQS+1sEHdBokgUWHYvPrZ1RJSDcDktbriCYHrlxGLtbdOaG/2cEGxz/jTccHO6DjTyeqtrmJvc5tzfjR5Y9vz9vHCDUug+Oucm/SPkh3nVea6TuVDmt9L/a82oFqyR4cN4qsD5Q11qhsVnjw6EzrIfXNKrtVunj/GxLkBb8B24Jid+P6MuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JRz9LDeDCS8uHYwuZ5jm+hLyanYM/G7FTb4tvvbVrH8=; b=g340pS4HNcptBCcZANFh+QDKYPJfQvUb5QA/QQHgBMWVB2r+g39DuqaGBUqO8m6TjLxB4bIki6OF7Dsb4VySpDVGpJohRP47zaRQZ+Lzk3fqNamKRSELQGqts0psSbBi1+f66vWqL2HZ6OqmSsdSxuh/H75D2IepPRYd7mnzQqTP7LhVifLjlOvTHzS2EBBWX9GG/76xJhtn8tu78DIdJIjDQNcZpTfU3MylHYv4Ar9n8NQmmsTQNwpR+WWUoqNCmNcVIslhKGqIj4gs4TN69LI2plbsE4+ZqyUEiDUmgDhuuDRtxQ8UQF6Ch3Ybs9HXvg6f6NC2S/tgcLDcO/Jxfg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB7065.eurprd04.prod.outlook.com (2603:10a6:10:127::9) by DB9PR04MB9378.eurprd04.prod.outlook.com (2603:10a6:10:36a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.24; Mon, 14 Oct 2024 02:24:02 +0000 Received: from DB8PR04MB7065.eurprd04.prod.outlook.com ([fe80::8af7:8659:9d42:bd84]) by DB8PR04MB7065.eurprd04.prod.outlook.com ([fe80::8af7:8659:9d42:bd84%6]) with mapi id 15.20.8048.020; Mon, 14 Oct 2024 02:24:02 +0000 From: Pengfei Li To: krzk+dt@kernel.org, robh@kernel.org, abelvesa@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, ping.bai@nxp.com, ye.li@nxp.com, peng.fan@nxp.com, aisheng.dong@nxp.com, frank.li@nxp.com Cc: kernel@pengutronix.de, festevam@gmail.com, linux-clk@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/4] clk: imx: add i.MX91 clk Date: Mon, 14 Oct 2024 11:24:38 -0700 Message-Id: <20241014182438.732444-5-pengfei.li_1@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241014182438.732444-1-pengfei.li_1@nxp.com> References: <20241014182438.732444-1-pengfei.li_1@nxp.com> X-ClientProxiedBy: SI2PR02CA0040.apcprd02.prod.outlook.com (2603:1096:4:196::6) To DB8PR04MB7065.eurprd04.prod.outlook.com (2603:10a6:10:127::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB8PR04MB7065:EE_|DB9PR04MB9378:EE_ X-MS-Office365-Filtering-Correlation-Id: ae3ac55f-d861-4a48-ba0a-08dcebf744c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: wq9i2X3A/8a87MF8c/y01fat6fawaQNtZfZhdjnbwUVdrGNfPbBpN0yJanTDImh9WCaD4b0cL31cuN+aRyrxnzqjIdROl0sMS+iWzMFiKObsOxMOVR90bCHciHUaRMzzP04RWxx0dGdUWFnY0WX7PUEmWX9fPZzDjKGXXw8LG7R6ydb1Prj4lQai9cfvUEuReJFTLdsQPSiQIi3jvShEXQouaTREtvgTHgoUg52OW5PCLktwvAUKUaffUyBybJQ8pwt3zt2jgTCBDXdL8ieuBepc0LGr78btAGoVp3i7Pb7DvPk+qDdmx74hmTqQ/0wGxaO47grXcsPDXDHzO1wBel4Km3JV62+zlvWNu5zKnXYbdftLeFarwpaXU6vnCRrlg5HW9kP68T1Vj+Z48MPiiv0BCbhE0QccCi0BHK+rTAWh0V3nsk12DyxPvM0sFdWrZzZK3NYmEyEqnfcfLNJbHMXj6WlGUahsIda8RRSXcYh7h67NHOIS04tQzq9IGXCTFUPN/JPjON9ckAhC6mw/8QRI8fUBxHJCZuYcXunBz2fUIMaZ5jwtWWXWpP8eIjPJl69otqcOxIi1P2Njir3qywQIqa0lU5HG9GPlKu00WjgO6Lj5Pn2/BHWSO93NwHZSuyvTVfFDEyr/a7ntDUJkncF1D11FZsoaGLsRKMRae+fCShy+Ew3GIkqG0K0QnjUQ1pqGDniBUpTNaFzfhP2aOUdvSpSmxGUxaA95JWup/sJP/T6VYkpa15EtBDuXM6FwYH9I8Dhyy76YkzfxBPrZYWHRFmlB41S5pSE+EviZxrADsrhQ1VBarpokFwKxdqFonAJQl0w/HmWimPmP65z/tNay653CTUkiP6ed5iWS2g6iYJBgS5nVEGR/huHWBlFvk43BPPDFGfSUP0EWgvR0GD99WosCDRNhZNAmfRMFRthQROMYlec87/F+5bdhD3Hjel7Gdcep5GhOHb+DLxwI2dnGw/gh8+NFW3624+0GUhvoBeWChjVobRXz5pc9mI8+elpSHX4Nxm/2MVbqrkaeRwrdkoGCNkatU3s5hnLI99kZI8Wwof36e39NrLyIgctEqCwQTPTWT8Gumdx1ui4x9e32H3JKE6Xy30+2FzhRN64jrP3MePZFiMZCQLpjvP+EJK4RxdyvLU608hRoHFFHOPgmXKnDP8JMB+yyCr2hm2IX0a42ZVhTB0kwRUD8NKApRctCnTgUgDqbZffXNGQRvRKFr12UxDG648+DziybY+8EMVbW7dJbgWZge6cl0dFahCcRGNd5BVTCSuysqnC51gDrr3tX6jUBcBpk2lGYU4xH0sIDIR2FB+OQ9nxdhTtcTowqeVC7MuEG6AymBoMB5g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR04MB7065.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RgtPlznmnI+uwiWsOMOHFiB2nIt2PDwvCcLgo/4Tbrxx7LXsV1FLCLhP0o9Zr7GRcXzTFJE0LHLpcIjU7ix2zod/Bk5NxL7M8UlEmJuQzWZY4D+9cnbJReFvYpYFKmL0wBdk+kTSmP2/8xixS2/v0jN2k2PQUWabGDgWx3nwSe0/rV0aPVAxkBdq1UWrDKe/AgR3sG56KHm5D76mRYxUFS423KzTN0JEwAHF0hfQmuKvgf4BM9GJ6LvsqI66Hm2NqHc54Ab8mMPCbX1H7uWU6TLFrxu4WV867eo0l/1GRrXWDee+C+k3R47b6HS3iDGcBerelh8hQShqDIu0Ov6XjJW8ZHn1w7+kQWZuJ9h3vlLFVthy8OdyPvWQQATHUyl5sJiAAq9DoAuCXrDvwPGtdqJXujOycMaE2YnDDP1P0rz7wPuDJw2C4Md06omUeVj9Pino442oFDLjz3ouXAeUklTUfFiIHYpGMjAxA6jyn+5QucYE0WwrZ8xttBbgRJYIauJmbbfJxyZ9zXBGg246LqxH9cMDQ3kmseZqCpkRBB5VOzXP34lGj6ybsnIh1hSUA31WYEQbjqH2FLhjaApESDoC6sTMPQ83hflrMkCY/zYC3R3sHCPAyAiJaHam0vJEC2KCo/0gA3HxTAvUJc4kHCP1cKXxpwqUJIQzv1FLLra2BlPdLGbwlvRrE5AfX6FhWPqMD9lLfedSv1stFQBdwTP2eZJpRgu8hCiDqK82OeuGij9v0NgVlQ9j8epEyr5HaecgN2HYfiQ8m1XfbBRBne4OQb0GpcY+Sm9SWX2ydUxUGLyrUYzsiv0UZI+/0Vpc3/YyU/ALhrOkQzKT0gxZ88NJSRqMQmrVRVIsWids+wG1tZXf8DnGyT/KWeYGxuI77gdrdDbfEnjMhb7HT++04qtlP+mEYYnwZM7Dtu5n8G9d1j+xLAfWINxx+gSz6Lf00+Pww/rFM0HPj3CIG7xgViE8GZlGMRa/URkGmPujD+WBohcL3HOHXtwAV1zSOe2rOjMHbgTrNTgJxaa0NCJG3MiOkF5rRKG+LCZB6nypcoP2ys9vUoW0dsoAUfOQZHOuOiABkFNSD47rJPM2+BPNyC6eGet27wIVejxz5UT1M9c++PF5oF9W3fFHe8XEzUA25GvVpPpnQsHFpuN8Cb37eMGamUD+ACXcKxisDRGI24eR/gwa6FhOVpK05Lxm/nT+ZI32iGrBms9p6345XKDEymDmWRT5IXzBLxj2JZYKx8IXedmswZDjwUbM54cRW4zKTHyYuSApVr9meW+iiFgJCPb9IiGQ1vf4JfDZP7v21MDgZatMu0QjteCenAJIujw1NcJnB/J0HQzONpS5/ICulw0QnxQYSYNNXALAU3WUs/IHxPZhrPpPp/vYDoui9qeQQU997AmLqhFejpjqwxn1AZjmyLyzTqd3D3yZbtXhzSfY9BgXPODqzG7I91nXwtQIQ73N209wLqCBHfdeuUMGiNRmGH6pM8srzja8TXuSKYl79ZAWNrSf3MuaR7EVNZnvnfp0LoHWwYxKSCNRKGLbWxe3GcTEg2e1S6zT5FGm2sU/I1nYf9g3IkvefQ86uXxt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae3ac55f-d861-4a48-ba0a-08dcebf744c1 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB7065.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2024 02:24:02.6365 (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: T7ldV/pTBksyiTYovdiIL0te5E1fGSqTxijiRzB1EkC6xD7Vkl1OZwrGHbisYZvx0D6FFjSHaatPgN3QtOcvmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9378 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241013_192407_032800_0C999F15 X-CRM114-Status: GOOD ( 15.13 ) 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 Add i.MX91 clk driver which reuses the 93 driver and removes some clks. Signed-off-by: Pengfei Li Reviewed-by: Peng Fan --- drivers/clk/imx/clk-imx93.c | 64 +++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/drivers/clk/imx/clk-imx93.c b/drivers/clk/imx/clk-imx93.c index c8b65146e76e..4d1123f51903 100644 --- a/drivers/clk/imx/clk-imx93.c +++ b/drivers/clk/imx/clk-imx93.c @@ -15,7 +15,11 @@ #include "clk.h" -#define IMX93_CLK_END 202 + +#define IMX93_CLK_END 207 + +#define PLAT_IMX93 BIT(0) +#define PLAT_IMX91 BIT(1) enum clk_sel { LOW_SPEED_IO_SEL, @@ -55,6 +59,7 @@ static const struct imx93_clk_root { u32 off; enum clk_sel sel; unsigned long flags; + unsigned long plat; } root_array[] = { /* a55/m33/bus critical clk for system run */ { IMX93_CLK_A55_PERIPH, "a55_periph_root", 0x0000, FAST_SEL, CLK_IS_CRITICAL }, @@ -65,7 +70,7 @@ static const struct imx93_clk_root { { IMX93_CLK_BUS_AON, "bus_aon_root", 0x0300, LOW_SPEED_IO_SEL, CLK_IS_CRITICAL }, { IMX93_CLK_WAKEUP_AXI, "wakeup_axi_root", 0x0380, FAST_SEL, CLK_IS_CRITICAL }, { IMX93_CLK_SWO_TRACE, "swo_trace_root", 0x0400, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_M33_SYSTICK, "m33_systick_root", 0x0480, LOW_SPEED_IO_SEL, }, + { IMX93_CLK_M33_SYSTICK, "m33_systick_root", 0x0480, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_FLEXIO1, "flexio1_root", 0x0500, LOW_SPEED_IO_SEL, }, { IMX93_CLK_FLEXIO2, "flexio2_root", 0x0580, LOW_SPEED_IO_SEL, }, { IMX93_CLK_LPTMR1, "lptmr1_root", 0x0700, LOW_SPEED_IO_SEL, }, @@ -122,15 +127,15 @@ static const struct imx93_clk_root { { IMX93_CLK_HSIO_ACSCAN_80M, "hsio_acscan_80m_root", 0x1f80, LOW_SPEED_IO_SEL, }, { IMX93_CLK_HSIO_ACSCAN_480M, "hsio_acscan_480m_root", 0x2000, MISC_SEL, }, { IMX93_CLK_NIC_AXI, "nic_axi_root", 0x2080, FAST_SEL, CLK_IS_CRITICAL, }, - { IMX93_CLK_ML_APB, "ml_apb_root", 0x2180, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_ML, "ml_root", 0x2200, FAST_SEL, }, + { IMX93_CLK_ML_APB, "ml_apb_root", 0x2180, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_ML, "ml_root", 0x2200, FAST_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_MEDIA_AXI, "media_axi_root", 0x2280, FAST_SEL, }, { IMX93_CLK_MEDIA_APB, "media_apb_root", 0x2300, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_MEDIA_LDB, "media_ldb_root", 0x2380, VIDEO_SEL, }, + { IMX93_CLK_MEDIA_LDB, "media_ldb_root", 0x2380, VIDEO_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_MEDIA_DISP_PIX, "media_disp_pix_root", 0x2400, VIDEO_SEL, }, { IMX93_CLK_CAM_PIX, "cam_pix_root", 0x2480, VIDEO_SEL, }, - { IMX93_CLK_MIPI_TEST_BYTE, "mipi_test_byte_root", 0x2500, VIDEO_SEL, }, - { IMX93_CLK_MIPI_PHY_CFG, "mipi_phy_cfg_root", 0x2580, VIDEO_SEL, }, + { IMX93_CLK_MIPI_TEST_BYTE, "mipi_test_byte_root", 0x2500, VIDEO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_MIPI_PHY_CFG, "mipi_phy_cfg_root", 0x2580, VIDEO_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_ADC, "adc_root", 0x2700, LOW_SPEED_IO_SEL, }, { IMX93_CLK_PDM, "pdm_root", 0x2780, AUDIO_SEL, }, { IMX93_CLK_TSTMR1, "tstmr1_root", 0x2800, LOW_SPEED_IO_SEL, }, @@ -139,13 +144,16 @@ static const struct imx93_clk_root { { IMX93_CLK_MQS2, "mqs2_root", 0x2980, AUDIO_SEL, }, { IMX93_CLK_AUDIO_XCVR, "audio_xcvr_root", 0x2a00, NON_IO_SEL, }, { IMX93_CLK_SPDIF, "spdif_root", 0x2a80, AUDIO_SEL, }, - { IMX93_CLK_ENET, "enet_root", 0x2b00, NON_IO_SEL, }, - { IMX93_CLK_ENET_TIMER1, "enet_timer1_root", 0x2b80, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_ENET_TIMER2, "enet_timer2_root", 0x2c00, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_ENET_REF, "enet_ref_root", 0x2c80, NON_IO_SEL, }, - { IMX93_CLK_ENET_REF_PHY, "enet_ref_phy_root", 0x2d00, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_I3C1_SLOW, "i3c1_slow_root", 0x2d80, LOW_SPEED_IO_SEL, }, - { IMX93_CLK_I3C2_SLOW, "i3c2_slow_root", 0x2e00, LOW_SPEED_IO_SEL, }, + { IMX93_CLK_ENET, "enet_root", 0x2b00, NON_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_ENET_TIMER1, "enet_timer1_root", 0x2b80, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_ENET_TIMER2, "enet_timer2_root", 0x2c00, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_ENET_REF, "enet_ref_root", 0x2c80, NON_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_ENET_REF_PHY, "enet_ref_phy_root", 0x2d00, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, + { IMX91_CLK_ENET1_QOS_TSN, "enet1_qos_tsn_root", 0x2b00, NON_IO_SEL, 0, PLAT_IMX91, }, + { IMX91_CLK_ENET_TIMER, "enet_timer_root", 0x2b80, LOW_SPEED_IO_SEL, 0, PLAT_IMX91, }, + { IMX91_CLK_ENET2_REGULAR, "enet2_regular_root", 0x2c80, NON_IO_SEL, 0, PLAT_IMX91, }, + { IMX93_CLK_I3C1_SLOW, "i3c1_slow_root", 0x2d80, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, + { IMX93_CLK_I3C2_SLOW, "i3c2_slow_root", 0x2e00, LOW_SPEED_IO_SEL, 0, PLAT_IMX93, }, { IMX93_CLK_USB_PHY_BURUNIN, "usb_phy_root", 0x2e80, LOW_SPEED_IO_SEL, }, { IMX93_CLK_PAL_CAME_SCAN, "pal_came_scan_root", 0x2f00, MISC_SEL, } }; @@ -157,6 +165,7 @@ static const struct imx93_clk_ccgr { u32 off; unsigned long flags; u32 *shared_count; + unsigned long plat; } ccgr_array[] = { { IMX93_CLK_A55_GATE, "a55_alt", "a55_alt_root", 0x8000, }, /* M33 critical clk for system run */ @@ -246,8 +255,10 @@ static const struct imx93_clk_ccgr { { IMX93_CLK_AUD_XCVR_GATE, "aud_xcvr", "audio_xcvr_root", 0x9b80, }, { IMX93_CLK_SPDIF_GATE, "spdif", "spdif_root", 0x9c00, }, { IMX93_CLK_HSIO_32K_GATE, "hsio_32k", "osc_32k", 0x9dc0, }, - { IMX93_CLK_ENET1_GATE, "enet1", "wakeup_axi_root", 0x9e00, }, - { IMX93_CLK_ENET_QOS_GATE, "enet_qos", "wakeup_axi_root", 0x9e40, }, + { IMX93_CLK_ENET1_GATE, "enet1", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX93, }, + { IMX93_CLK_ENET_QOS_GATE, "enet_qos", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX93, }, + { IMX91_CLK_ENET2_REGULAR_GATE, "enet2_regular", "wakeup_axi_root", 0x9e00, 0, NULL, PLAT_IMX91, }, + { IMX91_CLK_ENET1_QOS_TSN_GATE, "enet1_qos_tsn", "wakeup_axi_root", 0x9e40, 0, NULL, PLAT_IMX91, }, /* Critical because clk accessed during CPU idle */ { IMX93_CLK_SYS_CNT_GATE, "sys_cnt", "osc_24m", 0x9e80, CLK_IS_CRITICAL}, { IMX93_CLK_TSTMR1_GATE, "tstmr1", "bus_aon_root", 0x9ec0, }, @@ -267,6 +278,7 @@ static int imx93_clocks_probe(struct platform_device *pdev) const struct imx93_clk_ccgr *ccgr; void __iomem *base, *anatop_base; int i, ret; + const unsigned long plat = (unsigned long)device_get_match_data(&pdev->dev); clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, IMX93_CLK_END), GFP_KERNEL); @@ -316,17 +328,20 @@ static int imx93_clocks_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(root_array); i++) { root = &root_array[i]; - clks[root->clk] = imx93_clk_composite_flags(root->name, - parent_names[root->sel], - 4, base + root->off, 3, - root->flags); + if (!root->plat || root->plat & plat) + clks[root->clk] = imx93_clk_composite_flags(root->name, + parent_names[root->sel], + 4, base + root->off, 3, + root->flags); } for (i = 0; i < ARRAY_SIZE(ccgr_array); i++) { ccgr = &ccgr_array[i]; - clks[ccgr->clk] = imx93_clk_gate(NULL, ccgr->name, ccgr->parent_name, - ccgr->flags, base + ccgr->off, 0, 1, 1, 3, - ccgr->shared_count); + if (!ccgr->plat || ccgr->plat & plat) + clks[ccgr->clk] = imx93_clk_gate(NULL, + ccgr->name, ccgr->parent_name, + ccgr->flags, base + ccgr->off, 0, 1, 1, 3, + ccgr->shared_count); } clks[IMX93_CLK_A55_SEL] = imx_clk_hw_mux2("a55_sel", base + 0x4820, 0, 1, a55_core_sels, @@ -356,7 +371,8 @@ static int imx93_clocks_probe(struct platform_device *pdev) } static const struct of_device_id imx93_clk_of_match[] = { - { .compatible = "fsl,imx93-ccm" }, + { .compatible = "fsl,imx93-ccm", .data = (void *)PLAT_IMX93 }, + { .compatible = "fsl,imx91-ccm", .data = (void *)PLAT_IMX91 }, { /* Sentinel */ }, }; MODULE_DEVICE_TABLE(of, imx93_clk_of_match);