mb/google/bluey: Enable dynamic SoC calculation and log battery level
Enable EC_GOOGLE_CHROMEEC_BATTERY_SOC_DYNAMIC for the Quenbi and Quartz models. These Qualcomm-based boards require State of Charge (SoC) to be calculated from dynamic battery metrics because the standard charge state command is restricted during certain active power states. Additionally, add platform_dump_battery_soc_information() to romstage to log the battery percentage early in the boot process. This helps with debugging power-related issues during the early boot sequence when serial console is enabled. Details: - Select EC_GOOGLE_CHROMEEC_BATTERY_SOC_DYNAMIC for Quenbi and Quartz. - Call the SoC dump in platform_romstage_main() if CONSOLE_SERIAL is on. BUG=none TEST=Boot Quenbi/Quartz and verify "Battery state-of-charge X" appears in the romstage serial console logs. Change-Id: I6184762140884762140884762140884762140884 Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90619 Reviewed-by: Kapil Porwal <kapilporwal@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
bab8ca2bd0
commit
3bebadd347
2 changed files with 14 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ config BOARD_GOOGLE_MODEL_QUENBI
|
|||
def_bool n
|
||||
select BOARD_GOOGLE_BASEBOARD_BLUEY
|
||||
select BOARD_ROMSIZE_KB_32768
|
||||
select EC_GOOGLE_CHROMEEC_BATTERY_SOC_DYNAMIC
|
||||
select MAINBOARD_HAS_CHROME_EC
|
||||
select MAINBOARD_HAS_FINGERPRINT_VIA_SPI
|
||||
select MAINBOARD_HAS_GOOGLE_TPM
|
||||
|
|
@ -39,6 +40,7 @@ config BOARD_GOOGLE_MODEL_QUARTZ
|
|||
def_bool n
|
||||
select BOARD_GOOGLE_BASEBOARD_BLUEY
|
||||
select BOARD_ROMSIZE_KB_32768
|
||||
select EC_GOOGLE_CHROMEEC_BATTERY_SOC_DYNAMIC
|
||||
select MAINBOARD_HAS_CHROME_EC
|
||||
select MAINBOARD_HAS_FINGERPRINT_VIA_SPI
|
||||
select MAINBOARD_HAS_GOOGLE_TPM
|
||||
|
|
|
|||
|
|
@ -77,11 +77,23 @@ int qclib_mainboard_override(struct qclib_cb_if_table *table)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void platform_dump_battery_soc_information(void)
|
||||
{
|
||||
uint32_t batt_pct;
|
||||
if (google_chromeec_read_batt_state_of_charge(&batt_pct))
|
||||
printk(BIOS_WARNING, "Failed to get battery level\n");
|
||||
else
|
||||
printk(BIOS_INFO, "Battery state-of-charge %d\n", batt_pct);
|
||||
}
|
||||
|
||||
void platform_romstage_main(void)
|
||||
{
|
||||
/* Watchdog must be checked first to avoid erasing watchdog info later. */
|
||||
check_wdog();
|
||||
|
||||
if (CONFIG(EC_GOOGLE_CHROMEEC) && CONFIG(CONSOLE_SERIAL))
|
||||
platform_dump_battery_soc_information();
|
||||
|
||||
shrm_fw_load_reset();
|
||||
|
||||
/* QCLib: DDR init & train */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue