]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp: add binman support for STM32MP15x
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 13 Oct 2021 13:11:18 +0000 (15:11 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Wed, 10 Nov 2021 14:12:16 +0000 (15:12 +0100)
Use binman to add the stm32image header on SPL binary for basic boot
or on U-Boot binary when it is required, i.e. for TF-A boot without FIP
support, when CONFIG_STM32MP15x_STM32IMAGE is activated.

The "binman" tool is the recommended tool for specific image generation.
This patch allows to suppress the config.mk file and it is a preliminary
step to manage FIT generation with binman.

The init_r parsing of U-Boot device tree to search the binman
information is not required for STM32MP15, so the binman library
can be removed in U-Boot (CONFIG_BINMAN_FDT is deactivated).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 files changed:
arch/arm/dts/stm32mp15-u-boot.dtsi
arch/arm/mach-stm32mp/Kconfig
arch/arm/mach-stm32mp/config.mk [deleted file]
configs/stm32mp15-icore-stm32mp1-ctouch2_defconfig
configs/stm32mp15-icore-stm32mp1-edimm2.2_defconfig
configs/stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig
configs/stm32mp15-microgea-stm32mp1-microdev2_defconfig
configs/stm32mp15_basic_defconfig
configs/stm32mp15_defconfig
configs/stm32mp15_dhcom_basic_defconfig
configs/stm32mp15_dhcor_basic_defconfig
configs/stm32mp15_trusted_defconfig

index 43a7909978d8b4020186d395758c20fa8ad10250..db23d80eef8c2bee328ee6fbb27b52d3f9457e99 100644 (file)
                pinctrl1 = &pinctrl_z;
        };
 
+       binman: binman {
+               multiple-images;
+       };
+
        clocks {
                u-boot,dm-pre-reloc;
        };
        resets = <&rcc UART8_R>;
 };
 
+#if defined(CONFIG_STM32MP15x_STM32IMAGE)
+&binman {
+       u-boot-stm32 {
+               filename = "u-boot.stm32";
+               mkimage {
+                       args = "-T stm32image -a 0xC0100000 -e 0xC0100000";
+                       u-boot {
+                       };
+               };
+       };
+};
+#endif
+
+#if defined(CONFIG_SPL)
+&binman {
+       spl-stm32 {
+               filename = "u-boot-spl.stm32";
+               mkimage {
+                       args = "-T stm32image -a 0x2FFC2500 -e 0x2FFC2500";
+                       u-boot-spl {
+                       };
+               };
+       };
+};
+#endif
index 69d56c23e11287bbae86c97ac864883a80193be9..4acb29333c2577e880c7b054cfad082e7f33d5f3 100644 (file)
@@ -37,6 +37,7 @@ config STM32MP15x
        bool "Support STMicroelectronics STM32MP15x Soc"
        select ARCH_SUPPORT_PSCI if !TFABOOT
        select ARM_SMCCC if TFABOOT
+       select BINMAN
        select CPU_V7A
        select CPU_V7_HAS_NONSEC if !TFABOOT
        select CPU_V7_HAS_VIRT
diff --git a/arch/arm/mach-stm32mp/config.mk b/arch/arm/mach-stm32mp/config.mk
deleted file mode 100644 (file)
index f7f5b77..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
-#
-# Copyright (C) 2018, STMicroelectronics - All Rights Reserved
-#
-
-ifndef CONFIG_SPL
-INPUTS-$(CONFIG_STM32MP15x_STM32IMAGE) += u-boot.stm32
-else
-ifdef CONFIG_SPL_BUILD
-INPUTS-y += u-boot-spl.stm32
-endif
-endif
-
-MKIMAGEFLAGS_u-boot.stm32 = -T stm32image -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
-
-u-boot.stm32: MKIMAGEOUTPUT = u-boot.stm32.log
-
-u-boot.stm32: u-boot.bin FORCE
-       $(call if_changed,mkimage)
-
-MKIMAGEFLAGS_u-boot-spl.stm32 = -T stm32image -a $(CONFIG_SPL_TEXT_BASE) -e $(CONFIG_SPL_TEXT_BASE)
-
-spl/u-boot-spl.stm32: MKIMAGEOUTPUT = spl/u-boot-spl.stm32.log
-
-spl/u-boot-spl.stm32: spl/u-boot-spl.bin FORCE
-       $(call if_changed,mkimage)
-
-u-boot-spl.stm32 : spl/u-boot-spl.stm32
-       $(call if_changed,copy)
index 14bf6d1376a3f4db89001490223ee9a564fc6cec..ce7aece4b851d4623437f7fbb7931e3117ff67a4 100644 (file)
@@ -75,5 +75,6 @@ CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_ERRNO_STR=y
index 648ecbfc6766f53f0eebe23507c42b2eb7404d05..52a077980295abaf8b3a9d467a03498f7dd7238f 100644 (file)
@@ -75,5 +75,6 @@ CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_ERRNO_STR=y
index f422ffbedaa4ffb170a7bbed80f244619cc90408..31e890725cf4098fc984b6ce4af09966539176d7 100644 (file)
@@ -75,5 +75,6 @@ CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_ERRNO_STR=y
index 244d9ccf4edad740c88af7bf9a580bec6aa61d2d..61714b9df789fb771113d2367415dbc978477632 100644 (file)
@@ -75,5 +75,6 @@ CONFIG_RTC_STM32=y
 CONFIG_SERIAL_RX_BUFFER=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_ERRNO_STR=y
index 77ed82c99f791ab435a6130e3b5431224d9a9271..f9b51f73497a48fc88a32126985c783f79cedd1f 100644 (file)
@@ -170,6 +170,7 @@ CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
index 701b1510c5b37f85547f94e5e190c04a5870daf8..02457eb8d619a0a18a7deaf2731ed79ba306df39 100644 (file)
@@ -152,6 +152,7 @@ CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set
index 5b85f6ad03b3fa915487a47ebdd150aec97b94cb..17907dad7eba7fe952a36db2e9d2090a067ea1be 100644 (file)
@@ -153,5 +153,6 @@ CONFIG_VIDEO_BMP_RLE8=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
index 37dd2754c033a80f42034bc66146ee073ee953b1..d0c8d829f644070728c21ee910eed1c453508c02 100644 (file)
@@ -147,5 +147,6 @@ CONFIG_VIDEO_BMP_RLE8=y
 CONFIG_BMP_16BPP=y
 CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_LZO=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
index b4ed090e3f03f6f838410cb22c5a1ede33b97f19..5963064312cfcd7922e97a0ebc8231cd76aeab33 100644 (file)
@@ -153,6 +153,7 @@ CONFIG_BMP_24BPP=y
 CONFIG_BMP_32BPP=y
 CONFIG_WDT=y
 CONFIG_WDT_STM32MP=y
+# CONFIG_BINMAN_FDT is not set
 CONFIG_ERRNO_STR=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
 # CONFIG_LMB_USE_MAX_REGIONS is not set