diff options
author | Simon Glass <sjg@chromium.org> | 2022-07-30 15:52:31 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-08-12 08:17:11 -0400 |
commit | 98887ab802e4118e7c813e5e052678772fa1b3a8 (patch) | |
tree | d44b4041a2d15e73977641e508700770330076e1 /boot | |
parent | 569524741a01e1a96fc2b75dd7e5d12e41ce6c2b (diff) | |
download | u-boot-98887ab802e4118e7c813e5e052678772fa1b3a8.tar.gz |
event: Add an event for device tree fixups
At present there is a confusing array of functions that handle the
device tree fix-ups needed for booting an OS. We should be able to switch
to using events to clean this up.
As a first step, create a new event type and call it from the standard
place.
Note that this event uses the ofnode interface only, since this can
support live tree which is more efficient when making lots of updates.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/image-fdt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/boot/image-fdt.c b/boot/image-fdt.c index 9db2cee9942..5e5b24674d3 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -21,6 +21,7 @@ #include <linux/libfdt.h> #include <mapmem.h> #include <asm/io.h> +#include <dm/ofnode.h> #include <tee/optee.h> #ifndef CONFIG_SYS_FDT_PAD @@ -668,6 +669,16 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, goto err; } } + if (CONFIG_IS_ENABLED(EVENT)) { + struct event_ft_fixup fixup; + + fixup.tree = oftree_default(); + ret = event_notify(EVT_FT_FIXUP, &fixup, sizeof(fixup)); + if (ret) { + printf("ERROR: fdt fixup event failed: %d\n", ret); + goto err; + } + } /* Delete the old LMB reservation */ if (lmb) |