Skip to contentSkip to conversation

boot/optee-os: OP-TEE secure world

PATCH New Etienne Carriere 4 participants 31 messages Nov 22, 2018 – Jan 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
 boot/Config.in                                     |   1 +
 .../3.3.0/0001-move-python-to-python3.patch        |  26 ++++++
 boot/optee-os/Config.in                            | 102 ++++++++++++++++++++
 boot/optee-os/optee-os.hash                        |   4 +
 boot/optee-os/optee-os.mk                          | 103 +++++++++++++++++++++
 5 files changed, 236 insertions(+)
 create mode 100644 boot/optee-os/3.3.0/0001-move-python-to-python3.patch
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.hash
 create mode 100644 boot/optee-os/optee-os.mk
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/3.3.0/0001-move-python-to-python3.patch new file +26 -0
new file mode 100644
index 0000000..b0ed5b5
@@ -0,0 +1,26 @@
+move python scripts to pyhton3
+
+Use python3 for scripts depending on module Crypto.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa36..0b03d62 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479..348b40a 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
boot/optee-os/Config.in new file +102 -0

102 lines not on this page · raw message

boot/optee-os/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..f68d72f
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 f0c9572d3a341ea37bb8e89cfd511e96d6ca3b2b714b536564e8fedb93b0f44a  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/optee-os.mk new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/5 optee-client: new package

OP-TEE client API library and supplicant daemon from the OP-TEE project.

The package is added to the Security menu of BR configuration.

---
 package/Config.in                      |  1 +
 package/optee-client/Config.in         | 62 ++++++++++++++++++++++++++++++++++
 package/optee-client/S30optee          | 26 ++++++++++++++
 package/optee-client/optee-client.hash |  4 +++
 package/optee-client/optee-client.mk   | 31 +++++++++++++++++
 5 files changed, 124 insertions(+)
 create mode 100644 package/optee-client/Config.in
 create mode 100644 package/optee-client/S30optee
 create mode 100644 package/optee-client/optee-client.hash
 create mode 100644 package/optee-client/optee-client.mk
package/Config.in +1 -0
index b60e770..8c3b1bf 100644
@@ -2047,6 +2047,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-client/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-client/Config.in new file +62 -0

62 lines not on this page · raw message

package/optee-client/S30optee new file +26 -0
new file mode 100644
index 0000000..c893243
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# /etc/init.d/optee
+#
+# Start/stop tee-supplicant (OP-TEE normal world daemon)
+#
+case "$1" in
+    start)
+	if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
+		echo "Starting tee-supplicant..."
+		/usr/sbin/tee-supplicant &
+		exit 0
+	else
+		echo "tee-supplicant or TEE device not found"
+		exit 1
+	fi
+
+        ;;
+    stop)
+	killall tee-supplicant
+	;;
+    status)
+	cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not "
+	echo "tee-supplicant is ${not}active"
+	;;
+esac
package/optee-client/optee-client.hash new file +4 -0
new file mode 100644
index 0000000..ed7bf4e
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_client/archive/3.3.0.tar.gz
+sha256 63af1567fdcdbe28b45be274266a89aa81bef3d0fd8ec5a6eb680046a92e1177  optee-client-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
package/optee-client/optee-client.mk new file +31 -0
new file mode 100644
index 0000000..e856ca5
@@ -0,0 +1,31 @@
+################################################################################
+#
+# optee-client
+#
+################################################################################
+
+OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION))
+OPTEE_CLIENT_LICENSE = BSD-3-Clause
+OPTEE_CLIENT_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT),y)
+OPTEE_CLIENT_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL))
+OPTEE_CLIENT_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE)
+else
+OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION))
+endif
+
+define OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT
+	$(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \
+		$(TARGET_DIR)/etc/init.d/S30optee
+endef
+
+define OPTEE_CLIENT_INSTALL_INIT_SYSV
+	$(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT)
+endef
+
+OPTEE_CLIENT_INSTALL_STAGING = YES
+OPTEE_CLIENT_INSTALL_IMAGES = YES
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/5 optee-client: new package

Quoted 168 lines · Etienne Carriere

OP-TEE client API library and supplicant daemon from the OP-TEE project.

The package is added to the Security menu of BR configuration.

---
 package/Config.in                      |  1 +
 package/optee-client/Config.in         | 62 ++++++++++++++++++++++++++++++++++
 package/optee-client/S30optee          | 26 ++++++++++++++
 package/optee-client/optee-client.hash |  4 +++
 package/optee-client/optee-client.mk   | 31 +++++++++++++++++
 5 files changed, 124 insertions(+)
 create mode 100644 package/optee-client/Config.in
 create mode 100644 package/optee-client/S30optee
 create mode 100644 package/optee-client/optee-client.hash
 create mode 100644 package/optee-client/optee-client.mk
package/Config.in +1 -0
index b60e770..8c3b1bf 100644
@@ -2047,6 +2047,7 @@ endmenu
 
 menu "Security"
        source "package/checkpolicy/Config.in"
+       source "package/optee-client/Config.in"
        source "package/paxtest/Config.in"
        source "package/policycoreutils/Config.in"
        source "package/refpolicy/Config.in"
package/optee-client/Config.in new file +62 -0
new file mode 100644
index 0000000..c3f28c1
@@ -0,0 +1,62 @@
+config BR2_PACKAGE_OPTEE_CLIENT
+       bool "Embed OP-TEE client"
+       help
+         Enable the OP-TEE client package that brings non-secure
+         client application resources for OP-TEE support. OP-TEE
+         client is a component delivered by the OP-TEE project.
+
+         https://github.com/OP-TEE/optee_client
+
+         The client API library allows application to invoke
+         trusted applications hosted in the OP-TEE OS secure world.
+         The supplicant provides services hosted by the non-secure
+         world and invoked by the secure world.
+
+if BR2_PACKAGE_OPTEE_CLIENT
+
+choice
+       prompt "OP-TEE client version"
+       default BR2_PACKAGE_OPTEE_CLIENT_LATEST
+       help
+         Select the version of OP-TEE client you want to use
+
+config BR2_PACKAGE_OPTEE_CLIENT_LATEST
+       bool "sync with latest registered release tag"
+       help
+         Sync on latest release tag. This currently fetches the
+         latest registered release tag from the OP-TEE official
+         Git repository.
+
+config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT
+       bool "sync with a specific Git"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_PACKAGE_OPTEE_CLIENT_VERSION
+       string
+       default "3.3.0"         if BR2_PACKAGE_OPTEE_CLIENT_LATEST
+       default BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_VERSION \
+                               if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT
+       help
+         Reference in the target Git repository to sync with.
+
+if BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT
+
+config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL
+       string "Git repository site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_VERSION
+       string "target reference to pull in the Git repository"
+       help
+         Package version reference to sync with. As source file
+         reference is a Git repository, the version reference can
+         be any Git reference as a tag or a sha1.
+
+endif
+
+endif #BR2_PACKAGE_OPTEE_CLIENT
package/optee-client/S30optee new file +26 -0
new file mode 100644
index 0000000..c893243
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# /etc/init.d/optee
+#
+# Start/stop tee-supplicant (OP-TEE normal world daemon)
+#
+case "$1" in
+    start)
+       if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
+               echo "Starting tee-supplicant..."
+               /usr/sbin/tee-supplicant &
+               exit 0
+       else
+               echo "tee-supplicant or TEE device not found"
+               exit 1
+       fi
+
+        ;;
+    stop)
+       killall tee-supplicant
+       ;;
+    status)
+       cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not "
+       echo "tee-supplicant is ${not}active"
+       ;;
+esac
package/optee-client/optee-client.hash new file +4 -0
new file mode 100644
index 0000000..ed7bf4e
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_client/archive/3.3.0.tar.gz
+sha256 63af1567fdcdbe28b45be274266a89aa81bef3d0fd8ec5a6eb680046a92e1177  optee-client-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
package/optee-client/optee-client.mk new file +21 -0
new file mode 100644
index 0000000..e856ca5
@@ -0,0 +1,31 @@
+################################################################################
+#
+# optee-client
+#
+################################################################################
+
+OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION))
+OPTEE_CLIENT_LICENSE = BSD-3-Clause
+OPTEE_CLIENT_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT),y)
+OPTEE_CLIENT_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL))
+OPTEE_CLIENT_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE)
+else
+OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION))
+endif
+
+define OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT
+       $(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \
+               $(TARGET_DIR)/etc/init.d/S30optee

package/optee-client/optee-client.mk line 31

Quoted 10 lines
package/optee-client/optee-client.mk new file +10 -0
+endef
+
+define OPTEE_CLIENT_INSTALL_INIT_SYSV
+       $(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT)
+endef
+
+OPTEE_CLIENT_INSTALL_STAGING = YES
+OPTEE_CLIENT_INSTALL_IMAGES = YES
+
+$(eval $(cmake-package))
#3 lore raw

PATCH v2 2/5 optee-client: new package

In reply to Etienne Carriere

OP-TEE client API library and supplicant daemon from the OP-TEE project.

The package is added to the Security menu of BR configuration.

---
Changes v1 -> v2:
- Add option BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION to ensure OP-TEE client version is synced with OP-TEE OS version when the later if enabled.
- Remove useless OPTEE_CLIENT_INSTALL_IMAGE=YES.

---
 package/Config.in                      |  1 +
 package/optee-client/Config.in         | 73 ++++++++++++++++++++++++++++++++++
 package/optee-client/S30optee          | 26 ++++++++++++
 package/optee-client/optee-client.hash |  4 ++
 package/optee-client/optee-client.mk   | 30 ++++++++++++++
 5 files changed, 134 insertions(+)
 create mode 100644 package/optee-client/Config.in
 create mode 100644 package/optee-client/S30optee
 create mode 100644 package/optee-client/optee-client.hash
 create mode 100644 package/optee-client/optee-client.mk
package/Config.in +1 -0
index b60e770..8c3b1bf 100644
@@ -2047,6 +2047,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-client/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-client/Config.in new file +73 -0

73 lines not on this page · raw message

package/optee-client/S30optee new file +26 -0
new file mode 100644
index 0000000..c893243
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# /etc/init.d/optee
+#
+# Start/stop tee-supplicant (OP-TEE normal world daemon)
+#
+case "$1" in
+    start)
+	if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
+		echo "Starting tee-supplicant..."
+		/usr/sbin/tee-supplicant &
+		exit 0
+	else
+		echo "tee-supplicant or TEE device not found"
+		exit 1
+	fi
+
+        ;;
+    stop)
+	killall tee-supplicant
+	;;
+    status)
+	cat /dev/teepriv0 2>&1 | grep -q "Device or resource busy" || not="not "
+	echo "tee-supplicant is ${not}active"
+	;;
+esac
package/optee-client/optee-client.hash new file +4 -0
new file mode 100644
index 0000000..ed7bf4e
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_client/archive/3.3.0.tar.gz
+sha256 63af1567fdcdbe28b45be274266a89aa81bef3d0fd8ec5a6eb680046a92e1177  optee-client-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
package/optee-client/optee-client.mk new file +30 -0
new file mode 100644
index 0000000..ccc5d12
@@ -0,0 +1,30 @@
+################################################################################
+#
+# optee-client
+#
+################################################################################
+
+OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION))
+OPTEE_CLIENT_LICENSE = BSD-3-Clause
+OPTEE_CLIENT_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT),y)
+OPTEE_CLIENT_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL))
+OPTEE_CLIENT_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE)
+else
+OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION))
+endif
+
+define OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT
+	$(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \
+		$(TARGET_DIR)/etc/init.d/S30optee
+endef
+
+define OPTEE_CLIENT_INSTALL_INIT_SYSV
+	$(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT)
+endef
+
+OPTEE_CLIENT_INSTALL_STAGING = YES
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#4 lore raw

PATCH 3/5 optee-benchmark: new package

In reply to Etienne Carriere

OP-TEE performance benchmark tools for the OP-TEE project.

This packages generates embedded Linux based OS materials used to retrieve execution timing information on invocation of the OP-TEE secure services.

It is added next to the OP-TEE client package in BR configuration.

---
 package/Config.in                            |  1 +
 package/optee-benchmark/Config.in            | 56 ++++++++++++++++++++++++++++
 package/optee-benchmark/optee-benchmark.hash |  2 +
 package/optee-benchmark/optee-benchmark.mk   | 29 ++++++++++++++
 4 files changed, 88 insertions(+)
 create mode 100644 package/optee-benchmark/Config.in
 create mode 100644 package/optee-benchmark/optee-benchmark.hash
 create mode 100644 package/optee-benchmark/optee-benchmark.mk
package/Config.in +1 -0
index 8c3b1bf..38200af 100644
@@ -2047,6 +2047,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
package/optee-benchmark/Config.in new file +56 -0

56 lines not on this page · raw message

package/optee-benchmark/optee-benchmark.hash new file +2 -0
new file mode 100644
index 0000000..d93c26c
@@ -0,0 +1,2 @@
+# From https://github.com/linaro-swg/optee_benchmark/archive/3.3.0.tar.gz
+sha256 bfba3749ac8b37628550696f0625452ae8aef060eff5b3b1c4283a5dad8a3383 optee-benchmark-3.3.0.tar.gz
package/optee-benchmark/optee-benchmark.mk new file +29 -0
new file mode 100644
index 0000000..8c450b6
@@ -0,0 +1,29 @@
+################################################################################
+#
+# optee-benchmarch
+#
+################################################################################
+
+OPTEE_BENCHMARK_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_VERSION))
+OPTEE_BENCHMARK_LICENSE = BSD-2-Clause
+
+OPTEE_BENCHMARK_DEPENDENCIES = optee-client libyaml
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT),y)
+OPTEE_BENCHMARK_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_URL))
+OPTEE_BENCHMARK_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_BENCHMARK_SOURCE)
+endif
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_GIT_REFERENCE),y)
+OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION))
+endif
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_LATEST),y)
+OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION))
+endif
+
+OPTEE_BENCHMARK_INSTALL_STAGING = YES
+OPTEE_BENCHMARK_INSTALL_IMAGES = YES
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#5 lore raw

