mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 10:14:55 +00:00
Disable EC jump after RW image starts
TEST=Built and booted Peppy. Ran flashrom from user space and verified the EC firmware was updated after reboot. CQ-DEPEND=CL:172651, CL:172652, CL:178324 BRANCH=none BUG=chromium:325286 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ia73da70dbf3abb5ced48666e86715c8d24a431a0 Reviewed-on: https://chromium-review.googlesource.com/172635 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@google.com> Commit-Queue: Daisuke Nojiri <dnojiri@google.com>
This commit is contained in:
committed by
chrome-internal-fetch
parent
a3d70a3d2b
commit
8912169231
@@ -752,11 +752,10 @@ VbError_t VbExEcRunningRW(int *in_rw);
|
|||||||
VbError_t VbExEcJumpToRW(void);
|
VbError_t VbExEcJumpToRW(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell the EC to stay in RO code until it reboots. Subsequent calls to
|
* Tell the EC to refuse another jump until it reboots. Subsequent calls to
|
||||||
* VbExEcJumpToRW() this boot will fail. Fails if the EC is not currently in
|
* VbExEcJumpToRW() in this boot will fail.
|
||||||
* RO code.
|
|
||||||
*/
|
*/
|
||||||
VbError_t VbExEcStayInRO(void);
|
VbError_t VbExEcDisableJump(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the SHA-256 hash of the rewriteable EC image.
|
* Read the SHA-256 hash of the rewriteable EC image.
|
||||||
|
|||||||
@@ -615,10 +615,10 @@ VbError_t VbEcSoftwareSync(VbCommonParams *cparams)
|
|||||||
if (rv != VBERROR_SUCCESS)
|
if (rv != VBERROR_SUCCESS)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
rv = VbExEcStayInRO();
|
rv = VbExEcDisableJump();
|
||||||
if (rv != VBERROR_SUCCESS) {
|
if (rv != VBERROR_SUCCESS) {
|
||||||
VBDEBUG(("VbEcSoftwareSync() - "
|
VBDEBUG(("VbEcSoftwareSync() - "
|
||||||
"VbExEcStayInRO() returned %d\n", rv));
|
"VbExEcDisableJump() returned %d\n", rv));
|
||||||
VbSetRecoveryRequest(VBNV_RECOVERY_EC_SOFTWARE_SYNC);
|
VbSetRecoveryRequest(VBNV_RECOVERY_EC_SOFTWARE_SYNC);
|
||||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||||
}
|
}
|
||||||
@@ -803,6 +803,15 @@ VbError_t VbEcSoftwareSync(VbCommonParams *cparams)
|
|||||||
VbSetRecoveryRequest(VBNV_RECOVERY_EC_JUMP_RW);
|
VbSetRecoveryRequest(VBNV_RECOVERY_EC_JUMP_RW);
|
||||||
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||||
}
|
}
|
||||||
|
VBDEBUG(("VbEcSoftwareSync() jumped to EC-RW\n"));
|
||||||
|
|
||||||
|
rv = VbExEcDisableJump();
|
||||||
|
if (rv != VBERROR_SUCCESS) {
|
||||||
|
VBDEBUG(("VbEcSoftwareSync() - "
|
||||||
|
"VbExEcDisableJump() returned %d\n", rv));
|
||||||
|
VbSetRecoveryRequest(VBNV_RECOVERY_EC_SOFTWARE_SYNC);
|
||||||
|
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
|
||||||
|
}
|
||||||
|
|
||||||
VBDEBUG(("VbEcSoftwareSync() in RW; done\n"));
|
VBDEBUG(("VbEcSoftwareSync() in RW; done\n"));
|
||||||
return VBERROR_SUCCESS;
|
return VBERROR_SUCCESS;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ VbError_t VbExEcRebootToRO(void)
|
|||||||
return VBERROR_UNKNOWN;
|
return VBERROR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
VbError_t VbExEcStayInRO(void)
|
VbError_t VbExEcDisableJump(void)
|
||||||
{
|
{
|
||||||
return VBERROR_SUCCESS;
|
return VBERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ static void ResetMocks(void)
|
|||||||
trust_ec = 0;
|
trust_ec = 0;
|
||||||
mock_in_rw = 0;
|
mock_in_rw = 0;
|
||||||
ec_protected = 0;
|
ec_protected = 0;
|
||||||
ec_run_image = -1; /* 0 = RO, 1 = RW */
|
ec_run_image = 0; /* 0 = RO, 1 = RW */
|
||||||
ec_updated = 0;
|
ec_updated = 0;
|
||||||
in_rw_retval = VBERROR_SUCCESS;
|
in_rw_retval = VBERROR_SUCCESS;
|
||||||
protect_retval = VBERROR_SUCCESS;
|
protect_retval = VBERROR_SUCCESS;
|
||||||
@@ -129,9 +129,8 @@ VbError_t VbExEcProtectRW(void)
|
|||||||
return protect_retval;
|
return protect_retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
VbError_t VbExEcStayInRO(void)
|
VbError_t VbExEcDisableJump(void)
|
||||||
{
|
{
|
||||||
ec_run_image = 0;
|
|
||||||
return run_retval;
|
return run_retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user