]> git.sur5r.net Git - openocd/blob - tcl/target/xilinx_ultrascale.cfg
cortex_a: fix virt2phys when mmu is disabled
[openocd] / tcl / target / xilinx_ultrascale.cfg
1 #
2 # target configuration for
3 # Xilinx UltraScale+
4 #
5 if { [info exists CHIPNAME] } {
6     set _CHIPNAME $CHIPNAME
7 } else {
8     set _CHIPNAME uscale
9 }
10
11 #
12 # DAP tap
13 #
14 if { [info exists DAP_TAPID] } {
15     set _DAP_TAPID $DAP_TAPID
16 } else {
17     set _DAP_TAPID 0x5ba00477
18 }
19
20 jtag newtap $_CHIPNAME tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID
21 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.tap
22
23 #
24 # PS tap
25 #
26 if { [info exists PS_TAPID] } {
27     set _PS_TAPID $PS_TAPID
28 } else {
29     set _PS_TAPID 0x04710093
30 }
31
32 set jtag_configured 0
33
34 jtag newtap $_CHIPNAME ps -irlen 12 -ircapture 0x1 -irmask 0x03 -expected-id $_PS_TAPID
35
36 jtag configure $_CHIPNAME.ps -event setup {
37     global _CHIPNAME
38     global jtag_configured
39
40     if { $jtag_configured == 0 } {
41         # add the DAP tap to the chain
42         # See https://forums.xilinx.com/t5/UltraScale-Architecture/JTAG-Chain-Configuration-for-Zynq-UltraScale-MPSoC/td-p/758924
43         irscan $_CHIPNAME.ps 0x824
44         drscan $_CHIPNAME.ps 32 0x00000003
45         runtest 100
46
47         # setup event will be re-entered through jtag arp_init
48         # break the recursion
49         set jtag_configured 1
50         # re-initialized the jtag chain
51         jtag arp_init
52     }
53 }
54
55 set _TARGETNAME $_CHIPNAME.a53
56 set _CTINAME $_CHIPNAME.cti
57 set _smp_command ""
58
59 set DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
60 set CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
61 set _cores 4
62
63 for { set _core 0 } { $_core < $_cores } { incr _core } {
64
65     cti create $_CTINAME.$_core -dap $_CHIPNAME.dap -ap-num 1 \
66         -ctibase [lindex $CTIBASE $_core]
67
68     set _command "target create $_TARGETNAME.$_core aarch64 -dap $_CHIPNAME.dap \
69         -dbgbase [lindex $DBGBASE $_core] -cti $_CTINAME.$_core"
70
71     if { $_core != 0 } {
72         # non-boot core examination may fail
73         set _command "$_command -defer-examine"
74         set _smp_command "$_smp_command $_TARGETNAME.$_core"
75     } else {
76         # uncomment when "hawt" rtos is merged
77         #set _command "$_command -rtos hawt"
78         set _smp_command "target smp $_TARGETNAME.$_core"
79     }
80
81     eval $_command
82 }
83
84 eval $_smp_command
85 targets $_TARGETNAME.0
86
87 proc core_up { args } {
88     global _TARGETNAME
89     foreach { core } [set args] {
90         $_TARGETNAME.$core arp_examine
91     }
92 }