diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2020-11-23 16:16:14 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-16 09:39:12 +0000 |
commit | 80a3a4a289877fa8726d5b794fdfe57d51a3b047 (patch) | |
tree | 74b7912697e5b71ea91bc05465c057556b24c758 /board | |
parent | 59797476b4ad70cfe4209e6f9fdd3b78e49c12ed (diff) | |
download | chrome-ec-80a3a4a289877fa8726d5b794fdfe57d51a3b047.tar.gz |
bloonchipper: enable low power
Enable STOP mode in idle when the PLL is off and the AP is not running.
The Zork variants have a broken SLP_S0_L signal (stuck to 0 in S0).
We just ignore it there and only uses SLP_S3_L on those machines which
is fine since they do not implement a S0ix like state.
As those systems currently are the only users of the serial host interface,
uses this configuration as proxy for this workaround.
Once the AP RW will be updated on all those variants to toggle properly
the SLP_S0_L signal, we can remove this workaround.
Note: currently there is no wake-up from the serial console, in order to
use it, you must ensure that the AP power signals are in the 'running'
state.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=b:130561737
BRANCH=fpmcu-bloonchipper
TEST=manual, on bloonchipper, check we can still capture fingerprint.
TEST=manual, read the MCU power consumption: pp3300_dx_mcu_mw is 2.367 mW.
TEST=manual, verify USART and SPI host interfaces.
TEST=manual, verify fingerprint recognition latency.
Change-Id: Ia6779238d65022156a53ed4d040620c8c8cfc85e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555158
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/hatch_fp/board.c | 22 | ||||
-rw-r--r-- | board/hatch_fp/board.h | 5 |
2 files changed, 21 insertions, 6 deletions
diff --git a/board/hatch_fp/board.c b/board/hatch_fp/board.c index e42f576ad8..edffa11a53 100644 --- a/board/hatch_fp/board.c +++ b/board/hatch_fp/board.c @@ -16,6 +16,12 @@ #include "usart_host_command.h" #include "util.h" +/* + * Some platforms have a broken SLP_S0_L signal (stuck to 0 in S0) + * if set, ignore it and only uses SLP_S3_L for the AP state. + */ +static bool broken_slp_s0; + /** * Disable restricted commands when the system is locked. * @@ -36,12 +42,12 @@ static void ap_deferred(void) { /* * in S3: SLP_S3_L is 0 and SLP_S0_L is X. - * in S0ix: SLP_S3_L is X and SLP_S0_L is 0. + * in S0ix: SLP_S3_L is 1 and SLP_S0_L is 0. * in S0: SLP_S3_L is 1 and SLP_S0_L is 1. * in S5/G3, the FP MCU should not be running. */ int running = gpio_get_level(GPIO_PCH_SLP_S3_L) - && gpio_get_level(GPIO_PCH_SLP_S0_L); + && (gpio_get_level(GPIO_PCH_SLP_S0_L) || broken_slp_s0); if (running) { /* S0 */ disable_sleep(SLEEP_MASK_AP_RUN); @@ -87,6 +93,9 @@ static void board_init(void) { enum fp_transport_type ret_transport = get_fp_transport_type(); + /* Run until the first S3 entry */ + disable_sleep(SLEEP_MASK_AP_RUN); + /* Configure and enable SPI as master for FP sensor */ configure_fp_sensor_spi(); @@ -105,6 +114,15 @@ static void board_init(void) /* Disable SPI interrupt to disable SPI transport layer */ gpio_disable_interrupt(GPIO_SPI1_NSS); + + /* + * The Zork variants currently have a broken SLP_S0_L signal + * (stuck to 0 in S0). For now, unconditionally ignore it here + * as they are the only UART users and the AP has no S0ix state. + * TODO(b/174695987) once the RW AP firmware has been updated + * on all those machines, remove this workaround. + */ + broken_slp_s0 = true; break; case FP_TRANSPORT_TYPE_SPI: diff --git a/board/hatch_fp/board.h b/board/hatch_fp/board.h index b6f27d2815..8a0bb2d38c 100644 --- a/board/hatch_fp/board.h +++ b/board/hatch_fp/board.h @@ -225,12 +225,9 @@ #define CONFIG_AES #define CONFIG_AES_GCM #define CONFIG_DMA -/*FIXME*/ -/*#define CONFIG_FORCE_CONSOLE_RESUME*/ #define CONFIG_FPU #define CONFIG_HOST_COMMAND_STATUS -/*FIXME*/ -/*#define CONFIG_LOW_POWER_IDLE*/ +#define CONFIG_LOW_POWER_IDLE #define CONFIG_MKBP_EVENT #define CONFIG_MKBP_USE_GPIO #define CONFIG_PRINTF_LEGACY_LI_FORMAT |