diff options
| author | Tom Rini <[email protected]> | 2026-04-06 12:16:57 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-06 12:16:57 -0600 |
| commit | 93f84ee022a8401421cdaab84fe7d106d83fdb4a (patch) | |
| tree | fb15a4af876e8faf9893fd86c1c0e127265dbe9a /tools | |
| parent | 88dc2788777babfd6322fa655df549a019aa1e69 (diff) | |
| parent | e2138cf1e6088f12ffa874e87cc8f4b198378635 (diff) | |
Merge branch 'next'
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/.gitignore | 2 | ||||
| -rw-r--r-- | tools/Kconfig | 9 | ||||
| -rw-r--r-- | tools/Makefile | 4 | ||||
| -rw-r--r-- | tools/binman/btool/mkeficapsule.py | 8 | ||||
| -rw-r--r-- | tools/binman/btool/p11_kit.py | 21 | ||||
| -rw-r--r-- | tools/binman/btool/pkcs11_tool.py | 21 | ||||
| -rw-r--r-- | tools/binman/entries.rst | 4 | ||||
| -rw-r--r-- | tools/binman/entry_test.py | 2 | ||||
| -rw-r--r-- | tools/binman/etype/efi_capsule.py | 17 | ||||
| -rw-r--r-- | tools/binman/fdt_test.py | 4 | ||||
| -rw-r--r-- | tools/binman/ftest.py | 1155 | ||||
| -rwxr-xr-x | tools/binman/main.py | 7 | ||||
| -rw-r--r-- | tools/binman/test/214_no_alt_format.dts | 13 | ||||
| -rw-r--r-- | tools/binman/test/Makefile | 2 | ||||
| -rw-r--r-- | tools/binman/test/blob/blob.dts (renamed from tools/binman/test/023_blob.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext.dts (renamed from tools/binman/test/157_blob_ext.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_list.dts (renamed from tools/binman/test/215_blob_ext_list.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_list_fake.dts (renamed from tools/binman/test/218_blob_ext_list_fake.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_list_missing.dts (renamed from tools/binman/test/216_blob_ext_list_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_missing.dts (renamed from tools/binman/test/158_blob_ext_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_missing_sect.dts (renamed from tools/binman/test/159_blob_ext_missing_sect.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/ext_opt.dts (renamed from tools/binman/test/266_blob_ext_opt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/fake.dts (renamed from tools/binman/test/217_fake_blob.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/missing.dts (renamed from tools/binman/test/173_missing_blob.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/named_by_arg.dts (renamed from tools/binman/test/068_blob_named_by_arg.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/blob/symbol.dts (renamed from tools/binman/test/273_blob_symbol.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/accept.dts (renamed from tools/binman/test/319_capsule_accept.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/accept_missing_guid.dts (renamed from tools/binman/test/321_capsule_accept_missing_guid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/accept_revert_missing.dts (renamed from tools/binman/test/323_capsule_accept_revert_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/capsule.dts (renamed from tools/binman/test/311_capsule.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/empty_type_missing.dts (renamed from tools/binman/test/322_empty_capsule_type_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/missing_guid.dts (renamed from tools/binman/test/318_capsule_missing_guid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/missing_index.dts (renamed from tools/binman/test/317_capsule_missing_index.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/missing_key.dts (renamed from tools/binman/test/316_capsule_missing_key.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/oemflags.dts (renamed from tools/binman/test/315_capsule_oemflags.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/revert.dts (renamed from tools/binman/test/320_capsule_revert.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/signed.dts (renamed from tools/binman/test/312_capsule_signed.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/signed_pkcs11.dts | 22 | ||||
| -rw-r--r-- | tools/binman/test/capsule/signed_ver.dts (renamed from tools/binman/test/314_capsule_signed_ver.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/capsule/version.dts (renamed from tools/binman/test/313_capsule_version.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/bad_arch.dts (renamed from tools/binman/test/106_cbfs_bad_arch.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/bad_compress.dts (renamed from tools/binman/test/109_cbfs_bad_compress.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/bad_type.dts (renamed from tools/binman/test/126_cbfs_bad_type.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/name.dts (renamed from tools/binman/test/110_cbfs_name.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/no_contents.dts (renamed from tools/binman/test/108_cbfs_no_contents.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/no_size.dts (renamed from tools/binman/test/107_cbfs_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/offset.dts (renamed from tools/binman/test/114_cbfs_offset.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/raw.dts (renamed from tools/binman/test/102_cbfs_raw.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/raw_compress.dts (renamed from tools/binman/test/105_cbfs_raw_compress.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/raw_ppc.dts (renamed from tools/binman/test/103_cbfs_raw_ppc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/replace.dts (renamed from tools/binman/test/142_replace_cbfs.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/stage.dts (renamed from tools/binman/test/104_cbfs_stage.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cbfs/update.dts (renamed from tools/binman/test/125_cbfs_update.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/fmap.dts (renamed from tools/binman/test/067_fmap.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/gbb.dts (renamed from tools/binman/test/071_gbb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/gbb_no_size.dts (renamed from tools/binman/test/073_gbb_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/gbb_too_small.dts (renamed from tools/binman/test/072_gbb_too_small.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/vblock.dts (renamed from tools/binman/test/074_vblock.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/vblock_bad_entry.dts (renamed from tools/binman/test/077_vblock_bad_entry.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/vblock_bad_phandle.dts (renamed from tools/binman/test/076_vblock_bad_phandle.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/vblock_content.dts (renamed from tools/binman/test/189_vblock_content.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/cros/vblock_no_content.dts (renamed from tools/binman/test/075_vblock_no_content.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/absent.dts (renamed from tools/binman/test/262_absent.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/collection.dts (renamed from tools/binman/test/198_collection.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/collection_other.dts (renamed from tools/binman/test/246_collection_other.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/collection_section.dts (renamed from tools/binman/test/199_collection_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress.dts (renamed from tools/binman/test/083_compress.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress_extra.dts (renamed from tools/binman/test/186_compress_extra.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress_image.dts (renamed from tools/binman/test/182_compress_image.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress_image_less.dts (renamed from tools/binman/test/183_compress_image_less.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress_section.dts (renamed from tools/binman/test/185_compress_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/compress_section_size.dts (renamed from tools/binman/test/184_compress_section_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/elf.dts (renamed from tools/binman/test/096_elf.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/elf_strip.dts (renamed from tools/binman/test/097_elf_strip.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/entry_args.dts (renamed from tools/binman/test/062_entry_args.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/entry_args_missing.dts (renamed from tools/binman/test/063_entry_args_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/entry_args_required.dts (renamed from tools/binman/test/064_entry_args_required.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/entry_args_unknown_datatype.dts (renamed from tools/binman/test/065_entry_args_unknown_datatype.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/env.dts (renamed from tools/binman/test/174_env.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/env_no_size.dts (renamed from tools/binman/test/175_env_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/env_too_small.dts (renamed from tools/binman/test/176_env_too_small.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/files.dts (renamed from tools/binman/test/084_files.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/files_align.dts (renamed from tools/binman/test/190_files_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/files_compress.dts (renamed from tools/binman/test/085_files_compress.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/files_no_pattern.dts (renamed from tools/binman/test/087_files_no_pattern.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/files_none.dts (renamed from tools/binman/test/086_files_none.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/fill.dts (renamed from tools/binman/test/069_fill.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/fill_empty.dts (renamed from tools/binman/test/080_fill_empty.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/fill_no_size.dts (renamed from tools/binman/test/070_fill_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/image_entryarg.dts (renamed from tools/binman/test/188_image_entryarg.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/list.dts (renamed from tools/binman/test/127_list.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/name_prefix.dts (renamed from tools/binman/test/056_name_prefix.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/null.dts (renamed from tools/binman/test/268_null.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/offset_from_elf.dts (renamed from tools/binman/test/274_offset_from_elf.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/overlap.dts (renamed from tools/binman/test/269_overlap.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/overlap_bad.dts (renamed from tools/binman/test/271_overlap_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/overlap_no_size.dts (renamed from tools/binman/test/272_overlap_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/overlap_null.dts (renamed from tools/binman/test/270_overlap_null.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/prop_test.dts (renamed from tools/binman/test/045_prop_test.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/read_image_skip.dts (renamed from tools/binman/test/191_read_image_skip.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/remove_template.dts (renamed from tools/binman/test/346_remove_template.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace.dts (renamed from tools/binman/test/132_replace.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_all.dts (renamed from tools/binman/test/143_replace_all.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_multi.dts (renamed from tools/binman/test/133_replace_multi.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_repack.dts (renamed from tools/binman/test/139_replace_repack.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_section_deep.dts (renamed from tools/binman/test/278_replace_section_deep.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_section_simple.dts (renamed from tools/binman/test/241_replace_section_simple.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/replace_with_bintool.dts (renamed from tools/binman/test/239_replace_with_bintool.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/section_fname.dts (renamed from tools/binman/test/261_section_fname.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/section_timeout.dts (renamed from tools/binman/test/202_section_timeout.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/sections.dts (renamed from tools/binman/test/055_sections.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/symlink.dts (renamed from tools/binman/test/259_symlink.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/tee_os.dts (renamed from tools/binman/test/222_tee_os.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/tee_os_opt.dts (renamed from tools/binman/test/263_tee_os_opt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/template.dts (renamed from tools/binman/test/286_template.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/template_multi.dts (renamed from tools/binman/test/287_template_multi.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/template_phandle.dts (renamed from tools/binman/test/309_template_phandle.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/template_phandle_dup.dts (renamed from tools/binman/test/310_template_phandle_dup.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/template_section.dts (renamed from tools/binman/test/289_template_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/text.dts (renamed from tools/binman/test/066_text.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/unique_names.dts (renamed from tools/binman/test/237_unique_names.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/unique_names_multi.dts (renamed from tools/binman/test/238_unique_names_multi.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/unknown_contents.dts (renamed from tools/binman/test/057_unknown_contents.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/entry/unknown_pos_size.dts (renamed from tools/binman/test/041_unknown_pos_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/alternates_fdt.dts (renamed from tools/binman/test/328_alternates_fdt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/alternates_fdtgrep.dts (renamed from tools/binman/test/329_alternates_fdtgrep.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/alternates_inval.dts (renamed from tools/binman/test/332_alternates_inval.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/alternates_spl.dts (renamed from tools/binman/test/331_alternates_spl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/alternates_vpl.dts (renamed from tools/binman/test/330_alternates_vpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/bootph_prop.dts (renamed from tools/binman/test/347_bootph_prop.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/compress_dtb.dts (renamed from tools/binman/test/124_compress_dtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/compress_dtb_invalid.dts (renamed from tools/binman/test/250_compress_dtb_invalid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/compress_dtb_prepend_invalid.dts (renamed from tools/binman/test/248_compress_dtb_prepend_invalid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/compress_dtb_prepend_length.dts (renamed from tools/binman/test/249_compress_dtb_prepend_length.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/compress_dtb_zstd.dts (renamed from tools/binman/test/251_compress_dtb_zstd.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/decode_image.dts (renamed from tools/binman/test/128_decode_image.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/decode_image_nohdr.dts (renamed from tools/binman/test/129_decode_image_nohdr.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap.dts (renamed from tools/binman/test/115_fdtmap.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_alt_format.dts (renamed from tools/binman/test/213_fdtmap_alt_format.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr.dts (renamed from tools/binman/test/116_fdtmap_hdr.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_endbad.dts (renamed from tools/binman/test/137_fdtmap_hdr_endbad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_middle.dts (renamed from tools/binman/test/135_fdtmap_hdr_middle.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_missing.dts (renamed from tools/binman/test/119_fdtmap_hdr_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_nosize.dts (renamed from tools/binman/test/138_fdtmap_hdr_nosize.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_pos.dts (renamed from tools/binman/test/118_fdtmap_hdr_pos.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_start.dts (renamed from tools/binman/test/117_fdtmap_hdr_start.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/fdtmap_hdr_startbad.dts (renamed from tools/binman/test/136_fdtmap_hdr_startbad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/hdr_no_location.dts (renamed from tools/binman/test/120_hdr_no_location.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/incl.dts (renamed from tools/binman/test/194_fdt_incl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/incl_tpl.dts (renamed from tools/binman/test/195_fdt_incl_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/incl_vpl.dts (renamed from tools/binman/test/257_fdt_incl_vpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/list_fdtmap.dts (renamed from tools/binman/test/130_list_fdtmap.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/update.dts (renamed from tools/binman/test/060_fdt_update.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/update_all.dts (renamed from tools/binman/test/082_fdt_update_all.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/update_all_repack.dts (renamed from tools/binman/test/134_fdt_update_all_repack.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fdt/update_bad.dts (renamed from tools/binman/test/061_fdt_update_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/atf_bl31.dts (renamed from tools/binman/test/169_atf_bl31.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/bad_align.dts (renamed from tools/binman/test/211_fip_bad_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/bl1.dts (renamed from tools/binman/test/347_bl1.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/collection.dts (renamed from tools/binman/test/212_fip_collection.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/fip.dts (renamed from tools/binman/test/203_fip.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/ls.dts (renamed from tools/binman/test/207_fip_ls.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/missing.dts (renamed from tools/binman/test/209_fip_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/no_type.dts (renamed from tools/binman/test/205_fip_no_type.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/opensbi.dts (renamed from tools/binman/test/201_opensbi.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/other.dts (renamed from tools/binman/test/204_fip_other.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/replace.dts (renamed from tools/binman/test/208_fip_replace.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/scp.dts (renamed from tools/binman/test/172_scp.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/size.dts (renamed from tools/binman/test/210_fip_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fip/uuid.dts (renamed from tools/binman/test/206_fip_uuid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/aes256.bin (renamed from tools/binman/test/aes256.bin) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/align.dts (renamed from tools/binman/test/275_fit_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/bad_dir.dts (renamed from tools/binman/test/227_fit_bad_dir.dts) | 2 | ||||
| -rw-r--r-- | tools/binman/test/fit/bad_dir_config.dts (renamed from tools/binman/test/228_fit_bad_dir_config.dts) | 2 | ||||
| -rw-r--r-- | tools/binman/test/fit/bad_oper.dts (renamed from tools/binman/test/224_fit_bad_oper.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/dummy-rsa-engine.c (renamed from tools/binman/test/dummy-rsa-engine.c) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/dummy-rsa4096.crt (renamed from tools/binman/test/340_dummy-rsa4096.crt) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/encrypt_data.dts (renamed from tools/binman/test/343_fit_encrypt_data.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/encrypt_data_no_key.dts (renamed from tools/binman/test/344_fit_encrypt_data_no_key.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/external.dts (renamed from tools/binman/test/162_fit_external.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/extract_replace.dts (renamed from tools/binman/test/240_fit_extract_replace.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt.dts (renamed from tools/binman/test/170_fit_fdt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_compat.dts (renamed from tools/binman/test/334_fit_fdt_compat.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_dir.dts (renamed from tools/binman/test/333_fit_fdt_dir.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_list.dts (renamed from tools/binman/test/284_fit_fdt_list.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_missing_prop.dts (renamed from tools/binman/test/171_fit_fdt_missing_prop.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_name.dts (renamed from tools/binman/test/345_fit_fdt_name.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_oper.dts (renamed from tools/binman/test/223_fit_fdt_oper.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fdt_phase.dts (renamed from tools/binman/test/335_fit_fdt_phase.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/firmware_loadables.dts (renamed from tools/binman/test/276_fit_firmware_loadables.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/fit.dts (renamed from tools/binman/test/161_fit.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/gennode.dts (renamed from tools/binman/test/219_fit_gennode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/image_subentry_alignment.dts (renamed from tools/binman/test/167_fit_image_subentry_alignment.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/key_name_hint_dir_signature.dts (renamed from tools/binman/test/347_key_name_hint_dir_fit_signature.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/missing_blob.dts (renamed from tools/binman/test/168_fit_missing_blob.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/openssl.conf (renamed from tools/binman/test/340_openssl.conf) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/replace_sibling.dts (renamed from tools/binman/test/277_replace_fit_sibling.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/rsa2048.key (renamed from tools/binman/test/340_rsa2048.key) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/sign.dts (renamed from tools/binman/test/280_fit_sign.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature.dts (renamed from tools/binman/test/340_fit_signature.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_engine.dts (renamed from tools/binman/test/340_fit_signature_engine.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_engine_encrypt.dts (renamed from tools/binman/test/340_fit_signature_engine_encrypt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_engine_pkcs11.dts (renamed from tools/binman/test/340_fit_signature_engine_pkcs11.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_engine_pkcs11_object.dts (renamed from tools/binman/test/340_fit_signature_engine_pkcs11_object.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_multi_key.dts (renamed from tools/binman/test/341_fit_signature.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/signature_no_nodes.dts (renamed from tools/binman/test/342_fit_signature.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/softhsm2.conf (renamed from tools/binman/test/340_softhsm2.conf) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/split_elf.dts (renamed from tools/binman/test/226_fit_split_elf.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/subentry_bintool.dts (renamed from tools/binman/test/220_fit_subentry_bintool.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/subentry_hash.dts (renamed from tools/binman/test/221_fit_subentry_hash.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/tee_os_opt.dts (renamed from tools/binman/test/264_tee_os_opt_fit.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/tee_os_opt_bad.dts (renamed from tools/binman/test/265_tee_os_opt_fit_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/fit/template.dts (renamed from tools/binman/test/288_template_fit.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/coll.dts (renamed from tools/binman/test/247_mkimage_coll.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/filename.dts (renamed from tools/binman/test/254_mkimage_filename.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/image.dts (renamed from tools/binman/test/243_mkimage_image.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/image_bad.dts (renamed from tools/binman/test/245_mkimage_image_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/image_no_content.dts (renamed from tools/binman/test/244_mkimage_image_no_content.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/missing.dts (renamed from tools/binman/test/229_mkimage_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/missing_multiple.dts (renamed from tools/binman/test/292_mkimage_missing_multiple.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/mkimage.dts (renamed from tools/binman/test/156_mkimage.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/mult_data.dts (renamed from tools/binman/test/252_mkimage_mult_data.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/mult_no_content.dts (renamed from tools/binman/test/253_mkimage_mult_no_content.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/name.dts (renamed from tools/binman/test/242_mkimage_name.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/special.dts (renamed from tools/binman/test/283_mkimage_special.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/mkimage/sym.dts (renamed from tools/binman/test/290_mkimage_sym.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/4gb_and_skip_at_start_together.dts (renamed from tools/binman/test/098_4gb_and_skip_at_start_together.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/align_default.dts (renamed from tools/binman/test/200_align_default.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/assume_size.dts (renamed from tools/binman/test/326_assume_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/assume_size_ok.dts (renamed from tools/binman/test/327_assume_size_ok.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/bad_align.dts (renamed from tools/binman/test/007_bad_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/change_size.dts (renamed from tools/binman/test/059_change_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/dual_image.dts (renamed from tools/binman/test/006_dual_image.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/empty.dts (renamed from tools/binman/test/003_empty.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/entry_extend.dts (renamed from tools/binman/test/121_entry_extend.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/entry_extend_section.dts (renamed from tools/binman/test/123_entry_extend_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/entry_extend_twice.dts (renamed from tools/binman/test/122_entry_extend_twice.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/entry_shrink.dts (renamed from tools/binman/test/140_entry_shrink.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/expand_size_bad.dts (renamed from tools/binman/test/225_expand_size_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/extend_size.dts (renamed from tools/binman/test/088_extend_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/extend_size_bad.dts (renamed from tools/binman/test/089_extend_size_bad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/image_name.dts (renamed from tools/binman/test/022_image_name.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/image_pad.dts (renamed from tools/binman/test/021_image_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/invalid.dts (renamed from tools/binman/test/001_invalid.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/invalid_entry.dts (renamed from tools/binman/test/004_invalid_entry.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/missing_node.dts (renamed from tools/binman/test/002_missing_node.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack.dts (renamed from tools/binman/test/008_pack.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_4gb_no_size.dts (renamed from tools/binman/test/027_pack_4gb_no_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_4gb_outside.dts (renamed from tools/binman/test/028_pack_4gb_outside.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_align_power2.dts (renamed from tools/binman/test/010_pack_align_power2.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_align_section.dts (renamed from tools/binman/test/131_pack_align_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_align_size_power2.dts (renamed from tools/binman/test/011_pack_align_size_power2.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_extra.dts (renamed from tools/binman/test/009_pack_extra.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_image_align.dts (renamed from tools/binman/test/018_pack_image_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_image_overflow.dts (renamed from tools/binman/test/016_pack_image_overflow.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_image_size.dts (renamed from tools/binman/test/017_pack_image_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_inv_align.dts (renamed from tools/binman/test/012_pack_inv_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_inv_image_align.dts (renamed from tools/binman/test/019_pack_inv_image_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_inv_image_align_power2.dts (renamed from tools/binman/test/020_pack_inv_image_align_power2.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_inv_size_align.dts (renamed from tools/binman/test/013_pack_inv_size_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_overflow.dts (renamed from tools/binman/test/015_pack_overflow.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_overlap.dts (renamed from tools/binman/test/014_pack_overlap.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_overlap_zero.dts (renamed from tools/binman/test/160_pack_overlap_zero.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pack_zero_size.dts (renamed from tools/binman/test/025_pack_zero_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/pad_in_sections.dts (renamed from tools/binman/test/166_pad_in_sections.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/section_align.dts (renamed from tools/binman/test/181_section_align.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/section_inner.dts (renamed from tools/binman/test/267_section_inner.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/section_pad.dts (renamed from tools/binman/test/180_section_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/sections_offset.dts (renamed from tools/binman/test/101_sections_offset.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/simple.dts (renamed from tools/binman/test/005_simple.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/skip_at_start.dts (renamed from tools/binman/test/177_skip_at_start.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/skip_at_start_pad.dts (renamed from tools/binman/test/178_skip_at_start_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/skip_at_start_section_pad.dts (renamed from tools/binman/test/179_skip_at_start_section_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/sorted.dts (renamed from tools/binman/test/024_sorted.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/unit_address.dts (renamed from tools/binman/test/054_unit_address.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/pack/uses_pos.dts (renamed from tools/binman/test/079_uses_pos.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/encrypted_invalid_iv_file.dts (renamed from tools/binman/test/302_encrypted_invalid_iv_file.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/encrypted_key_file.dts (renamed from tools/binman/test/305_encrypted_key_file.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/encrypted_key_source.dts (renamed from tools/binman/test/304_encrypted_key_source.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/encrypted_missing_key.dts (renamed from tools/binman/test/303_encrypted_missing_key.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/encrypted_no_algo.dts (renamed from tools/binman/test/301_encrypted_no_algo.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/hash.dts (renamed from tools/binman/test/090_hash.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/hash_bad_algo.dts (renamed from tools/binman/test/092_hash_bad_algo.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/hash_no_algo.dts (renamed from tools/binman/test/091_hash_no_algo.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/hash_section.dts (renamed from tools/binman/test/099_hash_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/key.key (renamed from tools/binman/test/key.key) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/key.pem (renamed from tools/binman/test/key.pem) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/key_name_hint_dir_spl_pubkey_dtb.dts (renamed from tools/binman/test/348_key_name_hint_dir_spl_pubkey_dtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load.dts (renamed from tools/binman/test/230_pre_load.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_invalid_algo.dts (renamed from tools/binman/test/235_pre_load_invalid_algo.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_invalid_key.dts (renamed from tools/binman/test/236_pre_load_invalid_key.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_invalid_padding.dts (renamed from tools/binman/test/233_pre_load_invalid_padding.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_invalid_sha.dts (renamed from tools/binman/test/234_pre_load_invalid_sha.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_pkcs.dts (renamed from tools/binman/test/231_pre_load_pkcs.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/pre_load_pss.dts (renamed from tools/binman/test/232_pre_load_pss.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/section_ignore_hash_signature.dts (renamed from tools/binman/test/165_section_ignore_hash_signature.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/sign_non_fit.dts (renamed from tools/binman/test/281_sign_non_fit.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/spl_pubkey_dtb.dts (renamed from tools/binman/test/306_spl_pubkey_dtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/x509_cert.dts (renamed from tools/binman/test/279_x509_cert.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/xilinx_bootgen_sign.dts (renamed from tools/binman/test/307_xilinx_bootgen_sign.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/security/xilinx_bootgen_sign_enc.dts (renamed from tools/binman/test/308_xilinx_bootgen_sign_enc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/base.dts (renamed from tools/binman/test/336_symbols_base.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/base_expand.dts (renamed from tools/binman/test/337_symbols_base_expand.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/comp.dts (renamed from tools/binman/test/338_symbols_comp.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/disable.dts (renamed from tools/binman/test/282_symbols_disable.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/elf.dts (renamed from tools/binman/test/260_symbols_elf.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/expand.dts (renamed from tools/binman/test/197_symbols_expand.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/nodtb.dts (renamed from tools/binman/test/196_symbols_nodtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/sub.dts (renamed from tools/binman/test/187_symbols_sub.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/symbols.dts (renamed from tools/binman/test/053_symbols.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/symbols/tpl.dts (renamed from tools/binman/test/149_symbols_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_ddrfw_imx95.dts (renamed from tools/binman/test/346_nxp_ddrfw_imx95.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_imx8.dts (renamed from tools/binman/test/339_nxp_imx8.dts) | 3 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_imx8_csf.dts | 26 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_imx8_csf_fast_auth.dts | 21 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_imx8_imagename.dts | 27 | ||||
| -rw-r--r-- | tools/binman/test/vendor/nxp_imx95.dts (renamed from tools/binman/test/350_nxp_imx95.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/powerpc_mpc85xx_bootpg_resetvec.dts (renamed from tools/binman/test/150_powerpc_mpc85xx_bootpg_resetvec.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/renesas_rcar4_sa0.dts (renamed from tools/binman/test/348_renesas_rcar4_sa0.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/renesas_rcar4_sa0_size.dts (renamed from tools/binman/test/349_renesas_rcar4_sa0_size.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/rockchip_tpl.dts (renamed from tools/binman/test/291_rockchip_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_board_cfg.dts (renamed from tools/binman/test/293_ti_board_cfg.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_board_cfg_combined.dts (renamed from tools/binman/test/294_ti_board_cfg_combined.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_board_cfg_no_type.dts (renamed from tools/binman/test/295_ti_board_cfg_no_type.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_board_cfg_phony.dts (renamed from tools/binman/test/323_ti_board_cfg_phony.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_dm.dts (renamed from tools/binman/test/225_ti_dm.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure.dts (renamed from tools/binman/test/296_ti_secure.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_firewall.dts (renamed from tools/binman/test/324_ti_secure_firewall.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_firewall_missing_property.dts (renamed from tools/binman/test/325_ti_secure_firewall_missing_property.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_rom.dts (renamed from tools/binman/test/297_ti_secure_rom.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_rom_a.dts (renamed from tools/binman/test/299_ti_secure_rom_a.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_rom_b.dts (renamed from tools/binman/test/300_ti_secure_rom_b.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/vendor/ti_secure_rom_combined.dts (renamed from tools/binman/test/298_ti_secure_rom_combined.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/descriptor.bin (renamed from tools/binman/test/descriptor.bin) | bin | 4096 -> 4096 bytes | |||
| -rw-r--r-- | tools/binman/test/x86/descriptor_offset.dts (renamed from tools/binman/test/141_descriptor_offset.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/fitimage.bin.gz (renamed from tools/binman/test/fitimage.bin.gz) | bin | 8418 -> 8418 bytes | |||
| -rw-r--r-- | tools/binman/test/x86/fmap.dts (renamed from tools/binman/test/094_fmap_x86.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/fmap_section.dts (renamed from tools/binman/test/095_fmap_x86_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ifwi.bin.gz (renamed from tools/binman/test/ifwi.bin.gz) | bin | 1884 -> 1884 bytes | |||
| -rw-r--r-- | tools/binman/test/x86/intel_cmc.dts (renamed from tools/binman/test/043_intel_cmc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fit.dts (renamed from tools/binman/test/147_intel_fit.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fit_missing.dts (renamed from tools/binman/test/148_intel_fit_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fsp.dts (renamed from tools/binman/test/042_intel_fsp.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fsp_m.dts (renamed from tools/binman/test/152_intel_fsp_m.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fsp_s.dts (renamed from tools/binman/test/153_intel_fsp_s.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_fsp_t.dts (renamed from tools/binman/test/154_intel_fsp_t.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_mrc.dts (renamed from tools/binman/test/050_intel_mrc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_refcode.dts (renamed from tools/binman/test/100_intel_refcode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_vbt.dts (renamed from tools/binman/test/046_intel_vbt.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/intel_vga.dts (renamed from tools/binman/test/032_intel_vga.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/no_ucode.dts (renamed from tools/binman/test/037_x86_no_ucode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/optional_ucode.dts (renamed from tools/binman/test/044_x86_optional_ucode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/reset16.dts (renamed from tools/binman/test/144_x86_reset16.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/reset16_spl.dts (renamed from tools/binman/test/145_x86_reset16_spl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/reset16_tpl.dts (renamed from tools/binman/test/146_x86_reset16_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom.dts (renamed from tools/binman/test/029_x86_rom.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_ifwi.dts (renamed from tools/binman/test/111_x86_rom_ifwi.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_ifwi_nodata.dts (renamed from tools/binman/test/113_x86_rom_ifwi_nodata.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_ifwi_nodesc.dts (renamed from tools/binman/test/112_x86_rom_ifwi_nodesc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_ifwi_section.dts (renamed from tools/binman/test/151_x86_rom_ifwi_section.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_me.dts (renamed from tools/binman/test/031_x86_rom_me.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_me_empty.dts (renamed from tools/binman/test/163_x86_rom_me_empty.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_me_missing.dts (renamed from tools/binman/test/164_x86_rom_me_missing.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/rom_me_no_desc.dts (renamed from tools/binman/test/030_x86_rom_me_no_desc.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/single_ucode.dts (renamed from tools/binman/test/035_x86_single_ucode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/start16.dts (renamed from tools/binman/test/033_x86_start16.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/start16_spl.dts (renamed from tools/binman/test/048_x86_start16_spl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/start16_tpl.dts (renamed from tools/binman/test/081_x86_start16_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/symbols_tpl.dts (renamed from tools/binman/test/155_symbols_tpl_x86.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/tpl_ucode.dts (renamed from tools/binman/test/093_x86_tpl_ucode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode.dts (renamed from tools/binman/test/034_x86_ucode.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode_missing_node.dts (renamed from tools/binman/test/038_x86_ucode_missing_node.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode_missing_node2.dts (renamed from tools/binman/test/039_x86_ucode_missing_node2.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode_not_in_image.dts (renamed from tools/binman/test/040_x86_ucode_not_in_image.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode_spl.dts (renamed from tools/binman/test/049_x86_ucode_spl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/x86/ucode_spl_needs_retry.dts (renamed from tools/binman/test/058_x86_ucode_spl_needs_retry.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/pack_dtb.dts (renamed from tools/binman/test/026_pack_u_boot_dtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/spl_bss_pad.dts (renamed from tools/binman/test/047_spl_bss_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/tpl.dts (renamed from tools/binman/test/078_u_boot_tpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/tpl_bss_pad.dts (renamed from tools/binman/test/193_tpl_bss_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-img.dts (renamed from tools/binman/test/036_u_boot_img.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-spl-dtb.dts (renamed from tools/binman/test/051_u_boot_spl_dtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-spl-nodtb.dts (renamed from tools/binman/test/052_u_boot_spl_nodtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-spl.dts (renamed from tools/binman/test/285_spl_expand.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-tpl-nodtb.dts (renamed from tools/binman/test/192_u_boot_tpl_nodtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/u-boot-vpl-nodtb.dts (renamed from tools/binman/test/256_u_boot_vpl_nodtb.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/vpl.dts (renamed from tools/binman/test/255_u_boot_vpl.dts) | 0 | ||||
| -rw-r--r-- | tools/binman/test/xpl/vpl_bss_pad.dts (renamed from tools/binman/test/258_vpl_bss_pad.dts) | 0 | ||||
| -rw-r--r-- | tools/env/fw_env.c | 47 | ||||
| -rw-r--r-- | tools/fwumdata_src/Kconfig | 19 | ||||
| -rw-r--r-- | tools/fwumdata_src/fwumdata.c | 854 | ||||
| -rw-r--r-- | tools/fwumdata_src/fwumdata.config | 33 | ||||
| -rw-r--r-- | tools/fwumdata_src/fwumdata.h | 138 | ||||
| -rw-r--r-- | tools/fwumdata_src/fwumdata.mk | 10 | ||||
| -rw-r--r-- | tools/fwumdata_src/mkfwumdata.c (renamed from tools/mkfwumdata.c) | 106 | ||||
| -rw-r--r-- | tools/mkeficapsule.c | 113 | ||||
| -rw-r--r-- | tools/rkcommon.c | 5 | ||||
| -rw-r--r-- | tools/u_boot_pylib/test_util.py | 15 |
398 files changed, 2033 insertions, 679 deletions
diff --git a/tools/.gitignore b/tools/.gitignore index 6a5c613f772..49943d2cf3a 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -11,6 +11,7 @@ /file2include /fit_check_sign /fit_info +/fwumdata /gdb/gdbcont /gdb/gdbsend /gen_eth_addr @@ -24,6 +25,7 @@ /mkeficapsule /mkenvimage /mkexynosspl +/mkfwumdata /mkimage /mksunxiboot /mxsboot diff --git a/tools/Kconfig b/tools/Kconfig index a1b4d701ac7..ef33295b8ec 100644 --- a/tools/Kconfig +++ b/tools/Kconfig @@ -194,13 +194,6 @@ config LUT_SEQUENCE help Look Up Table Sequence -config TOOLS_MKFWUMDATA - bool "Build mkfwumdata command" - default y if FWU_MULTI_BANK_UPDATE - help - This command allows users to create a raw image of the FWU - metadata for initial installation of the FWU multi bank - update on the board. The installation method depends on - the platform. +source tools/fwumdata_src/Kconfig endmenu diff --git a/tools/Makefile b/tools/Makefile index 5d8e8f349e1..1a5f425ecda 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -272,9 +272,7 @@ mkeficapsule-objs := generated/lib/uuid.o \ mkeficapsule.o hostprogs-always-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule -mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o -HOSTLDLIBS_mkfwumdata += -luuid -hostprogs-always-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata +include tools/fwumdata_src/fwumdata.mk # We build some files with extra pedantic flags to try to minimize things # that won't build on some weird host compiler -- though there are lots of diff --git a/tools/binman/btool/mkeficapsule.py b/tools/binman/btool/mkeficapsule.py index f7e5a886849..7638c941a8e 100644 --- a/tools/binman/btool/mkeficapsule.py +++ b/tools/binman/btool/mkeficapsule.py @@ -16,7 +16,7 @@ Options: -p, --private-key <privkey file> private key file -c, --certificate <cert file> signer's certificate file -m, --monotonic-count <count> monotonic count - -d, --dump_sig dump signature (*.p7) + -d, --dump-sig dump signature to <output file>.p7 -A, --fw-accept firmware accept capsule, requires GUID, no image blob -R, --fw-revert firmware revert capsule, takes no GUID, no image blob -o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff @@ -38,7 +38,8 @@ class Bintoolmkeficapsule(bintool.Bintool): def generate_capsule(self, image_index, image_guid, hardware_instance, payload, output_fname, priv_key, pub_key, - monotonic_count=0, version=0, oemflags=0): + monotonic_count=0, version=0, oemflags=0, + dump_sig=False): """Generate a capsule through commandline-provided parameters Args: @@ -53,6 +54,7 @@ class Bintoolmkeficapsule(bintool.Bintool): monotonic_count (int): Count used when signing an image version (int): Image version (Optional) oemflags (int): Optional 16 bit OEM flags + dump_sig (bool): Dump signature to a file (Optional). Default no. Returns: str: Tool output @@ -73,6 +75,8 @@ class Bintoolmkeficapsule(bintool.Bintool): f'--private-key={priv_key}', f'--certificate={pub_key}' ] + if dump_sig: + args += [f'--dump-sig'] args += [ payload, diff --git a/tools/binman/btool/p11_kit.py b/tools/binman/btool/p11_kit.py new file mode 100644 index 00000000000..9d8d5d848b4 --- /dev/null +++ b/tools/binman/btool/p11_kit.py @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2026 Mettler Toledo Technologies GmbH +# +"""Bintool implementation for p11-kit""" + +from binman import bintool + + +class Bintoolp11_kit(bintool.Bintool): + """p11-kit -- support tool for pkcs#11 libraries""" + def __init__(self, name): + super().__init__('p11-kit', + 'Pkcs11 library modules tool', + version_args='list modules') + + def fetch(self, method): + """Install p11-kit via APT """ + if method != bintool.FETCH_BIN: + return None + + return self.apt_install('p11-kit') diff --git a/tools/binman/btool/pkcs11_tool.py b/tools/binman/btool/pkcs11_tool.py new file mode 100644 index 00000000000..673c0ea0ac3 --- /dev/null +++ b/tools/binman/btool/pkcs11_tool.py @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2026 Mettler Toledo Technologies GmbH +# +"""Bintool implementation for pkcs11-tool""" + +from binman import bintool + + +class Bintoolpkcs11_tool(bintool.Bintool): + """pkcs11-tool -- support tool for managing pkcs#11 tokens""" + def __init__(self, name): + super().__init__('pkcs11-tool', + 'PKCS #11 tokens managing tool', + version_args='--show-info') + + def fetch(self, method): + """Install opensc via APT """ + if method != bintool.FETCH_BIN: + return None + + return self.apt_install('opensc') diff --git a/tools/binman/entries.rst b/tools/binman/entries.rst index a81fcbd3891..91f855f6d7a 100644 --- a/tools/binman/entries.rst +++ b/tools/binman/entries.rst @@ -552,6 +552,10 @@ Properties / Entry arguments: - public-key-cert: Path to PEM formatted .crt public key certificate file. Mandatory property for generating signed capsules. - oem-flags - OEM flags to be passed through capsule header. + - dump-signature: Optional boolean (default: false). Instruct + mkeficapsule to write signature data to a separate file. The + filename will be <capsule file>.p7. It might be used to verify + capsule authentication with external tools. Since this is a subclass of Entry_section, all properties of the parent class also apply here. Except for the properties stated as mandatory, the diff --git a/tools/binman/entry_test.py b/tools/binman/entry_test.py index 40d74d401a2..7f00358e008 100644 --- a/tools/binman/entry_test.py +++ b/tools/binman/entry_test.py @@ -26,7 +26,7 @@ class TestEntry(unittest.TestCase): def GetNode(self): binman_dir = os.path.dirname(os.path.realpath(sys.argv[0])) fname = fdt_util.EnsureCompiled( - os.path.join(binman_dir,('test/005_simple.dts'))) + os.path.join(binman_dir,('test/pack/simple.dts'))) dtb = fdt.FdtScan(fname) return dtb.GetNode('/binman/u-boot') diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py index 9f06cc88e6e..022d57ee551 100644 --- a/tools/binman/etype/efi_capsule.py +++ b/tools/binman/etype/efi_capsule.py @@ -53,6 +53,10 @@ class Entry_efi_capsule(Entry_section): - public-key-cert: Path to PEM formatted .crt public key certificate file. Mandatory property for generating signed capsules. - oem-flags - OEM flags to be passed through capsule header. + - dump-signature: Optional boolean (default: false). Instruct + mkeficapsule to write signature data to a separate file. The + filename will be <capsule file>.p7. It might be used to verify + capsule authentication with external tools. Since this is a subclass of Entry_section, all properties of the parent class also apply here. Except for the properties stated as mandatory, the @@ -101,6 +105,7 @@ class Entry_efi_capsule(Entry_section): self.private_key = '' self.public_key_cert = '' self.auth = 0 + self.dump_signature = False def ReadNode(self): super().ReadNode() @@ -111,6 +116,7 @@ class Entry_efi_capsule(Entry_section): self.hardware_instance = fdt_util.GetInt(self._node, 'hardware-instance') self.monotonic_count = fdt_util.GetInt(self._node, 'monotonic-count') self.oem_flags = fdt_util.GetInt(self._node, 'oem-flags') + self.dump_signature = fdt_util.GetBool(self._node, 'dump-signature') self.private_key = fdt_util.GetString(self._node, 'private-key') self.public_key_cert = fdt_util.GetString(self._node, 'public-key-cert') @@ -125,10 +131,14 @@ class Entry_efi_capsule(Entry_section): private_key = '' public_key_cert = '' if self.auth: - if not os.path.isabs(self.private_key): + if not os.path.isabs(self.private_key) and not 'pkcs11:' in self.private_key: private_key = tools.get_input_filename(self.private_key) - if not os.path.isabs(self.public_key_cert): + if not os.path.isabs(self.public_key_cert) and not 'pkcs11:' in self.public_key_cert: public_key_cert = tools.get_input_filename(self.public_key_cert) + if 'pkcs11:' in self.private_key: + private_key = self.private_key + if 'pkcs11:' in self.public_key_cert: + public_key_cert = self.public_key_cert data, payload, uniq = self.collect_contents_to_file( self._entries.values(), 'capsule_in') outfile = self._filename if self._filename else 'capsule.%s' % uniq @@ -146,7 +156,8 @@ class Entry_efi_capsule(Entry_section): public_key_cert, self.monotonic_count, self.fw_version, - self.oem_flags) + self.oem_flags, + self.dump_signature) if ret is not None: return tools.read_file(capsule_fname) else: diff --git a/tools/binman/fdt_test.py b/tools/binman/fdt_test.py index 564c1770820..ef81a3262d2 100644 --- a/tools/binman/fdt_test.py +++ b/tools/binman/fdt_test.py @@ -36,12 +36,12 @@ class TestFdt(unittest.TestCase): node.DeleteProp('data') def testFdtNormal(self): - fname = self.GetCompiled('034_x86_ucode.dts') + fname = self.GetCompiled('x86/ucode.dts') dt = FdtScan(fname) self._DeleteProp(dt) def testFdtNormalProp(self): - fname = self.GetCompiled('045_prop_test.dts') + fname = self.GetCompiled('entry/prop_test.dts') dt = FdtScan(fname) node = dt.GetNode('/binman/intel-me') self.assertEqual('intel-me', node.name) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index a53e37f31b3..ca5149ee654 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -7,6 +7,7 @@ # python -m unittest func_test.TestFunctional.testHelp import collections +import configparser import glob import gzip import hashlib @@ -696,7 +697,7 @@ class TestFunctional(unittest.TestCase): @classmethod def _SetupDescriptor(cls): - with open(cls.TestFile('descriptor.bin'), 'rb') as fd: + with open(cls.TestFile('x86/descriptor.bin'), 'rb') as fd: TestFunctional._MakeInputFile('descriptor.bin', fd.read()) @classmethod @@ -816,7 +817,7 @@ class TestFunctional(unittest.TestCase): def testBoard(self): """Test that we can run it with a specific board""" - self._SetupDtb('005_simple.dts', 'sandbox/u-boot.dtb') + self._SetupDtb('pack/simple.dts', 'sandbox/u-boot.dtb') TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA) result = self._DoBinman('build', '-n', '-b', 'sandbox') self.assertEqual(0, result) @@ -843,19 +844,19 @@ class TestFunctional(unittest.TestCase): will come from the device-tree compiler (dtc). """ with self.assertRaises(Exception) as e: - self._RunBinman('build', '-d', self.TestFile('001_invalid.dts')) + self._RunBinman('build', '-d', self.TestFile('pack/invalid.dts')) self.assertIn("FATAL ERROR: Unable to parse input tree", str(e.exception)) def testMissingNode(self): """Test that a device tree without a 'binman' node generates an error""" with self.assertRaises(Exception) as e: - self._DoBinman('build', '-d', self.TestFile('002_missing_node.dts')) + self._DoBinman('build', '-d', self.TestFile('pack/missing_node.dts')) self.assertIn("does not have a 'binman' node", str(e.exception)) def testEmpty(self): """Test that an empty binman node works OK (i.e. does nothing)""" - result = self._RunBinman('build', '-d', self.TestFile('003_empty.dts')) + result = self._RunBinman('build', '-d', self.TestFile('pack/empty.dts')) self.assertEqual(0, len(result.stderr)) self.assertEqual(0, result.return_code) @@ -863,25 +864,25 @@ class TestFunctional(unittest.TestCase): """Test that an invalid entry is flagged""" with self.assertRaises(Exception) as e: result = self._RunBinman('build', '-d', - self.TestFile('004_invalid_entry.dts')) + self.TestFile('pack/invalid_entry.dts')) self.assertIn("Unknown entry type 'not-a-valid-type' in node " "'/binman/not-a-valid-type'", str(e.exception)) def testSimple(self): """Test a simple binman with a single file""" - data = self._DoReadFile('005_simple.dts') + data = self._DoReadFile('pack/simple.dts') self.assertEqual(U_BOOT_DATA, data) def testSimpleDebug(self): """Test a simple binman run with debugging enabled""" - self._DoTestFile('005_simple.dts', debug=True) + self._DoTestFile('pack/simple.dts', debug=True) def testDual(self): """Test that we can handle creating two images This also tests image padding. """ - retcode = self._DoTestFile('006_dual_image.dts') + retcode = self._DoTestFile('pack/dual_image.dts') self.assertEqual(0, retcode) image = control.images['image1'] @@ -905,13 +906,13 @@ class TestFunctional(unittest.TestCase): def testBadAlign(self): """Test that an invalid alignment value is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('007_bad_align.dts') + self._DoTestFile('pack/bad_align.dts') self.assertIn("Node '/binman/u-boot': Alignment 23 must be a power " "of two", str(e.exception)) def testPackSimple(self): """Test that packing works as expected""" - retcode = self._DoTestFile('008_pack.dts') + retcode = self._DoTestFile('pack/pack.dts') self.assertEqual(0, retcode) self.assertIn('image', control.images) image = control.images['image'] @@ -953,7 +954,7 @@ class TestFunctional(unittest.TestCase): def testPackExtra(self): """Test that extra packing feature works as expected""" - data, _, _, out_dtb_fname = self._DoReadFileDtb('009_pack_extra.dts', + data, _, _, out_dtb_fname = self._DoReadFileDtb('pack/pack_extra.dts', update_dtb=True) self.assertIn('image', control.images) @@ -1059,35 +1060,35 @@ class TestFunctional(unittest.TestCase): def testPackAlignPowerOf2(self): """Test that invalid entry alignment is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('010_pack_align_power2.dts') + self._DoTestFile('pack/pack_align_power2.dts') self.assertIn("Node '/binman/u-boot': Alignment 5 must be a power " "of two", str(e.exception)) def testPackAlignSizePowerOf2(self): """Test that invalid entry size alignment is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('011_pack_align_size_power2.dts') + self._DoTestFile('pack/pack_align_size_power2.dts') self.assertIn("Node '/binman/u-boot': Alignment size 55 must be a " "power of two", str(e.exception)) def testPackInvalidAlign(self): """Test detection of an offset that does not match its alignment""" with self.assertRaises(ValueError) as e: - self._DoTestFile('012_pack_inv_align.dts') + self._DoTestFile('pack/pack_inv_align.dts') self.assertIn("Node '/binman/u-boot': Offset 0x5 (5) does not match " "align 0x4 (4)", str(e.exception)) def testPackInvalidSizeAlign(self): """Test that invalid entry size alignment is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('013_pack_inv_size_align.dts') + self._DoTestFile('pack/pack_inv_size_align.dts') self.assertIn("Node '/binman/u-boot': Size 0x5 (5) does not match " "align-size 0x4 (4)", str(e.exception)) def testPackOverlap(self): """Test that overlapping regions are detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('014_pack_overlap.dts') + self._DoTestFile('pack/pack_overlap.dts') self.assertIn("Node '/binman/u-boot-align': Offset 0x3 (3) overlaps " "with previous entry '/binman/u-boot' ending at 0x4 (4)", str(e.exception)) @@ -1095,20 +1096,20 @@ class TestFunctional(unittest.TestCase): def testPackEntryOverflow(self): """Test that entries that overflow their size are detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('015_pack_overflow.dts') + self._DoTestFile('pack/pack_overflow.dts') self.assertIn("Node '/binman/u-boot': Entry contents size is 0x4 (4) " "but entry size is 0x3 (3)", str(e.exception)) def testPackImageOverflow(self): """Test that entries which overflow the image size are detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('016_pack_image_overflow.dts') + self._DoTestFile('pack/pack_image_overflow.dts') self.assertIn("Section '/binman': contents size 0x4 (4) exceeds section " "size 0x3 (3)", str(e.exception)) def testPackImageSize(self): """Test that the image size can be set""" - retcode = self._DoTestFile('017_pack_image_size.dts') + retcode = self._DoTestFile('pack/pack_image_size.dts') self.assertEqual(0, retcode) self.assertIn('image', control.images) image = control.images['image'] @@ -1116,7 +1117,7 @@ class TestFunctional(unittest.TestCase): def testPackImageSizeAlign(self): """Test that image size alignemnt works as expected""" - retcode = self._DoTestFile('018_pack_image_align.dts') + retcode = self._DoTestFile('pack/pack_image_align.dts') self.assertEqual(0, retcode) self.assertIn('image', control.images) image = control.images['image'] @@ -1125,27 +1126,27 @@ class TestFunctional(unittest.TestCase): def testPackInvalidImageAlign(self): """Test that invalid image alignment is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('019_pack_inv_image_align.dts') + self._DoTestFile('pack/pack_inv_image_align.dts') self.assertIn("Section '/binman': Size 0x7 (7) does not match " "align-size 0x8 (8)", str(e.exception)) def testPackAlignPowerOf2Inv(self): """Test that invalid image alignment is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('020_pack_inv_image_align_power2.dts') + self._DoTestFile('pack/pack_inv_image_align_power2.dts') self.assertIn("Image '/binman': Alignment size 131 must be a power of " "two", str(e.exception)) def testImagePadByte(self): """Test that the image pad byte can be specified""" self._SetupSplElf() - data = self._DoReadFile('021_image_pad.dts') + data = self._DoReadFile('pack/image_pad.dts') self.assertEqual(U_BOOT_SPL_DATA + tools.get_bytes(0xff, 1) + U_BOOT_DATA, data) def testImageName(self): """Test that image files can be named""" - retcode = self._DoTestFile('022_image_name.dts') + retcode = self._DoTestFile('pack/image_name.dts') self.assertEqual(0, retcode) image = control.images['image1'] fname = tools.get_output_filename('test-name') @@ -1157,13 +1158,13 @@ class TestFunctional(unittest.TestCase): def testBlobFilename(self): """Test that generic blobs can be provided by filename""" - data = self._DoReadFile('023_blob.dts') + data = self._DoReadFile('blob/blob.dts') self.assertEqual(BLOB_DATA, data) def testPackSorted(self): """Test that entries can be sorted""" self._SetupSplElf() - data = self._DoReadFile('024_sorted.dts') + data = self._DoReadFile('pack/sorted.dts') self.assertEqual(tools.get_bytes(0, 1) + U_BOOT_SPL_DATA + tools.get_bytes(0, 2) + U_BOOT_DATA, data) @@ -1171,21 +1172,21 @@ class TestFunctional(unittest.TestCase): """Test that an entry at offset 0 is not given a new offset""" self._SetupSplElf() with self.assertRaises(ValueError) as e: - self._DoTestFile('025_pack_zero_size.dts') + self._DoTestFile('pack/pack_zero_size.dts') self.assertIn("Node '/binman/u-boot-spl': Offset 0x0 (0) overlaps " "with previous entry '/binman/u-boot' ending at 0x4 (4)", str(e.exception)) def testPackUbootDtb(self): """Test that a device tree can be added to U-Boot""" - data = self._DoReadFile('026_pack_u_boot_dtb.dts') + data = self._DoReadFile('xpl/pack_dtb.dts') self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA, data) def testPackX86RomNoSize(self): """Test that the end-at-4gb property requires a size property""" self._SetupSplElf() with self.assertRaises(ValueError) as e: - self._DoTestFile('027_pack_4gb_no_size.dts') + self._DoTestFile('pack/pack_4gb_no_size.dts') self.assertIn("Image '/binman': Section size must be provided when " "using end-at-4gb", str(e.exception)) @@ -1194,7 +1195,7 @@ class TestFunctional(unittest.TestCase): together""" self._SetupSplElf() with self.assertRaises(ValueError) as e: - self._DoTestFile('098_4gb_and_skip_at_start_together.dts') + self._DoTestFile('pack/4gb_and_skip_at_start_together.dts') self.assertIn("Image '/binman': Provide either 'end-at-4gb' or " "'skip-at-start'", str(e.exception)) @@ -1202,7 +1203,7 @@ class TestFunctional(unittest.TestCase): """Test that the end-at-4gb property checks for offset boundaries""" self._SetupSplElf() with self.assertRaises(ValueError) as e: - self._DoTestFile('028_pack_4gb_outside.dts') + self._DoTestFile('pack/pack_4gb_outside.dts') self.assertIn("Node '/binman/u-boot': Offset 0x0 (0) size 0x4 (4) " "is outside the section '/binman' starting at " '0xffffffe0 (4294967264) of size 0x20 (32)', @@ -1211,7 +1212,7 @@ class TestFunctional(unittest.TestCase): def testPackX86Rom(self): """Test that a basic x86 ROM can be created""" self._SetupSplElf() - data = self._DoReadFile('029_x86_rom.dts') + data = self._DoReadFile('x86/rom.dts') self.assertEqual(U_BOOT_DATA + tools.get_bytes(0, 3) + U_BOOT_SPL_DATA + tools.get_bytes(0, 2), data) @@ -1220,7 +1221,7 @@ class TestFunctional(unittest.TestCase): try: TestFunctional._MakeInputFile('descriptor-empty.bin', b'') with self.assertRaises(ValueError) as e: - self._DoTestFile('163_x86_rom_me_empty.dts') + self._DoTestFile('x86/rom_me_empty.dts') self.assertIn("Node '/binman/intel-descriptor': Cannot find Intel Flash Descriptor (FD) signature", str(e.exception)) finally: @@ -1229,33 +1230,33 @@ class TestFunctional(unittest.TestCase): def testPackX86RomBadDesc(self): """Test that the Intel requires a descriptor entry""" with self.assertRaises(ValueError) as e: - self._DoTestFile('030_x86_rom_me_no_desc.dts') + self._DoTestFile('x86/rom_me_no_desc.dts') self.assertIn("Node '/binman/intel-me': No offset set with " "offset-unset: should another entry provide this correct " "offset?", str(e.exception)) def testPackX86RomMe(self): """Test that an x86 ROM with an ME region can be created""" - data = self._DoReadFile('031_x86_rom_me.dts') - expected_desc = tools.read_file(self.TestFile('descriptor.bin')) + data = self._DoReadFile('x86/rom_me.dts') + expected_desc = tools.read_file(self.TestFile('x86/descriptor.bin')) if data[:0x1000] != expected_desc: self.fail('Expected descriptor binary at start of image') self.assertEqual(ME_DATA, data[0x1000:0x1000 + len(ME_DATA)]) def testPackVga(self): """Test that an image with a VGA binary can be created""" - data = self._DoReadFile('032_intel_vga.dts') + data = self._DoReadFile('x86/intel_vga.dts') self.assertEqual(VGA_DATA, data[:len(VGA_DATA)]) def testPackStart16(self): """Test that an image with an x86 start16 region can be created""" - data = self._DoReadFile('033_x86_start16.dts') + data = self._DoReadFile('x86/start16.dts') self.assertEqual(X86_START16_DATA, data[:len(X86_START16_DATA)]) def testPackPowerpcMpc85xxBootpgResetvec(self): """Test that an image with powerpc-mpc85xx-bootpg-resetvec can be created""" - data = self._DoReadFile('150_powerpc_mpc85xx_bootpg_resetvec.dts') + data = self._DoReadFile('vendor/powerpc_mpc85xx_bootpg_resetvec.dts') self.assertEqual(PPC_MPC85XX_BR_DATA, data[:len(PPC_MPC85XX_BR_DATA)]) def _RunMicrocodeTest(self, dts_fname, nodtb_data, ucode_second=False): @@ -1318,7 +1319,7 @@ class TestFunctional(unittest.TestCase): u-boot.dtb with the microcode removed the microcode """ - first, pos_and_size = self._RunMicrocodeTest('034_x86_ucode.dts', + first, pos_and_size = self._RunMicrocodeTest('x86/ucode.dts', U_BOOT_NODTB_DATA) self.assertEqual(b'nodtb with microcode' + pos_and_size + b' somewhere in here', first) @@ -1335,7 +1336,7 @@ class TestFunctional(unittest.TestCase): # We need the libfdt library to run this test since only that allows # finding the offset of a property. This is required by # Entry_u_boot_dtb_with_ucode.ObtainContents(). - data = self._DoReadFile('035_x86_single_ucode.dts', True) + data = self._DoReadFile('x86/single_ucode.dts', True) second = data[len(U_BOOT_NODTB_DATA):] @@ -1362,27 +1363,27 @@ class TestFunctional(unittest.TestCase): def testUBootImg(self): """Test that u-boot.img can be put in a file""" - data = self._DoReadFile('036_u_boot_img.dts') + data = self._DoReadFile('xpl/u-boot-img.dts') self.assertEqual(U_BOOT_IMG_DATA, data) def testNoMicrocode(self): """Test that a missing microcode region is detected""" with self.assertRaises(ValueError) as e: - self._DoReadFile('037_x86_no_ucode.dts', True) + self._DoReadFile('x86/no_ucode.dts', True) self.assertIn("Node '/binman/u-boot-dtb-with-ucode': No /microcode " "node found in ", str(e.exception)) def testMicrocodeWithoutNode(self): """Test that a missing u-boot-dtb-with-ucode node is detected""" with self.assertRaises(ValueError) as e: - self._DoReadFile('038_x86_ucode_missing_node.dts', True) + self._DoReadFile('x86/ucode_missing_node.dts', True) self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find " "microcode region u-boot-dtb-with-ucode", str(e.exception)) def testMicrocodeWithoutNode2(self): """Test that a missing u-boot-ucode node is detected""" with self.assertRaises(ValueError) as e: - self._DoReadFile('039_x86_ucode_missing_node2.dts', True) + self._DoReadFile('x86/ucode_missing_node2.dts', True) self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Cannot find " "microcode region u-boot-ucode", str(e.exception)) @@ -1406,7 +1407,7 @@ class TestFunctional(unittest.TestCase): def testMicrocodeNotInImage(self): """Test that microcode must be placed within the image""" with self.assertRaises(ValueError) as e: - self._DoReadFile('040_x86_ucode_not_in_image.dts', True) + self._DoReadFile('x86/ucode_not_in_image.dts', True) self.assertIn("Node '/binman/u-boot-with-ucode-ptr': Microcode " "pointer _dt_ucode_base_size at fffffe14 is outside the " "section ranging from 00000000 to 0000002e", str(e.exception)) @@ -1415,7 +1416,7 @@ class TestFunctional(unittest.TestCase): """Test that we can cope with an image without microcode (e.g. qemu)""" TestFunctional._MakeInputFile('u-boot', tools.read_file(self.ElfTestFile('u_boot_no_ucode_ptr'))) - data, dtb, _, _ = self._DoReadFileDtb('044_x86_optional_ucode.dts', True) + data, dtb, _, _ = self._DoReadFileDtb('x86/optional_ucode.dts', True) # Now check the device tree has no microcode self.assertEqual(U_BOOT_NODTB_DATA, data[:len(U_BOOT_NODTB_DATA)]) @@ -1431,30 +1432,30 @@ class TestFunctional(unittest.TestCase): def testUnknownPosSize(self): """Test that microcode must be placed within the image""" with self.assertRaises(ValueError) as e: - self._DoReadFile('041_unknown_pos_size.dts', True) + self._DoReadFile('entry/unknown_pos_size.dts', True) self.assertIn("Section '/binman': Unable to set offset/size for unknown " "entry 'invalid-entry'", str(e.exception)) def testPackFsp(self): """Test that an image with a FSP binary can be created""" - data = self._DoReadFile('042_intel_fsp.dts') + data = self._DoReadFile('x86/intel_fsp.dts') self.assertEqual(FSP_DATA, data[:len(FSP_DATA)]) def testPackCmc(self): """Test that an image with a CMC binary can be created""" - data = self._DoReadFile('043_intel_cmc.dts') + data = self._DoReadFile('x86/intel_cmc.dts') self.assertEqual(CMC_DATA, data[:len(CMC_DATA)]) def testPackVbt(self): """Test that an image with a VBT binary can be created""" - data = self._DoReadFile('046_intel_vbt.dts') + data = self._DoReadFile('x86/intel_vbt.dts') self.assertEqual(VBT_DATA, data[:len(VBT_DATA)]) def testSplBssPad(self): """Test that we can pad SPL's BSS with zeros""" # ELF file with a '__bss_size' symbol self._SetupSplElf() - data = self._DoReadFile('047_spl_bss_pad.dts') + data = self._DoReadFile('xpl/spl_bss_pad.dts') self.assertEqual(U_BOOT_SPL_DATA + tools.get_bytes(0, 10) + U_BOOT_DATA, data) @@ -1462,13 +1463,13 @@ class TestFunctional(unittest.TestCase): """Test that a missing symbol is detected""" self._SetupSplElf('u_boot_ucode_ptr') with self.assertRaises(ValueError) as e: - self._DoReadFile('047_spl_bss_pad.dts') + self._DoReadFile('xpl/spl_bss_pad.dts') self.assertIn('Expected __bss_size symbol in spl/u-boot-spl', str(e.exception)) def testPackStart16Spl(self): """Test that an image with an x86 start16 SPL region can be created""" - data = self._DoReadFile('048_x86_start16_spl.dts') + data = self._DoReadFile('x86/start16_spl.dts') self.assertEqual(X86_START16_SPL_DATA, data[:len(X86_START16_SPL_DATA)]) def _PackUbootSplMicrocode(self, dts, ucode_second=False): @@ -1494,7 +1495,7 @@ class TestFunctional(unittest.TestCase): def testPackUbootSplMicrocode(self): """Test that x86 microcode can be handled correctly in SPL""" self._SetupSplElf() - self._PackUbootSplMicrocode('049_x86_ucode_spl.dts') + self._PackUbootSplMicrocode('x86/ucode_spl.dts') def testPackUbootSplMicrocodeReorder(self): """Test that order doesn't matter for microcode entries @@ -1503,24 +1504,24 @@ class TestFunctional(unittest.TestCase): u-boot-ucode entry we have not yet seen the u-boot-dtb-with-ucode entry, so we reply on binman to try later. """ - self._PackUbootSplMicrocode('058_x86_ucode_spl_needs_retry.dts', + self._PackUbootSplMicrocode('x86/ucode_spl_needs_retry.dts', ucode_second=True) def testPackMrc(self): """Test that an image with an MRC binary can be created""" - data = self._DoReadFile('050_intel_mrc.dts') + data = self._DoReadFile('x86/intel_mrc.dts') self.assertEqual(MRC_DATA, data[:len(MRC_DATA)]) def testSplDtb(self): """Test that an image with spl/u-boot-spl.dtb can be created""" self._SetupSplElf() - data = self._DoReadFile('051_u_boot_spl_dtb.dts') + data = self._DoReadFile('xpl/u-boot-spl-dtb.dts') self.assertEqual(U_BOOT_SPL_DTB_DATA, data[:len(U_BOOT_SPL_DTB_DATA)]) def testSplNoDtb(self): """Test that an image with spl/u-boot-spl-nodtb.bin can be created""" self._SetupSplElf() - data = self._DoReadFile('052_u_boot_spl_nodtb.dts') + data = self._DoReadFile('xpl/u-boot-spl-nodtb.dts') self.assertEqual(U_BOOT_SPL_NODTB_DATA, data[:len(U_BOOT_SPL_NODTB_DATA)]) def checkSymbols(self, dts, base_data, u_boot_offset, entry_args=None, @@ -1611,22 +1612,22 @@ class TestFunctional(unittest.TestCase): def testSymbols(self): """Test binman can assign symbols embedded in U-Boot""" - self.checkSymbols('053_symbols.dts', U_BOOT_SPL_DATA, 0x1c) + self.checkSymbols('symbols/symbols.dts', U_BOOT_SPL_DATA, 0x1c) def testSymbolsNoDtb(self): """Test binman can assign symbols embedded in U-Boot SPL""" - self.checkSymbols('196_symbols_nodtb.dts', + self.checkSymbols('symbols/nodtb.dts', U_BOOT_SPL_NODTB_DATA + U_BOOT_SPL_DTB_DATA, 0x38) def testPackUnitAddress(self): """Test that we support multiple binaries with the same name""" - data = self._DoReadFile('054_unit_address.dts') + data = self._DoReadFile('pack/unit_address.dts') self.assertEqual(U_BOOT_DATA + U_BOOT_DATA, data) def testSections(self): """Basic test of sections""" - data = self._DoReadFile('055_sections.dts') + data = self._DoReadFile('entry/sections.dts') expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) + U_BOOT_DATA + tools.get_bytes(ord('a'), 12) + U_BOOT_DATA + tools.get_bytes(ord('&'), 4)) @@ -1634,7 +1635,7 @@ class TestFunctional(unittest.TestCase): def testMap(self): """Tests outputting a map of the images""" - _, _, map_data, _ = self._DoReadFileDtb('055_sections.dts', map=True) + _, _, map_data, _ = self._DoReadFileDtb('entry/sections.dts', map=True) self.assertEqual('''ImagePos Offset Size Name 00000000 00000000 00000028 image 00000000 00000000 00000010 section@0 @@ -1647,7 +1648,7 @@ class TestFunctional(unittest.TestCase): def testNamePrefix(self): """Tests that name prefixes are used""" - _, _, map_data, _ = self._DoReadFileDtb('056_name_prefix.dts', map=True) + _, _, map_data, _ = self._DoReadFileDtb('entry/name_prefix.dts', map=True) self.assertEqual('''ImagePos Offset Size Name 00000000 00000000 00000028 image 00000000 00000000 00000010 section@0 @@ -1659,7 +1660,7 @@ class TestFunctional(unittest.TestCase): def testUnknownContents(self): """Test that obtaining the contents works as expected""" with self.assertRaises(ValueError) as e: - self._DoReadFile('057_unknown_contents.dts', True) + self._DoReadFile('entry/unknown_contents.dts', True) self.assertIn("Image '/binman': Internal error: Could not complete " "processing of contents: remaining [" "<binman.etype._testing.Entry__testing ", str(e.exception)) @@ -1669,7 +1670,7 @@ class TestFunctional(unittest.TestCase): try: state.SetAllowEntryExpansion(False) with self.assertRaises(ValueError) as e: - self._DoReadFile('059_change_size.dts', True) + self._DoReadFile('pack/change_size.dts', True) self.assertIn("Node '/binman/_testing': Cannot update entry size from 2 to 3", str(e.exception)) finally: @@ -1677,7 +1678,7 @@ class TestFunctional(unittest.TestCase): def testUpdateFdt(self): """Test that we can update the device tree with offset/size info""" - _, _, _, out_dtb_fname = self._DoReadFileDtb('060_fdt_update.dts', + _, _, _, out_dtb_fname = self._DoReadFileDtb('fdt/update.dts', update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -1707,7 +1708,7 @@ class TestFunctional(unittest.TestCase): def testUpdateFdtBad(self): """Test that we detect when ProcessFdt never completes""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('061_fdt_update_bad.dts', update_dtb=True) + self._DoReadFileDtb('fdt/update_bad.dts', update_dtb=True) self.assertIn('Could not complete processing of Fdt: remaining ' '[<binman.etype._testing.Entry__testing', str(e.exception)) @@ -1718,7 +1719,7 @@ class TestFunctional(unittest.TestCase): 'test-str-arg': 'test1', 'test-int-arg': '456', } - self._DoReadFileDtb('062_entry_args.dts', entry_args=entry_args) + self._DoReadFileDtb('entry/entry_args.dts', entry_args=entry_args) self.assertIn('image', control.images) entry = control.images['image'].GetEntries()['_testing'] self.assertEqual('test0', entry.test_str_fdt) @@ -1731,7 +1732,7 @@ class TestFunctional(unittest.TestCase): entry_args = { 'test-int-arg': '456', } - self._DoReadFileDtb('063_entry_args_missing.dts', entry_args=entry_args) + self._DoReadFileDtb('entry/entry_args_missing.dts', entry_args=entry_args) entry = control.images['image'].GetEntries()['_testing'] self.assertEqual('test0', entry.test_str_fdt) self.assertEqual(None, entry.test_str_arg) @@ -1744,7 +1745,7 @@ class TestFunctional(unittest.TestCase): 'test-int-arg': '456', } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('064_entry_args_required.dts') + self._DoReadFileDtb('entry/entry_args_required.dts') self.assertIn("Node '/binman/_testing': " 'Missing required properties/entry args: test-str-arg, ' 'test-int-fdt, test-int-arg', @@ -1752,7 +1753,7 @@ class TestFunctional(unittest.TestCase): def testEntryArgsInvalidFormat(self): """Test that an invalid entry-argument format is detected""" - args = ['build', '-d', self.TestFile('064_entry_args_required.dts'), + args = ['build', '-d', self.TestFile('entry/entry_args_required.dts'), '-ano-value'] with self.assertRaises(ValueError) as e: self._DoBinman(*args) @@ -1764,7 +1765,7 @@ class TestFunctional(unittest.TestCase): 'test-int-arg': 'abc', } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('062_entry_args.dts', entry_args=entry_args) + self._DoReadFileDtb('entry/entry_args.dts', entry_args=entry_args) self.assertIn("Node '/binman/_testing': Cannot convert entry arg " "'test-int-arg' (value 'abc') to integer", str(e.exception)) @@ -1780,7 +1781,7 @@ class TestFunctional(unittest.TestCase): 'test-bad-datatype-arg': '12', } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('065_entry_args_unknown_datatype.dts', + self._DoReadFileDtb('entry/entry_args_unknown_datatype.dts', entry_args=entry_args) self.assertIn('GetArg() internal error: Unknown data type ', str(e.exception)) @@ -1792,7 +1793,7 @@ class TestFunctional(unittest.TestCase): 'test-id2': TEXT_DATA2, 'test-id3': TEXT_DATA3, } - data, _, _, _ = self._DoReadFileDtb('066_text.dts', + data, _, _, _ = self._DoReadFileDtb('entry/text.dts', entry_args=entry_args) expected = (tools.to_bytes(TEXT_DATA) + tools.get_bytes(0, 8 - len(TEXT_DATA)) + @@ -1816,7 +1817,7 @@ class TestFunctional(unittest.TestCase): def testFmap(self): """Basic test of generation of a flashrom fmap""" - data = self._DoReadFile('067_fmap.dts') + data = self._DoReadFile('cros/fmap.dts') fhdr, fentries = fmap_util.DecodeFmap(data[32:]) expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) + U_BOOT_DATA + tools.get_bytes(ord('a'), 12)) @@ -1866,18 +1867,18 @@ class TestFunctional(unittest.TestCase): entry_args = { 'cros-ec-rw-path': 'ecrw.bin', } - self._DoReadFileDtb('068_blob_named_by_arg.dts', entry_args=entry_args) + self._DoReadFileDtb('blob/named_by_arg.dts', entry_args=entry_args) def testFill(self): """Test for an fill entry type""" - data = self._DoReadFile('069_fill.dts') + data = self._DoReadFile('entry/fill.dts') expected = tools.get_bytes(0xff, 8) + tools.get_bytes(0, 8) self.assertEqual(expected, data) def testFillNoSize(self): """Test for an fill entry type with no size""" with self.assertRaises(ValueError) as e: - self._DoReadFile('070_fill_no_size.dts') + self._DoReadFile('entry/fill_no_size.dts') self.assertIn("'fill' entry is missing properties: size", str(e.exception)) @@ -1898,7 +1899,7 @@ class TestFunctional(unittest.TestCase): 'keydir': 'devkeys', 'bmpblk': 'bmpblk.bin', } - data, _, _, _ = self._DoReadFileDtb('071_gbb.dts', entry_args=entry_args) + data, _, _, _ = self._DoReadFileDtb('cros/gbb.dts', entry_args=entry_args) # Since futility expected = (GBB_DATA + GBB_DATA + tools.get_bytes(0, 8) + @@ -1908,14 +1909,14 @@ class TestFunctional(unittest.TestCase): def testGbbTooSmall(self): """Test for the Chromium OS Google Binary Block being large enough""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('072_gbb_too_small.dts') + self._DoReadFileDtb('cros/gbb_too_small.dts') self.assertIn("Node '/binman/gbb': GBB is too small", str(e.exception)) def testGbbNoSize(self): """Test for the Chromium OS Google Binary Block having a size""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('073_gbb_no_size.dts') + self._DoReadFileDtb('cros/gbb_no_size.dts') self.assertIn("Node '/binman/gbb': GBB must have a fixed size", str(e.exception)) @@ -1925,7 +1926,7 @@ class TestFunctional(unittest.TestCase): 'keydir': 'devkeys', } with terminal.capture() as (_, stderr): - self._DoTestFile('071_gbb.dts', force_missing_bintools='futility', + self._DoTestFile('cros/gbb.dts', force_missing_bintools='futility', entry_args=entry_args) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: futility") @@ -1966,7 +1967,7 @@ class TestFunctional(unittest.TestCase): entry_args = { 'keydir': 'devkeys', } - data, _, _, _ = self._DoReadFileDtb('074_vblock.dts', + data, _, _, _ = self._DoReadFileDtb('cros/vblock.dts', entry_args=entry_args) expected = U_BOOT_DATA + VBLOCK_DATA + U_BOOT_DTB_DATA self.assertEqual(expected, data) @@ -1974,21 +1975,21 @@ class TestFunctional(unittest.TestCase): def testVblockNoContent(self): """Test we detect a vblock which has no content to sign""" with self.assertRaises(ValueError) as e: - self._DoReadFile('075_vblock_no_content.dts') + self._DoReadFile('cros/vblock_no_content.dts') self.assertIn("Node '/binman/vblock': Collection must have a 'content' " 'property', str(e.exception)) def testVblockBadPhandle(self): """Test that we detect a vblock with an invalid phandle in contents""" with self.assertRaises(ValueError) as e: - self._DoReadFile('076_vblock_bad_phandle.dts') + self._DoReadFile('cros/vblock_bad_phandle.dts') self.assertIn("Node '/binman/vblock': Cannot find node for phandle " '1000', str(e.exception)) def testVblockBadEntry(self): """Test that we detect an entry that points to a non-entry""" with self.assertRaises(ValueError) as e: - self._DoReadFile('077_vblock_bad_entry.dts') + self._DoReadFile('cros/vblock_bad_entry.dts') self.assertIn("Node '/binman/vblock': Cannot find entry for node " "'other'", str(e.exception)) @@ -2000,7 +2001,7 @@ class TestFunctional(unittest.TestCase): 'keydir': 'devkeys', } data = self._DoReadFileDtb( - '189_vblock_content.dts', use_real_dtb=True, update_dtb=True, + 'cros/vblock_content.dts', use_real_dtb=True, update_dtb=True, entry_args=entry_args)[0] hashlen = 32 # SHA256 hash is 32 bytes self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) @@ -2021,7 +2022,7 @@ class TestFunctional(unittest.TestCase): 'keydir': 'devkeys', } with terminal.capture() as (_, stderr): - self._DoTestFile('074_vblock.dts', + self._DoTestFile('cros/vblock.dts', force_missing_bintools='futility', entry_args=entry_args) err = stderr.getvalue() @@ -2031,31 +2032,31 @@ class TestFunctional(unittest.TestCase): """Test that an image with TPL and its device tree can be created""" # ELF file with a '__bss_size' symbol self._SetupTplElf() - data = self._DoReadFile('078_u_boot_tpl.dts') + data = self._DoReadFile('xpl/tpl.dts') self.assertEqual(U_BOOT_TPL_DATA + U_BOOT_TPL_DTB_DATA, data) def testUsesPos(self): """Test that the 'pos' property cannot be used anymore""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('079_uses_pos.dts') + data = self._DoReadFile('pack/uses_pos.dts') self.assertIn("Node '/binman/u-boot': Please use 'offset' instead of " "'pos'", str(e.exception)) def testFillZero(self): """Test for an fill entry type with a size of 0""" - data = self._DoReadFile('080_fill_empty.dts') + data = self._DoReadFile('entry/fill_empty.dts') self.assertEqual(tools.get_bytes(0, 16), data) def testTextMissing(self): """Test for a text entry type where there is no text""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('066_text.dts',) + self._DoReadFileDtb('entry/text.dts',) self.assertIn("Node '/binman/text': No value provided for text label " "'test-id'", str(e.exception)) def testPackStart16Tpl(self): """Test that an image with an x86 start16 TPL region can be created""" - data = self._DoReadFile('081_x86_start16_tpl.dts') + data = self._DoReadFile('x86/start16_tpl.dts') self.assertEqual(X86_START16_TPL_DATA, data[:len(X86_START16_TPL_DATA)]) def testSelectImage(self): @@ -2065,7 +2066,7 @@ class TestFunctional(unittest.TestCase): # We should only get the expected message in verbose mode for verbosity in (0, 2): with terminal.capture() as (stdout, stderr): - retcode = self._DoTestFile('006_dual_image.dts', + retcode = self._DoTestFile('pack/dual_image.dts', verbosity=verbosity, images=['image2']) self.assertEqual(0, retcode) @@ -2082,7 +2083,7 @@ class TestFunctional(unittest.TestCase): """Test that all device trees are updated with offset/size info""" self._SetupSplElf() self._SetupTplElf() - data = self._DoReadFileRealDtb('082_fdt_update_all.dts') + data = self._DoReadFileRealDtb('fdt/update_all.dts') base_expected = { 'offset': 0, @@ -2125,12 +2126,12 @@ class TestFunctional(unittest.TestCase): def testUpdateFdtOutput(self): """Test that output DTB files are updated""" try: - data, dtb_data, _, _ = self._DoReadFileDtb('082_fdt_update_all.dts', + data, dtb_data, _, _ = self._DoReadFileDtb('fdt/update_all.dts', use_real_dtb=True, update_dtb=True, reset_dtbs=False) # Unfortunately, compiling a source file always results in a file # called source.dtb (see fdt_util.EnsureCompiled()). The test - # source file (e.g. test/075_fdt_update_all.dts) thus does not enter + # source file (e.g. test/fdt/fdt_update_all.dts) thus does not enter # binman as a file called u-boot.dtb. To fix this, copy the file # over to the expected place. start = 0 @@ -2162,7 +2163,7 @@ class TestFunctional(unittest.TestCase): def testCompress(self): """Test compression of blobs""" self._CheckLz4() - data, _, _, out_dtb_fname = self._DoReadFileDtb('083_compress.dts', + data, _, _, out_dtb_fname = self._DoReadFileDtb('entry/compress.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -2192,13 +2193,13 @@ class TestFunctional(unittest.TestCase): def testFiles(self): """Test bringing in multiple files""" - data = self._DoReadFile('084_files.dts') + data = self._DoReadFile('entry/files.dts') self.assertEqual(FILES_DATA, data) def testFilesCompress(self): """Test bringing in multiple files and compressing them""" self._CheckLz4() - data = self._DoReadFile('085_files_compress.dts') + data = self._DoReadFile('entry/files_compress.dts') image = control.images['image'] entries = image.GetEntries() @@ -2218,20 +2219,20 @@ class TestFunctional(unittest.TestCase): def testFilesMissing(self): """Test missing files""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('086_files_none.dts') + data = self._DoReadFile('entry/files_none.dts') self.assertIn("Node '/binman/files': Pattern \'files/*.none\' matched " 'no files', str(e.exception)) def testFilesNoPattern(self): """Test missing files""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('087_files_no_pattern.dts') + data = self._DoReadFile('entry/files_no_pattern.dts') self.assertIn("Node '/binman/files': Missing 'pattern' property", str(e.exception)) def testExtendSize(self): """Test an extending entry""" - data, _, map_data, _ = self._DoReadFileDtb('088_extend_size.dts', + data, _, map_data, _ = self._DoReadFileDtb('pack/extend_size.dts', map=True) expect = (tools.get_bytes(ord('a'), 8) + U_BOOT_DATA + MRC_DATA + tools.get_bytes(ord('b'), 1) + U_BOOT_DATA + @@ -2255,13 +2256,13 @@ class TestFunctional(unittest.TestCase): """Test an extending entry which fails to provide contents""" with terminal.capture() as (stdout, stderr): with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('089_extend_size_bad.dts', map=True) + self._DoReadFileDtb('pack/extend_size_bad.dts', map=True) self.assertIn("Node '/binman/_testing': Cannot obtain contents when " 'expanding entry', str(e.exception)) def testHash(self): """Test hashing of the contents of an entry""" - _, _, _, out_dtb_fname = self._DoReadFileDtb('090_hash.dts', + _, _, _, out_dtb_fname = self._DoReadFileDtb('security/hash.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -2272,19 +2273,19 @@ class TestFunctional(unittest.TestCase): def testHashNoAlgo(self): with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('091_hash_no_algo.dts', update_dtb=True) + self._DoReadFileDtb('security/hash_no_algo.dts', update_dtb=True) self.assertIn("Node \'/binman/u-boot\': Missing \'algo\' property for " 'hash node', str(e.exception)) def testHashBadAlgo(self): with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('092_hash_bad_algo.dts', update_dtb=True) + self._DoReadFileDtb('security/hash_bad_algo.dts', update_dtb=True) self.assertIn("Node '/binman/u-boot': Unknown hash algorithm 'invalid'", str(e.exception)) def testHashSection(self): """Test hashing of the contents of an entry""" - _, _, _, out_dtb_fname = self._DoReadFileDtb('099_hash_section.dts', + _, _, _, out_dtb_fname = self._DoReadFileDtb('security/hash_section.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -2304,14 +2305,14 @@ class TestFunctional(unittest.TestCase): the microcode """ self._SetupTplElf('u_boot_ucode_ptr') - first, pos_and_size = self._RunMicrocodeTest('093_x86_tpl_ucode.dts', + first, pos_and_size = self._RunMicrocodeTest('x86/tpl_ucode.dts', U_BOOT_TPL_NODTB_DATA) self.assertEqual(b'tplnodtb with microc' + pos_and_size + b'ter somewhere in here', first) def testFmapX86(self): """Basic test of generation of a flashrom fmap""" - data = self._DoReadFile('094_fmap_x86.dts') + data = self._DoReadFile('x86/fmap.dts') fhdr, fentries = fmap_util.DecodeFmap(data[32:]) expected = U_BOOT_DATA + MRC_DATA + tools.get_bytes(ord('a'), 32 - 7) self.assertEqual(expected, data[:32]) @@ -2335,7 +2336,7 @@ class TestFunctional(unittest.TestCase): def testFmapX86Section(self): """Basic test of generation of a flashrom fmap""" - data = self._DoReadFile('095_fmap_x86_section.dts') + data = self._DoReadFile('x86/fmap_section.dts') expected = U_BOOT_DATA + MRC_DATA + tools.get_bytes(ord('b'), 32 - 7) self.assertEqual(expected, data[:32]) fhdr, fentries = fmap_util.DecodeFmap(data[36:]) @@ -2371,20 +2372,20 @@ class TestFunctional(unittest.TestCase): self._SetupTplElf() with open(self.ElfTestFile('bss_data'), 'rb') as fd: TestFunctional._MakeInputFile('-boot', fd.read()) - data = self._DoReadFile('096_elf.dts') + data = self._DoReadFile('entry/elf.dts') def testElfStrip(self): """Basic test of ELF entries""" self._SetupSplElf() with open(self.ElfTestFile('bss_data'), 'rb') as fd: TestFunctional._MakeInputFile('-boot', fd.read()) - data = self._DoReadFile('097_elf_strip.dts') + data = self._DoReadFile('entry/elf_strip.dts') def testPackOverlapMap(self): """Test that overlapping regions are detected""" with terminal.capture() as (stdout, stderr): with self.assertRaises(ValueError) as e: - self._DoTestFile('014_pack_overlap.dts', map=True) + self._DoTestFile('pack/pack_overlap.dts', map=True) map_fname = tools.get_output_filename('image.map') self.assertEqual("Wrote map file '%s' to show errors\n" % map_fname, stdout.getvalue()) @@ -2401,12 +2402,12 @@ class TestFunctional(unittest.TestCase): def testPackRefCode(self): """Test that an image with an Intel Reference code binary works""" - data = self._DoReadFile('100_intel_refcode.dts') + data = self._DoReadFile('x86/intel_refcode.dts') self.assertEqual(REFCODE_DATA, data[:len(REFCODE_DATA)]) def testSectionOffset(self): """Tests use of a section with an offset""" - data, _, map_data, _ = self._DoReadFileDtb('101_sections_offset.dts', + data, _, map_data, _ = self._DoReadFileDtb('pack/sections_offset.dts', map=True) self.assertEqual('''ImagePos Offset Size Name 00000000 00000000 00000038 image @@ -2432,7 +2433,7 @@ class TestFunctional(unittest.TestCase): cbfs_util_test.py. The tests here merely check that the files added to the CBFS can be found in the final image. """ - data = self._DoReadFile('102_cbfs_raw.dts') + data = self._DoReadFile('cbfs/raw.dts') size = 0xb0 cbfs = cbfs_util.CbfsReader(data) @@ -2444,7 +2445,7 @@ class TestFunctional(unittest.TestCase): def testCbfsArch(self): """Test on non-x86 architecture""" - data = self._DoReadFile('103_cbfs_raw_ppc.dts') + data = self._DoReadFile('cbfs/raw_ppc.dts') size = 0x100 cbfs = cbfs_util.CbfsReader(data) @@ -2462,7 +2463,7 @@ class TestFunctional(unittest.TestCase): elf.MakeElf(elf_fname, U_BOOT_DATA, U_BOOT_DTB_DATA) size = 0xb0 - data = self._DoReadFile('104_cbfs_stage.dts') + data = self._DoReadFile('cbfs/stage.dts') cbfs = cbfs_util.CbfsReader(data) self.assertEqual(size, cbfs.rom_size) @@ -2473,7 +2474,7 @@ class TestFunctional(unittest.TestCase): def testCbfsRawCompress(self): """Test handling of compressing raw files""" self._CheckLz4() - data = self._DoReadFile('105_cbfs_raw_compress.dts') + data = self._DoReadFile('cbfs/raw_compress.dts') size = 0x140 cbfs = cbfs_util.CbfsReader(data) @@ -2484,32 +2485,32 @@ class TestFunctional(unittest.TestCase): def testCbfsBadArch(self): """Test handling of a bad architecture""" with self.assertRaises(ValueError) as e: - self._DoReadFile('106_cbfs_bad_arch.dts') + self._DoReadFile('cbfs/bad_arch.dts') self.assertIn("Invalid architecture 'bad-arch'", str(e.exception)) def testCbfsNoSize(self): """Test handling of a missing size property""" with self.assertRaises(ValueError) as e: - self._DoReadFile('107_cbfs_no_size.dts') + self._DoReadFile('cbfs/no_size.dts') self.assertIn('entry must have a size property', str(e.exception)) def testCbfsNoContents(self): """Test handling of a CBFS entry which does not provide contentsy""" with self.assertRaises(ValueError) as e: - self._DoReadFile('108_cbfs_no_contents.dts') + self._DoReadFile('cbfs/no_contents.dts') self.assertIn('Could not complete processing of contents', str(e.exception)) def testCbfsBadCompress(self): """Test handling of a bad architecture""" with self.assertRaises(ValueError) as e: - self._DoReadFile('109_cbfs_bad_compress.dts') + self._DoReadFile('cbfs/bad_compress.dts') self.assertIn("Invalid compression in 'u-boot': 'invalid-algo'", str(e.exception)) def testCbfsNamedEntries(self): """Test handling of named entries""" - data = self._DoReadFile('110_cbfs_name.dts') + data = self._DoReadFile('cbfs/name.dts') cbfs = cbfs_util.CbfsReader(data) self.assertIn('FRED', cbfs.files) @@ -2530,7 +2531,7 @@ class TestFunctional(unittest.TestCase): self._SetupTplElf() # Intel Integrated Firmware Image (IFWI) file - with gzip.open(self.TestFile('%s.gz' % fname), 'rb') as fd: + with gzip.open(self.TestFile('x86/%s.gz' % fname), 'rb') as fd: data = fd.read() TestFunctional._MakeInputFile(fname,data) @@ -2540,7 +2541,7 @@ class TestFunctional(unittest.TestCase): Args: data: Conents of output file """ - expected_desc = tools.read_file(self.TestFile('descriptor.bin')) + expected_desc = tools.read_file(self.TestFile('x86/descriptor.bin')) if data[:0x1000] != expected_desc: self.fail('Expected descriptor binary at start of image') @@ -2556,20 +2557,20 @@ class TestFunctional(unittest.TestCase): def testPackX86RomIfwi(self): """Test that an x86 ROM with Integrated Firmware Image can be created""" self._SetupIfwi('fitimage.bin') - data = self._DoReadFile('111_x86_rom_ifwi.dts') + data = self._DoReadFile('x86/rom_ifwi.dts') self._CheckIfwi(data) def testPackX86RomIfwiNoDesc(self): """Test that an x86 ROM with IFWI can be created from an ifwi.bin file""" self._SetupIfwi('ifwi.bin') - data = self._DoReadFile('112_x86_rom_ifwi_nodesc.dts') + data = self._DoReadFile('x86/rom_ifwi_nodesc.dts') self._CheckIfwi(data) def testPackX86RomIfwiNoData(self): """Test that an x86 ROM with IFWI handles missing data""" self._SetupIfwi('ifwi.bin') with self.assertRaises(ValueError) as e: - data = self._DoReadFile('113_x86_rom_ifwi_nodata.dts') + data = self._DoReadFile('x86/rom_ifwi_nodata.dts') self.assertIn('Could not complete processing of contents', str(e.exception)) @@ -2577,7 +2578,7 @@ class TestFunctional(unittest.TestCase): """Test that binman still produces an image if ifwitool is missing""" self._SetupIfwi('fitimage.bin') with terminal.capture() as (_, stderr): - self._DoTestFile('111_x86_rom_ifwi.dts', + self._DoTestFile('x86/rom_ifwi.dts', force_missing_bintools='ifwitool') err = stderr.getvalue() self.assertRegex(err, @@ -2589,7 +2590,7 @@ class TestFunctional(unittest.TestCase): Like all CFBS tests, this is just checking the logic that calls cbfs_util. See cbfs_util_test for fully tests (e.g. test_cbfs_offset()). """ - data = self._DoReadFile('114_cbfs_offset.dts') + data = self._DoReadFile('cbfs/offset.dts') size = 0x200 cbfs = cbfs_util.CbfsReader(data) @@ -2607,7 +2608,7 @@ class TestFunctional(unittest.TestCase): def testFdtmap(self): """Test an FDT map can be inserted in the image""" - data = self.data = self._DoReadFileRealDtb('115_fdtmap.dts') + data = self.data = self._DoReadFileRealDtb('fdt/fdtmap.dts') fdtmap_data = data[len(U_BOOT_DATA):] magic = fdtmap_data[:8] self.assertEqual(b'_FDTMAP_', magic) @@ -2631,7 +2632,7 @@ class TestFunctional(unittest.TestCase): def testFdtmapNoMatch(self): """Check handling of an FDT map when the section cannot be found""" - self.data = self._DoReadFileRealDtb('115_fdtmap.dts') + self.data = self._DoReadFileRealDtb('fdt/fdtmap.dts') # Mangle the section name, which should cause a mismatch between the # correct FDT path and the one expected by the section @@ -2646,7 +2647,7 @@ class TestFunctional(unittest.TestCase): def testFdtmapHeader(self): """Test an FDT map and image header can be inserted in the image""" - data = self.data = self._DoReadFileRealDtb('116_fdtmap_hdr.dts') + data = self.data = self._DoReadFileRealDtb('fdt/fdtmap_hdr.dts') fdtmap_pos = len(U_BOOT_DATA) fdtmap_data = data[fdtmap_pos:] fdt_data = fdtmap_data[16:] @@ -2659,7 +2660,7 @@ class TestFunctional(unittest.TestCase): def testFdtmapHeaderStart(self): """Test an image header can be inserted at the image start""" - data = self.data = self._DoReadFileRealDtb('117_fdtmap_hdr_start.dts') + data = self.data = self._DoReadFileRealDtb('fdt/fdtmap_hdr_start.dts') fdtmap_pos = 0x100 + len(U_BOOT_DATA) hdr_data = data[:8] self.assertEqual(b'BinM', hdr_data[:4]) @@ -2668,7 +2669,7 @@ class TestFunctional(unittest.TestCase): def testFdtmapHeaderPos(self): """Test an image header can be inserted at a chosen position""" - data = self.data = self._DoReadFileRealDtb('118_fdtmap_hdr_pos.dts') + data = self.data = self._DoReadFileRealDtb('fdt/fdtmap_hdr_pos.dts') fdtmap_pos = 0x100 + len(U_BOOT_DATA) hdr_data = data[0x80:0x88] self.assertEqual(b'BinM', hdr_data[:4]) @@ -2678,20 +2679,20 @@ class TestFunctional(unittest.TestCase): def testHeaderMissingFdtmap(self): """Test an image header requires an fdtmap""" with self.assertRaises(ValueError) as e: - self.data = self._DoReadFileRealDtb('119_fdtmap_hdr_missing.dts') + self.data = self._DoReadFileRealDtb('fdt/fdtmap_hdr_missing.dts') self.assertIn("'image_header' section must have an 'fdtmap' sibling", str(e.exception)) def testHeaderNoLocation(self): """Test an image header with a no specified location is detected""" with self.assertRaises(ValueError) as e: - self.data = self._DoReadFileRealDtb('120_hdr_no_location.dts') + self.data = self._DoReadFileRealDtb('fdt/hdr_no_location.dts') self.assertIn("Invalid location 'None', expected 'start' or 'end'", str(e.exception)) def testEntryExpand(self): """Test extending an entry after it is packed""" - data = self._DoReadFile('121_entry_extend.dts') + data = self._DoReadFile('pack/entry_extend.dts') self.assertEqual(b'aaa', data[:3]) self.assertEqual(U_BOOT_DATA, data[3:3 + len(U_BOOT_DATA)]) self.assertEqual(b'aaa', data[-3:]) @@ -2699,13 +2700,13 @@ class TestFunctional(unittest.TestCase): def testEntryExtendBad(self): """Test extending an entry after it is packed, twice""" with self.assertRaises(ValueError) as e: - self._DoReadFile('122_entry_extend_twice.dts') + self._DoReadFile('pack/entry_extend_twice.dts') self.assertIn("Image '/binman': Entries changed size after packing", str(e.exception)) def testEntryExtendSection(self): """Test extending an entry within a section after it is packed""" - data = self._DoReadFile('123_entry_extend_section.dts') + data = self._DoReadFile('pack/entry_extend_section.dts') self.assertEqual(b'aaa', data[:3]) self.assertEqual(U_BOOT_DATA, data[3:3 + len(U_BOOT_DATA)]) self.assertEqual(b'aaa', data[-3:]) @@ -2713,7 +2714,7 @@ class TestFunctional(unittest.TestCase): def testCompressDtb(self): """Test that compress of device-tree files is supported""" self._CheckLz4() - data = self.data = self._DoReadFileRealDtb('124_compress_dtb.dts') + data = self.data = self._DoReadFileRealDtb('fdt/compress_dtb.dts') self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) comp_data = data[len(U_BOOT_DATA):] orig = self._decompress(comp_data) @@ -2731,7 +2732,7 @@ class TestFunctional(unittest.TestCase): def testCbfsUpdateFdt(self): """Test that we can update the device tree with CBFS offset/size info""" self._CheckLz4() - data, _, _, out_dtb_fname = self._DoReadFileDtb('125_cbfs_update.dts', + data, _, _, out_dtb_fname = self._DoReadFileDtb('cbfs/update.dts', update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -2755,13 +2756,13 @@ class TestFunctional(unittest.TestCase): def testCbfsBadType(self): """Test an image header with a no specified location is detected""" with self.assertRaises(ValueError) as e: - self._DoReadFile('126_cbfs_bad_type.dts') + self._DoReadFile('cbfs/bad_type.dts') self.assertIn("Unknown cbfs-type 'badtype'", str(e.exception)) def testList(self): """Test listing the files in an image""" self._CheckLz4() - data = self._DoReadFile('127_list.dts') + data = self._DoReadFile('entry/list.dts') image = control.images['image'] entries = image.BuildEntryList() self.assertEqual(7, len(entries)) @@ -2837,7 +2838,7 @@ class TestFunctional(unittest.TestCase): def testFindFdtmap(self): """Test locating an FDT map in an image""" self._CheckLz4() - data = self.data = self._DoReadFileRealDtb('128_decode_image.dts') + data = self.data = self._DoReadFileRealDtb('fdt/decode_image.dts') image = control.images['image'] entries = image.GetEntries() entry = entries['fdtmap'] @@ -2845,13 +2846,13 @@ class TestFunctional(unittest.TestCase): def testFindFdtmapMissing(self): """Test failing to locate an FDP map""" - data = self._DoReadFile('005_simple.dts') + data = self._DoReadFile('pack/simple.dts') self.assertEqual(None, fdtmap.LocateFdtmap(data)) def testFindImageHeader(self): """Test locating a image header""" self._CheckLz4() - data = self.data = self._DoReadFileRealDtb('128_decode_image.dts') + data = self.data = self._DoReadFileRealDtb('fdt/decode_image.dts') image = control.images['image'] entries = image.GetEntries() entry = entries['fdtmap'] @@ -2860,7 +2861,7 @@ class TestFunctional(unittest.TestCase): def testFindImageHeaderStart(self): """Test locating a image header located at the start of an image""" - data = self.data = self._DoReadFileRealDtb('117_fdtmap_hdr_start.dts') + data = self.data = self._DoReadFileRealDtb('fdt/fdtmap_hdr_start.dts') image = control.images['image'] entries = image.GetEntries() entry = entries['fdtmap'] @@ -2869,13 +2870,13 @@ class TestFunctional(unittest.TestCase): def testFindImageHeaderMissing(self): """Test failing to locate an image header""" - data = self._DoReadFile('005_simple.dts') + data = self._DoReadFile('pack/simple.dts') self.assertEqual(None, image_header.LocateHeaderOffset(data)) def testReadImage(self): """Test reading an image and accessing its FDT map""" self._CheckLz4() - data = self.data = self._DoReadFileRealDtb('128_decode_image.dts') + data = self.data = self._DoReadFileRealDtb('fdt/decode_image.dts') image_fname = tools.get_output_filename('image.bin') orig_image = control.images['image'] image = Image.FromFile(image_fname) @@ -2891,7 +2892,7 @@ class TestFunctional(unittest.TestCase): def testReadImageNoHeader(self): """Test accessing an image's FDT map without an image header""" self._CheckLz4() - data = self._DoReadFileRealDtb('129_decode_image_nohdr.dts') + data = self._DoReadFileRealDtb('fdt/decode_image_nohdr.dts') image_fname = tools.get_output_filename('image.bin') image = Image.FromFile(image_fname) self.assertTrue(isinstance(image, Image)) @@ -2899,7 +2900,7 @@ class TestFunctional(unittest.TestCase): def testReadImageFail(self): """Test failing to read an image image's FDT map""" - self._DoReadFile('005_simple.dts') + self._DoReadFile('pack/simple.dts') image_fname = tools.get_output_filename('image.bin') with self.assertRaises(ValueError) as e: image = Image.FromFile(image_fname) @@ -2908,7 +2909,7 @@ class TestFunctional(unittest.TestCase): def testListCmd(self): """Test listing the files in an image using an Fdtmap""" self._CheckLz4() - data = self._DoReadFileRealDtb('130_list_fdtmap.dts') + data = self._DoReadFileRealDtb('fdt/list_fdtmap.dts') # lz4 compression size differs depending on the version image = control.images['image'] @@ -2944,7 +2945,7 @@ class TestFunctional(unittest.TestCase): def testListCmdFail(self): """Test failing to list an image""" - self._DoReadFile('005_simple.dts') + self._DoReadFile('pack/simple.dts') tmpdir = None try: tmpdir, updated_fname = self._SetupImageInTmpdir() @@ -2963,7 +2964,7 @@ class TestFunctional(unittest.TestCase): expected: Expected list of filenames to be returned, in order """ self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') image = Image.FromFile(image_fname) lines = image.GetListEntries(paths)[1] @@ -3009,7 +3010,7 @@ class TestFunctional(unittest.TestCase): data from entry """ self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') return control.ReadEntry(image_fname, entry_name, decomp) @@ -3079,7 +3080,7 @@ class TestFunctional(unittest.TestCase): def testExtractCmd(self): """Test extracting a file fron an image on the command line""" self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') fname = os.path.join(self._indir, 'output.extact') tmpdir = None try: @@ -3096,7 +3097,7 @@ class TestFunctional(unittest.TestCase): def testExtractOneEntry(self): """Test extracting a single entry fron an image """ self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') fname = os.path.join(self._indir, 'output.extact') control.ExtractEntries(image_fname, fname, None, ['u-boot']) @@ -3141,7 +3142,7 @@ class TestFunctional(unittest.TestCase): path = os.path.join(outdir, name) os.rmdir(path) - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') outdir = os.path.join(self._indir, 'extract') einfos = control.ExtractEntries(image_fname, None, outdir, [], decomp) @@ -3202,7 +3203,7 @@ class TestFunctional(unittest.TestCase): def testExtractSelectedEntries(self): """Test extracting some entries""" self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') outdir = os.path.join(self._indir, 'extract') einfos = control.ExtractEntries(image_fname, None, outdir, @@ -3217,7 +3218,7 @@ class TestFunctional(unittest.TestCase): def testExtractNoEntryPaths(self): """Test extracting some entries""" self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') with self.assertRaises(ValueError) as e: control.ExtractEntries(image_fname, 'fname', None, []) @@ -3227,7 +3228,7 @@ class TestFunctional(unittest.TestCase): def testExtractTooManyEntryPaths(self): """Test extracting some entries""" self._CheckLz4() - self._DoReadFileRealDtb('130_list_fdtmap.dts') + self._DoReadFileRealDtb('fdt/list_fdtmap.dts') image_fname = tools.get_output_filename('image.bin') with self.assertRaises(ValueError) as e: control.ExtractEntries(image_fname, 'fname', None, ['a', 'b']) @@ -3236,7 +3237,7 @@ class TestFunctional(unittest.TestCase): def testPackAlignSection(self): """Test that sections can have alignment""" - self._DoReadFile('131_pack_align_section.dts') + self._DoReadFile('pack/pack_align_section.dts') self.assertIn('image', control.images) image = control.images['image'] @@ -3300,7 +3301,7 @@ class TestFunctional(unittest.TestCase): self.assertEqual(len(U_BOOT_DATA), entry.size) def _RunReplaceCmd(self, entry_name, data, decomp=True, allow_resize=True, - dts='132_replace.dts'): + dts='entry/replace.dts'): """Replace an entry in an image This writes the entry data to update it, then opens the updated file and @@ -3377,13 +3378,13 @@ class TestFunctional(unittest.TestCase): expected = U_BOOT_DATA + b'x' with self.assertRaises(ValueError) as e: self._RunReplaceCmd('u-boot', expected, allow_resize=False, - dts='139_replace_repack.dts') + dts='entry/replace_repack.dts') self.assertIn("Node '/u-boot': Entry data size does not match, but resize is disabled", str(e.exception)) def testReplaceMulti(self): """Test replacing entry data where multiple images are generated""" - data = self._DoReadFileDtb('133_replace_multi.dts', use_real_dtb=True, + data = self._DoReadFileDtb('entry/replace_multi.dts', use_real_dtb=True, update_dtb=True)[0] expected = b'x' * len(U_BOOT_DATA) updated_fname = tools.get_output_filename('image-updated.bin') @@ -3414,7 +3415,7 @@ class TestFunctional(unittest.TestCase): """Test that all device trees are updated with offset/size info""" self._SetupSplElf() self._SetupTplElf() - data = self._DoReadFileRealDtb('134_fdt_update_all_repack.dts') + data = self._DoReadFileRealDtb('fdt/update_all_repack.dts') SECTION_SIZE = 0x300 DTB_SIZE = 602 FDTMAP_SIZE = 608 @@ -3476,33 +3477,33 @@ class TestFunctional(unittest.TestCase): def testFdtmapHeaderMiddle(self): """Test an FDT map in the middle of an image when it should be at end""" with self.assertRaises(ValueError) as e: - self._DoReadFileRealDtb('135_fdtmap_hdr_middle.dts') + self._DoReadFileRealDtb('fdt/fdtmap_hdr_middle.dts') self.assertIn("Invalid sibling order 'middle' for image-header: Must be at 'end' to match location", str(e.exception)) def testFdtmapHeaderStartBad(self): """Test an FDT map in middle of an image when it should be at start""" with self.assertRaises(ValueError) as e: - self._DoReadFileRealDtb('136_fdtmap_hdr_startbad.dts') + self._DoReadFileRealDtb('fdt/fdtmap_hdr_startbad.dts') self.assertIn("Invalid sibling order 'end' for image-header: Must be at 'start' to match location", str(e.exception)) def testFdtmapHeaderEndBad(self): """Test an FDT map at the start of an image when it should be at end""" with self.assertRaises(ValueError) as e: - self._DoReadFileRealDtb('137_fdtmap_hdr_endbad.dts') + self._DoReadFileRealDtb('fdt/fdtmap_hdr_endbad.dts') self.assertIn("Invalid sibling order 'start' for image-header: Must be at 'end' to match location", str(e.exception)) def testFdtmapHeaderNoSize(self): """Test an image header at the end of an image with undefined size""" - self._DoReadFileRealDtb('138_fdtmap_hdr_nosize.dts') + self._DoReadFileRealDtb('fdt/fdtmap_hdr_nosize.dts') def testReplaceResize(self): """Test replacing a single file in an entry with a larger file""" expected = U_BOOT_DATA + b'x' data, _, image = self._RunReplaceCmd('u-boot', expected, - dts='139_replace_repack.dts') + dts='entry/replace_repack.dts') self.assertEqual(expected, data) entries = image.GetEntries() @@ -3533,7 +3534,7 @@ class TestFunctional(unittest.TestCase): """Test contracting an entry after it is packed""" try: state.SetAllowEntryContraction(True) - data = self._DoReadFileDtb('140_entry_shrink.dts', + data = self._DoReadFileDtb('pack/entry_shrink.dts', update_dtb=True)[0] finally: state.SetAllowEntryContraction(False) @@ -3543,7 +3544,7 @@ class TestFunctional(unittest.TestCase): def testEntryShrinkFail(self): """Test not being allowed to contract an entry after it is packed""" - data = self._DoReadFileDtb('140_entry_shrink.dts', update_dtb=True)[0] + data = self._DoReadFileDtb('pack/entry_shrink.dts', update_dtb=True)[0] # In this case there is a spare byte at the end of the data. The size of # the contents is only 1 byte but we still have the size before it @@ -3554,7 +3555,7 @@ class TestFunctional(unittest.TestCase): def testDescriptorOffset(self): """Test that the Intel descriptor is always placed at at the start""" - data = self._DoReadFileDtb('141_descriptor_offset.dts') + data = self._DoReadFileDtb('x86/descriptor_offset.dts') image = control.images['image'] entries = image.GetEntries() desc = entries['intel-descriptor'] @@ -3565,7 +3566,7 @@ class TestFunctional(unittest.TestCase): """Test replacing a single file in CBFS without changing the size""" self._CheckLz4() expected = b'x' * len(U_BOOT_DATA) - data = self._DoReadFileRealDtb('142_replace_cbfs.dts') + data = self._DoReadFileRealDtb('cbfs/replace.dts') updated_fname = tools.get_output_filename('image-updated.bin') tools.write_file(updated_fname, data) entry_name = 'section/cbfs/u-boot' @@ -3578,7 +3579,7 @@ class TestFunctional(unittest.TestCase): """Test replacing a single file in CBFS with one of a different size""" self._CheckLz4() expected = U_BOOT_DATA + b'x' - data = self._DoReadFileRealDtb('142_replace_cbfs.dts') + data = self._DoReadFileRealDtb('cbfs/replace.dts') updated_fname = tools.get_output_filename('image-updated.bin') tools.write_file(updated_fname, data) entry_name = 'section/cbfs/u-boot' @@ -3599,7 +3600,7 @@ class TestFunctional(unittest.TestCase): Output directory Expected values for updated entries, each a string """ - data = self._DoReadFileRealDtb('143_replace_all.dts') + data = self._DoReadFileRealDtb('entry/replace_all.dts') updated_fname = tools.get_output_filename('image-updated.bin') tools.write_file(updated_fname, data) @@ -3686,7 +3687,7 @@ class TestFunctional(unittest.TestCase): def testReplaceCmd(self): """Test replacing a file fron an image on the command line""" - self._DoReadFileRealDtb('143_replace_all.dts') + self._DoReadFileRealDtb('entry/replace_all.dts') try: tmpdir, updated_fname = self._SetupImageInTmpdir() @@ -3742,7 +3743,7 @@ class TestFunctional(unittest.TestCase): def testReplaceCmdMap(self): """Test replacing a file fron an image on the command line""" - self._DoReadFileRealDtb('143_replace_all.dts') + self._DoReadFileRealDtb('entry/replace_all.dts') try: tmpdir, updated_fname = self._SetupImageInTmpdir() @@ -3760,7 +3761,7 @@ class TestFunctional(unittest.TestCase): def testReplaceNoEntryPaths(self): """Test replacing an entry without an entry path""" - self._DoReadFileRealDtb('143_replace_all.dts') + self._DoReadFileRealDtb('entry/replace_all.dts') image_fname = tools.get_output_filename('image.bin') with self.assertRaises(ValueError) as e: control.ReplaceEntries(image_fname, 'fname', None, []) @@ -3769,7 +3770,7 @@ class TestFunctional(unittest.TestCase): def testReplaceTooManyEntryPaths(self): """Test extracting some entries""" - self._DoReadFileRealDtb('143_replace_all.dts') + self._DoReadFileRealDtb('entry/replace_all.dts') image_fname = tools.get_output_filename('image.bin') with self.assertRaises(ValueError) as e: control.ReplaceEntries(image_fname, 'fname', None, ['a', 'b']) @@ -3778,22 +3779,22 @@ class TestFunctional(unittest.TestCase): def testPackReset16(self): """Test that an image with an x86 reset16 region can be created""" - data = self._DoReadFile('144_x86_reset16.dts') + data = self._DoReadFile('x86/reset16.dts') self.assertEqual(X86_RESET16_DATA, data[:len(X86_RESET16_DATA)]) def testPackReset16Spl(self): """Test that an image with an x86 reset16-spl region can be created""" - data = self._DoReadFile('145_x86_reset16_spl.dts') + data = self._DoReadFile('x86/reset16_spl.dts') self.assertEqual(X86_RESET16_SPL_DATA, data[:len(X86_RESET16_SPL_DATA)]) def testPackReset16Tpl(self): """Test that an image with an x86 reset16-tpl region can be created""" - data = self._DoReadFile('146_x86_reset16_tpl.dts') + data = self._DoReadFile('x86/reset16_tpl.dts') self.assertEqual(X86_RESET16_TPL_DATA, data[:len(X86_RESET16_TPL_DATA)]) def testPackIntelFit(self): """Test that an image with an Intel FIT and pointer can be created""" - data = self._DoReadFile('147_intel_fit.dts') + data = self._DoReadFile('x86/intel_fit.dts') self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) fit = data[16:32]; self.assertEqual(b'_FIT_ \x01\x00\x00\x00\x00\x01\x80}' , fit) @@ -3807,7 +3808,7 @@ class TestFunctional(unittest.TestCase): def testPackIntelFitMissing(self): """Test detection of a FIT pointer with not FIT region""" with self.assertRaises(ValueError) as e: - self._DoReadFile('148_intel_fit_missing.dts') + self._DoReadFile('x86/intel_fit_missing.dts') self.assertIn("'intel-fit-ptr' section must have an 'intel-fit' sibling", str(e.exception)) @@ -3833,42 +3834,42 @@ class TestFunctional(unittest.TestCase): """Test binman can assign symbols embedded in U-Boot TPL in a section""" self._SetupSplElf('u_boot_binman_syms') self._SetupTplElf('u_boot_binman_syms') - self._CheckSymbolsTplSection('149_symbols_tpl.dts', + self._CheckSymbolsTplSection('symbols/tpl.dts', [0x04, 0x20, 0x10 + 0x3c, 0x04]) def testSymbolsTplSectionX86(self): """Test binman can assign symbols in a section with end-at-4gb""" self._SetupSplElf('u_boot_binman_syms_x86') self._SetupTplElf('u_boot_binman_syms_x86') - self._CheckSymbolsTplSection('155_symbols_tpl_x86.dts', + self._CheckSymbolsTplSection('x86/symbols_tpl.dts', [0xffffff04, 0xffffff20, 0xffffff3c, 0x04]) def testPackX86RomIfwiSectiom(self): """Test that a section can be placed in an IFWI region""" self._SetupIfwi('fitimage.bin') - data = self._DoReadFile('151_x86_rom_ifwi_section.dts') + data = self._DoReadFile('x86/rom_ifwi_section.dts') self._CheckIfwi(data) def testPackFspM(self): """Test that an image with a FSP memory-init binary can be created""" - data = self._DoReadFile('152_intel_fsp_m.dts') + data = self._DoReadFile('x86/intel_fsp_m.dts') self.assertEqual(FSP_M_DATA, data[:len(FSP_M_DATA)]) def testPackFspS(self): """Test that an image with a FSP silicon-init binary can be created""" - data = self._DoReadFile('153_intel_fsp_s.dts') + data = self._DoReadFile('x86/intel_fsp_s.dts') self.assertEqual(FSP_S_DATA, data[:len(FSP_S_DATA)]) def testPackFspT(self): """Test that an image with a FSP temp-ram-init binary can be created""" - data = self._DoReadFile('154_intel_fsp_t.dts') + data = self._DoReadFile('x86/intel_fsp_t.dts') self.assertEqual(FSP_T_DATA, data[:len(FSP_T_DATA)]) def testMkimage(self): """Test using mkimage to build an image""" self._SetupSplElf() - data = self._DoReadFile('156_mkimage.dts') + data = self._DoReadFile('mkimage/mkimage.dts') # Just check that the data appears in the file somewhere self.assertIn(U_BOOT_SPL_DATA, data) @@ -3877,27 +3878,27 @@ class TestFunctional(unittest.TestCase): """Test that binman still produces an image if mkimage is missing""" self._SetupSplElf() with terminal.capture() as (_, stderr): - self._DoTestFile('156_mkimage.dts', + self._DoTestFile('mkimage/mkimage.dts', force_missing_bintools='mkimage') err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage") def testExtblob(self): """Test an image with an external blob""" - data = self._DoReadFile('157_blob_ext.dts') + data = self._DoReadFile('blob/ext.dts') self.assertEqual(REFCODE_DATA, data) def testExtblobMissing(self): """Test an image with a missing external blob""" with self.assertRaises(ValueError) as e: - self._DoReadFile('158_blob_ext_missing.dts') + self._DoReadFile('blob/ext_missing.dts') self.assertIn("Filename 'missing-file' not found in input path", str(e.exception)) def testExtblobMissingOk(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - ret = self._DoTestFile('158_blob_ext_missing.dts', + ret = self._DoTestFile('blob/ext_missing.dts', allow_missing=True) self.assertEqual(103, ret) err = stderr.getvalue() @@ -3908,7 +3909,7 @@ class TestFunctional(unittest.TestCase): def testExtblobMissingOkFlag(self): """Test an image with an missing external blob allowed with -W""" with terminal.capture() as (stdout, stderr): - ret = self._DoTestFile('158_blob_ext_missing.dts', + ret = self._DoTestFile('blob/ext_missing.dts', allow_missing=True, ignore_missing=True) self.assertEqual(0, ret) err = stderr.getvalue() @@ -3919,7 +3920,7 @@ class TestFunctional(unittest.TestCase): def testExtblobMissingOkSect(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('159_blob_ext_missing_sect.dts', + self._DoTestFile('blob/ext_missing_sect.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: blob-ext blob-ext2") @@ -3927,7 +3928,7 @@ class TestFunctional(unittest.TestCase): def testPackX86RomMeMissingDesc(self): """Test that an missing Intel descriptor entry is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('164_x86_rom_me_missing.dts', allow_missing=True) + self._DoTestFile('x86/rom_me_missing.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: intel-descriptor") @@ -3937,13 +3938,13 @@ class TestFunctional(unittest.TestCase): pathname = os.path.join(self._indir, 'fitimage.bin') os.remove(pathname) with terminal.capture() as (stdout, stderr): - self._DoTestFile('111_x86_rom_ifwi.dts', allow_missing=True) + self._DoTestFile('x86/rom_ifwi.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: intel-ifwi") def testPackOverlapZero(self): """Test that zero-size overlapping regions are ignored""" - self._DoTestFile('160_pack_overlap_zero.dts') + self._DoTestFile('pack/pack_overlap_zero.dts') def _CheckSimpleFitData(self, fit_data, kernel_data, fdt1_data): # The data should be inside the FIT @@ -3991,7 +3992,7 @@ class TestFunctional(unittest.TestCase): def testSimpleFit(self): """Test an image with a FIT inside""" self._SetupSplElf() - data = self._DoReadFile('161_fit.dts') + data = self._DoReadFile('fit/fit.dts') self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) fit_data = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] @@ -4000,7 +4001,7 @@ class TestFunctional(unittest.TestCase): def testSimpleFitExpandsSubentries(self): """Test that FIT images expand their subentries""" - data = self._DoReadFileDtb('161_fit.dts', use_expanded=True)[0] + data = self._DoReadFileDtb('fit/fit.dts', use_expanded=True)[0] self.assertEqual(U_BOOT_EXP_DATA, data[:len(U_BOOT_EXP_DATA)]) self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) fit_data = data[len(U_BOOT_EXP_DATA):-len(U_BOOT_NODTB_DATA)] @@ -4009,7 +4010,7 @@ class TestFunctional(unittest.TestCase): def testSimpleFitImagePos(self): """Test that we have correct image-pos for FIT subentries""" - data, _, _, out_dtb_fname = self._DoReadFileDtb('161_fit.dts', + data, _, _, out_dtb_fname = self._DoReadFileDtb('fit/fit.dts', update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -4066,7 +4067,7 @@ class TestFunctional(unittest.TestCase): def testFitExternal(self): """Test an image with an FIT with external images""" - data = self._DoReadFile('162_fit_external.dts') + data = self._DoReadFile('fit/external.dts') fit_data = data[len(U_BOOT_DATA):-2] # _testing is 2 bytes # Size of the external-data region as set up by mkimage @@ -4094,7 +4095,7 @@ class TestFunctional(unittest.TestCase): def testFitExternalImagePos(self): """Test that we have correct image-pos for external FIT subentries""" - data, _, _, out_dtb_fname = self._DoReadFileDtb('162_fit_external.dts', + data, _, _, out_dtb_fname = self._DoReadFileDtb('fit/external.dts', update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() @@ -4151,7 +4152,7 @@ class TestFunctional(unittest.TestCase): def testFitMissing(self): """Test that binman complains if mkimage is missing""" with self.assertRaises(ValueError) as e: - self._DoTestFile('162_fit_external.dts', + self._DoTestFile('fit/external.dts', force_missing_bintools='mkimage') self.assertIn("Node '/binman/fit': Missing tool: 'mkimage'", str(e.exception)) @@ -4159,21 +4160,21 @@ class TestFunctional(unittest.TestCase): def testFitMissingOK(self): """Test that binman still produces a FIT image if mkimage is missing""" with terminal.capture() as (_, stderr): - self._DoTestFile('162_fit_external.dts', allow_missing=True, + self._DoTestFile('fit/external.dts', allow_missing=True, force_missing_bintools='mkimage') err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage") def testSectionIgnoreHashSignature(self): """Test that sections ignore hash, signature nodes for its data""" - data = self._DoReadFile('165_section_ignore_hash_signature.dts') + data = self._DoReadFile('security/section_ignore_hash_signature.dts') expected = (U_BOOT_DATA + U_BOOT_DATA) self.assertEqual(expected, data) def testPadInSections(self): """Test pad-before, pad-after for entries in sections""" data, _, _, out_dtb_fname = self._DoReadFileDtb( - '166_pad_in_sections.dts', update_dtb=True) + 'pack/pad_in_sections.dts', update_dtb=True) expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) + U_BOOT_DATA + tools.get_bytes(ord('!'), 6) + U_BOOT_DATA) @@ -4211,7 +4212,7 @@ class TestFunctional(unittest.TestCase): entry_args = { 'test-id': TEXT_DATA, } - data, _, _, _ = self._DoReadFileDtb('167_fit_image_subentry_alignment.dts', + data, _, _, _ = self._DoReadFileDtb('fit/image_subentry_alignment.dts', entry_args=entry_args) dtb = fdt.Fdt.FromData(data) dtb.Scan() @@ -4233,7 +4234,7 @@ class TestFunctional(unittest.TestCase): def testFitExtblobMissingOk(self): """Test a FIT with a missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('168_fit_missing_blob.dts', + self._DoTestFile('fit/missing_blob.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: atf-bl31") @@ -4241,21 +4242,21 @@ class TestFunctional(unittest.TestCase): def testBlobNamedByArgMissing(self): """Test handling of a missing entry arg""" with self.assertRaises(ValueError) as e: - self._DoReadFile('068_blob_named_by_arg.dts') + self._DoReadFile('blob/named_by_arg.dts') self.assertIn("Missing required properties/entry args: cros-ec-rw-path", str(e.exception)) def testPackBl31(self): """Test that an image with an ATF BL31 binary can be created""" - data = self._DoReadFile('169_atf_bl31.dts') + data = self._DoReadFile('fip/atf_bl31.dts') self.assertEqual(ATF_BL31_DATA, data[:len(ATF_BL31_DATA)]) def testPackScp(self): """Test that an image with an SCP binary can be created""" - data = self._DoReadFile('172_scp.dts') + data = self._DoReadFile('fip/scp.dts') self.assertEqual(SCP_DATA, data[:len(SCP_DATA)]) - def CheckFitFdt(self, dts='170_fit_fdt.dts', use_fdt_list=True, + def CheckFitFdt(self, dts='fit/fdt.dts', use_fdt_list=True, default_dt=None, use_seq_num=True): """Check an image with an FIT with multiple FDT images""" def _CheckFdt(val, expected_data): @@ -4351,7 +4352,7 @@ class TestFunctional(unittest.TestCase): def testFitFdtMissingList(self): """Test handling of a missing 'of-list' entry arg""" with self.assertRaises(ValueError) as e: - self._DoReadFile('170_fit_fdt.dts') + self._DoReadFile('fit/fdt.dts') self.assertIn("Generator node requires 'of-list' entry argument", str(e.exception)) @@ -4360,12 +4361,12 @@ class TestFunctional(unittest.TestCase): entry_args = { 'of-list': '', } - data = self._DoReadFileDtb('170_fit_fdt.dts', entry_args=entry_args)[0] + data = self._DoReadFileDtb('fit/fdt.dts', entry_args=entry_args)[0] def testFitFdtMissingProp(self): """Test handling of a missing 'fit,fdt-list' property""" with self.assertRaises(ValueError) as e: - self._DoReadFile('171_fit_fdt_missing_prop.dts') + self._DoReadFile('fit/fdt_missing_prop.dts') self.assertIn("Generator node requires 'fit,fdt-list' property", str(e.exception)) @@ -4376,7 +4377,7 @@ class TestFunctional(unittest.TestCase): } with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '170_fit_fdt.dts', + 'fit/fdt.dts', entry_args=entry_args, extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0] self.assertIn("Generated 'default' node requires default-dt entry argument", @@ -4390,7 +4391,7 @@ class TestFunctional(unittest.TestCase): } with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '170_fit_fdt.dts', + 'fit/fdt.dts', entry_args=entry_args, extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0] self.assertIn("default-dt entry argument 'test-fdt3' not found in fdt list: test-fdt1, test-fdt2", @@ -4402,7 +4403,7 @@ class TestFunctional(unittest.TestCase): control.missing_blob_help['wibble'] = 'Wibble test' control.missing_blob_help['another'] = 'Another test' with terminal.capture() as (stdout, stderr): - self._DoTestFile('168_fit_missing_blob.dts', + self._DoTestFile('fit/missing_blob.dts', allow_missing=True) err = stderr.getvalue() @@ -4415,13 +4416,13 @@ class TestFunctional(unittest.TestCase): def testMissingBlob(self): """Test handling of a blob containing a missing file""" with self.assertRaises(ValueError) as e: - self._DoTestFile('173_missing_blob.dts', allow_missing=True) + self._DoTestFile('blob/missing.dts', allow_missing=True) self.assertIn("Filename 'missing' not found in input path", str(e.exception)) def testEnvironment(self): """Test adding a U-Boot environment""" - data = self._DoReadFile('174_env.dts') + data = self._DoReadFile('entry/env.dts') self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) env = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] @@ -4431,14 +4432,14 @@ class TestFunctional(unittest.TestCase): def testEnvironmentNoSize(self): """Test that a missing 'size' property is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('175_env_no_size.dts') + self._DoTestFile('entry/env_no_size.dts') self.assertIn("'u-boot-env' entry must have a size property", str(e.exception)) def testEnvironmentTooSmall(self): """Test handling of an environment that does not fit""" with self.assertRaises(ValueError) as e: - self._DoTestFile('176_env_too_small.dts') + self._DoTestFile('entry/env_too_small.dts') # checksum, start byte, environment with \0 terminator, final \0 need = 4 + 1 + len(ENV_DATA) + 1 + 1 @@ -4448,7 +4449,7 @@ class TestFunctional(unittest.TestCase): def testSkipAtStart(self): """Test handling of skip-at-start section""" - data = self._DoReadFile('177_skip_at_start.dts') + data = self._DoReadFile('pack/skip_at_start.dts') self.assertEqual(U_BOOT_DATA, data) image = control.images['image'] @@ -4465,7 +4466,7 @@ class TestFunctional(unittest.TestCase): def testSkipAtStartPad(self): """Test handling of skip-at-start section with padded entry""" - data = self._DoReadFile('178_skip_at_start_pad.dts') + data = self._DoReadFile('pack/skip_at_start_pad.dts') before = tools.get_bytes(0, 8) after = tools.get_bytes(0, 4) all = before + U_BOOT_DATA + after @@ -4485,7 +4486,7 @@ class TestFunctional(unittest.TestCase): def testSkipAtStartSectionPad(self): """Test handling of skip-at-start section with padding""" - data = self._DoReadFile('179_skip_at_start_section_pad.dts') + data = self._DoReadFile('pack/skip_at_start_section_pad.dts') before = tools.get_bytes(0, 8) after = tools.get_bytes(0, 4) all = before + U_BOOT_DATA + after @@ -4506,7 +4507,7 @@ class TestFunctional(unittest.TestCase): def testSectionPad(self): """Testing padding with sections""" - data = self._DoReadFile('180_section_pad.dts') + data = self._DoReadFile('pack/section_pad.dts') expected = (tools.get_bytes(ord('&'), 3) + tools.get_bytes(ord('!'), 5) + U_BOOT_DATA + @@ -4516,7 +4517,7 @@ class TestFunctional(unittest.TestCase): def testSectionAlign(self): """Testing alignment with sections""" - data = self._DoReadFileDtb('181_section_align.dts', map=True)[0] + data = self._DoReadFileDtb('pack/section_align.dts', map=True)[0] expected = (b'\0' + # fill section tools.get_bytes(ord('&'), 1) + # padding to section align b'\0' + # fill section @@ -4530,7 +4531,7 @@ class TestFunctional(unittest.TestCase): """Test compression of the entire image""" self._CheckLz4() data, _, _, out_dtb_fname = self._DoReadFileDtb( - '182_compress_image.dts', use_real_dtb=True, update_dtb=True) + 'entry/compress_image.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', @@ -4573,7 +4574,7 @@ class TestFunctional(unittest.TestCase): """Test compression where compression reduces the image size""" self._CheckLz4() data, _, _, out_dtb_fname = self._DoReadFileDtb( - '183_compress_image_less.dts', use_real_dtb=True, update_dtb=True) + 'entry/compress_image_less.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', @@ -4618,7 +4619,7 @@ class TestFunctional(unittest.TestCase): """Test compression of a section with a fixed size""" self._CheckLz4() data, _, _, out_dtb_fname = self._DoReadFileDtb( - '184_compress_section_size.dts', use_real_dtb=True, update_dtb=True) + 'entry/compress_section_size.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', @@ -4646,7 +4647,7 @@ class TestFunctional(unittest.TestCase): """Test compression of a section with no fixed size""" self._CheckLz4() data, _, _, out_dtb_fname = self._DoReadFileDtb( - '185_compress_section.dts', use_real_dtb=True, update_dtb=True) + 'entry/compress_section.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', @@ -4671,7 +4672,7 @@ class TestFunctional(unittest.TestCase): def testLz4Missing(self): """Test that binman still produces an image if lz4 is missing""" with terminal.capture() as (_, stderr): - self._DoTestFile('185_compress_section.dts', + self._DoTestFile('entry/compress_section.dts', force_missing_bintools='lz4') err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: lz4") @@ -4680,7 +4681,7 @@ class TestFunctional(unittest.TestCase): """Test compression of a section with no fixed size""" self._CheckLz4() data, _, _, out_dtb_fname = self._DoReadFileDtb( - '186_compress_extra.dts', use_real_dtb=True, update_dtb=True) + 'entry/compress_extra.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() props = self._GetPropTree(dtb, ['offset', 'image-pos', 'size', @@ -4756,7 +4757,7 @@ class TestFunctional(unittest.TestCase): def testSymbolsSubsection(self): """Test binman can assign symbols from a subsection""" - self.checkSymbols('187_symbols_sub.dts', U_BOOT_SPL_DATA, 0x1c) + self.checkSymbols('symbols/sub.dts', U_BOOT_SPL_DATA, 0x1c) def testReadImageEntryArg(self): """Test reading an image that would need an entry arg to generate""" @@ -4764,7 +4765,7 @@ class TestFunctional(unittest.TestCase): 'cros-ec-rw-path': 'ecrw.bin', } data = self.data = self._DoReadFileDtb( - '188_image_entryarg.dts',use_real_dtb=True, update_dtb=True, + 'entry/image_entryarg.dts',use_real_dtb=True, update_dtb=True, entry_args=entry_args) image_fname = tools.get_output_filename('image.bin') @@ -4779,7 +4780,7 @@ class TestFunctional(unittest.TestCase): def testFilesAlign(self): """Test alignment with files""" - data = self._DoReadFile('190_files_align.dts') + data = self._DoReadFile('entry/files_align.dts') # The first string is 15 bytes so will align to 16 expect = FILES_DATA[:15] + b'\0' + FILES_DATA[15:] @@ -4787,7 +4788,7 @@ class TestFunctional(unittest.TestCase): def testReadImageSkip(self): """Test reading an image and accessing its FDT map""" - data = self.data = self._DoReadFileRealDtb('191_read_image_skip.dts') + data = self.data = self._DoReadFileRealDtb('entry/read_image_skip.dts') image_fname = tools.get_output_filename('image.bin') orig_image = control.images['image'] image = Image.FromFile(image_fname) @@ -4807,7 +4808,7 @@ class TestFunctional(unittest.TestCase): def testTplNoDtb(self): """Test that an image with tpl/u-boot-tpl-nodtb.bin can be created""" self._SetupTplElf() - data = self._DoReadFile('192_u_boot_tpl_nodtb.dts') + data = self._DoReadFile('xpl/u-boot-tpl-nodtb.dts') self.assertEqual(U_BOOT_TPL_NODTB_DATA, data[:len(U_BOOT_TPL_NODTB_DATA)]) @@ -4815,7 +4816,7 @@ class TestFunctional(unittest.TestCase): """Test that we can pad TPL's BSS with zeros""" # ELF file with a '__bss_size' symbol self._SetupTplElf() - data = self._DoReadFile('193_tpl_bss_pad.dts') + data = self._DoReadFile('xpl/tpl_bss_pad.dts') self.assertEqual(U_BOOT_TPL_DATA + tools.get_bytes(0, 10) + U_BOOT_DATA, data) @@ -4823,7 +4824,7 @@ class TestFunctional(unittest.TestCase): """Test that a missing symbol is detected""" self._SetupTplElf('u_boot_ucode_ptr') with self.assertRaises(ValueError) as e: - self._DoReadFile('193_tpl_bss_pad.dts') + self._DoReadFile('xpl/tpl_bss_pad.dts') self.assertIn('Expected __bss_size symbol in tpl/u-boot-tpl', str(e.exception)) @@ -4867,7 +4868,7 @@ class TestFunctional(unittest.TestCase): 'spl-bss-pad': 'y', 'tpl-dtb': '', } - self._DoReadFileDtb('194_fdt_incl.dts', use_expanded=True, + self._DoReadFileDtb('fdt/incl.dts', use_expanded=True, entry_args=entry_args) image = control.images['image'] entries = image.GetEntries() @@ -4907,7 +4908,7 @@ class TestFunctional(unittest.TestCase): 'tpl-bss-pad': 'y', 'tpl-dtb': 'y', } - self._DoReadFileDtb('195_fdt_incl_tpl.dts', use_expanded=True, + self._DoReadFileDtb('fdt/incl_tpl.dts', use_expanded=True, entry_args=entry_args) image = control.images['image'] entries = image.GetEntries() @@ -4934,7 +4935,7 @@ class TestFunctional(unittest.TestCase): 'spl-bss-pad': 'n', 'tpl-dtb': '', } - self._DoReadFileDtb('194_fdt_incl.dts', use_expanded=True, + self._DoReadFileDtb('fdt/incl.dts', use_expanded=True, entry_args=entry_args) image = control.images['image'] entries = image.GetEntries() @@ -4956,7 +4957,7 @@ class TestFunctional(unittest.TestCase): 'tpl-bss-pad': '', 'tpl-dtb': 'y', } - self._DoReadFileDtb('195_fdt_incl_tpl.dts', use_expanded=True, + self._DoReadFileDtb('fdt/incl_tpl.dts', use_expanded=True, entry_args=entry_args) image = control.images['image'] entries = image.GetEntries() @@ -4986,7 +4987,7 @@ class TestFunctional(unittest.TestCase): # Build the image. It includes two separate devicetree binaries, each # with their own contents, but all contain the binman definition. data = self._DoReadFileDtb( - '194_fdt_incl.dts', use_real_dtb=True, use_expanded=True, + 'fdt/incl.dts', use_real_dtb=True, use_expanded=True, update_dtb=True, entry_args=entry_args)[0] pad_len = 10 @@ -5007,13 +5008,13 @@ class TestFunctional(unittest.TestCase): entry_args = { 'spl-dtb': '1', } - self.checkSymbols('197_symbols_expand.dts', U_BOOT_SPL_NODTB_DATA + + self.checkSymbols('symbols/expand.dts', U_BOOT_SPL_NODTB_DATA + U_BOOT_SPL_DTB_DATA, 0x38, entry_args=entry_args, use_expanded=True) def testCollection(self): """Test a collection""" - data = self._DoReadFile('198_collection.dts') + data = self._DoReadFile('entry/collection.dts') self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA + tools.get_bytes(0xff, 2) + U_BOOT_NODTB_DATA + tools.get_bytes(0xfe, 3) + U_BOOT_DTB_DATA, @@ -5025,7 +5026,7 @@ class TestFunctional(unittest.TestCase): # BuildSectionData() is called with required=True, a section will force # building the contents, producing an error is anything is still # missing. - data = self._DoReadFile('199_collection_section.dts') + data = self._DoReadFile('entry/collection_section.dts') section = U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA self.assertEqual(section + U_BOOT_DATA + tools.get_bytes(0xff, 2) + section + tools.get_bytes(0xfe, 3) + U_BOOT_DATA, @@ -5033,7 +5034,7 @@ class TestFunctional(unittest.TestCase): def testAlignDefault(self): """Test that default alignment works on sections""" - data = self._DoReadFile('200_align_default.dts') + data = self._DoReadFile('pack/align_default.dts') expected = (U_BOOT_DATA + tools.get_bytes(0, 8 - len(U_BOOT_DATA)) + U_BOOT_DATA) # Special alignment for section @@ -5046,12 +5047,12 @@ class TestFunctional(unittest.TestCase): def testPackOpenSBI(self): """Test that an image with an OpenSBI binary can be created""" - data = self._DoReadFile('201_opensbi.dts') + data = self._DoReadFile('fip/opensbi.dts') self.assertEqual(OPENSBI_DATA, data[:len(OPENSBI_DATA)]) def testSectionsSingleThread(self): """Test sections without multithreading""" - data = self._DoReadFileDtb('055_sections.dts', threads=0)[0] + data = self._DoReadFileDtb('entry/sections.dts', threads=0)[0] expected = (U_BOOT_DATA + tools.get_bytes(ord('!'), 12) + U_BOOT_DATA + tools.get_bytes(ord('a'), 12) + U_BOOT_DATA + tools.get_bytes(ord('&'), 4)) @@ -5060,13 +5061,13 @@ class TestFunctional(unittest.TestCase): def testThreadTimeout(self): """Test handling a thread that takes too long""" with self.assertRaises(ValueError) as e: - self._DoTestFile('202_section_timeout.dts', + self._DoTestFile('entry/section_timeout.dts', test_section_timeout=True) self.assertIn("Timed out obtaining contents", str(e.exception)) def testTiming(self): """Test output of timing information""" - data = self._DoReadFile('055_sections.dts') + data = self._DoReadFile('entry/sections.dts') with terminal.capture() as (stdout, stderr): state.TimingShow() self.assertIn('read:', stdout.getvalue()) @@ -5081,7 +5082,7 @@ class TestFunctional(unittest.TestCase): begin_sym = 'dtb_embed_begin' end_sym = 'dtb_embed_end' retcode = self._DoTestFile( - '060_fdt_update.dts', update_dtb=True, + 'fdt/update.dts', update_dtb=True, update_fdt_in_elf=','.join([infile,outfile,begin_sym,end_sym])) self.assertEqual(0, retcode) @@ -5121,7 +5122,7 @@ class TestFunctional(unittest.TestCase): def testUpdateFdtInElfInvalid(self): """Test that invalid args are detected with --update-fdt-in-elf""" with self.assertRaises(ValueError) as e: - self._DoTestFile('060_fdt_update.dts', update_fdt_in_elf='fred') + self._DoTestFile('fdt/update.dts', update_fdt_in_elf='fred') self.assertIn("Invalid args ['fred'] to --update-fdt-in-elf", str(e.exception)) @@ -5135,7 +5136,7 @@ class TestFunctional(unittest.TestCase): end_sym = 'wrong_end' with self.assertRaises(ValueError) as e: self._DoTestFile( - '060_fdt_update.dts', + 'fdt/update.dts', update_fdt_in_elf=','.join([infile,outfile,begin_sym,end_sym])) self.assertIn("Expected two symbols 'wrong_begin' and 'wrong_end': got 0:", str(e.exception)) @@ -5150,7 +5151,7 @@ class TestFunctional(unittest.TestCase): end_sym = 'dtb_embed_end' with self.assertRaises(ValueError) as e: self._DoTestFile( - '060_fdt_update.dts', update_dtb=True, + 'fdt/update.dts', update_dtb=True, update_fdt_in_elf=','.join([infile,outfile,begin_sym,end_sym])) self.assertRegex( str(e.exception), @@ -5178,7 +5179,7 @@ class TestFunctional(unittest.TestCase): def testAltFormat(self): """Test that alternative formats can be used to extract""" - self._DoReadFileRealDtb('213_fdtmap_alt_format.dts') + self._DoReadFileRealDtb('fdt/fdtmap_alt_format.dts') try: tmpdir, updated_fname = self._SetupImageInTmpdir() @@ -5212,14 +5213,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobList(self): """Test an image with an external blob list""" - data = self._DoReadFileDtb('215_blob_ext_list.dts', + data = self._DoReadFileDtb('blob/ext_list.dts', allow_fake_blobs=False) self.assertEqual(REFCODE_DATA + FSP_M_DATA, data[0]) def testExtblobListMissing(self): """Test an image with a missing external blob""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('216_blob_ext_list_missing.dts', + self._DoReadFileDtb('blob/ext_list_missing.dts', allow_fake_blobs=False) self.assertIn("Filename 'missing-file' not found in input path", str(e.exception)) @@ -5227,14 +5228,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobListMissingOk(self): """Test an image with an missing external blob that is allowed""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('216_blob_ext_list_missing.dts', + self._DoTestFile('blob/ext_list_missing.dts', allow_missing=True, allow_fake_blobs=False) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: blob-ext") def testFip(self): """Basic test of generation of an ARM Firmware Image Package (FIP)""" - data = self._DoReadFile('203_fip.dts') + data = self._DoReadFile('fip/fip.dts') hdr, fents = fip_util.decode_fip(data) self.assertEqual(fip_util.HEADER_MAGIC, hdr.name) self.assertEqual(fip_util.HEADER_SERIAL, hdr.serial) @@ -5266,7 +5267,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipOther(self): """Basic FIP with something that isn't a external blob""" - data = self._DoReadFile('204_fip_other.dts') + data = self._DoReadFile('fip/other.dts') hdr, fents = fip_util.decode_fip(data) self.assertEqual(2, len(fents)) @@ -5277,13 +5278,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipNoType(self): """FIP with an entry of an unknown type""" with self.assertRaises(ValueError) as e: - self._DoReadFile('205_fip_no_type.dts') + self._DoReadFile('fip/no_type.dts') self.assertIn("Must provide a fip-type (node name 'u-boot' is not a known FIP type)", str(e.exception)) def testFipUuid(self): """Basic FIP with a manual uuid""" - data = self._DoReadFile('206_fip_uuid.dts') + data = self._DoReadFile('fip/uuid.dts') hdr, fents = fip_util.decode_fip(data) self.assertEqual(2, len(fents)) @@ -5297,7 +5298,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipLs(self): """Test listing a FIP""" - data = self._DoReadFileRealDtb('207_fip_ls.dts') + data = self._DoReadFileRealDtb('fip/ls.dts') hdr, fents = fip_util.decode_fip(data) tmpdir = None @@ -5353,7 +5354,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipExtractOneEntry(self): """Test extracting a single entry fron an FIP""" - self._DoReadFileRealDtb('207_fip_ls.dts') + self._DoReadFileRealDtb('fip/ls.dts') image_fname = tools.get_output_filename('image.bin') fname = os.path.join(self._indir, 'output.extact') control.ExtractEntries(image_fname, fname, None, ['atf-fip/u-boot']) @@ -5363,7 +5364,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipReplace(self): """Test replacing a single file in a FIP""" expected = U_BOOT_DATA + tools.get_bytes(0x78, 50) - data = self._DoReadFileRealDtb('208_fip_replace.dts') + data = self._DoReadFileRealDtb('fip/replace.dts') updated_fname = tools.get_output_filename('image-updated.bin') tools.write_file(updated_fname, data) entry_name = 'atf-fip/u-boot' @@ -5387,13 +5388,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipMissing(self): with terminal.capture() as (stdout, stderr): - self._DoTestFile('209_fip_missing.dts', allow_missing=True) + self._DoTestFile('fip/missing.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing.*: rmm-fw") def testFipSize(self): """Test a FIP with a size property""" - data = self._DoReadFile('210_fip_size.dts') + data = self._DoReadFile('fip/size.dts') self.assertEqual(0x100 + len(U_BOOT_DATA), len(data)) hdr, fents = fip_util.decode_fip(data) self.assertEqual(fip_util.HEADER_MAGIC, hdr.name) @@ -5414,14 +5415,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFipBadAlign(self): """Test that an invalid alignment value in a FIP is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('211_fip_bad_align.dts') + self._DoTestFile('fip/bad_align.dts') self.assertIn( "Node \'/binman/atf-fip\': FIP alignment 31 must be a power of two", str(e.exception)) def testFipCollection(self): """Test using a FIP in a collection""" - data = self._DoReadFile('212_fip_collection.dts') + data = self._DoReadFile('fip/collection.dts') entry1 = control.images['image'].GetEntries()['collection'] data1 = data[:entry1.size] hdr1, fents2 = fip_util.decode_fip(data1) @@ -5441,7 +5442,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFakeBlob(self): """Test handling of faking an external blob""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('217_fake_blob.dts', allow_missing=True, + self._DoTestFile('blob/fake.dts', allow_missing=True, allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex( @@ -5451,7 +5452,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobListFaked(self): """Test an extblob with missing external blob that are faked""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('216_blob_ext_list_missing.dts', + self._DoTestFile('blob/ext_list_missing.dts', allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*faked.*: blob-ext-list") @@ -5507,7 +5508,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'of-list': 'test-fdt1 test-fdt2', } data = self._DoReadFileDtb( - '219_fit_gennode.dts', + 'fit/gennode.dts', entry_args=entry_args, use_real_dtb=True, extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)]) @@ -5528,7 +5529,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'keydir': 'devkeys', 'bmpblk': 'bmpblk.bin', } - data, _, _, _ = self._DoReadFileDtb('220_fit_subentry_bintool.dts', + data, _, _, _ = self._DoReadFileDtb('fit/subentry_bintool.dts', entry_args=entry_args) expected = (GBB_DATA + GBB_DATA + tools.get_bytes(0, 8) + @@ -5541,7 +5542,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'keydir': 'devkeys', } with terminal.capture() as (_, stderr): - self._DoTestFile('220_fit_subentry_bintool.dts', + self._DoTestFile('fit/subentry_bintool.dts', force_missing_bintools='futility', entry_args=entry_args) err = stderr.getvalue() self.assertRegex(err, "Image 'image'.*missing bintools.*: futility") @@ -5550,7 +5551,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test an image with a FIT inside""" self._SetupSplElf() data, _, _, out_dtb_name = self._DoReadFileDtb( - '221_fit_subentry_hash.dts', use_real_dtb=True, update_dtb=True) + 'fit/subentry_hash.dts', use_real_dtb=True, update_dtb=True) mkimage_dtb = fdt.Fdt.FromData(data) mkimage_dtb.Scan() @@ -5573,27 +5574,27 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testPackTeeOs(self): """Test that an image with an TEE binary can be created""" - data = self._DoReadFile('222_tee_os.dts') + data = self._DoReadFile('entry/tee_os.dts') self.assertEqual(TEE_OS_DATA, data[:len(TEE_OS_DATA)]) def testPackTiDm(self): """Test that an image with a TI DM binary can be created""" - data = self._DoReadFile('225_ti_dm.dts') + data = self._DoReadFile('vendor/ti_dm.dts') self.assertEqual(TI_DM_DATA, data[:len(TI_DM_DATA)]) def testPackBl1(self): """test if an image with a bl1 binary can be created""" - data = self._DoReadFile('347_bl1.dts') + data = self._DoReadFile('fip/bl1.dts') self.assertEqual(ATF_BL1_DATA, data[:len(ATF_BL1_DATA)]) def testRenesasRCarGen4SA0Image(self): """Test that binman can produce an Renesas R-Car Gen4 SA0 image""" - self._DoTestFile('348_renesas_rcar4_sa0.dts') + self._DoTestFile('vendor/renesas_rcar4_sa0.dts') def testRenesasRCarGen4SA0ImageSize(self): """Test that binman can not produce large Renesas R-Car Gen4 SA0 image""" with self.assertRaises(ValueError) as exc: - self._DoTestFile('349_renesas_rcar4_sa0_size.dts') + self._DoTestFile('vendor/renesas_rcar4_sa0_size.dts') self.assertIn("Node '/binman/renesas-rcar4-sa0': SRAM data longer than 966656 Bytes", str(exc.exception)) @@ -5604,21 +5605,21 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'default-dt': 'test-fdt2', } self._DoReadFileDtb( - '223_fit_fdt_oper.dts', + 'fit/fdt_oper.dts', entry_args=entry_args, extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0] def testFitFdtBadOper(self): """Check handling of an FDT map when the section cannot be found""" with self.assertRaises(ValueError) as exc: - self._DoReadFileDtb('224_fit_bad_oper.dts') + self._DoReadFileDtb('fit/bad_oper.dts') self.assertIn("Node '/binman/fit': subnode 'images/@fdt-SEQ': Unknown operation 'unknown'", str(exc.exception)) def test_uses_expand_size(self): """Test that the 'expand-size' property cannot be used anymore""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('225_expand_size_bad.dts') + data = self._DoReadFile('pack/expand_size_bad.dts') self.assertIn( "Node '/binman/u-boot': Please use 'extend-size' instead of 'expand-size'", str(e.exception)) @@ -5635,7 +5636,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap } test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) data = self._DoReadFileDtb( - '226_fit_split_elf.dts', + 'fit/split_elf.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -5728,7 +5729,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) with self.assertRaises(ValueError) as exc: self._DoReadFileDtb( - '226_fit_split_elf.dts', + 'fit/split_elf.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] self.assertIn( @@ -5755,7 +5756,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) with terminal.capture() as (stdout, stderr): self._DoTestFile( - '226_fit_split_elf.dts', entry_args=entry_args, + 'fit/split_elf.dts', entry_args=entry_args, extra_indirs=[test_subdir], verbosity=3, **kwargs) out = stdout.getvalue() err = stderr.getvalue() @@ -5765,7 +5766,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test a FIT split-elf invalid fit,xxx directive in an image node""" if not elf.ELF_TOOLS: self.skipTest('Python elftools not available') - err = self._check_bad_fit('227_fit_bad_dir.dts') + err = self._check_bad_fit('fit/bad_dir.dts') self.assertIn( "Node '/binman/fit': subnode 'images/@atf-SEQ': Unknown directive 'fit,something'", err) @@ -5774,7 +5775,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test a FIT split-elf with invalid fit,xxx directive in config""" if not elf.ELF_TOOLS: self.skipTest('Python elftools not available') - err = self._check_bad_fit('228_fit_bad_dir_config.dts') + err = self._check_bad_fit('fit/bad_dir_config.dts') self.assertEqual( "Node '/binman/fit': subnode 'configurations/@config-SEQ': Unknown directive 'fit,config'", err) @@ -5809,7 +5810,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkimageMissingBlob(self): """Test using mkimage to build an image""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('229_mkimage_missing.dts', allow_missing=True, + self._DoTestFile('mkimage/missing.dts', allow_missing=True, allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex( @@ -5822,7 +5823,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } data = self._DoReadFileDtb( - '230_pre_load.dts', entry_args=entry_args, + 'security/pre_load.dts', entry_args=entry_args, extra_indirs=[os.path.join(self._binman_dir, 'test')])[0] image_fname = tools.get_output_filename('image.bin') @@ -5836,7 +5837,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testPreLoadNoKey(self): """Test an image with a pre-load heade0r with missing key""" with self.assertRaises(FileNotFoundError) as exc: - self._DoReadFile('230_pre_load.dts') + self._DoReadFile('security/pre_load.dts') self.assertIn("No such file or directory: 'dev.key'", str(exc.exception)) @@ -5845,7 +5846,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap entry_args = { 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } - data = self._DoReadFileDtb('231_pre_load_pkcs.dts', + data = self._DoReadFileDtb('security/pre_load_pkcs.dts', entry_args=entry_args)[0] self.assertEqual(PRE_LOAD_MAGIC, data[:len(PRE_LOAD_MAGIC)]) self.assertEqual(PRE_LOAD_VERSION, data[4:4 + len(PRE_LOAD_VERSION)]) @@ -5856,7 +5857,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap entry_args = { 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } - data = self._DoReadFileDtb('232_pre_load_pss.dts', + data = self._DoReadFileDtb('security/pre_load_pss.dts', entry_args=entry_args)[0] self.assertEqual(PRE_LOAD_MAGIC, data[:len(PRE_LOAD_MAGIC)]) self.assertEqual(PRE_LOAD_VERSION, data[4:4 + len(PRE_LOAD_VERSION)]) @@ -5868,7 +5869,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('233_pre_load_invalid_padding.dts', + self._DoReadFileDtb('security/pre_load_invalid_padding.dts', entry_args=entry_args) def testPreLoadInvalidSha(self): @@ -5877,13 +5878,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('234_pre_load_invalid_sha.dts', + self._DoReadFileDtb('security/pre_load_invalid_sha.dts', entry_args=entry_args) def testPreLoadInvalidAlgo(self): """Test an image with a pre-load header with an invalid algo""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('235_pre_load_invalid_algo.dts') + data = self._DoReadFile('security/pre_load_invalid_algo.dts') def testPreLoadInvalidKey(self): """Test an image with a pre-load header with an invalid key""" @@ -5891,7 +5892,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'pre-load-key-path': os.path.join(self._binman_dir, 'test'), } with self.assertRaises(ValueError) as e: - data = self._DoReadFileDtb('236_pre_load_invalid_key.dts', + data = self._DoReadFileDtb('security/pre_load_invalid_key.dts', entry_args=entry_args) def _CheckSafeUniqueNames(self, *images): @@ -5907,7 +5908,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSafeUniqueNames(self): """Test entry unique names are safe in single image configuration""" - data = self._DoReadFileRealDtb('237_unique_names.dts') + data = self._DoReadFileRealDtb('entry/unique_names.dts') orig_image = control.images['image'] image_fname = tools.get_output_filename('image.bin') @@ -5917,7 +5918,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSafeUniqueNamesMulti(self): """Test entry unique names are safe with multiple images""" - data = self._DoReadFileRealDtb('238_unique_names_multi.dts') + data = self._DoReadFileRealDtb('entry/unique_names_multi.dts') orig_image = control.images['image'] image_fname = tools.get_output_filename('image.bin') @@ -5927,7 +5928,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testReplaceCmdWithBintool(self): """Test replacing an entry that needs a bintool to pack""" - data = self._DoReadFileRealDtb('239_replace_with_bintool.dts') + data = self._DoReadFileRealDtb('entry/replace_with_bintool.dts') expected = U_BOOT_DATA + b'aa' self.assertEqual(expected, data[:len(expected)]) @@ -5946,7 +5947,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testReplaceCmdOtherWithBintool(self): """Test replacing an entry when another needs a bintool to pack""" - data = self._DoReadFileRealDtb('239_replace_with_bintool.dts') + data = self._DoReadFileRealDtb('entry/replace_with_bintool.dts') expected = U_BOOT_DATA + b'aa' self.assertEqual(expected, data[:len(expected)]) @@ -5986,7 +5987,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtractFit(self): """Test extracting a FIT section""" - self._DoReadFileRealDtb('240_fit_extract_replace.dts') + self._DoReadFileRealDtb('fit/extract_replace.dts') image_fname = tools.get_output_filename('image.bin') fit_data = control.ReadEntry(image_fname, 'fit') @@ -6005,7 +6006,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtractFitSubentries(self): """Test extracting FIT section subentries""" - self._DoReadFileRealDtb('240_fit_extract_replace.dts') + self._DoReadFileRealDtb('fit/extract_replace.dts') image_fname = tools.get_output_filename('image.bin') for entry_path, expected in [ @@ -6024,7 +6025,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap new_data = b'x' * len(U_BOOT_DATA) data, expected_fdtmap, _ = self._RunReplaceCmd( 'fit/kernel/u-boot', new_data, - dts='240_fit_extract_replace.dts') + dts='fit/extract_replace.dts') self.assertEqual(new_data, data) path, fdtmap = state.GetFdtContents('fdtmap') @@ -6036,7 +6037,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap new_data = b'ub' * len(U_BOOT_NODTB_DATA) data, expected_fdtmap, _ = self._RunReplaceCmd( 'fit/fdt-1/u-boot-nodtb', new_data, - dts='240_fit_extract_replace.dts') + dts='fit/extract_replace.dts') self.assertEqual(new_data, data) # Will be repacked, so fdtmap must change @@ -6050,7 +6051,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap expected = new_data.ljust(len(U_BOOT_NODTB_DATA), b'\0') data, expected_fdtmap, _ = self._RunReplaceCmd( 'fit/fdt-1/u-boot-nodtb', new_data, - dts='240_fit_extract_replace.dts') + dts='fit/extract_replace.dts') self.assertEqual(expected, data) path, fdtmap = state.GetFdtContents('fdtmap') @@ -6061,7 +6062,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test replacing a simple section with same-sized data""" new_data = b'w' * len(COMPRESS_DATA + U_BOOT_DATA) data, expected_fdtmap, image = self._RunReplaceCmd('section', - new_data, dts='241_replace_section_simple.dts') + new_data, dts='entry/replace_section_simple.dts') self.assertEqual(new_data, data) entries = image.GetEntries() @@ -6073,7 +6074,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test replacing a simple section with larger data""" new_data = b'w' * (len(COMPRESS_DATA + U_BOOT_DATA) + 1) data, expected_fdtmap, image = self._RunReplaceCmd('section', - new_data, dts='241_replace_section_simple.dts') + new_data, dts='entry/replace_section_simple.dts') self.assertEqual(new_data, data) entries = image.GetEntries() @@ -6087,7 +6088,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test replacing a simple section with smaller data""" new_data = b'w' * (len(COMPRESS_DATA + U_BOOT_DATA) - 1) + b'\0' data, expected_fdtmap, image = self._RunReplaceCmd('section', - new_data, dts='241_replace_section_simple.dts') + new_data, dts='entry/replace_section_simple.dts') self.assertEqual(new_data, data) # The new size is the same as the old, just with a pad byte at the end @@ -6103,7 +6104,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap state.SetAllowEntryContraction(True) with self.assertRaises(ValueError) as exc: self._RunReplaceCmd('section', new_data, - dts='241_replace_section_simple.dts') + dts='entry/replace_section_simple.dts') finally: state.SetAllowEntryContraction(False) @@ -6118,7 +6119,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkimageImagename(self): """Test using mkimage with -n holding the data too""" self._SetupSplElf() - data = self._DoReadFile('242_mkimage_name.dts') + data = self._DoReadFile('mkimage/name.dts') # Check that the data appears in the file somewhere self.assertIn(U_BOOT_SPL_DATA, data) @@ -6136,7 +6137,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkimageImage(self): """Test using mkimage with -n holding the data too""" self._SetupSplElf() - data = self._DoReadFile('243_mkimage_image.dts') + data = self._DoReadFile('mkimage/image.dts') # Check that the data appears in the file somewhere self.assertIn(U_BOOT_SPL_DATA, data) @@ -6158,7 +6159,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test using mkimage with -n and no data""" self._SetupSplElf() with self.assertRaises(ValueError) as exc: - self._DoReadFile('244_mkimage_image_no_content.dts') + self._DoReadFile('mkimage/image_no_content.dts') self.assertIn('Could not complete processing of contents', str(exc.exception)) @@ -6166,13 +6167,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test using mkimage with imagename node and data-to-imagename""" self._SetupSplElf() with self.assertRaises(ValueError) as exc: - self._DoReadFile('245_mkimage_image_bad.dts') + self._DoReadFile('mkimage/image_bad.dts') self.assertIn('Cannot use both imagename node and data-to-imagename', str(exc.exception)) def testCollectionOther(self): """Test a collection where the data comes from another section""" - data = self._DoReadFile('246_collection_other.dts') + data = self._DoReadFile('entry/collection_other.dts') self.assertEqual(U_BOOT_NODTB_DATA + U_BOOT_DTB_DATA + tools.get_bytes(0xff, 2) + U_BOOT_NODTB_DATA + tools.get_bytes(0xfe, 3) + U_BOOT_DTB_DATA, @@ -6181,20 +6182,20 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkimageCollection(self): """Test using a collection referring to an entry in a mkimage entry""" self._SetupSplElf() - data = self._DoReadFile('247_mkimage_coll.dts') + data = self._DoReadFile('mkimage/coll.dts') expect = U_BOOT_SPL_DATA + U_BOOT_DATA self.assertEqual(expect, data[:len(expect)]) def testCompressDtbPrependInvalid(self): """Test that invalid header is detected""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('248_compress_dtb_prepend_invalid.dts') + self._DoReadFileDtb('fdt/compress_dtb_prepend_invalid.dts') self.assertIn("Node '/binman/u-boot-dtb': Invalid prepend in " "'u-boot-dtb': 'invalid'", str(e.exception)) def testCompressDtbPrependLength(self): """Test that compress with length header works as expected""" - data = self._DoReadFileRealDtb('249_compress_dtb_prepend_length.dts') + data = self._DoReadFileRealDtb('fdt/compress_dtb_prepend_length.dts') image = control.images['image'] entries = image.GetEntries() self.assertIn('u-boot-dtb', entries) @@ -6227,7 +6228,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testInvalidCompress(self): """Test that invalid compress algorithm is detected""" with self.assertRaises(ValueError) as e: - self._DoTestFile('250_compress_dtb_invalid.dts') + self._DoTestFile('fdt/compress_dtb_invalid.dts') self.assertIn("Unknown algorithm 'invalid'", str(e.exception)) def testCompUtilCompressions(self): @@ -6261,7 +6262,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCompressDtbZstd(self): """Test that zstd compress of device-tree files failed""" with self.assertRaises(ValueError) as e: - self._DoTestFile('251_compress_dtb_zstd.dts') + self._DoTestFile('fdt/compress_dtb_zstd.dts') self.assertIn("Node '/binman/u-boot-dtb': The zstd compression " "requires a length header", str(e.exception)) @@ -6269,7 +6270,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test passing multiple files to mkimage in a mkimage entry""" self._SetupSplElf() self._SetupTplElf() - data = self._DoReadFile('252_mkimage_mult_data.dts') + data = self._DoReadFile('mkimage/mult_data.dts') # Size of files are packed in their 4B big-endian format expect = struct.pack('>I', len(U_BOOT_TPL_DATA)) expect += struct.pack('>I', len(U_BOOT_SPL_DATA)) @@ -6291,7 +6292,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'spl-bss-pad': 'y', 'spl-dtb': 'y', } - data = self._DoReadFileDtb('252_mkimage_mult_data.dts', + data = self._DoReadFileDtb('mkimage/mult_data.dts', use_expanded=True, entry_args=entry_args)[0] pad_len = 10 tpl_expect = U_BOOT_TPL_DATA @@ -6320,14 +6321,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test passing multiple data files to mkimage with one data file having no content""" self._SetupSplElf() with self.assertRaises(ValueError) as exc: - self._DoReadFile('253_mkimage_mult_no_content.dts') + self._DoReadFile('mkimage/mult_no_content.dts') self.assertIn('Could not complete processing of contents', str(exc.exception)) def testMkimageFilename(self): """Test using mkimage to build a binary with a filename""" self._SetupSplElf() - retcode = self._DoTestFile('254_mkimage_filename.dts') + retcode = self._DoTestFile('mkimage/filename.dts') self.assertEqual(0, retcode) fname = tools.get_output_filename('mkimage-test.bin') self.assertTrue(os.path.exists(fname)) @@ -6336,13 +6337,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test that an image with VPL and its device tree can be created""" # ELF file with a '__bss_size' symbol self._SetupVplElf() - data = self._DoReadFile('255_u_boot_vpl.dts') + data = self._DoReadFile('xpl/vpl.dts') self.assertEqual(U_BOOT_VPL_DATA + U_BOOT_VPL_DTB_DATA, data) def testVplNoDtb(self): """Test that an image with vpl/u-boot-vpl-nodtb.bin can be created""" self._SetupVplElf() - data = self._DoReadFile('256_u_boot_vpl_nodtb.dts') + data = self._DoReadFile('xpl/u-boot-vpl-nodtb.dts') self.assertEqual(U_BOOT_VPL_NODTB_DATA, data[:len(U_BOOT_VPL_NODTB_DATA)]) @@ -6354,7 +6355,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'vpl-bss-pad': 'y', 'vpl-dtb': 'y', } - self._DoReadFileDtb('257_fdt_incl_vpl.dts', use_expanded=True, + self._DoReadFileDtb('fdt/incl_vpl.dts', use_expanded=True, entry_args=entry_args) image = control.images['image'] entries = image.GetEntries() @@ -6374,13 +6375,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test that a missing symbol is detected""" self._SetupVplElf('u_boot_ucode_ptr') with self.assertRaises(ValueError) as e: - self._DoReadFile('258_vpl_bss_pad.dts') + self._DoReadFile('xpl/vpl_bss_pad.dts') self.assertIn('Expected __bss_size symbol in vpl/u-boot-vpl', str(e.exception)) def testSymlink(self): """Test that image files can be symlinked""" - retcode = self._DoTestFile('259_symlink.dts', debug=True, map=True) + retcode = self._DoTestFile('entry/symlink.dts', debug=True, map=True) self.assertEqual(0, retcode) image = control.images['test_image'] fname = tools.get_output_filename('test_image.bin') @@ -6391,9 +6392,9 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSymlinkOverwrite(self): """Test that symlinked images can be overwritten""" testdir = TestFunctional._MakeInputDir('symlinktest') - self._DoTestFile('259_symlink.dts', debug=True, map=True, output_dir=testdir) + self._DoTestFile('entry/symlink.dts', debug=True, map=True, output_dir=testdir) # build the same image again in the same directory so that existing symlink is present - self._DoTestFile('259_symlink.dts', debug=True, map=True, output_dir=testdir) + self._DoTestFile('entry/symlink.dts', debug=True, map=True, output_dir=testdir) fname = tools.get_output_filename('test_image.bin') sname = tools.get_output_filename('symlink_to_test.bin') self.assertTrue(os.path.islink(sname)) @@ -6406,7 +6407,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap self._SetupTplElf('u_boot_binman_syms') self._SetupVplElf('u_boot_binman_syms') self._SetupSplElf('u_boot_binman_syms') - data = self._DoReadFileDtb('260_symbols_elf.dts')[0] + data = self._DoReadFileDtb('symbols/elf.dts')[0] image_fname = tools.get_output_filename('image.bin') image = control.images['image'] @@ -6449,7 +6450,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap try: elf.ELF_TOOLS = False with self.assertRaises(ValueError) as exc: - self._DoReadFileDtb('260_symbols_elf.dts') + self._DoReadFileDtb('symbols/elf.dts') finally: elf.ELF_TOOLS = True self.assertIn( @@ -6459,7 +6460,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSectionFilename(self): """Check writing of section contents to a file""" - data = self._DoReadFile('261_section_fname.dts') + data = self._DoReadFile('entry/section_fname.dts') expected = (b'&&' + U_BOOT_DATA + b'&&&' + tools.get_bytes(ord('!'), 7) + U_BOOT_DATA + tools.get_bytes(ord('&'), 12)) @@ -6472,7 +6473,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testAbsent(self): """Check handling of absent entries""" - data = self._DoReadFile('262_absent.dts') + data = self._DoReadFile('entry/absent.dts') self.assertEqual(U_BOOT_DATA + b'aa' + U_BOOT_IMG_DATA, data) def testPackTeeOsElf(self): @@ -6481,7 +6482,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'tee-os-path': 'tee.elf', } tee_path = self.tee_elf_path - data = self._DoReadFileDtb('263_tee_os_opt.dts', + data = self._DoReadFileDtb('entry/tee_os_opt.dts', entry_args=entry_args)[0] self.assertEqual(U_BOOT_DATA + tools.read_file(tee_path) + U_BOOT_IMG_DATA, data) @@ -6510,7 +6511,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFitTeeOsOptionalFit(self): """Test an image with a FIT with an optional OP-TEE binary""" - data = self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bin') + data = self.checkFitTee('fit/tee_os_opt.dts', 'tee.bin') # There should be only one node, holding the data set up in SetUpClass() # for tee.bin @@ -6524,7 +6525,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap self.assertEqual(U_BOOT_DATA, node.props['data'].bytes) with terminal.capture() as (stdout, stderr): - self.checkFitTee('264_tee_os_opt_fit.dts', '') + self.checkFitTee('fit/tee_os_opt.dts', '') err = stderr.getvalue() self.assertRegex( err, @@ -6536,7 +6537,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFitTeeOsOptionalFitBad(self): """Test an image with a FIT with an optional OP-TEE binary""" with self.assertRaises(ValueError) as exc: - self.checkFitTee('265_tee_os_opt_fit_bad.dts', 'tee.bin') + self.checkFitTee('fit/tee_os_opt_bad.dts', 'tee.bin') self.assertIn( "Node '/binman/fit': subnode 'images/@tee-SEQ': Failed to read ELF file: Magic number does not match", str(exc.exception)) @@ -6545,14 +6546,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test an OP-TEE binary with wrong formats""" self.make_tee_bin('tee.bad1', 123) with self.assertRaises(ValueError) as exc: - self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bad1') + self.checkFitTee('fit/tee_os_opt.dts', 'tee.bad1') self.assertIn( "Node '/binman/fit/images/@tee-SEQ/tee-os': OP-TEE paged mode not supported", str(exc.exception)) self.make_tee_bin('tee.bad2', 0, b'extra data') with self.assertRaises(ValueError) as exc: - self.checkFitTee('264_tee_os_opt_fit.dts', 'tee.bad2') + self.checkFitTee('fit/tee_os_opt.dts', 'tee.bad2') self.assertIn( "Node '/binman/fit/images/@tee-SEQ/tee-os': Invalid OP-TEE file: size mismatch (expected 0x4, have 0xe)", str(exc.exception)) @@ -6560,7 +6561,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobMissingOptional(self): """Test an image with an external blob that is optional""" with terminal.capture() as (stdout, stderr): - data = self._DoReadFileDtb('266_blob_ext_opt.dts', + data = self._DoReadFileDtb('blob/ext_opt.dts', allow_fake_blobs=False)[0] self.assertEqual(REFCODE_DATA, data) self.assertNotIn(MISSING_DATA, data) @@ -6568,7 +6569,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testExtblobFakedOptional(self): """Test an image with an external blob that is optional""" with terminal.capture() as (stdout, stderr): - data = self._DoReadFile('266_blob_ext_opt.dts') + data = self._DoReadFile('blob/ext_opt.dts') self.assertEqual(REFCODE_DATA, data) err = stderr.getvalue() self.assertRegex( @@ -6580,18 +6581,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSectionInner(self): """Test an inner section with a size""" - data = self._DoReadFile('267_section_inner.dts') + data = self._DoReadFile('pack/section_inner.dts') expected = U_BOOT_DATA + tools.get_bytes(0, 12) self.assertEqual(expected, data) def testNull(self): """Test an image with a null entry""" - data = self._DoReadFile('268_null.dts') + data = self._DoReadFile('entry/null.dts') self.assertEqual(U_BOOT_DATA + b'\xff\xff\xff\xff' + U_BOOT_IMG_DATA, data) def testOverlap(self): """Test an image with a overlapping entry""" - data = self._DoReadFile('269_overlap.dts') + data = self._DoReadFile('entry/overlap.dts') self.assertEqual(U_BOOT_DATA[:1] + b'aa' + U_BOOT_DATA[3:], data) image = control.images['image'] @@ -6605,7 +6606,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testOverlapNull(self): """Test an image with a null overlap""" - data = self._DoReadFile('270_overlap_null.dts') + data = self._DoReadFile('entry/overlap_null.dts') self.assertEqual(U_BOOT_DATA, data[:len(U_BOOT_DATA)]) # Check the FMAP @@ -6639,7 +6640,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testOverlapBad(self): """Test an image with a bad overlapping entry""" with self.assertRaises(ValueError) as exc: - self._DoReadFile('271_overlap_bad.dts') + self._DoReadFile('entry/overlap_bad.dts') self.assertIn( "Node '/binman/inset': Offset 0x10 (16) ending at 0x12 (18) must overlap with existing entries", str(exc.exception)) @@ -6647,7 +6648,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testOverlapNoOffset(self): """Test an image with a bad overlapping entry""" with self.assertRaises(ValueError) as exc: - self._DoReadFile('272_overlap_no_size.dts') + self._DoReadFile('entry/overlap_no_size.dts') self.assertIn( "Node '/binman/inset': 'fill' entry is missing properties: size", str(exc.exception)) @@ -6659,7 +6660,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap TestFunctional._MakeInputFile('blob_syms.bin', tools.read_file(self.ElfTestFile('blob_syms.bin'))) - data = self._DoReadFile('273_blob_symbol.dts') + data = self._DoReadFile('blob/symbol.dts') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) addr = elf.GetSymbolAddress(elf_fname, '__my_start_sym') @@ -6678,7 +6679,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap TestFunctional._MakeInputFile('blob_syms.bin', tools.read_file(self.ElfTestFile('blob_syms.bin'))) - data = self._DoReadFile('274_offset_from_elf.dts') + data = self._DoReadFile('entry/offset_from_elf.dts') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) base = elf.GetSymbolAddress(elf_fname, '__my_start_sym') @@ -6701,7 +6702,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testFitAlign(self): """Test an image with an FIT with aligned external data""" - data = self._DoReadFile('275_fit_align.dts') + data = self._DoReadFile('fit/align.dts') self.assertEqual(4096, len(data)) dtb = fdt.Fdt.FromData(data) @@ -6728,7 +6729,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) with terminal.capture() as (stdout, stderr): data = self._DoReadFileDtb( - '276_fit_firmware_loadables.dts', + 'fit/firmware_loadables.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -6781,7 +6782,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test replacing an entry in a section""" expect_data = b'w' * len(U_BOOT_DATA + COMPRESS_DATA) entry_data, expected_fdtmap, image = self._RunReplaceCmd('section/blob', - expect_data, dts='241_replace_section_simple.dts') + expect_data, dts='entry/replace_section_simple.dts') self.assertEqual(expect_data, entry_data) entries = image.GetEntries() @@ -6808,7 +6809,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap expect_data = b'w' * len(U_BOOT_DATA + COMPRESS_DATA) entry_data, expected_fdtmap, image = self._RunReplaceCmd( 'section/section/blob', expect_data, - dts='278_replace_section_deep.dts') + dts='entry/replace_section_deep.dts') self.assertEqual(expect_data, entry_data) entries = image.GetEntries() @@ -6838,7 +6839,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test an image with a FIT inside where we replace its sibling""" self._SetupSplElf() fname = TestFunctional._MakeInputFile('once', b'available once') - self._DoReadFileRealDtb('277_replace_fit_sibling.dts') + self._DoReadFileRealDtb('fit/replace_sibling.dts') os.remove(fname) try: @@ -6859,11 +6860,11 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testX509Cert(self): """Test creating an X509 certificate""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } - data = self._DoReadFileDtb('279_x509_cert.dts', + data = self._DoReadFileDtb('security/x509_cert.dts', entry_args=entry_args)[0] cert = data[:-4] self.assertEqual(U_BOOT_DATA, data[-4:]) @@ -6872,12 +6873,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testX509CertMissing(self): """Test that binman still produces an image if openssl is missing""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': 'keyfile', } with terminal.capture() as (_, stderr): - self._DoTestFile('279_x509_cert.dts', + self._DoTestFile('security/x509_cert.dts', force_missing_bintools='openssl', entry_args=entry_args) err = stderr.getvalue() @@ -6885,21 +6886,21 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testPackRockchipTpl(self): """Test that an image with a Rockchip TPL binary can be created""" - data = self._DoReadFile('291_rockchip_tpl.dts') + data = self._DoReadFile('vendor/rockchip_tpl.dts') self.assertEqual(ROCKCHIP_TPL_DATA, data[:len(ROCKCHIP_TPL_DATA)]) def testMkimageMissingBlobMultiple(self): """Test missing blob with mkimage entry and multiple-data-files""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('292_mkimage_missing_multiple.dts', allow_missing=True) + self._DoTestFile('mkimage/missing_multiple.dts', allow_missing=True) err = stderr.getvalue() self.assertIn("is missing external blobs and is non-functional", err) with self.assertRaises(ValueError) as e: - self._DoTestFile('292_mkimage_missing_multiple.dts', allow_missing=False) + self._DoTestFile('mkimage/missing_multiple.dts', allow_missing=False) self.assertIn("not found in input path", str(e.exception)) - def _PrepareSignEnv(self, dts='280_fit_sign.dts'): + def _PrepareSignEnv(self, dts='fit/sign.dts'): """Prepare sign environment Create private and public keys, add pubkey into dtb. @@ -6963,7 +6964,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test a non-FIT entry cannot be signed""" is_signed = False fit, fname, private_key, _ = self._PrepareSignEnv( - '281_sign_non_fit.dts') + 'security/sign_non_fit.dts') # do sign with private key with self.assertRaises(ValueError) as e: @@ -6987,7 +6988,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSymbolNoWrite(self): """Test disabling of symbol writing""" self._SetupSplElf() - self.checkSymbols('282_symbols_disable.dts', U_BOOT_SPL_DATA, 0x1c, + self.checkSymbols('symbols/disable.dts', U_BOOT_SPL_DATA, 0x1c, no_write_symbols=True) def testSymbolNoWriteExpanded(self): @@ -6995,14 +6996,14 @@ fdt fdtmap Extract the devicetree blob from the fdtmap entry_args = { 'spl-dtb': '1', } - self.checkSymbols('282_symbols_disable.dts', U_BOOT_SPL_NODTB_DATA + + self.checkSymbols('symbols/disable.dts', U_BOOT_SPL_NODTB_DATA + U_BOOT_SPL_DTB_DATA, 0x38, entry_args=entry_args, use_expanded=True, no_write_symbols=True) def testMkimageSpecial(self): """Test mkimage ignores special hash-1 node""" - data = self._DoReadFile('283_mkimage_special.dts') + data = self._DoReadFile('mkimage/special.dts') # Just check that the data appears in the file somewhere self.assertIn(U_BOOT_DATA, data) @@ -7013,7 +7014,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'default-dt': 'test-fdt2', } data = self._DoReadFileDtb( - '284_fit_fdt_list.dts', + 'fit/fdt_list.dts', entry_args=entry_args, extra_indirs=[os.path.join(self._indir, TEST_FDT_SUBDIR)])[0] self.assertEqual(U_BOOT_NODTB_DATA, data[-len(U_BOOT_NODTB_DATA):]) @@ -7028,13 +7029,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'spl-bss-pad': 'y', 'spl-dtb': 'y', } - data = self._DoReadFileDtb('285_spl_expand.dts', + data = self._DoReadFileDtb('xpl/u-boot-spl.dts', use_expanded=True, entry_args=entry_args)[0] def testTemplate(self): """Test using a template""" TestFunctional._MakeInputFile('vga2.bin', b'#' + VGA_DATA) - data = self._DoReadFile('286_template.dts') + data = self._DoReadFile('entry/template.dts') first = U_BOOT_DATA + VGA_DATA + U_BOOT_DTB_DATA second = U_BOOT_DATA + b'#' + VGA_DATA + U_BOOT_DTB_DATA self.assertEqual(U_BOOT_IMG_DATA + first + second, data) @@ -7059,7 +7060,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test using a template with 'multiple-images' enabled""" TestFunctional._MakeInputFile('my-blob.bin', b'blob') TestFunctional._MakeInputFile('my-blob2.bin', b'other') - retcode = self._DoTestFile('287_template_multi.dts') + retcode = self._DoTestFile('entry/template_multi.dts') self.assertEqual(0, retcode) image = control.images['image'] @@ -7069,7 +7070,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testTemplateFit(self): """Test using a template in a FIT""" - fit_data = self._DoReadFile('288_template_fit.dts') + fit_data = self._DoReadFile('fit/template.dts') fname = os.path.join(self._indir, 'fit_data.fit') tools.write_file(fname, fit_data) out = tools.run('dumpimage', '-l', fname) @@ -7077,7 +7078,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testTemplateSection(self): """Test using a template in a section (not at top level)""" TestFunctional._MakeInputFile('vga2.bin', b'#' + VGA_DATA) - data = self._DoReadFile('289_template_section.dts') + data = self._DoReadFile('entry/template_section.dts') first = U_BOOT_DATA + VGA_DATA + U_BOOT_DTB_DATA second = U_BOOT_DATA + b'#' + VGA_DATA + U_BOOT_DTB_DATA self.assertEqual(U_BOOT_IMG_DATA + first + second + first, data) @@ -7085,7 +7086,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkimageSymbols(self): """Test using mkimage to build an image with symbols in it""" self._SetupSplElf('u_boot_binman_syms') - data = self._DoReadFile('290_mkimage_sym.dts') + data = self._DoReadFile('mkimage/sym.dts') image = control.images['image'] entries = image.GetEntries() @@ -7151,7 +7152,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap entry_args = { 'atf-bl31-path': 'bl31.elf', } - data = self._DoReadFileDtb('309_template_phandle.dts', + data = self._DoReadFileDtb('entry/template_phandle.dts', entry_args=entry_args) fname = tools.get_output_filename('image.bin') out = tools.run('dumpimage', '-l', fname) @@ -7167,7 +7168,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'atf-bl31-path': 'bl31.elf', } with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('310_template_phandle_dup.dts', + self._DoReadFileDtb('entry/template_phandle_dup.dts', entry_args=entry_args) self.assertIn( 'Duplicate phandle 1 in nodes /binman/image/fit/images/atf/atf-bl31 and /binman/image-2/fit/images/atf/atf-bl31', @@ -7175,69 +7176,69 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testTIBoardConfig(self): """Test that a schema validated board config file can be generated""" - data = self._DoReadFile('293_ti_board_cfg.dts') + data = self._DoReadFile('vendor/ti_board_cfg.dts') self.assertEqual(TI_BOARD_CONFIG_DATA, data) def testTIBoardConfigLint(self): """Test that an incorrectly linted config file would generate error""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('323_ti_board_cfg_phony.dts') + data = self._DoReadFile('vendor/ti_board_cfg_phony.dts') self.assertIn("Yamllint error", str(e.exception)) def testTIBoardConfigCombined(self): """Test that a schema validated combined board config file can be generated""" - data = self._DoReadFile('294_ti_board_cfg_combined.dts') + data = self._DoReadFile('vendor/ti_board_cfg_combined.dts') configlen_noheader = TI_BOARD_CONFIG_DATA * 4 self.assertGreater(data, configlen_noheader) def testTIBoardConfigNoDataType(self): """Test that error is thrown when data type is not supported""" with self.assertRaises(ValueError) as e: - data = self._DoReadFile('295_ti_board_cfg_no_type.dts') + data = self._DoReadFile('vendor/ti_board_cfg_no_type.dts') self.assertIn("Schema validation error", str(e.exception)) def testPackTiSecure(self): """Test that an image with a TI secured binary can be created""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } - data = self._DoReadFileDtb('296_ti_secure.dts', + data = self._DoReadFileDtb('vendor/ti_secure.dts', entry_args=entry_args)[0] self.assertGreater(len(data), len(TI_UNSECURE_DATA)) def testPackTiSecureFirewall(self): """Test that an image with a TI secured binary can be created""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } - data_no_firewall = self._DoReadFileDtb('296_ti_secure.dts', + data_no_firewall = self._DoReadFileDtb('vendor/ti_secure.dts', entry_args=entry_args)[0] - data_firewall = self._DoReadFileDtb('324_ti_secure_firewall.dts', + data_firewall = self._DoReadFileDtb('vendor/ti_secure_firewall.dts', entry_args=entry_args)[0] self.assertGreater(len(data_firewall),len(data_no_firewall)) def testPackTiSecureFirewallMissingProperty(self): """Test that an image with a TI secured binary can be created""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } with self.assertRaises(ValueError) as e: - data_firewall = self._DoReadFileDtb('325_ti_secure_firewall_missing_property.dts', + data_firewall = self._DoReadFileDtb('vendor/ti_secure_firewall_missing_property.dts', entry_args=entry_args)[0] self.assertRegex(str(e.exception), "Node '/binman/ti-secure': Subnode 'firewall-0-2' is missing properties: id,region") def testPackTiSecureMissingTool(self): """Test that an image with a TI secured binary (non-functional) can be created when openssl is missing""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } with terminal.capture() as (_, stderr): - self._DoTestFile('296_ti_secure.dts', + self._DoTestFile('vendor/ti_secure.dts', force_missing_bintools='openssl', entry_args=entry_args) err = stderr.getvalue() @@ -7245,15 +7246,15 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testPackTiSecureROM(self): """Test that a ROM image with a TI secured binary can be created""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } - data = self._DoReadFileDtb('297_ti_secure_rom.dts', + data = self._DoReadFileDtb('vendor/ti_secure_rom.dts', entry_args=entry_args)[0] - data_a = self._DoReadFileDtb('299_ti_secure_rom_a.dts', + data_a = self._DoReadFileDtb('vendor/ti_secure_rom_a.dts', entry_args=entry_args)[0] - data_b = self._DoReadFileDtb('300_ti_secure_rom_b.dts', + data_b = self._DoReadFileDtb('vendor/ti_secure_rom_b.dts', entry_args=entry_args)[0] self.assertGreater(len(data), len(TI_UNSECURE_DATA)) self.assertGreater(len(data_a), len(TI_UNSECURE_DATA)) @@ -7261,18 +7262,18 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testPackTiSecureROMCombined(self): """Test that a ROM image with a TI secured binary can be created""" - keyfile = self.TestFile('key.key') + keyfile = self.TestFile('security/key.key') entry_args = { 'keyfile': keyfile, } - data = self._DoReadFileDtb('298_ti_secure_rom_combined.dts', + data = self._DoReadFileDtb('vendor/ti_secure_rom_combined.dts', entry_args=entry_args)[0] self.assertGreater(len(data), len(TI_UNSECURE_DATA)) def testEncryptedNoAlgo(self): """Test encrypted node with missing required properties""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('301_encrypted_no_algo.dts') + self._DoReadFileDtb('security/encrypted_no_algo.dts') self.assertIn( "Node '/binman/fit/images/u-boot/encrypted': 'encrypted' entry is missing properties: algo iv-filename", str(e.exception)) @@ -7280,21 +7281,21 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testEncryptedInvalidIvfile(self): """Test encrypted node with invalid iv file""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('302_encrypted_invalid_iv_file.dts') + self._DoReadFileDtb('security/encrypted_invalid_iv_file.dts') self.assertIn("Filename 'invalid-iv-file' not found in input path", str(e.exception)) def testEncryptedMissingKey(self): """Test encrypted node with missing key properties""" with self.assertRaises(ValueError) as e: - self._DoReadFileDtb('303_encrypted_missing_key.dts') + self._DoReadFileDtb('security/encrypted_missing_key.dts') self.assertIn( "Node '/binman/fit/images/u-boot/encrypted': Provide either 'key-filename' or 'key-source'", str(e.exception)) def testEncryptedKeySource(self): """Test encrypted node with key-source property""" - data = self._DoReadFileDtb('304_encrypted_key_source.dts')[0] + data = self._DoReadFileDtb('security/encrypted_key_source.dts')[0] dtb = fdt.Fdt.FromData(data) dtb.Scan() @@ -7308,7 +7309,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testEncryptedKeyFile(self): """Test encrypted node with key-filename property""" - data = self._DoReadFileDtb('305_encrypted_key_file.dts')[0] + data = self._DoReadFileDtb('security/encrypted_key_file.dts')[0] dtb = fdt.Fdt.FromData(data) dtb.Scan() @@ -7324,16 +7325,16 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testKeyNameHintIsPathSplPubkeyDtb(self): """Test that binman errors out on key-name-hint being a path""" with self.assertRaises(ValueError) as e: - self._DoReadFile('348_key_name_hint_dir_spl_pubkey_dtb.dts') + self._DoReadFile('security/key_name_hint_dir_spl_pubkey_dtb.dts') self.assertIn( 'Node \'/binman/u-boot-spl-pubkey-dtb\': \'keys/key\' is a path not a filename', str(e.exception)) def testSplPubkeyDtb(self): """Test u_boot_spl_pubkey_dtb etype""" - data = tools.read_file(self.TestFile("key.pem")) + data = tools.read_file(self.TestFile("security/key.pem")) self._MakeInputFile("key.crt", data) - self._DoReadFileRealDtb('306_spl_pubkey_dtb.dts') + self._DoReadFileRealDtb('security/spl_pubkey_dtb.dts') image = control.images['image'] entries = image.GetEntries() dtb_entry = entries['u-boot-spl-pubkey-dtb'] @@ -7353,12 +7354,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test xilinx-bootgen etype""" bootgen = bintool.Bintool.create('bootgen') self._CheckBintool(bootgen) - data = tools.read_file(self.TestFile("key.key")) + data = tools.read_file(self.TestFile("security/key.key")) self._MakeInputFile("psk.pem", data) self._MakeInputFile("ssk.pem", data) self._SetupPmuFwlElf() self._SetupSplElf() - self._DoReadFileRealDtb('307_xilinx_bootgen_sign.dts') + self._DoReadFileRealDtb('security/xilinx_bootgen_sign.dts') image_fname = tools.get_output_filename('image.bin') # Read partition header table and check if authentication is enabled @@ -7382,12 +7383,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap """Test xilinx-bootgen etype""" bootgen = bintool.Bintool.create('bootgen') self._CheckBintool(bootgen) - data = tools.read_file(self.TestFile("key.key")) + data = tools.read_file(self.TestFile("security/key.key")) self._MakeInputFile("psk.pem", data) self._MakeInputFile("ssk.pem", data) self._SetupPmuFwlElf() self._SetupSplElf() - self._DoReadFileRealDtb('308_xilinx_bootgen_sign_enc.dts') + self._DoReadFileRealDtb('security/xilinx_bootgen_sign_enc.dts') image_fname = tools.get_output_filename('image.bin') # Read boot header in order to verify encryption source and @@ -7414,13 +7415,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testXilinxBootgenMissing(self): """Test that binman still produces an image if bootgen is missing""" - data = tools.read_file(self.TestFile("key.key")) + data = tools.read_file(self.TestFile("security/key.key")) self._MakeInputFile("psk.pem", data) self._MakeInputFile("ssk.pem", data) self._SetupPmuFwlElf() self._SetupSplElf() with terminal.capture() as (_, stderr): - self._DoTestFile('307_xilinx_bootgen_sign.dts', + self._DoTestFile('security/xilinx_bootgen_sign.dts', force_missing_bintools='bootgen') err = stderr.getvalue() self.assertRegex(err, @@ -7517,48 +7518,120 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCapsuleGen(self): """Test generation of EFI capsule""" - data = self._DoReadFile('311_capsule.dts') + data = self._DoReadFile('capsule/capsule.dts') self._CheckCapsule(data) def testSignedCapsuleGen(self): """Test generation of EFI capsule""" - data = tools.read_file(self.TestFile("key.key")) + data = tools.read_file(self.TestFile("security/key.key")) self._MakeInputFile("key.key", data) - data = tools.read_file(self.TestFile("key.pem")) + data = tools.read_file(self.TestFile("security/key.pem")) self._MakeInputFile("key.crt", data) - data = self._DoReadFile('312_capsule_signed.dts') + data = self._DoReadFile('capsule/signed.dts') self._CheckCapsule(data, signed_capsule=True) + def testPkcs11SignedCapsuleGen(self): + """Test generation of EFI capsule (with PKCS11)""" + data = tools.read_file(self.TestFile("security/key.key")) + private_key = self._MakeInputFile("key.key", data) + data = tools.read_file(self.TestFile("security/key.pem")) + cert_file = self._MakeInputFile("key.crt", data) + + softhsm2_util = bintool.Bintool.create('softhsm2_util') + self._CheckBintool(softhsm2_util) + + pkcs11_tool = bintool.Bintool.create('pkcs11-tool') + self._CheckBintool(pkcs11_tool) + + prefix = "testPkcs11SignedCapsuleGen." + # Configure SoftHSMv2 + data = tools.read_file(self.TestFile('fit/softhsm2.conf')) + softhsm2_conf = self._MakeInputFile(f'{prefix}softhsm2.conf', data) + softhsm2_tokens_dir = self._MakeInputDir(f'{prefix}softhsm2.tokens') + + with open(softhsm2_conf, 'a') as f: + f.write(f'directories.tokendir = {softhsm2_tokens_dir}\n') + + # Find the path to softhsm2 library + p11_kit = bintool.Bintool.create('p11-kit') + self._CheckBintool(p11_kit) + + p11_kit_config = configparser.ConfigParser() + out = tools.run('p11-kit', 'print-config') + p11_kit_config.read_string(out) + softhsm2_lib = p11_kit_config.get('softhsm2', 'module', + fallback=None) + self.assertIsNotNone(softhsm2_lib) + + with unittest.mock.patch.dict('os.environ', + {'SOFTHSM2_CONF': softhsm2_conf, + 'PKCS11_MODULE_PATH': softhsm2_lib}): + tools.run('softhsm2-util', '--init-token', '--free', '--label', + 'U-Boot token', '--pin', '1111', '--so-pin', + '222222') + tools.run('pkcs11-tool', '--module', softhsm2_lib, + '--write-object', cert_file, '--pin', '1111', + '--type', 'cert', '--id', '999999', '--label', + 'test_cert', '--login') + tools.run('softhsm2-util', '--import', private_key, '--token', + 'U-Boot token', '--label', 'test_key', '--id', '999999', + '--pin', '1111') + data = self._DoReadFile('capsule/signed_pkcs11.dts') + + self._CheckCapsule(data, signed_capsule=True) + + hdr = self._GetCapsuleHeaders(data) + monotonic_count = hdr['EFI_FIRMWARE_IMAGE_AUTH.MONOTONIC_COUNT'] + + # UEFI standard requires that signature is checked over payload followed + # by a monotonic count as little endian 64-bit integer. + sig_input = self._MakeInputFile("sig_input", EFI_CAPSULE_DATA) + with open(sig_input, 'ab') as f: + f.write(struct.pack('<Q', int(monotonic_count, 16))) + + # Verify dumped capsule signature dumped by meficapsule during + # generation + openssl = bintool.Bintool.create('openssl') + self._CheckBintool(openssl) + openssl_args = ['smime', '-verify', '-inform', 'DER', + '-in', tools.get_output_filename('capsule.efi-capsule.p7'), + '-content', sig_input, '-CAfile', cert_file, + '-no_check_time', + '-out', tools.get_output_filename('decoded-capsule.bin')] + result = openssl.run_cmd_result(*openssl_args) + self.assertIsNotNone(result.stdout) + self.assertIn('Verification successful', result.stderr) + def testCapsuleGenVersionSupport(self): """Test generation of EFI capsule with version support""" - data = self._DoReadFile('313_capsule_version.dts') + data = self._DoReadFile('capsule/version.dts') self._CheckCapsule(data, version_check=True) def testCapsuleGenSignedVer(self): """Test generation of signed EFI capsule with version information""" - data = tools.read_file(self.TestFile("key.key")) + data = tools.read_file(self.TestFile("security/key.key")) self._MakeInputFile("key.key", data) - data = tools.read_file(self.TestFile("key.pem")) + data = tools.read_file(self.TestFile("security/key.pem")) self._MakeInputFile("key.crt", data) - data = self._DoReadFile('314_capsule_signed_ver.dts') + data = self._DoReadFile('capsule/signed_ver.dts') self._CheckCapsule(data, signed_capsule=True, version_check=True) def testCapsuleGenCapOemFlags(self): """Test generation of EFI capsule with OEM Flags set""" - data = self._DoReadFile('315_capsule_oemflags.dts') + data = self._DoReadFile('capsule/oemflags.dts') self._CheckCapsule(data, capoemflags=True) def testCapsuleGenKeyMissing(self): """Test that binman errors out on missing key""" with self.assertRaises(ValueError) as e: - self._DoReadFile('316_capsule_missing_key.dts') + self._DoReadFile('capsule/missing_key.dts') self.assertIn("Both private key and public key certificate need to be provided", str(e.exception)) @@ -7566,7 +7639,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCapsuleGenIndexMissing(self): """Test that binman errors out on missing image index""" with self.assertRaises(ValueError) as e: - self._DoReadFile('317_capsule_missing_index.dts') + self._DoReadFile('capsule/missing_index.dts') self.assertIn("entry is missing properties: image-index", str(e.exception)) @@ -7574,27 +7647,27 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCapsuleGenGuidMissing(self): """Test that binman errors out on missing image GUID""" with self.assertRaises(ValueError) as e: - self._DoReadFile('318_capsule_missing_guid.dts') + self._DoReadFile('capsule/missing_guid.dts') self.assertIn("entry is missing properties: image-guid", str(e.exception)) def testCapsuleGenAcceptCapsule(self): """Test generationg of accept EFI capsule""" - data = self._DoReadFile('319_capsule_accept.dts') + data = self._DoReadFile('capsule/accept.dts') self._CheckEmptyCapsule(data, accept_capsule=True) def testCapsuleGenRevertCapsule(self): """Test generationg of revert EFI capsule""" - data = self._DoReadFile('320_capsule_revert.dts') + data = self._DoReadFile('capsule/revert.dts') self._CheckEmptyCapsule(data) def testCapsuleGenAcceptGuidMissing(self): """Test that binman errors out on missing image GUID for accept capsule""" with self.assertRaises(ValueError) as e: - self._DoReadFile('321_capsule_accept_missing_guid.dts') + self._DoReadFile('capsule/accept_missing_guid.dts') self.assertIn("Image GUID needed for generating accept capsule", str(e.exception)) @@ -7602,7 +7675,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCapsuleGenEmptyCapsuleTypeMissing(self): """Test that capsule-type is specified""" with self.assertRaises(ValueError) as e: - self._DoReadFile('322_empty_capsule_type_missing.dts') + self._DoReadFile('capsule/empty_type_missing.dts') self.assertIn("entry is missing properties: capsule-type", str(e.exception)) @@ -7610,12 +7683,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testCapsuleGenAcceptOrRevertMissing(self): """Test that both accept and revert capsule are not specified""" with self.assertRaises(ValueError) as e: - self._DoReadFile('323_capsule_accept_revert_missing.dts') + self._DoReadFile('capsule/accept_revert_missing.dts') def test_assume_size(self): """Test handling of the assume-size property for external blob""" with self.assertRaises(ValueError) as e: - self._DoTestFile('326_assume_size.dts', allow_missing=True, + self._DoTestFile('pack/assume_size.dts', allow_missing=True, allow_fake_blobs=True) self.assertIn("contents size 0xa (10) exceeds section size 0x9 (9)", str(e.exception)) @@ -7623,7 +7696,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def test_assume_size_ok(self): """Test handling of the assume-size where it fits OK""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('327_assume_size_ok.dts', allow_missing=True, + self._DoTestFile('pack/assume_size_ok.dts', allow_missing=True, allow_fake_blobs=True) err = stderr.getvalue() self.assertRegex( @@ -7633,7 +7706,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def test_assume_size_no_fake(self): """Test handling of the assume-size where it fits OK""" with terminal.capture() as (stdout, stderr): - self._DoTestFile('327_assume_size_ok.dts', allow_missing=True) + self._DoTestFile('pack/assume_size_ok.dts', allow_missing=True) err = stderr.getvalue() self.assertRegex( err, @@ -7724,7 +7797,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testAlternatesFdt(self): """Test handling of alternates-fdt etype""" self._SetupTplElf() - dtbs = self.CheckAlternates('328_alternates_fdt.dts', 'tpl', + dtbs = self.CheckAlternates('fdt/alternates_fdt.dts', 'tpl', U_BOOT_TPL_NODTB_DATA) for dtb in dtbs.values(): # Check for the node with the tag @@ -7738,7 +7811,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testAlternatesFdtgrep(self): """Test handling of alternates-fdt etype using fdtgrep""" self._SetupTplElf() - dtbs = self.CheckAlternates('329_alternates_fdtgrep.dts', 'tpl', + dtbs = self.CheckAlternates('fdt/alternates_fdtgrep.dts', 'tpl', U_BOOT_TPL_NODTB_DATA) for dtb in dtbs.values(): # Check for the node with the tag @@ -7753,20 +7826,20 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testAlternatesFdtgrepVpl(self): """Test handling of alternates-fdt etype using fdtgrep with vpl""" self._SetupVplElf() - dtbs = self.CheckAlternates('330_alternates_vpl.dts', 'vpl', + dtbs = self.CheckAlternates('fdt/alternates_vpl.dts', 'vpl', U_BOOT_VPL_NODTB_DATA) def testAlternatesFdtgrepSpl(self): """Test handling of alternates-fdt etype using fdtgrep with spl""" self._SetupSplElf() - dtbs = self.CheckAlternates('331_alternates_spl.dts', 'spl', + dtbs = self.CheckAlternates('fdt/alternates_spl.dts', 'spl', U_BOOT_SPL_NODTB_DATA) def testAlternatesFdtgrepInval(self): """Test alternates-fdt etype using fdtgrep with invalid phase""" self._SetupSplElf() with self.assertRaises(ValueError) as e: - dtbs = self.CheckAlternates('332_alternates_inval.dts', 'spl', + dtbs = self.CheckAlternates('fdt/alternates_inval.dts', 'spl', U_BOOT_SPL_NODTB_DATA) self.assertIn("Invalid U-Boot phase 'bad-phase': Use tpl/vpl/spl", str(e.exception)) @@ -7776,7 +7849,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap old_dir = os.getcwd() try: os.chdir(self._indir) - self.CheckFitFdt('333_fit_fdt_dir.dts', False) + self.CheckFitFdt('fit/fdt_dir.dts', False) finally: os.chdir(old_dir) @@ -7785,7 +7858,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap old_dir = os.getcwd() try: os.chdir(self._indir) - self.CheckFitFdt('333_fit_fdt_dir.dts', False, + self.CheckFitFdt('fit/fdt_dir.dts', False, default_dt='rockchip/test-fdt2') finally: os.chdir(old_dir) @@ -7798,7 +7871,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap } testdir, dtb_list = self.SetupAlternateDts() data = self._DoReadFileDtb( - '334_fit_fdt_compat.dts', use_real_dtb=True, update_dtb=True, + 'fit/fdt_compat.dts', use_real_dtb=True, update_dtb=True, entry_args=entry_args, extra_indirs=[testdir])[0] fit_data = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] @@ -7831,7 +7904,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap } testdir, dtb_list = self.SetupAlternateDts() data = self._DoReadFileDtb( - '335_fit_fdt_phase.dts', use_real_dtb=True, update_dtb=True, + 'fit/fdt_phase.dts', use_real_dtb=True, update_dtb=True, entry_args=entry_args, extra_indirs=[testdir])[0] fit_data = data[len(U_BOOT_DATA):-len(U_BOOT_NODTB_DATA)] fit = fdt.Fdt.FromData(fit_data) @@ -7857,7 +7930,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkeficapsuleMissing(self): """Test that binman complains if mkeficapsule is missing""" with self.assertRaises(ValueError) as e: - self._DoTestFile('311_capsule.dts', + self._DoTestFile('capsule/capsule.dts', force_missing_bintools='mkeficapsule') self.assertIn("Node '/binman/efi-capsule': Missing tool: 'mkeficapsule'", str(e.exception)) @@ -7865,7 +7938,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testMkeficapsuleMissingOk(self): """Test that binman deals with mkeficapsule being missing""" with terminal.capture() as (stdout, stderr): - ret = self._DoTestFile('311_capsule.dts', + ret = self._DoTestFile('capsule/capsule.dts', force_missing_bintools='mkeficapsule', allow_missing=True) self.assertEqual(103, ret) @@ -7874,7 +7947,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSymbolsBase(self): """Test handling of symbols-base""" - self.checkSymbols('336_symbols_base.dts', U_BOOT_SPL_DATA, 0x1c, + self.checkSymbols('symbols/base.dts', U_BOOT_SPL_DATA, 0x1c, symbols_base=0) def testSymbolsBaseExpanded(self): @@ -7882,7 +7955,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap entry_args = { 'spl-dtb': '1', } - self.checkSymbols('337_symbols_base_expand.dts', U_BOOT_SPL_NODTB_DATA + + self.checkSymbols('symbols/base_expand.dts', U_BOOT_SPL_NODTB_DATA + U_BOOT_SPL_DTB_DATA, 0x38, entry_args=entry_args, use_expanded=True, symbols_base=0) @@ -7890,18 +7963,124 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSymbolsCompressed(self): """Test binman complains about symbols from a compressed section""" with terminal.capture() as (stdout, stderr): - self.checkSymbols('338_symbols_comp.dts', U_BOOT_SPL_DATA, None) + self.checkSymbols('symbols/comp.dts', U_BOOT_SPL_DATA, None) out = stdout.getvalue() self.assertIn('Symbol-writing: no value for /binman/section/u-boot', out) def testNxpImx8Image(self): """Test that binman can produce an iMX8 image""" - self._DoTestFile('339_nxp_imx8.dts') + self._DoTestFile('vendor/nxp_imx8.dts') + + def testNxpImx8ImageMissing(self): + """Test that binman produces an iMX8 image if mkimage is missing""" + with terminal.capture() as (_, stderr): + self._DoTestFile('vendor/nxp_imx8.dts', + force_missing_bintools='mkimage') + err = stderr.getvalue() + self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage") + + def testNxpImx8ImagePos(self): + """Test SetImagePos for iMX8 image""" + with terminal.capture() as (_, stderr): + self._DoTestFile('vendor/nxp_imx8.dts', update_dtb=True, + force_missing_bintools='mkimage') + err = stderr.getvalue() + self.assertRegex(err, "Image 'image'.*missing bintools.*: mkimage") + + def testNxpImx8mCSTNormal(self): + """Test CST signing with IVT-format input (normal auth, no unlock)""" + # Create fake IVT blob: magic(4) + padding(20) + signsize_addr(4) + # + padding(36) = 64 bytes + ivt_data = struct.pack('<I', 0x412000d1) + ivt_data += b'\x00' * 20 + ivt_data += struct.pack('<I', 0) + ivt_data += b'\x00' * 36 + self._MakeInputFile('imx8m-ivt.bin', ivt_data) + with terminal.capture() as (_, stderr): + self._DoTestFile('vendor/nxp_imx8_csf.dts', + force_missing_bintools='cst') + err = stderr.getvalue() + self.assertRegex(err, "Image 'image'.*missing bintools.*: cst") + + def testNxpImx8mCSTFastAuth(self): + """Test CST signing with fast-auth mode, unlock, and FIT format""" + # FIT magic covers the FIT-signing path; fast-auth/unlock cover the + # ReadNode() and config-generation branches + fit_data = struct.pack('<I', 0xedfe0dd0) + fit_data += b'\x00' * 60 + self._MakeInputFile('imx8m-fit.bin', fit_data) + with terminal.capture() as (_, stderr): + self._DoTestFile('vendor/nxp_imx8_csf_fast_auth.dts', + force_missing_bintools='cst') + err = stderr.getvalue() + self.assertRegex(err, "Image 'image'.*missing bintools.*: cst") + + def testNxpImx8mCSTUnknownMagic(self): + """Test CST with unknown input magic passes data through""" + # Trigger the pass-through path use data with neither IVT nor FIT magic + data = b'\x00' * 64 + self._MakeInputFile('imx8m-ivt.bin', data) + self._DoTestFile('vendor/nxp_imx8_csf.dts', force_missing_bintools='cst') + + def testNxpImx8ImageSizeNone(self): + """Test SetImagePos() early return when an entry has no size""" + # The imagename entry is in GetEntries() but not packed, so has + # size=None, which triggers the early-return guard in SetImagePos() + with terminal.capture() as (_, stderr): + self._DoTestFile('vendor/nxp_imx8_imagename.dts', + force_missing_bintools='mkimage') + + def testNxpImx8mCSTSigned(self): + """Test CST-signing-success path with mocked cst invocation""" + ivt_data = struct.pack('<I', 0x412000d1) + ivt_data += b'\x00' * 20 + ivt_data += struct.pack('<I', 0) + ivt_data += b'\x00' * 36 + self._MakeInputFile('imx8m-ivt.bin', ivt_data) + + # Mock run_cmd() so that when cst is invoked, it creates a fake output + # blob and returns success, thus covering the signing path + original = bintool.Bintool.run_cmd + + def fake_cst_run_cmd(self_tool, *args, binary=False): + if self_tool.name == 'cst': + arg_list = list(args) + if '-o' in arg_list: + idx = arg_list.index('-o') + tools.write_file(arg_list[idx + 1], b'\x00' * 32) + return 'fake cst output' + return original(self_tool, *args, binary=binary) + + with unittest.mock.patch.object(bintool.Bintool, 'run_cmd', + new=fake_cst_run_cmd): + self._DoTestFile('vendor/nxp_imx8_csf.dts') + + def testNxpImx8mCSTBintool(self): + """Test the cst bintool run() and fetch() methods""" + cst = bintool.Bintool.create('cst') + self.assertEqual('cst', cst.name) + + # Mark cst as missing so run() exercises the code without needing the + # real tool (which fails without valid signing keys) + old_missing = bintool.Bintool.missing_list + bintool.Bintool.set_missing_list(['cst']) + try: + self.assertIsNone(cst.run('test.bin')) + finally: + bintool.Bintool.set_missing_list(old_missing) + # fetch() only supports FETCH_BUILD; other methods return None + self.assertIsNone(cst.fetch(bintool.FETCH_BIN)) + + # fetch(FETCH_BUILD) calls build_from_git() so mock it + with unittest.mock.patch.object( + bintool.Bintool, 'build_from_git', return_value=('cst', None)): + result = cst.fetch(bintool.FETCH_BUILD) + self.assertEqual(('cst', None), result) def testNxpHeaderDdrfw(self): """Test that binman can add a header to DDR PHY firmware images""" - data = self._DoReadFile('346_nxp_ddrfw_imx95.dts') + data = self._DoReadFile('vendor/nxp_ddrfw_imx95.dts') self.assertEqual(len(IMX_LPDDR_IMEM_DATA).to_bytes(4, 'little') + len(IMX_LPDDR_DMEM_DATA).to_bytes(4, 'little') + IMX_LPDDR_IMEM_DATA + IMX_LPDDR_DMEM_DATA, data) @@ -7915,7 +8094,8 @@ fdt fdtmap Extract the devicetree blob from the fdtmap container_path = os.path.join(testdir, 'mx95b0-ahab-container.img') with open(container_path, 'w') as f: f.write(bytes([0x87]).decode('latin1') * 32768) - self._DoTestFile('350_nxp_imx95.dts', output_dir=testdir) + with terminal.capture(): + self._DoTestFile('vendor/nxp_imx95.dts', output_dir=testdir) def testFitSignSimple(self): """Test that image with FIT and signature nodes can be signed""" @@ -7926,13 +8106,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'default-dt': 'test-fdt1', 'atf-bl31-path': 'bl31.elf', } - data = tools.read_file(self.TestFile("340_rsa2048.key")) + data = tools.read_file(self.TestFile("fit/rsa2048.key")) self._MakeInputFile("keys/rsa2048.key", data) test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) keys_subdir = os.path.join(self._indir, "keys") data = self._DoReadFileDtb( - '340_fit_signature.dts', + 'fit/signature.dts', entry_args=entry_args, extra_indirs=[test_subdir, keys_subdir])[0] @@ -7963,7 +8143,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'atf-bl31-path': 'bl31.elf', } - x509_pubkey = '340_dummy-rsa4096.crt' + x509_pubkey = 'fit/dummy-rsa4096.crt' data = tools.read_file(self.TestFile(x509_pubkey)) self._MakeInputFile('dev.crt', data) @@ -7973,7 +8153,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap with unittest.mock.patch.dict('os.environ', {'OPENSSL_ENGINES': ossl_engines_path}): data = self._DoReadFileDtb( - '340_fit_signature_engine.dts', + 'fit/signature_engine.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -8014,7 +8194,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '340_fit_signature_engine_encrypt.dts', + 'fit/signature_engine_encrypt.dts', entry_args=entry_args, extra_indirs=[test_subdir]) @@ -8038,7 +8218,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap prefix = "testFitSignPKCS11Simple." # Configure SoftHSMv2 - data = tools.read_file(self.TestFile('340_softhsm2.conf')) + data = tools.read_file(self.TestFile('fit/softhsm2.conf')) softhsm2_conf = self._MakeInputFile(f'{prefix}softhsm2.conf', data) softhsm2_tokens_dir = self._MakeInputDir(f'{prefix}softhsm2.tokens') @@ -8069,12 +8249,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) # Make OpenSSL use softhsm2 engine - ossl_conf = self.TestFile('340_openssl.conf') + ossl_conf = self.TestFile('fit/openssl.conf') with unittest.mock.patch.dict('os.environ', {'OPENSSL_CONF': ossl_conf, 'SOFTHSM2_CONF': softhsm2_conf}): data = self._DoReadFileDtb( - '340_fit_signature_engine_pkcs11.dts', + 'fit/signature_engine_pkcs11.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -8113,7 +8293,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap prefix = "testFitSignPKCS11Object." # Configure SoftHSMv2 - data = tools.read_file(self.TestFile('340_softhsm2.conf')) + data = tools.read_file(self.TestFile('fit/softhsm2.conf')) softhsm2_conf = self._MakeInputFile(f'{prefix}softhsm2.conf', data) softhsm2_tokens_dir = self._MakeInputDir(f'{prefix}softhsm2.tokens') @@ -8146,13 +8326,13 @@ fdt fdtmap Extract the devicetree blob from the fdtmap # Make OpenSSL use softhsm2 engine and configure PIN for token # The PIN is incorrect on purpose, the correct one will be passed by # MKIMAGE_SIGN_PIN - ossl_conf = self.TestFile('340_openssl.conf') + ossl_conf = self.TestFile('fit/openssl.conf') with unittest.mock.patch.dict('os.environ', {'OPENSSL_CONF': ossl_conf, 'SOFTHSM2_CONF': softhsm2_conf, 'MKIMAGE_SIGN_PIN': '1234'}): data = self._DoReadFileDtb( - '340_fit_signature_engine_pkcs11_object.dts', + 'fit/signature_engine_pkcs11_object.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -8187,7 +8367,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '340_fit_signature.dts', + 'fit/signature.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] self.assertIn( @@ -8203,9 +8383,9 @@ fdt fdtmap Extract the devicetree blob from the fdtmap 'default-dt': 'test-fdt1', 'atf-bl31-path': 'bl31.elf', } - data = tools.read_file(self.TestFile("340_rsa2048.key")) + data = tools.read_file(self.TestFile("fit/rsa2048.key")) self._MakeInputFile("keys1/rsa2048.key", data) - data = tools.read_file(self.TestFile("340_rsa2048.key")) + data = tools.read_file(self.TestFile("fit/rsa2048.key")) self._MakeInputFile("keys2/conf-rsa2048.key", data) test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) @@ -8213,7 +8393,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap keys_subdir2 = os.path.join(self._indir, "keys2") with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '341_fit_signature.dts', + 'fit/signature_multi_key.dts', entry_args=entry_args, extra_indirs=[test_subdir, keys_subdir1, keys_subdir2])[0] self.assertIn( @@ -8231,7 +8411,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap } test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) self._DoReadFileDtb( - '342_fit_signature.dts', + 'fit/signature_no_nodes.dts', entry_args=entry_args, extra_indirs=[test_subdir])[0] @@ -8247,7 +8427,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap test_subdir = os.path.join(self._indir, TEST_FDT_SUBDIR) with self.assertRaises(ValueError) as e: self._DoReadFileDtb( - '347_key_name_hint_dir_fit_signature.dts', + 'fit/key_name_hint_dir_signature.dts', entry_args=entry_args, extra_indirs=[test_subdir]) self.assertIn( @@ -8256,12 +8436,12 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSimpleFitEncryptedData(self): """Test an image with a FIT containing data to be encrypted""" - data = tools.read_file(self.TestFile("aes256.bin")) + data = tools.read_file(self.TestFile("fit/aes256.bin")) self._MakeInputFile("keys/aes256.bin", data) keys_subdir = os.path.join(self._indir, "keys") data = self._DoReadFileDtb( - '343_fit_encrypt_data.dts', + 'fit/encrypt_data.dts', extra_indirs=[keys_subdir])[0] fit = fdt.Fdt.FromData(data) @@ -8276,7 +8456,7 @@ fdt fdtmap Extract the devicetree blob from the fdtmap # Retrieve the key name from the FIT removing any null byte key_name = fit.GetProps(subnode)['key-name-hint'].bytes.replace(b'\x00', b'') - with open(self.TestFile(key_name.decode('ascii') + '.bin'), 'rb') as file: + with open(self.TestFile('fit/' + key_name.decode('ascii') + '.bin'), 'rb') as file: key = file.read() iv = fit.GetProps(subnode)['iv'].bytes.hex() enc_data = fit.GetProps(node)['data'].bytes @@ -8295,25 +8475,28 @@ fdt fdtmap Extract the devicetree blob from the fdtmap def testSimpleFitEncryptedDataMissingKey(self): """Test an image with a FIT containing data to be encrypted but with a missing key""" with self.assertRaises(ValueError) as e: - self._DoReadFile('344_fit_encrypt_data_no_key.dts') + self._DoReadFile('fit/encrypt_data_no_key.dts') self.assertIn("Filename 'aes256.bin' not found in input path", str(e.exception)) def testFitFdtName(self): """Test an image with an FIT with multiple FDT images using NAME""" - self.CheckFitFdt('345_fit_fdt_name.dts', use_seq_num=False) + self.CheckFitFdt('fit/fdt_name.dts', use_seq_num=False) def testRemoveTemplate(self): """Test whether template is removed""" TestFunctional._MakeInputFile('my-blob.bin', b'blob') TestFunctional._MakeInputFile('my-blob2.bin', b'other') - self._DoTestFile('346_remove_template.dts', - force_missing_bintools='openssl',) + with terminal.capture() as (_, stderr): + self._DoTestFile('entry/remove_template.dts', + force_missing_bintools='openssl',) + err = stderr.getvalue() + self.assertRegex(err, "Image 'file2'.*missing bintools.*: openssl") def testBootphPropagation(self): """Test that bootph-* properties are propagated correctly to supernodes""" _, _, _, out_dtb_fname = self._DoReadFileDtb( - '347_bootph_prop.dts', use_real_dtb=True, update_dtb=True) + 'fdt/bootph_prop.dts', use_real_dtb=True, update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() root = dtb.GetRoot() diff --git a/tools/binman/main.py b/tools/binman/main.py index fa5ad79ca0e..a0c775fd629 100755 --- a/tools/binman/main.py +++ b/tools/binman/main.py @@ -95,15 +95,10 @@ def RunTestCoverage(toolpath, build_dir, args): for path in toolpath: extra_args += ' --toolpath %s' % path - # Some files unfortunately don't thave the required test coverage. This will - # eventually be fixed, but exclude them for now test_util.run_test_coverage('tools/binman/binman', None, ['*test*', '*main.py', 'tools/patman/*', 'tools/dtoc/*', 'tools/u_boot_pylib/*'], - build_dir, all_set, extra_args or None, args=args, - allow_failures=['tools/binman/btool/cst.py', - 'tools/binman/etype/nxp_imx8mcst.py', - 'tools/binman/etype/nxp_imx8mimage.py']) + build_dir, all_set, extra_args or None, args=args) def RunBinman(args): """Main entry point to binman once arguments are parsed diff --git a/tools/binman/test/214_no_alt_format.dts b/tools/binman/test/214_no_alt_format.dts deleted file mode 100644 index f00bcdd5764..00000000000 --- a/tools/binman/test/214_no_alt_format.dts +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -/dts-v1/; - -/ { - #address-cells = <1>; - #size-cells = <1>; - - binman { - u-boot { - }; - }; -}; diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index d5e4c0f556a..6b42db6559f 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -85,7 +85,7 @@ blob_syms: blob_syms.c elf_sections: CFLAGS += $(LDS_EFL_SECTIONS) elf_sections: elf_sections.c -dummy-rsa-engine.so: dummy-rsa-engine.c +dummy-rsa-engine.so: $(SRC)fit/dummy-rsa-engine.c $(CC) -fPIC -shared -lcrypto -lssl -o $@ $< clean: diff --git a/tools/binman/test/023_blob.dts b/tools/binman/test/blob/blob.dts index 7dcff69666a..7dcff69666a 100644 --- a/tools/binman/test/023_blob.dts +++ b/tools/binman/test/blob/blob.dts diff --git a/tools/binman/test/157_blob_ext.dts b/tools/binman/test/blob/ext.dts index 8afdd5339e5..8afdd5339e5 100644 --- a/tools/binman/test/157_blob_ext.dts +++ b/tools/binman/test/blob/ext.dts diff --git a/tools/binman/test/215_blob_ext_list.dts b/tools/binman/test/blob/ext_list.dts index aad2f0300d3..aad2f0300d3 100644 --- a/tools/binman/test/215_blob_ext_list.dts +++ b/tools/binman/test/blob/ext_list.dts diff --git a/tools/binman/test/218_blob_ext_list_fake.dts b/tools/binman/test/blob/ext_list_fake.dts index 54ee54fdaab..54ee54fdaab 100644 --- a/tools/binman/test/218_blob_ext_list_fake.dts +++ b/tools/binman/test/blob/ext_list_fake.dts diff --git a/tools/binman/test/216_blob_ext_list_missing.dts b/tools/binman/test/blob/ext_list_missing.dts index c02c335c760..c02c335c760 100644 --- a/tools/binman/test/216_blob_ext_list_missing.dts +++ b/tools/binman/test/blob/ext_list_missing.dts diff --git a/tools/binman/test/158_blob_ext_missing.dts b/tools/binman/test/blob/ext_missing.dts index d315e5592e1..d315e5592e1 100644 --- a/tools/binman/test/158_blob_ext_missing.dts +++ b/tools/binman/test/blob/ext_missing.dts diff --git a/tools/binman/test/159_blob_ext_missing_sect.dts b/tools/binman/test/blob/ext_missing_sect.dts index 5f14c541381..5f14c541381 100644 --- a/tools/binman/test/159_blob_ext_missing_sect.dts +++ b/tools/binman/test/blob/ext_missing_sect.dts diff --git a/tools/binman/test/266_blob_ext_opt.dts b/tools/binman/test/blob/ext_opt.dts index 717153152ce..717153152ce 100644 --- a/tools/binman/test/266_blob_ext_opt.dts +++ b/tools/binman/test/blob/ext_opt.dts diff --git a/tools/binman/test/217_fake_blob.dts b/tools/binman/test/blob/fake.dts index 22cf67f4f83..22cf67f4f83 100644 --- a/tools/binman/test/217_fake_blob.dts +++ b/tools/binman/test/blob/fake.dts diff --git a/tools/binman/test/173_missing_blob.dts b/tools/binman/test/blob/missing.dts index ffb655a1cb4..ffb655a1cb4 100644 --- a/tools/binman/test/173_missing_blob.dts +++ b/tools/binman/test/blob/missing.dts diff --git a/tools/binman/test/068_blob_named_by_arg.dts b/tools/binman/test/blob/named_by_arg.dts index e129f843cd5..e129f843cd5 100644 --- a/tools/binman/test/068_blob_named_by_arg.dts +++ b/tools/binman/test/blob/named_by_arg.dts diff --git a/tools/binman/test/273_blob_symbol.dts b/tools/binman/test/blob/symbol.dts index 87b0aba2120..87b0aba2120 100644 --- a/tools/binman/test/273_blob_symbol.dts +++ b/tools/binman/test/blob/symbol.dts diff --git a/tools/binman/test/319_capsule_accept.dts b/tools/binman/test/capsule/accept.dts index d48e59f859b..d48e59f859b 100644 --- a/tools/binman/test/319_capsule_accept.dts +++ b/tools/binman/test/capsule/accept.dts diff --git a/tools/binman/test/321_capsule_accept_missing_guid.dts b/tools/binman/test/capsule/accept_missing_guid.dts index a0088b174c5..a0088b174c5 100644 --- a/tools/binman/test/321_capsule_accept_missing_guid.dts +++ b/tools/binman/test/capsule/accept_missing_guid.dts diff --git a/tools/binman/test/323_capsule_accept_revert_missing.dts b/tools/binman/test/capsule/accept_revert_missing.dts index 31268b20b88..31268b20b88 100644 --- a/tools/binman/test/323_capsule_accept_revert_missing.dts +++ b/tools/binman/test/capsule/accept_revert_missing.dts diff --git a/tools/binman/test/311_capsule.dts b/tools/binman/test/capsule/capsule.dts index 0a62ef81dd2..0a62ef81dd2 100644 --- a/tools/binman/test/311_capsule.dts +++ b/tools/binman/test/capsule/capsule.dts diff --git a/tools/binman/test/322_empty_capsule_type_missing.dts b/tools/binman/test/capsule/empty_type_missing.dts index d356168e775..d356168e775 100644 --- a/tools/binman/test/322_empty_capsule_type_missing.dts +++ b/tools/binman/test/capsule/empty_type_missing.dts diff --git a/tools/binman/test/318_capsule_missing_guid.dts b/tools/binman/test/capsule/missing_guid.dts index 85d3317ecb5..85d3317ecb5 100644 --- a/tools/binman/test/318_capsule_missing_guid.dts +++ b/tools/binman/test/capsule/missing_guid.dts diff --git a/tools/binman/test/317_capsule_missing_index.dts b/tools/binman/test/capsule/missing_index.dts index 99a54d55c33..99a54d55c33 100644 --- a/tools/binman/test/317_capsule_missing_index.dts +++ b/tools/binman/test/capsule/missing_index.dts diff --git a/tools/binman/test/316_capsule_missing_key.dts b/tools/binman/test/capsule/missing_key.dts index a14a74ee779..a14a74ee779 100644 --- a/tools/binman/test/316_capsule_missing_key.dts +++ b/tools/binman/test/capsule/missing_key.dts diff --git a/tools/binman/test/315_capsule_oemflags.dts b/tools/binman/test/capsule/oemflags.dts index 45853f69c31..45853f69c31 100644 --- a/tools/binman/test/315_capsule_oemflags.dts +++ b/tools/binman/test/capsule/oemflags.dts diff --git a/tools/binman/test/320_capsule_revert.dts b/tools/binman/test/capsule/revert.dts index bd141ef2924..bd141ef2924 100644 --- a/tools/binman/test/320_capsule_revert.dts +++ b/tools/binman/test/capsule/revert.dts diff --git a/tools/binman/test/312_capsule_signed.dts b/tools/binman/test/capsule/signed.dts index 4ab838efedd..4ab838efedd 100644 --- a/tools/binman/test/312_capsule_signed.dts +++ b/tools/binman/test/capsule/signed.dts diff --git a/tools/binman/test/capsule/signed_pkcs11.dts b/tools/binman/test/capsule/signed_pkcs11.dts new file mode 100644 index 00000000000..bb87e18a15f --- /dev/null +++ b/tools/binman/test/capsule/signed_pkcs11.dts @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + binman { + efi-capsule { + image-index = <0x1>; + /* Image GUID for testing capsule update */ + image-guid = "binman-test"; + hardware-instance = <0x0>; + monotonic-count = <0x1>; + dump-signature; + private-key = "pkcs11:token=U-Boot%20token;object=test_key;type=private;pin-value=1111"; + public-key-cert = "pkcs11:token=U-Boot%20token;object=test_cert;type=cert;pin-value=1111"; + + blob { + filename = "capsule_input.bin"; + }; + }; + }; +}; diff --git a/tools/binman/test/314_capsule_signed_ver.dts b/tools/binman/test/capsule/signed_ver.dts index 649b8ccb2df..649b8ccb2df 100644 --- a/tools/binman/test/314_capsule_signed_ver.dts +++ b/tools/binman/test/capsule/signed_ver.dts diff --git a/tools/binman/test/313_capsule_version.dts b/tools/binman/test/capsule/version.dts index 19e7e833480..19e7e833480 100644 --- a/tools/binman/test/313_capsule_version.dts +++ b/tools/binman/test/capsule/version.dts diff --git a/tools/binman/test/106_cbfs_bad_arch.dts b/tools/binman/test/cbfs/bad_arch.dts index 4318d45a7d4..4318d45a7d4 100644 --- a/tools/binman/test/106_cbfs_bad_arch.dts +++ b/tools/binman/test/cbfs/bad_arch.dts diff --git a/tools/binman/test/109_cbfs_bad_compress.dts b/tools/binman/test/cbfs/bad_compress.dts index 9695024ee9b..9695024ee9b 100644 --- a/tools/binman/test/109_cbfs_bad_compress.dts +++ b/tools/binman/test/cbfs/bad_compress.dts diff --git a/tools/binman/test/126_cbfs_bad_type.dts b/tools/binman/test/cbfs/bad_type.dts index 2cd6fc6d52d..2cd6fc6d52d 100644 --- a/tools/binman/test/126_cbfs_bad_type.dts +++ b/tools/binman/test/cbfs/bad_type.dts diff --git a/tools/binman/test/110_cbfs_name.dts b/tools/binman/test/cbfs/name.dts index 98c16f30b41..98c16f30b41 100644 --- a/tools/binman/test/110_cbfs_name.dts +++ b/tools/binman/test/cbfs/name.dts diff --git a/tools/binman/test/108_cbfs_no_contents.dts b/tools/binman/test/cbfs/no_contents.dts index 623346760d2..623346760d2 100644 --- a/tools/binman/test/108_cbfs_no_contents.dts +++ b/tools/binman/test/cbfs/no_contents.dts diff --git a/tools/binman/test/107_cbfs_no_size.dts b/tools/binman/test/cbfs/no_size.dts index 3592f62f7e6..3592f62f7e6 100644 --- a/tools/binman/test/107_cbfs_no_size.dts +++ b/tools/binman/test/cbfs/no_size.dts diff --git a/tools/binman/test/114_cbfs_offset.dts b/tools/binman/test/cbfs/offset.dts index 7aa9d9d4bf3..7aa9d9d4bf3 100644 --- a/tools/binman/test/114_cbfs_offset.dts +++ b/tools/binman/test/cbfs/offset.dts diff --git a/tools/binman/test/102_cbfs_raw.dts b/tools/binman/test/cbfs/raw.dts index 779cbc121ad..779cbc121ad 100644 --- a/tools/binman/test/102_cbfs_raw.dts +++ b/tools/binman/test/cbfs/raw.dts diff --git a/tools/binman/test/105_cbfs_raw_compress.dts b/tools/binman/test/cbfs/raw_compress.dts index 646168d84b4..646168d84b4 100644 --- a/tools/binman/test/105_cbfs_raw_compress.dts +++ b/tools/binman/test/cbfs/raw_compress.dts diff --git a/tools/binman/test/103_cbfs_raw_ppc.dts b/tools/binman/test/cbfs/raw_ppc.dts index df1caf092f4..df1caf092f4 100644 --- a/tools/binman/test/103_cbfs_raw_ppc.dts +++ b/tools/binman/test/cbfs/raw_ppc.dts diff --git a/tools/binman/test/142_replace_cbfs.dts b/tools/binman/test/cbfs/replace.dts index d64142f9d5c..d64142f9d5c 100644 --- a/tools/binman/test/142_replace_cbfs.dts +++ b/tools/binman/test/cbfs/replace.dts diff --git a/tools/binman/test/104_cbfs_stage.dts b/tools/binman/test/cbfs/stage.dts index 215e2f287a4..215e2f287a4 100644 --- a/tools/binman/test/104_cbfs_stage.dts +++ b/tools/binman/test/cbfs/stage.dts diff --git a/tools/binman/test/125_cbfs_update.dts b/tools/binman/test/cbfs/update.dts index 6d2e8a0b8ff..6d2e8a0b8ff 100644 --- a/tools/binman/test/125_cbfs_update.dts +++ b/tools/binman/test/cbfs/update.dts diff --git a/tools/binman/test/067_fmap.dts b/tools/binman/test/cros/fmap.dts index 24fa6351ec3..24fa6351ec3 100644 --- a/tools/binman/test/067_fmap.dts +++ b/tools/binman/test/cros/fmap.dts diff --git a/tools/binman/test/071_gbb.dts b/tools/binman/test/cros/gbb.dts index 551756372af..551756372af 100644 --- a/tools/binman/test/071_gbb.dts +++ b/tools/binman/test/cros/gbb.dts diff --git a/tools/binman/test/073_gbb_no_size.dts b/tools/binman/test/cros/gbb_no_size.dts index 83be4037852..83be4037852 100644 --- a/tools/binman/test/073_gbb_no_size.dts +++ b/tools/binman/test/cros/gbb_no_size.dts diff --git a/tools/binman/test/072_gbb_too_small.dts b/tools/binman/test/cros/gbb_too_small.dts index c088f36a1d0..c088f36a1d0 100644 --- a/tools/binman/test/072_gbb_too_small.dts +++ b/tools/binman/test/cros/gbb_too_small.dts diff --git a/tools/binman/test/074_vblock.dts b/tools/binman/test/cros/vblock.dts index f0c21bfe9fc..f0c21bfe9fc 100644 --- a/tools/binman/test/074_vblock.dts +++ b/tools/binman/test/cros/vblock.dts diff --git a/tools/binman/test/077_vblock_bad_entry.dts b/tools/binman/test/cros/vblock_bad_entry.dts index 764c42a56e1..764c42a56e1 100644 --- a/tools/binman/test/077_vblock_bad_entry.dts +++ b/tools/binman/test/cros/vblock_bad_entry.dts diff --git a/tools/binman/test/076_vblock_bad_phandle.dts b/tools/binman/test/cros/vblock_bad_phandle.dts index ffbd0c335c3..ffbd0c335c3 100644 --- a/tools/binman/test/076_vblock_bad_phandle.dts +++ b/tools/binman/test/cros/vblock_bad_phandle.dts diff --git a/tools/binman/test/189_vblock_content.dts b/tools/binman/test/cros/vblock_content.dts index dcc74449c17..dcc74449c17 100644 --- a/tools/binman/test/189_vblock_content.dts +++ b/tools/binman/test/cros/vblock_content.dts diff --git a/tools/binman/test/075_vblock_no_content.dts b/tools/binman/test/cros/vblock_no_content.dts index 676d9474b31..676d9474b31 100644 --- a/tools/binman/test/075_vblock_no_content.dts +++ b/tools/binman/test/cros/vblock_no_content.dts diff --git a/tools/binman/test/262_absent.dts b/tools/binman/test/entry/absent.dts index 2ab8766c878..2ab8766c878 100644 --- a/tools/binman/test/262_absent.dts +++ b/tools/binman/test/entry/absent.dts diff --git a/tools/binman/test/198_collection.dts b/tools/binman/test/entry/collection.dts index 484a1b0050d..484a1b0050d 100644 --- a/tools/binman/test/198_collection.dts +++ b/tools/binman/test/entry/collection.dts diff --git a/tools/binman/test/246_collection_other.dts b/tools/binman/test/entry/collection_other.dts index 09de20e5bca..09de20e5bca 100644 --- a/tools/binman/test/246_collection_other.dts +++ b/tools/binman/test/entry/collection_other.dts diff --git a/tools/binman/test/199_collection_section.dts b/tools/binman/test/entry/collection_section.dts index 03a73194c3f..03a73194c3f 100644 --- a/tools/binman/test/199_collection_section.dts +++ b/tools/binman/test/entry/collection_section.dts diff --git a/tools/binman/test/083_compress.dts b/tools/binman/test/entry/compress.dts index 07813bdeaa3..07813bdeaa3 100644 --- a/tools/binman/test/083_compress.dts +++ b/tools/binman/test/entry/compress.dts diff --git a/tools/binman/test/186_compress_extra.dts b/tools/binman/test/entry/compress_extra.dts index 59aae822638..59aae822638 100644 --- a/tools/binman/test/186_compress_extra.dts +++ b/tools/binman/test/entry/compress_extra.dts diff --git a/tools/binman/test/182_compress_image.dts b/tools/binman/test/entry/compress_image.dts index 4176b7f2e62..4176b7f2e62 100644 --- a/tools/binman/test/182_compress_image.dts +++ b/tools/binman/test/entry/compress_image.dts diff --git a/tools/binman/test/183_compress_image_less.dts b/tools/binman/test/entry/compress_image_less.dts index 1d9d57b78c9..1d9d57b78c9 100644 --- a/tools/binman/test/183_compress_image_less.dts +++ b/tools/binman/test/entry/compress_image_less.dts diff --git a/tools/binman/test/185_compress_section.dts b/tools/binman/test/entry/compress_section.dts index dc3e340c5d6..dc3e340c5d6 100644 --- a/tools/binman/test/185_compress_section.dts +++ b/tools/binman/test/entry/compress_section.dts diff --git a/tools/binman/test/184_compress_section_size.dts b/tools/binman/test/entry/compress_section_size.dts index 1c1dbd5f580..1c1dbd5f580 100644 --- a/tools/binman/test/184_compress_section_size.dts +++ b/tools/binman/test/entry/compress_section_size.dts diff --git a/tools/binman/test/096_elf.dts b/tools/binman/test/entry/elf.dts index 8e3f3f15ef0..8e3f3f15ef0 100644 --- a/tools/binman/test/096_elf.dts +++ b/tools/binman/test/entry/elf.dts diff --git a/tools/binman/test/097_elf_strip.dts b/tools/binman/test/entry/elf_strip.dts index 6f3c66fd705..6f3c66fd705 100644 --- a/tools/binman/test/097_elf_strip.dts +++ b/tools/binman/test/entry/elf_strip.dts diff --git a/tools/binman/test/062_entry_args.dts b/tools/binman/test/entry/entry_args.dts index 4d4f102d60c..4d4f102d60c 100644 --- a/tools/binman/test/062_entry_args.dts +++ b/tools/binman/test/entry/entry_args.dts diff --git a/tools/binman/test/063_entry_args_missing.dts b/tools/binman/test/entry/entry_args_missing.dts index 1644e2fef3a..1644e2fef3a 100644 --- a/tools/binman/test/063_entry_args_missing.dts +++ b/tools/binman/test/entry/entry_args_missing.dts diff --git a/tools/binman/test/064_entry_args_required.dts b/tools/binman/test/entry/entry_args_required.dts index 705be100691..705be100691 100644 --- a/tools/binman/test/064_entry_args_required.dts +++ b/tools/binman/test/entry/entry_args_required.dts diff --git a/tools/binman/test/065_entry_args_unknown_datatype.dts b/tools/binman/test/entry/entry_args_unknown_datatype.dts index 3e4838f4fff..3e4838f4fff 100644 --- a/tools/binman/test/065_entry_args_unknown_datatype.dts +++ b/tools/binman/test/entry/entry_args_unknown_datatype.dts diff --git a/tools/binman/test/174_env.dts b/tools/binman/test/entry/env.dts index d1393d2db93..d1393d2db93 100644 --- a/tools/binman/test/174_env.dts +++ b/tools/binman/test/entry/env.dts diff --git a/tools/binman/test/175_env_no_size.dts b/tools/binman/test/entry/env_no_size.dts index 267acd15491..267acd15491 100644 --- a/tools/binman/test/175_env_no_size.dts +++ b/tools/binman/test/entry/env_no_size.dts diff --git a/tools/binman/test/176_env_too_small.dts b/tools/binman/test/entry/env_too_small.dts index 2db8d054639..2db8d054639 100644 --- a/tools/binman/test/176_env_too_small.dts +++ b/tools/binman/test/entry/env_too_small.dts diff --git a/tools/binman/test/084_files.dts b/tools/binman/test/entry/files.dts index 8f09afd24ea..8f09afd24ea 100644 --- a/tools/binman/test/084_files.dts +++ b/tools/binman/test/entry/files.dts diff --git a/tools/binman/test/190_files_align.dts b/tools/binman/test/entry/files_align.dts index 213ba966d35..213ba966d35 100644 --- a/tools/binman/test/190_files_align.dts +++ b/tools/binman/test/entry/files_align.dts diff --git a/tools/binman/test/085_files_compress.dts b/tools/binman/test/entry/files_compress.dts index 5aeead2e6e9..5aeead2e6e9 100644 --- a/tools/binman/test/085_files_compress.dts +++ b/tools/binman/test/entry/files_compress.dts diff --git a/tools/binman/test/087_files_no_pattern.dts b/tools/binman/test/entry/files_no_pattern.dts index 0cb5b469cb0..0cb5b469cb0 100644 --- a/tools/binman/test/087_files_no_pattern.dts +++ b/tools/binman/test/entry/files_no_pattern.dts diff --git a/tools/binman/test/086_files_none.dts b/tools/binman/test/entry/files_none.dts index 34bd92f224a..34bd92f224a 100644 --- a/tools/binman/test/086_files_none.dts +++ b/tools/binman/test/entry/files_none.dts diff --git a/tools/binman/test/069_fill.dts b/tools/binman/test/entry/fill.dts index e372ea37aaa..e372ea37aaa 100644 --- a/tools/binman/test/069_fill.dts +++ b/tools/binman/test/entry/fill.dts diff --git a/tools/binman/test/080_fill_empty.dts b/tools/binman/test/entry/fill_empty.dts index 2b78d3ae88d..2b78d3ae88d 100644 --- a/tools/binman/test/080_fill_empty.dts +++ b/tools/binman/test/entry/fill_empty.dts diff --git a/tools/binman/test/070_fill_no_size.dts b/tools/binman/test/entry/fill_no_size.dts index 7b1fcf1b68b..7b1fcf1b68b 100644 --- a/tools/binman/test/070_fill_no_size.dts +++ b/tools/binman/test/entry/fill_no_size.dts diff --git a/tools/binman/test/188_image_entryarg.dts b/tools/binman/test/entry/image_entryarg.dts index 29d81491623..29d81491623 100644 --- a/tools/binman/test/188_image_entryarg.dts +++ b/tools/binman/test/entry/image_entryarg.dts diff --git a/tools/binman/test/127_list.dts b/tools/binman/test/entry/list.dts index c1d6fce3f9e..c1d6fce3f9e 100644 --- a/tools/binman/test/127_list.dts +++ b/tools/binman/test/entry/list.dts diff --git a/tools/binman/test/056_name_prefix.dts b/tools/binman/test/entry/name_prefix.dts index f38c80eb183..f38c80eb183 100644 --- a/tools/binman/test/056_name_prefix.dts +++ b/tools/binman/test/entry/name_prefix.dts diff --git a/tools/binman/test/268_null.dts b/tools/binman/test/entry/null.dts index 3824ba85090..3824ba85090 100644 --- a/tools/binman/test/268_null.dts +++ b/tools/binman/test/entry/null.dts diff --git a/tools/binman/test/274_offset_from_elf.dts b/tools/binman/test/entry/offset_from_elf.dts index e3372fc7c3d..e3372fc7c3d 100644 --- a/tools/binman/test/274_offset_from_elf.dts +++ b/tools/binman/test/entry/offset_from_elf.dts diff --git a/tools/binman/test/269_overlap.dts b/tools/binman/test/entry/overlap.dts index f949b8b359f..f949b8b359f 100644 --- a/tools/binman/test/269_overlap.dts +++ b/tools/binman/test/entry/overlap.dts diff --git a/tools/binman/test/271_overlap_bad.dts b/tools/binman/test/entry/overlap_bad.dts index f2818021144..f2818021144 100644 --- a/tools/binman/test/271_overlap_bad.dts +++ b/tools/binman/test/entry/overlap_bad.dts diff --git a/tools/binman/test/272_overlap_no_size.dts b/tools/binman/test/entry/overlap_no_size.dts index 4517536f2e6..4517536f2e6 100644 --- a/tools/binman/test/272_overlap_no_size.dts +++ b/tools/binman/test/entry/overlap_no_size.dts diff --git a/tools/binman/test/270_overlap_null.dts b/tools/binman/test/entry/overlap_null.dts index feed9ec8920..feed9ec8920 100644 --- a/tools/binman/test/270_overlap_null.dts +++ b/tools/binman/test/entry/overlap_null.dts diff --git a/tools/binman/test/045_prop_test.dts b/tools/binman/test/entry/prop_test.dts index 064de2b3167..064de2b3167 100644 --- a/tools/binman/test/045_prop_test.dts +++ b/tools/binman/test/entry/prop_test.dts diff --git a/tools/binman/test/191_read_image_skip.dts b/tools/binman/test/entry/read_image_skip.dts index 31df518fae6..31df518fae6 100644 --- a/tools/binman/test/191_read_image_skip.dts +++ b/tools/binman/test/entry/read_image_skip.dts diff --git a/tools/binman/test/346_remove_template.dts b/tools/binman/test/entry/remove_template.dts index e05229f3ebc..e05229f3ebc 100644 --- a/tools/binman/test/346_remove_template.dts +++ b/tools/binman/test/entry/remove_template.dts diff --git a/tools/binman/test/132_replace.dts b/tools/binman/test/entry/replace.dts index 6ebdcda45c5..6ebdcda45c5 100644 --- a/tools/binman/test/132_replace.dts +++ b/tools/binman/test/entry/replace.dts diff --git a/tools/binman/test/143_replace_all.dts b/tools/binman/test/entry/replace_all.dts index c5744a3c1c8..c5744a3c1c8 100644 --- a/tools/binman/test/143_replace_all.dts +++ b/tools/binman/test/entry/replace_all.dts diff --git a/tools/binman/test/133_replace_multi.dts b/tools/binman/test/entry/replace_multi.dts index 38b2f39d020..38b2f39d020 100644 --- a/tools/binman/test/133_replace_multi.dts +++ b/tools/binman/test/entry/replace_multi.dts diff --git a/tools/binman/test/139_replace_repack.dts b/tools/binman/test/entry/replace_repack.dts index a3daf6f9b46..a3daf6f9b46 100644 --- a/tools/binman/test/139_replace_repack.dts +++ b/tools/binman/test/entry/replace_repack.dts diff --git a/tools/binman/test/278_replace_section_deep.dts b/tools/binman/test/entry/replace_section_deep.dts index fba2d7dcf28..fba2d7dcf28 100644 --- a/tools/binman/test/278_replace_section_deep.dts +++ b/tools/binman/test/entry/replace_section_deep.dts diff --git a/tools/binman/test/241_replace_section_simple.dts b/tools/binman/test/entry/replace_section_simple.dts index c9d5c328561..c9d5c328561 100644 --- a/tools/binman/test/241_replace_section_simple.dts +++ b/tools/binman/test/entry/replace_section_simple.dts diff --git a/tools/binman/test/239_replace_with_bintool.dts b/tools/binman/test/entry/replace_with_bintool.dts index d7fabd2cd83..d7fabd2cd83 100644 --- a/tools/binman/test/239_replace_with_bintool.dts +++ b/tools/binman/test/entry/replace_with_bintool.dts diff --git a/tools/binman/test/261_section_fname.dts b/tools/binman/test/entry/section_fname.dts index 790381e7301..790381e7301 100644 --- a/tools/binman/test/261_section_fname.dts +++ b/tools/binman/test/entry/section_fname.dts diff --git a/tools/binman/test/202_section_timeout.dts b/tools/binman/test/entry/section_timeout.dts index 1481450367a..1481450367a 100644 --- a/tools/binman/test/202_section_timeout.dts +++ b/tools/binman/test/entry/section_timeout.dts diff --git a/tools/binman/test/055_sections.dts b/tools/binman/test/entry/sections.dts index 6b306aeda46..6b306aeda46 100644 --- a/tools/binman/test/055_sections.dts +++ b/tools/binman/test/entry/sections.dts diff --git a/tools/binman/test/259_symlink.dts b/tools/binman/test/entry/symlink.dts index 2ee1f7f05e2..2ee1f7f05e2 100644 --- a/tools/binman/test/259_symlink.dts +++ b/tools/binman/test/entry/symlink.dts diff --git a/tools/binman/test/222_tee_os.dts b/tools/binman/test/entry/tee_os.dts index 68854972942..68854972942 100644 --- a/tools/binman/test/222_tee_os.dts +++ b/tools/binman/test/entry/tee_os.dts diff --git a/tools/binman/test/263_tee_os_opt.dts b/tools/binman/test/entry/tee_os_opt.dts index 2e4ec24ac2c..2e4ec24ac2c 100644 --- a/tools/binman/test/263_tee_os_opt.dts +++ b/tools/binman/test/entry/tee_os_opt.dts diff --git a/tools/binman/test/286_template.dts b/tools/binman/test/entry/template.dts index 6980dbfafcc..6980dbfafcc 100644 --- a/tools/binman/test/286_template.dts +++ b/tools/binman/test/entry/template.dts diff --git a/tools/binman/test/287_template_multi.dts b/tools/binman/test/entry/template_multi.dts index 122bfccd565..122bfccd565 100644 --- a/tools/binman/test/287_template_multi.dts +++ b/tools/binman/test/entry/template_multi.dts diff --git a/tools/binman/test/309_template_phandle.dts b/tools/binman/test/entry/template_phandle.dts index c4ec1dd41be..c4ec1dd41be 100644 --- a/tools/binman/test/309_template_phandle.dts +++ b/tools/binman/test/entry/template_phandle.dts diff --git a/tools/binman/test/310_template_phandle_dup.dts b/tools/binman/test/entry/template_phandle_dup.dts index dc86f06463b..dc86f06463b 100644 --- a/tools/binman/test/310_template_phandle_dup.dts +++ b/tools/binman/test/entry/template_phandle_dup.dts diff --git a/tools/binman/test/289_template_section.dts b/tools/binman/test/entry/template_section.dts index 8a744a0cf68..8a744a0cf68 100644 --- a/tools/binman/test/289_template_section.dts +++ b/tools/binman/test/entry/template_section.dts diff --git a/tools/binman/test/066_text.dts b/tools/binman/test/entry/text.dts index f23a75ae929..f23a75ae929 100644 --- a/tools/binman/test/066_text.dts +++ b/tools/binman/test/entry/text.dts diff --git a/tools/binman/test/237_unique_names.dts b/tools/binman/test/entry/unique_names.dts index 6780d37f71f..6780d37f71f 100644 --- a/tools/binman/test/237_unique_names.dts +++ b/tools/binman/test/entry/unique_names.dts diff --git a/tools/binman/test/238_unique_names_multi.dts b/tools/binman/test/entry/unique_names_multi.dts index db63afb445e..db63afb445e 100644 --- a/tools/binman/test/238_unique_names_multi.dts +++ b/tools/binman/test/entry/unique_names_multi.dts diff --git a/tools/binman/test/057_unknown_contents.dts b/tools/binman/test/entry/unknown_contents.dts index 6ea98d7cab6..6ea98d7cab6 100644 --- a/tools/binman/test/057_unknown_contents.dts +++ b/tools/binman/test/entry/unknown_contents.dts diff --git a/tools/binman/test/041_unknown_pos_size.dts b/tools/binman/test/entry/unknown_pos_size.dts index 94fe821c470..94fe821c470 100644 --- a/tools/binman/test/041_unknown_pos_size.dts +++ b/tools/binman/test/entry/unknown_pos_size.dts diff --git a/tools/binman/test/328_alternates_fdt.dts b/tools/binman/test/fdt/alternates_fdt.dts index c913c8e4745..c913c8e4745 100644 --- a/tools/binman/test/328_alternates_fdt.dts +++ b/tools/binman/test/fdt/alternates_fdt.dts diff --git a/tools/binman/test/329_alternates_fdtgrep.dts b/tools/binman/test/fdt/alternates_fdtgrep.dts index 41695281456..41695281456 100644 --- a/tools/binman/test/329_alternates_fdtgrep.dts +++ b/tools/binman/test/fdt/alternates_fdtgrep.dts diff --git a/tools/binman/test/332_alternates_inval.dts b/tools/binman/test/fdt/alternates_inval.dts index 8c145dd2449..8c145dd2449 100644 --- a/tools/binman/test/332_alternates_inval.dts +++ b/tools/binman/test/fdt/alternates_inval.dts diff --git a/tools/binman/test/331_alternates_spl.dts b/tools/binman/test/fdt/alternates_spl.dts index 882fefce34a..882fefce34a 100644 --- a/tools/binman/test/331_alternates_spl.dts +++ b/tools/binman/test/fdt/alternates_spl.dts diff --git a/tools/binman/test/330_alternates_vpl.dts b/tools/binman/test/fdt/alternates_vpl.dts index 5b57069e2ab..5b57069e2ab 100644 --- a/tools/binman/test/330_alternates_vpl.dts +++ b/tools/binman/test/fdt/alternates_vpl.dts diff --git a/tools/binman/test/347_bootph_prop.dts b/tools/binman/test/fdt/bootph_prop.dts index 91d4e4ad600..91d4e4ad600 100644 --- a/tools/binman/test/347_bootph_prop.dts +++ b/tools/binman/test/fdt/bootph_prop.dts diff --git a/tools/binman/test/124_compress_dtb.dts b/tools/binman/test/fdt/compress_dtb.dts index 46bfd8b265f..46bfd8b265f 100644 --- a/tools/binman/test/124_compress_dtb.dts +++ b/tools/binman/test/fdt/compress_dtb.dts diff --git a/tools/binman/test/250_compress_dtb_invalid.dts b/tools/binman/test/fdt/compress_dtb_invalid.dts index 228139060bc..228139060bc 100644 --- a/tools/binman/test/250_compress_dtb_invalid.dts +++ b/tools/binman/test/fdt/compress_dtb_invalid.dts diff --git a/tools/binman/test/248_compress_dtb_prepend_invalid.dts b/tools/binman/test/fdt/compress_dtb_prepend_invalid.dts index ee32670a913..ee32670a913 100644 --- a/tools/binman/test/248_compress_dtb_prepend_invalid.dts +++ b/tools/binman/test/fdt/compress_dtb_prepend_invalid.dts diff --git a/tools/binman/test/249_compress_dtb_prepend_length.dts b/tools/binman/test/fdt/compress_dtb_prepend_length.dts index 1570233637a..1570233637a 100644 --- a/tools/binman/test/249_compress_dtb_prepend_length.dts +++ b/tools/binman/test/fdt/compress_dtb_prepend_length.dts diff --git a/tools/binman/test/251_compress_dtb_zstd.dts b/tools/binman/test/fdt/compress_dtb_zstd.dts index 90cf85d1e2c..90cf85d1e2c 100644 --- a/tools/binman/test/251_compress_dtb_zstd.dts +++ b/tools/binman/test/fdt/compress_dtb_zstd.dts diff --git a/tools/binman/test/128_decode_image.dts b/tools/binman/test/fdt/decode_image.dts index 449fccc41df..449fccc41df 100644 --- a/tools/binman/test/128_decode_image.dts +++ b/tools/binman/test/fdt/decode_image.dts diff --git a/tools/binman/test/129_decode_image_nohdr.dts b/tools/binman/test/fdt/decode_image_nohdr.dts index 90fdd8820ca..90fdd8820ca 100644 --- a/tools/binman/test/129_decode_image_nohdr.dts +++ b/tools/binman/test/fdt/decode_image_nohdr.dts diff --git a/tools/binman/test/115_fdtmap.dts b/tools/binman/test/fdt/fdtmap.dts index 2450c41f200..2450c41f200 100644 --- a/tools/binman/test/115_fdtmap.dts +++ b/tools/binman/test/fdt/fdtmap.dts diff --git a/tools/binman/test/213_fdtmap_alt_format.dts b/tools/binman/test/fdt/fdtmap_alt_format.dts index d9aef04bcf6..d9aef04bcf6 100644 --- a/tools/binman/test/213_fdtmap_alt_format.dts +++ b/tools/binman/test/fdt/fdtmap_alt_format.dts diff --git a/tools/binman/test/116_fdtmap_hdr.dts b/tools/binman/test/fdt/fdtmap_hdr.dts index 77a2194b394..77a2194b394 100644 --- a/tools/binman/test/116_fdtmap_hdr.dts +++ b/tools/binman/test/fdt/fdtmap_hdr.dts diff --git a/tools/binman/test/137_fdtmap_hdr_endbad.dts b/tools/binman/test/fdt/fdtmap_hdr_endbad.dts index ebacd71eb23..ebacd71eb23 100644 --- a/tools/binman/test/137_fdtmap_hdr_endbad.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_endbad.dts diff --git a/tools/binman/test/135_fdtmap_hdr_middle.dts b/tools/binman/test/fdt/fdtmap_hdr_middle.dts index d6211da8ae3..d6211da8ae3 100644 --- a/tools/binman/test/135_fdtmap_hdr_middle.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_middle.dts diff --git a/tools/binman/test/119_fdtmap_hdr_missing.dts b/tools/binman/test/fdt/fdtmap_hdr_missing.dts index 41bb680f08f..41bb680f08f 100644 --- a/tools/binman/test/119_fdtmap_hdr_missing.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_missing.dts diff --git a/tools/binman/test/138_fdtmap_hdr_nosize.dts b/tools/binman/test/fdt/fdtmap_hdr_nosize.dts index c362f8fdffb..c362f8fdffb 100644 --- a/tools/binman/test/138_fdtmap_hdr_nosize.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_nosize.dts diff --git a/tools/binman/test/118_fdtmap_hdr_pos.dts b/tools/binman/test/fdt/fdtmap_hdr_pos.dts index fd803f57fba..fd803f57fba 100644 --- a/tools/binman/test/118_fdtmap_hdr_pos.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_pos.dts diff --git a/tools/binman/test/117_fdtmap_hdr_start.dts b/tools/binman/test/fdt/fdtmap_hdr_start.dts index 17b6be00470..17b6be00470 100644 --- a/tools/binman/test/117_fdtmap_hdr_start.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_start.dts diff --git a/tools/binman/test/136_fdtmap_hdr_startbad.dts b/tools/binman/test/fdt/fdtmap_hdr_startbad.dts index ec5f4bc7e3a..ec5f4bc7e3a 100644 --- a/tools/binman/test/136_fdtmap_hdr_startbad.dts +++ b/tools/binman/test/fdt/fdtmap_hdr_startbad.dts diff --git a/tools/binman/test/120_hdr_no_location.dts b/tools/binman/test/fdt/hdr_no_location.dts index 585e21f456b..585e21f456b 100644 --- a/tools/binman/test/120_hdr_no_location.dts +++ b/tools/binman/test/fdt/hdr_no_location.dts diff --git a/tools/binman/test/194_fdt_incl.dts b/tools/binman/test/fdt/incl.dts index b14c8ff8f52..b14c8ff8f52 100644 --- a/tools/binman/test/194_fdt_incl.dts +++ b/tools/binman/test/fdt/incl.dts diff --git a/tools/binman/test/195_fdt_incl_tpl.dts b/tools/binman/test/fdt/incl_tpl.dts index 3756ac4fc47..3756ac4fc47 100644 --- a/tools/binman/test/195_fdt_incl_tpl.dts +++ b/tools/binman/test/fdt/incl_tpl.dts diff --git a/tools/binman/test/257_fdt_incl_vpl.dts b/tools/binman/test/fdt/incl_vpl.dts index 435256fe317..435256fe317 100644 --- a/tools/binman/test/257_fdt_incl_vpl.dts +++ b/tools/binman/test/fdt/incl_vpl.dts diff --git a/tools/binman/test/130_list_fdtmap.dts b/tools/binman/test/fdt/list_fdtmap.dts index 449fccc41df..449fccc41df 100644 --- a/tools/binman/test/130_list_fdtmap.dts +++ b/tools/binman/test/fdt/list_fdtmap.dts diff --git a/tools/binman/test/060_fdt_update.dts b/tools/binman/test/fdt/update.dts index f53c8a5053e..f53c8a5053e 100644 --- a/tools/binman/test/060_fdt_update.dts +++ b/tools/binman/test/fdt/update.dts diff --git a/tools/binman/test/082_fdt_update_all.dts b/tools/binman/test/fdt/update_all.dts index 1aea56989f0..1aea56989f0 100644 --- a/tools/binman/test/082_fdt_update_all.dts +++ b/tools/binman/test/fdt/update_all.dts diff --git a/tools/binman/test/134_fdt_update_all_repack.dts b/tools/binman/test/fdt/update_all_repack.dts index 625d37673bd..625d37673bd 100644 --- a/tools/binman/test/134_fdt_update_all_repack.dts +++ b/tools/binman/test/fdt/update_all_repack.dts diff --git a/tools/binman/test/061_fdt_update_bad.dts b/tools/binman/test/fdt/update_bad.dts index e5abf31699c..e5abf31699c 100644 --- a/tools/binman/test/061_fdt_update_bad.dts +++ b/tools/binman/test/fdt/update_bad.dts diff --git a/tools/binman/test/169_atf_bl31.dts b/tools/binman/test/fip/atf_bl31.dts index 2b7547d70f9..2b7547d70f9 100644 --- a/tools/binman/test/169_atf_bl31.dts +++ b/tools/binman/test/fip/atf_bl31.dts diff --git a/tools/binman/test/211_fip_bad_align.dts b/tools/binman/test/fip/bad_align.dts index a0901496d80..a0901496d80 100644 --- a/tools/binman/test/211_fip_bad_align.dts +++ b/tools/binman/test/fip/bad_align.dts diff --git a/tools/binman/test/347_bl1.dts b/tools/binman/test/fip/bl1.dts index 1a109956204..1a109956204 100644 --- a/tools/binman/test/347_bl1.dts +++ b/tools/binman/test/fip/bl1.dts diff --git a/tools/binman/test/212_fip_collection.dts b/tools/binman/test/fip/collection.dts index 332c023af87..332c023af87 100644 --- a/tools/binman/test/212_fip_collection.dts +++ b/tools/binman/test/fip/collection.dts diff --git a/tools/binman/test/203_fip.dts b/tools/binman/test/fip/fip.dts index 08973373240..08973373240 100644 --- a/tools/binman/test/203_fip.dts +++ b/tools/binman/test/fip/fip.dts diff --git a/tools/binman/test/207_fip_ls.dts b/tools/binman/test/fip/ls.dts index 630fca15024..630fca15024 100644 --- a/tools/binman/test/207_fip_ls.dts +++ b/tools/binman/test/fip/ls.dts diff --git a/tools/binman/test/209_fip_missing.dts b/tools/binman/test/fip/missing.dts index 43bb600d047..43bb600d047 100644 --- a/tools/binman/test/209_fip_missing.dts +++ b/tools/binman/test/fip/missing.dts diff --git a/tools/binman/test/205_fip_no_type.dts b/tools/binman/test/fip/no_type.dts index 23c8c3bc37e..23c8c3bc37e 100644 --- a/tools/binman/test/205_fip_no_type.dts +++ b/tools/binman/test/fip/no_type.dts diff --git a/tools/binman/test/201_opensbi.dts b/tools/binman/test/fip/opensbi.dts index 942183f9900..942183f9900 100644 --- a/tools/binman/test/201_opensbi.dts +++ b/tools/binman/test/fip/opensbi.dts diff --git a/tools/binman/test/204_fip_other.dts b/tools/binman/test/fip/other.dts index 65039410986..65039410986 100644 --- a/tools/binman/test/204_fip_other.dts +++ b/tools/binman/test/fip/other.dts diff --git a/tools/binman/test/208_fip_replace.dts b/tools/binman/test/fip/replace.dts index 432c12474df..432c12474df 100644 --- a/tools/binman/test/208_fip_replace.dts +++ b/tools/binman/test/fip/replace.dts diff --git a/tools/binman/test/172_scp.dts b/tools/binman/test/fip/scp.dts index 354e4ef17df..354e4ef17df 100644 --- a/tools/binman/test/172_scp.dts +++ b/tools/binman/test/fip/scp.dts diff --git a/tools/binman/test/210_fip_size.dts b/tools/binman/test/fip/size.dts index 9dfee796459..9dfee796459 100644 --- a/tools/binman/test/210_fip_size.dts +++ b/tools/binman/test/fip/size.dts diff --git a/tools/binman/test/206_fip_uuid.dts b/tools/binman/test/fip/uuid.dts index c9bd44f9c31..c9bd44f9c31 100644 --- a/tools/binman/test/206_fip_uuid.dts +++ b/tools/binman/test/fip/uuid.dts diff --git a/tools/binman/test/aes256.bin b/tools/binman/test/fit/aes256.bin index 09b8bf6254a..09b8bf6254a 100644 --- a/tools/binman/test/aes256.bin +++ b/tools/binman/test/fit/aes256.bin diff --git a/tools/binman/test/275_fit_align.dts b/tools/binman/test/fit/align.dts index c7b06e390fa..c7b06e390fa 100644 --- a/tools/binman/test/275_fit_align.dts +++ b/tools/binman/test/fit/align.dts diff --git a/tools/binman/test/227_fit_bad_dir.dts b/tools/binman/test/fit/bad_dir.dts index 51f4816c4c2..c6d5c7b0a87 100644 --- a/tools/binman/test/227_fit_bad_dir.dts +++ b/tools/binman/test/fit/bad_dir.dts @@ -2,7 +2,7 @@ /dts-v1/; -#include "226_fit_split_elf.dts" +#include "split_elf.dts" &atf { fit,something = "bad"; diff --git a/tools/binman/test/228_fit_bad_dir_config.dts b/tools/binman/test/fit/bad_dir_config.dts index 825a346c3e6..bae805a9523 100644 --- a/tools/binman/test/228_fit_bad_dir_config.dts +++ b/tools/binman/test/fit/bad_dir_config.dts @@ -2,7 +2,7 @@ /dts-v1/; -#include "226_fit_split_elf.dts" +#include "split_elf.dts" &config { fit,config = "bad"; diff --git a/tools/binman/test/224_fit_bad_oper.dts b/tools/binman/test/fit/bad_oper.dts index 8a8014ea33d..8a8014ea33d 100644 --- a/tools/binman/test/224_fit_bad_oper.dts +++ b/tools/binman/test/fit/bad_oper.dts diff --git a/tools/binman/test/dummy-rsa-engine.c b/tools/binman/test/fit/dummy-rsa-engine.c index d163e917a8b..d163e917a8b 100644 --- a/tools/binman/test/dummy-rsa-engine.c +++ b/tools/binman/test/fit/dummy-rsa-engine.c diff --git a/tools/binman/test/340_dummy-rsa4096.crt b/tools/binman/test/fit/dummy-rsa4096.crt index c426874431b..c426874431b 100644 --- a/tools/binman/test/340_dummy-rsa4096.crt +++ b/tools/binman/test/fit/dummy-rsa4096.crt diff --git a/tools/binman/test/343_fit_encrypt_data.dts b/tools/binman/test/fit/encrypt_data.dts index d70de3426cf..d70de3426cf 100644 --- a/tools/binman/test/343_fit_encrypt_data.dts +++ b/tools/binman/test/fit/encrypt_data.dts diff --git a/tools/binman/test/344_fit_encrypt_data_no_key.dts b/tools/binman/test/fit/encrypt_data_no_key.dts index d70de3426cf..d70de3426cf 100644 --- a/tools/binman/test/344_fit_encrypt_data_no_key.dts +++ b/tools/binman/test/fit/encrypt_data_no_key.dts diff --git a/tools/binman/test/162_fit_external.dts b/tools/binman/test/fit/external.dts index 6f2a629a985..6f2a629a985 100644 --- a/tools/binman/test/162_fit_external.dts +++ b/tools/binman/test/fit/external.dts diff --git a/tools/binman/test/240_fit_extract_replace.dts b/tools/binman/test/fit/extract_replace.dts index b44d05afe1a..b44d05afe1a 100644 --- a/tools/binman/test/240_fit_extract_replace.dts +++ b/tools/binman/test/fit/extract_replace.dts diff --git a/tools/binman/test/170_fit_fdt.dts b/tools/binman/test/fit/fdt.dts index 4b1e9b41ec0..4b1e9b41ec0 100644 --- a/tools/binman/test/170_fit_fdt.dts +++ b/tools/binman/test/fit/fdt.dts diff --git a/tools/binman/test/334_fit_fdt_compat.dts b/tools/binman/test/fit/fdt_compat.dts index bf1b5a4a94a..bf1b5a4a94a 100644 --- a/tools/binman/test/334_fit_fdt_compat.dts +++ b/tools/binman/test/fit/fdt_compat.dts diff --git a/tools/binman/test/333_fit_fdt_dir.dts b/tools/binman/test/fit/fdt_dir.dts index 71971de4232..71971de4232 100644 --- a/tools/binman/test/333_fit_fdt_dir.dts +++ b/tools/binman/test/fit/fdt_dir.dts diff --git a/tools/binman/test/284_fit_fdt_list.dts b/tools/binman/test/fit/fdt_list.dts index 70cdb326708..70cdb326708 100644 --- a/tools/binman/test/284_fit_fdt_list.dts +++ b/tools/binman/test/fit/fdt_list.dts diff --git a/tools/binman/test/171_fit_fdt_missing_prop.dts b/tools/binman/test/fit/fdt_missing_prop.dts index c36134715c6..c36134715c6 100644 --- a/tools/binman/test/171_fit_fdt_missing_prop.dts +++ b/tools/binman/test/fit/fdt_missing_prop.dts diff --git a/tools/binman/test/345_fit_fdt_name.dts b/tools/binman/test/fit/fdt_name.dts index 0ef2e1934a0..0ef2e1934a0 100644 --- a/tools/binman/test/345_fit_fdt_name.dts +++ b/tools/binman/test/fit/fdt_name.dts diff --git a/tools/binman/test/223_fit_fdt_oper.dts b/tools/binman/test/fit/fdt_oper.dts index cb3b31e36f6..cb3b31e36f6 100644 --- a/tools/binman/test/223_fit_fdt_oper.dts +++ b/tools/binman/test/fit/fdt_oper.dts diff --git a/tools/binman/test/335_fit_fdt_phase.dts b/tools/binman/test/fit/fdt_phase.dts index c20bcad651a..c20bcad651a 100644 --- a/tools/binman/test/335_fit_fdt_phase.dts +++ b/tools/binman/test/fit/fdt_phase.dts diff --git a/tools/binman/test/276_fit_firmware_loadables.dts b/tools/binman/test/fit/firmware_loadables.dts index 2f79cdc9bb8..2f79cdc9bb8 100644 --- a/tools/binman/test/276_fit_firmware_loadables.dts +++ b/tools/binman/test/fit/firmware_loadables.dts diff --git a/tools/binman/test/161_fit.dts b/tools/binman/test/fit/fit.dts index c52d760b735..c52d760b735 100644 --- a/tools/binman/test/161_fit.dts +++ b/tools/binman/test/fit/fit.dts diff --git a/tools/binman/test/219_fit_gennode.dts b/tools/binman/test/fit/gennode.dts index e9eda29983a..e9eda29983a 100644 --- a/tools/binman/test/219_fit_gennode.dts +++ b/tools/binman/test/fit/gennode.dts diff --git a/tools/binman/test/167_fit_image_subentry_alignment.dts b/tools/binman/test/fit/image_subentry_alignment.dts index 360cac52661..360cac52661 100644 --- a/tools/binman/test/167_fit_image_subentry_alignment.dts +++ b/tools/binman/test/fit/image_subentry_alignment.dts diff --git a/tools/binman/test/347_key_name_hint_dir_fit_signature.dts b/tools/binman/test/fit/key_name_hint_dir_signature.dts index 96e2126dadb..96e2126dadb 100644 --- a/tools/binman/test/347_key_name_hint_dir_fit_signature.dts +++ b/tools/binman/test/fit/key_name_hint_dir_signature.dts diff --git a/tools/binman/test/168_fit_missing_blob.dts b/tools/binman/test/fit/missing_blob.dts index 15f6cc07e5d..15f6cc07e5d 100644 --- a/tools/binman/test/168_fit_missing_blob.dts +++ b/tools/binman/test/fit/missing_blob.dts diff --git a/tools/binman/test/340_openssl.conf b/tools/binman/test/fit/openssl.conf index 9ab9dc739fe..9ab9dc739fe 100644 --- a/tools/binman/test/340_openssl.conf +++ b/tools/binman/test/fit/openssl.conf diff --git a/tools/binman/test/277_replace_fit_sibling.dts b/tools/binman/test/fit/replace_sibling.dts index fc941a80816..fc941a80816 100644 --- a/tools/binman/test/277_replace_fit_sibling.dts +++ b/tools/binman/test/fit/replace_sibling.dts diff --git a/tools/binman/test/340_rsa2048.key b/tools/binman/test/fit/rsa2048.key index e74b20cf392..e74b20cf392 100644 --- a/tools/binman/test/340_rsa2048.key +++ b/tools/binman/test/fit/rsa2048.key diff --git a/tools/binman/test/280_fit_sign.dts b/tools/binman/test/fit/sign.dts index b9f17dc5c0b..b9f17dc5c0b 100644 --- a/tools/binman/test/280_fit_sign.dts +++ b/tools/binman/test/fit/sign.dts diff --git a/tools/binman/test/340_fit_signature.dts b/tools/binman/test/fit/signature.dts index 9dce62e52de..9dce62e52de 100644 --- a/tools/binman/test/340_fit_signature.dts +++ b/tools/binman/test/fit/signature.dts diff --git a/tools/binman/test/340_fit_signature_engine.dts b/tools/binman/test/fit/signature_engine.dts index fd374e0edd2..fd374e0edd2 100644 --- a/tools/binman/test/340_fit_signature_engine.dts +++ b/tools/binman/test/fit/signature_engine.dts diff --git a/tools/binman/test/340_fit_signature_engine_encrypt.dts b/tools/binman/test/fit/signature_engine_encrypt.dts index fbcde342c65..fbcde342c65 100644 --- a/tools/binman/test/340_fit_signature_engine_encrypt.dts +++ b/tools/binman/test/fit/signature_engine_encrypt.dts diff --git a/tools/binman/test/340_fit_signature_engine_pkcs11.dts b/tools/binman/test/fit/signature_engine_pkcs11.dts index 60ba04c13d4..60ba04c13d4 100644 --- a/tools/binman/test/340_fit_signature_engine_pkcs11.dts +++ b/tools/binman/test/fit/signature_engine_pkcs11.dts diff --git a/tools/binman/test/340_fit_signature_engine_pkcs11_object.dts b/tools/binman/test/fit/signature_engine_pkcs11_object.dts index 5226ab4c6cf..5226ab4c6cf 100644 --- a/tools/binman/test/340_fit_signature_engine_pkcs11_object.dts +++ b/tools/binman/test/fit/signature_engine_pkcs11_object.dts diff --git a/tools/binman/test/341_fit_signature.dts b/tools/binman/test/fit/signature_multi_key.dts index 77bec8df1e5..77bec8df1e5 100644 --- a/tools/binman/test/341_fit_signature.dts +++ b/tools/binman/test/fit/signature_multi_key.dts diff --git a/tools/binman/test/342_fit_signature.dts b/tools/binman/test/fit/signature_no_nodes.dts index 267105d0f68..267105d0f68 100644 --- a/tools/binman/test/342_fit_signature.dts +++ b/tools/binman/test/fit/signature_no_nodes.dts diff --git a/tools/binman/test/340_softhsm2.conf b/tools/binman/test/fit/softhsm2.conf index dabaacb15a1..dabaacb15a1 100644 --- a/tools/binman/test/340_softhsm2.conf +++ b/tools/binman/test/fit/softhsm2.conf diff --git a/tools/binman/test/226_fit_split_elf.dts b/tools/binman/test/fit/split_elf.dts index 22c453e6037..22c453e6037 100644 --- a/tools/binman/test/226_fit_split_elf.dts +++ b/tools/binman/test/fit/split_elf.dts diff --git a/tools/binman/test/220_fit_subentry_bintool.dts b/tools/binman/test/fit/subentry_bintool.dts index b1d8fb0feae..b1d8fb0feae 100644 --- a/tools/binman/test/220_fit_subentry_bintool.dts +++ b/tools/binman/test/fit/subentry_bintool.dts diff --git a/tools/binman/test/221_fit_subentry_hash.dts b/tools/binman/test/fit/subentry_hash.dts index 2cb04f96d08..2cb04f96d08 100644 --- a/tools/binman/test/221_fit_subentry_hash.dts +++ b/tools/binman/test/fit/subentry_hash.dts diff --git a/tools/binman/test/264_tee_os_opt_fit.dts b/tools/binman/test/fit/tee_os_opt.dts index e9634d3ccdc..e9634d3ccdc 100644 --- a/tools/binman/test/264_tee_os_opt_fit.dts +++ b/tools/binman/test/fit/tee_os_opt.dts diff --git a/tools/binman/test/265_tee_os_opt_fit_bad.dts b/tools/binman/test/fit/tee_os_opt_bad.dts index 7fa363cc199..7fa363cc199 100644 --- a/tools/binman/test/265_tee_os_opt_fit_bad.dts +++ b/tools/binman/test/fit/tee_os_opt_bad.dts diff --git a/tools/binman/test/288_template_fit.dts b/tools/binman/test/fit/template.dts index d84dca4ea41..d84dca4ea41 100644 --- a/tools/binman/test/288_template_fit.dts +++ b/tools/binman/test/fit/template.dts diff --git a/tools/binman/test/247_mkimage_coll.dts b/tools/binman/test/mkimage/coll.dts index 30860118860..30860118860 100644 --- a/tools/binman/test/247_mkimage_coll.dts +++ b/tools/binman/test/mkimage/coll.dts diff --git a/tools/binman/test/254_mkimage_filename.dts b/tools/binman/test/mkimage/filename.dts index 4483790ae86..4483790ae86 100644 --- a/tools/binman/test/254_mkimage_filename.dts +++ b/tools/binman/test/mkimage/filename.dts diff --git a/tools/binman/test/243_mkimage_image.dts b/tools/binman/test/mkimage/image.dts index 6b8f4a4a401..6b8f4a4a401 100644 --- a/tools/binman/test/243_mkimage_image.dts +++ b/tools/binman/test/mkimage/image.dts diff --git a/tools/binman/test/245_mkimage_image_bad.dts b/tools/binman/test/mkimage/image_bad.dts index 54d2c99d628..54d2c99d628 100644 --- a/tools/binman/test/245_mkimage_image_bad.dts +++ b/tools/binman/test/mkimage/image_bad.dts diff --git a/tools/binman/test/244_mkimage_image_no_content.dts b/tools/binman/test/mkimage/image_no_content.dts index 7306c06af45..7306c06af45 100644 --- a/tools/binman/test/244_mkimage_image_no_content.dts +++ b/tools/binman/test/mkimage/image_no_content.dts diff --git a/tools/binman/test/229_mkimage_missing.dts b/tools/binman/test/mkimage/missing.dts index 54a5a6c571a..54a5a6c571a 100644 --- a/tools/binman/test/229_mkimage_missing.dts +++ b/tools/binman/test/mkimage/missing.dts diff --git a/tools/binman/test/292_mkimage_missing_multiple.dts b/tools/binman/test/mkimage/missing_multiple.dts index f84aea49ead..f84aea49ead 100644 --- a/tools/binman/test/292_mkimage_missing_multiple.dts +++ b/tools/binman/test/mkimage/missing_multiple.dts diff --git a/tools/binman/test/156_mkimage.dts b/tools/binman/test/mkimage/mkimage.dts index 933b13143a8..933b13143a8 100644 --- a/tools/binman/test/156_mkimage.dts +++ b/tools/binman/test/mkimage/mkimage.dts diff --git a/tools/binman/test/252_mkimage_mult_data.dts b/tools/binman/test/mkimage/mult_data.dts index a092bc39bf3..a092bc39bf3 100644 --- a/tools/binman/test/252_mkimage_mult_data.dts +++ b/tools/binman/test/mkimage/mult_data.dts diff --git a/tools/binman/test/253_mkimage_mult_no_content.dts b/tools/binman/test/mkimage/mult_no_content.dts index dd65666c62e..dd65666c62e 100644 --- a/tools/binman/test/253_mkimage_mult_no_content.dts +++ b/tools/binman/test/mkimage/mult_no_content.dts diff --git a/tools/binman/test/242_mkimage_name.dts b/tools/binman/test/mkimage/name.dts index fbc82f1f8d6..fbc82f1f8d6 100644 --- a/tools/binman/test/242_mkimage_name.dts +++ b/tools/binman/test/mkimage/name.dts diff --git a/tools/binman/test/283_mkimage_special.dts b/tools/binman/test/mkimage/special.dts index c234093e6ec..c234093e6ec 100644 --- a/tools/binman/test/283_mkimage_special.dts +++ b/tools/binman/test/mkimage/special.dts diff --git a/tools/binman/test/290_mkimage_sym.dts b/tools/binman/test/mkimage/sym.dts index 2dfd286ad44..2dfd286ad44 100644 --- a/tools/binman/test/290_mkimage_sym.dts +++ b/tools/binman/test/mkimage/sym.dts diff --git a/tools/binman/test/098_4gb_and_skip_at_start_together.dts b/tools/binman/test/pack/4gb_and_skip_at_start_together.dts index 90c467d910b..90c467d910b 100644 --- a/tools/binman/test/098_4gb_and_skip_at_start_together.dts +++ b/tools/binman/test/pack/4gb_and_skip_at_start_together.dts diff --git a/tools/binman/test/200_align_default.dts b/tools/binman/test/pack/align_default.dts index 1b155770d4c..1b155770d4c 100644 --- a/tools/binman/test/200_align_default.dts +++ b/tools/binman/test/pack/align_default.dts diff --git a/tools/binman/test/326_assume_size.dts b/tools/binman/test/pack/assume_size.dts index 4c5f8b418d8..4c5f8b418d8 100644 --- a/tools/binman/test/326_assume_size.dts +++ b/tools/binman/test/pack/assume_size.dts diff --git a/tools/binman/test/327_assume_size_ok.dts b/tools/binman/test/pack/assume_size_ok.dts index 00ed726f872..00ed726f872 100644 --- a/tools/binman/test/327_assume_size_ok.dts +++ b/tools/binman/test/pack/assume_size_ok.dts diff --git a/tools/binman/test/007_bad_align.dts b/tools/binman/test/pack/bad_align.dts index 123bb135581..123bb135581 100644 --- a/tools/binman/test/007_bad_align.dts +++ b/tools/binman/test/pack/bad_align.dts diff --git a/tools/binman/test/059_change_size.dts b/tools/binman/test/pack/change_size.dts index 1a69026a64c..1a69026a64c 100644 --- a/tools/binman/test/059_change_size.dts +++ b/tools/binman/test/pack/change_size.dts diff --git a/tools/binman/test/006_dual_image.dts b/tools/binman/test/pack/dual_image.dts index 78be16f1649..78be16f1649 100644 --- a/tools/binman/test/006_dual_image.dts +++ b/tools/binman/test/pack/dual_image.dts diff --git a/tools/binman/test/003_empty.dts b/tools/binman/test/pack/empty.dts index 493c9a04c97..493c9a04c97 100644 --- a/tools/binman/test/003_empty.dts +++ b/tools/binman/test/pack/empty.dts diff --git a/tools/binman/test/121_entry_extend.dts b/tools/binman/test/pack/entry_extend.dts index ebb7816db90..ebb7816db90 100644 --- a/tools/binman/test/121_entry_extend.dts +++ b/tools/binman/test/pack/entry_extend.dts diff --git a/tools/binman/test/123_entry_extend_section.dts b/tools/binman/test/pack/entry_extend_section.dts index 046f7234348..046f7234348 100644 --- a/tools/binman/test/123_entry_extend_section.dts +++ b/tools/binman/test/pack/entry_extend_section.dts diff --git a/tools/binman/test/122_entry_extend_twice.dts b/tools/binman/test/pack/entry_extend_twice.dts index 258cf859f4b..258cf859f4b 100644 --- a/tools/binman/test/122_entry_extend_twice.dts +++ b/tools/binman/test/pack/entry_extend_twice.dts diff --git a/tools/binman/test/140_entry_shrink.dts b/tools/binman/test/pack/entry_shrink.dts index b750d638986..b750d638986 100644 --- a/tools/binman/test/140_entry_shrink.dts +++ b/tools/binman/test/pack/entry_shrink.dts diff --git a/tools/binman/test/225_expand_size_bad.dts b/tools/binman/test/pack/expand_size_bad.dts index d4ad9a6a1ae..d4ad9a6a1ae 100644 --- a/tools/binman/test/225_expand_size_bad.dts +++ b/tools/binman/test/pack/expand_size_bad.dts diff --git a/tools/binman/test/088_extend_size.dts b/tools/binman/test/pack/extend_size.dts index f352699e37c..f352699e37c 100644 --- a/tools/binman/test/088_extend_size.dts +++ b/tools/binman/test/pack/extend_size.dts diff --git a/tools/binman/test/089_extend_size_bad.dts b/tools/binman/test/pack/extend_size_bad.dts index edc60e43fdf..edc60e43fdf 100644 --- a/tools/binman/test/089_extend_size_bad.dts +++ b/tools/binman/test/pack/extend_size_bad.dts diff --git a/tools/binman/test/022_image_name.dts b/tools/binman/test/pack/image_name.dts index 94fc069c176..94fc069c176 100644 --- a/tools/binman/test/022_image_name.dts +++ b/tools/binman/test/pack/image_name.dts diff --git a/tools/binman/test/021_image_pad.dts b/tools/binman/test/pack/image_pad.dts index c5abbbcdd6a..c5abbbcdd6a 100644 --- a/tools/binman/test/021_image_pad.dts +++ b/tools/binman/test/pack/image_pad.dts diff --git a/tools/binman/test/001_invalid.dts b/tools/binman/test/pack/invalid.dts index 7d00455d7c1..7d00455d7c1 100644 --- a/tools/binman/test/001_invalid.dts +++ b/tools/binman/test/pack/invalid.dts diff --git a/tools/binman/test/004_invalid_entry.dts b/tools/binman/test/pack/invalid_entry.dts index b043455bb57..b043455bb57 100644 --- a/tools/binman/test/004_invalid_entry.dts +++ b/tools/binman/test/pack/invalid_entry.dts diff --git a/tools/binman/test/002_missing_node.dts b/tools/binman/test/pack/missing_node.dts index 3a51ec2be58..3a51ec2be58 100644 --- a/tools/binman/test/002_missing_node.dts +++ b/tools/binman/test/pack/missing_node.dts diff --git a/tools/binman/test/008_pack.dts b/tools/binman/test/pack/pack.dts index a88785d8352..a88785d8352 100644 --- a/tools/binman/test/008_pack.dts +++ b/tools/binman/test/pack/pack.dts diff --git a/tools/binman/test/027_pack_4gb_no_size.dts b/tools/binman/test/pack/pack_4gb_no_size.dts index 371cca10d58..371cca10d58 100644 --- a/tools/binman/test/027_pack_4gb_no_size.dts +++ b/tools/binman/test/pack/pack_4gb_no_size.dts diff --git a/tools/binman/test/028_pack_4gb_outside.dts b/tools/binman/test/pack/pack_4gb_outside.dts index b6ad7fb56a5..b6ad7fb56a5 100644 --- a/tools/binman/test/028_pack_4gb_outside.dts +++ b/tools/binman/test/pack/pack_4gb_outside.dts diff --git a/tools/binman/test/010_pack_align_power2.dts b/tools/binman/test/pack/pack_align_power2.dts index 8f6253a3d0f..8f6253a3d0f 100644 --- a/tools/binman/test/010_pack_align_power2.dts +++ b/tools/binman/test/pack/pack_align_power2.dts diff --git a/tools/binman/test/131_pack_align_section.dts b/tools/binman/test/pack/pack_align_section.dts index 44478855b09..44478855b09 100644 --- a/tools/binman/test/131_pack_align_section.dts +++ b/tools/binman/test/pack/pack_align_section.dts diff --git a/tools/binman/test/011_pack_align_size_power2.dts b/tools/binman/test/pack/pack_align_size_power2.dts index 04f7672ea47..04f7672ea47 100644 --- a/tools/binman/test/011_pack_align_size_power2.dts +++ b/tools/binman/test/pack/pack_align_size_power2.dts diff --git a/tools/binman/test/009_pack_extra.dts b/tools/binman/test/pack/pack_extra.dts index 8d6f4910c93..8d6f4910c93 100644 --- a/tools/binman/test/009_pack_extra.dts +++ b/tools/binman/test/pack/pack_extra.dts diff --git a/tools/binman/test/018_pack_image_align.dts b/tools/binman/test/pack/pack_image_align.dts index 16cd2a422ef..16cd2a422ef 100644 --- a/tools/binman/test/018_pack_image_align.dts +++ b/tools/binman/test/pack/pack_image_align.dts diff --git a/tools/binman/test/016_pack_image_overflow.dts b/tools/binman/test/pack/pack_image_overflow.dts index 6ae66f3ac95..6ae66f3ac95 100644 --- a/tools/binman/test/016_pack_image_overflow.dts +++ b/tools/binman/test/pack/pack_image_overflow.dts diff --git a/tools/binman/test/017_pack_image_size.dts b/tools/binman/test/pack/pack_image_size.dts index 2360eb5d19a..2360eb5d19a 100644 --- a/tools/binman/test/017_pack_image_size.dts +++ b/tools/binman/test/pack/pack_image_size.dts diff --git a/tools/binman/test/012_pack_inv_align.dts b/tools/binman/test/pack/pack_inv_align.dts index d8dd600edb8..d8dd600edb8 100644 --- a/tools/binman/test/012_pack_inv_align.dts +++ b/tools/binman/test/pack/pack_inv_align.dts diff --git a/tools/binman/test/019_pack_inv_image_align.dts b/tools/binman/test/pack/pack_inv_image_align.dts index e5ee87b88fb..e5ee87b88fb 100644 --- a/tools/binman/test/019_pack_inv_image_align.dts +++ b/tools/binman/test/pack/pack_inv_image_align.dts diff --git a/tools/binman/test/020_pack_inv_image_align_power2.dts b/tools/binman/test/pack/pack_inv_image_align_power2.dts index a428c4be520..a428c4be520 100644 --- a/tools/binman/test/020_pack_inv_image_align_power2.dts +++ b/tools/binman/test/pack/pack_inv_image_align_power2.dts diff --git a/tools/binman/test/013_pack_inv_size_align.dts b/tools/binman/test/pack/pack_inv_size_align.dts index dfafa134d7b..dfafa134d7b 100644 --- a/tools/binman/test/013_pack_inv_size_align.dts +++ b/tools/binman/test/pack/pack_inv_size_align.dts diff --git a/tools/binman/test/015_pack_overflow.dts b/tools/binman/test/pack/pack_overflow.dts index 6f654330afc..6f654330afc 100644 --- a/tools/binman/test/015_pack_overflow.dts +++ b/tools/binman/test/pack/pack_overflow.dts diff --git a/tools/binman/test/014_pack_overlap.dts b/tools/binman/test/pack/pack_overlap.dts index 3895cba3bdb..3895cba3bdb 100644 --- a/tools/binman/test/014_pack_overlap.dts +++ b/tools/binman/test/pack/pack_overlap.dts diff --git a/tools/binman/test/160_pack_overlap_zero.dts b/tools/binman/test/pack/pack_overlap_zero.dts index 731aa1cbe6d..731aa1cbe6d 100644 --- a/tools/binman/test/160_pack_overlap_zero.dts +++ b/tools/binman/test/pack/pack_overlap_zero.dts diff --git a/tools/binman/test/025_pack_zero_size.dts b/tools/binman/test/pack/pack_zero_size.dts index e863c44e3fd..e863c44e3fd 100644 --- a/tools/binman/test/025_pack_zero_size.dts +++ b/tools/binman/test/pack/pack_zero_size.dts diff --git a/tools/binman/test/166_pad_in_sections.dts b/tools/binman/test/pack/pad_in_sections.dts index f2b327ff9f3..f2b327ff9f3 100644 --- a/tools/binman/test/166_pad_in_sections.dts +++ b/tools/binman/test/pack/pad_in_sections.dts diff --git a/tools/binman/test/181_section_align.dts b/tools/binman/test/pack/section_align.dts index 90795d131b0..90795d131b0 100644 --- a/tools/binman/test/181_section_align.dts +++ b/tools/binman/test/pack/section_align.dts diff --git a/tools/binman/test/267_section_inner.dts b/tools/binman/test/pack/section_inner.dts index f6faab3d2f9..f6faab3d2f9 100644 --- a/tools/binman/test/267_section_inner.dts +++ b/tools/binman/test/pack/section_inner.dts diff --git a/tools/binman/test/180_section_pad.dts b/tools/binman/test/pack/section_pad.dts index 7e4ebf257b8..7e4ebf257b8 100644 --- a/tools/binman/test/180_section_pad.dts +++ b/tools/binman/test/pack/section_pad.dts diff --git a/tools/binman/test/101_sections_offset.dts b/tools/binman/test/pack/sections_offset.dts index 46708ff9b6b..46708ff9b6b 100644 --- a/tools/binman/test/101_sections_offset.dts +++ b/tools/binman/test/pack/sections_offset.dts diff --git a/tools/binman/test/005_simple.dts b/tools/binman/test/pack/simple.dts index 3771aa2261c..3771aa2261c 100644 --- a/tools/binman/test/005_simple.dts +++ b/tools/binman/test/pack/simple.dts diff --git a/tools/binman/test/177_skip_at_start.dts b/tools/binman/test/pack/skip_at_start.dts index 021460b1a04..021460b1a04 100644 --- a/tools/binman/test/177_skip_at_start.dts +++ b/tools/binman/test/pack/skip_at_start.dts diff --git a/tools/binman/test/178_skip_at_start_pad.dts b/tools/binman/test/pack/skip_at_start_pad.dts index deda3c862e9..deda3c862e9 100644 --- a/tools/binman/test/178_skip_at_start_pad.dts +++ b/tools/binman/test/pack/skip_at_start_pad.dts diff --git a/tools/binman/test/179_skip_at_start_section_pad.dts b/tools/binman/test/pack/skip_at_start_section_pad.dts index bf2f8f69b4d..bf2f8f69b4d 100644 --- a/tools/binman/test/179_skip_at_start_section_pad.dts +++ b/tools/binman/test/pack/skip_at_start_section_pad.dts diff --git a/tools/binman/test/024_sorted.dts b/tools/binman/test/pack/sorted.dts index b54f9b14191..b54f9b14191 100644 --- a/tools/binman/test/024_sorted.dts +++ b/tools/binman/test/pack/sorted.dts diff --git a/tools/binman/test/054_unit_address.dts b/tools/binman/test/pack/unit_address.dts index 3216dbbcc19..3216dbbcc19 100644 --- a/tools/binman/test/054_unit_address.dts +++ b/tools/binman/test/pack/unit_address.dts diff --git a/tools/binman/test/079_uses_pos.dts b/tools/binman/test/pack/uses_pos.dts index 7638b9b5e0c..7638b9b5e0c 100644 --- a/tools/binman/test/079_uses_pos.dts +++ b/tools/binman/test/pack/uses_pos.dts diff --git a/tools/binman/test/302_encrypted_invalid_iv_file.dts b/tools/binman/test/security/encrypted_invalid_iv_file.dts index 388a0a6ad90..388a0a6ad90 100644 --- a/tools/binman/test/302_encrypted_invalid_iv_file.dts +++ b/tools/binman/test/security/encrypted_invalid_iv_file.dts diff --git a/tools/binman/test/305_encrypted_key_file.dts b/tools/binman/test/security/encrypted_key_file.dts index efd7ee5f35a..efd7ee5f35a 100644 --- a/tools/binman/test/305_encrypted_key_file.dts +++ b/tools/binman/test/security/encrypted_key_file.dts diff --git a/tools/binman/test/304_encrypted_key_source.dts b/tools/binman/test/security/encrypted_key_source.dts index 884ec508db8..884ec508db8 100644 --- a/tools/binman/test/304_encrypted_key_source.dts +++ b/tools/binman/test/security/encrypted_key_source.dts diff --git a/tools/binman/test/303_encrypted_missing_key.dts b/tools/binman/test/security/encrypted_missing_key.dts index d1daaa08851..d1daaa08851 100644 --- a/tools/binman/test/303_encrypted_missing_key.dts +++ b/tools/binman/test/security/encrypted_missing_key.dts diff --git a/tools/binman/test/301_encrypted_no_algo.dts b/tools/binman/test/security/encrypted_no_algo.dts index 03f7ffee90f..03f7ffee90f 100644 --- a/tools/binman/test/301_encrypted_no_algo.dts +++ b/tools/binman/test/security/encrypted_no_algo.dts diff --git a/tools/binman/test/090_hash.dts b/tools/binman/test/security/hash.dts index 200304599dc..200304599dc 100644 --- a/tools/binman/test/090_hash.dts +++ b/tools/binman/test/security/hash.dts diff --git a/tools/binman/test/092_hash_bad_algo.dts b/tools/binman/test/security/hash_bad_algo.dts index d2402000db6..d2402000db6 100644 --- a/tools/binman/test/092_hash_bad_algo.dts +++ b/tools/binman/test/security/hash_bad_algo.dts diff --git a/tools/binman/test/091_hash_no_algo.dts b/tools/binman/test/security/hash_no_algo.dts index b64df205117..b64df205117 100644 --- a/tools/binman/test/091_hash_no_algo.dts +++ b/tools/binman/test/security/hash_no_algo.dts diff --git a/tools/binman/test/099_hash_section.dts b/tools/binman/test/security/hash_section.dts index dcd8683d642..dcd8683d642 100644 --- a/tools/binman/test/099_hash_section.dts +++ b/tools/binman/test/security/hash_section.dts diff --git a/tools/binman/test/key.key b/tools/binman/test/security/key.key index 9de3be14da8..9de3be14da8 100644 --- a/tools/binman/test/key.key +++ b/tools/binman/test/security/key.key diff --git a/tools/binman/test/key.pem b/tools/binman/test/security/key.pem index 20bd5a41ab2..20bd5a41ab2 100644 --- a/tools/binman/test/key.pem +++ b/tools/binman/test/security/key.pem diff --git a/tools/binman/test/348_key_name_hint_dir_spl_pubkey_dtb.dts b/tools/binman/test/security/key_name_hint_dir_spl_pubkey_dtb.dts index 85ebd58b6c0..85ebd58b6c0 100644 --- a/tools/binman/test/348_key_name_hint_dir_spl_pubkey_dtb.dts +++ b/tools/binman/test/security/key_name_hint_dir_spl_pubkey_dtb.dts diff --git a/tools/binman/test/230_pre_load.dts b/tools/binman/test/security/pre_load.dts index e6d9ef40c6c..e6d9ef40c6c 100644 --- a/tools/binman/test/230_pre_load.dts +++ b/tools/binman/test/security/pre_load.dts diff --git a/tools/binman/test/235_pre_load_invalid_algo.dts b/tools/binman/test/security/pre_load_invalid_algo.dts index d6f6dd20cd9..d6f6dd20cd9 100644 --- a/tools/binman/test/235_pre_load_invalid_algo.dts +++ b/tools/binman/test/security/pre_load_invalid_algo.dts diff --git a/tools/binman/test/236_pre_load_invalid_key.dts b/tools/binman/test/security/pre_load_invalid_key.dts index f93bc9792cd..f93bc9792cd 100644 --- a/tools/binman/test/236_pre_load_invalid_key.dts +++ b/tools/binman/test/security/pre_load_invalid_key.dts diff --git a/tools/binman/test/233_pre_load_invalid_padding.dts b/tools/binman/test/security/pre_load_invalid_padding.dts index bbe2d1ba869..bbe2d1ba869 100644 --- a/tools/binman/test/233_pre_load_invalid_padding.dts +++ b/tools/binman/test/security/pre_load_invalid_padding.dts diff --git a/tools/binman/test/234_pre_load_invalid_sha.dts b/tools/binman/test/security/pre_load_invalid_sha.dts index 29afd2e37e4..29afd2e37e4 100644 --- a/tools/binman/test/234_pre_load_invalid_sha.dts +++ b/tools/binman/test/security/pre_load_invalid_sha.dts diff --git a/tools/binman/test/231_pre_load_pkcs.dts b/tools/binman/test/security/pre_load_pkcs.dts index 66268cdb212..66268cdb212 100644 --- a/tools/binman/test/231_pre_load_pkcs.dts +++ b/tools/binman/test/security/pre_load_pkcs.dts diff --git a/tools/binman/test/232_pre_load_pss.dts b/tools/binman/test/security/pre_load_pss.dts index 3008d3f4649..3008d3f4649 100644 --- a/tools/binman/test/232_pre_load_pss.dts +++ b/tools/binman/test/security/pre_load_pss.dts diff --git a/tools/binman/test/165_section_ignore_hash_signature.dts b/tools/binman/test/security/section_ignore_hash_signature.dts index 8adbe25512a..8adbe25512a 100644 --- a/tools/binman/test/165_section_ignore_hash_signature.dts +++ b/tools/binman/test/security/section_ignore_hash_signature.dts diff --git a/tools/binman/test/281_sign_non_fit.dts b/tools/binman/test/security/sign_non_fit.dts index e16c954246d..e16c954246d 100644 --- a/tools/binman/test/281_sign_non_fit.dts +++ b/tools/binman/test/security/sign_non_fit.dts diff --git a/tools/binman/test/306_spl_pubkey_dtb.dts b/tools/binman/test/security/spl_pubkey_dtb.dts index 3256ff970cd..3256ff970cd 100644 --- a/tools/binman/test/306_spl_pubkey_dtb.dts +++ b/tools/binman/test/security/spl_pubkey_dtb.dts diff --git a/tools/binman/test/279_x509_cert.dts b/tools/binman/test/security/x509_cert.dts index 71238172717..71238172717 100644 --- a/tools/binman/test/279_x509_cert.dts +++ b/tools/binman/test/security/x509_cert.dts diff --git a/tools/binman/test/307_xilinx_bootgen_sign.dts b/tools/binman/test/security/xilinx_bootgen_sign.dts index 02acf8652a5..02acf8652a5 100644 --- a/tools/binman/test/307_xilinx_bootgen_sign.dts +++ b/tools/binman/test/security/xilinx_bootgen_sign.dts diff --git a/tools/binman/test/308_xilinx_bootgen_sign_enc.dts b/tools/binman/test/security/xilinx_bootgen_sign_enc.dts index 5d7ce4c1f5a..5d7ce4c1f5a 100644 --- a/tools/binman/test/308_xilinx_bootgen_sign_enc.dts +++ b/tools/binman/test/security/xilinx_bootgen_sign_enc.dts diff --git a/tools/binman/test/336_symbols_base.dts b/tools/binman/test/symbols/base.dts index e4dccd38c22..e4dccd38c22 100644 --- a/tools/binman/test/336_symbols_base.dts +++ b/tools/binman/test/symbols/base.dts diff --git a/tools/binman/test/337_symbols_base_expand.dts b/tools/binman/test/symbols/base_expand.dts index 5a777ae63b8..5a777ae63b8 100644 --- a/tools/binman/test/337_symbols_base_expand.dts +++ b/tools/binman/test/symbols/base_expand.dts diff --git a/tools/binman/test/338_symbols_comp.dts b/tools/binman/test/symbols/comp.dts index 15008507cfd..15008507cfd 100644 --- a/tools/binman/test/338_symbols_comp.dts +++ b/tools/binman/test/symbols/comp.dts diff --git a/tools/binman/test/282_symbols_disable.dts b/tools/binman/test/symbols/disable.dts index 6efa9335041..6efa9335041 100644 --- a/tools/binman/test/282_symbols_disable.dts +++ b/tools/binman/test/symbols/disable.dts diff --git a/tools/binman/test/260_symbols_elf.dts b/tools/binman/test/symbols/elf.dts index 0fae118fc12..0fae118fc12 100644 --- a/tools/binman/test/260_symbols_elf.dts +++ b/tools/binman/test/symbols/elf.dts diff --git a/tools/binman/test/197_symbols_expand.dts b/tools/binman/test/symbols/expand.dts index 8aee76dc755..8aee76dc755 100644 --- a/tools/binman/test/197_symbols_expand.dts +++ b/tools/binman/test/symbols/expand.dts diff --git a/tools/binman/test/196_symbols_nodtb.dts b/tools/binman/test/symbols/nodtb.dts index 5c900d60709..5c900d60709 100644 --- a/tools/binman/test/196_symbols_nodtb.dts +++ b/tools/binman/test/symbols/nodtb.dts diff --git a/tools/binman/test/187_symbols_sub.dts b/tools/binman/test/symbols/sub.dts index 3ab62d37215..3ab62d37215 100644 --- a/tools/binman/test/187_symbols_sub.dts +++ b/tools/binman/test/symbols/sub.dts diff --git a/tools/binman/test/053_symbols.dts b/tools/binman/test/symbols/symbols.dts index b28f34a72fa..b28f34a72fa 100644 --- a/tools/binman/test/053_symbols.dts +++ b/tools/binman/test/symbols/symbols.dts diff --git a/tools/binman/test/149_symbols_tpl.dts b/tools/binman/test/symbols/tpl.dts index 4e649c45978..4e649c45978 100644 --- a/tools/binman/test/149_symbols_tpl.dts +++ b/tools/binman/test/symbols/tpl.dts diff --git a/tools/binman/test/346_nxp_ddrfw_imx95.dts b/tools/binman/test/vendor/nxp_ddrfw_imx95.dts index 889f6f29860..889f6f29860 100644 --- a/tools/binman/test/346_nxp_ddrfw_imx95.dts +++ b/tools/binman/test/vendor/nxp_ddrfw_imx95.dts diff --git a/tools/binman/test/339_nxp_imx8.dts b/tools/binman/test/vendor/nxp_imx8.dts index cb512ae9aa2..d9fc86635b4 100644 --- a/tools/binman/test/339_nxp_imx8.dts +++ b/tools/binman/test/vendor/nxp_imx8.dts @@ -12,6 +12,9 @@ nxp,boot-from = "sd"; nxp,rom-version = <1>; nxp,loader-address = <0x10>; + + u-boot { + }; }; }; }; diff --git a/tools/binman/test/vendor/nxp_imx8_csf.dts b/tools/binman/test/vendor/nxp_imx8_csf.dts new file mode 100644 index 00000000000..148f4668bb9 --- /dev/null +++ b/tools/binman/test/vendor/nxp_imx8_csf.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + nxp-imx8mcst { + args; + nxp,loader-address = <0x10>; + + blob { + filename = "imx8m-ivt.bin"; + }; + + imagename { + type = "section"; + + u-boot { + }; + }; + }; + }; +}; diff --git a/tools/binman/test/vendor/nxp_imx8_csf_fast_auth.dts b/tools/binman/test/vendor/nxp_imx8_csf_fast_auth.dts new file mode 100644 index 00000000000..af35f2569df --- /dev/null +++ b/tools/binman/test/vendor/nxp_imx8_csf_fast_auth.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + nxp-imx8mcst { + args; + nxp,loader-address = <0x10>; + nxp,fast-auth; + nxp,unlock; + + blob { + filename = "imx8m-fit.bin"; + }; + }; + }; +}; diff --git a/tools/binman/test/vendor/nxp_imx8_imagename.dts b/tools/binman/test/vendor/nxp_imx8_imagename.dts new file mode 100644 index 00000000000..58dd1ca3d5d --- /dev/null +++ b/tools/binman/test/vendor/nxp_imx8_imagename.dts @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + nxp-imx8mimage { + args; /* TODO: Needed by mkimage etype superclass */ + nxp,boot-from = "sd"; + nxp,rom-version = <1>; + nxp,loader-address = <0x10>; + + u-boot { + }; + + imagename { + type = "section"; + + u-boot { + }; + }; + }; + }; +}; diff --git a/tools/binman/test/350_nxp_imx95.dts b/tools/binman/test/vendor/nxp_imx95.dts index 3fc2de44b4a..3fc2de44b4a 100644 --- a/tools/binman/test/350_nxp_imx95.dts +++ b/tools/binman/test/vendor/nxp_imx95.dts diff --git a/tools/binman/test/150_powerpc_mpc85xx_bootpg_resetvec.dts b/tools/binman/test/vendor/powerpc_mpc85xx_bootpg_resetvec.dts index 8f4b16c399c..8f4b16c399c 100644 --- a/tools/binman/test/150_powerpc_mpc85xx_bootpg_resetvec.dts +++ b/tools/binman/test/vendor/powerpc_mpc85xx_bootpg_resetvec.dts diff --git a/tools/binman/test/348_renesas_rcar4_sa0.dts b/tools/binman/test/vendor/renesas_rcar4_sa0.dts index 4a8717520f2..4a8717520f2 100644 --- a/tools/binman/test/348_renesas_rcar4_sa0.dts +++ b/tools/binman/test/vendor/renesas_rcar4_sa0.dts diff --git a/tools/binman/test/349_renesas_rcar4_sa0_size.dts b/tools/binman/test/vendor/renesas_rcar4_sa0_size.dts index eaf4507260b..eaf4507260b 100644 --- a/tools/binman/test/349_renesas_rcar4_sa0_size.dts +++ b/tools/binman/test/vendor/renesas_rcar4_sa0_size.dts diff --git a/tools/binman/test/291_rockchip_tpl.dts b/tools/binman/test/vendor/rockchip_tpl.dts index 269f56e2545..269f56e2545 100644 --- a/tools/binman/test/291_rockchip_tpl.dts +++ b/tools/binman/test/vendor/rockchip_tpl.dts diff --git a/tools/binman/test/293_ti_board_cfg.dts b/tools/binman/test/vendor/ti_board_cfg.dts index cda024c1b8c..cda024c1b8c 100644 --- a/tools/binman/test/293_ti_board_cfg.dts +++ b/tools/binman/test/vendor/ti_board_cfg.dts diff --git a/tools/binman/test/294_ti_board_cfg_combined.dts b/tools/binman/test/vendor/ti_board_cfg_combined.dts index 95ef449cbf4..95ef449cbf4 100644 --- a/tools/binman/test/294_ti_board_cfg_combined.dts +++ b/tools/binman/test/vendor/ti_board_cfg_combined.dts diff --git a/tools/binman/test/295_ti_board_cfg_no_type.dts b/tools/binman/test/vendor/ti_board_cfg_no_type.dts index 584b7acc5a4..584b7acc5a4 100644 --- a/tools/binman/test/295_ti_board_cfg_no_type.dts +++ b/tools/binman/test/vendor/ti_board_cfg_no_type.dts diff --git a/tools/binman/test/323_ti_board_cfg_phony.dts b/tools/binman/test/vendor/ti_board_cfg_phony.dts index 441296de4fd..441296de4fd 100644 --- a/tools/binman/test/323_ti_board_cfg_phony.dts +++ b/tools/binman/test/vendor/ti_board_cfg_phony.dts diff --git a/tools/binman/test/225_ti_dm.dts b/tools/binman/test/vendor/ti_dm.dts index 3ab754131e9..3ab754131e9 100644 --- a/tools/binman/test/225_ti_dm.dts +++ b/tools/binman/test/vendor/ti_dm.dts diff --git a/tools/binman/test/296_ti_secure.dts b/tools/binman/test/vendor/ti_secure.dts index 941d0ab4ca3..941d0ab4ca3 100644 --- a/tools/binman/test/296_ti_secure.dts +++ b/tools/binman/test/vendor/ti_secure.dts diff --git a/tools/binman/test/324_ti_secure_firewall.dts b/tools/binman/test/vendor/ti_secure_firewall.dts index 7ec407fa67b..7ec407fa67b 100644 --- a/tools/binman/test/324_ti_secure_firewall.dts +++ b/tools/binman/test/vendor/ti_secure_firewall.dts diff --git a/tools/binman/test/325_ti_secure_firewall_missing_property.dts b/tools/binman/test/vendor/ti_secure_firewall_missing_property.dts index 24a0a996250..24a0a996250 100644 --- a/tools/binman/test/325_ti_secure_firewall_missing_property.dts +++ b/tools/binman/test/vendor/ti_secure_firewall_missing_property.dts diff --git a/tools/binman/test/297_ti_secure_rom.dts b/tools/binman/test/vendor/ti_secure_rom.dts index 1a3eca94255..1a3eca94255 100644 --- a/tools/binman/test/297_ti_secure_rom.dts +++ b/tools/binman/test/vendor/ti_secure_rom.dts diff --git a/tools/binman/test/299_ti_secure_rom_a.dts b/tools/binman/test/vendor/ti_secure_rom_a.dts index 887138f0e4b..887138f0e4b 100644 --- a/tools/binman/test/299_ti_secure_rom_a.dts +++ b/tools/binman/test/vendor/ti_secure_rom_a.dts diff --git a/tools/binman/test/300_ti_secure_rom_b.dts b/tools/binman/test/vendor/ti_secure_rom_b.dts index c6d6182158c..c6d6182158c 100644 --- a/tools/binman/test/300_ti_secure_rom_b.dts +++ b/tools/binman/test/vendor/ti_secure_rom_b.dts diff --git a/tools/binman/test/298_ti_secure_rom_combined.dts b/tools/binman/test/vendor/ti_secure_rom_combined.dts index bf872739bc1..bf872739bc1 100644 --- a/tools/binman/test/298_ti_secure_rom_combined.dts +++ b/tools/binman/test/vendor/ti_secure_rom_combined.dts diff --git a/tools/binman/test/descriptor.bin b/tools/binman/test/x86/descriptor.bin Binary files differindex 3d549436c27..3d549436c27 100644 --- a/tools/binman/test/descriptor.bin +++ b/tools/binman/test/x86/descriptor.bin diff --git a/tools/binman/test/141_descriptor_offset.dts b/tools/binman/test/x86/descriptor_offset.dts index f9bff016aa8..f9bff016aa8 100644 --- a/tools/binman/test/141_descriptor_offset.dts +++ b/tools/binman/test/x86/descriptor_offset.dts diff --git a/tools/binman/test/fitimage.bin.gz b/tools/binman/test/x86/fitimage.bin.gz Binary files differindex 0a9dcfc4248..0a9dcfc4248 100644 --- a/tools/binman/test/fitimage.bin.gz +++ b/tools/binman/test/x86/fitimage.bin.gz diff --git a/tools/binman/test/094_fmap_x86.dts b/tools/binman/test/x86/fmap.dts index 613c5dab425..613c5dab425 100644 --- a/tools/binman/test/094_fmap_x86.dts +++ b/tools/binman/test/x86/fmap.dts diff --git a/tools/binman/test/095_fmap_x86_section.dts b/tools/binman/test/x86/fmap_section.dts index fd5f018c923..fd5f018c923 100644 --- a/tools/binman/test/095_fmap_x86_section.dts +++ b/tools/binman/test/x86/fmap_section.dts diff --git a/tools/binman/test/ifwi.bin.gz b/tools/binman/test/x86/ifwi.bin.gz Binary files differindex 25d72892944..25d72892944 100644 --- a/tools/binman/test/ifwi.bin.gz +++ b/tools/binman/test/x86/ifwi.bin.gz diff --git a/tools/binman/test/043_intel_cmc.dts b/tools/binman/test/x86/intel_cmc.dts index 5a56c7d881a..5a56c7d881a 100644 --- a/tools/binman/test/043_intel_cmc.dts +++ b/tools/binman/test/x86/intel_cmc.dts diff --git a/tools/binman/test/147_intel_fit.dts b/tools/binman/test/x86/intel_fit.dts index 01ec40e5c72..01ec40e5c72 100644 --- a/tools/binman/test/147_intel_fit.dts +++ b/tools/binman/test/x86/intel_fit.dts diff --git a/tools/binman/test/148_intel_fit_missing.dts b/tools/binman/test/x86/intel_fit_missing.dts index 388c76b1ab5..388c76b1ab5 100644 --- a/tools/binman/test/148_intel_fit_missing.dts +++ b/tools/binman/test/x86/intel_fit_missing.dts diff --git a/tools/binman/test/042_intel_fsp.dts b/tools/binman/test/x86/intel_fsp.dts index 8a7c889251b..8a7c889251b 100644 --- a/tools/binman/test/042_intel_fsp.dts +++ b/tools/binman/test/x86/intel_fsp.dts diff --git a/tools/binman/test/152_intel_fsp_m.dts b/tools/binman/test/x86/intel_fsp_m.dts index b6010f31c2b..b6010f31c2b 100644 --- a/tools/binman/test/152_intel_fsp_m.dts +++ b/tools/binman/test/x86/intel_fsp_m.dts diff --git a/tools/binman/test/153_intel_fsp_s.dts b/tools/binman/test/x86/intel_fsp_s.dts index 579618a8fa3..579618a8fa3 100644 --- a/tools/binman/test/153_intel_fsp_s.dts +++ b/tools/binman/test/x86/intel_fsp_s.dts diff --git a/tools/binman/test/154_intel_fsp_t.dts b/tools/binman/test/x86/intel_fsp_t.dts index 8da749c1574..8da749c1574 100644 --- a/tools/binman/test/154_intel_fsp_t.dts +++ b/tools/binman/test/x86/intel_fsp_t.dts diff --git a/tools/binman/test/050_intel_mrc.dts b/tools/binman/test/x86/intel_mrc.dts index 54cd52a2b71..54cd52a2b71 100644 --- a/tools/binman/test/050_intel_mrc.dts +++ b/tools/binman/test/x86/intel_mrc.dts diff --git a/tools/binman/test/100_intel_refcode.dts b/tools/binman/test/x86/intel_refcode.dts index 0a1a0270e5f..0a1a0270e5f 100644 --- a/tools/binman/test/100_intel_refcode.dts +++ b/tools/binman/test/x86/intel_refcode.dts diff --git a/tools/binman/test/046_intel_vbt.dts b/tools/binman/test/x86/intel_vbt.dts index 733f5751d5a..733f5751d5a 100644 --- a/tools/binman/test/046_intel_vbt.dts +++ b/tools/binman/test/x86/intel_vbt.dts diff --git a/tools/binman/test/032_intel_vga.dts b/tools/binman/test/x86/intel_vga.dts index 9c532d03d3c..9c532d03d3c 100644 --- a/tools/binman/test/032_intel_vga.dts +++ b/tools/binman/test/x86/intel_vga.dts diff --git a/tools/binman/test/037_x86_no_ucode.dts b/tools/binman/test/x86/no_ucode.dts index 6da49c3da6d..6da49c3da6d 100644 --- a/tools/binman/test/037_x86_no_ucode.dts +++ b/tools/binman/test/x86/no_ucode.dts diff --git a/tools/binman/test/044_x86_optional_ucode.dts b/tools/binman/test/x86/optional_ucode.dts index 24a7040d318..24a7040d318 100644 --- a/tools/binman/test/044_x86_optional_ucode.dts +++ b/tools/binman/test/x86/optional_ucode.dts diff --git a/tools/binman/test/144_x86_reset16.dts b/tools/binman/test/x86/reset16.dts index ba90333b27b..ba90333b27b 100644 --- a/tools/binman/test/144_x86_reset16.dts +++ b/tools/binman/test/x86/reset16.dts diff --git a/tools/binman/test/145_x86_reset16_spl.dts b/tools/binman/test/x86/reset16_spl.dts index cc8d97a7e66..cc8d97a7e66 100644 --- a/tools/binman/test/145_x86_reset16_spl.dts +++ b/tools/binman/test/x86/reset16_spl.dts diff --git a/tools/binman/test/146_x86_reset16_tpl.dts b/tools/binman/test/x86/reset16_tpl.dts index 041b16f3de1..041b16f3de1 100644 --- a/tools/binman/test/146_x86_reset16_tpl.dts +++ b/tools/binman/test/x86/reset16_tpl.dts diff --git a/tools/binman/test/029_x86_rom.dts b/tools/binman/test/x86/rom.dts index ad8f9d6e1bd..ad8f9d6e1bd 100644 --- a/tools/binman/test/029_x86_rom.dts +++ b/tools/binman/test/x86/rom.dts diff --git a/tools/binman/test/111_x86_rom_ifwi.dts b/tools/binman/test/x86/rom_ifwi.dts index c0ba4f2ea42..c0ba4f2ea42 100644 --- a/tools/binman/test/111_x86_rom_ifwi.dts +++ b/tools/binman/test/x86/rom_ifwi.dts diff --git a/tools/binman/test/113_x86_rom_ifwi_nodata.dts b/tools/binman/test/x86/rom_ifwi_nodata.dts index 82a4bc8cdd5..82a4bc8cdd5 100644 --- a/tools/binman/test/113_x86_rom_ifwi_nodata.dts +++ b/tools/binman/test/x86/rom_ifwi_nodata.dts diff --git a/tools/binman/test/112_x86_rom_ifwi_nodesc.dts b/tools/binman/test/x86/rom_ifwi_nodesc.dts index 0874440ab53..0874440ab53 100644 --- a/tools/binman/test/112_x86_rom_ifwi_nodesc.dts +++ b/tools/binman/test/x86/rom_ifwi_nodesc.dts diff --git a/tools/binman/test/151_x86_rom_ifwi_section.dts b/tools/binman/test/x86/rom_ifwi_section.dts index 7e455c3a4b7..7e455c3a4b7 100644 --- a/tools/binman/test/151_x86_rom_ifwi_section.dts +++ b/tools/binman/test/x86/rom_ifwi_section.dts diff --git a/tools/binman/test/031_x86_rom_me.dts b/tools/binman/test/x86/rom_me.dts index b8b0a5a74bb..b8b0a5a74bb 100644 --- a/tools/binman/test/031_x86_rom_me.dts +++ b/tools/binman/test/x86/rom_me.dts diff --git a/tools/binman/test/163_x86_rom_me_empty.dts b/tools/binman/test/x86/rom_me_empty.dts index 9349d2d7245..9349d2d7245 100644 --- a/tools/binman/test/163_x86_rom_me_empty.dts +++ b/tools/binman/test/x86/rom_me_empty.dts diff --git a/tools/binman/test/164_x86_rom_me_missing.dts b/tools/binman/test/x86/rom_me_missing.dts index dce3be5e057..dce3be5e057 100644 --- a/tools/binman/test/164_x86_rom_me_missing.dts +++ b/tools/binman/test/x86/rom_me_missing.dts diff --git a/tools/binman/test/030_x86_rom_me_no_desc.dts b/tools/binman/test/x86/rom_me_no_desc.dts index 796cb87afc7..796cb87afc7 100644 --- a/tools/binman/test/030_x86_rom_me_no_desc.dts +++ b/tools/binman/test/x86/rom_me_no_desc.dts diff --git a/tools/binman/test/035_x86_single_ucode.dts b/tools/binman/test/x86/single_ucode.dts index 2b1f086a41c..2b1f086a41c 100644 --- a/tools/binman/test/035_x86_single_ucode.dts +++ b/tools/binman/test/x86/single_ucode.dts diff --git a/tools/binman/test/033_x86_start16.dts b/tools/binman/test/x86/start16.dts index 2e279dee9d6..2e279dee9d6 100644 --- a/tools/binman/test/033_x86_start16.dts +++ b/tools/binman/test/x86/start16.dts diff --git a/tools/binman/test/048_x86_start16_spl.dts b/tools/binman/test/x86/start16_spl.dts index e2009f15f05..e2009f15f05 100644 --- a/tools/binman/test/048_x86_start16_spl.dts +++ b/tools/binman/test/x86/start16_spl.dts diff --git a/tools/binman/test/081_x86_start16_tpl.dts b/tools/binman/test/x86/start16_tpl.dts index 68e6bbd68f0..68e6bbd68f0 100644 --- a/tools/binman/test/081_x86_start16_tpl.dts +++ b/tools/binman/test/x86/start16_tpl.dts diff --git a/tools/binman/test/155_symbols_tpl_x86.dts b/tools/binman/test/x86/symbols_tpl.dts index e1ce33e67fb..e1ce33e67fb 100644 --- a/tools/binman/test/155_symbols_tpl_x86.dts +++ b/tools/binman/test/x86/symbols_tpl.dts diff --git a/tools/binman/test/093_x86_tpl_ucode.dts b/tools/binman/test/x86/tpl_ucode.dts index d7ed9fc66b8..d7ed9fc66b8 100644 --- a/tools/binman/test/093_x86_tpl_ucode.dts +++ b/tools/binman/test/x86/tpl_ucode.dts diff --git a/tools/binman/test/034_x86_ucode.dts b/tools/binman/test/x86/ucode.dts index 40725731cd3..40725731cd3 100644 --- a/tools/binman/test/034_x86_ucode.dts +++ b/tools/binman/test/x86/ucode.dts diff --git a/tools/binman/test/038_x86_ucode_missing_node.dts b/tools/binman/test/x86/ucode_missing_node.dts index 720677c9c1e..720677c9c1e 100644 --- a/tools/binman/test/038_x86_ucode_missing_node.dts +++ b/tools/binman/test/x86/ucode_missing_node.dts diff --git a/tools/binman/test/039_x86_ucode_missing_node2.dts b/tools/binman/test/x86/ucode_missing_node2.dts index 10ac086d549..10ac086d549 100644 --- a/tools/binman/test/039_x86_ucode_missing_node2.dts +++ b/tools/binman/test/x86/ucode_missing_node2.dts diff --git a/tools/binman/test/040_x86_ucode_not_in_image.dts b/tools/binman/test/x86/ucode_not_in_image.dts index 609725824a5..609725824a5 100644 --- a/tools/binman/test/040_x86_ucode_not_in_image.dts +++ b/tools/binman/test/x86/ucode_not_in_image.dts diff --git a/tools/binman/test/049_x86_ucode_spl.dts b/tools/binman/test/x86/ucode_spl.dts index 350d2c4730b..350d2c4730b 100644 --- a/tools/binman/test/049_x86_ucode_spl.dts +++ b/tools/binman/test/x86/ucode_spl.dts diff --git a/tools/binman/test/058_x86_ucode_spl_needs_retry.dts b/tools/binman/test/x86/ucode_spl_needs_retry.dts index a04adaaf7ba..a04adaaf7ba 100644 --- a/tools/binman/test/058_x86_ucode_spl_needs_retry.dts +++ b/tools/binman/test/x86/ucode_spl_needs_retry.dts diff --git a/tools/binman/test/026_pack_u_boot_dtb.dts b/tools/binman/test/xpl/pack_dtb.dts index 2707a7347a4..2707a7347a4 100644 --- a/tools/binman/test/026_pack_u_boot_dtb.dts +++ b/tools/binman/test/xpl/pack_dtb.dts diff --git a/tools/binman/test/047_spl_bss_pad.dts b/tools/binman/test/xpl/spl_bss_pad.dts index 6bd88b83f98..6bd88b83f98 100644 --- a/tools/binman/test/047_spl_bss_pad.dts +++ b/tools/binman/test/xpl/spl_bss_pad.dts diff --git a/tools/binman/test/078_u_boot_tpl.dts b/tools/binman/test/xpl/tpl.dts index 6c60b4c46f4..6c60b4c46f4 100644 --- a/tools/binman/test/078_u_boot_tpl.dts +++ b/tools/binman/test/xpl/tpl.dts diff --git a/tools/binman/test/193_tpl_bss_pad.dts b/tools/binman/test/xpl/tpl_bss_pad.dts index f5c2db0646c..f5c2db0646c 100644 --- a/tools/binman/test/193_tpl_bss_pad.dts +++ b/tools/binman/test/xpl/tpl_bss_pad.dts diff --git a/tools/binman/test/036_u_boot_img.dts b/tools/binman/test/xpl/u-boot-img.dts index aa5a3fe4810..aa5a3fe4810 100644 --- a/tools/binman/test/036_u_boot_img.dts +++ b/tools/binman/test/xpl/u-boot-img.dts diff --git a/tools/binman/test/051_u_boot_spl_dtb.dts b/tools/binman/test/xpl/u-boot-spl-dtb.dts index 3912f86b4cd..3912f86b4cd 100644 --- a/tools/binman/test/051_u_boot_spl_dtb.dts +++ b/tools/binman/test/xpl/u-boot-spl-dtb.dts diff --git a/tools/binman/test/052_u_boot_spl_nodtb.dts b/tools/binman/test/xpl/u-boot-spl-nodtb.dts index 7f4e27780fe..7f4e27780fe 100644 --- a/tools/binman/test/052_u_boot_spl_nodtb.dts +++ b/tools/binman/test/xpl/u-boot-spl-nodtb.dts diff --git a/tools/binman/test/285_spl_expand.dts b/tools/binman/test/xpl/u-boot-spl.dts index 9c88ccb287b..9c88ccb287b 100644 --- a/tools/binman/test/285_spl_expand.dts +++ b/tools/binman/test/xpl/u-boot-spl.dts diff --git a/tools/binman/test/192_u_boot_tpl_nodtb.dts b/tools/binman/test/xpl/u-boot-tpl-nodtb.dts index 94cef395e89..94cef395e89 100644 --- a/tools/binman/test/192_u_boot_tpl_nodtb.dts +++ b/tools/binman/test/xpl/u-boot-tpl-nodtb.dts diff --git a/tools/binman/test/256_u_boot_vpl_nodtb.dts b/tools/binman/test/xpl/u-boot-vpl-nodtb.dts index 055016badd5..055016badd5 100644 --- a/tools/binman/test/256_u_boot_vpl_nodtb.dts +++ b/tools/binman/test/xpl/u-boot-vpl-nodtb.dts diff --git a/tools/binman/test/255_u_boot_vpl.dts b/tools/binman/test/xpl/vpl.dts index a3a281a91e0..a3a281a91e0 100644 --- a/tools/binman/test/255_u_boot_vpl.dts +++ b/tools/binman/test/xpl/vpl.dts diff --git a/tools/binman/test/258_vpl_bss_pad.dts b/tools/binman/test/xpl/vpl_bss_pad.dts index d308dcade17..d308dcade17 100644 --- a/tools/binman/test/258_vpl_bss_pad.dts +++ b/tools/binman/test/xpl/vpl_bss_pad.dts diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 425faf380fb..49a068d91cc 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -50,6 +50,7 @@ struct env_opts default_opts = { }; #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define ROUND_UP(x, y) (DIV_ROUND_UP(x, y) * (y)) #define min(x, y) ({ \ typeof(x) _min1 = (x); \ @@ -983,9 +984,6 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) { void *data; struct erase_info_user erase; - size_t blocklen; /* length of NAND block / NOR erase sector */ - size_t erase_len; /* whole area that can be erased - may include - bad blocks */ size_t erasesize; /* erase / write length - one block on NAND, whole area on NOR */ size_t processed = 0; /* progress counter */ @@ -1004,20 +1002,21 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) * For mtd devices only offset and size of the environment do matter */ if (DEVTYPE(dev) == MTD_ABSENT) { - blocklen = count; - erase_len = blocklen; - blockstart = DEVOFFSET(dev); + erasesize = count; block_seek = 0; - write_total = blocklen; + write_total = count; } else { - blocklen = DEVESIZE(dev); - erase_offset = DEVOFFSET(dev); - /* Maximum area we may use */ - erase_len = environment_end(dev) - erase_offset; - - blockstart = erase_offset; + if (DEVTYPE(dev) == MTD_NANDFLASH) { + /* + * NAND: calculate which blocks we are writing. We have + * to write one block at a time to skip bad blocks. + */ + erasesize = DEVESIZE(dev); + } else { + erasesize = environment_end(dev) - erase_offset; + } /* Offset inside a block */ block_seek = DEVOFFSET(dev) - erase_offset; @@ -1027,8 +1026,7 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) * to the start of the data, then count bytes of data, and * to the end of the block */ - write_total = ((block_seek + count + blocklen - 1) / - blocklen) * blocklen; + write_total = ROUND_UP(block_seek + count, DEVESIZE(dev)); } /* @@ -1037,11 +1035,11 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) * block back again. */ if (write_total > count) { - data = malloc(erase_len); + data = malloc(write_total); if (!data) { fprintf(stderr, "Cannot malloc %zu bytes: %s\n", - erase_len, strerror(errno)); + write_total, strerror(errno)); return -1; } @@ -1067,24 +1065,15 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) } else { /* * We get here, iff offset is block-aligned and count is a - * multiple of blocklen - see write_total calculation above + * multiple of erase size - see write_total calculation above */ data = buf; } - if (DEVTYPE(dev) == MTD_NANDFLASH) { - /* - * NAND: calculate which blocks we are writing. We have - * to write one block at a time to skip bad blocks. - */ - erasesize = blocklen; - } else { - erasesize = erase_len; - } - erase.length = erasesize; /* This only runs once on NOR flash and SPI-dataflash */ + blockstart = DEVOFFSET(dev); while (processed < write_total) { rc = flash_bad_block(fd, DEVTYPE(dev), blockstart); if (rc < 0) /* block test failed */ @@ -1096,7 +1085,7 @@ static int flash_write_buf(int dev, int fd, void *buf, size_t count) } if (rc) { /* block is bad */ - blockstart += blocklen; + blockstart += erasesize; continue; } diff --git a/tools/fwumdata_src/Kconfig b/tools/fwumdata_src/Kconfig new file mode 100644 index 00000000000..af1f3bb3f57 --- /dev/null +++ b/tools/fwumdata_src/Kconfig @@ -0,0 +1,19 @@ +config TOOLS_MKFWUMDATA + bool "Build mkfwumdata command" + default y if FWU_MULTI_BANK_UPDATE + help + This command allows users to create a raw image of the FWU + metadata for initial installation of the FWU multi bank + update on the board. The installation method depends on + the platform. + +config TOOLS_FWUMDATA + bool "Build fwumdata command" + default y if FWU_MULTI_BANK_UPDATE + help + This command allows users to read, display, and modify FWU + (Firmware Update) metadata from Linux userspace. It provides + functionality similar to fw_printenv/fw_setenv but for FWU + metadata. Users can view metadata, change active/previous + bank indices, modify bank states, and set image acceptance + flags. Configuration is done via fwumdata.config file. diff --git a/tools/fwumdata_src/fwumdata.c b/tools/fwumdata_src/fwumdata.c new file mode 100644 index 00000000000..c5b0f56842d --- /dev/null +++ b/tools/fwumdata_src/fwumdata.c @@ -0,0 +1,854 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * FWU Metadata Read/Write Tool + * Copyright (c) 2025, Kory Maincent <[email protected]> + * + * Tool to read, display, and modify FWU (Firmware Update) metadata + * from Linux userspace. Similar to fw_printenv/fw_setenv for U-Boot + * environment, but for FWU metadata. + * + * Usage: + * fwumdata - Print all metadata + * fwumdata -u - Print metadata and update it if CRC corrupted + * fwumdata -c <config> - Use custom config file + * fwumdata -a <bank> - Set active bank + * fwumdata -p <bank> - Set previous bank + * fwumdata -s <bank> <state> - Set bank state (V2 only) + * fwumdata -i <id> -b <bank> -A - Accept image + * fwumdata -i <id> -b <bank> -C - Clear image acceptance + * fwumdata -i <id> -b <bank> + * -B <num_banks> + * -I <num_images> -C - Clear image acceptance (V1 only) + * fwumdata -l - List detailed info with GUIDs + */ + +#include <errno.h> +#include <getopt.h> +#include <stdio.h> +#include <unistd.h> +#include <mtd/mtd-user.h> +#include <sys/ioctl.h> +#include <u-boot/crc.h> +#include "fwumdata.h" + +/* Device configuration */ +struct fwumdata_device { + const char *devname; + long long devoff; + unsigned long mdata_size; + unsigned long erase_size; + int fd; + bool is_mtd; +}; + +/* Global state */ +static struct fwumdata_device devices[2]; /* Primary and secondary */ +static struct fwu_mdata *mdata; +static int have_redundant; +static struct fwu_mdata *valid_mdata; +static bool mdata_mod; +static const char *config_file; +static int nbanks, nimages; /* For V1 only */ +static const char * const default_config_files[] = { + "./fwumdata.config", + "/etc/fwumdata.config", + NULL +}; + +/* GUID/UUID utilities */ +static void guid_to_string(const struct efi_guid *guid, char *str) +{ + sprintf(str, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + guid->time_high, guid->time_low, guid->reserved, + guid->family, guid->node[0], + guid->node[1], guid->node[2], guid->node[3], + guid->node[4], guid->node[5], guid->node[6]); +} + +/* Config file parsing */ +static int parse_config(const char *fname) +{ + size_t linesize = 0; + char *line = NULL; + char *devname; + int i = 0; + FILE *fp; + int rc; + + fp = fopen(fname, "r"); + if (!fp) + return -ENOENT; + + while (i < 2 && getline(&line, &linesize, fp) != -1) { + /* Skip comments and empty lines */ + if (line[0] == '#' || line[0] == '\n') + continue; + + rc = sscanf(line, "%ms %lli %lx %lx", + &devname, + &devices[i].devoff, + &devices[i].mdata_size, + &devices[i].erase_size); + + if (rc < 3) { + free(devname); + continue; + } + + if (rc < 4) + devices[i].erase_size = devices[i].mdata_size; + + devices[i].devname = devname; + i++; + } + + free(line); + fclose(fp); + + if (i == 2) { + have_redundant = true; + if (devices[0].mdata_size != devices[1].mdata_size) { + fprintf(stderr, + "Size mismatch between the two metadata\n"); + return -EINVAL; + } + } + + if (!i) { + fprintf(stderr, + "Can't read config %s content\n", fname); + return -EINVAL; + } + + return 0; +} + +static int find_parse_config(void) +{ + int i; + + if (config_file) + return parse_config(config_file); + + for (i = 0; default_config_files[i]; i++) { + int ret; + + ret = parse_config(default_config_files[i]); + if (ret == -ENOENT) + continue; + if (ret) + return ret; + + config_file = default_config_files[i]; + return 0; + } + + fprintf(stderr, "Error: Cannot find config file\n"); + return -ENOENT; +} + +static int open_device(struct fwumdata_device *dev) +{ + if (strstr(dev->devname, "/dev/mtd")) + dev->is_mtd = true; + + dev->fd = open(dev->devname, O_RDWR | O_SYNC); + if (dev->fd < 0) { + fprintf(stderr, "Cannot open %s: %s\n", dev->devname, + strerror(errno)); + return -ENODEV; + } + + return 0; +} + +static int mtd_erase(int fd, unsigned long offset, unsigned long size) +{ + struct erase_info_user erase; + int ret; + + erase.start = offset; + erase.length = size; + + ret = ioctl(fd, MEMERASE, &erase); + if (ret < 0) { + fprintf(stderr, "MTD erase failed: %s\n", strerror(errno)); + return -errno; + } + + return 0; +} + +static int read_device(struct fwumdata_device *dev, void *buf, size_t count) +{ + if (lseek(dev->fd, dev->devoff, SEEK_SET) < 0) { + fprintf(stderr, "Seek failed: %s\n", strerror(errno)); + return -errno; + } + + if (read(dev->fd, buf, count) < 0) { + fprintf(stderr, "Read failed: %s\n", strerror(errno)); + return -errno; + } + + return 0; +} + +static int write_device(struct fwumdata_device *dev, const void *buf, + size_t count) +{ + int ret; + + /* Erase if MTD device */ + if (dev->is_mtd) { + ret = mtd_erase(dev->fd, dev->devoff, dev->erase_size); + if (ret) + return ret; + } + + if (lseek(dev->fd, dev->devoff, SEEK_SET) < 0) { + fprintf(stderr, "Seek failed: %s\n", strerror(errno)); + return -errno; + } + + if (write(dev->fd, buf, count) < 0) { + fprintf(stderr, "Write failed: %s\n", strerror(errno)); + return -errno; + } + + return 0; +} + +/* Metadata operations */ +static int validate_crc(struct fwu_mdata *mdata, size_t size) +{ + u32 calc_crc, stored_crc; + + stored_crc = mdata->crc32; + calc_crc = crc32(0, (const u8 *)&mdata->version, size - sizeof(u32)); + + if (calc_crc != stored_crc) { + fprintf(stderr, + "CRC mismatch: calculated 0x%08x, stored 0x%08x\n", + calc_crc, stored_crc); + if (mdata->version == 1) + fprintf(stderr, + "Metadata is V1, this may be size description issue\n"); + return -1; + } + + return 0; +} + +static void update_crc(struct fwu_mdata *mdata, size_t size) +{ + mdata->crc32 = crc32(0, (const u8 *)&mdata->version, size - sizeof(u32)); +} + +static int read_one_metadata(int mdata_id, size_t size) +{ + int ret; + + ret = open_device(&devices[mdata_id]); + if (ret) + return ret; + + ret = read_device(&devices[mdata_id], &mdata[mdata_id], size); + if (ret) + return ret; + + if (mdata[mdata_id].version != 1 && mdata[mdata_id].version != 2) { + fprintf(stderr, "Invalid metadata %d version: %u\n", + mdata_id, mdata[mdata_id].version); + } + + return 0; +} + +static int read_metadata(bool update) +{ + size_t alloc_size; + int ret; + + /* Allocate initial buffer */ + alloc_size = devices[0].mdata_size; + mdata = calloc(have_redundant ? 2 : 1, alloc_size); + if (!mdata) { + fprintf(stderr, "Memory allocation failed\n"); + return -ENOMEM; + } + + ret = read_one_metadata(0, alloc_size); + if (ret) + return ret; + + if (validate_crc(&mdata[0], alloc_size) < 0) { + fprintf(stderr, + "Warning: Primary metadata CRC validation failed\n"); + mdata_mod = update; + } else { + valid_mdata = &mdata[0]; + } + + if (have_redundant) { + ret = read_one_metadata(1, alloc_size); + if (ret) + return ret; + + if (validate_crc(&mdata[1], alloc_size) < 0) { + fprintf(stderr, + "Warning: Secondary metadata CRC validation failed\n"); + mdata_mod = update; + } else if (valid_mdata && mdata[0].crc32 != mdata[1].crc32) { + fprintf(stderr, + "Metadatas valid but not equal, use first one as default\n"); + mdata_mod = update; + } else { + valid_mdata = &mdata[1]; + } + } + + if (!valid_mdata) { + fprintf(stderr, + "No metadata valid, use first one as default\n"); + mdata_mod = update; + valid_mdata = &mdata[0]; + } + + if (valid_mdata->version == 2) { + struct fwu_mdata_ext *mdata_ext; + + mdata_ext = fwu_get_fw_mdata_ext(valid_mdata); + if (mdata_ext->metadata_size != alloc_size) { + fprintf(stderr, + "Metadata real size 0x%x mismatch with the config 0x%zx\n", + mdata_ext->metadata_size, alloc_size); + return -EINVAL; + } + } + + return 0; +} + +static int write_metadata(void) +{ + size_t write_size = devices[0].mdata_size; + int ret; + + if (!mdata_mod) + return 0; + + /* Update CRC */ + update_crc(valid_mdata, write_size); + + /* Write primary */ + ret = write_device(&devices[0], valid_mdata, write_size); + if (ret < 0) { + fprintf(stderr, "Failed to write primary metadata\n"); + return ret; + } + + /* Write secondary if redundant */ + if (have_redundant) { + ret = write_device(&devices[1], valid_mdata, write_size); + if (ret < 0) { + fprintf(stderr, "Failed to write secondary metadata\n"); + return -1; + } + } + + printf("FWU metadata updated successfully\n"); + mdata_mod = 0; + + return 0; +} + +/* Display functions */ +static const char *bank_state_to_string(u8 state) +{ + switch (state) { + case FWU_BANK_ACCEPTED: + return "accepted"; + case FWU_BANK_VALID: + return "valid"; + case FWU_BANK_INVALID: + return "invalid"; + default: + return "unknown"; + } +} + +static void print_metadata_summary(void) +{ + int i; + + printf("FWU Metadata:\n"); + printf("\tVersion: %u\n", valid_mdata->version); + printf("\tActive Index: %u\n", valid_mdata->active_index); + printf("\tPrevious Index: %u\n", valid_mdata->previous_active_index); + printf("\tCRC32: 0x%08x\n", valid_mdata->crc32); + + if (valid_mdata->version == 2) { + struct fwu_fw_store_desc *fw_desc; + struct fwu_mdata_ext *mdata_ext; + + mdata_ext = fwu_get_fw_mdata_ext(valid_mdata); + printf("\tMetadata Size: %u bytes\n", mdata_ext->metadata_size); + printf("\tDescriptor Offset: %u\n", mdata_ext->desc_offset); + printf("\tBank States:\n"); + + fw_desc = fwu_get_fw_desc(valid_mdata); + for (i = 0; i < fw_desc->num_banks && i < MAX_BANKS_V2; i++) { + printf("\t\tBank %d: %s (0x%02x)\n", i, + bank_state_to_string(mdata_ext->bank_state[i]), + mdata_ext->bank_state[i]); + } + } +} + +static void print_metadata_detailed(void) +{ + struct fwu_fw_store_desc *fw_desc = NULL; + struct fwu_image_bank_info *bank_info; + struct fwu_image_entry *img_entry; + int num_images, num_banks; + char guid_str[64]; + int i, j; + + print_metadata_summary(); + + if (valid_mdata->version == 1) { + num_images = nimages; + num_banks = nbanks; + } else { + fw_desc = fwu_get_fw_desc(valid_mdata); + num_images = fw_desc->num_images; + num_banks = fw_desc->num_banks; + } + + if (fw_desc) { + printf("\n\tFirmware Store Descriptor:\n"); + printf("\t\tNumber of Banks: %u\n", num_banks); + printf("\t\tNumber of Images: %u\n", num_images); + printf("\t\tImage Entry Size: %u\n", fw_desc->img_entry_size); + printf("\t\tBank Info Entry Size: %u\n", fw_desc->bank_info_entry_size); + } + + printf("\n\tImages:\n"); + for (i = 0; i < num_images; i++) { + img_entry = fwu_get_image_entry(valid_mdata, valid_mdata->version, + num_banks, i); + + printf("\t\tImage %d:\n", i); + + guid_to_string(&img_entry->image_type_guid, guid_str); + printf("\t\t\tImage Type GUID: %s\n", guid_str); + + guid_to_string(&img_entry->location_guid, guid_str); + printf("\t\t\tLocation GUID: %s\n", guid_str); + + printf("\t\t\tBanks:\n"); + for (j = 0; j < num_banks; j++) { + bank_info = fwu_get_bank_info(valid_mdata, + valid_mdata->version, + num_banks, i, j); + + guid_to_string(&bank_info->image_guid, guid_str); + printf("\t\t\t\tBank %d:\n", j); + printf("\t\t\t\t\tImage GUID: %s\n", guid_str); + printf("\t\t\t\t\tAccepted: %s (%u)\n", + (bank_info->accepted & FWU_IMAGE_ACCEPTED) ? "yes" : "no", + bank_info->accepted); + } + } +} + +/* Modification functions */ +static int set_active_index(int bank) +{ + struct fwu_fw_store_desc *fw_desc; + int num_banks; + + if (valid_mdata->version == 2) { + fw_desc = fwu_get_fw_desc(valid_mdata); + num_banks = fw_desc->num_banks; + } else { + num_banks = nbanks; + } + + if (bank < 0 || bank >= num_banks) { + fprintf(stderr, "Error: Invalid bank %d (must be 0-%d)\n", + bank, num_banks - 1); + return -EINVAL; + } + + if (valid_mdata->active_index == bank) + return 0; + + valid_mdata->active_index = bank; + mdata_mod = 1; + + printf("Active bank set to %d\n", bank); + return 0; +} + +static int set_previous_index(int bank) +{ + struct fwu_fw_store_desc *fw_desc; + int num_banks; + + if (valid_mdata->version == 2) { + fw_desc = fwu_get_fw_desc(valid_mdata); + num_banks = fw_desc->num_banks; + } else { + num_banks = nbanks; + } + + if (bank < 0 || bank >= num_banks) { + fprintf(stderr, "Error: Invalid bank %d (must be 0-%d)\n", + bank, num_banks - 1); + return -EINVAL; + } + + if (valid_mdata->previous_active_index == bank) + return 0; + + valid_mdata->previous_active_index = bank; + mdata_mod = 1; + + printf("Previous bank set to %d\n", bank); + return 0; +} + +static int set_image_accepted(int image, int bank, int accept) +{ + struct fwu_image_bank_info *bank_info; + int num_images, num_banks; + + if (valid_mdata->version == 1) { + num_images = nimages; + num_banks = nbanks; + } else { + struct fwu_fw_store_desc *fw_desc; + + fw_desc = fwu_get_fw_desc(valid_mdata); + num_images = fw_desc->num_images; + num_banks = fw_desc->num_banks; + } + + if (bank < 0 || bank >= num_banks) { + fprintf(stderr, "Error: Invalid bank %d (must be 0-%d)\n", + bank, num_banks - 1); + return -EINVAL; + } + + if (image < 0 || image >= num_images) { + fprintf(stderr, "Error: Invalid image %d (must be 0-%d)\n", + image, num_images - 1); + return -EINVAL; + } + + bank_info = fwu_get_bank_info(valid_mdata, valid_mdata->version, + num_banks, image, bank); + if (accept == bank_info->accepted) + return 0; + + if (accept) { + bank_info->accepted = FWU_IMAGE_ACCEPTED; + } else { + bank_info->accepted = 0; + + /* According to the spec: bank_state[index] have to be set + * to invalid before any content in the img_bank_info[index] + * is overwritten. + */ + if (valid_mdata->version == 2) { + struct fwu_mdata_ext *mdata_ext; + + mdata_ext = fwu_get_fw_mdata_ext(valid_mdata); + mdata_ext->bank_state[bank] = FWU_BANK_INVALID; + } + } + + mdata_mod = 1; + printf("Image %d in bank %d: acceptance %s\n", + image, bank, accept ? "set" : "cleared"); + + return 0; +} + +static int set_bank_state(int bank, const char *state_str) +{ + struct fwu_fw_store_desc *fw_desc; + struct fwu_mdata_ext *mdata_ext; + u8 state; + int i; + + if (valid_mdata->version != 2) { + fprintf(stderr, + "Error: Bank state is only supported in V2 metadata\n"); + return -EINVAL; + } + + fw_desc = fwu_get_fw_desc(valid_mdata); + mdata_ext = fwu_get_fw_mdata_ext(valid_mdata); + + if (bank < 0 || bank >= fw_desc->num_banks || bank >= MAX_BANKS_V2) { + fprintf(stderr, "Error: Invalid bank %d (must be 0-%d)\n", + bank, fw_desc->num_banks - 1); + return -EINVAL; + } + + /* Parse state string */ + if (!strcmp(state_str, "accepted")) { + state = FWU_BANK_ACCEPTED; + } else if (!strcmp(state_str, "valid")) { + state = FWU_BANK_VALID; + } else if (!strcmp(state_str, "invalid")) { + state = FWU_BANK_INVALID; + } else { + fprintf(stderr, + "Error: Invalid state '%s' (must be accepted/valid/invalid)\n", + state_str); + return -EINVAL; + } + + if (mdata_ext->bank_state[bank] == state) + return 0; + + /* If a bank is set in a accepted state all firmware images in + * that bank must be marked as accepted as described in the spec. + */ + if (state == FWU_BANK_ACCEPTED) { + for (i = 0; i < fw_desc->num_images; i++) { + int ret; + + ret = set_image_accepted(i, bank, true); + if (ret) + return ret; + } + } + mdata_ext->bank_state[bank] = state; + mdata_mod = 1; + + printf("Bank %d state set to %s (0x%02x)\n", bank, state_str, state); + return 0; +} + +static int metadata_v1_validate_size(void) +{ + int calc_size; + + calc_size = sizeof(struct fwu_mdata) + + (sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * nbanks) * nimages; + + if (devices[0].mdata_size != calc_size) { + fprintf(stderr, + "Metadata calculate size (-B and -I options) 0x%x mismatch with the config 0x%zx\n", + calc_size, devices[0].mdata_size); + return -EINVAL; + } + + return 0; +} + +/* Command-line interface */ +static void print_usage(void) +{ + fprintf(stderr, "Usage: fwumdata [options]\n\n"); + fprintf(stderr, "Options:\n" + "\t-c, --config <file> Use custom config file, defaults:\n" + "\t ./fwumdata.config or /etc/fwumdata.config\n" + "\t-l, --list List detailed metadata with GUIDs\n" + "\t-a, --active <bank> Set active bank index\n" + "\t-p, --previous <bank> Set previous bank index\n" + "\t-s, --state <bank> <state> Set bank state (V2 only)\n" + "\t state: accepted|valid|invalid\n" + "\t-i, --image <id> Image number (for -A/-C)\n" + "\t-b, --bank <bank> Bank number (for -A/-C)\n" + "\t-A, --accept Accept image (requires -i and -b)\n" + "\t-C, --clear Clear image acceptance (requires -i and -b)\n" + "\t-u, --update Update metadata if there is a checksum issue\n" + "\t-B, --nbanks <num_banks> Number of banks (required for V1 metadata)\n" + "\t-I, --nimages <num_images> Number of images (required for V1 metadata)\n" + "\t-h, --help Print this help\n\n"); + fprintf(stderr, "Config file format (fwumdata.config):\n" + "\t# Device Name Device Offset Metadata Size Erase Size\n" + "\t/dev/mtd0 0x0 0x78 0x1000\n" + "\t/dev/mtd1 0x0 0x78 0x1000\n\n"); + fprintf(stderr, "Examples:\n" + "\tfwumdata # Print metadata summary\n" + "\tfwumdata -l # Print detailed metadata\n" + "\tfwumdata -a 1 # Set active bank to 1\n" + "\tfwumdata -s 1 accepted # Set bank 1 to accepted state\n" + "\tfwumdata -i 0 -b 0 -A # Accept image in bank 0\n" + "\tfwumdata -B 2 -I 2 -i 1 -b 1 -A -l # Accept image 1 in bank 1 with metadata V1\n"); +} + +int main(int argc, char *argv[]) +{ + char *bank_state_str = NULL; + bool list_detailed = false; + int bank_state_num = -1; + int active_index = -1; + int bank_id = -1; + int prev_index = -1; + bool do_accept = 0; + bool do_clear = 0; + bool do_update = 0; + int image_id = -1; + int ret = 0; + int opt; + + static struct option long_options[] = { + {"config", required_argument, 0, 'c'}, + {"list", no_argument, 0, 'l'}, + {"active", required_argument, 0, 'a'}, + {"previous", required_argument, 0, 'p'}, + {"state", required_argument, 0, 's'}, + {"image", required_argument, 0, 'i'}, + {"bank", required_argument, 0, 'b'}, + {"accept", no_argument, 0, 'A'}, + {"clear", no_argument, 0, 'C'}, + {"update", no_argument, 0, 'u'}, + {"nbanks", required_argument, 0, 'B'}, + {"nimages", required_argument, 0, 'I'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + + /* Parse arguments */ + while ((opt = getopt_long(argc, argv, "c:la:p:s:i:b:ACuB:I:h", long_options, NULL)) != -1) { + switch (opt) { + case 'c': + config_file = optarg; + break; + case 'l': + list_detailed = 1; + break; + case 'a': + active_index = atoi(optarg); + break; + case 'p': + prev_index = atoi(optarg); + break; + case 's': + bank_state_num = atoi(optarg); + if (optind < argc && argv[optind][0] != '-') { + bank_state_str = argv[optind++]; + } else { + fprintf(stderr, + "Error: -s requires bank number and state\n"); + return 1; + } + break; + case 'i': + image_id = atoi(optarg); + break; + case 'b': + bank_id = atoi(optarg); + break; + case 'A': + do_accept = 1; + break; + case 'C': + do_clear = 1; + break; + case 'u': + do_update = 1; + break; + case 'B': + nbanks = atoi(optarg); + break; + case 'I': + nimages = atoi(optarg); + break; + case 'h': + print_usage(); + return 0; + default: + print_usage(); + return 1; + } + } + + ret = find_parse_config(); + if (ret < 0) { + fprintf(stderr, "Error: Cannot read configuration\n"); + return ret; + } + + ret = read_metadata(do_update); + if (ret < 0) { + fprintf(stderr, "Error: Cannot read metadata\n"); + goto cleanup; + } + + if (valid_mdata->version == 1) { + ret = metadata_v1_validate_size(); + if (ret) + goto cleanup; + } + + /* Perform operations */ + if (active_index >= 0) { + ret = set_active_index(active_index); + if (ret < 0) + goto cleanup; + } + + if (prev_index >= 0) { + ret = set_previous_index(prev_index); + if (ret < 0) + goto cleanup; + } + + if (do_accept || do_clear) { + if (image_id < 0 || bank_id < 0) { + fprintf(stderr, + "Error: -A/-C requires both -i <guid> and -b <bank>\n"); + ret = -EINVAL; + goto cleanup; + } + + ret = set_image_accepted(image_id, bank_id, do_accept); + if (ret < 0) + goto cleanup; + } + + if (bank_state_num >= 0 && bank_state_str) { + ret = set_bank_state(bank_state_num, bank_state_str); + if (ret < 0) + goto cleanup; + } + + /* Write back if modified */ + if (mdata_mod) { + ret = write_metadata(); + if (ret) + goto cleanup; + } + + /* Display metadata if no modifications or list requested */ + if (list_detailed) + print_metadata_detailed(); + else + print_metadata_summary(); + +cleanup: + /* Close devices and free memory */ + if (devices[0].fd) + close(devices[0].fd); + if (devices[1].fd) + close(devices[1].fd); + + free(mdata); + + for (int i = 0; i < 2; i++) { + if (devices[i].devname) + free((void *)devices[i].devname); + } + + return ret; +} diff --git a/tools/fwumdata_src/fwumdata.config b/tools/fwumdata_src/fwumdata.config new file mode 100644 index 00000000000..7e83f7a5909 --- /dev/null +++ b/tools/fwumdata_src/fwumdata.config @@ -0,0 +1,33 @@ +# FWU Metadata Configuration File +# +# Format: <device> <offset> <metadata_size> <erase_size> +# +# This file describes where the FWU metadata is stored. You can specify +# up to two entries for redundant metadata copies. +# +# Device: MTD device (/dev/mtdX), block device (/dev/mmcblkX), or file path +# Offset: Byte offset from start of device (hex with 0x prefix) +# Metadata Size: Size of metadata structure in bytes (hex with 0x prefix) +# Erase Size: Sector/erase block size (hex with 0x prefix, defaults to +# metadata_size, required only for MTD device) +# +# Examples: +# +# MTD devices (NOR/NAND flash): +# /dev/mtd0 0x0 0x1000 0x1000 +# /dev/mtd1 0x0 0x1000 0x1000 +# +# Block device (eMMC/SD): +# /dev/mmcblk0 0x100000 0x78 +# /dev/mmcblk0 0x101000 0x78 +# +# or: +# /dev/disk/by-partlabel/metadata1 0 0x78 +# /dev/disk/by-partlabel/metadata2 0 0x78 +# +# Regular file: +# /boot/fwu-mdata.bin 0x0 0x78 +# +# Default configuration (update for your platform): +/dev/mtd0 0x0 0x78 0x1000 +/dev/mtd1 0x0 0x78 0x1000 diff --git a/tools/fwumdata_src/fwumdata.h b/tools/fwumdata_src/fwumdata.h new file mode 100644 index 00000000000..5e2c45d0fb0 --- /dev/null +++ b/tools/fwumdata_src/fwumdata.h @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2025, Kory Maincent <[email protected]> + */ + +#ifndef _FWUMDATA_H_ +#define _FWUMDATA_H_ + +#include <linux/compiler_attributes.h> + +/* Type definitions for U-Boot compatibility */ +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +/* FWU Constants */ +#define FWU_IMAGE_ACCEPTED 0x1 +#define FWU_BANK_INVALID (uint8_t)0xFF +#define FWU_BANK_VALID (uint8_t)0xFE +#define FWU_BANK_ACCEPTED (uint8_t)0xFC +#define MAX_BANKS_V2 4 + +/* EFI GUID structure */ +struct efi_guid { + u32 time_high; + u16 time_low; + u16 reserved; + u8 family; + u8 node[7]; +} __packed; + +/* FWU Metadata structures */ +struct fwu_image_bank_info { + struct efi_guid image_guid; + u32 accepted; + u32 reserved; +} __packed; + +struct fwu_image_entry { + struct efi_guid image_type_guid; + struct efi_guid location_guid; + struct fwu_image_bank_info img_bank_info[0]; /* Variable length */ +} __packed; + +struct fwu_fw_store_desc { + u8 num_banks; + u8 reserved; + u16 num_images; + u16 img_entry_size; + u16 bank_info_entry_size; + struct fwu_image_entry img_entry[0]; /* Variable length */ +} __packed; + +struct fwu_mdata { + u32 crc32; + u32 version; + u32 active_index; + u32 previous_active_index; + /* Followed by image entries or fwu_mdata_ext */ +} __packed; + +struct fwu_mdata_ext { /* V2 only */ + u32 metadata_size; + u16 desc_offset; + u16 reserved1; + u8 bank_state[4]; + u32 reserved2; +} __packed; + +/* Metadata access helpers */ +struct fwu_image_entry *fwu_get_image_entry(struct fwu_mdata *mdata, + int version, int num_banks, + int img_id) +{ + size_t offset; + + if (version == 1) { + offset = sizeof(struct fwu_mdata) + + (sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * num_banks) * img_id; + } else { + /* V2: skip fwu_fw_store_desc header */ + offset = sizeof(struct fwu_mdata) + + sizeof(struct fwu_mdata_ext) + + sizeof(struct fwu_fw_store_desc) + + (sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * num_banks) * img_id; + } + + return (struct fwu_image_entry *)((char *)mdata + offset); +} + +struct fwu_image_bank_info *fwu_get_bank_info(struct fwu_mdata *mdata, + int version, int num_banks, + int img_id, int bank_id) +{ + size_t offset; + + if (version == 1) { + offset = sizeof(struct fwu_mdata) + + (sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * num_banks) * img_id + + sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * bank_id; + } else { + offset = sizeof(struct fwu_mdata) + + sizeof(struct fwu_mdata_ext) + + sizeof(struct fwu_fw_store_desc) + + (sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * num_banks) * img_id + + sizeof(struct fwu_image_entry) + + sizeof(struct fwu_image_bank_info) * bank_id; + } + + return (struct fwu_image_bank_info *)((char *)mdata + offset); +} + +struct fwu_fw_store_desc *fwu_get_fw_desc(struct fwu_mdata *mdata) +{ + size_t offset; + + offset = sizeof(struct fwu_mdata) + + sizeof(struct fwu_mdata_ext); + + return (struct fwu_fw_store_desc *)((char *)mdata + offset); +} + +struct fwu_mdata_ext *fwu_get_fw_mdata_ext(struct fwu_mdata *mdata) +{ + size_t offset; + + offset = sizeof(struct fwu_mdata); + + return (struct fwu_mdata_ext *)((char *)mdata + offset); +} + +#endif /* _FWUMDATA_H_ */ diff --git a/tools/fwumdata_src/fwumdata.mk b/tools/fwumdata_src/fwumdata.mk new file mode 100644 index 00000000000..e91d72bf3e8 --- /dev/null +++ b/tools/fwumdata_src/fwumdata.mk @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2025, Kory Maincent <[email protected]> + +mkfwumdata-objs := fwumdata_src/mkfwumdata.o generated/lib/crc32.o +HOSTLDLIBS_mkfwumdata += -luuid +hostprogs-always-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata + +fwumdata-objs := fwumdata_src/fwumdata.o generated/lib/crc32.o +hostprogs-always-$(CONFIG_TOOLS_FWUMDATA) += fwumdata diff --git a/tools/mkfwumdata.c b/tools/fwumdata_src/mkfwumdata.c index fbc2067bc12..b8b60473b91 100644 --- a/tools/mkfwumdata.c +++ b/tools/fwumdata_src/mkfwumdata.c @@ -17,26 +17,7 @@ #include <u-boot/crc.h> #include <uuid/uuid.h> -typedef uint8_t u8; -typedef int16_t s16; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; - -#undef CONFIG_FWU_NUM_BANKS -#undef CONFIG_FWU_NUM_IMAGES_PER_BANK - -/* This will dynamically allocate the fwu_mdata */ -#define CONFIG_FWU_NUM_BANKS 0 -#define CONFIG_FWU_NUM_IMAGES_PER_BANK 0 - -/* version 2 supports maximum of 4 banks */ -#define MAX_BANKS_V2 4 - -#define BANK_INVALID (u8)0xFF -#define BANK_ACCEPTED (u8)0xFC - -#include <fwu_mdata.h> +#include "fwumdata.h" static const char *opts_short = "b:i:a:p:v:V:gh"; @@ -116,6 +97,7 @@ static struct fwu_mdata_object *fwu_alloc_mdata(size_t images, size_t banks, sizeof(struct fwu_image_bank_info) * banks) * images; } else { mobj->size = sizeof(struct fwu_mdata) + + sizeof(struct fwu_mdata_ext) + sizeof(struct fwu_fw_store_desc) + (sizeof(struct fwu_image_entry) + sizeof(struct fwu_image_bank_info) * banks) * images; @@ -146,50 +128,6 @@ alloc_err: return NULL; } -static struct fwu_image_entry * -fwu_get_image(struct fwu_mdata_object *mobj, size_t idx) -{ - size_t offset; - - if (mobj->version == 1) { - offset = sizeof(struct fwu_mdata) + - (sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * mobj->banks) * - idx; - } else { - offset = sizeof(struct fwu_mdata) + - sizeof(struct fwu_fw_store_desc) + - (sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * mobj->banks) * - idx; - } - - return (struct fwu_image_entry *)((char *)mobj->mdata + offset); -} - -static struct fwu_image_bank_info * -fwu_get_bank(struct fwu_mdata_object *mobj, size_t img_idx, size_t bnk_idx) -{ - size_t offset; - - if (mobj->version == 1) { - offset = sizeof(struct fwu_mdata) + - (sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * mobj->banks) * - img_idx + sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * bnk_idx; - } else { - offset = sizeof(struct fwu_mdata) + - sizeof(struct fwu_fw_store_desc) + - (sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * mobj->banks) * - img_idx + sizeof(struct fwu_image_entry) + - sizeof(struct fwu_image_bank_info) * bnk_idx; - } - - return (struct fwu_image_bank_info *)((char *)mobj->mdata + offset); -} - /** * convert_uuid_to_guid() - convert UUID to GUID * @buf: UUID binary @@ -239,11 +177,13 @@ static int fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj, size_t idx, char *uuids) { - struct fwu_image_entry *image = fwu_get_image(mobj, idx); struct fwu_image_bank_info *bank; + struct fwu_image_entry *image; char *p = uuids, *uuid; int i; + image = fwu_get_image_entry(mobj->mdata, mobj->version, + mobj->banks, idx); if (!image) return -ENOENT; @@ -266,7 +206,8 @@ fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj, /* Fill bank image-UUID */ for (i = 0; i < mobj->banks; i++) { - bank = fwu_get_bank(mobj, idx, i); + bank = fwu_get_bank_info(mobj->mdata, mobj->version, + mobj->banks, idx, i); if (!bank) return -ENOENT; bank->accepted = 1; @@ -281,25 +222,22 @@ fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj, return 0; } -#if defined(CONFIG_FWU_MDATA_V1) -static void fwu_fill_version_specific_mdata(struct fwu_mdata_object *mobj) -{ -} -#else static void fwu_fill_version_specific_mdata(struct fwu_mdata_object *mobj) { int i; struct fwu_fw_store_desc *fw_desc; - struct fwu_mdata *mdata = mobj->mdata; + struct fwu_mdata_ext *mdata_ext; - mdata->metadata_size = mobj->size; - mdata->desc_offset = sizeof(struct fwu_mdata); + mdata_ext = fwu_get_fw_mdata_ext(mobj->mdata); + mdata_ext->metadata_size = mobj->size; + mdata_ext->desc_offset = sizeof(struct fwu_mdata) + + sizeof(struct fwu_mdata_ext); for (i = 0; i < MAX_BANKS_V2; i++) - mdata->bank_state[i] = i < mobj->banks ? - BANK_ACCEPTED : BANK_INVALID; + mdata_ext->bank_state[i] = i < mobj->banks ? + FWU_BANK_ACCEPTED : FWU_BANK_INVALID; - fw_desc = (struct fwu_fw_store_desc *)((u8 *)mdata + sizeof(*mdata)); + fw_desc = fwu_get_fw_desc(mobj->mdata); fw_desc->num_banks = mobj->banks; fw_desc->num_images = mobj->images; fw_desc->img_entry_size = sizeof(struct fwu_image_entry) + @@ -307,7 +245,6 @@ static void fwu_fill_version_specific_mdata(struct fwu_mdata_object *mobj) fw_desc->bank_info_entry_size = sizeof(struct fwu_image_bank_info); } -#endif /* CONFIG_FWU_MDATA_V1 */ /* Caller must ensure that @uuids[] has @mobj->images entries. */ static int fwu_parse_fill_uuids(struct fwu_mdata_object *mobj, char *uuids[]) @@ -320,7 +257,8 @@ static int fwu_parse_fill_uuids(struct fwu_mdata_object *mobj, char *uuids[]) mdata->active_index = active_bank; mdata->previous_active_index = previous_bank; - fwu_fill_version_specific_mdata(mobj); + if (mdata->version == 2) + fwu_fill_version_specific_mdata(mobj); for (i = 0; i < mobj->images; i++) { ret = fwu_parse_fill_image_uuid(mobj, i, uuids[i]); @@ -471,9 +409,17 @@ int main(int argc, char *argv[]) return -EINVAL; } + if (version == 2 && banks > MAX_BANKS_V2) { + fprintf(stderr, "Error: Version 2 supports maximum %d banks, %ld requested.\n", + MAX_BANKS_V2, banks); + return -EINVAL; + } + /* This command takes UUIDs * images and output file. */ if (optind + images + 1 != argc) { - fprintf(stderr, "Error: UUID list or output file is not specified or too much.\n"); + fprintf(stderr, + "Error: Expected %ld UUID string(s) and 1 output file, got %d argument(s).\n", + images, argc - optind); print_usage(); return -ERANGE; } diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 0f41cdb64f5..ec640c57e8a 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -56,6 +56,7 @@ static struct option options[] = { {"fw-revert", no_argument, NULL, 'R'}, {"capoemflag", required_argument, NULL, 'o'}, {"dump-capsule", no_argument, NULL, 'D'}, + {"dump-sig", no_argument, NULL, 'd'}, {"help", no_argument, NULL, 'h'}, {NULL, 0, NULL, 0}, }; @@ -83,7 +84,7 @@ static void print_usage_mkeficapsule(void) "\t-p, --private-key <privkey file> private key file\n" "\t-c, --certificate <cert file> signer's certificate file\n" "\t-m, --monotonic-count <count> monotonic count\n" - "\t-d, --dump_sig dump signature (*.p7)\n" + "\t-d, --dump-sig dump signature to <output file>.p7\n" "\t-A, --fw-accept firmware accept capsule, requires GUID, no image blob\n" "\t-R, --fw-revert firmware revert capsule, takes no GUID, no image blob\n" "\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n" @@ -228,21 +229,54 @@ static int create_auth_data(struct auth_context *ctx) gnutls_pkcs7_t pkcs7; gnutls_datum_t data; gnutls_datum_t signature; + gnutls_pkcs11_obj_t *obj_list; + unsigned int obj_list_size = 0; + const char *lib; int ret; + bool pkcs11_cert = false; + bool pkcs11_key = false; - ret = read_bin_file(ctx->cert_file, &cert.data, &file_size); - if (ret < 0) - return -1; - if (file_size > UINT_MAX) - return -1; - cert.size = file_size; + if (!strncmp(ctx->cert_file, "pkcs11:", strlen("pkcs11:"))) + pkcs11_cert = true; - ret = read_bin_file(ctx->key_file, &key.data, &file_size); - if (ret < 0) - return -1; - if (file_size > UINT_MAX) - return -1; - key.size = file_size; + if (!strncmp(ctx->key_file, "pkcs11:", strlen("pkcs11:"))) + pkcs11_key = true; + + if (pkcs11_cert || pkcs11_key) { + lib = getenv("PKCS11_MODULE_PATH"); + if (!lib) { + fprintf(stdout, + "PKCS11_MODULE_PATH not set in the environment\n"); + return -1; + } + + gnutls_pkcs11_init(GNUTLS_PKCS11_FLAG_MANUAL, NULL); + gnutls_global_init(); + + ret = gnutls_pkcs11_add_provider(lib, "trusted"); + if (ret < 0) { + fprintf(stdout, "Failed to add pkcs11 provider\n"); + return -1; + } + } + + if (!pkcs11_cert) { + ret = read_bin_file(ctx->cert_file, &cert.data, &file_size); + if (ret < 0) + return -1; + if (file_size > UINT_MAX) + return -1; + cert.size = file_size; + } + + if (!pkcs11_key) { + ret = read_bin_file(ctx->key_file, &key.data, &file_size); + if (ret < 0) + return -1; + if (file_size > UINT_MAX) + return -1; + key.size = file_size; + } /* * For debugging, @@ -265,22 +299,42 @@ static int create_auth_data(struct auth_context *ctx) return -1; } - /* load a private key */ - ret = gnutls_privkey_import_x509_raw(pkey, &key, GNUTLS_X509_FMT_PEM, - 0, 0); - if (ret < 0) { - fprintf(stderr, - "error in gnutls_privkey_import_x509_raw(): %s\n", - gnutls_strerror(ret)); - return -1; + /* load x509 certificate */ + if (pkcs11_cert) { + ret = gnutls_pkcs11_obj_list_import_url4(&obj_list, &obj_list_size, + ctx->cert_file, 0); + if (ret < 0 || obj_list_size == 0) { + fprintf(stdout, "Failed to import crt_file URI objects\n"); + return -1; + } + + gnutls_x509_crt_import_pkcs11(x509, obj_list[0]); + } else { + ret = gnutls_x509_crt_import(x509, &cert, GNUTLS_X509_FMT_PEM); + if (ret < 0) { + fprintf(stderr, "error in gnutls_x509_crt_import(): %s\n", + gnutls_strerror(ret)); + return -1; + } } - /* load x509 certificate */ - ret = gnutls_x509_crt_import(x509, &cert, GNUTLS_X509_FMT_PEM); - if (ret < 0) { - fprintf(stderr, "error in gnutls_x509_crt_import(): %s\n", - gnutls_strerror(ret)); - return -1; + /* load a private key */ + if (pkcs11_key) { + ret = gnutls_privkey_import_pkcs11_url(pkey, ctx->key_file); + if (ret < 0) { + fprintf(stderr, "error in %d: %s\n", __LINE__, + gnutls_strerror(ret)); + return -1; + } + } else { + ret = gnutls_privkey_import_x509_raw(pkey, &key, GNUTLS_X509_FMT_PEM, + 0, 0); + if (ret < 0) { + fprintf(stderr, + "error in gnutls_privkey_import_x509_raw(): %s\n", + gnutls_strerror(ret)); + return -1; + } } /* generate a PKCS #7 structure */ @@ -349,6 +403,11 @@ static int create_auth_data(struct auth_context *ctx) * gnutls_free(signature.data); */ + if (pkcs11_cert || pkcs11_key) { + gnutls_global_deinit(); + gnutls_pkcs11_deinit(); + } + return 0; } diff --git a/tools/rkcommon.c b/tools/rkcommon.c index e7e78ef7e5b..cb2d30bfd57 100644 --- a/tools/rkcommon.c +++ b/tools/rkcommon.c @@ -148,12 +148,13 @@ static struct spl_info spl_infos[] = { { "rk3328", "RK32", 0x8000 - 0x800, false, RK_HEADER_V1 }, { "rk3368", "RK33", 0x8000 - 0x1000, false, RK_HEADER_V1 }, { "rk3399", "RK33", 0x30000 - 0x2000, false, RK_HEADER_V1 }, - { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 }, - { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 }, + { "rk3506", "RK35", 0xC000 - 0x1000, false, RK_HEADER_V2 }, { "rk3528", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 }, { "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 }, { "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 }, { "rk3588", "RK35", 0x100000 - 0x1000, false, RK_HEADER_V2 }, + { "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 }, + { "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 }, }; /** diff --git a/tools/u_boot_pylib/test_util.py b/tools/u_boot_pylib/test_util.py index d258a1935c9..364596d7a0c 100644 --- a/tools/u_boot_pylib/test_util.py +++ b/tools/u_boot_pylib/test_util.py @@ -24,7 +24,7 @@ except: def run_test_coverage(prog, filter_fname, exclude_list, build_dir, required=None, extra_args=None, single_thread='-P1', - args=None, allow_failures=None): + args=None): """Run tests and check that we get 100% coverage Args: @@ -95,19 +95,6 @@ def run_test_coverage(prog, filter_fname, exclude_list, build_dir, print('Coverage error: %s, but should be 100%%' % coverage) ok = False if not ok: - if allow_failures: - # for line in lines: - # print('.', line, re.match(r'^(tools/.*py) *\d+ *(\d+) *(\d+)%$', line)) - lines = [re.match(r'^(tools/.*py) *\d+ *(\d+) *\d+%$', line) - for line in stdout.splitlines()] - bad = [] - for mat in lines: - if mat and mat.group(2) != '0': - fname = mat.group(1) - if fname not in allow_failures: - bad.append(fname) - if not bad: - return raise ValueError('Test coverage failure') |
