From 271a08380634f2def4a6b148187cce6693e878a5 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 2 Nov 2020 12:55:43 -0700 Subject: 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 --- tools/binman/entry.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tools/binman/entry.py') diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 8946d2bc02f..68e694e7d15 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 -- cgit v1.2.3 From 08594d49860c335f39d4f7797cac766ac8b57c56 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 2 Nov 2020 12:55:44 -0700 Subject: binman: Correct calculation for image-pos A recent change removed the base offset from the calculation. This is used on coral to find the FSP-S binary. Fix it. Fixes: a9fad07d4b8 ("binman: Avoid reporting image-pos with compression") Signed-off-by: Simon Glass --- tools/binman/entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/binman/entry.py') diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 68e694e7d15..2be0d8e0532 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -245,7 +245,7 @@ class Entry(object): state.SetInt(self._node, 'size', self.size) base = self.section.GetRootSkipAtStart() if self.section else 0 if self.image_pos is not None: - state.SetInt(self._node, 'image-pos', self.image_pos) + state.SetInt(self._node, 'image-pos', self.image_pos - base) if self.GetImage().allow_repack: if self.orig_offset is not None: state.SetInt(self._node, 'orig-offset', self.orig_offset, True) -- cgit v1.2.3