Skip to contentSkip to conversation

imx9[4,5]_evk: Drop init_uart_clk from board code

PATCH In review Peng Fan (OSS) 2 participants 5 messages Feb 6 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

v2 cover imx9[4,5]_evk: Drop init_uart_clk from board code

The serial driver could enable the uart clk using clk_enable, there is no need to call init_uart_clk in board_early_init_f.

The init_uart_clk() function is still kept, in case it is needed for debug purpose.

---
Changes in v2:
- Drop board_early_init_f and update defconfig
- Include cleanup to toradex smarc-imx95
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Peng Fan (3):
nxp: imx95_evk: Drop init_uart_clk
nxp: imx94_evk: Drop init_uart_clk
toradex: smarc-imx95: Drop init_uart_clk

 board/nxp/imx94_evk/imx94_evk.c         | 6 ------
 board/nxp/imx94_evk/spl.c               | 2 --
 board/nxp/imx95_evk/imx95_evk.c         | 8 --------
 board/nxp/imx95_evk/spl.c               | 2 --
 board/toradex/smarc-imx95/smarc-imx95.c | 8 --------
 board/toradex/smarc-imx95/spl.c         | 2 --
 configs/imx943_evk_defconfig            | 1 -
 configs/imx95_15x15_evk_defconfig       | 1 -
 configs/imx95_evk.config                | 1 -
 configs/toradex-smarc-imx95_defconfig   | 1 -
 10 files changed, 32 deletions(-)

---
base-commit: b5213bbfdcb1812be510427857827ee8becb9f8f
change-id: 20260206-imx9-board-clean-uart-7eda1c7fed1c

Best regards,

Signature · 1 line
Peng Fan <[email protected]>
#1 lore raw

PATCH v2 1/3 nxp: imx95_evk: Drop init_uart_clk

From: Peng Fan <[email protected]>

Rely on serial driver calling clk_enable to enable the lpuart clk, no need to do init_uart_clk in board_early_init_f().

Also remove board_early_init_f(), because it is empty now.

---
 board/nxp/imx95_evk/imx95_evk.c   | 8 --------
 board/nxp/imx95_evk/spl.c         | 2 --
 configs/imx95_15x15_evk_defconfig | 1 -
 configs/imx95_evk.config          | 1 -
 4 files changed, 12 deletions(-)
board/nxp/imx95_evk/imx95_evk.c +0 -8
index ca1d916deab..620a69b53e5 100644
@@ -7,14 +7,6 @@
 #include <asm/arch/clock.h>
 #include <asm/mach-imx/sys_proto.h>
 
-int board_early_init_f(void)
-{
-	/* UART1: A55, UART2: M33, UART3: M7 */
-	init_uart_clk(0);
-
-	return 0;
-}
-
 int board_late_init(void)
 {
 	if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC))
board/nxp/imx95_evk/spl.c +0 -2
index 752d7f916b6..761a1a4a0f6 100644
@@ -67,8 +67,6 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
-	board_early_init_f();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
configs/imx95_15x15_evk_defconfig +0 -1
index f3099f14401..5c7b3941550 100644
@@ -38,7 +38,6 @@ CONFIG_BOOTCOMMAND="bootflow scan -l; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx95-15x15-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_PCI_INIT_R=y
configs/imx95_evk.config +0 -1
index 631ec23c335..58b8fc2a01a 100644
@@ -37,7 +37,6 @@ CONFIG_BOOTCOMMAND="bootflow scan -l; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx95-19x19-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_PCI_INIT_R=y
Signature · 1 line
2.51.0
#2 lore raw

PATCH v2 2/3 nxp: imx94_evk: Drop init_uart_clk

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Rely on serial driver calling clk_enable to enable the lpuart clk, no need to do init_uart_clk in board_early_init_f().

Also remove board_early_init_f(), because it is empty now.

---
 board/nxp/imx94_evk/imx94_evk.c | 6 ------
 board/nxp/imx94_evk/spl.c       | 2 --
 configs/imx943_evk_defconfig    | 1 -
 3 files changed, 9 deletions(-)
board/nxp/imx94_evk/imx94_evk.c +0 -6
index 588aa7548d4..2aeb21c1de7 100644
@@ -9,12 +9,6 @@
 #include <asm/arch/clock.h>
 #include <asm/mach-imx/sys_proto.h>
 
-int board_early_init_f(void)
-{
-	init_uart_clk(0);
-	return 0;
-}
-
 int board_init(void)
 {
 	return 0;
board/nxp/imx94_evk/spl.c +0 -2
index 797806a8d4d..cc5b7f9ef0f 100644
@@ -69,8 +69,6 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
-	board_early_init_f();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
configs/imx943_evk_defconfig +0 -1
index 0371dbe28a9..ef4f9a8fcbc 100644
@@ -37,7 +37,6 @@ CONFIG_BOOTCOMMAND="bootflow scan -l; run bsp_bootcmd"
 CONFIG_DEFAULT_FDT_FILE="imx943-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
-CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_PCI_INIT_R=y
 CONFIG_SPL_MAX_SIZE=0x30000
Signature · 1 line
2.51.0
#3 lore raw

PATCH v2 3/3 toradex: smarc-imx95: Drop init_uart_clk

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Rely on serial driver calling clk_enable to enable the lpuart clk, no need to do init_uart_clk in board_early_init_f().

Also remove board_early_init_f(), because it is empty now.

---
 board/toradex/smarc-imx95/smarc-imx95.c | 8 --------
 board/toradex/smarc-imx95/spl.c         | 2 --
 configs/toradex-smarc-imx95_defconfig   | 1 -
 3 files changed, 11 deletions(-)
board/toradex/smarc-imx95/smarc-imx95.c +0 -8
index c2cf872d9f9..6040c49975a 100644
@@ -8,14 +8,6 @@
 
 #include "../common/tdx-cfg-block.h"
 
-int board_early_init_f(void)
-{
-	/* UART1: A55 */
-	init_uart_clk(0);
-
-	return 0;
-}
-
 int board_phys_sdram_size(phys_size_t *size)
 {
 	*size = PHYS_SDRAM_SIZE + PHYS_SDRAM_2_SIZE;
board/toradex/smarc-imx95/spl.c +0 -2
index e0e39b8bb94..ce8da89410b 100644
@@ -105,8 +105,6 @@ void board_init_f(ulong dummy)
 
 	arch_cpu_init();
 
-	board_early_init_f();
-
 	preloader_console_init();
 
 	debug("SOC: 0x%x\n", gd->arch.soc_rev);
configs/toradex-smarc-imx95_defconfig +0 -1
index 5ab420ae519..77b355c12d6 100644
@@ -43,7 +43,6 @@ CONFIG_SYS_PBSIZE=2074
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_SPL_MAX_SIZE=0x30000
 CONFIG_SPL_BOARD_INIT=y
Signature · 1 line
2.51.0
Acked-by on v2 3/3
#4 lore raw

Re: [PATCH v2 3/3] toradex: smarc-imx95: Drop init_uart_clk

Hello Peng,
thanks for the patch.

Quoted 8 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Rely on serial driver calling clk_enable to enable the lpuart clk, no need to do init_uart_clk in board_early_init_f().

Also remove board_early_init_f(), because it is empty now.

Francesco