[U-Boot] [RFC] Make U-Boot log great again

Sam Protsenko semen.protsenko at linaro.org
Fri Feb 16 19:01:57 UTC 2018


Hi guys,

TL;DR This is a suggestion about fixing U-Boot log, which has got
worse recently.

Right now U-Boot and SPL logs are cluttered with bogus warnings like
these (on X15 board, but I'm pretty sure it should appear on many
others):

    Loading Environment from FAT...
    *** Warning - bad CRC, using default environment
    Failed (-5)

Those are the consequences of next commit:

    fb69464eae1e ("env: Allow to build multiple environments in Kconfig")

Because of this commit, I can see following changes in my .config file:

    +CONFIG_ENV_IS_IN_FAT=y
    +CONFIG_ENV_FAT_INTERFACE="mmc"
    +CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
    +CONFIG_ENV_FAT_FILE="uboot.env"

which led U-Boot to try and load the environment from different
sources. I agree that it's good thing to do and can be useful, but the
problem is that the code for loading the environment wasn't changed to
handle errors properly.

How I suggest to handle that case:

 1. If we have two sources for the environment (e.g. FAT partition on
SD card and some raw partition on eMMC), we shouldn't print error
messages if we were unable to load the environment from one source
 2. We should probably print some human-readable information that we
didn't find the environment there, let's skip and look for next source
(but don't print those warnings/failed messages)
 3. And only print the error message in case when U-Boot environment
wasn't found at all (on all possible sources).

I don't have enough time to fix this by my own right now. But let's
discuss how to approach this issue in a best way possible. And if
someone wants to step forward and do that -- would be really nice. If
no -- I can look into that later. But let's collect some opinions
here, first.

Thanks.


More information about the U-Boot mailing list