summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2022-02-01 14:53:22 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-07 18:54:04 +0000
commitc0e350a226b41a48b78c1b0f7743c4b8ef9c5d91 (patch)
tree14be05c443f5f05418e6f7b5e2b6cad92edba830 /power
parent90cd4033ccb514a60a9476e4bbb469e9cb6c6cfa (diff)
downloadchrome-ec-c0e350a226b41a48b78c1b0f7743c4b8ef9c5d91.tar.gz
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 <dzigterman@chromium.org> Change-Id: I30a07b9accdd5632fa303e05ac12201f3f86cfb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3430301 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/amd_x86.c17
1 files changed, 17 insertions, 0 deletions
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__);