All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/2] rockchip: tpl.c #ifdef fixes
@ 2019-07-19 13:22 Chris Webb
  2019-07-19 13:23 ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT Chris Webb
  2019-07-19 13:23 ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT Chris Webb
  0 siblings, 2 replies; 7+ messages in thread
From: Chris Webb @ 2019-07-19 13:22 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT
  2019-07-19 13:22 [U-Boot] [PATCH 0/2] rockchip: tpl.c #ifdef fixes Chris Webb
@ 2019-07-19 13:23 ` Chris Webb
  2019-07-21  3:30   ` Kever Yang
  2019-07-19 13:23 ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT Chris Webb
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Webb @ 2019-07-19 13:23 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: <chris@arachsys.com>
---
 arch/arm/mach-rockchip/tpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 0ff2a197ed..5df88bddeb 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -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:
 	 *

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT
  2019-07-19 13:22 [U-Boot] [PATCH 0/2] rockchip: tpl.c #ifdef fixes Chris Webb
  2019-07-19 13:23 ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT Chris Webb
@ 2019-07-19 13:23 ` Chris Webb
  2019-07-21  3:30   ` Kever Yang
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Webb @ 2019-07-19 13:23 UTC (permalink / raw)
  To: u-boot

The 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.

Signed-off-by: <chris@arachsys.com>
---
 arch/arm/mach-rockchip/tpl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 5df88bddeb..55f6e922d0 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -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) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT
  2019-07-19 13:23 ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT Chris Webb
@ 2019-07-21  3:30   ` Kever Yang
  2019-07-23  8:02     ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Kever Yang @ 2019-07-21  3:30 UTC (permalink / raw)
  To: u-boot

Hi Chris,


On 2019/7/19 下午9:23, Chris Webb wrote:
> 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.
>
> Signed-off-by: <chris@arachsys.com>

Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>

Thanks,
  - Kever
> ---
>   arch/arm/mach-rockchip/tpl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
> index 0ff2a197ed..5df88bddeb 100644
> --- a/arch/arm/mach-rockchip/tpl.c
> +++ b/arch/arm/mach-rockchip/tpl.c
> @@ -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:
>   	 *
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT
  2019-07-19 13:23 ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT Chris Webb
@ 2019-07-21  3:30   ` Kever Yang
  2019-07-23  8:03     ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Kever Yang @ 2019-07-21  3:30 UTC (permalink / raw)
  To: u-boot

Hi Chris,


On 2019/7/19 下午9:23, Chris Webb wrote:
> The 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.
>
> Signed-off-by: <chris@arachsys.com>


Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>

Thanks,
  - Kever

> ---
>   arch/arm/mach-rockchip/tpl.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
> index 5df88bddeb..55f6e922d0 100644
> --- a/arch/arm/mach-rockchip/tpl.c
> +++ b/arch/arm/mach-rockchip/tpl.c
> @@ -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) {
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT【请注意,邮件由u-boot-bounces@lists.denx.de代发】
  2019-07-21  3:30   ` Kever Yang
@ 2019-07-23  8:02     ` Kever Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Kever Yang @ 2019-07-23  8:02 UTC (permalink / raw)
  To: u-boot


On 2019/7/21 上午11:30, Kever Yang wrote:
> Hi Chris,
>
>
> On 2019/7/19 下午9:23, Chris Webb wrote:
>> 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.
>>
>> Signed-off-by: <chris@arachsys.com>
>
Applied to u-boot-rockchip, thanks!
> Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>
>
> Thanks,
>  - Kever
>> ---
>>   arch/arm/mach-rockchip/tpl.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
>> index 0ff2a197ed..5df88bddeb 100644
>> --- a/arch/arm/mach-rockchip/tpl.c
>> +++ b/arch/arm/mach-rockchip/tpl.c
>> @@ -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:
>>        *
>>
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT【请注意,邮件由u-boot-bounces@lists.denx.de代发】
  2019-07-21  3:30   ` Kever Yang
@ 2019-07-23  8:03     ` Kever Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Kever Yang @ 2019-07-23  8:03 UTC (permalink / raw)
  To: u-boot


On 2019/7/21 上午11:30, Kever Yang wrote:
> Hi Chris,
>
>
> On 2019/7/19 下午9:23, Chris Webb wrote:
>> The 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.
>>
>> Signed-off-by: <chris@arachsys.com>
>

Applied to u-boot-rockchip, thanks!
>
> Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>
>
> Thanks,
>  - Kever
>
>> ---
>>   arch/arm/mach-rockchip/tpl.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
>> index 5df88bddeb..55f6e922d0 100644
>> --- a/arch/arm/mach-rockchip/tpl.c
>> +++ b/arch/arm/mach-rockchip/tpl.c
>> @@ -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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-23  8:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 13:22 [U-Boot] [PATCH 0/2] rockchip: tpl.c #ifdef fixes Chris Webb
2019-07-19 13:23 ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT Chris Webb
2019-07-21  3:30   ` Kever Yang
2019-07-23  8:02     ` [U-Boot] [PATCH 1/2] rockchip: Fix TPL build without CONFIG_TPL_SERIAL_SUPPORT【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
2019-07-19 13:23 ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT Chris Webb
2019-07-21  3:30   ` Kever Yang
2019-07-23  8:03     ` [U-Boot] [PATCH 2/2] rockchip: TPL banner should depend on CONFIG_TPL_BANNER_PRINT【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.