diff options
author | Mary Ruthven <mruthven@chromium.org> | 2022-02-23 11:04:07 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-01 05:09:35 +0000 |
commit | bba90682d743dd6947751dcfd50871525c2224a2 (patch) | |
tree | bc3dd60d00cdabff1bbcb0ff8e017ac39a1ed6a1 /board/cr50/gpio.inc | |
parent | 8d39e763aca72c79049009865fe164f59b6c6035 (diff) | |
download | chrome-ec-bba90682d743dd6947751dcfd50871525c2224a2.tar.gz |
cr50: return the time since user_pres was asserted
Add a vendor command that returns the time since user_pres_l was
asserted. This is only used for testing.
Tracking user_pres_l needs to be enabled with a vendor command since
DIOM4 may not be pulled up and may be pulled down on old boards.
Enabling the vendor command survives deep sleep reset. It gets cleared
after cr50 reset.
Cr50 clears the user_pres_l status if tracking is disabled.
BUG=b:219981194,b:208504127
TEST=manual
# Verify it survives deep sleep
sudo gsctool -y enable
sudo gsctool -y
...
user pres enabled
# enter deep sleep
sudo gsctool -y
...
user pres enabled
# Verify it doesn't survive cr50 reboot
sudo gsctool -y enable
sudo gsctool -y
...
user pres enabled
cr50 > reboot
sudo gsctool -y
...
user pres disabled
# Check gsctool output after triggering DIOM4 pulse
sudo gsctool -y enable
# Trigger pulse and wait 5 seconds
sudo gsctool -y
...
user pres enabled
last press: 5064331
Change-Id: Ib37980a5cd8d3378bf718e8e32a7d4152435a816
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3495863
Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
Diffstat (limited to 'board/cr50/gpio.inc')
-rw-r--r-- | board/cr50/gpio.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/board/cr50/gpio.inc b/board/cr50/gpio.inc index 8fb67bd425..a89aae20b5 100644 --- a/board/cr50/gpio.inc +++ b/board/cr50/gpio.inc @@ -127,6 +127,12 @@ GPIO_INT(EC_PACKET_MODE_EN, PIN(1, 7), GPIO_INT_RISING, ec_comm_packet_mode_en) GPIO_INT(EC_PACKET_MODE_DIS, PIN(1, 8), GPIO_INT_FALLING, ec_comm_packet_mode_dis) +/* + * Generic pulled up input used for physical presence indication on some + * devices. + */ +GPIO_INT(DIOM4, PIN(0, 3), GPIO_INT_RISING, diom4_deasserted) + /*****************************************************************************/ /* NON STANDARD INTERRUPT GPIOs - handlers defined and configured in board.c */ /* @@ -172,12 +178,6 @@ GPIO(SPI_MOSI, PIN(0, 7), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(SPI_CLK, PIN(0, 8), GPIO_INPUT | GPIO_PULL_DOWN) GPIO(SPI_CS_L, PIN(0, 9), GPIO_INPUT) -/* - * Generic pulled up input used for physical presence indication on some - * devices. - */ -GPIO(DIOM4, PIN(0, 3), GPIO_INPUT) - /* Used during *chip* factory process. */ GPIO(DIOB4, PIN(0, 10), GPIO_INPUT | GPIO_PULL_DOWN) @@ -242,7 +242,7 @@ UNIMPLEMENTED(ENTERING_RW) /* GPIOs - mark outputs as inputs too, to read back from the driven pad */ PINMUX(GPIO(INT_AP_L), A5, DIO_INPUT) -PINMUX(GPIO(DIOM4), M4, DIO_INPUT | GPIO_PULL_UP) +PINMUX(GPIO(DIOM4), M4, DIO_INPUT) PINMUX(GPIO(EC_FLASH_SELECT), B2, DIO_INPUT) PINMUX(GPIO(MONITOR_I2CP_SDA), A1, GPIO_INPUT) |