summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Griffin <peter.griffin@linaro.org>2019-10-25 11:04:01 +0200
committerOtavio Salvador <otavio@ossystems.com.br>2019-11-08 15:31:25 -0300
commit2cbca9a255674649730b3f440a6142cf16030267 (patch)
treefea93a817d4c523b5822036363b885057ec3078c
parentd331f7043142626ce2250ccd7f9a3e4791b1d377 (diff)
downloadmeta-freescale-2cbca9a255674649730b3f440a6142cf16030267.tar.gz
optee: Add support for optee imx fork to imx8mqevk
optee imx fork like most other imx forked components is more fully featured for imx devices and supports things like CAAM accleration. Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
-rw-r--r--conf/machine/include/imx-base.inc15
-rw-r--r--recipes-bsp/imx-atf/imx-atf_2.0.bb9
-rw-r--r--recipes-bsp/imx-mkimage/imx-boot_0.2.bb15
3 files changed, 38 insertions, 1 deletions
diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index 7e5437d3..459b98d4 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -266,6 +266,11 @@ PREFERRED_VERSION_libdrm_mx6 ?= "2.4.91.imx"
266PREFERRED_VERSION_libdrm_mx7 ?= "2.4.91.imx" 266PREFERRED_VERSION_libdrm_mx7 ?= "2.4.91.imx"
267PREFERRED_VERSION_libdrm_mx8 ?= "2.4.91.imx" 267PREFERRED_VERSION_libdrm_mx8 ?= "2.4.91.imx"
268 268
269# Use i.MX optee Version
270PREFERRED_VERSION_optee-os_mx8 ?= "3.2.0.imx"
271PREFERRED_VERSION_optee-client_mx8 ?= "3.2.0.imx"
272PREFERRED_VERSION_optee-test_mx8 ?= "3.2.0.imx"
273
269# Handle default kernel 274# Handle default kernel
270IMX_DEFAULT_KERNEL = "linux-imx" 275IMX_DEFAULT_KERNEL = "linux-imx"
271IMX_DEFAULT_KERNEL_mxs = "linux-fslc" 276IMX_DEFAULT_KERNEL_mxs = "linux-fslc"
@@ -287,19 +292,29 @@ SOC_DEFAULT_IMAGE_FSTYPES_mxs = "uboot-mxsboot-sdcard wic.gz"
287# Do not update fstab file when using wic images 292# Do not update fstab file when using wic images
288WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update" 293WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update"
289 294
295OPTEE_BOOT_IMAGE = "uTee"
296OPTEE_BOOT_IMAGE_aarch64 = ""
297
298SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4"
299
290IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" 300IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}"
291 301
292IMAGE_BOOT_FILES ?= " \ 302IMAGE_BOOT_FILES ?= " \
293 ${KERNEL_IMAGETYPE} \ 303 ${KERNEL_IMAGETYPE} \
294 ${@make_dtb_boot_files(d)} \ 304 ${@make_dtb_boot_files(d)} \
305 ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_BOOT_IMAGE}', '', d)} \
295" 306"
296 307
297### wic default support 308### wic default support
309OPTEE_WKS_FILE_DEPENDS = "optee-os"
310OPTEE_WKS_FILE_DEPENDS_aarch64 = ""
311
298WKS_FILE_DEPENDS ?= " \ 312WKS_FILE_DEPENDS ?= " \
299 virtual/bootloader \ 313 virtual/bootloader \
300 \ 314 \
301 e2fsprogs-native \ 315 e2fsprogs-native \
302 bmap-tools-native \ 316 bmap-tools-native \
317 ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_WKS_FILE_DEPENDS}', '', d)} \
303" 318"
304 319
305WKS_FILE_DEPENDS_mx8 += "imx-boot" 320WKS_FILE_DEPENDS_mx8 += "imx-boot"
diff --git a/recipes-bsp/imx-atf/imx-atf_2.0.bb b/recipes-bsp/imx-atf/imx-atf_2.0.bb
index 6a1ed74d..15122520 100644
--- a/recipes-bsp/imx-atf/imx-atf_2.0.bb
+++ b/recipes-bsp/imx-atf/imx-atf_2.0.bb
@@ -30,16 +30,25 @@ EXTRA_OEMAKE += " \
30 PLAT=${PLATFORM} \ 30 PLAT=${PLATFORM} \
31" 31"
32 32
33BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}"
34
33do_compile() { 35do_compile() {
34 # Clear LDFLAGS to avoid the option -Wl recognize issue 36 # Clear LDFLAGS to avoid the option -Wl recognize issue
35 unset LDFLAGS 37 unset LDFLAGS
36 oe_runmake bl31 38 oe_runmake bl31
39 if ${BUILD_OPTEE}; then
40 oe_runmake clean BUILD_BASE=build-optee
41 oe_runmake BUILD_BASE=build-optee SPD=opteed bl31
42 fi
37} 43}
38 44
39do_install[noexec] = "1" 45do_install[noexec] = "1"
40 46
41do_deploy() { 47do_deploy() {
42 install -Dm 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}.bin 48 install -Dm 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}.bin
49 if ${BUILD_OPTEE}; then
50 install -m 0644 ${S}/build-optee/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/${BOOT_TOOLS}/bl31-${PLATFORM}.bin-optee
51 fi
43} 52}
44addtask deploy after do_compile 53addtask deploy after do_compile
45 54
diff --git a/recipes-bsp/imx-mkimage/imx-boot_0.2.bb b/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
index 04e8b11e..7518c911 100644
--- a/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
+++ b/recipes-bsp/imx-mkimage/imx-boot_0.2.bb
@@ -14,6 +14,7 @@ DEPENDS += " \
14 firmware-imx \ 14 firmware-imx \
15 ${IMX_EXTRA_FIRMWARE} \ 15 ${IMX_EXTRA_FIRMWARE} \
16 imx-atf \ 16 imx-atf \
17 ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'optee-os', '', d)} \
17" 18"
18DEPENDS_append_mx8m = " dtc-native" 19DEPENDS_append_mx8m = " dtc-native"
19BOOT_NAME = "imx-boot" 20BOOT_NAME = "imx-boot"
@@ -30,6 +31,7 @@ do_compile[depends] += " \
30 virtual/bootloader:do_deploy \ 31 virtual/bootloader:do_deploy \
31 ${@' '.join('%s:do_deploy' % r for r in '${IMX_EXTRA_FIRMWARE}'.split() )} \ 32 ${@' '.join('%s:do_deploy' % r for r in '${IMX_EXTRA_FIRMWARE}'.split() )} \
32 imx-atf:do_deploy \ 33 imx-atf:do_deploy \
34 ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'optee-os:do_deploy', '', d)} \
33" 35"
34 36
35SC_FIRMWARE_NAME ?= "scfw_tcm.bin" 37SC_FIRMWARE_NAME ?= "scfw_tcm.bin"
@@ -39,7 +41,7 @@ ATF_MACHINE_NAME_mx8qm = "bl31-imx8qm.bin"
39ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin" 41ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin"
40ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin" 42ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin"
41ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin" 43ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin"
42ATF_MACHINE_NAME_append = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', '-optee', '', d)}" 44ATF_MACHINE_NAME_append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', '-optee', '', d)}"
43 45
44UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" 46UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}"
45BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin" 47BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin"
@@ -52,6 +54,8 @@ SOC_TARGET_mx8qxp = "iMX8QX"
52SOC_TARGET_mx8mq = "iMX8M" 54SOC_TARGET_mx8mq = "iMX8M"
53SOC_TARGET_mx8mm = "iMX8MM" 55SOC_TARGET_mx8mm = "iMX8MM"
54 56
57DEPLOY_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}"
58
55IMXBOOT_TARGETS ?= \ 59IMXBOOT_TARGETS ?= \
56 "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \ 60 "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
57 bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \ 61 bb.utils.contains('UBOOT_CONFIG', 'nand', 'flash_nand', \
@@ -99,6 +103,9 @@ compile_mx8x() {
99do_compile() { 103do_compile() {
100 compile_${SOC_FAMILY} 104 compile_${SOC_FAMILY}
101 # mkimage for i.MX8 105 # mkimage for i.MX8
106 if ${DEPLOY_OPTEE}; then
107 cp ${DEPLOY_DIR_IMAGE}/tee.bin ${BOOT_STAGING}
108 fi
102 for target in ${IMXBOOT_TARGETS}; do 109 for target in ${IMXBOOT_TARGETS}; do
103 bbnote "building ${SOC_TARGET} - ${target}" 110 bbnote "building ${SOC_TARGET} - ${target}"
104 make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${target} 111 make SOC=${SOC_TARGET} dtbs=${UBOOT_DTB_NAME} ${target}
@@ -141,6 +148,12 @@ do_deploy() {
141 deploy_${SOC_FAMILY} 148 deploy_${SOC_FAMILY}
142 # copy the tool mkimage to deploy path and sc fw, dcd and uboot 149 # copy the tool mkimage to deploy path and sc fw, dcd and uboot
143 install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${DEPLOYDIR}/${BOOT_TOOLS} 150 install -m 0644 ${DEPLOY_DIR_IMAGE}/${UBOOT_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
151
152 # copy tee.bin to deploy path
153 if ${DEPLOY_OPTEE}; then
154 install -m 0644 ${DEPLOY_DIR_IMAGE}/tee.bin ${DEPLOYDIR}/${BOOT_TOOLS}
155 fi
156
144 # copy makefile (soc.mak) for reference 157 # copy makefile (soc.mak) for reference
145 install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS} 158 install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
146 # copy the generated boot image to deploy path 159 # copy the generated boot image to deploy path