Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Martin Roth | ebace9f | 2018-05-26 18:56:17 -0600 | [diff] [blame] | 2 | |
| 3 | /* |
| 4 | * Utilities for SMM setup |
Alexandru Gagniuc | 2dbd08f | 2014-04-10 14:35:59 -0500 | [diff] [blame] | 5 | */ |
| 6 | |
Michał Żygowski | f3db2ae | 2019-11-24 13:26:10 +0100 | [diff] [blame] | 7 | #include <amdblocks/acpimmio.h> |
Kyösti Mälkki | c4fdb7b | 2019-08-10 15:51:59 +0300 | [diff] [blame] | 8 | #include <cpu/x86/smm.h> |
| 9 | |
| 10 | #include "smi.h" |
Alexandru Gagniuc | 2dbd08f | 2014-04-10 14:35:59 -0500 | [diff] [blame] | 11 | |
Alexandru Gagniuc | 2dbd08f | 2014-04-10 14:35:59 -0500 | [diff] [blame] | 12 | /** Set the EOS bit and enable SMI generation from southbridge */ |
Kyösti Mälkki | b264c5c | 2020-06-10 11:13:24 +0300 | [diff] [blame] | 13 | void global_smi_enable(void) |
Alexandru Gagniuc | 2dbd08f | 2014-04-10 14:35:59 -0500 | [diff] [blame] | 14 | { |
| 15 | uint32_t reg = smi_read32(SMI_REG_SMITRIG0); |
| 16 | reg &= ~SMITRG0_SMIENB; /* Enable SMI generation */ |
| 17 | reg |= SMITRG0_EOS; /* Set EOS bit */ |
| 18 | smi_write32(SMI_REG_SMITRIG0, reg); |
| 19 | } |