1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # The Broadcom BCM2711 used in Raspberry Pi 4
4 # No documentation was found on Broadcom website
6 # Partial information is available in raspberry pi website:
7 # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/
9 if { [info exists CHIPNAME] } {
10 set _CHIPNAME $CHIPNAME
15 if { [info exists CHIPCORES] } {
21 if { [info exists USE_SMP] } {
27 if { [info exists DAP_TAPID] } {
28 set _DAP_TAPID $DAP_TAPID
30 set _DAP_TAPID 0x4ba00477
33 jtag newtap $_CHIPNAME cpu -expected-id $_DAP_TAPID -irlen 4
36 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
38 # MEM-AP for direct access
39 target create $_CHIPNAME.ap mem_ap -dap $_CHIPNAME.dap -ap-num 0
41 # these addresses are obtained from the ROM table via 'dap info 0' command
42 set _DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
43 set _CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
45 set _smp_command "target smp"
47 for { set _core 0 } { $_core < $_cores } { incr _core } {
48 set _CTINAME $_CHIPNAME.cti$_core
49 set _TARGETNAME $_CHIPNAME.cpu$_core
51 cti create $_CTINAME -dap $_CHIPNAME.dap -ap-num 0 -baseaddr [lindex $_CTIBASE $_core]
52 target create $_TARGETNAME aarch64 -dap $_CHIPNAME.dap -ap-num 0 -dbgbase [lindex $_DBGBASE $_core] -cti $_CTINAME
54 set _smp_command "$_smp_command $_TARGETNAME"
61 # default target is cpu0
62 targets $_CHIPNAME.cpu0