/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _AVM_TZ_H #define _AVM_TZ_H #include "avm_smc_ids.h" /* * AVM TrustZone feature detection: Use these macros and this function to detect * at runtime which TrustZone features are supported by the TZ currently in use. */ #define AVM_TZ_IS_AVM_TZ BIT(0) #define AVM_TZ_FEAT_FIQ BIT(1) #define AVM_TZ_FEAT_FIQ_PREEMPT BIT(2) #define AVM_TZ_FEAT_SECURE_WDT BIT(3) #define AVM_TZ_FEAT_ATF_LAST_LOG BIT(4) #define AVM_TZ_FEAT_NO_SEC_WDT_ENABLED BIT(5) #define AVM_TZ_FEAT_IPSEC_XPU_ENABLED BIT(6) #ifndef CONFIG_AVM_TZ_EXTENSIONS static inline uint64_t avm_tz_supported_features(void) { return 0; }; static inline bool avm_get_tz_version(char *buffer, size_t size) { return false; }; #else uint64_t avm_tz_supported_features(void); bool avm_get_tz_version(char *buffer, size_t size); #endif /* * The TZ version is a string in the shape * * v0.v1.v2.v3.v4[-M] * * where * * v0-v4 can be any decimal numbers (as long as the entire string fits in 32 * bytes, including the null terminator), * * -M is optional and specifies whether the TrustZone contains code changes made * since the last tag. */ #define AVM_TZ_VERSION_SIZE 32 #ifdef CONFIG_AVM_FASTIRQ_TZ void avm_tz_set_fiq_handler(void *address, void *reg_save); void avm_tz_disable_fiq_handling_in_linux(void *unused); void avm_tz_enable_fiq_handling_in_linux(void *unused); void avm_secure_wdt_pet(void); void avm_secure_wdt_config(u32 enable, u32 bark_ms, u32 bite_ms); #ifdef CONFIG_AVM_TZ_TYPE_ATF_RTE int avm_get_atf_last_log(void *ker_buf, u32 buf_len); #else static inline int avm_get_atf_last_log(void *ker_buf, u32 buf_len) { return 0; }; #endif #endif /* CONFIG_AVM_FASTIRQ_TZ */ #endif /* _AVM_TZ_H */