diff options
-rw-r--r-- | conf/machine/include/imx-base.inc | 15 | ||||
-rw-r--r-- | recipes-bsp/imx-atf/imx-atf_2.0.bb | 9 | ||||
-rw-r--r-- | recipes-bsp/imx-mkimage/imx-boot_0.2.bb | 15 |
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" | |||
266 | PREFERRED_VERSION_libdrm_mx7 ?= "2.4.91.imx" | 266 | PREFERRED_VERSION_libdrm_mx7 ?= "2.4.91.imx" |
267 | PREFERRED_VERSION_libdrm_mx8 ?= "2.4.91.imx" | 267 | PREFERRED_VERSION_libdrm_mx8 ?= "2.4.91.imx" |
268 | 268 | ||
269 | # Use i.MX optee Version | ||
270 | PREFERRED_VERSION_optee-os_mx8 ?= "3.2.0.imx" | ||
271 | PREFERRED_VERSION_optee-client_mx8 ?= "3.2.0.imx" | ||
272 | PREFERRED_VERSION_optee-test_mx8 ?= "3.2.0.imx" | ||
273 | |||
269 | # Handle default kernel | 274 | # Handle default kernel |
270 | IMX_DEFAULT_KERNEL = "linux-imx" | 275 | IMX_DEFAULT_KERNEL = "linux-imx" |
271 | IMX_DEFAULT_KERNEL_mxs = "linux-fslc" | 276 | IMX_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 |
288 | WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update" | 293 | WIC_CREATE_EXTRA_ARGS ?= "--no-fstab-update" |
289 | 294 | ||
295 | OPTEE_BOOT_IMAGE = "uTee" | ||
296 | OPTEE_BOOT_IMAGE_aarch64 = "" | ||
297 | |||
298 | SDCARD_ROOTFS ?= "${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4" | ||
299 | |||
290 | IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" | 300 | IMAGE_FSTYPES ?= "${SOC_DEFAULT_IMAGE_FSTYPES}" |
291 | 301 | ||
292 | IMAGE_BOOT_FILES ?= " \ | 302 | IMAGE_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 |
309 | OPTEE_WKS_FILE_DEPENDS = "optee-os" | ||
310 | OPTEE_WKS_FILE_DEPENDS_aarch64 = "" | ||
311 | |||
298 | WKS_FILE_DEPENDS ?= " \ | 312 | WKS_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 | ||
305 | WKS_FILE_DEPENDS_mx8 += "imx-boot" | 320 | WKS_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 | ||
33 | BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" | ||
34 | |||
33 | do_compile() { | 35 | do_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 | ||
39 | do_install[noexec] = "1" | 45 | do_install[noexec] = "1" |
40 | 46 | ||
41 | do_deploy() { | 47 | do_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 | } |
44 | addtask deploy after do_compile | 53 | addtask 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 | " |
18 | DEPENDS_append_mx8m = " dtc-native" | 19 | DEPENDS_append_mx8m = " dtc-native" |
19 | BOOT_NAME = "imx-boot" | 20 | BOOT_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 | ||
35 | SC_FIRMWARE_NAME ?= "scfw_tcm.bin" | 37 | SC_FIRMWARE_NAME ?= "scfw_tcm.bin" |
@@ -39,7 +41,7 @@ ATF_MACHINE_NAME_mx8qm = "bl31-imx8qm.bin" | |||
39 | ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin" | 41 | ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin" |
40 | ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin" | 42 | ATF_MACHINE_NAME_mx8mq = "bl31-imx8mq.bin" |
41 | ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin" | 43 | ATF_MACHINE_NAME_mx8mm = "bl31-imx8mm.bin" |
42 | ATF_MACHINE_NAME_append = "${@bb.utils.contains('COMBINED_FEATURES', 'optee', '-optee', '', d)}" | 44 | ATF_MACHINE_NAME_append = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', '-optee', '', d)}" |
43 | 45 | ||
44 | UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" | 46 | UBOOT_NAME = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}" |
45 | BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin" | 47 | BOOT_CONFIG_MACHINE = "${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG}.bin" |
@@ -52,6 +54,8 @@ SOC_TARGET_mx8qxp = "iMX8QX" | |||
52 | SOC_TARGET_mx8mq = "iMX8M" | 54 | SOC_TARGET_mx8mq = "iMX8M" |
53 | SOC_TARGET_mx8mm = "iMX8MM" | 55 | SOC_TARGET_mx8mm = "iMX8MM" |
54 | 56 | ||
57 | DEPLOY_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" | ||
58 | |||
55 | IMXBOOT_TARGETS ?= \ | 59 | IMXBOOT_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() { | |||
99 | do_compile() { | 103 | do_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 |