[coreboot-gerrit] Change in coreboot[master]: ec/lenovo/h8: Enable battery thresholds for more platforms, add bound...

Alexey Derlaft (Code Review) gerrit at coreboot.org
Mon Jan 8 22:51:53 CET 2018


Alexey Derlaft has uploaded this change for review. ( https://review.coreboot.org/23177


Change subject: ec/lenovo/h8: Enable battery thresholds for more platforms, add boundary checks
......................................................................

ec/lenovo/h8: Enable battery thresholds for more platforms, add boundary checks

Change-Id: Ie785819c73df1fe1600c99a0c997f3c24081964b
Signed-off-by: Alexey Kharlamov <der at 2-47.ru>
---
M src/ec/lenovo/h8/acpi/ec.asl
M src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
M src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
M src/mainboard/lenovo/t400/Kconfig
M src/mainboard/lenovo/t420/Kconfig
M src/mainboard/lenovo/t420s/Kconfig
M src/mainboard/lenovo/t430/Kconfig
M src/mainboard/lenovo/t430s/Kconfig
8 files changed, 24 insertions(+), 15 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/23177/1

diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index ed122d7..345d113 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -438,7 +438,7 @@
 		}
 
 		#if IS_ENABLED(CONFIG_IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS)
-        #include "tp_acpi_bat.asl"
+		#include "tp_acpi_bat.asl"
 		#endif
 	}
 
diff --git a/src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl b/src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
index 6a15ac6..9c5e6ca 100644
--- a/src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
+++ b/src/ec/lenovo/h8/acpi/tp_acpi_bat_24.asl
@@ -37,7 +37,7 @@
 	 */
 	Method (SETT, 2, NotSerialized)
 	{
-		if (Arg0 <= 1) {
+		if (Arg0 <= 1 && Arg1 <= 100) {
 			BSTP = Arg0
 			TSH0 = Arg1 | 0x80
 		}
@@ -61,7 +61,7 @@
 	 */
 	Method (SETT, 2, NotSerialized)
 	{
-		if (Arg0 <= 1) {
+		if (Arg0 <= 1 && Arg1 <= 100) {
 			BSTP = Arg0
 			TSH1 = Arg1 | 0x80
 		}
diff --git a/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl b/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
index 6c568de..8040b17 100644
--- a/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
+++ b/src/ec/lenovo/h8/acpi/tp_acpi_bat_b0.asl
@@ -38,12 +38,14 @@
 	 */
 	Method (SETT, 2, NotSerialized)
 	{
-		if (Arg0 == 0) {
-			TSL0 = Arg1
-		}
-		if (Arg0 == 1) {
-			TSH0 = Arg1
-		}
+        if (Arg1 <= 100) {
+            if (Arg0 == 0) {
+                TSL0 = Arg1
+            }
+            if (Arg0 == 1) {
+                TSH0 = Arg1
+            }
+        }
 	}
 	/* Get threshold on battery0, Arg0: (0 start, 1 stop) chargning */
 	Method (GETT, 1, NotSerialized)
@@ -66,12 +68,14 @@
 	 */
 	Method (SETT, 2, NotSerialized)
 	{
-		if (Arg0 == 0) {
-			TSL1 = Arg1
-		}
-		if (Arg0 == 1) {
-			TSH1 = Arg1
-		}
+        if (Arg1 <= 100) {
+            if (Arg0 == 0) {
+                TSL1 = Arg1
+            }
+            if (Arg0 == 1) {
+                TSH1 = Arg1
+            }
+        }
 	}
 	/* Get threshold on battery1, Arg0: (0 start, 1 stop) chargning */
 	Method (GETT, 1, NotSerialized)
diff --git a/src/mainboard/lenovo/t400/Kconfig b/src/mainboard/lenovo/t400/Kconfig
index 8eb5fc5..6c9b1d3 100644
--- a/src/mainboard/lenovo/t400/Kconfig
+++ b/src/mainboard/lenovo/t400/Kconfig
@@ -8,6 +8,7 @@
 	select SOUTHBRIDGE_INTEL_I82801IX
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_24
 	select H8_DOCK_EARLY_INIT
 	select BOARD_ROMSIZE_KB_8192
 	select DRIVERS_GENERIC_IOAPIC
diff --git a/src/mainboard/lenovo/t420/Kconfig b/src/mainboard/lenovo/t420/Kconfig
index c0b4752..c2044e7 100644
--- a/src/mainboard/lenovo/t420/Kconfig
+++ b/src/mainboard/lenovo/t420/Kconfig
@@ -9,6 +9,7 @@
 	select SOUTHBRIDGE_INTEL_BD82X6X
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_8192
 	select HAVE_ACPI_TABLES
diff --git a/src/mainboard/lenovo/t420s/Kconfig b/src/mainboard/lenovo/t420s/Kconfig
index 08052b1..ab579fb 100644
--- a/src/mainboard/lenovo/t420s/Kconfig
+++ b/src/mainboard/lenovo/t420s/Kconfig
@@ -9,6 +9,7 @@
 	select SOUTHBRIDGE_INTEL_BD82X6X
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_8192
 	select HAVE_ACPI_TABLES
diff --git a/src/mainboard/lenovo/t430/Kconfig b/src/mainboard/lenovo/t430/Kconfig
index a621fdb..8d759c0 100644
--- a/src/mainboard/lenovo/t430/Kconfig
+++ b/src/mainboard/lenovo/t430/Kconfig
@@ -6,6 +6,7 @@
 	select CPU_INTEL_SOCKET_RPGA989
 	select DRIVERS_RICOH_RCE822
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select EC_LENOVO_PMH7
 	select NO_UART_ON_SUPERIO
 	select HAVE_ACPI_RESUME
diff --git a/src/mainboard/lenovo/t430s/Kconfig b/src/mainboard/lenovo/t430s/Kconfig
index f45fb0d..5f68d90 100644
--- a/src/mainboard/lenovo/t430s/Kconfig
+++ b/src/mainboard/lenovo/t430s/Kconfig
@@ -9,6 +9,7 @@
 	select SOUTHBRIDGE_INTEL_C216
 	select EC_LENOVO_PMH7
 	select EC_LENOVO_H8
+	select IMPLEMENTS_ACPI_H8_BAT_TRESHOLDS_B0
 	select NO_UART_ON_SUPERIO
 	select BOARD_ROMSIZE_KB_16384
 	select HAVE_ACPI_TABLES

-- 
To view, visit https://review.coreboot.org/23177
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie785819c73df1fe1600c99a0c997f3c24081964b
Gerrit-Change-Number: 23177
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Derlaft <derlafff at ya.ru>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180108/16a3d4f9/attachment.html>


More information about the coreboot-gerrit mailing list