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.
 
 
 
 
 
 

106 lines
2.8 KiB

  1. #
  2. # target configuration for
  3. # Xilinx ZynqMP (UltraScale+ / A53)
  4. #
  5. if { [info exists CHIPNAME] } {
  6. set _CHIPNAME $CHIPNAME
  7. } else {
  8. set _CHIPNAME uscale
  9. }
  10. #
  11. # DAP tap (Quard core A53)
  12. #
  13. if { [info exists DAP_TAPID] } {
  14. set _DAP_TAPID $DAP_TAPID
  15. } else {
  16. set _DAP_TAPID 0x5ba00477
  17. }
  18. jtag newtap $_CHIPNAME tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID
  19. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.tap
  20. #
  21. # PS tap (UltraScale+)
  22. #
  23. if { [info exists PS_TAPID] } {
  24. set _PS_TAPID $PS_TAPID
  25. jtag newtap $_CHIPNAME ps -irlen 12 -ircapture 0x1 -irmask 0x03 -expected-id $_PS_TAPID
  26. } else {
  27. # FPGA Programmable logic. Values take from Table 39-1 in UG1085:
  28. jtag newtap $_CHIPNAME ps -irlen 12 -ircapture 0x1 -irmask 0x03 -ignore-version \
  29. -expected-id 0x04711093 \
  30. -expected-id 0x04710093 \
  31. -expected-id 0x04721093 \
  32. -expected-id 0x04720093 \
  33. -expected-id 0x04739093 \
  34. -expected-id 0x04730093 \
  35. -expected-id 0x04738093 \
  36. -expected-id 0x04740093 \
  37. -expected-id 0x04750093 \
  38. -expected-id 0x04759093 \
  39. -expected-id 0x04758093
  40. }
  41. set jtag_configured 0
  42. jtag configure $_CHIPNAME.ps -event setup {
  43. global _CHIPNAME
  44. global jtag_configured
  45. if { $jtag_configured == 0 } {
  46. # add the DAP tap to the chain
  47. # See https://forums.xilinx.com/t5/UltraScale-Architecture/JTAG-Chain-Configuration-for-Zynq-UltraScale-MPSoC/td-p/758924
  48. irscan $_CHIPNAME.ps 0x824
  49. drscan $_CHIPNAME.ps 32 0x00000003
  50. runtest 100
  51. # setup event will be re-entered through jtag arp_init
  52. # break the recursion
  53. set jtag_configured 1
  54. # re-initialized the jtag chain
  55. jtag arp_init
  56. }
  57. }
  58. set _TARGETNAME $_CHIPNAME.a53
  59. set _CTINAME $_CHIPNAME.cti
  60. set _smp_command ""
  61. set DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
  62. set CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
  63. set _cores 4
  64. for { set _core 0 } { $_core < $_cores } { incr _core } {
  65. cti create $_CTINAME.$_core -dap $_CHIPNAME.dap -ap-num 1 \
  66. -baseaddr [lindex $CTIBASE $_core]
  67. set _command "target create $_TARGETNAME.$_core aarch64 -dap $_CHIPNAME.dap \
  68. -dbgbase [lindex $DBGBASE $_core] -cti $_CTINAME.$_core"
  69. if { $_core != 0 } {
  70. # non-boot core examination may fail
  71. set _command "$_command -defer-examine"
  72. set _smp_command "$_smp_command $_TARGETNAME.$_core"
  73. } else {
  74. # uncomment when "hawt" rtos is merged
  75. #set _command "$_command -rtos hawt"
  76. set _smp_command "target smp $_TARGETNAME.$_core"
  77. }
  78. eval $_command
  79. }
  80. target create uscale.axi mem_ap -dap uscale.dap -ap-num 0
  81. eval $_smp_command
  82. targets $_TARGETNAME.0
  83. proc core_up { args } {
  84. global _TARGETNAME
  85. foreach { core } [set args] {
  86. $_TARGETNAME.$core arp_examine
  87. }
  88. }