1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef _AMDBLOCKS_SMM_H_ 4 #define _AMDBLOCKS_SMM_H_ 5 6 #include <cpu/x86/msr.h> 7 #include <types.h> 8 9 void *get_smi_source_handler(int source); 10 void handle_smi_gsmi(void); 11 void handle_smi_store(void); 12 void fch_apmc_smi_handler(void); 13 void clear_tvalid(void); 14 void tseg_valid(void); 15 bool is_smm_locked(void); 16 void lock_smm(void); 17 /* See SMITYPE_* for list possible of events. GEVENTS are handled with mainboard_smi_gpi. */ 18 void mainboard_handle_smi(int event); 19 20 #if CONFIG_SMM_TSEG_SIZE != 0 21 #if (CONFIG_SMM_TSEG_SIZE <= CONFIG_SMM_RESERVED_SIZE) 22 # error "CONFIG_SMM_TSEG_SIZE <= CONFIG_SMM_RESERVED_SIZE" 23 #endif 24 #if (CONFIG_SMM_TSEG_SIZE < 0x20000) 25 # error "CONFIG_SMM_TSEG_SIZE must at least be 128KiB" 26 #endif 27 #if ((CONFIG_SMM_TSEG_SIZE & (CONFIG_SMM_TSEG_SIZE - 1)) != 0) 28 # error "CONFIG_SMM_TSEG_SIZE is not a power of 2" 29 #endif 30 #endif 31 32 #endif 33