[PATCH v2] sunxi: fix initial environment loading without MMC
Samuel Holland
samuel at sholland.org
Mon Jun 27 02:59:55 CEST 2022
Hi Andre,
On 6/24/22 11:12 AM, Andre Przywara wrote:
> From: Samuel Holland <samuel at sholland.org>
>
> Commit e42dad4168fe ("sunxi: use boot source for determining environment
> location") changed our implementation of env_get_location() and enabled
> it for every board, even those without MMC support (like the C.H.I.P.
> boards). However the default fallback location of ENVL_FAT requires MMC
> support compiled in, so the board hangs when trying to initially load
> the environment.
>
> Change the algorithm to only return configured environment locations,
> and improve the fallback algorithm on the way.
>
> The env_init() routine calling this function here does not behave well
> if the return value is ENVL_UNKNOWN on the very first call: it will make
> U-Boot proper silently hang very early.
> Work around this issue by making sure we return some configured (dummy)
> environment location when prio is 0. This for instance happens when
> booting via FEL.
>
> This fixes U-Boot loading on the C.H.I.P. boards.
>
> Fixes: e42dad4168fe ("sunxi: use boot source for determining environment location")
> Reported-by: Chris Morgan <macroalpha82 at gmail.com>
> Signed-off-by: Samuel Holland <samuel at sholland.org>
> [Andre: fix FEL boot case by not returning ENVL_UNKNOWN when prio==0]
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
> Hi Samuel,
>
> I cheekily added your Signed-off-by:, as I made this your patch (since
> you came up with it in that email reply some weeks ago). I hope that's
> fine.
Yes, this is fine with me.
Regards,
Samuel
More information about the U-Boot
mailing list