]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/fdtdec.c
Merge branch 'u-boot/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / lib / fdtdec.c
index be045989026c1b09ee00112f08f284e54f60c49f..33265ecfb26cb3d378dc78141f1fd4680b0efe0b 100644 (file)
@@ -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;
+}