aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-11 09:47:15 -0600
committerSimon Glass <sjg@chromium.org>2022-10-17 21:17:13 -0600
commit33ba72700b586babfad7f5ef1e408b6b399fe0ec (patch)
tree7472327c1a61f45e29ce7952d5a770354919aa15
parent0718c3154c428b694bff94fab178bc2c43ce3ff9 (diff)
downloadu-boot-33ba72700b586babfad7f5ef1e408b6b399fe0ec.zip
u-boot-33ba72700b586babfad7f5ef1e408b6b399fe0ec.tar.gz
u-boot-33ba72700b586babfad7f5ef1e408b6b399fe0ec.tar.bz2
boot: Pass the correct FDT to the EVT_FT_FIXUP event
Now that we support multiple device trees with the ofnode interface, we can pass the correct FDT to this event. This allows the 'working' FDT to be fixed up, as expected, so long as OFNODE_MULTI_TREE is enabled. Also make sure we don't try to do this with livetree, which does not support fixups yet. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--boot/image-fdt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index f651940..b830a0a 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -665,15 +665,18 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob,
goto err;
}
}
- if (CONFIG_IS_ENABLED(EVENT)) {
+ if (!of_live_active() && CONFIG_IS_ENABLED(EVENT)) {
struct event_ft_fixup fixup;
- fixup.tree = oftree_default();
+ fixup.tree = oftree_from_fdt(blob);
fixup.images = images;
- ret = event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup));
- if (ret) {
- printf("ERROR: fdt fixup event failed: %d\n", ret);
- goto err;
+ if (oftree_valid(fixup.tree)) {
+ ret = event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup));
+ if (ret) {
+ printf("ERROR: fdt fixup event failed: %d\n",
+ ret);
+ goto err;
+ }
}
}