]> git.ipfire.org Git - thirdparty/u-boot.git/commit
phytec: change preferred bootdevice dynamically
authorBenjamin Hahn <B.Hahn@phytec.de>
Fri, 28 Nov 2025 16:38:44 +0000 (17:38 +0100)
committerFabio Estevam <festevam@nabladev.com>
Sat, 29 Nov 2025 21:02:13 +0000 (18:02 -0300)
commit76612e93c3cd0422171a62ebddf3afc36d5cd9a2
tree28ca07e2d82f9efb9d75e8ccda5706dd2153cdb4
parent27d6ea356193badc418d79e27ce6cf33120aa743
phytec: change preferred bootdevice dynamically

We want to change the bootdevice dynamically, so that when booting
U-Boot from sdcard, kernel is also preferably booted from sdcard by
default. If the user decides to set their own bootorder, this should not
be overwritten. This was already implemented for imx8mp-libra-fpsc
board, but as we set the default value for boot_targets in devicetree
now, the env_get_default will return NULL. Also env_get might return
NULL when boot_targets is not set. A string compare with NULL is unsafe
and should be avoided. To fix this we only change the env value if the
variable was not set before (NULL), as this is the new default value.
In any other case the user has changed the value so it will not be
overwritten.
Also let standardboot set bootcmd automatically. For this
CONFIG_USE_BOOTCOMMAND needs to be activated.

Signed-off-by: Benjamin Hahn <B.Hahn@phytec.de>
board/phytec/imx8mp-libra-fpsc/imx8mp-libra-fpsc.c
board/phytec/phycore_imx8mm/phycore-imx8mm.c
board/phytec/phycore_imx8mp/phycore-imx8mp.c
board/phytec/phycore_imx8mp/phycore_imx8mp.env
configs/phycore-imx8mp_defconfig