amd/mendocino/root_complex: Throttle SOC during low/no battery

Use dynamic power and thermal configuration (DPTC) via ACPI ALIB calls
to throttle the SOC when there is no battery or critically low battery,
to enable the SOC to boot without overwhelming the AC charger and
browning out.

DPTC is not enabled for low/no battery mode with this CL. It will be
enabled for Skyrim in a following CL.

BRANCH=none
BUG=b:217911928
TEST=Boot skyrim

Signed-off-by: Tim Van Patten <timvp@google.com>
Change-Id: Ifeddb99e97af93b40a5aad960d760e4c101cf086
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67189
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Tim Van Patten 2022-05-20 11:06:03 -06:00 committed by Martin L Roth
parent d8210d6ee1
commit 1075fef445
1 changed files with 12 additions and 0 deletions

View File

@ -210,6 +210,18 @@ static void acipgen_dptci(void)
config->vrm_maximum_current_limit_mA,
config->vrm_soc_current_limit_mA);
acpigen_write_alib_dptc_default((uint8_t *)&default_input, sizeof(default_input));
/* Low/No Battery */
struct dptc_input no_battery_input = DPTC_INPUTS(
config->thermctl_limit_degreeC,
config->sustained_power_limit_mW,
config->fast_ppt_limit_mW,
config->slow_ppt_limit_mW,
config->vrm_current_limit_throttle_mA,
config->vrm_maximum_current_limit_throttle_mA,
config->vrm_soc_current_limit_throttle_mA);
acpigen_write_alib_dptc_no_battery((uint8_t *)&no_battery_input,
sizeof(no_battery_input));
}
static void root_complex_fill_ssdt(const struct device *device)