aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/guybrush/chromeos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/guybrush/chromeos.c')
-rw-r--r--src/mainboard/google/guybrush/chromeos.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c
index 3e54fa4964..9875554d64 100644
--- a/src/mainboard/google/guybrush/chromeos.c
+++ b/src/mainboard/google/guybrush/chromeos.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
+#include <boardid.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
@@ -26,3 +27,14 @@ void mainboard_chromeos_acpi_generate(void)
{
chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios));
}
+
+int get_ec_is_trusted(void)
+{
+ /* Board versions 1 & 2 support H1 DB, but the EC_IN_RW signal is not
+ routed. So emulate EC is trusted. */
+ if (CONFIG(BOARD_GOOGLE_GUYBRUSH) &&
+ (board_id() == UNDEFINED_STRAPPING_ID || board_id() < 3))
+ return 1;
+ /* EC is trusted if not in RW. */
+ return !gpio_get(GPIO_EC_IN_RW);
+}