Device tree format gains tags older tools can skip
dtc and libfdt move toward DTB version 18 so future extensions need not break existing readers, after a proposed write lock was rejected.
Herve Codina of Bootlin has posted a fourth revision of changes that introduce version 18 of the flattened device tree blob, the binary format read and written by dtc and libfdt. The change is not a new hardware description. It is a way for today's tools to keep working when a blob contains tags they have never seen.
Device trees are the board description shared by Linux and boot firmware. Extending that format has been awkward: an unrecognized tag is treated as a corrupt blob, so a newer file cannot be read by an older compiler or library. Codina's earlier proposal for metadata and addon device trees ran into that limit. The agreed prerequisite is a structured tag whose value encodes its own data length. An older libfdt, dtc, or dump tool can then skip the tag and the bytes that follow without failing, when the format allows it.
Version 18 also adds a flags field in the blob header, a placeholder for the kind of tree being carried. Addon trees, for example, would set a flag there.
One piece of the original plan did not survive review of the previous iteration. A header field meant to mark a blob as unsafe for older tools to rewrite, similar to the existing last-compatible-version check but for modifications, was rejected. Edits are handled by rule instead. Depending on the change, unknown tags attached to a property or a node are dropped or kept, and any structural change downgrades the blob version so an old writer cannot leave the tree inconsistent with tags it does not understand.
The update also fixes handling of nop markers at the start of a blob, and teaches the dump tool, libfdt, and dtc to read tags they do not recognize.