2lib: Use ctx flag VB2_CONTEXT_EC_TRUSTED instead of vb2ex_ec_trusted
2lib: Use ctx flag VB2_CONTEXT_EC_TRUSTED instead of vb2ex_ec_trusted

In vb2api_allow_recovery(), we need to check if EC is trusted for
booting into manual recovery mode. This was implemented by a function
vb2ex_ec_trusted() which defined in vboot_reference and implemented in
depthcharge by reading the corresponding EC_IN_RW GPIO flags.

By introducing new boot mode architecture, coreboot will now calling
these functions to determine the current boot mode and support the
similar functionalities about checking if EC is trusted (i.e. EC is not
in RW).

We leverages the existing ctx flag VB2_CONTEXT_EC_TRUSTED for fulfilling
this. This flag will be set at coreboot vboot_logic.c:verstage_main()
and can be used deciding the boot mode in vboot_reference:
vb2api_fw_phase1() and is cleared while EC jumps to RW (i.e.
2ec_sync.c:sync_ec()).

BRANCH=none
BUG=b:181931817
TEST=emerge-trogdor coreboot vboot_reference depthcharge

Cq-Depend: chromium:3088889
Signed-off-by: Hsuan Ting Chen <ac2917b87838b7bb62e5c0056c190a1955e52056@chromium.org>
Change-Id: I50f35f48ce75e421094ea21e45c24b82e6e55a6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3106329
Reviewed-by: Julius Werner <4d12f06cff3725783b352157673a720bc67c4afe@chromium.org>
Reviewed-by: Yu-Ping Wu <e17b963d2ce5bddd1fecae25c320252b132e804d@chromium.org>

coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot