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