summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hemp <c.hemp@phytec.de>2018-09-07 14:00:06 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2018-09-07 17:27:17 +0200
commit79d8b9228a1ef9d2e4f5ffe1b2d85829a9718b4e (patch)
treed070011b70d06bc618c8cc579c5cafb6b21f3268
parent13a27955c922ce51ab07b2a2f03416d404732f6b (diff)
downloadmeta-phytec-79d8b9228a1ef9d2e4f5ffe1b2d85829a9718b4e.tar.bz2
meta-phytec-79d8b9228a1ef9d2e4f5ffe1b2d85829a9718b4e.zip
dynamic: fsl-bsp-release: security: Add optee-os recipe
The optee-os-imx_git recipe is a copy of the fsl-bsp-release layer and the phyBOARD-Polaris. This is necessary because NXP uses an anonymous Python class in the optee-os recipe. There is no way to overwrite them. But we have to add our machine otherwise the BSP will not build. Signed-off-by: Christian Hemp <c.hemp@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rwxr-xr-xdynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx/0001-core-imx-Add-phyboard-polaris-1-support.patch71
-rw-r--r--dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx_git.bb98
2 files changed, 169 insertions, 0 deletions
diff --git a/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx/0001-core-imx-Add-phyboard-polaris-1-support.patch b/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx/0001-core-imx-Add-phyboard-polaris-1-support.patch
new file mode 100755
index 0000000..9794f54
--- /dev/null
+++ b/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx/0001-core-imx-Add-phyboard-polaris-1-support.patch
@@ -0,0 +1,71 @@
+From de5b5aa4605d8e09767141e0d74b58bb81172d79 Mon Sep 17 00:00:00 2001
+From: Christian Hemp <c.hemp@phytec.de>
+Date: Wed, 5 Sep 2018 09:31:16 +0200
+Subject: [PATCH] core: imx: Add phyboard-polaris-1 support
+
+Add support for phyBOARD-Polaris-1 with 1GB RAM.
+
+Signed-off-by: Christian Hemp <c.hemp@phytec.de>
+---
+ core/arch/arm/plat-imx/conf.mk | 6 +++++-
+ core/arch/arm/plat-imx/config/config_imx8m.h | 5 +++++
+ core/arch/arm/plat-imx/tzasc.c | 3 ++-
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/core/arch/arm/plat-imx/conf.mk b/core/arch/arm/plat-imx/conf.mk
+index e63946d..b6842a6 100644
+--- a/core/arch/arm/plat-imx/conf.mk
++++ b/core/arch/arm/plat-imx/conf.mk
+@@ -13,7 +13,7 @@ mx6sl-flavorlist = mx6slevk
+ mx6sll-flavorlist = mx6sllevk
+ mx7-flavorlist = mx7dsabresd
+ mx7ulp-flavorlist = mx7ulpevk
+-mx8m-flavorlist = mx8mqevk
++mx8m-flavorlist = mx8mqevk phyboardpolarisimx8m1
+
+ ifneq (,$(filter $(PLATFORM_FLAVOR),$(mx6ul-flavorlist)))
+ $(call force,CFG_MX6,y)
+@@ -293,6 +293,10 @@ ifneq (,$(filter $(PLATFORM_FLAVOR),mx8mqevk))
+ CFG_DDR_SIZE ?= 0xC0000000
+ endif
+
++ifneq (,$(filter $(PLATFORM_FLAVOR),phyboardpolarisimx8m1))
++CFG_DDR_SIZE ?= 0x40000000
++endif
++
+ ifeq ($(filter y, $(CFG_PSCI_ARM32)), y)
+ CFG_HWSUPP_MEM_PERM_WXN = n
+ CFG_IMX_WDOG ?= y
+diff --git a/core/arch/arm/plat-imx/config/config_imx8m.h b/core/arch/arm/plat-imx/config/config_imx8m.h
+index 48ef76d..68c90e7 100644
+--- a/core/arch/arm/plat-imx/config/config_imx8m.h
++++ b/core/arch/arm/plat-imx/config/config_imx8m.h
+@@ -4,6 +4,11 @@
+ *
+ */
+
++
++#if defined(PLATFORM_FLAVOR_phyboardpolarisimx8m1)
++#define CFG_UART_BASE (UART2_BASE)
++#endif
++
+ #ifndef CFG_UART_BASE
+ #define CFG_UART_BASE (UART1_BASE)
+ #endif
+diff --git a/core/arch/arm/plat-imx/tzasc.c b/core/arch/arm/plat-imx/tzasc.c
+index 4755737..0087e19 100644
+--- a/core/arch/arm/plat-imx/tzasc.c
++++ b/core/arch/arm/plat-imx/tzasc.c
+@@ -271,7 +271,8 @@ static int board_imx_tzasc_configure(vaddr_t addr)
+
+ return 0;
+ }
+-#elif defined(PLATFORM_FLAVOR_mx8mqevk)
++#elif (defined(PLATFORM_FLAVOR_mx8mqevk) \
++ || defined(PLATFORM_FLAVOR_phyboardpolarisimx8m1))
+ static int board_imx_tzasc_configure(vaddr_t addr)
+ {
+ tzc_init(addr);
+--
+2.7.4
+
diff --git a/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx_git.bb b/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx_git.bb
new file mode 100644
index 0000000..0c474c5
--- /dev/null
+++ b/dynamic-layers/fsl-bsp-release/recipes-security/optee-imx/optee-os-imx_git.bb
@@ -0,0 +1,98 @@
+# Copyright (C) 2017-2018 NXP
+
+SUMMARY = "OPTEE OS"
+DESCRIPTION = "OPTEE OS"
+HOMEPAGE = "http://www.optee.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b"
+
+inherit deploy pythonnative autotools
+DEPENDS = "python-pycrypto-native u-boot-mkimage-native"
+
+SRCBRANCH = "imx_4.9.88_2.0.0_ga"
+OPTEE_OS_SRC ?= "git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https"
+SRC_URI = "${OPTEE_OS_SRC};branch=${SRCBRANCH}"
+SRCREV = "17fec4d15572a06f354b00bf7ec9be08123ba3db"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+SRC_URI_append = " file://0001-core-imx-Add-phyboard-polaris-1-support.patch"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build.${OPTEE_PLATFORM}"
+
+python () {
+ machine = d.getVar("MACHINE", True)
+
+ import re
+ if re.match('imx6qpdlsolox',machine):
+ subplatform = 'mx6qsabresd'
+ elif re.match('imx6ul7d',machine):
+ subplatform = 'mx6ulevk'
+ elif re.match('imx6ull',machine):
+ subplatform = 'mx6ullevk'
+ elif re.match('imx',machine):
+ subplatform = machine[1:]
+ elif re.match('phyboard-polaris-imx8m-1',machine):
+ subplatform = 'phyboardpolarisimx8m1'
+ else:
+ bb.fatal("optee-os-imx doesn't recognize this MACHINE")
+ d.setVar("OPTEE_PLATFORM", subplatform)
+}
+
+OPTEE_ARCH ?= "arm32"
+OPTEE_ARCH_armv7a = "arm32"
+OPTEE_ARCH_aarch64 = "arm64"
+
+# Optee-os can be built for 32 bits and 64 bits at the same time
+# as long as the compilers are correctly defined.
+# For 64bits, CROSS_COMPILE64 must be set
+# When defining CROSS_COMPILE and CROSS_COMPILE64, we assure that
+# any 32 or 64 bits builds will pass
+EXTRA_OEMAKE = "PLATFORM=imx PLATFORM_FLAVOR=${OPTEE_PLATFORM} \
+ CROSS_COMPILE=${HOST_PREFIX} \
+ CROSS_COMPILE64=${HOST_PREFIX} \
+ NOWERROR=1 \
+ LDFLAGS= \
+ O=${B} \
+ "
+
+do_compile () {
+ unset LDFLAGS
+ export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
+ oe_runmake -C ${S} all CFG_TEE_TA_LOG_LEVEL=0
+}
+
+
+do_deploy () {
+ install -d ${DEPLOYDIR}
+ ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${OPTEE_PLATFORM}.bin
+
+ IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \
+ uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \
+ -d ${DEPLOYDIR}/tee.${OPTEE_PLATFORM}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT}
+
+ cd ${DEPLOYDIR}
+ ln -sf tee.${OPTEE_PLATFORM}.bin tee.bin
+ cd -
+}
+
+do_install () {
+ install -d ${D}/lib/firmware/
+ install -m 644 ${B}/core/*.bin ${D}/lib/firmware/
+
+ # Install the TA devkit
+ install -d ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
+
+ for f in ${B}/export-ta_${OPTEE_ARCH}/*; do
+ cp -aR $f ${D}/usr/include/optee/export-user_ta_${OPTEE_ARCH}/
+ done
+}
+
+addtask deploy after do_compile before do_install
+
+
+FILES_${PN} = "/lib/firmware/"
+FILES_${PN}-dev = "/usr/include/optee"
+INSANE_SKIP_${PN}-dev = "staticdev"
+
+COMPATIBLE_MACHINE = "(mx6|mx7|mx8m)"