All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] imx8mm_evk: switch to use binman to pack images
@ 2021-04-06  3:58 Peng Fan
  2021-04-06  3:58 ` [PATCH 2/7] doc: imx8mm_evk: update doc after using binman Peng Fan
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:58 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mm-evk-u-boot.dtsi           | 106 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   1 +
 .../imx8mm_evk/imximage-8mm-lpddr4.cfg        |   9 ++
 configs/imx8mm_evk_defconfig                  |   4 +-
 4 files changed, 118 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg

diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 6d204526af..495bef3d38 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -4,6 +4,10 @@
  */
 
 / {
+	binman: binman {
+		multiple-images;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -144,3 +148,105 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
+
+&binman {
+	 u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+
+		blob_1: blob-ext at 1 {
+			filename = "lpddr4_pmu_train_1d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext at 2 {
+			filename = "lpddr4_pmu_train_1d_dmem.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext at 3 {
+			filename = "lpddr4_pmu_train_2d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext at 4 {
+			filename = "lpddr4_pmu_train_2d_dmem.bin";
+			size = <0x4000>;
+		};
+	};
+
+
+       flash {
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x7e1000";
+
+			blob {
+				filename = "u-boot-spl-ddr.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 = <0x920000>;
+					entry = <0x920000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index e7e1315bac..d9a99e9ccb 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -40,6 +40,7 @@ config TARGET_IMX8MQ_PHANBELL
 
 config TARGET_IMX8MM_EVK
 	bool "imx8mm LPDDR4 EVK board"
+	select BINMAN
 	select IMX8MM
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
diff --git a/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg b/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg
new file mode 100644
index 0000000000..b89092a559
--- /dev/null
+++ b/board/freescale/imx8mm_evk/imximage-8mm-lpddr4.cfg
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+BOOT_FROM	sd
+LOADER		mkimage.flash.mkimage	0x7E1000
diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
index ae9e0626dd..883994c1a3 100644
--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -21,9 +21,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx8mm-evk"
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 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_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mm-lpddr4.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8mm-evk/imximage-8mm-lpddr4.cfg"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SEPARATE_BSS=y
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] doc: imx8mm_evk: update doc after using binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
@ 2021-04-06  3:58 ` Peng Fan
  2021-04-06  3:58 ` [PATCH 3/7] imx8mn-ddr4-evk: switch to use binman Peng Fan
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:58 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Update doc after switch to binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 doc/board/freescale/imx8mm_evk.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/board/freescale/imx8mm_evk.rst b/doc/board/freescale/imx8mm_evk.rst
index a9ccdb7850..7fd3d72564 100644
--- a/doc/board/freescale/imx8mm_evk.rst
+++ b/doc/board/freescale/imx8mm_evk.rst
@@ -43,13 +43,14 @@ Build U-Boot
    $ export CROSS_COMPILE=aarch64-poky-linux-
    $ make imx8mm_evk_defconfig
    $ export ATF_LOAD_ADDR=0x920000
-   $ make flash.bin
+   $ make
 
 Burn the flash.bin to MicroSD card offset 33KB:
 
 .. code-block:: bash
 
    $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=notrunc
+   $sudo dd if=u-boot.itb of=/dev/sdc bs=1024 seek=384 conv=sync
 
 Boot
 ----
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] imx8mn-ddr4-evk: switch to use binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
  2021-04-06  3:58 ` [PATCH 2/7] doc: imx8mm_evk: update doc after using binman Peng Fan
@ 2021-04-06  3:58 ` Peng Fan
  2021-04-06  3:59 ` [PATCH 4/7] imx8mn-evk: " Peng Fan
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:58 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi      | 106 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   1 +
 .../imx8mn_evk/imximage-8mn-ddr4.cfg          |  10 ++
 configs/imx8mn_ddr4_evk_defconfig             |   4 +-
 4 files changed, 119 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg

diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
index a0fd2a3098..1d3844437d 100644
--- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
@@ -4,6 +4,10 @@
  */
 
 / {
+	binman: binman {
+		multiple-images;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -119,3 +123,105 @@
 &wdog1 {
 	u-boot,dm-spl;
 };
+
+&binman {
+	 u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+
+		blob_1: blob-ext at 1 {
+			filename = "ddr4_imem_1d_201810.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext at 2 {
+			filename = "ddr4_dmem_1d_201810.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext at 3 {
+			filename = "ddr4_imem_2d_201810.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext at 4 {
+			filename = "ddr4_dmem_2d_201810.bin";
+			size = <0x4000>;
+		};
+	};
+
+
+	flash {
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
+
+			blob {
+				filename = "u-boot-spl-ddr.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 = <0x960000>;
+					entry = <0x960000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index d9a99e9ccb..be697bddfa 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -59,6 +59,7 @@ config TARGET_IMX8MN_EVK
 
 config TARGET_IMX8MN_DDR4_EVK
 	bool "imx8mn DDR4 EVK board"
+	select BINMAN
 	select IMX8MN
 	select SUPPORT_SPL
 	select IMX8M_DDR4
diff --git a/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
new file mode 100644
index 0000000000..22aec26da7
--- /dev/null
+++ b/board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		mkimage.flash.mkimage	0x912000
diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig
index f7ea65886d..7f020c9a7a 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -22,9 +22,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx8mn-ddr4-evk"
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 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_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mn-ddr4.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg"
 CONFIG_DEFAULT_FDT_FILE="imx8mn-ddr4-evk.dtb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] imx8mn-evk: switch to use binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
  2021-04-06  3:58 ` [PATCH 2/7] doc: imx8mm_evk: update doc after using binman Peng Fan
  2021-04-06  3:58 ` [PATCH 3/7] imx8mn-ddr4-evk: switch to use binman Peng Fan
@ 2021-04-06  3:59 ` Peng Fan
  2021-04-06  3:59 ` [PATCH 5/7] doc: imx8mn_evk: update doc after using binman Peng Fan
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:59 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Use binman to pack images.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mn-evk-u-boot.dtsi | 102 ++++++++++++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig     |   1 +
 configs/imx8mn_evk_defconfig        |   4 +-
 3 files changed, 105 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/imx8mn-evk-u-boot.dtsi b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
index 2730ff6a81..3db46d4cbc 100644
--- a/arch/arm/dts/imx8mn-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mn-evk-u-boot.dtsi
@@ -24,3 +24,105 @@
 &pinctrl_pmic {
 	u-boot,dm-spl;
 };
+
+&binman {
+	 u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+
+		blob_1: blob-ext at 1 {
+			filename = "lpddr4_pmu_train_1d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext at 2 {
+			filename = "lpddr4_pmu_train_1d_dmem.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext at 3 {
+			filename = "lpddr4_pmu_train_2d_imem.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext at 4 {
+			filename = "lpddr4_pmu_train_2d_dmem.bin";
+			size = <0x4000>;
+		};
+	};
+
+
+	flash {
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x912000";
+
+			blob {
+				filename = "u-boot-spl-ddr.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 = <0x960000>;
+					entry = <0x960000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index be697bddfa..390ead9444 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -53,6 +53,7 @@ config TARGET_IMX8MM_VENICE
 
 config TARGET_IMX8MN_EVK
 	bool "imx8mn LPDDR4 EVK board"
+	select BINMAN
 	select IMX8MN
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
index c53dc968c8..d0e5b58902 100644
--- a/configs/imx8mn_evk_defconfig
+++ b/configs/imx8mn_evk_defconfig
@@ -25,9 +25,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx8mn-evk"
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 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_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mn-lpddr4.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8mn_evk/imximage-8mn-ddr4.cfg"
 CONFIG_DEFAULT_FDT_FILE="imx8mn-evk.dtb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_BOARD_INIT=y
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] doc: imx8mn_evk: update doc after using binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
                   ` (2 preceding siblings ...)
  2021-04-06  3:59 ` [PATCH 4/7] imx8mn-evk: " Peng Fan
@ 2021-04-06  3:59 ` Peng Fan
  2021-04-06  3:59 ` [PATCH 6/7] imx8mp-evk: switch to use binman Peng Fan
  2021-04-06  3:59 ` [PATCH 7/7] doc: imx8mp-evk: update after using binman Peng Fan
  5 siblings, 0 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:59 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 doc/board/freescale/imx8mn_evk.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/board/freescale/imx8mn_evk.rst b/doc/board/freescale/imx8mn_evk.rst
index 375e0bb761..9fbb947032 100644
--- a/doc/board/freescale/imx8mn_evk.rst
+++ b/doc/board/freescale/imx8mn_evk.rst
@@ -43,13 +43,14 @@ Build U-Boot
    $ export CROSS_COMPILE=aarch64-poky-linux-
    $ make imx8mn_ddr4_evk_defconfig
    $ export ATF_LOAD_ADDR=0x960000
-   $ make flash.bin
+   $ make
 
 Burn the flash.bin to MicroSD card offset 32KB:
 
 .. code-block:: bash
 
    $sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32 conv=notrunc
+   $sudo dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=notrunc
 
 Boot
 ----
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] imx8mp-evk: switch to use binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
                   ` (3 preceding siblings ...)
  2021-04-06  3:59 ` [PATCH 5/7] doc: imx8mn_evk: update doc after using binman Peng Fan
@ 2021-04-06  3:59 ` Peng Fan
  2021-04-06  3:59 ` [PATCH 7/7] doc: imx8mp-evk: update after using binman Peng Fan
  5 siblings, 0 replies; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:59 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

Use binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/dts/imx8mp-evk-u-boot.dtsi           | 106 ++++++++++++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |   1 +
 .../imx8mp_evk/imximage-8mp-lpddr4.cfg        |  10 ++
 configs/imx8mp_evk_defconfig                  |   4 +-
 4 files changed, 119 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg

diff --git a/arch/arm/dts/imx8mp-evk-u-boot.dtsi b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
index 27075c5217..4162f41cff 100644
--- a/arch/arm/dts/imx8mp-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-evk-u-boot.dtsi
@@ -4,6 +4,10 @@
  */
 
 / {
+	binman: binman {
+		multiple-images;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		wdt = <&wdog1>;
@@ -151,3 +155,105 @@
 	phy-reset-duration = <15>;
 	phy-reset-post-delay = <100>;
 };
+
+&binman {
+	 u-boot-spl-ddr {
+		filename = "u-boot-spl-ddr.bin";
+		pad-byte = <0xff>;
+		align-size = <4>;
+		align = <4>;
+
+		u-boot-spl {
+			align-end = <4>;
+		};
+
+		blob_1: blob-ext at 1 {
+			filename = "lpddr4_pmu_train_1d_imem_202006.bin";
+			size = <0x8000>;
+		};
+
+		blob_2: blob-ext at 2 {
+			filename = "lpddr4_pmu_train_1d_dmem_202006.bin";
+			size = <0x4000>;
+		};
+
+		blob_3: blob-ext at 3 {
+			filename = "lpddr4_pmu_train_2d_imem_202006.bin";
+			size = <0x8000>;
+		};
+
+		blob_4: blob-ext at 4 {
+			filename = "lpddr4_pmu_train_2d_dmem_202006.bin";
+			size = <0x4000>;
+		};
+	};
+
+
+       flash {
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8mimage -e 0x920000";
+
+			blob {
+				filename = "u-boot-spl-ddr.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 = <0x970000>;
+					entry = <0x970000>;
+
+					atf_blob: blob-ext {
+						filename = "bl31.bin";
+					};
+				};
+
+				fdt {
+					description = "NAME";
+					type = "flat_dt";
+					compression = "none";
+
+					uboot_fdt_blob: blob-ext {
+						filename = "u-boot.dtb";
+					};
+				};
+			};
+
+			configurations {
+				default = "conf";
+
+				conf {
+					description = "NAME";
+					firmware = "uboot";
+					loadables = "atf";
+					fdt = "fdt";
+				};
+			};
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index 390ead9444..c27fb248d1 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -67,6 +67,7 @@ config TARGET_IMX8MN_DDR4_EVK
 
 config TARGET_IMX8MP_EVK
 	bool "imx8mp LPDDR4 EVK board"
+	select BINMAN
 	select IMX8MP
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
diff --git a/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg b/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg
new file mode 100644
index 0000000000..b2920b4908
--- /dev/null
+++ b/board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		mkimage.flash.mkimage	0x920000
diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig
index 47a52eedb9..089ec26b3c 100644
--- a/configs/imx8mp_evk_defconfig
+++ b/configs/imx8mp_evk_defconfig
@@ -22,9 +22,9 @@ CONFIG_DEFAULT_DEVICE_TREE="imx8mp-evk"
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 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_OF_SYSTEM_SETUP=y
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/imx8m/imximage-8mp-lpddr4.cfg"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg"
 CONFIG_DEFAULT_FDT_FILE="imx8mp-evk.dtb"
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_BOARD_LATE_INIT=y
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] doc: imx8mp-evk: update after using binman
  2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
                   ` (4 preceding siblings ...)
  2021-04-06  3:59 ` [PATCH 6/7] imx8mp-evk: switch to use binman Peng Fan
@ 2021-04-06  3:59 ` Peng Fan
  2021-04-06  6:58   ` Peter Bergin
  5 siblings, 1 reply; 9+ messages in thread
From: Peng Fan @ 2021-04-06  3:59 UTC (permalink / raw)
  To: u-boot

From: Peng Fan <peng.fan@nxp.com>

update doc after using binman to pack images

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 doc/board/freescale/imx8mp_evk.rst | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/board/freescale/imx8mp_evk.rst b/doc/board/freescale/imx8mp_evk.rst
index 796a7611d0..609a29f3eb 100644
--- a/doc/board/freescale/imx8mp_evk.rst
+++ b/doc/board/freescale/imx8mp_evk.rst
@@ -40,18 +40,19 @@ Build U-Boot
    $ export CROSS_COMPILE=aarch64-poky-linux-
    $ make O=build imx8mp_evk_defconfig
    $ cp ../imx-atf/build/imx8mp/release/bl31.bin ./build/bl31.bin
-   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin ./build/lpddr4_pmu_train_1d_dmem.bin
-   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin ./build/lpddr4_pmu_train_1d_imem.bin
-   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin ./build/lpddr4_pmu_train_2d_dmem.bin
-   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin ./build/lpddr4_pmu_train_2d_imem.bin
+   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin ./build/
+   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin ./build/
+   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin ./build/
+   $ cp ../firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin ./build/
    $ export ATF_LOAD_ADDR=0x970000
-   $ make O=build flash.bin
+   $ make O=build
 
 Burn the flash.bin to the MicroSD card at offset 32KB:
 
 .. code-block:: bash
 
    $sudo dd if=build/flash.bin of=/dev/sd[x] bs=1K seek=32 conv=notrunc; sync
+   $sudo dd if=build/u-boot.itb of=/dev/sd[x] bs=1K seek=384 conv=notrunc; sync
 
 Boot
 ----
-- 
2.30.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] doc: imx8mp-evk: update after using binman
  2021-04-06  3:59 ` [PATCH 7/7] doc: imx8mp-evk: update after using binman Peng Fan
@ 2021-04-06  6:58   ` Peter Bergin
  2021-04-28 17:06     ` ZHIZHIKIN Andrey
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Bergin @ 2021-04-06  6:58 UTC (permalink / raw)
  To: u-boot

Hi,

On 2021-04-06 05:59, Peng Fan (OSS) wrote:
>   Burn the flash.bin to the MicroSD card at offset 32KB:
>   
>   .. code-block:: bash
>   
>      $sudo dd if=build/flash.bin of=/dev/sd[x] bs=1K seek=32 conv=notrunc; sync
> +   $sudo dd if=build/u-boot.itb of=/dev/sd[x] bs=1K seek=384 conv=notrunc; sync

Why is this changed to 'seek=384'? Comment still states 'offset 32KB' 
and reference manual states that Primary Image Offset for SD card shall 
be 32KB. Can you explain a bit more around this?

Thanks,
/Peter

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 7/7] doc: imx8mp-evk: update after using binman
  2021-04-06  6:58   ` Peter Bergin
@ 2021-04-28 17:06     ` ZHIZHIKIN Andrey
  0 siblings, 0 replies; 9+ messages in thread
From: ZHIZHIKIN Andrey @ 2021-04-28 17:06 UTC (permalink / raw)
  To: u-boot


> -----Original Message-----
> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Peter Bergin
> Sent: Tuesday, April 6, 2021 8:59 AM
> To: u-boot at lists.denx.de
> Subject: Re: [PATCH 7/7] doc: imx8mp-evk: update after using binman
>  
> 
> Hi,
> 
> On 2021-04-06 05:59, Peng Fan (OSS) wrote:
> >   Burn the flash.bin to the MicroSD card at offset 32KB:
> >
> >   .. code-block:: bash
> >
> >      $sudo dd if=build/flash.bin of=/dev/sd[x] bs=1K seek=32
> > conv=notrunc; sync
> > +   $sudo dd if=build/u-boot.itb of=/dev/sd[x] bs=1K seek=384
> > + conv=notrunc; sync
> 
> Why is this changed to 'seek=384'? Comment still states 'offset 32KB'
> and reference manual states that Primary Image Offset for SD card shall be 32KB.
> Can you explain a bit more around this?

I'd also be interested in a more detailed explanation of this change, since the documentation is not quite descriptive about this added step.

How the magic new offset is handled and why is it chosen to be 384?

I see this change was made *exactly in the same way* across Mini, Nano and Plus SOCs of i.MX8M family, hence I believe it does deserve a good description.

> 
> Thanks,
> /Peter

Thanks a lot!

-- andrey

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-28 17:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06  3:58 [PATCH 1/7] imx8mm_evk: switch to use binman to pack images Peng Fan
2021-04-06  3:58 ` [PATCH 2/7] doc: imx8mm_evk: update doc after using binman Peng Fan
2021-04-06  3:58 ` [PATCH 3/7] imx8mn-ddr4-evk: switch to use binman Peng Fan
2021-04-06  3:59 ` [PATCH 4/7] imx8mn-evk: " Peng Fan
2021-04-06  3:59 ` [PATCH 5/7] doc: imx8mn_evk: update doc after using binman Peng Fan
2021-04-06  3:59 ` [PATCH 6/7] imx8mp-evk: switch to use binman Peng Fan
2021-04-06  3:59 ` [PATCH 7/7] doc: imx8mp-evk: update after using binman Peng Fan
2021-04-06  6:58   ` Peter Bergin
2021-04-28 17:06     ` ZHIZHIKIN Andrey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.