summaryrefslogtreecommitdiffstats
path: root/arch/metag/kernel/da.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2012-09-21 17:38:15 +0100
committerJames Hogan <james.hogan@imgtec.com>2013-03-02 20:09:56 +0000
commitae85ac71b7433fa974759109c4380c620258f07f (patch)
tree066915c6c1f0f830c35ff12f4a84e233b6fd15da /arch/metag/kernel/da.c
parent690998b629a554d8004d3129a42176afafce9fae (diff)
downloadop-kernel-dev-ae85ac71b7433fa974759109c4380c620258f07f.zip
op-kernel-dev-ae85ac71b7433fa974759109c4380c620258f07f.tar.gz
metag: Add JTAG Debug Adapter (DA) support
Add basic JTAG Debug Adapter (DA) support so that drivers which communicate with the DA can detect whether one is actually present (otherwise the target will halt indefinitely). This allows the metag_da TTY driver and imgdafs filesystem driver to be built, updates defconfigs, and sets up the metag_da console early if it's configured in. Signed-off-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch/metag/kernel/da.c')
-rw-r--r--arch/metag/kernel/da.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/metag/kernel/da.c b/arch/metag/kernel/da.c
new file mode 100644
index 0000000..52aabb6
--- /dev/null
+++ b/arch/metag/kernel/da.c
@@ -0,0 +1,23 @@
+/*
+ * Meta DA JTAG debugger control.
+ *
+ * Copyright 2012 Imagination Technologies Ltd.
+ */
+
+
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <asm/da.h>
+#include <asm/metag_mem.h>
+
+bool _metag_da_present;
+
+int __init metag_da_probe(void)
+{
+ _metag_da_present = (metag_in32(T0VECINT_BHALT) == 1);
+ if (_metag_da_present)
+ pr_info("DA present\n");
+ else
+ pr_info("DA not present\n");
+ return 0;
+}
OpenPOWER on IntegriCloud