summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/binman.h7
-rw-r--r--lib/binman.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/include/binman.h b/include/binman.h
index e0b92075e2..8b89a9666d 100644
--- a/include/binman.h
+++ b/include/binman.h
@@ -43,6 +43,13 @@ int binman_entry_map(ofnode parent, const char *name, void **bufp, int *sizep);
void binman_set_rom_offset(int rom_offset);
/**
+ * binman_get_rom_offset() - Get the ROM memory-map offset
+ *
+ * @returns offset from an image_pos to the memory-mapped address
+ */
+int binman_get_rom_offset(void);
+
+/**
* binman_entry_find() - Find a binman symbol
*
* This searches the binman information in the device tree for a symbol of the
diff --git a/lib/binman.c b/lib/binman.c
index 7a8ad62c4a..79e497fc8d 100644
--- a/lib/binman.c
+++ b/lib/binman.c
@@ -43,7 +43,7 @@ static int binman_entry_find_internal(ofnode node, const char *name,
ret = ofnode_read_u32(node, "image-pos", &entry->image_pos);
if (ret)
- return log_msg_ret("import-pos", ret);
+ return log_msg_ret("image-pos", ret);
ret = ofnode_read_u32(node, "size", &entry->size);
if (ret)
return log_msg_ret("size", ret);
@@ -83,6 +83,11 @@ void binman_set_rom_offset(int rom_offset)
binman->rom_offset = rom_offset;
}
+int binman_get_rom_offset(void)
+{
+ return binman->rom_offset;
+}
+
int binman_init(void)
{
binman = malloc(sizeof(struct binman_info));