summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-11-02 22:55:43 +0300
committerSimon Glass <sjg@chromium.org>2020-11-05 19:11:31 +0300
commit271a08380634f2def4a6b148187cce6693e878a5 (patch)
tree42fbe4ecf47ff5e950425f76abe38d3189017000 /tools/binman/entry.py
parentde429d7b0962a91f91bbe921600745fb4608ece0 (diff)
downloadu-boot-271a08380634f2def4a6b148187cce6693e878a5.tar.xz
binman: Update intel_ifwi to store padded section
With a recent change this entry stores only part of the section data, leaving out the padding at the end. Fix this by using GetPaddedData() to get the data. Add this function to the base Entry class also. Fixes: d1d3ad7d1fe ("binman: Move section padding to the parent") Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 8946d2bc02..68e694e7d1 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -456,6 +456,22 @@ class Entry(object):
self.Detail('GetData: size %s' % ToHexSize(self.data))
return self.data
+ def GetPaddedData(self, data=None):
+ """Get the data for an entry including any padding
+
+ Gets the entry data and uses its section's pad-byte value to add padding
+ before and after as defined by the pad-before and pad-after properties.
+
+ This does not consider alignment.
+
+ Returns:
+ Contents of the entry along with any pad bytes before and
+ after it (bytes)
+ """
+ if data is None:
+ data = self.GetData()
+ return self.section.GetPaddedDataForEntry(self, data)
+
def GetOffsets(self):
"""Get the offsets for siblings