diff options
author | Mary Ruthven <mruthven@chromium.org> | 2017-08-24 11:25:21 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-08-24 17:20:42 -0700 |
commit | 611887143a67253ffdd5a947c0c4543d0a1c64d7 (patch) | |
tree | 7c5493900470a8c35d7108191a0233ae09bcedb0 | |
parent | abd7e7d5820c114dee87565b93d5d76c209b3361 (diff) | |
download | chrome-ec-611887143a67253ffdd5a947c0c4543d0a1c64d7.tar.gz |
cr50: add board property functions
Add some board property functions that describe what behavior we are
checking instead of just using board_use_plt_rst. More devices are
getting deep sleep support. This changes some function names to make the
transition easier.
This change adds board_use_deep_sleep and board_detect_ap_with_tpm_rst.
Right now both of these just call board_use_plt_rst. This will
eventually change with the expansion of deep sleep to new devices.
BUG=none
BRANCH=cr50
TEST=run firmware_Cr50DeepSleepStress with 10 suspend/resume cycles
Change-Id: I8d9ef23f686dea788d26ac4973054ad027fdd3a4
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/633891
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | board/cr50/board.c | 16 | ||||
-rw-r--r-- | board/cr50/board.h | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index b3414cdba8..626535f98e 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -120,6 +120,16 @@ int board_use_plt_rst(void) return !!(board_properties & BOARD_USE_PLT_RESET); } +int board_deep_sleep_allowed(void) +{ + return board_use_plt_rst(); +} + +int board_detect_ap_with_tpm_rst(void) +{ + return board_use_plt_rst(); +} + int board_rst_pullup_needed(void) { return !!(board_properties & BOARD_NEEDS_SYS_RST_PULL_UP); @@ -804,7 +814,7 @@ static void deferred_tpm_rst_isr(void) * If we're transitioning the AP from OFF or UNKNOWN, also trigger the * resume handler. */ - if (board_use_plt_rst() && + if (board_detect_ap_with_tpm_rst() && device_state_changed(DEVICE_AP, DEVICE_STATE_ON)) hook_notify(HOOK_CHIPSET_RESUME); @@ -1273,7 +1283,7 @@ void board_update_device_state(enum device_type device) * signals; we own those GPIOs, so need to enable their * interrupts explicitly. */ - if ((device != DEVICE_AP) || !board_use_plt_rst()) + if ((device != DEVICE_AP) || !board_detect_ap_with_tpm_rst()) gpio_enable_interrupt(device_states[device].detect); /* @@ -1316,7 +1326,7 @@ static void ap_shutdown(void) * there will require more support on the AP side than is available * now. */ - if (board_use_plt_rst()) + if (board_deep_sleep_allowed()) enable_deep_sleep(); } DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, ap_shutdown, HOOK_PRIO_DEFAULT); diff --git a/board/cr50/board.h b/board/cr50/board.h index b851f98209..ea907a351c 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -247,6 +247,10 @@ int board_rst_pullup_needed(void); int board_tpm_uses_i2c(void); int board_tpm_uses_spi(void); int board_id_is_mismatched(void); +/* Use TPM_RST_L to detect the AP state instead of the uart */ +int board_detect_ap_with_tpm_rst(void); +/* Allow for deep sleep to be enabled on AP shutdown */ +int board_deep_sleep_allowed(void); void power_button_record(void); |