|
| 1 | +# Copyright (c) 2021 Linaro Limited. |
| 2 | +# Licensed under the MIT License. |
| 3 | + |
| 4 | +set(TX_TFM_BASE_DIR ${GSG_BASE_DIR}/core/lib/tfm) |
| 5 | +set(TX_TFM_BL2_DIR ${TX_TFM_BASE_DIR}/bl2/ext/mcuboot) |
| 6 | + |
| 7 | +option(BUILD_WITH_TFM "Build with TF-M as the Secure Execution Environment" ON) |
| 8 | +include(CMakeDependentOption) |
| 9 | +set(TFM_KEY_FILE_S |
| 10 | + "${TX_TFM_BL2_DIR}/root-RSA-3072.pem" |
| 11 | + CACHE FILEPATH |
| 12 | + "The path and filename for the .pem file containing the private key |
| 13 | + that should be used by the BL2 bootloader when signing secure |
| 14 | + firmware images." |
| 15 | +) |
| 16 | + |
| 17 | +set(TFM_KEY_FILE_NS |
| 18 | + "${TX_TFM_BL2_DIR}/root-RSA-3072_1.pem" |
| 19 | + CACHE FILEPATH |
| 20 | + "The path and filename for the .pem file containing the private key |
| 21 | + that should be used by the BL2 bootloader when signing non-secure |
| 22 | + firmware images." |
| 23 | +) |
| 24 | + |
| 25 | +set(TFM_PROFILE |
| 26 | + OFF |
| 27 | + CACHE STRING |
| 28 | + "The build profile used for TFM Secure image." |
| 29 | +) |
| 30 | + |
| 31 | +set(TFM_ISOLATION_LEVEL |
| 32 | + "1" |
| 33 | + CACHE STRING |
| 34 | + "Manually set the required TFM isolation level. Possible values are |
| 35 | + 1,2 or 3; the default is set by build configuration." |
| 36 | +) |
| 37 | + |
| 38 | +cmake_dependent_option(TFM_BL2 |
| 39 | + "TFM is designed to run with MCUboot in a certain configuration. |
| 40 | + This config adds MCUboot to the build - built via TFM's build system." |
| 41 | + ON |
| 42 | + BUILD_WITH_TFM OFF |
| 43 | +) |
| 44 | + |
| 45 | +set(TFM_MCUBOOT_IMAGE_NUMBER |
| 46 | + "1" |
| 47 | + CACHE STRING |
| 48 | + "How many images the bootloader sees when it looks at TFM and the app. |
| 49 | + When this is 1, the S and NS are considered as 1 image and must be |
| 50 | + updated in one atomic operation. When this is 2, they are split and |
| 51 | + can be updated independently if dependency requirements are met." |
| 52 | +) |
| 53 | + |
| 54 | +cmake_dependent_option(TFM_PARTITION_PROTECTED_STORAGE |
| 55 | + "Setting this option will cause '-DTFM_PARTITION_PROTECTED_STORAGE' |
| 56 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 57 | + in the trusted-firmware-m repository for details regarding this |
| 58 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 59 | + options are handled by the build system in the trusted-firmware-m |
| 60 | + repository." |
| 61 | + ON |
| 62 | + BUILD_WITH_TFM OFF |
| 63 | +) |
| 64 | + |
| 65 | +cmake_dependent_option(TFM_PARTITION_INTERNAL_TRUSTED_STORAGE |
| 66 | + "Setting this option will cause '-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE' |
| 67 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 68 | + in the trusted-firmware-m repository for details regarding this |
| 69 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 70 | + options are handled by the build system in the trusted-firmware-m |
| 71 | + repository." |
| 72 | + ON |
| 73 | + BUILD_WITH_TFM OFF |
| 74 | +) |
| 75 | + |
| 76 | +cmake_dependent_option(TFM_PARTITION_CRYPTO |
| 77 | + "Setting this option will cause '-DTFM_PARTITION_CRYPTO' |
| 78 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 79 | + in the trusted-firmware-m repository for details regarding this |
| 80 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 81 | + options are handled by the build system in the trusted-firmware-m |
| 82 | + repository." |
| 83 | + ON |
| 84 | + BUILD_WITH_TFM OFF |
| 85 | +) |
| 86 | + |
| 87 | +cmake_dependent_option(TFM_PARTITION_INITIAL_ATTESTATION |
| 88 | + "Setting this option will cause '-DTFM_PARTITION_INITIAL_ATTESTATION' |
| 89 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 90 | + in the trusted-firmware-m repository for details regarding this |
| 91 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 92 | + options are handled by the build system in the trusted-firmware-m |
| 93 | + repository." |
| 94 | + ON |
| 95 | + BUILD_WITH_TFM OFF |
| 96 | +) |
| 97 | + |
| 98 | +cmake_dependent_option(TFM_PARTITION_PLATFORM |
| 99 | + "Setting this option will cause '-DTFM_PARTITION_PLATFORM' |
| 100 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 101 | + in the trusted-firmware-m repository for details regarding this |
| 102 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 103 | + options are handled by the build system in the trusted-firmware-m |
| 104 | + repository." |
| 105 | + ON |
| 106 | + BUILD_WITH_TFM OFF |
| 107 | +) |
| 108 | + |
| 109 | +cmake_dependent_option(TFM_PARTITION_AUDIT_LOG |
| 110 | + "Setting this option will cause '-DTFM_PARTITION_AUDIT_LOG' |
| 111 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 112 | + in the trusted-firmware-m repository for details regarding this |
| 113 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 114 | + options are handled by the build system in the trusted-firmware-m |
| 115 | + repository." |
| 116 | + ON |
| 117 | + BUILD_WITH_TFM OFF |
| 118 | +) |
| 119 | + |
| 120 | +cmake_dependent_option(TFM_PARTITION_FIRMWARE_UPDATE |
| 121 | + "Setting this option will cause '-DTFM_PARTITION_FIRMWARE_UPDATE' |
| 122 | + to be passed to the TF-M build system. Look at 'config_default.cmake' |
| 123 | + in the trusted-firmware-m repository for details regarding this |
| 124 | + parameter. Any dependencies between the various TFM_PARTITION_* |
| 125 | + options are handled by the build system in the trusted-firmware-m |
| 126 | + repository." |
| 127 | + On |
| 128 | + BUILD_WITH_TFM OFF |
| 129 | +) |
| 130 | + |
| 131 | +cmake_dependent_option(TFM_IPC |
| 132 | + "When enabled, this option signifies that the TF-M build supports |
| 133 | + the PSA API (IPC mode) instead of the secure library mode." |
| 134 | + ON |
| 135 | + BUILD_WITH_TFM OFF |
| 136 | +) |
| 137 | + |
| 138 | +cmake_dependent_option(TFM_REGRESSION |
| 139 | + "When enabled, this option signifies that the TF-M build includes |
| 140 | + the Secure and the Non-Secure regression tests." |
| 141 | + ON |
| 142 | + BUILD_WITH_TFM OFF |
| 143 | +) |
| 144 | + |
| 145 | +set(APP_CONFIG OFF CACHE FILEPATH |
| 146 | + "Configuration file for the MPS3 AN524 example app" |
| 147 | +) |
| 148 | + |
| 149 | +if (APP_CONFIG) |
| 150 | + include(${APP_CONFIG}) |
| 151 | +endif() |
0 commit comments