[coreboot-gerrit] New patch to review for coreboot: vendorcode/chromeos/vbnv: add cmos init function
Jagadish Krishnamoorthy (jagadish.krishnamoorthy@intel.com)
gerrit at coreboot.org
Thu May 19 00:29:40 CEST 2016
Jagadish Krishnamoorthy (jagadish.krishnamoorthy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14898
-gerrit
commit bb05a3f1cc0274bf5ade12996a7255a81316c735
Author: Jagadish Krishnamoorthy <jagadish.krishnamoorthy at intel.com>
Date: Wed May 18 15:18:58 2016 -0700
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.
Change-Id: I8475f23d849fb5b5a2d16738b4d5e99f112883da
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy at intel.com>
---
src/vendorcode/google/chromeos/vbnv.h | 1 +
src/vendorcode/google/chromeos/vbnv_cmos.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/src/vendorcode/google/chromeos/vbnv.h b/src/vendorcode/google/chromeos/vbnv.h
index 3d88507..5d21cc8 100644
--- a/src/vendorcode/google/chromeos/vbnv.h
+++ b/src/vendorcode/google/chromeos/vbnv.h
@@ -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);
diff --git a/src/vendorcode/google/chromeos/vbnv_cmos.c b/src/vendorcode/google/chromeos/vbnv_cmos.c
index 6dfc74c..119f681 100644
--- a/src/vendorcode/google/chromeos/vbnv_cmos.c
+++ b/src/vendorcode/google/chromeos/vbnv_cmos.c
@@ -51,6 +51,20 @@ 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];
+
+ read_vbnv(vbnv);
+ if (rtc_fail)
+ read_vbnv(vbnv);
+
+ cmos_init(rtc_fail);
+
+ if (rtc_fail)
+ save_vbnv(vbnv);
+}
+
#if IS_ENABLED(CONFIG_CHROMEOS_VBNV_CMOS_BACKUP_TO_FLASH)
static void back_up_vbnv_cmos(void *unused)
{
More information about the coreboot-gerrit
mailing list