[PATCH] clk: imx: don't build i.MX6/RTxxxx code for all users of CCF

A. Sverdlin alexander.sverdlin at siemens.com
Fri May 1 18:27:03 CEST 2026


From: Alexander Sverdlin <alexander.sverdlin at siemens.com>

When commit 1d7993d1d0ef
("clk: Port Linux common clock framework [CCF] for imx6q to U-boot (tag: v5.1.12)")
introduced the parts of Linux Common Clock Framework, it was done for i.MX6
only and even had "depends on SPL_CLK_IMX6Q" conditions. Since commit
ccab06689aa2 ("clk: imx: expose CCF entry for all") the framework can be
re-used with SoCs of other vendors (say, TI), but NXP SoC-specific code is
still being build. Is is especially problematic for size-constrained SPL
images on TI AM62x.

Make the build of the i.MX6/RTxxxx code not only dependent on
CONFIG_$(PHASE_)CLK_CCF, but also on the corresponding CONFIG_ARCH_*
options taking into account that only two platforms seem to use the code in
question.

This saves 2264 bytes on ARM platforms [using CCF].

Signed-off-by: Alexander Sverdlin <alexander.sverdlin at siemens.com>
---
 drivers/clk/imx/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile
index f2fd6ff8ca0..53f07bdf70d 100644
--- a/drivers/clk/imx/Makefile
+++ b/drivers/clk/imx/Makefile
@@ -2,7 +2,9 @@
 #
 # SPDX-License-Identifier: GPL-2.0
 
+ifeq ($(CONFIG_ARCH_MX6)$(CONFIG_ARCH_IMXRT),y)
 obj-$(CONFIG_$(PHASE_)CLK_CCF) += clk-gate2.o clk-pllv3.o clk-pfd.o
+endif
 obj-$(CONFIG_$(PHASE_)CLK_IMX6Q) += clk-imx6q.o
 obj-$(CONFIG_$(PHASE_)CLK_IMX6UL) += clk-imx6ul.o
 obj-$(CONFIG_CLK_IMX8) += clk-imx8.o
-- 
2.52.0



More information about the U-Boot mailing list