xref: /rk3399_ARM-atf/include/lib/extensions/sme.h (revision 1d2706dbaf98634aa1eecc65e52b54acf330df3d)
1 /*
2  * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef SME_H
8 #define SME_H
9 
10 #include <stdbool.h>
11 #include <context.h>
12 
13 /*
14  * Maximum value of LEN field in SMCR_ELx. This is different than the maximum
15  * supported value which is platform dependent. In the first version of SME the
16  * LEN field is limited to 4 bits but will be expanded in future iterations.
17  * To support different versions, the code that discovers the supported vector
18  * lengths will write the max value into SMCR_ELx then read it back to see how
19  * many bits are implemented.
20  */
21 #define SME_SMCR_LEN_MAX	U(0x1FF)
22 
23 #if ENABLE_SME_FOR_NS
24 void sme_enable(cpu_context_t *context);
25 void sme_disable(cpu_context_t *context);
26 #else
27 static inline void sme_enable(cpu_context_t *context)
28 {
29 }
30 static inline void sme_disable(cpu_context_t *context)
31 {
32 }
33 #endif /* ENABLE_SME_FOR_NS */
34 
35 #endif /* SME_H */
36