1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef __VBOOT_VBNV_H__ 4 #define __VBOOT_VBNV_H__ 5 6 #include <types.h> 7 8 /* Generic functions */ 9 void read_vbnv(uint8_t *vbnv_copy); 10 void save_vbnv(const uint8_t *vbnv_copy); 11 int verify_vbnv(uint8_t *vbnv_copy); 12 void regen_vbnv_crc(uint8_t *vbnv_copy); 13 14 /* Read the USB Device Controller(UDC) enable flag from VBNV. */ 15 int vbnv_udc_enable_flag(void); 16 17 /* Initialize and read vbnv. This is used in the main vboot logic path. */ 18 void vbnv_init(void); 19 /* Reset vbnv snapshot to a known state. */ 20 void vbnv_reset(uint8_t *vbnv_copy); 21 22 /* CMOS backend */ 23 /* Initialize the vbnv CMOS backing store. The vbnv_copy pointer is used for 24 optional temporary storage in the init function. */ 25 void vbnv_init_cmos(uint8_t *vbnv_copy); 26 /* Return non-zero if CMOS power was lost. */ 27 int vbnv_cmos_failed(void); 28 void read_vbnv_cmos(uint8_t *vbnv_copy); 29 void save_vbnv_cmos(const uint8_t *vbnv_copy); 30 31 /* Flash backend */ 32 void read_vbnv_flash(uint8_t *vbnv_copy); 33 void save_vbnv_flash(const uint8_t *vbnv_copy); 34 35 /* EC backend */ 36 void read_vbnv_ec(uint8_t *vbnv_copy); 37 void save_vbnv_ec(const uint8_t *vbnv_copy); 38 39 #endif /* __VBOOT_VBNV_H__ */ 40