cros_ec: Adjust to use v1 vboot context only

At present there are no users of the 64-byte v2 context. The v1 context is
only 16 bytes long and currently an error is raised if too much data is
returned from the EC.

Update the code to limit the size to 16 bytes.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2018-11-23 21:29:37 -07:00
parent a749c09a1e
commit eafb4a59db
1 changed files with 6 additions and 4 deletions

View File

@ -313,13 +313,15 @@ static int process_cmd(struct ec_state *ec,
switch (req->op) {
case EC_VBNV_CONTEXT_OP_READ:
/* TODO(sjg@chromium.org): Support full-size context */
memcpy(resp->block, ec->vbnv_context,
sizeof(resp->block));
len = sizeof(*resp);
EC_VBNV_BLOCK_SIZE);
len = 16;
break;
case EC_VBNV_CONTEXT_OP_WRITE:
memcpy(ec->vbnv_context, resp->block,
sizeof(resp->block));
/* TODO(sjg@chromium.org): Support full-size context */
memcpy(ec->vbnv_context, req->block,
EC_VBNV_BLOCK_SIZE);
len = 0;
break;
default: