summaryrefslogtreecommitdiff
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index be04598..33265ec 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -63,6 +63,8 @@ static const char * const compat_names[COMPAT_COUNT] = {
COMPAT(INFINEON_SLB9635_TPM, "infineon,slb9635-tpm"),
COMPAT(INFINEON_SLB9645_TPM, "infineon,slb9645-tpm"),
COMPAT(SAMSUNG_EXYNOS5_I2C, "samsung,exynos5-hsi2c"),
+ COMPAT(SANDBOX_HOST_EMULATION, "sandbox,host-emulation"),
+ COMPAT(SANDBOX_LCD_SDL, "sandbox,lcd-sdl"),
};
const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -619,3 +621,27 @@ int fdtdec_decode_region(const void *blob, int node,
debug("%s: size=%zx\n", __func__, *size);
return 0;
}
+
+/**
+ * Read a flash entry from the fdt
+ *
+ * @param blob FDT blob
+ * @param node Offset of node to read
+ * @param name Name of node being read
+ * @param entry Place to put offset and size of this node
+ * @return 0 if ok, -ve on error
+ */
+int fdtdec_read_fmap_entry(const void *blob, int node, const char *name,
+ struct fmap_entry *entry)
+{
+ u32 reg[2];
+
+ if (fdtdec_get_int_array(blob, node, "reg", reg, 2)) {
+ debug("Node '%s' has bad/missing 'reg' property\n", name);
+ return -FDT_ERR_NOTFOUND;
+ }
+ entry->offset = reg[0];
+ entry->length = reg[1];
+
+ return 0;
+}