[PATCH 2/2] board: ti: am57xx: Set fdtfile from C code instead of findfdt script
Anurag Dutta
a-dutta at ti.com
Fri Apr 25 07:34:31 CEST 2025
We now can provide a map and have the standard fdtfile variable set from
code itself. This allows for bootstd to "just work".
While at this, replace findfdt in environment with a warning as it is no
longer needed.
Signed-off-by: Anurag Dutta <a-dutta at ti.com>
---
board/ti/am57xx/board.c | 19 ++++++++++++++++
include/configs/ti_omap5_common.h | 36 -------------------------------
2 files changed, 19 insertions(+), 36 deletions(-)
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index fc0d87daae4..a807c2a5464 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -42,6 +42,7 @@
#include "../common/board_detect.h"
#include "../common/cape_detect.h"
+#include "../common/fdt_ops.h"
#include "mux_data.h"
#ifdef CONFIG_SUPPORT_EMMC_BOOT
@@ -577,6 +578,23 @@ void do_board_detect(void)
"Board: %s REV %s\n", bname, board_ti_get_rev());
}
+static struct ti_fdt_map ti_omap_am57_evm_fdt_map[] = {
+ {"omap5_uevm", "ti/omap/omap5-uevm.dtb"},
+ {"dra7xx", "ti/omap/dra7-evm.dtb"},
+ {"dra72x-revc", "ti/omap/dra72-evm-revc.dtb"},
+ {"dra72x", "ti/omap/dra72-evm.dtb"},
+ {"dra71x", "ti/omap/dra71-evm.dtb"},
+ {"dra76x_acd", "ti/omap/dra76-evm.dtb"},
+ {"beagle_x15", "ti/omap/am57xx-beagle-x15.dtb"},
+ {"beagle_x15_revb1", "ti/omap/am57xx-beagle-x15-revb1.dtb"},
+ {"beagle_x15_revc", "ti/omap/am57xx-beagle-x15-revc.dtb"},
+ {"am5729_beagleboneai", "ti/omap/am5729-beagleboneai.dtb"},
+ {"am572x_idk", "ti/omap/am572x-idk.dtb"},
+ {"am574x_idk", "ti/omap/am574x-idk.dtb"},
+ {"am57xx_evm", "ti/omap/am57xx-beagle-x15.dtb"},
+ {"am57xx_evm_reva3", "ti/omap/am57xx-beagle-x15.dtb"},
+ {"am571x_idk", "ti/omap/am571x-idk.dtb"},
+};
static void setup_board_eeprom_env(void)
{
char *name = "beagle_x15";
@@ -614,6 +632,7 @@ static void setup_board_eeprom_env(void)
invalid_eeprom:
set_board_info_env(name);
+ ti_set_fdt_env(name, ti_omap_am57_evm_fdt_map);
}
#endif /* CONFIG_XPL_BUILD */
diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h
index 39102f15eb9..a0aaf750788 100644
--- a/include/configs/ti_omap5_common.h
+++ b/include/configs/ti_omap5_common.h
@@ -204,41 +204,6 @@
"exit; " \
"fi;\0"
-#define DEFAULT_FDT_TI_ARGS \
- "findfdt="\
- "if test $board_name = omap5_uevm; then " \
- "setenv fdtfile omap5-uevm.dtb; fi; " \
- "if test $board_name = dra7xx; then " \
- "setenv fdtfile dra7-evm.dtb; fi;" \
- "if test $board_name = dra72x-revc; then " \
- "setenv fdtfile dra72-evm-revc.dtb; fi;" \
- "if test $board_name = dra72x; then " \
- "setenv fdtfile dra72-evm.dtb; fi;" \
- "if test $board_name = dra71x; then " \
- "setenv fdtfile dra71-evm.dtb; fi;" \
- "if test $board_name = dra76x_acd; then " \
- "setenv fdtfile dra76-evm.dtb; fi;" \
- "if test $board_name = beagle_x15; then " \
- "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
- "if test $board_name = beagle_x15_revb1; then " \
- "setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;" \
- "if test $board_name = beagle_x15_revc; then " \
- "setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;" \
- "if test $board_name = am5729_beagleboneai; then " \
- "setenv fdtfile am5729-beagleboneai.dtb; fi;" \
- "if test $board_name = am572x_idk; then " \
- "setenv fdtfile am572x-idk.dtb; fi;" \
- "if test $board_name = am574x_idk; then " \
- "setenv fdtfile am574x-idk.dtb; fi;" \
- "if test $board_name = am57xx_evm; then " \
- "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
- "if test $board_name = am57xx_evm_reva3; then " \
- "setenv fdtfile am57xx-beagle-x15.dtb; fi;" \
- "if test $board_name = am571x_idk; then " \
- "setenv fdtfile am571x-idk.dtb; fi;" \
- "if test $fdtfile = undefined; then " \
- "echo WARNING: Could not determine device tree to use; fi; \0"
-
#define GET_OVERLAY_MMC_TI_ARGS \
"get_overlay_mmc=" \
"fdt address ${fdtaddr};" \
@@ -278,7 +243,6 @@
DEFAULT_FIT_TI_ARGS \
"get_fit_config=setenv name_fit_config ${fdtfile}\0" \
DEFAULT_COMMON_BOOT_TI_ARGS \
- DEFAULT_FDT_TI_ARGS \
GET_OVERLAY_MMC_TI_ARGS \
DFUARGS \
NETARGS \
--
2.34.1
More information about the U-Boot
mailing list