u-boot-brain/tools/binman/test
Alper Nebi Yasak fe05701b05 binman: Build FIT image subentries with the section etype
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reinstate check in testPadInSections(), squash in
   "binman: Allow FIT binaries to have missing external blobs"
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2020-09-22 12:50:43 -06:00
..
files binman: Support adding files 2018-09-29 11:49:35 -06:00
001_invalid.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
002_missing_node.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
003_empty.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
004_invalid_entry.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
005_simple.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
006_dual_image.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
007_bad_align.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
008_pack.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
009_pack_extra.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
010_pack_align_power2.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
011_pack_align_size_power2.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
012_pack_inv_align.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
013_pack_inv_size_align.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
014_pack_overlap.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
015_pack_overflow.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
016_pack_image_overflow.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
017_pack_image_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
018_pack_image_align.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
019_pack_inv_image_align.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
020_pack_inv_image_align_power2.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
021_image_pad.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
022_image_name.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
023_blob.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
024_sorted.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
025_pack_zero_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
026_pack_u_boot_dtb.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
027_pack_4gb_no_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
028_pack_4gb_outside.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
029_x86_rom.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
030_x86_rom_me_no_desc.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
031_x86_rom_me.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
032_intel_vga.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
033_x86_start16.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
034_x86_ucode.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
035_x86_single_ucode.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
036_u_boot_img.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
037_x86_no_ucode.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
038_x86_ucode_missing_node.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
039_x86_ucode_missing_node2.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
040_x86_ucode_not_in_image.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
041_unknown_pos_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
042_intel_fsp.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
043_intel_cmc.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
044_x86_optional_ucode.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
045_prop_test.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
046_intel_vbt.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
047_spl_bss_pad.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
048_x86_start16_spl.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
049_x86_ucode_spl.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
050_intel_mrc.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
051_u_boot_spl_dtb.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
052_u_boot_spl_nodtb.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
053_symbols.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
054_unit_address.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
055_sections.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
056_name_prefix.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
057_unknown_contents.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
058_x86_ucode_spl_needs_retry.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
059_change_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
060_fdt_update.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
061_fdt_update_bad.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
062_entry_args.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
063_entry_args_missing.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
064_entry_args_required.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
065_entry_args_unknown_datatype.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
066_text.dts binman: Allow text directly in the node 2019-07-23 20:27:57 -07:00
067_fmap.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
068_blob_named_by_arg.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
069_fill.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
070_fill_no_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
071_gbb.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
072_gbb_too_small.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
073_gbb_no_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
074_vblock.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
075_vblock_no_content.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
076_vblock_bad_phandle.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
077_vblock_bad_entry.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
078_u_boot_tpl.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
079_uses_pos.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
080_fill_empty.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
081_x86_start16_tpl.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
082_fdt_update_all.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
083_compress.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
084_files.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
085_files_compress.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
086_files_none.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
087_files_no_pattern.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
088_expand_size.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
089_expand_size_bad.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
090_hash.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
091_hash_no_algo.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
092_hash_bad_algo.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
093_x86_tpl_ucode.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
094_fmap_x86.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
095_fmap_x86_section.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
096_elf.dts binman: Support ELF files for TPL 2019-07-23 20:27:58 -07:00
097_elf_strip.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
098_4gb_and_skip_at_start_together.dts binman: Rename some two-digit test files 2019-10-15 08:40:02 -06:00
099_hash_section.dts binman: Move to three-digit test-file numbers 2018-10-09 04:40:27 -06:00
100_intel_refcode.dts binman: Add a test for Intel reference code 2018-10-22 13:57:12 -04:00
101_sections_offset.dts binman: Allow sections to have an offset 2019-05-08 12:44:07 +08:00
102_cbfs_raw.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
103_cbfs_raw_ppc.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
104_cbfs_stage.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
105_cbfs_raw_compress.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
106_cbfs_bad_arch.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
107_cbfs_no_size.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
108_cbfs_no_contents.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
109_cbfs_bad_compress.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
110_cbfs_name.dts binman: Add support for CBFS entries 2019-07-24 12:53:46 -07:00
111_x86_rom_ifwi.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
112_x86_rom_ifwi_nodesc.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
113_x86_rom_ifwi_nodata.dts binman: Use underscore in test filenames 2019-10-15 08:40:02 -06:00
114_cbfs_offset.dts binman: Add support for fixed-offset files in CBFS 2019-07-24 12:53:46 -07:00
115_fdtmap.dts binman: Add an FDT map 2019-07-24 12:53:46 -07:00
116_fdtmap_hdr.dts binman: Add an image header 2019-07-24 12:53:46 -07:00
117_fdtmap_hdr_start.dts binman: Add an image header 2019-07-24 12:53:46 -07:00
118_fdtmap_hdr_pos.dts binman: Add an image header 2019-07-24 12:53:46 -07:00
119_fdtmap_hdr_missing.dts binman: Add an image header 2019-07-24 12:53:46 -07:00
120_hdr_no_location.dts binman: Add an image header 2019-07-24 12:53:46 -07:00
121_entry_expand.dts binman: Allow entries to expand after packing 2019-07-24 12:54:08 -07:00
122_entry_expand_twice.dts binman: Allow entries to expand after packing 2019-07-24 12:54:08 -07:00
123_entry_expand_section.dts binman: Allow entries to expand after packing 2019-07-24 12:54:08 -07:00
124_compress_dtb.dts binman: Allow device-tree entries to be compressed 2019-07-24 12:54:08 -07:00
125_cbfs_update.dts binman: Support FDT update for CBFS 2019-07-24 12:54:08 -07:00
126_cbfs_bad_type.dts binman: Detect bad CBFS file types 2019-07-24 12:54:08 -07:00
127_list.dts binman: Allow listing the entries in an image 2019-07-24 12:54:08 -07:00
128_decode_image.dts binman: Support locating an FDT map 2019-07-24 12:54:08 -07:00
129_decode_image_nohdr.dts binman: Support reading an image into an Image object 2019-07-24 12:54:08 -07:00
130_list_fdtmap.dts binman: Support listing an image 2019-07-24 12:54:08 -07:00
131_pack_align_section.dts binman: Add a test for nested and aligned sections 2019-07-24 12:54:08 -07:00
132_replace.dts binman: Support updating entries in an existing image 2019-07-29 09:38:06 -06:00
133_replace_multi.dts binman: Support updating entries in an existing image 2019-07-29 09:38:06 -06:00
134_fdt_update_all_repack.dts binman: Add info to allow safely repacking an image later 2019-07-29 09:38:06 -06:00
135_fdtmap_hdr_middle.dts binman: Add more tests for image header position 2019-07-29 09:38:06 -06:00
136_fdtmap_hdr_startbad.dts binman: Add more tests for image header position 2019-07-29 09:38:06 -06:00
137_fdtmap_hdr_endbad.dts binman: Add more tests for image header position 2019-07-29 09:38:06 -06:00
138_fdtmap_hdr_nosize.dts binman: Add more tests for image header position 2019-07-29 09:38:06 -06:00
139_replace_repack.dts binman: Allow updating entries that change size 2019-07-29 09:38:06 -06:00
140_entry_shrink.dts binman: Support shrinking a entry after packing 2019-07-29 09:38:06 -06:00
141_descriptor_offset.dts binman: Place Intel descriptor at image start 2019-07-29 09:38:06 -06:00
142_replace_cbfs.dts binman: Support replacing data in a cbfs 2019-07-29 09:38:06 -06:00
143_replace_all.dts binman: Add command-line support for replacing entries 2019-07-29 09:38:06 -06:00
144_x86_reset16.dts binman: Add support for an x86 'reset' section 2019-10-15 08:40:02 -06:00
145_x86_reset16_spl.dts binman: Add support for an x86 'reset' section 2019-10-15 08:40:02 -06:00
146_x86_reset16_tpl.dts binman: Add support for an x86 'reset' section 2019-10-15 08:40:02 -06:00
147_intel_fit.dts binman: Add support for Intel FIT 2019-10-15 08:40:02 -06:00
148_intel_fit_missing.dts binman: Add support for Intel FIT 2019-10-15 08:40:02 -06:00
149_symbols_tpl.dts binman: Increase size of TPL and SPL test data 2019-10-15 08:40:02 -06:00
150_powerpc_mpc85xx_bootpg_resetvec.dts binman: Rename some two-digit test files 2019-10-15 08:40:02 -06:00
151_x86_rom_ifwi_section.dts binman: Avoid needing the section size in advance 2019-10-15 08:40:02 -06:00
152_intel_fsp_m.dts binman: Add support for Intel FSP meminit 2019-10-15 08:40:02 -06:00
153_intel_fsp_s.dts binman: Add support for Intel FSP-S 2019-11-02 18:00:51 +08:00
154_intel_fsp_t.dts binman: Add support for Intel FSP-T 2019-11-02 18:00:51 +08:00
155_symbols_tpl_x86.dts binman: tegra: Adjust symbol calculation depending on end-at-4gb 2019-11-11 14:20:35 -05:00
156_mkimage.dts binman: Add support for calling mkimage 2020-07-24 19:25:15 -06:00
157_blob_ext.dts binman: Add an etype for external binary blobs 2020-07-25 14:46:57 -06:00
158_blob_ext_missing.dts binman: Add an etype for external binary blobs 2020-07-25 14:46:57 -06:00
159_blob_ext_missing_sect.dts binman: Detect when valid images are not produced 2020-07-25 14:46:57 -06:00
160_pack_overlap_zero.dts binman: Allow zero-length entries to overlap 2020-07-25 14:46:57 -06:00
161_fit.dts binman: Add support for generating a FIT 2020-07-25 14:46:57 -06:00
162_fit_external.dts binman: Add support for generating a FIT 2020-07-25 14:46:57 -06:00
163_x86_rom_me_empty.dts binman: Don't change the descriptor in tests 2020-07-26 19:59:57 -06:00
164_x86_rom_me_missing.dts binman: Don't change the descriptor in tests 2020-07-26 19:59:57 -06:00
165_section_ignore_hash_signature.dts binman: Ignore hash*, signature* nodes in sections 2020-09-22 12:50:43 -06:00
166_pad_in_sections.dts binman: Respect pad-before property of section subentries 2020-09-22 12:50:43 -06:00
167_fit_image_subentry_alignment.dts binman: Build FIT image subentries with the section etype 2020-09-22 12:50:43 -06:00
168_fit_missing_blob.dts binman: Build FIT image subentries with the section etype 2020-09-22 12:50:43 -06:00
bss_data.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bss_data.lds SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
descriptor.bin binman: Add support for building x86 ROMs 2016-12-20 08:09:55 +13:00
fitimage.bin.gz binman: Add support for Intel IFWI entries 2019-07-24 12:53:46 -07:00
ifwi.bin.gz binman: Add support for Intel IFWI entries 2019-07-24 12:53:46 -07:00
Makefile binman: tegra: Adjust symbol calculation depending on end-at-4gb 2019-11-11 14:20:35 -05:00
u_boot_binman_syms_bad.c binman: Add tests binaries with binman symbols 2017-12-12 19:53:45 -07:00
u_boot_binman_syms_bad.lds SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u_boot_binman_syms_size.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u_boot_binman_syms_x86.c binman: tegra: Adjust symbol calculation depending on end-at-4gb 2019-11-11 14:20:35 -05:00
u_boot_binman_syms_x86.lds binman: tegra: Adjust symbol calculation depending on end-at-4gb 2019-11-11 14:20:35 -05:00
u_boot_binman_syms.c binman: Allow support for writing a size symbol to binaries 2019-10-15 08:40:02 -06:00
u_boot_binman_syms.lds binman: Correct symbol calculation with non-zero image base 2019-11-02 18:00:51 +08:00
u_boot_no_ucode_ptr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u_boot_ucode_ptr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u_boot_ucode_ptr.lds binman: Use the Makefile for u_boot_ucode_ptr 2019-10-15 08:40:02 -06:00