modules: trusted-firmware-m: Allow application to use qcbor TF-M

QCBOR cannot be shipped with Zephyr.
Allow the application to supply their own copy of QCBOR or let the TF-M
build system automatically download this dependency.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2023-02-10 15:07:43 +01:00 committed by Stephanos Ioannidis
commit dd47f4c730
2 changed files with 21 additions and 2 deletions

View file

@ -238,7 +238,7 @@ if (CONFIG_BUILD_WITH_TFM)
message(FATAL_ERROR "Unsupported ZEPHYR_TOOLCHAIN_VARIANT: ${ZEPHYR_TOOLCHAIN_VARIANT}")
endif()
if (CONFIG_TFM_PARTITION_INITIAL_ATTESTATION)
if (CONFIG_TFM_PARTITION_INITIAL_ATTESTATION AND CONFIG_TFM_QCBOR_PATH STREQUAL "")
# TODO: Remove this when QCBOR licensing issues w/t_cose have been resolved,
# or only allow it when 'QCBOR_PATH' is set to a local path where QCBOR has
# been manually downloaded by the user before starting the build.
@ -248,7 +248,7 @@ if (CONFIG_BUILD_WITH_TFM)
)
endif()
if (CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION)
if (CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION AND CONFIG_TFM_QCBOR_PATH STREQUAL "")
# TODO: Remove this when QCBOR licensing issues w/t_cose have been resolved,
# or only allow it when 'QCBOR_PATH' is set to a local path where QCBOR has
# been manually downloaded by the user before starting the build.
@ -258,6 +258,14 @@ if (CONFIG_BUILD_WITH_TFM)
)
endif()
if (CONFIG_TFM_QCBOR_PATH STREQUAL "DOWNLOAD")
# Change CMake cache type to string to avoid QCBOR_PATH=/absolute/path/DOWNLOAD being set.
set(QCBOR_PATH_TYPE ":STRING")
endif()
# Always set QCBOR_PATH, this will make sure that we don't automatically download this
# dependency in the TF-M build system and it will fail when set to an invalid value.
list(APPEND TFM_CMAKE_ARGS -DQCBOR_PATH${QCBOR_PATH_TYPE}=${CONFIG_TFM_QCBOR_PATH})
if(CONFIG_BOARD_LPCXPRESSO55S69_CPU0)
# Supply path to NXP HAL sources used for TF-M build
set(TFM_PLATFORM_NXP_HAL_FILE_PATH ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/platform/ext/target/nxp/)

View file

@ -280,6 +280,17 @@ config TFM_MCUBOOT_PATH_DOWNLOAD
endchoice
config TFM_QCBOR_PATH
string
prompt "Path to QCBOR or DOWNLOAD to fetch automatically"
default ""
help
Path to QCBOR for TF-M builds. Due to a license issue with this
library Zephyr does not ship with this library.
If the application wishes to still use this library they can point
to their own checkout of this library, or set to DOWNLOAD to allow
TF-M build system to automatically download this.
config TFM_MCUBOOT_DATA_SHARING
bool "Share app-specific data between TF-M and MCUBoot"
help