diff options
author | Namyoon Woo <namyoon@google.com> | 2020-05-06 14:27:47 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-14 04:03:17 +0000 |
commit | 53f6d8a9334b259cf6ec3ddbc577ff49354c1ed1 (patch) | |
tree | 0a353c42d490c0d0399a5297600b683a97ae85a3 | |
parent | 7c2da5bce9c93041777c92711ff02d7672baa916 (diff) | |
download | chrome-ec-53f6d8a9334b259cf6ec3ddbc577ff49354c1ed1.tar.gz |
make cr50 agnostic about EC-EFS2
This patch makes cr50 respond EC-EFS2 related TPM commands no matter
it has the board property, BOARD_EC_CR50_COMM_SUPPORT or not.
board_has_ec_cr50_comm_support() calls remain for configuring
GPIO_EC_PACKET_MODE_EN only.
BUG=b:155214584
TEST=checked gsctool running on Coral.
[before]
$ gsctool --getbootmode
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
Error 8 in Getting boot mode
[after]
$ gsctool --getbootmode
finding_device 18d1:5014
Found device.
found interface 3 endpoint 4, chunk_len 64
READY
-------
Boot mode = 0x00: NORMAL
Also checked 'ec_comm' uart command.
[before]
> ec_comm
No EC-CR50 comm support
Invalid argument
Usage: ec_comm [corrupt]
[after]
> ec_comm
uart : 0xff
packet mode : DISABLED
phase : 0
preamble_count : 0
bytes_received : 0
bytes_expected : 0
response : 0x0000
ec_hash : UNLOADED <-- It is marked as unloaded,
secdata_error_code : 0x00001203 <-- because of NVMEM error.
boot_mode : NORMAL <-- Still, boot_mode is normal.
Signed-off-by: Namyoon Woo <namyoon@google.com>
Change-Id: I08dc9abd8f194c83484b5be9b0a5e8844b2fd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2185872
Tested-by: Namyoon Woo <namyoon@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Commit-Queue: Namyoon Woo <namyoon@chromium.org>
-rw-r--r-- | board/cr50/board.c | 4 | ||||
-rw-r--r-- | common/ec_comm.c | 5 | ||||
-rw-r--r-- | common/ec_efs.c | 14 |
3 files changed, 2 insertions, 21 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 8aa6dde87d..355c92ff97 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1148,8 +1148,8 @@ void assert_ec_rst(void) /* Prevent bit bang interrupt storm. */ if (uart_bitbang_is_enabled()) task_disable_irq(bitbang_config.rx_irq); - else if (board_has_ec_cr50_comm_support()) - ec_efs_reset(); + + ec_efs_reset(); wait_ec_rst(1); diff --git a/common/ec_comm.c b/common/ec_comm.c index 18ea225ef9..4ad6311acc 100644 --- a/common/ec_comm.c +++ b/common/ec_comm.c @@ -317,11 +317,6 @@ void ec_comm_block(int block) */ static int command_ec_comm(int argc, char **argv) { - if (!board_has_ec_cr50_comm_support()) { - ccprintf("No EC-CR50 comm support\n"); - return EC_ERROR_INVAL; - } - if (argc > 1) { if (!strcasecmp(argv[1], "corrupt")) { int result = ec_efs_corrupt_hash(); diff --git a/common/ec_efs.c b/common/ec_efs.c index 4a3cb2b996..a08edde9b1 100644 --- a/common/ec_efs.c +++ b/common/ec_efs.c @@ -108,9 +108,6 @@ static int load_ec_hash_(uint8_t * const ec_hash) */ static void ec_efs_init_(void) { - if (!board_has_ec_cr50_comm_support()) - return; - /* * If it is a wakeup from deep sleep, then recover some core EC-EFS * context values, including the boot_mode value, from a PWRD_SCRATCH @@ -139,11 +136,6 @@ static enum vendor_cmd_rc vc_get_boot_mode_(struct vendor_cmd_params *p) { uint8_t *buffer; - if (!board_has_ec_cr50_comm_support()) { - p->out_size = 0; - return VENDOR_RC_NO_SUCH_SUBCOMMAND; - } - buffer = (uint8_t *)p->buffer; buffer[0] = (uint8_t)ec_efs_ctx.boot_mode; @@ -162,9 +154,6 @@ static enum vendor_cmd_rc vc_reset_ec_(struct vendor_cmd_params *p) { p->out_size = 0; - if (!board_has_ec_cr50_comm_support()) - return VENDOR_RC_NO_SUCH_SUBCOMMAND; - /* * Let's reset EC a little later so that CR50 can send a TPM command * to AP. @@ -272,9 +261,6 @@ void ec_efs_refresh(void) { int rv; - if (!board_has_ec_cr50_comm_support()) - return; - rv = load_ec_hash_(ec_efs_ctx.hash); if (rv == EC_SUCCESS) { ec_efs_ctx.hash_is_loaded = 1; |