* [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate()
@ 2026-10-02 11:35 Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 2/5] ARM: i.MX8MM/8MN: clock NOC from SYS_PLL3 in early clock init Ahmad Fatoum
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:35 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
While clk_pll1416x_early_set_rate() programs the dividers, waits for
the lock and clears the bypass, it doesn't actually ungate the clock.
Therefore, the i.MX8M early clock init sets the CLKE bit by hand
afterwards, but it does so only for the ARM PLL.
SYS_PLL3 is reconfigured without CLKE being touched, because it works
out, because it's set at reset and BootROM doesn't clear it.
U-Boot's intpll_configure() sets CLKE at the end instead. As we are
going to align the early init with U-Boot for easier comparison in
future, let's rename our function to clk_pll1416x_early_configure() and
have it also ungate the clock.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/imx8m.c | 11 ++++-------
drivers/clk/imx/clk-pll14xx.c | 14 +++++++++++---
include/soc/imx8m/clk-early.h | 4 ++--
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 6286ab7344bc..3b2833a07ec2 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -116,8 +116,8 @@ static void __imx8m_early_clock_init(int cpu_type)
pll3_freq = 750000000UL;
/* Configure SYS_PLL3 */
- clk_pll1416x_early_set_rate(ana + IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL,
- pll3_freq, 25000000UL);
+ clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL,
+ pll3_freq, 25000000UL);
if (cpu_type == IMX_CPU_IMX8MP) {
/* 8MP ROM already set NOC to 800Mhz, only need to configure NOC_IO clk to 600Mhz */
@@ -131,11 +131,8 @@ static void __imx8m_early_clock_init(int cpu_type)
IMX8M_CCM_TARGET_ROOTn_MUX(2));
/* Configure ARM PLL to 1.2GHz */
- clk_pll1416x_early_set_rate(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL,
- 1200000000UL, 25000000UL);
-
- clrsetbits_le32(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL, 0,
- INTPLL_CLKE_MASK);
+ clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL,
+ 1200000000UL, 25000000UL);
clrsetbits_le32(ccm + IMX8M_CCM_TARGET_ROOTn(IMX8M_ARM_A53_CLK_ROOT),
IMX8M_CCM_TARGET_ROOTn_MUX(7),
diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index 8a773f19f807..a0213c60516d 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -238,8 +238,8 @@ static int clk_pll1416x_set_rate(struct clk_hw *hw, unsigned long drate,
return 0;
}
-int clk_pll1416x_early_set_rate(void __iomem *base, unsigned long drate,
- unsigned long prate)
+int clk_pll1416x_early_configure(void __iomem *base, unsigned long drate,
+ unsigned long prate)
{
struct clk_pll14xx pll = {
.hw.clk = {
@@ -249,8 +249,16 @@ int clk_pll1416x_early_set_rate(void __iomem *base, unsigned long drate,
.rate_table = imx_pll1416x_tbl,
.rate_count = ARRAY_SIZE(imx_pll1416x_tbl),
};
+ int ret;
- return clk_pll1416x_set_rate(&pll.hw, drate, prate);
+ ret = clk_pll1416x_set_rate(&pll.hw, drate, prate);
+ if (ret)
+ return ret;
+
+ /* enable the PLL output */
+ setbits_le32(base + GNRL_CTL, CLKE_MASK);
+
+ return 0;
}
static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate,
diff --git a/include/soc/imx8m/clk-early.h b/include/soc/imx8m/clk-early.h
index c2034e54f070..2430521d7a2e 100644
--- a/include/soc/imx8m/clk-early.h
+++ b/include/soc/imx8m/clk-early.h
@@ -3,7 +3,7 @@
#ifndef __SOC_IMX8M_CLK_EARLY_H
#define __SOC_IMX8M_CLK_EARLY_H
-int clk_pll1416x_early_set_rate(void __iomem *base, unsigned long drate,
- unsigned long prate);
+int clk_pll1416x_early_configure(void __iomem *base, unsigned long drate,
+ unsigned long prate);
#endif /* __SOC_IMX8M_CLK_EARLY_H */
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH master 2/5] ARM: i.MX8MM/8MN: clock NOC from SYS_PLL3 in early clock init
2026-10-02 11:35 [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate() Ahmad Fatoum
@ 2026-10-02 11:35 ` Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 3/5] ARM: i.MX8M: feed A53 cores from ARM PLL via CORE_SEL_CFG " Ahmad Fatoum
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:35 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum, Niels de Koeijer
barebox never touches NOC_CLK_ROOT on the i.MX8MM and i.MX8MN in the
PBL, so early startup uses the ROM's setting: sys_pll1_800m with a
post divider of 2, i.e. 400MHz.
barebox proper later reparents NOC to sys_pll3_out as requested by the
upstream device tree, but the assigned rate is 0 and clk-conf only
switches the mux, so the ROM's divider stays and NOC runs at half the
SYS_PLL3 rate: 300MHz instead of 600MHz on the i.MX8MN.
This was observed to make an L2 cache miss about 10% more costly.
U-Boot's clock_init() instead writes NOC_CLK_ROOT in full: undivided
sys_pll3_out, i.e. 750MHz on the i.MX8MM and 600MHz on the i.MX8MN,
both within the 800MHz maximum of the root.
Let's do the same in barebox.
Reported-by: Niels de Koeijer <NEMK@bang-olufsen.dk>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/imx8m.c | 5 +++++
include/mach/imx/imx8m-ccm-regs.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 3b2833a07ec2..533e2877237f 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -124,6 +124,11 @@ static void __imx8m_early_clock_init(int cpu_type)
imx8m_clock_set_target_val(IMX8M_NOC_IO_CLK_ROOT,
IMX8M_CCM_TARGET_ROOTn_ENABLE |
IMX8M_CCM_TARGET_ROOTn_MUX(2));
+ } else {
+ /* NOC from undivided sys_pll3_out */
+ imx8m_clock_set_target_val(IMX8M_NOC_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(2));
}
clrsetbits_le32(ccm + IMX8M_CCM_TARGET_ROOTn(IMX8M_ARM_A53_CLK_ROOT),
diff --git a/include/mach/imx/imx8m-ccm-regs.h b/include/mach/imx/imx8m-ccm-regs.h
index 035cd13ed694..42d0c485f25b 100644
--- a/include/mach/imx/imx8m-ccm-regs.h
+++ b/include/mach/imx/imx8m-ccm-regs.h
@@ -22,6 +22,7 @@
* Applications Processor Reference Manual
*/
#define IMX8M_ARM_A53_CLK_ROOT 0
+#define IMX8M_NOC_CLK_ROOT 26
#define IMX8M_NOC_IO_CLK_ROOT 27
#define IMX8M_DRAM_SEL_CFG 48
#define IMX8M_DRAM_ALT_CLK_ROOT 64
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH master 3/5] ARM: i.MX8M: feed A53 cores from ARM PLL via CORE_SEL_CFG in early clock init
2026-10-02 11:35 [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate() Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 2/5] ARM: i.MX8MM/8MN: clock NOC from SYS_PLL3 in early clock init Ahmad Fatoum
@ 2026-10-02 11:35 ` Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 4/5] ARM: i.MX8M: source dram_apb from sys_pll2_200m " Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 5/5] ARM: i.MX8M: order early clock init like U-Boot Ahmad Fatoum
3 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:35 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
barebox runs the Cortex-A53 cores off the ARM PLL through the A53 root
slice, as the ROM does, but at 1.2GHz instead of the ROM's 1GHz.
The i.MX8MM, i.MX8MN and i.MX8MP reference manuals all list 1000MHz as
the maximum for ARM_A53_CLK_ROOT in Table 5-1, so the slice runs out of
spec until barebox proper applies the upstream device tree's
assigned-clock-parents: A53_SRC to sys_pll1_800m first, dropping the
cores to 800MHz, then A53_CORE to arm_pll_out.
U-Boot's clock_init() instead writes the A53 root slice in full, i.e.
sys_pll2_500m with all dividers cleared, and switches CORE_SEL_CFG to
arm_pll_out, so the cores are fed from the PLL directly and the slice
is left unused. U-Boot commit 46a8a28bf60b ("imx8m: configure arm clk
sources from PLL") introduced this for the same 1GHz reason. Let's do
the same: barebox proper's reparenting then only touches the unused
slice and the cores stay at 1.2GHz throughout.
CORE_SEL_CFG is target root 49 with only a mux bit, so it is written
without ENABLE, like U-Boot does.
Assisted-by: Claude:fable-5.1
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/imx8m.c | 21 ++++++---------------
include/mach/imx/imx8m-ccm-regs.h | 1 +
2 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 533e2877237f..66a3b376ed94 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -10,7 +10,6 @@
#include <mach/imx/imx8m-ccm-regs.h>
#include <soc/imx8m/clk-early.h>
-#include <linux/bitfield.h>
#include <linux/iopoll.h>
#define IMX_SIP_BUILDINFO 0xC2000003
@@ -49,8 +48,6 @@ void imx8m_ccgr_clock_disable(int index)
#define INTPLL_DIV2_CLKE_MASK BIT(13)
#define INTPLL_CLKE_MASK BIT(11)
-#define CCM_TARGET_ROOT0_DIV GENMASK(1, 0)
-
#define IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL 0x84
#define IMX8MM_CCM_ANALOG_SYS_PLL1_GEN_CTRL 0x94
#define IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL 0x104
@@ -60,7 +57,6 @@ static void __imx8m_early_clock_init(int cpu_type)
{
unsigned long pll3_freq;
void __iomem *ana = IOMEM(MX8M_ANATOP_BASE_ADDR);
- void __iomem *ccm = IOMEM(MX8M_CCM_BASE_ADDR);
u32 val;
imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_DDR1);
@@ -131,22 +127,17 @@ static void __imx8m_early_clock_init(int cpu_type)
IMX8M_CCM_TARGET_ROOTn_MUX(2));
}
- clrsetbits_le32(ccm + IMX8M_CCM_TARGET_ROOTn(IMX8M_ARM_A53_CLK_ROOT),
- IMX8M_CCM_TARGET_ROOTn_MUX(7),
- IMX8M_CCM_TARGET_ROOTn_MUX(2));
+ imx8m_clock_set_target_val(IMX8M_ARM_A53_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(2));
/* Configure ARM PLL to 1.2GHz */
clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL,
1200000000UL, 25000000UL);
- clrsetbits_le32(ccm + IMX8M_CCM_TARGET_ROOTn(IMX8M_ARM_A53_CLK_ROOT),
- IMX8M_CCM_TARGET_ROOTn_MUX(7),
- IMX8M_CCM_TARGET_ROOTn_MUX(1));
-
- /* Configure DIV to 1.2GHz */
- clrsetbits_le32(ccm + IMX8M_CCM_TARGET_ROOTn(IMX8M_ARM_A53_CLK_ROOT),
- CCM_TARGET_ROOT0_DIV,
- FIELD_PREP(CCM_TARGET_ROOT0_DIV, 0));
+ /* Bypass the A53 root and feed the cores from arm_pll_out directly */
+ imx8m_clock_set_target_val(IMX8M_CORE_SEL_CFG,
+ IMX8M_CCM_TARGET_ROOTn_MUX(1));
}
void imx8mm_early_clock_init(void)
diff --git a/include/mach/imx/imx8m-ccm-regs.h b/include/mach/imx/imx8m-ccm-regs.h
index 42d0c485f25b..bcd8b85f9f3e 100644
--- a/include/mach/imx/imx8m-ccm-regs.h
+++ b/include/mach/imx/imx8m-ccm-regs.h
@@ -25,6 +25,7 @@
#define IMX8M_NOC_CLK_ROOT 26
#define IMX8M_NOC_IO_CLK_ROOT 27
#define IMX8M_DRAM_SEL_CFG 48
+#define IMX8M_CORE_SEL_CFG 49
#define IMX8M_DRAM_ALT_CLK_ROOT 64
#define IMX8M_DRAM_APB_CLK_ROOT 65
#define IMX8M_UART1_CLK_ROOT 94
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH master 4/5] ARM: i.MX8M: source dram_apb from sys_pll2_200m in early clock init
2026-10-02 11:35 [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate() Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 2/5] ARM: i.MX8MM/8MN: clock NOC from SYS_PLL3 in early clock init Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 3/5] ARM: i.MX8M: feed A53 cores from ARM PLL via CORE_SEL_CFG " Ahmad Fatoum
@ 2026-10-02 11:35 ` Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 5/5] ARM: i.MX8M: order early clock init like U-Boot Ahmad Fatoum
3 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:35 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
barebox derives the 200MHz dram_apb clock from sys_pll1_800m divided
by 4, while U-Boot's clock_init() selects sys_pll2_200m, which needs
no divider. Let's do the same, so both can be compared side by side.
Move the DRAM clock setup below the code enabling the SYS_PLL2 outputs,
where U-Boot has it as well. This is ordering only: all SYS_PLL2
outputs are enabled at reset already.
No functional change: imx8m_ddr_init() reconfigures DRAM_APB_CLK_ROOT
via ddrphy_init_set_dfi_clk() before the DDRC is first accessed, so
the value set here is overwritten before any register access uses it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/imx8m.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 66a3b376ed94..23a920ffae2e 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -59,20 +59,6 @@ static void __imx8m_early_clock_init(int cpu_type)
void __iomem *ana = IOMEM(MX8M_ANATOP_BASE_ADDR);
u32 val;
- imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_DDR1);
-
- imx8m_clock_set_target_val(IMX8M_DRAM_ALT_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(1));
-
- /* change the clock source of dram_apb_clk_root: source 4 800MHz /4 = 200MHz */
- imx8m_clock_set_target_val(IMX8M_DRAM_APB_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(4) |
- IMX8M_CCM_TARGET_ROOTn_POST_DIV(4 - 1));
-
- imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_DDR1);
-
/*
* The gate is not exported to clk tree, so configure them here.
* According to ANAMIX SPEC
@@ -96,6 +82,19 @@ static void __imx8m_early_clock_init(int cpu_type)
INTPLL_DIV20_CLKE_MASK;
writel(val, ana + IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL);
+ imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_DDR1);
+
+ imx8m_clock_set_target_val(IMX8M_DRAM_ALT_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(1));
+
+ /* change the clock source of dram_apb_clk_root: source 1 sys_pll2_200m */
+ imx8m_clock_set_target_val(IMX8M_DRAM_APB_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(1));
+
+ imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_DDR1);
+
if (cpu_type != IMX_CPU_IMX8MP) {
/* 8MP ROM already set GIC to 400Mhz, system_pll1_800m with div = 2 */
/* For everything else, config GIC to sys_pll2_100m */
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH master 5/5] ARM: i.MX8M: order early clock init like U-Boot
2026-10-02 11:35 [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate() Ahmad Fatoum
` (2 preceding siblings ...)
2026-10-02 11:35 ` [PATCH master 4/5] ARM: i.MX8M: source dram_apb from sys_pll2_200m " Ahmad Fatoum
@ 2026-10-02 11:35 ` Ahmad Fatoum
3 siblings, 0 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:35 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
The clocks configured in __imx8m_early_clock_init() now match U-Boot's
clock_init(), but are written in a different order: DRAM first, then
GIC, SYS_PLL3, NOC and the ARM PLL last.
U-Boot sets up the ARM PLL right after enabling the SYS_PLL1/2 outputs,
then SYS_PLL3 and its NOC consumer, the GIC root and the DRAM clocks
last. Reorder to the same sequence, so the two can be compared side by
side. The remaining differences are:
- barebox doesn't touch the NAND_USDHC_BUS and watchdog roots or the
TEMP_SENSOR and SEC_DEBUG gates in the PBL
- NXP's downstream U-Boot additionally configures the display clocks
in clock_init() (VIDEO_PLL at 594MHz, the DISPLAY_AXI/APB and MIPI
DSI roots, DISPMIX gate)
These are skipped as both barebox and Linux will configure these clocks
if needed before using them.
Every root and gate ends up with the same value, and each source is
enabled before a root is switched to it in either order.
No functional change.
Assisted-by: Claude:fable-5.1
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
arch/arm/mach-imx/imx8m.c | 83 +++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-imx/imx8m.c b/arch/arm/mach-imx/imx8m.c
index 23a920ffae2e..b9f8906d6ed2 100644
--- a/arch/arm/mach-imx/imx8m.c
+++ b/arch/arm/mach-imx/imx8m.c
@@ -82,6 +82,46 @@ static void __imx8m_early_clock_init(int cpu_type)
INTPLL_DIV20_CLKE_MASK;
writel(val, ana + IMX8MM_CCM_ANALOG_SYS_PLL2_GEN_CTRL);
+ /* Configure ARM at 1.2GHz */
+ imx8m_clock_set_target_val(IMX8M_ARM_A53_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(2));
+
+ clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL,
+ 1200000000UL, 25000000UL);
+
+ /* Bypass the A53 root and feed the cores from arm_pll_out directly */
+ imx8m_clock_set_target_val(IMX8M_CORE_SEL_CFG,
+ IMX8M_CCM_TARGET_ROOTn_MUX(1));
+
+ if (cpu_type == IMX_CPU_IMX8MN || cpu_type == IMX_CPU_IMX8MP)
+ pll3_freq = 600000000UL;
+ else
+ pll3_freq = 750000000UL;
+
+ /* Configure SYS_PLL3 */
+ clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL,
+ pll3_freq, 25000000UL);
+
+ if (cpu_type == IMX_CPU_IMX8MP) {
+ /* NOC_IO from sys_pll3_out, barebox proper sets NOC and GIC */
+ imx8m_clock_set_target_val(IMX8M_NOC_IO_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(2));
+ } else {
+ /* NOC from undivided sys_pll3_out */
+ imx8m_clock_set_target_val(IMX8M_NOC_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(2));
+
+ /* config GIC to sys_pll2_100m */
+ imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_GIC);
+ imx8m_clock_set_target_val(IMX8M_GIC_CLK_ROOT,
+ IMX8M_CCM_TARGET_ROOTn_ENABLE |
+ IMX8M_CCM_TARGET_ROOTn_MUX(3));
+ imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_GIC);
+ }
+
imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_DDR1);
imx8m_clock_set_target_val(IMX8M_DRAM_ALT_CLK_ROOT,
@@ -94,49 +134,6 @@ static void __imx8m_early_clock_init(int cpu_type)
IMX8M_CCM_TARGET_ROOTn_MUX(1));
imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_DDR1);
-
- if (cpu_type != IMX_CPU_IMX8MP) {
- /* 8MP ROM already set GIC to 400Mhz, system_pll1_800m with div = 2 */
- /* For everything else, config GIC to sys_pll2_100m */
- imx8m_ccgr_clock_disable(IMX8M_CCM_CCGR_GIC);
- imx8m_clock_set_target_val(IMX8M_GIC_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(3));
- imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_GIC);
- }
-
- if (cpu_type == IMX_CPU_IMX8MN || cpu_type == IMX_CPU_IMX8MP)
- pll3_freq = 600000000UL;
- else
- pll3_freq = 750000000UL;
-
- /* Configure SYS_PLL3 */
- clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_SYS_PLL3_GEN_CTRL,
- pll3_freq, 25000000UL);
-
- if (cpu_type == IMX_CPU_IMX8MP) {
- /* 8MP ROM already set NOC to 800Mhz, only need to configure NOC_IO clk to 600Mhz */
- imx8m_clock_set_target_val(IMX8M_NOC_IO_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(2));
- } else {
- /* NOC from undivided sys_pll3_out */
- imx8m_clock_set_target_val(IMX8M_NOC_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(2));
- }
-
- imx8m_clock_set_target_val(IMX8M_ARM_A53_CLK_ROOT,
- IMX8M_CCM_TARGET_ROOTn_ENABLE |
- IMX8M_CCM_TARGET_ROOTn_MUX(2));
-
- /* Configure ARM PLL to 1.2GHz */
- clk_pll1416x_early_configure(ana + IMX8MM_CCM_ANALOG_ARM_PLL_GEN_CTRL,
- 1200000000UL, 25000000UL);
-
- /* Bypass the A53 root and feed the cores from arm_pll_out directly */
- imx8m_clock_set_target_val(IMX8M_CORE_SEL_CFG,
- IMX8M_CCM_TARGET_ROOTn_MUX(1));
}
void imx8mm_early_clock_init(void)
--
2.47.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-02 11:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 11:35 [PATCH master 1/5] clk: imx: pll14xx: enable PLL output in clk_pll1416x_early_set_rate() Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 2/5] ARM: i.MX8MM/8MN: clock NOC from SYS_PLL3 in early clock init Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 3/5] ARM: i.MX8M: feed A53 cores from ARM PLL via CORE_SEL_CFG " Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 4/5] ARM: i.MX8M: source dram_apb from sys_pll2_200m " Ahmad Fatoum
2026-10-02 11:35 ` [PATCH master 5/5] ARM: i.MX8M: order early clock init like U-Boot Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox