Patchwork New patch to review: 9069251 SMM: add mainboard_apm_cnt() callback

login
register
about
Submitter gerrit@coreboot.org
Date 2011-06-06 14:21:00
Message ID <E1QTafs-0000cx-6n@ra.coresystems.de>
Download mbox | patch
Permalink /patch/3054/
State New, archived
Headers show

Comments

gerrit@coreboot.org - 2011-06-06 14:21:00
Dear list,

Sven Schnelle (svens@stackframe.org) just uploaded a new patch set to gerrit, which you can find at
http://review.coreboot.org/3.

You will also find it attached for your convenience.

Regards,
gerrit

Patch

commit 90692510e88e67929d0d01d011eebb6cb7a010f4
Author: Sven Schnelle <svens@stackframe.org>
Date:   Sat Jun 4 19:35:22 2011 +0200

    SMM: add mainboard_apm_cnt() callback
    
    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>

diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h
index ad0984e..559b1b7 100644
--- a/src/include/cpu/x86/smm.h
+++ b/src/include/cpu/x86/smm.h
@@ -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);
diff --git a/src/southbridge/intel/i82801gx/smihandler.c b/src/southbridge/intel/i82801gx/smihandler.c
index aefa283..bccf6d5 100644
--- a/src/southbridge/intel/i82801gx/smihandler.c
+++ b/src/southbridge/intel/i82801gx/smihandler.c
@@ -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