| #!/usr/bin/env python3 |
| |
| """ build_helper_config_maps.py: |
| Set map info of config params for build helper """ |
| |
| __copyright__ = """ |
| /* |
| * SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors |
| * |
| * SPDX-License-Identifier: BSD-3-Clause |
| * |
| */ |
| """ |
| |
| # Map platform names to short format |
| mapPlatform = { |
| "arm/mps2/an519" : "AN519", |
| "arm/mps2/an521" : "AN521", |
| "arm/mps3/an524" : "AN524", |
| "arm/mps3/corstone300/fvp" : "CS300_FVP", |
| "arm/mps3/corstone300/an547" : "CS300_AN547", |
| "arm/mps3/corstone300/an552" : "CS300_AN552", |
| "arm/musca_b1" : "MUSCA_B1", |
| "arm/musca_s1" : "MUSCA_S1", |
| "arm/corstone1000" : "corstone1000", |
| "arm/mps4/corstone315" : "corstone315", |
| "arm/mps4/corstone320" : "corstone320", |
| "arm/mps3/corstone310/fvp" : "corstone310", |
| "arm/rse/tc/tc3" : "RSE_TC3", |
| "arm/rse/tc/tc4" : "RSE_TC4", |
| "arm/rse/neoverse_rd/rdv3" : "RSE_RDV3", |
| "arm/rse/neoverse_rd/rdv3r1" : "RSE_RDV3R1", |
| "arm/rse/automotive_rd/rd1ae" : "RSE_RD1AE", |
| "cypress/psoc64" : "psoc64", |
| "lairdconnectivity/bl5340_dvk_cpuapp": "BL5340", |
| "nordic_nrf/nrf5340dk_nrf5340_cpuapp": "nrf5340dk", |
| "nordic_nrf/nrf9160dk_nrf9160" : "nrf9160dk", |
| "nuvoton/m2351" : "M2351", |
| "nuvoton/m2354" : "M2354", |
| "nxp/lpcxpresso55s69" : "lpcxpresso55s69", |
| "stm/stm32l562e_dk" : "stm32l562e_dk", |
| "stm/stm32wba65i_dk" : "stm32wba65i_dk", |
| "stm/b_u585i_iot02a" : "b_u585i_iot02a", |
| "stm/stm32h573i_dk" : "stm32h573i_dk", |
| "stm/nucleo_l552ze_q" : "nucleo_l552ze_q", |
| "rpi/rp2350" : "rp2350", |
| } |
| |
| # Map regression test parameters to short format |
| mapRegTest = { |
| "OFF" : "-DTEST_BL2=OFF -DTEST_S=OFF -DTEST_NS=OFF ", |
| "RegBL2" : "-DTEST_BL2=ON ", |
| "RegS" : "-DTEST_S=ON ", |
| "RegNS" : "-DTEST_NS=ON -DTEST_NS_FLIH_IRQ=OFF ", |
| "RegBL1_1" : "-DTEST_BL1_1=ON ", |
| "RegBL1_2" : "-DTEST_BL1_2=ON ", |
| } |
| |
| # Map PSA Arch Tests to short format |
| mapTestPsaApi = { |
| "IPC" : "FF", |
| "CRYPTO" : "CRYPTO", |
| "INITIAL_ATTESTATION": "ATTEST", |
| "STORAGE" : "STORAGE", |
| } |
| |
| # Map Profile names to short format |
| mapProfile = { |
| "profile_small" : "SMALL", |
| "profile_medium": "MEDIUM", |
| "profile_medium_arotless": "MEDIUM-AROT-LESS", |
| "profile_large" : "LARGE", |
| } |
| |
| # Map abbreviation of extra params to cmake build commands |
| mapExtraParams = { |
| # Default |
| "" : "", |
| "NSOFF" : "-DNS=OFF ", |
| # NSCE |
| "NSCE" : "-DTFM_NS_MANAGE_NSID=ON ", |
| # MMIO |
| "MMIO" : "-DPSA_FRAMEWORK_HAS_MM_IOVEC=ON ", |
| # FPU support |
| "FPOFF" : "-DCONFIG_TFM_ENABLE_FP=OFF ", |
| "FPON" : ("-DCONFIG_TFM_ENABLE_FP=ON " |
| "-DTEST_S_FPU=ON -DTEST_NS_FPU=ON "), |
| "LZOFF" : "-DCONFIG_TFM_LAZY_STACKING=OFF ", |
| # Partiton |
| "PSOFF" : "-DTFM_PARTITION_PROTECTED_STORAGE=OFF ", |
| "PSCLEAR" : "-DPS_ENCRYPTION=OFF -DPS_ROLLBACK_PROTECTION=OFF", |
| "PSLIMIT" : "-DPS_AES_KEY_USAGE_LIMIT=1000000", |
| # IPC |
| "IPC" : "-DCONFIG_TFM_SPM_BACKEND=IPC ", |
| # CC Driver |
| "CC_DRIVER_PSA": "-DCC312_LEGACY_DRIVER_API_ENABLED=OFF ", |
| # ST support |
| "CRYPTO_OFF" : ("-DTEST_S_CRYPTO=OFF " |
| "-DTEST_NS_CRYPTO=OFF "), |
| "CRYPTO_ON" : ("-DTEST_S_CRYPTO=ON " |
| "-DTEST_NS_CRYPTO=ON "), |
| # Corstone1000 support |
| "FVP" : "-DPLATFORM_IS_FVP=True ", |
| "FPGA" : "-DPLATFORM_IS_FVP=False -DTEST_S_PLATFORM=OFF ", |
| "CS1K_TEST" : ("-DTEST_S_PS=OFF " |
| "-DTEST_S_ITS=OFF " |
| "-DTEST_S_IPC=OFF " |
| "-DTEST_S_ATTESTATION=OFF " |
| "-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/platform/ext/target/arm/corstone1000/ci_regression_tests/ "), |
| |
| # PAC/BTI Support |
| "PACBTI_STD" : "-DCONFIG_TFM_BRANCH_PROTECTION_FEAT=BRANCH_PROTECTION_STANDARD", |
| "PACBTI_NONE" : "-DCONFIG_TFM_BRANCH_PROTECTION_FEAT=BRANCH_PROTECTION_NONE", |
| |
| # Platform Variants Support for RSE_RDV3 & RSE_RDV3R1 |
| "CFG0" : "-DTFM_PLATFORM_VARIANT=0", |
| "CFG1" : "-DTFM_PLATFORM_VARIANT=1", |
| |
| # Platform Variants Support for RSE_RDV3 |
| "CFG2" : "-DTFM_PLATFORM_VARIANT=2", |
| |
| # Extra test cases |
| "TEST_CBOR" : "-DTEST_NS_QCBOR=ON ", |
| |
| # Profiling test |
| "PROF" : ("-DTFM_EXTRA_CONFIG_PATH=%(codebase_root_dir)s/../tf-m-tools/profiling/profiling_cases/prof_psa_client_api/partitions/config_spe.cmake "), |
| |
| # Platform provisioning |
| "PROV_TFM_DUMMY" : "-DPLATFORM_DEFAULT_PROVISIONING=OFF -DTFM_DUMMY_PROVISIONING=ON ", |
| "PROV_MCUBOOT_GEN_KEYS" : "-DPLATFORM_DEFAULT_PROVISIONING=OFF -DTFM_DUMMY_PROVISIONING=OFF -DMCUBOOT_GENERATE_SIGNING_KEYPAIR=ON ", |
| |
| # tf-m-extras example support |
| "EXTRAS_EXAMPLE_VAD" : ("-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side " |
| "-DTFM_EXTRA_PARTITION_PATHS=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/ " |
| "-DTFM_EXTRA_MANIFEST_LIST_FILES=%(codebase_root_dir)s/../tf-m-extras/partitions/vad_an552_sp/extra_manifest_list.yaml " |
| "-DPROJECT_CONFIG_HEADER_FILE=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side/project_config.h " |
| "-DTFM_PARTITION_FIRMWARE_UPDATE=ON -DMCUBOOT_DATA_SHARING=ON " |
| "-DMCUBOOT_UPGRADE_STRATEGY=SWAP_USING_SCRATCH " |
| "-DMCUBOOT_IMAGE_NUMBER=1 -DMCUBOOT_SIGNATURE_KEY_LEN=2048 " |
| "-DCONFIG_TFM_ENABLE_MVE=ON -DCONFIG_TFM_SPM_BACKEND=IPC " |
| "-DPLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT=ON -DTFM_PARTITION_PLATFORM=ON " |
| "-DTFM_PARTITION_CRYPTO=ON -DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON " |
| "-DTFM_PARTITION_PROTECTED_STORAGE=ON -DMCUBOOT_CONFIRM_IMAGE=ON "), |
| |
| "EXTRAS_EXAMPLE_DMA350_TRIGGER" : "", |
| "EXTRAS_EXAMPLE_DMA350_CLCD" : "-DDEFAULT_NS_SCATTER=OFF -DPLATFORM_SVC_HANDLERS=ON ", |
| |
| "EXTRAS_EXAMPLE_DMA350_S" : "-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_s", |
| "EXTRAS_EXAMPLE_DMA350_NS" : "-DEXTRA_NS_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/corstone310_fvp_dma/dma350_ns", |
| |
| # Attestation scheme |
| "ATTESTATION_SCHEME_DPE" : ("-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/partitions/dice_protection_environment/test/secure "), |
| "ATTESTATION_SCHEME_CCA" : ("-DTFM_ATTESTATION_SCHEME=CCA " |
| "-DEXTRA_S_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/partitions/delegated_attestation/test/secure " |
| "-DEXTRA_NS_TEST_SUITE_PATH=%(codebase_root_dir)s/../tf-m-extras/partitions/measured_boot/test/non_secure "), |
| |
| # Provisioning blob signing |
| "RSE_PROVISIONING_ASYMMETRIC" : ("-DRSE_SYMMETRIC_PROVISIONING=OFF") |
| } |
| |
| mapTfmExtrasExamplePaths = { |
| "EXTRAS_EXAMPLE_VAD" : "examples/vad_an552/ns_side", |
| "EXTRAS_EXAMPLE_DMA350_TRIGGER" : "examples/corstone310_fvp_dma/triggering_example", |
| "EXTRAS_EXAMPLE_DMA350_CLCD" : "examples/corstone310_fvp_dma/clcd_example", |
| "EXTRAS_EXAMPLE_DMA350_S" : "examples/corstone310_fvp_dma/dma350_s", |
| "EXTRAS_EXAMPLE_DMA350_NS" : "examples/corstone310_fvp_dma/dma350_ns" |
| } |