Commit b49e3952 authored by Øyvind Rønningstad's avatar Øyvind Rønningstad Committed by Ioannis Glaropoulos
Browse files

Kconfig.tfm: Add TFM_MCUBOOT_IMAGE_NUMBER config



Controlling the number of images in TFM's BL2/mcuboot.

Signed-off-by: default avatarØyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
parent 20110306
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@
#                        BUILD_PROFILE profile_small)
function(trusted_firmware_build)
  set(options IPC REGRESSION)
  set(oneValueArgs BINARY_DIR BOARD BL2 ISOLATION_LEVEL CMAKE_BUILD_TYPE BUILD_PROFILE)
  set(oneValueArgs BINARY_DIR BOARD BL2 ISOLATION_LEVEL CMAKE_BUILD_TYPE BUILD_PROFILE
    MCUBOOT_IMAGE_NUMBER)
  cmake_parse_arguments(TFM "${options}" "${oneValueArgs}" "" ${ARGN})

  if(NOT DEFINED TFM_BL2)
@@ -63,6 +64,9 @@ function(trusted_firmware_build)
    set(TFM_PROFILE_ARG -DTFM_PROFILE=${TFM_BUILD_PROFILE})
  endif()

  if(DEFINED TFM_MCUBOOT_IMAGE_NUMBER)
    set(MCUBOOT_IMAGE_NUM_ARG -DMCUBOOT_IMAGE_NUMBER=${TFM_MCUBOOT_IMAGE_NUMBER})
  endif()

  set(VENEERS_FILE ${TFM_BINARY_DIR}/secure_fw/s_veneers.o)
  set(PSA_API_NS_PATH ${TFM_BINARY_DIR}/interface/libpsa_api_ns.a)
@@ -125,6 +129,7 @@ function(trusted_firmware_build)
               ${TFM_ISOLATION_LEVEL_ARG}
               ${TFM_REGRESSION_ARG}
               ${TFM_PROFILE_ARG}
               ${MCUBOOT_IMAGE_NUM_ARG}
               -DTFM_TEST_REPO_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/tf-m-tests
               -DMCUBOOT_PATH=${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/../tfm-mcuboot
    BUILD_ALWAYS True
@@ -207,12 +212,17 @@ if (CONFIG_BUILD_WITH_TFM)
  elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO)
    set(TFM_CMAKE_BUILD_TYPE "RelWithDebInfo")
  endif()
  if (DEFINED CONFIG_TFM_MCUBOOT_IMAGE_NUMBER)
    set(TFM_IMAGE_NUMBER_ARG
        MCUBOOT_IMAGE_NUMBER ${CONFIG_TFM_MCUBOOT_IMAGE_NUMBER})
  endif()

  trusted_firmware_build(
    BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
    BOARD ${CONFIG_TFM_BOARD}
    ${TFM_ISOLATION_LEVEL_ARG}
    ${TFM_PROFILE_ARG}
    ${TFM_IMAGE_NUMBER_ARG}
    ${TFM_BL2_ARG}
    ${TFM_IPC_ARG}
    ${TFM_REGRESSION_ARG}
+10 −0
Original line number Diff line number Diff line
@@ -116,6 +116,16 @@ config TFM_BL2_FALSE

endchoice

config TFM_MCUBOOT_IMAGE_NUMBER
	int "Granularity of FW updates of TFM and app"
	range 1 2
	default 2
	help
	  How many images the bootloader sees when it looks at TFM and the app.
	  When this is 1, the S and NS are considered as 1 image and must be
	  updated in one atomic operation. When this is 2, they are split and
	  can be updated independently if dependency requirements are met.

config TFM_IPC
	bool "IPC"
	help