Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D031EC54E58 for ; Tue, 12 Mar 2024 10:52:47 +0000 (UTC) Subject: Re: [PATCH] kernel-fitimage: dtb sections named by their filenames and one config section for each dtb To: poky@lists.yoctoproject.org From: enok@lysator.liu.se X-Originating-Location: Bromma, Stockholm County, SE (94.191.137.33) X-Originating-Platform: Linux Firefox 123 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Tue, 12 Mar 2024 03:52:44 -0700 References: <1489764783-11522-1-git-send-email-fw@javox-solutions.com> In-Reply-To: <1489764783-11522-1-git-send-email-fw@javox-solutions.com> Message-ID: <4511.1710240764565121572@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="U4tDVB8QScMyw18d2JWf" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 12 Mar 2024 10:52:47 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/poky/message/13305 --U4tDVB8QScMyw18d2JWf Content-Type: text/plain; charset="utf-8"; markup=markdown Content-Transfer-Encoding: quoted-printable I added some .dtso overlay files to KERNEL_DEVICETREE in order to have them= added to my fitimage file through the kernel-fitimage.class. This seems to work, as long as corresponding .dtso files are added to the r= ight subdir with SRC_URI in the linux kernel recipe. The dtbo becomes inclu= ded in the fitimage. config sections are emitted. However, the config sections in the fitimage become weird. One config secti= on is emitted for each dtb or dtbo file. Does this make sense? Shouldn't th= ere be one config section for each .dtb file, and then dtbo references be a= dded to these sections? The most simple alternative would be to add every .= dtbo file in KERNEL_DEVICETREE to ever .dtb config section, but probably th= ere should be some way to select which overlays to add to each dtb. It currently looks like this: ``` configurations { default =3D "conf-rk3588s-rock-5a.dtb"; conf-rk3588s-rock-5a.dtb { description =3D "1 Linux kernel, FDT blob"; =20 kernel =3D "kernel-1"; fdt =3D "fdt-rk3588s-rock-5a.dtb"; =20 =20 =20 hash-1 { algo =3D "sha256"; }; }; =20 conf-rock-5a-radxa-camera-4k.dtbo { description =3D "0 FDT blob"; =20 =20 fdt =3D "fdt-rock-5a-radxa-camera-4k.dtbo"; =20 =20 =20 hash-1 { algo =3D "sha256"; }; }; }; ``` but I would have expected it to look like this: ``` configurations { default =3D "conf-rk3588s-rock-5a.dtb"; conf-rk3588s-rock-5a.dtb { description =3D "1 Linux kernel, FDT blob"; =20 kernel =3D "kernel-1"; fdt =3D "fdt-rk3588s-rock-5a.dtb", "fdt-rock-5a-rad= xa-camera-4k.dtbo";; =20 =20 =20 hash-1 { algo =3D "sha256"; }; }; }; ``` As in this example from u-boot/doc/uImage.FIT/overlay-fdt-boot.txt: ``` /dts-v1/; / { images { kernel { data =3D /incbin/("./zImage"); type =3D "kernel"; arch =3D "arm"; os =3D "linux"; load =3D <0x82000000>; entry =3D <0x82000000>; }; fdt-1 { data =3D /incbin/("./foo.dtb"); type =3D "flat_dt"; arch =3D "arm"; load =3D <0x87f00000>; }; fdt-2 { data =3D /incbin/("./reva.dtbo"); type =3D "flat_dt"; arch =3D "arm"; load =3D <0x87fc0000>; }; fdt-3 { data =3D /incbin/("./revb.dtbo"); type =3D "flat_dt"; arch =3D "arm"; load =3D <0x87fc0000>; }; fdt-4 { data =3D /incbin/("./bar.dtbo"); type =3D "flat_dt"; arch =3D "arm"; load =3D <0x87fc0000>; }; fdt-5 { data =3D /incbin/("./baz.dtbo"); type =3D "flat_dt"; arch =3D "arm"; load =3D <0x87fc0000>; }; }; configurations { default =3D "foo-reva.dtb; foo-reva.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-2"; }; foo-revb.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-3"; }; foo-reva-bar.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-2", "fdt-4"; }; foo-revb-bar.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-3", "fdt-4"; }; foo-revb-baz.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-3", "fdt-5"; }; foo-revb-bar-baz.dtb { kernel =3D "kernel"; fdt =3D "fdt-1", "fdt-3", "fdt-4", "fdt-5"; }; bar { fdt =3D "fdt-4"; }; baz { fdt =3D "fdt-5"; }; }; }; ``` --U4tDVB8QScMyw18d2JWf Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

