
On Fri, 25 Aug 2023 at 03:37, Michal Simek michal.simek@amd.com wrote:
Add helper function to allow reading a single indexed u64 value from a device-tree property containing multiple u64 values, that is an array of u64's.
Co-developed-by: Ashok Reddy Soma ashok.reddy.soma@amd.com Signed-off-by: Ashok Reddy Soma ashok.reddy.soma@amd.com Signed-off-by: Michal Simek michal.simek@amd.com
Changes in v2:
- fix kernel-doc for of_read_u64_index()
- add missing test reported by Simon
- fix debug print to print 64bit value
- convert of_read_u64 to use of_read_u64_index() as is done also for u32 version
- fix overflow size calculation
Tested on sandbox: make defconfig && make -j8 && ./u-boot --fdt arch/sandbox/dts/test.dtb --command "ut dm ofnode_u64" -v
Test: dm_test_ofnode_u64: ofnode.c Test: dm_test_ofnode_u64: ofnode.c (flat tree) Failures: 0
Based on v2023.07 tag.
arch/sandbox/dts/test.dts | 1 + drivers/core/of_access.c | 16 ++++++++++++---- drivers/core/ofnode.c | 30 ++++++++++++++++++++++++++++++ include/dm/of_access.h | 19 +++++++++++++++++++ include/dm/ofnode.h | 12 ++++++++++++ test/dm/ofnode.c | 8 ++++++++ 6 files changed, 82 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org