summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-07-24 16:56:25 -0700
committerGerrit <chrome-bot@google.com>2012-07-24 18:55:36 -0700
commit1a72ad60d7237a778a4e9b3e075cdc3451895c9f (patch)
treef65eee07823ad496fbbba1d87d2e5bc05716c170
parent262cef37e66c1a2f9a38cd8f2b35a7ba1ea50aa1 (diff)
downloadvboot-1a72ad60d7237a778a4e9b3e075cdc3451895c9f.tar.gz
Call VbExEcGetExpectedRW() with the correct parameters.
vboot is passing in an index but the function expects an enum. BUG=chrome-os-partner:11765 TEST=manual Build with serial enabled, watch what happens. Before, it does this: ec.c: VbExEcGetExpectedRW: Unrecognized EC firmware requested. VbEcSoftwareSync() - VbExEcGetExpectedRW() returned 65536 VbSetRecoveryRequest(34) After this change, it should get a little further: ec.c: VbExEcGetExpectedRW: EC-RW image offset 0 size 0. ec.c: VbExEcGetExpectedRW: EC image has bogus size. VbEcSoftwareSync() - VbExEcGetExpectedRW() returned 65536 VbSetRecoveryRequest(34) Sigh. Change-Id: Ideb5f9d70bc5f3f202a8e04a6ec718e1d674d526 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28341 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/lib/vboot_api_kernel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 1a99ecbe..359c6366 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -422,8 +422,12 @@ VbError_t VbEcSoftwareSync(VbSharedDataHeader *shared) {
}
VBDEBUG(("VbEcSoftwareSync() - hash len = %d\n", ec_hash_size));
- /* Get expected EC-RW code */
- rv = VbExEcGetExpectedRW(shared->firmware_index, &expected, &expected_size);
+ /* Get expected EC-RW code. Note that we've already checked for RO_NORMAL,
+ * so we know that the BIOS must be RW-A or RW-B, and therefore the EC must
+ * match. */
+ rv = VbExEcGetExpectedRW(
+ shared->firmware_index ? VB_SELECT_FIRMWARE_B : VB_SELECT_FIRMWARE_A,
+ &expected, &expected_size);
if (rv) {
VBDEBUG(("VbEcSoftwareSync() - VbExEcGetExpectedRW() returned %d\n", rv));
VbSetRecoveryRequest(VBNV_RECOVERY_EC_SOFTWARE_SYNC);