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>
This commit is contained in:
Randall Spangler
2014-07-22 14:42:58 -07:00
committed by chrome-internal-fetch
parent af23ef7ef1
commit 6014c04813
2 changed files with 13 additions and 1 deletions

View File

@@ -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

View File

@@ -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. */