[PATCH 1/2] spl: Avoid printing boot device if silent console is enabled

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] spl: Avoid printing boot device if silent console is enabled

Otavio Salvador
This avoid emitting message if silent console is in use, otherwise it
pollutes the output and user desires a quiet console

Signed-off-by: Otavio Salvador <[hidden email]>
---

 common/spl/spl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 4840d1d3670..63c48fbf33d 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -552,7 +552,9 @@ static int boot_from_devices(struct spl_image_info *spl_image,
  struct spl_image_loader *loader;
 
  loader = spl_ll_find_loader(spl_boot_list[i]);
-#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if defined(CONFIG_SPL_SERIAL_SUPPORT) \
+    && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)    \
+    && !defined(CONFIG_SILENT_CONSOLE)
  if (loader)
  printf("Trying to boot from %s\n", loader->name);
  else
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] spl: Add SPL_SERIAL as requirement for SDP_USB_SDP

Otavio Salvador
The USB SDP protocol require the SPL serial support to allow the build
to succeed.

Signed-off-by: Otavio Salvador <[hidden email]>
---

 common/spl/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index af8255a8d6a..20c5c4af3c3 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1237,6 +1237,7 @@ endchoice
 
 config SPL_USB_SDP_SUPPORT
  bool "Support SDP (Serial Download Protocol)"
+ depends on SPL_SERIAL_SUPPORT
  help
   Enable Serial Download Protocol (SDP) device support in SPL. This
   allows to download images into memory and execute (jump to) them
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] spl: Avoid printing boot device if silent console is enabled

Stefan Roese
In reply to this post by Otavio Salvador
Hi Otavio,

On 30.09.20 04:14, Otavio Salvador wrote:

> This avoid emitting message if silent console is in use, otherwise it
> pollutes the output and user desires a quiet console
>
> Signed-off-by: Otavio Salvador <[hidden email]>
> ---
>
>   common/spl/spl.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 4840d1d3670..63c48fbf33d 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -552,7 +552,9 @@ static int boot_from_devices(struct spl_image_info *spl_image,
>   struct spl_image_loader *loader;
>  
>   loader = spl_ll_find_loader(spl_boot_list[i]);
> -#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
> +#if defined(CONFIG_SPL_SERIAL_SUPPORT) \
> +    && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)    \
> +    && !defined(CONFIG_SILENT_CONSOLE)
>   if (loader)
>   printf("Trying to boot from %s\n", loader->name);
>   else
>

Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
the console / printf function itself instead of adding it to all
callers?

Thanks,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] spl: Avoid printing boot device if silent console is enabled

Otavio Salvador-2
Em qua., 30 de set. de 2020 às 02:23, Stefan Roese <[hidden email]> escreveu:
> On 30.09.20 04:14, Otavio Salvador wrote:
> Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
> the console / printf function itself instead of adding it to all
> callers?

I believe in critical errors and like, it is important to print so I'd
say that using a more controlled "hide" mechanism is good.

--
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] spl: Avoid printing boot device if silent console is enabled

Stefan Roese
On 30.09.20 13:47, Otavio Salvador wrote:
> Em qua., 30 de set. de 2020 às 02:23, Stefan Roese <[hidden email]> escreveu:
>> On 30.09.20 04:14, Otavio Salvador wrote:
>> Wouldn't it be better, to add this CONFIG_SILENT_CONSOLE check to
>> the console / printf function itself instead of adding it to all
>> callers?
>
> I believe in critical errors and like, it is important to print so I'd
> say that using a more controlled "hide" mechanism is good.

Agreed. I forgot about that.

Thanks,
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/2] spl: Add SPL_SERIAL as requirement for SDP_USB_SDP

Tom Rini-4
In reply to this post by Otavio Salvador
On Tue, Sep 29, 2020 at 11:14:29PM -0300, Otavio Salvador wrote:

> The USB SDP protocol require the SPL serial support to allow the build
> to succeed.
>
> Signed-off-by: Otavio Salvador <[hidden email]>

Applied to u-boot/master, thanks!

--
Tom

signature.asc (673 bytes) Download Attachment