]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(tc): enable the execution of both platform tests
authorTamas Ban <tamas.ban@arm.com>
Fri, 21 Apr 2023 07:31:48 +0000 (09:31 +0200)
committerSandrine Bailleux <sandrine.bailleux@arm.com>
Thu, 27 Apr 2023 05:59:44 +0000 (07:59 +0200)
The C preprocessor cannot compare defines against strings.
Such an expression is always evaluated to be true. Therefore,
its usage in a conditional expression results that always the
first branch is taken. Other branches cannot be reached by
any configuration value. The fix removes this string comparison
and instead it introduces distinct defines for all the cases.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ia1142b31b6778686c74e1e882fe4604fe3b6501d

plat/arm/board/tc/include/tc_plat.h
plat/arm/board/tc/platform.mk
plat/arm/board/tc/platform_test.mk
plat/arm/board/tc/tc_bl31_setup.c

index ba1831fb3fb53f393fccb63d8fc7f4eb9aae2893..195366e4843072e92e69d6d2894c7689ab652d7e 100644 (file)
@@ -9,8 +9,10 @@
 
 void tc_bl31_common_platform_setup(void);
 
-#ifdef PLATFORM_TEST
+#ifdef PLATFORM_TEST_TFM_TESTSUITE
 void run_platform_tests(void);
+#endif
+#ifdef PLATFORM_TEST_NV_COUNTERS
 void nv_counter_test(void);
 #endif
 
index 7fdc4fd84f8dc88f819ffd320fe6bfbe68d16fa8..7171c24540cd590bb682ed34c7bc387c710dc5ec 100644 (file)
@@ -209,7 +209,7 @@ ifeq (${PLATFORM_TEST},rss-nv-counters)
 
     PLAT_INCLUDES      +=      -Iinclude/lib/psa
 
-    $(eval $(call add_define,PLATFORM_TEST))
+    $(eval $(call add_define,PLATFORM_TEST_NV_COUNTERS))
 else ifeq (${PLATFORM_TEST},tfm-testsuite)
     # Add this include as first, before arm_common.mk. This is necessary
     # because arm_common.mk builds Mbed TLS, and platform_test.mk can
index 5cdbb86bea57156352250b8cb5e81b035573058c..e974855ad0684da2cca1b20fa88afe989a6e4694 100644 (file)
@@ -76,5 +76,5 @@ ifeq (${PLATFORM_TEST},tfm-testsuite)
     $(eval $(call add_define,MEASURED_BOOT_HASH_ALG))
     $(eval $(call add_define,DELEG_ATTEST_DUMP_TOKEN_AND_KEY))
 
-    $(eval $(call add_define,PLATFORM_TEST))
+    $(eval $(call add_define,PLATFORM_TEST_TFM_TESTSUITE))
 endif
index 1c1e2fb2ad59d9fdb637ef1745959d138a988968..aa88f7f3d0b588da3b03e0d96100be7bdffbe780 100644 (file)
@@ -53,15 +53,13 @@ void tc_bl31_common_platform_setup(void)
 {
        arm_bl31_platform_setup();
 
-#ifdef PLATFORM_TEST
-#if PLATFORM_TEST == rss-nv-counters
+#ifdef PLATFORM_TEST_NV_COUNTERS
        nv_counter_test();
-#elif PLATFORM_TEST == tfm-testsuite
-       run_platform_tests()
+#elif PLATFORM_TEST_TFM_TESTSUITE
+       run_platform_tests();
 #endif
        /* Suspend booting */
        plat_error_handler(-1);
-#endif
 }
 
 const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)