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.
 
 
 
 
 
 

60 lines
1.4 KiB

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