From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 03 Apr 2024 12:39:36 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rry1n-005rGB-2u for lore@lore.pengutronix.de; Wed, 03 Apr 2024 12:39:35 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rry1n-0002Xv-9C; Wed, 03 Apr 2024 12:39:35 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rry1d-0002Dm-PT; Wed, 03 Apr 2024 12:39:25 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rry1d-00A9u5-AD; Wed, 03 Apr 2024 12:39:25 +0200 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1rry1d-00DIKb-0k; Wed, 03 Apr 2024 12:39:25 +0200 From: Ahmad Fatoum To: distrokit@pengutronix.de Date: Wed, 3 Apr 2024 12:39:22 +0200 Message-Id: <20240403103924.3168404-7-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240403103924.3168404-1-a.fatoum@pengutronix.de> References: <20240403103924.3168404-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [DistroKit] [PATCH v2 6/8] v7a: stm32mp: add TF-A recipe for STM32MP13 X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ahmad Fatoum Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false We have two ways of doing multi-image builds with TF-A: - STM32MP15-specific: Multiple device trees can be supplied and TF-A is built once and linked with each DT in turn. This was contributed to TF-A for DistroKit purposes, but ST broke the compatibility for STM32MP13, which requires to be built separately. - PTXdist-specific: The PTXdist rule can built multiple platforms in different build directories. This requires however that the options used are the same, except for platform. We unfortunately need to change the option between our two TF-A build though. Therefore, let's duplicate the upstream TF-A rule for the STM32MP13 and configure it for use with OP-TEE. Signed-off-by: Ahmad Fatoum Link: https://lore.pengutronix.de/20240315211240.3016716-11-a.fatoum@pengutronix.de Signed-off-by: Robert Schwebel --- v1 -> v2: - no change --- configs/platform-v7a/platformconfig | 1 + .../platform-v7a/platforms/tf-a-stm32mp13.in | 12 ++ .../platform-v7a/rules/tf-a-stm32mp13.make | 110 ++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 configs/platform-v7a/platforms/tf-a-stm32mp13.in create mode 100644 configs/platform-v7a/rules/tf-a-stm32mp13.make diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig index f9c095916c22..ab9e5b2e6671 100644 --- a/configs/platform-v7a/platformconfig +++ b/configs/platform-v7a/platformconfig @@ -203,6 +203,7 @@ PTXCONF_OPTEE=y PTXCONF_OPTEE_PLATFORM="stm32mp1" PTXCONF_OPTEE_PLATFORM_FLAVOUR="135F_DK" PTXCONF_OPTEE_CFG="CFG_TEE_CORE_LOG_LEVEL=2 CFG_WITH_PAGER=n CFG_GP_SOCKETS=n CFG_TA_MBEDTLS_SELF_TEST=n" +# PTXCONF_TF_A_STM32MP13 is not set PTXCONF_TF_A=y PTXCONF_TF_A_URL="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot" PTXCONF_TF_A_VERSION="v2.10" diff --git a/configs/platform-v7a/platforms/tf-a-stm32mp13.in b/configs/platform-v7a/platforms/tf-a-stm32mp13.in new file mode 100644 index 000000000000..0dd58041ec19 --- /dev/null +++ b/configs/platform-v7a/platforms/tf-a-stm32mp13.in @@ -0,0 +1,12 @@ +## SECTION=bootloader + +menuconfig TF_A_STM32MP13 + select BOOTLOADER + select HOST_DTC + prompt "ARM Trusted Firmware-A for STM32MP13 with OP-TEE" + depends on ARCH_ARM + bool + help + ARM Trusted Firmware-A for STM32MP13 series SoCs with OP-TEE enabled. + Currently, these can't be built in the same build as the + STM32MP15 with SP_min. diff --git a/configs/platform-v7a/rules/tf-a-stm32mp13.make b/configs/platform-v7a/rules/tf-a-stm32mp13.make new file mode 100644 index 000000000000..36feb25e6e76 --- /dev/null +++ b/configs/platform-v7a/rules/tf-a-stm32mp13.make @@ -0,0 +1,110 @@ +# -*-makefile-*- +# +# Copyright (C) 2018 by Rouven Czerwinski +# 2019 by Ahmad Fatoum +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_TF_A_STM32MP13) += tf-a-stm32mp13 + +# +# Paths and names +# +TF_A_STM32MP13_VERSION := $(call ptx/config-version, PTXCONF_TF_A) +TF_A_STM32MP13_MD5 := $(call ptx/config-md5, PTXCONF_TF_A) +TF_A_STM32MP13 := tf-a-stm32mp13-$(TF_A_STM32MP13_VERSION) +TF_A_STM32MP13_SUFFIX := tar.gz +TF_A_STM32MP13_URL := https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot/$(TF_A_STM32MP13_VERSION).$(TF_A_STM32MP13_SUFFIX) +TF_A_STM32MP13_SOURCE := $(SRCDIR)/$(TF_A_STM32MP13).$(TF_A_STM32MP13_SUFFIX) +TF_A_STM32MP13_DIR := $(BUILDDIR)/$(TF_A_STM32MP13) +TF_A_STM32MP13_BUILDDIR := $(TF_A_STM32MP13_DIR)/build +TF_A_STM32MP13_BUILD_OOT := YES +TF_A_STM32MP13_LICENSE := BSD-3-Clause AND BSD-2-Clause \ + AND (GPL-2.0-or-later OR BSD-2-Clause) \ + AND (NCSA OR MIT) \ + AND Zlib \ + AND (GPL-2.0-or-later OR BSD-3-Clause) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +TF_A_STM32MP13_PLATFORMS := stm32mp1 +TF_A_STM32MP13_ARTIFACTS := tf-a-*.stm32 fdts/*-fw-config.dtb + +TF_A_STM32MP13_WRAPPER_BLACKLIST := \ + $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST) + +TF_A_STM32MP13_PATH := PATH=$(CROSS_PATH) +TF_A_STM32MP13_MAKE_OPT := \ + -C $(TF_A_STM32MP13_DIR) \ + CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \ + HOSTCC=$(HOSTCC) \ + ARCH=aarch32 \ + ARM_ARCH_MAJOR=7 \ + BUILD_STRING=$(TF_A_STM32MP13_VERSION) \ + DTB_FILE_NAME='stm32mp135f-dk.dtb' \ + STM32MP_EMMC=1 STM32MP_SDMMC=1 \ + STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 STM32MP_SPI_NOR=1 \ + STM32MP_USB_PROGRAMMER=1 \ + AARCH32_SP=optee \ + all + +TF_A_STM32MP13_CONF_TOOL := NO + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +TF_A_STM32MP13_MAKE_ENV := $(CROSS_ENV) + +$(STATEDIR)/tf-a-stm32mp13.compile: + @$(call targetinfo) + + @$(foreach plat, $(TF_A_STM32MP13_PLATFORMS), \ + $(call compile, TF_A_STM32MP13, \ + $(TF_A_STM32MP13_MAKE_OPT) PLAT=$(plat))$(ptx/nl)) + + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +tf-a-stm32mp13/inst_plat = $(foreach artifact, \ + $(foreach pattern, $(TF_A_STM32MP13_ARTIFACTS), \ + $(wildcard $(TF_A_STM32MP13_BUILDDIR)/$(1)/$(if $(filter DEBUG=1,TF_A_STM32MP13_MAKE_OPT),debug,release)/$(pattern))), \ + install -v -D -m 644 $(artifact) \ + $(2)/$(1)-$(notdir $(artifact))$(ptx/nl)) + +tf-a-stm32mp13/inst_bins = $(foreach plat, $(TF_A_STM32MP13_PLATFORMS), $(call tf-a-stm32mp13/inst_plat,$(plat),$(1))) + +$(STATEDIR)/tf-a-stm32mp13.install: + @$(call targetinfo) + @$(call tf-a-stm32mp13/inst_bins,$(TF_A_STM32MP13_PKGDIR)/usr/lib/firmware) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/tf-a-stm32mp13.targetinstall: + @$(call targetinfo) + @$(call tf-a-stm32mp13/inst_bins,$(IMAGEDIR)) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +$(STATEDIR)/tf-a-stm32mp13.clean: + @$(call targetinfo) + @rm -vf $(addprefix $(IMAGEDIR)/, $(notdir $(TF_A_STM32MP13_ARTIFACTS_SRC))) + @$(call clean_pkg, TF_A_STM32MP13) + +# vim: syntax=make -- 2.39.2