aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorIvan De Cesaris <ivan.de.cesaris@intel.com>2016-01-12 16:30:18 +0100
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2016-02-13 22:55:41 +0000
commita4ce9a2c719b1f7536ada1c9fa8f1eb672b04897 (patch)
tree3e57cd84810f6bb309d29202c40a26af67567cb9 /tcl
parent3e07e1cdfac63d5fb93260803d16e79f292dae73 (diff)
downloadriscv-openocd-a4ce9a2c719b1f7536ada1c9fa8f1eb672b04897.zip
riscv-openocd-a4ce9a2c719b1f7536ada1c9fa8f1eb672b04897.tar.gz
riscv-openocd-a4ce9a2c719b1f7536ada1c9fa8f1eb672b04897.tar.bz2
quark: add Intel Quark mcu D2000 support
Add support for the Intel Quark mcu D2000 using the new quark_d2xx target. Changes to the lakemont part are needed for the D2000 core and backwards compatible with the X1000 one. Change-Id: I6e1ef5a5d116344942f08e413965abd3945235fa Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com> Reviewed-on: http://openocd.zylin.com/3199 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'tcl')
-rw-r--r--tcl/board/quark_d2000_refboard.cfg15
-rw-r--r--tcl/target/quark_d20xx.cfg50
2 files changed, 65 insertions, 0 deletions
diff --git a/tcl/board/quark_d2000_refboard.cfg b/tcl/board/quark_d2000_refboard.cfg
new file mode 100644
index 0000000..d1388bb
--- /dev/null
+++ b/tcl/board/quark_d2000_refboard.cfg
@@ -0,0 +1,15 @@
+# Intel Quark microcontroller D2000 Reference Board (web search for doc num 333582)
+
+# the board has an onboard FTDI FT232H chip
+interface ftdi
+ftdi_vid_pid 0x0403 0x6014
+ftdi_channel 0
+
+ftdi_layout_init 0x0000 0x030b
+ftdi_layout_signal nTRST -data 0x0100 -noe 0x0100
+
+source [find target/quark_d20xx.cfg]
+
+adapter_khz 1000
+
+reset_config trst_only
diff --git a/tcl/target/quark_d20xx.cfg b/tcl/target/quark_d20xx.cfg
new file mode 100644
index 0000000..419f9dc
--- /dev/null
+++ b/tcl/target/quark_d20xx.cfg
@@ -0,0 +1,50 @@
+if { [info exists CPUTAPID] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0x38289013
+}
+
+jtag newtap quark_d20xx quark -irlen 8 -irmask 0xff -expected-id $_CPUTAPID -disable
+jtag newtap quark_d20xx cltap -irlen 8 -irmask 0xff -expected-id 0x0e786013 -enable
+
+proc quark_d20xx_tapenable {} {
+ echo "enabling quark core tap"
+ irscan quark_d20xx.cltap 0x11
+ drscan quark_d20xx.cltap 12 1
+ runtest 10
+}
+
+proc quark_d20xx_tapdisable {} {
+ echo "disabling quark core tap"
+ irscan quark_d20xx.cltap 0x11
+ drscan quark_d20xx.cltap 12 0
+ runtest 10
+}
+
+proc quark_d20xx_setup {} {
+ jtag tapenable quark_d20xx.quark
+}
+
+jtag configure quark_d20xx.quark -event tap-enable \
+ "quark_d20xx_tapenable"
+
+jtag configure quark_d20xx.quark -event tap-disable \
+ "quark_d20xx_tapdisable"
+
+target create quark_d20xx.quark quark_d20xx -endian little -chain-position quark_d20xx.quark
+
+quark_d20xx.quark configure -event gdb-attach { halt }
+
+quark_d20xx.quark configure -event reset-start {
+ # need to halt the target to write to memory
+ if {[quark_d20xx.quark curstate] ne "halted"} { halt }
+ # set resetbreak via the core tap
+ irscan quark_d20xx.quark 0x35 ; drscan quark_d20xx.quark 1 0x1
+ # trigger a warm reset
+ mww 0xb0800570 0x2
+ # clear resetbreak
+ irscan quark_d20xx.quark 0x35 ; drscan quark_d20xx.quark 1 0x0
+}
+
+jtag configure quark_d20xx.quark -event setup \
+ "quark_d20xx_setup"