summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorYu-Ping Wu <yupingso@chromium.org>2022-06-28 17:29:20 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-06-30 14:05:45 +0000
commitc7730dd9b66e8909de8f4c2a51247894559ab997 (patch)
tree10e917a64340151f1c26484611141e5459ab5e90 /src/mainboard/google
parent3fa36f63ae4ea6c55b67510ff1b16606f704e314 (diff)
mb/google/corsola: Decide EC-is-trusted logic by board rev
Kingler and Krabby's rev 0 boards both have Cr50 instead of Ti50. In order to support them with the new firmware where TPM_GOOGLE_TI50 is selected, use the board rev to determine the EC-is-trusted logic. BUG=b:237355198 TEST=emerge-corsola coreboot BRANCH=none Change-Id: I7797eafaa7a35355d241c4ea425a4716a35a7817 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65472 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/corsola/chromeos.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mainboard/google/corsola/chromeos.c b/src/mainboard/google/corsola/chromeos.c
index 7d36a170fd..9717f9c2e1 100644
--- a/src/mainboard/google/corsola/chromeos.c
+++ b/src/mainboard/google/corsola/chromeos.c
@@ -2,8 +2,10 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
+#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <security/tpm/tis.h>
+#include <stdbool.h>
#include "gpio.h"
@@ -45,8 +47,21 @@ void fill_lb_gpios(struct lb_gpios *gpios)
int get_ec_is_trusted(void)
{
+ uint32_t rev;
+ bool has_cr50 = false;
+
+ /*
+ * Kingler and Krabby's rev 0 boards both use Cr50 instead of Ti50. In order to share
+ * the same firmware with newer rev, get the board rev from CBI, and ignore
+ * TPM_GOOGLE_TI50 when rev is 0.
+ */
+ if (CONFIG(BOARD_GOOGLE_KINGLER) || CONFIG(BOARD_GOOGLE_KRABBY)) {
+ if (google_chromeec_cbi_get_board_version(&rev) == 0 && rev == 0)
+ has_cr50 = true;
+ }
+
/* With Ti50, VB2_CONTEXT_EC_TRUSTED should be set according to the boot mode. */
- if (CONFIG(TPM_GOOGLE_TI50))
+ if (CONFIG(TPM_GOOGLE_TI50) && !has_cr50)
return 0;
/* EC is trusted if not in RW. This is active low. */