g: initialize rdd based on current cc readings

Call rdd_attach or detach based on the current CC state and initialize
the debug map to the proper state.

BUG=none
BRANCH=none
TEST=reboot cr50 with suzyq plugged in and check ccd is initialized.
reboot cr50 with suzyq disconnected and verify ccd is disabled.

Change-Id: I61eb9f357ee4309030b06225502add4f5e43ac31
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/361596
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
This commit is contained in:
Mary Ruthven
2016-07-19 11:26:59 -07:00
committed by chrome-bot
parent 858cba298c
commit 4cedfaab42

View File

@@ -53,11 +53,8 @@ void rdd_init(void)
debug_detect = GREAD(RDD, PROG_DEBUG_STATE_MAP);
/* Initialize the detached debug state */
rdd_detached();
/* Make sure the interrupt fires next time debug cable is connected. */
GWRITE(RDD, PROG_DEBUG_STATE_MAP, debug_detect);
/* Initialize the debug state based on the current cc values */
rdd_interrupt();
/* Enable RDD interrupts */
task_enable_irq(GC_IRQNUM_RDD0_INTR_DEBUG_STATE_DETECTED_INT);