PATCH v2 3/5 optee-benchmark: new package

OP-TEE performance benchmark tools for the OP-TEE project.

This packages generates embedded Linux based OS materials used to retrieve execution timing information on invocation of the OP-TEE secure services.

It is added next to the OP-TEE client package in BR configuration.

---
Changes v1 -> v2:
- Add dependency on OP-TEE client.
- Add option BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION to ensure OP-TEE benchmark version is synced with OP-TEE client version.
- Remove useless OPTEE_BENCHMARK_INSTALL_STAGING and OPTEE_BENCHMARK_INSTALL_IMAGES.
- Remove unused BR2_PACKAGE_OPTEE_BENCHMARK_GIT_REFERENCE.
- Remove useless _INSTALL_STAGING/_INSTALL_IMAGES=YES.

---
 package/Config.in                            |  1 +
 package/optee-benchmark/Config.in            | 69 ++++++++++++++++++++++++++++
 package/optee-benchmark/optee-benchmark.hash |  2 +
 package/optee-benchmark/optee-benchmark.mk   | 22 +++++++++
 4 files changed, 94 insertions(+)
 create mode 100644 package/optee-benchmark/Config.in
 create mode 100644 package/optee-benchmark/optee-benchmark.hash
 create mode 100644 package/optee-benchmark/optee-benchmark.mk
package/Config.in +1 -0
index 8c3b1bf..38200af 100644
@@ -2047,6 +2047,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
package/optee-benchmark/Config.in new file +69 -0

69 lines not on this page · raw message

package/optee-benchmark/optee-benchmark.hash new file +2 -0
new file mode 100644
index 0000000..d93c26c
@@ -0,0 +1,2 @@
+# From https://github.com/linaro-swg/optee_benchmark/archive/3.3.0.tar.gz
+sha256 bfba3749ac8b37628550696f0625452ae8aef060eff5b3b1c4283a5dad8a3383 optee-benchmark-3.3.0.tar.gz
package/optee-benchmark/optee-benchmark.mk new file +22 -0
new file mode 100644
index 0000000..8eef0f6
@@ -0,0 +1,22 @@
+################################################################################
+#
+# optee-benchmarch
+#
+################################################################################
+
+OPTEE_BENCHMARK_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_VERSION))
+OPTEE_BENCHMARK_LICENSE = BSD-2-Clause
+
+OPTEE_BENCHMARK_DEPENDENCIES = optee-client libyaml
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_LATEST),y)
+OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION))
+endif
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT),y)
+OPTEE_BENCHMARK_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_URL))
+OPTEE_BENCHMARK_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_BENCHMARK_SOURCE)
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#6 lore raw

PATCH 4/5 optee-examples: new package

In reply to Etienne Carriere

This package generates embedded Linux based OS userland client applications and OP-TEE OS trusted applications all embedded in the file system. These applications shows how to use the APIs OP-TEE OS is based on, both in the non secure and secure worlds.

Package is added next to the OP-TEE client package in the BR package configuration.

---
 package/Config.in                          |  1 +
 package/optee-examples/Config.in           | 57 ++++++++++++++++++++++++++++++
 package/optee-examples/optee-examples.hash |  4 +++
 package/optee-examples/optee-examples.mk   | 48 +++++++++++++++++++++++++
 4 files changed, 110 insertions(+)
 create mode 100644 package/optee-examples/Config.in
 create mode 100644 package/optee-examples/optee-examples.hash
 create mode 100644 package/optee-examples/optee-examples.mk
package/Config.in +1 -0
index 38200af..35870d0 100644
@@ -2049,6 +2049,7 @@ menu "Security"
 	source "package/checkpolicy/Config.in"
 	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
+	source "package/optee-examples/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-examples/Config.in new file +57 -0

57 lines not on this page · raw message

package/optee-examples/optee-examples.hash new file +4 -0
new file mode 100644
index 0000000..77b7466
@@ -0,0 +1,4 @@
+# From https://github.com/linaro-swg/optee_examples/archive/3.3.0.tar.gz
+sha256 504642edd1510562dcc213637d8869190dd581986daf938ed3e85088830e0ef9  optee-examples-3.3.0.tar.gz
+# Locally computed
+sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9  LICENSE
package/optee-examples/optee-examples.mk new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
1.9.1
#7 lore raw

PATCH 4/5 optee-examples: new package

Quoted 149 lines · Etienne Carriere

This package generates embedded Linux based OS userland client applications and OP-TEE OS trusted applications all embedded in the file system. These applications shows how to use the APIs OP-TEE OS is based on, both in the non secure and secure worlds.

Package is added next to the OP-TEE client package in the BR package configuration.

---
 package/Config.in                          |  1 +
 package/optee-examples/Config.in           | 57 ++++++++++++++++++++++++++++++
 package/optee-examples/optee-examples.hash |  4 +++
 package/optee-examples/optee-examples.mk   | 48 +++++++++++++++++++++++++
 4 files changed, 110 insertions(+)
 create mode 100644 package/optee-examples/Config.in
 create mode 100644 package/optee-examples/optee-examples.hash
 create mode 100644 package/optee-examples/optee-examples.mk
package/Config.in +1 -0
index 38200af..35870d0 100644
@@ -2049,6 +2049,7 @@ menu "Security"
        source "package/checkpolicy/Config.in"
        source "package/optee-benchmark/Config.in"
        source "package/optee-client/Config.in"
+       source "package/optee-examples/Config.in"
        source "package/paxtest/Config.in"
        source "package/policycoreutils/Config.in"
        source "package/refpolicy/Config.in"
