'of_compatible' and 'model' imd records are unusable
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Sascha Hauer
maintainerHi Antony,
+Cc list
Quoted 27 lines · Antony Pavlov
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_defconfigbarebox$ 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.imgbarebox$
./scripts/bareboximdimages/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.
Quoted 8 lines
So there is no chance to
imd_find_type(..., IMD_TYPE_OF_COMPATIBLE)(seecommon/bbu.c) in a barebox image file.
scripts/gen-dtb-sputsIMD_TYPE_OF_COMPATIBLEandIMD_TYPE_MODELrecords intobarebox_imd_0section.
BAREBOX_IMDmacro (include/asm-generic/barebox.lds.h) does not KEEPbarebox_imd_0section":
This is done on purpose because otherwise...
Quoted 10 lines
#define BAREBOX_IMD \ STRUCT_ALIGN(); \ KEEP(*(.barebox_imd_start)) \ KEEP(*(.barebox_imd_1*)) \ *(.barebox_imd_0*) \ KEEP(*(.barebox_imd_end))KEEPing
barebox_imd_0leads 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<-------------------------
Quoted 1 line
From
456d90992fe0b9f4258b693a946f8d13ba5b0b4cMon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
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.
--- 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(+)
arch/arm/boards/nxp-imx8mm-evk/lowlevel.c +3 -0
@@ -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 (); }
arch/arm/boards/nxp-imx8mp-evk/lowlevel.c +3 -0
@@ -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 (); }
arch/arm/boards/nxp-imx8mq-evk/lowlevel.c +3 -0
@@ -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 (); }
arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c +3 -0
@@ -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 (); }
arch/arm/boards/zii-imx8mq-dev/lowlevel.c +4 -0
@@ -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 (); }
Signature · 14 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox
On Sat, 2 Oct 2021 10:48:50 +0200
Sascha Hauer <[email protected]> wrote:
Hi Sascha!
Quoted 50 lines · Antony Pavlov
Quoted 27 lines
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_defconfigbarebox$ 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.imgbarebox$
./scripts/bareboximdimages/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.Quoted 8 lines
So there is no chance to
imd_find_type(..., IMD_TYPE_OF_COMPATIBLE)(seecommon/bbu.c) in a barebox image file.
scripts/gen-dtb-sputsIMD_TYPE_OF_COMPATIBLEandIMD_TYPE_MODELrecords intobarebox_imd_0section.
BAREBOX_IMDmacro (include/asm-generic/barebox.lds.h) does not KEEPbarebox_imd_0section":This is done on purpose because otherwise...
Quoted 10 lines
#define BAREBOX_IMD \ STRUCT_ALIGN(); \ KEEP(*(.barebox_imd_start)) \ KEEP(*(.barebox_imd_1*)) \ *(.barebox_imd_0*) \ KEEP(*(.barebox_imd_end))KEEPing
barebox_imd_0leads to several 'of_compatible' and 'model' records in one barebox image file, e.g.:
Quoted 7 lines
...exactly this would happen.
To get the
of_compatibleand model imd tags in an image you have to putIMD_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?
Signature · 2 lines
Best regards, Antony Pavlov
Quoted 134 lines
Sascha
--------------------------------8<-------------------------
From
456d90992fe0b9f4258b693a946f8d13ba5b0b4cMon Sep 17 00:00:00 2001
From: Sascha Hauer <[email protected]>
Date: Sat, 2 Oct 2021 10:45:04 +0200
Subject: [PATCH] ARM: i.MX8m: Addof_compatibleimd tags for i.MX8 boardsThe 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 <[email protected]>--- 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(+)arch/arm/boards/nxp-imx8mm-evk/lowlevel.c +3
-0@@ -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 (); }arch/arm/boards/nxp-imx8mp-evk/lowlevel.c +3
-0@@ -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 (); }arch/arm/boards/nxp-imx8mq-evk/lowlevel.c +3
-0@@ -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 (); }arch/arm/boards/protonic-imx8m/lowlevel-prt8mm.c +3
-0@@ -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 (); }arch/arm/boards/zii-imx8mq-dev/lowlevel.c +4
-0@@ -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 (); }Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerQuoted 63 lines · Antony Pavlov
On Sat, 2 Oct 2021 10:48:50 +0200
Sascha Hauer <[email protected]> wrote:Hi Sascha!
Quoted 50 lines · Antony Pavlov
Quoted 27 lines
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_defconfigbarebox$ 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.imgbarebox$
./scripts/bareboximdimages/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.Quoted 8 lines
So there is no chance to
imd_find_type(..., IMD_TYPE_OF_COMPATIBLE)(seecommon/bbu.c) in a barebox image file.
scripts/gen-dtb-sputsIMD_TYPE_OF_COMPATIBLEandIMD_TYPE_MODELrecords intobarebox_imd_0section.
BAREBOX_IMDmacro (include/asm-generic/barebox.lds.h) does not KEEPbarebox_imd_0section":This is done on purpose because otherwise...
Quoted 10 lines
#define BAREBOX_IMD \ STRUCT_ALIGN(); \ KEEP(*(.barebox_imd_start)) \ KEEP(*(.barebox_imd_1*)) \ *(.barebox_imd_0*) \ KEEP(*(.barebox_imd_end))KEEPing
barebox_imd_0leads to several 'of_compatible' and 'model' records in one barebox image file, e.g.:Quoted 7 lines
...exactly this would happen.
To get the
of_compatibleand model imd tags in an image you have to putIMD_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.
Quoted 4 lines
There are two remarks:
1. It looks like we still able to automatically add
of_compatibleand 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.
Quoted 3 lines
Can we automaticaly generate
of_compatibleand model imd tags for most of the boards and explicitly generate tags withIMD_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
Signature · 9 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox