blob: 30da6a50c5a1f51c985344cf71a628706ded72cb [file] [log] [blame]
Duncan Laurie88b28ad2016-01-25 17:13:27 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Google Inc.
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.
14 */
15
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070016#ifndef __VBOOT_VBNV_H__
17#define __VBOOT_VBNV_H__
Duncan Laurie88b28ad2016-01-25 17:13:27 -080018
19#include <types.h>
20
21/* Generic functions */
Furquan Shaikhbe87f732016-06-29 11:26:27 -070022void read_vbnv(uint8_t *vbnv_copy);
Duncan Laurie88b28ad2016-01-25 17:13:27 -080023void save_vbnv(const uint8_t *vbnv_copy);
24int verify_vbnv(uint8_t *vbnv_copy);
Hung-Te Linfe2fc832016-12-29 20:59:37 +080025void regen_vbnv_crc(uint8_t *vbnv_copy);
Duncan Laurie88b28ad2016-01-25 17:13:27 -080026int get_recovery_mode_from_vbnv(void);
27void set_recovery_mode_into_vbnv(int recovery_reason);
28int vboot_wants_oprom(void);
29
30/* CMOS backend */
31void read_vbnv_cmos(uint8_t *vbnv_copy);
32void save_vbnv_cmos(const uint8_t *vbnv_copy);
Jagadish Krishnamoorthye2e561d2016-05-18 15:18:58 -070033void init_vbnv_cmos(int rtc_fail);
Duncan Laurie88b28ad2016-01-25 17:13:27 -080034
35/* Flash backend */
36void read_vbnv_flash(uint8_t *vbnv_copy);
37void save_vbnv_flash(const uint8_t *vbnv_copy);
38
39/* EC backend */
40void read_vbnv_ec(uint8_t *vbnv_copy);
41void save_vbnv_ec(const uint8_t *vbnv_copy);
42
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070043#endif /* __VBOOT_VBNV_H__ */