Skip to contentSkip to conversation

arm: stm32mp: Drop unnecessary BOARD_EARLY_INIT_F usage

PATCH In review Tom Rini 2 participants 3 messages Mar 25 – Apr 30

Subsystems (3)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 arm: stm32mp: Drop unnecessary BOARD_EARLY_INIT_F usage

All of these platforms enable CONFIG_BOARD_EARLY_INIT_F and then have a do-nothing board_early_init_f function. Change to not enabling the option and so not needing an empty function.

---
Cc: Patrick Delaunay <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Matteo Lisi <[email protected]>
Cc: Dillon Min <[email protected]>
Cc: [email protected]

---
 arch/arm/mach-stm32mp/stm32mp1/spl.c         | 15 ++++++---------
 board/engicam/stm32mp1/spl.c                 |  6 ------
 board/st/stm32h750-art-pi/stm32h750-art-pi.c |  5 -----
 configs/stm32h750-art-pi_defconfig           |  1 -
 4 files changed, 6 insertions(+), 21 deletions(-)
arch/arm/mach-stm32mp/stm32mp1/spl.c +6 -9
index e63bdaaf42fd..d2e41b8e65ff 100644
@@ -90,11 +90,6 @@ void spl_display_print(void)
 }
 #endif
 
-__weak int board_early_init_f(void)
-{
-	return 0;
-}
-
 uint32_t stm32mp_get_dram_size(void)
 {
 	struct ram_info ram;
@@ -204,10 +199,12 @@ void board_init_f(ulong dummy)
 	/* enable console uart printing */
 	preloader_console_init();
 
-	ret = board_early_init_f();
-	if (ret) {
-		log_debug("board_early_init_f() failed: %d\n", ret);
-		hang();
+	if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F)) {
+		ret = board_early_init_f();
+		if (ret) {
+			log_debug("board_early_init_f() failed: %d\n", ret);
+			hang();
+		}
 	}
 
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
board/engicam/stm32mp1/spl.c +0 -6
index bb2bd446aa8c..19e5ab0180f9 100644
@@ -15,9 +15,3 @@ void board_vddcore_init(u32 voltage_mv)
 	if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
 		opp_voltage_mv = voltage_mv;
 }
-
-int board_early_init_f(void)
-{
-	return 0;
-}
-
board/st/stm32h750-art-pi/stm32h750-art-pi.c +0 -5
index 244bb5eefb3a..8b1b23337790 100644
@@ -32,11 +32,6 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int board_early_init_f(void)
-{
-	return 0;
-}
-
 int board_late_init(void)
 {
 	return 0;
configs/stm32h750-art-pi_defconfig +0 -1
index 971d5c00d88f..0d0dca2511b7 100644
@@ -24,7 +24,6 @@ CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi"
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=282
 # CONFIG_DISPLAY_CPUINFO is not set
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SYS_PROMPT="U-Boot > "
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 87 lines · Tom Rini

All of these platforms enable CONFIG_BOARD_EARLY_INIT_F and then have a do-nothing board_early_init_f function. Change to not enabling the option and so not needing an empty function.

---
Cc: Patrick Delaunay <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Matteo Lisi <[email protected]>
Cc: Dillon Min <[email protected]>
Cc: [email protected]

---
 arch/arm/mach-stm32mp/stm32mp1/spl.c         | 15 ++++++---------
 board/engicam/stm32mp1/spl.c                 |  6 ------
 board/st/stm32h750-art-pi/stm32h750-art-pi.c |  5 -----
 configs/stm32h750-art-pi_defconfig           |  1 -
 4 files changed, 6 insertions(+), 21 deletions(-)
arch/arm/mach-stm32mp/stm32mp1/spl.c +6 -9
index e63bdaaf42fd..d2e41b8e65ff 100644
@@ -90,11 +90,6 @@ void spl_display_print(void)
 }
 #endif
 
-__weak int board_early_init_f(void)
-{
-	return 0;
-}
-
 uint32_t stm32mp_get_dram_size(void)
 {
 	struct ram_info ram;
@@ -204,10 +199,12 @@ void board_init_f(ulong dummy)
 	/* enable console uart printing */
 	preloader_console_init();
 
-	ret = board_early_init_f();
-	if (ret) {
-		log_debug("board_early_init_f() failed: %d\n", ret);
-		hang();
+	if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F)) {
+		ret = board_early_init_f();
+		if (ret) {
+			log_debug("board_early_init_f() failed: %d\n", ret);
+			hang();
+		}
 	}
 
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
board/engicam/stm32mp1/spl.c +0 -6
index bb2bd446aa8c..19e5ab0180f9 100644
@@ -15,9 +15,3 @@ void board_vddcore_init(u32 voltage_mv)
 	if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
 		opp_voltage_mv = voltage_mv;
 }
