[Upstream] [PATCH v2 2/3] board: phytec: phycore-imx93: Set boot_targets dynamically

Wadim Egorov w.egorov at phytec.de
Sat Dec 6 19:11:29 CET 2025



On 12/6/25 2:27 PM, Primoz Fiser wrote:
> Hi Wadim,
> 
> On 5. 12. 25 16:40, Wadim Egorov wrote:
>>
>>
>> On 12/5/25 1:10 PM, Primoz Fiser wrote:
>>> Set boot_targets environment variable dynamically, so that when booting
>>> from SD-card, boot binaries are also preferably fetched from the SD-card
>>> by default. If the user decides to set their own boot_targets, we should
>>> not overwrite them.
>>>
>>> Signed-off-by: Primoz Fiser <primoz.fiser at norik.com>
>>> ---
>>> Changes in v2:
>>> - no changes
>>> Link to v1: https://lore.kernel.org/all/20251204080744.3868067-2- 
>>> primoz.fiser at norik.com/
>>>
>>>   board/phytec/phycore_imx93/phycore-imx93.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/board/phytec/phycore_imx93/phycore-imx93.c b/board/ 
>>> phytec/phycore_imx93/phycore-imx93.c
>>> index c6a4e923b074..cfc6d91f20f2 100644
>>> --- a/board/phytec/phycore_imx93/phycore-imx93.c
>>> +++ b/board/phytec/phycore_imx93/phycore-imx93.c
>>> @@ -38,6 +38,8 @@ int board_late_init(void)
>>>       switch (get_boot_device()) {
>>>       case SD2_BOOT:
>>>           env_set_ulong("mmcdev", 1);
>>> +        if (!env_get("boot_targets"))
>>> +            env_set("boot_targets", "mmc1 mmc0 ethernet");
>>
>> I guess you don't define boot_targets in your env so you don't need to 
>> check for default env here?
> 
> This check ensures that if the user manually defines boot_targets in the
> environment, we don’t overwrite it, as described in the commit message.
> 
> So the intent is to only set boot_targets when it is not already present
> in the env. This mirrors the behavior Benjamin implemented on the PHYTEC 
>   i.MX8M boards.

OK, thanks for explaining.

> 
> BR,
> Primoz
> 
>>
>> If so,
>>
>> Reviewed-by: Wadim Egorov <w.egorov at phytec.de>
>>
>>>           break;
>>>       case MMC1_BOOT:
>>>           env_set_ulong("mmcdev", 0);
>>
> 



More information about the U-Boot mailing list