rockchip: puma-rk3399: load environment from same medium as one used to load U-Boot...
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Thu, 15 Sep 2022 09:14:27 +0000 (11:14 +0200)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 19 Oct 2022 11:30:49 +0000 (19:30 +0800)
commitb1f1b4a5a528eeefea283ccca2ee9777cb10c840
treeb7d4655c0111e0d4873815a22b4738e04ab73370
parentac471587f28f9539ab1da27c9fa491f69eb106a9
rockchip: puma-rk3399: load environment from same medium as one used to load U-Boot proper

Chances are when one boots U-Boot proper from a given storage medium,
they want the same medium to be used to load and store the environment.

This basically allows to have completely separate U-Boot (TPL/SPL/U-Boot
proper/environment) per storage medium which is convenient when working
with recovery from SD-Card as one would just need to insert a properly
configured SD-Card into the device to have access to their whole debug
setup.

No fallback mechanism is provided as to not dirty other storage medium
environment by mistake. However, since arch_env_get_location() is called
by env_init() which is part of the pre-relocation process, a valid,
non-ENVL_UNKNOWN, value shall be returned otherwise the relocation fails
with the following message:
initcall sequence 00000000002866c0 failed at call 0000000000256b34 (err=-19)

This valid, non-ENVL_UNKNOWN, value is ENVL_NOWHERE which requires to
always select CONFIG_ENV_IS_NOWHERE otherwise this work-around does not
work.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
board/theobroma-systems/puma_rk3399/puma-rk3399.c
configs/puma-rk3399_defconfig