Skip to contentSkip to conversation

spl: Avoid printing boot device if silent console is enabled

PATCH New Otavio Salvador 4 participants 6 messages Sep 30, 2020 – Oct 14, 2020

lore
Share & tools
lore
#0 lore raw

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

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

---

 common/spl/spl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl.c +3 -1
index 4840d1d3670..63c48fbf33d 100644
@@ -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
Signature · 1 line
2.28.0
#1 lore raw

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

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

---

 common/spl/Kconfig | 1 +
 1 file changed, 1 insertion(+)
common/spl/Kconfig +1 -0
index af8255a8d6a..20c5c4af3c3 100644
@@ -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
Signature · 1 line
2.28.0
#2 lore raw

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

Quoted 4 lines · Otavio Salvador

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

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201014/95a8456a/attachment.sig>
#3 lore raw

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

In reply to Otavio Salvador

Hi Otavio,

Quoted 15 lines · Otavio Salvador

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

---

  common/spl/spl.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl.c +0 -0
index 4840d1d3670..63c48fbf33d 100644

common/spl/spl.c static int boot_from_devices(struct spl_image_info *spl_image, · line 560

Quoted 10 lines
common/spl/spl.c +3 -1
@@ -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

#4 lore raw

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

Em qua., 30 de set. de 2020 ?s 02:23, Stefan Roese <[email protected]> escreveu:

Quoted 4 lines · Otavio Salvador

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.

Signature · 3 lines
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
#5 lore raw

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

Quoted 8 lines · Otavio Salvador

Em qua., 30 de set. de 2020 ?s 02:23, Stefan Roese <[email protected]> escreveu:

Quoted 4 lines · Otavio Salvador

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