Hannah Williams (hannah.williams@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17814
-gerrit
commit 8dbc2fde456a4acb2b8f0a39a6a469fa0d903c05 Author: Hannah Williams hannah.williams@intel.com Date: Thu Oct 13 12:48:10 2016 -0700
board/glkrvp: Put all EC functions inside CHROMEEC compile flag GLK RVP1 does not have a EC running ChromeEC
Change-Id: Id58a1be08727a0a2047c7bc97723dc0bc75795c0 Signed-off-by: Hannah Williams hannah.williams@intel.com --- src/mainboard/intel/glkrvp/chromeos.c | 14 +++++++++++--- src/mainboard/intel/glkrvp/ec.c | 11 +++++++---- src/mainboard/intel/glkrvp/smihandler.c | 5 +++-- src/mainboard/intel/glkrvp/variants/baseboard/boardid.c | 5 ++++- 4 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/mainboard/intel/glkrvp/chromeos.c b/src/mainboard/intel/glkrvp/chromeos.c index 58c2cd8..49887ad 100644 --- a/src/mainboard/intel/glkrvp/chromeos.c +++ b/src/mainboard/intel/glkrvp/chromeos.c @@ -38,8 +38,11 @@ void fill_lb_gpios(struct lb_gpios *gpios)
int get_lid_switch(void) { + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) /* Read lid switch state from the EC. */ - return !!(google_chromeec_get_switches() & EC_SWITCH_LID_OPEN); + return !!(google_chromeec_get_switches() & EC_SWITCH_LID_OPEN); + else + return 1; }
int get_developer_mode_switch(void) @@ -50,16 +53,21 @@ int get_developer_mode_switch(void)
int get_recovery_mode_switch(void) { + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) /* Check if the EC has posted the keyboard recovery event. */ - return !!(google_chromeec_get_events_b() & + return !!(google_chromeec_get_events_b() & EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY)); + return 0; }
int clear_recovery_mode_switch(void) { + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) /* Clear keyboard recovery event. */ - return google_chromeec_clear_events_b( + return google_chromeec_clear_events_b( EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY)); + else + return 0; }
int get_write_protect_state(void) diff --git a/src/mainboard/intel/glkrvp/ec.c b/src/mainboard/intel/glkrvp/ec.c index e1832fd..ea93a1a 100644 --- a/src/mainboard/intel/glkrvp/ec.c +++ b/src/mainboard/intel/glkrvp/ec.c @@ -65,8 +65,11 @@ static void bootblock_ec_init(void)
void mainboard_ec_init(void) { - if (ENV_RAMSTAGE) - ramstage_ec_init(); - else if (ENV_BOOTBLOCK) - bootblock_ec_init(); + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) + { + if (ENV_RAMSTAGE) + ramstage_ec_init(); + else if (ENV_BOOTBLOCK) + bootblock_ec_init(); + } } diff --git a/src/mainboard/intel/glkrvp/smihandler.c b/src/mainboard/intel/glkrvp/smihandler.c index fe4f8c4..5a59d46 100644 --- a/src/mainboard/intel/glkrvp/smihandler.c +++ b/src/mainboard/intel/glkrvp/smihandler.c @@ -26,8 +26,9 @@
void mainboard_smi_gpi_handler(const struct gpi_status *sts) { - if (gpi_status_get(sts, EC_SMI_GPI)) - chromeec_smi_process_events(); + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) + if (gpi_status_get(sts, EC_SMI_GPI)) + chromeec_smi_process_events(); }
void mainboard_smi_sleep(u8 slp_typ) diff --git a/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c b/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c index 26f1588..51641e3 100644 --- a/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c +++ b/src/mainboard/intel/glkrvp/variants/baseboard/boardid.c @@ -18,5 +18,8 @@
uint8_t __attribute__((weak)) variant_board_id(void) { - return google_chromeec_get_board_version(); + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) + return google_chromeec_get_board_version(); + else + return 0; }