diff options
author | Michal Simek <michal.simek@amd.com> | 2023-08-31 09:04:27 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@amd.com> | 2023-09-21 13:20:11 +0200 |
commit | 44f35e1aca706e7625aa2989911b4bc938681158 (patch) | |
tree | 480bb2b88f4bc8ba5daf8208e54574f509a798cf /test | |
parent | 771635f6b0f5bc71d85beb7d994b1c66bf36f6ff (diff) | |
download | u-boot-44f35e1aca706e7625aa2989911b4bc938681158.zip u-boot-44f35e1aca706e7625aa2989911b4bc938681158.tar.gz u-boot-44f35e1aca706e7625aa2989911b4bc938681158.tar.bz2 |
dm: core: ofnode: Add ofnode_read_bootscript_flash()
ofnode_read_bootscript_flash() reads bootscript address from
/options/u-boot DT node. bootscr-flash-offset and bootscr-flash-size
properties are read and values are filled. When bootscr-flash-size is not
defined, bootscr-flash-offset property is unusable that's why cleaned.
Both of these properties should be defined to function properly.
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/08a3e6c09cce13287c69ad370e409e7f1766b406.1693465465.git.michal.simek@amd.com
Diffstat (limited to 'test')
-rw-r--r-- | test/dm/ofnode.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index 621a4b4..d71faac 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -585,14 +585,19 @@ DM_TEST(dm_test_ofnode_conf, 0); static int dm_test_ofnode_options(struct unit_test_state *uts) { - u64 bootscr_address; - u64 bootscr_offset; + u64 bootscr_address, bootscr_offset; + u64 bootscr_flash_offset, bootscr_flash_size; ut_assertok(ofnode_read_bootscript_address(&bootscr_address, &bootscr_offset)); ut_asserteq_64(0, bootscr_address); ut_asserteq_64(0x12345678, bootscr_offset); + ut_assertok(ofnode_read_bootscript_flash(&bootscr_flash_offset, + &bootscr_flash_size)); + ut_asserteq_64(0, bootscr_flash_offset); + ut_asserteq_64(0x2000, bootscr_flash_size); + return 0; } DM_TEST(dm_test_ofnode_options, 0); |