summaryrefslogtreecommitdiff
path: root/include/fdtdec.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-02-27 13:26:01 -0700
committerSimon Glass <sjg@chromium.org>2014-03-17 20:05:46 -0600
commit006e73b9cafde9287912c4699091f3b1f07d3f97 (patch)
tree02b5a8fbde25e8ae45112b7a82f7eb005c530232 /include/fdtdec.h
parentcecb19c03f5a7abed2e8ff691bc849bdc3c4ed2c (diff)
downloadu-boot-imx-006e73b9cafde9287912c4699091f3b1f07d3f97.zip
u-boot-imx-006e73b9cafde9287912c4699091f3b1f07d3f97.tar.gz
u-boot-imx-006e73b9cafde9287912c4699091f3b1f07d3f97.tar.bz2
cros_ec: Add a function for reading a flash map entry
A flash map describes the layout of flash memory in terms of offsets and sizes for each region. Add a function to read a flash map entry from the device tree. Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/fdtdec.h')
-rw-r--r--include/fdtdec.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 19bab79..aa695df 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -530,4 +530,22 @@ const u8 *fdtdec_locate_byte_array(const void *blob, int node,
*/
int fdtdec_decode_region(const void *blob, int node,
const char *prop_name, void **ptrp, size_t *size);
+
+/* A flash map entry, containing an offset and length */
+struct fmap_entry {
+ uint32_t offset;
+ uint32_t length;
+};
+
+/**
+ * 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);
#endif