From 45c610d718bd605a1b3bdf99ec0386620b54b559 Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Wed, 1 Apr 2026 16:15:20 +0200 Subject: ofnode: add read_u64_array and count_elems_of_size These are similar to their Linux counterparts, adding helpers for reading arrays of 64-bit values with of_access and fdtdec implementations. Signed-off-by: Casey Connolly --- include/fdtdec.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/fdtdec.h') diff --git a/include/fdtdec.h b/include/fdtdec.h index d9fcd037ed2..3d199e56b03 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -700,6 +700,22 @@ int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name); 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 a u64 + * array of given length. The property must have at least enough data for + * the array (8*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: 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found, + * or -FDT_ERR_BADLAYOUT if not enough data + */ +int fdtdec_get_long_array(const void *blob, int node, const char *prop_name, + u64 *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 -- cgit v1.3.1