diff options
author | Mary Ruthven <mruthven@chromium.org> | 2017-09-07 12:40:03 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-01-11 00:31:13 +0000 |
commit | 271ad8a8f1a3a043c01c6b2d49ceb35364ee9556 (patch) | |
tree | 12e697817c83bec19441911d9696a649c3bee04e | |
parent | 7124671ae7f7b4e4615d96ff7229401446868c77 (diff) | |
download | chrome-ec-271ad8a8f1a3a043c01c6b2d49ceb35364ee9556.tar.gz |
cr50: add board property deep sleep and detect ap flags
Add the flags for board_deep_sleep_allowed and
board_detect_ap_with_tpm_rst.
BUG=b:35647982
BRANCH=cr50
TEST=run firmware_DeepCr50SleepStress on electro. Make sure Bob can
still detect the AP state and doesn't enter deep sleep
Change-Id: I39e45f6eacc1cbdcb3ab1caaecd0836f8a2c073a
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/699294
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 3c1943f14d73a321f4cb862e7c5850d9a2624c1c)
Reviewed-on: https://chromium-review.googlesource.com/860286
-rw-r--r-- | board/cr50/board.c | 15 | ||||
-rw-r--r-- | board/cr50/scratch_reg1.h | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index b78e498571..bcb01951bc 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -138,14 +138,19 @@ int board_use_plt_rst(void) return !!(board_properties & BOARD_USE_PLT_RESET); } +/* Allow enabling deep sleep if the board supports it. */ int board_deep_sleep_allowed(void) { - return board_use_plt_rst(); + return !(board_properties & BOARD_DEEP_SLEEP_DISABLED); } +/* + * If the board doesn't use CR50_RX_AP_TX to determine AP state, it uses + * TPM_RST_L. + */ int board_detect_ap_with_tpm_rst(void) { - return board_use_plt_rst(); + return !(board_properties & BOARD_DETECT_AP_WITH_UART); } int board_rst_pullup_needed(void) @@ -231,7 +236,8 @@ const struct strap_desc strap_regs[] = { static struct board_cfg board_cfg_table[] = { /* SPI Variants: DIOA12 = 1M PD, DIOA6 = 1M PD */ /* Kevin/Gru: DI0A9 = 5k PD, DIOA1 = 1M PU */ - { 0x02, BOARD_SLAVE_CONFIG_SPI | BOARD_NEEDS_SYS_RST_PULL_UP }, + { 0x02, BOARD_SLAVE_CONFIG_SPI | BOARD_NEEDS_SYS_RST_PULL_UP | + BOARD_DEEP_SLEEP_DISABLED | BOARD_DETECT_AP_WITH_UART }, /* Poppy: DI0A9 = 1M PU, DIOA1 = 1M PU */ { 0x0A, BOARD_SLAVE_CONFIG_SPI | BOARD_USE_PLT_RESET }, @@ -239,7 +245,8 @@ static struct board_cfg board_cfg_table[] = { /* Reef/Eve: DIOA12 = 5k PD, DIOA6 = 1M PU */ { 0x20, BOARD_SLAVE_CONFIG_I2C | BOARD_USE_PLT_RESET }, /* Rowan: DIOA12 = 5k PD, DIOA6 = 5k PU */ - { 0x30, BOARD_SLAVE_CONFIG_I2C }, + { 0x30, BOARD_SLAVE_CONFIG_I2C | BOARD_DEEP_SLEEP_DISABLED | + BOARD_DETECT_AP_WITH_UART }, }; void post_reboot_request(void) diff --git a/board/cr50/scratch_reg1.h b/board/cr50/scratch_reg1.h index 86dc8d7e4b..9ea550f1ca 100644 --- a/board/cr50/scratch_reg1.h +++ b/board/cr50/scratch_reg1.h @@ -45,6 +45,10 @@ #define BOARD_CCD_SHIFT 11 #define BOARD_CCD_STATE (3 << BOARD_CCD_SHIFT) +/* Prevent Cr50 from entering deep sleep when the AP is off */ +#define BOARD_DEEP_SLEEP_DISABLED (1 << 13) +/* Use Cr50_RX_AP_TX to determine if the AP is off or on */ +#define BOARD_DETECT_AP_WITH_UART (1 << 14) /* * Macro to capture all properties related to board strapping pins. This must be * updated if additional strap related properties are added. |