1#-------------------------------------------------------------------------------
2# Copyright (c) 2022, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8# It requires platform to enable network connectivity and
9# bootloader to support Firmware Update service
10if(NOT DEFINED PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT)
11    set(PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT OFF)
12endif()
13
14set(TFM_PARTITION_FIRMWARE_UPDATE         OFF         CACHE BOOL      "Enable firmware update partition")
15set(TFM_FWU_BOOTLOADER_LIB                "mcuboot"   CACHE STRING    "Bootloader configure file for Firmware Update partition")
16set(TFM_CONFIG_FWU_MAX_WRITE_SIZE         1024        CACHE STRING    "The maximum permitted size for block in psa_fwu_write, in bytes.")
17set(TFM_CONFIG_FWU_MAX_MANIFEST_SIZE      0           CACHE STRING    "The maximum permitted size for manifest in psa_fwu_start(), in bytes.")
18set(FWU_DEVICE_CONFIG_FILE                ""          CACHE STRING    "The device configuration file for Firmware Update partition")
19if (DEFINED MCUBOOT_UPGRADE_STRATEGY)
20    if(${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "SWAP_USING_SCRATCH" OR ${MCUBOOT_UPGRADE_STRATEGY} STREQUAL "SWAP_USING_MOVE")
21        set(FWU_SUPPORT_TRIAL_STATE ON CACHE BOOL "Device support TRIAL component state.")
22    endif()
23else()
24    set(FWU_SUPPORT_TRIAL_STATE OFF CACHE BOOL "Device support TRIAL component state.")
25endif()
26