imx8mm-evk: Generate a bootable flash.bin again
Subsystems (2)
RFC 1/1 imx8mm-evk: Generate a bootable flash.bin again
After the convesion to binman in commit 8996e6b7c6a1 ("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.
Such new requirement breaks existing distro mechanisms to generate the final image because the extra u-boot.itb is now required.
Generate a final flash.bin image that can be used again as a single bootable image to keep the original behavior.
--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm/dts/imx8mm-evk-u-boot.dtsi +15 -0
@@ -217,4 +217,19 @@ }; }; }; + + imx-boot { + filename = "flash.bin"; + pad-byte = <0x00>; + + spl: blob-ext@1 { + offset = <0x0>; + filename = "flash.bin"; + }; + + uboot: blob-ext@2 { + offset = <0x57c00>; + filename = "u-boot.itb"; + }; + }; };
Signature · 1 line
2.25.1
Hello Fabio,
Quoted 22 lines · Fabio Estevam
After the convesion to binman in commit
8996e6b7c6a1("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.Such new requirement breaks existing distro mechanisms to generate the final image because the extra u-boot.itb is now required.
Generate a final flash.bin image that can be used again as a single bootable image to keep the original behavior.
Suggested-by Heiko Schocher <[email protected]>Signed-off-by Fabio Estevam <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/dts/imx8mm-evk-u-boot.dtsi +0
-0
arch/arm/dts/imx8mm-evk-u-boot.dtsi line 222
Quoted 6 lines
arch/arm/dts/imx8mm-evk-u-boot.dtsi +3
-0@@ -217,4 +217,19 @@ }; }; }; + + imx-boot { + filename = "flash.bin";
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Why not imx-boot as image name as in NXP sources? (Thats why I named it so in my "fast example approach")
Quoted 4 lines
arch/arm/dts/imx8mm-evk-u-boot.dtsi +3
-0+ pad-byte = <0x00>; + + spl: blob-ext@1 {
arch/arm/dts/imx8mm-evk-u-boot.dtsi line 235
Quoted 10 lines
arch/arm/dts/imx8mm-evk-u-boot.dtsi +9
-0+ offset = <0x0>; + filename = "flash.bin"; + }; + + uboot: blob-ext@2 { + offset = <0x57c00>; + filename = "u-boot.itb"; + }; + }; };
regarding the question, if we can make a generic file .. for example on the imx8mp-phyboard-pollux-rdk u-boot is at offset 0x60000 in QSPI NOR ( for QSPI boot of course)
So, there should be something like this:
+ imx-boot {
+ filename = "imx-boot";
+ pad-byte = <0x00>;
+
+ qspiheader: blob-ext@2 {
+ offset = <0x400>;
+ filename = "qspiheader.bin";
+ };
+
+ spl: blob-ext@2 {
+ offset = <0x1000>;
+ filename = "flash.bin";
+ };
+
+ uboot: blob-ext@3 {
+ offset = <0x60000>;
+ filename = "u-boot.itb";
+ };
+ };
On sd card boot it is without qspiheader and offsets -0x1000, so may we make a imx-boot and imx-boot-qspi ?
+ imx-boot {
+ filename = "imx-boot";
+ pad-byte = <0x00>;
+
+ spl: blob-ext@1 {
+ offset = <0x0>;
+ filename = "flash.bin";
+ };
+
+ uboot: blob-ext@2 {
+ offset = <0x59000>;
+ filename = "u-boot.itb";
+ };
+ };
+ imx-boot-qspi {
+ filename = "imx-boot-qspi";
+ pad-byte = <0x00>;
+
+ qspiheader: blob-ext@2 {
+ offset = <0x400>;
+ filename = "qspiheader.bin";
+ };
+
+ imx-boot: blob-ext@2 {
+ offset = <0x1000>;
+ filename = "imx-boot";
+ };
+ };
And of course we must add a possibility to create qspi header. I have here local some python script, but not sure how to integrate this to binman.
And it would be very cool, to sign the image with binman!
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Hi,
Am Di., 17. Aug. 2021 um 05:56 Uhr schrieb Heiko Schocher <[email protected]>:
Quoted 37 lines
Hello Fabio,
Quoted 22 lines · Fabio Estevam
After the convesion to binman in commit
8996e6b7c6a1("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.Such new requirement breaks existing distro mechanisms to generate the final image because the extra u-boot.itb is now required.
Generate a final flash.bin image that can be used again as a single bootable image to keep the original behavior.
Suggested-by Heiko Schocher <[email protected]>Signed-off-by Fabio Estevam <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/dts/imx8mm-evk-u-boot.dtsi +0
-0arch/arm/dts/imx8mm-evk-u-boot.dtsi line 222
Quoted 6 lines
arch/arm/dts/imx8mm-evk-u-boot.dtsi +3
-0@@ -217,4 +217,19 @@ }; }; }; + + imx-boot { + filename = "flash.bin";I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Quoted 2 lines
Why not imx-boot as image name as in NXP sources? (Thats why I named it so in my "fast example approach")
Is it right that in that case a new u-boot makefile target has to be set? Currently flash.bin works because it is already set in "arch/arm/mach-imx/Makefile"?
Signature · 1 line
Heiko
Hello Heiko,
Quoted 40 lines · Heiko Thiery
Hi,
Am Di., 17. Aug. 2021 um 05:56 Uhr schrieb Heiko Schocher <[email protected]>:
Quoted 37 lines
Hello Fabio,
Quoted 22 lines · Fabio Estevam
After the convesion to binman in commit
8996e6b7c6a1("imx8mm_evk: switch to use binman to pack images"), it is necessary to flash both flash.bin and u-boot.itb to get a bootable system. Prior to this commit, only flash.bin was needed.Such new requirement breaks existing distro mechanisms to generate the final image because the extra u-boot.itb is now required.
Generate a final flash.bin image that can be used again as a single bootable image to keep the original behavior.
Suggested-by Heiko Schocher <[email protected]>Signed-off-by Fabio Estevam <[email protected]>--- arch/arm/dts/imx8mm-evk-u-boot.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)arch/arm/dts/imx8mm-evk-u-boot.dtsi +0
-0arch/arm/dts/imx8mm-evk-u-boot.dtsi line 222
Quoted 6 lines
arch/arm/dts/imx8mm-evk-u-boot.dtsi +3
-0@@ -217,4 +217,19 @@ }; }; }; + + imx-boot { + filename = "flash.bin";I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Quoted 6 lines
Quoted 2 lines
Why not imx-boot as image name as in NXP sources? (Thats why I named it so in my "fast example approach")
Is it right that in that case a new u-boot makefile target has to be set? Currently flash.bin works because it is already set in "
arch/arm/mach-imx/Makefile"?
No, I think not, that is binman magic ... binman creates the targets which are defined in your DTS in the binman node, see:
u-boot:/tools/binman/README.rst
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Fabio Estevam
reviewerHi Heiko,
Quoted 3 lines · Heiko Schocher
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
I thought about that too. Frieder suggested I use a different name for the SPL file, such as spl.bin.
I am concerned that renaming flash.bin to spl.bin may break i.MX8MM targets that do not use binman, such as the verdin-imx8mm board.
Quoted 1 line
Why not imx-boot as image name as in NXP sources?
NXP U-Boot also generates the final binary called "flash.bin"
My main motivation for sending this RFC patch is to avoid imx8mm-evk breakage when people upgrade
to U-Boor 2021.07.
Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.
Thanks
Hello Fabio,
Quoted 8 lines · Fabio Estevam
Hi Heiko,
Quoted 3 lines · Heiko Schocher
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Quoted 5 lines
I thought about that too. Frieder suggested I use a different name for the SPL file, such as spl.bin.
I am concerned that renaming flash.bin to spl.bin may break i.MX8MM targets that do not use binman, such as the verdin-imx8mm board.
Hmm... okay, but I do not understand why spl code is named flash.bin than?
spl.bin seems better to me.
Quoted 3 lines
Quoted 1 line
Why not imx-boot as image name as in NXP sources?
NXP U-Boot also generates the final binary called "flash.bin"
What do you mean with "final binary"? The binary which contains SPL and u-boot (and all other needed binaries)?
If so, is this really called flash.bin? So *same* name as "SPL only" code? I could not believe this...
NXP code does this not for all imx8 derivates, see comment:
But yes, the container is named "flash.bin"...
Quoted 3 lines
My main motivation for sending this RFC patch is to avoid imx8mm-evk breakage when people upgrade
to U-Boor 2021.07.
U-Boot 2021.07 is broken? Or do you mean 2021.10?
Ah, *now* I got it commit "8996e6b7c6a1" introduced a SPL based "flash.bin" through arch/arm/dts/imx8mm-evk-u-boot.dtsi:
+ flash {
+ mkimage {
+ args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+
+ blob {
+ filename = "u-boot-spl-ddr.bin";
+ };
+ };
+ };
-> now we have a "flash.bin" with SPL only code and a "flash.bin" Makefile target which produces "flash.bin" which is a container of SPL, U-Boot, dtb, atf, ... and may much more binaries...
:-(
Added Peng to cc, as he did this conversion for imx8mm-evk-u-boot.dtsi
Quoted 3 lines
Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.
I vote for renaming flash.bin (in SPL case) to spl.bin. It seems to me there are many imx8*-u-boot.dtsi file now which use this part:
+ flash {
+ mkimage {
+ args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+
+ blob {
+ filename = "u-boot-spl-ddr.bin";
+ };
+ };
+ };
But may this rename is no problem, as all boards use the "flash.bin" container?
I don;t know...
bye,
Heiko
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-52 Fax: +49-8142-66989-80 Email: [email protected]
Quoted 61 lines · Heiko Schocher
Hello Fabio,
Quoted 8 lines · Fabio Estevam
Hi Heiko,
Quoted 3 lines · Heiko Schocher
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Quoted 5 lines
I thought about that too. Frieder suggested I use a different name for the SPL file, such as spl.bin.
I am concerned that renaming flash.bin to spl.bin may break i.MX8MM targets that do not use binman, such as the verdin-imx8mm board.
Hmm... okay, but I do not understand why spl code is named flash.bin than?
spl.bin seems better to me.
Quoted 3 lines
Quoted 1 line
Why not imx-boot as image name as in NXP sources?
NXP U-Boot also generates the final binary called "flash.bin"
What do you mean with "final binary"? The binary which contains SPL and u-boot (and all other needed binaries)?
If so, is this really called flash.bin? So *same* name as "SPL only" code? I could not believe this...
NXP code does this not for all imx8 derivates, see comment:
But yes, the container is named "flash.bin"...
Quoted 3 lines
My main motivation for sending this RFC patch is to avoid imx8mm-evk breakage when people upgrade
to U-Boor 2021.07.U-Boot 2021.07 is broken? Or do you mean 2021.10?
Ah, *now* I got it commit "
8996e6b7c6a1" introduced a SPL based "flash.bin" througharch/arm/dts/imx8mm-evk-u-boot.dtsi:(quoted diff) +9
-1+ flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + }; -> now we have a "flash.bin" with SPL only code and a "flash.bin"
Makefiletarget which produces "flash.bin" which is a container of SPL, U-Boot, dtb, atf, ... and may much more binaries...
Quoted 1 line
:-(
Exactly, that's the main problem.
Quoted 9 lines
Added Peng to cc, as he did this conversion for
imx8mm-evk-u-boot.dtsiQuoted 3 lines
Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.I vote for renaming flash.bin (in SPL case) to spl.bin. It seems to me there are many imx8*-u-boot.dtsi file now which use this part:
Yes, I think we should introduce a common dtsi file with a binman configuration that uses spl.bin for the SPL image and flash.bin for the final image. Then we could switch all boards to use this config step by step afterwards.
Quoted 18 lines
(quoted diff) +9
-0+ flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + };But may this rename is no problem, as all boards use the "flash.bin" container?
I don;t know...
bye,
Heiko
Quoted 70 lines · Frieder Schrempf
Quoted 61 lines · Heiko Schocher
Hello Fabio,
Quoted 8 lines · Fabio Estevam
Hi Heiko,
Quoted 3 lines · Heiko Schocher
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
Quoted 5 lines
I thought about that too. Frieder suggested I use a different name for the SPL file, such as spl.bin.
I am concerned that renaming flash.bin to spl.bin may break i.MX8MM targets that do not use binman, such as the verdin-imx8mm board.
Hmm... okay, but I do not understand why spl code is named flash.bin than?
spl.bin seems better to me.
Quoted 3 lines
Quoted 1 line
Why not imx-boot as image name as in NXP sources?
NXP U-Boot also generates the final binary called "flash.bin"
What do you mean with "final binary"? The binary which contains SPL and u-boot (and all other needed binaries)?
If so, is this really called flash.bin? So *same* name as "SPL only" code? I could not believe this...
NXP code does this not for all imx8 derivates, see comment:
But yes, the container is named "flash.bin"...
Quoted 3 lines
My main motivation for sending this RFC patch is to avoid imx8mm-evk breakage when people upgrade
to U-Boor 2021.07.U-Boot 2021.07 is broken? Or do you mean 2021.10?
Ah, *now* I got it commit "
8996e6b7c6a1" introduced a SPL based "flash.bin" througharch/arm/dts/imx8mm-evk-u-boot.dtsi:(quoted diff) +9
-1+ flash { + mkimage { + args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000"; + + blob { + filename = "u-boot-spl-ddr.bin"; + }; + }; + }; -> now we have a "flash.bin" with SPL only code and a "flash.bin"
Makefiletarget which produces "flash.bin" which is a container of SPL, U-Boot, dtb, atf, ... and may much more binaries...Quoted 1 line
:-(
Exactly, that's the main problem.
Quoted 3 lines
Added Peng to cc, as he did this conversion for
imx8mm-evk-u-boot.dtsi
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.I vote for renaming flash.bin (in SPL case) to spl.bin. It seems to me there are many imx8*-u-boot.dtsi file now which use this part:
Yes, I think we should introduce a common dtsi file with a binman configuration that uses spl.bin for the SPL image and flash.bin for the final image. Then we could switch all boards to use this config step by step afterwards.
Actually this would require changing the SPL image name for all boards, or if that's possible with binman, rename the flash.bin SPL image to spl.bin, before building the final image.
Quoted 8 lines · Frieder Schrempf
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.I vote for renaming flash.bin (in SPL case) to spl.bin. It seems to me there are many imx8*-u-boot.dtsi file now which use this part:
Quoted 6 lines
Quoted 3 lines
Yes, I think we should introduce a common dtsi file with a binman configuration that uses spl.bin for the SPL image and flash.bin for the final image. Then we could switch all boards to use this config step by step afterwards.
Actually this would require changing the SPL image name for all boards, or if that's possible with binman, rename the flash.bin SPL image to spl.bin, before building the final image.
I agree with this probably being the best way forward.
Hi Fabio,
Quoted 18 lines · Fabio Estevam
Hi Heiko,
Quoted 3 lines · Heiko Schocher
I am unsure here, if it makes sense to overwrite flash.bin with the binary which contains SPL and u-boot.itb. May others want to use them (as I currently use them for signing them)
I thought about that too. Frieder suggested I use a different name for the SPL file, such as spl.bin.
I am concerned that renaming flash.bin to spl.bin may break i.MX8MM targets that do not use binman, such as the verdin-imx8mm board.
Quoted 1 line
Why not imx-boot as image name as in NXP sources?
NXP U-Boot also generates the final binary called "flash.bin"
Quoted 7 lines
My main motivation for sending this RFC patch is to avoid imx8mm-evk breakage when people upgrade
to U-Boor 2021.07.Prior to 2021.07: only flash.bin was required. Yocto recipe, for example, will no longer produce a bootable image
after the upgrade to 2021.07. This is the breakage I would like to avoid.
On the other hand, for example I have already adapted my (downstream) Yocto environment to the binman setup in 2021.07 and changing it back to the original behavior in the next release will break my Yocto recipes again. The breaking change is already in the release, so the harm is already done. Should we really spend effort to revert to the old scheme or rather switch to proper and meaningful names for the images now that we already broke it. But I see your point that this probably would require to move all boards to binman first before doing so.
And as Heiko already said, overwriting the SPL image with the final image is not really an option in my opinion. We might need the SPL image for other purposes and we should definitely make sure that it's still around after the final image has been built.
Best regards
Frieder