diff options
author | Simon Glass <sjg@chromium.org> | 2019-07-20 12:23:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-07-29 09:38:05 -0600 |
commit | 589d8f917e718f702142d1fdba51723d45237b44 (patch) | |
tree | 0239e6d0adb0965ac7bef1b51ca96e1c5879c243 /tools | |
parent | e44bc831e262c2ca7f307ad12074c2eb9adab615 (diff) | |
download | u-boot-589d8f917e718f702142d1fdba51723d45237b44.tar.gz u-boot-589d8f917e718f702142d1fdba51723d45237b44.tar.bz2 u-boot-589d8f917e718f702142d1fdba51723d45237b44.zip |
binman: Store image fdtmap when loading from a file
This data provides all the information about the position and size of each
entry. Store it for later use when loading an image. It can be reused as
is if the image is modified without changing offsets/sizes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/binman/image.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py index fb6e591ca6..232e752258 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -32,6 +32,9 @@ class Image(section.Entry_section): Attributes: filename: Output filename for image + image_node: Name of node containing the description for this image + fdtmap_dtb: Fdt object for the fdtmap when loading from a file + fdtmap_data: Contents of the fdtmap when loading from a file Args: test: True if this is being called from a test of Images. This this case @@ -44,6 +47,8 @@ class Image(section.Entry_section): self.name = 'main-section' self.image_name = name self._filename = '%s.bin' % self.image_name + self.fdtmap_dtb = None + self.fdtmap_data = None if not test: filename = fdt_util.GetString(self._node, 'filename') if filename: @@ -82,7 +87,11 @@ class Image(section.Entry_section): dtb.Scan() # Return an Image with the associated nodes - image = Image('image', dtb.GetRoot()) + root = dtb.GetRoot() + image = Image('image', root) + image.image_node = fdt_util.GetString(root, 'image-node', 'image') + image.fdtmap_dtb = dtb + image.fdtmap_data = fdtmap_data image._data = data return image |