blob: 58bc6e0cd455c022d44518f9b2dca9d234fa8aec [file] [log] [blame]
Mate Toth-Pald3c77662019-02-20 16:23:00 +01001/*
Raef Coles79d82082021-01-07 15:42:38 +00002 * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
Mate Toth-Pald3c77662019-02-20 16:23:00 +01003 *
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 Busy wait until the user presses a specific button
15 */
Raef Coles79d82082021-01-07 15:42:38 +000016TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
Mate Toth-Pald3c77662019-02-20 16:23:00 +010017void tfm_plat_test_wait_user_button_pressed(void);
18
19/**
20 * \brief Busy wait until the user releases a specific button
21 */
Raef Coles79d82082021-01-07 15:42:38 +000022TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
Mate Toth-Pald3c77662019-02-20 16:23:00 +010023void tfm_plat_test_wait_user_button_released(void);
24
25/**
26 * \brief Get the status of the LEDs used by tests
27 *
28 * \return Returns the current status of LEDs
29 */
Raef Coles79d82082021-01-07 15:42:38 +000030TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
Mate Toth-Pald3c77662019-02-20 16:23:00 +010031uint32_t tfm_plat_test_get_led_status(void);
32
33/**
34 * \brief Sets the status of the LEDs used by tests
35 *
36 * \param[in] status The status to be set
37 */
Raef Coles79d82082021-01-07 15:42:38 +000038TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
Mate Toth-Pald3c77662019-02-20 16:23:00 +010039void tfm_plat_test_set_led_status(uint32_t status);
40
41/**
42 * \brief Get the mask of the LEDs used for testing
43 *
44 * \return Returns the mask of the LEDs used for testing
45 */
Raef Coles79d82082021-01-07 15:42:38 +000046TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
Mate Toth-Pald3c77662019-02-20 16:23:00 +010047uint32_t tfm_plat_test_get_userled_mask(void);
48
Mate Toth-Pala9f8e9e2019-03-05 16:11:14 +010049/**
50 * \brief starts 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 */
Raef Coles79d82082021-01-07 15:42:38 +000057TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1", "APP-ROT")
Mate Toth-Pala9f8e9e2019-03-05 16:11:14 +010058void tfm_plat_test_secure_timer_start(void);
59
60/**
61 * \brief Stops the Secure timer and clears the timer interrupt.
62 */
Raef Coles79d82082021-01-07 15:42:38 +000063TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1", "APP-ROT")
Mate Toth-Pala9f8e9e2019-03-05 16:11:14 +010064void tfm_plat_test_secure_timer_stop(void);
65
66/**
67 * \brief starts Non-secure timer
68 *
69 * Configures a timer to start counting, and generate a timer interrupt after a
70 * certain amount of time. For the test case to be useful, the timeout value of
71 * the timer should be long enough so that the test service can go to the state
72 * where it starts waiting for the interrupt.
73 */
74void tfm_plat_test_non_secure_timer_start(void);
75
76/**
77 * \brief Stops the non-Secure timer and clears the timer interrupt.
78 */
79void tfm_plat_test_non_secure_timer_stop(void);
80
81
Mate Toth-Pald3c77662019-02-20 16:23:00 +010082#endif /* __TFM_PLAT_TEST_H__ */