summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-08-31 18:36:17 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-09-11 21:34:19 +0000
commit58c58000843a5c544a0f74abdb51d2985353642f (patch)
treec3f56c9d97fa7c941149545ab99d0100379ac13d /board
parentb31512fe872257a6a34019e9f80d2c0352d3c544 (diff)
downloadchrome-ec-58c58000843a5c544a0f74abdb51d2985353642f.tar.gz
cleanup: Remove jtag_pre_init()
Use our newly-created chip_pre_init() for doing JTAG initialization. Conflicts: chip/npcx/build.mk BUG=chromium:747629 BRANCH=None TEST=`make buildall -j` Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ic5771895a214a9f1aa9bd289eef576f52adf973f Reviewed-on: https://chromium-review.googlesource.com/629676 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit 0898c7a63a4ccb0f11c1c61bb085d8d062f664ab) Reviewed-on: https://chromium-review.googlesource.com/660892 Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/samus/board.c21
-rw-r--r--board/samus/board.h3
2 files changed, 23 insertions, 1 deletions
diff --git a/board/samus/board.c b/board/samus/board.c
index 53c56c9070..20e939bde2 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -26,7 +26,6 @@
#include "hooks.h"
#include "host_command.h"
#include "i2c.h"
-#include "jtag.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
#include "lightbar.h"
@@ -39,6 +38,7 @@
#include "pwm_chip.h"
#include "registers.h"
#include "switch.h"
+#include "system.h"
#include "task.h"
#include "temp_sensor.h"
#include "temp_sensor_chip.h"
@@ -406,3 +406,22 @@ struct motion_sensor_t motion_sensors[] = {
};
const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
+
+#ifdef CONFIG_LOW_POWER_IDLE
+void jtag_interrupt(enum gpio_signal signal)
+{
+ /*
+ * This interrupt is the first sign someone is trying to use
+ * the JTAG. Disable slow speed sleep so that the JTAG action
+ * can take place.
+ */
+ disable_sleep(SLEEP_MASK_JTAG);
+
+ /*
+ * Once we get this interrupt, disable it from occurring again
+ * to avoid repeated interrupts when debugging via JTAG.
+ */
+ gpio_disable_interrupt(GPIO_JTAG_TCK);
+}
+#endif /* CONFIG_LOW_POWER_IDLE */
+
diff --git a/board/samus/board.h b/board/samus/board.h
index 59455e7822..3add1a26f6 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -196,6 +196,9 @@ void board_reset_pd_mcu(void);
/* Backboost detected interrupt */
void bkboost_det_interrupt(enum gpio_signal signal);
+/* Interrupt handler for JTAG clock */
+void jtag_interrupt(enum gpio_signal signal);
+
/* Bit masks for turning on PP5000 rail in G3 */
#define PP5000_IN_G3_AC (1 << 0)
#define PP5000_IN_G3_LIGHTBAR (1 << 1)