From: Adam Ford <aford173@gmail.com>
To: u-boot@lists.denx.de
Cc: aford@beaconembedded.com, Adam Ford <aford173@gmail.com>,
Michael Trimarchi <michael@amarulasolutions.com>,
Tom Rini <trini@konsulko.com>, Lukasz Majewski <lukma@denx.de>,
Sean Anderson <seanga2@gmail.com>, Stefano Babic <sbabic@denx.de>,
Fabio Estevam <festevam@gmail.com>,
"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
Simon Glass <sjg@chromium.org>,
Sumit Garg <sumit.garg@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Emil Kronborg <emil.kronborg@protonmail.com>,
Tim Harvey <tharvey@gateworks.com>,
Hou Zhiqiang <Zhiqiang.Hou@nxp.com>,
Peter Robinson <pbrobinson@gmail.com>
Subject: [PATCH V2 01/10] clk: imx6q: Properly handle imx6qp ECSPI clk_sels
Date: Tue, 11 Mar 2025 19:30:21 -0500 [thread overview]
Message-ID: <20250312003041.110023-2-aford173@gmail.com> (raw)
In-Reply-To: <20250312003041.110023-1-aford173@gmail.com>
The ECSPI clock has the ability to select between pll3_60m and
osc on the imx6qp, where it's fixed on other variants. Fix this
by adding using a helper function to determine SoC variant and
register the clock accordingly.
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
---
drivers/clk/imx/clk-imx6q.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
V2: Fix the name "ECSPI" and elimiate helper function by
directly calling of_machine_is_compatible.
diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
index df9f0285e1e..15ad0c9ac06 100644
--- a/drivers/clk/imx/clk-imx6q.c
+++ b/drivers/clk/imx/clk-imx6q.c
@@ -35,6 +35,7 @@ static const char *const usdhc_sels[] = { "pll2_pfd2_396m", "pll2_pfd0_352m", };
static const char *const periph_sels[] = { "periph_pre", "periph_clk2", };
static const char *const periph_pre_sels[] = { "pll2_bus", "pll2_pfd2_396m",
"pll2_pfd0_352m", "pll2_198m", };
+static const char *const ecspi_sels[] = { "pll3_60m", "osc", };
static int imx6q_clk_probe(struct udevice *dev)
{
@@ -78,6 +79,11 @@ static int imx6q_clk_probe(struct udevice *dev)
imx_clk_mux("usdhc4_sel", base + 0x1c, 19, 1,
usdhc_sels, ARRAY_SIZE(usdhc_sels)));
+ if (of_machine_is_compatible("fsl,imx6qp")
+ clk_dm(IMX6QDL_CLK_ECSPI_SEL,
+ imx_clk_mux("ecspi_sel", base + 0x38, 18, 1, ecspi_sels,
+ ARRAY_SIZE(ecspi_sels)));
+
clk_dm(IMX6QDL_CLK_USDHC1_PODF,
imx_clk_divider("usdhc1_podf", "usdhc1_sel",
base + 0x24, 11, 3));
@@ -91,8 +97,12 @@ static int imx6q_clk_probe(struct udevice *dev)
imx_clk_divider("usdhc4_podf", "usdhc4_sel",
base + 0x24, 22, 3));
- clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
- imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6));
+ if (of_machine_is_compatible("fsl,imx6qp")
+ clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
+ imx_clk_divider("ecspi_root", "ecspi_sel", base + 0x38, 19, 6));
+ else
+ clk_dm(IMX6QDL_CLK_ECSPI_ROOT,
+ imx_clk_divider("ecspi_root", "pll3_60m", base + 0x38, 19, 6));
clk_dm(IMX6QDL_CLK_ECSPI1,
imx_clk_gate2("ecspi1", "ecspi_root", base + 0x6c, 0));
--
2.45.2
next prev parent reply other threads:[~2025-03-12 0:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 0:30 [PATCH 00/10] clk: imx: Use Clock frameworkt to register UART clocks Adam Ford
2025-03-12 0:30 ` Adam Ford [this message]
2025-03-12 6:18 ` [PATCH V2 01/10] clk: imx6q: Properly handle imx6qp ECSPI clk_sels Peng Fan
2025-03-12 0:30 ` [PATCH V2 02/10] clk: imx6q: Register UART clocks Adam Ford
2025-03-12 2:06 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 03/10] clk: imx8mm: register " Adam Ford
2025-03-12 6:21 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 04/10] clk: imx8mn: " Adam Ford
2025-03-12 6:22 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 05/10] serial: mxc: Support bulk enabling clocks Adam Ford
2025-03-12 6:24 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 06/10] board: beacon: imx8mm: Let clock system enable UART clock Adam Ford
2025-03-12 6:29 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 07/10] board: beacon: imx8mn: " Adam Ford
2025-03-12 6:45 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 08/10] clk: imx: select SPL_CLK_COMPOSITE_CCF when SPL_CLK_IMX8MP Adam Ford
2025-03-12 6:46 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 09/10] configs: imx8mp_beacon: Select SPL_CLK_IMX8MP Adam Ford
2025-03-12 6:48 ` Peng Fan
2025-03-12 0:30 ` [PATCH V2 10/10] board: beacon: imx8mp: Let clock system enable UART clock Adam Ford
2025-03-12 6:49 ` Peng Fan
2025-03-12 2:31 ` [PATCH 00/10] clk: imx: Use Clock frameworkt to register UART clocks Fabio Estevam
2025-03-15 15:37 ` Adam Ford
2025-03-15 16:16 ` Fabio Estevam
2025-03-16 22:17 ` Adam Ford
2025-03-17 14:16 ` Fabio Estevam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250312003041.110023-2-aford173@gmail.com \
--to=aford173@gmail.com \
--cc=Zhiqiang.Hou@nxp.com \
--cc=aford@beaconembedded.com \
--cc=emil.kronborg@protonmail.com \
--cc=festevam@gmail.com \
--cc=lukma@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=michael@amarulasolutions.com \
--cc=pbrobinson@gmail.com \
--cc=sbabic@denx.de \
--cc=seanga2@gmail.com \
--cc=sjg@chromium.org \
--cc=sumit.garg@kernel.org \
--cc=tharvey@gateworks.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uboot-imx@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.