tcl/target: add SPDX tag
[fw/openocd] / tcl / target / imx51.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 # Freescale i.MX51
4
5 if { [info exists CHIPNAME] } {
6    set _CHIPNAME $CHIPNAME
7 } else {
8    set _CHIPNAME imx51
9 }
10
11 # CoreSight Debug Access Port
12 if { [info exists DAP_TAPID] } {
13    set _DAP_TAPID $DAP_TAPID
14 } else {
15    set _DAP_TAPID 0x1ba00477
16 }
17
18 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf \
19         -expected-id $_DAP_TAPID
20
21 # SDMA / no IDCODE
22 jtag newtap $_CHIPNAME sdma -irlen 4 -ircapture 0x0 -irmask 0xf
23
24 # SJC
25 if { [info exists SJC_TAPID] } {
26    set _SJC_TAPID SJC_TAPID
27 } else {
28    set _SJC_TAPID 0x0190c01d
29 }
30
31 jtag newtap $_CHIPNAME sjc -irlen 5 -ircapture 0x1 -irmask 0x1f \
32         -expected-id $_SJC_TAPID -ignore-version
33
34 # GDB target: Cortex-A8, using DAP
35 set _TARGETNAME $_CHIPNAME.cpu
36 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
37 target create $_TARGETNAME cortex_a -dap $_CHIPNAME.dap
38
39 # some TCK tycles are required to activate the DEBUG power domain
40 jtag configure $_CHIPNAME.sjc -event post-reset "runtest 100"
41
42 proc imx51_dbginit {target} {
43      # General Cortex-A8 debug initialisation
44      cortex_a dbginit
45 }
46
47 $_TARGETNAME configure -event reset-assert-post "imx51_dbginit $_TARGETNAME"