diff options
author | Samuel Holland <samuel@sholland.org> | 2022-04-20 23:15:39 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2022-06-26 11:22:54 +0100 |
commit | e008e5132f7e160320dcc0ffb8fe7fef5264aecd (patch) | |
tree | d20d15ad318d47bdab8f5bdd586cd8e494df7d42 /arch | |
parent | 33112ae0214ed6b260fc982329d02253eab3e35d (diff) | |
download | u-boot-e008e5132f7e160320dcc0ffb8fe7fef5264aecd.tar.gz |
sunxi: fix initial environment loading without MMC
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@gmail.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
[Andre: fix FEL boot case by not returning ENVL_UNKNOWN when prio==0]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions