target/xtensa: avoid IHI for writes to non-executable memory
[openocd.git] / tcl / target / s32k.cfg
blob3ff3239739ed83797b99630bea099e03c2cc0698
1 # SPDX-License-Identifier: GPL-2.0-or-later
4 # Freescale S32K devices
5 # Similar to Kinetis Kx series devices.
8 source [find target/swj-dp.tcl]
10 if { [info exists CHIPNAME] } {
11     set _CHIPNAME $CHIPNAME
12 } else {
13     set _CHIPNAME s32k
16 # Work-area is a space in RAM used for flash programming
17 # By default use 4kB
18 if { [info exists WORKAREASIZE] } {
19    set _WORKAREASIZE $WORKAREASIZE
20 } else {
21    set _WORKAREASIZE 0x1000
24 if { [info exists CPUTAPID] } {
25     set _CPUTAPID $CPUTAPID
26 } else {
27     set _CPUTAPID 0x0995001d
30 swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
31 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
33 set _TARGETNAME $_CHIPNAME.cpu
34 target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
36 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
38 set _FLASHNAME $_CHIPNAME.pflash
39 flash bank $_FLASHNAME kinetis 0 0 0 0 $_TARGETNAME -s32k
40 kinetis create_banks
42 adapter speed 1000
44 reset_config srst_nogate
46 if {[using_hla]} {
47    echo ""
48    echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!"
49    echo " Kinetis MCUs have a MDM-AP dedicated mainly to MCU security related functions."
50    echo " A high level adapter (like a ST-Link) you are currently using cannot access"
51    echo " the MDM-AP, so commands like 'mdm mass_erase' are not available in your"
52    echo " configuration. Also security locked state of the device will not be reported."
53    echo " Expect problems connecting to a blank device without boot ROM."
54    echo ""
55    echo " Be very careful as you can lock the device though there is no way to unlock"
56    echo " it without mass erase. Don't set write protection on the first block."
57    echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!"
58    echo ""
59 } else {
60    # Detect secured MCU or boot lock-up in RESET/WDOG loop
61    $_TARGETNAME configure -event examine-fail {
62       kinetis mdm check_security
63    }
64    # During RESET/WDOG loop the target is sometimes falsely examined
65    $_TARGETNAME configure -event examine-end {
66       kinetis mdm check_security
67    }
69    # if srst is not fitted use SYSRESETREQ to
70    # perform a soft reset
71    cortex_m reset_config sysresetreq
74 # Disable watchdog not to disturb OpenOCD algorithms running on MCU
75 # (e.g. armv7m_checksum_memory() in verify_image)
76 # Flash driver also disables watchdog before FTFA flash programming.
77 $_TARGETNAME configure -event reset-init {
78    kinetis disable_wdog