From 0325dc6f7cbdad4fd29315bfcb7f4e54fb678f3e Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Mon, 25 Jul 2016 13:02:36 -0700 Subject: bootmode: Get rid of CONFIG_BOOTMODE_STRAPS With VBOOT_VERIFY_FIRMWARE separated from CHROMEOS, move recovery and developer mode check functions to vboot. Thus, get rid of the BOOTMODE_STRAPS option which controlled these functions under src/lib. BUG=chrome-os-partner:55639 Change-Id: Ia2571026ce8976856add01095cc6be415d2be22e Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/15868 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/ec/google/chromeec/ec.c | 33 ++++++++++++--------------------- src/ec/google/chromeec/ec.h | 1 - 2 files changed, 12 insertions(+), 22 deletions(-) (limited to 'src/ec') diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 1a381d716e..c8b6e7e10a 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include "chip.h" #include "ec.h" @@ -198,18 +198,18 @@ void google_chromeec_check_ec_image(int expected_type) } } -/* Check for recovery mode and ensure EC is in RO */ +/* Check for recovery mode and ensure PD/EC is in RO */ void google_chromeec_early_init(void) { - if (IS_ENABLED(CONFIG_CHROMEOS)) { - /* Check USB PD chip state first */ - if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_PD)) - google_chromeec_early_pd_init(); - - /* If in recovery ensure EC is running RO firmware. */ - if (recovery_mode_enabled()) - google_chromeec_check_ec_image(EC_IMAGE_RO); - } + if (!IS_ENABLED(CONFIG_CHROMEOS) || !vboot_recovery_mode_enabled()) + return; + + /* Check USB PD chip state first */ + if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC_PD)) + google_chromeec_check_pd_image(EC_IMAGE_RO); + + /* If in recovery ensure EC is running RO firmware. */ + google_chromeec_check_ec_image(EC_IMAGE_RO); } void google_chromeec_check_pd_image(int expected_type) @@ -241,15 +241,6 @@ void google_chromeec_check_pd_image(int expected_type) udelay(1000); } } - -/* Check for recovery mode and ensure PD is in RO */ -void google_chromeec_early_pd_init(void) -{ - /* If in recovery ensure PD is running RO firmware. */ - if (recovery_mode_enabled()) { - google_chromeec_check_pd_image(EC_IMAGE_RO); - } -} #endif u16 google_chromeec_get_board_version(void) @@ -521,7 +512,7 @@ void google_chromeec_init(void) } if (cec_cmd.cmd_code || - (recovery_mode_enabled() && + (vboot_recovery_mode_enabled() && (cec_resp.current_image != EC_IMAGE_RO))) { struct ec_params_reboot_ec reboot_ec; /* Reboot the EC and make it come back in RO mode */ diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index d3e6d78e4d..f765fe46ba 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -36,7 +36,6 @@ void google_chromeec_init(void); /* If recovery mode is enabled and EC is not running RO firmware reboot. */ void google_chromeec_early_init(void); -void google_chromeec_early_pd_init(void); /* Reboot if EC firmware is not expected type. */ void google_chromeec_check_ec_image(int expected_type); void google_chromeec_check_pd_image(int expected_type); -- cgit v1.2.3