target: add configuration for NXP MC-IMX8M-EVK
[openocd.git] / tcl / target / imx8m.cfg
blob33149540af176ea5e5ded31960764f327c5d8979
2 # configuration file for NXP i.MX8M family of SoCs
4 if { [info exists CHIPNAME] } {
5    set  _CHIPNAME $CHIPNAME
6 } else {
7    set  _CHIPNAME imx8m
10 if { [info exists CHIPCORES] } {
11     set _cores $CHIPCORES
12 } else {
13     set _cores 1
16 # CoreSight Debug Access Port
17 if { [info exists DAP_TAPID] } {
18         set _DAP_TAPID $DAP_TAPID
19 } else {
20         set _DAP_TAPID 0x5ba00477
23 # the DAP tap
24 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f \
25         -expected-id $_DAP_TAPID
27 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
29 set _TARGETNAME $_CHIPNAME.a53
30 set _CTINAME $_CHIPNAME.cti
32 set DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
33 set CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
35 for { set _core 0 } { $_core < $_cores } { incr _core } {
37     cti create $_CTINAME.$_core -dap $_CHIPNAME.dap -ap-num 1 \
38         -ctibase [lindex $CTIBASE $_core]
40     set _command "target create $_TARGETNAME.$_core aarch64 -dap $_CHIPNAME.dap \
41         -dbgbase [lindex $DBGBASE $_core] -cti $_CTINAME.$_core"
43     if { $_core != 0 } {
44         # non-boot core examination may fail
45         set _command "$_command -defer-examine"
46         set _smp_command "$_smp_command $_TARGETNAME.$_core"
47     } else {
48         set _smp_command "target smp $_TARGETNAME.$_core"
49     }
51     eval $_command
54 eval $_smp_command
55 targets $_TARGETNAME.0