package/optee-examples/Config.in new file +57 -0
new file mode 100644
index 0000000..1a19791
@@ -0,0 +1,57 @@
+config BR2_PACKAGE_OPTEE_EXAMPLES
+       bool "Embed OP-TEE examples"
+       depends on BR2_aarch64 || BR2_arm
+       help
+         Enable the OP-TEE examples package that brings examples of
+         implementation of OP-TEE non-secure client applications and
+         secure trusted applications. OP-TEE examples is a
+         component delivered by the OP-TEE project.
+
+if BR2_PACKAGE_OPTEE_EXAMPLES
+
+choice
+       prompt "OP-TEE exmaples version"
+       default BR2_PACKAGE_OPTEE_EXAMPLES_LATEST
+       help
+         Select the version of OP-TEE exmaples you want to use
+
+config BR2_PACKAGE_OPTEE_EXAMPLES_LATEST
+       bool "sync with latest release tag"
+       help
+         Sync on latest release tag. This currently fetches the
+         latest registered release tag from the OP-TEE official
+         Git repository.
+
+config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT
+       bool "sync with a specific Git"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_PACKAGE_OPTEE_EXAMPLES_VERSION
+       string
+       default "3.3.0"         if BR2_PACKAGE_OPTEE_EXAMPLES_LATEST
+       default BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_VERSION \
+                               if BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT
+       help
+         Reference in the target Git repository to sync with.
+
+if BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT
+
+config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_URL
+       string "Git repository site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_VERSION
+       string "target reference to pull in the Git repository"
+       help
+         Package version reference to sync with. As source file
+         reference is a Git repository, the version reference can
+         be any Git reference as a tag or a sha1.
+
+endif
+
+endif #BR2_PACKAGE_OPTEE_EXAMPLES
package/optee-examples/optee-examples.hash new file +4 -0
new file mode 100644
index 0000000..77b7466
@@ -0,0 +1,4 @@
+# From https://github.com/linaro-swg/optee_examples/archive/3.3.0.tar.gz
+sha256 504642edd1510562dcc213637d8869190dd581986daf938ed3e85088830e0ef9  optee-examples-3.3.0.tar.gz
+# Locally computed
+sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9  LICENSE
package/optee-examples/optee-examples.mk new file +38 -0
new file mode 100644
index 0000000..2edcc45
@@ -0,0 +1,48 @@
+################################################################################
+#
+# optee-examples
+#
+################################################################################
+
+OPTEE_EXAMPLES_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_VERSION))
+OPTEE_EXAMPLES_LICENSE = BSD-2-Clause
+OPTEE_EXAMPLES_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_GIT),y)
+OPTEE_EXAMPLES_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_EXAMPLES_CUSTOM_REPO_URL))
+OPTEE_EXAMPLES_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_EXAMPLES_SOURCE)
+else
+OPTEE_EXAMPLES_SITE = $(call github,linaro-swg,optee_examples,$(OPTEE_EXAMPLES_VERSION))
+endif
+
+OPTEE_EXAMPLES_DEPENDENCIES = optee-client optee-os
+OPTEE_EXAMPLES_INSTALL_STAGING = YES
+
+ifeq ($(BR2_aarch64),y)
+OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64
+endif
+ifeq ($(BR2_arm),y)
+OPTEE_EXAMPLES_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32
+endif
+
+define OPTEE_EXAMPLES_BUILD_TAS
+       @$(foreach f,$(wildcard $(@D)/*/ta/Makefile), \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
+                       O=out TA_DEV_KIT_DIR=$(OPTEE_EXAMPLES_SDK) \
+                       -C $(dir $f) all &&) true
+endef
+
+define OPTEE_EXAMPLES_INSTALL_TAS
+       @$(foreach f,$(wildcard $(@D)/*/ta/out/*.ta), \

package/optee-examples/optee-examples.mk line 48

Quoted 10 lines
package/optee-examples/optee-examples.mk new file +10 -0
+               mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
+               $(INSTALL) -v -p --mode=444 \
+                       --target-directory=$(TARGET_DIR)/lib/optee_armtz $f \
+                       &&) true
+endef
+
+OPTEE_EXAMPLES_POST_BUILD_HOOKS += OPTEE_EXAMPLES_BUILD_TAS
+OPTEE_EXAMPLES_POST_INSTALL_TARGET_HOOKS += OPTEE_EXAMPLES_INSTALL_TAS
+
+$(eval $(cmake-package))
#8 lore raw

PATCH v2 4/5 optee-examples: new package

In reply to Etienne Carriere

This package generates embedded Linux based OS userland client applications and OP-TEE OS trusted applications all embedded in the file system. These applications shows how to use the APIs OP-TEE OS is based on, both in the non secure and secure worlds.

Package is added next to the OP-TEE client package in the BR package configuration.

---
Changes v1 -> v2:
- Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines.
- Select OP-TEE client and add dependency on OP-TEE OS.
- Add option BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION to ensure OP-TEE examples version is synced with OP-TEE OS version.
- Do not force output build directory, rely on native path: out/.
- Replace if/endif with depends on in Config.in.
- Remove useless OPTEE_EXAMPLES_INSTALL_STAGING=YES.
- Add package official URL in Config.in package description.

---
 package/Config.in                          |  1 +
 package/optee-examples/Config.in           | 68 ++++++++++++++++++++++++++++++
 package/optee-examples/optee-examples.hash |  4 ++
 package/optee-examples/optee-examples.mk   | 47 +++++++++++++++++++++
 4 files changed, 120 insertions(+)
 create mode 100644 package/optee-examples/Config.in
 create mode 100644 package/optee-examples/optee-examples.hash
 create mode 100644 package/optee-examples/optee-examples.mk
package/Config.in +1 -0
index 38200af..35870d0 100644
@@ -2049,6 +2049,7 @@ menu "Security"
 	source "package/checkpolicy/Config.in"
 	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
+	source "package/optee-examples/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-examples/Config.in new file +68 -0

68 lines not on this page · raw message

package/optee-examples/optee-examples.hash new file +4 -0
new file mode 100644
index 0000000..77b7466
@@ -0,0 +1,4 @@
+# From https://github.com/linaro-swg/optee_examples/archive/3.3.0.tar.gz
+sha256 504642edd1510562dcc213637d8869190dd581986daf938ed3e85088830e0ef9  optee-examples-3.3.0.tar.gz
+# Locally computed
+sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9  LICENSE
package/optee-examples/optee-examples.mk new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

PATCH 5/5 optee-test: new package

In reply to Etienne Carriere

OP-TEE test package provide test materials as part of the OP-TEE project helping platforms to verify their OP-TEE components against a set of regression and performance tests.

Package is added in the BR package configuration next to the OP-TEE client package.

---
 package/Config.in                                  |  1 +
 .../optee-test/3.3.0/0001-cmake-rely-on-C.patch    | 32 +++++++++++
 package/optee-test/Config.in                       | 64 ++++++++++++++++++++++
 package/optee-test/optee-test.hash                 |  4 ++
 package/optee-test/optee-test.mk                   | 49 +++++++++++++++++
 5 files changed, 150 insertions(+)
 create mode 100644 package/optee-test/3.3.0/0001-cmake-rely-on-C.patch
 create mode 100644 package/optee-test/Config.in
 create mode 100644 package/optee-test/optee-test.hash
 create mode 100644 package/optee-test/optee-test.mk
package/Config.in +1 -0
index 35870d0..ff53a75 100644
@@ -2050,6 +2050,7 @@ menu "Security"
 	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/optee-examples/Config.in"
+	source "package/optee-test/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-test/3.3.0/0001-cmake-rely-on-C.patch new file +32 -0
new file mode 100644
index 0000000..ea7b966
@@ -0,0 +1,32 @@
+cmake: component rely on C support
+
+Without specifing optee_client source expects only C source file
+support cmake may attempt to look for resources as g++. When
+building with environments that do not provide such tools as when
+building from native buildroot ofr a qemu target, optee_client
+fails to build. This change ensure a minimal C support allows to
+build optee_client with cmake.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0290205..a3fd269 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ cmake_minimum_required (VERSION 3.2)
++project (optee_test C)
+ 
+ # Default cross compile settings
+ set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
+diff --git a/ta/CMakeLists.txt b/ta/CMakeLists.txt
+index 22d7727..795237e 100644
+--- a/ta/CMakeLists.txt
++++ b/ta/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-project (xtest-ta-headers)
++project (xtest-ta-headers C)
+ 
+ add_library(${PROJECT_NAME} INTERFACE)
+ 
package/optee-test/Config.in new file +64 -0

64 lines not on this page · raw message

package/optee-test/optee-test.hash new file +4 -0
new file mode 100644
index 0000000..0da2212
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 9651d5db0d28856e45d6bc25ce603bfcf641435bd3264d95b449f093665c8521  optee-test-3.3.0.tar.gz
+# Locally computed
+sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7  LICENSE.md
package/optee-test/optee-test.mk new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
1.9.1
#10 lore raw

PATCH 5/5 optee-test: new package

Quoted 5 lines

From: "Etienne Carriere" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "etienne carriere" <[email protected]>
Sent: Quinta-feira, 22 de novembro de 2018 13:22:57
Subject: [Buildroot] [PATCH 5/5] optee-test: new package

[...]

Quoted 9 lines
package/optee-test/Config.in new file +6 -0
@@ -0,0 +1,64 @@
+config BR2_PACKAGE_OPTEE_TEST
+	bool "optee_test"
+	depends on BR2_aarch64 || BR2_arm
+	help
+	  This build option enables OP-TEE test package from the
+	  OP-TEE project. It helps platforms to verify the OP-TEE

package/optee-test/Config.in line 16

Quoted 10 lines
package/optee-test/Config.in new file +10 -0
+	  installation against a set of regression and performance
+	  tests.
+
+	  The package generates userspace test applications and
+	  data files for the Linux userland. It also generates
+	  OP-TEE trusted applications embedded in the target
+	  directory /lib/optee-armtz. These are loaded into the
+	  secure world at runtime.
+
+	  http://github.org/OP-TEE/optee_test

Must be https://github.com/OP-TEE/optee_test

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#11 lore raw

PATCH 5/5 optee-test: new package

Quoted 21 lines · Carlos Santos
Quoted 6 lines

From: "Etienne Carriere" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "etienne carriere" <[email protected]>
Sent: Quinta-feira, 22 de novembro de 2018 13:22:57
Subject: [Buildroot] [PATCH 5/5] optee-test: new package

[...]

Quoted 13 lines
package/optee-test/Config.in new file +10 -0
@@ -0,0 +1,64 @@
+config BR2_PACKAGE_OPTEE_TEST
+     bool "optee_test"
+     depends on BR2_aarch64 || BR2_arm
+     help
+       This build option enables OP-TEE test package from the
+       OP-TEE project. It helps platforms to verify the OP-TEE
+       installation against a set of regression and performance
+       tests.
+
+       The package generates userspace test applications and
Quoted 8 lines

package/optee-test/Config.in line 16

Quoted 6 lines
package/optee-test/Config.in new file +6 -0
+       data files for the Linux userland. It also generates
+       OP-TEE trusted applications embedded in the target
+       directory /lib/optee-armtz. These are loaded into the
+       secure world at runtime.
+
+       http://github.org/OP-TEE/optee_test

Must be https://github.com/OP-TEE/optee_test

Hello Carlos,

Yes, thanks.

regards,
etienne

Quoted 5 lines

--
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty that only the ignorant can have.? ? Epitaph of a volunteer

#12 lore raw

PATCH 5/5 optee-test: new package

In reply to Etienne Carriere
Quoted 196 lines · Etienne Carriere

OP-TEE test package provide test materials as part of the OP-TEE project helping platforms to verify their OP-TEE components against a set of regression and performance tests.

Package is added in the BR package configuration next to the OP-TEE client package.

---
 package/Config.in                                  |  1 +
 .../optee-test/3.3.0/0001-cmake-rely-on-C.patch    | 32 +++++++++++
 package/optee-test/Config.in                       | 64 ++++++++++++++++++++++
 package/optee-test/optee-test.hash                 |  4 ++
 package/optee-test/optee-test.mk                   | 49 +++++++++++++++++
 5 files changed, 150 insertions(+)
 create mode 100644 package/optee-test/3.3.0/0001-cmake-rely-on-C.patch
 create mode 100644 package/optee-test/Config.in
 create mode 100644 package/optee-test/optee-test.hash
 create mode 100644 package/optee-test/optee-test.mk
package/Config.in +1 -0
index 35870d0..ff53a75 100644
@@ -2050,6 +2050,7 @@ menu "Security"
        source "package/optee-benchmark/Config.in"
        source "package/optee-client/Config.in"
        source "package/optee-examples/Config.in"
+       source "package/optee-test/Config.in"
        source "package/paxtest/Config.in"
        source "package/policycoreutils/Config.in"
        source "package/refpolicy/Config.in"
package/optee-test/3.3.0/0001-cmake-rely-on-C.patch new file +32 -0
new file mode 100644
index 0000000..ea7b966
@@ -0,0 +1,32 @@
+cmake: component rely on C support
+
+Without specifing optee_client source expects only C source file
+support cmake may attempt to look for resources as g++. When
+building with environments that do not provide such tools as when
+building from native buildroot ofr a qemu target, optee_client
+fails to build. This change ensure a minimal C support allows to
+build optee_client with cmake.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0290205..a3fd269 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ cmake_minimum_required (VERSION 3.2)
++project (optee_test C)
+
+ # Default cross compile settings
+ set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
+diff --git a/ta/CMakeLists.txt b/ta/CMakeLists.txt
+index 22d7727..795237e 100644
+--- a/ta/CMakeLists.txt
++++ b/ta/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-project (xtest-ta-headers)
++project (xtest-ta-headers C)
+
+ add_library(${PROJECT_NAME} INTERFACE)
+
package/optee-test/Config.in new file +64 -0
new file mode 100644
index 0000000..f06cbf6
@@ -0,0 +1,64 @@
+config BR2_PACKAGE_OPTEE_TEST
+       bool "optee_test"
+       depends on BR2_aarch64 || BR2_arm
+       help
+         This build option enables OP-TEE test package from the
+         OP-TEE project. It helps platforms to verify the OP-TEE
+         installation against a set of regression and performance
+         tests.
+
+         The package generates userspace test applications and
+         data files for the Linux userland. It also generates
+         OP-TEE trusted applications embedded in the target
+         directory /lib/optee-armtz. These are loaded into the
+         secure world at runtime.
+
+         http://github.org/OP-TEE/optee_test
+
+if BR2_PACKAGE_OPTEE_TEST
+
+choice
+       prompt "OP-TEE test version"
+       default BR2_PACKAGE_OPTEE_TEST_LATEST
+       help
+         Select the version of OP-TEE test you want to use
+
+config BR2_PACKAGE_OPTEE_TEST_LATEST
+       bool "sync with latest release tag"
+       help
+         This fetches the latest registered release tag from
+         the OP-TEE test official Git repository.
+
+config BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT
+       bool "sync with a specific Git"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_PACKAGE_OPTEE_TEST_VERSION
+       string
+       default "3.3.0"         if BR2_PACKAGE_OPTEE_TEST_LATEST
+       default BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_VERSION \
+                               if BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT
+       help
+         Reference in the target Git repository to sync with.
+
+if BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT
+
+config BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_URL
+       string "Git repository site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_VERSION
+       string "target reference to pull in the Git repository"
+       help
+         Package version reference to sync with. As source file
+         reference is a Git repository, the version reference can
+         be any Git reference as a tag or a sha1.
+
+endif
+
+endif #BR2_PACKAGE_OPTEE_TEST
package/optee-test/optee-test.hash new file +4 -0
new file mode 100644
index 0000000..0da2212
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 9651d5db0d28856e45d6bc25ce603bfcf641435bd3264d95b449f093665c8521  optee-test-3.3.0.tar.gz
+# Locally computed
+sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7  LICENSE.md
package/optee-test/optee-test.mk new file +39 -0
new file mode 100644
index 0000000..68caea7
@@ -0,0 +1,49 @@
+################################################################################
+#
+# optee-test
+#
+################################################################################
+
+OPTEE_TEST_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_VERSION))
+OPTEE_TEST_LICENSE = GPL-2.0, BSD-2-Clause,
+OPTEE_TEST_LICENSE_FILES = LICENSE.md
+
+ifeq ($(BR2_PACKAGE_OPTEE_TEST_CUSTOM_GIT),y)
+OPTEE_TEST_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_TEST_CUSTOM_REPO_URL))
+OPTEE_TEST_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_TEST_SOURCE)
+else
+OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION))
+endif
+
+OPTEE_TEST_DEPENDENCIES = optee-client optee-os
+OPTEE_TEST_INSTALL_STAGING = YES
+
+ifeq ($(BR2_aarch64),y)
+OPTEE_TEST_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64
+endif
+ifeq ($(BR2_arm),y)
+OPTEE_TEST_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32
+endif
+OPTEE_TEST_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_TEST_SDK)
+
+define OPTEE_TEST_BUILD_TAS
+       @$(foreach f,$(wildcard $(@D)/ta/*/Makefile), \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \
+                       O=out TA_DEV_KIT_DIR=$(OPTEE_TEST_SDK) \
+                       -C $(dir $f) all &&) true
+endef
+
+define OPTEE_TEST_INSTALL_TAS
+       @$(foreach f,$(wildcard $(@D)/ta/*/out/*.ta), \

package/optee-test/optee-test.mk line 49

Quoted 10 lines
package/optee-test/optee-test.mk new file +10 -0
+               mkdir -p $(TARGET_DIR)/lib/optee_armtz && \
+               $(INSTALL) -v -p --mode=444 \
+                       --target-directory=$(TARGET_DIR)/lib/optee_armtz $f \
+                       &&) true
+endef
+
+OPTEE_TEST_POST_BUILD_HOOKS += OPTEE_TEST_BUILD_TAS
+OPTEE_TEST_POST_INSTALL_TARGET_HOOKS += OPTEE_TEST_INSTALL_TAS
+
+$(eval $(cmake-package))
#13 lore raw

PATCH v2 5/5 optee-test: new package

In reply to Etienne Carriere

OP-TEE test package provide test materials as part of the OP-TEE project helping platforms to verify their OP-TEE components against a set of regression and performance tests.

Package is added in the BR package configuration next to the OP-TEE client package.

---
Changes v1 -> v2:
- Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines.
- Add missing dependency on BR2_TARGET_OPTEE_OS and select BR2_PACKAGE_OPTEE_CLIENT when enabled.
- Add option BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION to ensure OP-TEE test version is synced with OP-TEE OS version.
- Fix official repo URL in Config.in package description.
- Remove useless OPTEE_TEST_INSTALL_STAGING=YES.
- Do not force output build directory and rely on native one: out/.

---
 package/Config.in                                  |  1 +
 .../optee-test/3.3.0/0001-cmake-rely-on-C.patch    | 32 +++++++++
 package/optee-test/Config.in                       | 75 ++++++++++++++++++++++
 package/optee-test/optee-test.hash                 |  4 ++
 package/optee-test/optee-test.mk                   | 48 ++++++++++++++
 5 files changed, 160 insertions(+)
 create mode 100644 package/optee-test/3.3.0/0001-cmake-rely-on-C.patch
 create mode 100644 package/optee-test/Config.in
 create mode 100644 package/optee-test/optee-test.hash
 create mode 100644 package/optee-test/optee-test.mk
package/Config.in +1 -0
index 35870d0..ff53a75 100644
@@ -2050,6 +2050,7 @@ menu "Security"
 	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/optee-examples/Config.in"
+	source "package/optee-test/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-test/3.3.0/0001-cmake-rely-on-C.patch new file +32 -0
new file mode 100644
index 0000000..ea7b966
@@ -0,0 +1,32 @@
+cmake: component rely on C support
+
+Without specifing optee_client source expects only C source file
+support cmake may attempt to look for resources as g++. When
+building with environments that do not provide such tools as when
+building from native buildroot ofr a qemu target, optee_client
+fails to build. This change ensure a minimal C support allows to
+build optee_client with cmake.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0290205..a3fd269 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ cmake_minimum_required (VERSION 3.2)
++project (optee_test C)
+ 
+ # Default cross compile settings
+ set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
+diff --git a/ta/CMakeLists.txt b/ta/CMakeLists.txt
+index 22d7727..795237e 100644
+--- a/ta/CMakeLists.txt
++++ b/ta/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-project (xtest-ta-headers)
++project (xtest-ta-headers C)
+ 
+ add_library(${PROJECT_NAME} INTERFACE)
+ 
package/optee-test/Config.in new file +75 -0

75 lines not on this page · raw message

package/optee-test/optee-test.hash new file +4 -0
new file mode 100644
index 0000000..0da2212
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 9651d5db0d28856e45d6bc25ce603bfcf641435bd3264d95b449f093665c8521  optee-test-3.3.0.tar.gz
+# Locally computed
+sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7  LICENSE.md
package/optee-test/optee-test.mk new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
1.9.1
#14 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

In reply to Etienne Carriere

Hi Etienne,

Thanks for your contribution. I have a few comments below.

Quoted 15 lines · Etienne Carriere

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

...

boot/optee-os/Config.in line 4

Quoted 10 lines
boot/optee-os/Config.in new file +4 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+	bool "optee_os"
+	depends on BR2_aarch64 || BR2_arm
+	select BR2_PACKAGE_OPENSSL # host tool

Which host? Is that the host below which OPTEE OS runs? This is usually called target in the Buildroot lingo. Please clarify in a comment.

Is that a build time dependency? If so you need to add openssl to _DEPENDENCIES.

Quoted 5 lines
boot/optee-os/Config.in new file +5 -0
+	help
+	  OP-TEE OS provides the secure world boot image and the trust
+	  application development kit of the OP-TEE project. OP-TEE OS
+	  also provides generic trusted application one can embedded
+	  into its system.

boot/optee-os/Config.in line 19

Quoted 10 lines
boot/optee-os/Config.in new file +10 -0
+
+	  http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
+	prompt "OP-TEE OS version"
+	default BR2_TARGET_OPTEE_OS_LATEST
+	help
+	  Select the version of OP-TEE OS you want to use

Is there a practical need to support selection separate version selection for each OPTEE component? If not then I think this version selection should apply to all other components.

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#15 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Quoted 24 lines · Baruch Siach

Hi Etienne,

Thanks for your contribution. I have a few comments below.

Quoted 15 lines · Etienne Carriere

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

...

Quoted 13 lines

boot/optee-os/Config.in line 4

Quoted 10 lines
boot/optee-os/Config.in new file +4 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+     bool "optee_os"
+     depends on BR2_aarch64 || BR2_arm
+     select BR2_PACKAGE_OPENSSL # host tool

Which host? Is that the host below which OPTEE OS runs? This is usually called target in the Buildroot lingo. Please clarify in a comment.

I see. Well, it is really the host here: OpenSSL is required to build the OPTEE OS binaries, it is not required in the target.
I found such "# host tool" comment in some packages and though it was the shortest explicit way to highlight the deps.

By the way, I have a questions on
optee-os also requires the Crypto module from python to build the optee-os target binaries.
It failed with trace:
File "scripts/pem_to_pub_c.py", line 23, in main
from Crypto.PublicKey import RSA
ImportError: No module named Crypto.PublicKey

I tried to resolve this by adding "select BR2_PACKAGE_PYTHON_PYCRYPTO" here but it did not solve the issue.
Moreover, I had to also enable some configs to get pycrypto to build:
BR2_PACKAGE_PYTHON=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_USE_WCHAR=y
Finally, i worked around the issue by patching optee-os filetree: port related scripts to python3

How do you think should have I done to get Crypto module supported for optee-os build?

Quoted 3 lines

Is that a build time dependency? If so you need to add openssl to _DEPENDENCIES.

Ok. I understand I need both: BR2_<dep>=y + add <package>_DEPENDENCIES+= <dep>.

thanks.

Quoted 12 lines
Quoted 12 lines
boot/optee-os/Config.in new file +11 -0
+     help
+       OP-TEE OS provides the secure world boot image and the trust
+       application development kit of the OP-TEE project. OP-TEE OS
+       also provides generic trusted application one can embedded
+       into its system.
+
+       http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
Quoted 8 lines

boot/optee-os/Config.in line 19

Quoted 4 lines
boot/optee-os/Config.in new file +4 -0
+     prompt "OP-TEE OS version"
+     default BR2_TARGET_OPTEE_OS_LATEST
+     help
+       Select the version of OP-TEE OS you want to use

Is there a practical need to support selection separate version selection for each OPTEE component? If not then I think this version selection should apply to all other components.

Your absolutely right. I will see how to handle that.

regards,
etienne

Quoted 7 lines

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#16 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Hi Etienne,

Quoted 36 lines · Etienne Carriere
Quoted 21 lines · Baruch Siach

Thanks for your contribution. I have a few comments below.

Quoted 15 lines · Etienne Carriere

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

...

Quoted 13 lines

boot/optee-os/Config.in line 4

Quoted 10 lines
boot/optee-os/Config.in new file +4 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+     bool "optee_os"
+     depends on BR2_aarch64 || BR2_arm
+     select BR2_PACKAGE_OPENSSL # host tool

Which host? Is that the host below which OPTEE OS runs? This is usually called target in the Buildroot lingo. Please clarify in a comment.

Quoted 4 lines

I see. Well, it is really the host here: OpenSSL is required to build the OPTEE OS binaries, it is not required in the target.
I found such "# host tool" comment in some packages and though it was the shortest explicit way to highlight the deps.

Your 'select' enables the target OpenSSL, which is not what you need. You only need to add host-openssl to the _DEPENDENCIES of your package. No need to 'select' the host package.

Make sure to test on a host that has no openssl tools installed by the distro. Your build test succeeds because your package is actually using your distro installed tools. That didn't work for your other dependency
...

Quoted 17 lines

By the way, I have a questions on
optee-os also requires the Crypto module from python to build the optee-os target binaries.
It failed with trace:
File "scripts/pem_to_pub_c.py", line 23, in main
from Crypto.PublicKey import RSA
ImportError: No module named Crypto.PublicKey

I tried to resolve this by adding "select BR2_PACKAGE_PYTHON_PYCRYPTO" here but it did not solve the issue.
Moreover, I had to also enable some configs to get pycrypto to build:
BR2_PACKAGE_PYTHON=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_USE_WCHAR=y
Finally, i worked around the issue by patching optee-os filetree: port related scripts to python3

Quoted 2 lines

How do you think should have I done to get Crypto module supported for optee-os build?

Here again BR2_PACKAGE_PYTHON_PYCRYPTO enables the target package, while you need the host package. The solutions is the same. Add host-python-pycrypto to your _DEPENDENCIES.

Quoted 5 lines
Quoted 2 lines

Is that a build time dependency? If so you need to add openssl to _DEPENDENCIES.

Ok. I understand I need both: BR2_<dep>=y + add
<package>_DEPENDENCIES+= <dep>.

For target package you need both. For host packages you don't need BR2_<dep>.

Quoted 20 lines
Quoted 11 lines
Quoted 11 lines
boot/optee-os/Config.in new file +11 -0
+     help
+       OP-TEE OS provides the secure world boot image and the trust
+       application development kit of the OP-TEE project. OP-TEE OS
+       also provides generic trusted application one can embedded
+       into its system.
+
+       http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
Quoted 8 lines

boot/optee-os/Config.in line 19

Quoted 4 lines
boot/optee-os/Config.in new file +4 -0
+     prompt "OP-TEE OS version"
+     default BR2_TARGET_OPTEE_OS_LATEST
+     help
+       Select the version of OP-TEE OS you want to use

Is there a practical need to support selection separate version selection for each OPTEE component? If not then I think this version selection should apply to all other components.

Quoted 1 line

Your absolutely right. I will see how to handle that.

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#17 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Quoted 78 lines · Baruch Siach

Hi Etienne,

Quoted 36 lines · Etienne Carriere
Quoted 21 lines · Baruch Siach

Thanks for your contribution. I have a few comments below.

Quoted 15 lines · Etienne Carriere

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

...

Quoted 13 lines

boot/optee-os/Config.in line 4

Quoted 10 lines
boot/optee-os/Config.in new file +4 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+     bool "optee_os"
+     depends on BR2_aarch64 || BR2_arm
+     select BR2_PACKAGE_OPENSSL # host tool

Which host? Is that the host below which OPTEE OS runs? This is usually called target in the Buildroot lingo. Please clarify in a comment.

Quoted 4 lines

I see. Well, it is really the host here: OpenSSL is required to build the OPTEE OS binaries, it is not required in the target.
I found such "# host tool" comment in some packages and though it was the shortest explicit way to highlight the deps.

Your 'select' enables the target OpenSSL, which is not what you need. You only need to add host-openssl to the _DEPENDENCIES of your package. No need to 'select' the host package.

Make sure to test on a host that has no openssl tools installed by the distro. Your build test succeeds because your package is actually using your distro installed tools. That didn't work for your other dependency
...

Quoted 17 lines

By the way, I have a questions on
optee-os also requires the Crypto module from python to build the optee-os target binaries.
It failed with trace:
File "scripts/pem_to_pub_c.py", line 23, in main
from Crypto.PublicKey import RSA
ImportError: No module named Crypto.PublicKey

I tried to resolve this by adding "select BR2_PACKAGE_PYTHON_PYCRYPTO" here but it did not solve the issue.
Moreover, I had to also enable some configs to get pycrypto to build:
BR2_PACKAGE_PYTHON=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_USE_WCHAR=y
Finally, i worked around the issue by patching optee-os filetree: port related scripts to python3

Quoted 2 lines

How do you think should have I done to get Crypto module supported for optee-os build?

Here again BR2_PACKAGE_PYTHON_PYCRYPTO enables the target package, while you need the host package. The solutions is the same. Add host-python-pycrypto to your _DEPENDENCIES.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Is that a build time dependency? If so you need to add openssl to _DEPENDENCIES.

Ok. I understand I need both: BR2_<dep>=y + add
<package>_DEPENDENCIES+= <dep>.

For target package you need both. For host packages you don't need BR2_<dep>.

Ok Baruch,
Thanks a lot for the details.

etienne

Quoted 29 lines
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
boot/optee-os/Config.in new file +11 -0
+     help
+       OP-TEE OS provides the secure world boot image and the trust
+       application development kit of the OP-TEE project. OP-TEE OS
+       also provides generic trusted application one can embedded
+       into its system.
+
+       http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
Quoted 8 lines

boot/optee-os/Config.in line 19

Quoted 4 lines
boot/optee-os/Config.in new file +4 -0
+     prompt "OP-TEE OS version"
+     default BR2_TARGET_OPTEE_OS_LATEST
+     help
+       Select the version of OP-TEE OS you want to use

Is there a practical need to support selection separate version selection for each OPTEE component? If not then I think this version selection should apply to all other components.

Quoted 1 line

Your absolutely right. I will see how to handle that.

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#18 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

In reply to Etienne Carriere
Quoted 5 lines

From: "Etienne Carriere" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "etienne carriere" <[email protected]>
Sent: Quinta-feira, 22 de novembro de 2018 13:22:53
Subject: [Buildroot] [PATCH 1/5] boot/optee-os: OP-TEE secure world

[...]

Quoted 4 lines
boot/optee-os/Config.in new file +1 -0
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS

boot/optee-os/Config.in line 11

Quoted 10 lines
boot/optee-os/Config.in new file +10 -0
+	bool "optee_os"
+	depends on BR2_aarch64 || BR2_arm
+	select BR2_PACKAGE_OPENSSL # host tool
+	help
+	  OP-TEE OS provides the secure world boot image and the trust
+	  application development kit of the OP-TEE project. OP-TEE OS
+	  also provides generic trusted application one can embedded
+	  into its system.
+
+	  http://github.org/OP-TEE/optee_os

Must be https://github.com/OP-TEE/optee_os

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#19 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Quoted 8 lines · Carlos Santos
Quoted 6 lines

From: "Etienne Carriere" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "etienne carriere" <[email protected]>
Sent: Quinta-feira, 22 de novembro de 2018 13:22:53
Subject: [Buildroot] [PATCH 1/5] boot/optee-os: OP-TEE secure world

[...]

Quoted 16 lines
Quoted 4 lines
boot/optee-os/Config.in new file +1 -0
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS

boot/optee-os/Config.in line 11

Quoted 10 lines
boot/optee-os/Config.in new file +10 -0
+     bool "optee_os"
+     depends on BR2_aarch64 || BR2_arm
+     select BR2_PACKAGE_OPENSSL # host tool
+     help
+       OP-TEE OS provides the secure world boot image and the trust
+       application development kit of the OP-TEE project. OP-TEE OS
+       also provides generic trusted application one can embedded
+       into its system.
+
+       http://github.org/OP-TEE/optee_os

Must be https://github.com/OP-TEE/optee_os

Oups! yes, my mistake.
I fear I did the same mistake in the other OP-TEE packages. I'll fix. thanks.

Quoted 5 lines

--
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty that only the ignorant can have.? ? Epitaph of a volunteer

#20 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

In reply to Etienne Carriere

Hi Etienne,

Quoted 224 lines

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
 boot/Config.in                                     |   1 +
 .../3.3.0/0001-move-python-to-python3.patch        |  26 ++++++
 boot/optee-os/Config.in                            | 102 ++++++++++++++++++++
 boot/optee-os/optee-os.hash                        |   4 +
 boot/optee-os/optee-os.mk                          | 103 +++++++++++++++++++++
 5 files changed, 236 insertions(+)
 create mode 100644 boot/optee-os/3.3.0/0001-move-python-to-python3.patch
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.hash
 create mode 100644 boot/optee-os/optee-os.mk
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/3.3.0/0001-move-python-to-python3.patch new file +26 -0
new file mode 100644
index 0000000..b0ed5b5
@@ -0,0 +1,26 @@
+move python scripts to pyhton3
+
+Use python3 for scripts depending on module Crypto.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa36..0b03d62 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479..348b40a 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
boot/optee-os/Config.in new file +102 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+       bool "optee_os"
+       depends on BR2_aarch64 || BR2_arm
+       select BR2_PACKAGE_OPENSSL # host tool
+       help
+         OP-TEE OS provides the secure world boot image and the trust
+         application development kit of the OP-TEE project. OP-TEE OS
+         also provides generic trusted application one can embedded
+         into its system.
+
+         http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
+       prompt "OP-TEE OS version"
+       default BR2_TARGET_OPTEE_OS_LATEST
+       help
+         Select the version of OP-TEE OS you want to use
+
+config BR2_TARGET_OPTEE_OS_LATEST
+       bool "sync with latest registered release tag"
+       help
+         This fetches the latest registered release tag from
+         the OP-TEE OS official Git repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+       bool "sync on custom OP-TEE OS Git repository"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_TARGET_OPTEE_OS_VERSION
+       string
+       default "3.3.0"         if BR2_TARGET_OPTEE_OS_LATEST
+       default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
+                               if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
+       string "sourcetree-site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION
+       string "git reference to pull"
+       help
+         Reference in the target git repository to sync with.
+
+endif
+
+# Building core, TA libraries/devkit and/or generic TA services
+
+config BR2_TARGET_OPTEE_OS_CORE
+       bool "Build core"
+       default y
+       help
+         This option will build and install the OP-TEE core
+         boot images.
+
+config BR2_TARGET_OPTEE_OS_SDK
+       bool "Build TA devkit"
+       default y
+       help
+         This option will build and install the OP-TEE development
+         kit for building OP-TEE trusted application images. It is
+          installed in the staging filetree in /lib/optee directory.
+
+config BR2_TARGET_OPTEE_OS_SERVICES
+       bool "Build service TAs"
+       default y
+       help
+         This option will build and install the generic trusted
+         applications in the OP-TEE OS source tree and install
+         them in the target /lib/optee_armtz directory. At runtime
+         OP-TEE OS can load trusted applications from a non secure
+         filesystem into the secure world for execution.
+
+# Building TA libraries and/or core images require target platform info
+
+config BR2_TARGET_OPTEE_OS_PLATFORM
+       string "mandatory target PLATFORM"
+       help
+         Value for the mandated PLATFORM build directive provided to
+         OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR
+       string "optional target PLATFORM_FLAVOR"
+       help
+         Value for the optional PLATFORM_FLAVOR build directive
+         provided to OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES
+       string "Additional OP-TEE OS build variables"
+       help
+         Additional parameters for the OP-TEE OS build
+         E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y'
+
+endif # BR2_TARGET_OPTEE_OS
boot/optee-os/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..f68d72f
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 f0c9572d3a341ea37bb8e89cfd511e96d6ca3b2b714b536564e8fedb93b0f44a  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/optee-os.mk new file +28 -0
new file mode 100644
index 0000000..2e04ce0
@@ -0,0 +1,103 @@
+################################################################################
+#
+# optee-os
+#
+################################################################################
+
+OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION))
+OPTEE_OS_LICENSE = BSD-2-Clause
+OPTEE_OS_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
+OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
+OPTEE_OS_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
+else
+OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,OPTEE_OS_VERSION)
+endif
+
+# On 64bit targets, OP-TEE OS can be built in 32bit mode, or
+# can be built in 64bit mode and support 32bit and 64bit
+# trusted applications. Since buildroot currently references
+# a single cross compiler, build exclusively in 32bit
+# or 64bit mode.
+OPTEE_OS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)"
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_core="$(TARGET_CROSS)"
+ifeq ($(BR2_aarch64),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)"
+endif

boot/optee-os/optee-os.mk line 38

Quoted 10 lines
boot/optee-os/optee-os.mk new file +10 -0
+ifeq ($(BR2_arm),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)"
+endif
+
+# Get mandatory PLAFORM and optional PLATFORM_FLAVOR
+OPTEE_OS_MAKE_OPTS += PLATFORM=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM))
+ifneq ($(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR),)
+OPTEE_OS_MAKE_OPTS += PLATFORM_FLAVOR=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR))
+endif
+OPTEE_OS_MAKE_OPTS += $(call qstrip,$(BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES))

minor nit, please see below

boot/optee-os/optee-os.mk line 40

Quoted 2 lines
boot/optee-os/optee-os.mk new file +2 -0
+
+# OP-TEE OS builds from subdirectory build/ of its synced sourcetree root path

optee_os by default uses [1] "out" as build directory, Shouldn't we use the same for consistency. We can provide option
and let the user decide?

[1] https://github.com/OP-TEE/optee_os/blob/master/Makefile#L44

other than that,

#21 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Quoted 240 lines · Shyam Saini

Hi Etienne,

Quoted 224 lines

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
 boot/Config.in                                     |   1 +
 .../3.3.0/0001-move-python-to-python3.patch        |  26 ++++++
 boot/optee-os/Config.in                            | 102 ++++++++++++++++++++
 boot/optee-os/optee-os.hash                        |   4 +
 boot/optee-os/optee-os.mk                          | 103 +++++++++++++++++++++
 5 files changed, 236 insertions(+)
 create mode 100644 boot/optee-os/3.3.0/0001-move-python-to-python3.patch
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.hash
 create mode 100644 boot/optee-os/optee-os.mk
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/3.3.0/0001-move-python-to-python3.patch new file +26 -0
new file mode 100644
index 0000000..b0ed5b5
@@ -0,0 +1,26 @@
+move python scripts to pyhton3
+
+Use python3 for scripts depending on module Crypto.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa36..0b03d62 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479..348b40a 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
boot/optee-os/Config.in new file +102 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+       bool "optee_os"
+       depends on BR2_aarch64 || BR2_arm
+       select BR2_PACKAGE_OPENSSL # host tool
+       help
+         OP-TEE OS provides the secure world boot image and the trust
+         application development kit of the OP-TEE project. OP-TEE OS
+         also provides generic trusted application one can embedded
+         into its system.
+
+         http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
+       prompt "OP-TEE OS version"
+       default BR2_TARGET_OPTEE_OS_LATEST
+       help
+         Select the version of OP-TEE OS you want to use
+
+config BR2_TARGET_OPTEE_OS_LATEST
+       bool "sync with latest registered release tag"
+       help
+         This fetches the latest registered release tag from
+         the OP-TEE OS official Git repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+       bool "sync on custom OP-TEE OS Git repository"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_TARGET_OPTEE_OS_VERSION
+       string
+       default "3.3.0"         if BR2_TARGET_OPTEE_OS_LATEST
+       default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
+                               if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
+       string "sourcetree-site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION
+       string "git reference to pull"
+       help
+         Reference in the target git repository to sync with.
+
+endif
+
+# Building core, TA libraries/devkit and/or generic TA services
+
+config BR2_TARGET_OPTEE_OS_CORE
+       bool "Build core"
+       default y
+       help
+         This option will build and install the OP-TEE core
+         boot images.
+
+config BR2_TARGET_OPTEE_OS_SDK
+       bool "Build TA devkit"
+       default y
+       help
+         This option will build and install the OP-TEE development
+         kit for building OP-TEE trusted application images. It is
+          installed in the staging filetree in /lib/optee directory.
+
+config BR2_TARGET_OPTEE_OS_SERVICES
+       bool "Build service TAs"
+       default y
+       help
+         This option will build and install the generic trusted
+         applications in the OP-TEE OS source tree and install
+         them in the target /lib/optee_armtz directory. At runtime
+         OP-TEE OS can load trusted applications from a non secure
+         filesystem into the secure world for execution.
+
+# Building TA libraries and/or core images require target platform info
+
+config BR2_TARGET_OPTEE_OS_PLATFORM
+       string "mandatory target PLATFORM"
+       help
+         Value for the mandated PLATFORM build directive provided to
+         OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR
+       string "optional target PLATFORM_FLAVOR"
+       help
+         Value for the optional PLATFORM_FLAVOR build directive
+         provided to OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES
+       string "Additional OP-TEE OS build variables"
+       help
+         Additional parameters for the OP-TEE OS build
+         E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y'
+
+endif # BR2_TARGET_OPTEE_OS
boot/optee-os/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..f68d72f
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 f0c9572d3a341ea37bb8e89cfd511e96d6ca3b2b714b536564e8fedb93b0f44a  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/optee-os.mk new file +28 -0
new file mode 100644
index 0000000..2e04ce0
@@ -0,0 +1,103 @@
+################################################################################
+#
+# optee-os
+#
+################################################################################
+
+OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION))
+OPTEE_OS_LICENSE = BSD-2-Clause
+OPTEE_OS_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
+OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
+OPTEE_OS_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
+else
+OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,OPTEE_OS_VERSION)
+endif
+
+# On 64bit targets, OP-TEE OS can be built in 32bit mode, or
+# can be built in 64bit mode and support 32bit and 64bit
+# trusted applications. Since buildroot currently references
+# a single cross compiler, build exclusively in 32bit
+# or 64bit mode.
+OPTEE_OS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)"
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_core="$(TARGET_CROSS)"
+ifeq ($(BR2_aarch64),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)"
+endif

boot/optee-os/optee-os.mk line 38

Quoted 10 lines
boot/optee-os/optee-os.mk new file +10 -0
+ifeq ($(BR2_arm),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)"
+endif
+
+# Get mandatory PLAFORM and optional PLATFORM_FLAVOR
+OPTEE_OS_MAKE_OPTS += PLATFORM=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM))
+ifneq ($(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR),)
+OPTEE_OS_MAKE_OPTS += PLATFORM_FLAVOR=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR))
+endif
+OPTEE_OS_MAKE_OPTS += $(call qstrip,$(BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES))

minor nit, please see below

Quoted 6 lines

boot/optee-os/optee-os.mk line 40

Quoted 2 lines
boot/optee-os/optee-os.mk new file +2 -0
+
+# OP-TEE OS builds from subdirectory build/ of its synced sourcetree root path

optee_os by default uses [1] "out" as build directory, Shouldn't we use the same for consistency. We can provide option
and let the user decide?

I though i would be better to have this makefile agnostic of the optee_os default output path.
I guess a build option with a known default value is more flexible. However i did not find such in other BR packages. I wonder if it is a good idea.

Quoted 6 lines

[1] https://github.com/OP-TEE/optee_os/blob/master/Makefile#L44

other than that,

Thanks a lot.

etienne

#22 lore raw

PATCH 1/5 boot/optee-os: OP-TEE secure world

Quoted 249 lines · Etienne Carriere
Quoted 240 lines · Shyam Saini

Hi Etienne,

Quoted 224 lines

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
 boot/Config.in                                     |   1 +
 .../3.3.0/0001-move-python-to-python3.patch        |  26 ++++++
 boot/optee-os/Config.in                            | 102 ++++++++++++++++++++
 boot/optee-os/optee-os.hash                        |   4 +
 boot/optee-os/optee-os.mk                          | 103 +++++++++++++++++++++
 5 files changed, 236 insertions(+)
 create mode 100644 boot/optee-os/3.3.0/0001-move-python-to-python3.patch
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.hash
 create mode 100644 boot/optee-os/optee-os.mk
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/3.3.0/0001-move-python-to-python3.patch new file +26 -0
new file mode 100644
index 0000000..b0ed5b5
@@ -0,0 +1,26 @@
+move python scripts to pyhton3
+
+Use python3 for scripts depending on module Crypto.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+
+diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py
+index 6b8fa36..0b03d62 100755
+--- a/scripts/pem_to_pub_c.py
++++ b/scripts/pem_to_pub_c.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # SPDX-License-Identifier: BSD-2-Clause
+ #
+ # Copyright (c) 2015, Linaro Limited
+diff --git a/scripts/sign.py b/scripts/sign.py
+index ad47479..348b40a 100755
+--- a/scripts/sign.py
++++ b/scripts/sign.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2015, 2017, Linaro Limited
+ #
boot/optee-os/Config.in new file +102 -0
new file mode 100644
index 0000000..5968531
@@ -0,0 +1,102 @@
+config BR2_TARGET_OPTEE_OS
+       bool "optee_os"
+       depends on BR2_aarch64 || BR2_arm
+       select BR2_PACKAGE_OPENSSL # host tool
+       help
+         OP-TEE OS provides the secure world boot image and the trust
+         application development kit of the OP-TEE project. OP-TEE OS
+         also provides generic trusted application one can embedded
+         into its system.
+
+         http://github.org/OP-TEE/optee_os
+
+if BR2_TARGET_OPTEE_OS
+
+choice
+       prompt "OP-TEE OS version"
+       default BR2_TARGET_OPTEE_OS_LATEST
+       help
+         Select the version of OP-TEE OS you want to use
+
+config BR2_TARGET_OPTEE_OS_LATEST
+       bool "sync with latest registered release tag"
+       help
+         This fetches the latest registered release tag from
+         the OP-TEE OS official Git repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+       bool "sync on custom OP-TEE OS Git repository"
+       help
+         Sync with a specific OP-TEE Git repository.
+
+endchoice
+
+config BR2_TARGET_OPTEE_OS_VERSION
+       string
+       default "3.3.0"         if BR2_TARGET_OPTEE_OS_LATEST
+       default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
+                               if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
+       string "sourcetree-site"
+       help
+         Specific location of the reference source tree Git
+         repository.
+
+config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION
+       string "git reference to pull"
+       help
+         Reference in the target git repository to sync with.
+
+endif
+
+# Building core, TA libraries/devkit and/or generic TA services
+
+config BR2_TARGET_OPTEE_OS_CORE
+       bool "Build core"
+       default y
+       help
+         This option will build and install the OP-TEE core
+         boot images.
+
+config BR2_TARGET_OPTEE_OS_SDK
+       bool "Build TA devkit"
+       default y
+       help
+         This option will build and install the OP-TEE development
+         kit for building OP-TEE trusted application images. It is
+          installed in the staging filetree in /lib/optee directory.
+
+config BR2_TARGET_OPTEE_OS_SERVICES
+       bool "Build service TAs"
+       default y
+       help
+         This option will build and install the generic trusted
+         applications in the OP-TEE OS source tree and install
+         them in the target /lib/optee_armtz directory. At runtime
+         OP-TEE OS can load trusted applications from a non secure
+         filesystem into the secure world for execution.
+
+# Building TA libraries and/or core images require target platform info
+
+config BR2_TARGET_OPTEE_OS_PLATFORM
+       string "mandatory target PLATFORM"
+       help
+         Value for the mandated PLATFORM build directive provided to
+         OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR
+       string "optional target PLATFORM_FLAVOR"
+       help
+         Value for the optional PLATFORM_FLAVOR build directive
+         provided to OP-TEE OS.
+
+config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES
+       string "Additional OP-TEE OS build variables"
+       help
+         Additional parameters for the OP-TEE OS build
+         E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y'
+
+endif # BR2_TARGET_OPTEE_OS
boot/optee-os/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..f68d72f
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 f0c9572d3a341ea37bb8e89cfd511e96d6ca3b2b714b536564e8fedb93b0f44a  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/optee-os.mk new file +28 -0
new file mode 100644
index 0000000..2e04ce0
@@ -0,0 +1,103 @@
+################################################################################
+#
+# optee-os
+#
+################################################################################
+
+OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION))
+OPTEE_OS_LICENSE = BSD-2-Clause
+OPTEE_OS_LICENSE_FILES = LICENSE
+
+ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
+OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
+OPTEE_OS_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
+else
+OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,OPTEE_OS_VERSION)
+endif
+
+# On 64bit targets, OP-TEE OS can be built in 32bit mode, or
+# can be built in 64bit mode and support 32bit and 64bit
+# trusted applications. Since buildroot currently references
+# a single cross compiler, build exclusively in 32bit
+# or 64bit mode.
+OPTEE_OS_MAKE_OPTS = CROSS_COMPILE="$(TARGET_CROSS)"
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_core="$(TARGET_CROSS)"
+ifeq ($(BR2_aarch64),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)"
+endif

boot/optee-os/optee-os.mk line 38

Quoted 10 lines
boot/optee-os/optee-os.mk new file +10 -0
+ifeq ($(BR2_arm),y)
+OPTEE_OS_MAKE_OPTS += CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)"
+endif
+
+# Get mandatory PLAFORM and optional PLATFORM_FLAVOR
+OPTEE_OS_MAKE_OPTS += PLATFORM=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM))
+ifneq ($(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR),)
+OPTEE_OS_MAKE_OPTS += PLATFORM_FLAVOR=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR))
+endif
+OPTEE_OS_MAKE_OPTS += $(call qstrip,$(BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES))

minor nit, please see below

Quoted 6 lines

boot/optee-os/optee-os.mk line 40

Quoted 2 lines
boot/optee-os/optee-os.mk new file +2 -0
+
+# OP-TEE OS builds from subdirectory build/ of its synced sourcetree root path

optee_os by default uses [1] "out" as build directory, Shouldn't we use the same for consistency. We can provide option
and let the user decide?

Quoted 5 lines

I though i would be better to have this makefile agnostic of the optee_os default output path.
I guess a build option with a known default value is more flexible. However i did not find such in other BR packages. I wonder if it is a good idea.

I check and actually the default output build dir is not out/ but out/$(ARCH)-plat-$(PLATFORM) knowing that $(PLATFORM) may not be the value of PLATFORM set in this makefile script.
i.e Single PLATFORM=vexpress-qemu_virt external directive in transformed by optee-os internal build as dual PLATFORM=vexpress + PLATFORM_FLAVOR=qemu_virt.
Refer to https://github.com/OP-TEE/optee_os/blob/master/Makefile#L32

I will stick on forcing it to out/ as it simplifies the path resolution.

etienne

Quoted 10 lines
Quoted 6 lines

[1] https://github.com/OP-TEE/optee_os/blob/master/Makefile#L44

other than that,

Thanks a lot.

etienne

#23 lore raw

PATCH v2 1/5 boot/optee-os: new package

In reply to Etienne Carriere

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
Changes v1 -> v2:
- Replace dependency on BR2_arm with BR2_ARM_CPU_ARMV7 as BR2_arm
is enabled for non Armv7 targets.
- Correct build dependencies on OpenSSL and pycrypto.
Remove patch on package python scripts since pycrypto dependency
is now handled.
- Correct location of in-tree services TAs (s/ta_services/ta/).
Remvoe OPTEE_OS_BUILD_SERVICES as service TAs are already built built when OP-TEE OS core is built. Correct BR2_TARGET_OPTEE_OS_SERVICES options: it only installs the
- Fix bad reference in Config.in package description.
- Fix wrong hash for the optee-os v3.3.0 tarball.
- Fix bad use of OPTEE_OS_VERSION where it is the value content that

    is expected: $(OPTEE_OS_VERSION).

- Clarify output build directory name: use out/.
- Minor replace use if/endif with use of depends on in Config.mk.
- Add missing dependency of BR2_TARGET_OPTEE_OS_SERVICES on BR2_TARGET_OPTEE_OS_SDK.
- Change commit header comment to "boot/optee-os: new package".

---
 boot/Config.in              |   1 +
 boot/optee-os/Config.in     | 100 +++++++++++++++++++++++++++++++++++++++++++
 boot/optee-os/optee-os.hash |   4 ++
 boot/optee-os/optee-os.mk   | 101 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 206 insertions(+)
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.hash
 create mode 100644 boot/optee-os/optee-os.mk
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/Config.in new file +100 -0

100 lines not on this page · raw message

boot/optee-os/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..02828a3
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_os/archive/3.3.0.tar.gz
+sha256 7b62e9fe650e197473eb2f4dc35c09d1e6395eb48dc1c16cc139d401b359ac6f  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/optee-os.mk new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
1.9.1
#24 lore raw

PATCH v3 1/7 boot/optee-os: new package

OP-TEE OS is maintained by the OP-TEE project. It provides an open source solution for development and integration of secure services for Armv7-A and Armv8-A CPU based platforms supporting the TrustZone technology. This technology enables CPUs to concurrently host a secure world as the OP-TEE OS and a non-secure world as a Linux based OS.

The OP-TEE project maintains other packages to leverage OP-TEE on Linux kernel based OSes. An OP-TEE interface driver is available in the Linux kernel since 4.12 upon CONFIG_OPTEE.

This change references in Buildroot the today's latest OP-TEE revision release tagged 3.3.0 with 2 patches:
- fix a issue in the OP-TEE OS Qemu platform regarding Qemu v2.12.1+.
- Introduce CFG_USER_TA_TARGETS to have Aarch64 building Aarch64 only.

https://www.op-tee.org/
https://github.com/OP-TEE/optee_os

---
Chages v2-> v3
- Add an entry in file DEVELOPERS.
- Fix BR2_ARM_CPU_ARMV7 into BR2_ARM_CPU_ARMV7A and replace dependency on BR2_aarch64 with dep on BR2_ARM_CPU_ARMV8A which is more accurate.
- Many cleaning in description sections of Config.in and layout reordering.
- Reordering in optee-os.mk layout.
- Correct dependency openssl into host-openssl.
- Use OPTEE_OS_INSTALL_STAGING_CMDS for installs in the staging dir.
- Clean in-tree TAs install command (s/@(foreach ...)/$(INSTALL) ...)
- BR2_TARGET_OPTEE_OS_SERVICES selects BR2_TARGET_OPTEE_OS_CORE instead of depending on BR2_TARGET_OPTEE_OS_SDK. This because core build also builds the in-tree TAs.
- Replace common optee-os.hash with per-version .hash files. Support the released 3.x tags from OP-TEE project.
- Remove useless indirection in OPTEE_OS_INSTALL_STAGING_CMDS definition.
- Fix issue of Aarch64 OS to attempt to build Aarch32 user mode support while the selected cross compilation toolchain cannot compile for Aarch32 targets. OP-TEE OS 3.3.0 is patched to backport support for CFG_USER_TA_TARGETS directive, allowing to restrict build to Aarch64.

Changes v1 -> v2:
- Replace dependency on BR2_arm with BR2_ARM_CPU_ARMV7 as BR2_arm
is enabled for non Armv7 targets.
- Correct build dependencies on OpenSSL and pycrypto.
Remove patch on package python scripts since pycrypto dependency
is now handled.
- Correct location of in-tree services TAs (s/ta_services/ta/).
Remvoe OPTEE_OS_BUILD_SERVICES as service TAs are already built built when OP-TEE OS core is built. Correct BR2_TARGET_OPTEE_OS_SERVICES options: it only installs the
- Fix bad reference in Config.in package description.
- Fix wrong hash for the optee-os v3.3.0 tarball.
- Fix bad use of OPTEE_OS_VERSION where it is the value content that

    is expected: $(OPTEE_OS_VERSION).

- Clarify output build directory name: use out/.
- Minor replace use if/endif with use of depends on in Config.mk.
- Add missing dependency of BR2_TARGET_OPTEE_OS_SERVICES on BR2_TARGET_OPTEE_OS_SDK.
- Change commit header comment to "boot/optee-os: new package".

---
 DEVELOPERS                                         |   3 +
 boot/Config.in                                     |   1 +
 ...1-qemu-increase-CFG_DTB_MAX_SIZE-to-1-MiB.patch |  41 +++++++++
 ...0002-workaround-multiple-ta-targets-issue.patch |  45 +++++++++
 boot/optee-os/3.3.0/optee-os.hash                  |   4 +
 boot/optee-os/Config.in                            | 101 +++++++++++++++++++++
 boot/optee-os/optee-os.mk                          |  97 ++++++++++++++++++++
 7 files changed, 292 insertions(+)
 create mode 100644 boot/optee-os/3.3.0/0001-qemu-increase-CFG_DTB_MAX_SIZE-to-1-MiB.patch
 create mode 100644 boot/optee-os/3.3.0/0002-workaround-multiple-ta-targets-issue.patch
 create mode 100644 boot/optee-os/3.3.0/optee-os.hash
 create mode 100644 boot/optee-os/Config.in
 create mode 100644 boot/optee-os/optee-os.mk
DEVELOPERS +3 -0
index 9654fcf..83c0ec8 100644
@@ -681,6 +681,9 @@ F:	package/mxsldr/
 N:	Ernesto L. Williams Jr <[email protected]>
 F:	package/szip/
 
+N:	Etienne Carriere <[email protected]>
+F:	boot/optee-os/
+
 N:	Eugene Tarassov <[email protected]>
 F:	package/tcf-agent/
 
boot/Config.in +1 -0
index 8e0c8e5..cd14731 100644
@@ -13,6 +13,7 @@ source "boot/gummiboot/Config.in"
 source "boot/lpc32xxcdl/Config.in"
 source "boot/mv-ddr-marvell/Config.in"
 source "boot/mxs-bootlets/Config.in"
+source "boot/optee-os/Config.in"
 source "boot/riscv-pk/Config.in"
 source "boot/s500-bootloader/Config.in"
 source "boot/syslinux/Config.in"
boot/optee-os/3.3.0/0001-qemu-increase-CFG_DTB_MAX_SIZE-to-1-MiB.patch new file +41 -0

41 lines not on this page · raw message

boot/optee-os/3.3.0/0002-workaround-multiple-ta-targets-issue.patch new file +45 -0

45 lines not on this page · raw message

boot/optee-os/3.3.0/optee-os.hash new file +4 -0
new file mode 100644
index 0000000..02828a3
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_os/archive/3.3.0.tar.gz
+sha256 7b62e9fe650e197473eb2f4dc35c09d1e6395eb48dc1c16cc139d401b359ac6f  optee-os-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
boot/optee-os/Config.in new file +101 -0

101 lines not on this page · raw message

boot/optee-os/optee-os.mk new file +97 -0

97 lines not on this page · raw message

Signature · 1 line
1.9.1
#25 lore raw

PATCH v3 2/7 optee-client: new package

OP-TEE client API library and supplicant daemon from the OP-TEE project are packaged in package/optee-client. An init script launches the tee-supplicant deamon. Package is added to the Security menu of BR configuration.

This change references in Buildroot the today's latest OP-TEE revision release tagged 3.3.0.

---
Changes v2 -> v3:
- Add an entry in file DEVELOPERS.
- Clean Config.in layout and description sections.
- Drop BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION.
- Clean optee-client.mk layout.
- Remove OPTEE_CLIENT_INSTALL_STAGING indirection.
- Replace optee-client.hash with per-version optee-client.hash files.
- Support the released 3.x tags from OP-TEE project.
- Correct license tag (client is BSD-2-Clause instead of BSD-3-Clause).
- Rewrite the init script to use start-stop-daemon

Changes v1 -> v2:
- Add option BR2_PACKAGE_OPTEE_CLIENT_SYNCED_VERSION to ensure OP-TEE client version is synced with OP-TEE OS version when the later if enabled.
- Remove useless OPTEE_CLIENT_INSTALL_IMAGE=YES.

---
 DEVELOPERS                                   |  1 +
 package/Config.in                            |  1 +
 package/optee-client/3.3.0/optee-client.hash |  4 ++
 package/optee-client/Config.in               | 55 ++++++++++++++++++++++++++++
 package/optee-client/S30optee                | 49 +++++++++++++++++++++++++
 package/optee-client/optee-client.mk         | 25 +++++++++++++
 6 files changed, 135 insertions(+)
 create mode 100644 package/optee-client/3.3.0/optee-client.hash
 create mode 100644 package/optee-client/Config.in
 create mode 100644 package/optee-client/S30optee
 create mode 100644 package/optee-client/optee-client.mk
DEVELOPERS +1 -0
index 83c0ec8..0810e63 100644
@@ -683,6 +683,7 @@ F:	package/szip/
 
 N:	Etienne Carriere <[email protected]>
 F:	boot/optee-os/
+F:	package/optee-client/
 
 N:	Eugene Tarassov <[email protected]>
 F:	package/tcf-agent/
package/Config.in +1 -0
index 0df9b73..277a855 100644
@@ -2076,6 +2076,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-client/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-client/3.3.0/optee-client.hash new file +4 -0
new file mode 100644
index 0000000..ed7bf4e
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_client/archive/3.3.0.tar.gz
+sha256 63af1567fdcdbe28b45be274266a89aa81bef3d0fd8ec5a6eb680046a92e1177  optee-client-3.3.0.tar.gz
+# Locally computed
+sha256 fda8385993f112d7ca61b88b54ba5b4cbeec7e43a0f9b317d5186703c1985e8f  LICENSE
package/optee-client/Config.in new file +55 -0

55 lines not on this page · raw message

package/optee-client/S30optee new file +49 -0

49 lines not on this page · raw message

package/optee-client/optee-client.mk new file +25 -0
new file mode 100644
index 0000000..5cd741b
@@ -0,0 +1,25 @@
+################################################################################
+#
+# optee-client
+#
+################################################################################
+
+OPTEE_CLIENT_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_VERSION))
+OPTEE_CLIENT_LICENSE = BSD-2-Clause
+OPTEE_CLIENT_LICENSE_FILES = LICENSE
+OPTEE_CLIENT_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_GIT),y)
+OPTEE_CLIENT_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_CLIENT_CUSTOM_REPO_URL))
+OPTEE_CLIENT_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_CLIENT_SOURCE)
+else
+OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION))
+endif
+
+define OPTEE_CLIENT_INSTALL_INIT_SYSV
+	$(INSTALL) -m 0755 -D $(OPTEE_CLIENT_PKGDIR)/S30optee \
+		$(TARGET_DIR)/etc/init.d/S30optee
+endef
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#26 lore raw

PATCH v3 3/7 optee-examples: new package

In reply to Etienne Carriere

This package generates embedded Linux based OS userland client applications and OP-TEE OS trusted applications all embedded in the file system. These applications shows how to use the APIs OP-TEE OS is based on, both in the non secure and secure worlds.

Package is added next to the OP-TEE client package in the BR package configuration.

This change references in Buildroot the today's latest OP-TEE revision release tagged 3.3.0 with an added patch to fix an issue reported by recent GCC toolchains.

---
Changes v2 -> v3:
- Add an entry in file DEVELOPERS.
- Clean Config.in layout and description sections.
- Drop BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION.
- Clean optee-examples.mk layout.
- Replace common optee-examples.hash with per-version .hash files.
- Simplify install command in iotee-test.mk
- Patch optee_test 3.3.0 against an issue in the CMake files.
- Remove dependency of BR2_PACKAGE_OPTEE_EXAMPLES. As the package depends on BR2_TARGET_OPTEE_OS, leave it to optee-os to define the supported architectures.

Changes v1 -> v2:
- Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines.
- Select OP-TEE client and add dependency on OP-TEE OS.
- Add option BR2_PACKAGE_OPTEE_EXAMPLES_SYNCED_VERSION to ensure OP-TEE examples version is synced with OP-TEE OS version.
- Do not force output build directory, rely on native path: out/.
- Replace if/endif with depends on in Config.in.
- Remove useless OPTEE_EXAMPLES_INSTALL_STAGING=YES.
- Add package official URL in Config.in package description.

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 .../0001-fix-deprecated-size_t-type-for-size.patch | 37 ++++++++++++++
 package/optee-examples/3.3.0/optee-examples.hash   |  4 ++
 package/optee-examples/Config.in                   | 59 ++++++++++++++++++++++
 package/optee-examples/optee-examples.mk           | 44 ++++++++++++++++
 6 files changed, 146 insertions(+)
 create mode 100644 package/optee-examples/3.3.0/0001-fix-deprecated-size_t-type-for-size.patch
 create mode 100644 package/optee-examples/3.3.0/optee-examples.hash
 create mode 100644 package/optee-examples/Config.in
 create mode 100644 package/optee-examples/optee-examples.mk
DEVELOPERS +1 -0
index 0810e63..c9f2e00 100644
@@ -684,6 +684,7 @@ F:	package/szip/
 N:	Etienne Carriere <[email protected]>
 F:	boot/optee-os/
 F:	package/optee-client/
+F:	package/optee-examples/
 
 N:	Eugene Tarassov <[email protected]>
 F:	package/tcf-agent/
package/Config.in +1 -0
index 277a855..b76db17 100644
@@ -2077,6 +2077,7 @@ endmenu
 menu "Security"
 	source "package/checkpolicy/Config.in"
 	source "package/optee-client/Config.in"
+	source "package/optee-examples/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-examples/3.3.0/0001-fix-deprecated-size_t-type-for-size.patch new file +37 -0
new file mode 100644
index 0000000..ba1716a
@@ -0,0 +1,37 @@
+commit fca0caba591f31f66325826c74acd26aefd52dee
+Author: Etienne Carriere <[email protected]>
+Date:   Tue Dec 18 22:35:16 2018 +0100
+
+    secure_storage: fix deprecated size_t type for size
+    
+    size_t types is an deprecated type used in GPD API v1.0.
+    Update
+    
+    Error reported by GCC 7.3-2018.05:
+      secure_storage_ta.c:203:6: warning: passing argument 4 of 'TEE_ReadObjectData' from incompatible pointer type [-Wincompatible-pointer-types]
+          &read_bytes);
+    
+    Signed-off-by: Etienne Carriere <[email protected]>
+
+diff --git a/secure_storage/ta/secure_storage_ta.c b/secure_storage/ta/secure_storage_ta.c
+index d120e47..3ccc12d 100644
+--- a/secure_storage/ta/secure_storage_ta.c
++++ b/secure_storage/ta/secure_storage_ta.c
+@@ -146,7 +146,7 @@ static TEE_Result read_raw_object(uint32_t param_types, TEE_Param params[4])
+ 	TEE_ObjectHandle object;
+ 	TEE_ObjectInfo object_info;
+ 	TEE_Result res;
+-	size_t read_bytes;
++	uint32_t read_bytes;
+ 	char *obj_id;
+ 	size_t obj_id_sz;
+ 	char *data;
+@@ -202,7 +202,7 @@ static TEE_Result read_raw_object(uint32_t param_types, TEE_Param params[4])
+ 	res = TEE_ReadObjectData(object, data, object_info.dataSize,
+ 				 &read_bytes);
+ 	if (res != TEE_SUCCESS || read_bytes != object_info.dataSize) {
+-		EMSG("TEE_ReadObjectData failed 0x%08x, read %u over %u",
++		EMSG("TEE_ReadObjectData failed 0x%08x, read %" PRIu32 " over %u",
+ 				res, read_bytes, object_info.dataSize);
+ 		goto exit;
+ 	}
package/optee-examples/3.3.0/optee-examples.hash new file +4 -0
new file mode 100644
index 0000000..77b7466
@@ -0,0 +1,4 @@
+# From https://github.com/linaro-swg/optee_examples/archive/3.3.0.tar.gz
+sha256 504642edd1510562dcc213637d8869190dd581986daf938ed3e85088830e0ef9  optee-examples-3.3.0.tar.gz
+# Locally computed
+sha256 6f1ef8449cb82ae79d2155605f7985bdf0f08e7ab5007de9b4362e8bf28733b9  LICENSE
package/optee-examples/Config.in new file +59 -0

59 lines not on this page · raw message

package/optee-examples/optee-examples.mk new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
1.9.1
#27 lore raw

PATCH v3 4/7 optee-test: new package

In reply to Etienne Carriere

OP-TEE test package provide test materials as part of the OP-TEE project helping platforms to verify their OP-TEE components against a set of regression and performance tests.

Package is added in the BR package configuration next to the OP-TEE client package.

This change references in Buildroot the today's latest OP-TEE revision release tagged 3.3.0 with few added patches:
- fix an issue with the CMake files,
- fix few issues with recent GCC releases (8.x)

---
Changes v2 -> v3:
- Add an entry in file DEVELOPERS.
- Clean Config.in layout and description sections.
- Drop BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION.
- Clean optee-test.mk layout.
- Replace common optee-test.hash with per-version .hash files.
- Patch optee_benchmark 3.3.0 against an issue reported by GCC warns.
- Remove dependency of BR2_PACKAGE_OPTEE_EXAMPLES and Arm architecture. As the package depends on BR2_TARGET_OPTEE_OS, leave it to optee-os to define the supported architectures.

Changes v1 -> v2:
- Replace BR2_arm with BR2_ARM_CPU_ARMV7 as OP-TEE supports only BR2_ARM_CPU_ARMV7 architectures among the 32bit Arm machines.
- Add missing dependency on BR2_TARGET_OPTEE_OS and select BR2_PACKAGE_OPTEE_CLIENT when enabled.
- Add option BR2_PACKAGE_OPTEE_TEST_SYNCED_VERSION to ensure OP-TEE test version is synced with OP-TEE OS version.
- Fix official repo URL in Config.in package description.
- Remove useless OPTEE_TEST_INSTALL_STAGING=YES.
- Do not force output build directory and rely on native one: out/.

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 .../optee-test/3.3.0/0001-cmake-rely-on-C.patch    | 32 +++++++++++
 ...ent-unexpected-build-warning-with-strncpy.patch | 54 +++++++++++++++++++
 ...egression-4011-correct-potential-overflow.patch | 60 +++++++++++++++++++++
 package/optee-test/3.3.0/optee-test.hash           |  4 ++
 package/optee-test/Config.in                       | 63 ++++++++++++++++++++++
 package/optee-test/optee-test.mk                   | 45 ++++++++++++++++
 8 files changed, 260 insertions(+)
 create mode 100644 package/optee-test/3.3.0/0001-cmake-rely-on-C.patch
 create mode 100644 package/optee-test/3.3.0/0002-xtest-prevent-unexpected-build-warning-with-strncpy.patch
 create mode 100644 package/optee-test/3.3.0/0003-regression-4011-correct-potential-overflow.patch
 create mode 100644 package/optee-test/3.3.0/optee-test.hash
 create mode 100644 package/optee-test/Config.in
 create mode 100644 package/optee-test/optee-test.mk
DEVELOPERS +1 -0
index c9f2e00..28ba658 100644
@@ -685,6 +685,7 @@ N:	Etienne Carriere <[email protected]>
 F:	boot/optee-os/
 F:	package/optee-client/
 F:	package/optee-examples/
+F:	package/optee-test/
 
 N:	Eugene Tarassov <[email protected]>
 F:	package/tcf-agent/
package/Config.in +1 -0
index b76db17..e5b6dad 100644
@@ -2078,6 +2078,7 @@ menu "Security"
 	source "package/checkpolicy/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/optee-examples/Config.in"
+	source "package/optee-test/Config.in"
 	source "package/paxtest/Config.in"
 	source "package/policycoreutils/Config.in"
 	source "package/refpolicy/Config.in"
package/optee-test/3.3.0/0001-cmake-rely-on-C.patch new file +32 -0
new file mode 100644
index 0000000..ea7b966
@@ -0,0 +1,32 @@
+cmake: component rely on C support
+
+Without specifing optee_client source expects only C source file
+support cmake may attempt to look for resources as g++. When
+building with environments that do not provide such tools as when
+building from native buildroot ofr a qemu target, optee_client
+fails to build. This change ensure a minimal C support allows to
+build optee_client with cmake.
+
+Signed-off-by: Etienne Carriere <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0290205..a3fd269 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,5 @@
+ cmake_minimum_required (VERSION 3.2)
++project (optee_test C)
+ 
+ # Default cross compile settings
+ set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
+diff --git a/ta/CMakeLists.txt b/ta/CMakeLists.txt
+index 22d7727..795237e 100644
+--- a/ta/CMakeLists.txt
++++ b/ta/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-project (xtest-ta-headers)
++project (xtest-ta-headers C)
+ 
+ add_library(${PROJECT_NAME} INTERFACE)
+ 
package/optee-test/3.3.0/0002-xtest-prevent-unexpected-build-warning-with-strncpy.patch new file +54 -0

54 lines not on this page · raw message

package/optee-test/3.3.0/0003-regression-4011-correct-potential-overflow.patch new file +60 -0

60 lines not on this page · raw message

package/optee-test/3.3.0/optee-test.hash new file +4 -0
new file mode 100644
index 0000000..0da2212
@@ -0,0 +1,4 @@
+# From https://github.com/OP-TEE/optee_test/archive/3.3.0.tar.gz
+sha256 9651d5db0d28856e45d6bc25ce603bfcf641435bd3264d95b449f093665c8521  optee-test-3.3.0.tar.gz
+# Locally computed
+sha256 6e6810981f0ddab9e0d44399d0700a15d9f760a3c2843cc866659c2074139ae7  LICENSE.md
package/optee-test/Config.in new file +63 -0

63 lines not on this page · raw message

package/optee-test/optee-test.mk new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
1.9.1
#28 lore raw

PATCH v3 5/7 optee-benchmark: new package

In reply to Etienne Carriere

OP-TEE performance benchmark tools for the OP-TEE project.

This packages generates embedded Linux based OS materials used to retrieve execution timing information on invocation of the OP-TEE secure services.

It is added next to the OP-TEE client package in BR configuration.

This change references in Buildroot the today's latest OP-TEE revision release tagged 3.3.0 with an added patch to fix an issue reported by recent GCC toolchains.

---
Changes v2 -> v3:
- Add an entry in file DEVELOPERS.
- Clean Config.in layout and description sections.
- Drop BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION.
- Clean optee-benchmark.mk layout.
- Replace common optee-benchmark.hash with per-version .hash files.
- Add a patch on 3.3.0 to fix an issue reported through GCC warns.

Changes v1 -> v2:
- Add dependency on OP-TEE client.
- Add option BR2_PACKAGE_OPTEE_BENCHMARK_SYNCED_VERSION to ensure OP-TEE benchmark version is synced with OP-TEE client version.
- Remove useless OPTEE_BENCHMARK_INSTALL_STAGING and OPTEE_BENCHMARK_INSTALL_IMAGES.
- Remove unused BR2_PACKAGE_OPTEE_BENCHMARK_GIT_REFERENCE.
- Remove useless _INSTALL_STAGING/_INSTALL_IMAGES=YES.

---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 ...ix-format-specifier-in-call-to-INFO-macro.patch | 30 ++++++++++++
 package/optee-benchmark/3.3.0/optee-benchmark.hash |  2 +
 package/optee-benchmark/Config.in                  | 55 ++++++++++++++++++++++
 package/optee-benchmark/optee-benchmark.mk         | 22 +++++++++
 6 files changed, 111 insertions(+)
 create mode 100644 package/optee-benchmark/3.3.0/0001-Fix-format-specifier-in-call-to-INFO-macro.patch
 create mode 100644 package/optee-benchmark/3.3.0/optee-benchmark.hash
 create mode 100644 package/optee-benchmark/Config.in
 create mode 100644 package/optee-benchmark/optee-benchmark.mk
DEVELOPERS +1 -0
index 28ba658..4dd7f4a 100644
@@ -683,6 +683,7 @@ F:	package/szip/
 
 N:	Etienne Carriere <[email protected]>
 F:	boot/optee-os/
+F:	package/optee-benchmark/
 F:	package/optee-client/
 F:	package/optee-examples/
 F:	package/optee-test/
package/Config.in +1 -0
index e5b6dad..cdee281 100644
@@ -2076,6 +2076,7 @@ endmenu
 
 menu "Security"
 	source "package/checkpolicy/Config.in"
+	source "package/optee-benchmark/Config.in"
 	source "package/optee-client/Config.in"
 	source "package/optee-examples/Config.in"
 	source "package/optee-test/Config.in"
package/optee-benchmark/3.3.0/0001-Fix-format-specifier-in-call-to-INFO-macro.patch new file +30 -0
new file mode 100644
index 0000000..6a2cd37
@@ -0,0 +1,30 @@
+commit ecba70dd88f33f3c770a4c564b49d7e872eab34e
+Author: ChrisG55 <[email protected]>
+Date:   Thu Dec 6 11:52:29 2018 +0100
+
+    Fix format specifier in call to INFO macro
+    
+    Improper use of format specifiers for arguments of type intptr_t and size_t
+    raises warnings at compile time. Compilation breaks when GCC's -Werror flag is
+    set, which is the default. By using the appropriate format specifiers, no
+    warnings are raised and compilation succeeds.
+    
+    Reported-by: ChrisG55 <[email protected]>
+    Tested-by: ChrisG55 <[email protected]>
+    Fixes: 55fcc4ae0de4b9a2f7253562f8083694e69a8e33
+    Signed-off-by: ChrisG55 <[email protected]>
+    Reviewed-by: Joakim Bech <[email protected]>
+
+diff --git a/main.c b/main.c
+index 3d53dca..86225bd 100644
+--- a/main.c
++++ b/main.c
+@@ -106,7 +106,7 @@ static void alloc_bench_buf(uint32_t cores)
+ 	paddr_ts_buf = op.params[0].value.a;
+ 	size = op.params[0].value.b;
+ 
+-	INFO("ts buffer paddr = %x, size = %d\n", paddr_ts_buf, size);
++	INFO("ts buffer paddr = %" PRIiPTR ", size = %zu\n", paddr_ts_buf, size);
+ 	if (paddr_ts_buf) {
+ 
+ 		bench_ts_global = mmap_paddr(paddr_ts_buf, size);
package/optee-benchmark/3.3.0/optee-benchmark.hash new file +2 -0
new file mode 100644
index 0000000..d93c26c
@@ -0,0 +1,2 @@
+# From https://github.com/linaro-swg/optee_benchmark/archive/3.3.0.tar.gz
+sha256 bfba3749ac8b37628550696f0625452ae8aef060eff5b3b1c4283a5dad8a3383 optee-benchmark-3.3.0.tar.gz
package/optee-benchmark/Config.in new file +55 -0

55 lines not on this page · raw message

package/optee-benchmark/optee-benchmark.mk new file +22 -0
new file mode 100644
index 0000000..8eef0f6
@@ -0,0 +1,22 @@
+################################################################################
+#
+# optee-benchmarch
+#
+################################################################################
+
+OPTEE_BENCHMARK_VERSION = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_VERSION))
+OPTEE_BENCHMARK_LICENSE = BSD-2-Clause
+
+OPTEE_BENCHMARK_DEPENDENCIES = optee-client libyaml
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_LATEST),y)
+OPTEE_BENCHMARK_SITE = $(call github,linaro-swg,optee_benchmark,$(OPTEE_BENCHMARK_VERSION))
+endif
+
+ifeq ($(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_GIT),y)
+OPTEE_BENCHMARK_SITE = $(call qstrip,$(BR2_PACKAGE_OPTEE_BENCHMARK_CUSTOM_REPO_URL))
+OPTEE_BENCHMARK_SITE_METHOD = git
+BR_NO_CHECK_HASH_FOR += $(OPTEE_BENCHMARK_SOURCE)
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#29 lore raw

PATCH v3 6/7 configs/qemu_armv7a_tz_virt: Armv7-A emulation with TrustZone services

In reply to Etienne Carriere

This change introduces a Qemu board for an Armv7-A target executing with OP-TEE secure world services.

The target Linux based normal world embeds the standard minimal filesystem with OP-TEE non-secure components embedded files from OP-TEE test, examples and benchmark packages.

The Linux custom configuration is dumped from the vexpress_defconfig with few added fragments: OP-TEE driver and 9p for virtual filesystem to ease file manipulation and exchanges through Qemu virtfs support.

The standard way for booting OP-TEE with a non-secure world companion use the Arm Trusted Firmware-A as bootloader. OP-TEE OS provides the BL32 image and U-boot the BL33 image. The proposed board enables OP-TEE and U-boot build for this. However package boot/arm-trusted-firmware needs few change support building Armv7-A targets.

Therefore the proposed board allows one to build the images but not yet to run the target with the built Qemu host tool.

---
Changes v2 -> v3
- New change to introduce a board that at least builds Armv7-A OP-TEE.

---
 board/qemu/armv7a-tz-virt/linux.config  | 167 ++++++++++++++++++++++++++++++++
 board/qemu/armv7a-tz-virt/readme.txt    |  11 +++
 board/qemu/armv7a-tz-virt/u-boot.config |   3 +
 configs/qemu_armv7a_tz_virt_defconfig   |  41 ++++++++
 4 files changed, 222 insertions(+)
 create mode 100644 board/qemu/armv7a-tz-virt/linux.config
 create mode 100644 board/qemu/armv7a-tz-virt/readme.txt
 create mode 100644 board/qemu/armv7a-tz-virt/u-boot.config
 create mode 100644 configs/qemu_armv7a_tz_virt_defconfig
board/qemu/armv7a-tz-virt/linux.config new file +167 -0
new file mode 100644
index 0000000..62ece0c
@@ -0,0 +1,167 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_CGROUPS=y
+CONFIG_CPUSETS=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_ARCH_VEXPRESS_DCSCB=y
+CONFIG_ARCH_VEXPRESS_TC2_PM=y
+# CONFIG_SWP_EMULATE is not set
+CONFIG_SMP=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_MCPM=y
+CONFIG_VMSPLIT_2G=y
+CONFIG_NR_CPUS=8
+CONFIG_ARM_PSCI=y
+CONFIG_AEABI=y
+CONFIG_CMA=y
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyAMA0"
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
+CONFIG_VFP=y
+CONFIG_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_PLATRAM=y
+CONFIG_MTD_UBI=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_VIRTIO_BLK=y
+# CONFIG_SCSI_PROC_FS is not set
+CONFIG_BLK_DEV_SD=y
+CONFIG_SCSI_VIRTIO=y
+CONFIG_ATA=y
+# CONFIG_SATA_PMP is not set
+CONFIG_NETDEVICES=y
+CONFIG_VIRTIO_NET=y
+CONFIG_SMC91X=y
+CONFIG_SMSC911X=y
+# CONFIG_WLAN is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_SERIO_AMBAKMI=y
+CONFIG_LEGACY_PTY_COUNT=16
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_VIRTIO=y
+CONFIG_I2C=y
+CONFIG_I2C_VERSATILE=y
+CONFIG_SENSORS_VEXPRESS=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_VEXPRESS=y
+CONFIG_FB=y
+CONFIG_FB_ARMCLCD=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+# CONFIG_SND_DRIVERS is not set
+CONFIG_SND_ARMAACI=y
+CONFIG_HID_DRAGONRISE=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_TWINHAN=y
+CONFIG_HID_NTRIG=y
+CONFIG_HID_PANTHERLORD=y
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+CONFIG_HID_GREENASIA=y
+CONFIG_HID_SMARTJOYPLUS=y
+CONFIG_HID_TOPSEED=y
+CONFIG_HID_THRUSTMASTER=y
+CONFIG_HID_ZEROPLUS=y
+CONFIG_USB=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_MON=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_ISP1760=y
+CONFIG_MMC=y
+CONFIG_MMC_ARMMMCI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PL031=y
+CONFIG_VIRTIO_BALLOON=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+#CONFIG_JFFS2_FS is not set
+CONFIG_UBIFS_FS=y
+CONFIG_CRAMFS=y
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_LZO=y
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
+CONFIG_9P_FS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_DEBUG_USER=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+### Enable OP-TEE
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+### Enable 9P VFS
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
+CONFIG_9P_FS=y
+CONFIG_9P_FS_POSIX_ACL=y
board/qemu/armv7a-tz-virt/readme.txt new file +11 -0
new file mode 100644
index 0000000..06b728f
@@ -0,0 +1,11 @@
+Board qemu_armv7a_tz_virt builds a Qemu Armv7-A target with
+OP-TEE running in the TrustZone secure world setup and a Linux based
+OS running in the non-secure world.
+
+This setup is usually booted with the Arm Trsuted Firmware-A (TF-A from
+package boot/arm-trusted-firmware). However the current Buildroot package
+needs few changes to build TF-A for OP-TEE support.
+
+Until BR arm-trusted-firmware is updated this board allows one to only
+build the secure and non-secure boot images if not the BIOS for the Qemu
+host.
board/qemu/armv7a-tz-virt/u-boot.config new file +3 -0
new file mode 100644
index 0000000..5588008
@@ -0,0 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x60000000
+CONFIG_BOOTCOMMAND="fdt addr ${fdt_addr} && fdt resize 1000 && smhload zImage ${kernel_addr_r} && smhload rootfs.cpio.gz ${ramdisk_addr_r} ramdisk_addr_end &&  setenv bootargs console=ttyAMA0,115200 earlyprintk=serial,ttyAMA0,115200 && fdt chosen ${ramdisk_addr_r} ${ramdisk_addr_end} && bootz ${kernel_addr_r} - ${fdt_addr}"
+CONFIG_SEMIHOSTING=y
configs/qemu_armv7a_tz_virt_defconfig new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
1.9.1
#30 lore raw

PATCH v3 7/7 configs/qemu_aarch64_tz_virt: AArch64 emulation with TrustZone services

In reply to Etienne Carriere

This change introduces a Qemu board for an AArch64 target executing with OP-TEE secure world services.

The target Linux based normal world embeds the standard minimal filesystem with OP-TEE non-secure components embedded files from OP-TEE client, test, examples and benchmark packages.

The Linux custom configuration is dumped from the qemu/aarch64-virt board with few added fragments: OP-TEE driver and 9p for virtual filesystem to ease file manipulation and exchanges through Qemu virtfs support.

The standard way for booting OP-TEE with a non-secure world companion use the Arm Trusted Firmware-A as bootloader. OP-TEE OS provides the BL32 image and U-boot the BL33 image. The proposed board enables OP-TEE and U-boot build for this. However package boot/arm-trusted-firmware needs few changes to build OP-TEE compliant TF-A images.

Therefore the proposed board allows one to build the images but not yet to run the target with the built Qemu host tool.

---
Changes v2 -> v3
- New change to introduce a board that at least builds Aarch64 OP-TEE.

---
 board/qemu/aarch64-tz-virt/linux.config  | 63 ++++++++++++++++++++++++++++++++
 board/qemu/aarch64-tz-virt/readme.txt    | 11 ++++++
 board/qemu/aarch64-tz-virt/u-boot.config |  3 ++
 configs/qemu_aarch64_tz_virt_defconfig   | 47 ++++++++++++++++++++++++
 4 files changed, 124 insertions(+)
 create mode 100644 board/qemu/aarch64-tz-virt/linux.config
 create mode 100644 board/qemu/aarch64-tz-virt/readme.txt
 create mode 100644 board/qemu/aarch64-tz-virt/u-boot.config
 create mode 100644 configs/qemu_aarch64_tz_virt_defconfig
board/qemu/aarch64-tz-virt/linux.config new file +63 -0
new file mode 100644
index 0000000..49b7ac6
@@ -0,0 +1,63 @@
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_TASKSTATS=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_PROFILING=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_BLK_DEV_BSGLIB=y
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_BINFMT_MISC=y
+CONFIG_COMPAT=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_PACKET_DIAG=y
+CONFIG_UNIX=y
+CONFIG_NET_KEY=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_BRIDGE=m
+CONFIG_NET_SCHED=y
+CONFIG_VSOCKETS=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_VIRTIO_BLK=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_CONSTANTS=y
+CONFIG_SCSI_LOGGING=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_VIRTIO=y
+CONFIG_ATA=y
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=y
+CONFIG_MACVLAN=y
+CONFIG_VIRTIO_NET=y
+CONFIG_NLMON=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_VIRTIO_CONSOLE=y
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_VIRTIO=y
+CONFIG_RTC_CLASS=y
+CONFIG_VIRTIO_MMIO=y
+CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
+CONFIG_MAILBOX=y
+CONFIG_PL320_MBOX=y
+CONFIG_EXT4_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+### Enable OP-TEE
+CONFIG_TEE=y
+CONFIG_OPTEE=y
+### Enable 9P VFS
+CONFIG_NET_9P=y
+CONFIG_NET_9P_VIRTIO=y
+CONFIG_9P_FS=y
+CONFIG_9P_FS_POSIX_ACL=y
+
board/qemu/aarch64-tz-virt/readme.txt new file +11 -0
new file mode 100644
index 0000000..ec91d2e
@@ -0,0 +1,11 @@
+Board qemu_aarch64_tz_virt builds a Qemu Armv8-A target with
+OP-TEE running in the TrustZone secure wolrd setup and a Linux based
+OS running in the non-secure wolrd.
+
+This setup is usually booted with the Arm Trsuted Firmware-A (TF-A from
+package boot/arm-trusted-firmware). However the current Buildroot package
+needs few changes to build TF-A for OP-TEE support.
+
+Until BR arm-trusted-firmware is updated this board allows one to only
+build the secure and non-secure boot images if not the BIOS for the Qemu
+host.
board/qemu/aarch64-tz-virt/u-boot.config new file +3 -0
new file mode 100644
index 0000000..5588008
@@ -0,0 +1,3 @@
+CONFIG_SYS_TEXT_BASE=0x60000000
+CONFIG_BOOTCOMMAND="fdt addr ${fdt_addr} && fdt resize 1000 && smhload zImage ${kernel_addr_r} && smhload rootfs.cpio.gz ${ramdisk_addr_r} ramdisk_addr_end &&  setenv bootargs console=ttyAMA0,115200 earlyprintk=serial,ttyAMA0,115200 && fdt chosen ${ramdisk_addr_r} ${ramdisk_addr_end} && bootz ${kernel_addr_r} - ${fdt_addr}"
+CONFIG_SEMIHOSTING=y
configs/qemu_aarch64_tz_virt_defconfig new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
1.9.1