public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Oliver Graute <oliver.graute@kococonnector.com>
To: sbabic@denx.de
Cc: oliver.graute@kococonnector.com, oliver.graute@gmail.com,
	festevam@gmail.com, peng.fan@nxp.com, uboot-imx@nxp.com,
	"Gaurav Jain" <gaurav.jain@nxp.com>, "Ye Li" <ye.li@nxp.com>,
	"Marcel Ziswiler" <marcel.ziswiler@toradex.com>,
	"Denys Drozdov" <denys.drozdov@toradex.com>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	u-boot@lists.denx.de
Subject: [PATCH v5] imx: imx8qm-rom7720: switch to binman
Date: Wed,  2 Nov 2022 16:56:48 +0100	[thread overview]
Message-ID: <20221102155655.5296-2-oliver.graute@kococonnector.com> (raw)
In-Reply-To: <20221102155655.5296-1-oliver.graute@kococonnector.com>

Switch to use binman to pack images

Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com>
---
Changes for v5:
 - renamed ftd to @fdt-SEQ

Changes for v4
 - remove hardcoded dtb filename
 - added CONFIG_FIT_EXTERNAL_OFFSET

Changes for v3
 - just rebased to master

Changes for v2
 - just rebased to master

 arch/arm/dts/imx8qm-rom7720-a1.dts            |   1 +
 arch/arm/dts/imx8qm-u-boot.dtsi               | 133 ++++++++++++++++++
 arch/arm/mach-imx/imx8/Kconfig                |   1 +
 .../advantech/imx8qm_rom7720_a1/imximage.cfg  |   4 +-
 configs/imx8qm_rom7720_a1_4G_defconfig        |   3 +-
 doc/board/advantech/imx8qm-rom7720-a1.rst     |   3 +-
 6 files changed, 140 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/imx8qm-u-boot.dtsi

diff --git a/arch/arm/dts/imx8qm-rom7720-a1.dts b/arch/arm/dts/imx8qm-rom7720-a1.dts
index d1f2fff869..332d441c6d 100644
--- a/arch/arm/dts/imx8qm-rom7720-a1.dts
+++ b/arch/arm/dts/imx8qm-rom7720-a1.dts
@@ -10,6 +10,7 @@
 /memreserve/ 0x80000000 0x00020000;
 
 #include "fsl-imx8qm.dtsi"
+#include "imx8qm-u-boot.dtsi"
 
 / {
 	model = "Advantech iMX8QM Qseven series";
diff --git a/arch/arm/dts/imx8qm-u-boot.dtsi b/arch/arm/dts/imx8qm-u-boot.dtsi
new file mode 100644
index 0000000000..9b382f4d11
--- /dev/null
+++ b/arch/arm/dts/imx8qm-u-boot.dtsi
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2021 NXP
+ */
+
+/ {
+	binman: binman {
+		multiple-images;
+	};
+};
+
+&binman {
+	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";
+		};
+	};
+
+	spl {
+		filename = "spl.bin";
+
+		mkimage {
+			args = "-n spl/u-boot-spl.cfgout -T imx8image -e 0x100000";
+
+			blob {
+				filename = "u-boot-spl-ddr.bin";
+			};
+		};
+	};
+
+	itb {
+		filename = "u-boot.itb";
+
+		fit {
+			description = "Configuration to load ATF before U-Boot";
+			fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
+			fit,fdt-list = "of-list";
+			#address-cells = <1>;
+
+			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 = "atf-bl31";
+					};
+				};
+
+				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-SEQ {
+					compression = "none";
+					description = "NAME";
+					type = "flat_dt";
+
+					uboot-fdt-blob {
+						filename = "u-boot.dtb";
+						type = "blob-ext";
+					};
+				};
+			};
+
+			configurations {
+				default = "@config-DEFAULT-SEQ";
+
+				binman_configuration: @config-SEQ {
+					description = "NAME";
+					fdt = "fdt-SEQ";
+					firmware = "uboot";
+					loadables = "atf";
+				};
+			};
+		};
+	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl {
+			filename = "spl.bin";
+			offset = <0x0>;
+			type = "blob-ext";
+		};
+	};
+};
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index abb03340d8..71abbb33ea 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -82,6 +82,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
diff --git a/board/advantech/imx8qm_rom7720_a1/imximage.cfg b/board/advantech/imx8qm_rom7720_a1/imximage.cfg
index 5ecde0c530..43035088e3 100644
--- a/board/advantech/imx8qm_rom7720_a1/imximage.cfg
+++ b/board/advantech/imx8qm_rom7720_a1/imximage.cfg
@@ -4,8 +4,8 @@
  */
 
 
-/* Boot from SD, sector size 0x400 */
-BOOT_FROM SD 0x400
+BOOT_FROM	sd
+
 /* SoC type IMX8QM */
 SOC_TYPE IMX8QM
 /* Append seco container image */
diff --git a/configs/imx8qm_rom7720_a1_4G_defconfig b/configs/imx8qm_rom7720_a1_4G_defconfig
index 3b099761a9..4b7ed6df01 100644
--- a/configs/imx8qm_rom7720_a1_4G_defconfig
+++ b/configs/imx8qm_rom7720_a1_4G_defconfig
@@ -20,8 +20,9 @@ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80200000
 CONFIG_REMAKE_ELF=y
 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_BOOTDELAY=3
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else run netboot; fi; fi; else booti ${loadaddr} - ${fdt_addr}; fi"
diff --git a/doc/board/advantech/imx8qm-rom7720-a1.rst b/doc/board/advantech/imx8qm-rom7720-a1.rst
index bd4be1dbeb..953cf01fde 100644
--- a/doc/board/advantech/imx8qm-rom7720-a1.rst
+++ b/doc/board/advantech/imx8qm-rom7720-a1.rst
@@ -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
 ---------------------------------
-- 
2.17.1


  reply	other threads:[~2022-11-02 15:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 15:56 [PATCH 0/8] imx8: switch missing boards to binman Oliver Graute
2022-11-02 15:56 ` Oliver Graute [this message]
2022-11-02 15:56 ` [PATCH v6] imx: imx8qm: cgtqmx8: switch " Oliver Graute
2022-11-02 15:56 ` [PATCH v1] imx: imx8qxp: imx8qxp_mek " Oliver Graute
2022-11-02 15:56 ` [PATCH v2] imx: imx8qm: imx8qm_mek " Oliver Graute
2022-11-02 15:56 ` [PATCH v1] imx: imx8qxp: giedi " Oliver Graute
2022-11-02 15:56 ` [PATCH v1] imx: imx8qxp: deneb " Oliver Graute
2022-11-02 15:56 ` [PATCH v1] imx: imx8x: colibri: " Oliver Graute
2022-11-02 15:56 ` [PATCH v1] imx: imx8: apalis: " Oliver Graute
2022-11-02 16:16   ` Fabio Estevam
2022-11-04 12:38     ` Oliver Graute
2022-11-04 12:58       ` Fabio Estevam
2022-11-04 13:07         ` Oliver Graute
2022-11-04 13:03       ` Oliver Graute
2022-11-02 16:07 ` [PATCH 0/8] imx8: switch missing boards " Fabio Estevam
  -- strict thread matches above, loose matches on Subject: below --
2022-10-26 14:00 [PATCH v5] imx: imx8qm-rom7720: switch " Oliver Graute

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221102155655.5296-2-oliver.graute@kococonnector.com \
    --to=oliver.graute@kococonnector.com \
    --cc=denys.drozdov@toradex.com \
    --cc=festevam@gmail.com \
    --cc=gaurav.jain@nxp.com \
    --cc=horia.geanta@nxp.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=oliver.graute@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox