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