[U-Boot] Silencing SPL output

This is probably something of a foot-gun but here we go...
I was wondering if it's worth providing the ability to silence the output from the SPL. CONFIG_SILENT_CONSOLE exist for u-boot proper but the SPL preloader_console_init bypasses anything that would set GD_FLG_SILENT. Even if it didn't the SPL probably doesn't have access to any environment that would allow it to be set/unset.
I was thinking about adding a SPL specific CONFIG option that would set GD_FLG_SILENT (probably in spl_init). Aside from re-compiling there wouldn't be any way of making the SPL loud. Is this a reasonable idea or is it just asking for boards to be bricked with no way of telling what went wrong?
Thanks, Chris

Hello Chris,
Am 16.10.2017 um 02:38 schrieb Chris Packham:
This is probably something of a foot-gun but here we go...
I was wondering if it's worth providing the ability to silence the output from the SPL. CONFIG_SILENT_CONSOLE exist for u-boot proper but the SPL preloader_console_init bypasses anything that would set GD_FLG_SILENT. Even if it didn't the SPL probably doesn't have access to any environment that would allow it to be set/unset.
I was thinking about adding a SPL specific CONFIG option that would set GD_FLG_SILENT (probably in spl_init). Aside from re-compiling there wouldn't be any way of making the SPL loud. Is this a reasonable idea or is it just asking for boards to be bricked with no way of telling what went wrong?
I have a at91 based board in mainline, which has no SPL output enabled (as there is no space for it), see:
configs/smartweb_defconfig
Do not define CONFIG_SPL_SERIAL_SUPPORT=y
bye, Heiko

Hi Heiko,
On Mon, Oct 16, 2017 at 5:24 PM, Heiko Schocher hs@denx.de wrote:
Hello Chris,
Am 16.10.2017 um 02:38 schrieb Chris Packham:
This is probably something of a foot-gun but here we go...
I was wondering if it's worth providing the ability to silence the output from the SPL. CONFIG_SILENT_CONSOLE exist for u-boot proper but the SPL preloader_console_init bypasses anything that would set GD_FLG_SILENT. Even if it didn't the SPL probably doesn't have access to any environment that would allow it to be set/unset.
I was thinking about adding a SPL specific CONFIG option that would set GD_FLG_SILENT (probably in spl_init). Aside from re-compiling there wouldn't be any way of making the SPL loud. Is this a reasonable idea or is it just asking for boards to be bricked with no way of telling what went wrong?
I have a at91 based board in mainline, which has no SPL output enabled (as there is no space for it), see:
configs/smartweb_defconfig
Do not define CONFIG_SPL_SERIAL_SUPPORT=y
Thanks for the tip. Unfortunately disabling CONFIG_SPL_SERIAL_SUPPORT causes some build errors (at least for db-88f6820-amc)
common/spl/built-in.o: In function `preloader_console_init': common/spl/spl.c:463: undefined reference to `serial_init' lib/built-in.o: In function `fdtdec_get_alias_seq': lib/fdtdec.c:546: undefined reference to `trailing_strtol' drivers/built-in.o: In function `spi_flash_probe_bus_cs':drivers/mtd/spi/sf-uclass.c:66: undefined reference to `snprintf' scripts/Makefile.spl:358: recipe for target 'spl/u-boot-spl' failed
The first one looks like an appropriate #ifdef (or do/while fallback) is missing. The others look like missing dependencies.
I was already on the fence about silencing SPL output so I'm not planning on pursuing it. I thought I'd mention the build failures in case someone wants to take a look.
Thanks, Chris

Hello Chris,
Am 16.10.2017 um 23:08 schrieb Chris Packham:
Hi Heiko,
On Mon, Oct 16, 2017 at 5:24 PM, Heiko Schocher hs@denx.de wrote:
Hello Chris,
Am 16.10.2017 um 02:38 schrieb Chris Packham:
This is probably something of a foot-gun but here we go...
I was wondering if it's worth providing the ability to silence the output from the SPL. CONFIG_SILENT_CONSOLE exist for u-boot proper but the SPL preloader_console_init bypasses anything that would set GD_FLG_SILENT. Even if it didn't the SPL probably doesn't have access to any environment that would allow it to be set/unset.
I was thinking about adding a SPL specific CONFIG option that would set GD_FLG_SILENT (probably in spl_init). Aside from re-compiling there wouldn't be any way of making the SPL loud. Is this a reasonable idea or is it just asking for boards to be bricked with no way of telling what went wrong?
I have a at91 based board in mainline, which has no SPL output enabled (as there is no space for it), see:
configs/smartweb_defconfig
Do not define CONFIG_SPL_SERIAL_SUPPORT=y
Thanks for the tip. Unfortunately disabling CONFIG_SPL_SERIAL_SUPPORT causes some build errors (at least for db-88f6820-amc)
common/spl/built-in.o: In function `preloader_console_init': common/spl/spl.c:463: undefined reference to `serial_init' > lib/built-in.o: In function `fdtdec_get_alias_seq': lib/fdtdec.c:546: undefined reference to `trailing_strtol' drivers/built-in.o: In function `spi_flash_probe_bus_cs':drivers/mtd/spi/sf-uclass.c:66: undefined reference to `snprintf' scripts/Makefile.spl:358: recipe for target 'spl/u-boot-spl' failed
The first one looks like an appropriate #ifdef (or do/while fallback) is missing. The others look like missing dependencies.
Yes, this has to be fixed for your arch, see for example at91:
http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-at91/spl_at91.c;h=cc...
Or may better, we should fix this in common/spl/spl.c
Hmm... error in "drivers/mtd/spi/sf-uclass.c" is strange:
code: #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_USE_TINY_PRINTF) str = "spi_flash"; #else char name[30];
snprintf(name, sizeof(name), "spi_flash@%d:%d", busnum, cs); str = strdup(name); #endif
You are sure you build for SPL ?
I was already on the fence about silencing SPL output so I'm not planning on pursuing it. I thought I'd mention the build failures in case someone wants to take a look.
Ah, Okay.
bye, Heiko
participants (2)
-
Chris Packham
-
Heiko Schocher