the following patch was just integrated into master:
commit 85cfddb4b493004d7fe2073a9db96cade40c91f8
Author: Arthur Heymans <arthur(a)aheymans.xyz>
Date: Mon Feb 6 13:47:21 2017 +0100
nb/i945/gma.c: Change name and type of mmiobase in functions argument
Void pointer arithmetics are forbidden in standard C but GCC has
an extension that allows it.
Change-Id: I43029b2ab2f7709b8e1ba85eb05c31341b8ac16f
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
Reviewed-on: https://review.coreboot.org/18293
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
See https://review.coreboot.org/18293 for details.
-gerrit
Tobias Diedrich (ranma+coreboot(a)tdiedrich.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18349
-gerrit
commit d610b8c6302e9877b367347072a0b68195923e53
Author: Tobias Diedrich <ranma+openocd(a)tdiedrich.de>
Date: Sun Feb 12 13:35:37 2017 +0100
ec/lenovo/h8: Guard against EC bugs in the battery status logic.
On my Thinkpad with an H8-compatible ENE KB9012 EC (GDHT92WW 1.52), when
the battery is nearly full and we switch from battery to AC by plugging
in the cable, the current rate will not drop to 0 immediately, but the
discharging state is cleared immediately.
This leads to the code trying to process an invalid rate value >0x8000,
leading to a displayed rate of >1000W.
This patch changes the logic to deal with these corner cases.
Change-Id: Ideb588d00757f259792e5ae97729e371b63a096c
Signed-off-by: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
---
src/ec/lenovo/h8/acpi/battery.asl | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/ec/lenovo/h8/acpi/battery.asl b/src/ec/lenovo/h8/acpi/battery.asl
index 0ebc9ee..fef994a 100644
--- a/src/ec/lenovo/h8/acpi/battery.asl
+++ b/src/ec/lenovo/h8/acpi/battery.asl
@@ -97,21 +97,36 @@ Method(BSTA, 4, NotSerialized)
Store(BAMA, Local1)
Store(Arg0, PAGE) /* Battery dynamic information */
+ /*
+ * Present rate is a 16bit signed int, positive while charging
+ * and negative while discharging.
+ */
Store(BAPR, Local2)
- if (Arg2) // charging
+ If (Arg2) // Charging
{
Or(2, Local0, Local0)
-
- If (LGreaterEqual (Local2, 0x8000)) {
+ }
+ Else
+ {
+ If (Arg3) // Discharging
+ {
+ Or(1, Local0, Local0)
+ // Negate present rate
+ Subtract(0x10000, Local2, Local2)
+ }
+ Else // Full battery, force to 0
+ {
Store(0, Local2)
}
}
- if (Arg3) // discharging
- {
- Or(1, Local0, Local0)
- Subtract(0x10000, Local2, Local2)
+ /*
+ * The present rate value must be positive now, if it is not we have an
+ * EC bug or inconsistency and force the value to 0.
+ */
+ If (LGreaterEqual (Local2, 0x8000)) {
+ Store(0, Local2)
}
Store(Local0, Index(Arg1, 0x00))
Tobias Diedrich (ranma+coreboot(a)tdiedrich.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18349
-gerrit
commit 46dfcfcfe92aa43d6f7b662f125d97f38c1d6375
Author: Tobias Diedrich <ranma+openocd(a)tdiedrich.de>
Date: Sun Feb 12 13:35:37 2017 +0100
ec/lenovo/h8: Guard against EC bugs in the battery status logic.
On my Thinkpad with an H8-compatible ENE KB9012 EC (GDHT92WW 1.52), when
the battery is nearly full and we switch from battery to AC by plugging
in the cable, the current rate will not drop to 0 immediately, but the
discharging state is cleared immediately.
This leads to the code trying to process an invalid rate value >0x8000,
leading to a displayed rate of >1000W.
This patch changes the logic to deal with these corner cases.
Change-Id: Ideb588d00757f259792e5ae97729e371b63a096c
Signed-off-by: Tobias Diedrich <ranma+coreboot(a)tdiedrich.de>
---
src/ec/lenovo/h8/acpi/battery.asl | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/ec/lenovo/h8/acpi/battery.asl b/src/ec/lenovo/h8/acpi/battery.asl
index 629397a..111f29f 100644
--- a/src/ec/lenovo/h8/acpi/battery.asl
+++ b/src/ec/lenovo/h8/acpi/battery.asl
@@ -105,21 +105,36 @@ Method(BSTA, 4, NotSerialized)
Store(BAMA, Local1)
^BPAG(Arg0) /* Battery dynamic information */
+ /*
+ * Present rate is a 16bit signed int, positive while charging
+ * and negative while discharging.
+ */
Store(BAPR, Local2)
- if (Arg2) // charging
+ If (Arg2) // Charging
{
Or(2, Local0, Local0)
-
- If (LGreaterEqual (Local2, 0x8000)) {
+ }
+ Else
+ {
+ If (Arg3) // Discharging
+ {
+ Or(1, Local0, Local0)
+ // Negate present rate
+ Subtract(0x10000, Local2, Local2)
+ }
+ Else // Full battery, force to 0
+ {
Store(0, Local2)
}
}
- if (Arg3) // discharging
- {
- Or(1, Local0, Local0)
- Subtract(0x10000, Local2, Local2)
+ /*
+ * The present rate value must be positive now, if it is not we have an
+ * EC bug or inconsistency and force the value to 0.
+ */
+ If (LGreaterEqual (Local2, 0x8000)) {
+ Store(0, Local2)
}
Store(Local0, Index(Arg1, 0x00))
Patrick Rudolph (siro(a)das-labor.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18347
-gerrit
commit 3cad8fd714ecc41736b1c4f22b230599aa2b2807
Author: Patrick Rudolph <siro(a)das-labor.org>
Date: Sun Feb 12 12:54:42 2017 +0100
libpayload: Enable SSE on x86 by default
Enable SSE on x86 by default.
Turns on SSE instructions when present and allows
to use SSE optimized memcpy.
Change-Id: I8799f356622489f2386241f7a9053e9ac5b0c2d1
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
payloads/libpayload/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile
index 429bf05..3828928 100644
--- a/payloads/libpayload/Makefile
+++ b/payloads/libpayload/Makefile
@@ -147,6 +147,9 @@ READELF := $(READELF_$(ARCH-y))
STRIP := $(STRIP_$(ARCH-y))
AR := $(AR_$(ARCH-y))
+# Enable SSE on x86
+CFLAGS_x86_32 += -msse
+
CFLAGS += $(CFLAGS_$(ARCH-y))
ifneq ($(INNER_SCANBUILD),y)