1 # SPDX-License-Identifier: GPL-2.0-or-later
3 # This is the Broadcom chip used in the Raspberry Pi 3,
4 # and in later models of the Raspberry Pi 2.
6 # Partial information is available in raspberry pi website:
7 # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837
8 # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837b0
10 if { [info exists CHIPNAME] } {
11 set _CHIPNAME $CHIPNAME
16 if { [info exists CHIPCORES] } {
22 if { [info exists USE_SMP] } {
28 if { [info exists DAP_TAPID] } {
29 set _DAP_TAPID $DAP_TAPID
31 set _DAP_TAPID 0x4ba00477
34 jtag newtap $_CHIPNAME cpu -expected-id $_DAP_TAPID -irlen 4
37 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
39 # MEM-AP for direct access
40 target create $_CHIPNAME.ap mem_ap -dap $_CHIPNAME.dap -ap-num 0
42 # these addresses are obtained from the ROM table via 'dap info 0' command
43 set _DBGBASE {0x80010000 0x80012000 0x80014000 0x80016000}
44 set _CTIBASE {0x80018000 0x80019000 0x8001a000 0x8001b000}
46 set _smp_command "target smp"
48 for { set _core 0 } { $_core < $_cores } { incr _core } {
49 set _CTINAME $_CHIPNAME.cti$_core
50 set _TARGETNAME $_CHIPNAME.cpu$_core
52 cti create $_CTINAME -dap $_CHIPNAME.dap -ap-num 0 -baseaddr [lindex $_CTIBASE $_core]
53 target create $_TARGETNAME aarch64 -dap $_CHIPNAME.dap -ap-num 0 -dbgbase [lindex $_DBGBASE $_core] -cti $_CTINAME
54 $_TARGETNAME configure -event reset-assert-post { aarch64 dbginit }
56 set _smp_command "$_smp_command $_TARGETNAME"
63 # default target is cpu0
64 targets $_CHIPNAME.cpu0