summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2021-01-04 20:48:04 +0100
committerTom Rini <trini@konsulko.com>2021-01-05 08:21:48 -0500
commitd8ab0fe5b5993fb8cecb5f018b7265bad0026e46 (patch)
tree3f3b6be27a3f5e2d67abaf3e47f105b0efd14488 /common
parentf14e6eec6c7fe5c0a77491bdb62961ae8dacb503 (diff)
image: support board_fit_config_name_match
Support reusing board_fit_config_name_match() to automatically select a sensible default configuration for booting fitImages using 'bootm'. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'common')
-rw-r--r--common/image-fit.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/common/image-fit.c b/common/image-fit.c
index 097cd38af0..6a8787ca0a 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1738,12 +1738,19 @@ 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");
- conf_uname = (char *)fdt_getprop(fit, confs_noffset,
- FIT_DEFAULT_PROP, &len);
- if (conf_uname == NULL) {
- fit_get_debug(fit, confs_noffset, FIT_DEFAULT_PROP,
- len);
- return len;
+ if (!host_build() && IS_ENABLED(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) {
+ fit_get_debug(fit, confs_noffset, FIT_DEFAULT_PROP,
+ len);
+ return len;
+ }
}
debug("Found default configuration: '%s'\n", conf_uname);
}