From nobody Mon Apr 6 23:08:21 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ADC7ECAAD3 for ; Thu, 1 Sep 2022 18:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234508AbiIASe7 (ORCPT ); Thu, 1 Sep 2022 14:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234594AbiIASeV (ORCPT ); Thu, 1 Sep 2022 14:34:21 -0400 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A243C7EFD9; Thu, 1 Sep 2022 11:34:08 -0700 (PDT) Received: by mail-qk1-x72a.google.com with SMTP id g21so13983158qka.5; Thu, 01 Sep 2022 11:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=w6/b6eAxBM+z6MacuArKcagQMrwFQhEgIdrWGuZF1SU=; b=H93NkSYq9RPDgfFgxKcfySyBf8G5mKNjY+WNhUkzoka9pWwIt0YX7haA0jnRgo5373 BzEQa33gtFlRhqQYrBEoLNQiZoAEwccxVJ+WdB1cfBH0jXPY/50mCxievwNbusMEsu2m iMgW7tOJ5a+69qO+b+WpNoZThMOB7S4bTY3SXhCKiMX92XyUDgs293gwZtI28RjMw5sY J/BlmNUlxCMHx3UJ/bVTdZg7uhaIF66N1Ov2BfcqlHzmfnIhNyNbFfqJ+XOpDJ0jh61y fddKIN1ibR5SClv96Wug/rz/PRYbw8/5/xYkZV63lY+yXcvsoSRRtCX4JgTG+R5QCCso HSzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=w6/b6eAxBM+z6MacuArKcagQMrwFQhEgIdrWGuZF1SU=; b=JQ3JXrpFw7VZ39DWiHgLR98M2ievxnpCpiLlpOW/2AXqZSjS5P0rR4JgupKJ/m4XiI Tj09RkQBVVr20CK1miYztzkfFNPx/V8tY/ub/UrVnFQZHVoXfRRbdedm1OzAJ15otLv4 5mtISGJo/o6GCD1tjBtL2dx7sYmjjOZ2zP2O3zEHtFffC4pQFKMt0/HIuuiAtEkJo2vK ZGdkvNW2LTXhyyvqyYKi9AQgCVfn0oX7E8SMMVM0JXct2NSaLuG+D7GV0QLgIrw2wYkG YLStj5NHJqAYF5s26U2juo9ZVu0Mb4UYAYNpJYV5p1aY0T1my9nHN3rFJIsJ0XSMd4xO nB9w== X-Gm-Message-State: ACgBeo2f+oquzlf9S7h98TrVWCYmbtIs3el8GedKISHL0mT0SoMzgYR/ 7TWccATtig1uABbrdnCYEu0= X-Google-Smtp-Source: AA6agR6s6kZsW7g7CJ4+pV8uhBOgvwWXUhTTMy/1JaA9iQ7rW5iXZj9IfBVupJTx1kb2oF//HTTMRw== X-Received: by 2002:a37:6086:0:b0:6bb:cf90:f680 with SMTP id u128-20020a376086000000b006bbcf90f680mr19868966qkb.182.1662057243951; Thu, 01 Sep 2022 11:34:03 -0700 (PDT) Received: from jesse-desktop.jtp-bos.lab (146-115-144-188.s4282.c3-0.nwt-cbr1.sbo-nwt.ma.cable.rcncustomer.com. [146.115.144.188]) by smtp.gmail.com with ESMTPSA id u20-20020ac87514000000b00342e86b3bdasm10563343qtq.12.2022.09.01.11.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 11:34:02 -0700 (PDT) From: Jesse Taube X-Google-Original-From: Jesse Taube To: linux-imx@nxp.com Cc: robh+dt@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, aisheng.dong@nxp.com, stefan@agner.ch, linus.walleij@linaro.org, daniel.lezcano@linaro.org, tglx@linutronix.de, arnd@arndb.de, olof@lixom.net, soc@kernel.org, linux@armlinux.org.uk, abel.vesa@nxp.com, dev@lynxeye.de, marcel.ziswiler@toradex.com, tharvey@gateworks.com, leoyang.li@nxp.com, sebastian.reichel@collabora.com, cniedermaier@dh-electronics.com, Mr.Bossman075@gmail.com, clin@suse.com, giulio.benetti@benettiengineering.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Subject: [PATCH v6 08/10] clk: imx: Add initial support for i.MXRT1170 clock driver Date: Thu, 1 Sep 2022 14:33:41 -0400 Message-Id: <20220901183343.3188903-9-Mr.Bossman075@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220901183343.3188903-1-Mr.Bossman075@gmail.com> References: <20220901183343.3188903-1-Mr.Bossman075@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add clock driver support for i.MXRT1170. Cc: Giulio Benetti Signed-off-by: Jesse Taube --- V1 -> V2: - Add slab.h and clock-provider.h - Add spaces in `root_clocks` - Expand and sort macro - Move `clk_hw` structs to `clocks_probe` - Remove of_irq.h - Remove unused code/comments V2 -> V3: - Expand root_clocks names array - Remove root_clock_names enum V3 -> V4: - Nothing done V4 -> V5: - Use __imx_clk_hw_pllv3 to change power bit V5 -> V6: - Nothing done --- drivers/clk/imx/Kconfig | 7 + drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-imxrt1170.c | 749 ++++++++++++++++++++++++++++++++ 3 files changed, 757 insertions(+) create mode 100644 drivers/clk/imx/clk-imxrt1170.c diff --git a/drivers/clk/imx/Kconfig b/drivers/clk/imx/Kconfig index 25785ec9c276..704a7777af4f 100644 --- a/drivers/clk/imx/Kconfig +++ b/drivers/clk/imx/Kconfig @@ -119,3 +119,10 @@ config CLK_IMXRT1050 select MXC_CLK help Build the driver for i.MXRT1050 CCM Clock Driver + +config CLK_IMXRT1170 + tristate "IMXRT1170 CCM Clock Driver" + depends on SOC_IMXRT + select MXC_CLK + help + Build the driver for i.MXRT1170 CCM Clock Driver diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 88b9b9285d22..d607a6d8138a 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -52,4 +52,5 @@ obj-$(CONFIG_CLK_IMX6UL) +=3D clk-imx6ul.o obj-$(CONFIG_CLK_IMX7D) +=3D clk-imx7d.o obj-$(CONFIG_CLK_IMX7ULP) +=3D clk-imx7ulp.o obj-$(CONFIG_CLK_IMXRT1050) +=3D clk-imxrt1050.o +obj-$(CONFIG_CLK_IMXRT1170) +=3D clk-imxrt1170.o obj-$(CONFIG_CLK_VF610) +=3D clk-vf610.o diff --git a/drivers/clk/imx/clk-imxrt1170.c b/drivers/clk/imx/clk-imxrt117= 0.c new file mode 100644 index 000000000000..71d9aacf9751 --- /dev/null +++ b/drivers/clk/imx/clk-imxrt1170.c @@ -0,0 +1,749 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (C) 2022 + * Author(s): + * Jesse Taube + */ +#include +#include +#include +#include +#include +#include + +#include "clk.h" + +#define CLOCK_MUX_DEFAULT "rcosc48M_div2", "osc", "rcosc400M", "rcosc16M" + +#define LPCG_GATE(gate) (0x6000 + (gate * 0x20)) + +static const char * const m7_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll_arm", "pll1_sys", "pll3_sys", "pll_video" }; +static const char * const m4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_sys", "pll1_div5" }; +static const char * const bus_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_sys", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const bus_lpsr_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_sys", "pll1_div5" }; +static const char * const semc_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div5", "pll2_sys", "pll2_pfd1", "pll3_pfd0" }; +static const char * const cssys_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const cstrace_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_pfd1", "pll2_sys" }; +static const char * const m4_systick_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd0", "pll1_div5" }; +static const char * const m7_systick_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll3_div2", "pll1_div5", "pll2_pfd0" }; +static const char * const adc1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const adc2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const acmp_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_sys", "pll1_div5", "pll_audio", "pll2_pfd3" }; +static const char * const flexio1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const flexio2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const gpt1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll3_pfd2", "pll3_pfd3" }; +static const char * const gpt2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll_audio", "pll_video" }; +static const char * const gpt3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll_audio", "pll_video" }; +static const char * const gpt4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll3_pfd2", "pll3_pfd3" }; +static const char * const gpt5_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll3_pfd2", "pll3_pfd3" }; +static const char * const gpt6_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll3_pfd2", "pll3_pfd3" }; +static const char * const flexspi1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd0", "pll2_sys", "pll2_pfd2", "pll3_sys" }; +static const char * const flexspi2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd0", "pll2_sys", "pll2_pfd2", "pll3_sys" }; +static const char * const can1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const can2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const can3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd3", "pll1_div5" }; +static const char * const lpuart1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart5_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart6_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart7_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart8_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart9_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart10_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpuart11_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd3", "pll1_div5" }; +static const char * const lpuart12_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd3", "pll1_div5" }; +static const char * const lpi2c1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpi2c2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpi2c3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpi2c4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpi2c5_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd3", "pll1_div5" }; +static const char * const lpi2c6_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll2_pfd3", "pll1_div5" }; +static const char * const lpspi1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpspi2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpspi3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpspi4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const lpspi5_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll3_pfd2", "pll1_div5" }; +static const char * const lpspi6_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll3_pfd2", "pll1_div5" }; +static const char * const emv1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const emv2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_div2", "pll1_div5", "pll2_sys", "pll2_pfd3" }; +static const char * const enet1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet_qos_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet_25m_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet_timer1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet_timer2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const enet_timer3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div2", "pll_audio", "pll1_div5", "pll2_pfd1" }; +static const char * const usdhc1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll2_pfd0", "pll1_div5", "pll_arm" }; +static const char * const usdhc2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll2_pfd0", "pll1_div5", "pll_arm" }; +static const char * const asrc_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div5", "pll3_div2", "pll_audio", "pll2_pfd3" }; +static const char * const mqs_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll1_div5", "pll3_div2", "pll_audio", "pll2_pfd3" }; +static const char * const mic_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll_audio", "pll1_div5" }; +static const char * const spdif_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll_audio", "pll3_sys", "pll3_pfd2", "pll2_pfd3" }; +static const char * const sai1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll_audio", "pll3_pfd2", "pll1_div5", "pll2_pfd3" }; +static const char * const sai2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll_audio", "pll3_pfd2", "pll1_div5", "pll2_pfd3" }; +static const char * const sai3_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll_audio", "pll3_pfd2", "pll1_div5", "pll2_pfd3" }; +static const char * const sai4_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll3_pfd3", "pll3_sys", "pll_audio", "pll1_div5" }; +static const char * const gc355_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll2_pfd1", "pll3_sys", "pll_video" }; +static const char * const lcdif_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll2_pfd2", "pll3_pfd0", "pll_video" }; +static const char * const lcdifv2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll2_pfd2", "pll3_pfd0", "pll_video" }; +static const char * const mipi_ref_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll2_pfd0", "pll3_pfd0", "pll_video" }; +static const char * const mipi_esc_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_sys", "pll2_pfd0", "pll3_pfd0", "pll_video" }; +static const char * const csi2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll3_sys", "pll2_pfd0", "pll_video" }; +static const char * const csi2_esc_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll3_sys", "pll2_pfd0", "pll_video" }; +static const char * const csi2_ui_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll3_sys", "pll2_pfd0", "pll_video" }; +static const char * const csi_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll3_sys", "pll3_pfd1", "pll_video" }; +static const char * const cko1_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd2", "pll2_sys", "pll3_pfd1", "pll1_div5" }; +static const char * const cko2_sels[] =3D { CLOCK_MUX_DEFAULT, + "pll2_pfd3", "rcosc48M", "pll3_pfd1", "pll_audio"}; + +static const char * const pll_arm_mux[] =3D {"pll_arm_pre", "osc"}; +static const char * const pll3_mux[] =3D {"pll3_pre", "osc"}; +static const char * const pll2_mux[] =3D {"pll2_pre", "osc"}; + +static const struct clk_div_table post_div_table[] =3D { + { .val =3D 3, .div =3D 1, }, + { .val =3D 2, .div =3D 8, }, + { .val =3D 1, .div =3D 4, }, + { .val =3D 0, .div =3D 2, }, + { } +}; + +static int imxrt1170_clocks_probe(struct platform_device *pdev) +{ + void __iomem *ccm_base; + void __iomem *pll_base; + struct clk_hw **hws; + struct clk_hw_onecell_data *clk_hw_data; + struct device *dev =3D &pdev->dev; + struct device_node *np =3D dev->of_node; + struct device_node *anp; + int ret; + + clk_hw_data =3D kzalloc(struct_size(clk_hw_data, hws, + IMXRT1170_CLK_END), GFP_KERNEL); + if (WARN_ON(!clk_hw_data)) + return -ENOMEM; + + clk_hw_data->num =3D IMXRT1170_CLK_END; + hws =3D clk_hw_data->hws; + + hws[IMXRT1170_CLK_OSC] =3D imx_obtain_fixed_clk_hw(np, "osc"); + hws[IMXRT1170_CLK_RCOSC_16M] =3D imx_obtain_fixed_clk_hw(np, "rcosc16M"); + hws[IMXRT1170_CLK_OSC_32K] =3D imx_obtain_fixed_clk_hw(np, "osc32k"); + + hws[IMXRT1170_CLK_RCOSC_48M] =3D imx_clk_hw_fixed_factor("rcosc48M", "rc= osc16M", 3, 1); + hws[IMXRT1170_CLK_RCOSC_400M] =3D imx_clk_hw_fixed_factor("rcosc400M", "= rcosc16M", 25, 1); + hws[IMXRT1170_CLK_RCOSC_48M_DIV2] =3D imx_clk_hw_fixed_factor("rcosc48M_d= iv2", "rcosc48M", 1, 2); + + anp =3D of_find_compatible_node(NULL, NULL, "fsl,imxrt-anatop"); + pll_base =3D of_iomap(anp, 0); + of_node_put(anp); + if (WARN_ON(!pll_base)) + return -ENOMEM; + + /* Anatop clocks */ + hws[IMXRT1170_CLK_DUMMY] =3D imx_clk_hw_fixed("dummy", 0UL); + + hws[IMXRT1170_CLK_PLL_ARM_PRE] =3D __imx_clk_hw_pllv3(IMX_PLLV3_SYSV2, "p= ll_arm_pre", "osc", + pll_base + 0x200, 0xff, 13); + hws[IMXRT1170_CLK_PLL_ARM_BYPASS] =3D imx_clk_hw_mux("pll_arm_bypass", pl= l_base + 0x200, 17, + 1, pll_arm_mux, 2); + hws[IMXRT1170_CLK_PLL_ARM_DIV] =3D clk_hw_register_divider_table(NULL, "p= ll_arm_div", + "pll_arm_bypass", CLK_SET_RATE_PARENT | CLK_SET_RATE_GATE, + pll_base + 0x200, 15, 2, 0, post_div_table, &imx_ccm_lock); + hws[IMXRT1170_CLK_PLL_ARM] =3D imx_clk_hw_gate("pll_arm", "pll_arm_div", = pll_base + 0x200, 14); + + hws[IMXRT1170_CLK_PLL3_PRE] =3D __imx_clk_hw_pllv3(IMX_PLLV3_GENERICV2, "= pll3_pre", "osc", + pll_base + 0x210, 0x1, 21); + hws[IMXRT1170_CLK_PLL3_BYPASS] =3D imx_clk_hw_mux("pll3_bypass", + pll_base + 0x210, 16, 1, pll3_mux, 2); + hws[IMXRT1170_CLK_PLL3] =3D imx_clk_hw_gate("pll3_sys", "pll3_bypass", pl= l_base + 0x210, 13); + + hws[IMXRT1170_CLK_PLL2_PRE] =3D __imx_clk_hw_pllv3(IMX_PLLV3_GENERICV2, "= pll2_pre", "osc", + pll_base + 0x240, 0x1, 23); + hws[IMXRT1170_CLK_PLL2_BYPASS] =3D imx_clk_hw_mux("pll2_bypass", + pll_base + 0x240, 16, 1, pll2_mux, 2); + hws[IMXRT1170_CLK_PLL2] =3D imx_clk_hw_gate("pll2_sys", "pll2_bypass", pl= l_base + 0x240, 13); + + hws[IMXRT1170_CLK_PLL3_PFD0] =3D imx_clk_hw_pfd("pll3_pfd0", "pll3_sys", = pll_base + 0x230, 0); + hws[IMXRT1170_CLK_PLL3_PFD1] =3D imx_clk_hw_pfd("pll3_pfd1", "pll3_sys", = pll_base + 0x230, 1); + hws[IMXRT1170_CLK_PLL3_PFD2] =3D imx_clk_hw_pfd("pll3_pfd2", "pll3_sys", = pll_base + 0x230, 2); + hws[IMXRT1170_CLK_PLL3_PFD3] =3D imx_clk_hw_pfd("pll3_pfd3", "pll3_sys", = pll_base + 0x230, 3); + hws[IMXRT1170_CLK_PLL3_DIV2_GATE] =3D imx_clk_hw_fixed_factor("pll3_div2_= gate", "pll3_sys", 1, 2); + hws[IMXRT1170_CLK_PLL3_DIV2] =3D imx_clk_hw_gate("pll3_div2", "pll3_sys",= pll_base + 0x210, 3); + + hws[IMXRT1170_CLK_PLL2_PFD0] =3D imx_clk_hw_pfd("pll2_pfd0", "pll2_sys", = pll_base + 0x270, 0); + hws[IMXRT1170_CLK_PLL2_PFD1] =3D imx_clk_hw_pfd("pll2_pfd1", "pll2_sys", = pll_base + 0x270, 1); + hws[IMXRT1170_CLK_PLL2_PFD2] =3D imx_clk_hw_pfd("pll2_pfd2", "pll2_sys", = pll_base + 0x270, 2); + hws[IMXRT1170_CLK_PLL2_PFD3] =3D imx_clk_hw_pfd("pll2_pfd3", "pll2_sys", = pll_base + 0x270, 3); + + /* CCM clocks */ + ccm_base =3D devm_platform_ioremap_resource(pdev, 0); + if (WARN_ON(IS_ERR(ccm_base))) + return PTR_ERR(ccm_base); + + hws[IMXRT1170_CLK_M7_SEL] =3D imx_clk_hw_mux("m7_sel", ccm_base + (1 * 0x= 80), + 8, 3, m7_sels, 8); + hws[IMXRT1170_CLK_M4_SEL] =3D imx_clk_hw_mux("m4_sel", ccm_base + (2 * 0x= 80), + 8, 3, m4_sels, 8); + hws[IMXRT1170_CLK_BUS_SEL] =3D imx_clk_hw_mux("bus_sel", ccm_base + (3 * = 0x80), + 8, 3, bus_sels, 8); + hws[IMXRT1170_CLK_BUS_LPSR_SEL] =3D imx_clk_hw_mux("bus_lpsr_sel", ccm_ba= se + (4 * 0x80), + 8, 3, bus_lpsr_sels, 8); + hws[IMXRT1170_CLK_SEMC_SEL] =3D imx_clk_hw_mux("semc_sel", ccm_base + (5 = * 0x80), + 8, 3, semc_sels, 8); + hws[IMXRT1170_CLK_CSSYS_SEL] =3D imx_clk_hw_mux("cssys_sel", ccm_base + (= 6 * 0x80), + 8, 3, cssys_sels, 8); + hws[IMXRT1170_CLK_CSTRACE_SEL] =3D imx_clk_hw_mux("cstrace_sel", ccm_base= + (7 * 0x80), + 8, 3, cstrace_sels, 8); + hws[IMXRT1170_CLK_M4_SYSTICK_SEL] =3D imx_clk_hw_mux("m4_systick_sel", cc= m_base + (8 * 0x80), + 8, 3, m4_systick_sels, 8); + hws[IMXRT1170_CLK_M7_SYSTICK_SEL] =3D imx_clk_hw_mux("m7_systick_sel", cc= m_base + (9 * 0x80), + 8, 3, m7_systick_sels, 8); + hws[IMXRT1170_CLK_ADC1_SEL] =3D imx_clk_hw_mux("adc1_sel", ccm_base + (10= * 0x80), + 8, 3, adc1_sels, 8); + hws[IMXRT1170_CLK_ADC2_SEL] =3D imx_clk_hw_mux("adc2_sel", ccm_base + (11= * 0x80), + 8, 3, adc2_sels, 8); + hws[IMXRT1170_CLK_ACMP_SEL] =3D imx_clk_hw_mux("acmp_sel", ccm_base + (12= * 0x80), + 8, 3, acmp_sels, 8); + hws[IMXRT1170_CLK_FLEXIO1_SEL] =3D imx_clk_hw_mux("flexio1_sel", ccm_base= + (13 * 0x80), + 8, 3, flexio1_sels, 8); + hws[IMXRT1170_CLK_FLEXIO2_SEL] =3D imx_clk_hw_mux("flexio2_sel", ccm_base= + (14 * 0x80), + 8, 3, flexio2_sels, 8); + hws[IMXRT1170_CLK_GPT1_SEL] =3D imx_clk_hw_mux("gpt1_sel", ccm_base + (15= * 0x80), + 8, 3, gpt1_sels, 8); + hws[IMXRT1170_CLK_GPT2_SEL] =3D imx_clk_hw_mux("gpt2_sel", ccm_base + (16= * 0x80), + 8, 3, gpt2_sels, 8); + hws[IMXRT1170_CLK_GPT3_SEL] =3D imx_clk_hw_mux("gpt3_sel", ccm_base + (17= * 0x80), + 8, 3, gpt3_sels, 8); + hws[IMXRT1170_CLK_GPT4_SEL] =3D imx_clk_hw_mux("gpt4_sel", ccm_base + (18= * 0x80), + 8, 3, gpt4_sels, 8); + hws[IMXRT1170_CLK_GPT5_SEL] =3D imx_clk_hw_mux("gpt5_sel", ccm_base + (19= * 0x80), + 8, 3, gpt5_sels, 8); + hws[IMXRT1170_CLK_GPT6_SEL] =3D imx_clk_hw_mux("gpt6_sel", ccm_base + (20= * 0x80), + 8, 3, gpt6_sels, 8); + hws[IMXRT1170_CLK_FLEXSPI1_SEL] =3D imx_clk_hw_mux("flexspi1_sel", ccm_ba= se + (21 * 0x80), + 8, 3, flexspi1_sels, 8); + hws[IMXRT1170_CLK_FLEXSPI2_SEL] =3D imx_clk_hw_mux("flexspi2_sel", ccm_ba= se + (22 * 0x80), + 8, 3, flexspi2_sels, 8); + hws[IMXRT1170_CLK_CAN1_SEL] =3D imx_clk_hw_mux("can1_sel", ccm_base + (23= * 0x80), + 8, 3, can1_sels, 8); + hws[IMXRT1170_CLK_CAN2_SEL] =3D imx_clk_hw_mux("can2_sel", ccm_base + (24= * 0x80), + 8, 3, can2_sels, 8); + hws[IMXRT1170_CLK_CAN3_SEL] =3D imx_clk_hw_mux("can3_sel", ccm_base + (25= * 0x80), + 8, 3, can3_sels, 8); + hws[IMXRT1170_CLK_LPUART1_SEL] =3D imx_clk_hw_mux("lpuart1_sel", ccm_base= + (26 * 0x80), + 8, 3, lpuart1_sels, 8); + hws[IMXRT1170_CLK_LPUART2_SEL] =3D imx_clk_hw_mux("lpuart2_sel", ccm_base= + (27 * 0x80), + 8, 3, lpuart2_sels, 8); + hws[IMXRT1170_CLK_LPUART3_SEL] =3D imx_clk_hw_mux("lpuart3_sel", ccm_base= + (28 * 0x80), + 8, 3, lpuart3_sels, 8); + hws[IMXRT1170_CLK_LPUART4_SEL] =3D imx_clk_hw_mux("lpuart4_sel", ccm_base= + (29 * 0x80), + 8, 3, lpuart4_sels, 8); + hws[IMXRT1170_CLK_LPUART5_SEL] =3D imx_clk_hw_mux("lpuart5_sel", ccm_base= + (30 * 0x80), + 8, 3, lpuart5_sels, 8); + hws[IMXRT1170_CLK_LPUART6_SEL] =3D imx_clk_hw_mux("lpuart6_sel", ccm_base= + (31 * 0x80), + 8, 3, lpuart6_sels, 8); + hws[IMXRT1170_CLK_LPUART7_SEL] =3D imx_clk_hw_mux("lpuart7_sel", ccm_base= + (32 * 0x80), + 8, 3, lpuart7_sels, 8); + hws[IMXRT1170_CLK_LPUART8_SEL] =3D imx_clk_hw_mux("lpuart8_sel", ccm_base= + (33 * 0x80), + 8, 3, lpuart8_sels, 8); + hws[IMXRT1170_CLK_LPUART9_SEL] =3D imx_clk_hw_mux("lpuart9_sel", ccm_base= + (34 * 0x80), + 8, 3, lpuart9_sels, 8); + hws[IMXRT1170_CLK_LPUART10_SEL] =3D imx_clk_hw_mux("lpuart10_sel", ccm_ba= se + (35 * 0x80), + 8, 3, lpuart10_sels, 8); + hws[IMXRT1170_CLK_LPUART11_SEL] =3D imx_clk_hw_mux("lpuart11_sel", ccm_ba= se + (36 * 0x80), + 8, 3, lpuart11_sels, 8); + hws[IMXRT1170_CLK_LPUART12_SEL] =3D imx_clk_hw_mux("lpuart12_sel", ccm_ba= se + (37 * 0x80), + 8, 3, lpuart12_sels, 8); + hws[IMXRT1170_CLK_LPI2C1_SEL] =3D imx_clk_hw_mux("lpi2c1_sel", ccm_base += (38 * 0x80), + 8, 3, lpi2c1_sels, 8); + hws[IMXRT1170_CLK_LPI2C2_SEL] =3D imx_clk_hw_mux("lpi2c2_sel", ccm_base += (39 * 0x80), + 8, 3, lpi2c2_sels, 8); + hws[IMXRT1170_CLK_LPI2C3_SEL] =3D imx_clk_hw_mux("lpi2c3_sel", ccm_base += (40 * 0x80), + 8, 3, lpi2c3_sels, 8); + hws[IMXRT1170_CLK_LPI2C4_SEL] =3D imx_clk_hw_mux("lpi2c4_sel", ccm_base += (41 * 0x80), + 8, 3, lpi2c4_sels, 8); + hws[IMXRT1170_CLK_LPI2C5_SEL] =3D imx_clk_hw_mux("lpi2c5_sel", ccm_base += (42 * 0x80), + 8, 3, lpi2c5_sels, 8); + hws[IMXRT1170_CLK_LPI2C6_SEL] =3D imx_clk_hw_mux("lpi2c6_sel", ccm_base += (43 * 0x80), + 8, 3, lpi2c6_sels, 8); + hws[IMXRT1170_CLK_LPSPI1_SEL] =3D imx_clk_hw_mux("lpspi1_sel", ccm_base += (44 * 0x80), + 8, 3, lpspi1_sels, 8); + hws[IMXRT1170_CLK_LPSPI2_SEL] =3D imx_clk_hw_mux("lpspi2_sel", ccm_base += (45 * 0x80), + 8, 3, lpspi2_sels, 8); + hws[IMXRT1170_CLK_LPSPI3_SEL] =3D imx_clk_hw_mux("lpspi3_sel", ccm_base += (46 * 0x80), + 8, 3, lpspi3_sels, 8); + hws[IMXRT1170_CLK_LPSPI4_SEL] =3D imx_clk_hw_mux("lpspi4_sel", ccm_base += (47 * 0x80), + 8, 3, lpspi4_sels, 8); + hws[IMXRT1170_CLK_LPSPI5_SEL] =3D imx_clk_hw_mux("lpspi5_sel", ccm_base += (48 * 0x80), + 8, 3, lpspi5_sels, 8); + hws[IMXRT1170_CLK_LPSPI6_SEL] =3D imx_clk_hw_mux("lpspi6_sel", ccm_base += (49 * 0x80), + 8, 3, lpspi6_sels, 8); + hws[IMXRT1170_CLK_EMV1_SEL] =3D imx_clk_hw_mux("emv1_sel", ccm_base + (50= * 0x80), + 8, 3, emv1_sels, 8); + hws[IMXRT1170_CLK_EMV2_SEL] =3D imx_clk_hw_mux("emv2_sel", ccm_base + (51= * 0x80), + 8, 3, emv2_sels, 8); + hws[IMXRT1170_CLK_ENET1_SEL] =3D imx_clk_hw_mux("enet1_sel", ccm_base + (= 52 * 0x80), + 8, 3, enet1_sels, 8); + hws[IMXRT1170_CLK_ENET2_SEL] =3D imx_clk_hw_mux("enet2_sel", ccm_base + (= 53 * 0x80), + 8, 3, enet2_sels, 8); + hws[IMXRT1170_CLK_ENET_QOS_SEL] =3D imx_clk_hw_mux("enet_qos_sel", ccm_ba= se + (54 * 0x80), + 8, 3, enet_qos_sels, 8); + hws[IMXRT1170_CLK_ENET_25M_SEL] =3D imx_clk_hw_mux("enet_25m_sel", ccm_ba= se + (55 * 0x80), + 8, 3, enet_25m_sels, 8); + hws[IMXRT1170_CLK_ENET_TIMER1_SEL] =3D imx_clk_hw_mux("enet_timer1_sel", + ccm_base + (56 * 0x80), 8, 3, + enet_timer1_sels, 8); + hws[IMXRT1170_CLK_ENET_TIMER2_SEL] =3D imx_clk_hw_mux("enet_timer2_sel", + ccm_base + (57 * 0x80), 8, 3, + enet_timer2_sels, 8); + hws[IMXRT1170_CLK_ENET_TIMER3_SEL] =3D imx_clk_hw_mux("enet_timer3_sel", + ccm_base + (58 * 0x80), 8, 3, + enet_timer3_sels, 8); + hws[IMXRT1170_CLK_USDHC1_SEL] =3D imx_clk_hw_mux("usdhc1_sel", ccm_base += (59 * 0x80), + 8, 3, usdhc1_sels, 8); + hws[IMXRT1170_CLK_USDHC2_SEL] =3D imx_clk_hw_mux("usdhc2_sel", ccm_base += (60 * 0x80), + 8, 3, usdhc2_sels, 8); + hws[IMXRT1170_CLK_ASRC_SEL] =3D imx_clk_hw_mux("asrc_sel", ccm_base + (61= * 0x80), + 8, 3, asrc_sels, 8); + hws[IMXRT1170_CLK_MQS_SEL] =3D imx_clk_hw_mux("mqs_sel", ccm_base + (62 *= 0x80), + 8, 3, mqs_sels, 8); + hws[IMXRT1170_CLK_MIC_SEL] =3D imx_clk_hw_mux("mic_sel", ccm_base + (63 *= 0x80), + 8, 3, mic_sels, 8); + hws[IMXRT1170_CLK_SPDIF_SEL] =3D imx_clk_hw_mux("spdif_sel", ccm_base + (= 64 * 0x80), + 8, 3, spdif_sels, 8); + hws[IMXRT1170_CLK_SAI1_SEL] =3D imx_clk_hw_mux("sai1_sel", ccm_base + (65= * 0x80), + 8, 3, sai1_sels, 8); + hws[IMXRT1170_CLK_SAI2_SEL] =3D imx_clk_hw_mux("sai2_sel", ccm_base + (66= * 0x80), + 8, 3, sai2_sels, 8); + hws[IMXRT1170_CLK_SAI3_SEL] =3D imx_clk_hw_mux("sai3_sel", ccm_base + (67= * 0x80), + 8, 3, sai3_sels, 8); + hws[IMXRT1170_CLK_SAI4_SEL] =3D imx_clk_hw_mux("sai4_sel", ccm_base + (68= * 0x80), + 8, 3, sai4_sels, 8); + hws[IMXRT1170_CLK_GC355_SEL] =3D imx_clk_hw_mux("gc355_sel", ccm_base + (= 69 * 0x80), + 8, 3, gc355_sels, 8); + hws[IMXRT1170_CLK_LCDIF_SEL] =3D imx_clk_hw_mux("lcdif_sel", ccm_base + (= 70 * 0x80), + 8, 3, lcdif_sels, 8); + hws[IMXRT1170_CLK_LCDIFV2_SEL] =3D imx_clk_hw_mux("lcdifv2_sel", ccm_base= + (71 * 0x80), + 8, 3, lcdifv2_sels, 8); + hws[IMXRT1170_CLK_MIPI_REF_SEL] =3D imx_clk_hw_mux("mipi_ref_sel", ccm_ba= se + (72 * 0x80), + 8, 3, mipi_ref_sels, 8); + hws[IMXRT1170_CLK_MIPI_ESC_SEL] =3D imx_clk_hw_mux("mipi_esc_sel", ccm_ba= se + (73 * 0x80), + 8, 3, mipi_esc_sels, 8); + hws[IMXRT1170_CLK_CSI2_SEL] =3D imx_clk_hw_mux("csi2_sel", ccm_base + (74= * 0x80), + 8, 3, csi2_sels, 8); + hws[IMXRT1170_CLK_CSI2_ESC_SEL] =3D imx_clk_hw_mux("csi2_esc_sel", ccm_ba= se + (75 * 0x80), + 8, 3, csi2_esc_sels, 8); + hws[IMXRT1170_CLK_CSI2_UI_SEL] =3D imx_clk_hw_mux("csi2_ui_sel", ccm_base= + (76 * 0x80), + 8, 3, csi2_ui_sels, 8); + hws[IMXRT1170_CLK_CSI_SEL] =3D imx_clk_hw_mux("csi_sel", ccm_base + (77 *= 0x80), + 8, 3, csi_sels, 8); + hws[IMXRT1170_CLK_CKO1_SEL] =3D imx_clk_hw_mux("cko1_sel", ccm_base + (78= * 0x80), + 8, 3, cko1_sels, 8); + hws[IMXRT1170_CLK_CKO2_SEL] =3D imx_clk_hw_mux("cko2_sel", ccm_base + (79= * 0x80), + 8, 3, cko2_sels, 8); + + hws[IMXRT1170_CLK_M7_GATE] =3D imx_clk_hw_gate_dis_flags("m7_gate", "m7_s= el", ccm_base + + (1 * 0x80), 24, CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_M4_GATE] =3D imx_clk_hw_gate_dis_flags("m4_gate", "m4_s= el", ccm_base + + (2 * 0x80), 24, CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_BUS_GATE] =3D imx_clk_hw_gate_dis_flags("bus_gate", "bu= s_sel", ccm_base + + (3 * 0x80), 24, CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_BUS_LPSR_GATE] =3D imx_clk_hw_gate_dis_flags("bus_lpsr_= gate", + "bus_lpsr_sel", ccm_base + (4 * 0x80), 24, CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_SEMC_GATE] =3D imx_clk_hw_gate_dis_flags("semc_gate", "= semc_sel", + ccm_base + (5 * 0x80), 24, + CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_CSSYS_GATE] =3D imx_clk_hw_gate_dis_flags("cssys_gate",= "cssys_sel", + ccm_base + (6 * 0x80), 24, + CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_CSTRACE_GATE] =3D imx_clk_hw_gate_dis_flags("cstrace_ga= te", "cstrace_sel", + ccm_base + (7 * 0x80), 24, + CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_M4_SYSTICK_GATE] =3D imx_clk_hw_gate_dis_flags("m4_syst= ick_gate", + "m4_systick_sel", ccm_base + + (8 * 0x80), 24, 0); + hws[IMXRT1170_CLK_M7_SYSTICK_GATE] =3D imx_clk_hw_gate_dis_flags("m7_syst= ick_gate", + "m7_systick_sel", ccm_base + + (9 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ADC1_GATE] =3D imx_clk_hw_gate_dis_flags("adc1_gate", "= adc1_sel", + ccm_base + (10 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ADC2_GATE] =3D imx_clk_hw_gate_dis_flags("adc2_gate", "= adc2_sel", + ccm_base + (11 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ACMP_GATE] =3D imx_clk_hw_gate_dis_flags("acmp_gate", "= acmp_sel", + ccm_base + (12 * 0x80), 24, 0); + hws[IMXRT1170_CLK_FLEXIO1_GATE] =3D imx_clk_hw_gate_dis_flags("flexio1_ga= te", "flexio1_sel", + ccm_base + (13 * 0x80), 24, 0); + hws[IMXRT1170_CLK_FLEXIO2_GATE] =3D imx_clk_hw_gate_dis_flags("flexio2_ga= te", "flexio2_sel", + ccm_base + (14 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GPT1_GATE] =3D imx_clk_hw_gate_dis_flags("gpt1_gate", "= gpt1_sel", + ccm_base + (15 * 0x80), 24, + CLK_IS_CRITICAL); + hws[IMXRT1170_CLK_GPT2_GATE] =3D imx_clk_hw_gate_dis_flags("gpt2_gate", "= gpt2_sel", + ccm_base + (16 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GPT3_GATE] =3D imx_clk_hw_gate_dis_flags("gpt3_gate", "= gpt3_sel", + ccm_base + (17 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GPT4_GATE] =3D imx_clk_hw_gate_dis_flags("gpt4_gate", "= gpt4_sel", + ccm_base + (18 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GPT5_GATE] =3D imx_clk_hw_gate_dis_flags("gpt5_gate", "= gpt5_sel", + ccm_base + (19 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GPT6_GATE] =3D imx_clk_hw_gate_dis_flags("gpt6_gate", "= gpt6_sel", + ccm_base + (20 * 0x80), 24, 0); + hws[IMXRT1170_CLK_FLEXSPI1_GATE] =3D imx_clk_hw_gate_dis_flags("flexspi1_= gate", + "flexspi1_sel", ccm_base + + (21 * 0x80), 24, 0); + hws[IMXRT1170_CLK_FLEXSPI2_GATE] =3D imx_clk_hw_gate_dis_flags("flexspi2_= gate", + "flexspi2_sel", ccm_base + + (22 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CAN1_GATE] =3D imx_clk_hw_gate_dis_flags("can1_gate", "= can1_sel", + ccm_base + (23 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CAN2_GATE] =3D imx_clk_hw_gate_dis_flags("can2_gate", "= can2_sel", + ccm_base + (24 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CAN3_GATE] =3D imx_clk_hw_gate_dis_flags("can3_gate", "= can3_sel", + ccm_base + (25 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART1_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart1_ga= te", "lpuart1_sel", + ccm_base + (26 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART2_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart2_ga= te", "lpuart2_sel", + ccm_base + (27 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART3_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart3_ga= te", "lpuart3_sel", + ccm_base + (28 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART4_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart4_ga= te", "lpuart4_sel", + ccm_base + (29 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART5_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart5_ga= te", "lpuart5_sel", + ccm_base + (30 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART6_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart6_ga= te", "lpuart6_sel", + ccm_base + (31 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART7_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart7_ga= te", "lpuart7_sel", + ccm_base + (32 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART8_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart8_ga= te", "lpuart8_sel", + ccm_base + (33 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART9_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart9_ga= te", "lpuart9_sel", + ccm_base + (34 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART10_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart10_= gate", + "lpuart10_sel", ccm_base + + (35 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART11_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart11_= gate", + "lpuart11_sel", ccm_base + + (36 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPUART12_GATE] =3D imx_clk_hw_gate_dis_flags("lpuart12_= gate", + "lpuart12_sel", ccm_base + + (37 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C1_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c1_gate= ", "lpi2c1_sel", + ccm_base + (38 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C2_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c2_gate= ", "lpi2c2_sel", + ccm_base + (39 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C3_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c3_gate= ", "lpi2c3_sel", + ccm_base + (40 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C4_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c4_gate= ", "lpi2c4_sel", + ccm_base + (41 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C5_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c5_gate= ", "lpi2c5_sel", + ccm_base + (42 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPI2C6_GATE] =3D imx_clk_hw_gate_dis_flags("lpi2c6_gate= ", "lpi2c6_sel", + ccm_base + (43 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI1_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi1_gate= ", "lpspi1_sel", + ccm_base + (44 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI2_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi2_gate= ", "lpspi2_sel", + ccm_base + (45 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI3_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi3_gate= ", "lpspi3_sel", + ccm_base + (46 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI4_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi4_gate= ", "lpspi4_sel", + ccm_base + (47 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI5_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi5_gate= ", "lpspi5_sel", + ccm_base + (48 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LPSPI6_GATE] =3D imx_clk_hw_gate_dis_flags("lpspi6_gate= ", "lpspi6_sel", + ccm_base + (49 * 0x80), 24, 0); + hws[IMXRT1170_CLK_EMV1_GATE] =3D imx_clk_hw_gate_dis_flags("emv1_gate", "= emv1_sel", + ccm_base + (50 * 0x80), 24, 0); + hws[IMXRT1170_CLK_EMV2_GATE] =3D imx_clk_hw_gate_dis_flags("emv2_gate", "= emv2_sel", + ccm_base + (51 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET1_GATE] =3D imx_clk_hw_gate_dis_flags("enet1_gate",= "enet1_sel", + ccm_base + (52 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET2_GATE] =3D imx_clk_hw_gate_dis_flags("enet2_gate",= "enet2_sel", + ccm_base + (53 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET_QOS_GATE] =3D imx_clk_hw_gate_dis_flags("enet_qos_= gate", + "enet_qos_sel", ccm_base + (54 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET_25M_GATE] =3D imx_clk_hw_gate_dis_flags("enet_25m_= gate", + "enet_25m_sel", ccm_base + (55 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET_TIMER1_GATE] =3D imx_clk_hw_gate_dis_flags("enet_t= imer1_gate", + "enet_timer1_sel", ccm_base + (56 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET_TIMER2_GATE] =3D imx_clk_hw_gate_dis_flags("enet_t= imer2_gate", + "enet_timer2_sel", ccm_base + (57 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ENET_TIMER3_GATE] =3D imx_clk_hw_gate_dis_flags("enet_t= imer3_gate", + "enet_timer3_sel", ccm_base + (58 * 0x80), 24, 0); + hws[IMXRT1170_CLK_USDHC1_GATE] =3D imx_clk_hw_gate_dis_flags("usdhc1_gate= ", "usdhc1_sel", + ccm_base + (59 * 0x80), 24, 0); + hws[IMXRT1170_CLK_USDHC2_GATE] =3D imx_clk_hw_gate_dis_flags("usdhc2_gate= ", "usdhc2_sel", + ccm_base + (60 * 0x80), 24, 0); + hws[IMXRT1170_CLK_ASRC_GATE] =3D imx_clk_hw_gate_dis_flags("asrc_gate", "= asrc_sel", + ccm_base + (61 * 0x80), 24, 0); + hws[IMXRT1170_CLK_MQS_GATE] =3D imx_clk_hw_gate_dis_flags("mqs_gate", "mq= s_sel", + ccm_base + (62 * 0x80), 24, 0); + hws[IMXRT1170_CLK_MIC_GATE] =3D imx_clk_hw_gate_dis_flags("mic_gate", "mi= c_sel", + ccm_base + (63 * 0x80), 24, 0); + hws[IMXRT1170_CLK_SPDIF_GATE] =3D imx_clk_hw_gate_dis_flags("spdif_gate",= "spdif_sel", + ccm_base + (64 * 0x80), 24, 0); + hws[IMXRT1170_CLK_SAI1_GATE] =3D imx_clk_hw_gate_dis_flags("sai1_gate", "= sai1_sel", + ccm_base + (65 * 0x80), 24, 0); + hws[IMXRT1170_CLK_SAI2_GATE] =3D imx_clk_hw_gate_dis_flags("sai2_gate", "= sai2_sel", + ccm_base + (66 * 0x80), 24, 0); + hws[IMXRT1170_CLK_SAI3_GATE] =3D imx_clk_hw_gate_dis_flags("sai3_gate", "= sai3_sel", + ccm_base + (67 * 0x80), 24, 0); + hws[IMXRT1170_CLK_SAI4_GATE] =3D imx_clk_hw_gate_dis_flags("sai4_gate", "= sai4_sel", + ccm_base + (68 * 0x80), 24, 0); + hws[IMXRT1170_CLK_GC355_GATE] =3D imx_clk_hw_gate_dis_flags("gc355_gate",= "gc355_sel", + ccm_base + (69 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LCDIF_GATE] =3D imx_clk_hw_gate_dis_flags("lcdif_gate",= "lcdif_sel", + ccm_base + (70 * 0x80), 24, 0); + hws[IMXRT1170_CLK_LCDIFV2_GATE] =3D imx_clk_hw_gate_dis_flags("lcdifv2_ga= te", "lcdifv2_sel", + ccm_base + (71 * 0x80), 24, 0); + hws[IMXRT1170_CLK_MIPI_REF_GATE] =3D imx_clk_hw_gate_dis_flags("mipi_ref_= gate", + "mipi_ref_sel", ccm_base + + (72 * 0x80), 24, 0); + hws[IMXRT1170_CLK_MIPI_ESC_GATE] =3D imx_clk_hw_gate_dis_flags("mipi_esc_= gate", + "mipi_esc_sel", ccm_base + + (73 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CSI2_GATE] =3D imx_clk_hw_gate_dis_flags("csi2_gate", "= csi2_sel", + ccm_base + (74 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CSI2_ESC_GATE] =3D imx_clk_hw_gate_dis_flags("csi2_esc_= gate", + "csi2_esc_sel", ccm_base + + (75 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CSI2_UI_GATE] =3D imx_clk_hw_gate_dis_flags("csi2_ui_ga= te", "csi2_ui_sel", + ccm_base + (76 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CSI_GATE] =3D imx_clk_hw_gate_dis_flags("csi_gate", "cs= i_sel", + ccm_base + (77 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CKO1_GATE] =3D imx_clk_hw_gate_dis_flags("cko1_gate", "= cko1_sel", + ccm_base + (78 * 0x80), 24, 0); + hws[IMXRT1170_CLK_CKO2_GATE] =3D imx_clk_hw_gate_dis_flags("cko2_gate", "= cko2_sel", + ccm_base + (79 * 0x80), 24, 0); + + hws[IMXRT1170_CLK_M7] =3D imx_clk_hw_divider("m7", "m7_gate", ccm_base + = (1 * 0x80), 0, 8); + hws[IMXRT1170_CLK_M4] =3D imx_clk_hw_divider("m4", "m4_gate", ccm_base + = (2 * 0x80), 0, 8); + hws[IMXRT1170_CLK_BUS] =3D imx_clk_hw_divider("bus", "bus_gate", ccm_base= + (3 * 0x80), 0, 8); + hws[IMXRT1170_CLK_BUS_LPSR] =3D imx_clk_hw_divider("bus_lpsr", "bus_lpsr_= gate", ccm_base + + (4 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SEMC] =3D imx_clk_hw_divider("semc", "semc_gate", ccm_b= ase + (5 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSSYS] =3D imx_clk_hw_divider("cssys", "cssys_gate", cc= m_base + (6 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSTRACE] =3D imx_clk_hw_divider("cstrace", "cstrace_gat= e", ccm_base + + (7 * 0x80), 0, 8); + hws[IMXRT1170_CLK_M4_SYSTICK] =3D imx_clk_hw_divider("m4_systick", "m4_sy= stick_gate", + ccm_base + (8 * 0x80), 0, 8); + hws[IMXRT1170_CLK_M7_SYSTICK] =3D imx_clk_hw_divider("m7_systick", "m7_sy= stick_gate", + ccm_base + (9 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ADC1] =3D imx_clk_hw_divider("adc1", "adc1_gate", ccm_b= ase + (10 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ADC2] =3D imx_clk_hw_divider("adc2", "adc2_gate", ccm_b= ase + (11 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ACMP] =3D imx_clk_hw_divider("acmp", "acmp_gate", ccm_b= ase + (12 * 0x80), 0, 8); + hws[IMXRT1170_CLK_FLEXIO1] =3D imx_clk_hw_divider("flexio1", "flexio1_gat= e", ccm_base + + (13 * 0x80), 0, 8); + hws[IMXRT1170_CLK_FLEXIO2] =3D imx_clk_hw_divider("flexio2", "flexio2_gat= e", ccm_base + + (14 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT1] =3D imx_clk_hw_divider("gpt1", "gpt1_gate", ccm_b= ase + (15 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT2] =3D imx_clk_hw_divider("gpt2", "gpt2_gate", ccm_b= ase + (16 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT3] =3D imx_clk_hw_divider("gpt3", "gpt3_gate", ccm_b= ase + (17 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT4] =3D imx_clk_hw_divider("gpt4", "gpt4_gate", ccm_b= ase + (18 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT5] =3D imx_clk_hw_divider("gpt5", "gpt5_gate", ccm_b= ase + (19 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GPT6] =3D imx_clk_hw_divider("gpt6", "gpt6_gate", ccm_b= ase + (20 * 0x80), 0, 8); + hws[IMXRT1170_CLK_FLEXSPI1] =3D imx_clk_hw_divider("flexspi1", "flexspi1_= gate", ccm_base + + (21 * 0x80), 0, 8); + hws[IMXRT1170_CLK_FLEXSPI2] =3D imx_clk_hw_divider("flexspi2", "flexspi2_= gate", ccm_base + + (22 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CAN1] =3D imx_clk_hw_divider("can1", "can1_gate", ccm_b= ase + (23 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CAN2] =3D imx_clk_hw_divider("can2", "can2_gate", ccm_b= ase + (24 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CAN3] =3D imx_clk_hw_divider("can3", "can3_gate", ccm_b= ase + (25 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART1] =3D imx_clk_hw_divider("lpuart1", "lpuart1_gat= e", ccm_base + + (26 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART2] =3D imx_clk_hw_divider("lpuart2", "lpuart2_gat= e", ccm_base + + (27 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART3] =3D imx_clk_hw_divider("lpuart3", "lpuart3_gat= e", ccm_base + + (28 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART4] =3D imx_clk_hw_divider("lpuart4", "lpuart4_gat= e", ccm_base + + (29 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART5] =3D imx_clk_hw_divider("lpuart5", "lpuart5_gat= e", ccm_base + + (30 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART6] =3D imx_clk_hw_divider("lpuart6", "lpuart6_gat= e", ccm_base + + (31 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART7] =3D imx_clk_hw_divider("lpuart7", "lpuart7_gat= e", ccm_base + + (32 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART8] =3D imx_clk_hw_divider("lpuart8", "lpuart8_gat= e", ccm_base + + (33 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART9] =3D imx_clk_hw_divider("lpuart9", "lpuart9_gat= e", ccm_base + + (34 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART10] =3D imx_clk_hw_divider("lpuart10", "lpuart10_= gate", ccm_base + + (35 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART11] =3D imx_clk_hw_divider("lpuart11", "lpuart11_= gate", ccm_base + + (36 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPUART12] =3D imx_clk_hw_divider("lpuart12", "lpuart12_= gate", ccm_base + + (37 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C1] =3D imx_clk_hw_divider("lpi2c1", "lpi2c1_gate",= ccm_base + + (38 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C2] =3D imx_clk_hw_divider("lpi2c2", "lpi2c2_gate",= ccm_base + + (39 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C3] =3D imx_clk_hw_divider("lpi2c3", "lpi2c3_gate",= ccm_base + + (40 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C4] =3D imx_clk_hw_divider("lpi2c4", "lpi2c4_gate",= ccm_base + + (41 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C5] =3D imx_clk_hw_divider("lpi2c5", "lpi2c5_gate",= ccm_base + + (42 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPI2C6] =3D imx_clk_hw_divider("lpi2c6", "lpi2c6_gate",= ccm_base + + (43 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI1] =3D imx_clk_hw_divider("lpspi1", "lpspi1_gate",= ccm_base + + (44 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI2] =3D imx_clk_hw_divider("lpspi2", "lpspi2_gate",= ccm_base + + (45 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI3] =3D imx_clk_hw_divider("lpspi3", "lpspi3_gate",= ccm_base + + (46 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI4] =3D imx_clk_hw_divider("lpspi4", "lpspi4_gate",= ccm_base + + (47 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI5] =3D imx_clk_hw_divider("lpspi5", "lpspi5_gate",= ccm_base + + (48 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LPSPI6] =3D imx_clk_hw_divider("lpspi6", "lpspi6_gate",= ccm_base + + (49 * 0x80), 0, 8); + hws[IMXRT1170_CLK_EMV1] =3D imx_clk_hw_divider("emv1", "emv1_gate", ccm_b= ase + (50 * 0x80), 0, 8); + hws[IMXRT1170_CLK_EMV2] =3D imx_clk_hw_divider("emv2", "emv2_gate", ccm_b= ase + (51 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET1] =3D imx_clk_hw_divider("enet1", "enet1_gate", cc= m_base + (52 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET2] =3D imx_clk_hw_divider("enet2", "enet2_gate", cc= m_base + (53 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET_QOS] =3D imx_clk_hw_divider("enet_qos", "enet_qos_= gate", ccm_base + + (54 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET_25M] =3D imx_clk_hw_divider("enet_25m", "enet_25m_= gate", ccm_base + + (55 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET_TIMER1] =3D imx_clk_hw_divider("enet_timer1", "ene= t_timer1_gate", + ccm_base + (56 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET_TIMER2] =3D imx_clk_hw_divider("enet_timer2", "ene= t_timer2_gate", + ccm_base + (57 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ENET_TIMER3] =3D imx_clk_hw_divider("enet_timer3", "ene= t_timer3_gate", + ccm_base + (58 * 0x80), 0, 8); + hws[IMXRT1170_CLK_USDHC1] =3D imx_clk_hw_divider("usdhc1", "usdhc1_gate",= ccm_base + + (59 * 0x80), 0, 8); + hws[IMXRT1170_CLK_USDHC2] =3D imx_clk_hw_divider("usdhc2", "usdhc2_gate",= ccm_base + + (60 * 0x80), 0, 8); + hws[IMXRT1170_CLK_ASRC] =3D imx_clk_hw_divider("asrc", "asrc_gate", ccm_b= ase + (61 * 0x80), 0, 8); + hws[IMXRT1170_CLK_MQS] =3D imx_clk_hw_divider("mqs", "mqs_gate", ccm_base= + (62 * 0x80), 0, 8); + hws[IMXRT1170_CLK_MIC] =3D imx_clk_hw_divider("mic", "mic_gate", ccm_base= + (63 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SPDIF] =3D imx_clk_hw_divider("spdif", "spdif_gate", cc= m_base + (64 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SAI1] =3D imx_clk_hw_divider("sai1", "sai1_gate", ccm_b= ase + (65 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SAI2] =3D imx_clk_hw_divider("sai2", "sai2_gate", ccm_b= ase + (66 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SAI3] =3D imx_clk_hw_divider("sai3", "sai3_gate", ccm_b= ase + (67 * 0x80), 0, 8); + hws[IMXRT1170_CLK_SAI4] =3D imx_clk_hw_divider("sai4", "sai4_gate", ccm_b= ase + (68 * 0x80), 0, 8); + hws[IMXRT1170_CLK_GC355] =3D imx_clk_hw_divider("gc355", "gc355_gate", cc= m_base + (69 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LCDIF] =3D imx_clk_hw_divider("lcdif", "lcdif_gate", cc= m_base + (70 * 0x80), 0, 8); + hws[IMXRT1170_CLK_LCDIFV2] =3D imx_clk_hw_divider("lcdifv2", "lcdifv2_gat= e", ccm_base + + (71 * 0x80), 0, 8); + hws[IMXRT1170_CLK_MIPI_REF] =3D imx_clk_hw_divider("mipi_ref", "mipi_ref_= gate", ccm_base + + (72 * 0x80), 0, 8); + hws[IMXRT1170_CLK_MIPI_ESC] =3D imx_clk_hw_divider("mipi_esc", "mipi_esc_= gate", ccm_base + + (73 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSI2] =3D imx_clk_hw_divider("csi2", "csi2_gate", ccm_b= ase + (74 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSI2_ESC] =3D imx_clk_hw_divider("csi2_esc", "csi2_esc_= gate", ccm_base + + (75 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSI2_UI] =3D imx_clk_hw_divider("csi2_ui", "csi2_ui_gat= e", ccm_base + + (76 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CSI] =3D imx_clk_hw_divider("csi", "csi_gate", ccm_base= + (77 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CKO1] =3D imx_clk_hw_divider("cko1", "cko1_gate", ccm_b= ase + (78 * 0x80), 0, 8); + hws[IMXRT1170_CLK_CKO2] =3D imx_clk_hw_divider("cko2", "cko2_gate", ccm_b= ase + (79 * 0x80), 0, 8); + + hws[IMXRT1170_CLK_USB] =3D imx_clk_hw_gate("usb", "bus", ccm_base + LPCG_= GATE(115), 0); + + imx_check_clk_hws(hws, IMXRT1170_CLK_END); + + ret =3D of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_hw_data); + if (ret < 0) { + dev_err(dev, "Failed to register clks for i.MXRT1170.\n"); + imx_unregister_hw_clocks(hws, IMXRT1170_CLK_END); + } + return ret; +} + +static const struct of_device_id imxrt1170_clk_of_match[] =3D { + { .compatible =3D "fsl,imxrt1170-ccm" }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imxrt1170_clk_of_match); + +static struct platform_driver imxrt1170_clk_driver =3D { + .probe =3D imxrt1170_clocks_probe, + .driver =3D { + .name =3D "imxrt1170-ccm", + .of_match_table =3D imxrt1170_clk_of_match, + }, +}; +module_platform_driver(imxrt1170_clk_driver); --=20 2.36.1