RFC Add support for dtb metadata and addon device-trees
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 RFC Latest74 patches 36 repliesIn review
- v1 RFC77 patches 82 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/74 | dtc-parser.y: Avoid an empty proplistdtc-parser.y | +6 | 1 reply | |
| 2/74 | Introduce v20 dtb versiondtc.h fdtdump.c flattree.c +7 more | +22 | 1 reply | |
| 3/74 | fdtdump: Introduce get_structured_tag_data()fdtdump.c | +30 | 2 replies | |
| 4/74 | libfdt: Introduce fdt_get_structured_tag_data()libfdt/ libfdt/ | +55 | 2 replies | |
| 5/74 | libfdt: Prepare for metadata tag supportlibfdt/ libfdt/ libfdt/ +2 more | +140 | 5 replies | |
| 6/74 | dtc: Move fill_fullpaths() into build_dt_info()dtc.c livetree.c | +19 | 1 reply | |
| 7/74 | Add support for FDT_PROPDATA_PHANDLE dtb tagdata.c dtc.h fdtdump.c +6 more | +171 | 8 replies | |
| 8/74 | livetree: Improve get_node_by_phandle()livetree.c | +20 | 7 replies | |
| 9/74 | dtc: Complete REF_PHANDLE markers with ref strings and is_local flagslivetree.c | +82 | 2 replies | |
| 10/74 | tests: Add basic metadata teststests/ tests/ tests/ +3 more | +118 | 4 replies | |
| 11/74 | Add support for FDT_PROPDATA_PHANDLE_REF dtb tagfdtdump.c flattree.c libfdt/ +2 more | +165 | 2 replies | |
| 12/74 | tests: metadata: Add external phandle reference teststests/ tests/ tests/ +2 more | +64 | 1 reply | |
| 13/74 | Add support for /addon/ keywordchecks.c dtc-lexer.l dtc-parser.y +5 more | +57 | 0 replies | |
| 14/74 | tests: Add a test related to addon dt_flags header valuetests/ tests/ tests/ | +20 | 0 replies | |
| 15/74 | tests: metadata: Add a basic addon testtests/ tests/ tests/ +2 more | +46 | 0 replies | |
| 16/74 | dtc: Introduce export symbolsdtc-parser.y dtc.h flattree.c +2 more | +21 | 0 replies | |
| 17/74 | dtc: Add support for /export/ dts keyword parsingdtc-lexer.l dtc-parser.y dtc.h +1 more | +147 | 0 replies | |
| 18/74 | checks: Handle export symbols in fixup_phandle_references()checks.c | +22 | 0 replies | |
| 19/74 | dtc: Add export symbols (/export/ keyword) in generated dts filetreesource.c | +13 | 0 replies | |
| 20/74 | dtc: Extend complete_references() to handle export symbolslivetree.c | +12 | 0 replies | |
| 21/74 | Add support for FDT_EXPORT_SYM dtb tagdtc.h fdtdump.c flattree.c +5 more | +146 | 0 replies | |
| 22/74 | tests: metadata: Add export symbols with local references teststests/ tests/ tests/ +2 more | +101 | 0 replies | |
| 23/74 | dtc: Add support for export symbols sortinglivetree.c | +37 | 0 replies | |
| 24/74 | tests: metadata: Add a test for export symbols sortingtests/ tests/ tests/ +1 more | +63 | 0 replies | |
| 25/74 | Add support for FDT_EXPORT_SYM_REF dtb tagfdtdump.c flattree.c libfdt/ +2 more | +137 | 0 replies | |
| 26/74 | tests: metadata: Add export symbols with external references teststests/ tests/ tests/ +2 more | +96 | 0 replies | |
| 27/74 | dtc: Introduce import symbolsdtc-parser.y dtc.h flattree.c +2 more | +10 | 0 replies | |
| 28/74 | dtc-parser: Introduce last_header_flagsdtc-parser.y | +9 | 0 replies | |
| 29/74 | dtc: Add support for /import/ dts keyword parsingdtc-lexer.l dtc-parser.y dtc.h +1 more | +67 | 0 replies | |
| 30/74 | dtc: Add import symbols (/import/ keyword) in generated dts filetreesource.c | +10 | 0 replies | |
| 31/74 | Add support for FDT_IMPORT_SYM dtb tagfdtdump.c flattree.c libfdt/ +2 more | +177 | 0 replies | |
| 32/74 | tests: metadata: Add import symbols teststests/ tests/ tests/ +2 more | +45 | 0 replies | |
| 33/74 | dtc: Add support for import symbols sortinglivetree.c | +27 | 0 replies | |
| 34/74 | tests: metadata: Improve sort test to check for import symbols sortingtests/ tests/ tests/ +1 more | +13 | 0 replies | |
| 35/74 | checks: Get 'chosen' node using get_subnode()checks.c | +1 | 0 replies | |
| 36/74 | dtc: Change get_node_by_path() signature to take dt_infochecks.c dtc.h livetree.c | +17 | 0 replies | |
| 37/74 | dtc: Change get_node_by_label() signature to take dt_infochecks.c dtc.h livetree.c | +18 | 0 replies | |
| 38/74 | dtc: Change get_node_by_phandle() signature to take dt_infochecks.c dtc.h livetree.c +1 more | +24 | 0 replies | |
| 39/74 | dtc: Change get_node_by_ref() signature to take dt_infochecks.c dtc-parser.y dtc.h +1 more | +41 | 0 replies | |
| 40/74 | dtc: Change get_node_phandle() signature to take dt_infochecks.c dtc.h livetree.c | +6 | 0 replies | |
| 41/74 | dtc: Change get_property_by_label() signature to take dt_infochecks.c dtc.h livetree.c | +22 | 0 replies | |
| 42/74 | dtc: Change get_marker_label() signature to take dt_infochecks.c dtc.h livetree.c | +22 | 0 replies | |
| 43/74 | dtc: Change fill_fullpaths() signature to take dt_infolivetree.c | +10 | 0 replies | |
| 44/74 | dtc: Introduce orphan nodesdtc-parser.y dtc.h flattree.c +2 more | +30 | 0 replies | |
| 45/74 | dtc: Handle orphan nodes in get_xxx_by_yyy()livetree.c | +35 | 0 replies | |
| 46/74 | dtc: Avoid NULL fullpath for nodes in orphan treeslivetree.c | +5 | 0 replies | |
| 47/74 | dtc: Handle orphan nodes in complete_references()livetree.c | +10 | 0 replies | |
| 48/74 | checks: Perform checks for orphan nodeschecks.c | +25 | 0 replies | |
| 49/74 | dtc: Rename add_orphan_node() to plugin_add_orphan_node()dtc-parser.y dtc.h livetree.c | +7 | 0 replies | |
| 50/74 | dtc: Add basic support for addon orphan nodes in dtsdtc-parser.y dtc.h livetree.c +1 more | +81 | 0 replies | |
| 51/74 | Add support for FDT_BEGIN_NODE_REF dtb tagfdtdump.c flattree.c libfdt/ +4 more | +317 | 0 replies | |
| 52/74 | tests: metadata: Add basic test for addon orphan nodestests/ tests/ tests/ +2 more | +66 | 0 replies | |
| 53/74 | dtc: Add support for missing root node in addon device-treechecks.c dtc-parser.y dtc.c +3 more | +100 | 0 replies | |
| 54/74 | tests: metadata: Add a test for addon without root nodetests/ tests/ tests/ +2 more | +42 | 0 replies | |
| 55/74 | dtc: Allow parser_get_node_by_ref() to return an orphan node for merging purposedtc-parser.y | +22 | 0 replies | |
| 56/74 | tests: metadata: Add a test related to orphan node mergingtests/ tests/ tests/ +2 more | +91 | 0 replies | |
| 57/74 | dtc: Add support for orphan nodes sortinglivetree.c | +30 | 0 replies | |
| 58/74 | tests: metadata: Improve sort test to check for orphan nodes sortingtests/ tests/ tests/ | +102 | 0 replies | |
| 59/74 | dtc: Add support for references by path involving orphan nodesdtc-lexer.l dtc-parser.y livetree.c +1 more | +85 | 0 replies | |
| 60/74 | tests: metadata: Add a test for references by path involving orphan nodestests/ tests/ tests/ +2 more | +185 | 0 replies | |
| 61/74 | dtc: Add support for namespace labels referencesdtc-lexer.l dtc-parser.y | +59 | 0 replies | |
| 62/74 | tests: metadata: Add a test for namespace labels referencestests/ tests/ tests/ +2 more | +133 | 0 replies | |
| 63/74 | libfdt: Add support for applying an addon on a base device-tree bloblibfdt/ libfdt/ libfdt/ +4 more | +1850 | 0 replies | |
| 64/74 | Add fdtaddon tool to apply an addonMakefile Makefile.utils fdtaddon.c +1 more | +209 | 0 replies | |
| 65/74 | tests: Add a first basic test for fdtaddontests/ tests/ tests/ +8 more | +244 | 0 replies | |
| 66/74 | tests: fdtaddon: Add a basic test for addons using an orphan nodestests/ tests/ tests/ +4 more | +149 | 0 replies | |
| 67/74 | tests: fdtaddon: Add a basic test for addons with unresolved phandle referencestests/ tests/ tests/ +4 more | +160 | 0 replies | |
| 68/74 | tests: fdtaddon: Add a basic test for addons with references by path to orphan nodestests/ tests/ tests/ +4 more | +209 | 0 replies | |
| 69/74 | tests: fdtaddon: Add a test for addons with properties identical to existing onestests/ tests/ tests/ +3 more | +113 | 0 replies | |
| 70/74 | tests: fdtaddon: Add a test for addons using namespace label referencestests/ tests/ tests/ +4 more | +246 | 0 replies | |
| 71/74 | tests: fdtaddon: Add a test for using 'stacked' addonstests/ tests/ tests/ +6 more | +359 | 0 replies | |
| 72/74 | tests: fdtaddon: Add a test using more realistic dts and dtsatests/ tests/ tests/ +4 more | +426 | 0 replies | |
| 73/74 | libfdt/fdt_addon.c: Add support for an external resolverlibfdt/ libfdt/ libfdt/ | +200 | 0 replies | |
| 74/74 | fdtaddon: Add a simple external resolverfdtaddon.c tests/ tests/ +7 more | +503 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC PATCH v2 00/74] Add support for dtb metadata and addon device-trees
This big picture series adds support for dtb metadata and addon device-trees.
It is worth noting that this series needs the support for "structured tags" available and so this RFC v2 must be applied to top of the following series:
https://lore.kernel.org/all/[email protected]/
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 patch 73 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/
A first RFC iteration related to the implementation of features discussed on the mailing-list has been sent [4]. During the review, the need for "structured tag" format emerged in order to allow a smoother integration of new tags. A series adding support for those structured tags has been sent separately and its v3 iteration is available [5].
This current RFC v2 is the implementation of features discussed on the mailing-list rebased on the top of the series adding support for "structured tags" [5]. 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.
[4] https://lore.kernel.org/all/[email protected]/
[5] https://lore.kernel.org/all/[email protected]/
Also this RFC v2 contains some improvements and fixes that were missed in RFC v1.
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.
- Patch 1:
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_PROPDATA_PHANDLE and FDT_PROPDATA_PHANDLE_REF (FDT_LOCAL and FDT_REF_PHANDLE in RFC v1).
FDT_PROPDATA_PHANDLE (details in patch 7) 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_PROPDATA_PHANDLE_REF (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..15: Introduce addons device-tree
This part introduce the new /addon/ dts keyword
- Patches 16..26: Introduce /export/ keyword and related dtb tags
This part introduces the new /export/ dts keyword (details in patch
17) and the related FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF dtb tags.
FDT_EXPORT_SYM (details in patch 21) is used when the exported symbol involved is a local node and FDT_EXPORT_SYM_REF (details in patch 25) is used when the node involved is a non local node.
- Patches 27..34: Introduce /import/ keyword and related dtb tags
This part introduces the new /import/ dts keyword (details in patch
29) and the related FDT_IMPORT_SYM dtb tag (details in patch 31).
- Patches 35..58: 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 44) and the related FDT_BEGIN_NODE_REF_SYM dtb tag (details in patch 51).
It also adds support for addons dts/dtb without a 'root' (details in patch 53).
This part ended with the support for merging orphan node described in dts when relevant (details patch 55).
- Patches 59..60: Reference orphan nodes and its sub-nodes by path
A new syntax is needed to be able to reference an orphan node and its sub-nodes by path.
This new syntax is '${$<orphan_name>/<path>}' (details in patch 59)
- Patches 61..62: 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 61).
- Patches 63..64: Support for applying an addon
First, add fdt_addon_apply() in libfdt (details in patch 63) and then the fdtaddon command line tool (details in patch 64).
- Patches 65..71: fdtaddon test
Several tests related to addon application
- Patch 72: A more Realistic test
A test based on use-case we want to handle.
This 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.
- Patch 73..74: External resolver
Add the ability to use an external symbol resolver (i.e. a symbol resolver other than the one provided in the core libfdt) and implement an external resolver in the fdtaddon tool.
This external resolver performs the resolution based on information given at the tool command line and prove the capabilities of the addon feature to handle the case where an addon uses several connectors of a base board.
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é
Changes RFC v1 -> RFC v2
RFC v1: https://lore.kernel.org/all/[email protected]/
Rebase on top of the series adding support for "structured tags"
https://lore.kernel.org/all/[email protected]/
Use "structured tag" for the new tags.
Remove patches proposed in RFC v1 which arae either already applied upstream or moved to the series adding support for "structured tags".
- Patch 1 (patch 15 in RFC v1)
Reword commit log and move the patch at the beginning of the series.
- Patches 2..12: Introduce new meta-data dtb tags based on markers
- Introduce get_structured_tag_data() in fdtdump and fdt_get_structured_tag_data() in libfdt to avoid code duplication.
- Remove fdt_next_tag_full() and keep fdt_next_tag() returning all known tags (no implicit filtering). All tags need to be handled at caller side. Introduce fdt_next_tag_filter() and a predefined filter function, fdt_tag_filter_skip_metadata(), to ease the handling of tags at caller side avoiding also code duplication.
- Handle metadata tags on dtb modification.
- Move fill_fullpaths() into build_dt_info()
- Rename FDT_LOCAL and FDT_REF_PHANDLE to FDT_PROPDATA_PHANDLE and FDT_PROPDATA_PHANDLE_REF
- Complete REF_PHANDLE markers with complete_references() instead of creating new marker as suggested in RFC v1. Complete those markers as soon as possible in build_dt_info() to avoid the existence of incomplete markers later in the code. build_dt_info() is called at the end of parsing functions whatever the format (dts, dtb) parsed. Once a dt_info is available, markers are complete. In other words, markers are completed as soon as the input file is parsed.
- Fold simple patch (RFC v1 patch 4) into patch that needs it.
- Patches 13..15: Introduce addons device-tree
- Check that the DTC input (dts or dtb) is not flagged plugin (overlay) and addon. Mutually exclusive flags.
- Patches 16..26: Introduce /export/ keyword and related dtb tags
- Fix patch 16 commit log
- Update fdt_tag_filter_skip_metadata()
- Update complete_references()
- Avoid extra padding in FDT_EXPORT_SYM. Make FDT_EXPORT_SYM_REF consistent with FDT_EXPORT_SYM format (i.e. symbol name after the reference)
- Put FDT_EXPORT* tags right after FDT_NODE. Indeed, FDT_EXPORT* tags are node related structured tags.
- Remove the (ugly) 'placeholder for a phandle' field in FDT_EXPORT_SYM_REF.
- Patches 27..34: Introduce /import/ keyword and related dtb tags
- Update fdt_tag_filter_skip_metadata()
- Patches 35..58: Introduce orphan nodes
- Change existing function signature instead of introducing new functions. Add '_' suffix to function with old signature that are still used internally.
- Introduce node_is_orphan() to test if a given node is an orphan node.
- Fix fixup_phandle_references() when an orphan node is involved (missed in RFC v1) and add a related test.
- Do not check node name for orphan nodes. A orphan node doesn't have a node name but a reference to an external node.
- Rework handling in libfdt due to fdt_next_tag() returning all known tags.
- Take orphan nodes into account in libfdt fdt_check_full().
- Patches 59..60: Reference orphan nodes and its sub-nodes by path
- Fix fill_fullpaths(), get_node_by_path() and get_node_by_ref_().
- phandle properties are no more created in an orphan node. Fix test expected values.
- Patches 61..62: Namespace labels references
- No specific changes other expected values updates due to series changes (tags name and locations)
- Patches 63..64: Support for applying an addon
- Minor modification to avoid signed/unsigned mismatch
- Fix last_prop_offset handling in addon_adjust_local_phandles(), addon_resolve_phandles() and addon_replace_local_phandles()
- Handle data fields re-ordering in FDT_EXPORT_SYM and FDT_EXPORT_SYM_REF.
- Handle the 'placeholder for a phandle' field removal in FDT_EXPORT_SYM_REF.
- Use fdt_get_structured_tag_data() to get data related to new tags.
- Use fdt_root_offset() to get the addon root node instead of using hard-coded offset 0.
- An addon cannot modify a property present in the base device-tree. In RFC v1 if the property was present in both side, an error was reported. Fix that and report the error only if the property is present on both side but with different values. Exact same values doesn't imply a property modification.
- Update orphan node handling and remove tag overrides done in RFC v1 to consider orphan nodes as standard nodes at some specific parts.
- Update comments, split and renamed some functions, make the code more consistent.
- Patches 67..71: fdtaddon test
- Update expected values due to series changes (tags name and locations)
- Add a new test related to references by path to orphan nodes
- Add a new test related properties in addon identical to existing ones
- Patch 72: A more Realistic test
- No specific changes other expected values updates due to series changes (tags name and locations)
- Patch 73..74: External resolver
- New patches in RFC v2. Allow to resolve symbols on criteria other than simple import/export symbol names. Symbol resolution of an addon applied at some node level and using several connectors should be handle by this kind of external resolver.
Herve Codina (74):
dtc-parser.y: Avoid an empty proplist
Introduce v20 dtb version
fdtdump: Introduce get_structured_tag_data()
libfdt: Introduce fdt_get_structured_tag_data()
libfdt: Prepare for metadata tag support
dtc: Move fill_fullpaths() into build_dt_info()
Add support for FDT_PROPDATA_PHANDLE dtb tag
livetree: Improve get_node_by_phandle()
dtc: Complete REF_PHANDLE markers with ref strings and is_local flags
tests: Add basic metadata tests
Add support for FDT_PROPDATA_PHANDLE_REF dtb tag
tests: metadata: Add external phandle reference tests
Add support for /addon/ keyword
tests: Add a test related to addon dt_flags header value
tests: metadata: Add a basic addon test
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: Extend complete_references() to handle export symbols 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
checks: Get 'chosen' node using get_subnode()
dtc: Change get_node_by_path() signature to take dt_info
dtc: Change get_node_by_label() signature to take dt_info
dtc: Change get_node_by_phandle() signature to take dt_info
dtc: Change get_node_by_ref() signature to take dt_info
dtc: Change get_node_phandle() signature to take dt_info
dtc: Change get_property_by_label() signature to take dt_info
dtc: Change get_marker_label() signature to take dt_info
dtc: Change fill_fullpaths() signature to take dt_info
dtc: Introduce orphan nodes
dtc: Handle orphan nodes in get_xxx_by_yyy()
dtc: Avoid NULL fullpath for nodes in orphan trees
dtc: Handle orphan nodes in complete_references()
checks: Perform checks for orphan nodes
dtc: Rename add_orphan_node() to plugin_add_orphan_node()
dtc: Add basic support for addon orphan nodes in dts
Add support for FDT_BEGIN_NODE_REF 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: 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 basic test for addons with references by path
to orphan nodes
tests: fdtaddon: Add a test for addons with properties identical to
existing ones
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 libfdt/fdt_addon.c: Add support for an external resolver
fdtaddon: Add a simple external resolver
Makefile | 5 + Makefile.utils | 6 + checks.c | 154 +- data.c | 3 +- dtc-lexer.l | 37 + dtc-parser.y | 307 ++- dtc.c | 40 +- dtc.h | 66 +- fdtaddon.c | 415 ++++ fdtdump.c | 121 +- flattree.c | 470 ++++- fstree.c | 5 +- libfdt/Makefile.libfdt | 2 +- libfdt/fdt.c | 365 +++- libfdt/fdt.h | 89 + libfdt/fdt_addon.c | 1805 +++++++++++++++++ libfdt/fdt_check.c | 257 ++- libfdt/fdt_ro.c | 49 +- libfdt/fdt_rw.c | 172 +- libfdt/fdt_wip.c | 23 +- libfdt/libfdt.h | 137 +- libfdt/libfdt_internal.h | 29 + libfdt/meson.build | 1 + libfdt/version.lds | 3 + livetree.c | 626 +++++- meson.build | 2 +- tests/dtflags_addon.dtb.expect | 1 + tests/dtflags_addon.dts | 11 + ...n_custom_resolver_node_a-merged.dtb.expect | 39 + ...n_addon_custom_resolver_node_a.dtba.expect | 15 + ...fdtaddon_addon_custom_resolver_node_a.dtsa | 22 + ..._custom_resolver_node_ab-merged.dtb.expect | 42 + ..._addon_custom_resolver_node_ab.dtba.expect | 21 + ...dtaddon_addon_custom_resolver_node_ab.dtsa | 29 + ...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 + ...n_addon_prop_existing_ok-merged.dtb.expect | 20 + ...dtaddon_addon_prop_existing_ok.dtba.expect | 17 + tests/fdtaddon_addon_prop_existing_ok.dtsa | 25 + tests/fdtaddon_base.dtb.expect | 24 + tests/fdtaddon_base.dts | 27 + .../fdtaddon_base_custom_resolver.dtb.expect | 33 + tests/fdtaddon_base_custom_resolver.dts | 52 + tests/fdtaddon_base_namespace.dtb.expect | 29 + tests/fdtaddon_base_namespace.dts | 33 + tests/fdtaddon_base_prop_existing.dtb.expect | 17 + tests/fdtaddon_base_prop_existing.dts | 22 + 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 + tests/fdtaddon_basics4-merged1.dtb.dts.expect | 43 + tests/fdtaddon_basics4-merged1.dtb.expect | 37 + tests/fdtaddon_basics4-merged2.dtb.dts.expect | 43 + tests/fdtaddon_basics4-merged2.dtb.expect | 37 + tests/fdtaddon_basics4.dtba.expect | 22 + tests/fdtaddon_basics4.dtsa | 25 + ...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 | 28 + .../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 | 2 + 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 | 47 + tests/metadata_addon_references.dtb.expect | 47 + tests/metadata_addon_references.dts | 43 + .../metadata_addon_references.dts.dts.expect | 47 + ...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 + .../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 + ...data_propdata_phandle_local.dtb.dts.expect | 23 + ...metadata_propdata_phandle_local.dtb.expect | 20 + tests/metadata_propdata_phandle_local.dts | 27 + ...data_propdata_phandle_local.dts.dts.expect | 23 + ...tadata_propdata_phandle_ref.dtb.dts.expect | 18 + .../metadata_propdata_phandle_ref.dtb.expect | 16 + tests/metadata_propdata_phandle_ref.dts | 11 + ...tadata_propdata_phandle_ref.dts.dts.expect | 18 + tests/metadata_sort.dtb.dts.expect | 61 + tests/metadata_sort.dtb.expect | 48 + tests/metadata_sort.dts | 58 + tests/pylibfdt_tests.py | 6 +- tests/run_tests.sh | 178 +- tests/testutils.sh | 1 + tests/treegen.c | 2 +- ...own_tags_can_skip.fdtput.test.dtb.1.expect | 2 +- ...nknown_tags_can_skip.wip.test.dtb.1.expect | 2 +- treesource.c | 46 +- 142 files changed, 8299 insertions(+), 298 deletions(-) create mode 100644 fdtaddon.c create mode 100644 libfdt/fdt_addon.c create mode 100644 tests/dtflags_addon.dtb.expect create mode 100644 tests/dtflags_addon.dts create mode 100644 tests/fdtaddon_addon_custom_resolver_node_a-merged.dtb.expect create mode 100644 tests/fdtaddon_addon_custom_resolver_node_a.dtba.expect create mode 100644 tests/fdtaddon_addon_custom_resolver_node_a.dtsa create mode 100644 tests/fdtaddon_addon_custom_resolver_node_ab-merged.dtb.expect create mode 100644 tests/fdtaddon_addon_custom_resolver_node_ab.dtba.expect create mode 100644 tests/fdtaddon_addon_custom_resolver_node_ab.dtsa 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_addon_prop_existing_ok-merged.dtb.expect create mode 100644 tests/fdtaddon_addon_prop_existing_ok.dtba.expect create mode 100644 tests/fdtaddon_addon_prop_existing_ok.dtsa create mode 100644 tests/fdtaddon_base.dtb.expect create mode 100644 tests/fdtaddon_base.dts create mode 100644 tests/fdtaddon_base_custom_resolver.dtb.expect create mode 100644 tests/fdtaddon_base_custom_resolver.dts create mode 100644 tests/fdtaddon_base_namespace.dtb.expect create mode 100644 tests/fdtaddon_base_namespace.dts create mode 100644 tests/fdtaddon_base_prop_existing.dtb.expect create mode 100644 tests/fdtaddon_base_prop_existing.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_basics4-merged1.dtb.dts.expect create mode 100644 tests/fdtaddon_basics4-merged1.dtb.expect create mode 100644 tests/fdtaddon_basics4-merged2.dtb.dts.expect create mode 100644 tests/fdtaddon_basics4-merged2.dtb.expect create mode 100644 tests/fdtaddon_basics4.dtba.expect create mode 100644 tests/fdtaddon_basics4.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_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_propdata_phandle_local.dtb.dts.expect create mode 100644 tests/metadata_propdata_phandle_local.dtb.expect create mode 100644 tests/metadata_propdata_phandle_local.dts create mode 100644 tests/metadata_propdata_phandle_local.dts.dts.expect create mode 100644 tests/metadata_propdata_phandle_ref.dtb.dts.expect create mode 100644 tests/metadata_propdata_phandle_ref.dtb.expect create mode 100644 tests/metadata_propdata_phandle_ref.dts create mode 100644 tests/metadata_propdata_phandle_ref.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
Signature · 1 line
2.55.0