google/stout: Fix build without ChromeOS
Currently we have no developer or recovery mode switches when
building without ChromeOS.
Change-Id: I49adfcd8408838cf581430970be5efcef11ba06b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5596
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
diff --git a/src/mainboard/google/stout/chromeos.c b/src/mainboard/google/stout/chromeos.c
index 7a861ec..0e43250 100644
--- a/src/mainboard/google/stout/chromeos.c
+++ b/src/mainboard/google/stout/chromeos.c
@@ -35,9 +35,6 @@
#define ACTIVE_LOW 0
#define ACTIVE_HIGH 1
-static int ec_in_rec_mode;
-static int ec_rec_flag_good;
-
void fill_lb_gpios(struct lb_gpios *gpios)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
@@ -115,6 +112,8 @@
#ifdef __PRE_RAM__
device_t dev = PCI_DEV(0, 0x1f, 0);
#else
+ static int ec_in_rec_mode = 0;
+ static int ec_rec_flag_good = 0;
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
#endif
diff --git a/src/mainboard/google/stout/ec.c b/src/mainboard/google/stout/ec.c
index 474d96f..69b5bef 100644
--- a/src/mainboard/google/stout/ec.c
+++ b/src/mainboard/google/stout/ec.c
@@ -19,7 +19,7 @@
#include <arch/acpi.h>
#include <arch/io.h>
-#include <vendorcode/google/chromeos/chromeos.h>
+#include <bootmode.h>
#include <types.h>
#include <console/console.h>
#include <ec/quanta/it8518/ec.h>
@@ -43,7 +43,8 @@
/*
* Important: get_recovery_mode_switch() must be called in EC init.
*/
- get_recovery_mode_switch();
+ if (IS_ENABLED(CONFIG_BOOTMODE_STRAPS))
+ get_recovery_mode_switch();
/* Unmute */
ec_kbc_write_cmd(EC_KBD_CMD_UNMUTE);
diff --git a/src/mainboard/google/stout/romstage.c b/src/mainboard/google/stout/romstage.c
index 0ea53e7..f53c07d 100644
--- a/src/mainboard/google/stout/romstage.c
+++ b/src/mainboard/google/stout/romstage.c
@@ -38,6 +38,7 @@
#include <cpu/x86/bist.h>
#include <cpu/x86/msr.h>
#include "gpio.h"
+#include <bootmode.h>
#if CONFIG_CHROMEOS
#include <vendorcode/google/chromeos/chromeos.h>
#endif
@@ -131,7 +132,8 @@
static void early_ec_init(void)
{
u8 ec_status = ec_read(EC_STATUS_REG);
- int rec_mode = get_recovery_mode_switch();
+ int rec_mode = IS_ENABLED(CONFIG_BOOTMODE_STRAPS) &&
+ get_recovery_mode_switch();
if (((ec_status & 0x3) == EC_IN_RO_MODE) ||
((ec_status & 0x3) == EC_IN_RECOVERY_MODE)) {