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

David Gibson <[email protected]> Thu, 18 Jun 2026 20:15:10 +1000
Newsgroups org.kernel.vger.devicetree-compiler,org.kernel.vger.devicetree-spec,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <ajPFLjQ96nmsPLp2@zatzit>
--lns24CUJon2t2BZq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 09, 2026 at 01:54:19PM +0200, Herve Codina wrote:
> tree.S is used to generate custom dtbs. It uses the treehdr macro to
> build the header part.
>=20
> The current definition of this macro doesn't allow to set custom
> settings related to version fields.
>=20
> In order to easily generate some dtb with custom version values without
> duplicating the full header computation, introduce the treehdr_vers
> macro.
>=20
> The modification doesn't introduce any functional changes.
>=20
> Signed-off-by: Herve Codina <[email protected]>

I just killed the not-very-portable trees.S in the main git tree, so
this will need reworking for the new treegen.c system.

> ---
>  tests/trees.S | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>=20
> 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
> =20
> -	.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
> =20
> +	.macro	treehdr	tree
> +	treehdr_vers \tree 0x11 0x10
> +	.endm
> +
>  	.macro	rsvmape	addrh, addrl, lenh, lenl
>  	fdtlong	\addrh
>  	fdtlong	\addrl
> --=20
> 2.53.0
>=20
>=20

--=20
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

--lns24CUJon2t2BZq
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmozxSkACgkQzQJF27ox
2GewKhAApzipErwNhduZzLZdHtLSD4WtW134EbEGXAmL6VEThToQfwwIofqLymYt
YWSFHskRFNtRfDLttm4Tn1efaLSIhla08X6Suc2fZ9rqJMgCjMWQeThYIHdUOku5
RFzVLAWAIZw6rlX2jiOFiHt+DwzIK0jFsfzWrGNbHzXZMegLPz4r3YENNCQFLmvR
nK9lScYv0uTVz1vuF3VWF9o5r5bubP+AwABol3o3I4bIOOjFktdtjCmyAtWs3p/K
auZcRhkDlTLgzJUcwjgWauGIYcwI0DUf/Lya9ILso7DjEgI1VthR+tYuy0PyMMRv
zzYiIT6ZueKdNm5TQV+iYCudXbCtWJqDztjHtHuBx3X/cNzovKYGh7obLG1gik/r
/8OExqnGAEfskoGdRYJn4BJaL01EYOJrNOVQ/A1KgJi8Fuc+ONwip7aFrfnyk21y
P7jk0EK0axt6o40D+eHuIGyGRWraZ1QUbw1KSnhIRUhkpIAddowwW8k2yRvEX9QL
ptNXGQc2Mlog3o+fbPQjWKcVOhU9FRhq2HPjdlqR2VrYwRMHX5FpQ6tgmnFOedec
uwWp2/IDaKv7VpiXvyFQ4VxV1AoEZO08jz2U4hveBj6xb+XH56HzyKXPFkBnZkt3
SYJgJ1VekxpXEcnj9YtlhxgPoJKRgy14o44BJBd3JmWE1KRs7Z4=
=q0GJ
-----END PGP SIGNATURE-----

--lns24CUJon2t2BZq--