DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: distrokit@pengutronix.de
Subject: Re: [DistroKit] [PATCH 10/12] v7a: stm32mp: add TF-A recipe for STM32MP13
Date: Fri, 26 Apr 2024 10:03:19 +0200	[thread overview]
Message-ID: <20240426-lyrics-manager-9affa0516da9@thorsis.com> (raw)
In-Reply-To: <20240315211240.3016716-11-a.fatoum@pengutronix.de>

Hello Ahmad,

sorry to hook in here again, but a clean DistroKit build fails on
`ptxdist get tf-a-stm32mp13` which is essentially the same problem as
already fixed with 3e11c53d98c0 ("tf-a: Change download URL") for the
generic tf-a package … see below.

Am Fri, Mar 15, 2024 at 10:12:38PM +0100 schrieb Ahmad Fatoum:
> 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 <a.fatoum@pengutronix.de>
> ---
>  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 c502a5e44b40..1ff25470bfd6 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"
> +# 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 <r.czerwinski@pengutronix.de>
> +#               2019 by Ahmad Fatoum <a.fatoum@pengutronix.de>
> +#
> +# 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)

This fails if someone deselects pkg 'tf-a' (after deselecting all
images depending on it).  TF_A_STM32MP13_VERSION and
TF_A_STM32MP13_MD5 won't get a valid value then.

I thought about setting TF_A_STM32MP13_URL to PTXCONF_TF_A_URL to fix
the URL problem, but that would have the same problem.

I see three possibilities:

1) hardcode everything in this duplicated package 'tf-a-stm32mp13'
2) create a dependency to the generic 'tf-a' package which might be
built without real reason then maybe
3) move that version, md5, and url stuff in some extra 'common'
package (would not make it possible to use the tf-a package from
ptxdist anymore?)

Greets
Alex

> +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
> 
> 



  reply	other threads:[~2024-04-26  8:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 21:12 [DistroKit] [PATCH 00/12] update and add STM32MP135F-DK support Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 01/12] ptxdist: migrate 2023.02.0 → 2024.03.0 Ahmad Fatoum
2024-03-16  9:26   ` Alexander Dahl
2024-03-17 19:14     ` Robert Schwebel
2024-03-21  9:37   ` Alexander Dahl
2024-03-25 18:45     ` [DistroKit] [PATCH] blspec-entry: remove superfluous file Roland Hieber
2024-03-25 20:51       ` Robert Schwebel
2024-03-15 21:12 ` [DistroKit] [PATCH 02/12] tf-a: update from v2.8 → v2.10 Ahmad Fatoum
2024-04-24 11:15   ` Alexander Dahl
2024-04-24 11:48     ` Ahmad Fatoum
2024-04-24 11:58       ` Alexander Dahl
2024-03-15 21:12 ` [DistroKit] [PATCH 03/12] v8a: imx8mq-evk: disable PCI nodes Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 04/12] v8a: update kernel from v6.6 → v6.8 Ahmad Fatoum
2024-03-16 11:18   ` Michael Olbrich
2024-03-16 13:09     ` Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 05/12] v8a: barebox: version bump v2023.12.0 → v2024.03.0 Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 06/12] v7a: update kernel from v6.6 → v6.8 Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 07/12] v7a: barebox: version bump v2024.01.0 → v2024.03.0 Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 08/12] v7a: barebox: enable STM32MP135F-DK support Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 09/12] v7a: build OP-TEE for STM32MP13 Ahmad Fatoum
2024-03-15 21:12 ` [DistroKit] [PATCH 10/12] v7a: stm32mp: add TF-A recipe " Ahmad Fatoum
2024-04-26  8:03   ` Alexander Dahl [this message]
2024-03-15 21:12 ` [DistroKit] [PATCH 11/12] v7a: kernel: enable STM32MP135F-DK support Ahmad Fatoum
2024-03-18 13:07   ` Michael Olbrich
2024-03-18 14:23     ` Robert Schwebel
2024-03-15 21:12 ` [DistroKit] [PATCH 12/12] v7a: stm32mp: add image recipe for STM32MP135F-DK Ahmad Fatoum
2024-03-17 19:27 ` [DistroKit] [PATCH 00/12] update and add STM32MP135F-DK support Robert Schwebel

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=20240426-lyrics-manager-9affa0516da9@thorsis.com \
    --to=ada@thorsis.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /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