summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/rambi/board.c19
-rw-r--r--board/rambi/board.h2
-rw-r--r--power/baytrail.c15
3 files changed, 31 insertions, 5 deletions
diff --git a/board/rambi/board.c b/board/rambi/board.c
index 845797139b..d20229ec5c 100644
--- a/board/rambi/board.c
+++ b/board/rambi/board.c
@@ -14,6 +14,7 @@
#include "gpio.h"
#include "host_command.h"
#include "i2c.h"
+#include "jtag.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
#include "peci.h"
@@ -26,20 +27,23 @@
#include "temp_sensor_chip.h"
#include "thermal.h"
#include "timer.h"
+#include "uart.h"
#include "util.h"
/* GPIO signal list. Must match order from enum gpio_signal. */
const struct gpio_info gpio_list[] = {
/* Inputs with interrupt handlers are first for efficiency */
- {"POWER_BUTTON_L", LM4_GPIO_A, (1<<2), GPIO_INT_BOTH,
+ {"POWER_BUTTON_L", LM4_GPIO_A, (1<<2), GPIO_INT_BOTH_DSLEEP,
power_button_interrupt},
- {"LID_OPEN", LM4_GPIO_A, (1<<3), GPIO_INT_BOTH,
+ {"LID_OPEN", LM4_GPIO_A, (1<<3), GPIO_INT_BOTH_DSLEEP,
lid_interrupt},
- {"AC_PRESENT", LM4_GPIO_H, (1<<3), GPIO_INT_BOTH,
+ {"AC_PRESENT", LM4_GPIO_H, (1<<3), GPIO_INT_BOTH_DSLEEP,
extpower_interrupt},
- {"PCH_SLP_S3_L", LM4_GPIO_G, (1<<7), GPIO_INT_BOTH|GPIO_PULL_UP,
+ {"PCH_SLP_S3_L", LM4_GPIO_G, (1<<7), GPIO_INT_BOTH_DSLEEP |
+ GPIO_PULL_UP,
x86_interrupt},
- {"PCH_SLP_S4_L", LM4_GPIO_H, (1<<1), GPIO_INT_BOTH|GPIO_PULL_UP,
+ {"PCH_SLP_S4_L", LM4_GPIO_H, (1<<1), GPIO_INT_BOTH_DSLEEP |
+ GPIO_PULL_UP,
x86_interrupt},
{"PP1050_PGOOD", LM4_GPIO_H, (1<<4), GPIO_INT_BOTH,
x86_interrupt},
@@ -53,6 +57,11 @@ const struct gpio_info gpio_list[] = {
x86_interrupt},
{"WP_L", LM4_GPIO_A, (1<<4), GPIO_INT_BOTH,
switch_interrupt},
+ {"JTAG_TCK", LM4_GPIO_C, (1<<0), GPIO_DEFAULT,
+ jtag_interrupt},
+ {"UART0_RX", LM4_GPIO_A, (1<<0), GPIO_INT_BOTH_DSLEEP |
+ GPIO_PULL_UP,
+ uart_deepsleep_interrupt},
/* Other inputs */
{"BOARD_VERSION1", LM4_GPIO_Q, (1<<5), GPIO_INPUT, NULL},
diff --git a/board/rambi/board.h b/board/rambi/board.h
index 8412a5535e..34ed193823 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -71,6 +71,8 @@ enum gpio_signal {
GPIO_S5_PGOOD, /* Power good on S5 supplies */
GPIO_VCORE_PGOOD, /* Power good on core VR */
GPIO_WP_L, /* Write protect input */
+ GPIO_JTAG_TCK, /* JTAG clock input */
+ GPIO_UART0_RX, /* UART0 RX input */
/* Other inputs */
GPIO_BOARD_VERSION1, /* Board version stuffing resistor 1 */
diff --git a/power/baytrail.c b/power/baytrail.c
index 9ca1633a2f..3f7f217f24 100644
--- a/power/baytrail.c
+++ b/power/baytrail.c
@@ -113,6 +113,9 @@ enum x86_state x86_chipset_init(void)
*/
if (system_jumped_to_this_image()) {
if ((x86_get_signals() & IN_ALL_S0) == IN_ALL_S0) {
+ /* Disable idle task deep sleep when in S0. */
+ disable_sleep(SLEEP_MASK_AP_RUN);
+
CPRINTF("[%T x86 already in S0]\n");
return X86_S0;
} else {
@@ -266,6 +269,12 @@ enum x86_state x86_handle_state(enum x86_state state)
/* Call hooks now that rails are up */
hook_notify(HOOK_CHIPSET_RESUME);
+ /*
+ * Disable idle task deep sleep. This means that the low
+ * power idle task will not go into deep sleep while in S0.
+ */
+ disable_sleep(SLEEP_MASK_AP_RUN);
+
/* Wait 100ms after all voltages good */
msleep(100);
@@ -298,6 +307,12 @@ enum x86_state x86_handle_state(enum x86_state state)
wireless_enable(0);
/*
+ * Enable idle task deep sleep. Allow the low power idle task
+ * to go into deep sleep in S3 or lower.
+ */
+ enable_sleep(SLEEP_MASK_AP_RUN);
+
+ /*
* Deassert prochot since CPU is off and we're about to drop
* +VCCP.
*/