raspberrypi4.cfg 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # The Broadcom BCM2711 used in Raspberry Pi 4
  3. # No documentation was found on Broadcom website
  4. # Partial information is available in raspberry pi website:
  5. # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/
  6. if { [info exists CHIPNAME] } {
  7. set _CHIPNAME $CHIPNAME
  8. } else {
  9. set _CHIPNAME bcm2711
  10. }
  11. if { [info exists CHIPCORES] } {
  12. set _cores $CHIPCORES
  13. } else {
  14. set _cores 4
  15. }
  16. if { [info exists USE_SMP] } {
  17. set _USE_SMP $USE_SMP
  18. } else {
  19. set _USE_SMP 1
  20. }
  21. if { [info exists DAP_TAPID] } {
  22. set _DAP_TAPID $DAP_TAPID
  23. } else {
  24. set _DAP_TAPID 0x4ba00477
  25. }
  26. jtag newtap $_CHIPNAME cpu -expected-id $_DAP_TAPID -irlen 4
  27. adapter speed 4000
  28. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  29. # MEM-AP for direct access
  30. target create $_CHIPNAME.ap mem_ap -dap $_CHIPNAME.dap -ap-num 0
  31. # these addresses are obtained from the ROM table via 'dap info 0' command
  32. set _DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
  33. set _CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
  34. set _smp_command "target smp"
  35. for { set _core 0 } { $_core < $_cores } { incr _core } {
  36. set _CTINAME $_CHIPNAME.cti$_core
  37. set _TARGETNAME $_CHIPNAME.cpu$_core
  38. cti create $_CTINAME -dap $_CHIPNAME.dap -ap-num 0 -baseaddr [lindex $_CTIBASE $_core]
  39. target create $_TARGETNAME aarch64 -dap $_CHIPNAME.dap -ap-num 0 -dbgbase [lindex $_DBGBASE $_core] -cti $_CTINAME -coreid $_core -rtos hwthread
  40. set _smp_command "$_smp_command $_TARGETNAME"
  41. $_TARGETNAME configure -event reset-assert-post "aarch64 dbginit"
  42. $_TARGETNAME configure -event gdb-attach { halt }
  43. $_TARGETNAME configure -event gdb-detach { resume }
  44. }
  45. if {$_USE_SMP} {
  46. eval $_smp_command
  47. echo $_smp_command
  48. }
  49. # default target is cpu0
  50. targets $_CHIPNAME.cpu0