diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2020-08-04 16:50:02 -0600 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2020-08-14 08:35:15 +0000 |
commit | c96d12e5ec9310947a24a3c3a03bccc7b01898c3 (patch) | |
tree | 2b66f9fda4243440ca3b04cdc06671bf393c6eff | |
parent | f9cc6374f218789ae91dfc61f8d4494874908b5e (diff) |
ec/google/chromeec: Add helper to request AP reset
Add a helper function to initiate AP reset through Embedded Controller
(EC).
BUG=b:162290856
TEST=Ensure that the EC resets AP on boards where the command is
supported.
Change-Id: I01d7dfec72a8a3f6d2c4844bc062672e494860d8
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44188
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/ec/google/chromeec/ec.c | 18 | ||||
-rw-r--r-- | src/ec/google/chromeec/ec.h | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index e66e3b16c9..40285dc81d 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1539,3 +1539,21 @@ int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd) return 0; } + +int google_chromeec_ap_reset(void) +{ + struct chromeec_command cmd = { + .cmd_code = EC_CMD_AP_RESET, + .cmd_version = 0, + .cmd_data_in = NULL, + .cmd_size_in = 0, + .cmd_data_out = NULL, + .cmd_size_out = 0, + .cmd_dev_index = 0, + }; + + if (google_chromeec_command(&cmd)) + return -1; + + return 0; +} diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index aead5f7fa8..9d4e58842e 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -337,6 +337,13 @@ int google_chromeec_get_pd_port_caps(int port, */ int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd); +/** + * Send EC command to perform AP reset + * + * @return 0 on success, -1 on error + */ +int google_chromeec_ap_reset(void); + #if CONFIG(HAVE_ACPI_TABLES) /** * Writes USB Type-C PD related information to the SSDT |