summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2019-02-13 09:42:59 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-02-14 19:18:04 +0100
commit944acc24571c167cbd8b3f8b430fc3ff7e97581f (patch)
tree350a631efa4c2cf6a0b0f31c1f3953d20aa95127
parent0b4b9e2d2df12f54ab73c39e1dfc1bcaefd4c420 (diff)
downloadptxdist-944acc24571c167cbd8b3f8b430fc3ff7e97581f.tar.gz
ptxdist-944acc24571c167cbd8b3f8b430fc3ff7e97581f.tar.xz
optee: add the OP-TEE as new target package
Provide two KConfig files to allow inclusion of OP-TEE for userspace libraries and applications. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--platforms/optee.in40
-rw-r--r--rules/optee.in4
-rw-r--r--rules/optee.make97
3 files changed, 141 insertions, 0 deletions
diff --git a/platforms/optee.in b/platforms/optee.in
new file mode 100644
index 000000000..dc31f66c6
--- /dev/null
+++ b/platforms/optee.in
@@ -0,0 +1,40 @@
+## SECTION=bootloader
+
+menuconfig OPTEE
+ prompt "OP-TEE "
+ bool
+ depends on ARCH_ARM || ARCH_ARM64
+ depends on !ARCH_ARM64 || BROKEN
+ help
+ OP-TEE is an open source project which contains a full implementation
+ to make up a complete Trusted Execution Environment. The project has
+ roots in a proprietary solution, initially created by ST-Ericsson and
+ then owned and maintained by STMicroelectronics. In 2014, Linaro
+ started working with STMicroelectronics to transform the proprietary
+ TEE solution into an open source TEE solution instead.
+
+if OPTEE
+
+config OPTEE_PLATFORM
+ string
+ prompt "OP-TEE Platform"
+ help
+ Platform to use for OP-TEE.
+ i.e. imx for the NXP imx platform or vexpress for versatile express
+ platforms.
+
+config OPTEE_PLATFORM_FLAVOUR
+ string
+ prompt "OP-TEE Platform Flavour"
+ help
+ Platform Flavour for the selected platform, i.e. mx6qsabresd for the
+ imx platform.
+
+config OPTEE_CFG
+ string
+ prompt "OP-TEE CFG Flags"
+ help
+ Refer to the following file for the CFG_FLAGS:
+ https://github.com/OP-TEE/optee_os/blob/master/mk/config.mk
+
+endif
diff --git a/rules/optee.in b/rules/optee.in
new file mode 100644
index 000000000..49bc6c93f
--- /dev/null
+++ b/rules/optee.in
@@ -0,0 +1,4 @@
+## SECTION=security
+
+config OPTEE
+ tristate
diff --git a/rules/optee.make b/rules/optee.make
new file mode 100644
index 000000000..9acc524f0
--- /dev/null
+++ b/rules/optee.make
@@ -0,0 +1,97 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Rouven Czerwinski <rouven@czerwinskis.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_OPTEE) += optee
+
+#
+# Paths and names
+#
+OPTEE_VERSION := 3.4.0
+OPTEE_MD5 := d0644c0f57124f183034e5fd7b26513e
+OPTEE := optee-$(OPTEE_VERSION)
+OPTEE_SUFFIX := tar.gz
+OPTEE_URL := https://github.com/OP-TEE/optee_os/archive/$(OPTEE_VERSION).$(OPTEE_SUFFIX)
+OPTEE_SOURCE := $(SRCDIR)/$(OPTEE).$(OPTEE_SUFFIX)
+OPTEE_DIR := $(BUILDDIR)/$(OPTEE)
+OPTEE_LICENSE := BSD-2-Clause AND BSD-3-Clause
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+OPTEE_WRAPPER_BLACKLIST := \
+ TARGET_HARDEN_FORTIFY \
+ TARGET_HARDEN_RELRO \
+ TARGET_HARDEN_BINDNOW \
+ TARGET_HARDEN_PIE \
+ TARGET_DEBUG \
+ TARGET_BUILD_ID
+
+OPTEE_CONF_TOOL := NO
+OPTEE_MAKE_ENV += \
+ PATH=$(CROSS_PATH) \
+ CROSS_COMPILE=$(COMPILER_PREFIX) \
+ $(call ptx/ifdef,PTXCONF_ARCH_ARM64,CFG_ARM64_core=y) \
+ PLATFORM=$(call remove_quotes,$(PTXCONF_OPTEE_PLATFORM))-$(call remove_quotes,$(PTXCONF_OPTEE_PLATFORM_FLAVOUR)) \
+ $(call remove_quotes,$(PTXCONF_OPTEE_CFG))
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+OPTEE_LIB_DIR := \
+ $(call ptx/ifdef,PTXCONF_ARCH_ARM64,export-ta_arm64,export-ta_arm32)
+
+OPTEE_OUT_DIR := \
+ $(OPTEE_DIR)/out/arm-plat-$(PTXCONF_OPTEE_PLATFORM)
+
+$(STATEDIR)/optee.install:
+ @$(call targetinfo)
+
+ @$(call install_init, optee)
+ @install -vd -m755 $(OPTEE_PKGDIR)/usr/lib/optee-os
+ @cp -vr $(OPTEE_OUT_DIR)/$(OPTEE_LIB_DIR)/* $(OPTEE_PKGDIR)/usr/lib/optee-os
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+OPTEE_BINARIES := \
+ tee.bin \
+ tee-header_v2.bin \
+ tee-pager_v2.bin \
+ tee-pageable_v2.bin \
+ tee.elf
+
+$(STATEDIR)/optee.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, optee)
+ @$(foreach binary, $(OPTEE_BINARIES), \
+ install -vD -m644 $(OPTEE_OUT_DIR)/core/$(binary) \
+ $(IMAGEDIR)/$(binary)$(ptx/nl))
+
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/optee.clean:
+ @$(call targetinfo)
+ @rm -f $(addprefix $(IMAGEDIR)/, $(OPTEE_BINARIES))
+ @$(call clean_pkg, OPTEE)
+
+# vim: syntax=make