Nicholas Sudsgaard has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84247?usp=email )
Change subject: ec/hp/kbc1126/acpi: Clean up GBSS ......................................................................
ec/hp/kbc1126/acpi: Clean up GBSS
This changes the format of the serial number slightly, as it does not add any zero padding.
Old format: %05d %04d/%02d/%02d New format: %d %d/%d/%d
TEST=Produces correct serial number on HP ProBook 450 G3
Change-Id: I12066526dc0031513488884f38c5bd4130206761 Signed-off-by: Nicholas Sudsgaard devel+coreboot@nsudsgaard.com --- M src/ec/hp/kbc1126/acpi/battery.asl 1 file changed, 8 insertions(+), 32 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/84247/1
diff --git a/src/ec/hp/kbc1126/acpi/battery.asl b/src/ec/hp/kbc1126/acpi/battery.asl index b1e9f2d..3acb0e5 100644 --- a/src/ec/hp/kbc1126/acpi/battery.asl +++ b/src/ec/hp/kbc1126/acpi/battery.asl @@ -196,40 +196,16 @@ 0x04B0 })
-Method (\ISTR, 2, Serialized) -{ - Name (NUMB, Buffer (6) { " " }) - Local0 = Arg0 - Local1 = Arg1 - While (Local1) - { - Local1-- - Local2 = Local0 % 10 - Local0 = Local0 / 10 - NUMB[Local1] = Local2 + 48 - } - ToString (NUMB, Arg1, Local3) - Return (Local3) -} - Method (GBSS, 2, Serialized) { - Local3 = \ISTR (Arg0, 0x05) - Concatenate (Local3, " ", Local4) - Local0 = (Arg1 >> 0x09) - Local1 = (Local0 + 1980) - Local2 = \ISTR (Local1, 0x04) - Concatenate (Local4, Local2, Local3) - Concatenate (Local3, "/", Local4) - Local0 = (Arg1 >> 0x05) - Local1 = (Local0 & 0x0F) - Local2 = \ISTR (Local1, 0x02) - Concatenate (Local4, Local2, Local3) - Concatenate (Local3, "/", Local4) - Local1 = (Arg1 & 0x1F) - Local2 = \ISTR (Local1, 0x02) - Concatenate (Local4, Local2, Local3) - Return (Local3) + Local0 = "" + Fprintf(Local0, "%o %o/%o/%o", + ToDecimalString(Arg0), + ToDecimalString(((Arg1 >> 9) & 0x7F) + 1980), + ToDecimalString((Arg1 >> 5) & 0x0F), + ToDecimalString((Arg1 >> 0) & 0x1F) + ) + Return (Local0) }
Method (BTIG, 1, Serialized) /* in vendor DSDT is EC0.BTIF */