SMM: add mainboard_apm_cnt() callback
authorSven Schnelle <svens@stackframe.org>
Sat, 4 Jun 2011 17:35:22 +0000 (19:35 +0200)
committerPatrick Georgi <patrick@georgi-clan.de>
Mon, 6 Jun 2011 15:56:13 +0000 (17:56 +0200)
motherboards can use this hook to get notified if someone writes
to the APM_CNT port (0xb2). If the hook returns 1, the chipset
specific hook is also skipped.

Change-Id: I05f1a27cebf9d25db8064f2adfd2a0f5759e48b5
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Reviewed-on: http://review.coreboot.org/3
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
src/include/cpu/x86/smm.h
src/southbridge/intel/i82801gx/smihandler.c

index ad0984eae58d838acc242f9b58151b74733cc9e6..559b1b71979d5d8a2f379f8d8000e40f550d3e68 100644 (file)
@@ -263,4 +263,4 @@ void __attribute__((weak)) northbridge_smi_handler(unsigned int node, smm_state_
 void __attribute__((weak)) southbridge_smi_handler(unsigned int node, smm_state_save_area_t *state_save);
 
 void __attribute__((weak)) mainboard_smi_gpi(u16 gpi_sts);
-
+int __attribute__((weak)) mainboard_apm_cnt(u8 data);
index aefa2835716873a23a64ac951ac0b77e5596cb60..bccf6d5f0566dbe67b089ed05a34f036a640830d 100644 (file)
@@ -362,6 +362,9 @@ static void southbridge_smi_apmc(unsigned int node, smm_state_save_area_t *state
        /* Emulate B2 register as the FADT / Linux expects it */
 
        reg8 = inb(APM_CNT);
+       if (mainboard_apm_cnt && mainboard_apm_cnt(reg8))
+               return;
+
        switch (reg8) {
        case CST_CONTROL:
                /* Calling this function seems to cause