You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
1.7 KiB

  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # This is the Broadcom chip used in the Raspberry Pi 3,
  3. # and in later models of the Raspberry Pi 2.
  4. # Partial information is available in raspberry pi website:
  5. # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837
  6. # https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2837b0
  7. if { [info exists CHIPNAME] } {
  8. set _CHIPNAME $CHIPNAME
  9. } else {
  10. set _CHIPNAME bcm2837
  11. }
  12. if { [info exists CHIPCORES] } {
  13. set _cores $CHIPCORES
  14. } else {
  15. set _cores 4
  16. }
  17. if { [info exists USE_SMP] } {
  18. set _USE_SMP $USE_SMP
  19. } else {
  20. set _USE_SMP 0
  21. }
  22. if { [info exists DAP_TAPID] } {
  23. set _DAP_TAPID $DAP_TAPID
  24. } else {
  25. set _DAP_TAPID 0x4ba00477
  26. }
  27. jtag newtap $_CHIPNAME cpu -expected-id $_DAP_TAPID -irlen 4
  28. adapter speed 4000
  29. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  30. # MEM-AP for direct access
  31. target create $_CHIPNAME.ap mem_ap -dap $_CHIPNAME.dap -ap-num 0
  32. # these addresses are obtained from the ROM table via 'dap info 0' command
  33. set _DBGBASE {0x80010000 0x80012000 0x80014000 0x80016000}
  34. set _CTIBASE {0x80018000 0x80019000 0x8001a000 0x8001b000}
  35. set _smp_command "target smp"
  36. for { set _core 0 } { $_core < $_cores } { incr _core } {
  37. set _CTINAME $_CHIPNAME.cti$_core
  38. set _TARGETNAME $_CHIPNAME.cpu$_core
  39. cti create $_CTINAME -dap $_CHIPNAME.dap -ap-num 0 -baseaddr [lindex $_CTIBASE $_core]
  40. target create $_TARGETNAME aarch64 -dap $_CHIPNAME.dap -ap-num 0 -dbgbase [lindex $_DBGBASE $_core] -cti $_CTINAME
  41. $_TARGETNAME configure -event reset-assert-post { aarch64 dbginit }
  42. set _smp_command "$_smp_command $_TARGETNAME"
  43. }
  44. if {$_USE_SMP} {
  45. eval $_smp_command
  46. }
  47. # default target is cpu0
  48. targets $_CHIPNAME.cpu0