aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/picasso/smihandler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/picasso/smihandler.c')
-rw-r--r--src/soc/amd/picasso/smihandler.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/soc/amd/picasso/smihandler.c b/src/soc/amd/picasso/smihandler.c
index 626daad00a..928669dfef 100644
--- a/src/soc/amd/picasso/smihandler.c
+++ b/src/soc/amd/picasso/smihandler.c
@@ -15,6 +15,7 @@
#include <amdblocks/acpi.h>
#include <amdblocks/psp.h>
#include <amdblocks/smi.h>
+#include <amdblocks/smm.h>
#include <elog.h>
#include <soc/smu.h>
@@ -222,7 +223,7 @@ static const struct smi_sources_t smi_sources[] = {
{ .type = SMITYPE_SLP_TYP, .handler = sb_slp_typ_handler},
};
-static void *get_source_handler(int source)
+void *get_smi_source_handler(int source)
{
int i;
@@ -232,46 +233,3 @@ static void *get_source_handler(int source)
return NULL;
}
-
-static void process_smi_sources(uint32_t reg)
-{
- const uint32_t status = smi_read32(reg);
- int bit_zero = 32 / sizeof(uint32_t) * (reg - SMI_REG_SMISTS0);
- void (*source_handler)(void);
- int i;
-
- for (i = 0 ; i < 32 ; i++) {
- if (status & (1 << i)) {
- source_handler = get_source_handler(i + bit_zero);
- if (source_handler)
- source_handler();
- }
- }
-
- if (reg == SMI_REG_SMISTS0)
- if (status & GEVENT_MASK)
- /* Gevent[23:0] are assumed to be mainboard-specific */
- mainboard_smi_gpi(status & GEVENT_MASK);
-
- /* Clear all events in this register */
- smi_write32(reg, status);
-}
-
-void southbridge_smi_handler(void)
-{
- const uint16_t smi_src = smi_read16(SMI_REG_POINTER);
-
- if (smi_src & SMI_STATUS_SRC_SCI)
- /* Clear events to prevent re-entering SMI if event isn't handled */
- clear_smi_sci_status();
- if (smi_src & SMI_STATUS_SRC_0)
- process_smi_sources(SMI_REG_SMISTS0);
- if (smi_src & SMI_STATUS_SRC_1)
- process_smi_sources(SMI_REG_SMISTS1);
- if (smi_src & SMI_STATUS_SRC_2)
- process_smi_sources(SMI_REG_SMISTS2);
- if (smi_src & SMI_STATUS_SRC_3)
- process_smi_sources(SMI_REG_SMISTS3);
- if (smi_src & SMI_STATUS_SRC_4)
- process_smi_sources(SMI_REG_SMISTS4);
-}