diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-07-22 14:42:58 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-01 01:13:19 +0000 |
commit | 6014c048131f7c3d055e97c0aaa44494edc4f813 (patch) | |
tree | 35bcae847010edd5ec761e556df663f2b0d3a517 | |
parent | af23ef7ef17bfb954dbe46606911679b61e21d31 (diff) | |
download | vboot-6014c048131f7c3d055e97c0aaa44494edc4f813.tar.gz |
Call software sync a second time for PD, if necessary
If a device has both an EC and a separate PD chip, call software sync
for each chip.
BUG=chrome-os-partner:30079
BRANCH=none
TEST=Flash image.bin with new AP+EC+PD firmware, reboot.
See EC and PD both update and jump to RW.
On next cold boot, they jump to RW without again updating.
CQ-DEPEND=CL:210520
Change-Id: Ie445336ade46f0009c040afc14b3f40452caf27b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/210536
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 10 |
2 files changed, 13 insertions, 1 deletions
@@ -149,6 +149,10 @@ ifneq (${FORCE_LOGGING_ON},) CFLAGS += -DFORCE_LOGGING_ON=${FORCE_LOGGING_ON} endif +ifneq (${PD_SYNC},) +CFLAGS += -DPD_SYNC +endif + # Create / use dependency files CFLAGS += -MMD -MF $@.d diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 2f54d672..448e6963 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -625,6 +625,8 @@ VbError_t VbEcSoftwareSync(int devidx, VbCommonParams *cparams) int need_update = 0; int i; + VBDEBUG(("VbEcSoftwareSync(devidx=%d)\n", devidx)); + /* Determine whether the EC is in RO or RW */ rv = VbExEcRunningRW(devidx, &in_rw); @@ -861,7 +863,6 @@ VbError_t VbEcSoftwareSync(int devidx, VbCommonParams *cparams) /* Tell EC to jump to its RW image */ VBDEBUG(("VbEcSoftwareSync() jumping to EC-RW\n")); rv = VbExEcJumpToRW(devidx); - if (rv != VBERROR_SUCCESS) { VBDEBUG(("VbEcSoftwareSync() - " "VbExEcJumpToRW() returned %d\n", rv)); @@ -941,6 +942,13 @@ VbError_t VbSelectAndLoadKernel(VbCommonParams *cparams, retval = VbEcSoftwareSync(0, cparams); if (retval != VBERROR_SUCCESS) goto VbSelectAndLoadKernel_exit; + +#ifdef PD_SYNC + retval = VbEcSoftwareSync(1, cparams); + if (retval != VBERROR_SUCCESS) + goto VbSelectAndLoadKernel_exit; +#endif + } /* Read kernel version from the TPM. Ignore errors in recovery mode. */ |