Nicholas Sudsgaard has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84242?usp=email )
Change subject: ec/hp/kbc1126/acpi: Document EC RAM fields ......................................................................
ec/hp/kbc1126/acpi: Document EC RAM fields
This is not perfect, as documentation for some fields are missing or speculative. However, I think it is enough to be a good starting point.
This was done by only analyzing the ACPI dump from vendor firmware, we could understand more by looking deeper into the vendor firmware, but this would take more time and effort. I'll leave that as a task for me or somebody else in the future.
Change-Id: Ic411a7a821d7b03be45d4bda645a03f82c7241c5 Signed-off-by: Nicholas Sudsgaard devel+coreboot@nsudsgaard.com --- M src/ec/hp/kbc1126/acpi/ac.asl M src/ec/hp/kbc1126/acpi/battery.asl M src/ec/hp/kbc1126/acpi/ec.asl 3 files changed, 178 insertions(+), 149 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/84242/1
diff --git a/src/ec/hp/kbc1126/acpi/ac.asl b/src/ec/hp/kbc1126/acpi/ac.asl index 9743045..4b04996 100644 --- a/src/ec/hp/kbc1126/acpi/ac.asl +++ b/src/ec/hp/kbc1126/acpi/ac.asl @@ -3,13 +3,6 @@ Name (ACST, 0x01) Name (SMAR, 0x00)
-Field (ECRM, ByteAcc, NoLock, Preserve) -{ - Offset (0x84), - ADP, 1, - ADID, 2 -} - Method (UPAD, 0, Serialized) { Acquire (BTMX, 0xFFFF) diff --git a/src/ec/hp/kbc1126/acpi/battery.asl b/src/ec/hp/kbc1126/acpi/battery.asl index ff542a1..b1e9f2d 100644 --- a/src/ec/hp/kbc1126/acpi/battery.asl +++ b/src/ec/hp/kbc1126/acpi/battery.asl @@ -1,34 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */
-Field (ECRM, ByteAcc, NoLock, Preserve) -{ - Offset (0x84), - , 3, - LCTV, 1, - BATP, 4, - BPU, 1, - Offset (0x86), - BSEL, 4, /* battery select */ - Offset (0x87), - LB1, 8, - LB2, 8, - BDC, 16, - Offset (0x8D), - BFC, 16, /* battery full capacity */ - BRTE, 16, - BTC, 1, - Offset (0x92), - BME, 16, - BDN, 8, - BDV, 16, /* battery design voltage */ - BCV1, 16, - BST, 4, - Offset (0xC9), - BSN, 16, /* battery serial number */ - BDAT, 16, /* battery date */ - BMF, 8, -} - Name (NGBF, 0xFF) Name (NGBT, 0xFF) Name (GACP, 0x07) diff --git a/src/ec/hp/kbc1126/acpi/ec.asl b/src/ec/hp/kbc1126/acpi/ec.asl index ef68cc4..1922bd1 100644 --- a/src/ec/hp/kbc1126/acpi/ec.asl +++ b/src/ec/hp/kbc1126/acpi/ec.asl @@ -15,142 +15,207 @@ OperationRegion (ECRM, EmbeddedControl, 0x00, 0xFF) Field (ECRM, ByteAcc, NoLock, Preserve) { - PMCD, 32, - S0FL, 8, - SXF0, 8, - SXF1, 8, - CPWR, 16, - CVLT, 16, - CCUR, 16, - DIDX, 8, - CIDX, 8, - PMCC, 8, - PMEP, 8, + PMCD, 32, // PMC data? + S0FL, 8, // ? + SXF0, 8, // ? + SXF1, 8, // ? + CPWR, 16, // ... power? + CVLT, 16, // ... voltage? + CCUR, 16, // ... current? + DIDX, 8, // PMC data index? + CIDX, 8, // ... index? + PMCC, 8, // PMC command? + PMEP, 8, // ? Offset (0x22), - CRZN, 8, - THTA, 8, - HYST, 8, - CRIT, 8, - TEMP, 8, - TENA, 8, + CRZN, 8, // Select thermal zone + // 0 = PCHZ + // 1 = CPUZ + // 2 = GFXZ + // 3 = EXTZ + // 4 = LOCZ + // 5 = BATZ + // 6 = CHGZ + THTA, 8, // ? + HYST, 8, // ? + CRIT, 8, // ? + TEMP, 8, // Thermal zone temperature (unit: celcius) + TENA, 8, // ? Offset (0x29), - TOAD, 8, - PHTP, 8, - THEM, 8, - TMPO, 8, + TOAD, 8, // ? + PHTP, 8, // High trip point (unit: celcius) + // Vendor ACPI stores the next trip point temperature here. + THEM, 8, // Thermal zones with meaningful temperature change + // [0] = CPUZ + // [1] = GFXZ + // [2] = EXTZ + // [3] = LOCZ + // [4] = BATZ + // [5] = CHGZ + TMPO, 8, // ? Offset (0x2E), - FRDC, 8, - FTGC, 8, - PLTP, 8, + FRDC, 8, // (Thermal related?) + FTGC, 8, // (Thermal related?) + PLTP, 8, // Low trip point (unit: celcius) + // Vendor ACPI always stores the passive temperature here. Offset (0x32), - DTMP, 8, + DTMP, 8, // ... temperature (unit: celcius)? Offset (0x35), - PL1, 8, - PL2, 8, - BCVD, 8, + PL1, 8, // ? + PL2, 8, // ? + BCVD, 8, // ? Offset (0x40), - ABDI, 8, - ABAD, 8, - ABIX, 8, - ABDA, 8, - ABST, 8, - PORI, 8, + ABDI, 8, // Accelerometer device? + ABAD, 8, // Accelerometer mode? + // 0 = write + // 1 = read + ABIX, 8, // Accelerometer index? + ABDA, 8, // Accelerometer data? + ABST, 8, // Accelerometer status? + // [7] = operation failed? + PORI, 8, // Offset (0x4C), - PSSB, 8, + PSSB, 8, // (Battery related?) Offset (0x80), Offset (0x81), - , 4, - SLPT, 4, - FNSW, 1, - SFNC, 1, - ACPI, 1, - , 1, - , 1, - , 1, - , 1, - DETF, 1, - LIDS, 1, - TBLT, 1, - , 1, - , 1, - , 1, - COMM, 1, - PME, 1, - SBVD, 1, - - /* 0x84 to 0x9A is in battery.asl */ - + , 4, + SLPT, 4, // Sleep type + FNSW, 1, // Launch hotkeys without Fn keypress + SFNC, 1, // Swap Fn and Ctrl keys + ACPI, 1, // Enable ACPI + , 1, + , 1, + , 1, + , 1, + DETF, 1, // ? + LIDS, 1, // Lid status (opened/closed) + TBLT, 1, // Tablet (maybe related to touchscreens)? + , 1, + , 1, + , 1, + COMM, 1, // ? + PME, 1, // ? + SBVD, 1, // ? + ADP, 1, // AC presence + ADID, 2, // (Power source related?) + LCTV, 1, // ? + BATP, 4, // Battery presence + // [0] = primary + // [1] = secondary + BPU, 1, // ? + Offset (0x86), + BSEL, 4, // Select battery + // 0 = primary + // 1 = secondary + Offset (0x87), + LB1, 8, // Battery design capacity of warning + // There is a conversion from the ACPI value (used in _BIF) to the value + // stored in the EC: (X + 9) / 10 + // The speculation is that the EC stores in units of 10 mAh. The addition + // of 9 is to prevent truncating to 0 (e.g. 5/10 = 0 <=> (5 + 9)/10 = 1). + LB2, 8, // Battery design capacity of low + // See LB1 for more information (uses the same logic). + BDC, 16, // Battery design capacity + Offset (0x8D), + BFC, 16, // Battery last full charge capacity + BRTE, 16, // (Battery related?) + BTC, 1, // ? + Offset (0x92), + BME, 16, // (Battery related?) + BDN, 8, // Battery model (ASCII: max 16 characters) + // Reading this field will move the pointer to the next character. + // Setting BSEL will reset the pointer to the beginning. + BDV, 16, // Battery design voltage + BCV1, 16, // Battery cell voltage 1 + BST, 4, // Battery state Offset (0x9B), - BATE, 16, - BPR, 16, - BCR, 16, - BRC, 16, - BCC, 16, - BPV, 16, - BCV2, 16, - BCV3, 16, - BCV4, 16, - BCW, 16, - BATF, 16, - BCL, 16, - MAXC, 16, - BCG1, 8, - BT1I, 1, - BT2I, 1, - , 2, - BATN, 4, - BSTS, 16, - BCG2, 8, + BATE, 16, // (Battery related?) + BPR, 16, // Battery present rate + BCR, 16, // (Battery related?) + BRC, 16, // Battery remaining capacity + BCC, 16, // Battery cycle count + BPV, 16, // Battery present voltage + BCV2, 16, // Battery cell voltage 2 + BCV3, 16, // Battery cell voltage 3 + BCV4, 16, // Battery cell voltage 4 + BCW, 16, // ? + BATF, 16, // (Battery related?) + BCL, 16, // ? + MAXC, 16, // (Battery related?) + BCG1, 8, // ? + BT1I, 1, // ? + BT2I, 1, // ? + , 2, + BATN, 4, // (Battery related?) + BSTS, 16, // (Battery related?) + BCG2, 8, // ? Offset (0xBD), - BMO, 8, + BMO, 8, // ? Offset (0xBF), - BRCV, 8, + BRCV, 8, // (Battery related?) Offset (0xC1), - BIF, 8, - BRCC, 8, - - /* 0xC9 to 0xCD in battery.asl */ - + BIF, 8, // ? + BRCC, 8, // (Battery related?) + Offset (0xC9), + BSN, 16, // Battery serial number + BDAT, 16, // Battery date + // [0:4] = day + // [5:8] = month + // [9:15] = year ? 1980 (e.g. 2015 would be 35) + BMF, 8, // Battery manufacturer (ASCII: max 16 characters) + // See BDN for more information (uses the same logic). Offset (0xCF), - CTLB, 8, + CTLB, 8, // Battery commodity tracking number (ASCII: max 16 characters) + // See BDN for more information (uses the same logic). Offset (0xD1), - BTY, 8, + BTY, 8, // Battery type (ASCII: max 4 characters) + // See BDN for more information (uses the same logic). Offset (0xD5), - MFAC, 8, - CFAN, 8, - PFAN, 8, - OCPS, 8, - OCPR, 8, - OCPE, 8, - TMP1, 8, - TMP2, 8, - NABT, 4, - BCM, 4, - CCBQ, 16, - CBT, 16, + MFAC, 8, // ? + CFAN, 8, // ? + PFAN, 8, // ? + OCPS, 8, // ? + OCPR, 8, // ? + OCPE, 8, // ? + TMP1, 8, // ? + TMP2, 8, // ? + NABT, 4, // ? + BCM, 4, // ? + CCBQ, 16, // ? + CBT, 16, // Current battery temperature (unit: decikelvin) Offset (0xE3), - OST, 4, + OST, 4, // OS type + // 1 = Linux + // 4 = Windows 2001 + // 4 = Windows 2001 SP1 + // 5 = Windows 2001 SP2 + // 6 = Windows 2006 + // 7 = Windows 2009 + // 8 = Windows 2012 + // 9 = Windows 2013 + // 10 = Windows 2015 + // 11 = Windows 2016 + // 12 = Windows 2017 Offset (0xE4), Offset (0xE5), - TPTE, 1, - TBBN, 1, - , 3, - TP, 1, + TPTE, 1, // ? + TBBN, 1, // (Brightness related?) + , 3, + TP, 1, // ? Offset (0xE6), - SHK, 8, - AUDS, 1, - SPKR, 1, + SHK, 8, // (Hotkey related?) + AUDS, 1, // ? + SPKR, 1, // ? Offset (0xE8), - HSEN, 4, - HSST, 4, + HSEN, 4, // ? + HSST, 4, // ? Offset (0xEA), - , 2, - WWP, 1, - WLP, 1, + , 2, + WWP, 1, // (Battery related?) + WLP, 1, // (Battery related?) Offset (0xEF), - INCH, 2, - IDIS, 2, - INAC, 1 + INCH, 2, // (Battery related?) + IDIS, 2, // (Battery related?) + INAC, 1, // (Battery related?) }
Method (ECRI, 0, Serialized)