diff options
author | Anton Staaf <robotboy@chromium.org> | 2014-11-11 07:58:52 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-11 21:46:16 +0000 |
commit | 947ee79ae0cf34ec6271305ae094e3c627456766 (patch) | |
tree | 1b653583d90a4afaaaa2d5f987c31a356aba9839 /chip/stm32/usb-stm32f3.h | |
parent | 74a98425efd53098ed430e6817261cf6386cce3a (diff) | |
download | chrome-ec-947ee79ae0cf34ec6271305ae094e3c627456766.tar.gz |
USB: Add support for board specific connect/disconnect
Previously the usb driver used #ifs to select a mechanism to
enable and disable the DP pullup. This doesn't scale well,
especially when the knowledge of how to do this is not known
to the chip specific code, but instead is board specific (as
it is with the STM32F373).
This change uses the build systems ability to build chip family
specific files per build to select the appropriate behavior.
And on the STM32F3 family of parts it just calls out to a board
specific pair of connect/disconnect functions.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Enable console on ryu_p2 and discovery-stm32f072 board
Verify that it works on both
Change-Id: I976e02fbc7acbb0f85817d7295b26ee9ecab0711
Reviewed-on: https://chromium-review.googlesource.com/229040
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'chip/stm32/usb-stm32f3.h')
-rw-r--r-- | chip/stm32/usb-stm32f3.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chip/stm32/usb-stm32f3.h b/chip/stm32/usb-stm32f3.h new file mode 100644 index 0000000000..cf4590fa11 --- /dev/null +++ b/chip/stm32/usb-stm32f3.h @@ -0,0 +1,17 @@ +/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * STM32F3 Family specific USB functionality + */ + +/* + * A device that uses an STM32F3 part will need to define these two functions + * which are used to connect and disconnect the device from the USB bus. This + * is usually accomplished by enabling a pullup on the DP USB line. The pullup + * should be enabled by default so that the STM32 will enumerate correctly in + * DFU mode (which doesn't know how to enable the DP pullup, so it assumes that + * the pullup is always there). + */ +void usb_board_connect(void); +void usb_board_disconnect(void); |