[PATCH] configs: rockchip: rock5a: enable environment

Jonas Karlman jonas at kwiboo.se
Tue Mar 5 10:17:10 CET 2024


Hi,

On 2024-03-05 06:40, Eugen Hristev wrote:
> On 3/5/24 04:10, Trevor Woerner wrote:
>> Following the pattern of other Rockchip devices, enable the U-Boot
>> environment to be stored in MMC. This patch specifically assumes the
>> environment will be stored on the SDcard.
>>
>> Signed-off-by: Trevor Woerner <twoerner at gmail.com>
>> ---
>>  configs/rock5a-rk3588s_defconfig | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/configs/rock5a-rk3588s_defconfig b/configs/rock5a-rk3588s_defconfig
>> index a6471a519514..ac6411667d9a 100644
>> --- a/configs/rock5a-rk3588s_defconfig
>> +++ b/configs/rock5a-rk3588s_defconfig
>> @@ -8,6 +8,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
>>  CONFIG_NR_DRAM_BANKS=2
>>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
>> +CONFIG_ENV_SIZE=0x8000
>>  CONFIG_DEFAULT_DEVICE_TREE="rk3588s-rock-5a"
>>  CONFIG_ROCKCHIP_RK3588=y
>>  CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
>> @@ -48,6 +49,8 @@ CONFIG_CMD_REGULATOR=y
>>  CONFIG_SPL_OF_CONTROL=y
>>  CONFIG_OF_LIVE=y
>>  CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
>> +CONFIG_ENV_IS_IN_MMC=y
>> +CONFIG_SYS_MMC_ENV_DEV=1
>>  CONFIG_SPL_DM_SEQ_ALIAS=y
>>  CONFIG_SPL_REGMAP=y
>>  CONFIG_SPL_SYSCON=y
> 
> 
> Hi Trevor,
> 
> What will happen if there is no Sd-Card, and we boot from eMMC or SPI flash ?

Agree, we should not blindly enable env and expect that it can be stored
on sd-card. If anything, it should preferably be saved/loaded from the
device where TPL/SPL was booted from.

Personally I always run my devices with ENV_IS_NOWHERE, with standard
boot and extlinux or efi as the preferred way to boot, I do not see why
normal end-users with a single OS really have a need for a saved env,
please educate me :-)

> 
> The rockchip pattern is usually to have a standard config for all boards and it is
> not stored anywhere.

Unfortunately lots of rockchip boards have blindly enabled ENV_IN_MMC
and force it to use sd-card. However, before enabling same forced
behavior on new boards I would recommend ensuring adding support for
allowing env to follow same load order as FIT (spl-boot-order).

Regards,
Jonas

> 
> Kever, Jonas, please correct me if I am wrong.
> 
> Eugen



More information about the U-Boot mailing list