tcl/target: consolidate Kinetis configs
[fw/openocd] / tcl / target / kx.cfg
1 #
2 # Freescale Kinetis Kx series devices
3 #
4
5 source [find target/swj-dp.tcl]
6
7 if { [info exists CHIPNAME] } {
8     set _CHIPNAME $CHIPNAME
9 } else {
10     set _CHIPNAME kx
11 }
12
13 if { [info exists ENDIAN] } {
14     set _ENDIAN $ENDIAN
15 } else {
16     set _ENDIAN little
17 }
18
19 if { [info exists CPUTAPID] } {
20     set _CPUTAPID $CPUTAPID
21 } else {
22    if { [using_jtag] } {
23       set _CPUTAPID 0x4ba00477
24    } {
25       set _CPUTAPID 0x2ba01477
26    }
27 }
28
29 set _TARGETNAME $_CHIPNAME.cpu
30
31 swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
32
33 target create $_TARGETNAME cortex_m -chain-position $_CHIPNAME.cpu
34
35 reset_config srst_nogate
36
37 if {![using_hla]} {
38    # if srst is not fitted use SYSRESETREQ to
39    # perform a soft reset
40    cortex_m reset_config sysresetreq
41 }