From c0e350a226b41a48b78c1b0f7743c4b8ef9c5d91 Mon Sep 17 00:00:00 2001 From: Diana Z Date: Tue, 1 Feb 2022 14:53:22 -0700 Subject: AMD: Add fake S0 support Add in support for a fake S0 state. Since we rely on the SoC SLP signals to sequence, we can encourage sequencing through just turning these GPIOs into outputs and setting them. Disable the forced power sequencing by setting them to inputs again. BRANCH=None BUG=b:209613841 TEST=make buildall Signed-off-by: Diana Z Change-Id: I30a07b9accdd5632fa303e05ac12201f3f86cfb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3430301 Reviewed-by: Aseda Aboagye --- power/amd_x86.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'power') diff --git a/power/amd_x86.c b/power/amd_x86.c index ae3367e227..c62663e9e9 100644 --- a/power/amd_x86.c +++ b/power/amd_x86.c @@ -30,6 +30,23 @@ static int forcing_shutdown; /* Forced shutdown in progress? */ +#ifdef CONFIG_POWERSEQ_FAKE_CONTROL +/* Create fake power states through forcing the SoC SLP signal sequencing */ +void power_fake_s0(void) +{ + /* Change the SLP signals to output and drive them */ + gpio_set_flags(GPIO_PCH_SLP_S5_L, GPIO_OUT_HIGH); + gpio_set_flags(GPIO_PCH_SLP_S3_L, GPIO_OUT_HIGH); +} + +void power_fake_disable(void) +{ + /* Pins back to inputs */ + gpio_set_flags(GPIO_PCH_SLP_S5_L, GPIO_INPUT); + gpio_set_flags(GPIO_PCH_SLP_S3_L, GPIO_INPUT); +} +#endif /* defined(CONFIG_POWERSEQ_FAKE_CONTROL) */ + void chipset_force_shutdown(enum chipset_shutdown_reason reason) { CPRINTS("%s()", __func__); -- cgit v1.2.1