UPSTREAM: vendorcode/chromeos/vbnv: Add CMOS init function
Add cmos init helper function. This function saves the Vboot NV data, calls cmos init and restores the Vboot NV data. BUG=None BRANCH=None TEST=None Change-Id: I8475f23d849fb5b5a2d16738b4d5e99f112883da Original-Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> Original-Reviewed-on: https://review.coreboot.org/14898 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/347164 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
parent
c0a6c5196a
commit
8610557368
2 changed files with 14 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ int vboot_wants_oprom(void);
|
|||
/* CMOS backend */
|
||||
void read_vbnv_cmos(uint8_t *vbnv_copy);
|
||||
void save_vbnv_cmos(const uint8_t *vbnv_copy);
|
||||
void init_vbnv_cmos(int rtc_fail);
|
||||
|
||||
/* Flash backend */
|
||||
void read_vbnv_flash(uint8_t *vbnv_copy);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,19 @@ void save_vbnv_cmos(const uint8_t *vbnv_copy)
|
|||
cmos_write(vbnv_copy[i], CONFIG_VBNV_OFFSET + 14 + i);
|
||||
}
|
||||
|
||||
void init_vbnv_cmos(int rtc_fail)
|
||||
{
|
||||
uint8_t vbnv[VBNV_BLOCK_SIZE];
|
||||
|
||||
if (rtc_fail)
|
||||
read_vbnv_cmos(vbnv);
|
||||
|
||||
cmos_init(rtc_fail);
|
||||
|
||||
if (rtc_fail)
|
||||
save_vbnv_cmos(vbnv);
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_CHROMEOS_VBNV_CMOS_BACKUP_TO_FLASH)
|
||||
static void back_up_vbnv_cmos(void *unused)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue