summaryrefslogtreecommitdiff
path: root/include/case_closed_debug.h
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2014-11-10 11:29:32 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-13 03:14:32 +0000
commit8e25d9e1fc4e23c8f379dac8bd9fbdbf09b602c3 (patch)
treead03c355f87bf929186860dc13d217901727a0de /include/case_closed_debug.h
parent079742b1ffb352cb0149d4fea232747e83dd6209 (diff)
downloadchrome-ec-8e25d9e1fc4e23c8f379dac8bd9fbdbf09b602c3.tar.gz
ryu: Add minimal Case Closed Debug support
This provides a framework for additional work. It exposes an API (ccd_set_mode) that can be used by the PD code to enable Case Closed Debug. Enabling CCD will result in the USB 2.0 lines on Ryu (proto 2) to be disconnected from the AP and for the USB peripheral to be enabled and connected to the host. The result is an enumerated device with no interfaces. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Enable CCD ryu_p2 and verify that it is enumerated by the host correctly. This requires a reworked Ryu (proto 2 with pullup). Change-Id: I1fbecdd5f94a61519cfc18c5e087892c6bd77fde Reviewed-on: https://chromium-review.googlesource.com/229139 Reviewed-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'include/case_closed_debug.h')
-rw-r--r--include/case_closed_debug.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/case_closed_debug.h b/include/case_closed_debug.h
new file mode 100644
index 0000000000..1884e545d9
--- /dev/null
+++ b/include/case_closed_debug.h
@@ -0,0 +1,49 @@
+/* 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.
+ *
+ * Case Closed Debug interface
+ */
+#ifndef INCLUDE_CASE_CLOSED_DEBUG_H
+#define INCLUDE_CASE_CLOSED_DEBUG_H
+
+enum ccd_mode {
+ /*
+ * The disabled mode tri-states the DP and DN lines.
+ */
+ CCD_MODE_DISABLED,
+
+ /*
+ * The partial mode allows some CCD functionality and is to be set
+ * when the device is write protected and a CCD cable is detected.
+ * This mode gives access to the APs console.
+ */
+ CCD_MODE_PARTIAL,
+
+ /*
+ * The fully enabled mode is used in factory and test lab
+ * configurations where it is acceptable to be able to reflash the
+ * device over CCD.
+ */
+ CCD_MODE_ENABLED,
+};
+
+/*
+ * Set current CCD mode, this function is idempotent.
+ */
+void ccd_set_mode(enum ccd_mode new_mode);
+
+/*
+ * Board provided function that should ensure that the debug USB port is ready
+ * for use by the case closed debug code. This could mean updating a MUX or
+ * switch to disconnect USB from the AP.
+ */
+void ccd_board_connect(void);
+
+/*
+ * Board provided function that releases the debug USB port, giving it back
+ * to the AP.
+ */
+void ccd_board_disconnect(void);
+
+#endif /* INCLUDE_CASE_CLOSED_DEBUG_H */