-
-int board_early_init_f(void)
-{
-	return 0;
-}
-
board/st/stm32h750-art-pi/stm32h750-art-pi.c +0 -5
index 244bb5eefb3a..8b1b23337790 100644
@@ -32,11 +32,6 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int board_early_init_f(void)
-{
-	return 0;
-}
-
 int board_late_init(void)
 {
 	return 0;
configs/stm32h750-art-pi_defconfig +0 -0
index 971d5c00d88f..0d0dca2511b7 100644

configs/stm32h750-art-pi_defconfig CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi" · line 29

Quoted 7 lines
configs/stm32h750-art-pi_defconfig +0 -1
@@ -24,7 +24,6 @@ CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi"
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=282
 # CONFIG_DISPLAY_CPUINFO is not set
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SYS_PROMPT="U-Boot > "

Hi Tom

Thanks
Patrice

#2 lore raw
Quoted 100 lines · Patrice CHOTARD
Quoted 87 lines · Tom Rini

All of these platforms enable CONFIG_BOARD_EARLY_INIT_F and then have a do-nothing board_early_init_f function. Change to not enabling the option and so not needing an empty function.

---
Cc: Patrick Delaunay <[email protected]>
Cc: Patrice Chotard <[email protected]>
Cc: Jagan Teki <[email protected]>
Cc: Matteo Lisi <[email protected]>
Cc: Dillon Min <[email protected]>
Cc: [email protected]

---
 arch/arm/mach-stm32mp/stm32mp1/spl.c         | 15 ++++++---------
 board/engicam/stm32mp1/spl.c                 |  6 ------
 board/st/stm32h750-art-pi/stm32h750-art-pi.c |  5 -----
 configs/stm32h750-art-pi_defconfig           |  1 -
 4 files changed, 6 insertions(+), 21 deletions(-)
arch/arm/mach-stm32mp/stm32mp1/spl.c +6 -9
index e63bdaaf42fd..d2e41b8e65ff 100644
@@ -90,11 +90,6 @@ void spl_display_print(void)
 }
 #endif
 
-__weak int board_early_init_f(void)
-{
-	return 0;
-}
-
 uint32_t stm32mp_get_dram_size(void)
 {
 	struct ram_info ram;
@@ -204,10 +199,12 @@ void board_init_f(ulong dummy)
 	/* enable console uart printing */
 	preloader_console_init();
 
-	ret = board_early_init_f();
-	if (ret) {
-		log_debug("board_early_init_f() failed: %d\n", ret);
-		hang();
+	if (IS_ENABLED(CONFIG_BOARD_EARLY_INIT_F)) {
+		ret = board_early_init_f();
+		if (ret) {
+			log_debug("board_early_init_f() failed: %d\n", ret);
+			hang();
+		}
 	}
 
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
board/engicam/stm32mp1/spl.c +0 -6
index bb2bd446aa8c..19e5ab0180f9 100644
@@ -15,9 +15,3 @@ void board_vddcore_init(u32 voltage_mv)
 	if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
 		opp_voltage_mv = voltage_mv;
 }
-
-int board_early_init_f(void)
-{
-	return 0;
-}
-
board/st/stm32h750-art-pi/stm32h750-art-pi.c +0 -5
index 244bb5eefb3a..8b1b23337790 100644
@@ -32,11 +32,6 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int board_early_init_f(void)
-{
-	return 0;
-}
-
 int board_late_init(void)
 {
 	return 0;
configs/stm32h750-art-pi_defconfig +0 -0
index 971d5c00d88f..0d0dca2511b7 100644

configs/stm32h750-art-pi_defconfig CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi" · line 29

Quoted 7 lines
configs/stm32h750-art-pi_defconfig +0 -1
@@ -24,7 +24,6 @@ CONFIG_DEFAULT_FDT_FILE="stm32h750i-art-pi"
 CONFIG_SYS_CBSIZE=256
 CONFIG_SYS_PBSIZE=282
 # CONFIG_DISPLAY_CPUINFO is not set
-CONFIG_BOARD_EARLY_INIT_F=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SYS_PROMPT="U-Boot > "

Hi Tom

Quoted 8 lines

Thanks
Patrice
_______________________________________________
Uboot-stm32 mailing list
[email protected]
https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32

Applied to u-boot-stm32/master

Thanks
Patrice