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 <kevin.peng@arm.com>
diff --git a/config/check_config.cmake b/config/check_config.cmake
index 7e33403..a069a4d 100644
--- a/config/check_config.cmake
+++ b/config/check_config.cmake
@@ -83,3 +83,4 @@
 ########################### 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 cea9722..cb0653b 100644
--- a/config/config_default.cmake
+++ b/config/config_default.cmake
@@ -149,6 +149,7 @@
 
 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 7657632..4393ce0 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 @@
    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 d9f0371..44cd135 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 @@
 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 d28c2bb..fa071db 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 @@
 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 ced002b..013081d 100644
--- a/platform/include/tfm_plat_test.h
+++ b/platform/include/tfm_plat_test.h
@@ -56,6 +56,8 @@
  */
 #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 @@
  */
 #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 @@
  */
 #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 a7674a5..cb2c129 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.*"
+         ]
+      }
+    }
   ]
 }