1 /*
2  * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __TFM_PLAT_TEST_H__
9 #define __TFM_PLAT_TEST_H__
10 
11 #include "tfm_plat_defs.h"
12 
13 /**
14  * \brief starts Secure timer
15  *
16  * Configures a timer to start counting, and generate a timer interrupt after a
17  * certain amount of time. For the test case to be useful, the timeout value of
18  * the timer should be long enough so that the test service can go to the state
19  * where it starts waiting for the interrupt.
20  */
21 #ifdef TEST_NS_SLIH_IRQ
22 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT")
23 #elif defined(TEST_NS_FLIH_IRQ)
24 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT")
25 #endif
26 void tfm_plat_test_secure_timer_start(void);
27 
28 
29 /**
30  * \brief Clears Secure timer interrupt
31  */
32 #ifdef TEST_NS_SLIH_IRQ
33 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT")
34 #elif TEST_NS_FLIH_IRQ
35 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT")
36 #endif
37 void tfm_plat_test_secure_timer_clear_intr(void);
38 
39 /**
40  * \brief Stops the Secure timer and clears the timer interrupt.
41  */
42 #ifdef TEST_NS_SLIH_IRQ
43 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_SLIH_TEST", "APP-ROT")
44 #elif defined(TEST_NS_FLIH_IRQ)
45 TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_FLIH_TEST", "APP-ROT")
46 #endif
47 void tfm_plat_test_secure_timer_stop(void);
48 
49 /**
50  * \brief starts Non-secure timer
51  *
52  * Configures a timer to start counting, and generate a timer interrupt after a
53  * certain amount of time. For the test case to be useful, the timeout value of
54  * the timer should be long enough so that the test service can go to the state
55  * where it starts waiting for the interrupt.
56  */
57 void tfm_plat_test_non_secure_timer_start(void);
58 
59 /**
60  * \brief Stops the non-Secure timer and clears the timer interrupt.
61  */
62 void tfm_plat_test_non_secure_timer_stop(void);
63 
64 
65 #endif /* __TFM_PLAT_TEST_H__ */
66