vboot: expose vbnv_reset() function

It's helpful to use the common vbnv_reset() function to
initialize the vbnv contents when backing store failures occur.
Therefore, allow that to happen.

BUG=b:63054105

Change-Id: I990639e8c163469733fdab0d3c72e064acc9f8d8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/21559
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Aaron Durbin 2017-09-15 11:17:38 -06:00
parent 976200388b
commit fe265a1b9c
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,7 @@ static uint8_t crc8_vbnv(const uint8_t *data, int len)
return (uint8_t) (crc >> 8); return (uint8_t) (crc >> 8);
} }
static void reset_vbnv(uint8_t *vbnv_copy) void vbnv_reset(uint8_t *vbnv_copy)
{ {
memset(vbnv_copy, 0, VBOOT_VBNV_BLOCK_SIZE); memset(vbnv_copy, 0, VBOOT_VBNV_BLOCK_SIZE);
} }
@ -100,7 +100,7 @@ void read_vbnv(uint8_t *vbnv_copy)
/* Check data for consistency */ /* Check data for consistency */
if (!verify_vbnv(vbnv_copy)) if (!verify_vbnv(vbnv_copy))
reset_vbnv(vbnv_copy); vbnv_reset(vbnv_copy);
} }
/* /*

View File

@ -28,6 +28,8 @@ void set_recovery_mode_into_vbnv(int recovery_reason);
int vboot_wants_oprom(void); int vboot_wants_oprom(void);
/* Initialize and read vbnv. This is used in the main vboot logic path. */ /* Initialize and read vbnv. This is used in the main vboot logic path. */
void vbnv_init(uint8_t *vbnv_copy); void vbnv_init(uint8_t *vbnv_copy);
/* Reset vbnv snapshot to a known state. */
void vbnv_reset(uint8_t *vbnv_copy);
/* CMOS backend */ /* CMOS backend */
void read_vbnv_cmos(uint8_t *vbnv_copy); void read_vbnv_cmos(uint8_t *vbnv_copy);