rockchip: tpl.c #ifdef fixes
Subsystems (3)
cover rockchip: tpl.c #ifdef fixes
These are two trivial patches which fix up the #ifdef conditionals in mach-rockchip/tpl.c to do the right thing in two configuration scenarios:
1. Debug UART enabled (for SPL and main U-Boot) but serial support disabled for the TPL stage.
2. TPL banner disabled by unsetting CONFIG_TPL_BANNER_PRINT.
I stumbled over these edge cases while trying various permitted config permutations, trying to make U-Boot less noisy without killing useful error messages.
The diffs are against u-boot-rockchip.git: this already has changes that haven't yet reached mainline u-boot yet, moving the relevant code from board specific source files into the shared mach-rockchip/tpl.c.
PATCH 1/2 rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT
If CONFIG_DEBUG_UART is set but CONFIG_TPL_SERIAL_SUPPORT is not, the serial output should be available in SPL and full U-Boot, but not built in TPL. However, the rockchip tpl.c instead fails to compile with undefined references to the debug UART.
Instead, initialise the debug UART and print the TPL banner only if both CONFIG_DEBUG_UART and CONFIG_TPL_SERIAL_SUPPORT are set.
--- arch/arm/mach-rockchip/tpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/tpl.c +1 -1
@@ -44,7 +44,7 @@ void board_init_f(ulong dummy)struct udevice *dev;int ret; -#ifdef CONFIG_DEBUG_UART +#if defined(CONFIG_DEBUG_UART ) && defined(CONFIG_TPL_SERIAL_SUPPORT )/* * Debug UART can be used from here if required: *
PATCH 1/2 rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT
Hi Chris,
Quoted 9 lines · Chris Webb
If
CONFIG_DEBUG_UARTis set butCONFIG_TPL_SERIAL_SUPPORTis not, the serial output should be available in SPL and full U-Boot, but not built in TPL. However, the rockchiptpl.cinstead fails to compile with undefined references to the debug UART.Instead, initialise the debug UART and print the TPL banner only if both
CONFIG_DEBUG_UARTandCONFIG_TPL_SERIAL_SUPPORTare set.Signed-off-by <[email protected]>
Thanks,
- Kever
Quoted 18 lines
--- arch/arm/mach-rockchip/tpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/tpl.c +1
-1@@ -44,7 +44,7 @@ void board_init_f(ulong dummy)struct udevice *dev;int ret; -#ifdef CONFIG_DEBUG_UART +#if defined(CONFIG_DEBUG_UART ) && defined(CONFIG_TPL_SERIAL_SUPPORT )/* * Debug UART can be used from here if required: *
PATCH 1/2 rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT【请注意,邮件由[email protected]代发】
Quoted 14 lines · Kever Yang
Hi Chris,
Quoted 9 lines · Chris Webb
If
CONFIG_DEBUG_UARTis set butCONFIG_TPL_SERIAL_SUPPORTis not, the serial output should be available in SPL and full U-Boot, but not built in TPL. However, the rockchiptpl.cinstead fails to compile with undefined references to the debug UART.Instead, initialise the debug UART and print the TPL banner only if both
CONFIG_DEBUG_UARTandCONFIG_TPL_SERIAL_SUPPORTare set.Signed-off-by <[email protected]>
Applied to u-boot-rockchip, thanks!
Quoted 27 lines
Reviewed-by Kever Yang <[email protected]>Thanks,
- KeverQuoted 11 lines
---
arch/arm/mach-rockchip/tpl.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/tpl.c +0
-0@@ -44,7 +44,7 @@ void board_init_f(ulong dummy) struct udevice *dev; int ret;Quoted 6 lines
-#ifdef
CONFIG_DEBUG_UART
+#ifdefined(CONFIG_DEBUG_UART)&&defined(CONFIG_TPL_SERIAL_SUPPORT)/*
* Debug UART can be used from here if required:
*_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 2/2 rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT
In reply to Chris WebbThe generic code in common/spl/spl.c allows TPL/SPL banners to be silenced by unsetting CONFIG_TPL_BANNER_PRINT or CONFIG_SPL_BANNER_PRINT respectively. However, arch/arm/mach-rockchip/tpl.c prints this banner unconditionally.
Fix the rockchip-specific tpl.c so that the TPL banner depends on CONFIG_TPL_BANNER_PRINT in the same way as the generic code.
--- arch/arm/mach-rockchip/tpl.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-rockchip/tpl.c +2 -0
@@ -54,8 +54,10 @@ void board_init_f(ulong dummy)* printascii("string"); */ debug_uart_init (); +#ifdef CONFIG_TPL_BANNER_PRINT printascii ("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \U_BOOT_TIME ")\n" ); +#endif #endif ret =spl_early_init ();if (ret) {
PATCH 2/2 rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT
Hi Chris,
Quoted 9 lines · Chris Webb
The generic code in
common/spl/spl.callows TPL/SPL banners to be silenced by unsettingCONFIG_TPL_BANNER_PRINTorCONFIG_SPL_BANNER_PRINTrespectively. However,arch/arm/mach-rockchip/tpl.cprints this banner unconditionally.Fix the rockchip-specific
tpl.cso that the TPL banner depends onCONFIG_TPL_BANNER_PRINTin the same way as the generic code.Signed-off-by <[email protected]>
Thanks,
- Kever
Quoted 20 lines
--- arch/arm/mach-rockchip/tpl.c | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-rockchip/tpl.c +2
-0@@ -54,8 +54,10 @@ void board_init_f(ulong dummy)* printascii("string"); */ debug_uart_init (); +#ifdef CONFIG_TPL_BANNER_PRINT printascii ("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \U_BOOT_TIME ")\n" ); +#endif #endif ret =spl_early_init ();if (ret) {
PATCH 2/2 rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT【请注意,邮件由[email protected]代发】
Quoted 14 lines · Kever Yang
Hi Chris,
Quoted 9 lines · Chris Webb
The generic code in
common/spl/spl.callows TPL/SPL banners to be silenced by unsettingCONFIG_TPL_BANNER_PRINTorCONFIG_SPL_BANNER_PRINTrespectively. However,arch/arm/mach-rockchip/tpl.cprints this banner unconditionally.Fix the rockchip-specific
tpl.cso that the TPL banner depends onCONFIG_TPL_BANNER_PRINTin the same way as the generic code.Signed-off-by <[email protected]>
Applied to u-boot-rockchip, thanks!
Quoted 32 lines
Reviewed-by Kever Yang <[email protected]>Thanks,
- KeverQuoted 10 lines
---
arch/arm/mach-rockchip/tpl.c| 2 ++1 file changed, 2 insertions(+)arch/arm/mach-rockchip/tpl.c +0
-0arch/arm/mach-rockchip/tpl.c void board_init_f(ulong dummy) · line 63
Quoted 10 lines
arch/arm/mach-rockchip/tpl.c +2
-0@@ -54,8 +54,10 @@ void board_init_f(ulong dummy)* printascii("string"); */ debug_uart_init(); +#ifdef CONFIG_TPL_BANNER_PRINT printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \ U_BOOT_TIME ")\n"); +#endif #endif ret = spl_early_init(); if (ret) {_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot