U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Bisson <bisson.gary@gmail.com>
To: u-boot@lists.denx.de
Cc: trini@konsulko.com, festevam@gmail.com, peng.fan@nxp.com,
	uboot-imx@nxp.com, Gary Bisson <bisson.gary@gmail.com>
Subject: [PATCH 4/5] mach-imx: Add i.MX 8ULP binman support
Date: Mon,  5 Aug 2024 14:43:25 +0200	[thread overview]
Message-ID: <20240805124326.544310-5-bisson.gary@gmail.com> (raw)
In-Reply-To: <20240805124326.544310-1-bisson.gary@gmail.com>

- Re-use i.MX 93 Makefile target as similar boot process
- Create imx8ulp-u-boot.dtsi for binman image architecture
- Create both SPL and U-Boot containers configuration

Key differences between the 93 and 8ULP SPL container are:
- No LPDDR training library needed for 8ULP
- 8ULP requires a uPower binary (RISC-V core) for power management
- 8ULP also requires a M33 binary to work properly

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
---
 arch/arm/dts/imx8ulp-u-boot.dtsi        | 63 +++++++++++++++++++++++++
 arch/arm/mach-imx/Makefile              |  4 +-
 arch/arm/mach-imx/imx8ulp/container.cfg |  7 +++
 arch/arm/mach-imx/imx8ulp/imximage.cfg  |  9 ++++
 4 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/imx8ulp-u-boot.dtsi
 create mode 100644 arch/arm/mach-imx/imx8ulp/container.cfg
 create mode 100644 arch/arm/mach-imx/imx8ulp/imximage.cfg

diff --git a/arch/arm/dts/imx8ulp-u-boot.dtsi b/arch/arm/dts/imx8ulp-u-boot.dtsi
new file mode 100644
index 00000000000..30baaeff8ef
--- /dev/null
+++ b/arch/arm/dts/imx8ulp-u-boot.dtsi
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#ifdef CONFIG_BINMAN
+/ {
+	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 0x22020000";
+
+			blob {
+				filename = "u-boot-spl-ddr.bin";
+			};
+		};
+	};
+
+	u-boot-container {
+		filename = "u-boot-container.bin";
+
+		mkimage {
+			args = "-n u-boot-container.cfgout -T imx8image -e 0x0";
+
+			blob {
+				filename = "u-boot.bin";
+			};
+		};
+	};
+
+	imx-boot {
+		filename = "flash.bin";
+		pad-byte = <0x00>;
+
+		spl: blob-ext@1 {
+			filename = "spl.bin";
+			offset = <0x0>;
+			align-size = <0x400>;
+			align = <0x400>;
+		};
+
+		uboot: blob-ext@2 {
+			filename = "u-boot-container.bin";
+		};
+	};
+};
+#endif
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index ef0caed3f7f..b311d176d64 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -129,7 +129,7 @@ DEPFILE_EXISTS := $(shell $(CPP) $(cpp_flags) -x c -o u-boot-dtb.cfgout $(srctre
 else ifeq ($(CONFIG_ARCH_IMX8M), y)
 IMAGE_TYPE := imx8mimage
 DEPFILE_EXISTS := 0
-else ifeq ($(CONFIG_ARCH_IMX9), y)
+else ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
 IMAGE_TYPE := imx8image
 DEPFILE_EXISTS := 0
 else
@@ -215,7 +215,7 @@ flash.bin: spl/u-boot-spl.bin FORCE
 endif
 endif
 
-ifeq ($(CONFIG_ARCH_IMX9), y)
+ifeq ($(CONFIG_ARCH_IMX9)$(CONFIG_ARCH_IMX8ULP), y)
 
 quiet_cmd_imx9_check = CHECK    $@
 cmd_imx9_check = $(srctree)/tools/imx9_image.sh $@
diff --git a/arch/arm/mach-imx/imx8ulp/container.cfg b/arch/arm/mach-imx/imx8ulp/container.cfg
new file mode 100644
index 00000000000..029b79128c8
--- /dev/null
+++ b/arch/arm/mach-imx/imx8ulp/container.cfg
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+BOOT_FROM SD 0x400
+SOC_TYPE ULP
+CONTAINER
+IMAGE A35 bl31.bin 0x20040000
+IMAGE A35 u-boot.bin CONFIG_TEXT_BASE
diff --git a/arch/arm/mach-imx/imx8ulp/imximage.cfg b/arch/arm/mach-imx/imx8ulp/imximage.cfg
new file mode 100644
index 00000000000..a55359fee23
--- /dev/null
+++ b/arch/arm/mach-imx/imx8ulp/imximage.cfg
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+BOOT_FROM SD 0x400
+SOC_TYPE ULP
+APPEND mx8ulpa2-ahab-container.img
+CONTAINER
+IMAGE PWR upower.bin
+IMAGE M40 m33_image.bin 0x1ffc2000
+IMAGE A35 u-boot-spl-ddr.bin 0x22020000
-- 
2.43.0


  parent reply	other threads:[~2024-08-05 13:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 12:43 [PATCH 0/5] imx: imx8ulp: add binman support Gary Bisson
2024-08-05 12:43 ` [PATCH 1/5] tools: imx8image: fix soc variable for ULP Gary Bisson
2024-08-05 14:01   ` Peng Fan
2024-08-13 16:23   ` Fabio Estevam
2024-08-05 12:43 ` [PATCH 2/5] tools: imx8image: add upower image support Gary Bisson
2024-08-05 14:04   ` Peng Fan
2024-08-05 12:43 ` [PATCH 3/5] spl: binman: Disable u_boot_any symbols for i.MX 8ULP boards Gary Bisson
2024-08-05 14:05   ` Peng Fan
2024-08-05 12:43 ` Gary Bisson [this message]
2024-08-05 14:06   ` [PATCH 4/5] mach-imx: Add i.MX 8ULP binman support Peng Fan
2024-08-05 12:43 ` [PATCH 5/5] imx8ulp_evk: enable " Gary Bisson
2024-08-05 14:10   ` Peng Fan
2024-08-05 13:31 ` [PATCH 0/5] imx: imx8ulp: add " Fabio Estevam
2024-08-05 13:43   ` Gary Bisson
2024-08-05 21:25 ` [PATCH v2 " Gary Bisson
2024-08-05 21:25   ` [PATCH v2 1/5] tools: imx8image: fix soc variable for ULP Gary Bisson
2024-08-05 21:25   ` [PATCH v2 2/5] tools: imx8image: add upower image support Gary Bisson
2024-08-05 21:25   ` [PATCH v2 3/5] spl: binman: Disable u_boot_any symbols for i.MX 8ULP boards Gary Bisson
2024-08-05 21:25   ` [PATCH v2 4/5] mach-imx: Add i.MX 8ULP binman support Gary Bisson
2024-08-05 21:25   ` [PATCH v2 5/5] imx8ulp_evk: enable " Gary Bisson

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=20240805124326.544310-5-bisson.gary@gmail.com \
    --to=bisson.gary@gmail.com \
    --cc=festevam@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@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