summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-07-22 14:42:58 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-06 01:14:05 +0000
commitd6e1bbd37c8c1387ef64a199a5dc6e5463add4ad (patch)
tree35bcae847010edd5ec761e556df663f2b0d3a517
parent28e3412c36e67ddac947dd001125ef8a38f9bc21 (diff)
downloadvboot-d6e1bbd37c8c1387ef64a199a5dc6e5463add4ad.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> Reviewed-on: https://chromium-review.googlesource.com/227841 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--Makefile4
-rw-r--r--firmware/lib/vboot_api_kernel.c10
2 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4a481036..fffcfb7b 100644
--- a/Makefile
+++ b/Makefile
@@ -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. */