Skip to contentSkip to conversation

board: imx6: guard LDB clock init with appropriate video config

PATCH In review Md Shofiqul Islam 2 participants 2 messages Jul 29

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 board: imx6: guard LDB clock init with appropriate video config

Guard select_ldb_di_clock_source() in board_early_init_f() with the correct video Kconfig symbol instead of calling it unconditionally.

- board/ge/b1x5v2: guard with CONFIG_SPL_VIDEO -- LDB init is needed in SPL only when display support is enabled
- board/aristainetos: guard with CONFIG_VIDEO_IPUV3 -- this board does not use SPL so CONFIG_SPL_VIDEO is not the right guard here

drivers/clk/imx/clk-imx6q.c already guards imx6q_init_ldb_clks() with CONFIG_IS_ENABLED(VIDEO), so no change is needed there.

---
v3: Rebased per Fabio's request. Dropped the other two changes from v2:
- "imx6: clock: fix clk0/clk1 swap in select_ldb_di_clock_source()" is no longer needed; the same fix already landed in next.
- The drivers/clk/imx/clk-imx6q.c guard hunk from patch 1/2 is no longer needed either; that call site is now guarded there with CONFIG_IS_ENABLED(VIDEO). Only the board-file guard below was still missing, so v3 is a single patch instead of two.

 board/aristainetos/aristainetos.c | 2 ++
 board/ge/b1x5v2/b1x5v2.c          | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
board/aristainetos/aristainetos.c +2 -0
index 4a2349e165b..c163b49209e 100644
@@ -218,7 +218,9 @@ static void set_gpr_register(void)
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_VIDEO_IPUV3)
 	select_ldb_di_clock_source(MXC_PLL5_CLK, MXC_PLL5_CLK);
+#endif
 	set_gpr_register();
 
 	/*
board/ge/b1x5v2/b1x5v2.c +2 -1
index f7751fd6fb1..da7cb880eeb 100644
@@ -320,8 +320,9 @@ int overwrite_console(void)
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_SPL_VIDEO)
 	select_ldb_di_clock_source(MXC_PLL5_CLK, MXC_PLL5_CLK);
-
+#endif
 	return 0;
 }
 
Signature · 1 line
2.51.1
#1 lore raw

Hi Md Shofiqul,

board/ge/b1x5v2/b1x5v2.c int overwrite_console(void) · line 325

Quoted 10 lines · Md Shofiqul Islam
board/ge/b1x5v2/b1x5v2.c +2 -1
@@ -320,8 +320,9 @@ int overwrite_console(void)
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_SPL_VIDEO)
        select_ldb_di_clock_source(MXC_PLL5_CLK, MXC_PLL5_CLK);
-
+#endif

ge_b1x5v2_defconfig does not select CONFIG_SPL_VIDEO.

What's the motivation for this patch? What exactly are you trying to solve?