summaryrefslogtreecommitdiff
path: root/src/mainboard/google/rambi
diff options
context:
space:
mode:
authorHsuan Ting Chen <roccochen@chromium.org>2021-08-12 15:47:06 +0800
committerJulius Werner <jwerner@chromium.org>2021-09-16 23:44:20 +0000
commit6260bf712a836762b18d80082505e981e040f4bc (patch)
tree70314d8702b2a8d3b293a570634f2bf7f7cb9434 /src/mainboard/google/rambi
parent7a474a5bb73ba66eb32da930315e53d5fd74e207 (diff)
vboot_logic: Set VB2_CONTEXT_EC_TRUSTED in verstage_main
vboot_reference is introducing a new field (ctx) to store the current boot mode in crrev/c/2944250 (ctx->bootmode), which will be leveraged in both vboot flow and elog_add_boot_reason in coreboot. In current steps of deciding bootmode, a function vb2ex_ec_trusted is required. This function checks gpio EC_IN_RW pin and will return 'trusted' only if EC is not in RW. Therefore, we need to implement similar utilities in coreboot. We will deprecate vb2ex_ec_trusted and use the flag, VB2_CONTEXT_EC_TRUSTED, in vboot, vb2api_fw_phase1 and set that flag in coreboot, verstage_main. Also add a help function get_ec_is_trusted which needed to be implemented per mainboard. BUG=b:177196147, b:181931817 BRANCH=none TEST=Test on trogdor if manual recovery works Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I479c8f80e45cc524ba87db4293d19b29bdfa2192 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57048 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rambi')
-rw-r--r--src/mainboard/google/rambi/chromeos.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mainboard/google/rambi/chromeos.c b/src/mainboard/google/rambi/chromeos.c
index f9a171820d..edc714eff5 100644
--- a/src/mainboard/google/rambi/chromeos.c
+++ b/src/mainboard/google/rambi/chromeos.c
@@ -8,6 +8,9 @@
/* The WP status pin lives on GPIO_SSUS_6 which is pad 36 in the SUS well. */
#define WP_STATUS_PAD 36
+/* The EC_IN_RW lives on SCGPIO59 */
+#define EC_IN_RW_PAD 59
+
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio chromeos_gpios[] = {
@@ -43,3 +46,9 @@ void mainboard_chromeos_acpi_generate(void)
{
chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios));
}
+
+int get_ec_is_trusted(void)
+{
+ /* EC is trusted if not in RW. */
+ return !score_get_gpio(EC_IN_RW_PAD);
+}