[openwrt/openwrt] arm-trusted-firmware-stm32: add ATF for stm32 boards
LEDE Commits
lede-commits at lists.infradead.org
Thu Nov 28 10:58:18 PST 2024
ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/d921c2db0b511b89cd9adeb644f4d92a79e419bb
commit d921c2db0b511b89cd9adeb644f4d92a79e419bb
Author: Thomas Richard <thomas.richard at bootlin.com>
AuthorDate: Thu Sep 26 16:29:41 2024 +0200
arm-trusted-firmware-stm32: add ATF for stm32 boards
Add ATF for stm32 boards, with the first being STM32MP135F-DK.
Signed-off-by: Thomas Richard <thomas.richard at bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/16716
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
(cherry picked from commit 08dcb73c8d05aa774957422731bfed1b322648d7)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
package/boot/arm-trusted-firmware-stm32/Makefile | 63 ++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/package/boot/arm-trusted-firmware-stm32/Makefile b/package/boot/arm-trusted-firmware-stm32/Makefile
new file mode 100644
index 0000000000..75a92f15af
--- /dev/null
+++ b/package/boot/arm-trusted-firmware-stm32/Makefile
@@ -0,0 +1,63 @@
+#
+# Copyright (C) 2024 Bootlin
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=2.10
+PKG_RELEASE:=1
+
+PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201
+PKG_MAINTAINER:=Thomas Richard <thomas.richard at bootlin.com>
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/trusted-firmware-a.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Trusted-Firmware-A/Default
+ BUILD_TARGET:=stm32
+ BUILD_DEVICES:=$(1)
+ DEPENDS:=+u-boot-$(1) +optee-os-$(1)
+endef
+
+define Trusted-Firmware-A/stm32mp1
+ BUILD_SUBTARGET:=stm32mp1
+ PLAT:=stm32mp1
+ MAKE_ARGS += BL32_EXTRA2=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pageable_v2.bin \
+ STM32MP_USB_PROGRAMMER=1 \
+ STM32MP1_OPTEE_IN_SYSRAM=1 \
+ ARM_ARCH_MAJOR=7
+endef
+
+define Trusted-Firmware-A/stm32mp135f-dk
+ $(call Trusted-Firmware-A/stm32mp1)
+ NAME:=STM32MP135F-DK
+ DTB_FILE_NAME=stm32mp135f-dk.dtb
+endef
+
+TFA_TARGETS := stm32mp135f-dk
+
+TFA_MAKE_FLAGS += \
+ ARCH=aarch32 AARCH32_SP=optee \
+ BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \
+ BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \
+ BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.bin \
+ BL33_CFG=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot.dtb \
+ DTB_FILE_NAME=$(DTB_FILE_NAME) \
+ STM32MP_SDMMC=1 \
+ TARGET_BOARD="" \
+ $(MAKE_ARGS) \
+ all fip
+
+define Package/trusted-firmware-a/install
+ $(INSTALL_DIR) $(STAGING_DIR_IMAGE)
+ $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/tf-a-$(BUILD_VARIANT).stm32 \
+ $(STAGING_DIR_IMAGE)/tf-a-$(BUILD_VARIANT).stm32
+ $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \
+ $(STAGING_DIR_IMAGE)/fip-$(BUILD_VARIANT).bin
+endef
+
+$(eval $(call BuildPackage/Trusted-Firmware-A))
More information about the lede-commits
mailing list