aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-27 18:46:20 -0600
committerSimon Glass <sjg@chromium.org>2020-10-29 14:42:17 -0600
commit83187546ae14e266c745c3bb24db492eb5433b89 (patch)
tree95c7399f48b303507f2a5faa68c4e5dfd81bf586
parentf4f4123708cd3699aa3981afca9511beb760c7fb (diff)
downloadu-boot-83187546ae14e266c745c3bb24db492eb5433b89.zip
u-boot-83187546ae14e266c745c3bb24db492eb5433b89.tar.gz
u-boot-83187546ae14e266c745c3bb24db492eb5433b89.tar.bz2
binman: Support multiple images in the library
Add support for multiple images, since these are used on x86 now. Select the first image for now, since that is generally the correct one. At some point we can add a way to determine which image is currently running. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--lib/binman.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/binman.c b/lib/binman.c
index 79e497f..e71c1b9 100644
--- a/lib/binman.c
+++ b/lib/binman.c
@@ -96,6 +96,13 @@ int binman_init(void)
binman->image = ofnode_path("/binman");
if (!ofnode_valid(binman->image))
return log_msg_ret("binman node", -EINVAL);
+ if (ofnode_read_bool(binman->image, "multiple-images")) {
+ ofnode node = ofnode_first_subnode(binman->image);
+
+ if (!ofnode_valid(node))
+ return log_msg_ret("first image", -ENOENT);
+ binman->image = node;
+ }
binman->rom_offset = ROM_OFFSET_NONE;
return 0;