[PATCH 1/3] image: support board_fit_config_name_match

Sebastian Reichel sebastian.reichel at collabora.com
Tue Dec 8 19:10:11 CET 2020


Support reusing board_fit_config_name_match() to automatically
select a sensible default configuration for booting fitImages
using 'bootm'.

Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
 common/image-fit.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/common/image-fit.c b/common/image-fit.c
index c82d4d8015f0..52c194222735 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1741,6 +1741,12 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
 	if (conf_uname == NULL) {
 		/* get configuration unit name from the default property */
 		debug("No configuration specified, trying default...\n");
+#if !defined(USE_HOSTCC) && defined(CONFIG_MULTI_DTB_FIT)
+		noffset = fit_find_config_node(fit);
+		if (noffset < 0)
+			return noffset;
+		conf_uname = fdt_get_name(fit, noffset, NULL);
+#else
 		conf_uname = (char *)fdt_getprop(fit, confs_noffset,
 						 FIT_DEFAULT_PROP, &len);
 		if (conf_uname == NULL) {
@@ -1748,6 +1754,7 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
 				      len);
 			return len;
 		}
+#endif
 		debug("Found default configuration: '%s'\n", conf_uname);
 	}
 
-- 
2.29.2



More information about the U-Boot mailing list