From 4cedfaab42ff020616a0445a96d13295f798d6ad Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Tue, 19 Jul 2016 11:26:59 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/361596 Reviewed-by: Aseda Aboagye --- chip/g/rdd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/chip/g/rdd.c b/chip/g/rdd.c index b2a7c8d9bc..f25405d923 100644 --- a/chip/g/rdd.c +++ b/chip/g/rdd.c @@ -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);