summaryrefslogtreecommitdiff
path: root/include/fdtdec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-12-17 06:59:33 +0300
committerTom Rini <trini@konsulko.com>2021-12-23 18:24:40 +0300
commit39605c6ec3618a848a4a1c4063d474270deab442 (patch)
tree76ee12b767057ed463c64455085f88d3e73b2e1f /include/fdtdec.h
parent6476c4d9818beac88610f18ff3c3cb05c7a1f33b (diff)
downloadu-boot-39605c6ec3618a848a4a1c4063d474270deab442.tar.xz
fdt: Record where the devicetree came from
Keep track of where the devicetree came from, so we can report this later. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdtdec.h')
-rw-r--r--include/fdtdec.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 68a36f1058..09525ce510 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -55,6 +55,31 @@ struct bd_info;
#define SPL_BUILD 0
#endif
+/**
+ * enum fdt_source_t - indicates where the devicetree came from
+ *
+ * These are listed in approximate order of desirability after FDTSRC_NONE
+ *
+ * @FDTSRC_SEPARATE: Appended to U-Boot. This is the normal approach if U-Boot
+ * is the only firmware being booted
+ * @FDTSRC_FIT: Found in a multi-dtb FIT. This should be used when U-Boot must
+ * select a devicetree from many options
+ * @FDTSRC_BOARD: Located by custom board code. This should only be used when
+ * the prior stage does not support FDTSRC_PASSAGE
+ * @FDTSRC_EMBED: Embedded into U-Boot executable. This should onyl be used when
+ * U-Boot is packaged as an ELF file, e.g. for debugging purposes
+ * @FDTSRC_ENV: Provided by the fdtcontroladdr environment variable. This should
+ * be used for debugging/development only
+ * @FDTSRC_NONE: No devicetree at all
+ */
+enum fdt_source_t {
+ FDTSRC_SEPARATE,
+ FDTSRC_FIT,
+ FDTSRC_BOARD,
+ FDTSRC_EMBED,
+ FDTSRC_ENV,
+};
+
/*
* Information about a resource. start is the first address of the resource
* and end is the last address (inclusive). The length of the resource will
@@ -1215,4 +1240,11 @@ int fdtdec_decode_ram_size(const void *blob, const char *area, int board_id,
phys_addr_t *basep, phys_size_t *sizep,
struct bd_info *bd);
+/**
+ * fdtdec_get_srcname() - Get the name of where the devicetree comes from
+ *
+ * @return source name
+ */
+const char *fdtdec_get_srcname(void);
+
#endif