1 /*
2  * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef  _CC_PAL_FIPS_H
8 #define  _CC_PAL_FIPS_H
9 
10 /*!
11 @file
12 @brief This file contains definitions that are used by the FIPS related APIs. The implementation of these functions
13 need to be replaced according to the Platform and TEE_OS.
14 */
15 
16 #include "cc_pal_types_plat.h"
17 #include "cc_fips.h"
18 #include "cc_fips_defs.h"
19 
20 /**
21  * @brief This function purpose is to get the FIPS state.
22  *
23  *
24  * @return Zero on success.
25  * @return A non-zero value on failure.
26  */
27 CCError_t CC_PalFipsGetState(CCFipsState_t *pFipsState);
28 
29 
30 /**
31  * @brief This function purpose is to get the FIPS Error.
32  *
33  *
34  * @return Zero on success.
35  * @return A non-zero value on failure.
36  */
37 CCError_t CC_PalFipsGetError(CCFipsError_t *pFipsError);
38 
39 
40 /**
41  * @brief This function purpose is to get the FIPS trace.
42  *
43  *
44  * @return Zero on success.
45  * @return A non-zero value on failure.
46  */
47 CCError_t CC_PalFipsGetTrace(CCFipsTrace_t *pFipsTrace);
48 
49 
50 /**
51  * @brief This function purpose is to set the FIPS state.
52  *
53  *
54  * @return Zero on success.
55  * @return A non-zero value on failure.
56  */
57 CCError_t CC_PalFipsSetState(CCFipsState_t fipsState);
58 
59 
60 /**
61  * @brief This function purpose is to set the FIPS error.
62  *
63  *
64  * @return Zero on success.
65  * @return A non-zero value on failure.
66  */
67 CCError_t CC_PalFipsSetError(CCFipsError_t fipsError);
68 
69 
70 /**
71  * @brief This function purpose is to set the FIPS trace.
72  *
73  *
74  * @return Zero on success.
75  * @return A non-zero value on failure.
76  */
77 CCError_t CC_PalFipsSetTrace(CCFipsTrace_t fipsTrace);
78 
79 
80 /**
81  * @brief This function purpose is to wait for FIPS interrupt.
82  *      After GPR0 (==FIPS) interrupt is detected, clear the interrupt in ICR,
83  *      and call CC_FipsIrqHandle
84  *
85  *
86  * @return Zero on success.
87  * @return A non-zero value on failure.
88  */
89 CCError_t CC_PalFipsWaitForReeStatus(void);
90 
91 /**
92  * @brief This function purpose is to stop waiting for REE FIPS interrupt.
93  *      since TEE lib is terminating
94  *
95  *
96  * @return Zero on success.
97  * @return A non-zero value on failure.
98  */
99 CCError_t CC_PalFipsStopWaitingRee(void);
100 
101 #endif  // _CC_PAL_FIPS_H
102 
103