Skip to contentSkip to conversation

imx: imx93_11x11_evk: using binman to pack images

PATCH Superseded Peng Fan (OSS) 1 participant 1 message Jun 13, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 imx: imx93_11x11_evk: using binman to pack images

From: Peng Fan <[email protected]>

Use BINMAN to generate flash.bin

---

Based on
https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

 arch/arm/dts/imx93-11x11-evk-u-boot.dtsi |  2 +
 arch/arm/dts/imx93-u-boot.dtsi           | 84 ++++++++++++++++++++++++
 arch/arm/mach-imx/Makefile               | 24 +++++++
 arch/arm/mach-imx/imx9/Kconfig           |  1 +
 arch/arm/mach-imx/imx9/container.cfg     | 11 ++++
 arch/arm/mach-imx/imx9/imximage.cfg      | 15 +++++
 board/freescale/imx93_evk/Kconfig        |  6 ++
 7 files changed, 143 insertions(+)
 create mode 100644 arch/arm/dts/imx93-u-boot.dtsi
 create mode 100644 arch/arm/mach-imx/imx9/container.cfg
 create mode 100644 arch/arm/mach-imx/imx9/imximage.cfg
arch/arm/dts/imx93-11x11-evk-u-boot.dtsi +2 -0
index 6f02b389893..e5912a85ca2 100644
@@ -3,6 +3,8 @@
  * Copyright 2022 NXP
  */
 
+#include "imx8mp-u-boot.dtsi"
+
 / {
 	wdt-reboot {
 		compatible = "wdt-reboot";
arch/arm/dts/imx93-u-boot.dtsi new file +84 -0

84 lines not on this page · raw message

arch/arm/mach-imx/Makefile +24 -0
index 71ac8e6ffde..2f51226e0d9 100644
@@ -120,6 +120,9 @@ 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)
+IMAGE_TYPE := imx8image
+DEPFILE_EXISTS := 0
 else
 IMAGE_TYPE := imximage
 DEPFILE_EXISTS := 0
@@ -171,6 +174,27 @@ flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE
 	$(call if_changed,mkimage)
 endif
 
+ifeq ($(CONFIG_ARCH_IMX9), y)
+
+SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout u-boot-container.cfgout FORCE
+
+MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e $(CONFIG_SPL_TEXT_BASE)
+flash.bin: MKIMAGEOUTPUT = flash.log
+
+spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cpp_cfg)
+
+spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
+
+u-boot-container.cfgout: $(IMX_CONTAINER_CFG) FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cpp_cfg)
+
+flash.bin: spl/u-boot-spl-ddr.bin container.cfgout FORCE
+	$(call if_changed,mkimage)
+endif
+
 ifeq ($(CONFIG_ARCH_IMX8), y)
 SPL:
 
arch/arm/mach-imx/imx9/Kconfig +1 -0
index c06102bae07..0b965376987 100644
@@ -25,6 +25,7 @@ choice
 config TARGET_IMX93_11X11_EVK
 	bool "imx93_11x11_evk"
 	select IMX93
+	select BINMAN
 
 endchoice
 
arch/arm/mach-imx/imx9/container.cfg new file +11 -0
new file mode 100644
index 00000000000..baaa17748ff
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2022 NXP
+ */
+
+/* This file is to create a container image could be loaded by SPL */
+BOOT_FROM SD 0x400
+SOC_TYPE IMX9
+CONTAINER
+IMAGE A55 bl31.bin	0x204E0000
+IMAGE A55 u-boot.bin	CONFIG_SYS_TEXT_BASE
arch/arm/mach-imx/imx9/imximage.cfg new file +15 -0
new file mode 100644
index 00000000000..fae0c64245f
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2022 NXP
+ */
+
+/* Boot from SD, sector size 0x400 */
+BOOT_FROM SD 0x400
+/* SoC type IMX9 */
+SOC_TYPE IMX9
+/* Append sentinel container image */
+APPEND mx93a0-ahab-container.img
+/* Create the 2nd container */
+CONTAINER
+/* Add spl with exec attribute */
+IMAGE A55 u-boot-spl-ddr.bin 0x2049A000
board/freescale/imx93_evk/Kconfig +6 -0
index 032e523198d..17209d939d2 100644
@@ -16,6 +16,12 @@ config IMX93_EVK_LPDDR4X
 	help
 	  Select the LPDDR4X timing and 0.6V VDDQ
 
+config IMX_CONFIG
+	default "arch/arm/mach-imx/imx9/imximage.cfg"
+
+config IMX_CONTAINER_CFG
+	default "arch/arm/mach-imx/imx9/container.cfg"
+
 source "board/freescale/common/Kconfig"
 
 endif
Signature · 1 line
2.36.0