blob: d56c4c3fc427693294a9d5e0a44feb137331664a [file] [log] [blame]
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +01001#!/usr/bin/env python3
2
3""" builtin_configs.py:
4
5 Default configuration files used as reference """
6
7from __future__ import print_function
8
9__copyright__ = """
10/*
Karl Zhangaff558a2020-05-15 14:28:23 +010011 * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010012 *
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 Galanakisea421232019-06-20 17:11:28 +010021__version__ = "1.1"
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +010022
Minos Galanakisea421232019-06-20 17:11:28 +010023# 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 Zhangaff558a2020-05-15 14:28:23 +010036 "psa_api_suit",
37 "with_OTP",
Minos Galanakisea421232019-06-20 17:11:28 +010038 "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 Zhangaff558a2020-05-15 14:28:23 +010054 "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 Galanakisea421232019-06-20 17:11:28 +010065 # 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 Zhangaff558a2020-05-15 14:28:23 +010075 "build_cmds": {"all": ["cmake --build ./ -- install"],
Minos Galanakisea421232019-06-20 17:11:28 +010076 "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 Galanakise86f4482019-11-06 16:08:23 +000089 "-Binary -offset 0xA000000 "
Minos Galanakisea421232019-06-20 17:11:28 +010090 "%(_tbm_build_dir_)s/install/outputs/"
91 "%(_tbm_target_platform_)s/tfm_sign.bin "
Minos Galanakise86f4482019-11-06 16:08:23 +000092 "-Binary -offset 0xA020000 -o "
Minos Galanakisea421232019-06-20 17:11:28 +010093 "%(_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 Galanakisf4ca6ac2017-12-11 02:39:21 +0100120
121# Configure build manager to build several combinations
Karl Zhangaff558a2020-05-15 14:28:23 +0100122config_AN539 = {"seed_params": {
123 "target_platform": ["AN539"],
124 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100125 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100126 "ConfigRegressionIPC",
127 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100128 "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 Galanakisf4ca6ac2017-12-11 02:39:21 +0100135 # 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 Zhangaff558a2020-05-15 14:28:23 +0100141# Configure build manager to build several combinations
142config_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
162config_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
182config_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
203config_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
222config_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
244config_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 Galanakisea421232019-06-20 17:11:28 +0100262
263# Configure build manager to build several combinations
264config_AN519 = {"seed_params": {
265 "target_platform": ["AN519"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100266 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100267 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100268 "ConfigRegressionIPC",
269 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100270 "ConfigCoreIPC",
271 "ConfigCoreIPCTfmLevel2",
272 "ConfigDefault"],
273 "cmake_build_type": ["Debug", "Release"],
274 "with_mcuboot": [True, False],
275 },
276 "common_params": _common_tfm_builder_cfg,
277 # invalid configuations can be added as tuples of adjustable
278 # resolution "AN521" will reject all combinations for that
279 # platform while ("AN521", "GNUARM") will only reject GCC ones
280 "invalid": []
281 }
282
283config_IPC = {"seed_params": {
284 "target_platform": ["AN521", "AN519", "MUSCA_A", "MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100285 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100286 "proj_config": ["ConfigCoreIPC",
Karl Zhangaff558a2020-05-15 14:28:23 +0100287 "ConfigCoreIPCTfmLevel2",
288 "ConfigRegressionIPC",
289 "ConfigRegressionIPCTfmLevel2"],
Minos Galanakisea421232019-06-20 17:11:28 +0100290 "cmake_build_type": ["Debug", "Release"],
291 "with_mcuboot": [True, False],
292 },
293 "common_params": _common_tfm_builder_cfg,
294 # invalid configuations can be added as tuples of adjustable
295 # resolution "AN521" will reject all combinations for that
296 # platform while ("AN521", "GNUARM") will only reject GCC
297 "invalid": [("MUSCA_B1", "*", "*", "*", False)]
298 }
299
300# Configure build manager to build the maximum number of configurations
301config_full = {"seed_params": {
Karl Zhangaff558a2020-05-15 14:28:23 +0100302 "target_platform": ["AN521", "AN519",
303 "MUSCA_A", "MUSCA_B1",
304 "AN524", "AN539"],
305 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100306 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100307 "ConfigRegressionIPC",
308 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100309 "ConfigCoreIPC",
310 "ConfigCoreIPCTfmLevel2",
311 "ConfigDefault"],
312 "cmake_build_type": ["Debug", "Release"],
313 "with_mcuboot": [True, False],
314 },
315 "common_params": _common_tfm_builder_cfg,
316 # invalid configuations can be added as tuples of adjustable
317 # resolution "AN521" will reject all combinations for that
318 # platform while ("AN521", "GNUARM") will only reject GCC ones
319 "invalid": [("MUSCA_A", "*", "*", "*", False),
320 ("MUSCA_B1", "*", "*", "*", False)]
321 }
322
Karl Zhangaff558a2020-05-15 14:28:23 +0100323# Configure build manager to build the maximum number of configurations
Dean Birchd6ce2c82020-05-13 13:16:15 +0100324config_full_gnuarm = {"seed_params": {
325 "target_platform": ["AN521", "AN519",
326 "MUSCA_A", "MUSCA_B1",
327 "AN524", "AN539"],
328 "compiler": ["ARMCLANG", "GNUARM"],
329 "proj_config": ["ConfigRegression",
330 "ConfigRegressionIPC",
331 "ConfigRegressionIPCTfmLevel2",
332 "ConfigCoreIPC",
333 "ConfigCoreIPCTfmLevel2",
334 "ConfigDefault"],
335 "cmake_build_type": ["Debug", "Release"],
336 "with_mcuboot": [True, False],
337 },
338 "common_params": _common_tfm_builder_cfg,
339 # invalid configuations can be added as tuples of adjustable
340 # resolution "AN521" will reject all combinations for that
341 # platform while ("AN521", "GNUARM") will only reject GCC ones
342 "invalid": [("MUSCA_A", "*", "*", "*", False),
343 ("MUSCA_B1", "*", "*", "*", False),
344 ("*", "ARMCLANG", "*", "*", "*")]
345 }
346
347# Configure build manager to build the maximum number of configurations
Karl Zhangaff558a2020-05-15 14:28:23 +0100348config_tfm_test = {"seed_params": {
349 "target_platform": ["AN521", "MUSCA_A", "MUSCA_B1", "MUSCA_S1"],
350 "compiler": ["ARMCLANG", "GNUARM"],
351 "proj_config": ["ConfigRegression",
352 "ConfigRegressionIPC",
353 "ConfigRegressionIPCTfmLevel2",
354 "ConfigCoreIPC",
355 "ConfigCoreIPCTfmLevel2",
356 "ConfigDefault"],
357 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
358 "with_mcuboot": [True, False],
359 },
360 "common_params": _common_tfm_builder_cfg,
361 # invalid configuations can be added as tuples of adjustable
362 # resolution "AN521" will reject all combinations for that
363 # platform while ("AN521", "GNUARM") will only reject GCC ones
364 "invalid": [("MUSCA_A", "*", "*", "*", False),
365 ("MUSCA_S1", "*", "*", "*", False),
366 ("MUSCA_B1", "*", "*", "*", False)]
367 }
368# Configure build manager to build the maximum number of configurations
369config_tfm_test2 = {"seed_params": {
370 "target_platform": ["AN519", "AN524", "AN539", "SSE-200_AWS"],
371 "compiler": ["ARMCLANG", "GNUARM"],
372 "proj_config": ["ConfigRegression",
373 "ConfigRegressionIPC",
374 "ConfigRegressionIPCTfmLevel2",
375 "ConfigCoreIPC",
376 "ConfigCoreIPCTfmLevel2",
377 "ConfigDefault"],
378 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
379 "with_mcuboot": [True, False],
380 },
381 "common_params": _common_tfm_builder_cfg,
382 # invalid configuations can be added as tuples of adjustable
383 # resolution "AN521" will reject all combinations for that
384 # platform while ("AN521", "GNUARM") will only reject GCC ones
385 "invalid": []
386 }
387
388# Configure build manager to build the maximum number of configurations
389config_tfm_test_OTP = {"seed_params": {
390 "target_platform": ["MUSCA_B1"],
391 "compiler": ["ARMCLANG", "GNUARM"],
392 "proj_config": ["ConfigRegression",
393 "ConfigRegressionIPC",
394 "ConfigRegressionIPCTfmLevel2",
395 "ConfigCoreIPC",
396 "ConfigCoreIPCTfmLevel2",
397 "ConfigDefault"],
398 "with_OTP": ["OTP"],
399 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
400 "with_mcuboot": [True],
401 },
402 "common_params": _common_tfm_builder_cfg,
403 # invalid configuations can be added as tuples of adjustable
404 # resolution "AN521" will reject all combinations for that
405 # platform while ("AN521", "GNUARM") will only reject GCC ones
406 "invalid": []
407 }
408
Minos Galanakisea421232019-06-20 17:11:28 +0100409config_MUSCA_A = {"seed_params": {
410 "target_platform": ["MUSCA_A"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100411 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100412 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100413 "ConfigRegressionIPC",
414 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100415 "ConfigCoreIPC",
416 "ConfigCoreIPCTfmLevel2",
417 "ConfigDefault"],
418 "cmake_build_type": ["Debug", "Release"],
419 "with_mcuboot": [True],
420 },
421 "common_params": _common_tfm_builder_cfg,
422 # invalid configuations can be added as tuples of adjustable
423 # resolution "AN521" will reject all combinations for that
424 # platform while ("AN521", "GNUARM") will only reject GCC
425 "invalid": [("MUSCA_A", "*", "*", "*", False)]
426 }
427
428config_MUSCA_B1 = {"seed_params": {
429 "target_platform": ["MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100430 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100431 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100432 "ConfigRegressionIPC",
433 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100434 "ConfigCoreIPC",
435 "ConfigCoreIPCTfmLevel2",
436 "ConfigDefault"],
437 "cmake_build_type": ["Debug", "Release"],
438 "with_mcuboot": [True],
439 },
440 "common_params": _common_tfm_builder_cfg,
441 # invalid configuations can be added as tuples of adjustable
442 # resolution "AN521" will reject all combinations for that
443 # platform while ("AN521", "GNUARM") will only reject GCC
444 "invalid": [("MUSCA_B1", "*", "*", "*", False)]
445 }
446
Karl Zhangaff558a2020-05-15 14:28:23 +0100447# Configure build manager to build the maximum number of configurations
448config_release = {"seed_params": {
449 "target_platform": ["AN521", "AN519",
450 "MUSCA_A", "MUSCA_B1", "MUSCA_S1",
451 "AN524", "AN539"],
452 "compiler": ["ARMCLANG", "GNUARM"],
453 "proj_config": ["ConfigRegression",
454 "ConfigRegressionIPC",
455 "ConfigRegressionIPCTfmLevel2",
456 "ConfigCoreIPC",
457 "ConfigCoreIPCTfmLevel2",
458 "ConfigDefault"],
459 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
460 "with_mcuboot": [True, False],
461 },
462 "common_params": _common_tfm_builder_cfg,
463 # invalid configuations can be added as tuples of adjustable
464 # resolution "AN521" will reject all combinations for that
465 # platform while ("AN521", "GNUARM") will only reject GCC ones
466 "invalid": [("MUSCA_A", "*", "*", "*", False),
467 ("MUSCA_S1", "*", "*", "*", False),
468 ("MUSCA_B1", "*", "*", "*", False)]
469 }
470
471# Configure build manager to build several combinations
472config_AN521_PSA_API = {"seed_params": {
473 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
474 "compiler": ["ARMCLANG", "GNUARM"],
475 "proj_config": ["ConfigPsaApiTest",
476 "ConfigPsaApiTestIPC",
477 "ConfigPsaApiTestIPCTfmLevel2"],
478 "psa_api_suit": ["CRYPTO",
479 "PROTECTED_STORAGE",
480 "INITIAL_ATTESTATION",
481 "INTERNAL_TRUSTED_STORAGE",
482 "IPC"],
483 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
484 "with_mcuboot": [True],
485 },
486 "common_params": _common_tfm_builder_cfg,
487 # invalid configuations can be added as tuples of adjustable
488 # resolution "AN521" will reject all combinations for that
489 # platform while ("AN521", "GNUARM") will only reject GCC ones
490 "invalid": [("*", "*", "*", "IPC", "*", "*")]
491 }
492
493# Configure build manager to build several combinations
494config_AN521_PSA_IPC = {"seed_params": {
495 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
496 "compiler": ["ARMCLANG", "GNUARM"],
497 "proj_config": ["ConfigPsaApiTestIPC",
498 "ConfigPsaApiTestIPCTfmLevel2"],
499 "psa_api_suit": ["IPC"],
500 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
501 "with_mcuboot": [True],
502 },
503 "common_params": _common_tfm_builder_cfg,
504 # invalid configuations can be added as tuples of adjustable
505 # resolution "AN521" will reject all combinations for that
506 # platform while ("AN521", "GNUARM") will only reject GCC ones
507 "invalid": []
508 }
509
Minos Galanakisea421232019-06-20 17:11:28 +0100510# Configruation used for document building
511config_doxygen = {"common_params": {
512 "config_type": "tf-m_documents",
513 "codebase_root_dir": "tf-m",
514 "build_cmds": {"all": ["cmake -G \"Unix Makefiles\" "
515 "-DPROJ_CONFIG=`readlink -f "
516 "%(_tbm_code_dir_)s/"
517 "configs/ConfigDefault.cmake` "
518 "-DTARGET_PLATFORM=AN521 "
519 "-DCOMPILER=GNUARM "
520 "-DCMAKE_BUILD_TYPE=Debug "
521 "-DBL2=True "
522 "%(_tbm_code_dir_)s/",
523 "cmake --build ./ -- install_doc",
524 "cmake --build ./ "
525 "-- install_userguide"]},
526 "artifact_capture_rex": r'%(_tbm_build_dir_)s/install/'
527 r'doc/reference_manual/(?:pdf|html)'
528 r'/(\w+\.(?:html|md|pdf))$',
529 },
530 "invalid": []
531 }
532
Karl Zhangaff558a2020-05-15 14:28:23 +0100533# Configuration used in testing
Minos Galanakisea421232019-06-20 17:11:28 +0100534config_debug = {"seed_params": {
535 "target_platform": ["AN521"],
536 "compiler": ["ARMCLANG"],
537 "proj_config": ["ConfigDefault"],
538 "cmake_build_type": ["Debug"],
539 "with_mcuboot": [True],
540 },
541 "common_params": _common_tfm_builder_cfg,
Karl Zhangaff558a2020-05-15 14:28:23 +0100542 # invalid configurations can be added as tuples of adjustable
Minos Galanakisea421232019-06-20 17:11:28 +0100543 # resolution "AN521" will reject all combinations for that
544 # platform while ("AN521", "GNUARM") will only reject GCC ones
545 "invalid": [("*", "GNUARM", "*", "*", False),
546 ("AN521", "ARMCLANG", "ConfigRegression",
547 "Release", False),
548 ]
549 }
550
Dean Birch4c6ad622020-03-13 11:28:03 +0000551# Configuration used in CI
552config_ci = {
553 "seed_params": {
554 "target_platform": ["AN521"],
555 "compiler": ["ARMCLANG", "GNUARM"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000556 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
557 "cmake_build_type": ["Release"],
558 "with_mcuboot": [True, False],
559 },
560 "common_params": _common_tfm_builder_cfg,
561 "invalid": [
562 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
563 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
564 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
565 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
566 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
567 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
568 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
569 ],
570}
571
Dean Birchd6ce2c82020-05-13 13:16:15 +0100572# Configuration used in CI if armclang not available
573config_ci_gnuarm = {
574 "seed_params": {
575 "target_platform": ["AN521"],
576 "compiler": ["ARMCLANG", "GNUARM"],
577 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
578 "cmake_build_type": ["Release"],
579 "with_mcuboot": [True, False],
580 },
581 "common_params": _common_tfm_builder_cfg,
582 "invalid": [
583 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
584 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
585 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
586 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
587 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
588 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
589 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
590 ("*", "ARMCLANG", "*", "*", "*"), # Disable ARMCLANG for now
591 ],
592}
593
594
Matthew Hartfb6fd362020-03-04 21:03:59 +0000595config_lava_debug = {
596 "seed_params": {
597 "target_platform": ["AN521"],
598 "compiler": ["GNUARM"],
599 "proj_config": ["ConfigCoreIPC", "ConfigCoreIPCTfmLevel2", "ConfigRegression"],
Dean Birch4c6ad622020-03-13 11:28:03 +0000600 "cmake_build_type": ["Release"],
601 "with_mcuboot": [True],
602 },
603 "common_params": _common_tfm_builder_cfg,
604 "invalid": [
605 ("AN521", "ARMCLANG", "ConfigDefault", "Release", True),
606 ("AN521", "GNUARM", "ConfigCoreIPCTfmLevel2", "Release", True),
607 ],
608}
609
Karl Zhangaff558a2020-05-15 14:28:23 +0100610_builtin_configs = {
611 "tfm_test": config_tfm_test,
612 "tfm_test2": config_tfm_test2,
613 "tfm_test_otp": config_tfm_test_OTP,
614 "psa_api": config_PSA_API,
615 "psa_api_otp": config_PSA_API_OTP,
616 "psa_ff": config_PSA_FF,
617 "psa_ff_otp": config_PSA_FF_OTP,
618 "full": config_full,
Dean Birchd6ce2c82020-05-13 13:16:15 +0100619 "full_gnuarm": config_full_gnuarm,
Karl Zhangaff558a2020-05-15 14:28:23 +0100620 "an539": config_AN539,
621 "an524": config_AN524,
Minos Galanakisea421232019-06-20 17:11:28 +0100622 "an521": config_AN521,
623 "an519": config_AN519,
624 "musca_a": config_MUSCA_A,
625 "musca_b1": config_MUSCA_B1,
626 "ipc": config_IPC,
627 "doxygen": config_doxygen,
Dean Birch4c6ad622020-03-13 11:28:03 +0000628 "debug": config_debug,
Karl Zhangaff558a2020-05-15 14:28:23 +0100629 "release": config_release,
630 "an521_psa_api": config_AN521_PSA_API,
631 "an521_psa_ipc": config_AN521_PSA_IPC,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000632 "debug": config_debug,
633 "lava_debug": config_lava_debug,
Dean Birchd6ce2c82020-05-13 13:16:15 +0100634 "ci": config_ci,
635 "ci_gnuarm": config_ci_gnuarm}
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100636
637if __name__ == '__main__':
638 import os
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100639
Minos Galanakisea421232019-06-20 17:11:28 +0100640 # Default behavior is to export refference config when called
641 _dir = os.getcwd()
642 from utils import save_json
643 for _cname, _cfg in _builtin_configs.items():
644 _fname = os.path.join(_dir, _cname + ".json")
645 print("Exporting config %s" % _fname)
646 save_json(_fname, _cfg)