Skip to content
Commit e008e513 authored by Samuel Holland's avatar Samuel Holland Committed by Andre Przywara
Browse files

sunxi: fix initial environment loading without MMC



Commit e42dad41 ("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: e42dad41 ("sunxi: use boot source for determining environment location")
Reported-by: default avatarChris Morgan <macroalpha82@gmail.com>
Signed-off-by: default avatarSamuel Holland <samuel@sholland.org>
[Andre: fix FEL boot case by not returning ENVL_UNKNOWN when prio==0]
Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent 33112ae0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment