[RFC PATCH 00/77] Add support for dtb metadata and addon device-trees

Herve Codina posted 77 patches 3 weeks, 5 days ago
Makefile                                      |    5 +
checks.c                                      |  135 +-
data.c                                        |    3 +-
dtc-lexer.l                                   |   37 +
dtc-parser.y                                  |  307 +++-
dtc.c                                         |   64 +-
dtc.h                                         |   72 +-
fdtaddon.c                                    |  197 ++
fdtdump.c                                     |  114 +-
flattree.c                                    |  396 +++-
fstree.c                                      |    5 +-
libfdt/Makefile.libfdt                        |    2 +-
libfdt/fdt.c                                  |  152 +-
libfdt/fdt.h                                  |   15 +
libfdt/fdt_addon.c                            | 1636 +++++++++++++++++
libfdt/fdt_ro.c                               |   12 +
libfdt/fdt_rw.c                               |  102 +-
libfdt/libfdt.h                               |   60 +-
libfdt/libfdt_internal.h                      |    7 +
libfdt/meson.build                            |    1 +
libfdt/version.lds                            |    2 +
livetree.c                                    |  563 +++++-
meson.build                                   |    2 +-
...ddon_addon_namespace-merged.dtb.dts.expect |   57 +
...fdtaddon_addon_namespace-merged.dtb.expect |   49 +
tests/fdtaddon_addon_namespace.dtba.expect    |   31 +
tests/fdtaddon_addon_namespace.dtsa           |   34 +
tests/fdtaddon_base.dtb.expect                |   24 +
tests/fdtaddon_base.dts                       |   27 +
tests/fdtaddon_base_namespace.dtb.expect      |   29 +
tests/fdtaddon_base_namespace.dts             |   33 +
tests/fdtaddon_basics1-merged1.dtb.dts.expect |   35 +
tests/fdtaddon_basics1-merged1.dtb.expect     |   27 +
tests/fdtaddon_basics1-merged2.dtb.dts.expect |   35 +
tests/fdtaddon_basics1-merged2.dtb.expect     |   27 +
tests/fdtaddon_basics1.dtba.expect            |    8 +
tests/fdtaddon_basics1.dtsa                   |   13 +
tests/fdtaddon_basics2-merged1.dtb.dts.expect |   35 +
tests/fdtaddon_basics2-merged1.dtb.expect     |   27 +
tests/fdtaddon_basics2-merged2.dtb.dts.expect |   35 +
tests/fdtaddon_basics2-merged2.dtb.expect     |   27 +
tests/fdtaddon_basics2.dtba.expect            |    9 +
tests/fdtaddon_basics2.dtsa                   |   15 +
tests/fdtaddon_basics3-merged1.dtb.dts.expect |   36 +
tests/fdtaddon_basics3-merged1.dtb.expect     |   29 +
tests/fdtaddon_basics3-merged2.dtb.dts.expect |   36 +
tests/fdtaddon_basics3-merged2.dtb.expect     |   29 +
tests/fdtaddon_basics3.dtba.expect            |   12 +
tests/fdtaddon_basics3.dtsa                   |   17 +
...ddon_realistic_addon-merged.dtb.dts.expect |   91 +
...fdtaddon_realistic_addon-merged.dtb.expect |   93 +
tests/fdtaddon_realistic_addon.dtba.expect    |   32 +
tests/fdtaddon_realistic_addon.dtsa           |   50 +
tests/fdtaddon_realistic_base.dtb.expect      |   72 +
tests/fdtaddon_realistic_base.dts             |   74 +
.../fdtaddon_stack_1st-merged.dtb.dts.expect  |   51 +
tests/fdtaddon_stack_1st-merged.dtb.expect    |   41 +
tests/fdtaddon_stack_1st.dtba.expect          |   24 +
tests/fdtaddon_stack_1st.dtsa                 |   27 +
.../fdtaddon_stack_2nd-merged.dtb.dts.expect  |   70 +
tests/fdtaddon_stack_2nd-merged.dtb.expect    |   59 +
tests/fdtaddon_stack_2nd.dtba.expect          |   30 +
tests/fdtaddon_stack_2nd.dtsa                 |   35 +
tests/meson.build                             |    4 +-
tests/metadata_addon_base.dtb.dts.expect      |   10 +
tests/metadata_addon_base.dtb.expect          |   10 +
tests/metadata_addon_base.dts                 |   14 +
tests/metadata_addon_base.dts.dts.expect      |   10 +
tests/metadata_addon_orphan1.dtb.dts.expect   |   16 +
tests/metadata_addon_orphan1.dtb.expect       |   13 +
tests/metadata_addon_orphan1.dts              |   19 +
tests/metadata_addon_orphan1.dts.dts.expect   |   16 +
tests/metadata_addon_orphan2.dtb.dts.expect   |   10 +
tests/metadata_addon_orphan2.dtb.expect       |    8 +
tests/metadata_addon_orphan2.dts              |   13 +
tests/metadata_addon_orphan2.dts.dts.expect   |   10 +
tests/metadata_addon_orphan3.dtb.dts.expect   |   22 +
tests/metadata_addon_orphan3.dtb.expect       |   17 +
tests/metadata_addon_orphan3.dts              |   28 +
tests/metadata_addon_orphan3.dts.dts.expect   |   22 +
.../metadata_addon_references.dtb.dts.expect  |   48 +
tests/metadata_addon_references.dtb.expect    |   48 +
tests/metadata_addon_references.dts           |   43 +
.../metadata_addon_references.dts.dts.expect  |   48 +
...metadata_addon_refnamespace.dtb.dts.expect |   32 +
tests/metadata_addon_refnamespace.dtb.expect  |   29 +
tests/metadata_addon_refnamespace.dts         |   38 +
...metadata_addon_refnamespace.dts.dts.expect |   32 +
tests/metadata_dtflags0.dtb.expect            |    1 +
tests/metadata_dtflags0.dts                   |   10 +
tests/metadata_dtflags1.dtb.expect            |    1 +
tests/metadata_dtflags1.dts                   |   11 +
.../metadata_exportsyms_local.dtb.dts.expect  |   26 +
tests/metadata_exportsyms_local.dtb.expect    |   20 +
tests/metadata_exportsyms_local.dts           |   28 +
.../metadata_exportsyms_local.dts.dts.expect  |   26 +
tests/metadata_exportsyms_ref.dtb.dts.expect  |   25 +
tests/metadata_exportsyms_ref.dtb.expect      |   18 +
tests/metadata_exportsyms_ref.dts             |   26 +
tests/metadata_exportsyms_ref.dts.dts.expect  |   25 +
tests/metadata_importsyms.dtb.dts.expect      |    9 +
tests/metadata_importsyms.dtb.expect          |    8 +
tests/metadata_importsyms.dts                 |   14 +
tests/metadata_importsyms.dts.dts.expect      |    9 +
tests/metadata_reflocal.dtb.dts.expect        |   23 +
tests/metadata_reflocal.dtb.expect            |   20 +
tests/metadata_reflocal.dts                   |   27 +
tests/metadata_reflocal.dts.dts.expect        |   23 +
tests/metadata_refphandle.dtb.dts.expect      |   17 +
tests/metadata_refphandle.dtb.expect          |   16 +
tests/metadata_refphandle.dts                 |   11 +
tests/metadata_refphandle.dts.dts.expect      |   17 +
tests/metadata_sort.dtb.dts.expect            |   61 +
tests/metadata_sort.dtb.expect                |   48 +
tests/metadata_sort.dts                       |   58 +
tests/pylibfdt_tests.py                       |    8 +-
tests/run_tests.sh                            |  176 +-
tests/testutils.c                             |    2 +-
tests/testutils.sh                            |    1 +
tests/trees.S                                 |    3 +-
treesource.c                                  |   42 +-
121 files changed, 6552 insertions(+), 192 deletions(-)
create mode 100644 fdtaddon.c
create mode 100644 libfdt/fdt_addon.c
create mode 100644 tests/fdtaddon_addon_namespace-merged.dtb.dts.expect
create mode 100644 tests/fdtaddon_addon_namespace-merged.dtb.expect
create mode 100644 tests/fdtaddon_addon_namespace.dtba.expect
create mode 100644 tests/fdtaddon_addon_namespace.dtsa
create mode 100644 tests/fdtaddon_base.dtb.expect
create mode 100644 tests/fdtaddon_base.dts
create mode 100644 tests/fdtaddon_base_namespace.dtb.expect
create mode 100644 tests/fdtaddon_base_namespace.dts
create mode 100644 tests/fdtaddon_basics1-merged1.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics1-merged1.dtb.expect
create mode 100644 tests/fdtaddon_basics1-merged2.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics1-merged2.dtb.expect
create mode 100644 tests/fdtaddon_basics1.dtba.expect
create mode 100644 tests/fdtaddon_basics1.dtsa
create mode 100644 tests/fdtaddon_basics2-merged1.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics2-merged1.dtb.expect
create mode 100644 tests/fdtaddon_basics2-merged2.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics2-merged2.dtb.expect
create mode 100644 tests/fdtaddon_basics2.dtba.expect
create mode 100644 tests/fdtaddon_basics2.dtsa
create mode 100644 tests/fdtaddon_basics3-merged1.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics3-merged1.dtb.expect
create mode 100644 tests/fdtaddon_basics3-merged2.dtb.dts.expect
create mode 100644 tests/fdtaddon_basics3-merged2.dtb.expect
create mode 100644 tests/fdtaddon_basics3.dtba.expect
create mode 100644 tests/fdtaddon_basics3.dtsa
create mode 100644 tests/fdtaddon_realistic_addon-merged.dtb.dts.expect
create mode 100644 tests/fdtaddon_realistic_addon-merged.dtb.expect
create mode 100644 tests/fdtaddon_realistic_addon.dtba.expect
create mode 100644 tests/fdtaddon_realistic_addon.dtsa
create mode 100644 tests/fdtaddon_realistic_base.dtb.expect
create mode 100644 tests/fdtaddon_realistic_base.dts
create mode 100644 tests/fdtaddon_stack_1st-merged.dtb.dts.expect
create mode 100644 tests/fdtaddon_stack_1st-merged.dtb.expect
create mode 100644 tests/fdtaddon_stack_1st.dtba.expect
create mode 100644 tests/fdtaddon_stack_1st.dtsa
create mode 100644 tests/fdtaddon_stack_2nd-merged.dtb.dts.expect
create mode 100644 tests/fdtaddon_stack_2nd-merged.dtb.expect
create mode 100644 tests/fdtaddon_stack_2nd.dtba.expect
create mode 100644 tests/fdtaddon_stack_2nd.dtsa
create mode 100644 tests/metadata_addon_base.dtb.dts.expect
create mode 100644 tests/metadata_addon_base.dtb.expect
create mode 100644 tests/metadata_addon_base.dts
create mode 100644 tests/metadata_addon_base.dts.dts.expect
create mode 100644 tests/metadata_addon_orphan1.dtb.dts.expect
create mode 100644 tests/metadata_addon_orphan1.dtb.expect
create mode 100644 tests/metadata_addon_orphan1.dts
create mode 100644 tests/metadata_addon_orphan1.dts.dts.expect
create mode 100644 tests/metadata_addon_orphan2.dtb.dts.expect
create mode 100644 tests/metadata_addon_orphan2.dtb.expect
create mode 100644 tests/metadata_addon_orphan2.dts
create mode 100644 tests/metadata_addon_orphan2.dts.dts.expect
create mode 100644 tests/metadata_addon_orphan3.dtb.dts.expect
create mode 100644 tests/metadata_addon_orphan3.dtb.expect
create mode 100644 tests/metadata_addon_orphan3.dts
create mode 100644 tests/metadata_addon_orphan3.dts.dts.expect
create mode 100644 tests/metadata_addon_references.dtb.dts.expect
create mode 100644 tests/metadata_addon_references.dtb.expect
create mode 100644 tests/metadata_addon_references.dts
create mode 100644 tests/metadata_addon_references.dts.dts.expect
create mode 100644 tests/metadata_addon_refnamespace.dtb.dts.expect
create mode 100644 tests/metadata_addon_refnamespace.dtb.expect
create mode 100644 tests/metadata_addon_refnamespace.dts
create mode 100644 tests/metadata_addon_refnamespace.dts.dts.expect
create mode 100644 tests/metadata_dtflags0.dtb.expect
create mode 100644 tests/metadata_dtflags0.dts
create mode 100644 tests/metadata_dtflags1.dtb.expect
create mode 100644 tests/metadata_dtflags1.dts
create mode 100644 tests/metadata_exportsyms_local.dtb.dts.expect
create mode 100644 tests/metadata_exportsyms_local.dtb.expect
create mode 100644 tests/metadata_exportsyms_local.dts
create mode 100644 tests/metadata_exportsyms_local.dts.dts.expect
create mode 100644 tests/metadata_exportsyms_ref.dtb.dts.expect
create mode 100644 tests/metadata_exportsyms_ref.dtb.expect
create mode 100644 tests/metadata_exportsyms_ref.dts
create mode 100644 tests/metadata_exportsyms_ref.dts.dts.expect
create mode 100644 tests/metadata_importsyms.dtb.dts.expect
create mode 100644 tests/metadata_importsyms.dtb.expect
create mode 100644 tests/metadata_importsyms.dts
create mode 100644 tests/metadata_importsyms.dts.dts.expect
create mode 100644 tests/metadata_reflocal.dtb.dts.expect
create mode 100644 tests/metadata_reflocal.dtb.expect
create mode 100644 tests/metadata_reflocal.dts
create mode 100644 tests/metadata_reflocal.dts.dts.expect
create mode 100644 tests/metadata_refphandle.dtb.dts.expect
create mode 100644 tests/metadata_refphandle.dtb.expect
create mode 100644 tests/metadata_refphandle.dts
create mode 100644 tests/metadata_refphandle.dts.dts.expect
create mode 100644 tests/metadata_sort.dtb.dts.expect
create mode 100644 tests/metadata_sort.dtb.expect
create mode 100644 tests/metadata_sort.dts
[RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Herve Codina 3 weeks, 5 days ago
This big picture series adds support for dtb metadata and addon
device-trees.

Before giving details about the series content, let me give a little bit
of context.

The use-case is to support additional boards that can be hot-plugged to
a connector available in a base board. This connector is standardized in
terms of resources available on each pin. Any additional boards
compatible with the connector should be able to be connected to base
board and all base boards where this connector is implemented should
support any additional boards.

TLDR: The last patch, patch 77, gives an example of dts and dtsa (new
      addon device-tree) handling this use-case. It provides an example
      of a realistic base board description (dts) and an realistic
      additional board description (dtsa).

Each base board is described by its own device-tree and the real
resource connected to the connector depends on each board. For instance
an i2c bus on the connector can come from the i2c1 controller from base
board A and i2c5 controller from base board B. This is obviously the
case for all resources wired to the connector.

On the other hand, the device-tree describing the additional board has
no reason to be changed based on the base board the additional board is
going to be connected. Indeed this device-tree describes the additional
board hardware and this hardware doesn't change if the additional board
is connected to the base board A or the base board B.

In order to extend a device-tree at runtime, a device-tree overlay can
be used. The drawback of current overlay implementation is that an
overlay is tightly coupled with the base device-tree it is applied to.

If a symbol of the base device-tree has to be used by the overlay, all
symbols available in the base device-tree need to be visible by the
overlay and the overlay can use only those symbol without any kind of
name translation.

With current overlay implementation, a overlay depends on the base
board. Indeed, if an overlay wants to add an I2C device on the I2C bus
available on the base board A connector, it needs to reference the i2c1
bus whereas it needs to reference the i2c5 bus if it used with the base
board B.

In order to fix the issue, the 'export symbol' concept has been
proposed. This concept allows some specific node to 'export' symbols in
order to be seen by an overlay applied to this node.

The use-case and the export symbol proposal have been detailed during
a talk at ELCE 2025. Have a look at the slides [1] and/or the video [2]
to have a clear view of the topic

[1] https://bootlin.com/pub/conferences/2025/elce/ceresoli-hotplug-status.pdf
[2] https://www.youtube.com/watch?v=C8dEQ4OzMnc

The export symbol proposal based on an export-symbol node in the
device-tree have been rejected by device-tree and dtc maintainers.

A discussion about the topic has been started on the mailing-list [3].
This discussions led to:

- The addition of meta-data in dtb instead of having __fixup__, __local__fixup__,
  an similar nodes in the device-tree used by overlays

- A new kind of device-tree, an addon device-tree, in order to replace the
  usage of the overlay device-tree in this 'hot-plugging additional board'
  use-case.

[3] https://lore.kernel.org/all/20250902105710.00512c6d@booty/

This current RFC is the implementation of features discussed on the
mailing-list. A lot of things are new in dtb format (new tags) and dts
format (new keyword, new kind of references) and not yet mentioned in
the standard.

The purpose of this big picture RFC is to move forward on this topic
based on code and some concrete dts / dtb example. Indeed, this RFC also
adds tests for each feature introduced. Those tests are performed using
dts files and the content of those dts files can also help in the
discussion.

The first patch is just a simple fix and can probably be merged out of this
meta-data and addon discussion.

  - Patches 2..12: Introduce new meta-data dtb tags based on markers

    Those new tags are FDT_REF_LOCAL and FDT_REF_PHANDLE.

    FDT_REF_LOCAL (details in patch 6) is used to tag property using a
    phandle and this phandle points to a local node (i.e. a node
    existing in the dtb).

    FDT_REF_PHANDLE (details in patch 11) is used to tag a property
    using a phandle but this phandle points to a non local node (i.e.
    the node doesn't exist in the dtb). The reference to the node is
    present with the tag and the phandle value has to be fixed when the
    dtb is applied. This tag can only be present in plugins (overlays)
    and addons dtb.

  - Patches 13..17: Introduce addons device-tree

    This part introduce the new /addon/ dts keyword

  - Patches 18..30: Introduce /export/ keyword and related dtb tags

    This part introduces the new /export/ dts keyword (details in patch
    20) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.

    FDT_EXPORT_SYM (details in patch 25) is used when the exported
    symbol involved is a local node and FDT_EXPORT_SYM_REF (details in
    patch 29) is used when the node involved is a non local node.

  - Patches 31..38: Introduce /import/ keyword and related dtb tags

    This part introduces the new /import/ dts keyword (details in patch
    33) and the related FDT_IMPORT_SYM dtb tag (details in patch 35).

  - Patches 39..63: Introduce orphan nodes

    Even if the orphan nodes concept was already present in overlays,
    the final encoding of those nodes in addon dtbs is different
    compared to overlays dtbs.

    In overlays, orphan nodes are transformed to a /fragment@n/__overlay__
    node. This is not the way used in addons.

    Indeed, in addons, orphan nodes are not transformed to fit in
    something like /fragment@n/__overlay__. They are encoded in the dtb
    using a specific tag.

    This part, after some preparation, introduces orphan nodes (details
    in patch 48) and the related FDT_BEGIN_NODE_REF_SYM dtb tag (details
    in patch 56).

    It also adds support for addons dts/dtb without a 'root' (details in
    patch 58).

    This part ended with the support for merging orphan node described
    in dts when relevant (details patch 60).

  - Patches 64..65: Reference orphan nodes and its sub-nodes by path

    A new syntax is needed to be able to reference a an orphan node and
    its sub-nodes by path.

    This new syntax is '${$<orphan_name>/<path>}' (details in patch #60)

  - Patches 66..67: Namespace labels references

    Add Namespace labels references with the new syntax '&foo.bar.baz'.

    This new syntax, only allowed in addons, allows to 'jump' from node
    to node based on exported symbols defined at each node (details in
    patch 66).

  - Patches 68..71: Support for applying an addon

    First, add fdt_addon_apply() in libfdt (details in patch 70) and
    then the fdtaddon command line tool (details in patch 71).

  - Patches 72..76: fdtaddon test

    Several tests related to addon application

  - Patch 77: A more Realistic test

    A last test based on use-case we want to handle.

    This last patch (and its dts and dtsa files) shows the kind of usage
    is expected for addons.

    Also it proves that metadata and addons features handles our
    use-case.

I know this series is a huge series but I would like to give the big
picture in this RFC (I hope this was a good idea). Of course, this
series can be split for the upstreaming step and handled by parts by
parts. Let me know.

Tests are provided for each feature. In addition to be used for testing,
tests input source files and expected output files can be used to see
the expected behavior related to each feature.

I hope also that this first RFC will help in moving forward regarding
this 'handling an additional board described by a device-tree' topic.

Best regards,
Hervé

Herve Codina (77):
  checks: Use consistent type for strspn() returned value
  Introduce v18 dtb version
  libfdt: Introduce fdt_next_tag_full() and use it in fdt_next_tag()
  dtc: Allow to use data_append_markers() out of data.c
  fdtdump: Change FDT_PROP prob handling to ease future addition
  Add support for FDT_REF_LOCAL dtb tag
  livetree: Improve get_node_by_phandle()
  dtc: Introduce update_phandles_ref()
  dtc: Introduce mark_local_phandles()
  tests: Add basic metadata tests
  Add support for FDT_REF_PHANDLE dtb tag
  tests: metadata: Add external phandle reference tests
  Introduce dt_flags field in dtb header
  tests: metadata: Add a first test related to the dt_flags header field
  Add support for /addon/ keyword
  tests: metadata: Add a test related to addon dt_flags header value
  tests: metadata: Add a basic addon test
  dtc-parser.y: Avoid an empty proplist
  dtc: Introduce export symbols
  dtc: Add support for /export/ dts keyword parsing
  checks: Handle export symbols in fixup_phandle_references()
  dtc: Add export symbols (/export/ keyword) in generated dts file
  dtc: Introduce mark_local_exports()
  dtc: Introduce update_exports_ref()
  Add support for FDT_EXPORT_SYM dtb tag
  tests: metadata: Add export symbols with local references tests
  dtc: Add support for export symbols sorting
  tests: metadata: Add a test for export symbols sorting
  Add support for FDT_EXPORT_SYM_REF dtb tag
  tests: metadata: Add export symbols with external references tests
  dtc: Introduce import symbols
  dtc-parser: Introduce last_header_flags
  dtc: Add support for /import/ dts keyword parsing
  dtc: Add import symbols (/import/ keyword) in generated dts file
  Add support for FDT_IMPORT_SYM dtb tag
  tests: metadata: Add import symbols tests
  dtc: Add support for import symbols sorting
  tests: metadata: Improve sort test to check for import symbols sorting
  check: Get 'chosen' node using get_subnode()
  dtc: Introduce dti_get_node_by_path()
  dtc: Introduce dti_get_node_by_label()
  dtc: Introduce dti_get_node_by_phandle()
  dtc: Introduce dti_get_node_by_ref()
  dtc: Introduce dti_get_node_phandle()
  dtc: Introduce dti_get_property_by_label()
  dtc: Introduce dti_get_marker_label()
  dtc: Introduce dti_fill_fullpaths()
  dtc: Introduce orphan nodes
  dtc: Handle orphan nodes in dti_get_xxx_by_yyy()
  dtc: Handle orphan nodes in mark_local_xxx() and update_xxx_ref()
  dtc: Avoid NULL fullpath for nodes in orphan trees
  checks: Perform checks for orphan nodes
  dtc: Rename add_orphan_node() to plugin_add_orphan_node()
  dtc: Add basic support for addon orphan nodes dts parsing
  dtc: Add orphan nodes in generated dts file
  Add support for FDT_BEGIN_NODE_REF_SYM dtb tag
  tests: metadata: Add basic test for addon orphan nodes
  dtc: Add support for missing root node in addon device-tree
  tests: metadata: Add a test for addon without root node
  dtc: Allow parser_get_node_by_ref() to return an orphan node for
    merging purpose
  tests: metadata: Add a test related to orphan node merging
  dtc: Add support for orphan nodes sorting
  tests: metadata: Improve sort test to check for orphan nodes sorting
  dtc: Add support for references by path involving orphan nodes
  tests: metadata: Add a test for references by path involving orphan
    nodes
  dtc: Add support for namespace labels references
  tests: metadata: Add a test for namespace labels references
  libfdt: Introduce fdt_getprop_by_offset_w()
  libfdt: Introduce fdt_getprop_offset()
  libfdt: Add support for applying an addon on a base device-tree blob
  Add fdtaddon tool to apply an addon
  tests: Add a first basic test for fdtaddon
  tests: fdtaddon: Add a basic test for addons using an orphan nodes
  tests: fdtaddon: Add a basic test for addons with unresolved phandle
    references
  tests: fdtaddon: Add a test for addons using namespace label
    references
  tests: fdtaddon: Add a test for using 'stacked' addons
  tests: fdtaddon: Add a test using more realistic dts and dtsa

 Makefile                                      |    5 +
 checks.c                                      |  135 +-
 data.c                                        |    3 +-
 dtc-lexer.l                                   |   37 +
 dtc-parser.y                                  |  307 +++-
 dtc.c                                         |   64 +-
 dtc.h                                         |   72 +-
 fdtaddon.c                                    |  197 ++
 fdtdump.c                                     |  114 +-
 flattree.c                                    |  396 +++-
 fstree.c                                      |    5 +-
 libfdt/Makefile.libfdt                        |    2 +-
 libfdt/fdt.c                                  |  152 +-
 libfdt/fdt.h                                  |   15 +
 libfdt/fdt_addon.c                            | 1636 +++++++++++++++++
 libfdt/fdt_ro.c                               |   12 +
 libfdt/fdt_rw.c                               |  102 +-
 libfdt/libfdt.h                               |   60 +-
 libfdt/libfdt_internal.h                      |    7 +
 libfdt/meson.build                            |    1 +
 libfdt/version.lds                            |    2 +
 livetree.c                                    |  563 +++++-
 meson.build                                   |    2 +-
 ...ddon_addon_namespace-merged.dtb.dts.expect |   57 +
 ...fdtaddon_addon_namespace-merged.dtb.expect |   49 +
 tests/fdtaddon_addon_namespace.dtba.expect    |   31 +
 tests/fdtaddon_addon_namespace.dtsa           |   34 +
 tests/fdtaddon_base.dtb.expect                |   24 +
 tests/fdtaddon_base.dts                       |   27 +
 tests/fdtaddon_base_namespace.dtb.expect      |   29 +
 tests/fdtaddon_base_namespace.dts             |   33 +
 tests/fdtaddon_basics1-merged1.dtb.dts.expect |   35 +
 tests/fdtaddon_basics1-merged1.dtb.expect     |   27 +
 tests/fdtaddon_basics1-merged2.dtb.dts.expect |   35 +
 tests/fdtaddon_basics1-merged2.dtb.expect     |   27 +
 tests/fdtaddon_basics1.dtba.expect            |    8 +
 tests/fdtaddon_basics1.dtsa                   |   13 +
 tests/fdtaddon_basics2-merged1.dtb.dts.expect |   35 +
 tests/fdtaddon_basics2-merged1.dtb.expect     |   27 +
 tests/fdtaddon_basics2-merged2.dtb.dts.expect |   35 +
 tests/fdtaddon_basics2-merged2.dtb.expect     |   27 +
 tests/fdtaddon_basics2.dtba.expect            |    9 +
 tests/fdtaddon_basics2.dtsa                   |   15 +
 tests/fdtaddon_basics3-merged1.dtb.dts.expect |   36 +
 tests/fdtaddon_basics3-merged1.dtb.expect     |   29 +
 tests/fdtaddon_basics3-merged2.dtb.dts.expect |   36 +
 tests/fdtaddon_basics3-merged2.dtb.expect     |   29 +
 tests/fdtaddon_basics3.dtba.expect            |   12 +
 tests/fdtaddon_basics3.dtsa                   |   17 +
 ...ddon_realistic_addon-merged.dtb.dts.expect |   91 +
 ...fdtaddon_realistic_addon-merged.dtb.expect |   93 +
 tests/fdtaddon_realistic_addon.dtba.expect    |   32 +
 tests/fdtaddon_realistic_addon.dtsa           |   50 +
 tests/fdtaddon_realistic_base.dtb.expect      |   72 +
 tests/fdtaddon_realistic_base.dts             |   74 +
 .../fdtaddon_stack_1st-merged.dtb.dts.expect  |   51 +
 tests/fdtaddon_stack_1st-merged.dtb.expect    |   41 +
 tests/fdtaddon_stack_1st.dtba.expect          |   24 +
 tests/fdtaddon_stack_1st.dtsa                 |   27 +
 .../fdtaddon_stack_2nd-merged.dtb.dts.expect  |   70 +
 tests/fdtaddon_stack_2nd-merged.dtb.expect    |   59 +
 tests/fdtaddon_stack_2nd.dtba.expect          |   30 +
 tests/fdtaddon_stack_2nd.dtsa                 |   35 +
 tests/meson.build                             |    4 +-
 tests/metadata_addon_base.dtb.dts.expect      |   10 +
 tests/metadata_addon_base.dtb.expect          |   10 +
 tests/metadata_addon_base.dts                 |   14 +
 tests/metadata_addon_base.dts.dts.expect      |   10 +
 tests/metadata_addon_orphan1.dtb.dts.expect   |   16 +
 tests/metadata_addon_orphan1.dtb.expect       |   13 +
 tests/metadata_addon_orphan1.dts              |   19 +
 tests/metadata_addon_orphan1.dts.dts.expect   |   16 +
 tests/metadata_addon_orphan2.dtb.dts.expect   |   10 +
 tests/metadata_addon_orphan2.dtb.expect       |    8 +
 tests/metadata_addon_orphan2.dts              |   13 +
 tests/metadata_addon_orphan2.dts.dts.expect   |   10 +
 tests/metadata_addon_orphan3.dtb.dts.expect   |   22 +
 tests/metadata_addon_orphan3.dtb.expect       |   17 +
 tests/metadata_addon_orphan3.dts              |   28 +
 tests/metadata_addon_orphan3.dts.dts.expect   |   22 +
 .../metadata_addon_references.dtb.dts.expect  |   48 +
 tests/metadata_addon_references.dtb.expect    |   48 +
 tests/metadata_addon_references.dts           |   43 +
 .../metadata_addon_references.dts.dts.expect  |   48 +
 ...metadata_addon_refnamespace.dtb.dts.expect |   32 +
 tests/metadata_addon_refnamespace.dtb.expect  |   29 +
 tests/metadata_addon_refnamespace.dts         |   38 +
 ...metadata_addon_refnamespace.dts.dts.expect |   32 +
 tests/metadata_dtflags0.dtb.expect            |    1 +
 tests/metadata_dtflags0.dts                   |   10 +
 tests/metadata_dtflags1.dtb.expect            |    1 +
 tests/metadata_dtflags1.dts                   |   11 +
 .../metadata_exportsyms_local.dtb.dts.expect  |   26 +
 tests/metadata_exportsyms_local.dtb.expect    |   20 +
 tests/metadata_exportsyms_local.dts           |   28 +
 .../metadata_exportsyms_local.dts.dts.expect  |   26 +
 tests/metadata_exportsyms_ref.dtb.dts.expect  |   25 +
 tests/metadata_exportsyms_ref.dtb.expect      |   18 +
 tests/metadata_exportsyms_ref.dts             |   26 +
 tests/metadata_exportsyms_ref.dts.dts.expect  |   25 +
 tests/metadata_importsyms.dtb.dts.expect      |    9 +
 tests/metadata_importsyms.dtb.expect          |    8 +
 tests/metadata_importsyms.dts                 |   14 +
 tests/metadata_importsyms.dts.dts.expect      |    9 +
 tests/metadata_reflocal.dtb.dts.expect        |   23 +
 tests/metadata_reflocal.dtb.expect            |   20 +
 tests/metadata_reflocal.dts                   |   27 +
 tests/metadata_reflocal.dts.dts.expect        |   23 +
 tests/metadata_refphandle.dtb.dts.expect      |   17 +
 tests/metadata_refphandle.dtb.expect          |   16 +
 tests/metadata_refphandle.dts                 |   11 +
 tests/metadata_refphandle.dts.dts.expect      |   17 +
 tests/metadata_sort.dtb.dts.expect            |   61 +
 tests/metadata_sort.dtb.expect                |   48 +
 tests/metadata_sort.dts                       |   58 +
 tests/pylibfdt_tests.py                       |    8 +-
 tests/run_tests.sh                            |  176 +-
 tests/testutils.c                             |    2 +-
 tests/testutils.sh                            |    1 +
 tests/trees.S                                 |    3 +-
 treesource.c                                  |   42 +-
 121 files changed, 6552 insertions(+), 192 deletions(-)
 create mode 100644 fdtaddon.c
 create mode 100644 libfdt/fdt_addon.c
 create mode 100644 tests/fdtaddon_addon_namespace-merged.dtb.dts.expect
 create mode 100644 tests/fdtaddon_addon_namespace-merged.dtb.expect
 create mode 100644 tests/fdtaddon_addon_namespace.dtba.expect
 create mode 100644 tests/fdtaddon_addon_namespace.dtsa
 create mode 100644 tests/fdtaddon_base.dtb.expect
 create mode 100644 tests/fdtaddon_base.dts
 create mode 100644 tests/fdtaddon_base_namespace.dtb.expect
 create mode 100644 tests/fdtaddon_base_namespace.dts
 create mode 100644 tests/fdtaddon_basics1-merged1.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics1-merged1.dtb.expect
 create mode 100644 tests/fdtaddon_basics1-merged2.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics1-merged2.dtb.expect
 create mode 100644 tests/fdtaddon_basics1.dtba.expect
 create mode 100644 tests/fdtaddon_basics1.dtsa
 create mode 100644 tests/fdtaddon_basics2-merged1.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics2-merged1.dtb.expect
 create mode 100644 tests/fdtaddon_basics2-merged2.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics2-merged2.dtb.expect
 create mode 100644 tests/fdtaddon_basics2.dtba.expect
 create mode 100644 tests/fdtaddon_basics2.dtsa
 create mode 100644 tests/fdtaddon_basics3-merged1.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics3-merged1.dtb.expect
 create mode 100644 tests/fdtaddon_basics3-merged2.dtb.dts.expect
 create mode 100644 tests/fdtaddon_basics3-merged2.dtb.expect
 create mode 100644 tests/fdtaddon_basics3.dtba.expect
 create mode 100644 tests/fdtaddon_basics3.dtsa
 create mode 100644 tests/fdtaddon_realistic_addon-merged.dtb.dts.expect
 create mode 100644 tests/fdtaddon_realistic_addon-merged.dtb.expect
 create mode 100644 tests/fdtaddon_realistic_addon.dtba.expect
 create mode 100644 tests/fdtaddon_realistic_addon.dtsa
 create mode 100644 tests/fdtaddon_realistic_base.dtb.expect
 create mode 100644 tests/fdtaddon_realistic_base.dts
 create mode 100644 tests/fdtaddon_stack_1st-merged.dtb.dts.expect
 create mode 100644 tests/fdtaddon_stack_1st-merged.dtb.expect
 create mode 100644 tests/fdtaddon_stack_1st.dtba.expect
 create mode 100644 tests/fdtaddon_stack_1st.dtsa
 create mode 100644 tests/fdtaddon_stack_2nd-merged.dtb.dts.expect
 create mode 100644 tests/fdtaddon_stack_2nd-merged.dtb.expect
 create mode 100644 tests/fdtaddon_stack_2nd.dtba.expect
 create mode 100644 tests/fdtaddon_stack_2nd.dtsa
 create mode 100644 tests/metadata_addon_base.dtb.dts.expect
 create mode 100644 tests/metadata_addon_base.dtb.expect
 create mode 100644 tests/metadata_addon_base.dts
 create mode 100644 tests/metadata_addon_base.dts.dts.expect
 create mode 100644 tests/metadata_addon_orphan1.dtb.dts.expect
 create mode 100644 tests/metadata_addon_orphan1.dtb.expect
 create mode 100644 tests/metadata_addon_orphan1.dts
 create mode 100644 tests/metadata_addon_orphan1.dts.dts.expect
 create mode 100644 tests/metadata_addon_orphan2.dtb.dts.expect
 create mode 100644 tests/metadata_addon_orphan2.dtb.expect
 create mode 100644 tests/metadata_addon_orphan2.dts
 create mode 100644 tests/metadata_addon_orphan2.dts.dts.expect
 create mode 100644 tests/metadata_addon_orphan3.dtb.dts.expect
 create mode 100644 tests/metadata_addon_orphan3.dtb.expect
 create mode 100644 tests/metadata_addon_orphan3.dts
 create mode 100644 tests/metadata_addon_orphan3.dts.dts.expect
 create mode 100644 tests/metadata_addon_references.dtb.dts.expect
 create mode 100644 tests/metadata_addon_references.dtb.expect
 create mode 100644 tests/metadata_addon_references.dts
 create mode 100644 tests/metadata_addon_references.dts.dts.expect
 create mode 100644 tests/metadata_addon_refnamespace.dtb.dts.expect
 create mode 100644 tests/metadata_addon_refnamespace.dtb.expect
 create mode 100644 tests/metadata_addon_refnamespace.dts
 create mode 100644 tests/metadata_addon_refnamespace.dts.dts.expect
 create mode 100644 tests/metadata_dtflags0.dtb.expect
 create mode 100644 tests/metadata_dtflags0.dts
 create mode 100644 tests/metadata_dtflags1.dtb.expect
 create mode 100644 tests/metadata_dtflags1.dts
 create mode 100644 tests/metadata_exportsyms_local.dtb.dts.expect
 create mode 100644 tests/metadata_exportsyms_local.dtb.expect
 create mode 100644 tests/metadata_exportsyms_local.dts
 create mode 100644 tests/metadata_exportsyms_local.dts.dts.expect
 create mode 100644 tests/metadata_exportsyms_ref.dtb.dts.expect
 create mode 100644 tests/metadata_exportsyms_ref.dtb.expect
 create mode 100644 tests/metadata_exportsyms_ref.dts
 create mode 100644 tests/metadata_exportsyms_ref.dts.dts.expect
 create mode 100644 tests/metadata_importsyms.dtb.dts.expect
 create mode 100644 tests/metadata_importsyms.dtb.expect
 create mode 100644 tests/metadata_importsyms.dts
 create mode 100644 tests/metadata_importsyms.dts.dts.expect
 create mode 100644 tests/metadata_reflocal.dtb.dts.expect
 create mode 100644 tests/metadata_reflocal.dtb.expect
 create mode 100644 tests/metadata_reflocal.dts
 create mode 100644 tests/metadata_reflocal.dts.dts.expect
 create mode 100644 tests/metadata_refphandle.dtb.dts.expect
 create mode 100644 tests/metadata_refphandle.dtb.expect
 create mode 100644 tests/metadata_refphandle.dts
 create mode 100644 tests/metadata_refphandle.dts.dts.expect
 create mode 100644 tests/metadata_sort.dtb.dts.expect
 create mode 100644 tests/metadata_sort.dtb.expect
 create mode 100644 tests/metadata_sort.dts

-- 
2.52.0

Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by David Gibson 3 weeks, 2 days ago
On Mon, Jan 12, 2026 at 03:18:50PM +0100, Herve Codina wrote:
> This big picture series adds support for dtb metadata and addon
> device-trees.

Oof.  So, I lobbied for (at least aspects of) this approach, I think
it's a better idea than more ad-hoc extensions to overlays.

Now I'm reaping what I sowed: reviewing 77 patches for dtc/libfdt is
going to be a real challenge - I've been struggling to find time to
review a 6 patch series for months.  Well, I guess we'll see what we
can do.

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by David Gibson 3 weeks, 2 days ago
On Thu, Jan 15, 2026 at 11:08:51AM +1100, David Gibson wrote:
> On Mon, Jan 12, 2026 at 03:18:50PM +0100, Herve Codina wrote:
> > This big picture series adds support for dtb metadata and addon
> > device-trees.
> 
> Oof.  So, I lobbied for (at least aspects of) this approach, I think
> it's a better idea than more ad-hoc extensions to overlays.
> 
> Now I'm reaping what I sowed: reviewing 77 patches for dtc/libfdt is
> going to be a real challenge - I've been struggling to find time to
> review a 6 patch series for months.  Well, I guess we'll see what we
> can do.

Jsyk

In line with the above, the review I've done so far is, deliberately,
a shallow, first-pass approach.  I'm looking primarily at the commit
messages rather than code, and I'm focussing on generalities and
reviewability, rather than details.

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Rob Herring 3 weeks, 3 days ago
On Mon, Jan 12, 2026 at 8:20 AM Herve Codina <herve.codina@bootlin.com> wrote:
>
> This big picture series adds support for dtb metadata and addon
> device-trees.
>
> Before giving details about the series content, let me give a little bit
> of context.
>
> The use-case is to support additional boards that can be hot-plugged to
> a connector available in a base board. This connector is standardized in
> terms of resources available on each pin. Any additional boards
> compatible with the connector should be able to be connected to base
> board and all base boards where this connector is implemented should
> support any additional boards.
>
> TLDR: The last patch, patch 77, gives an example of dts and dtsa (new
>       addon device-tree) handling this use-case. It provides an example
>       of a realistic base board description (dts) and an realistic
>       additional board description (dtsa).

From a quick scan, that seems reasonable looking to me. The main thing
that got my attention was the namespace labels thing which I'll need
to study more.

> Each base board is described by its own device-tree and the real
> resource connected to the connector depends on each board. For instance
> an i2c bus on the connector can come from the i2c1 controller from base
> board A and i2c5 controller from base board B. This is obviously the
> case for all resources wired to the connector.
>
> On the other hand, the device-tree describing the additional board has
> no reason to be changed based on the base board the additional board is
> going to be connected. Indeed this device-tree describes the additional
> board hardware and this hardware doesn't change if the additional board
> is connected to the base board A or the base board B.
>
> In order to extend a device-tree at runtime, a device-tree overlay can
> be used. The drawback of current overlay implementation is that an
> overlay is tightly coupled with the base device-tree it is applied to.
>
> If a symbol of the base device-tree has to be used by the overlay, all
> symbols available in the base device-tree need to be visible by the
> overlay and the overlay can use only those symbol without any kind of
> name translation.
>
> With current overlay implementation, a overlay depends on the base
> board. Indeed, if an overlay wants to add an I2C device on the I2C bus
> available on the base board A connector, it needs to reference the i2c1
> bus whereas it needs to reference the i2c5 bus if it used with the base
> board B.
>
> In order to fix the issue, the 'export symbol' concept has been
> proposed. This concept allows some specific node to 'export' symbols in
> order to be seen by an overlay applied to this node.
>
> The use-case and the export symbol proposal have been detailed during
> a talk at ELCE 2025. Have a look at the slides [1] and/or the video [2]
> to have a clear view of the topic
>
> [1] https://bootlin.com/pub/conferences/2025/elce/ceresoli-hotplug-status.pdf
> [2] https://www.youtube.com/watch?v=C8dEQ4OzMnc
>
> The export symbol proposal based on an export-symbol node in the
> device-tree have been rejected by device-tree and dtc maintainers.
>
> A discussion about the topic has been started on the mailing-list [3].
> This discussions led to:
>
> - The addition of meta-data in dtb instead of having __fixup__, __local__fixup__,
>   an similar nodes in the device-tree used by overlays
>
> - A new kind of device-tree, an addon device-tree, in order to replace the
>   usage of the overlay device-tree in this 'hot-plugging additional board'
>   use-case.

I guess "addons" is overlays 2.0. Do you envision any use for overlays
1.0 after this? I wouldn't think so other than compatibility for
existing overlays.

Maybe a conversion tool and/or function would be useful (not asking
for that now).

> [3] https://lore.kernel.org/all/20250902105710.00512c6d@booty/
>
> This current RFC is the implementation of features discussed on the
> mailing-list. A lot of things are new in dtb format (new tags) and dts
> format (new keyword, new kind of references) and not yet mentioned in
> the standard.

spec follows code. :)

> The purpose of this big picture RFC is to move forward on this topic
> based on code and some concrete dts / dtb example. Indeed, this RFC also
> adds tests for each feature introduced. Those tests are performed using
> dts files and the content of those dts files can also help in the
> discussion.
>
> The first patch is just a simple fix and can probably be merged out of this
> meta-data and addon discussion.
>
>   - Patches 2..12: Introduce new meta-data dtb tags based on markers
>
>     Those new tags are FDT_REF_LOCAL and FDT_REF_PHANDLE.
>
>     FDT_REF_LOCAL (details in patch 6) is used to tag property using a
>     phandle and this phandle points to a local node (i.e. a node
>     existing in the dtb).
>
>     FDT_REF_PHANDLE (details in patch 11) is used to tag a property
>     using a phandle but this phandle points to a non local node (i.e.
>     the node doesn't exist in the dtb). The reference to the node is
>     present with the tag and the phandle value has to be fixed when the
>     dtb is applied. This tag can only be present in plugins (overlays)
>     and addons dtb.

This is very much aligned with what I would like to see. We've
discussed new DTB formats in the past and it becomes a laundry list of
changes likely resulting in something entirely different. I think
that's never going to move forward (it's only been discussed for 10+
years). I think doing something like this is much easier to define and
deploy.

I think the first step is just allowing the FDT format to have
additional tags with metadata that's not yet defined. Ideally that
would be just "allow unknown tags" instead of giving a parsing error.
However, I think we have to at least know the length of data for
unknown tags, so maybe we define a range of tag values which are
followed by a length. Either way, that should be a pretty small change
and easily deployed everywhere (that uses libfdt). After that, then we
can start to define the specific tags and meta-data we want. I would
like to see not just phandle info, but all type information for
example.

The addition of phandle info is also useful for fw_devlink (which is
the kernel's device dependency tracking), and I've been talking with
Saravana some about an approach like this.

>   - Patches 13..17: Introduce addons device-tree
>
>     This part introduce the new /addon/ dts keyword
>
>   - Patches 18..30: Introduce /export/ keyword and related dtb tags
>
>     This part introduces the new /export/ dts keyword (details in patch
>     20) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.
>
>     FDT_EXPORT_SYM (details in patch 25) is used when the exported
>     symbol involved is a local node and FDT_EXPORT_SYM_REF (details in
>     patch 29) is used when the node involved is a non local node.

More generally, would these just be "node metadata" tags?

Rob
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Herve Codina 3 weeks, 2 days ago
Hi Rob,

On Tue, 13 Jan 2026 12:44:07 -0600
Rob Herring <robh@kernel.org> wrote:

> On Mon, Jan 12, 2026 at 8:20 AM Herve Codina <herve.codina@bootlin.com> wrote:

...

> >
> > - A new kind of device-tree, an addon device-tree, in order to replace the
> >   usage of the overlay device-tree in this 'hot-plugging additional board'
> >   use-case.  
> 
> I guess "addons" is overlays 2.0. Do you envision any use for overlays
> 1.0 after this? I wouldn't think so other than compatibility for
> existing overlays.

On my side, with use cases I know about, I plan to switch to addons.

Of course, our connector use case which was the use case that leads to
series will use addons.

Also, I plan to move the overlay used in the LAN966x PCI use case (overlay on
top of PCI devices) to addons. I will do that when all needed support for this
feature will be available in the Linux kernel.

> 
> Maybe a conversion tool and/or function would be useful (not asking
> for that now).

Indeed, this kind of tool could be a nice to have.

> 
> > [3] https://lore.kernel.org/all/20250902105710.00512c6d@booty/
> >
> > This current RFC is the implementation of features discussed on the
> > mailing-list. A lot of things are new in dtb format (new tags) and dts
> > format (new keyword, new kind of references) and not yet mentioned in
> > the standard.  
> 
> spec follows code. :)
> 
> > The purpose of this big picture RFC is to move forward on this topic
> > based on code and some concrete dts / dtb example. Indeed, this RFC also
> > adds tests for each feature introduced. Those tests are performed using
> > dts files and the content of those dts files can also help in the
> > discussion.
> >
> > The first patch is just a simple fix and can probably be merged out of this
> > meta-data and addon discussion.
> >
> >   - Patches 2..12: Introduce new meta-data dtb tags based on markers
> >
> >     Those new tags are FDT_REF_LOCAL and FDT_REF_PHANDLE.
> >
> >     FDT_REF_LOCAL (details in patch 6) is used to tag property using a
> >     phandle and this phandle points to a local node (i.e. a node
> >     existing in the dtb).
> >
> >     FDT_REF_PHANDLE (details in patch 11) is used to tag a property
> >     using a phandle but this phandle points to a non local node (i.e.
> >     the node doesn't exist in the dtb). The reference to the node is
> >     present with the tag and the phandle value has to be fixed when the
> >     dtb is applied. This tag can only be present in plugins (overlays)
> >     and addons dtb.  
> 
> This is very much aligned with what I would like to see. We've
> discussed new DTB formats in the past and it becomes a laundry list of
> changes likely resulting in something entirely different. I think
> that's never going to move forward (it's only been discussed for 10+
> years). I think doing something like this is much easier to define and
> deploy.
> 
> I think the first step is just allowing the FDT format to have
> additional tags with metadata that's not yet defined. Ideally that
> would be just "allow unknown tags" instead of giving a parsing error.
> However, I think we have to at least know the length of data for
> unknown tags, so maybe we define a range of tag values which are
> followed by a length. Either way, that should be a pretty small change
> and easily deployed everywhere (that uses libfdt). After that, then we
> can start to define the specific tags and meta-data we want. I would
> like to see not just phandle info, but all type information for
> example.
> 
> The addition of phandle info is also useful for fw_devlink (which is
> the kernel's device dependency tracking), and I've been talking with
> Saravana some about an approach like this.
> 
> >   - Patches 13..17: Introduce addons device-tree
> >
> >     This part introduce the new /addon/ dts keyword
> >
> >   - Patches 18..30: Introduce /export/ keyword and related dtb tags
> >
> >     This part introduces the new /export/ dts keyword (details in patch
> >     20) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.
> >
> >     FDT_EXPORT_SYM (details in patch 25) is used when the exported
> >     symbol involved is a local node and FDT_EXPORT_SYM_REF (details in
> >     patch 29) is used when the node involved is a non local node.  
> 
> More generally, would these just be "node metadata" tags?
> 

I think we can have metadata at 3 differents levels:
- Property
- Node
- Global dtb

With the suggestion you did on patch 6 related to FDT_REF_LOCAL and if I
understood correctly, you expect to have a kind of "container" tag to group
metadata on each level.

Also you expect to have the ability to handle all 'for now unknown' tag
smoothly and so, I agree, the length of the data related to a tag are
needed to be present with the tag itself. I see to kind of tag, some with
the length of data available in the u32 following the tag and other without
the length encoded.

Tags without length encoded are followed by one u32 field containing data
related to the tag. This allow to avoid a lot of 'TAG_XXX 0x04 u32_data'
Indeed, I have the feeling that quite a lot of tags will have only one u32
field as data part and so, having 0x04 encoded (cell aligned) each time.

A tag value is on 32bits. We can define the structure of this value.
  - bit 31 (msb):
     - 0: This is not a new kind to tag and so it doesn't follow this definition.
          All existing tags are in this categorie
     - 1: New kind of tag adopting this definition

  - bits 30..28:
     tag data length encoding
     0b000: No data related to the tag
     0b001: 1 data cell (u32) directly follows the tag
     0b010: 2 data cells (2 u32) directly follow the tag
     ...
     0b110: 6 data cells (6 u32) directly follow the tag
     0b111: Tag is followed by a cell (u32) indicating the size (in bytes)
            of data available just after this cell (including any padding
            if needed).
	    Because this size include some possible padding, its value is a
            multiple of 4 bytes.
            The offset of the tag + 4 + size points to the next tag.
          

  - bit 27..0
     tag specific identifier

With that definition, the following tags can be defined:
  - FDT_INFO_PROPERTY (new tag, length encoding): 0xf0000001
     This tag is available after a property.
     It is followed by a cell for the length of data, the data part is a
     sequence of tags (and related data) giving information related to the
     last property available before the tag.

  - FDT_REF_LOCAL (new tag, 1 cell data): 0x90000002:
     The cell after this tag is the offset in the property where a local
     phandle is available

  - FDT_REF_PHANDLE (new tag, length encoding): 0xf0000003
     Cf. patch 11 for definition
     It is followed by a cell for the length of data. The data part is
     composed of:
       - offset (u32)
       - label (string including \0)
       - padding if needed to have next item aligned on 32bits


With that defined, supposing the following dts example:
  --- 8< ---
  /* 'foo' is a reference to local node,
   * 'bar' is a reference to an external node
   */
  prop = <1 2 &foo &bar1>;
  --- 8< ---

The dtb will see the following structure:
FDT_PROP ...
FDT_INFO_PROPERTY (0xf0000001)
  28 (length = (4+4)+(4+4+12) bytes)
  FDT_REF_LOCAL (0x90000002)
    0x8                             <--- offset of &foo
  FDT_REF_PHANDLE (0xf0000003)
    12 (length = 4+4+1+3 bytes)
    0xc                             <--- offset of &bar
    "bar1" + its \0                 <-- reference to resolve
    0x00 0x00 0x00                  <-- 3 bytes padding

Adding FDT_TYPE_U32 later will consist in defining
its value, probably a 0x9 family (1 cell after the tag for the
offset value)

At any point, only looking at the higher part of the tag (i.e. 0xN.......), we
can skip the tag and its data if don't know about the tag.
 - 0x0: Old tag format
    -> Error if unknown

 - 0x8 to 0xe: New format followed by 0 (0x8) to 6 cells of data
    -> Ignore if unknown and skip the N cells of data to look at the next

 - 0xf: New format followed by 1 cell giving the size of following data.
    -> Ignore if unknown and read the length available in the cell after the
       tag, skip length byte of data to look at the next.
       If the length read is not a multiple of 4: Error, invalid tag.


For this series we need the container tags:
- FDT_INFO_PROPERTY for information related to a property
  Among known tags defined in this series, only FDT_REF_LOCAL and
  FDT_REF_PHANDLE can be grouped into a FDT_INFO_PROPERTY.

- FDT_INFO_NODE for information related to a node
  Among known tags defined in this series, only FDT_EXPORT_SYM_LOCAL
  and FDT_EXPORT_SYM_REF can be grouped into a FDT_INFO_NODE.

- FDT_INFO_DTB for information related to the dtb
  Among known tags defined in this series, only FDT_IMPORT_SYM can
  be present into a FDT_INFO_DTB.

IMHO, the new tag FDT_BEGIN_NODE_REF related to orphan nodes doesn't
have to be in one of those containers. Indeed, FDT_BEGIN_NODE_REF
is more a node definition than a metadata.

Rob, does this could fit with what you expect?

If it does, is it relevant to keep the length cell available in 0xf
family to be in bytes. It should be a multiple of 4 in all cases and
so it can be given in the number of 32bit words instead of bytes.

Best regards,
Hervé

Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by David Gibson 2 weeks, 5 days ago
On Wed, Jan 14, 2026 at 05:18:22PM +0100, Herve Codina wrote:
> Hi Rob,
> 
> On Tue, 13 Jan 2026 12:44:07 -0600
> Rob Herring <robh@kernel.org> wrote:
> 
> > On Mon, Jan 12, 2026 at 8:20 AM Herve Codina <herve.codina@bootlin.com> wrote:
[snip]
> > >   - Patches 13..17: Introduce addons device-tree
> > >
> > >     This part introduce the new /addon/ dts keyword
> > >
> > >   - Patches 18..30: Introduce /export/ keyword and related dtb tags
> > >
> > >     This part introduces the new /export/ dts keyword (details in patch
> > >     20) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.
> > >
> > >     FDT_EXPORT_SYM (details in patch 25) is used when the exported
> > >     symbol involved is a local node and FDT_EXPORT_SYM_REF (details in
> > >     patch 29) is used when the node involved is a non local node.  
> > 
> > More generally, would these just be "node metadata" tags?
> > 
> 
> I think we can have metadata at 3 differents levels:
> - Property
> - Node
> - Global dtb

This is a really minor point, but I don't especially like the term
"metadata" for the symbol / fixup information.  Although it's
technically accurate that it's metadata for the property bytestrings,
in most contexts "metadata" makes me think only of tree global
metadata.  By analogy, symbols and fixup information in a .so or .a
could be seen as metadata to the raw code / data bytes, but I wouldn't
normally use that term for it (whereas I might for, say, the soname or
certain .note sections).

> With the suggestion you did on patch 6 related to FDT_REF_LOCAL and if I
> understood correctly, you expect to have a kind of "container" tag to group
> metadata on each level.
> 
> Also you expect to have the ability to handle all 'for now unknown' tag
> smoothly and so, I agree, the length of the data related to a tag are
> needed to be present with the tag itself. I see to kind of tag, some with
> the length of data available in the u32 following the tag and other without
> the length encoded.
> 
> Tags without length encoded are followed by one u32 field containing data
> related to the tag. This allow to avoid a lot of 'TAG_XXX 0x04 u32_data'
> Indeed, I have the feeling that quite a lot of tags will have only one u32
> field as data part and so, having 0x04 encoded (cell aligned) each time.
> 
> A tag value is on 32bits. We can define the structure of this value.
>   - bit 31 (msb):
>      - 0: This is not a new kind to tag and so it doesn't follow this definition.
>           All existing tags are in this categorie
>      - 1: New kind of tag adopting this definition
> 
>   - bits 30..28:
>      tag data length encoding
>      0b000: No data related to the tag
>      0b001: 1 data cell (u32) directly follows the tag
>      0b010: 2 data cells (2 u32) directly follow the tag
>      ...
>      0b110: 6 data cells (6 u32) directly follow the tag
>      0b111: Tag is followed by a cell (u32) indicating the size (in bytes)
>             of data available just after this cell (including any padding
>             if needed).
> 	    Because this size include some possible padding, its value is a
>             multiple of 4 bytes.
>             The offset of the tag + 4 + size points to the next tag.
>           
> 
>   - bit 27..0
>      tag specific identifier

As noted elsewhere, I'm not necessarily opposed to having a general
length encoding.  However, for each new tag I think we need to think
carefully about whether it really is safe for older software that
doesn't understand it to just skip it.

> With that definition, the following tags can be defined:
>   - FDT_INFO_PROPERTY (new tag, length encoding): 0xf0000001
>      This tag is available after a property.
>      It is followed by a cell for the length of data, the data part is a
>      sequence of tags (and related data) giving information related to the
>      last property available before the tag.

I'd prefer to avoid an additional layer of nesting here - I'd rather
just have multiple top level tags.

>   - FDT_REF_LOCAL (new tag, 1 cell data): 0x90000002:
>      The cell after this tag is the offset in the property where a local
>      phandle is available
> 
>   - FDT_REF_PHANDLE (new tag, length encoding): 0xf0000003
>      Cf. patch 11 for definition
>      It is followed by a cell for the length of data. The data part is
>      composed of:
>        - offset (u32)
>        - label (string including \0)
>        - padding if needed to have next item aligned on 32bits
> 
> 
> With that defined, supposing the following dts example:
>   --- 8< ---
>   /* 'foo' is a reference to local node,
>    * 'bar' is a reference to an external node
>    */
>   prop = <1 2 &foo &bar1>;
>   --- 8< ---
> 
> The dtb will see the following structure:
> FDT_PROP ...
> FDT_INFO_PROPERTY (0xf0000001)
>   28 (length = (4+4)+(4+4+12) bytes)
>   FDT_REF_LOCAL (0x90000002)
>     0x8                             <--- offset of &foo
>   FDT_REF_PHANDLE (0xf0000003)
>     12 (length = 4+4+1+3 bytes)
>     0xc                             <--- offset of &bar
>     "bar1" + its \0                 <-- reference to resolve
>     0x00 0x00 0x00                  <-- 3 bytes padding
> 
> Adding FDT_TYPE_U32 later will consist in defining
> its value, probably a 0x9 family (1 cell after the tag for the
> offset value)
> 
> At any point, only looking at the higher part of the tag (i.e. 0xN.......), we
> can skip the tag and its data if don't know about the tag.
>  - 0x0: Old tag format
>     -> Error if unknown
> 
>  - 0x8 to 0xe: New format followed by 0 (0x8) to 6 cells of data
>     -> Ignore if unknown and skip the N cells of data to look at the next
> 
>  - 0xf: New format followed by 1 cell giving the size of following data.
>     -> Ignore if unknown and read the length available in the cell after the
>        tag, skip length byte of data to look at the next.
>        If the length read is not a multiple of 4: Error, invalid tag.
> 
> 
> For this series we need the container tags:
> - FDT_INFO_PROPERTY for information related to a property
>   Among known tags defined in this series, only FDT_REF_LOCAL and
>   FDT_REF_PHANDLE can be grouped into a FDT_INFO_PROPERTY.
> 
> - FDT_INFO_NODE for information related to a node
>   Among known tags defined in this series, only FDT_EXPORT_SYM_LOCAL
>   and FDT_EXPORT_SYM_REF can be grouped into a FDT_INFO_NODE.
> 
> - FDT_INFO_DTB for information related to the dtb
>   Among known tags defined in this series, only FDT_IMPORT_SYM can
>   be present into a FDT_INFO_DTB.
> 
> IMHO, the new tag FDT_BEGIN_NODE_REF related to orphan nodes doesn't
> have to be in one of those containers. Indeed, FDT_BEGIN_NODE_REF
> is more a node definition than a metadata.

That's a perfect example of a new tag that absolutely cannot be just
skipped if not understood.  Software *must* hard error if they
encounter this and don't understand it.

> Rob, does this could fit with what you expect?
> 
> If it does, is it relevant to keep the length cell available in 0xf
> family to be in bytes. It should be a multiple of 4 in all cases and
> so it can be given in the number of 32bit words instead of bytes.
> 
> Best regards,
> Hervé
> 
> 

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Herve Codina 1 week, 3 days ago
Hi Rob, David,

On Mon, 19 Jan 2026 17:00:44 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

...
> > 
> > I think we can have metadata at 3 differents levels:
> > - Property
> > - Node
> > - Global dtb  
> 
> This is a really minor point, but I don't especially like the term
> "metadata" for the symbol / fixup information.  Although it's
> technically accurate that it's metadata for the property bytestrings,
> in most contexts "metadata" makes me think only of tree global
> metadata.  By analogy, symbols and fixup information in a .so or .a
> could be seen as metadata to the raw code / data bytes, but I wouldn't
> normally use that term for it (whereas I might for, say, the soname or
> certain .note sections).
> 
> > With the suggestion you did on patch 6 related to FDT_REF_LOCAL and if I
> > understood correctly, you expect to have a kind of "container" tag to group
> > metadata on each level.
> > 
> > Also you expect to have the ability to handle all 'for now unknown' tag
> > smoothly and so, I agree, the length of the data related to a tag are
> > needed to be present with the tag itself. I see to kind of tag, some with
> > the length of data available in the u32 following the tag and other without
> > the length encoded.
> > 
> > Tags without length encoded are followed by one u32 field containing data
> > related to the tag. This allow to avoid a lot of 'TAG_XXX 0x04 u32_data'
> > Indeed, I have the feeling that quite a lot of tags will have only one u32
> > field as data part and so, having 0x04 encoded (cell aligned) each time.
> > 
> > A tag value is on 32bits. We can define the structure of this value.
> >   - bit 31 (msb):
> >      - 0: This is not a new kind to tag and so it doesn't follow this definition.
> >           All existing tags are in this categorie
> >      - 1: New kind of tag adopting this definition
> > 
> >   - bits 30..28:
> >      tag data length encoding
> >      0b000: No data related to the tag
> >      0b001: 1 data cell (u32) directly follows the tag
> >      0b010: 2 data cells (2 u32) directly follow the tag
> >      ...
> >      0b110: 6 data cells (6 u32) directly follow the tag
> >      0b111: Tag is followed by a cell (u32) indicating the size (in bytes)
> >             of data available just after this cell (including any padding
> >             if needed).
> > 	    Because this size include some possible padding, its value is a
> >             multiple of 4 bytes.
> >             The offset of the tag + 4 + size points to the next tag.
> >           
> > 
> >   - bit 27..0
> >      tag specific identifier  
> 
> As noted elsewhere, I'm not necessarily opposed to having a general
> length encoding.  However, for each new tag I think we need to think
> carefully about whether it really is safe for older software that
> doesn't understand it to just skip it.
> 
> > With that definition, the following tags can be defined:
> >   - FDT_INFO_PROPERTY (new tag, length encoding): 0xf0000001
> >      This tag is available after a property.
> >      It is followed by a cell for the length of data, the data part is a
> >      sequence of tags (and related data) giving information related to the
> >      last property available before the tag.  
> 
> I'd prefer to avoid an additional layer of nesting here - I'd rather
> just have multiple top level tags.
> 
> >   - FDT_REF_LOCAL (new tag, 1 cell data): 0x90000002:
> >      The cell after this tag is the offset in the property where a local
> >      phandle is available
> > 
> >   - FDT_REF_PHANDLE (new tag, length encoding): 0xf0000003
> >      Cf. patch 11 for definition
> >      It is followed by a cell for the length of data. The data part is
> >      composed of:
> >        - offset (u32)
> >        - label (string including \0)
> >        - padding if needed to have next item aligned on 32bits
> > 
> > 
> > With that defined, supposing the following dts example:
> >   --- 8< ---
> >   /* 'foo' is a reference to local node,
> >    * 'bar' is a reference to an external node
> >    */
> >   prop = <1 2 &foo &bar1>;
> >   --- 8< ---
> > 
> > The dtb will see the following structure:
> > FDT_PROP ...
> > FDT_INFO_PROPERTY (0xf0000001)
> >   28 (length = (4+4)+(4+4+12) bytes)
> >   FDT_REF_LOCAL (0x90000002)
> >     0x8                             <--- offset of &foo
> >   FDT_REF_PHANDLE (0xf0000003)
> >     12 (length = 4+4+1+3 bytes)
> >     0xc                             <--- offset of &bar
> >     "bar1" + its \0                 <-- reference to resolve
> >     0x00 0x00 0x00                  <-- 3 bytes padding
> > 
> > Adding FDT_TYPE_U32 later will consist in defining
> > its value, probably a 0x9 family (1 cell after the tag for the
> > offset value)
> > 
> > At any point, only looking at the higher part of the tag (i.e. 0xN.......), we
> > can skip the tag and its data if don't know about the tag.
> >  - 0x0: Old tag format  
> >     -> Error if unknown  
> > 
> >  - 0x8 to 0xe: New format followed by 0 (0x8) to 6 cells of data  
> >     -> Ignore if unknown and skip the N cells of data to look at the next  
> > 
> >  - 0xf: New format followed by 1 cell giving the size of following data.  
> >     -> Ignore if unknown and read the length available in the cell after the  
> >        tag, skip length byte of data to look at the next.
> >        If the length read is not a multiple of 4: Error, invalid tag.
> > 
> > 
> > For this series we need the container tags:
> > - FDT_INFO_PROPERTY for information related to a property
> >   Among known tags defined in this series, only FDT_REF_LOCAL and
> >   FDT_REF_PHANDLE can be grouped into a FDT_INFO_PROPERTY.
> > 
> > - FDT_INFO_NODE for information related to a node
> >   Among known tags defined in this series, only FDT_EXPORT_SYM_LOCAL
> >   and FDT_EXPORT_SYM_REF can be grouped into a FDT_INFO_NODE.
> > 
> > - FDT_INFO_DTB for information related to the dtb
> >   Among known tags defined in this series, only FDT_IMPORT_SYM can
> >   be present into a FDT_INFO_DTB.
> > 
> > IMHO, the new tag FDT_BEGIN_NODE_REF related to orphan nodes doesn't
> > have to be in one of those containers. Indeed, FDT_BEGIN_NODE_REF
> > is more a node definition than a metadata.  
> 
> That's a perfect example of a new tag that absolutely cannot be just
> skipped if not understood.  Software *must* hard error if they
> encounter this and don't understand it.
> 

I have started to implement this "unknown tag" feature based on the tag
values definition presented here and with complementary feature (bit
allowing to skip an unknown tag) as presented in patch 2 discussion [1].

I didn't introduce any FDT_INFO_xxx tags. They introduce nesting tags
and David seems not agree with that.

I use simple test tags to have some "unknown tags" in dtb and looked at
the way to handle them.

When we read a dtb, no problem, we just skip "unknown tags" if we are
allowed to (flag in tag value).

The issue comes when we modify a dtb.

libftd allows to modify a dtb. It allows to add/modify/remove properties
and nodes. Bootloaders for instance use this capability to update a dtb
before passing it to the kernel.

How should we handle unknown tags in this context?

We don't knwow about the meaning of those tags (unknown tags) and so, we
don't know if those tags are still consistent with modifications done?

A property can be followed by an unknown tags related to this property.
Also a property can be followed by an unknown tag related to the node.
We simply don't know.

Any modification can impact unknown tags and make them inconsistent.
Here again, we simply don't know.

Should we avoid any modification when a dtb contains unknown tags?
Should we simply remove all unknown tags when a modification is done?

Bootloaders need to modify the dtb. Avoiding modification is a no-go.
Removing "unknown tags" when a modification is done will lead to removing
all unknown tags at bootloader stage.

Rob, David, any opinion related to this specific issue and the strategy we
should follow when modification are involved?

[1] https://lore.kernel.org/all/20260119104852.3e7043ee@bootlin.com/

Best regards,
Hervé
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Rob Herring 1 week, 3 days ago
On Tue, Jan 27, 2026 at 9:19 AM Herve Codina <herve.codina@bootlin.com> wrote:
>
> Hi Rob, David,
>
> On Mon, 19 Jan 2026 17:00:44 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
>
> ...
> > >
> > > I think we can have metadata at 3 differents levels:
> > > - Property
> > > - Node
> > > - Global dtb
> >
> > This is a really minor point, but I don't especially like the term
> > "metadata" for the symbol / fixup information.  Although it's
> > technically accurate that it's metadata for the property bytestrings,
> > in most contexts "metadata" makes me think only of tree global
> > metadata.  By analogy, symbols and fixup information in a .so or .a
> > could be seen as metadata to the raw code / data bytes, but I wouldn't
> > normally use that term for it (whereas I might for, say, the soname or
> > certain .note sections).
> >
> > > With the suggestion you did on patch 6 related to FDT_REF_LOCAL and if I
> > > understood correctly, you expect to have a kind of "container" tag to group
> > > metadata on each level.
> > >
> > > Also you expect to have the ability to handle all 'for now unknown' tag
> > > smoothly and so, I agree, the length of the data related to a tag are
> > > needed to be present with the tag itself. I see to kind of tag, some with
> > > the length of data available in the u32 following the tag and other without
> > > the length encoded.
> > >
> > > Tags without length encoded are followed by one u32 field containing data
> > > related to the tag. This allow to avoid a lot of 'TAG_XXX 0x04 u32_data'
> > > Indeed, I have the feeling that quite a lot of tags will have only one u32
> > > field as data part and so, having 0x04 encoded (cell aligned) each time.
> > >
> > > A tag value is on 32bits. We can define the structure of this value.
> > >   - bit 31 (msb):
> > >      - 0: This is not a new kind to tag and so it doesn't follow this definition.
> > >           All existing tags are in this categorie
> > >      - 1: New kind of tag adopting this definition
> > >
> > >   - bits 30..28:
> > >      tag data length encoding
> > >      0b000: No data related to the tag
> > >      0b001: 1 data cell (u32) directly follows the tag
> > >      0b010: 2 data cells (2 u32) directly follow the tag
> > >      ...
> > >      0b110: 6 data cells (6 u32) directly follow the tag
> > >      0b111: Tag is followed by a cell (u32) indicating the size (in bytes)
> > >             of data available just after this cell (including any padding
> > >             if needed).
> > >         Because this size include some possible padding, its value is a
> > >             multiple of 4 bytes.
> > >             The offset of the tag + 4 + size points to the next tag.
> > >
> > >
> > >   - bit 27..0
> > >      tag specific identifier
> >
> > As noted elsewhere, I'm not necessarily opposed to having a general
> > length encoding.  However, for each new tag I think we need to think
> > carefully about whether it really is safe for older software that
> > doesn't understand it to just skip it.
> >
> > > With that definition, the following tags can be defined:
> > >   - FDT_INFO_PROPERTY (new tag, length encoding): 0xf0000001
> > >      This tag is available after a property.
> > >      It is followed by a cell for the length of data, the data part is a
> > >      sequence of tags (and related data) giving information related to the
> > >      last property available before the tag.
> >
> > I'd prefer to avoid an additional layer of nesting here - I'd rather
> > just have multiple top level tags.
> >
> > >   - FDT_REF_LOCAL (new tag, 1 cell data): 0x90000002:
> > >      The cell after this tag is the offset in the property where a local
> > >      phandle is available
> > >
> > >   - FDT_REF_PHANDLE (new tag, length encoding): 0xf0000003
> > >      Cf. patch 11 for definition
> > >      It is followed by a cell for the length of data. The data part is
> > >      composed of:
> > >        - offset (u32)
> > >        - label (string including \0)
> > >        - padding if needed to have next item aligned on 32bits
> > >
> > >
> > > With that defined, supposing the following dts example:
> > >   --- 8< ---
> > >   /* 'foo' is a reference to local node,
> > >    * 'bar' is a reference to an external node
> > >    */
> > >   prop = <1 2 &foo &bar1>;
> > >   --- 8< ---
> > >
> > > The dtb will see the following structure:
> > > FDT_PROP ...
> > > FDT_INFO_PROPERTY (0xf0000001)
> > >   28 (length = (4+4)+(4+4+12) bytes)
> > >   FDT_REF_LOCAL (0x90000002)
> > >     0x8                             <--- offset of &foo
> > >   FDT_REF_PHANDLE (0xf0000003)
> > >     12 (length = 4+4+1+3 bytes)
> > >     0xc                             <--- offset of &bar
> > >     "bar1" + its \0                 <-- reference to resolve
> > >     0x00 0x00 0x00                  <-- 3 bytes padding
> > >
> > > Adding FDT_TYPE_U32 later will consist in defining
> > > its value, probably a 0x9 family (1 cell after the tag for the
> > > offset value)
> > >
> > > At any point, only looking at the higher part of the tag (i.e. 0xN.......), we
> > > can skip the tag and its data if don't know about the tag.
> > >  - 0x0: Old tag format
> > >     -> Error if unknown
> > >
> > >  - 0x8 to 0xe: New format followed by 0 (0x8) to 6 cells of data
> > >     -> Ignore if unknown and skip the N cells of data to look at the next
> > >
> > >  - 0xf: New format followed by 1 cell giving the size of following data.
> > >     -> Ignore if unknown and read the length available in the cell after the
> > >        tag, skip length byte of data to look at the next.
> > >        If the length read is not a multiple of 4: Error, invalid tag.
> > >
> > >
> > > For this series we need the container tags:
> > > - FDT_INFO_PROPERTY for information related to a property
> > >   Among known tags defined in this series, only FDT_REF_LOCAL and
> > >   FDT_REF_PHANDLE can be grouped into a FDT_INFO_PROPERTY.
> > >
> > > - FDT_INFO_NODE for information related to a node
> > >   Among known tags defined in this series, only FDT_EXPORT_SYM_LOCAL
> > >   and FDT_EXPORT_SYM_REF can be grouped into a FDT_INFO_NODE.
> > >
> > > - FDT_INFO_DTB for information related to the dtb
> > >   Among known tags defined in this series, only FDT_IMPORT_SYM can
> > >   be present into a FDT_INFO_DTB.
> > >
> > > IMHO, the new tag FDT_BEGIN_NODE_REF related to orphan nodes doesn't
> > > have to be in one of those containers. Indeed, FDT_BEGIN_NODE_REF
> > > is more a node definition than a metadata.
> >
> > That's a perfect example of a new tag that absolutely cannot be just
> > skipped if not understood.  Software *must* hard error if they
> > encounter this and don't understand it.
> >
>
> I have started to implement this "unknown tag" feature based on the tag
> values definition presented here and with complementary feature (bit
> allowing to skip an unknown tag) as presented in patch 2 discussion [1].
>
> I didn't introduce any FDT_INFO_xxx tags. They introduce nesting tags
> and David seems not agree with that.
>
> I use simple test tags to have some "unknown tags" in dtb and looked at
> the way to handle them.
>
> When we read a dtb, no problem, we just skip "unknown tags" if we are
> allowed to (flag in tag value).
>
> The issue comes when we modify a dtb.
>
> libftd allows to modify a dtb. It allows to add/modify/remove properties
> and nodes. Bootloaders for instance use this capability to update a dtb
> before passing it to the kernel.
>
> How should we handle unknown tags in this context?
>
> We don't knwow about the meaning of those tags (unknown tags) and so, we
> don't know if those tags are still consistent with modifications done?

I don't think we have any choice, but to remove the tags.

> A property can be followed by an unknown tags related to this property.
> Also a property can be followed by an unknown tag related to the node.
> We simply don't know.

We should be able to distinguish between node and property tags at
least. Either by value or location. IOW, node tags must follow a
BEGIN_NODE tag and property tags must follow a property.

> Any modification can impact unknown tags and make them inconsistent.
> Here again, we simply don't know.
>
> Should we avoid any modification when a dtb contains unknown tags?

You answered that below. :)

> Should we simply remove all unknown tags when a modification is done?

For that node or property, yes. For the whole DTB, no. Though does
modifying a property constitute modifying a node?

>
> Bootloaders need to modify the dtb. Avoiding modification is a no-go.
> Removing "unknown tags" when a modification is done will lead to removing
> all unknown tags at bootloader stage.
>
> Rob, David, any opinion related to this specific issue and the strategy we
> should follow when modification are involved?

Perhaps we should separate the 'version we can read' and the 'version
we can write'. Let's say it is v18 that allows unknown tags, but v19
that actually adds any specific tags (or adds tags that are not safe
to ignore). Then a DTB with last_compat_version=v18 and version=v19
can be read by libfdt supporting v18+, but requires v19 libfdt to
write it. We'd still have to allow writing a v19 DTB with v18 libfdt,
but we'd have to downgrade the version to v18 (or downgrade if we had
to drop some tags).

The DT and bootloader/firmware are typically bundled together and in
that case there shouldn't be an issue of different versions. You can
have a newer DTB instead of the firmware one, but that doesn't need to
have the new tags (if the OS does require them, then it broke
compatibility).

Even with this series, I think everything can be ignored if you are
only looking for compatibility with what we have now. It's only if you
want to support the addons, then you need v?? which defines the set of
tags for addons. So I'm not certain a tag bit is the right way to say
safe to ignore or not. I think if we have a new tag that every client
has to understand and handle, then that's a major version change. I
think the original intent with the versions was 0x10 (aka 16) was a
new major version, 0x13(v18) would be another minor rev, and 0x20
would be the next major version.

Rob
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by David Gibson 1 week, 2 days ago
On Tue, Jan 27, 2026 at 04:06:12PM -0600, Rob Herring wrote:
> On Tue, Jan 27, 2026 at 9:19 AM Herve Codina <herve.codina@bootlin.com> wrote:
> >
> > Hi Rob, David,
> >
> > On Mon, 19 Jan 2026 17:00:44 +1100
> > David Gibson <david@gibson.dropbear.id.au> wrote:
> >
> > ...
> > > >
> > > > I think we can have metadata at 3 differents levels:
> > > > - Property
> > > > - Node
> > > > - Global dtb
> > >
> > > This is a really minor point, but I don't especially like the term
> > > "metadata" for the symbol / fixup information.  Although it's
> > > technically accurate that it's metadata for the property bytestrings,
> > > in most contexts "metadata" makes me think only of tree global
> > > metadata.  By analogy, symbols and fixup information in a .so or .a
> > > could be seen as metadata to the raw code / data bytes, but I wouldn't
> > > normally use that term for it (whereas I might for, say, the soname or
> > > certain .note sections).
> > >
> > > > With the suggestion you did on patch 6 related to FDT_REF_LOCAL and if I
> > > > understood correctly, you expect to have a kind of "container" tag to group
> > > > metadata on each level.
> > > >
> > > > Also you expect to have the ability to handle all 'for now unknown' tag
> > > > smoothly and so, I agree, the length of the data related to a tag are
> > > > needed to be present with the tag itself. I see to kind of tag, some with
> > > > the length of data available in the u32 following the tag and other without
> > > > the length encoded.
> > > >
> > > > Tags without length encoded are followed by one u32 field containing data
> > > > related to the tag. This allow to avoid a lot of 'TAG_XXX 0x04 u32_data'
> > > > Indeed, I have the feeling that quite a lot of tags will have only one u32
> > > > field as data part and so, having 0x04 encoded (cell aligned) each time.
> > > >
> > > > A tag value is on 32bits. We can define the structure of this value.
> > > >   - bit 31 (msb):
> > > >      - 0: This is not a new kind to tag and so it doesn't follow this definition.
> > > >           All existing tags are in this categorie
> > > >      - 1: New kind of tag adopting this definition
> > > >
> > > >   - bits 30..28:
> > > >      tag data length encoding
> > > >      0b000: No data related to the tag
> > > >      0b001: 1 data cell (u32) directly follows the tag
> > > >      0b010: 2 data cells (2 u32) directly follow the tag
> > > >      ...
> > > >      0b110: 6 data cells (6 u32) directly follow the tag
> > > >      0b111: Tag is followed by a cell (u32) indicating the size (in bytes)
> > > >             of data available just after this cell (including any padding
> > > >             if needed).
> > > >         Because this size include some possible padding, its value is a
> > > >             multiple of 4 bytes.
> > > >             The offset of the tag + 4 + size points to the next tag.
> > > >
> > > >
> > > >   - bit 27..0
> > > >      tag specific identifier
> > >
> > > As noted elsewhere, I'm not necessarily opposed to having a general
> > > length encoding.  However, for each new tag I think we need to think
> > > carefully about whether it really is safe for older software that
> > > doesn't understand it to just skip it.
> > >
> > > > With that definition, the following tags can be defined:
> > > >   - FDT_INFO_PROPERTY (new tag, length encoding): 0xf0000001
> > > >      This tag is available after a property.
> > > >      It is followed by a cell for the length of data, the data part is a
> > > >      sequence of tags (and related data) giving information related to the
> > > >      last property available before the tag.
> > >
> > > I'd prefer to avoid an additional layer of nesting here - I'd rather
> > > just have multiple top level tags.
> > >
> > > >   - FDT_REF_LOCAL (new tag, 1 cell data): 0x90000002:
> > > >      The cell after this tag is the offset in the property where a local
> > > >      phandle is available
> > > >
> > > >   - FDT_REF_PHANDLE (new tag, length encoding): 0xf0000003
> > > >      Cf. patch 11 for definition
> > > >      It is followed by a cell for the length of data. The data part is
> > > >      composed of:
> > > >        - offset (u32)
> > > >        - label (string including \0)
> > > >        - padding if needed to have next item aligned on 32bits
> > > >
> > > >
> > > > With that defined, supposing the following dts example:
> > > >   --- 8< ---
> > > >   /* 'foo' is a reference to local node,
> > > >    * 'bar' is a reference to an external node
> > > >    */
> > > >   prop = <1 2 &foo &bar1>;
> > > >   --- 8< ---
> > > >
> > > > The dtb will see the following structure:
> > > > FDT_PROP ...
> > > > FDT_INFO_PROPERTY (0xf0000001)
> > > >   28 (length = (4+4)+(4+4+12) bytes)
> > > >   FDT_REF_LOCAL (0x90000002)
> > > >     0x8                             <--- offset of &foo
> > > >   FDT_REF_PHANDLE (0xf0000003)
> > > >     12 (length = 4+4+1+3 bytes)
> > > >     0xc                             <--- offset of &bar
> > > >     "bar1" + its \0                 <-- reference to resolve
> > > >     0x00 0x00 0x00                  <-- 3 bytes padding
> > > >
> > > > Adding FDT_TYPE_U32 later will consist in defining
> > > > its value, probably a 0x9 family (1 cell after the tag for the
> > > > offset value)
> > > >
> > > > At any point, only looking at the higher part of the tag (i.e. 0xN.......), we
> > > > can skip the tag and its data if don't know about the tag.
> > > >  - 0x0: Old tag format
> > > >     -> Error if unknown
> > > >
> > > >  - 0x8 to 0xe: New format followed by 0 (0x8) to 6 cells of data
> > > >     -> Ignore if unknown and skip the N cells of data to look at the next
> > > >
> > > >  - 0xf: New format followed by 1 cell giving the size of following data.
> > > >     -> Ignore if unknown and read the length available in the cell after the
> > > >        tag, skip length byte of data to look at the next.
> > > >        If the length read is not a multiple of 4: Error, invalid tag.
> > > >
> > > >
> > > > For this series we need the container tags:
> > > > - FDT_INFO_PROPERTY for information related to a property
> > > >   Among known tags defined in this series, only FDT_REF_LOCAL and
> > > >   FDT_REF_PHANDLE can be grouped into a FDT_INFO_PROPERTY.
> > > >
> > > > - FDT_INFO_NODE for information related to a node
> > > >   Among known tags defined in this series, only FDT_EXPORT_SYM_LOCAL
> > > >   and FDT_EXPORT_SYM_REF can be grouped into a FDT_INFO_NODE.
> > > >
> > > > - FDT_INFO_DTB for information related to the dtb
> > > >   Among known tags defined in this series, only FDT_IMPORT_SYM can
> > > >   be present into a FDT_INFO_DTB.
> > > >
> > > > IMHO, the new tag FDT_BEGIN_NODE_REF related to orphan nodes doesn't
> > > > have to be in one of those containers. Indeed, FDT_BEGIN_NODE_REF
> > > > is more a node definition than a metadata.
> > >
> > > That's a perfect example of a new tag that absolutely cannot be just
> > > skipped if not understood.  Software *must* hard error if they
> > > encounter this and don't understand it.
> > >
> >
> > I have started to implement this "unknown tag" feature based on the tag
> > values definition presented here and with complementary feature (bit
> > allowing to skip an unknown tag) as presented in patch 2 discussion [1].
> >
> > I didn't introduce any FDT_INFO_xxx tags. They introduce nesting tags
> > and David seems not agree with that.

Right.  I don't see that they provide any advantage, so it's just
extra complexity.  I'm open to persuasion if it turns out there's a
concrete reason for it.

> > I use simple test tags to have some "unknown tags" in dtb and looked at
> > the way to handle them.
> >
> > When we read a dtb, no problem, we just skip "unknown tags" if we are
> > allowed to (flag in tag value).
> >
> > The issue comes when we modify a dtb.
> >
> > libftd allows to modify a dtb. It allows to add/modify/remove properties
> > and nodes. Bootloaders for instance use this capability to update a dtb
> > before passing it to the kernel.
> >
> > How should we handle unknown tags in this context?
> >
> > We don't knwow about the meaning of those tags (unknown tags) and so, we
> > don't know if those tags are still consistent with modifications done?
> 
> I don't think we have any choice, but to remove the tags.

Agreed.

> > A property can be followed by an unknown tags related to this property.
> > Also a property can be followed by an unknown tag related to the node.
> > We simply don't know.
> 
> We should be able to distinguish between node and property tags at
> least. Either by value or location. IOW, node tags must follow a
> BEGIN_NODE tag and property tags must follow a property.

This seems reasonable to me.  The fact that these properties are
considered tied to a specific node or property should be stated
explicitly in the general description of "ignorable" tags, though.  As
Herve pointed out, we still have the option of adding more "old style"
tags if we need something that doesn't fit the new constraints.

> > Any modification can impact unknown tags and make them inconsistent.
> > Here again, we simply don't know.
> >
> > Should we avoid any modification when a dtb contains unknown tags?
> 
> You answered that below. :)
> 
> > Should we simply remove all unknown tags when a modification is done?
> 
> For that node or property, yes. For the whole DTB, no. Though does
> modifying a property constitute modifying a node?
> 
> >
> > Bootloaders need to modify the dtb. Avoiding modification is a no-go.
> > Removing "unknown tags" when a modification is done will lead to removing
> > all unknown tags at bootloader stage.
> >
> > Rob, David, any opinion related to this specific issue and the strategy we
> > should follow when modification are involved?
> 
> Perhaps we should separate the 'version we can read' and the 'version
> we can write'. Let's say it is v18 that allows unknown tags, but v19
> that actually adds any specific tags (or adds tags that are not safe
> to ignore). Then a DTB with last_compat_version=v18 and version=v19
> can be read by libfdt supporting v18+, but requires v19 libfdt to
> write it. We'd still have to allow writing a v19 DTB with v18 libfdt,
> but we'd have to downgrade the version to v18 (or downgrade if we had
> to drop some tags).
> 
> The DT and bootloader/firmware are typically bundled together and in
> that case there shouldn't be an issue of different versions. You can
> have a newer DTB instead of the firmware one, but that doesn't need to
> have the new tags (if the OS does require them, then it broke
> compatibility).
> 
> Even with this series, I think everything can be ignored if you are
> only looking for compatibility with what we have now.

Not if you rely on reading phandle values.

> It's only if you
> want to support the addons, then you need v?? which defines the set of
> tags for addons. So I'm not certain a tag bit is the right way to say
> safe to ignore or not. I think if we have a new tag that every client
> has to understand and handle, then that's a major version change. I
> think the original intent with the versions was 0x10 (aka 16) was a
> new major version, 0x13(v18) would be another minor rev, and 0x20
> would be the next major version.

I don't think it was thought out in that much detail at the time, but
that seems a reasonable approach to me.

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson
Re: [RFC PATCH 00/77] Add support for dtb metadata and addon device-trees
Posted by Ayush Singh 3 weeks, 5 days ago
On 1/12/26 7:48 PM, Herve Codina wrote:

> This big picture series adds support for dtb metadata and addon
> device-trees.
>
> Before giving details about the series content, let me give a little bit
> of context.
>
> The use-case is to support additional boards that can be hot-plugged to
> a connector available in a base board. This connector is standardized in
> terms of resources available on each pin. Any additional boards
> compatible with the connector should be able to be connected to base
> board and all base boards where this connector is implemented should
> support any additional boards.
>
> TLDR: The last patch, patch 77, gives an example of dts and dtsa (new
>        addon device-tree) handling this use-case. It provides an example
>        of a realistic base board description (dts) and an realistic
>        additional board description (dtsa).
>
> Each base board is described by its own device-tree and the real
> resource connected to the connector depends on each board. For instance
> an i2c bus on the connector can come from the i2c1 controller from base
> board A and i2c5 controller from base board B. This is obviously the
> case for all resources wired to the connector.
>
> On the other hand, the device-tree describing the additional board has
> no reason to be changed based on the base board the additional board is
> going to be connected. Indeed this device-tree describes the additional
> board hardware and this hardware doesn't change if the additional board
> is connected to the base board A or the base board B.
>
> In order to extend a device-tree at runtime, a device-tree overlay can
> be used. The drawback of current overlay implementation is that an
> overlay is tightly coupled with the base device-tree it is applied to.
>
> If a symbol of the base device-tree has to be used by the overlay, all
> symbols available in the base device-tree need to be visible by the
> overlay and the overlay can use only those symbol without any kind of
> name translation.
>
> With current overlay implementation, a overlay depends on the base
> board. Indeed, if an overlay wants to add an I2C device on the I2C bus
> available on the base board A connector, it needs to reference the i2c1
> bus whereas it needs to reference the i2c5 bus if it used with the base
> board B.
>
> In order to fix the issue, the 'export symbol' concept has been
> proposed. This concept allows some specific node to 'export' symbols in
> order to be seen by an overlay applied to this node.
>
> The use-case and the export symbol proposal have been detailed during
> a talk at ELCE 2025. Have a look at the slides [1] and/or the video [2]
> to have a clear view of the topic
>
> [1] https://bootlin.com/pub/conferences/2025/elce/ceresoli-hotplug-status.pdf
> [2] https://www.youtube.com/watch?v=C8dEQ4OzMnc
>
> The export symbol proposal based on an export-symbol node in the
> device-tree have been rejected by device-tree and dtc maintainers.
>
> A discussion about the topic has been started on the mailing-list [3].
> This discussions led to:
>
> - The addition of meta-data in dtb instead of having __fixup__, __local__fixup__,
>    an similar nodes in the device-tree used by overlays
>
> - A new kind of device-tree, an addon device-tree, in order to replace the
>    usage of the overlay device-tree in this 'hot-plugging additional board'
>    use-case.
>
> [3] https://lore.kernel.org/all/20250902105710.00512c6d@booty/
>
> This current RFC is the implementation of features discussed on the
> mailing-list. A lot of things are new in dtb format (new tags) and dts
> format (new keyword, new kind of references) and not yet mentioned in
> the standard.
>
> The purpose of this big picture RFC is to move forward on this topic
> based on code and some concrete dts / dtb example. Indeed, this RFC also
> adds tests for each feature introduced. Those tests are performed using
> dts files and the content of those dts files can also help in the
> discussion.
>
> The first patch is just a simple fix and can probably be merged out of this
> meta-data and addon discussion.
>
>    - Patches 2..12: Introduce new meta-data dtb tags based on markers
>
>      Those new tags are FDT_REF_LOCAL and FDT_REF_PHANDLE.
>
>      FDT_REF_LOCAL (details in patch 6) is used to tag property using a
>      phandle and this phandle points to a local node (i.e. a node
>      existing in the dtb).
>
>      FDT_REF_PHANDLE (details in patch 11) is used to tag a property
>      using a phandle but this phandle points to a non local node (i.e.
>      the node doesn't exist in the dtb). The reference to the node is
>      present with the tag and the phandle value has to be fixed when the
>      dtb is applied. This tag can only be present in plugins (overlays)
>      and addons dtb.
>
>    - Patches 13..17: Introduce addons device-tree
>
>      This part introduce the new /addon/ dts keyword
>
>    - Patches 18..30: Introduce /export/ keyword and related dtb tags
>
>      This part introduces the new /export/ dts keyword (details in patch
>      20) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.
>
>      FDT_EXPORT_SYM (details in patch 25) is used when the exported
>      symbol involved is a local node and FDT_EXPORT_SYM_REF (details in
>      patch 29) is used when the node involved is a non local node.
>
>    - Patches 31..38: Introduce /import/ keyword and related dtb tags
>
>      This part introduces the new /import/ dts keyword (details in patch
>      33) and the related FDT_IMPORT_SYM dtb tag (details in patch 35).
>
>    - Patches 39..63: Introduce orphan nodes
>
>      Even if the orphan nodes concept was already present in overlays,
>      the final encoding of those nodes in addon dtbs is different
>      compared to overlays dtbs.
>
>      In overlays, orphan nodes are transformed to a /fragment@n/__overlay__
>      node. This is not the way used in addons.
>
>      Indeed, in addons, orphan nodes are not transformed to fit in
>      something like /fragment@n/__overlay__. They are encoded in the dtb
>      using a specific tag.
>
>      This part, after some preparation, introduces orphan nodes (details
>      in patch 48) and the related FDT_BEGIN_NODE_REF_SYM dtb tag (details
>      in patch 56).
>
>      It also adds support for addons dts/dtb without a 'root' (details in
>      patch 58).
>
>      This part ended with the support for merging orphan node described
>      in dts when relevant (details patch 60).
>
>    - Patches 64..65: Reference orphan nodes and its sub-nodes by path
>
>      A new syntax is needed to be able to reference a an orphan node and
>      its sub-nodes by path.
>
>      This new syntax is '${$<orphan_name>/<path>}' (details in patch #60)
>
>    - Patches 66..67: Namespace labels references
>
>      Add Namespace labels references with the new syntax '&foo.bar.baz'.
>
>      This new syntax, only allowed in addons, allows to 'jump' from node
>      to node based on exported symbols defined at each node (details in
>      patch 66).
>
>    - Patches 68..71: Support for applying an addon
>
>      First, add fdt_addon_apply() in libfdt (details in patch 70) and
>      then the fdtaddon command line tool (details in patch 71).
>
>    - Patches 72..76: fdtaddon test
>
>      Several tests related to addon application
>
>    - Patch 77: A more Realistic test
>
>      A last test based on use-case we want to handle.
>
>      This last patch (and its dts and dtsa files) shows the kind of usage
>      is expected for addons.
>
>      Also it proves that metadata and addons features handles our
>      use-case.
>
> I know this series is a huge series but I would like to give the big
> picture in this RFC (I hope this was a good idea). Of course, this
> series can be split for the upstreaming step and handled by parts by
> parts. Let me know.
>
> Tests are provided for each feature. In addition to be used for testing,
> tests input source files and expected output files can be used to see
> the expected behavior related to each feature.
>
> I hope also that this first RFC will help in moving forward regarding
> this 'handling an additional board described by a device-tree' topic.
>
> Best regards,
> Hervé

Hello Herve,


I was just in the process of typing out a reply in the old thread for 
the topic regarding restarting discussion and how we should move towards 
extending DT. So imagine my surprise when this lands in my mailbox. 
Thanks for all this work.

I will go through this series and check things in reference with my 
connector + addon baord setups.


Best Regards,

Ayush Singh