summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Include
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-02-15 10:30:33 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-02-21 10:53:08 +0000
commit44e6186eeadf8738d72a6e34b1ce75d1265d86fd (patch)
tree0cc8f09ff8fc32549e16266935b88d747cb5978b /EmbeddedPkg/Include
parent6461344c318cd43a5494c0302e142a0cbe386d52 (diff)
downloadedk2-44e6186eeadf8738d72a6e34b1ce75d1265d86fd.tar.gz
edk2-44e6186eeadf8738d72a6e34b1ce75d1265d86fd.tar.bz2
edk2-44e6186eeadf8738d72a6e34b1ce75d1265d86fd.zip
EmbeddedPkg/FdtLib: incorporate missing overlay support
Commit a099239015eb ("EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5") updated our FdtLib implementation to a more recent upstream version, but omitted fdt_overlay.c due to its ambiguous licensing situation. This has been resolved now, so take the latest upstream version of the file (which received no other modifications in the mean time) and add it to FdtLib. Note that fdt_overlay.c has a dependency on strtoul() which EDK does not provide natively, so add a private implementation that wraps the BaseLib routines that do roughly the same. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'EmbeddedPkg/Include')
-rw-r--r--EmbeddedPkg/Include/libfdt.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/EmbeddedPkg/Include/libfdt.h b/EmbeddedPkg/Include/libfdt.h
index 1aabec37f6..141ecb579b 100644
--- a/EmbeddedPkg/Include/libfdt.h
+++ b/EmbeddedPkg/Include/libfdt.h
@@ -1859,6 +1859,37 @@ int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
*/
int fdt_del_node(void *fdt, int nodeoffset);
+/**
+ * fdt_overlay_apply - Applies a DT overlay on a base DT
+ * @fdt: pointer to the base device tree blob
+ * @fdto: pointer to the device tree overlay blob
+ *
+ * fdt_overlay_apply() will apply the given device tree overlay on the
+ * given base device tree.
+ *
+ * Expect the base device tree to be modified, even if the function
+ * returns an error.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
+ * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
+ * properties in the base DT
+ * -FDT_ERR_BADPHANDLE,
+ * -FDT_ERR_BADOVERLAY,
+ * -FDT_ERR_NOPHANDLES,
+ * -FDT_ERR_INTERNAL,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADOFFSET,
+ * -FDT_ERR_BADPATH,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_overlay_apply(void *fdt, void *fdto);
+
/**********************************************************************/
/* Debugging / informational functions */
/**********************************************************************/