summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-11-10 18:00:19 -0700
committerSimon Glass <sjg@chromium.org>2014-11-21 07:24:11 +0100
commita9f04d49e519383f98689d603facdee227a2f94d (patch)
tree1b218e35a8b8c0789a119edcdb06c87ba78e62e5 /include
parent768e0f52f2d1a9d19842c8d1ded22a96b080a266 (diff)
downloadu-boot-imx-a9f04d49e519383f98689d603facdee227a2f94d.zip
u-boot-imx-a9f04d49e519383f98689d603facdee227a2f94d.tar.gz
u-boot-imx-a9f04d49e519383f98689d603facdee227a2f94d.tar.bz2
fdt: Add a function to decode a variable-sized u32 array
Sometimes an array can be of variable size up to a maximum. Add a helper function to decode this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/fdtdec.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 4ae77be..6b40006 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -445,6 +445,22 @@ int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
u32 *array, int count);
/**
+ * Look up a property in a node and return its contents in an integer
+ * array of given length. The property must exist but may have less data that
+ * expected (4*count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @param array array to fill with data
+ * @param count number of array elements
+ * @return number of array elements if ok, or -FDT_ERR_NOTFOUND if the
+ * property is not found
+ */
+int fdtdec_get_int_array_count(const void *blob, int node,
+ const char *prop_name, u32 *array, int count);
+
+/**
* Look up a property in a node and return a pointer to its contents as a
* unsigned int array of given length. The property must have at least enough
* data for the array ('count' cells). It may have more, but this will be