[PATCH v3 00/19] binman: Simple templating feature and mkimage conversion

Jan Kiszka jan.kiszka at siemens.com
Mon Jul 10 07:21:06 CEST 2023


On 10.07.23 04:40, Simon Glass wrote:
> This series converts the mkimage entry type to be a section, i.e. based on
> the entry_Section class. This makes it more consistent in its behaviour,
> e.g. allowing symbol writing and expanded entries.
> 
> A simple templating feature is also introduced, to reduce duplication
> when a set of entries must be used in multiple images.
> 
> In this version the nodes from the template are placed before any other
> nodes, meaning that the template sets the node order. This seems more
> consistent than other mechanisms.
> 
> Changes in v3:
> - Add new patch for elf to return number of written symbols
> - Add new patch with more detail on how ObtainContents() works
> - Fix up some tests which now need SPL and TPL
> - Avoid calling ObtainContents() when not needed
> - Fix 'specific' typo
> - Add a new devicetree file especially for node copying
> - Correct logic for merging nodes in order
> - Tidy up some comments
> - Adjust to use the new example file
> - Drop duplicate dts-v1 header
> - Add new test case for templating in a FIT
> - Add new patch to support writing symbols inside a mkimage image
> 
> Changes in v2:
> - Drop now-unnecessary methods in mkimage etype
> - Correct ordering of template nodes
> - Fix 'preseverd' and 'inserter' typos
> 
> Marek Vasut (1):
>   binman: Convert mkimage to Entry_section
> 
> Simon Glass (18):
>   binman: Correct coverage gap in control
>   binman: Init align_default in entry_Section
>   binman: Use GetEntries() to obtain section contents
>   binman: Read _multiple_data_files in the correct place
>   binman: Allow disabling symbol writing
>   stm32mp15: Avoid writing symbols in SPL
>   binman: Update elf to return number of written symbols
>   binman: Add more detail on how ObtainContents() works
>   binman: Provide a way to specify the fdt-list directly
>   binman: Drop __bss_size variable in bss_data.c
>   binman: Correct handling of zero bss size
>   dtoc: Support copying the contents of a node into another
>   dtoc: Allow inserting a list of nodes into another
>   binman: Support simple templates
>   binman: Support templating with multiple images
>   binman: Add a test for templating in a FIT
>   binman: Support templates at any level
>   binman: Support writing symbols inside a mkimage image
> 
>  arch/arm/dts/stm32mp15-u-boot.dtsi         |   1 +
>  tools/binman/binman.rst                    |  89 +++++++++
>  tools/binman/control.py                    |  34 +++-
>  tools/binman/elf.py                        |  13 +-
>  tools/binman/elf_test.py                   |  13 +-
>  tools/binman/entries.rst                   |   6 +
>  tools/binman/entry.py                      |  11 +-
>  tools/binman/etype/blob_phase.py           |   5 +
>  tools/binman/etype/fit.py                  |   9 +
>  tools/binman/etype/mkimage.py              | 110 ++++++++---
>  tools/binman/etype/section.py              |  54 +++--
>  tools/binman/etype/u_boot_spl_bss_pad.py   |   2 +-
>  tools/binman/etype/u_boot_tpl_bss_pad.py   |   2 +-
>  tools/binman/etype/u_boot_vpl_bss_pad.py   |   2 +-
>  tools/binman/ftest.py                      | 218 ++++++++++++++++++++-
>  tools/binman/test/282_symbols_disable.dts  |  25 +++
>  tools/binman/test/283_mkimage_special.dts  |  24 +++
>  tools/binman/test/284_fit_fdt_list.dts     |  58 ++++++
>  tools/binman/test/285_spl_expand.dts       |  13 ++
>  tools/binman/test/286_template.dts         |  42 ++++
>  tools/binman/test/287_template_multi.dts   |  27 +++
>  tools/binman/test/288_template_fit.dts     |  37 ++++
>  tools/binman/test/289_template_section.dts |  52 +++++
>  tools/binman/test/290_mkimage_sym.dts      |  27 +++
>  tools/binman/test/Makefile                 |   5 +-
>  tools/binman/test/bss_data.c               |   3 +-
>  tools/binman/test/bss_data_zero.c          |  16 ++
>  tools/binman/test/bss_data_zero.lds        |  15 ++
>  tools/binman/test/embed_data.lds           |   1 +
>  tools/dtoc/fdt.py                          | 122 +++++++++++-
>  tools/dtoc/test/dtoc_test_copy.dts         |  86 ++++++++
>  tools/dtoc/test_fdt.py                     |  93 +++++++++
>  32 files changed, 1147 insertions(+), 68 deletions(-)
>  create mode 100644 tools/binman/test/282_symbols_disable.dts
>  create mode 100644 tools/binman/test/283_mkimage_special.dts
>  create mode 100644 tools/binman/test/284_fit_fdt_list.dts
>  create mode 100644 tools/binman/test/285_spl_expand.dts
>  create mode 100644 tools/binman/test/286_template.dts
>  create mode 100644 tools/binman/test/287_template_multi.dts
>  create mode 100644 tools/binman/test/288_template_fit.dts
>  create mode 100644 tools/binman/test/289_template_section.dts
>  create mode 100644 tools/binman/test/290_mkimage_sym.dts
>  create mode 100644 tools/binman/test/bss_data_zero.c
>  create mode 100644 tools/binman/test/bss_data_zero.lds
>  create mode 100644 tools/dtoc/test/dtoc_test_copy.dts
> 

Works much better!

What does not work yet:

/dts-v1/;

/ {
	binman: binman {
		multiple-images;

		my_template: template {
			size = <0x100>;
			pad-byte = <0xff>;

			blob at 0 {
				filename = "my-blob.bin";
			};
		};

		image {
			filename = "my-image.bin";
			insert-template = <&my_template>;
		};
	};
};

The properties size and pad-byte get lost in this case.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux



More information about the U-Boot mailing list