Skip to contentSkip to conversation

environment: ti: Add get_fit_config command to get FIT config string

PATCH In review Andrew Davis 2 participants 3 messages Apr 25, 2023 – May 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 environment: ti: Add get_fit_config command to get FIT config string

When OE is packaging a dtb file into the FIT image it names the node based on the dtb filename. Node names can't have "/" so it is turned into "_". We select our FIT config using the "fdtfile" env var so we don't duplicate the board_name to fdt logic. Result is fdtfile needs mangled when used to select a config node from OE made FIT image. Do this here.

---
 include/configs/ti_armv7_common.h          | 3 ++-
 include/environment/ti/ti_armv7_common.env | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
include/configs/ti_armv7_common.h +2 -1
index d54c208ef66..149a74d98e8 100644
@@ -55,7 +55,8 @@
 		"do;" \
 		"setenv overlaystring ${overlaystring}'#'${overlay};" \
 		"done;\0" \
-	"run_fit=bootm ${addr_fit}#conf-${fdtfile}${overlaystring}\0" \
+	"get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}\0" \
+	"run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}\0" \
 
 /*
  * DDR information.  If the CONFIG_NR_DRAM_BANKS is not defined,
include/environment/ti/ti_armv7_common.env +2 -1
index 4d334648c05..0c0929d8628 100644
@@ -20,5 +20,6 @@ get_overlaystring=
 	do;
 	setenv overlaystring ${overlaystring}'#'${overlay};
 	done;
-run_fit=bootm ${addr_fit}#conf-${fdtfile}${overlaystring}
+get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
+run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
 
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Davis

When OE is packaging a dtb file into the FIT image it names the node based on the dtb filename. Node names can't have "/" so it is turned into "_". We select our FIT config using the "fdtfile" env var so we don't duplicate the board_name to fdt logic. Result is fdtfile needs mangled when used to select a config node from OE made FIT image. Do this here.

Thanks for getting this done!

Signature · 1 line
Tom
#2 lore raw
In reply to Andrew Davis
Quoted 8 lines · Andrew Davis

When OE is packaging a dtb file into the FIT image it names the node based on the dtb filename. Node names can't have "/" so it is turned into "_". We select our FIT config using the "fdtfile" env var so we don't duplicate the board_name to fdt logic. Result is fdtfile needs mangled when used to select a config node from OE made FIT image. Do this here.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom