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); |
Hung-Te Lin | fe2fc83 | 2016-12-29 20:59:37 +0800 | [diff] [blame] | 25 | void regen_vbnv_crc(uint8_t *vbnv_copy); |
Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 26 | int get_recovery_mode_from_vbnv(void); |
| 27 | void set_recovery_mode_into_vbnv(int recovery_reason); |
| 28 | int vboot_wants_oprom(void); |
| 29 | |
| 30 | /* CMOS backend */ |
| 31 | void read_vbnv_cmos(uint8_t *vbnv_copy); |
| 32 | void save_vbnv_cmos(const uint8_t *vbnv_copy); |
Jagadish Krishnamoorthy | e2e561d | 2016-05-18 15:18:58 -0700 | [diff] [blame] | 33 | void init_vbnv_cmos(int rtc_fail); |
Duncan Laurie | 88b28ad | 2016-01-25 17:13:27 -0800 | [diff] [blame] | 34 | |
| 35 | /* Flash backend */ |
| 36 | void read_vbnv_flash(uint8_t *vbnv_copy); |
| 37 | void save_vbnv_flash(const uint8_t *vbnv_copy); |
| 38 | |
| 39 | /* EC backend */ |
| 40 | void read_vbnv_ec(uint8_t *vbnv_copy); |
| 41 | void save_vbnv_ec(const uint8_t *vbnv_copy); |
| 42 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 43 | #endif /* __VBOOT_VBNV_H__ */ |