I added some .dtso overlay files to KERNEL_DEVICETREE in order to have t= hem added to my fitimage file through the kernel-fitimage.class.

This seems to work, as long as corresponding .dtso files are added to th= e right subdir with SRC_URI in the linux kernel recipe. The dtbo becomes in= cluded in the fitimage. config sections are emitted.

However, the config sections in the fitimage become weird. One config se= ction is emitted for each dtb or dtbo file. Does this make sense? Shouldn't= there be one config section for each .dtb file, and then dtbo references b= e added to these sections? The most simple alternative would be to add ever= y .dtbo file in KERNEL_DEVICETREE to ever .dtb config section, but probably= there should be some way to select which overlays to add to each dtb.

It currently looks like this:

        configu=
rations {
                default =3D "conf-rk3588s-rock-5a.dtb";
                conf-rk3588s-rock-5a.dtb {
                        description =3D "1 Linux kernel, FDT blob";
                       =20
                        kernel =3D "kernel-1";
                        fdt =3D "fdt-rk3588s-rock-5a.dtb";
                       =20
                       =20
                       =20
                        hash-1 {
                                algo =3D "sha256";
                        };
                };
               =20
                conf-rock-5a-radxa-camera-4k.dtbo {
                        description =3D "0 FDT blob";
                       =20
                       =20
                        fdt =3D "fdt-rock-5a-radxa-camera-4k.dtbo";
                       =20
                       =20
                       =20
                        hash-1 {
                                algo =3D "sha256";
                        };
                };
        };

but I would have expected it to look like this:

        configu=
rations {
                default =3D "conf-rk3588s-rock-5a.dtb";
                conf-rk3588s-rock-5a.dtb {
                        description =3D "1 Linux kernel, FDT blob";
                       =20
                        kernel =3D "kernel-1";
                        fdt =3D "fdt-rk3588s-rock-5a.dtb", "fdt=
-rock-5a-radxa-camera-4k.dtbo";;
                       =20
                       =20
                       =20
                        hash-1 {
                                algo =3D "sha256";
                        };
                };
        };

As in this example from u-boot/doc/uImage.FIT/overlay-fdt-boot.txt:

	/dts-v1/;
	/ {
		images {
			kernel {
				data =3D /incbin/("./zImage");
				type =3D "kernel";
				arch =3D "arm";
				os =3D "linux";
				load =3D <0x82000000>;
				entry =3D <0x82000000>;
			};
			fdt-1 {
				data =3D /incbin/("./foo.dtb");
				type =3D "flat_dt";
				arch =3D "arm";
				load =3D <0x87f00000>;
			};
			fdt-2 {
				data =3D /incbin/("./reva.dtbo");
				type =3D "flat_dt";
				arch =3D "arm";
				load =3D <0x87fc0000>;
			};
			fdt-3 {
				data =3D /incbin/("./revb.dtbo");
				type =3D "flat_dt";
				arch =3D "arm";
				load =3D <0x87fc0000>;
			};
			fdt-4 {
				data =3D /incbin/("./bar.dtbo");
				type =3D "flat_dt";
				arch =3D "arm";
				load =3D <0x87fc0000>;
			};
			fdt-5 {
				data =3D /incbin/("./baz.dtbo");
				type =3D "flat_dt";
				arch =3D "arm";
				load =3D <0x87fc0000>;
			};
		};

		configurations {
			default =3D "foo-reva.dtb;
			foo-reva.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-2";
			};
			foo-revb.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-3";
			};
			foo-reva-bar.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-2", "fdt-4";
			};
			foo-revb-bar.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-3", "fdt-4";
			};
			foo-revb-baz.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-3", "fdt-5";
			};
			foo-revb-bar-baz.dtb {
				kernel =3D "kernel";
				fdt =3D "fdt-1", "fdt-3", "fdt-4", "fdt-5&#=
34;;
			};
			bar {
				fdt =3D "fdt-4";
			};
			baz {
				fdt =3D "fdt-5";
			};
		};
	};
--U4tDVB8QScMyw18d2JWf--