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 /include | |
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 'include')
-rw-r--r-- | include/tpm_vendor_cmds.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/tpm_vendor_cmds.h b/include/tpm_vendor_cmds.h index a59c81e10f..3ad5d79214 100644 --- a/include/tpm_vendor_cmds.h +++ b/include/tpm_vendor_cmds.h @@ -165,6 +165,8 @@ enum vendor_cmd_cc { */ VENDOR_CC_DS_DIS_TEMP = 59, + VENDOR_CC_USER_PRES = 60, + LAST_VENDOR_COMMAND = 65535, }; @@ -224,6 +226,18 @@ enum wp_options { WP_ENABLE }; +/* VENDOR_CC_USER_PRES options. */ +enum user_pres_options { + USER_PRES_ENABLE = BIT(0), + USER_PRES_DISABLE = BIT(1), + USER_PRES_PRESSED = BIT(2) +}; +/* Structure for VENDOR_CC_USER_PRES response */ +struct user_pres_response { + uint8_t state; /* The user presence state. ENABLE or DISABLE */ + uint64_t last_press; /* Time since last press */ +} __packed; + /* * The TPMv2 Spec mandates that vendor-specific command codes have bit 29 set, * while bits 15-0 indicate the command. All other bits should be zero. |