diff mbox series

[U-Boot,22/53] binman: Add an image name into the fdtmap

Message ID 20190720182416.183626-23-sjg@chromium.org
State Accepted
Commit 1411ac8d162eaf97714b17848a2da7be1f01fa98
Delegated to: Simon Glass
Headers show
Series binman: Support replacing entries in an existing image | expand

Commit Message

Simon Glass July 20, 2019, 6:23 p.m. UTC
Since binman supports multiple images it is useful to know which one
created the image that has been read. Then it is possible to look up that
name in the 'master' device tree (containing the description of all
images).

Add a property for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/etype/fdtmap.py | 2 ++
 tools/binman/ftest.py        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Glass July 29, 2019, 9:22 p.m. UTC | #1
Since binman supports multiple images it is useful to know which one
created the image that has been read. Then it is possible to look up that
name in the 'master' device tree (containing the description of all
images).

Add a property for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/etype/fdtmap.py | 2 ++
 tools/binman/ftest.py        | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py
index 229b4a1bb69..a55c9c899bf 100644
--- a/tools/binman/etype/fdtmap.py
+++ b/tools/binman/etype/fdtmap.py
@@ -60,6 +60,7 @@  class Entry_fdtmap(Entry):
     Example output for a simple image with U-Boot and an FDT map:
 
     / {
+        image-name = "binman";
         size = <0x00000112>;
         image-pos = <0x00000000>;
         offset = <0x00000000>;
@@ -110,6 +111,7 @@  class Entry_fdtmap(Entry):
         fsw = libfdt.FdtSw()
         fsw.finish_reservemap()
         with fsw.add_node(''):
+            fsw.property_string('image-node', node.name)
             _AddNode(node)
         fdt = fsw.as_fdt()
 
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index 6a40d1fdbb4..08a1df03077 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -2369,7 +2369,7 @@  class TestFunctional(unittest.TestCase):
 '      u-boot            138     4  u-boot            38',
 '      u-boot-dtb        180   10f  u-boot-dtb        80          3c9',
 '    u-boot-dtb          500   %x  u-boot-dtb       400          3c9' % fdt_size,
-'  fdtmap                %x   395  fdtmap           %x' %
+'  fdtmap                %x   3b4  fdtmap           %x' %
         (fdtmap_offset, fdtmap_offset),
 '  image-header          bf8     8  image-header     bf8',
             ]