[PATCH v2 03/10] tests: asm: Introduce treehdr_vers macro

Herve Codina
2026-04-09T11:54:56Z

tree.S is used to generate custom dtbs. It uses the treehdr macro to
build the header part.

The current definition of this macro doesn't allow to set custom
settings related to version fields.

In order to easily generate some dtb with custom version values without
duplicating the full header computation, introduce the treehdr_vers
macro.

The modification doesn't introduce any functional changes.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
tests/trees.S | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/trees.S b/tests/trees.S
index d69f7f1..4db2b9b 100644
--- a/tests/trees.S
+++ b/tests/trees.S
@@ -8,7 +8,7 @@
.byte (\val) & 0xff
.endm

- .macro treehdr tree
+ .macro treehdr_vers tree vers last_comp_vers
.balign 8
.globl \tree
\tree :
@@ -17,13 +17,17 @@
fdtlong (\tree\()_struct - \tree)
fdtlong (\tree\()_strings - \tree)
fdtlong (\tree\()_rsvmap - \tree)
- fdtlong 0x11
- fdtlong 0x10
+ fdtlong \vers
+ fdtlong \last_comp_vers
fdtlong 0
fdtlong (\tree\()_strings_end - \tree\()_strings)
fdtlong (\tree\()_struct_end - \tree\()_struct)
.endm

+ .macro treehdr tree
+ treehdr_vers \tree 0x11 0x10
+ .endm
+
.macro rsvmape addrh, addrl, lenh, lenl
fdtlong \addrh
fdtlong \addrl
--
2.53.0