2020-04-02 23:48:53 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2016-01-26 02:13:27 +01:00
|
|
|
|
2016-07-25 20:48:03 +02:00
|
|
|
#ifndef __VBOOT_VBNV_H__
|
|
|
|
#define __VBOOT_VBNV_H__
|
2016-01-26 02:13:27 +01:00
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
|
|
|
|
/* Generic functions */
|
2016-06-29 20:26:27 +02:00
|
|
|
void read_vbnv(uint8_t *vbnv_copy);
|
2016-01-26 02:13:27 +01:00
|
|
|
void save_vbnv(const uint8_t *vbnv_copy);
|
|
|
|
int verify_vbnv(uint8_t *vbnv_copy);
|
2016-12-29 13:59:37 +01:00
|
|
|
void regen_vbnv_crc(uint8_t *vbnv_copy);
|
2018-04-26 03:13:03 +02:00
|
|
|
|
|
|
|
/* Read the USB Device Controller(UDC) enable flag from VBNV. */
|
|
|
|
int vbnv_udc_enable_flag(void);
|
|
|
|
|
2017-09-15 19:15:07 +02:00
|
|
|
/* Initialize and read vbnv. This is used in the main vboot logic path. */
|
|
|
|
void vbnv_init(uint8_t *vbnv_copy);
|
2017-09-15 19:17:38 +02:00
|
|
|
/* Reset vbnv snapshot to a known state. */
|
|
|
|
void vbnv_reset(uint8_t *vbnv_copy);
|
2016-01-26 02:13:27 +01:00
|
|
|
|
|
|
|
/* CMOS backend */
|
2020-02-16 10:01:33 +01:00
|
|
|
/* Initialize the vbnv CMOS backing store. The vbnv_copy pointer is used for
|
2017-09-15 23:23:04 +02:00
|
|
|
optional temporary storage in the init function. */
|
|
|
|
void vbnv_init_cmos(uint8_t *vbnv_copy);
|
2020-02-16 10:01:33 +01:00
|
|
|
/* Return non-zero if CMOS power was lost. */
|
2017-09-15 23:23:04 +02:00
|
|
|
int vbnv_cmos_failed(void);
|
2016-01-26 02:13:27 +01:00
|
|
|
void read_vbnv_cmos(uint8_t *vbnv_copy);
|
|
|
|
void save_vbnv_cmos(const uint8_t *vbnv_copy);
|
|
|
|
|
|
|
|
/* Flash backend */
|
|
|
|
void read_vbnv_flash(uint8_t *vbnv_copy);
|
|
|
|
void save_vbnv_flash(const uint8_t *vbnv_copy);
|
|
|
|
|
|
|
|
/* EC backend */
|
|
|
|
void read_vbnv_ec(uint8_t *vbnv_copy);
|
|
|
|
void save_vbnv_ec(const uint8_t *vbnv_copy);
|
|
|
|
|
2016-07-25 20:48:03 +02:00
|
|
|
#endif /* __VBOOT_VBNV_H__ */
|