diff options
author | Simon Glass | 2021-12-16 20:59:26 -0700 |
---|---|---|
committer | Tom Rini | 2021-12-23 10:24:39 -0500 |
commit | d893b8ad095f952829933c79b09345ae0c8ebd6b (patch) | |
tree | 33b98e5fde0c09a388da06f8734af0c158763fd8 /include/fdtdec.h | |
parent | b4b6daf38d49c73f670bbf1654b568bca222fa79 (diff) |
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.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h index 6c7ab887b20..68786111a44 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. * |