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.
 
 
 
 
 
 

77 lines
2.0 KiB

  1. if { [info exists CHIPNAME] } {
  2. set _CHIPNAME $CHIPNAME
  3. } else {
  4. set _CHIPNAME am335x
  5. }
  6. # This chip contains an IcePick-D JTAG router. The IcePick-C configuration is almost
  7. # compatible, but it doesn't work. For now, we will just embed the IcePick-D
  8. # routines here.
  9. proc icepick_d_tapenable {jrc port} {
  10. # select router
  11. irscan $jrc 7 -endstate IRPAUSE
  12. drscan $jrc 8 0x89 -endstate DRPAUSE
  13. # set ip control
  14. irscan $jrc 2 -endstate IRPAUSE
  15. drscan $jrc 32 [expr 0xa0002108 + ($port << 24)] -endstate DRPAUSE
  16. # for icepick_D
  17. irscan $jrc 2 -endstate IRPAUSE
  18. drscan $jrc 32 0xe0002008 -endstate DRPAUSE
  19. irscan $jrc 0x3F -endstate RUN/IDLE
  20. runtest 10
  21. }
  22. #
  23. # M3 DAP
  24. #
  25. if { [info exists M3_DAP_TAPID] } {
  26. set _M3_DAP_TAPID $M3_DAP_TAPID
  27. } else {
  28. set _M3_DAP_TAPID 0x4b6b902f
  29. }
  30. jtag newtap $_CHIPNAME m3_dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_M3_DAP_TAPID -disable
  31. jtag configure $_CHIPNAME.m3_dap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 11"
  32. #
  33. # Main DAP
  34. #
  35. if { [info exists DAP_TAPID ] } {
  36. set _DAP_TAPID $DAP_TAPID
  37. } else {
  38. set _DAP_TAPID 0x4b6b902f
  39. }
  40. jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
  41. jtag configure $_CHIPNAME.dap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 12"
  42. #
  43. # ICEpick-D (JTAG route controller)
  44. #
  45. if { [info exists JRC_TAPID ] } {
  46. set _JRC_TAPID $JRC_TAPID
  47. } else {
  48. set _JRC_TAPID 0x0b94402f
  49. }
  50. jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID
  51. jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap"
  52. # some TCK tycles are required to activate the DEBUG power domain
  53. jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
  54. #
  55. # Cortex A8 target
  56. #
  57. set _TARGETNAME $_CHIPNAME.cpu
  58. target create $_TARGETNAME cortex_a8 -chain-position $_CHIPNAME.dap -dbgbase 0x80001000
  59. # SRAM: 64K at 0x4030.0000; use the first 16K
  60. $_TARGETNAME configure -work-area-phys 0x40300000 -work-area-size 0x4000
  61. $_TARGETNAME configure -event gdb-attach {
  62. cortex_a8 dbginit
  63. halt
  64. }