ec/google/chromeec: Add Kconfig to enable battery full workaround

Commit 55a972236e ("chromeec: Disable battery remaining capacity
workaround") disabled the workaround for all ChromeEC devices, since
newer EC firmware applies compensation via battery_compensate_params.
Older boards use EC branches that lack this logic; without it, users can
see 93–100% charge–discharge cycling and stale full-capacity reporting.

Add a Kconfig to configure the workaround, and select it for older
boards whose EC firmware lacks battery_compensate_params logic.
EC firmware branches were inspected to determine which ones lack this
logic.


TEST=build/boot google/lulu, verify battery full indication works
     correctly with the Kconfig selected.

Change-Id: I096e0cf402e07f846b961319e01fb8f2c2dde7fc
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90960
Reviewed-by: Caveh Jalali <caveh@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
This commit is contained in:
Matt DeVillier 2026-01-27 18:15:22 -06:00
commit e464a02635
11 changed files with 26 additions and 4 deletions

View file

@ -220,6 +220,17 @@ config EC_GOOGLE_CHROMEEC_READ_BATTERY_LONG_STRING
If unsure, say N.
config EC_GOOGLE_CHROMEEC_NEEDS_BATTERY_WORKAROUND
bool
help
Enable the ACPI "full battery" workaround (BFWK) for remaining capacity.
When enabled, remaining charge near full is reported as full capacity to
hide 93-100% charge-discharge cycles and to handle batteries that don't report
full capacity timely.
Select this for older boards whose EC firmware lacks battery_compensate_params
logic.
If unsure, say N.
config EC_GOOGLE_CHROMEEC_LPC_GENERIC_MEMORY_RANGE
def_bool n
help

View file

@ -414,8 +414,9 @@ Device (BAT0)
})
Name (BSTP, 0)
// Workaround for full battery status, disabled by default
Name (BFWK, 0)
// Workaround for full battery status, disabled by default,
// enabled via Kconfig for older boards lacking EC compensation.
Name (BFWK, CONFIG(EC_GOOGLE_CHROMEEC_NEEDS_BATTERY_WORKAROUND))
// Method to enable full battery workaround
Method (BFWE)
@ -504,8 +505,9 @@ Device (BAT1)
})
Name (BSTP, 0)
// Workaround for full battery status, disabled by default
Name (BFWK, 0)
// Workaround for full battery status, disabled by default,
// enabled via Kconfig for older boards lacking EC compensation.
Name (BFWK, CONFIG(EC_GOOGLE_CHROMEEC_NEEDS_BATTERY_WORKAROUND))
// Method to enable full battery workaround
Method (BFWE)