Subrata Banik has submitted this change. ( https://review.coreboot.org/c/coreboot/+/86337?usp=email )
(
5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ec/google/chromeec: Implement early power off ......................................................................
ec/google/chromeec: Implement early power off
This commit implements the `google_chromeec_do_early_poweroff` function for the Chrome EC. This allows the system to power off before memory initialization by triggering an EC reset with EC_REBOOT_COLD_AP_OFF.
BUG=b:339673254 TEST=Able to build and boot google/brox.
Change-Id: Ia53469feb2a020b38a5414728159b09c86c7e32d Signed-off-by: Subrata Banik subratabanik@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/86337 Reviewed-by: Karthik Ramasubramanian kramasub@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Caveh Jalali caveh@chromium.org --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h 2 files changed, 15 insertions(+), 0 deletions(-)
Approvals: Karthik Ramasubramanian: Looks good to me, approved build bot (Jenkins): Verified Caveh Jalali: Looks good to me, but someone else must approve
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 2e8961f..cc581ff 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -8,6 +8,7 @@ #include <device/device.h> #include <device/path.h> #include <elog.h> +#include <halt.h> #include <rtc.h> #include <security/vboot/vboot_common.h> #include <stdlib.h> @@ -1669,3 +1670,9 @@
return false; } + +void google_chromeec_do_early_poweroff(void) +{ + google_chromeec_reboot(EC_REBOOT_COLD_AP_OFF, 0); + halt(); +} diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index b11b7a8..08d4f27 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -471,6 +471,14 @@ */ bool google_chromeec_is_battery_present(void);
+/* + * Performs early power off. + * + * This function handles the necessary steps to initiate an early power off + * sequence. + */ +void google_chromeec_do_early_poweroff(void); + /** * Determine if the UCSI stack is currently active. *