summaryrefslogtreecommitdiff
path: root/src/mainboard/google/butterfly
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2021-11-06 18:52:22 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2021-11-12 19:29:23 +0000
commit071d1787fd5d2af3f5e5409836945e9bf2f2acac (patch)
treeb1b7f0c080920942ecd1a22834913cfb6cf1e069 /src/mainboard/google/butterfly
parent4f021e554f961bfdf67b92c8cf0751aae4e3ee84 (diff)
google/butterfly: Refactor get_recovery_mode_switch()
Do not place console output in low-level GPIO functions. The caller of get_recovery_mode_switch() is in vboot_logic.c that is linked in romstage. So presumably recovery mode is broken and is not fixed with this commit either. Change-Id: I2a0fdbb370d54898c72adb29a0e9b990a5fc0ce1 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59003 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/google/butterfly')
-rw-r--r--src/mainboard/google/butterfly/chromeos.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/mainboard/google/butterfly/chromeos.c b/src/mainboard/google/butterfly/chromeos.c
index 2293f93d62..83b6ba04c4 100644
--- a/src/mainboard/google/butterfly/chromeos.c
+++ b/src/mainboard/google/butterfly/chromeos.c
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <console/console.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <device/device.h>
@@ -13,8 +12,6 @@
#include "ec.h"
#include "onboard.h"
-#define FORCE_RECOVERY_MODE 0
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
struct lb_gpio chromeos_gpios[] = {
@@ -42,23 +39,13 @@ int get_lid_switch(void)
return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
}
+/* FIXME: VBOOT reads this in ENV_ROMSTAGE. */
int get_recovery_mode_switch(void)
{
- int ec_rec_mode = 0;
-
- if (FORCE_RECOVERY_MODE) {
- printk(BIOS_DEBUG, "FORCING RECOVERY MODE.\n");
- return 1;
- }
-
- if (ENV_RAMSTAGE) {
- if (ec_mem_read(EC_CODE_STATE) == EC_COS_EC_RO)
- ec_rec_mode = 1;
-
- printk(BIOS_DEBUG, "RECOVERY MODE FROM EC: %x\n", ec_rec_mode);
- }
+ if (ENV_RAMSTAGE)
+ return (ec_mem_read(EC_CODE_STATE) == EC_COS_EC_RO);
- return ec_rec_mode;
+ return 0;
}
static const struct cros_gpio cros_gpios[] = {