cros_ec: Use boot mode to check if EC can be trusted

Currently, EC_IN_RW signal is used for the AP to decide whether EC is
running an RO copy or not.

coreboot will set VB2_CONTEXT_EC_TRUSTED based on the EC's boot mode
if supported. It means the EC is in RO and PD is disabled. This patch
makes vb2_allow_recovery check VB2_CONTEXT_EC_TRUSTED prior to
entering recovery mode.

BUG=b:180927027, b:187871195

Signed-off-by: Daisuke Nojiri <>
Change-Id: Ie7fb337085f9c5f73ee82049d490a719f76a26bb
Reviewed-by: Furquan Shaikh <>
Reviewed-by: Julius Werner <>
2 files changed