diff options
| author | Caleb Connolly <[email protected]> | 2025-04-11 14:47:38 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-05-02 08:38:02 -0600 |
| commit | 993a9db918af451c68851522c8770e582b717629 (patch) | |
| tree | bb2407b5b6ee6d5a263b4262506b0247ee511c30 /lib | |
| parent | 45acd9d2d4ec84775d09c73aab75a4fd989beb41 (diff) | |
event: signal when livetree has been built
OF_LIVE offers a variety of benefits, one of them being that the live
tree can be modified without caring about the underlying FDT. This is
particularly valuable for working around U-Boot limitations like lacking
USB superspeed support on Qualcomm platforms, no runtime OTG, or
peripherals like the sdcard being broken (and displaying potentially
worrying error messages).
Add an event to signal when the live tree has been built so that we can
apply fixups to it directly before devices are bound.
Signed-off-by: Caleb Connolly <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/of_live.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/of_live.c b/lib/of_live.c index 90b9459ede3..c1620616513 100644 --- a/lib/of_live.c +++ b/lib/of_live.c @@ -11,6 +11,7 @@ #define LOG_CATEGORY LOGC_DT #include <abuf.h> +#include <event.h> #include <log.h> #include <linux/libfdt.h> #include <of_live.h> @@ -321,6 +322,7 @@ int unflatten_device_tree(const void *blob, struct device_node **mynodes) int of_live_build(const void *fdt_blob, struct device_node **rootp) { int ret; + union event_data evt; debug("%s: start\n", __func__); ret = unflatten_device_tree(fdt_blob, rootp); @@ -335,6 +337,15 @@ int of_live_build(const void *fdt_blob, struct device_node **rootp) } debug("%s: stop\n", __func__); + if (CONFIG_IS_ENABLED(EVENT)) { + evt.of_live_built.root = *rootp; + ret = event_notify(EVT_OF_LIVE_BUILT, &evt, sizeof(evt)); + if (ret) { + log_debug("Failed to notify livetree build event: err=%d\n", ret); + return ret; + } + } + return ret; } |
