diff options
author | Craig Hesling <hesling@chromium.org> | 2021-07-25 17:06:09 -0400 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-05 21:23:58 +0000 |
commit | 565833feea83ca23d0c16a1c01bbc4a3c42d02c6 (patch) | |
tree | bc9a6c13e7a7af5f9697a196d2cd16942e2b42f7 /board/nocturne_fp/board_rw.c | |
parent | 5e2a0808b7dfc736676daf8ba4d6cf683076d961 (diff) | |
download | chrome-ec-565833feea83ca23d0c16a1c01bbc4a3c42d02c6.tar.gz |
dartmonkey: Reintroduce sleep lines to RO
Change https://crrev.com/c/2657778 removed the sleep lines from RO
in an effort to minimize the RO complexity.
Most notably, this isolated the deep-sleep/low-power-idle
logic to RW only.
Unfortunately, the sleep lines also control whether the SPI host interface
is listening, which allows it to ignore spurious communication.
It seems safer to reinstate the the sleep line with low power idle
active and directly disable CONFIG_LOW_POWER_IDLE in subsequent CL.
We reinstate the sleep line gpio logic from the following:
crrev.com/c1b5095aa8404709bb447bd7a58f262d7d471a01/board/nocturne_fp/board.c
This is the parent commit to the CL that refactors the sleep lines.
Considering dartmonkey has a sleep line modification for dev boards,
we keep this in RW only. Since nearly all functionality would need
to be conditioned and communicated between RO and RW, I decided to
just create a clean break between RO and RW board init. The original
board.c no longer spans both RO and RW, there are exclusive board_ro.c
and board_rw.c files.
BRANCH=none
BUG=b:178746753
TEST=# Connect servo_micro and J-Link to an icetower board.
make proj-dartmonkey -j
sudo servod --board=icetower
./util/flash_jlink.py --board=dartmonkey --image=./build/dartmonkey/ec.bin
# Unplug J-Link and unplug/replug servo connector.
dut-control fpmcu_slp:off fpmcu_slp_alt:off
dut-control pp3300_dx_mcu_mw # Should be more than 40mw
dut-control fpmcu_slp:on fpmcu_slp_alt:off
dut-control pp3300_dx_mcu_mw # Should be less than 10mw
dut-control fpmcu_slp:off fpmcu_slp_alt:on
dut-control pp3300_dx_mcu_mw # Should be less than 10mw
dut-control fpmcu_slp:on fpmcu_slp_alt:on
dut-control pp3300_dx_mcu_mw # Should be less than 10mw
dut-control fpmcu_slp:off fpmcu_slp_alt:off
minicom -D$(dut-control -o raw_fpmcu_console_uart_pty)
> reboot ro
# Ctrl-A Q
# RO does not have the code to adjust to SLP_ALT_DEV_L, thus
# it will use SLP_ALT_L, which is 0. This means it will always
# think sleep is asserted.
dut-control fpmcu_slp:off fpmcu_slp_alt:off
dut-control pp3300_dx_mcu_mw # Should be less than 10mw
minicom -D$(dut-control -o raw_fpmcu_console_uart_pty)
> gpioget
# Should see SLP_L=1, SLP_ALT_L=0, and SLP_ALT_DEV_L=1
> reboot
> fpenroll
> fpmatch
# Ctrl-A Q
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: Ibb2c8052bc4fb776c5e1c172eeb1f3faf356a147
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3052750
Commit-Queue: Josie Nordrum <josienordrum@google.com>
Reviewed-by: Josie Nordrum <josienordrum@google.com>
Diffstat (limited to 'board/nocturne_fp/board_rw.c')
-rw-r--r-- | board/nocturne_fp/board_rw.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/board/nocturne_fp/board_rw.c b/board/nocturne_fp/board_rw.c index 657f155a4a..0a7b38b97d 100644 --- a/board/nocturne_fp/board_rw.c +++ b/board/nocturne_fp/board_rw.c @@ -19,6 +19,18 @@ #error "This file should only be built for RW." #endif +/** + * Disable restricted commands when the system is locked. + * + * @see console.h system.c + */ +int console_is_restricted(void) +{ + return system_is_locked(); +} + +#include "gpio_list.h" + /* SPI devices */ struct spi_device_t spi_devices[] = { /* Fingerprint sensor (SCLK at 4Mhz) */ @@ -84,7 +96,7 @@ static void spi_configure(enum fp_sensor_spi_select spi_select) spi_enable(&spi_devices[0], 1); } -void board_init_rw(void) +void board_init(void) { enum fp_sensor_spi_select spi_select = get_fp_sensor_spi_select(); @@ -111,6 +123,7 @@ void board_init_rw(void) /* Enable interrupt on PCH power signals */ gpio_enable_interrupt(gpio_slp_alt_l); gpio_enable_interrupt(GPIO_SLP_L); + /* * Enable the SPI slave interface if the PCH is up. * Do not use hook_call_deferred(), because ap_deferred() will be @@ -118,3 +131,4 @@ void board_init_rw(void) */ ap_deferred(); } +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); |