
On Mon, 31 Aug 2020 at 03:59, Alper Nebi Yasak alpernebiyasak@gmail.com wrote:
When reading subentries of each image, the FIT entry type directly concatenates their contents without padding them according to their offset, size, align, align-size, align-end, pad-before, pad-after properties.
This patch makes sure these properties are respected by offloading this image-data building to the section etype, where each subnode of the "images" node is processed as a section. Alignments and offsets are respective to the beginning of each image. For example, the following fragment can end up having "u-boot-spl" start at 0x88 within the final FIT binary, while "u-boot" would then end up starting at e.g. 0x20088.
fit { description = "example"; images { kernel-1 { description = "U-Boot with SPL"; type = "kernel"; arch = "arm64"; os = "linux"; compression = "none"; u-boot-spl { }; u-boot { align = <0x10000>; }; }; }; }
Signed-off-by: Alper Nebi Yasak alpernebiyasak@gmail.com
Changes in v2:
- Renumber test to accommodate for the first patch's new test
- Use 'section' instead of 'image' for FIT subimage sections
- Also rename 'Members:' comment for the renamed _fit_content variable
- Clarify comments around FIT subimage section/content processing
- Don't check for section.ObtainContents() returning False (never does)
tools/binman/etype/fit.py | 41 +++++++------ tools/binman/ftest.py | 23 ++++++++ .../test/167_fit_image_subentry_alignment.dts | 57 +++++++++++++++++++ 3 files changed, 104 insertions(+), 17 deletions(-) create mode 100644 tools/binman/test/167_fit_image_subentry_alignment.dts
Reviewed-by: Simon Glass sjg@chromium.org