Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
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 --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h 2 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/44188/1
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index e66e3b1..40285dc 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1539,3 +1539,21 @@
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 aead5f7..9d4e588 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -337,6 +337,13 @@ */ 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
Justin TerAvest has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 1: Code-Review+2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 1:
So there will be some instructions continuing to execute after the AP sends the command and before the EC can perform the reset; I think a call to `halt()` is probably a good idea here. I'm just trying to think where the best place for it is... I'm thinking here is probably the better choice, otherwise it needs to be duplicated for other boards that will require this workaround as well.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 1: Code-Review+2
Karthik Ramasubramanian has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 2:
Patch Set 1:
So there will be some instructions continuing to execute after the AP sends the command and before the EC can perform the reset; I think a call to `halt()` is probably a good idea here. I'm just trying to think where the best place for it is... I'm thinking here is probably the better choice, otherwise it needs to be duplicated for other boards that will require this workaround as well.
Should we wait until we some usage elsewhere. In the case here, CSE Lite driver invokes die() after cse_board_reset. die() inturn invokes halt(). So it will be redundant.
Hello build bot (Jenkins), Furquan Shaikh, Justin TerAvest, Tim Wawrzynczak, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/44188
to look at the new patch set (#3).
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
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 --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h 2 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/44188/3
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 4: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 5: Code-Review+2
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 5: Code-Review+2
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
Patch Set 5: Code-Review+2
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44188 )
Change subject: ec/google/chromeec: Add helper to request AP reset ......................................................................
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 --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h 2 files changed, 25 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Justin TerAvest: Looks good to me, approved Nick Vaccaro: Looks good to me, approved Angel Pons: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index e66e3b1..40285dc 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1539,3 +1539,21 @@
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 aead5f7..9d4e588 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -337,6 +337,13 @@ */ 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