From 020a3ce90b025e342faec9479ded07e3ce055146 Mon Sep 17 00:00:00 2001 From: Dennis Wassenberg Date: Thu, 10 Sep 2015 12:17:49 +0200 Subject: ec/roda/it8518: Add another embedded controller The embedded-controller interface of Roda's Ivy Bridge notebooks is supposedly programmed by AMI. Change-Id: I153d831fcea8a3132c7bd1927ff3b445d9a8e92c Signed-off-by: Dennis Wassenberg Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/17288 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan --- src/ec/roda/it8518/acpi/battery.asl | 123 ++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/ec/roda/it8518/acpi/battery.asl (limited to 'src/ec/roda/it8518/acpi/battery.asl') diff --git a/src/ec/roda/it8518/acpi/battery.asl b/src/ec/roda/it8518/acpi/battery.asl new file mode 100644 index 0000000000..ffe2c2f6e9 --- /dev/null +++ b/src/ec/roda/it8518/acpi/battery.asl @@ -0,0 +1,123 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2015 secunet Security Networks AG + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +//SCOPE EC0 + +Device (BAT0) +{ + Name (_HID, EISAID ("PNP0C0A")) + Name (_UID, 1) + Name (_PCL, Package () { \_SB }) + + + // + // Default Static Battery Information + // + Name (PBIF, Package (13) + { + 1, // 0: Power Unit + 4800, // 1: Design Capacity + 4650, // 2: Last Full Charge Capacity + 1, // 3: Battery Technology(Rechargeable) + 12608, // 4: Design Voltage 10.8V + 0, // 5: Design capacity of warning + 0, // 6: Design capacity of low + 0, // 7: Battery capacity granularity 1 + 0, // 8: Battery capacity granularity 2 + "BAT0", // 9: Model Number + "RT672", // 10: Serial Number + "LiON", // 11: Battery Type + "ASP" // 12: OEM Information + }) + + + Name (PBST, Package (4) + { + 0x00000000, // Battery State + 0xFFFFFFFF, // Battery Present Rate + 0xFFFFFFFF, // Battery Remaining Capacity + 0xFFFFFFFF, // Battery Present Voltage + }) + + + // Battery Slot Status + Method (_STA, 0, Serialized) + { + Store ("-----> BAT0: _STA", Debug) + + Store (0x0F, Local0) + + Store (ECPS, Local1) + And (Local1, 0x02, Local1) + If (LEqual (Local1, 0x02)) + { + Store (0x1F, Local0) + } + + Store ("<----- BAT0: _STA", Debug) + + Return (Local0) + } + + Method (_BIF, 0, Serialized) + { + Store ("-----> BAT0: _BIF", Debug) + + Store (B0FC, Index (PBIF, 0x02)) + Store (Divide (Multiply (B0FC, 6), 100), Index (PBIF, 0x05)) + Store (Divide (Multiply (B0FC, 3), 100), Index (PBIF, 0x06)) + + Store ("<----- BAT0: _BIF", Debug) + + Return (PBIF) + } + + Method (_BST, 0, Serialized) + { + Store ("-----> BAT0: _BST", Debug) + + Store (B0ST, Local0) + And (Local0, 0x40, Local0) + If (LEqual (Local0, 0x40)) + { + If (LEqual (PWRS, 1)) + { + Store (0x00, Index (PBST, 0x00)) + } + Else + { + Store (0x01, Index (PBST, 0x00)) + } + } + Else + { + Store (0x02, Index (PBST, 0x00)) + } + + Store (B0AC, Local1) + If (LGreaterEqual (Local1, 0x8000)) + { + Subtract (0x00010000, Local1, Local1) + } + + Store (Local1, Index (PBST, 0x01)) + Store (B0RC, Index (PBST, 0x02)) + Store (B0VT, Index (PBST, 0x03)) + + Store ("<----- BAT0: _BST", Debug) + + Return (PBST) + } +} -- cgit v1.2.3