Re: [PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman

2024-04-25 Thread Marek Vasut

On 4/25/24 10:34 PM, Tim Harvey wrote:

On Tue, Apr 23, 2024 at 11:33 AM Marek Vasut  wrote:


Rework the flash.bin image generation such that it uses the new binman
nxp_imx8mimage etype. This way, the flash.bin is assembled in correct
order using plain binman, without any workarounds or sections assembled
in special DT node order.

Signed-off-by: Marek Vasut 
---
WARNING: This is very likely to break corner case uses, so please do
  test this on your platform.
NOTE: This also opens the implementation for proper CST signing etype,
   the CST signing would look similar to nxp-imx8mimage section, and
   it would likely wrap the whole topmost section {} in the binman
   node.


Marek,

Thanks - this is neat and I look forward to seeing a CST signing etype!


The whole collected batch of patches is here:

https://source.denx.de/u-boot/custodians/u-boot-usb/-/commits/test-cst?ref_type=heads

I believe this will need tweaking, we will probably need more DT 
properties to configure the content of the CST config file more 
precisely. But this could be a start.


Re: [PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman

2024-04-25 Thread Fabio Estevam
On Thu, Apr 25, 2024 at 5:34 PM Tim Harvey  wrote:

> Marek,
>
> Thanks - this is neat and I look forward to seeing a CST signing etype!
>
> Reviewed-By: Tim Harvey 
>
> I did test this on imx8mm_venice_defconfig and it worked great:
> Tested-By: Tim Harvey  # imx8mm_venice

I tested on imx8mm-evk and imx8mn-evk, thanks!

Tested-by: Fabio Estevam 


Re: [PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman

2024-04-25 Thread Tim Harvey
On Tue, Apr 23, 2024 at 11:33 AM Marek Vasut  wrote:
>
> Rework the flash.bin image generation such that it uses the new binman
> nxp_imx8mimage etype. This way, the flash.bin is assembled in correct
> order using plain binman, without any workarounds or sections assembled
> in special DT node order.
>
> Signed-off-by: Marek Vasut 
> ---
> WARNING: This is very likely to break corner case uses, so please do
>  test this on your platform.
> NOTE: This also opens the implementation for proper CST signing etype,
>   the CST signing would look similar to nxp-imx8mimage section, and
>   it would likely wrap the whole topmost section {} in the binman
>   node.

Marek,

Thanks - this is neat and I look forward to seeing a CST signing etype!

Reviewed-By: Tim Harvey 

I did test this on imx8mm_venice_defconfig and it worked great:
Tested-By: Tim Harvey  # imx8mm_venice

This likely paves the way for removing IMX_CONFIG

Best Regards,

Tim


[PATCH 3/3] ARM: dts: imx: Convert i.MX8M flash.bin image generation to binman

2024-04-23 Thread Marek Vasut
Rework the flash.bin image generation such that it uses the new binman
nxp_imx8mimage etype. This way, the flash.bin is assembled in correct
order using plain binman, without any workarounds or sections assembled
in special DT node order.

Signed-off-by: Marek Vasut 
---
WARNING: This is very likely to break corner case uses, so please do
 test this on your platform.
NOTE: This also opens the implementation for proper CST signing etype,
  the CST signing would look similar to nxp-imx8mimage section, and
  it would likely wrap the whole topmost section {} in the binman
  node.
---
Cc: "NXP i.MX U-Boot Team" 
Cc: Adam Ford 
Cc: Alper Nebi Yasak 
Cc: Andrejs Cainikovs 
Cc: Angus Ainslie 
Cc: Emanuele Ghidoli 
Cc: Fabio Estevam 
Cc: Francesco Dolcini 
Cc: Marcel Ziswiler 
Cc: Rasmus Villemoes 
Cc: Simon Glass 
Cc: Stefan Eichenberger 
Cc: Stefano Babic 
Cc: Tim Harvey 
Cc: Tom Rini 
Cc: ker...@puri.sm
Cc: u-b...@dh-electronics.com
Cc: u-boot@lists.denx.de
---
 arch/arm/dts/imx8mm-u-boot.dtsi   | 126 ++-
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi|   8 +-
 arch/arm/dts/imx8mn-u-boot.dtsi   | 147 +++---
 arch/arm/dts/imx8mp-dhcom-u-boot.dtsi |   2 +-
 arch/arm/dts/imx8mp-rsb3720-a1-u-boot.dtsi|   2 +-
 arch/arm/dts/imx8mp-u-boot.dtsi   |  96 +---
 arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi|  15 +-
 arch/arm/dts/imx8mq-u-boot.dtsi   | 109 +
 8 files changed, 203 insertions(+), 302 deletions(-)

diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
index 06f2f73a03f..6ab8f66256e 100644
--- a/arch/arm/dts/imx8mm-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-u-boot.dtsi
@@ -5,7 +5,6 @@
 
 / {
binman: binman {
-   multiple-images;
};
 
 #ifdef CONFIG_OPTEE
@@ -43,56 +42,61 @@
 };
 
  {
-   u-boot-spl-ddr {
-   align = <4>;
-   align-size = <4>;
-   filename = "u-boot-spl-ddr.bin";
-   pad-byte = <0xff>;
-
-   u-boot-spl {
-   align-end = <4>;
-   filename = "u-boot-spl.bin";
-   };
+   filename = "flash.bin";
+   section {
+   pad-byte = <0x00>;
 
-   ddr-1d-imem-fw {
-   filename = "lpddr4_pmu_train_1d_imem.bin";
-   align-end = <4>;
+#ifdef CONFIG_FSPI_CONF_HEADER
+   fspi_conf_block {
+   filename = CONFIG_FSPI_CONF_FILE;
type = "blob-ext";
+   size = <0x1000>;
};
+#endif
 
-   ddr-1d-dmem-fw {
-   filename = "lpddr4_pmu_train_1d_dmem.bin";
-   align-end = <4>;
-   type = "blob-ext";
-   };
+   nxp-imx8mimage {
+   filename = "u-boot-spl-mkimage.bin";
+   nxp,boot-from = "sd";
+   nxp,rom-version = <1>;
+   nxp,loader-address = ;
+   args;   /* Needed by mkimage etype superclass */
 
-   ddr-2d-imem-fw {
-   filename = "lpddr4_pmu_train_2d_imem.bin";
-   align-end = <4>;
-   type = "blob-ext";
-   };
+   section {
+   align = <4>;
+   align-size = <4>;
+   filename = "u-boot-spl-ddr.bin";
+   pad-byte = <0xff>;
 
-   ddr-2d-dmem-fw {
-   filename = "lpddr4_pmu_train_2d_dmem.bin";
-   align-end = <4>;
-   type = "blob-ext";
-   };
-   };
+   u-boot-spl {
+   align-end = <4>;
+   filename = "u-boot-spl.bin";
+   };
 
-   spl {
-   filename = "spl.bin";
+   ddr-1d-imem-fw {
+   filename = 
"lpddr4_pmu_train_1d_imem.bin";
+   align-end = <4>;
+   type = "blob-ext";
+   };
 
-   mkimage {
-   args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 
0x7e1000";
+   ddr-1d-dmem-fw {
+   filename = 
"lpddr4_pmu_train_1d_dmem.bin";
+   align-end = <4>;
+   type = "blob-ext";
+   };
 
-   blob {
-   filename = "u-boot-spl-ddr.bin";
+   ddr-2d-imem-fw {
+   filename =