2020-04-18 22:26:39 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-04-22 22:55:16 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Utilities for SMM setup
|
|
|
|
*/
|
|
|
|
|
2020-08-11 21:04:51 +02:00
|
|
|
#include <acpi/acpi.h>
|
2020-03-17 02:20:20 +01:00
|
|
|
#include <arch/io.h>
|
2019-04-22 22:55:16 +02:00
|
|
|
#include <console/console.h>
|
2019-08-10 14:51:59 +02:00
|
|
|
#include <cpu/x86/smm.h>
|
2019-04-22 22:55:16 +02:00
|
|
|
#include <amdblocks/acpimmio.h>
|
|
|
|
#include <soc/southbridge.h>
|
|
|
|
#include <soc/smi.h>
|
|
|
|
|
|
|
|
/** Set the EOS bit and enable SMI generation from southbridge */
|
2020-05-31 08:59:14 +02:00
|
|
|
void global_smi_enable(void)
|
2019-04-22 22:55:16 +02:00
|
|
|
{
|
|
|
|
uint32_t reg = smi_read32(SMI_REG_SMITRIG0);
|
|
|
|
reg &= ~SMITRG0_SMIENB; /* Enable SMI generation */
|
|
|
|
reg |= SMITRG0_EOS; /* Set EOS bit */
|
|
|
|
smi_write32(SMI_REG_SMITRIG0, reg);
|
2020-03-17 02:20:20 +01:00
|
|
|
|
2020-08-11 21:04:51 +02:00
|
|
|
if (!acpi_is_wakeup_s3())
|
|
|
|
outb(APM_CNT_SMMINFO, APM_CNT);
|
2019-04-22 22:55:16 +02:00
|
|
|
}
|