aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-23 21:29:37 -0700
committerSimon Glass <sjg@chromium.org>2018-12-05 06:01:34 -0700
commiteafb4a59dbb90a63c9676f16ffa1e099ee26ec28 (patch)
treecd99b60de91aaf1064e8cd9d6519e02b13ff4e1c
parenta749c09a1ea7376ff7a891663bb80ffbe308c485 (diff)
downloadu-boot-eafb4a59dbb90a63c9676f16ffa1e099ee26ec28.zip
u-boot-eafb4a59dbb90a63c9676f16ffa1e099ee26ec28.tar.gz
u-boot-eafb4a59dbb90a63c9676f16ffa1e099ee26ec28.tar.bz2
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>
-rw-r--r--drivers/misc/cros_ec_sandbox.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c
index 429f1a9..4fcb2d9 100644
--- a/drivers/misc/cros_ec_sandbox.c
+++ b/drivers/misc/cros_ec_sandbox.c
@@ -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: