Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50459 )
Change subject: soc/amd*/smihandler: factor out and rename clear_all_smi_status ......................................................................
soc/amd*/smihandler: factor out and rename clear_all_smi_status
The old name was misleading, since it doesn't disable the generation of SMIs, but clears the status registers.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Iddadbec013091c2e5993a6303e291451c3d1e7ce --- M src/soc/amd/common/block/include/amdblocks/smi.h M src/soc/amd/common/block/smi/smi_util.c M src/soc/amd/picasso/smihandler.c M src/soc/amd/stoneyridge/smihandler.c 4 files changed, 14 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/50459/1
diff --git a/src/soc/amd/common/block/include/amdblocks/smi.h b/src/soc/amd/common/block/include/amdblocks/smi.h index 31f9042..25a1da7 100644 --- a/src/soc/amd/common/block/include/amdblocks/smi.h +++ b/src/soc/amd/common/block/include/amdblocks/smi.h @@ -47,5 +47,6 @@ void disable_gevent_smi(uint8_t gevent); void gpe_configure_sci(const struct sci_source *scis, size_t num_gpes); void soc_route_sci(uint8_t event); +void clear_all_smi_status(void);
#endif /* AMD_BLOCK_SMI_H */ diff --git a/src/soc/amd/common/block/smi/smi_util.c b/src/soc/amd/common/block/smi/smi_util.c index e3379f3..aa37dab 100644 --- a/src/soc/amd/common/block/smi/smi_util.c +++ b/src/soc/amd/common/block/smi/smi_util.c @@ -143,3 +143,14 @@ { return pm_read16(PM_ACPI_SMI_CMD); } + +void clear_all_smi_status(void) +{ + smi_write32(SMI_SCI_STATUS, smi_read32(SMI_SCI_STATUS)); + smi_write32(SMI_EVENT_STATUS, smi_read32(SMI_EVENT_STATUS)); + smi_write32(SMI_REG_SMISTS0, smi_read32(SMI_REG_SMISTS0)); + smi_write32(SMI_REG_SMISTS1, smi_read32(SMI_REG_SMISTS1)); + smi_write32(SMI_REG_SMISTS2, smi_read32(SMI_REG_SMISTS2)); + smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3)); + smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4)); +} diff --git a/src/soc/amd/picasso/smihandler.c b/src/soc/amd/picasso/smihandler.c index d6c3ed0..5134358 100644 --- a/src/soc/amd/picasso/smihandler.c +++ b/src/soc/amd/picasso/smihandler.c @@ -123,17 +123,6 @@ mainboard_smi_apmc(cmd); }
-static void disable_all_smi_status(void) -{ - smi_write32(SMI_SCI_STATUS, smi_read32(SMI_SCI_STATUS)); - smi_write32(SMI_EVENT_STATUS, smi_read32(SMI_EVENT_STATUS)); - smi_write32(SMI_REG_SMISTS0, smi_read32(SMI_REG_SMISTS0)); - smi_write32(SMI_REG_SMISTS1, smi_read32(SMI_REG_SMISTS1)); - smi_write32(SMI_REG_SMISTS2, smi_read32(SMI_REG_SMISTS2)); - smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3)); - smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4)); -} - static void sb_slp_typ_handler(void) { uint32_t pci_ctrl, reg32; @@ -172,7 +161,7 @@
wbinvd();
- disable_all_smi_status(); + clear_all_smi_status();
/* Do not send SMI before AcpiPm1CntBlkx00[SlpTyp] */ pci_ctrl = pm_read32(PM_PCI_CTRL); diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c index 45dd07d..e90bdb1 100644 --- a/src/soc/amd/stoneyridge/smihandler.c +++ b/src/soc/amd/stoneyridge/smihandler.c @@ -118,17 +118,6 @@ mainboard_smi_apmc(cmd); }
-static void disable_all_smi_status(void) -{ - smi_write32(SMI_SCI_STATUS, smi_read32(SMI_SCI_STATUS)); - smi_write32(SMI_EVENT_STATUS, smi_read32(SMI_EVENT_STATUS)); - smi_write32(SMI_REG_SMISTS0, smi_read32(SMI_REG_SMISTS0)); - smi_write32(SMI_REG_SMISTS1, smi_read32(SMI_REG_SMISTS1)); - smi_write32(SMI_REG_SMISTS2, smi_read32(SMI_REG_SMISTS2)); - smi_write32(SMI_REG_SMISTS3, smi_read32(SMI_REG_SMISTS3)); - smi_write32(SMI_REG_SMISTS4, smi_read32(SMI_REG_SMISTS4)); -} - static void sb_slp_typ_handler(void) { uint32_t pci_ctrl, reg32; @@ -167,7 +156,7 @@
wbinvd();
- disable_all_smi_status(); + clear_all_smi_status();
/* Do not send SMI before AcpiPm1CntBlkx00[SlpTyp] */ pci_ctrl = pm_read32(PM_PCI_CTRL);