dedede: Add z-state support

Dedede has support for the new low power "Z-state".  In this state. the
EC and H1 are unpowered, but power will be restored to the EC once one
of the wakeup events occurs.  These events are ACOK, lid open, and a
power button press.  This commit simply enables the Z-state when the EC
hibernates.

BUG=b:147819424
BRANCH=None
TEST=build and flash waddledoo, enter `hibernate`, verify that EC power
is turned off and can be restored by pressing the power button or
plugging in a charger.

Change-Id: I4f93efd0632f457354f4bf6bf0274b19a9cd799c
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2006215
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
This commit is contained in:
Aseda Aboagye 2020-01-16 15:17:33 -08:00 committed by Commit Bot
parent 23b0af225e
commit 7616354e44
3 changed files with 19 additions and 3 deletions

View File

@ -58,3 +58,12 @@ void baseboard_chipset_shutdown(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, baseboard_chipset_shutdown,
HOOK_PRIO_DEFAULT);
void board_hibernate_late(void)
{
/*
* Turn on the Z state. This will not return as it will cut power to
* the EC.
*/
gpio_set_level(GPIO_EN_SLP_Z, 1);
}

View File

@ -465,7 +465,12 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
}
/* bit5: watchdog is disabled. */
IT83XX_ETWD_ETWCTRL |= BIT(5);
/* Setup GPIOs for hibernate */
/*
* Setup GPIOs for hibernate. On some boards, it's possible that this
* may not return at all. On those boards, power to the EC is likely
* being turn off entirely.
*/
if (board_hibernate_late)
board_hibernate_late();

View File

@ -509,8 +509,10 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
system_set_gpios_and_wakeup_inputs_hibernate();
/*
* Give the board a chance to do any late stage hibernation work.
* This is likely going to configure GPIOs for hibernation.
* Give the board a chance to do any late stage hibernation work. This
* is likely going to configure GPIOs for hibernation. On some boards,
* it's possible that this may not return at all. On those boards,
* power to the EC is likely being turn off entirely.
*/
if (board_hibernate_late)
board_hibernate_late();