Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/84352?usp=email )
Change subject: ec/google/chromeec: Add option to control reading long battery strings ......................................................................
ec/google/chromeec: Add option to control reading long battery strings
Older ChromeOS devices (pre-CR50) do not support reading long battery strings. This commit adds a Kconfig option, EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING, to enable or disable this feature.
This allows devices with TPM_GOOGLE (CR50/TI50) to read and display long battery strings, while older devices like google/link, wolf, samus, and chell will continue to display only the first 8 characters.
This change ensures compatibility with older devices while enabling the display of complete battery information on newer platforms.
BUG=b:366338622 TEST=Verified on google/tivviks_ufs: * Long battery string is displayed when EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING is enabled. * Short battery string is displayed when EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING=n.
Change-Id: I7859809278b7e926bbe8beb1a0a9e12c7e6c220d Signed-off-by: Subrata Banik subratabanik@google.com --- M src/ec/google/chromeec/Kconfig M src/ec/google/chromeec/acpi/battery.asl 2 files changed, 19 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/84352/1
diff --git a/src/ec/google/chromeec/Kconfig b/src/ec/google/chromeec/Kconfig index 7a8777f..f0418ff 100644 --- a/src/ec/google/chromeec/Kconfig +++ b/src/ec/google/chromeec/Kconfig @@ -152,6 +152,21 @@ help Put the fan in auto mode at boot.
+config EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING + depends on TPM_GOOGLE + bool + default y + help + The Chrome EC currently supports two ways to read battery strings on + ACPI platforms: + + * Read up to 8 bytes from EC shared memory BMFG, BMOD, ... + * Send a EC_CMD_BATTERY_GET_STATIC host command and read longer strings as a response. + + Select this config to support readout of longer battery strings. + + If unsure, say N. + endif # EC_GOOGLE_CHROMEEC
source "src/ec/google/chromeec/*/Kconfig" diff --git a/src/ec/google/chromeec/acpi/battery.asl b/src/ec/google/chromeec/acpi/battery.asl index f5047cb..30fe0fc 100644 --- a/src/ec/google/chromeec/acpi/battery.asl +++ b/src/ec/google/chromeec/acpi/battery.asl @@ -54,9 +54,12 @@ Return (Local0) }
+#if CONFIG(EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING) // Cached flag for BSRF FIFO readout support from EC. Name(BRSS, 0xff) - +#else +Name(BRSS, 0x0) +#endif // Read extended battery strings from the selected battery. // Arg0 = string index //