amd/stoneyridge: Change SMM setup functions
Remove the APMC-specific initialization call. Make the function which programs the event type not static and call it from the southbridge.c file. Change-Id: I1e3cf898637720fa835de0a6e735c6a65fe2d3a2 Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com> Reviewed-on: https://review.coreboot.org/21750 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
This commit is contained in:
parent
f039a0befc
commit
a05fdcb269
|
@ -200,9 +200,9 @@ struct smi_sources_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
uint16_t pm_acpi_smi_cmd_port(void);
|
uint16_t pm_acpi_smi_cmd_port(void);
|
||||||
|
void configure_smi(uint8_t smi_num, uint8_t mode);
|
||||||
void configure_gevent_smi(uint8_t gevent, uint8_t mode, uint8_t level);
|
void configure_gevent_smi(uint8_t gevent, uint8_t mode, uint8_t level);
|
||||||
void disable_gevent_smi(uint8_t gevent);
|
void disable_gevent_smi(uint8_t gevent);
|
||||||
void enable_acpi_cmd_smi(void);
|
|
||||||
|
|
||||||
#ifndef __SMM__
|
#ifndef __SMM__
|
||||||
void enable_smi_generation(void);
|
void enable_smi_generation(void);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <soc/southbridge.h>
|
#include <soc/southbridge.h>
|
||||||
#include <soc/smi.h>
|
#include <soc/smi.h>
|
||||||
|
|
||||||
static void configure_smi(uint8_t smi_num, uint8_t mode)
|
void configure_smi(uint8_t smi_num, uint8_t mode)
|
||||||
{
|
{
|
||||||
uint8_t reg32_offset, bit_offset;
|
uint8_t reg32_offset, bit_offset;
|
||||||
uint32_t reg32;
|
uint32_t reg32;
|
||||||
|
@ -69,12 +69,6 @@ void disable_gevent_smi(uint8_t gevent)
|
||||||
configure_smi(gevent, SMI_MODE_DISABLE);
|
configure_smi(gevent, SMI_MODE_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Enable SMIs on writes to ACPI SMI command port */
|
|
||||||
void enable_acpi_cmd_smi(void)
|
|
||||||
{
|
|
||||||
configure_smi(SMITYPE_SMI_CMD_PORT, SMI_MODE_SMI);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t pm_acpi_smi_cmd_port(void)
|
uint16_t pm_acpi_smi_cmd_port(void)
|
||||||
{
|
{
|
||||||
return pm_read16(PM_ACPI_SMI_CMD);
|
return pm_read16(PM_ACPI_SMI_CMD);
|
||||||
|
|
|
@ -57,8 +57,9 @@ static void sb_init_acpi_ports(void)
|
||||||
pm_write16(PM_CPU_CTRL, ACPI_CPU_CONTROL);
|
pm_write16(PM_CPU_CTRL, ACPI_CPU_CONTROL);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)) {
|
if (IS_ENABLED(CONFIG_HAVE_SMI_HANDLER)) {
|
||||||
|
/* APMC - SMI Command Port */
|
||||||
pm_write16(PM_ACPI_SMI_CMD, APM_CNT);
|
pm_write16(PM_ACPI_SMI_CMD, APM_CNT);
|
||||||
enable_acpi_cmd_smi();
|
configure_smi(SMITYPE_SMI_CMD_PORT, SMI_MODE_SMI);
|
||||||
} else {
|
} else {
|
||||||
pm_write16(PM_ACPI_SMI_CMD, 0);
|
pm_write16(PM_ACPI_SMI_CMD, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue