tcl/stm32mp15x: freeze watchdog, recover SWD after power cycle
[fw/openocd] / tcl / target / bcm2836.cfg
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 # The Broadcom chip used in the Raspberry Pi 2 Model B
4
5 # Partial information is available in raspberry pi website:
6 # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836
7
8 if { [info exists CHIPNAME] } {
9         set  _CHIPNAME $CHIPNAME
10 } else {
11         set  _CHIPNAME bcm2836
12 }
13
14 if { [info exists CHIPCORES] } {
15         set _cores $CHIPCORES
16 } else {
17         set _cores 4
18 }
19
20 if { [info exists USE_SMP] } {
21         set _USE_SMP $USE_SMP
22 } else {
23         set _USE_SMP 0
24 }
25
26 if { [info exists DAP_TAPID] } {
27         set _DAP_TAPID $DAP_TAPID
28 } else {
29         set _DAP_TAPID 0x4ba00477
30 }
31
32 jtag newtap $_CHIPNAME cpu -expected-id $_DAP_TAPID -irlen 4
33 adapter speed 4000
34
35 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
36
37 # MEM-AP for direct access
38 target create $_CHIPNAME.ap mem_ap -dap $_CHIPNAME.dap -ap-num 0
39
40 # these addresses are obtained from the ROM table via 'dap info 0' command
41 set _DBGBASE {0x80010000 0x80012000 0x80014000 0x80016000}
42
43 set _smp_command "target smp"
44
45 for { set _core 0 } { $_core < $_cores } { incr _core } {
46         set _TARGETNAME $_CHIPNAME.cpu$_core
47
48         target create $_TARGETNAME cortex_a -dap $_CHIPNAME.dap -coreid $_core -dbgbase [lindex $_DBGBASE $_core]
49         $_TARGETNAME configure -event reset-assert-post { cortex_a dbginit }
50
51         set _smp_command "$_smp_command $_CHIPNAME.cpu$_core"
52 }
53
54 if {$_USE_SMP} {
55         eval $_smp_command
56 }
57
58 # default target is cpu0
59 targets $_CHIPNAME.cpu0