From fb9f2ce3db740b643e8444ace9b2c00a5cbcf4ca Mon Sep 17 00:00:00 2001 From: Kevin Peng Date: Thu, 27 May 2021 15:13:46 +0800 Subject: Test: Add the FLIH test Partition Currently the FLIH test is only supported on AN519 and AN521 Change-Id: Ic34aee26d4db732bdf9fb72c9163dd164b1e688e Signed-off-by: Kevin Peng --- config/check_config.cmake | 1 + config/config_default.cmake | 1 + .../services/tfm_secure_partition_addition.rst | 2 +- .../arm/mps2/an519/retarget/platform_retarget_dev.c | 6 ++++++ .../arm/mps2/an521/retarget/platform_retarget_dev.c | 6 ++++++ platform/include/tfm_plat_test.h | 6 ++++++ tools/tfm_manifest_list.yaml | 15 +++++++++++++++ 7 files changed, 36 insertions(+), 1 deletion(-) diff --git a/config/check_config.cmake b/config/check_config.cmake index 7e3340351..a069a4d78 100644 --- a/config/check_config.cmake +++ b/config/check_config.cmake @@ -83,3 +83,4 @@ tfm_invalid_config(TFM_PARTITION_AUDIT_LOG AND TFM_PSA_API) ########################### TF-M Tests ##################################### tfm_invalid_config(TFM_ENABLE_SLIH_TEST AND NOT TFM_PSA_API) +tfm_invalid_config(TFM_ENABLE_SLIH_TEST AND TFM_ENABLE_FLIH_TEST) diff --git a/config/config_default.cmake b/config/config_default.cmake index cea972278..cb0653b99 100644 --- a/config/config_default.cmake +++ b/config/config_default.cmake @@ -149,6 +149,7 @@ set(TFM_FWU_BOOTLOADER_LIB "mcuboot" CACHE STRING "Bootloader set(TFM_INTERACTIVE_TEST OFF CACHE BOOL "Enable interactive tests") set(TFM_ENABLE_SLIH_TEST OFF CACHE BOOL "Enable Second-Level Interrupt Handling tests") +set(TFM_ENABLE_FLIH_TEST OFF CACHE BOOL "Enable First-Level Interrupt Handling tests") set(TFM_PERIPH_ACCESS_TEST OFF CACHE BOOL "Enable peripheral access tests") set(PS_TEST_NV_COUNTERS ON CACHE BOOL "Use the test NV counters to test Protected Storage rollback scenarios") diff --git a/docs/integration_guide/services/tfm_secure_partition_addition.rst b/docs/integration_guide/services/tfm_secure_partition_addition.rst index 765763290..4393ce028 100644 --- a/docs/integration_guide/services/tfm_secure_partition_addition.rst +++ b/docs/integration_guide/services/tfm_secure_partition_addition.rst @@ -177,7 +177,7 @@ Here is the RoT Service ID table used in TF-M. tfm_ipc_client 0x0000F 0x060-0x07F tfm_ipc_service 0x0000F 0x080-0x09F tfm_slih_test_service 0x0000F 0x0A0-0x0AF - Reserved 0x0000F 0x0B0-0x0BF + tfm_flih_test_service 0x0000F 0x0B0-0x0BF tfm_ps_test_service 0x0000F 0x0C0-0x0DF tfm_ff11_partition 0x0000F 0x120-0x13F =========================== ====================== ======================== diff --git a/platform/ext/target/arm/mps2/an519/retarget/platform_retarget_dev.c b/platform/ext/target/arm/mps2/an519/retarget/platform_retarget_dev.c index d9f03719c..44cd13542 100644 --- a/platform/ext/target/arm/mps2/an519/retarget/platform_retarget_dev.c +++ b/platform/ext/target/arm/mps2/an519/retarget/platform_retarget_dev.c @@ -304,17 +304,23 @@ struct ppc_sse200_dev_t APB_PPCEXP3_DEV_S = { static const struct cmsdk_timer_dev_cfg_t CMSDK_TIMER0_DEV_CFG_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {.base = CMSDK_TIMER0_BASE_S}; static struct cmsdk_timer_dev_data_t CMSDK_TIMER0_DEV_DATA_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {.is_initialized = 0}; struct cmsdk_timer_dev_t CMSDK_TIMER0_DEV_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {&(CMSDK_TIMER0_DEV_CFG_S), &(CMSDK_TIMER0_DEV_DATA_S)}; #endif diff --git a/platform/ext/target/arm/mps2/an521/retarget/platform_retarget_dev.c b/platform/ext/target/arm/mps2/an521/retarget/platform_retarget_dev.c index d28c2bb5b..fa071dba0 100644 --- a/platform/ext/target/arm/mps2/an521/retarget/platform_retarget_dev.c +++ b/platform/ext/target/arm/mps2/an521/retarget/platform_retarget_dev.c @@ -304,17 +304,23 @@ struct ppc_sse200_dev_t APB_PPCEXP3_DEV_S = { static const struct cmsdk_timer_dev_cfg_t CMSDK_TIMER0_DEV_CFG_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {.base = CMSDK_TIMER0_BASE_S}; static struct cmsdk_timer_dev_data_t CMSDK_TIMER0_DEV_DATA_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {.is_initialized = 0}; struct cmsdk_timer_dev_t CMSDK_TIMER0_DEV_S #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) + TFM_LINK_SET_RW_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif = {&(CMSDK_TIMER0_DEV_CFG_S), &(CMSDK_TIMER0_DEV_DATA_S)}; #endif diff --git a/platform/include/tfm_plat_test.h b/platform/include/tfm_plat_test.h index ced002b7e..013081d2c 100644 --- a/platform/include/tfm_plat_test.h +++ b/platform/include/tfm_plat_test.h @@ -56,6 +56,8 @@ uint32_t tfm_plat_test_get_userled_mask(void); */ #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) +TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif void tfm_plat_test_secure_timer_start(void); @@ -65,6 +67,8 @@ void tfm_plat_test_secure_timer_start(void); */ #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif TFM_ENABLE_FLIH_TEST +TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif void tfm_plat_test_secure_timer_clear_intr(void); @@ -73,6 +77,8 @@ void tfm_plat_test_secure_timer_clear_intr(void); */ #ifdef TFM_ENABLE_SLIH_TEST TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT") +#elif defined(TFM_ENABLE_FLIH_TEST) +TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT") #endif void tfm_plat_test_secure_timer_stop(void); diff --git a/tools/tfm_manifest_list.yaml b/tools/tfm_manifest_list.yaml index a7674a5d6..cb2c12934 100644 --- a/tools/tfm_manifest_list.yaml +++ b/tools/tfm_manifest_list.yaml @@ -290,5 +290,20 @@ ] } }, + { + "name": "TFM FLIH Test Service", + "short_name": "TFM_SP_FLIH_TEST", + "manifest": "${TFM_TEST_PATH}/test_services/tfm_flih_test_service/tfm_flih_test_service.yaml", + "source_path": "${TFM_TEST_PATH}", + "tfm_partition_ipc": true, + "conditional": "TFM_ENABLE_FLIH_TEST", + "version_major": 0, + "version_minor": 1, + "linker_pattern": { + "library_list": [ + "*tfm_*partition_flih_test.*" + ] + } + } ] } -- cgit v1.2.3