summaryrefslogtreecommitdiff
path: root/lib/binman.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/binman.c')
-rw-r--r--lib/binman.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/binman.c b/lib/binman.c
index b6d9dff5b7..f415df3054 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;