Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
| 2 | |
| 3 | """ builtin_configs.py: |
| 4 | |
| 5 | Default configuration files used as reference """ |
| 6 | |
| 7 | from __future__ import print_function |
| 8 | |
| 9 | __copyright__ = """ |
| 10 | /* |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 11 | * Copyright (c) 2018-2020, Arm Limited. All rights reserved. |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 12 | * |
| 13 | * SPDX-License-Identifier: BSD-3-Clause |
| 14 | * |
| 15 | */ |
| 16 | """ |
| 17 | __author__ = "Minos Galanakis" |
| 18 | __email__ = "minos.galanakis@linaro.org" |
| 19 | __project__ = "Trusted Firmware-M Open CI" |
| 20 | __status__ = "stable" |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 21 | __version__ = "1.1" |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 22 | |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 23 | # common parameters for tf-m build system |
| 24 | # This configuration template will be passed into the tfm-builder module after |
| 25 | # the template evaluation is converted to a command |
| 26 | |
| 27 | _common_tfm_builder_cfg = { |
| 28 | "config_type": "tf-m", |
| 29 | "codebase_root_dir": "tf-m", |
| 30 | # Order to which the variants are evaluated. This affects the name of |
| 31 | # variant configuration and the wildcard replacement logic in invalid |
| 32 | # configuration tuples |
| 33 | "sort_order": ["target_platform", |
| 34 | "compiler", |
| 35 | "proj_config", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 36 | "psa_api_suit", |
| 37 | "with_OTP", |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 38 | "cmake_build_type", |
| 39 | "with_mcuboot"], |
| 40 | |
| 41 | # Keys for the templace will come from the combinations of parameters |
| 42 | # provided in the seed dictionary. |
| 43 | |
| 44 | "config_template": ( |
| 45 | "cmake -G \"Unix Makefiles\" " |
| 46 | "-DPROJ_CONFIG=`" |
| 47 | "readlink -f %(codebase_root_dir)s/configs/%(proj_config)s.cmake` " |
| 48 | "-DTARGET_PLATFORM=%(target_platform)s " |
| 49 | "-DCOMPILER=%(compiler)s " |
| 50 | "-DCMAKE_BUILD_TYPE=%(cmake_build_type)s " |
| 51 | "-DBL2=%(with_mcuboot)s " |
| 52 | "%(codebase_root_dir)s"), |
| 53 | |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 54 | "config_template_psa_api": ( |
| 55 | "cmake -G \"Unix Makefiles\" " |
| 56 | "-DPROJ_CONFIG=`" |
| 57 | "readlink -f %(codebase_root_dir)s/configs/%(proj_config)s.cmake` " |
| 58 | "-DTARGET_PLATFORM=%(target_platform)s " |
| 59 | "-DCOMPILER=%(compiler)s " |
| 60 | "-DCMAKE_BUILD_TYPE=%(cmake_build_type)s " |
| 61 | #TODO: error when using this param |
| 62 | # "-DPSA_API_TEST_BUILD_PATH=%(_tbm_build_dir_)s " |
| 63 | "%(codebase_root_dir)s"), |
| 64 | |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 65 | # A small subset of string substitution params is allowed in commands. |
| 66 | # tfm_build_manager will replace %(_tbm_build_dir_)s, %(_tbm_code_dir_)s, |
| 67 | # _tbm_target_platform_ with the paths set when building |
| 68 | |
| 69 | "artifact_capture_rex": (r'%(_tbm_build_dir_)s/install/outputs/' |
| 70 | r'(?:fvp|AN521|AN519|MUSCA_A|MUSCA_B1)' |
| 71 | r'/(\w+\.(?:axf|bin|hex))$'), |
| 72 | |
| 73 | # ALL commands will be executed for every build. |
| 74 | # Other keys will append extra commands when matching target_platform |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 75 | "build_cmds": {"all": ["cmake --build ./ -- install"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 76 | "MUSCA_A": [("srec_cat " |
| 77 | "%(_tbm_build_dir_)s/install/outputs/" |
| 78 | "%(_tbm_target_platform_)s/mcuboot.bin " |
| 79 | "-Binary -offset 0x200000 " |
| 80 | "%(_tbm_build_dir_)s/install/outputs/" |
| 81 | "%(_tbm_target_platform_)s/tfm_sign.bin " |
| 82 | "-Binary -offset 0x220000 -o " |
| 83 | "%(_tbm_build_dir_)s/install/outputs/" |
| 84 | "%(_tbm_target_platform_)s" |
| 85 | "/tfm.hex -Intel")], |
| 86 | "MUSCA_B1": [("srec_cat " |
| 87 | "%(_tbm_build_dir_)s/install/outputs/" |
| 88 | "%(_tbm_target_platform_)s/mcuboot.bin " |
Minos Galanakis | e86f448 | 2019-11-06 16:08:23 +0000 | [diff] [blame] | 89 | "-Binary -offset 0xA000000 " |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 90 | "%(_tbm_build_dir_)s/install/outputs/" |
| 91 | "%(_tbm_target_platform_)s/tfm_sign.bin " |
Minos Galanakis | e86f448 | 2019-11-06 16:08:23 +0000 | [diff] [blame] | 92 | "-Binary -offset 0xA020000 -o " |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 93 | "%(_tbm_build_dir_)s/install/outputs/" |
| 94 | "%(_tbm_target_platform_)s" |
| 95 | "/tfm.hex -Intel")] |
| 96 | }, |
| 97 | |
| 98 | # (Optional) If set will fail if those artefacts are missing post build |
| 99 | "required_artefacts": {"all": [ |
| 100 | "%(_tbm_build_dir_)s/install/outputs/" |
| 101 | "%(_tbm_target_platform_)s/tfm_s.bin", |
| 102 | "%(_tbm_build_dir_)s/install/outputs/" |
| 103 | "%(_tbm_target_platform_)s/tfm_ns.bin"], |
| 104 | "MUSCA_A": [ |
| 105 | "%(_tbm_build_dir_)s/install/outputs/" |
| 106 | "%(_tbm_target_platform_)s/tfm.hex", |
| 107 | "%(_tbm_build_dir_)s/install/outputs/" |
| 108 | "%(_tbm_target_platform_)s/mcuboot.bin", |
| 109 | "%(_tbm_build_dir_)s/install/outputs/" |
| 110 | "%(_tbm_target_platform_)s/tfm_sign.bin"], |
| 111 | "MUSCA_B1": [ |
| 112 | "%(_tbm_build_dir_)s/install/outputs/" |
| 113 | "%(_tbm_target_platform_)s/tfm.hex", |
| 114 | "%(_tbm_build_dir_)s/install/outputs/" |
| 115 | "%(_tbm_target_platform_)s/mcuboot.bin", |
| 116 | "%(_tbm_build_dir_)s/install/outputs/" |
| 117 | "%(_tbm_target_platform_)s/tfm_sign.bin"] |
| 118 | } |
| 119 | } |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 120 | |
| 121 | # Configure build manager to build several combinations |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 122 | config_AN539 = {"seed_params": { |
| 123 | "target_platform": ["AN539"], |
| 124 | "compiler": ["ARMCLANG", "GNUARM"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 125 | "proj_config": ["ConfigRegression", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 126 | "ConfigRegressionIPC", |
| 127 | "ConfigRegressionIPCTfmLevel2", |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 128 | "ConfigCoreIPC", |
| 129 | "ConfigCoreIPCTfmLevel2", |
| 130 | "ConfigDefault"], |
| 131 | "cmake_build_type": ["Debug", "Release"], |
| 132 | "with_mcuboot": [True, False], |
| 133 | }, |
| 134 | "common_params": _common_tfm_builder_cfg, |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 135 | # invalid configuations can be added as tuples of adjustable |
| 136 | # resolution "AN521" will reject all combinations for that |
| 137 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 138 | "invalid": [] |
| 139 | } |
| 140 | |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 141 | # Configure build manager to build several combinations |
| 142 | config_AN524 = {"seed_params": { |
| 143 | "target_platform": ["AN524"], |
| 144 | "compiler": ["ARMCLANG", "GNUARM"], |
| 145 | "proj_config": ["ConfigRegression", |
| 146 | "ConfigRegressionIPC", |
| 147 | "ConfigRegressionIPCTfmLevel2", |
| 148 | "ConfigCoreIPC", |
| 149 | "ConfigCoreIPCTfmLevel2", |
| 150 | "ConfigDefault"], |
| 151 | "cmake_build_type": ["Debug", "Release"], |
| 152 | "with_mcuboot": [True, False], |
| 153 | }, |
| 154 | "common_params": _common_tfm_builder_cfg, |
| 155 | # invalid configuations can be added as tuples of adjustable |
| 156 | # resolution "AN521" will reject all combinations for that |
| 157 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 158 | "invalid": [] |
| 159 | } |
| 160 | |
| 161 | # Configure build manager to build several combinations |
| 162 | config_AN521 = {"seed_params": { |
| 163 | "target_platform": ["AN521"], |
| 164 | "compiler": ["ARMCLANG", "GNUARM"], |
| 165 | "proj_config": ["ConfigRegression", |
| 166 | "ConfigRegressionIPC", |
| 167 | "ConfigRegressionIPCTfmLevel2", |
| 168 | "ConfigCoreIPC", |
| 169 | "ConfigCoreIPCTfmLevel2", |
| 170 | "ConfigDefault"], |
| 171 | "cmake_build_type": ["Debug", "Release"], |
| 172 | "with_mcuboot": [True, False], |
| 173 | }, |
| 174 | "common_params": _common_tfm_builder_cfg, |
| 175 | # invalid configuations can be added as tuples of adjustable |
| 176 | # resolution "AN521" will reject all combinations for that |
| 177 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 178 | "invalid": [] |
| 179 | } |
| 180 | |
| 181 | # Configure build manager to build several combinations |
| 182 | config_PSA_API = {"seed_params": { |
| 183 | "target_platform": ["AN521", "MUSCA_B1"], |
| 184 | "compiler": ["ARMCLANG", "GNUARM"], |
| 185 | "proj_config": ["ConfigPsaApiTest", |
| 186 | "ConfigPsaApiTestIPC", |
| 187 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 188 | "psa_api_suit": ["CRYPTO", |
| 189 | "PROTECTED_STORAGE", |
| 190 | "INITIAL_ATTESTATION", |
| 191 | "INTERNAL_TRUSTED_STORAGE"], |
| 192 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 193 | "with_mcuboot": [True], |
| 194 | }, |
| 195 | "common_params": _common_tfm_builder_cfg, |
| 196 | # invalid configuations can be added as tuples of adjustable |
| 197 | # resolution "AN521" will reject all combinations for that |
| 198 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 199 | "invalid": [] |
| 200 | } |
| 201 | |
| 202 | # Configure build manager to build several combinations |
| 203 | config_PSA_FF = {"seed_params": { |
| 204 | "target_platform": ["AN521", "MUSCA_B1"], |
| 205 | "compiler": ["ARMCLANG", "GNUARM"], |
| 206 | "proj_config": ["ConfigPsaApiTestIPC", |
| 207 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 208 | # Prefer to use "IPC" from compile command perspective |
| 209 | # But the name style is prefer "FF" |
| 210 | "psa_api_suit": ["FF"], |
| 211 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 212 | "with_mcuboot": [True], |
| 213 | }, |
| 214 | "common_params": _common_tfm_builder_cfg, |
| 215 | # invalid configuations can be added as tuples of adjustable |
| 216 | # resolution "AN521" will reject all combinations for that |
| 217 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 218 | "invalid": [] |
| 219 | } |
| 220 | |
| 221 | # Configure build manager to build several combinations |
| 222 | config_PSA_API_OTP = {"seed_params": { |
| 223 | "target_platform": ["MUSCA_B1"],# |
| 224 | "compiler": ["ARMCLANG", "GNUARM"], |
| 225 | "proj_config": ["ConfigPsaApiTest", |
| 226 | "ConfigPsaApiTestIPC", |
| 227 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 228 | "psa_api_suit": ["CRYPTO", |
| 229 | "PROTECTED_STORAGE", |
| 230 | "INITIAL_ATTESTATION", |
| 231 | "INTERNAL_TRUSTED_STORAGE"], |
| 232 | "with_OTP": ["OTP"], |
| 233 | "cmake_build_type": ["Debug", "Release", "Minsizerel"],# |
| 234 | "with_mcuboot": [True], |
| 235 | }, |
| 236 | "common_params": _common_tfm_builder_cfg, |
| 237 | # invalid configuations can be added as tuples of adjustable |
| 238 | # resolution "AN521" will reject all combinations for that |
| 239 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 240 | "invalid": [] |
| 241 | } |
| 242 | |
| 243 | # Configure build manager to build several combinations |
| 244 | config_PSA_FF_OTP = {"seed_params": { |
| 245 | "target_platform": ["MUSCA_B1"], |
| 246 | "compiler": ["ARMCLANG", "GNUARM"], |
| 247 | "proj_config": ["ConfigPsaApiTestIPC", |
| 248 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 249 | # Prefer to use "IPC" from compile command perspective |
| 250 | # But the name style is prefer "FF" |
| 251 | "psa_api_suit": ["FF"], |
| 252 | "with_OTP": ["OTP"], |
| 253 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 254 | "with_mcuboot": [True], |
| 255 | }, |
| 256 | "common_params": _common_tfm_builder_cfg, |
| 257 | # invalid configuations can be added as tuples of adjustable |
| 258 | # resolution "AN521" will reject all combinations for that |
| 259 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 260 | "invalid": [] |
| 261 | } |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 262 | |
| 263 | # Configure build manager to build several combinations |
Karl Zhang | 96dfe2d | 2020-05-11 11:31:40 +0800 | [diff] [blame] | 264 | config_PSOC64 = {"seed_params": { |
| 265 | "target_platform": ["psoc64"], |
| 266 | "compiler": ["ARMCLANG", "GNUARM"], |
| 267 | "proj_config": ["ConfigRegressionIPC", |
| 268 | "ConfigRegressionIPCTfmLevel2"], |
| 269 | "cmake_build_type": ["Release"], |
| 270 | "with_mcuboot": [False], |
| 271 | }, |
| 272 | "common_params": _common_tfm_builder_cfg, |
| 273 | # invalid configuations can be added as tuples of adjustable |
| 274 | # resolution "AN521" will reject all combinations for that |
| 275 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 276 | "invalid": [] |
| 277 | } |
| 278 | |
| 279 | # Configure build manager to build several combinations |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 280 | config_AN519 = {"seed_params": { |
| 281 | "target_platform": ["AN519"], |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 282 | "compiler": ["ARMCLANG", "GNUARM"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 283 | "proj_config": ["ConfigRegression", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 284 | "ConfigRegressionIPC", |
| 285 | "ConfigRegressionIPCTfmLevel2", |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 286 | "ConfigCoreIPC", |
| 287 | "ConfigCoreIPCTfmLevel2", |
| 288 | "ConfigDefault"], |
| 289 | "cmake_build_type": ["Debug", "Release"], |
| 290 | "with_mcuboot": [True, False], |
| 291 | }, |
| 292 | "common_params": _common_tfm_builder_cfg, |
| 293 | # invalid configuations can be added as tuples of adjustable |
| 294 | # resolution "AN521" will reject all combinations for that |
| 295 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 296 | "invalid": [] |
| 297 | } |
| 298 | |
| 299 | config_IPC = {"seed_params": { |
| 300 | "target_platform": ["AN521", "AN519", "MUSCA_A", "MUSCA_B1"], |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 301 | "compiler": ["ARMCLANG", "GNUARM"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 302 | "proj_config": ["ConfigCoreIPC", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 303 | "ConfigCoreIPCTfmLevel2", |
| 304 | "ConfigRegressionIPC", |
| 305 | "ConfigRegressionIPCTfmLevel2"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 306 | "cmake_build_type": ["Debug", "Release"], |
| 307 | "with_mcuboot": [True, False], |
| 308 | }, |
| 309 | "common_params": _common_tfm_builder_cfg, |
| 310 | # invalid configuations can be added as tuples of adjustable |
| 311 | # resolution "AN521" will reject all combinations for that |
| 312 | # platform while ("AN521", "GNUARM") will only reject GCC |
| 313 | "invalid": [("MUSCA_B1", "*", "*", "*", False)] |
| 314 | } |
| 315 | |
| 316 | # Configure build manager to build the maximum number of configurations |
| 317 | config_full = {"seed_params": { |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 318 | "target_platform": ["AN521", "AN519", |
| 319 | "MUSCA_A", "MUSCA_B1", |
Karl Zhang | 81a7677 | 2020-05-11 18:28:52 +0800 | [diff] [blame] | 320 | "AN524", "AN539", |
| 321 | "psoc64"], |
Dean Birch | d6ce2c8 | 2020-05-13 13:16:15 +0100 | [diff] [blame] | 322 | "compiler": ["ARMCLANG", "GNUARM"], |
| 323 | "proj_config": ["ConfigRegression", |
| 324 | "ConfigRegressionIPC", |
| 325 | "ConfigRegressionIPCTfmLevel2", |
| 326 | "ConfigCoreIPC", |
| 327 | "ConfigCoreIPCTfmLevel2", |
| 328 | "ConfigDefault"], |
| 329 | "cmake_build_type": ["Debug", "Release"], |
| 330 | "with_mcuboot": [True, False], |
| 331 | }, |
| 332 | "common_params": _common_tfm_builder_cfg, |
| 333 | # invalid configuations can be added as tuples of adjustable |
| 334 | # resolution "AN521" will reject all combinations for that |
| 335 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 336 | "invalid": [("MUSCA_A", "*", "*", "*", False), |
| 337 | ("MUSCA_B1", "*", "*", "*", False), |
Karl Zhang | 81a7677 | 2020-05-11 18:28:52 +0800 | [diff] [blame] | 338 | ("psoc64", "*", "*", "*", True), |
| 339 | ("psoc64", "*", "*", "Debug", "*"), |
| 340 | ("psoc64", "*", "ConfigRegression", "*", "*"), |
| 341 | ("psoc64", "*", "ConfigCoreIPC", "*", "*"), |
| 342 | ("psoc64", "*", "ConfigCoreIPCTfmLevel2", "*", "*"), |
| 343 | ("psoc64", "*", "ConfigDefault", "*", "*")] |
| 344 | } |
| 345 | |
| 346 | # Configure build manager to build the maximum number of configurations |
| 347 | config_full_gnuarm = {"seed_params": { |
| 348 | "target_platform": ["AN521", "AN519", |
| 349 | "MUSCA_A", "MUSCA_B1", |
| 350 | "AN524", "AN539", |
| 351 | "psoc64"], |
| 352 | "compiler": ["GNUARM"], |
| 353 | "proj_config": ["ConfigRegression", |
| 354 | "ConfigRegressionIPC", |
| 355 | "ConfigRegressionIPCTfmLevel2", |
| 356 | "ConfigCoreIPC", |
| 357 | "ConfigCoreIPCTfmLevel2", |
| 358 | "ConfigDefault"], |
| 359 | "cmake_build_type": ["Debug", "Release"], |
| 360 | "with_mcuboot": [True, False], |
| 361 | }, |
| 362 | "common_params": _common_tfm_builder_cfg, |
| 363 | # invalid configuations can be added as tuples of adjustable |
| 364 | # resolution "AN521" will reject all combinations for that |
| 365 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 366 | "invalid": [("MUSCA_A", "*", "*", "*", False), |
| 367 | ("MUSCA_B1", "*", "*", "*", False), |
| 368 | ("psoc64", "*", "*", "*", True), |
| 369 | ("psoc64", "*", "*", "Debug", "*"), |
| 370 | ("psoc64", "*", "ConfigRegression", "*", "*"), |
| 371 | ("psoc64", "*", "ConfigCoreIPC", "*", "*"), |
| 372 | ("psoc64", "*", "ConfigCoreIPCTfmLevel2", "*", "*"), |
| 373 | ("psoc64", "*", "ConfigDefault", "*", "*")] |
Dean Birch | d6ce2c8 | 2020-05-13 13:16:15 +0100 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | # Configure build manager to build the maximum number of configurations |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 377 | config_tfm_test = {"seed_params": { |
| 378 | "target_platform": ["AN521", "MUSCA_A", "MUSCA_B1", "MUSCA_S1"], |
| 379 | "compiler": ["ARMCLANG", "GNUARM"], |
| 380 | "proj_config": ["ConfigRegression", |
| 381 | "ConfigRegressionIPC", |
| 382 | "ConfigRegressionIPCTfmLevel2", |
| 383 | "ConfigCoreIPC", |
| 384 | "ConfigCoreIPCTfmLevel2", |
| 385 | "ConfigDefault"], |
| 386 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 387 | "with_mcuboot": [True, False], |
| 388 | }, |
| 389 | "common_params": _common_tfm_builder_cfg, |
| 390 | # invalid configuations can be added as tuples of adjustable |
| 391 | # resolution "AN521" will reject all combinations for that |
| 392 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 393 | "invalid": [("MUSCA_A", "*", "*", "*", False), |
| 394 | ("MUSCA_S1", "*", "*", "*", False), |
| 395 | ("MUSCA_B1", "*", "*", "*", False)] |
| 396 | } |
| 397 | # Configure build manager to build the maximum number of configurations |
| 398 | config_tfm_test2 = {"seed_params": { |
| 399 | "target_platform": ["AN519", "AN524", "AN539", "SSE-200_AWS"], |
| 400 | "compiler": ["ARMCLANG", "GNUARM"], |
| 401 | "proj_config": ["ConfigRegression", |
| 402 | "ConfigRegressionIPC", |
| 403 | "ConfigRegressionIPCTfmLevel2", |
| 404 | "ConfigCoreIPC", |
| 405 | "ConfigCoreIPCTfmLevel2", |
| 406 | "ConfigDefault"], |
| 407 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 408 | "with_mcuboot": [True, False], |
| 409 | }, |
| 410 | "common_params": _common_tfm_builder_cfg, |
| 411 | # invalid configuations can be added as tuples of adjustable |
| 412 | # resolution "AN521" will reject all combinations for that |
| 413 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 414 | "invalid": [] |
| 415 | } |
| 416 | |
| 417 | # Configure build manager to build the maximum number of configurations |
| 418 | config_tfm_test_OTP = {"seed_params": { |
| 419 | "target_platform": ["MUSCA_B1"], |
| 420 | "compiler": ["ARMCLANG", "GNUARM"], |
| 421 | "proj_config": ["ConfigRegression", |
| 422 | "ConfigRegressionIPC", |
| 423 | "ConfigRegressionIPCTfmLevel2", |
| 424 | "ConfigCoreIPC", |
| 425 | "ConfigCoreIPCTfmLevel2", |
| 426 | "ConfigDefault"], |
| 427 | "with_OTP": ["OTP"], |
| 428 | "cmake_build_type": ["Debug", "Release", "Minsizerel"], |
| 429 | "with_mcuboot": [True], |
| 430 | }, |
| 431 | "common_params": _common_tfm_builder_cfg, |
| 432 | # invalid configuations can be added as tuples of adjustable |
| 433 | # resolution "AN521" will reject all combinations for that |
| 434 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 435 | "invalid": [] |
| 436 | } |
| 437 | |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 438 | config_MUSCA_A = {"seed_params": { |
| 439 | "target_platform": ["MUSCA_A"], |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 440 | "compiler": ["ARMCLANG", "GNUARM"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 441 | "proj_config": ["ConfigRegression", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 442 | "ConfigRegressionIPC", |
| 443 | "ConfigRegressionIPCTfmLevel2", |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 444 | "ConfigCoreIPC", |
| 445 | "ConfigCoreIPCTfmLevel2", |
| 446 | "ConfigDefault"], |
| 447 | "cmake_build_type": ["Debug", "Release"], |
| 448 | "with_mcuboot": [True], |
| 449 | }, |
| 450 | "common_params": _common_tfm_builder_cfg, |
| 451 | # invalid configuations can be added as tuples of adjustable |
| 452 | # resolution "AN521" will reject all combinations for that |
| 453 | # platform while ("AN521", "GNUARM") will only reject GCC |
| 454 | "invalid": [("MUSCA_A", "*", "*", "*", False)] |
| 455 | } |
| 456 | |
| 457 | config_MUSCA_B1 = {"seed_params": { |
| 458 | "target_platform": ["MUSCA_B1"], |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 459 | "compiler": ["ARMCLANG", "GNUARM"], |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 460 | "proj_config": ["ConfigRegression", |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 461 | "ConfigRegressionIPC", |
| 462 | "ConfigRegressionIPCTfmLevel2", |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 463 | "ConfigCoreIPC", |
| 464 | "ConfigCoreIPCTfmLevel2", |
| 465 | "ConfigDefault"], |
| 466 | "cmake_build_type": ["Debug", "Release"], |
| 467 | "with_mcuboot": [True], |
| 468 | }, |
| 469 | "common_params": _common_tfm_builder_cfg, |
| 470 | # invalid configuations can be added as tuples of adjustable |
| 471 | # resolution "AN521" will reject all combinations for that |
| 472 | # platform while ("AN521", "GNUARM") will only reject GCC |
| 473 | "invalid": [("MUSCA_B1", "*", "*", "*", False)] |
| 474 | } |
| 475 | |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 476 | # Configure build manager to build the maximum number of configurations |
| 477 | config_release = {"seed_params": { |
| 478 | "target_platform": ["AN521", "AN519", |
| 479 | "MUSCA_A", "MUSCA_B1", "MUSCA_S1", |
| 480 | "AN524", "AN539"], |
| 481 | "compiler": ["ARMCLANG", "GNUARM"], |
| 482 | "proj_config": ["ConfigRegression", |
| 483 | "ConfigRegressionIPC", |
| 484 | "ConfigRegressionIPCTfmLevel2", |
| 485 | "ConfigCoreIPC", |
| 486 | "ConfigCoreIPCTfmLevel2", |
| 487 | "ConfigDefault"], |
| 488 | "cmake_build_type": ["Debug", "Release", "MINSIZEREL"], |
| 489 | "with_mcuboot": [True, False], |
| 490 | }, |
| 491 | "common_params": _common_tfm_builder_cfg, |
| 492 | # invalid configuations can be added as tuples of adjustable |
| 493 | # resolution "AN521" will reject all combinations for that |
| 494 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 495 | "invalid": [("MUSCA_A", "*", "*", "*", False), |
| 496 | ("MUSCA_S1", "*", "*", "*", False), |
| 497 | ("MUSCA_B1", "*", "*", "*", False)] |
| 498 | } |
| 499 | |
| 500 | # Configure build manager to build several combinations |
| 501 | config_AN521_PSA_API = {"seed_params": { |
| 502 | "target_platform": ["AN521", "AN519", "MUSCA_B1"], |
| 503 | "compiler": ["ARMCLANG", "GNUARM"], |
| 504 | "proj_config": ["ConfigPsaApiTest", |
| 505 | "ConfigPsaApiTestIPC", |
| 506 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 507 | "psa_api_suit": ["CRYPTO", |
| 508 | "PROTECTED_STORAGE", |
| 509 | "INITIAL_ATTESTATION", |
| 510 | "INTERNAL_TRUSTED_STORAGE", |
| 511 | "IPC"], |
| 512 | "cmake_build_type": ["Debug", "Release", "MINSIZEREL"], |
| 513 | "with_mcuboot": [True], |
| 514 | }, |
| 515 | "common_params": _common_tfm_builder_cfg, |
| 516 | # invalid configuations can be added as tuples of adjustable |
| 517 | # resolution "AN521" will reject all combinations for that |
| 518 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 519 | "invalid": [("*", "*", "*", "IPC", "*", "*")] |
| 520 | } |
| 521 | |
| 522 | # Configure build manager to build several combinations |
| 523 | config_AN521_PSA_IPC = {"seed_params": { |
| 524 | "target_platform": ["AN521", "AN519", "MUSCA_B1"], |
| 525 | "compiler": ["ARMCLANG", "GNUARM"], |
| 526 | "proj_config": ["ConfigPsaApiTestIPC", |
| 527 | "ConfigPsaApiTestIPCTfmLevel2"], |
| 528 | "psa_api_suit": ["IPC"], |
| 529 | "cmake_build_type": ["Debug", "Release", "MINSIZEREL"], |
| 530 | "with_mcuboot": [True], |
| 531 | }, |
| 532 | "common_params": _common_tfm_builder_cfg, |
| 533 | # invalid configuations can be added as tuples of adjustable |
| 534 | # resolution "AN521" will reject all combinations for that |
| 535 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 536 | "invalid": [] |
| 537 | } |
| 538 | |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 539 | # Configruation used for document building |
| 540 | config_doxygen = {"common_params": { |
| 541 | "config_type": "tf-m_documents", |
| 542 | "codebase_root_dir": "tf-m", |
| 543 | "build_cmds": {"all": ["cmake -G \"Unix Makefiles\" " |
| 544 | "-DPROJ_CONFIG=`readlink -f " |
| 545 | "%(_tbm_code_dir_)s/" |
| 546 | "configs/ConfigDefault.cmake` " |
| 547 | "-DTARGET_PLATFORM=AN521 " |
| 548 | "-DCOMPILER=GNUARM " |
| 549 | "-DCMAKE_BUILD_TYPE=Debug " |
| 550 | "-DBL2=True " |
| 551 | "%(_tbm_code_dir_)s/", |
| 552 | "cmake --build ./ -- install_doc", |
| 553 | "cmake --build ./ " |
| 554 | "-- install_userguide"]}, |
| 555 | "artifact_capture_rex": r'%(_tbm_build_dir_)s/install/' |
| 556 | r'doc/reference_manual/(?:pdf|html)' |
| 557 | r'/(\w+\.(?:html|md|pdf))$', |
| 558 | }, |
| 559 | "invalid": [] |
| 560 | } |
| 561 | |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 562 | # Configuration used in testing |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 563 | config_debug = {"seed_params": { |
| 564 | "target_platform": ["AN521"], |
| 565 | "compiler": ["ARMCLANG"], |
| 566 | "proj_config": ["ConfigDefault"], |
| 567 | "cmake_build_type": ["Debug"], |
| 568 | "with_mcuboot": [True], |
| 569 | }, |
| 570 | "common_params": _common_tfm_builder_cfg, |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 571 | # invalid configurations can be added as tuples of adjustable |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 572 | # resolution "AN521" will reject all combinations for that |
| 573 | # platform while ("AN521", "GNUARM") will only reject GCC ones |
| 574 | "invalid": [("*", "GNUARM", "*", "*", False), |
| 575 | ("AN521", "ARMCLANG", "ConfigRegression", |
| 576 | "Release", False), |
| 577 | ] |
| 578 | } |
| 579 | |
Dean Birch | 4c6ad62 | 2020-03-13 11:28:03 +0000 | [diff] [blame] | 580 | # Configuration used in CI |
| 581 | config_ci = { |
| 582 | "seed_params": { |
| 583 | "target_platform": ["AN521"], |
| 584 | "compiler": ["ARMCLANG", "GNUARM"], |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 585 | "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"], |
| 586 | "cmake_build_type": ["Release"], |
| 587 | "with_mcuboot": [True, False], |
| 588 | }, |
| 589 | "common_params": _common_tfm_builder_cfg, |
| 590 | "invalid": [ |
| 591 | ("AN521", "ARMCLANG", "ConfigDefault", "Release", False), |
| 592 | ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False), |
| 593 | ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True), |
| 594 | ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False), |
| 595 | ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True), |
| 596 | ("AN521", "ARMCLANG", "ConfigRegression", "Release", False), |
| 597 | ("AN521", "ARMCLANG", "ConfigRegression", "Release", True), |
| 598 | ], |
| 599 | } |
| 600 | |
Dean Birch | d6ce2c8 | 2020-05-13 13:16:15 +0100 | [diff] [blame] | 601 | # Configuration used in CI if armclang not available |
| 602 | config_ci_gnuarm = { |
| 603 | "seed_params": { |
| 604 | "target_platform": ["AN521"], |
| 605 | "compiler": ["ARMCLANG", "GNUARM"], |
| 606 | "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"], |
| 607 | "cmake_build_type": ["Release"], |
| 608 | "with_mcuboot": [True, False], |
| 609 | }, |
| 610 | "common_params": _common_tfm_builder_cfg, |
| 611 | "invalid": [ |
| 612 | ("AN521", "ARMCLANG", "ConfigDefault", "Release", False), |
| 613 | ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False), |
| 614 | ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True), |
| 615 | ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False), |
| 616 | ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True), |
| 617 | ("AN521", "ARMCLANG", "ConfigRegression", "Release", False), |
| 618 | ("AN521", "ARMCLANG", "ConfigRegression", "Release", True), |
| 619 | ("*", "ARMCLANG", "*", "*", "*"), # Disable ARMCLANG for now |
| 620 | ], |
| 621 | } |
| 622 | |
| 623 | |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 624 | config_lava_debug = { |
| 625 | "seed_params": { |
Matthew Hart | 2c2688f | 2020-05-26 13:09:20 +0100 | [diff] [blame] | 626 | "target_platform": ["AN521", "AN519"], |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 627 | "compiler": ["GNUARM"], |
Matthew Hart | 2c2688f | 2020-05-26 13:09:20 +0100 | [diff] [blame] | 628 | "proj_config": ["ConfigRegressionIPC", "ConfigRegressionIPCTfmLevel2", "ConfigRegression"], |
Dean Birch | 4c6ad62 | 2020-03-13 11:28:03 +0000 | [diff] [blame] | 629 | "cmake_build_type": ["Release"], |
Matthew Hart | 2c2688f | 2020-05-26 13:09:20 +0100 | [diff] [blame] | 630 | "with_mcuboot": [True, False], |
Dean Birch | 4c6ad62 | 2020-03-13 11:28:03 +0000 | [diff] [blame] | 631 | }, |
| 632 | "common_params": _common_tfm_builder_cfg, |
| 633 | "invalid": [ |
| 634 | ("AN521", "ARMCLANG", "ConfigDefault", "Release", True), |
| 635 | ("AN521", "GNUARM", "ConfigCoreIPCTfmLevel2", "Release", True), |
| 636 | ], |
| 637 | } |
| 638 | |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 639 | _builtin_configs = { |
| 640 | "tfm_test": config_tfm_test, |
| 641 | "tfm_test2": config_tfm_test2, |
| 642 | "tfm_test_otp": config_tfm_test_OTP, |
| 643 | "psa_api": config_PSA_API, |
| 644 | "psa_api_otp": config_PSA_API_OTP, |
| 645 | "psa_ff": config_PSA_FF, |
| 646 | "psa_ff_otp": config_PSA_FF_OTP, |
| 647 | "full": config_full, |
Dean Birch | d6ce2c8 | 2020-05-13 13:16:15 +0100 | [diff] [blame] | 648 | "full_gnuarm": config_full_gnuarm, |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 649 | "an539": config_AN539, |
| 650 | "an524": config_AN524, |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 651 | "an521": config_AN521, |
| 652 | "an519": config_AN519, |
| 653 | "musca_a": config_MUSCA_A, |
| 654 | "musca_b1": config_MUSCA_B1, |
Karl Zhang | 96dfe2d | 2020-05-11 11:31:40 +0800 | [diff] [blame] | 655 | "psoc64": config_PSOC64, |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 656 | "ipc": config_IPC, |
| 657 | "doxygen": config_doxygen, |
Dean Birch | 4c6ad62 | 2020-03-13 11:28:03 +0000 | [diff] [blame] | 658 | "debug": config_debug, |
Karl Zhang | aff558a | 2020-05-15 14:28:23 +0100 | [diff] [blame] | 659 | "release": config_release, |
| 660 | "an521_psa_api": config_AN521_PSA_API, |
| 661 | "an521_psa_ipc": config_AN521_PSA_IPC, |
Matthew Hart | fb6fd36 | 2020-03-04 21:03:59 +0000 | [diff] [blame] | 662 | "debug": config_debug, |
| 663 | "lava_debug": config_lava_debug, |
Dean Birch | d6ce2c8 | 2020-05-13 13:16:15 +0100 | [diff] [blame] | 664 | "ci": config_ci, |
| 665 | "ci_gnuarm": config_ci_gnuarm} |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 666 | |
| 667 | if __name__ == '__main__': |
| 668 | import os |
Minos Galanakis | f4ca6ac | 2017-12-11 02:39:21 +0100 | [diff] [blame] | 669 | |
Minos Galanakis | ea42123 | 2019-06-20 17:11:28 +0100 | [diff] [blame] | 670 | # Default behavior is to export refference config when called |
| 671 | _dir = os.getcwd() |
| 672 | from utils import save_json |
| 673 | for _cname, _cfg in _builtin_configs.items(): |
| 674 | _fname = os.path.join(_dir, _cname + ".json") |
| 675 | print("Exporting config %s" % _fname) |
| 676 | save_json(_fname, _cfg) |