SANTHOSH JANARDHANA HASSAN has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31426
Change subject: google/mistrtal: Add board ID API.
......................................................................
google/mistrtal: Add board ID API.
BUG=None
TEST=Verified GPIO assignment and board ID values.
BRANCH=None
Change-Id: Ic81b41f799c7bfc47a0daee705db1c01cd0af1a3
Signed-off-by: Santhosh Hassan <sahassan(a)google.com>
---
M src/mainboard/google/mistral/Makefile.inc
A src/mainboard/google/mistral/boardid.c
2 files changed, 49 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/31426/1
diff --git a/src/mainboard/google/mistral/Makefile.inc b/src/mainboard/google/mistral/Makefile.inc
index e9013af..ae418f2 100644
--- a/src/mainboard/google/mistral/Makefile.inc
+++ b/src/mainboard/google/mistral/Makefile.inc
@@ -3,6 +3,7 @@
bootblock-y += chromeos.c
bootblock-y += bootblock.c
+verstage-y += boardid.c
verstage-y += memlayout.ld
verstage-y += chromeos.c
verstage-y += verstage.c
@@ -10,7 +11,9 @@
romstage-y += memlayout.ld
romstage-y += chromeos.c
romstage-y += romstage.c
+romstage-y += boardid.c
+ramstage-y += boardid.c
ramstage-y += memlayout.ld
ramstage-y += chromeos.c
ramstage-y += mainboard.c
diff --git a/src/mainboard/google/mistral/boardid.c b/src/mainboard/google/mistral/boardid.c
new file mode 100644
index 0000000..f20960c
--- /dev/null
+++ b/src/mainboard/google/mistral/boardid.c
@@ -0,0 +1,46 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 Google LLC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <boardid.h>
+#include <gpio.h>
+#include <console/console.h>
+#include <stdlib.h>
+
+/*
+ * Mistral boards dedicate to the board ID three GPIOs in ternary mode: 105, 106
+ * and 107.
+ */
+
+static uint32_t board_id_val = UNDEFINED_STRAPPING_ID;
+
+static uint32_t get_board_id(void)
+{
+ uint32_t bid;
+ const gpio_t pins[] = {[2] = GPIO(107), [1] = GPIO(106), [0] = GPIO(105)};
+
+ bid = gpio_binary_first_base3_value(pins, ARRAY_SIZE(pins));
+ printk(BIOS_INFO, "Board ID %d\n", bid);
+
+ return bid;
+}
+
+uint32_t board_id(void)
+{
+ if (board_id_val == UNDEFINED_STRAPPING_ID)
+ board_id_val = get_board_id();
+
+ return board_id_val;
+}
+
--
To view, visit https://review.coreboot.org/c/coreboot/+/31426
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic81b41f799c7bfc47a0daee705db1c01cd0af1a3
Gerrit-Change-Number: 31426
Gerrit-PatchSet: 1
Gerrit-Owner: SANTHOSH JANARDHANA HASSAN <sahassan(a)google.com>
Gerrit-MessageType: newchange
Hello SANTHOSH JANARDHANA HASSAN,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/32272
to review the following change.
Change subject: mb/google/mistral: Ignore REC switch if TPM isn't ready
......................................................................
mb/google/mistral: Ignore REC switch if TPM isn't ready
The recovery button's state is cached in the TPM, but on first boot Cr50
isn't ready yet for this task, which leads to a reboot further down the
road (to get TPM up).
To not confuse matters further, only act on the recovery button if the
TPM is in fact able to cache the state.
BUG=b:129878075
BRANCH=none
TEST=recovery button is only read on second boot
Change-Id: I1ad2c148be4cbdbb2afa05c46c483d89855e1959
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M src/mainboard/google/mistral/chromeos.c
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/32272/1
diff --git a/src/mainboard/google/mistral/chromeos.c b/src/mainboard/google/mistral/chromeos.c
index 9b69a4f..e0306b16 100644
--- a/src/mainboard/google/mistral/chromeos.c
+++ b/src/mainboard/google/mistral/chromeos.c
@@ -72,6 +72,9 @@
gpio_t rec_sw;
static enum switch_state saved_state = not_probed;
+ if (is_tpm_detected() == 0)
+ return saved_state;
+
if (saved_state != not_probed)
return saved_state;
--
To view, visit https://review.coreboot.org/c/coreboot/+/32272
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1ad2c148be4cbdbb2afa05c46c483d89855e1959
Gerrit-Change-Number: 32272
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: SANTHOSH JANARDHANA HASSAN <sahassan(a)google.com>
Gerrit-MessageType: newchange
Yuji Sasaki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32904
Change subject: TEMP: NOT FOR REVIEW: google/mistral: Limit FDR detection for verstage
......................................................................
TEMP: NOT FOR REVIEW: google/mistral: Limit FDR detection for verstage
FDR switch detection and LED state change must only be functional
when called in verstage. get_recovery_mode_switch() is called from
ramstage as part of elog function but this is informational
purpose, should not affecting LED state and boot mode.
This CL is adding #if directives to limit FDR detection for
verstage. When get_recovery_mode_switch() is called from other
stages, it just return current FDR switch state but do not change
LED state or boot mode.
BUG=b:131622855
TEST=Build and run on DUT, keep pushing FDR switch and power on,
verify it do not fall into secondary FDR detection loop in ramstage
after "recovery requested" in verstage.
Signed-off-by: Yuji Sasaki <sasakiy(a)chromium.org>
Change-Id: Ib034acca2bcf39728e58b468e69e74620b086a10
---
M src/mainboard/google/mistral/chromeos.c
1 file changed, 19 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/32904/1
diff --git a/src/mainboard/google/mistral/chromeos.c b/src/mainboard/google/mistral/chromeos.c
index f220151..8873edd 100644
--- a/src/mainboard/google/mistral/chromeos.c
+++ b/src/mainboard/google/mistral/chromeos.c
@@ -67,6 +67,11 @@
wipeout_req
};
+/*
+ * FDR switch detection and LED state change is only functional
+ * when called in verstage.
+ */
+#if defined(__VERSTAGE__)
static void display_pattern(int pattern)
{
led_lp5562_display_pattern(BLSP_QUP_ID_1, pattern);
@@ -130,6 +135,20 @@
return saved_state;
}
+/*
+ * get_recovery_mode_switch is called from ramstage as part of
+ * elog function, but this is informational purpose to show current
+ * FDR switch state, should not affecting LED and boot mode.
+ */
+#else // defined(__VERSTAGE)
+static enum switch_state get_rec_sw_state(void)
+{
+ gpio_t rec_sw = GPIO_REC_STATE;
+ int sampled_value = !gpio_get(rec_sw);
+ return sampled_value ? recovery_req : no_req;
+}
+#endif // defined(__VERSTAGE)
+
int get_recovery_mode_switch(void)
{
return get_rec_sw_state() == recovery_req;
--
To view, visit https://review.coreboot.org/c/coreboot/+/32904
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib034acca2bcf39728e58b468e69e74620b086a10
Gerrit-Change-Number: 32904
Gerrit-PatchSet: 1
Gerrit-Owner: Yuji Sasaki <sasakiy(a)chromium.org>
Gerrit-MessageType: newchange