imx: imx8qm-rom7720: switch to binman
Subsystems (3)
RFC 1/1 imx: imx8qm-rom7720: switch to binman
Switch to use binman to pack images
---
Run into this issue on the first try to get binman working:
make[1]: Nothing to be done for 'SPL'.
BINMAN flash.bin
MKIMAGE flash.bin
Error: spl/u-boot-spl.cfgout[16] - Invalid command (LOADER) arch/arm/mach-imx/Makefile:190: recipe for target 'flash.bin' failed make[1]: *** [flash.bin] Error 1
make[1]: *** Deleting file 'flash.bin'
Makefile:1519: recipe for target 'flash.bin' failed
make: *** [flash.bin] Error 2
Some clue howto fix that?
arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 95 +++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +--- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +- 5 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsi
arch/arm/dts/imx8qm-rom7720-a1.dts +1 -0
@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000; #include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";
arch/arm/dts/imx8qm-u-boot.dtsi new file +95 -0
95 lines not on this page · raw message
arch/arm/mach-imx/imx8/Kconfig +1 -0
@@ -81,6 +81,7 @@ config TARGET_CONGA_QMX8 config TARGET_IMX8QM_ROM7720_A1 bool "Support i.MX8QM ROM-7720-A1" + select BINMAN select BOARD_LATE_INIT select SUPPORT_SPL select IMX8QM
board/advantech/imx8qm_rom7720_a1/imximage.cfg +2 -14
@@ -5,17 +5,5 @@ #define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM -/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000 +BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000
configs/imx8qm_rom7720_a1_4G_defconfig +1 -1
@@ -18,7 +18,7 @@ CONFIG_SPL=y CONFIG_SYS_LOAD_ADDR=0x80280000 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_SPL_FIT_GENERATOR is not set CONFIG_BOOTDELAY=3 CONFIG_LOG=y CONFIG_BOARD_EARLY_INIT_F=y
Signature · 1 line
2.17.1
Hello Oliver,
Quoted 11 lines
-----Original Message-----
From: Oliver Graute <[email protected]>
Sent: Monday, January 10, 2022 11:31 AM
To: Oliver Graute <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; NXP i.MX U-Boot Team <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; ZHIZHIKIN Andrey <[email protected]>; [email protected]
Subject: [RFC] imx: imx8qm-rom7720: switch to binman
Quoted 1 line
Switch to use binman to pack images
Please don't forget S-o-B, checkpatch does complain about it. ;)
Quoted 15 lines
---
Run into this issue on the first try to get binman working:
make[1]: Nothing to be done for 'SPL'.
BINMAN flash.bin
MKIMAGE flash.bin
Error: spl/u-boot-spl.cfgout[16] - Invalid command (LOADER)arch/arm/mach-imx/Makefile:190: recipe for target 'flash.bin' failed make[1]: *** [flash.bin] Error 1
make[1]: *** Deleting file 'flash.bin'
Makefile:1519: recipe for target 'flash.bin' failed
make: *** [flash.bin] Error 2
Quoted 1 line
Some clue howto fix that?
This might be due to the fact that you're using the same u-boot-nodtb.bin binary twice: once in binman section, and once in ITB. You can try to rename the binman entry to a different name, this might do the trick. See [1] for sample of imx8mq_evk conversion.
Quoted 6 lines
arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 95 +++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +--- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +-
Is there any documentation available for this board that needs adaptions with new build instructions? I was not able to locate any doc for this board at all...
Quoted 34 lines
5 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsiarch/arm/dts/imx8qm-rom7720- renamed from arch/arm/dts/imx8qm-rom7720-a1.dts +0
-0
a1.dts
indexd1f2fff869..332d441c6d100644arch/arm/dts/imx8qm-rom7720-a1.dts +1
-0@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000; #include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";arch/arm/dts/imx8qm-u-boot.dtsi new file +12
-0@@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021 NXP + */ + +/ { + binman: binman { + multiple-images; + }; + +}; +
arch/arm/dts/imx8qm-u-boot.dtsi line 22
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+&binman { + u-boot-nodtb { + filename = "u-boot-nodtb.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + };
What I see is missing in this section is SECO and SCFW binaries.
Can i.MX8QM boot without those? Otherwise generated image will be unusable.
Quoted 42 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +6
-0+ + }; + + flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e
0x100000";arch/arm/dts/imx8qm-u-boot.dtsi new file +35
-0+ + blob { + filename = "u-boot-nodtb.bin"; + }; + + }; + + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + #address-cells = <1>; + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + + uboot_blob: blob-ext { + filename = "u-boot-nodtb.bin"; + }; + }; + + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none";
arch/arm/dts/imx8qm-u-boot.dtsi line 73
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+ load = <0x80000000>; + entry = <0x80000000>; + + atf_blob: blob-ext { + filename = "bl31.bin"; + }; + }; + + fdt { + description = "imx8qm-rom7720-a1";
You can use "NAME" here I suppose.
Quoted 4 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +4
-0+ type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob: blob-ext {
arch/arm/dts/imx8qm-u-boot.dtsi line 87
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+ filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + default = "conf"; + + conf { + description = "imx8qm-rom7720-a1";
And as well here, "NAME".
arch/arm/dts/imx8qm-u-boot.dtsi line 95
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; + }; + }; +};
This binman configuration suggests that there are 2 binaries that should be populated onto the bootable media: flash.bin and u-boot.itb. Can you please convert them to use a single binary? Sample code for this is also in [1].
Quoted 52 lines
arch/arm/mach-imx/imx8/Kconfig +1
-0@@ -81,6 +81,7 @@ config TARGET_CONGA_QMX8 config TARGET_IMX8QM_ROM7720_A1 bool "Support i.MX8QM ROM-7720-A1" + select BINMAN select BOARD_LATE_INIT select SUPPORT_SPL select IMX8QMboard/advantech/imx8qm_rom7720_a1/imximage.cfg +2
-14@@ -5,17 +5,5 @@ #define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM -/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000 +BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000configs/imx8qm_rom7720_a1_4G_defconfig +1
-2@@ -18,7 +18,7 @@ CONFIG_SPL=y CONFIG_SYS_LOAD_ADDR=0x80280000 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_SPL_FIT_GENERATOR is not set CONFIG_BOOTDELAY=3 CONFIG_LOG=y CONFIG_BOARD_EARLY_INIT_F=y --
Quoted 1 line
2.17.1
-- andrey
Quoted 13 lines · ZHIZHIKIN Andrey
Hello Oliver,
Quoted 11 lines
-----Original Message-----
From: Oliver Graute <[email protected]>
Sent: Monday, January 10, 2022 11:31 AM
To: Oliver Graute <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; NXP i.MX U-Boot Team <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; ZHIZHIKIN Andrey <[email protected]>; [email protected]
Subject: [RFC] imx: imx8qm-rom7720: switch to binman
Quoted 3 lines
Quoted 1 line
Switch to use binman to pack images
Please don't forget S-o-B, checkpatch does complain about it. ;)
will do it on next submission
Quoted 15 lines
Quoted 15 lines
---
Run into this issue on the first try to get binman working:
make[1]: Nothing to be done for 'SPL'.
BINMAN flash.bin
MKIMAGE flash.bin
Error: spl/u-boot-spl.cfgout[16] - Invalid command (LOADER)arch/arm/mach-imx/Makefile:190: recipe for target 'flash.bin' failed make[1]: *** [flash.bin] Error 1
make[1]: *** Deleting file 'flash.bin'
Makefile:1519: recipe for target 'flash.bin' failed
make: *** [flash.bin] Error 2
Quoted 3 lines
Quoted 1 line
Some clue howto fix that?
This might be due to the fact that you're using the same u-boot-nodtb.bin binary twice: once in binman section, and once in ITB. You can try to rename the binman entry to a different name, this might do the trick. See [1] for sample of
imx8mq_evkconversion.
ok I think I fixed that. I dropped additionally the following statements:
make u-boot.bin
make flash.bin
just make is enough here or?
But still get this warning even if CONFIG_SPL_FIT_GENERATOR is disabled.
make imx8qm_rom7720_a1_4G_defconfig && make
#
# configuration written to .config # scripts/kconfig/conf --syncconfig Kconfig CFG u-boot.cfg GEN include/autoconf.mk GEN include/autoconf.mk.dep CFG spl/u-boot.cfg GEN spl/include/autoconf.mk ===================== WARNING ====================== This board uses CONFIG_SPL_FIT_GENERATOR. Please migrate to binman instead, to avoid the proliferation of arch-specific scripts with no tests. ====================================================
Quoted 3 lines
Is there any documentation available for this board that needs adaptions with new build instructions? I was not able to locate any doc for this board at all...
You find the doc here:
doc/board/advantech/imx8qm-rom7720-a1.rst
Quoted 4 lines
What I see is missing in this section is SECO and SCFW binaries.
Can i.MX8QM boot without those? Otherwise generated image will be unusable.
you are right. This is still missing. Can you point me to a example with SECO and SCFW?
Quoted 6 lines
This binman configuration suggests that there are 2 binaries that should be populated onto the bootable media: flash.bin and u-boot.itb. Can you please convert them to use a single binary? Sample code for this is also in [1].
thx for your suggestions
Best regards,
Oliver
Hi Oliver
Quoted 13 lines · ZHIZHIKIN Andrey
Hello Oliver,
Quoted 11 lines
-----Original Message-----
From: Oliver Graute <[email protected]>
Sent: Monday, January 10, 2022 11:31 AM
To: Oliver Graute <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; NXP i.MX U-Boot Team <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; ZHIZHIKIN Andrey <[email protected]>; [email protected]
Subject: [RFC] imx: imx8qm-rom7720: switch to binman
Quoted 9 lines
Quoted 1 line
Switch to use binman to pack images
Please don't forget S-o-B, checkpatch does complain about it. ;)
Quoted 6 lines
---
Run into this issue on the first try to get binman working:
make[1]: Nothing to be done for 'SPL'.
You may need something similar to [1]
Quoted 9 lines
Quoted 9 lines
BINMAN flash.bin
MKIMAGE flash.bin
Error: spl/u-boot-spl.cfgout[16] - Invalid command (LOADER)arch/arm/mach-imx/Makefile:190: recipe for target 'flash.bin' failed make[1]: *** [flash.bin] Error 1
make[1]: *** Deleting file 'flash.bin'
Makefile:1519: recipe for target 'flash.bin' failed
make: *** [flash.bin] Error 2
Quoted 5 lines
Quoted 1 line
Some clue howto fix that?
This might be due to the fact that you're using the same u-boot-nodtb.bin binary twice: once in binman section, and once in ITB. You can try to rename the binman entry to a different name, this might do the trick. See [1] for sample of
imx8mq_evkconversion.
Yep, adding the imx-boot/flash.bin binman section combining them two should avoid this.
To be honest, even on imx8mm it currently fails if doing make flash.bin rather than just make which will call BINMAN ALL. I guess, that might be some kind of a remnant resp. clash with before binman stuff.
⬢[zim@toolbox u-boot.git]$ make verdin-imx8mm_defconfig ⬢[zim@toolbox u-boot.git]$ make -j12 flash.bin
...
BINMAN flash.bin
MKIMAGE flash.bin./tools/mkimage: Can't open spl/u-boot-spl-ddr.bin: No such file or directory make[1]: *** [arch/arm/mach-imx/Makefile:167: flash.bin] Error 1 make[1]: *** Deleting file 'flash.bin'
make: *** [Makefile:1521: flash.bin] Error 2
Quoted 34 lines
Quoted 5 lines
arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 95 +++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +--- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +-
Is there any documentation available for this board that needs adaptions with new build instructions? I was not able to locate any doc for this board at all...
Quoted 24 lines
5 files changed, 100 insertions(+), 15 deletions(-)create mode 100644
arch/arm/dts/imx8qm-u-boot.dtsiarch/arm/dts/imx8qm-rom7720- renamed from arch/arm/dts/imx8qm-rom7720-a1.dts +0
-0
a1.dts
indexd1f2fff869..332d441c6d100644arch/arm/dts/imx8qm-rom7720-a1.dts +1
-0@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000; #include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";arch/arm/dts/imx8qm-u-boot.dtsi new file +2
-0@@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi line 10
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ * Copyright 2021 NXP + */ + +/ { + binman: binman { + multiple-images; + }; +
Please avoid such empty lines before closing curly braces.
Quoted 63 lines
arch/arm/dts/imx8qm-u-boot.dtsi line 22
Quoted 12 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +12
-0+}; + +&binman { + u-boot-nodtb { + filename = "u-boot-nodtb.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + };What I see is missing in this section is SECO and SCFW binaries.
Can i.MX8QM boot without those? Otherwise generated image will be unusable.
Quoted 46 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +6
-0+ + }; + + flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e
0x100000";arch/arm/dts/imx8qm-u-boot.dtsi new file +39
-0+ + blob { + filename = "u-boot-nodtb.bin"; + }; + + }; + + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATF before U-Boot"; + #address-cells = <1>; + fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; + + images { + uboot { + description = "U-Boot (64-bit)"; + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + + uboot_blob: blob-ext { + filename = "u-boot-nodtb.bin"; + }; + }; + + atf { + description = "ARM Trusted Firmware"; + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x80000000>; + entry = <0x80000000>; + + atf_blob: blob-ext {
Quoted 8 lines
Quoted 6 lines
+ filename = "bl31.bin"; + };
+ };
+
+ fdt {
+ description = "imx8qm-rom7720-a1";You can use "NAME" here I suppose.
I guess, Andrey meant filename, right?
Anyway, you may want to look at the latest clean-up I did here [2] et al. Otherwise I will have to go through that same clean-up for imx8qm later yet again :-p.
Quoted 26 lines
Quoted 4 lines
+ type = "
flat_dt"; + compression = "none";arch/arm/dts/imx8qm-u-boot.dtsi new file +2
-0+ + uboot_fdt_blob: blob-ext {arch/arm/dts/imx8qm-u-boot.dtsi line 87
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+ filename = "u-boot.dtb"; + }; + }; + }; + + configurations { + default = "conf"; + + conf { + description = "imx8qm-rom7720-a1";And as well here, "NAME".
Quoted 8 lines
+ firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + };
+ };
+ };
+ };
+};
Quoted 4 lines
This binman configuration suggests that there are 2 binaries that should be populated onto the bootable media: flash.bin and u-boot.itb. Can you please convert them to use a single binary? Sample code for this is also in [1].
I also could not really find such information as at least the address where to put the second part will be crucial.
Quoted 40 lines
Quoted 40 lines
arch/arm/mach-imx/imx8/Kconfig +0
-0@@ -81,6 +81,7 @@ config TARGET_CONGA_QMX8config
TARGET_IMX8QM_ROM7720_A1
bool "Support i.MX8QM ROM-7720-A1"
+ select BINMAN
selectBOARD_LATE_INIT
selectSUPPORT_SPL
select IMX8QMboard/advantech/imx8qm_rom7720_a1/imximage.cfg +2
-14@@ -5,17 +5,5 @@ #define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM -/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000 +BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000configs/imx8qm_rom7720_a1_4G_defconfig +0
-0
Quoted 8 lines
configs/imx8qm_rom7720_a1_4G_defconfig CONFIG_SPL=y · line 21
Quoted 8 lines
configs/imx8qm_rom7720_a1_4G_defconfig +0
-0@@ -18,7 +18,7 @@ CONFIG_SPL=yCONFIG_SYS_LOAD_ADDR=0x80280000
CONFIG_FIT=y
CONFIG_SPL_LOAD_FIT=yconfigs/imx8qm_rom7720_a1_4G_defconfig +1
-1-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_SPL_FIT_GENERATOR is not set
I guess, that would likely rather need to be as follows:
# CONFIG_USE_SPL_FIT_GENERATOR is not set
Quoted 9 lines
Quoted 5 lines
CONFIG_BOOTDELAY=3
CONFIG_LOG=y
CONFIG_BOARD_EARLY_INIT_F=y
--
2.17.1-- andrey
[1] https://source.denx.de/u-boot/u-boot/-/commit/68de913c12c4d091f51009ad6f179fab825d3d82
[2] https://source.denx.de/u-boot/u-boot/-/commit/f17fb6cae4ddaa539f2a49851b112f2d547bbada
Cheers
Marcel
Quoted 55 lines · Marcel Ziswiler
Hi Oliver
Quoted 7 lines · ZHIZHIKIN Andrey
Hello Oliver,
Quoted 5 lines
-----Original Message-----
From: Oliver Graute <[email protected]>
Sent: Monday, January 10, 2022 11:31 AM
To: Oliver Graute <[email protected]>; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; NXP i.MX U-BootTeam
Quoted 3 lines
Quoted 3 lines
<[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; ZHIZHIKIN Andrey <Quoted 12 lines
Quoted 4 lines
[email protected]
Subject: [RFC] imx: imx8qm-rom7720: switch to binmanSwitch to use binman to pack images
Please don't forget S-o-B, checkpatch does complain about it. ;)
Quoted 6 lines
---
Run into this issue on the first try to get binman working:
make[1]: Nothing to be done for 'SPL'.
You may need something similar to [1]
Quoted 9 lines
Quoted 9 lines
BINMAN flash.bin
MKIMAGE flash.bin
Error: spl/u-boot-spl.cfgout[16] - Invalid command (LOADER)arch/arm/mach-imx/Makefile:190: recipe for target 'flash.bin' failed make[1]: *** [flash.bin] Error 1
make[1]: *** Deleting file 'flash.bin'
Makefile:1519: recipe for target 'flash.bin' failed
make: *** [flash.bin] Error 2Quoted 3 lines
Quoted 1 line
Some clue howto fix that?
This might be due to the fact that you're using the same
u-boot-nodtb.bin binary twice: once in binman
Quoted 1 line
section, and once in ITB. You can try to rename the binman entry to a
different name, this might do the
Quoted 1 line
trick. See [1] for sample of
imx8mq_evkconversion.Yep, adding the imx-boot/flash.bin binman section combining them two should avoid this.
To be honest, even on imx8mm it currently fails if doing make flash.bin rather than just make which will call
BINMAN ALL. I guess, that might be some kind of a remnant resp. clash with before binman stuff.
Quoted 8 lines
⬢[zim@toolbox u-boot.git]$ make verdin-imx8mm_defconfig ⬢[zim@toolbox u-boot.git]$ make -j12 flash.bin
...
BINMAN flash.bin
MKIMAGE flash.bin./tools/mkimage: Can't open spl/u-boot-spl-ddr.bin: No such file or directory
When I got this error, I had to double check the imximage-8mm-lpddr4.cfg file referenced from the Kconfig. Beacon has a custom one [1] that doesn't point to spl, and that made this error go away.
[1]
https://source.denx.de/u-boot/u-boot/-/blob/master/board/beacon/imx8mm/imximage-8mm-lpddr4.cfg
Quoted 248 lines
make[1]: *** [
arch/arm/mach-imx/Makefile:167: flash.bin] Error 1 make[1]: *** Deleting file 'flash.bin'
make: *** [Makefile:1521: flash.bin] Error 2Quoted 6 lines
Quoted 5 lines
arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 95 +++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +--- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +-Quoted 8 lines
Is there any documentation available for this board that needs adaptions with new build instructions? I was not able to locate any doc for this board at all...
Review
Quoted 4 lines
5 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsi(quoted diff) +0
-0b/arch/arm/dts/imx8qm-rom7720-
Quoted 7 lines
Quoted 7 lines
a1.dts
indexd1f2fff869..332d441c6d100644arch/arm/dts/imx8qm-rom7720-a1.dts +0
-0@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000;Quoted 6 lines
Review
Quoted 6 lines
arch/arm/dts/imx8qm-rom7720-a1.dts +1
-0#include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";(quoted diff) +0
-0
b/arch/arm/dts/imx8qm-u-boot.dtsiQuoted 7 lines
Quoted 7 lines
new file mode 100644
index 0000000000..77e5cd6989arch/arm/dts/imx8qm-u-boot.dtsi new file +2
-0@@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi line 10
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ * Copyright 2021 NXP + */ + +/ { + binman: binman { + multiple-images; + }; +Please avoid such empty lines before closing curly braces.
Quoted 15 lines
arch/arm/dts/imx8qm-u-boot.dtsi line 22
Quoted 12 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +12
-0+}; + +&binman { + u-boot-nodtb { + filename = "u-boot-nodtb.bin"; + pad-byte = <0xff>; + align-size = <4>; + align = <4>; + + u-boot-spl { + align-end = <4>; + };What I see is missing in this section is SECO and SCFW binaries.
Quoted 1 line
Can i.MX8QM boot without those? Otherwise generated image will be
unusable.
Quoted 7 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 7 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +6
-0+ + }; + + flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage-e
Quoted 7 lines
Quoted 7 lines
0x100000";arch/arm/dts/imx8qm-u-boot.dtsi new file +6
-0+ + blob { + filename = "u-boot-nodtb.bin"; + }; + + };Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ + }; + + itb { + filename = "u-boot.itb"; + + fit { + description = "Configuration to load ATFbefore U-Boot";
Quoted 2 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 2 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +2
-0+ #address-cells = <1>; + fit,external-offset =<
CONFIG_FIT_EXTERNAL_OFFSET>;Quoted 4 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 4 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +4
-0+ + images { + uboot { + description = "U-Boot(64-bit)";
Quoted 7 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 7 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +7
-0+ type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <CONFIG_SYS_TEXT_BASE>; + + uboot_blob: blob-ext { + filename ="u-boot-nodtb.bin";
Quoted 5 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 5 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +5
-0+ }; + }; + + atf { + description = "ARM TrustedFirmware";
Quoted 5 lines
Quoted 5 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +5
-0+ type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x80000000>; + entry = <0x80000000>;Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ + atf_blob: blob-ext { + filename = "bl31.bin"; + }; + }; + + fdt { + description ="imx8qm-rom7720-a1";
Quoted 2 lines
You can use "NAME" here I suppose.
I guess, Andrey meant filename, right?
Anyway, you may want to look at the latest clean-up I did here [2] et al. Otherwise I will have to go through
that same clean-up for imx8qm later yet again :-p.Quoted 5 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 5 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +5
-0+ type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob: blob-ext { + filename ="u-boot.dtb";
Quoted 9 lines
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 9 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +9
-0+ }; + }; + }; + + configurations { + default = "conf"; + + conf { + description ="imx8qm-rom7720-a1";
Quoted 12 lines
And as well here, "NAME".
arch/arm/dts/imx8qm-u-boot.dtsi line 95
Quoted 8 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +8
-0+ firmware = "uboot"; + loadables = "atf"; + fdt = "fdt"; + }; + }; + }; + }; +};Quoted 4 lines
This binman configuration suggests that there are 2 binaries that should be populated onto the bootable media: flash.bin and u-boot.itb. Can you please convert them to use a single binary? Sample code for this is also in [1].
I also could not really find such information as at least the address where to put the second part will be
crucial.Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0b/arch/arm/mach-imx/imx8/Kconfig
Quoted 39 lines
Quoted 39 lines
index
b43739e5c6..b42b985cdf100644arch/arm/mach-imx/imx8/Kconfig +1
-0@@ -81,6 +81,7 @@ config TARGET_CONGA_QMX8 config TARGET_IMX8QM_ROM7720_A1 bool "Support i.MX8QM ROM-7720-A1" + select BINMAN select BOARD_LATE_INIT select SUPPORT_SPL select IMX8QMboard/advantech/imx8qm_rom7720_a1/imximage.cfg +2
-14@@ -5,17 +5,5 @@ #define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM -/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000 +BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000configs/imx8qm_rom7720_a1_4G_defconfig +0
-0Quoted 8 lines
configs/imx8qm_rom7720_a1_4G_defconfig CONFIG_SPL=y · line 21
Quoted 8 lines
configs/imx8qm_rom7720_a1_4G_defconfig +1
-1@@ -18,7 +18,7 @@ CONFIG_SPL=y CONFIG_SYS_LOAD_ADDR=0x80280000 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_SPL_FIT_GENERATOR is not setI guess, that would likely rather need to be as follows:
#
CONFIG_USE_SPL_FIT_GENERATORis not setQuoted 9 lines
Quoted 5 lines
configs/imx8qm_rom7720_a1_4G_defconfig +0
-1CONFIG_BOOTDELAY=3 CONFIG_LOG=y CONFIG_BOARD_EARLY_INIT_F=y --2.17.1
-- andrey
Link [1]:https://lore.kernel.org/u-boot/[email protected]/
[1]
https://source.denx.de/u-boot/u-boot/-/commit/68de913c12c4d091f51009ad6f179fab825d3d82
[2]
https://source.denx.de/u-boot/u-boot/-/commit/f17fb6cae4ddaa539f2a49851b112f2d547bbadaCheers
Marcel
RFC 1/1 imx: imx8qm-rom7720: switch to binman
In reply to Oliver GrauteSwitch to use binman to pack images
---
A flash.bin is now generated by binman but its now bigger then with mkimage_fit_atf.sh 800K vs. 1.1M and is currently NOT booting. So something is still messed up.
arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 136 ++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +-- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +- doc/board/advantech/imx8qm-rom7720-a1.rst | 3 +- 6 files changed, 142 insertions(+), 17 deletions(-) create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsi
arch/arm/dts/imx8qm-rom7720-a1.dts +1 -0
@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000; #include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";
arch/arm/dts/imx8qm-u-boot.dtsi new file +136 -0
136 lines not on this page · raw message
arch/arm/mach-imx/imx8/Kconfig +1 -0
@@ -81,6 +81,7 @@ config TARGET_CONGA_QMX8 config TARGET_IMX8QM_ROM7720_A1 bool "Support i.MX8QM ROM-7720-A1" + select BINMAN select BOARD_LATE_INIT select SUPPORT_SPL select IMX8QM
board/advantech/imx8qm_rom7720_a1/imximage.cfg +2 -14
@@ -5,17 +5,5 @@ #define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM -/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000 +BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000
configs/imx8qm_rom7720_a1_4G_defconfig +1 -1
@@ -18,7 +18,7 @@ CONFIG_SPL=y CONFIG_SYS_LOAD_ADDR=0x80280000 CONFIG_FIT=y CONFIG_SPL_LOAD_FIT=y -CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh" +# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_BOOTDELAY=3 CONFIG_LOG=y CONFIG_BOARD_EARLY_INIT_F=y
doc/board/advantech/imx8qm-rom7720-a1.rst +1 -2
@@ -57,8 +57,7 @@ Build U-Boot $ export ATF_LOAD_ADDR=0x80000000 $ export BL33_LOAD_ADDR=0x80020000 $ make imx8qm_rom7720_a1_4G_defconfig - $ make u-boot.bin - $ make flash.bin + $ make Flash the binary into the SD card ---------------------------------
Signature · 1 line
2.17.1
Quoted 57 lines · Oliver Graute
Switch to use binman to pack images
Signed-off-by Oliver Graute <[email protected]>arch/arm/dts/imx8qm-u-boot.dtsi new file +54
-0+ + images { + uboot { + arch = "arm64"; + compression = "none"; + description = "U-Boot (64-bit)"; + load = <CONFIG_SYS_TEXT_BASE>; + type = "standalone"; + + uboot_blob { + filename = "u-boot-nodtb.bin"; + type = "blob-ext"; + }; + }; + + atf { + arch = "arm64"; + compression = "none"; + description = "ARM Trusted Firmware"; + entry = <0x00910000>; + load = <0x00091000>; + type = "firmware"; + + atf_blob { + filename = "bl31.bin"; + type = "blob-ext"; + }; + }; + + scfw { + arch = "arm64"; + compression = "none"; + description = "System Controler Firmware"; + type = "firmware"; + + scfw_blob { + filename = "mx8qm-val-scfw-tcm.bin"; + type = "blob-ext"; + }; + }; + + seco { + arch = "arm64"; + compression = "none"; + description = "Seco Firmware"; + type = "firmware"; + + seco_blob { + filename = "mx8qm-ahab-container.img"; + type = "blob-ext"; + }; + }; + + fdt {
arch/arm/dts/imx8qm-u-boot.dtsi line 105
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+ filename = "imx8qm-rom7720-a1"; + type = "flat_dt"; + compression = "none"; + + uboot_fdt_blob { + filename = "u-boot.dtb"; + type = "blob-ext"; + }; + }; + };
As far as I now the order of the blobs for imx8qm is:
1.SECO
2.scfw
3.ATF
4.U-Boot
So do I need to reorder the blobs nodes above? How is the order determined?
Quoted 7 lines
#define
__ASSEMBLY__board/advantech/imx8qm_rom7720_a1/imximage.cfg +0
-4-/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM
board/advantech/imx8qm_rom7720_a1/imximage.cfg line 21
Quoted 10 lines
board/advantech/imx8qm_rom7720_a1/imximage.cfg +0
-10-/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000
this is what imx-image is doing before. Can someone comment on this?
Best Regards,
Oliver
Quoted 53 lines · Oliver Graute
Switch to use binman to pack images
Signed-off-by Oliver Graute <[email protected]>---
A flash.bin is now generated by binman but its now bigger then with
mkimage_fit_atf.sh800K vs. 1.1M and is currently NOT booting. So something is still messed up.arch/arm/dts/imx8qm-rom7720-a1.dts | 1 + arch/arm/dts/imx8qm-u-boot.dtsi | 136 ++++++++++++++++++ arch/arm/mach-imx/imx8/Kconfig | 1 + .../advantech/imx8qm_rom7720_a1/imximage.cfg | 16 +-- configs/imx8qm_rom7720_a1_4G_defconfig | 2 +- doc/board/advantech/imx8qm-rom7720-a1.rst | 3 +- 6 files changed, 142 insertions(+), 17 deletions(-) create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsiarch/arm/dts/imx8qm-rom7720-a1.dts +1
-0@@ -10,6 +10,7 @@ /memreserve/ 0x80000000 0x00020000; #include "fsl-imx8qm.dtsi" +#include "imx8qm-u-boot.dtsi" / { model = "Advantech iMX8QM Qseven series";arch/arm/dts/imx8qm-u-boot.dtsi new file +17
-0@@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2021 NXP + */ + +/ { + binman: binman { + multiple-images; + }; +}; + +&binman { + u-boot { + align-size = <4>; + align = <4>; + filename = "u-boot.bin"; + pad-byte = <0xff>;
arch/arm/dts/imx8qm-u-boot.dtsi line 27
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +10
-0+ + u-boot-spl { + align-end = <4>; + }; + }; + + spl { + filename = "spl.bin"; + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x100000";
this refers to the wrong container format for imx8qm!
So replacing s/imx8mimage/imx8image/ does help to get a working image.
Quoted 7 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +0
-4#define __ASSEMBLY__ -/* Boot from SD, sector size 0x400 */ -BOOT_FROM SD 0x400 -/* SoC type IMX8QM */ -SOC_TYPE IMX8QM
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 10 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +0
-10-/* Append seco container image */ -APPEND mx8qm-ahab-container.img -/* Create the 2nd container */ -CONTAINER -/* Add scfw image with exec attribute */ -IMAGE SCU mx8qm-val-scfw-tcm.bin -/* Add ATF image with exec attribute */ -IMAGE A35 bl31.bin 0x80000000 -/* Add U-Boot image with load attribute */ -DATA A35 u-boot-dtb.bin 0x80020000
I need to keep this here to.
arch/arm/dts/imx8qm-u-boot.dtsi
Quoted 2 lines
arch/arm/dts/imx8qm-u-boot.dtsi new file +2
-0+BOOT_FROM sd +LOADER u-boot-dtb.bin 0x10000
with this changes the resulting flash.bin is as big as before and its booting flawlessly.
I 'll ppst later a patch v1 for this.
Best regards,
Oliver