summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/system.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/common/system.c b/common/system.c
index 25acdbf544..a5824f0a72 100644
--- a/common/system.c
+++ b/common/system.c
@@ -1227,17 +1227,22 @@ int host_command_vbnvcontext(struct host_cmd_handler_args *args)
{
const struct ec_params_vbnvcontext *p = args->params;
struct ec_response_vbnvcontext *r;
+ int i;
switch (p->op) {
case EC_VBNV_CONTEXT_OP_READ:
r = args->response;
- if (system_get_vbnvcontext(r->block))
- return EC_RES_ERROR;
+ for (i = 0; i < EC_VBNV_BLOCK_SIZE; ++i)
+ if (system_get_bbram(SYSTEM_BBRAM_IDX_VBNVBLOCK0 + i,
+ r->block + i))
+ return EC_RES_ERROR;
args->response_size = sizeof(*r);
break;
case EC_VBNV_CONTEXT_OP_WRITE:
- if (system_set_vbnvcontext(p->block))
- return EC_RES_ERROR;
+ for (i = 0; i < EC_VBNV_BLOCK_SIZE; ++i)
+ if (system_set_bbram(SYSTEM_BBRAM_IDX_VBNVBLOCK0 + i,
+ p->block[i]))
+ return EC_RES_ERROR;
break;
default:
return EC_RES_ERROR;