* 'of_compatible' and 'model' imd records are unusable @ 2021-10-01 11:46 Antony Pavlov 2021-10-01 23:47 ` Antony Pavlov 0 siblings, 1 reply; 5+ messages in thread From: Antony Pavlov @ 2021-10-01 11:46 UTC (permalink / raw) To: barebox Hi all! I have cloned barebox c67ada0024da (v2021.08.0) and found that 'of_compatible' and 'model' imd records are unusable. E.g. barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- imx_v8_defconfig barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ... images built: barebox-nxp-imx8mm-evk.img barebox-prt-prt8mm.img barebox-nxp-imx8mp-evk.img barebox-nxp-imx8mq-evk.img barebox-zii-imx8mq-dev.img barebox-phytec-phycore-imx8mq.img barebox$ ./scripts/bareboximd images/barebox-nxp-imx8mm-evk.img build: #1 Fri Oct 1 10:16:30 UTC 2021 buildsystem version: crc32: 0x00000000 release: 2021.08.0 barebox$ There is no 'of_compatible' and 'model' imd records in bareboximd output. So there is no chance to imd_find_type(..., IMD_TYPE_OF_COMPATIBLE) (see common/bbu.c) in a barebox image file. scripts/gen-dtb-s puts IMD_TYPE_OF_COMPATIBLE and IMD_TYPE_MODEL records into barebox_imd_0 section. BAREBOX_IMD macro (include/asm-generic/barebox.lds.h) does not KEEP barebox_imd_0 section": #define BAREBOX_IMD \ STRUCT_ALIGN(); \ KEEP(*(.barebox_imd_start)) \ KEEP(*(.barebox_imd_1*)) \ *(.barebox_imd_0*) \ KEEP(*(.barebox_imd_end)) KEEPing barebox_imd_0 leads to several 'of_compatible' and 'model' records in one barebox image file, e.g.: barebox$ ./scripts/bareboximd images/barebox-prt-prt8mm.img build: #2 Fri Oct 1 10:19:07 UTC 2021 buildsystem version: crc32: 0x00000000 release: 2021.08.0-dirty of_compatible: fsl,imx8mm-evk fsl,imx8mm model: FSL i.MX8MM EVK board of_compatible: prt,prt8mm fsl,imx8mm model: Protonic PRT8MM of_compatible: fsl,imx8mp-evk fsl,imx8mp model: NXP i.MX8MPlus EVK board of_compatible: fsl,imx8mq-evk fsl,imx8mq model: NXP i.MX8MQ EVK of_compatible: phytec,imx8mq-pcl066 fsl,imx8mq model: Phytec phyCORE-i.MX8 of_compatible: zii,imx8mq-ultra-rmb3 zii,imx8mq-ultra fsl,imx8mq model: ZII Ultra RMB3 Board of_compatible: zii,imx8mq-ultra-zest zii,imx8mq-ultra fsl,imx8mq model: ZII Ultra Zest Board builduser@ae676260680c:~/barebox$ -- Best regards, Antony Pavlov _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 'of_compatible' and 'model' imd records are unusable 2021-10-01 11:46 'of_compatible' and 'model' imd records are unusable Antony Pavlov @ 2021-10-01 23:47 ` Antony Pavlov 0 siblings, 0 replies; 5+ messages in thread From: Antony Pavlov @ 2021-10-01 23:47 UTC (permalink / raw) To: Sascha Hauer, Uwe Kleine-König, Steffen Trumtrar, Ahmad Fatoum Cc: barebox On Fri, 1 Oct 2021 14:46:19 +0300 Antony Pavlov <antonynpavlov@gmail.com> wrote: Hi all! > I have cloned barebox c67ada0024da (v2021.08.0) and found that > 'of_compatible' and 'model' imd records are unusable. I have found a quick-and-dirty solution for the problem. of_compatible and model imd types were introduced in commit 97e81f2d78f30fb4936f0f6fe52b317d8dbc9881 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Mon Jul 28 07:22:40 2014 +0200 Add support for metadata in barebox images the commit commit 58eae8361c10fea661bcb48c4c5e75e7ad19e1c1 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Fri Oct 23 09:14:54 2015 +0200 ARM: Allow compressed dtb binaries breaks adding of of_compatible and model records by changing in scripts/gen-dtb-s. the commit commit c1c818735caa8222d88aa9286a219d6055c1699d Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Date: Thu Feb 21 11:25:30 2019 +0100 imd: create new helper macro to add data from oftree to image meta data introduces macro for explicit adding of of_compatible imd record from C code. You can resurrect of_compatible and model imd records adding by partialy reverting c1c818735caa822:scripts/gen-dtb-s and 58eae8361c10fea66:scripts/gen-dtb-s e.g. barebox$ make rpi_defconfig ... barebox$ make ... barebox$ ./scripts/bareboximd images/barebox-raspberry-pi-3.img buildsystem version: crc32: 0x00000000 build: #8 Fri Oct 1 23:23:30 UTC 2021 release: 2021.08.0 barebox$ patch -p1 <<EOF diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s index 4f8c62a0b..649021e20 100755 --- a/scripts/gen-dtb-s +++ b/scripts/gen-dtb-s @@ -18,8 +18,8 @@ FDTGET=scripts/dtc/fdtget if [ "$imd" = "y" ]; then echo ".section .barebox_imd_0.${name},\"a\"" - echo ".global __barebox_imd_OF_${name}" - echo "__barebox_imd_OF_${name}:" + echo ".global __imd_${name}_start" + echo "__imd_${name}_start:" compat=$($FDTGET -d notfound -t bi "$dtb" / compatible | sed "s^ ^,^g") if [ "$compat" != "notfound" ]; then @@ -51,6 +51,10 @@ echo "__dtb_${name}_end:" echo ".global __dtb_${name}_end" echo ".balign STRUCT_ALIGNMENT" +if [ "$imd" = "y" ]; then + echo ".word __imd_${name}_start" +fi + lzop -f -9 $dtb -o $dtb.lzo if [ $? != 0 ]; then exit 1 EOF patching file scripts/gen-dtb-s barebox$ make ... barebox$ ./scripts/bareboximd images/barebox-raspberry-pi-3.img buildsystem version: crc32: 0x00000000 build: #9 Fri Oct 1 23:24:06 UTC 2021 release: 2021.08.0-dirty of_compatible: raspberrypi,3-model-b brcm,bcm2837 model: Raspberry Pi 3 Model B barebox$ > E.g. > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- imx_v8_defconfig > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- > ... > images built: > barebox-nxp-imx8mm-evk.img > barebox-prt-prt8mm.img > barebox-nxp-imx8mp-evk.img > barebox-nxp-imx8mq-evk.img > barebox-zii-imx8mq-dev.img > barebox-phytec-phycore-imx8mq.img > > barebox$ ./scripts/bareboximd images/barebox-nxp-imx8mm-evk.img > build: #1 Fri Oct 1 10:16:30 UTC 2021 > buildsystem version: > crc32: 0x00000000 > release: 2021.08.0 > barebox$ > > There is no 'of_compatible' and 'model' imd records in bareboximd output. > -- Best regards, Antony Pavlov _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20211001142453.4a3c0ba9bd7bb909125e2a5f@gmail.com>]
* Re: 'of_compatible' and 'model' imd records are unusable [not found] <20211001142453.4a3c0ba9bd7bb909125e2a5f@gmail.com> @ 2021-10-02 8:48 ` Sascha Hauer 2021-10-02 9:44 ` Antony Pavlov 0 siblings, 1 reply; 5+ messages in thread From: Sascha Hauer @ 2021-10-02 8:48 UTC (permalink / raw) To: Antony Pavlov; +Cc: Steffen Trumtrar, Ahmad Fatoum, barebox Hi Antony, +Cc list On Fri, Oct 01, 2021 at 02:24:53PM +0300, Antony Pavlov wrote: > Hi all! > > I have cloned barebox c67ada0024da (v2021.08.0) and found that > 'of_compatible' and 'model' imd records are unusable. > > E.g. > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- imx_v8_defconfig > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- > ... > images built: > barebox-nxp-imx8mm-evk.img > barebox-prt-prt8mm.img > barebox-nxp-imx8mp-evk.img > barebox-nxp-imx8mq-evk.img > barebox-zii-imx8mq-dev.img > barebox-phytec-phycore-imx8mq.img > > barebox$ ./scripts/bareboximd images/barebox-nxp-imx8mm-evk.img > build: #1 Fri Oct 1 10:16:30 UTC 2021 > buildsystem version: > crc32: 0x00000000 > release: 2021.08.0 > barebox$ > > There is no 'of_compatible' and 'model' imd records in bareboximd output. > > So there is no chance to imd_find_type(..., IMD_TYPE_OF_COMPATIBLE) > (see common/bbu.c) in a barebox image file. > > scripts/gen-dtb-s puts IMD_TYPE_OF_COMPATIBLE and IMD_TYPE_MODEL > records into barebox_imd_0 section. > > BAREBOX_IMD macro (include/asm-generic/barebox.lds.h) > does not KEEP barebox_imd_0 section": This is done on purpose because otherwise... > > #define BAREBOX_IMD \ > STRUCT_ALIGN(); \ > KEEP(*(.barebox_imd_start)) \ > KEEP(*(.barebox_imd_1*)) \ > *(.barebox_imd_0*) \ > KEEP(*(.barebox_imd_end)) > > KEEPing barebox_imd_0 leads to several 'of_compatible' and 'model' records > in one barebox image file, e.g.: ...exactly this would happen. To get the of_compatible and model imd tags in an image you have to put IMD_USED_OF() explicitly into the entry function of the image handling this compatible, there's no way for the build process to know which image handles which device tree. See below for an example which adds the tags for the boards you are currently compiling. Sascha --------------------------------8<------------------------- >From 456d90992fe0b9f4258b693a946f8d13ba5b0b4c Mon Sep 17 00:00:00 2001 From: Sascha Hauer <s.hauer@pengutronix.de> Date: Sat, 2 Oct 2021 10:45:04 +0200 Subject: [PATCH] ARM: i.MX8m: Add of_compatible imd tags for i.MX8 boards The build process has to be manually told which image is compatible to which device tree. Add the IMD_USED_OF() calls to the i.MX8m based boards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 3 +++ arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 3 +++ arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 3 +++ arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c | 3 +++ arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 4 ++++ 5 files changed, 16 insertions(+) diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c index 4bd29c2269..c2f6206cfd 100644 --- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c @@ -21,6 +21,7 @@ #include <mfd/bd71837.h> #include <soc/imx8m/ddr.h> #include <soc/fsl/fsl_udc.h> +#include <image-metadata.h> extern char __dtb_imx8mm_evk_start[]; @@ -177,5 +178,7 @@ ENTRY_FUNCTION(start_nxp_imx8mm_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); + IMD_USED_OF(imx8mm_evk); + nxp_imx8mm_evk_start(); } diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c index 3298ded586..5732ccc645 100644 --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c @@ -4,6 +4,7 @@ #include <common.h> #include <debug_ll.h> #include <firmware.h> +#include <image-metadata.h> #include <asm/mmu.h> #include <asm/cache.h> #include <asm/sections.h> @@ -189,5 +190,7 @@ ENTRY_FUNCTION(start_nxp_imx8mp_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); + IMD_USED_OF(imx8mp_evk); + nxp_imx8mp_evk_start(); } diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c index 564621abef..92cc22e022 100644 --- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c +++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c @@ -2,6 +2,7 @@ #include <common.h> #include <firmware.h> +#include <image-metadata.h> #include <linux/sizes.h> #include <mach/generic.h> #include <asm/barebox-arm-head.h> @@ -106,5 +107,7 @@ ENTRY_FUNCTION(start_nxp_imx8mq_evk, r0, r1, r2) relocate_to_current_adr(); setup_c(); + IMD_USED_OF(imx8mq_evk); + nxp_imx8mq_evk_start(); } diff --git a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c index 3b8b53b36e..24d98fe6c9 100644 --- a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c +++ b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c @@ -2,6 +2,7 @@ #include <asm/barebox-arm.h> #include <common.h> +#include <image-metadata.h> #include <debug_ll.h> #include <firmware.h> #include <mach/atf.h> @@ -118,5 +119,7 @@ ENTRY_FUNCTION(start_prt_prt8mm, r0, r1, r2) relocate_to_current_adr(); setup_c(); + IMD_USED_OF(imx8mm_prt8mm); + prt_prt8mm_start(); } diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c index 311e61fb1d..cf53fb2def 100644 --- a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c +++ b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c @@ -6,6 +6,7 @@ #include <common.h> #include <firmware.h> +#include <image-metadata.h> #include <linux/sizes.h> #include <mach/generic.h> #include <asm/barebox-arm-head.h> @@ -200,5 +201,8 @@ ENTRY_FUNCTION(start_zii_imx8mq_dev, r0, r1, r2) relocate_to_current_adr(); setup_c(); + IMD_USED_OF(imx8mq_zii_ultra_rmb3); + IMD_USED_OF(imx8mq_zii_ultra_zest); + zii_imx8mq_dev_start(); } -- 2.30.2 -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 'of_compatible' and 'model' imd records are unusable 2021-10-02 8:48 ` Sascha Hauer @ 2021-10-02 9:44 ` Antony Pavlov 2021-10-04 7:52 ` Sascha Hauer 0 siblings, 1 reply; 5+ messages in thread From: Antony Pavlov @ 2021-10-02 9:44 UTC (permalink / raw) To: Sascha Hauer; +Cc: Steffen Trumtrar, Ahmad Fatoum, barebox On Sat, 2 Oct 2021 10:48:50 +0200 Sascha Hauer <s.hauer@pengutronix.de> wrote: Hi Sascha! > On Fri, Oct 01, 2021 at 02:24:53PM +0300, Antony Pavlov wrote: > > Hi all! > > > > I have cloned barebox c67ada0024da (v2021.08.0) and found that > > 'of_compatible' and 'model' imd records are unusable. > > > > E.g. > > > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- imx_v8_defconfig > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- > > ... > > images built: > > barebox-nxp-imx8mm-evk.img > > barebox-prt-prt8mm.img > > barebox-nxp-imx8mp-evk.img > > barebox-nxp-imx8mq-evk.img > > barebox-zii-imx8mq-dev.img > > barebox-phytec-phycore-imx8mq.img > > > > barebox$ ./scripts/bareboximd images/barebox-nxp-imx8mm-evk.img > > build: #1 Fri Oct 1 10:16:30 UTC 2021 > > buildsystem version: > > crc32: 0x00000000 > > release: 2021.08.0 > > barebox$ > > > > There is no 'of_compatible' and 'model' imd records in bareboximd output. > > > > So there is no chance to imd_find_type(..., IMD_TYPE_OF_COMPATIBLE) > > (see common/bbu.c) in a barebox image file. > > > > scripts/gen-dtb-s puts IMD_TYPE_OF_COMPATIBLE and IMD_TYPE_MODEL > > records into barebox_imd_0 section. > > > > BAREBOX_IMD macro (include/asm-generic/barebox.lds.h) > > does not KEEP barebox_imd_0 section": > > This is done on purpose because otherwise... > > > > > #define BAREBOX_IMD \ > > STRUCT_ALIGN(); \ > > KEEP(*(.barebox_imd_start)) \ > > KEEP(*(.barebox_imd_1*)) \ > > *(.barebox_imd_0*) \ > > KEEP(*(.barebox_imd_end)) > > > > KEEPing barebox_imd_0 leads to several 'of_compatible' and 'model' records > > in one barebox image file, e.g.: > > ...exactly this would happen. > > To get the of_compatible and model imd tags in an image you have to put > IMD_USED_OF() explicitly into the entry function of the image handling > this compatible, there's no way for the build process to know which > image handles which device tree. See below for an example which adds the > tags for the boards you are currently compiling. There are two remarks: 1. It looks like we still able to automatically add of_compatible and model imd tags. Please see my message http://lists.infradead.org/pipermail/barebox/2021-October/037412.html 2. I have no lowlevel.c board files on MIPS :( Can we automaticaly generate of_compatible and model imd tags for most of the boards and explicitly generate tags with IMD_USED_OF() just for selected boards? -- Best regards, Antony Pavlov > > Sascha > > --------------------------------8<------------------------- > > From 456d90992fe0b9f4258b693a946f8d13ba5b0b4c Mon Sep 17 00:00:00 2001 > From: Sascha Hauer <s.hauer@pengutronix.de> > Date: Sat, 2 Oct 2021 10:45:04 +0200 > Subject: [PATCH] ARM: i.MX8m: Add of_compatible imd tags for i.MX8 boards > > The build process has to be manually told which image is compatible to > which device tree. Add the IMD_USED_OF() calls to the i.MX8m based > boards. > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > --- > arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 3 +++ > arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 3 +++ > arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 3 +++ > arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c | 3 +++ > arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 4 ++++ > 5 files changed, 16 insertions(+) > > diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > index 4bd29c2269..c2f6206cfd 100644 > --- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c > @@ -21,6 +21,7 @@ > #include <mfd/bd71837.h> > #include <soc/imx8m/ddr.h> > #include <soc/fsl/fsl_udc.h> > +#include <image-metadata.h> > > extern char __dtb_imx8mm_evk_start[]; > > @@ -177,5 +178,7 @@ ENTRY_FUNCTION(start_nxp_imx8mm_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > + IMD_USED_OF(imx8mm_evk); > + > nxp_imx8mm_evk_start(); > } > diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > index 3298ded586..5732ccc645 100644 > --- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c > @@ -4,6 +4,7 @@ > #include <common.h> > #include <debug_ll.h> > #include <firmware.h> > +#include <image-metadata.h> > #include <asm/mmu.h> > #include <asm/cache.h> > #include <asm/sections.h> > @@ -189,5 +190,7 @@ ENTRY_FUNCTION(start_nxp_imx8mp_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > + IMD_USED_OF(imx8mp_evk); > + > nxp_imx8mp_evk_start(); > } > diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > index 564621abef..92cc22e022 100644 > --- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > +++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c > @@ -2,6 +2,7 @@ > > #include <common.h> > #include <firmware.h> > +#include <image-metadata.h> > #include <linux/sizes.h> > #include <mach/generic.h> > #include <asm/barebox-arm-head.h> > @@ -106,5 +107,7 @@ ENTRY_FUNCTION(start_nxp_imx8mq_evk, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > + IMD_USED_OF(imx8mq_evk); > + > nxp_imx8mq_evk_start(); > } > diff --git a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > index 3b8b53b36e..24d98fe6c9 100644 > --- a/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > +++ b/arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c > @@ -2,6 +2,7 @@ > > #include <asm/barebox-arm.h> > #include <common.h> > +#include <image-metadata.h> > #include <debug_ll.h> > #include <firmware.h> > #include <mach/atf.h> > @@ -118,5 +119,7 @@ ENTRY_FUNCTION(start_prt_prt8mm, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > + IMD_USED_OF(imx8mm_prt8mm); > + > prt_prt8mm_start(); > } > diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > index 311e61fb1d..cf53fb2def 100644 > --- a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > +++ b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c > @@ -6,6 +6,7 @@ > > #include <common.h> > #include <firmware.h> > +#include <image-metadata.h> > #include <linux/sizes.h> > #include <mach/generic.h> > #include <asm/barebox-arm-head.h> > @@ -200,5 +201,8 @@ ENTRY_FUNCTION(start_zii_imx8mq_dev, r0, r1, r2) > relocate_to_current_adr(); > setup_c(); > > + IMD_USED_OF(imx8mq_zii_ultra_rmb3); > + IMD_USED_OF(imx8mq_zii_ultra_zest); > + > zii_imx8mq_dev_start(); > } > -- > 2.30.2 > > > > -- > Pengutronix e.K. | | > Steuerwalder Str. 21 | http://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 'of_compatible' and 'model' imd records are unusable 2021-10-02 9:44 ` Antony Pavlov @ 2021-10-04 7:52 ` Sascha Hauer 0 siblings, 0 replies; 5+ messages in thread From: Sascha Hauer @ 2021-10-04 7:52 UTC (permalink / raw) To: Antony Pavlov; +Cc: Steffen Trumtrar, Ahmad Fatoum, barebox On Sat, Oct 02, 2021 at 12:44:47PM +0300, Antony Pavlov wrote: > On Sat, 2 Oct 2021 10:48:50 +0200 > Sascha Hauer <s.hauer@pengutronix.de> wrote: > > Hi Sascha! > > > On Fri, Oct 01, 2021 at 02:24:53PM +0300, Antony Pavlov wrote: > > > Hi all! > > > > > > I have cloned barebox c67ada0024da (v2021.08.0) and found that > > > 'of_compatible' and 'model' imd records are unusable. > > > > > > E.g. > > > > > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- imx_v8_defconfig > > > barebox$ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- > > > ... > > > images built: > > > barebox-nxp-imx8mm-evk.img > > > barebox-prt-prt8mm.img > > > barebox-nxp-imx8mp-evk.img > > > barebox-nxp-imx8mq-evk.img > > > barebox-zii-imx8mq-dev.img > > > barebox-phytec-phycore-imx8mq.img > > > > > > barebox$ ./scripts/bareboximd images/barebox-nxp-imx8mm-evk.img > > > build: #1 Fri Oct 1 10:16:30 UTC 2021 > > > buildsystem version: > > > crc32: 0x00000000 > > > release: 2021.08.0 > > > barebox$ > > > > > > There is no 'of_compatible' and 'model' imd records in bareboximd output. > > > > > > So there is no chance to imd_find_type(..., IMD_TYPE_OF_COMPATIBLE) > > > (see common/bbu.c) in a barebox image file. > > > > > > scripts/gen-dtb-s puts IMD_TYPE_OF_COMPATIBLE and IMD_TYPE_MODEL > > > records into barebox_imd_0 section. > > > > > > BAREBOX_IMD macro (include/asm-generic/barebox.lds.h) > > > does not KEEP barebox_imd_0 section": > > > > This is done on purpose because otherwise... > > > > > > > > #define BAREBOX_IMD \ > > > STRUCT_ALIGN(); \ > > > KEEP(*(.barebox_imd_start)) \ > > > KEEP(*(.barebox_imd_1*)) \ > > > *(.barebox_imd_0*) \ > > > KEEP(*(.barebox_imd_end)) > > > > > > KEEPing barebox_imd_0 leads to several 'of_compatible' and 'model' records > > > in one barebox image file, e.g.: > > > > ...exactly this would happen. > > > > To get the of_compatible and model imd tags in an image you have to put > > IMD_USED_OF() explicitly into the entry function of the image handling > > this compatible, there's no way for the build process to know which > > image handles which device tree. See below for an example which adds the > > tags for the boards you are currently compiling. > > There are two remarks: > > 1. It looks like we still able to automatically add of_compatible and model imd tags. > Please see my message http://lists.infradead.org/pipermail/barebox/2021-October/037412.html I gave it a try, it works and looks like a good solution. We'll need another if [ "$imd" = "y" ]; then echo ".word __imd_${name}_start" fi at the end of scripts/gen-dtb-s to make it work with compressed dtbs as well. > > Can we automaticaly generate of_compatible and model imd tags for most of the boards > and explicitly generate tags with IMD_USED_OF() just for selected boards? With your approach we can drop IMD_USED_OF(), at least I see no more need for it. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-04 7:54 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-01 11:46 'of_compatible' and 'model' imd records are unusable Antony Pavlov 2021-10-01 23:47 ` Antony Pavlov [not found] <20211001142453.4a3c0ba9bd7bb909125e2a5f@gmail.com> 2021-10-02 8:48 ` Sascha Hauer 2021-10-02 9:44 ` Antony Pavlov 2021-10-04 7:52 ` Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox