From db5e349d3ddfc75953b2364e94b111ea1795f3c8 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 31 Aug 2023 08:59:05 +0200 Subject: dm: core: ofnode: Add ofnode_read_bootscript_address() ofnode_read_bootscript_address() reads bootscript address from /options/u-boot DT node. bootscr-address or bootscr-ram-offset properties are read and values are filled. bootscr-address has higher priority than bootscr-ram-offset and the only one should be described in DT. Also add test to cover this new function. Reviewed-by: Simon Glass Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/23be3838502efef61803c90ef6e8b32bbd6ede41.1693465140.git.michal.simek@amd.com --- test/dm/ofnode.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index b74f5c2ebcf..621a4b4fa3c 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -583,6 +583,20 @@ static int dm_test_ofnode_conf(struct unit_test_state *uts) } DM_TEST(dm_test_ofnode_conf, 0); +static int dm_test_ofnode_options(struct unit_test_state *uts) +{ + u64 bootscr_address; + u64 bootscr_offset; + + ut_assertok(ofnode_read_bootscript_address(&bootscr_address, + &bootscr_offset)); + ut_asserteq_64(0, bootscr_address); + ut_asserteq_64(0x12345678, bootscr_offset); + + return 0; +} +DM_TEST(dm_test_ofnode_options, 0); + static int dm_test_ofnode_for_each_compatible_node(struct unit_test_state *uts) { const char compatible[] = "denx,u-boot-fdt-test"; -- cgit v1.2.3