summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2016-08-31 10:52:48 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-02 04:24:42 -0700
commita7182280b3aaf0c8ebe0acc375f872a0cbafe2f3 (patch)
treed2d6b90d7394d4ba857b9ff256fd6a44fea9ddb2
parentfd25b97b2768446fa9cee62111221a4331eca359 (diff)
downloadchrome-ec-a7182280b3aaf0c8ebe0acc375f872a0cbafe2f3.tar.gz
reef: Shutdown the AP before hibernating
To support hibernate called from console commands, ectool commands and key sequence added code to shutdown the AP before hibernating. BUG=chrome-os-partner:56490 BRANCH=none TEST=Using console command, ectool command & key sequence verified both EC and AP are hibernated. Change-Id: I7708377596d7d4175a44c202ae2385a239ca3d01 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/379157 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/reef/board.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/board/reef/board.c b/board/reef/board.c
index c58520d8e1..1845a105b8 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -663,26 +663,13 @@ void chipset_do_shutdown(void)
#endif
}
-void board_set_gpio_hibernate_state(void)
+void board_hibernate_late(void)
{
int i;
const uint32_t hibernate_pins[][2] = {
-#if 0
/* Turn off LEDs in hibernate */
{GPIO_BAT_LED_BLUE, GPIO_INPUT | GPIO_PULL_UP},
{GPIO_BAT_LED_AMBER, GPIO_INPUT | GPIO_PULL_UP},
- /*
- * Set PD wake low so that it toggles high to generate a wake
- * event once we leave hibernate.
- */
- {GPIO_USB_PD_WAKE, GPIO_OUTPUT | GPIO_LOW},
-#endif
- /*
- * In hibernate, this pin connected to GND. Set it to output
- * low to eliminate the current caused by internal pull-up.
- */
- /* FIXME(dhendrix): What do to with PROCHOT? */
- /* {GPIO_PLATFORM_EC_PROCHOT, GPIO_OUTPUT | GPIO_LOW}, */
/*
* BD99956 handles charge input automatically. We'll disable
@@ -917,19 +904,20 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
void board_hibernate(void)
{
- CPRINTS("Enter Pseudo G3");
-
- /* Enable both the VBUS & VCC ports before entering PG3 */
- bd99955_select_input_port(BD99955_CHARGE_PORT_BOTH);
-
/*
- * Clean up the UART buffer and prevent any unwanted garbage characters
- * before power off and also ensure above debug message is printed.
+ * To support hibernate called from console commands, ectool commands
+ * and key sequence, shutdown the AP before hibernating.
*/
- cflush();
+ chipset_do_shutdown();
+
+ /* Should not enter hibernate on AC */
+ ASSERT(!extpower_is_present());
- /* FIXME(dhendrix): What to do here? EC is always on so we need to
- * turn off whatever can be turned off. */
+ /* Added delay to allow AP to settle down */
+ msleep(100);
+
+ /* Enable both the VBUS & VCC ports before entering PG3 */
+ bd99955_select_input_port(BD99955_CHARGE_PORT_BOTH);
}
struct {