blob: d73423eb7530a0ea1757bec3dd80f13936e76647 [file] [log] [blame]
Stefan Reinaueraaaf6892013-08-29 15:57:11 -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 Reinaueraaaf6892013-08-29 15:57:11 -070014 */
15
16#include <types.h>
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070017#include <ec/google/chromeec/ec.h>
Philipp Deppenwiesefea24292017-10-17 17:02:29 +020018#include <security/vboot/vbnv.h>
19#include <security/vboot/vbnv_layout.h>
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070020
Duncan Laurie88b28ad2016-01-25 17:13:27 -080021void read_vbnv_ec(uint8_t *vbnv_copy)
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070022{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070023 google_chromeec_vbnv_context(1, vbnv_copy, VBOOT_VBNV_BLOCK_SIZE);
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070024}
25
Duncan Laurie88b28ad2016-01-25 17:13:27 -080026void save_vbnv_ec(const uint8_t *vbnv_copy)
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070027{
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070028 google_chromeec_vbnv_context(0, (uint8_t *)vbnv_copy,
29 VBOOT_VBNV_BLOCK_SIZE);
Stefan Reinaueraaaf6892013-08-29 15:57:11 -070030}