Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 1 | /* |
| 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 Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 16 | #ifndef __VBOOT_VBNV_H__ |
| 17 | #define __VBOOT_VBNV_H__ |
Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 18 | |
| 19 | #include <types.h> |
| 20 | |
| 21 | /* Generic functions */ |
Furquan Shaikh | be87f73 | 2016-06-29 11:26:27 -0700 | [diff] [blame] | 22 | void read_vbnv(uint8_t *vbnv_copy); |
Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 23 | void save_vbnv(const uint8_t *vbnv_copy); |
| 24 | int verify_vbnv(uint8_t *vbnv_copy); |
| 25 | int get_recovery_mode_from_vbnv(void); |
| 26 | void set_recovery_mode_into_vbnv(int recovery_reason); |
| 27 | int vboot_wants_oprom(void); |
| 28 | |
| 29 | /* CMOS backend */ |
| 30 | void read_vbnv_cmos(uint8_t *vbnv_copy); |
| 31 | void save_vbnv_cmos(const uint8_t *vbnv_copy); |
Jagadish Krishnamoorthy | e2e561d | 2016-05-18 15:18:58 -0700 | [diff] [blame] | 32 | void init_vbnv_cmos(int rtc_fail); |
Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 33 | |
| 34 | /* Flash backend */ |
| 35 | void read_vbnv_flash(uint8_t *vbnv_copy); |
| 36 | void save_vbnv_flash(const uint8_t *vbnv_copy); |
| 37 | |
| 38 | /* EC backend */ |
| 39 | void read_vbnv_ec(uint8_t *vbnv_copy); |
| 40 | void save_vbnv_ec(const uint8_t *vbnv_copy); |
| 41 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 42 | #endif /* __VBOOT_VBNV_H__ */ |