summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-04-01 16:53:52 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-15 17:58:41 +0000
commita687150a3ac7c62df02e34de17d23566082b8e8a (patch)
tree6830880351e9b53172ea498aaeb8bf690469a58d
parent5f0980d11eab2db0690c05f4d75dd81917fe12aa (diff)
downloadchrome-ec-a687150a3ac7c62df02e34de17d23566082b8e8a.tar.gz
TCPMv2: Generate Hard Reset event
Inform the AP when the PRL completes a Hard Reset. BUG=b:183946291 TEST=Observe event during transition-to-default states TEST=With kernel patch, observe mode reentry after Hard Reset BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I4af576bd3a8fb57d820bd91d74817040214eaa5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799924 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829114
-rw-r--r--common/usbc/usb_prl_sm.c4
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c3
-rw-r--r--include/ec_commands.h1
3 files changed, 8 insertions, 0 deletions
diff --git a/common/usbc/usb_prl_sm.c b/common/usbc/usb_prl_sm.c
index 9fcdfd0a33..7f1f9dd368 100644
--- a/common/usbc/usb_prl_sm.c
+++ b/common/usbc/usb_prl_sm.c
@@ -1327,6 +1327,10 @@ static void prl_hr_reset_layer_entry(const int port)
*/
prl_set_default_pd_revision(port);
+ /* Inform the AP of Hard Reset */
+ if (IS_ENABLED(CONFIG_USB_PD_HOST_CMD))
+ pd_notify_event(port, PD_STATUS_EVENT_HARD_RESET);
+
/*
* Protocol Layer message transmission transitions to
* PRL_Tx_Wait_For_Message_Request state.
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index 65e7b32dc1..46b2e799a6 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -3846,6 +3846,9 @@ static void pd_chipset_reset(void)
for (i = 0; i < board_get_usb_pd_port_count(); i++) {
enum tcpm_transmit_type tx;
+ /* Do not notify the AP of irrelevant past Hard Resets. */
+ pd_clear_events(i, PD_STATUS_EVENT_HARD_RESET);
+
/*
* Re-set events for SOP and SOP' discovery complete so the
* kernel knows to consume discovery information for them.
diff --git a/include/ec_commands.h b/include/ec_commands.h
index a3678f3bc4..4a074fae8e 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -6643,6 +6643,7 @@ enum tcpc_cc_polarity {
#define PD_STATUS_EVENT_SOP_DISC_DONE BIT(0)
#define PD_STATUS_EVENT_SOP_PRIME_DISC_DONE BIT(1)
+#define PD_STATUS_EVENT_HARD_RESET BIT(2)
/*
* Encode and decode for BCD revision response