blob: 709019408485c51c87e1aa7af6a230a9b5357dd4 [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",
320 "AN524", "AN539"],
321 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100322 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100323 "ConfigRegressionIPC",
324 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100325 "ConfigCoreIPC",
326 "ConfigCoreIPCTfmLevel2",
327 "ConfigDefault"],
328 "cmake_build_type": ["Debug", "Release"],
329 "with_mcuboot": [True, False],
330 },
331 "common_params": _common_tfm_builder_cfg,
332 # invalid configuations can be added as tuples of adjustable
333 # resolution "AN521" will reject all combinations for that
334 # platform while ("AN521", "GNUARM") will only reject GCC ones
335 "invalid": [("MUSCA_A", "*", "*", "*", False),
336 ("MUSCA_B1", "*", "*", "*", False)]
337 }
338
Karl Zhangaff558a2020-05-15 14:28:23 +0100339# Configure build manager to build the maximum number of configurations
Dean Birchd6ce2c82020-05-13 13:16:15 +0100340config_full_gnuarm = {"seed_params": {
341 "target_platform": ["AN521", "AN519",
342 "MUSCA_A", "MUSCA_B1",
343 "AN524", "AN539"],
344 "compiler": ["ARMCLANG", "GNUARM"],
345 "proj_config": ["ConfigRegression",
346 "ConfigRegressionIPC",
347 "ConfigRegressionIPCTfmLevel2",
348 "ConfigCoreIPC",
349 "ConfigCoreIPCTfmLevel2",
350 "ConfigDefault"],
351 "cmake_build_type": ["Debug", "Release"],
352 "with_mcuboot": [True, False],
353 },
354 "common_params": _common_tfm_builder_cfg,
355 # invalid configuations can be added as tuples of adjustable
356 # resolution "AN521" will reject all combinations for that
357 # platform while ("AN521", "GNUARM") will only reject GCC ones
358 "invalid": [("MUSCA_A", "*", "*", "*", False),
359 ("MUSCA_B1", "*", "*", "*", False),
360 ("*", "ARMCLANG", "*", "*", "*")]
361 }
362
363# Configure build manager to build the maximum number of configurations
Karl Zhangaff558a2020-05-15 14:28:23 +0100364config_tfm_test = {"seed_params": {
365 "target_platform": ["AN521", "MUSCA_A", "MUSCA_B1", "MUSCA_S1"],
366 "compiler": ["ARMCLANG", "GNUARM"],
367 "proj_config": ["ConfigRegression",
368 "ConfigRegressionIPC",
369 "ConfigRegressionIPCTfmLevel2",
370 "ConfigCoreIPC",
371 "ConfigCoreIPCTfmLevel2",
372 "ConfigDefault"],
373 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
374 "with_mcuboot": [True, False],
375 },
376 "common_params": _common_tfm_builder_cfg,
377 # invalid configuations can be added as tuples of adjustable
378 # resolution "AN521" will reject all combinations for that
379 # platform while ("AN521", "GNUARM") will only reject GCC ones
380 "invalid": [("MUSCA_A", "*", "*", "*", False),
381 ("MUSCA_S1", "*", "*", "*", False),
382 ("MUSCA_B1", "*", "*", "*", False)]
383 }
384# Configure build manager to build the maximum number of configurations
385config_tfm_test2 = {"seed_params": {
386 "target_platform": ["AN519", "AN524", "AN539", "SSE-200_AWS"],
387 "compiler": ["ARMCLANG", "GNUARM"],
388 "proj_config": ["ConfigRegression",
389 "ConfigRegressionIPC",
390 "ConfigRegressionIPCTfmLevel2",
391 "ConfigCoreIPC",
392 "ConfigCoreIPCTfmLevel2",
393 "ConfigDefault"],
394 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
395 "with_mcuboot": [True, False],
396 },
397 "common_params": _common_tfm_builder_cfg,
398 # invalid configuations can be added as tuples of adjustable
399 # resolution "AN521" will reject all combinations for that
400 # platform while ("AN521", "GNUARM") will only reject GCC ones
401 "invalid": []
402 }
403
404# Configure build manager to build the maximum number of configurations
405config_tfm_test_OTP = {"seed_params": {
406 "target_platform": ["MUSCA_B1"],
407 "compiler": ["ARMCLANG", "GNUARM"],
408 "proj_config": ["ConfigRegression",
409 "ConfigRegressionIPC",
410 "ConfigRegressionIPCTfmLevel2",
411 "ConfigCoreIPC",
412 "ConfigCoreIPCTfmLevel2",
413 "ConfigDefault"],
414 "with_OTP": ["OTP"],
415 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
416 "with_mcuboot": [True],
417 },
418 "common_params": _common_tfm_builder_cfg,
419 # invalid configuations can be added as tuples of adjustable
420 # resolution "AN521" will reject all combinations for that
421 # platform while ("AN521", "GNUARM") will only reject GCC ones
422 "invalid": []
423 }
424
Minos Galanakisea421232019-06-20 17:11:28 +0100425config_MUSCA_A = {"seed_params": {
426 "target_platform": ["MUSCA_A"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100427 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100428 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100429 "ConfigRegressionIPC",
430 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100431 "ConfigCoreIPC",
432 "ConfigCoreIPCTfmLevel2",
433 "ConfigDefault"],
434 "cmake_build_type": ["Debug", "Release"],
435 "with_mcuboot": [True],
436 },
437 "common_params": _common_tfm_builder_cfg,
438 # invalid configuations can be added as tuples of adjustable
439 # resolution "AN521" will reject all combinations for that
440 # platform while ("AN521", "GNUARM") will only reject GCC
441 "invalid": [("MUSCA_A", "*", "*", "*", False)]
442 }
443
444config_MUSCA_B1 = {"seed_params": {
445 "target_platform": ["MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100446 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100447 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100448 "ConfigRegressionIPC",
449 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100450 "ConfigCoreIPC",
451 "ConfigCoreIPCTfmLevel2",
452 "ConfigDefault"],
453 "cmake_build_type": ["Debug", "Release"],
454 "with_mcuboot": [True],
455 },
456 "common_params": _common_tfm_builder_cfg,
457 # invalid configuations can be added as tuples of adjustable
458 # resolution "AN521" will reject all combinations for that
459 # platform while ("AN521", "GNUARM") will only reject GCC
460 "invalid": [("MUSCA_B1", "*", "*", "*", False)]
461 }
462
Karl Zhangaff558a2020-05-15 14:28:23 +0100463# Configure build manager to build the maximum number of configurations
464config_release = {"seed_params": {
465 "target_platform": ["AN521", "AN519",
466 "MUSCA_A", "MUSCA_B1", "MUSCA_S1",
467 "AN524", "AN539"],
468 "compiler": ["ARMCLANG", "GNUARM"],
469 "proj_config": ["ConfigRegression",
470 "ConfigRegressionIPC",
471 "ConfigRegressionIPCTfmLevel2",
472 "ConfigCoreIPC",
473 "ConfigCoreIPCTfmLevel2",
474 "ConfigDefault"],
475 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
476 "with_mcuboot": [True, False],
477 },
478 "common_params": _common_tfm_builder_cfg,
479 # invalid configuations can be added as tuples of adjustable
480 # resolution "AN521" will reject all combinations for that
481 # platform while ("AN521", "GNUARM") will only reject GCC ones
482 "invalid": [("MUSCA_A", "*", "*", "*", False),
483 ("MUSCA_S1", "*", "*", "*", False),
484 ("MUSCA_B1", "*", "*", "*", False)]
485 }
486
487# Configure build manager to build several combinations
488config_AN521_PSA_API = {"seed_params": {
489 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
490 "compiler": ["ARMCLANG", "GNUARM"],
491 "proj_config": ["ConfigPsaApiTest",
492 "ConfigPsaApiTestIPC",
493 "ConfigPsaApiTestIPCTfmLevel2"],
494 "psa_api_suit": ["CRYPTO",
495 "PROTECTED_STORAGE",
496 "INITIAL_ATTESTATION",
497 "INTERNAL_TRUSTED_STORAGE",
498 "IPC"],
499 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
500 "with_mcuboot": [True],
501 },
502 "common_params": _common_tfm_builder_cfg,
503 # invalid configuations can be added as tuples of adjustable
504 # resolution "AN521" will reject all combinations for that
505 # platform while ("AN521", "GNUARM") will only reject GCC ones
506 "invalid": [("*", "*", "*", "IPC", "*", "*")]
507 }
508
509# Configure build manager to build several combinations
510config_AN521_PSA_IPC = {"seed_params": {
511 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
512 "compiler": ["ARMCLANG", "GNUARM"],
513 "proj_config": ["ConfigPsaApiTestIPC",
514 "ConfigPsaApiTestIPCTfmLevel2"],
515 "psa_api_suit": ["IPC"],
516 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
517 "with_mcuboot": [True],
518 },
519 "common_params": _common_tfm_builder_cfg,
520 # invalid configuations can be added as tuples of adjustable
521 # resolution "AN521" will reject all combinations for that
522 # platform while ("AN521", "GNUARM") will only reject GCC ones
523 "invalid": []
524 }
525
Minos Galanakisea421232019-06-20 17:11:28 +0100526# Configruation used for document building
527config_doxygen = {"common_params": {
528 "config_type": "tf-m_documents",
529 "codebase_root_dir": "tf-m",
530 "build_cmds": {"all": ["cmake -G \"Unix Makefiles\" "
531 "-DPROJ_CONFIG=`readlink -f "
532 "%(_tbm_code_dir_)s/"
533 "configs/ConfigDefault.cmake` "
534 "-DTARGET_PLATFORM=AN521 "
535 "-DCOMPILER=GNUARM "
536 "-DCMAKE_BUILD_TYPE=Debug "
537 "-DBL2=True "
538 "%(_tbm_code_dir_)s/",
539 "cmake --build ./ -- install_doc",
540 "cmake --build ./ "
541 "-- install_userguide"]},
542 "artifact_capture_rex": r'%(_tbm_build_dir_)s/install/'
543 r'doc/reference_manual/(?:pdf|html)'
544 r'/(\w+\.(?:html|md|pdf))$',
545 },
546 "invalid": []
547 }
548
Karl Zhangaff558a2020-05-15 14:28:23 +0100549# Configuration used in testing
Minos Galanakisea421232019-06-20 17:11:28 +0100550config_debug = {"seed_params": {
551 "target_platform": ["AN521"],
552 "compiler": ["ARMCLANG"],
553 "proj_config": ["ConfigDefault"],
554 "cmake_build_type": ["Debug"],
555 "with_mcuboot": [True],
556 },
557 "common_params": _common_tfm_builder_cfg,
Karl Zhangaff558a2020-05-15 14:28:23 +0100558 # invalid configurations can be added as tuples of adjustable
Minos Galanakisea421232019-06-20 17:11:28 +0100559 # resolution "AN521" will reject all combinations for that
560 # platform while ("AN521", "GNUARM") will only reject GCC ones
561 "invalid": [("*", "GNUARM", "*", "*", False),
562 ("AN521", "ARMCLANG", "ConfigRegression",
563 "Release", False),
564 ]
565 }
566
Dean Birch4c6ad622020-03-13 11:28:03 +0000567# Configuration used in CI
568config_ci = {
569 "seed_params": {
570 "target_platform": ["AN521"],
571 "compiler": ["ARMCLANG", "GNUARM"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000572 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
573 "cmake_build_type": ["Release"],
574 "with_mcuboot": [True, False],
575 },
576 "common_params": _common_tfm_builder_cfg,
577 "invalid": [
578 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
579 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
580 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
581 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
582 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
583 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
584 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
585 ],
586}
587
Dean Birchd6ce2c82020-05-13 13:16:15 +0100588# Configuration used in CI if armclang not available
589config_ci_gnuarm = {
590 "seed_params": {
591 "target_platform": ["AN521"],
592 "compiler": ["ARMCLANG", "GNUARM"],
593 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
594 "cmake_build_type": ["Release"],
595 "with_mcuboot": [True, False],
596 },
597 "common_params": _common_tfm_builder_cfg,
598 "invalid": [
599 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
600 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
601 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
602 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
603 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
604 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
605 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
606 ("*", "ARMCLANG", "*", "*", "*"), # Disable ARMCLANG for now
607 ],
608}
609
610
Matthew Hartfb6fd362020-03-04 21:03:59 +0000611config_lava_debug = {
612 "seed_params": {
Matthew Hart2c2688f2020-05-26 13:09:20 +0100613 "target_platform": ["AN521", "AN519"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000614 "compiler": ["GNUARM"],
Matthew Hart2c2688f2020-05-26 13:09:20 +0100615 "proj_config": ["ConfigRegressionIPC", "ConfigRegressionIPCTfmLevel2", "ConfigRegression"],
Dean Birch4c6ad622020-03-13 11:28:03 +0000616 "cmake_build_type": ["Release"],
Matthew Hart2c2688f2020-05-26 13:09:20 +0100617 "with_mcuboot": [True, False],
Dean Birch4c6ad622020-03-13 11:28:03 +0000618 },
619 "common_params": _common_tfm_builder_cfg,
620 "invalid": [
621 ("AN521", "ARMCLANG", "ConfigDefault", "Release", True),
622 ("AN521", "GNUARM", "ConfigCoreIPCTfmLevel2", "Release", True),
623 ],
624}
625
Karl Zhangaff558a2020-05-15 14:28:23 +0100626_builtin_configs = {
627 "tfm_test": config_tfm_test,
628 "tfm_test2": config_tfm_test2,
629 "tfm_test_otp": config_tfm_test_OTP,
630 "psa_api": config_PSA_API,
631 "psa_api_otp": config_PSA_API_OTP,
632 "psa_ff": config_PSA_FF,
633 "psa_ff_otp": config_PSA_FF_OTP,
634 "full": config_full,
Dean Birchd6ce2c82020-05-13 13:16:15 +0100635 "full_gnuarm": config_full_gnuarm,
Karl Zhangaff558a2020-05-15 14:28:23 +0100636 "an539": config_AN539,
637 "an524": config_AN524,
Minos Galanakisea421232019-06-20 17:11:28 +0100638 "an521": config_AN521,
639 "an519": config_AN519,
640 "musca_a": config_MUSCA_A,
641 "musca_b1": config_MUSCA_B1,
Karl Zhang96dfe2d2020-05-11 11:31:40 +0800642 "psoc64": config_PSOC64,
Minos Galanakisea421232019-06-20 17:11:28 +0100643 "ipc": config_IPC,
644 "doxygen": config_doxygen,
Dean Birch4c6ad622020-03-13 11:28:03 +0000645 "debug": config_debug,
Karl Zhangaff558a2020-05-15 14:28:23 +0100646 "release": config_release,
647 "an521_psa_api": config_AN521_PSA_API,
648 "an521_psa_ipc": config_AN521_PSA_IPC,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000649 "debug": config_debug,
650 "lava_debug": config_lava_debug,
Dean Birchd6ce2c82020-05-13 13:16:15 +0100651 "ci": config_ci,
652 "ci_gnuarm": config_ci_gnuarm}
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100653
654if __name__ == '__main__':
655 import os
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100656
Minos Galanakisea421232019-06-20 17:11:28 +0100657 # Default behavior is to export refference config when called
658 _dir = os.getcwd()
659 from utils import save_json
660 for _cname, _cfg in _builtin_configs.items():
661 _fname = os.path.join(_dir, _cname + ".json")
662 print("Exporting config %s" % _fname)
663 save_json(_fname, _cfg)