mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 10:04:26 +00:00

Add support for runtime detection (ENABLE_SME_FOR_NS=2), by splitting feat_sme_supported() into an ID register reading function and a second function to report the support status. That function considers both build time settings and runtime information (if needed), and is used before we do SME specific setup. Change the FVP platform default to the now supported dynamic option (=2),so the right decision can be made by the code at runtime. Change-Id: Ida9ccf737db5be20865b84f42b1f9587be0626ab Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
35 lines
947 B
C
35 lines
947 B
C
/*
|
|
* Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SME_H
|
|
#define SME_H
|
|
|
|
#include <stdbool.h>
|
|
#include <context.h>
|
|
|
|
/*
|
|
* Maximum value of LEN field in SMCR_ELx. This is different than the maximum
|
|
* supported value which is platform dependent. In the first version of SME the
|
|
* LEN field is limited to 4 bits but will be expanded in future iterations.
|
|
* To support different versions, the code that discovers the supported vector
|
|
* lengths will write the max value into SMCR_ELx then read it back to see how
|
|
* many bits are implemented.
|
|
*/
|
|
#define SME_SMCR_LEN_MAX U(0x1FF)
|
|
|
|
#if ENABLE_SME_FOR_NS
|
|
void sme_enable(cpu_context_t *context);
|
|
void sme_disable(cpu_context_t *context);
|
|
#else
|
|
static inline void sme_enable(cpu_context_t *context)
|
|
{
|
|
}
|
|
static inline void sme_disable(cpu_context_t *context)
|
|
{
|
|
}
|
|
#endif /* ENABLE_SME_FOR_NS */
|
|
|
|
#endif /* SME_H */
|