summaryrefslogtreecommitdiff
path: root/board/twinkie
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-10-22 13:10:37 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-29 18:37:42 +0000
commitca74d14ea9c9aa4b6fe95998350856c096beec43 (patch)
tree16eb124c364b8f72aed2fe6202520f70b7cc02c5 /board/twinkie
parenta25b9fa1ab68d7b37dd5bd5ed727607e3315f4a0 (diff)
downloadchrome-ec-ca74d14ea9c9aa4b6fe95998350856c096beec43.tar.gz
USB-console: Reclaim two bulk endpoints
Previously the USB console code used two separate bidirectional endpoints. Using the STM32 USB perihperals endpoints in this manner means that there are only 8 total endpoints available. But the STM32 USB peripheral allows for a single endpoint number to be used for both IN and OUT transactions, and while this (re-using an endpoint number for both IN and OUT endpoints) appears to be not compliant with the letter of the law with respect to the USB spec, it is supported by USB stacks, and is used in a number of USB devices. So this change makes the USB console driver share a single endpoint number between the IN and OUT bulk endpoints used to implement the console. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Enable USB console on discovery board and manually test. Change-Id: I511e56de2162a6c04ddba80d26b37b4f0cd993fd Reviewed-on: https://chromium-review.googlesource.com/225868 Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'board/twinkie')
-rw-r--r--board/twinkie/board.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/board/twinkie/board.h b/board/twinkie/board.h
index 1c257dae9d..df1ca2ec7f 100644
--- a/board/twinkie/board.h
+++ b/board/twinkie/board.h
@@ -87,13 +87,20 @@ enum usb_strings {
/* USB endpoint indexes (use define rather than enum to expand them) */
#define USB_EP_CONTROL 0
-#define USB_EP_CON_TX 1
-#define USB_EP_CON_RX 2
+#define USB_EP_CONSOLE 1
+
+/*
+ * Endpoint 2 is missing because the console used to use two bidirectional
+ * endpoints. It now uses a single bidirectional endpoint relying on the
+ * direction bit as an additional bit identifying the endpoint used. It is
+ * safe to reallocate endpoint 2 in the future.
+ */
+
#ifdef HAS_TASK_SNIFFER
#define USB_EP_SNIFFER 3
#define USB_EP_COUNT 4
#else
-#define USB_EP_COUNT 3
+#define USB_EP_COUNT 2
#endif
#endif /* __BOARD_H */