Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5527
-gerrit
commit 12434f3fca5c3ed8d31d0192f959da6e2ff6bd84
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Thu Apr 17 00:47:47 2014 -0500
hp/pavilion_m6_1035dx: Shutdown on low battery with non-ACPI OS
Intercept the low battery SMI from the EC, and shut down the system
immediately. The EC only sends this SMI when the OS did not enable
ACPI mode, so ACPI OSes are not affected by this.
On the other hand, payloads such as GRUB or SeaBIOS will experience
the shutdown. This behavior is helpful for protecting the battery, for
example, when the OS fails to boot and we are stuck in the payload.
The low battery SMI is triggered at 10% charge, at which point the risk
of cell degradation exists.
Change-Id: I4c6c1a4feed8576cbdbb1945768de0805a1f5e42
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c b/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c
index bb9cc2e..7c1a602 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/mainboard_smi.c
@@ -6,14 +6,18 @@
*/
#include "ec.h"
+#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <delay.h>
#include <ec/compal/ene932/ec.h>
#include <southbridge/amd/agesa/hudson/hudson.h>
+#define ACPI_PM1_CNT_SLEEP(state) ((1 << 13) | (state & 0x7) << 10)
+
enum ec_smi_event {
EC_SMI_EVENT_IDLE = 0x80,
+ EC_SMI_BATTERY_LOW = 0xb3,
};
/* Tell EC to operate in APM mode. Events generate SMIs instead of SCIs */
@@ -37,12 +41,18 @@ static uint8_t ec_get_smi_event(void)
static void ec_process_smi(uint8_t src)
{
- /*
- * Stub: We aren't processing any events yet, but reading the SMI source
- * satisfies the EC in terms of responding to the event.
+ /* Reading the SMI source satisfies the EC in terms of responding to
+ * the event, regardless of whether we take an action or not.
*/
- printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src);
+ switch (src) {
+ case EC_SMI_BATTERY_LOW:
+ printk(BIOS_DEBUG, "Battery low. Shutting down\n");
+ outl(ACPI_PM1_CNT_SLEEP(5), ACPI_PM1_CNT_BLK);
+ break;
+ default:
+ printk(BIOS_DEBUG, "EC_SMI event 0x%x\n", src);
+ }
}
static void handle_ec_smi(void)
the following patch was just integrated into master:
commit 43cb7ca9223b472b5ecf7f99070e0003e1a31619
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Wed Apr 16 16:29:03 2014 +0300
AMD hudson yangtze: Drop MAX_PHYSICAL_CPUS in comments
Change-Id: I81de291da7b3db8d04a127d5a304b558f1c75b34
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/5535
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
See http://review.coreboot.org/5535 for details.
-gerrit
the following patch was just integrated into master:
commit fa4cb6d606a6017758ae1986fe57aea6ed9b0b2b
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Thu Apr 17 11:49:42 2014 -0500
southbridge/hudson: Remove unused function set_sm_enable_bits()
This function isn't used on hudson, and seems to be copy-paste from
older southbridges. It is used in sb700 to enable or disable certain
PCI devices. On hudson, these configuration bits are moved to the PM
space.
Change-Id: I9b967a2d0a5dddc8341204dadeed90460251915c
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Reviewed-on: http://review.coreboot.org/5513
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)gmail.com>
See http://review.coreboot.org/5513 for details.
-gerrit