summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-08-12 14:12:45 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-14 09:09:11 +0000
commit116080b151b11e05cdd7f37027e61571268dbb2f (patch)
tree8ed3f29cf225a9ab61a0f8ef940f88974f830ae4 /common/system.c
parentaa3ca9bc536880a17963bbccba1ecf8489e7203b (diff)
downloadchrome-ec-116080b151b11e05cdd7f37027e61571268dbb2f.tar.gz
pd: issue PD soft reset on sysjump
On sysjump, we are losing all of our PD states. Instead of trying to remember all the states and deal with on-going transmission, let's just issue a soft reset so that the communication starts over. BUG=chrome-os-partner:31207 TEST=With Ryu/Zinger, do 'sysjump rw' and check EC doesn't reboot. BRANCH=None Change-Id: I8779b74491a402434931b3455fa93ff2e178cb1f Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212123 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index 2bbf572f8e..db5d171b58 100644
--- a/common/system.c
+++ b/common/system.c
@@ -20,6 +20,7 @@
#include "task.h"
#include "timer.h"
#include "uart.h"
+#include "usb_pd.h"
#include "util.h"
#include "version.h"
@@ -399,6 +400,17 @@ static void jump_to_image(uintptr_t init_addr)
usleep(MSEC);
gpio_set_level(GPIO_ENTERING_RW, 0);
+#ifdef CONFIG_USB_POWER_DELIVERY
+ /*
+ * On sysjump, we are most definitely going to drop pings (if any)
+ * and lose all of our PD state. Instead of trying to remember all
+ * the states and deal with on-going transmission, let's send soft
+ * reset here so that the communication starts over without dropping
+ * power.
+ */
+ pd_soft_reset();
+#endif
+
/* Flush UART output unless the UART hasn't been initialized yet */
if (uart_init_done())
uart_flush_output();