summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-16 11:40:54 -0600
committerTom Rini <[email protected]>2025-12-16 11:40:54 -0600
commita333d9e59f6675c9541c34643f334dbf50898647 (patch)
tree1b1a527bbc4d2fbe2fe6a0a0c68fbe3c0b405111 /boot
parent417254ff08ef6647fd73c6963c95ba06015699df (diff)
parent6c7d3ba292c648c9075eb0b82278a844bb1ff953 (diff)
Merge patch series "fit: print conf node compatibles + use property string constants"
Quentin Schulz <[email protected]> says: This does a bit of "cleanup" by reusing constants for some FIT properties instead of having the same string in multiple places. Additionally, this adds a new constant for the compatible property in FIT configuration nodes[1] which is useful for FIT images with multiple FIT configuration nodes to support multiple devices in the same blob. U-Boot will try to figure out which node to select based on that compatible[2]. However, if this property is missing (and the first blob in the fdt property of the configuration node is uncompressed), the compatible from the root node of the associated kernel FDT will be used for the autoselection mechanism. For now, I only print the property if it exists, but maybe it'd make sense to expose the fallback one if it's missing. I guess we can implement that later on if desired. [1] https://fitspec.osfw.foundation/#optional-properties compatible paragraph [2] https://fitspec.osfw.foundation/#select-a-configuration-to-boot Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'boot')
-rw-r--r--boot/common_fit.c4
-rw-r--r--boot/image-fit.c15
2 files changed, 15 insertions, 4 deletions
diff --git a/boot/common_fit.c b/boot/common_fit.c
index a2f9b8d83c3..fd434fe28e1 100644
--- a/boot/common_fit.c
+++ b/boot/common_fit.c
@@ -46,12 +46,12 @@ int fit_find_config_node(const void *fdt)
return -EINVAL;
}
- dflt_conf_name = fdt_getprop(fdt, conf, "default", &len);
+ dflt_conf_name = fdt_getprop(fdt, conf, FIT_DEFAULT_PROP, &len);
for (node = fdt_first_subnode(fdt, conf);
node >= 0;
node = fdt_next_subnode(fdt, node)) {
- name = fdt_getprop(fdt, node, "description", &len);
+ name = fdt_getprop(fdt, node, FIT_DESC_PROP, &len);
if (!name) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: Missing FDT description in DTB\n",
diff --git a/boot/image-fit.c b/boot/image-fit.c
index f47f37471c0..2d040e38d97 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -328,6 +328,17 @@ static void fit_conf_print(const void *fit, int noffset, const char *p)
printf("%s\n", uname);
}
+ for (fdt_index = 0;
+ uname = fdt_stringlist_get(fit, noffset, FIT_COMPAT_PROP,
+ fdt_index, NULL), uname;
+ fdt_index++) {
+ if (fdt_index == 0)
+ printf("%s Compatible: ", p);
+ else
+ printf("%s ", p);
+ printf("%s\n", uname);
+ }
+
uname = fdt_getprop(fit, noffset, FIT_FPGA_PROP, NULL);
if (uname)
printf("%s FPGA: %s\n", p, uname);
@@ -1761,11 +1772,11 @@ int fit_conf_find_compat(const void *fit, const void *fdt)
continue;
/* If there's a compat property in the config node, use that. */
- if (fdt_getprop(fit, noffset, "compatible", NULL)) {
+ if (fdt_getprop(fit, noffset, FIT_COMPAT_PROP, NULL)) {
fdt = fit; /* search in FIT image */
compat_noffset = noffset; /* search under config node */
} else { /* Otherwise extract it from the kernel FDT. */
- kfdt_name = fdt_getprop(fit, noffset, "fdt", &len);
+ kfdt_name = fdt_getprop(fit, noffset, FIT_FDT_PROP, &len);
if (!kfdt_name) {
debug("No fdt property found.\n");
continue;