summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-04-29 17:00:30 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-05-02 17:35:45 -0700
commit65118b7f7afc361426852f72024cb8d135cec6c2 (patch)
tree3593e942c73326ed993e0dd942e03d488c415f25
parentd37d50832564bb5fb7dc0f79ea1eb0faf160bd9c (diff)
downloadchrome-ec-65118b7f7afc361426852f72024cb8d135cec6c2.tar.gz
g: drop: always start with USB facing external port
We want to be able to communicate with the chip no matter what the hardware conditions are, otherwise it is easy to lose the ability to re-program it from the external connector. With this patch the chip always comes up with the USB interface exposed and will stay in this mode until debug cable is pulled out. After that it will honor subsequent cable plug ins/pull out events as designed. BRANCH=none BUG=chrome-os-partner:52281,chrome-os-partner:50700 TEST=Suzy-q reliably creates serial interfaces when the chip is programmed with the code including this patch. Change-Id: I608fb1912f1b2e88f7a207cbfff145760da1a4e4 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/341580 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--chip/g/rdd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/chip/g/rdd.c b/chip/g/rdd.c
index 129299f91b..f6c11f69d2 100644
--- a/chip/g/rdd.c
+++ b/chip/g/rdd.c
@@ -48,9 +48,14 @@ void rdd_init(void)
debug_detect = GREAD(RDD, PROG_DEBUG_STATE_MAP);
- /* Invoke the interrupt handler manually so that the board-specific
- * callbacks can process the initial state. */
- rdd_interrupt();
+ /*
+ * Unitl the system is robust enough always start with the phy facing
+ * the USB-C connector.
+ */
+ rdd_attached();
+
+ /* Make sure the interrupt fires next time debug cable is connected. */
+ GWRITE(RDD, PROG_DEBUG_STATE_MAP, debug_detect);
/* Enable RDD interrupts */
task_enable_irq(GC_IRQNUM_RDD0_INTR_DEBUG_STATE_DETECTED_INT);