From 0f25f85e44362e7feb15ce59974f0423abab0b5f Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 24 Apr 2019 11:20:51 -0700 Subject: ccd: delay sleep while opening ccd Cr50 may enter deep sleep while wiping the TPM. This change adds a sleep delay before opening ccd. BUG=b:130646257 BRANCH=cr50 TEST=manual dut-control cold_reset:on run ccd open make sure ccd is open even after entering deep sleep Change-Id: Id44b608702b664621bd2441f62a03ba6428135cf Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/1585606 Reviewed-by: Namyoon Woo --- board/cr50/board.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'board/cr50') diff --git a/board/cr50/board.h b/board/cr50/board.h index 016cbc4607..b03499e3d0 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -459,4 +459,19 @@ enum nvmem_users { #define CONFIG_USB_I2C_MAX_WRITE_COUNT 508 #define CONFIG_USB_I2C_MAX_READ_COUNT 506 +/* The below time constants are way longer than should be required in practice: + * + * Time it takes to finish processing TPM command + */ +#define TPM_PROCESSING_TIME (1 * SECOND) + +/* + * Time it takse TPM reset function to wipe out the NVMEM and reboot the + * device. + */ +#define TPM_RESET_TIME (10 * SECOND) + +/* Total time deep sleep should not be allowed while wiping the TPM. */ +#define DISABLE_SLEEP_TIME_TPM_WIPE (TPM_PROCESSING_TIME + TPM_RESET_TIME) + #endif /* __CROS_EC_BOARD_H */ -- cgit v1.2.1