blob: f302396e4f23e2bea6d80bb90419c27c4a8f93c9 [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
Karl Zhang96dfe2d2020-05-11 11:31:40 +0800264config_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 Galanakisea421232019-06-20 17:11:28 +0100280config_AN519 = {"seed_params": {
281 "target_platform": ["AN519"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100282 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100283 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100284 "ConfigRegressionIPC",
285 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100286 "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
299config_IPC = {"seed_params": {
300 "target_platform": ["AN521", "AN519", "MUSCA_A", "MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100301 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100302 "proj_config": ["ConfigCoreIPC",
Karl Zhangaff558a2020-05-15 14:28:23 +0100303 "ConfigCoreIPCTfmLevel2",
304 "ConfigRegressionIPC",
305 "ConfigRegressionIPCTfmLevel2"],
Minos Galanakisea421232019-06-20 17:11:28 +0100306 "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
317config_full = {"seed_params": {
Karl Zhangaff558a2020-05-15 14:28:23 +0100318 "target_platform": ["AN521", "AN519",
319 "MUSCA_A", "MUSCA_B1",
Karl Zhang81a76772020-05-11 18:28:52 +0800320 "AN524", "AN539",
321 "psoc64"],
Dean Birchd6ce2c82020-05-13 13:16:15 +0100322 "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 Zhang81a76772020-05-11 18:28:52 +0800338 ("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
347config_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 Birchd6ce2c82020-05-13 13:16:15 +0100374 }
375
376# Configure build manager to build the maximum number of configurations
Karl Zhangaff558a2020-05-15 14:28:23 +0100377config_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 }
Karl Zhang14573bc2020-06-08 09:23:21 +0800397
Karl Zhangaff558a2020-05-15 14:28:23 +0100398# Configure build manager to build the maximum number of configurations
399config_tfm_test2 = {"seed_params": {
400 "target_platform": ["AN519", "AN524", "AN539", "SSE-200_AWS"],
401 "compiler": ["ARMCLANG", "GNUARM"],
402 "proj_config": ["ConfigRegression",
403 "ConfigRegressionIPC",
404 "ConfigRegressionIPCTfmLevel2",
405 "ConfigCoreIPC",
406 "ConfigCoreIPCTfmLevel2",
407 "ConfigDefault"],
408 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
409 "with_mcuboot": [True, False],
410 },
411 "common_params": _common_tfm_builder_cfg,
412 # invalid configuations can be added as tuples of adjustable
413 # resolution "AN521" will reject all combinations for that
414 # platform while ("AN521", "GNUARM") will only reject GCC ones
415 "invalid": []
416 }
417
418# Configure build manager to build the maximum number of configurations
Karl Zhang14573bc2020-06-08 09:23:21 +0800419config_tfm_profile = {"seed_params": {
420 "target_platform": ["AN519", "AN521"],
421 "compiler": ["ARMCLANG", "GNUARM"],
422 "proj_config": ["ConfigDefaultProfileS",
423 "ConfigRegressionProfileS"],
424 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
425 "with_mcuboot": [True, False],
426 },
427 "common_params": _common_tfm_builder_cfg,
428 # invalid configuations can be added as tuples of adjustable
429 # resolution "AN521" will reject all combinations for that
430 # platform while ("AN521", "GNUARM") will only reject GCC ones
431 "invalid": []
432 }
433
434# Configure build manager to build the maximum number of configurations
Karl Zhangaff558a2020-05-15 14:28:23 +0100435config_tfm_test_OTP = {"seed_params": {
436 "target_platform": ["MUSCA_B1"],
437 "compiler": ["ARMCLANG", "GNUARM"],
438 "proj_config": ["ConfigRegression",
439 "ConfigRegressionIPC",
440 "ConfigRegressionIPCTfmLevel2",
441 "ConfigCoreIPC",
442 "ConfigCoreIPCTfmLevel2",
443 "ConfigDefault"],
444 "with_OTP": ["OTP"],
445 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
446 "with_mcuboot": [True],
447 },
448 "common_params": _common_tfm_builder_cfg,
449 # invalid configuations can be added as tuples of adjustable
450 # resolution "AN521" will reject all combinations for that
451 # platform while ("AN521", "GNUARM") will only reject GCC ones
452 "invalid": []
453 }
454
Minos Galanakisea421232019-06-20 17:11:28 +0100455config_MUSCA_A = {"seed_params": {
456 "target_platform": ["MUSCA_A"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100457 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100458 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100459 "ConfigRegressionIPC",
460 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100461 "ConfigCoreIPC",
462 "ConfigCoreIPCTfmLevel2",
463 "ConfigDefault"],
464 "cmake_build_type": ["Debug", "Release"],
465 "with_mcuboot": [True],
466 },
467 "common_params": _common_tfm_builder_cfg,
468 # invalid configuations can be added as tuples of adjustable
469 # resolution "AN521" will reject all combinations for that
470 # platform while ("AN521", "GNUARM") will only reject GCC
471 "invalid": [("MUSCA_A", "*", "*", "*", False)]
472 }
473
474config_MUSCA_B1 = {"seed_params": {
475 "target_platform": ["MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100476 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100477 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100478 "ConfigRegressionIPC",
479 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100480 "ConfigCoreIPC",
481 "ConfigCoreIPCTfmLevel2",
482 "ConfigDefault"],
483 "cmake_build_type": ["Debug", "Release"],
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
490 "invalid": [("MUSCA_B1", "*", "*", "*", False)]
491 }
492
Karl Zhangaff558a2020-05-15 14:28:23 +0100493# Configure build manager to build the maximum number of configurations
494config_release = {"seed_params": {
495 "target_platform": ["AN521", "AN519",
496 "MUSCA_A", "MUSCA_B1", "MUSCA_S1",
497 "AN524", "AN539"],
498 "compiler": ["ARMCLANG", "GNUARM"],
499 "proj_config": ["ConfigRegression",
500 "ConfigRegressionIPC",
501 "ConfigRegressionIPCTfmLevel2",
502 "ConfigCoreIPC",
503 "ConfigCoreIPCTfmLevel2",
504 "ConfigDefault"],
505 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
506 "with_mcuboot": [True, False],
507 },
508 "common_params": _common_tfm_builder_cfg,
509 # invalid configuations can be added as tuples of adjustable
510 # resolution "AN521" will reject all combinations for that
511 # platform while ("AN521", "GNUARM") will only reject GCC ones
512 "invalid": [("MUSCA_A", "*", "*", "*", False),
513 ("MUSCA_S1", "*", "*", "*", False),
514 ("MUSCA_B1", "*", "*", "*", False)]
515 }
516
517# Configure build manager to build several combinations
518config_AN521_PSA_API = {"seed_params": {
519 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
520 "compiler": ["ARMCLANG", "GNUARM"],
521 "proj_config": ["ConfigPsaApiTest",
522 "ConfigPsaApiTestIPC",
523 "ConfigPsaApiTestIPCTfmLevel2"],
524 "psa_api_suit": ["CRYPTO",
525 "PROTECTED_STORAGE",
526 "INITIAL_ATTESTATION",
527 "INTERNAL_TRUSTED_STORAGE",
528 "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": [("*", "*", "*", "IPC", "*", "*")]
537 }
538
539# Configure build manager to build several combinations
540config_AN521_PSA_IPC = {"seed_params": {
541 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
542 "compiler": ["ARMCLANG", "GNUARM"],
543 "proj_config": ["ConfigPsaApiTestIPC",
544 "ConfigPsaApiTestIPCTfmLevel2"],
545 "psa_api_suit": ["IPC"],
546 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
547 "with_mcuboot": [True],
548 },
549 "common_params": _common_tfm_builder_cfg,
550 # invalid configuations can be added as tuples of adjustable
551 # resolution "AN521" will reject all combinations for that
552 # platform while ("AN521", "GNUARM") will only reject GCC ones
553 "invalid": []
554 }
555
Karl Zhang14573bc2020-06-08 09:23:21 +0800556# Configure build manager to build the maximum number of configurations
557config_nightly = {"seed_params": {
558 "target_platform": ["AN521", "AN519",
559 "MUSCA_A", "MUSCA_B1", "MUSCA_S1",
560 "AN524", "AN539", "SSE-200_AWS",
561 "psoc64"],
562 "compiler": ["ARMCLANG", "GNUARM"],
563 "proj_config": ["ConfigRegression",
564 "ConfigRegressionIPC",
565 "ConfigRegressionIPCTfmLevel2",
566 "ConfigDefault"],
567 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
568 "with_mcuboot": [True, False],
569 },
570 "common_params": _common_tfm_builder_cfg,
571 # invalid configuations can be added as tuples of adjustable
572 # resolution "AN521" will reject all combinations for that
573 # platform while ("AN521", "GNUARM") will only reject GCC ones
574 "invalid": [("MUSCA_A", "*", "*", "*", False),
575 ("MUSCA_B1", "*", "*", "*", False),
576 ("psoc64", "*", "*", "*", True),
577 ("psoc64", "*", "*", "Debug", "*"),
578 ("psoc64", "*", "*", "Minsizerel", "*"),
579 ("psoc64", "*", "ConfigDefault", "*", "*"),
580 ("psoc64", "*", "ConfigRegression", "*", "*")]
581 }
582
583# Configure build manager to build the maximum number of configurations
584config_nightly_profile = {"seed_params": {
585 "target_platform": ["AN519", "AN521"],
586 "compiler": ["ARMCLANG", "GNUARM"],
587 "proj_config": ["ConfigDefaultProfileS",
588 "ConfigRegressionProfileS"],
589 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
590 "with_mcuboot": [True, False],
591 },
592 "common_params": _common_tfm_builder_cfg,
593 # invalid configuations can be added as tuples of adjustable
594 # resolution "AN521" will reject all combinations for that
595 # platform while ("AN521", "GNUARM") will only reject GCC ones
596 "invalid": []
597 }
598
599# Configure build manager to build several combinations
600config_nightly_PSA_API = {"seed_params": {
601 "target_platform": ["AN521"],
602 "compiler": ["ARMCLANG", "GNUARM"],
603 "proj_config": ["ConfigPsaApiTest",
604 "ConfigPsaApiTestIPC",
605 "ConfigPsaApiTestIPCTfmLevel2"],
606 "psa_api_suit": ["CRYPTO",
607 "PROTECTED_STORAGE",
608 "INITIAL_ATTESTATION",
609 "INTERNAL_TRUSTED_STORAGE"],
610 "cmake_build_type": ["Debug", "Release"],
611 "with_mcuboot": [True],
612 },
613 "common_params": _common_tfm_builder_cfg,
614 # invalid configuations can be added as tuples of adjustable
615 # resolution "AN521" will reject all combinations for that
616 # platform while ("AN521", "GNUARM") will only reject GCC ones
617 "invalid": []
618 }
619
620# Configure build manager to build several combinations
621config_nightly_PSA_FF = {"seed_params": {
622 "target_platform": ["AN521"],
623 "compiler": ["ARMCLANG", "GNUARM"],
624 "proj_config": ["ConfigPsaApiTestIPC",
625 "ConfigPsaApiTestIPCTfmLevel2"],
626 # Prefer to use "IPC" from compile command perspective
627 # But the name style is prefer "FF"
628 "psa_api_suit": ["FF"],
629 "cmake_build_type": ["Debug", "Release"],
630 "with_mcuboot": [True],
631 },
632 "common_params": _common_tfm_builder_cfg,
633 # invalid configuations can be added as tuples of adjustable
634 # resolution "AN521" will reject all combinations for that
635 # platform while ("AN521", "GNUARM") will only reject GCC ones
636 "invalid": []
637 }
638
639# Configure build manager to build the maximum number of configurations
640config_nightly_OTP = {"seed_params": {
641 "target_platform": ["MUSCA_B1"],
642 "compiler": ["ARMCLANG", "GNUARM"],
643 "proj_config": ["ConfigRegression",
644 "ConfigRegressionIPC",
645 "ConfigRegressionIPCTfmLevel2"],
646 "with_OTP": ["OTP"],
647 "cmake_build_type": ["Debug", "Release"],
648 "with_mcuboot": [True],
649 },
650 "common_params": _common_tfm_builder_cfg,
651 # invalid configuations can be added as tuples of adjustable
652 # resolution "AN521" will reject all combinations for that
653 # platform while ("AN521", "GNUARM") will only reject GCC ones
654 "invalid": []
655 }
656
657# Configure build manager to build the maximum number of configurations
658config_pp_test = {"seed_params": {
659 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
660 "compiler": ["ARMCLANG", "GNUARM"],
661 "proj_config": ["ConfigRegression",
662 "ConfigRegressionIPC",
663 "ConfigRegressionIPCTfmLevel2",
664 "ConfigRegressionProfileS"],
665 "cmake_build_type": ["Release"],
666 "with_mcuboot": [True],
667 },
668 "common_params": _common_tfm_builder_cfg,
669 # invalid configuations can be added as tuples of adjustable
670 # resolution "AN521" will reject all combinations for that
671 # platform while ("AN521", "GNUARM") will only reject GCC ones
672 "invalid": [("MUSCA_B1", "*", "ConfigRegressionProfileS", "*", "*")]
673 }
674
675# Configure build manager to build the maximum number of configurations
676config_pp_OTP = {"seed_params": {
677 "target_platform": ["MUSCA_B1"],
678 "compiler": ["GNUARM"],
679 "proj_config": ["ConfigRegression",
680 "ConfigRegressionIPC",
681 "ConfigRegressionIPCTfmLevel2"],
682 "with_OTP": ["OTP"],
683 "cmake_build_type": ["Release"],
684 "with_mcuboot": [True],
685 },
686 "common_params": _common_tfm_builder_cfg,
687 # invalid configuations can be added as tuples of adjustable
688 # resolution "AN521" will reject all combinations for that
689 # platform while ("AN521", "GNUARM") will only reject GCC ones
690 "invalid": []
691 }
692
693# Configure build manager to build several combinations
694config_pp_PSA_API = {"seed_params": {
695 "target_platform": ["AN521"],
696 "compiler": ["GNUARM"],
697 "proj_config": ["ConfigPsaApiTestIPCTfmLevel2"],
698 "psa_api_suit": ["FF",
699 "CRYPTO",
700 "PROTECTED_STORAGE",
701 "INITIAL_ATTESTATION",
702 "INTERNAL_TRUSTED_STORAGE"],
703 "cmake_build_type": ["Release"],
704 "with_mcuboot": [True],
705 },
706 "common_params": _common_tfm_builder_cfg,
707 # invalid configuations can be added as tuples of adjustable
708 # resolution "AN521" will reject all combinations for that
709 # platform while ("AN521", "GNUARM") will only reject GCC ones
710 "invalid": []
711 }
712
713# Configure build manager to build several combinations
714config_pp_PSoC64 = {"seed_params": {
715 "target_platform": ["psoc64"],
716 "compiler": ["GNUARM"],
717 "proj_config": ["ConfigRegressionIPC",
718 "ConfigRegressionIPCTfmLevel2"],
719 "cmake_build_type": ["Release"],
720 "with_mcuboot": [False],
721 },
722 "common_params": _common_tfm_builder_cfg,
723 # invalid configuations can be added as tuples of adjustable
724 # resolution "AN521" will reject all combinations for that
725 # platform while ("AN521", "GNUARM") will only reject GCC ones
726 "invalid": []
727 }
728
Minos Galanakisea421232019-06-20 17:11:28 +0100729# Configruation used for document building
730config_doxygen = {"common_params": {
731 "config_type": "tf-m_documents",
732 "codebase_root_dir": "tf-m",
733 "build_cmds": {"all": ["cmake -G \"Unix Makefiles\" "
734 "-DPROJ_CONFIG=`readlink -f "
735 "%(_tbm_code_dir_)s/"
736 "configs/ConfigDefault.cmake` "
737 "-DTARGET_PLATFORM=AN521 "
738 "-DCOMPILER=GNUARM "
739 "-DCMAKE_BUILD_TYPE=Debug "
740 "-DBL2=True "
741 "%(_tbm_code_dir_)s/",
742 "cmake --build ./ -- install_doc",
743 "cmake --build ./ "
744 "-- install_userguide"]},
745 "artifact_capture_rex": r'%(_tbm_build_dir_)s/install/'
746 r'doc/reference_manual/(?:pdf|html)'
747 r'/(\w+\.(?:html|md|pdf))$',
748 },
749 "invalid": []
750 }
751
Karl Zhangaff558a2020-05-15 14:28:23 +0100752# Configuration used in testing
Minos Galanakisea421232019-06-20 17:11:28 +0100753config_debug = {"seed_params": {
754 "target_platform": ["AN521"],
755 "compiler": ["ARMCLANG"],
756 "proj_config": ["ConfigDefault"],
757 "cmake_build_type": ["Debug"],
758 "with_mcuboot": [True],
759 },
760 "common_params": _common_tfm_builder_cfg,
Karl Zhangaff558a2020-05-15 14:28:23 +0100761 # invalid configurations can be added as tuples of adjustable
Minos Galanakisea421232019-06-20 17:11:28 +0100762 # resolution "AN521" will reject all combinations for that
763 # platform while ("AN521", "GNUARM") will only reject GCC ones
764 "invalid": [("*", "GNUARM", "*", "*", False),
765 ("AN521", "ARMCLANG", "ConfigRegression",
766 "Release", False),
767 ]
768 }
769
Dean Birch4c6ad622020-03-13 11:28:03 +0000770# Configuration used in CI
771config_ci = {
772 "seed_params": {
773 "target_platform": ["AN521"],
774 "compiler": ["ARMCLANG", "GNUARM"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000775 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
776 "cmake_build_type": ["Release"],
777 "with_mcuboot": [True, False],
778 },
779 "common_params": _common_tfm_builder_cfg,
780 "invalid": [
781 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
782 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
783 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
784 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
785 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
786 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
787 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
788 ],
789}
790
Dean Birchd6ce2c82020-05-13 13:16:15 +0100791# Configuration used in CI if armclang not available
792config_ci_gnuarm = {
793 "seed_params": {
794 "target_platform": ["AN521"],
795 "compiler": ["ARMCLANG", "GNUARM"],
796 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
797 "cmake_build_type": ["Release"],
798 "with_mcuboot": [True, False],
799 },
800 "common_params": _common_tfm_builder_cfg,
801 "invalid": [
802 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
803 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
804 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
805 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
806 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
807 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
808 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
809 ("*", "ARMCLANG", "*", "*", "*"), # Disable ARMCLANG for now
810 ],
811}
812
813
Matthew Hartfb6fd362020-03-04 21:03:59 +0000814config_lava_debug = {
815 "seed_params": {
Matthew Hart2c2688f2020-05-26 13:09:20 +0100816 "target_platform": ["AN521", "AN519"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000817 "compiler": ["GNUARM"],
Matthew Hart2c2688f2020-05-26 13:09:20 +0100818 "proj_config": ["ConfigRegressionIPC", "ConfigRegressionIPCTfmLevel2", "ConfigRegression"],
Dean Birch4c6ad622020-03-13 11:28:03 +0000819 "cmake_build_type": ["Release"],
Matthew Hart2c2688f2020-05-26 13:09:20 +0100820 "with_mcuboot": [True, False],
Dean Birch4c6ad622020-03-13 11:28:03 +0000821 },
822 "common_params": _common_tfm_builder_cfg,
823 "invalid": [
824 ("AN521", "ARMCLANG", "ConfigDefault", "Release", True),
825 ("AN521", "GNUARM", "ConfigCoreIPCTfmLevel2", "Release", True),
826 ],
827}
828
Karl Zhangaff558a2020-05-15 14:28:23 +0100829_builtin_configs = {
Karl Zhang14573bc2020-06-08 09:23:21 +0800830 #release test group
Karl Zhangaff558a2020-05-15 14:28:23 +0100831 "tfm_test": config_tfm_test,
832 "tfm_test2": config_tfm_test2,
Karl Zhang14573bc2020-06-08 09:23:21 +0800833 "tfm_profile": config_tfm_profile,
Karl Zhangaff558a2020-05-15 14:28:23 +0100834 "tfm_test_otp": config_tfm_test_OTP,
835 "psa_api": config_PSA_API,
836 "psa_api_otp": config_PSA_API_OTP,
837 "psa_ff": config_PSA_FF,
838 "psa_ff_otp": config_PSA_FF_OTP,
Karl Zhang14573bc2020-06-08 09:23:21 +0800839 "tfm_psoc64": config_PSOC64,
840
841 #nightly test group
842 "nightly_test": config_nightly,
843 "nightly_profile": config_nightly_profile,
844 "nightly_psa_api": config_nightly_PSA_API,
845 "nightly_ff": config_nightly_PSA_FF,
846 "nightly_otp": config_nightly_OTP,
847
848 #per patch test group
849 "pp_test": config_pp_test,
850 "pp_OTP": config_pp_OTP,
851 "pp_PSA_API": config_pp_PSA_API,
852 "pp_psoc64": config_pp_PSoC64,
853
854 #full test group in the old CI
Karl Zhangaff558a2020-05-15 14:28:23 +0100855 "full": config_full,
Karl Zhang14573bc2020-06-08 09:23:21 +0800856
857 #specific test group
Karl Zhangaff558a2020-05-15 14:28:23 +0100858 "an539": config_AN539,
859 "an524": config_AN524,
Minos Galanakisea421232019-06-20 17:11:28 +0100860 "an521": config_AN521,
Karl Zhang14573bc2020-06-08 09:23:21 +0800861 "an521_psa_api": config_AN521_PSA_API,
862 "an521_psa_ipc": config_AN521_PSA_IPC,
Minos Galanakisea421232019-06-20 17:11:28 +0100863 "an519": config_AN519,
864 "musca_a": config_MUSCA_A,
865 "musca_b1": config_MUSCA_B1,
Karl Zhang96dfe2d2020-05-11 11:31:40 +0800866 "psoc64": config_PSOC64,
Minos Galanakisea421232019-06-20 17:11:28 +0100867 "ipc": config_IPC,
868 "doxygen": config_doxygen,
Dean Birch4c6ad622020-03-13 11:28:03 +0000869 "debug": config_debug,
Karl Zhangaff558a2020-05-15 14:28:23 +0100870 "release": config_release,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000871 "debug": config_debug,
Karl Zhang14573bc2020-06-08 09:23:21 +0800872
873 #DevOps team test group
874 "full_gnuarm": config_full_gnuarm,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000875 "lava_debug": config_lava_debug,
Dean Birchd6ce2c82020-05-13 13:16:15 +0100876 "ci": config_ci,
877 "ci_gnuarm": config_ci_gnuarm}
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100878
879if __name__ == '__main__':
880 import os
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100881
Minos Galanakisea421232019-06-20 17:11:28 +0100882 # Default behavior is to export refference config when called
883 _dir = os.getcwd()
884 from utils import save_json
885 for _cname, _cfg in _builtin_configs.items():
886 _fname = os.path.join(_dir, _cname + ".json")
887 print("Exporting config %s" % _fname)
888 save_json(_fname, _cfg)