From ef50f542dfceafe930cb694b35b5c560f12b9a30 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 18 Oct 2021 15:15:49 +0200 Subject: colibri-imx8x: set the soc env variable according to fuses Move from using cfgblock information for setting the soc environment variable to use fuse information. This allows using the correct device tree even if the config block is not available. Signed-off-by: Max Krummenacher --- board/toradex/colibri-imx8x/colibri-imx8x.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c index e98ddd2679..84e44ddafe 100644 --- a/board/toradex/colibri-imx8x/colibri-imx8x.c +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c @@ -174,26 +174,14 @@ static void init_gpio_expander(void) static void select_dt_from_module_version(void) { - switch (tdx_hw_tag.prodid) { - /* Select Colibri iMX8QXP device trees */ - case COLIBRI_IMX8QXP_WIFI_BT_IT: - case COLIBRI_IMX8QXP_IT: - env_set("soc", "imx8qxp"); - break; - - /* Select Colibri iMX8DX device trees */ - case COLIBRI_IMX8DX_WIFI_BT: - case COLIBRI_IMX8DX: - env_set("soc", "imx8dx"); - break; - default: - printf("Unknown Colibri iMX8x module\n"); - return; - } - -#ifndef CONFIG_ENV_IS_NOWHERE - env_save(); -#endif + /* + * The dtb filename is constructed from ${soc}-colibri-${fdt_board}.dtb. + * Set soc depending on the used SoC. + */ + if (is_imx8dx()) + env_set("soc", "imx8dx"); + else + env_set("soc", "imx8qxp"); } int board_init(void) -- cgit v1.2.3