blob: fcae37a910dc8aeb5a60903a8d9c750462b8e12c [file] [log] [blame]
Angel Pons986d50e2020-04-02 23:48:53 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauer9aea04a2012-03-30 12:01:06 -07002
3#include <types.h>
Stefan Reinaueraaaf6892013-08-29 15:57:11 -07004#include <ec/google/chromeec/ec.h>
Philipp Deppenwiesefea24292017-10-17 17:02:29 +02005#include <security/vboot/vbnv.h>
6#include <security/vboot/vbnv_layout.h>
Stefan Reinauer9aea04a2012-03-30 12:01:06 -07007
Duncan Laurie88b28ad2016-01-25 17:13:27 -08008void read_vbnv_ec(uint8_t *vbnv_copy)
Stefan Reinauer9aea04a2012-03-30 12:01:06 -07009{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070010 google_chromeec_vbnv_context(1, vbnv_copy, VBOOT_VBNV_BLOCK_SIZE);
Aaron Durbinfd795622013-03-01 17:12:26 -060011}
12
Duncan Laurie88b28ad2016-01-25 17:13:27 -080013void save_vbnv_ec(const uint8_t *vbnv_copy)
Aaron Durbinfd795622013-03-01 17:12:26 -060014{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070015 google_chromeec_vbnv_context(0, (uint8_t *)vbnv_copy,
16 VBOOT_VBNV_BLOCK_SIZE);
Aaron Durbinfd795622013-03-01 17:12:26 -060017}