Patchwork correct 'power_on_after_fail' setting

login
register
about
Submitter Josef Kellermann
Date 2011-03-09 13:34:51
Message ID <4D7781FB.6030200@arcor.de>
Download mbox | patch
Permalink /patch/2759/
State Accepted
Headers show

Comments

Josef Kellermann - 2011-03-09 13:34:51
Hi,
bit 0 of pm reg#74 have to be set turn on system after power resumes.
See '42661_sb600_rrg_nda_3.02.pdf' for detail.

Signed-off-by: Josef Kellermann <seppk@arcor.de> <mailto://seppk@arcor.de>

Patch

diff --git a/src/southbridge/amd/sb600/sm.c b/src/southbridge/amd/sb600/sm.c
index 1a0d6ac..66c22e7 100644
--- a/src/southbridge/amd/sb600/sm.c
+++ b/src/southbridge/amd/sb600/sm.c
@@ -89,14 +89,16 @@  static void sm_init(device_t dev)
 	pm_iowrite(0x53, byte);
 
 	/* power after power fail */
-	on = CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL;
-	get_option(&on, "power_on_after_fail");
+
+	if( get_option(&on, "power_on_after_fail") < 0) {
+		on = CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL;
+	}
 	byte = pm_ioread(0x74);
 	byte &= ~0x03;
 	if (on) {
-		byte |= 2;
+		byte |= (1 << 0);
 	}
-	byte |= 1 << 2;
+	byte |= (1 << 2);
 	pm_iowrite(0x74, byte);
 	printk(BIOS_INFO, "set power %s after power fail\n", on ? "on" : "off");