summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.