blob: 99e2b82b1f7abaf649368dbd4d2a883fd2f97372 [file] [log] [blame]
Stefan Reinauer9aea04a2012-03-30 12:01:06 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070014 */
15
16#include <types.h>
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070017#include <ec/google/chromeec/ec.h>
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070018#include <vboot/vbnv.h>
19#include <vboot/vbnv_layout.h>
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070020
Duncan Laurie88b28ad2016-01-25 17:13:27 -080021void read_vbnv_ec(uint8_t *vbnv_copy)
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070022{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070023 google_chromeec_vbnv_context(1, vbnv_copy, VBOOT_VBNV_BLOCK_SIZE);
Aaron Durbinfd795622013-03-01 17:12:26 -060024}
25
Duncan Laurie88b28ad2016-01-25 17:13:27 -080026void save_vbnv_ec(const uint8_t *vbnv_copy)
Aaron Durbinfd795622013-03-01 17:12:26 -060027{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070028 google_chromeec_vbnv_context(0, (uint8_t *)vbnv_copy,
29 VBOOT_VBNV_BLOCK_SIZE);
Aaron Durbinfd795622013-03-01 17:12:26 -060030}