[PATCH v2 0/6] binman: Template fixes and improvements

Simon Glass sjg at chromium.org
Sun Jul 23 05:43:51 CEST 2023

With the basic template feature in place, some problems have come to

Firstly, keeping the template around while processing entries seems
unnecessary and perhaps confusing, so this is removed.

Secondly this series aims to support phandles in a more intuitive way,
rather than just ignoring them in templates. It includes an experimental
patch to copy phandles from template so that it is possible to so
something like:

   template {
      some_node: some-node {

   image {
      insert-template = <&template>;

with the some_node phandle being copied to the 'image' node, to result in:

   image {
      insert-template = <&template>;

      some_node: some-node {

Changes in v2:
- Use a 'done' variable to reduce code duplication
- Handle phandle copying property and report duplicates
- Refine support for phandles to deal with duplicates
- Add a test that deals with duplicate phandles

Simon Glass (6):
  binman: Produce a template-file after processing
  dtoc: Make properties dirty when purging them
  dtoc: Add some debugging when copying nodes
  fdt: Allow copying phandles into templates
  binman: Remove templates after use
  binman: Support templates containing phandles

 tools/binman/binman.rst                       | 26 +++++++-
 tools/binman/control.py                       | 32 ++++++++-
 tools/binman/ftest.py                         | 43 ++++++++++++
 tools/binman/test/291_template_phandle.dts    | 51 +++++++++++++++
 .../binman/test/292_template_phandle_dup.dts  | 65 +++++++++++++++++++
 tools/dtoc/fdt.py                             | 34 +++++++---
 tools/dtoc/test/dtoc_test_copy.dts            |  6 +-
 tools/dtoc/test_fdt.py                        | 40 +++++++++---
 8 files changed, 274 insertions(+), 23 deletions(-)
 create mode 100644 tools/binman/test/291_template_phandle.dts
 create mode 100644 tools/binman/test/292_template_phandle_dup.dts


More information about the U-Boot mailing list