[U-Boot] Silencing SPL output

Heiko Schocher hs at denx.de
Tue Oct 17 03:34:50 UTC 2017


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 at 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=cc3341acb537c4b4edf3a241f386a44c40220c9f;hb=eb0044db392247aa1c43e29f2703418d5668018a#l124

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
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list