[PATCH] imx9: Improve boot device auto-selection
Szőke Benjamin
egyszeregy at freemail.hu
Fri Nov 1 11:55:07 CET 2024
2024. 10. 22. 14:23 keltezéssel, Peng Fan írta:
>> Subject: Re: [PATCH] imx9: Improve boot device auto-selection
>>
>> On Wed, Oct 16, 2024 at 4:42 PM Szőke Benjamin
>> <egyszeregy at freemail.hu> wrote:
>>
>>> You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and
>>> CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
>>
>> imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y
>> and CONFIG_ENV_IS_NOWHERE=y.
>>
>>> If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the
>> patched
>>> source files will be not part of the build, and the autodetection of
>>> the boot mode will never work. At the moment it works only if you
>> use
>>> CONFIG_ENV_IS_IN_MMC=y in U-boot config but it should work also
>> in
>>> case of use CONFIG_ENV_IS_NOWHERE=y option also.
>>
>> But like I said imx93_11x11_evk_defconfig selects both
>> CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
>>
>> I am still confused by your patch.
>>
>> I would like to get a feedback from Peng Fan.
>
> In UUU boot mode, we use the env inside U-Boot proper, so
> it is NOWHERE.
>
> In this patch, I think use changing to mmc for NOWHERE
> may break the rule.
>
> Thanks,
> Peng.
If both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y are in the config,
CONFIG_ENV_IS_IN_MMC=y will be overrideing default CONFIG_ENV_IS_NOWHERE
settings, so in imx9 defconfig it is useless to use both of them.
In my board i can use CONFIG_ENV_IS_NOWHERE=y without CONFIG_ENV_IS_IN_MMC=y in
imX93 EVK board but i needed to make this patch in imx9/soc.c and imx93_evk.c
source files imx9 to get it work.
It will not break any rules. In this boot mode selection it just a simple
process to set "mmcdev" and "mmcroot" according your actual MMC device IDs from
boot switches states. It never be able to break any rules for UUU booting in
Serial download mode because you have to use manual commands from UUU script
which will never use this mmc variables.
https://elixir.bootlin.com/u-boot/v2024.10/source/board/congatec/common/mmc.c#L41
Goal in my patch to able to use the boot mode autodecetion in case of use only
CONFIG_ENV_IS_NOWHERE=y option (without CONFIG_ENV_IS_IN_MMC). It works for me.
Please sit down, put your NXP board i your desk and try it, then analyse how
well works for you also.
More information about the U-Boot
mailing list