From ebd108076039578d77cb591ec473290ebb7a6712 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Thu, 21 Oct 2021 17:02:18 +0200 Subject: colibri-imx8x: make select_dt_from_module_version a command When booting the Toradex Easy Installer from USB recovery select_dt_from_module_version is not automatically executed and thus ${soc} is not set correctly. Make the function available as a cli command so it can be executed as part of the bootcmd_mfg. Signed-off-by: Max Krummenacher --- board/toradex/colibri-imx8x/colibri-imx8x.c | 11 +++++++++++ include/configs/colibri-imx8x.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index 84e44ddafe..0758ad3f57 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -184,6 +184,17 @@ static void select_dt_from_module_version(void) env_set("soc", "imx8qxp"); } +static int do_select_dt_from_module_version(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) { + select_dt_from_module_version(); + return 0; +} + +U_BOOT_CMD( + select_dt_from_module_version, CONFIG_SYS_MAXARGS, 1, do_select_dt_from_module_version, + "\n", " - select devicetree from module version" +); + int board_init(void) { init_gpio_expander(); diff --git a/include/configs/colibri-imx8x.h b/include/configs/colibri-imx8x.h index 13bdf3f760..a884a794b0 100644 --- a/include/configs/colibri-imx8x.h +++ b/include/configs/colibri-imx8x.h @@ -85,7 +85,7 @@ MEM_LAYOUT_ENV_SETTINGS \ "boot_scripts=" BOOT_SCRIPT "\0" \ "boot_script_dhcp=" BOOT_SCRIPT "\0" \ - "bootcmd_mfg=fastboot 0\0" \ + "bootcmd_mfg=select_dt_from_module_version && fastboot 0\0" \ "console=ttyLP3,115200 earlycon=lpuart32,0x5a090000,115200\0" \ "fdt_addr=0x83000000\0" \ "fdt_high=\0" \ -- cgit v1.2.3