xilinx_zynqmp.cfg 2.8 KB

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