aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichal Simek2023-08-31 08:59:05 +0200
committerMichal Simek2023-09-21 13:20:11 +0200
commitdb5e349d3ddfc75953b2364e94b111ea1795f3c8 (patch)
tree993ebc7d3e58645baabfa8f1fae32193f4a405cf /test
parent99b46477e3495f819f6826d11470d46f12a4f9f7 (diff)
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 <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/23be3838502efef61803c90ef6e8b32bbd6ede41.1693465140.git.michal.simek@amd.com
Diffstat (limited to 'test')
-rw-r--r--test/dm/ofnode.c14
1 files changed, 14 insertions, 0 deletions
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";