diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-13 20:29:57 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-27 17:03:16 -0500 |
commit | 1e35a4d2282329093ae384bfbb8df844e23798c6 (patch) | |
tree | 7f6a4d78a00ac3510e0157c5b528a658dbba2a69 /lib | |
parent | 76b54d8ca159b217be976eef986b76e26409ea4a (diff) | |
download | u-boot-1e35a4d2282329093ae384bfbb8df844e23798c6.tar.gz |
binman: Allow reading entries from a subnode
Some images may have multiple copies of the same thing, e.g. two versions
of the read/write U-Boots. It is necessary to read data from one or other
of these under selection of the verified-boot logic. Add a function to
select the subnode to use.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/binman.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/binman.c b/lib/binman.c index b6d9dff5b7c..f415df30545 100644 --- a/lib/binman.c +++ b/lib/binman.c @@ -116,6 +116,24 @@ int binman_get_rom_offset(void) return binman->rom_offset; } +int binman_select_subnode(const char *name) +{ + ofnode node; + int ret; + + ret = find_image_node(&node); + if (ret) + return log_msg_ret("main", -ENOENT); + node = ofnode_find_subnode(node, name); + if (!ofnode_valid(node)) + return log_msg_ret("node", -ENOENT); + binman->image = node; + log_debug("binman: Selected image subnode '%s'\n", + ofnode_get_name(binman->image)); + + return 0; +} + int binman_init(void) { int ret; |