-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzynqmp.cfg
170 lines (147 loc) · 5.07 KB
/
zynqmp.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
##############################################################################
# zub_1cg, kv260_starter, zcu104
##############################################################################
#set board_name zub_1cg
#set board_name kv260_starter
set board_name k24_som_on_kv260_starter
#set board_name zcu104
if {$board_name eq "zub_1cg"} {
adapter driver ftdi
ftdi device_desc "JTAG+Serial"
ftdi vid_pid 0x0403 0x6010
ftdi channel 0
ftdi layout_init 0x00c8 0x000b
set _cores 2
} elseif {$board_name eq "zcu104"} {
adapter driver ftdi
ftdi device_desc "JTAG+3Serial"
ftdi vid_pid 0x0403 0x6011
ftdi channel 0
ftdi layout_init 0x00c8 0x000b
set _cores 4
} elseif {$board_name eq "kv260_starter"} {
adapter driver ftdi
ftdi device_desc "ML Carrier Card"
ftdi vid_pid 0x0403 0x6011
ftdi channel 0
ftdi layout_init 0x00d8 0x002b
set _cores 4
} elseif {$board_name eq "k24_som_on_kv260_starter"} {
adapter driver ftdi
ftdi device_desc "ML Carrier Card"
ftdi vid_pid 0x0403 0x6011
ftdi channel 0
ftdi layout_init 0x00d8 0x002b
set _cores 4
} else {
echo "pls specify board_name:zcu104|zub_1cg|kv260_starter"
break
}
###############################################################################
# jtag or swd
###############################################################################
transport select jtag
###############################################################################
# configure reset
###############################################################################
reset_config none
##############################################################################
# slow default clock
##############################################################################
adapter speed 4000
###############################################################################
# target configuration for
# Xilinx ZynqMP (UltraScale+ / A53)
###############################################################################
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME uscale
}
#
# DAP tap (Quard core A53)
#
if { [info exists DAP_TAPID] } {
set _DAP_TAPID $DAP_TAPID
} else {
set _DAP_TAPID 0x5ba00477
}
jtag newtap $_CHIPNAME tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.tap -ignore-syspwrupack
#
# PS tap (UltraScale+)
#
if { [info exists PS_TAPID] } {
set _PS_TAPID $PS_TAPID
jtag newtap $_CHIPNAME ps -irlen 12 -ircapture 0x1 -irmask 0x03 -expected-id $_PS_TAPID
} else {
# FPGA Programmable logic. Values take from Table 39-1 in UG1085:
jtag newtap $_CHIPNAME ps -irlen 12 -ircapture 0x1 -irmask 0x03 -ignore-version \
-expected-id 0x04688093 \
-expected-id 0x04711093 \
-expected-id 0x04710093 \
-expected-id 0x04724093 \
-expected-id 0x04721093 \
-expected-id 0x04720093 \
-expected-id 0x04739093 \
-expected-id 0x04730093 \
-expected-id 0x04738093 \
-expected-id 0x04740093 \
-expected-id 0x04750093 \
-expected-id 0x04759093 \
-expected-id 0x04758093 \
-expected-id 0x14712093
}
set jtag_configured 0
jtag configure $_CHIPNAME.ps -event setup {
global _CHIPNAME
global jtag_configured
if { $jtag_configured == 0 } {
# add the DAP tap to the chain
# See https://forums.xilinx.com/t5/UltraScale-Architecture/JTAG-Chain-Configuration-for-Zynq-UltraScale-MPSoC/td-p/758924
irscan $_CHIPNAME.ps 0x824
drscan $_CHIPNAME.ps 32 0x00000003
runtest 100
# setup event will be re-entered through jtag arp_init
# break the recursion
set jtag_configured 1
# re-initialized the jtag chain
jtag arp_init
}
}
set _TARGETNAME $_CHIPNAME.a53
set _CTINAME $_CHIPNAME.cti
set _smp_command ""
set DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
set CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
for { set _core 0 } { $_core < $_cores } { incr _core } {
cti create $_CTINAME.$_core -dap $_CHIPNAME.dap -ap-num 1 \
-baseaddr [lindex $CTIBASE $_core]
set _command "target create $_TARGETNAME.$_core aarch64 -dap $_CHIPNAME.dap \
-dbgbase [lindex $DBGBASE $_core] -cti $_CTINAME.$_core"
if { $_core != 0 } {
# non-boot core examination may fail
set _command "$_command -defer-examine"
set _smp_command "$_smp_command $_TARGETNAME.$_core"
} else {
# uncomment when "hawt" rtos is merged
#set _command "$_command -rtos hawt"
set _smp_command "target smp $_TARGETNAME.$_core"
}
eval $_command
}
target create uscale.axi mem_ap -dap uscale.dap -ap-num 0
eval $_smp_command
targets $_TARGETNAME.0
###############################################################################
# port binding
###############################################################################
gdb_port 3333
telnet_port 4444
bindto 0.0.0.0
###############################################################################
# play svf
###############################################################################
init
svf -tap $_CHIPNAME.tap zynqmp.svf quiet
$_TARGETNAME.0 arp_examine