Attention is currently required from: Caveh Jalali, Forest Mittelberg, Jon Murphy, Karthik Ramasubramanian.

Jon Murphy uploaded patch set #2 to this change.

View Change

The following approvals got outdated and were removed: Verified-1 by build bot (Jenkins)

acpi: add support for reading long battery strings

This adds EC_ACPI_MEM_STRINGS_FIFO, a method for host firmware to read
arbitrarily long battery information strings (or any other string, but
currently only supporting battery strings).

On ACPI platforms, the host generally reads battery information from a
shared memory region where the strings are limited to 8 bytes in length.
Expanding those would consume a large fraction of the available shared
memory space (limited to 256 bytes), so this implements an ACPI command
(based on the ACPI Embedded Controller Interface Specification) allowing
the host to read strings of any length while consuming only one byte of
ACPI memory space.

Although the EC also supports reading long strings using host commands
(EC_CMD_BATTERY_GET_STATIC), host commands are assumed to be the
exclusive domain of the OS and unavailable to AP firmware because it
would require careful cooperation (locking) to ensure that firmware and
other software cannot interfere with each other's host commands.

BUG=b:339171261
TEST=on yaviks, the EC console logs FIFO readout messages when used in
ACPI and correct strings are shown in the OS.

Original-Cq-Depend: chromium:5599370,chromium:5605867,chromium:5605868
Original-Change-Id: Ibb3d4115f7d5c6b6c2512deb4e53077a48a355e3
Original-Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/5581473
Original-Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Commit-Queue: Peter Marheine <pmarheine@chromium.org>
Original-Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Original-Tested-by: Peter Marheine <pmarheine@chromium.org>

GitOrigin-RevId: 22e6b9a3ef43132f10e77bd5845b648fdbd387f1

Change-Id: I871433c66cefe5522f9ff942841518e0d6654ca3
Signed-off-by: Jon Murphy <jpmurphy@google.com>
---
M src/ec/google/chromeec/ec_commands.h
1 file changed, 59 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/83526/2

To view, visit change 83526. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I871433c66cefe5522f9ff942841518e0d6654ca3
Gerrit-Change-Number: 83526
Gerrit-PatchSet: 2
Gerrit-Owner: Jon Murphy <jpmurphy@google.com>
Gerrit-Reviewer: Caveh Jalali <caveh@chromium.org>
Gerrit-Reviewer: Forest Mittelberg <bmbm@google.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Attention: Caveh Jalali <caveh@chromium.org>
Gerrit-Attention: Jon Murphy <jpmurphy@google.com>
Gerrit-Attention: Karthik Ramasubramanian <kramasub@google.com>
Gerrit-Attention: Forest Mittelberg <bmbm@google.com>