[coreboot-gerrit] Patch set updated for coreboot: 858dbd6 ec/lenovo/h8: Allow user to disable powermanagement beeps.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sat Jan 11 21:01:54 CET 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4662

-gerrit

commit 858dbd603b47cc22bde37cb00d996d3b1c9e802e
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Sat Jan 11 20:56:47 2014 +0100

    ec/lenovo/h8: Allow user to disable powermanagement beeps.
    
    They're pretty annoying.
    
    Change-Id: I44d26dc168927a9cedfd6ecc4c9a51a3a7b362c7
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/ec/lenovo/h8/chip.h                 |  2 ++
 src/ec/lenovo/h8/h8.c                   | 15 +++++++++++++--
 src/mainboard/lenovo/t60/cmos.layout    |  1 +
 src/mainboard/lenovo/t60/devicetree.cb  |  1 +
 src/mainboard/lenovo/x201/cmos.default  |  1 +
 src/mainboard/lenovo/x201/cmos.layout   |  3 ++-
 src/mainboard/lenovo/x201/devicetree.cb |  1 +
 src/mainboard/lenovo/x60/cmos.default   |  1 +
 src/mainboard/lenovo/x60/cmos.layout    |  1 +
 src/mainboard/lenovo/x60/devicetree.cb  |  1 +
 10 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/ec/lenovo/h8/chip.h b/src/ec/lenovo/h8/chip.h
index 6cb2f9b..2cac36c 100644
--- a/src/ec/lenovo/h8/chip.h
+++ b/src/ec/lenovo/h8/chip.h
@@ -50,5 +50,7 @@ struct ec_lenovo_h8_config {
 	u8 trackpoint_enable;
 	u8 wlan_enable;
 	u8 wwan_enable;
+
+	u8 has_power_management_beeps;
 };
 #endif
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 0218ed4..aa11d73 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -160,6 +160,7 @@ static void h8_enable(device_t dev)
 {
 	struct ec_lenovo_h8_config *conf = dev->chip_info;
 	u8 val, tmp;
+	u8 beepmask0, beepmask1;
 
 	h8_log_ec_version();
 
@@ -168,8 +169,18 @@ static void h8_enable(device_t dev)
 	ec_write(H8_CONFIG2, conf->config2);
 	ec_write(H8_CONFIG3, conf->config3);
 
-	ec_write(H8_SOUND_ENABLE0, conf->beepmask0);
-	ec_write(H8_SOUND_ENABLE1, conf->beepmask1);
+	beepmask0 = conf->beepmask0;
+	beepmask1 = conf->beepmask1;
+
+	if (conf->has_power_management_beeps
+	    && get_option(&val, "power_management_beeps") == CB_SUCCESS
+	    && val == 0) {
+		beepmask0 = 0x00;
+		beepmask1 = 0x00;
+	}
+	ec_write(H8_SOUND_ENABLE0, beepmask0);
+	ec_write(H8_SOUND_ENABLE1, beepmask1);
+
 	ec_write(H8_SOUND_REPEAT, 0x00);
 
 	ec_write(0x10, conf->event0_enable);
diff --git a/src/mainboard/lenovo/t60/cmos.layout b/src/mainboard/lenovo/t60/cmos.layout
index abd98d2..fc8b395 100644
--- a/src/mainboard/lenovo/t60/cmos.layout
+++ b/src/mainboard/lenovo/t60/cmos.layout
@@ -114,6 +114,7 @@ entries
 1072         1       e       9        first_battery
 1074         1       e       1        fn_ctrl_swap
 1075         1       e       1        sticky_fn
+1076         1       e       1        power_management_beeps
 # -----------------------------------------------------------------
 
 enumerations
diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb
index 3973f3b..3038ed6 100644
--- a/src/mainboard/lenovo/t60/devicetree.cb
+++ b/src/mainboard/lenovo/t60/devicetree.cb
@@ -128,6 +128,7 @@ chip northbridge/intel/i945
 
 					register "beepmask0" = "0xfe"
 					register "beepmask1" = "0x96"
+					register "has_power_management_beeps" = "1"
 
 					register "event2_enable" = "0xff"
 					register "event3_enable" = "0xff"
diff --git a/src/mainboard/lenovo/x201/cmos.default b/src/mainboard/lenovo/x201/cmos.default
index 772b024..d1158e8 100644
--- a/src/mainboard/lenovo/x201/cmos.default
+++ b/src/mainboard/lenovo/x201/cmos.default
@@ -11,3 +11,4 @@ wwan=Enable
 touchpad=Enable
 fn_ctrl_swap=Disable
 sticky_fn=Disable
+power_management_beeps=Enable
diff --git a/src/mainboard/lenovo/x201/cmos.layout b/src/mainboard/lenovo/x201/cmos.layout
index ba6f87d..8597374 100644
--- a/src/mainboard/lenovo/x201/cmos.layout
+++ b/src/mainboard/lenovo/x201/cmos.layout
@@ -92,7 +92,8 @@ entries
 414         1       e       1        touchpad
 417         1       e       1        fn_ctrl_swap
 418         1       e       1        sticky_fn
-#419        565     r       0        unused
+419         1       e       1        power_management_beeps
+#420        564     r       0        unused
 
 # coreboot config options: check sums
 984         16       h       0        check_sum
diff --git a/src/mainboard/lenovo/x201/devicetree.cb b/src/mainboard/lenovo/x201/devicetree.cb
index f800f9a..aa1a91a 100644
--- a/src/mainboard/lenovo/x201/devicetree.cb
+++ b/src/mainboard/lenovo/x201/devicetree.cb
@@ -58,6 +58,7 @@ chip northbridge/intel/nehalem
 
 		register "beepmask0" = "0xfe"
 		register "beepmask1" = "0x96"
+		register "has_power_management_beeps" = "1"
 
 		register "event2_enable" = "0xff"
 		register "event3_enable" = "0xff"
diff --git a/src/mainboard/lenovo/x60/cmos.default b/src/mainboard/lenovo/x60/cmos.default
index eed5fa8..883bfd4 100644
--- a/src/mainboard/lenovo/x60/cmos.default
+++ b/src/mainboard/lenovo/x60/cmos.default
@@ -14,3 +14,4 @@ first_battery=Primary
 bluetooth=Enable
 fn_ctrl_swap=Disable
 sticky_fn=Disable
+power_management_beeps=Enable
diff --git a/src/mainboard/lenovo/x60/cmos.layout b/src/mainboard/lenovo/x60/cmos.layout
index 738863e..a2b45bd 100644
--- a/src/mainboard/lenovo/x60/cmos.layout
+++ b/src/mainboard/lenovo/x60/cmos.layout
@@ -114,6 +114,7 @@ entries
 1082         1       e       1        wwan
 1085         1       e       1        fn_ctrl_swap
 1086         1       e       1        sticky_fn
+1087         1       e       1        power_management_beeps
 # -----------------------------------------------------------------
 
 enumerations
diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb
index 91daf3a..07553fa 100644
--- a/src/mainboard/lenovo/x60/devicetree.cb
+++ b/src/mainboard/lenovo/x60/devicetree.cb
@@ -106,6 +106,7 @@ chip northbridge/intel/i945
 
 					register "beepmask0" = "0xfe"
 					register "beepmask1" = "0x96"
+					register "has_power_management_beeps" = "1"
 
 					register "event2_enable" = "0xff"
 					register "event3_enable" = "0xff"



More information about the coreboot-gerrit mailing list