diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2015-01-07 11:36:03 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-08 23:55:53 +0000 |
commit | 49bfe43b905c1ca80d42b18dbed43d0a6270a012 (patch) | |
tree | a059ab0088cf00b2b8061d6aac1b0e553f6070ae | |
parent | 61d50195e1fb568327d2cdce5b5a5095f1be6e05 (diff) | |
download | chrome-ec-49bfe43b905c1ca80d42b18dbed43d0a6270a012.tar.gz |
usb: fix sysjump
Ensure that we can re-etablish a proper USB communication after a
sysjump by properly disabling the USB stack before jumping.
So the host sees a USB disconnection and can properly re-initialize the
device when it re-appears.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=samus
BUG=none
TEST=On Twinkie, use the "sysjump RW" command on the USB console
and see the prompt coming back after a few seconds.
Change-Id: Iaf4498333eb4e7a1dda0f51ee8be19a0c9f10349
Reviewed-on: https://chromium-review.googlesource.com/239227
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | chip/stm32/usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c index af9082299e..631dc8a19d 100644 --- a/chip/stm32/usb.c +++ b/chip/stm32/usb.c @@ -336,6 +336,8 @@ void usb_release(void) /* disable USB device clock */ STM32_RCC_APB1ENR &= ~STM32_RCC_PB1_USB; } +/* ensure the host disconnects and reconnects over a sysjump */ +DECLARE_HOOK(HOOK_SYSJUMP, usb_release, HOOK_PRIO_DEFAULT); int usb_is_enabled(void) { |