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