summaryrefslogtreecommitdiff
path: root/include/fdtdec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-17 06:59:26 +0300
committerTom Rini <trini@konsulko.com>2021-12-23 18:24:39 +0300
commitd893b8ad095f952829933c79b09345ae0c8ebd6b (patch)
tree33b98e5fde0c09a388da06f8734af0c158763fd8 /include/fdtdec.h
parentb4b6daf38d49c73f670bbf1654b568bca222fa79 (diff)
downloadu-boot-d893b8ad095f952829933c79b09345ae0c8ebd6b.tar.xz
fdt: Drop CONFIG_SPL_BUILD check in fdtdec_setup()
Move this to the header file to clean up the C code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdtdec.h')
-rw-r--r--include/fdtdec.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 6c7ab887b2..68786111a4 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -111,6 +111,20 @@ struct fdt_pci_addr {
extern u8 __dtb_dt_begin[]; /* embedded device tree blob */
extern u8 __dtb_dt_spl_begin[]; /* embedded device tree blob for SPL/TPL */
+/* Get a pointer to the embedded devicetree, if there is one, else NULL */
+static inline u8 *dtb_dt_embedded(void)
+{
+#ifdef CONFIG_OF_EMBED
+# ifdef CONFIG_SPL_BUILD
+ return __dtb_dt_spl_begin;
+# else
+ return __dtb_dt_begin;
+# endif
+#else
+ return NULL;
+#endif
+}
+
/**
* Compute the size of a resource.
*