blob: 0372fc1c61dff0265bbc6766ea37eda68940e8a1 [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
324config_tfm_test = {"seed_params": {
325 "target_platform": ["AN521", "MUSCA_A", "MUSCA_B1", "MUSCA_S1"],
326 "compiler": ["ARMCLANG", "GNUARM"],
327 "proj_config": ["ConfigRegression",
328 "ConfigRegressionIPC",
329 "ConfigRegressionIPCTfmLevel2",
330 "ConfigCoreIPC",
331 "ConfigCoreIPCTfmLevel2",
332 "ConfigDefault"],
333 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
334 "with_mcuboot": [True, False],
335 },
336 "common_params": _common_tfm_builder_cfg,
337 # invalid configuations can be added as tuples of adjustable
338 # resolution "AN521" will reject all combinations for that
339 # platform while ("AN521", "GNUARM") will only reject GCC ones
340 "invalid": [("MUSCA_A", "*", "*", "*", False),
341 ("MUSCA_S1", "*", "*", "*", False),
342 ("MUSCA_B1", "*", "*", "*", False)]
343 }
344# Configure build manager to build the maximum number of configurations
345config_tfm_test2 = {"seed_params": {
346 "target_platform": ["AN519", "AN524", "AN539", "SSE-200_AWS"],
347 "compiler": ["ARMCLANG", "GNUARM"],
348 "proj_config": ["ConfigRegression",
349 "ConfigRegressionIPC",
350 "ConfigRegressionIPCTfmLevel2",
351 "ConfigCoreIPC",
352 "ConfigCoreIPCTfmLevel2",
353 "ConfigDefault"],
354 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
355 "with_mcuboot": [True, False],
356 },
357 "common_params": _common_tfm_builder_cfg,
358 # invalid configuations can be added as tuples of adjustable
359 # resolution "AN521" will reject all combinations for that
360 # platform while ("AN521", "GNUARM") will only reject GCC ones
361 "invalid": []
362 }
363
364# Configure build manager to build the maximum number of configurations
365config_tfm_test_OTP = {"seed_params": {
366 "target_platform": ["MUSCA_B1"],
367 "compiler": ["ARMCLANG", "GNUARM"],
368 "proj_config": ["ConfigRegression",
369 "ConfigRegressionIPC",
370 "ConfigRegressionIPCTfmLevel2",
371 "ConfigCoreIPC",
372 "ConfigCoreIPCTfmLevel2",
373 "ConfigDefault"],
374 "with_OTP": ["OTP"],
375 "cmake_build_type": ["Debug", "Release", "Minsizerel"],
376 "with_mcuboot": [True],
377 },
378 "common_params": _common_tfm_builder_cfg,
379 # invalid configuations can be added as tuples of adjustable
380 # resolution "AN521" will reject all combinations for that
381 # platform while ("AN521", "GNUARM") will only reject GCC ones
382 "invalid": []
383 }
384
Minos Galanakisea421232019-06-20 17:11:28 +0100385config_MUSCA_A = {"seed_params": {
386 "target_platform": ["MUSCA_A"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100387 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100388 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100389 "ConfigRegressionIPC",
390 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100391 "ConfigCoreIPC",
392 "ConfigCoreIPCTfmLevel2",
393 "ConfigDefault"],
394 "cmake_build_type": ["Debug", "Release"],
395 "with_mcuboot": [True],
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
401 "invalid": [("MUSCA_A", "*", "*", "*", False)]
402 }
403
404config_MUSCA_B1 = {"seed_params": {
405 "target_platform": ["MUSCA_B1"],
Karl Zhangaff558a2020-05-15 14:28:23 +0100406 "compiler": ["ARMCLANG", "GNUARM"],
Minos Galanakisea421232019-06-20 17:11:28 +0100407 "proj_config": ["ConfigRegression",
Karl Zhangaff558a2020-05-15 14:28:23 +0100408 "ConfigRegressionIPC",
409 "ConfigRegressionIPCTfmLevel2",
Minos Galanakisea421232019-06-20 17:11:28 +0100410 "ConfigCoreIPC",
411 "ConfigCoreIPCTfmLevel2",
412 "ConfigDefault"],
413 "cmake_build_type": ["Debug", "Release"],
414 "with_mcuboot": [True],
415 },
416 "common_params": _common_tfm_builder_cfg,
417 # invalid configuations can be added as tuples of adjustable
418 # resolution "AN521" will reject all combinations for that
419 # platform while ("AN521", "GNUARM") will only reject GCC
420 "invalid": [("MUSCA_B1", "*", "*", "*", False)]
421 }
422
Karl Zhangaff558a2020-05-15 14:28:23 +0100423# Configure build manager to build the maximum number of configurations
424config_release = {"seed_params": {
425 "target_platform": ["AN521", "AN519",
426 "MUSCA_A", "MUSCA_B1", "MUSCA_S1",
427 "AN524", "AN539"],
428 "compiler": ["ARMCLANG", "GNUARM"],
429 "proj_config": ["ConfigRegression",
430 "ConfigRegressionIPC",
431 "ConfigRegressionIPCTfmLevel2",
432 "ConfigCoreIPC",
433 "ConfigCoreIPCTfmLevel2",
434 "ConfigDefault"],
435 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
436 "with_mcuboot": [True, False],
437 },
438 "common_params": _common_tfm_builder_cfg,
439 # invalid configuations can be added as tuples of adjustable
440 # resolution "AN521" will reject all combinations for that
441 # platform while ("AN521", "GNUARM") will only reject GCC ones
442 "invalid": [("MUSCA_A", "*", "*", "*", False),
443 ("MUSCA_S1", "*", "*", "*", False),
444 ("MUSCA_B1", "*", "*", "*", False)]
445 }
446
447# Configure build manager to build several combinations
448config_AN521_PSA_API = {"seed_params": {
449 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
450 "compiler": ["ARMCLANG", "GNUARM"],
451 "proj_config": ["ConfigPsaApiTest",
452 "ConfigPsaApiTestIPC",
453 "ConfigPsaApiTestIPCTfmLevel2"],
454 "psa_api_suit": ["CRYPTO",
455 "PROTECTED_STORAGE",
456 "INITIAL_ATTESTATION",
457 "INTERNAL_TRUSTED_STORAGE",
458 "IPC"],
459 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
460 "with_mcuboot": [True],
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": [("*", "*", "*", "IPC", "*", "*")]
467 }
468
469# Configure build manager to build several combinations
470config_AN521_PSA_IPC = {"seed_params": {
471 "target_platform": ["AN521", "AN519", "MUSCA_B1"],
472 "compiler": ["ARMCLANG", "GNUARM"],
473 "proj_config": ["ConfigPsaApiTestIPC",
474 "ConfigPsaApiTestIPCTfmLevel2"],
475 "psa_api_suit": ["IPC"],
476 "cmake_build_type": ["Debug", "Release", "MINSIZEREL"],
477 "with_mcuboot": [True],
478 },
479 "common_params": _common_tfm_builder_cfg,
480 # invalid configuations can be added as tuples of adjustable
481 # resolution "AN521" will reject all combinations for that
482 # platform while ("AN521", "GNUARM") will only reject GCC ones
483 "invalid": []
484 }
485
Minos Galanakisea421232019-06-20 17:11:28 +0100486# Configruation used for document building
487config_doxygen = {"common_params": {
488 "config_type": "tf-m_documents",
489 "codebase_root_dir": "tf-m",
490 "build_cmds": {"all": ["cmake -G \"Unix Makefiles\" "
491 "-DPROJ_CONFIG=`readlink -f "
492 "%(_tbm_code_dir_)s/"
493 "configs/ConfigDefault.cmake` "
494 "-DTARGET_PLATFORM=AN521 "
495 "-DCOMPILER=GNUARM "
496 "-DCMAKE_BUILD_TYPE=Debug "
497 "-DBL2=True "
498 "%(_tbm_code_dir_)s/",
499 "cmake --build ./ -- install_doc",
500 "cmake --build ./ "
501 "-- install_userguide"]},
502 "artifact_capture_rex": r'%(_tbm_build_dir_)s/install/'
503 r'doc/reference_manual/(?:pdf|html)'
504 r'/(\w+\.(?:html|md|pdf))$',
505 },
506 "invalid": []
507 }
508
Karl Zhangaff558a2020-05-15 14:28:23 +0100509# Configuration used in testing
Minos Galanakisea421232019-06-20 17:11:28 +0100510config_debug = {"seed_params": {
511 "target_platform": ["AN521"],
512 "compiler": ["ARMCLANG"],
513 "proj_config": ["ConfigDefault"],
514 "cmake_build_type": ["Debug"],
515 "with_mcuboot": [True],
516 },
517 "common_params": _common_tfm_builder_cfg,
Karl Zhangaff558a2020-05-15 14:28:23 +0100518 # invalid configurations can be added as tuples of adjustable
Minos Galanakisea421232019-06-20 17:11:28 +0100519 # resolution "AN521" will reject all combinations for that
520 # platform while ("AN521", "GNUARM") will only reject GCC ones
521 "invalid": [("*", "GNUARM", "*", "*", False),
522 ("AN521", "ARMCLANG", "ConfigRegression",
523 "Release", False),
524 ]
525 }
526
Dean Birch4c6ad622020-03-13 11:28:03 +0000527# Configuration used in CI
528config_ci = {
529 "seed_params": {
530 "target_platform": ["AN521"],
531 "compiler": ["ARMCLANG", "GNUARM"],
Matthew Hartfb6fd362020-03-04 21:03:59 +0000532 "proj_config": ["ConfigDefault", "ConfigCoreIPCTfmLevel2", "ConfigCoreIPC", "ConfigRegression"],
533 "cmake_build_type": ["Release"],
534 "with_mcuboot": [True, False],
535 },
536 "common_params": _common_tfm_builder_cfg,
537 "invalid": [
538 ("AN521", "ARMCLANG", "ConfigDefault", "Release", False),
539 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", False),
540 ("AN521", "ARMCLANG", "ConfigCoreIPCTfmLevel2", "Release", True),
541 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", False),
542 ("AN521", "ARMCLANG", "ConfigCoreIPC", "Release", True),
543 ("AN521", "ARMCLANG", "ConfigRegression", "Release", False),
544 ("AN521", "ARMCLANG", "ConfigRegression", "Release", True),
545 ],
546}
547
548config_lava_debug = {
549 "seed_params": {
550 "target_platform": ["AN521"],
551 "compiler": ["GNUARM"],
552 "proj_config": ["ConfigCoreIPC", "ConfigCoreIPCTfmLevel2", "ConfigRegression"],
Dean Birch4c6ad622020-03-13 11:28:03 +0000553 "cmake_build_type": ["Release"],
554 "with_mcuboot": [True],
555 },
556 "common_params": _common_tfm_builder_cfg,
557 "invalid": [
558 ("AN521", "ARMCLANG", "ConfigDefault", "Release", True),
559 ("AN521", "GNUARM", "ConfigCoreIPCTfmLevel2", "Release", True),
560 ],
561}
562
Karl Zhangaff558a2020-05-15 14:28:23 +0100563_builtin_configs = {
564 "tfm_test": config_tfm_test,
565 "tfm_test2": config_tfm_test2,
566 "tfm_test_otp": config_tfm_test_OTP,
567 "psa_api": config_PSA_API,
568 "psa_api_otp": config_PSA_API_OTP,
569 "psa_ff": config_PSA_FF,
570 "psa_ff_otp": config_PSA_FF_OTP,
571 "full": config_full,
572 "an539": config_AN539,
573 "an524": config_AN524,
Minos Galanakisea421232019-06-20 17:11:28 +0100574 "an521": config_AN521,
575 "an519": config_AN519,
576 "musca_a": config_MUSCA_A,
577 "musca_b1": config_MUSCA_B1,
578 "ipc": config_IPC,
579 "doxygen": config_doxygen,
Dean Birch4c6ad622020-03-13 11:28:03 +0000580 "debug": config_debug,
Karl Zhangaff558a2020-05-15 14:28:23 +0100581 "release": config_release,
582 "an521_psa_api": config_AN521_PSA_API,
583 "an521_psa_ipc": config_AN521_PSA_IPC,
Matthew Hartfb6fd362020-03-04 21:03:59 +0000584 "debug": config_debug,
585 "lava_debug": config_lava_debug,
Dean Birch4c6ad622020-03-13 11:28:03 +0000586 "ci": config_ci}
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100587
588if __name__ == '__main__':
589 import os
Minos Galanakisf4ca6ac2017-12-11 02:39:21 +0100590
Minos Galanakisea421232019-06-20 17:11:28 +0100591 # Default behavior is to export refference config when called
592 _dir = os.getcwd()
593 from utils import save_json
594 for _cname, _cfg in _builtin_configs.items():
595 _fname = os.path.join(_dir, _cname + ".json")
596 print("Exporting config %s" % _fname)
597 save_json(_fname, _cfg)