colibri_vf: use preboot for fdtfile evaluation
authorIgor Opaniuk <igor.opaniuk@toradex.com>
Mon, 14 Sep 2020 08:01:09 +0000 (11:01 +0300)
committerStefano Babic <sbabic@denx.de>
Thu, 17 Sep 2020 12:39:09 +0000 (14:39 +0200)
Enable and set preboot var with fdtfile evaluation.
preboot will be checked and run immediately before starting the
CONFIG_BOOTDELAY countdown and/or running the auto-boot command resp.
entering interactive mode.

This provides possibility to use different boot cmds in interactive mode
without manual setting fdtfile value, as it it's already evaluated
before entering interactive mode.

Fixes: 304042c1f3("colibri_vf: set fdtfile for distroboot")
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
configs/colibri_vf_defconfig
include/configs/colibri_vf.h

index b145b9f..def64b1 100644 (file)
@@ -11,6 +11,8 @@ CONFIG_TARGET_COLIBRI_VF=y
 CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri"
 CONFIG_ENV_VARS_UBOOT_CONFIG=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND"
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv fdtfile ${soc}-colibri-${fdt_board}.dtb"
 CONFIG_BOOTDELAY=1
 CONFIG_LOGLEVEL=3
 CONFIG_VERSION_VARIABLE=y
index 86d4621..cae7c14 100644 (file)
@@ -76,8 +76,7 @@
        "ubi read ${fdt_addr_r} dtb && " \
        "run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}\0" \
 
-#define CONFIG_BOOTCOMMAND "run ubiboot; " \
-       "setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;"
+#define CONFIG_BOOTCOMMAND "run ubiboot || run distro_bootcmd;"
 
 #define BOOT_TARGET_DEVICES(func) \
        func(MMC, mmc, 0) \