[PATCH 08/12] binman: Support multiple images in the library

Simon Glass sjg at chromium.org
Mon Sep 28 02:46:20 CEST 2020


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 at chromium.org>
---

 lib/binman.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/binman.c b/lib/binman.c
index 79e497fc8de..e71c1b9e992 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;
-- 
2.28.0.681.g6f77f65b4e-goog



More information about the U-Boot mailing list