* [ptxdist] [PATCH tfa: New package]
@ 2020-02-07 12:17 avazquez.dev
2020-02-10 16:16 ` Ahmad Fatoum
0 siblings, 1 reply; 2+ messages in thread
From: avazquez.dev @ 2020-02-07 12:17 UTC (permalink / raw)
To: ptxdist; +Cc: Alejandro Vazquez
From: Alejandro Vazquez <avazquez.dev@gmail.com>
Trusted Firmware-A (TF-A) is a reference implementation of secure
world software for Arm A-Profile architectures.
Signed-off-by: Alejandro Vazquez <avazquez.dev@gmail.com>
---
platforms/tfa.in | 56 +++++++++++++++++++++++++++++++++++++
rules/tfa.make | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 140 insertions(+)
create mode 100644 platforms/tfa.in
create mode 100644 rules/tfa.make
diff --git a/platforms/tfa.in b/platforms/tfa.in
new file mode 100644
index 0000000..d81f734
--- /dev/null
+++ b/platforms/tfa.in
@@ -0,0 +1,56 @@
+## SECTION=bootloader
+
+menuconfig TFA
+ depends on (ARCH_ARM || ARCH_ARM64)
+ prompt "Trusted Firmware-A (TF-A) "
+ bool
+ help
+ Trusted Firmware-A (TF-A) is a reference implementation of secure
+ world software for Arm A-Profile architectures.
+
+if TFA
+
+choice
+ prompt "Major arch version"
+ default TFA_ARM_ARCH_MAJOR_7
+
+ config TFA_ARM_ARCH_MAJOR_7
+ bool
+ prompt "ARM v7"
+
+ config TFA_ARM_ARCH_MAJOR_8
+ bool
+ prompt "ARM v8"
+endchoice
+
+config TFA_ARCH32_SP
+ depends on ARCH_ARM
+ string
+ default "sp_min"
+ prompt "AArch32 Secure Payload"
+ help
+ The AArch32 Secure Payload component to be built as the
+ BL32 image
+
+config TFA_PLAT
+ string
+ prompt "Target platform"
+ help
+ Target plaform to build for.
+
+config TFA_ADDITIONAL_PARAMETERS
+ string
+ prompt "Additional parameters"
+ help
+ Additional parameters for the TF-A build
+ E.G. 'DEBUG=1 LOG_LEVEL=20'.
+
+config TFA_FIRMWARE_IMAGES
+ string
+ default "tf-a*.bin"
+ prompt "Binary boot images"
+ help
+ Names of generated image files that are installed in the
+ output images/ directory.
+
+endif
diff --git a/rules/tfa.make b/rules/tfa.make
new file mode 100644
index 0000000..56ae98c
--- /dev/null
+++ b/rules/tfa.make
@@ -0,0 +1,84 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Alejandro Vazquez <avazquez.dev@gmail.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_TFA) += tfa
+
+#
+# Paths and names
+#
+TFA_VERSION := 2.0
+TFA := arm-trusted-firmware-$(TFA_VERSION)
+TFA_MD5 := 21038abbf572c273fa87d296bcd5dad2
+TFA_SUFFIX := tar.gz
+TFA_URL := https://github.com/ARM-software/arm-trusted-firmware/archive/v$(TFA_VERSION).$(TFA_SUFFIX)
+TFA_DIR := $(BUILDDIR)/$(TFA)
+TFA_SOURCE := $(SRCDIR)/$(TFA).$(TFA_SUFFIX)
+TFA_DIR := $(BUILDDIR)/$(TFA)
+TFA_LICENSE := BSD-3-Clause
+TFA_LICENSE_FILES := \
+ file://license.rst;md5=e927e02bca647e14efd87e9e914b2443
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+TFA_CONF_TOOL := NO
+TFA_MAKE_ENV := CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE)
+
+ifdef PTXCONF_ARCH_ARM
+TFA_MAKE_OPT = ARCH=aarch32
+else
+TFA_MAKE_OPT = ARCH=aarch64
+endif
+
+ifdef PTXCONF_TFA_ARM_ARCH_MAJOR_7
+TFA_MAKE_OPT += ARM_ARCH_MAJOR=7
+else
+TFA_MAKE_OPT += ARM_ARCH_MAJOR=7
+endif
+
+ifdef PTXCONF_TFA_AARCH32_SP
+TFA_MAKE_OPT += AARCH32_SP=$(call remove_quotes, $(PTXCONF_TFA_AARCH32_SP))
+endif
+
+TFA_MAKE_OPT += \
+ PLAT=$(PTXCONF_TFA_PLAT) \
+ $(call remove_quotes, $(PTXCONF_TFA_ADDITIONAL_PARAMETERS))
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/tfa.install:
+ @$(call targetinfo)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/tfa.targetinstall:
+ @$(call targetinfo)
+ @$(foreach file, $(call remove_quotes, $(PTXCONF_TFA_FIRMWARE_IMAGES)), \
+ install -vD -m 0644 $(TFA_DIR)/build/$(PTXCONF_TFA_PLAT)/release/$(file) \
+ $(IMAGEDIR))
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/tfa.clean:
+ @$(call targetinfo)
+ @$(call clean_pkg, TFA)
+ @rm -f $(IMAGEDIR)/$(call remove_quotes, $(PTXCONF_TFA_FIRMWARE_IMAGES))
+
+# vim: syntax=make
--
1.9.1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ptxdist] [PATCH tfa: New package]
2020-02-07 12:17 [ptxdist] [PATCH tfa: New package] avazquez.dev
@ 2020-02-10 16:16 ` Ahmad Fatoum
0 siblings, 0 replies; 2+ messages in thread
From: Ahmad Fatoum @ 2020-02-10 16:16 UTC (permalink / raw)
To: ptxdist, avazquez.dev
Hello Alejandro,
On 2/7/20 1:17 PM, avazquez.dev@gmail.com wrote:
> From: Alejandro Vazquez <avazquez.dev@gmail.com>
>
> Trusted Firmware-A (TF-A) is a reference implementation of secure
> world software for Arm A-Profile architectures.
I'm using a TF-A rule locally as well, but it's a bit more general than yours.
I just sent it to the mailing list.
Could you take a look if it suffices for your use case?
Cheers
Ahmad
>
> Signed-off-by: Alejandro Vazquez <avazquez.dev@gmail.com>
> ---
> platforms/tfa.in | 56 +++++++++++++++++++++++++++++++++++++
> rules/tfa.make | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 140 insertions(+)
> create mode 100644 platforms/tfa.in
> create mode 100644 rules/tfa.make
>
> diff --git a/platforms/tfa.in b/platforms/tfa.in
> new file mode 100644
> index 0000000..d81f734
> --- /dev/null
> +++ b/platforms/tfa.in
> @@ -0,0 +1,56 @@
> +## SECTION=bootloader
> +
> +menuconfig TFA
> + depends on (ARCH_ARM || ARCH_ARM64)
> + prompt "Trusted Firmware-A (TF-A) "
> + bool
> + help
> + Trusted Firmware-A (TF-A) is a reference implementation of secure
> + world software for Arm A-Profile architectures.
> +
> +if TFA
> +
> +choice
> + prompt "Major arch version"
> + default TFA_ARM_ARCH_MAJOR_7
> +
> + config TFA_ARM_ARCH_MAJOR_7
> + bool
> + prompt "ARM v7"
> +
> + config TFA_ARM_ARCH_MAJOR_8
> + bool
> + prompt "ARM v8"
> +endchoice
> +
> +config TFA_ARCH32_SP
> + depends on ARCH_ARM
> + string
> + default "sp_min"
> + prompt "AArch32 Secure Payload"
> + help
> + The AArch32 Secure Payload component to be built as the
> + BL32 image
> +
> +config TFA_PLAT
> + string
> + prompt "Target platform"
> + help
> + Target plaform to build for.
> +
> +config TFA_ADDITIONAL_PARAMETERS
> + string
> + prompt "Additional parameters"
> + help
> + Additional parameters for the TF-A build
> + E.G. 'DEBUG=1 LOG_LEVEL=20'.
> +
> +config TFA_FIRMWARE_IMAGES
> + string
> + default "tf-a*.bin"
> + prompt "Binary boot images"
> + help
> + Names of generated image files that are installed in the
> + output images/ directory.
> +
> +endif
> diff --git a/rules/tfa.make b/rules/tfa.make
> new file mode 100644
> index 0000000..56ae98c
> --- /dev/null
> +++ b/rules/tfa.make
> @@ -0,0 +1,84 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2020 by Alejandro Vazquez <avazquez.dev@gmail.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_TFA) += tfa
> +
> +#
> +# Paths and names
> +#
> +TFA_VERSION := 2.0
> +TFA := arm-trusted-firmware-$(TFA_VERSION)
> +TFA_MD5 := 21038abbf572c273fa87d296bcd5dad2
> +TFA_SUFFIX := tar.gz
> +TFA_URL := https://github.com/ARM-software/arm-trusted-firmware/archive/v$(TFA_VERSION).$(TFA_SUFFIX)
> +TFA_DIR := $(BUILDDIR)/$(TFA)
> +TFA_SOURCE := $(SRCDIR)/$(TFA).$(TFA_SUFFIX)
> +TFA_DIR := $(BUILDDIR)/$(TFA)
> +TFA_LICENSE := BSD-3-Clause
> +TFA_LICENSE_FILES := \
> + file://license.rst;md5=e927e02bca647e14efd87e9e914b2443
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +TFA_CONF_TOOL := NO
> +TFA_MAKE_ENV := CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE)
> +
> +ifdef PTXCONF_ARCH_ARM
> +TFA_MAKE_OPT = ARCH=aarch32
> +else
> +TFA_MAKE_OPT = ARCH=aarch64
> +endif
> +
> +ifdef PTXCONF_TFA_ARM_ARCH_MAJOR_7
> +TFA_MAKE_OPT += ARM_ARCH_MAJOR=7
> +else
> +TFA_MAKE_OPT += ARM_ARCH_MAJOR=7
> +endif
> +
> +ifdef PTXCONF_TFA_AARCH32_SP
> +TFA_MAKE_OPT += AARCH32_SP=$(call remove_quotes, $(PTXCONF_TFA_AARCH32_SP))
> +endif
> +
> +TFA_MAKE_OPT += \
> + PLAT=$(PTXCONF_TFA_PLAT) \
> + $(call remove_quotes, $(PTXCONF_TFA_ADDITIONAL_PARAMETERS))
> +
> +# ----------------------------------------------------------------------------
> +# Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/tfa.install:
> + @$(call targetinfo)
> + @$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/tfa.targetinstall:
> + @$(call targetinfo)
> + @$(foreach file, $(call remove_quotes, $(PTXCONF_TFA_FIRMWARE_IMAGES)), \
> + install -vD -m 0644 $(TFA_DIR)/build/$(PTXCONF_TFA_PLAT)/release/$(file) \
> + $(IMAGEDIR))
> + @$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Clean
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/tfa.clean:
> + @$(call targetinfo)
> + @$(call clean_pkg, TFA)
> + @rm -f $(IMAGEDIR)/$(call remove_quotes, $(PTXCONF_TFA_FIRMWARE_IMAGES))
> +
> +# vim: syntax=make
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-10 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 12:17 [ptxdist] [PATCH tfa: New package] avazquez.dev
2020-02-10 16:16 ` Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox