soc/amd*/smihandler: factor out and rename clear_smi_sci_status

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ifd6c3bebee1ccf7e7e7987d8ae3d9fa654019791
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50460
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Felix Held 2021-02-10 01:32:00 +01:00 committed by Martin Roth
parent 4f69ab729a
commit a6fc2125e7
4 changed files with 10 additions and 18 deletions

View File

@ -48,5 +48,6 @@ void disable_gevent_smi(uint8_t gevent);
void gpe_configure_sci(const struct sci_source *scis, size_t num_gpes); void gpe_configure_sci(const struct sci_source *scis, size_t num_gpes);
void soc_route_sci(uint8_t event); void soc_route_sci(uint8_t event);
void clear_all_smi_status(void); void clear_all_smi_status(void);
void clear_smi_sci_status(void);
#endif /* AMD_BLOCK_SMI_H */ #endif /* AMD_BLOCK_SMI_H */

View File

@ -154,3 +154,8 @@ void clear_all_smi_status(void)
smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3)); smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3));
smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4)); smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4));
} }
void clear_smi_sci_status(void)
{
smi_write32(SMI_SCI_STATUS, smi_read32(SMI_SCI_STATUS));
}

View File

@ -222,14 +222,6 @@ static const struct smi_sources_t smi_sources[] = {
{ .type = SMITYPE_SLP_TYP, .handler = sb_slp_typ_handler}, { .type = SMITYPE_SLP_TYP, .handler = sb_slp_typ_handler},
}; };
static void process_smi_sci(void)
{
const uint32_t status = smi_read32(SMI_SCI_STATUS);
/* Clear events to prevent re-entering SMI if event isn't handled */
smi_write32(SMI_SCI_STATUS, status);
}
static void *get_source_handler(int source) static void *get_source_handler(int source)
{ {
int i; int i;
@ -270,7 +262,8 @@ void southbridge_smi_handler(void)
const uint16_t smi_src = smi_read16(SMI_REG_POINTER); const uint16_t smi_src = smi_read16(SMI_REG_POINTER);
if (smi_src & SMI_STATUS_SRC_SCI) if (smi_src & SMI_STATUS_SRC_SCI)
process_smi_sci(); /* Clear events to prevent re-entering SMI if event isn't handled */
clear_smi_sci_status();
if (smi_src & SMI_STATUS_SRC_0) if (smi_src & SMI_STATUS_SRC_0)
process_smi_sources(SMI_REG_SMISTS0); process_smi_sources(SMI_REG_SMISTS0);
if (smi_src & SMI_STATUS_SRC_1) if (smi_src & SMI_STATUS_SRC_1)

View File

@ -217,14 +217,6 @@ static const struct smi_sources_t smi_sources[] = {
{ .type = SMITYPE_SLP_TYP, .handler = sb_slp_typ_handler}, { .type = SMITYPE_SLP_TYP, .handler = sb_slp_typ_handler},
}; };
static void process_smi_sci(void)
{
const uint32_t status = smi_read32(SMI_SCI_STATUS);
/* Clear events to prevent re-entering SMI if event isn't handled */
smi_write32(SMI_SCI_STATUS, status);
}
static void *get_source_handler(int source) static void *get_source_handler(int source)
{ {
int i; int i;
@ -265,7 +257,8 @@ void southbridge_smi_handler(void)
const uint16_t smi_src = smi_read16(SMI_REG_POINTER); const uint16_t smi_src = smi_read16(SMI_REG_POINTER);
if (smi_src & SMI_STATUS_SRC_SCI) if (smi_src & SMI_STATUS_SRC_SCI)
process_smi_sci(); /* Clear events to prevent re-entering SMI if event isn't handled */
clear_smi_sci_status();
if (smi_src & SMI_STATUS_SRC_0) if (smi_src & SMI_STATUS_SRC_0)
process_smi_sources(SMI_REG_SMISTS0); process_smi_sources(SMI_REG_SMISTS0);
if (smi_src & SMI_STATUS_SRC_1) if (smi_src & SMI_STATUS_SRC_1)