DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Lars Schmidt <l.schmidt@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Lars Schmidt <l.schmidt@pengutronix.de>
Subject: [DistroKit] [PATCH 02/12] beagleplay: tf-a: needs adaption for k3 boards
Date: Fri, 23 May 2025 10:10:39 +0200	[thread overview]
Message-ID: <20250523081049.1693633-3-l.schmidt@pengutronix.de> (raw)
In-Reply-To: <20250523081049.1693633-1-l.schmidt@pengutronix.de>

BeaglePlay needs changes to Trusted-Firmware-A for
its boot processon the Cortex-A53 core.
So the file from ptxdist is used as basis.

Signed-off-by: Lars Schmidt <l.schmidt@pengutronix.de>
---
 configs/platform-v8a/rules/tf-a.make | 115 +++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)
 create mode 100644 configs/platform-v8a/rules/tf-a.make

diff --git a/configs/platform-v8a/rules/tf-a.make b/configs/platform-v8a/rules/tf-a.make
new file mode 100644
index 0000000..bff4edf
--- /dev/null
+++ b/configs/platform-v8a/rules/tf-a.make
@@ -0,0 +1,115 @@
+# -*-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) += tf-a
+
+#
+# Paths and names
+#
+TF_A_VERSION	:= $(call ptx/config-version, PTXCONF_TF_A)
+TF_A_MD5	:= $(call ptx/config-md5, PTXCONF_TF_A)
+TF_A		:= tf-a-$(TF_A_VERSION)
+TF_A_SUFFIX	:= tar.gz
+TF_A_URL	:= $(call remove_quotes, $(PTXCONF_TF_A_URL))/$(TF_A_VERSION).$(TF_A_SUFFIX)
+TF_A_SOURCE	:= $(SRCDIR)/$(TF_A).$(TF_A_SUFFIX)
+TF_A_DIR	:= $(BUILDDIR)/$(TF_A)
+TF_A_BUILD_DIR	:= $(TF_A_DIR)/build
+TF_A_BUILD_OOT	:= YES
+TF_A_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)
+TF_A_CVE_PRODUCT:= arm:trusted_firmware-a
+TF_A_CVE_VERSION:= $(patsubst v%,%,$(TF_A_VERSION))
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+TF_A_PLATFORMS		:= $(call remove_quotes, $(PTXCONF_TF_A_PLATFORMS))
+TF_A_ARTIFACTS		:= $(call remove_quotes, $(PTXCONF_TF_A_ARTIFACTS))
+
+TF_A_WRAPPER_BLACKLIST	:= \
+	$(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
+
+TF_A_EXTRA_ARGS		:= $(call remove_quotes,$(PTXCONF_TF_A_EXTRA_ARGS))
+TF_A_BINDIR		 = $(TF_A_BUILD_DIR)/$(1)/$(if $(filter DEBUG=1,$(TF_A_EXTRA_ARGS)),debug,release)
+TF_A_MAKE_OPT	:= \
+	-C $(TF_A_DIR) \
+	CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
+	HOSTCC=$(HOSTCC) \
+	ARCH=$(PTXCONF_TF_A_ARCH_STRING) \
+	ARM_ARCH_MAJOR=$(PTXCONF_TF_A_ARM_ARCH_MAJOR) \
+	BUILD_STRING=$(PTXCONF_TF_A_VERSION) \
+	$(TF_A_EXTRA_ARGS) \
+	all
+
+ifdef PTXCONF_TF_A_BL32_TSP
+TF_A_MAKE_OPT += ARM_TSP_RAM_LOCATION=$(PTXCONF_TF_A_BL32_TSP_RAM_LOCATION_STRING)
+endif
+ifdef PTXCONF_TF_A_ARM_ARCH_MINOR
+TF_A_MAKE_OPT += ARM_ARCH_MINOR=$(PTXCONF_TF_A_ARM_ARCH_MINOR)
+endif
+ifdef PTXCONF_TF_A_BL32_SP_MIN
+TF_A_MAKE_OPT += AARCH32_SP=sp_min
+endif
+
+ifdef PTXCONF_TF_A
+ifeq ($(TF_A_ARTIFACTS),)
+$(call ptx/error, TF_A_ARTIFACTS is empty. Nothing to install.)
+endif
+endif
+
+TF_A_CONF_TOOL	:= NO
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/tf-a.compile:
+	@$(call targetinfo)
+
+	@$(foreach plat, $(TF_A_PLATFORMS), \
+		$(call compile, TF_A, \
+		$(TF_A_MAKE_OPT) PLAT=$(plat))$(ptx/nl))
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+tf-a/inst_pkgdir = \
+	install -v -D -m 644 $(2) $(TF_A_PKGDIR)/usr/lib/firmware/$(3)
+
+tf-a/inst_plat = $(foreach artifact, \
+	$(wildcard $(addprefix $(TF_A_BINDIR)/, $(TF_A_ARTIFACTS))), \
+	$(call $(2),TF_A,$(artifact),$(1)-$(notdir $(artifact)))$(ptx/nl))
+
+tf-a/inst_bins = $(foreach plat, $(TF_A_PLATFORMS), $(call tf-a/inst_plat,$(plat),$(1)))
+
+$(STATEDIR)/tf-a.install:
+	@$(call targetinfo)
+	@$(call tf-a/inst_bins,tf-a/inst_pkgdir)
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/tf-a.targetinstall:
+	@$(call targetinfo)
+	@$(call tf-a/inst_bins,ptx/image-install)
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.39.5




  parent reply	other threads:[~2025-05-23  8:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  8:10 [DistroKit] [PATCH 00/12] Add beagleplay support to DistroKit Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 01/12] v8a: barebox: bump version v2025.03.0 -> v2025.05.0 Lars Schmidt
2025-05-23  8:10 ` Lars Schmidt [this message]
2025-05-23  8:10 ` [DistroKit] [PATCH 03/12] tf-a: k3 needs an additional compile argument Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 04/12] beagleplay: k3: barebox needs part of tf-a firmware Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 05/12] tf-a: unify handling of firmware parts for barebox Lars Schmidt
2025-05-23  8:49   ` Alexander Dahl
2025-05-23  8:10 ` [DistroKit] [PATCH 06/12] beagleplay: firmware-ti: initial package Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 07/12] beagleplay: barebox: first stage bootloader for Cortex-R5 Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 08/12] beagleplay: fipimage: add fip image for K3 Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 09/12] beagleplay: add full image including bootloaders and rootfs Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 10/12] beagleplay: add initial kernel configuration Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 11/12] beagleplay: barebox: update config for beagleplay Lars Schmidt
2025-05-23  8:10 ` [DistroKit] [PATCH 12/12] beagleplay: add initial platform config Lars Schmidt

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=20250523081049.1693633-3-l.schmidt@pengutronix.de \
    --to=l.schmidt@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