diff options
author | Vic Yang <victoryang@chromium.org> | 2014-08-12 14:12:45 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-14 09:09:11 +0000 |
commit | 116080b151b11e05cdd7f37027e61571268dbb2f (patch) | |
tree | 8ed3f29cf225a9ab61a0f8ef940f88974f830ae4 /common/system.c | |
parent | aa3ca9bc536880a17963bbccba1ecf8489e7203b (diff) | |
download | chrome-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.c | 12 |
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(); |