public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH v2 11/11] meta-isar: Add OP-TEE to STM32MP15x board
Date: Thu, 15 Oct 2020 11:43:40 +0200	[thread overview]
Message-ID: <fbc1e93cc2b6e4c016a9774c5e1278621259d735.1602755020.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1602755020.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This builds OP-TEE 3.10.0 for the "stm32mp1" platform and installs the
generated binaries in the required partitions for the STM32MP15x. Serves
as a demo and test for building custom OP-TEE packages.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta-isar/conf/machine/stm32mp15x.conf        |  4 ++--
 .../optee-os/optee-os-stm32mp15x_3.10.0.bb    | 19 +++++++++++++++++++
 .../trusted-firmware-a-stm32mp15x_2.3.bb      |  2 +-
 .../lib/wic/canned-wks/stm32mp15x.wks.in      |  4 ++++
 4 files changed, 26 insertions(+), 3 deletions(-)
 create mode 100644 meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.10.0.bb

diff --git a/meta-isar/conf/machine/stm32mp15x.conf b/meta-isar/conf/machine/stm32mp15x.conf
index 66a47df4..e963d080 100644
--- a/meta-isar/conf/machine/stm32mp15x.conf
+++ b/meta-isar/conf/machine/stm32mp15x.conf
@@ -13,7 +13,7 @@ U_BOOT_BIN_stm32mp15x = "u-boot.stm32"
 
 IMAGE_TYPE ?= "wic-img"
 WKS_FILE ?= "stm32mp15x.wks.in"
-IMAGER_INSTALL += "trusted-firmware-a-stm32mp15x u-boot-stm32mp15x"
-IMAGER_BUILD_DEPS += "trusted-firmware-a-stm32mp15x u-boot-stm32mp15x"
+IMAGER_INSTALL += "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x u-boot-stm32mp15x"
+IMAGER_BUILD_DEPS += "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x u-boot-stm32mp15x"
 
 IMAGE_INSTALL += "u-boot-script"
diff --git a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.10.0.bb b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.10.0.bb
new file mode 100644
index 00000000..a2570946
--- /dev/null
+++ b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.10.0.bb
@@ -0,0 +1,19 @@
+#
+# Copyright (c) Siemens AG, 2020
+#
+# SPDX-License-Identifier: MIT
+
+require recipes-bsp/optee-os/optee-os-custom.inc
+
+SRC_URI += "https://github.com/OP-TEE/optee_os/archive/${PV}.tar.gz"
+SRC_URI[sha256sum] = "d30776ab051b701cdd2b71d32ff5cd54285a688440cc90aefd14b4f0f6495d7c"
+
+S = "${WORKDIR}/optee_os-${PV}"
+
+DEBIAN_BUILD_DEPENDS += ", device-tree-compiler"
+
+OPTEE_PLATFORM = "stm32mp1"
+OPTEE_EXTRA_BUILDARGS = " \
+    ARCH=arm CFG_EMBED_DTB_SOURCE_FILE=stm32mp157c-ev1.dts \
+    CFG_TEE_CORE_LOG_LEVEL=2"
+OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32"
diff --git a/meta-isar/recipes-bsp/trusted-firmware-a/trusted-firmware-a-stm32mp15x_2.3.bb b/meta-isar/recipes-bsp/trusted-firmware-a/trusted-firmware-a-stm32mp15x_2.3.bb
index 0a45ec36..33836ea9 100644
--- a/meta-isar/recipes-bsp/trusted-firmware-a/trusted-firmware-a-stm32mp15x_2.3.bb
+++ b/meta-isar/recipes-bsp/trusted-firmware-a/trusted-firmware-a-stm32mp15x_2.3.bb
@@ -14,7 +14,7 @@ DEBIAN_BUILD_DEPENDS += ", device-tree-compiler"
 
 TF_A_PLATFORM = "stm32mp1"
 TF_A_EXTRA_BUILDARGS = " \
-    ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=sp_min \
+    ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=optee \
     STM32MP_SDMMC=1 STM32MP_EMMC=1 \
     STM32MP_RAW_NAND=1 STM32MP_SPI_NAND=1 STM32MP_SPI_NOR=1 \
     DTB_FILE_NAME=stm32mp157c-ev1.dtb"
diff --git a/meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in b/meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in
index 5abaa833..744330e6 100644
--- a/meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in
+++ b/meta-isar/scripts/lib/wic/canned-wks/stm32mp15x.wks.in
@@ -7,6 +7,10 @@ part fsbl1 --part-name fsbl1 --source rawcopy --sourceparams "file=/usr/lib/trus
 part fsbl2 --part-name fsbl2 --source rawcopy --sourceparams "file=/usr/lib/trusted-firmware-a/${MACHINE}/tf-a-stm32mp157c-ev1.stm32" --fstype=ext4 --fsoptions "noauto" --part-type 0x8301 --fixed-size 256K
 part ssbl --part-name ssbl --source rawcopy --sourceparams "file=/usr/lib/u-boot/${MACHINE}/u-boot.stm32" --fstype=ext4 --fsoptions "noauto" --part-type 0x8301 --fixed-size 2048K
 
+part teeh --part-name teeh --source rawcopy --sourceparams "file=/usr/lib/optee-os/${MACHINE}/tee-header_v2.stm32" --fstype=ext4 --fsoptions "noauto" --part-type 0x8301 --fixed-size 256K
+part teed --part-name teed --source rawcopy --sourceparams "file=/usr/lib/optee-os/${MACHINE}/tee-pageable_v2.stm32" --fstype=ext4 --fsoptions "noauto" --part-type 0x8301 --fixed-size 512K
+part teex --part-name teex --source rawcopy --sourceparams "file=/usr/lib/optee-os/${MACHINE}/tee-pager_v2.stm32" --fstype=ext4 --fsoptions "noauto" --part-type 0x8301 --fixed-size 256K
+
 part / --source rootfs-u-boot --fstype ext4 --label root --align 1024 --active --use-uuid
 
 bootloader --ptable gpt --append="rootwait rw console=ttySTM0,115200"
-- 
2.26.2


  parent reply	other threads:[~2020-10-15  9:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15  9:43 [PATCH v2 00/11] Support for building TF-A and OP-TEE, add " Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 01/11] meta-isar: Lift de0-nano-soc build to buster Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 02/11] meta-isar: linux-mainline: Update to latest 5.4.70 Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 03/11] meta-isar: u-boot: Update to 2020.10 Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 04/11] meta-isar: u-boot: Factor our de0-nano-soc recipe Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 05/11] meta-isar: example-raw: Purge securetty from target image Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 06/11] Add STM32MP15x eval board Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 07/11] Add recipe include for building custom Trusted Firmware A Jan Kiszka
2020-11-21 13:42   ` [PATCH v3 " Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 08/11] stm32mp15x: Switch to TF-A based boot Jan Kiszka
2020-11-21 13:42   ` [PATCH v3 " Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 09/11] Add recipe include for building custom OP-TEE Jan Kiszka
2020-11-21 18:05   ` [PATCH v3 " Jan Kiszka
2020-10-15  9:43 ` [PATCH v2 10/11] meta-isar: u-boot-stm32mp15x: Add patches needed for OP-TEE usage Jan Kiszka
2020-10-15  9:43 ` Jan Kiszka [this message]
2020-11-21  7:35 ` [PATCH v2 00/11] Support for building TF-A and OP-TEE, add STM32MP15x board Jan Kiszka
2020-11-22 14:46   ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fbc1e93cc2b6e4c016a9774c5e1278621259d735.1602755020.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox