comparison calypso-jtag/ft2232d-unbuf-poc.cfg @ 62:240221552ecf

calypso-jtag: files reshuffled for release
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Jun 2019 03:12:30 +0000
parents calypso-jtag/brute.cfg@3940292ad76f
children
comparison
equal deleted inserted replaced
61:3940292ad76f 62:240221552ecf
1 # The Calypso target is connected to an unbuffered FT2232D adapter
2 # acting as the JTAG interface following Mother Mychaela's method,
3 # ADBUS7 is wired to the reset pin on TI's 14-pin connector.
4 #
5 # This OpenOCD config is a proof of concept, demonstrating our ability
6 # to (1) halt an already-running Calypso through the scan chain without
7 # doing a reset, (2) perform a reset (Iota nTESTRESET) without a halt,
8 # i.e., reset and let run, and (3) perform a reset with a built-in halt,
9 # halting the Calypso at the reset vector before it executes even one
10 # instruction, with all hardware in its pristine state directly out of
11 # superdeep reset. This proof of concept is done in a "brute force" way,
12 # bypassing most of OpenOCD's infrastructure and using our own ad hoc
13 # Tcl procedures instead.
14
15 interface ftdi
16 ftdi_vid_pid 0x0403 0x7151
17
18 ftdi_layout_init 0x0088 0x008b
19 ftdi_layout_signal XDS_RESET -data 0x0080 -oe 0x0080
20
21 transport select jtag
22 adapter_khz 6000
23
24 # Reset like the one produced by TI's original XDS510/560 adapters
25 proc xds_reset {} {
26 ftdi_set_signal XDS_RESET 0
27 sleep 50
28 ftdi_set_signal XDS_RESET 1
29 sleep 10
30 }
31
32 if { [info exists CHIPNAME] } {
33 set _CHIPNAME $CHIPNAME
34 } else {
35 set _CHIPNAME calypso
36 }
37
38 if { [info exists CPUTAPID] } {
39 set _CPUTAPID $CPUTAPID
40 } else {
41 set _CPUTAPID 0x3100e02f
42 }
43
44 jtag newtap $_CHIPNAME dsp -irlen 8
45 jtag newtap $_CHIPNAME arm -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
46
47 set _TARGETNAME $_CHIPNAME.arm
48 target create $_TARGETNAME arm7tdmi -endian little -chain-position $_TARGETNAME
49
50 arm7_9 dbgrq enable
51
52 proc calypso_magic {} {
53 irscan calypso.arm 0x0b -endstate DRPAUSE
54 drscan calypso.arm 2 2 -endstate RUN/IDLE
55 }
56
57 proc enable_halt {} {
58 poll off
59 calypso_magic
60 poll on
61 }
62
63 # watchdog disable with minimal finger strokes to make it in time
64 proc wd {} {
65 calypso.arm mwh 0xFFFFF804 0xF5
66 calypso.arm mwh 0xFFFFF804 0xA0
67 }
68
69 proc reset_run {} {
70 poll off
71 xds_reset
72 jtag arp_init
73 calypso.arm arp_examine
74 poll on
75 }
76
77 proc reset_halt {} {
78 poll off
79 xds_reset
80 jtag arp_init
81 calypso.arm arp_examine
82 calypso_magic
83 halt
84 wd
85 poll on
86 }