From patchwork Mon Nov 19 12:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shyam Saini X-Patchwork-Id: 56 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 9C7062E5436 for ; Mon, 19 Nov 2018 13:58:42 +0100 (CET) Received: by mail-pf1-f200.google.com with SMTP id i19-v6sf26047137pfi.21 for ; Mon, 19 Nov 2018 04:58:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542632320; cv=pass; d=google.com; s=arc-20160816; b=w/K257mnl9knS3xMcC+I1eTjojXvvC8NatkRRV8lNfdNzUKIB0W39W6XUAXcYAms5G oZBsY/KlY5VQ2ZSf3azIngdDBRC5/k9KiqOfSoD98+ftDp9otRsY/ldirXnv8k36tZ1p son26cuBvpXVIbDfMs5I2To4Osvh2o7lrd/Ntr3VtSSfgE5kFcxVAyjsFsXJnkpbysGb 6vqlE+zPqQW0POaUULNhIibNzo79zpL3BB27sr2J09iVyBuZnv2ZQ7nbWY6X9MLKuXIX HHawzj3Tx/DEeg/RXS8Am8xCPdHbsi8IaCJV8uIgMUPiWscxIgItqs/mMuct/DjGNxSD 4SNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:message-id:date:subject:cc:to:from :mime-version:dkim-signature; bh=Mtv50k2pvdC2es7yJ7Mg4MzHs1l7iBsWsVIT3YmqEFE=; b=rtpb8g3BLsWu27rPm4JVWCCAqZsASvs70hsFT00qgrsRK5PB2rbA5q2W7anKt4k3dN zGn6fTo1HI1FwnLhZh6y71RNitP4PHnzYDzchdOQluBDtxlrrF9WSGHhGbwv46RRWxRR jw3MDxvRKbE7Jm3X9WSlGCYwJ8ZbsdVpRViyt7M8NmKrr6HRAOEwpHxJmh9M9xCK+nFD zAxTZhL+ZjgVMCVGbJLcNEDKN5nphaY1rSYKhg6UnHDiLnwRgXqG5GmQX5ks41sSktoq XcMgMQcMgxxgDkES5KNcuWhyoni/GXnFXnGjUC3f4ndhhQfD90tArZODt2dSBcHP5NiV NoRQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SSatK2as; spf=pass (google.com: domain of shyam.saini@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=shyam.saini@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Mtv50k2pvdC2es7yJ7Mg4MzHs1l7iBsWsVIT3YmqEFE=; b=ZsSwMIZ4Q/n3M5wGHPbF6NLBsDZxzfWYLDpO7pJQDHGtj7fj00tKRYgoZHqvqVLD2P N2AmYvQ3kRLvhwzwzWHd9Tn6kO9iYqa2oq58JptwvJ1Uh4HjwF/SUwrR1Nw+jvOrm5nJ jY0chTZyTIzEqNoKgf4BSAoaCG4HLACEyLBZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=Mtv50k2pvdC2es7yJ7Mg4MzHs1l7iBsWsVIT3YmqEFE=; b=JwA+UtgQ2QIglSJR9cHbYYbETGB268h/J/qhzX7KDvUCeSvEwzCW+ZsreSlh2gFR4a qHye+BytndUUBj1H+MOAs7UtdmS6JY8Ky2tRHzzTYD2vXdMh1KZwMkm9puXsc/n07NyI wG8qhHqGDQDzVAczmVTYpe4zMi+ANpem6Kl4esKWuTuldm5Wpy3UAQY01J+l5mZEtIVe Ejxf4qXeA42IqqTr0lztdFU4DpCVTa4HqcQmGTdKTAdCXRa+Hs+jsDx8atU/N27bMLD9 Ai/bCRAWfyG3CQWj/2PsO8iMYG2E9J/1KRgMIfYWc+jedkbjuoGSixa0HIupLnL/PMYA N4xA== X-Gm-Message-State: AA+aEWZDV+eWDDbOOIz+xVkIy/0bQYp6SI5E2u8sBRVQe3AwiIRiVeqV rALQy5JWOp/dk7jg8DN9M4sRFOux X-Google-Smtp-Source: AFSGD/U+eUG5SRJEUpRYtBfEmldPexZCVJlW5ZdUpjV6PbQWgrUjoxsKcyYDXnzoRuSChm8xCPU+Nw== X-Received: by 2002:a65:45c6:: with SMTP id m6mr2074851pgr.103.1542632320165; Mon, 19 Nov 2018 04:58:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:618a:: with SMTP id v132ls8767163pgb.6.gmail; Mon, 19 Nov 2018 04:58:39 -0800 (PST) X-Received: by 2002:a63:40c6:: with SMTP id n189mr19667123pga.355.1542632319798; Mon, 19 Nov 2018 04:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542632319; cv=none; d=google.com; s=arc-20160816; b=xgC8XzJGAoFo6lFbMNakZwAImJ+ys4uTYIp2VpN/v58RASsnqL+orGp6Dp6PSi3pp+ u46J9fdSB57DpTq6cBZLAx6irodMsl4IERtCUUPWh82mMDCodlPnMdtUhezrxjxSPQFp BZNwrFmb6is2qusGpOPIQqAPHjd3rNKKFFpWd0J6t1FZ2EvZsqW6fDcoe4WdX4VTINWk fxzh+KdblVQYqxesEoxGrxONm1OUqkTrO8G3Meb5mWSCHoRYcrWU72VT6joMJeQnPK8e ruYbXjZ2x/TkUYj0/7+g+kHxoTi0Gjz/VtVmlewzQyaMftuKCBa1F6izCRxRuqsy3nsg cM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=Mtv50k2pvdC2es7yJ7Mg4MzHs1l7iBsWsVIT3YmqEFE=; b=v0Va//qP88sE5GfqjkmWGfhlZ/UU7KWhXQqn4wOHQKRVCcRi+89n6+lZ931oXGYzxW ridnWtsX04pGXyNu9RJbSr/+TCtZYGhwrQii60/jtlfqv0IkCl8o+CKwsRgNiW8B4skK 0EE5GJeJmHqIrXlcc1eeO+J2quA5O2IcLDOw/UmN6PrlRJzqSGR7x4Gy15EpObrMITw2 qyoEF8y6MsyCmqoF1miQwCfzcyrtycR81au6XVkwD0I8NHSZ1tz72HvvbImA2oapqtut scqnKDRHlAG224yZhHRDevCJqv6fo8jAtVxv0JXz1e8l/Yfel4Hi4gvfSWx1Dl3ABLSZ /IxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SSatK2as; spf=pass (google.com: domain of shyam.saini@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=shyam.saini@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c14sor44979494pgl.37.2018.11.19.04.58.39 for (Google Transport Security); Mon, 19 Nov 2018 04:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of shyam.saini@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:61c8:: with SMTP id v191mr20304201pgb.242.1542632318675; Mon, 19 Nov 2018 04:58:38 -0800 (PST) Received: from localhost.localdomain ([49.206.203.97]) by smtp.gmail.com with ESMTPSA id x7sm37998971pga.68.2018.11.19.04.58.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Nov 2018 04:58:37 -0800 (PST) From: Shyam Saini To: linux-amarula@amarulasolutions.com Cc: angelo@amarulasolutions.com, jagan@amarulasolutions.com, michael@amarulasolutions.com, Shyam Saini Subject: [PATCH] package: optee: Add package for OPTEE Date: Mon, 19 Nov 2018 18:28:24 +0530 Message-Id: <20181119125824.20449-1-shyam.saini@amarulasolutions.com> X-Mailer: git-send-email 2.11.0 X-Original-Sender: shyam.saini@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SSatK2as; spf=pass (google.com: domain of shyam.saini@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=shyam.saini@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patach adds support for Open Source implementation of arm's Trusted Execution Environment (TEE), Open Portable Trusted Execution Environment(OPTEE) package. This includes optee_os, optee_client, and optee_test. Signed-off-by: Shyam Saini --- package/Config.in | 1 + package/optee/Config.in | 18 ++++ package/optee/optee.mk | 1 + package/optee/optee_client/Config.in | 4 + package/optee/optee_client/optee_client.mk | 4 + package/optee/optee_os/Config.in | 79 ++++++++++++++++ package/optee/optee_os/optee_os.mk | 145 +++++++++++++++++++++++++++++ package/optee/optee_test/Config.in | 27 ++++++ package/optee/optee_test/optee_test.mk | 27 ++++++ 9 files changed, 306 insertions(+) create mode 100644 package/optee/Config.in create mode 100644 package/optee/optee.mk create mode 100644 package/optee/optee_client/Config.in create mode 100644 package/optee/optee_client/optee_client.mk create mode 100644 package/optee/optee_os/Config.in create mode 100644 package/optee/optee_os/optee_os.mk create mode 100644 package/optee/optee_test/Config.in create mode 100644 package/optee/optee_test/optee_test.mk diff --git a/package/Config.in b/package/Config.in index b60e7700ada4..312d2320e7b1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2047,6 +2047,7 @@ endmenu menu "Security" source "package/checkpolicy/Config.in" + source "package/optee/Config.in" source "package/paxtest/Config.in" source "package/policycoreutils/Config.in" source "package/refpolicy/Config.in" diff --git a/package/optee/Config.in b/package/optee/Config.in new file mode 100644 index 000000000000..397866f2ff94 --- /dev/null +++ b/package/optee/Config.in @@ -0,0 +1,18 @@ +config BR2_PACKAGE_OPTEE + bool "Optee" + help + This is a comment that explains what libfoo is. The help text + should be wrapped. + + http://foosoftware.org/libfoo/ +if BR2_PACKAGE_OPTEE + +menu "OPTEE Source" +source package/optee/optee_client/Config.in +source package/optee/optee_os/Config.in +source package/optee/optee_test/Config.in +endmenu + +endif + + diff --git a/package/optee/optee.mk b/package/optee/optee.mk new file mode 100644 index 000000000000..fdebff4ef1b3 --- /dev/null +++ b/package/optee/optee.mk @@ -0,0 +1 @@ +include $(sort $(wildcard package/optee/*/*.mk)) diff --git a/package/optee/optee_client/Config.in b/package/optee/optee_client/Config.in new file mode 100644 index 000000000000..0192b105016b --- /dev/null +++ b/package/optee/optee_client/Config.in @@ -0,0 +1,4 @@ +config BR2_PACKAGE_OPTEE_CLIENT + bool "optee_client" + help + http://github.org/OP-TEE/optee_client diff --git a/package/optee/optee_client/optee_client.mk b/package/optee/optee_client/optee_client.mk new file mode 100644 index 000000000000..36892392e861 --- /dev/null +++ b/package/optee/optee_client/optee_client.mk @@ -0,0 +1,4 @@ +OPTEE_CLIENT_VERSION = 3.3.0 +OPTEE_CLIENT_SITE = $(call github,OP-TEE,optee_client,$(OPTEE_CLIENT_VERSION)) + +$(eval $(cmake-package)) diff --git a/package/optee/optee_os/Config.in b/package/optee/optee_os/Config.in new file mode 100644 index 000000000000..a0598d96cd27 --- /dev/null +++ b/package/optee/optee_os/Config.in @@ -0,0 +1,79 @@ +config BR2_PACKAGE_OPTEE_OS + bool "optee_os" + help + http://github.org/OP-TEE/optee_client + +if BR2_PACKAGE_OPTEE_OS + config BR2_PLATFORM + string "PLAFORM name " + help + Supported platform for which optee_os has to be + build. For example : imx6, rockchip + +endif + +config BR_DEBUG + bool "Enable OPTEE Debug" + default y + help + Enable this to see run time debug logs +if BR_DEBUG + config BR_DEBUG_LEVEL + string "loglevel" + default 3 + help + Choose either of 0,1,2,3,4 +endif +config BR_CUSTOM_DDR_SIZE + bool "custom DDR RAM size" + default y + help + Provide your board specific ddr ram size +if BR_CUSTOM_DDR_SIZE + config BR_DDR_SIZE + string "soc ddr size" + help + Set your soc DDR size to calculate trust zone ram size +endif + +config BR_BOOT_SECONDARY_REQUEST + bool "Enable OP-TEE to respond to SMP boot request" + default y + help + This option enables OP-TEE to respond to SMP boot request: the Rich OS \ + issues this to request OP-TEE to release secondaries cores out of reset, \ + with specific core number and non-secure entry address. +config BR_NS_ENTRY_ADDR + string "NS World physical entry address" + help + Define this to force NS(Non Secure) World physical entry address +config BR_DT + bool "Device Tree Support" + default y + help + Enable device tree address +if BR_DT + config BR_DT_ADDR + string "Device Tree Address" + help + Address of device tree (fdt) file in RAM +endif +config BR_PAGEABLE_ADDR + string "Pageable data physical address" + default 0 + help + Define this to force pageable data physical address +config BR_UART_BASE + string "UART Base Address" + help + uart base for serial console +config BR_PSCI_ARM32 + bool "PSCI support for arm 32" + default y + help + Enable this for cpu idle management which in turn used in cpus sync up +config BR_TEE_BENCHMARK + bool "OPTEE benchmark" + default n + help + Enable this to benchmark optee on your platform diff --git a/package/optee/optee_os/optee_os.mk b/package/optee/optee_os/optee_os.mk new file mode 100644 index 000000000000..de5bdf653a48 --- /dev/null +++ b/package/optee/optee_os/optee_os.mk @@ -0,0 +1,145 @@ +OPTEE_OS_VERSION = 3.3.0 +OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION)) + +#compilation mode flags + +ifeq ($(BR2_ARCH_IS_64),y) +COMPILE_NS_USER=64 +COMPILE_NS_KERNEL=64 +COMPILE_S_USER=64 +COMPILE_S_KERNEL=64 +else +COMPILE_NS_USER=32 +COMPILE_NS_KERNEL=32 +COMPILE_S_USER=32 +COMPILE_S_KERNEL=32 +endif + +# default high verbosity. slow uarts shall specify lower if preferred +CFG_TEE_CORE_LOG_LEVEL ?= 3 + +# default disable latency benchmarks (over all OP-TEE layers) +CFG_TEE_BENCHMARK ?= n + +################################################################################ +# Check coherency of compilation mode +################################################################################ + +ifneq ($(COMPILE_NS_USER),) +ifeq ($(COMPILE_NS_KERNEL),) +$(error COMPILE_NS_KERNEL must be defined as COMPILE_NS_USER=$(COMPILE_NS_USER) is defined) +endif +ifeq (,$(filter $(COMPILE_NS_USER),32 64)) +$(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 or 64) +endif +endif + +ifneq ($(COMPILE_NS_KERNEL),) +ifeq ($(COMPILE_NS_USER),) +$(error COMPILE_NS_USER must be defined as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) is defined) +endif +ifeq (,$(filter $(COMPILE_NS_KERNEL),32 64)) +$(error COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL) - Should be 32 or 64) +endif +endif + +ifeq ($(COMPILE_NS_KERNEL),32) +ifneq ($(COMPILE_NS_USER),32) +$(error COMPILE_NS_USER=$(COMPILE_NS_USER) - Should be 32 as COMPILE_NS_KERNEL=$(COMPILE_NS_KERNEL)) +endif +endif + +ifneq ($(COMPILE_S_USER),) +ifeq ($(COMPILE_S_KERNEL),) +$(error COMPILE_S_KERNEL must be defined as COMPILE_S_USER=$(COMPILE_S_USER) is defined) +endif +ifeq (,$(filter $(COMPILE_S_USER),32 64)) +$(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 or 64) +endif +endif + +ifneq ($(COMPILE_S_KERNEL),) +OPTEE_OS_COMMON_EXTRA_FLAGS ?= O=out/arm +OPTEE_OS_BIN ?= $(@D)/out/arm/core/tee.bin +OPTEE_OS_HEADER_V2_BIN ?= $(@D)/out/arm/core/tee-header_v2.bin +OPTEE_OS_PAGER_V2_BIN ?= $(@D)/out/arm/core/tee-pager_v2.bin +OPTEE_OS_PAGEABLE_V2_BIN ?= $(@D)/out/arm/core/tee-pageable_v2.bin +endif + +ifeq ($(BR_CUSTOM_DDR_SIZE),y) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_DDR_SIZE=$(BR_DDR_SIZE) +endif +ifeq ($(BR_BOOT_SECONDARY_REQUEST),y) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_BOOT_SECONDARY_REQUEST=y +endif + +ifeq ($(BR_NS_ENTRY_ADDR),y) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_NS_ENTRY_ADDR=$(BR_NS_ENTRY_ADDR) +endif +ifeq ($(BR_DT),y) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_DT_ADDR=$(BR_DT_ADDR) +endif +ifneq ($(BR_PAGEABLE_ADDR),) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_PAGEABLE_ADDR=$(BR_PAGEABLE_ADDR) +endif + +ifneq ($(BR_UART_BASE),) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_UART_BASE=$(BR_UART_BASE) +endif + +ifneq ($(BR_PAGEABLE_ADDR),) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_PAGEABLE_ADDR=$(BR_PAGEABLE_ADDR) +endif + +ifeq ($(COMPILE_S_USER),) +$(error COMPILE_S_USER must be defined as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) is defined) +endif +ifeq (,$(filter $(COMPILE_S_KERNEL),32 64)) +$(error COMPILE_S_KERNEL=$(COMPILE_S_KERNEL) - Should be 32 or 64) +endif +ifeq ($(COMPILE_S_KERNEL),32) +ifneq ($(COMPILE_S_USER),32) +$(error COMPILE_S_USER=$(COMPILE_S_USER) - Should be 32 as COMPILE_S_KERNEL=$(COMPILE_S_KERNEL)) +endif +endif + +################################################################################ +# set the compiler when COMPILE_xxx are defined +################################################################################ + +ifeq ($(COMPILE_S_USER),32) +OPTEE_OS_TA_DEV_KIT_DIR ?= $(@D)/out/arm/export-ta_arm32 +endif +ifeq ($(COMPILE_S_USER),64) +OPTEE_OS_TA_DEV_KIT_DIR ?= $(@D)/out/arm/export-ta_arm64 +endif + +ifeq ($(COMPILE_S_KERNEL),64) +OPTEE_OS_COMMON_EXTRA_FLAGS += CFG_ARM64_core=y +endif + +define expand-env-var +awk '{while(match($$0,"[$$]{[^}]*}")) {var=substr($$0,RSTART+2,RLENGTH -3);gsub("[$$]{"var"}",ENVIRON[var])}}1' +endef + +DEBUG ?= 3 + +################################################################################ +# OP-TEE +################################################################################ + +define OPTEE_OS_BUILD_CMDS + $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" CROSS_COMPILE_core="$(TARGET_CROSS)" \ + CFG_TEE_CORE_LOG_LEVEL=$(CFG_TEE_CORE_LOG_LEVEL) \ + $(OPTEE_OS_COMMON_EXTRA_FLAGS) \ + CFG_TEE_BENCHMARK=$(CFG_TEE_BENCHMARK) \ + CFG_PAGEABLE_ADDR=0 \ + CFG_NS_ENTRY_ADDR=0x12000000 CFG_DT_ADDR=0x18000000 \ + CFG_DT=y CFG_PSCI_ARM32=y DEBUG=n \ + CFG_BOOT_SYNC_CPU=n CFG_BOOT_SECONDARY_REQUEST=y \ + CFG_DDR_SIZE=0x1E200000 CFG_UART_BASE=UART4_BASE \ + -C $(@D) PLATFORM="$(BR2_PLATFORM)" +endef + +$(eval $(generic-package)) + diff --git a/package/optee/optee_test/Config.in b/package/optee/optee_test/Config.in new file mode 100644 index 000000000000..8a435d19fa88 --- /dev/null +++ b/package/optee/optee_test/Config.in @@ -0,0 +1,27 @@ +config BR2_PACKAGE_OPTEE_TEST + bool "optee_test" + select BR2_PACKAGE_OPTEE_CLIENT + help + http://github.org/OP-TEE/optee_test + +if BR2_PACKAGE_OPTEE_TEST + +config BR2_PACKAGE_OPTEE_TEST_SITE + string "OP-TEE test path" + default "" + help + The path to the source directory of OP-TEE test + +config BR2_PACKAGE_OPTEE_TEST_SDK + string "OPTEE SDK path" + default "" + help + some help + +config BR2_PACKAGE_OPTEE_TEST_CROSS_COMPILE + string "OPTEE cross compiler" + default "" + help + some help + +endif diff --git a/package/optee/optee_test/optee_test.mk b/package/optee/optee_test/optee_test.mk new file mode 100644 index 000000000000..77b5f61d4ed9 --- /dev/null +++ b/package/optee/optee_test/optee_test.mk @@ -0,0 +1,27 @@ +OPTEE_TEST_VERSION = 3.3.0 +OPTEE_TEST_SITE = $(call github,OP-TEE,optee_test,$(OPTEE_TEST_VERSION)) +OPTEE_TEST_INSTALL_STAGING = YES +OPTEE_TEST_DEPENDENCIES = optee_client openssl host-python-pycrypto +OPTEE_TEST_SDK = "/home/shyam/buildroot/output/build/optee_os-3.3.0/out/arm/export-ta_arm32" +OPTEE_TEST_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_TEST_SDK) + +define OPTEE_TEST_BUILD_TAS + @$(foreach f,$(wildcard $(@D)/ta/*/Makefile), \ + echo Building $f && \ + $(MAKE) CROSS_COMPILE="/home/shyam/buildroot/output/host/bin/arm-linux-gnueabihf-" \ + O=out TA_DEV_KIT_DIR=$(OPTEE_TEST_SDK) \ + $(TARGET_CONFIGURE_OPTS) -C $(dir $f) all &&) true +endef + +define OPTEE_TEST_INSTALL_TAS + @$(foreach f,$(wildcard $(@D)/ta/*/out/*.ta), \ + 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 $(generic-package))