summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElthan_Huang <elthan_huang@compal.corp-partner.google.com>2018-01-29 10:57:37 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-02-12 18:59:29 -0800
commitdb93a8d74c52bc30945120c0f43c527c8af3148c (patch)
tree216b45ec0f7709b53851cdd01921844b3482d2a1
parent61e1151d2cdd3247a285a549ffa8fbd68d3597ca (diff)
downloadchrome-ec-db93a8d74c52bc30945120c0f43c527c8af3148c.tar.gz
Nami: Enable hibernate using silego
Nami EC has EC_HIBERNATE pin connected to a silego (U91). When this pin is asserted, U91 shuts down ROP_PMIC_ENVR3, which turns off the EC. Thus, we don't use the internal hibernate/wake-up feature in npcx. BUG=b:72641658 BRANCH=none TEST=Test system will shutdown and doesn't auto wake up when type hibernate in ec console. And wake up by AC plugin, LID open, or power button. Change-Id: Ib9e02f7e41087e5972eedf4855d88a4c45c75bb4 Signed-off-by: Elthan_Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/890569 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--board/nami/board.c12
-rw-r--r--board/nami/board.h1
-rw-r--r--chip/npcx/registers.h1
-rw-r--r--chip/npcx/system.c6
-rw-r--r--include/config.h6
5 files changed, 14 insertions, 12 deletions
diff --git a/board/nami/board.c b/board/nami/board.c
index 40891acc89..a5a9a1ac68 100644
--- a/board/nami/board.c
+++ b/board/nami/board.c
@@ -131,14 +131,6 @@ const struct power_signal_info power_signal_list[] = {
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
-/* Hibernate wake configuration */
-const enum gpio_signal hibernate_wake_pins[] = {
- GPIO_AC_PRESENT,
- GPIO_LID_OPEN,
- GPIO_POWER_BUTTON_L,
-};
-const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
-
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Vbus sensing (10x voltage divider). PPVAR_BOOSTIN_SENSE */
@@ -488,7 +480,9 @@ void board_hibernate(void)
{
CPRINTS("Triggering PMIC shutdown.");
uart_flush_output();
- /* dnojiri: revisit */
+ gpio_set_level(GPIO_EC_HIBERNATE, 1);
+ while (1)
+ ;
}
const struct pwm_t pwm_channels[] = {
diff --git a/board/nami/board.h b/board/nami/board.h
index 6fb0c7d5c1..e6809aa89f 100644
--- a/board/nami/board.h
+++ b/board/nami/board.h
@@ -49,6 +49,7 @@
#define CONFIG_WIRELESS_SUSPEND \
(EC_WIRELESS_SWITCH_WLAN | EC_WIRELESS_SWITCH_WLAN_POWER)
#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_DX_WLAN
+#undef CONFIG_SUPPORT_CHIP_HIBERNATION
/* EC console commands */
#define CONFIG_CMD_ACCELS
diff --git a/chip/npcx/registers.h b/chip/npcx/registers.h
index 0e12e5f7f4..855adfb32d 100644
--- a/chip/npcx/registers.h
+++ b/chip/npcx/registers.h
@@ -47,7 +47,6 @@
/* Switcher of features */
#define SUPPORT_LCT 1
#define SUPPORT_WDG 1
-#define SUPPORT_HIB 1
#define SUPPORT_P80_SEG 0 /* Note: it uses KSO10 & KSO11 */
/* Switcher of debugging */
#define DEBUG_GPIO 0
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index aa7b239c38..b2d4c4b0c0 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -422,7 +422,8 @@ void system_check_reset_cause(void)
/**
* Chip-level function to set GPIOs and wake-up inputs for hibernate.
*/
-void system_set_gpios_and_wakeup_inputs_hibernate(void)
+#ifdef CONFIG_SUPPORT_CHIP_HIBERNATION
+static void system_set_gpios_and_wakeup_inputs_hibernate(void)
{
int table, i;
@@ -534,6 +535,7 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
__hibernate_npcx_series();
}
+#endif /* CONFIG_SUPPORT_CHIP_HIBERNATION */
static char system_to_hex(uint8_t x)
{
@@ -637,7 +639,7 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds)
if (board_hibernate)
board_hibernate();
-#if SUPPORT_HIB
+#ifdef CONFIG_SUPPORT_CHIP_HIBERNATION
/* Add additional hibernate operations here */
__enter_hibernate(seconds, microseconds);
#endif
diff --git a/include/config.h b/include/config.h
index f091694ec1..a1d197c014 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1676,6 +1676,12 @@
#undef CONFIG_HIBERNATE_WAKEUP_PINS
/*
+ * If defined, chip hibernation is used. Your board needs to define wake-up
+ * signals. Undefine this to use board hibernation capability.
+ */
+#define CONFIG_SUPPORT_CHIP_HIBERNATION
+
+/*
* Use PSL (Power Switch Logic) for hibernating. It turns off VCC power rail
* for ultra-low power consumption and uses PSL inputs rely on VSBY power rail
* to wake up ec and the whole system.