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.
 
 
 
 
 
 

76 lines
2.0 KiB

  1. # Script for freescale DSP568013
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME dsp568013
  6. }
  7. if { [info exists ENDIAN] } {
  8. set _ENDIAN $ENDIAN
  9. } else {
  10. # this defaults to a big endian
  11. set _ENDIAN little
  12. }
  13. if { [info exists CPUTAPID] } {
  14. set _CPUTAPID $CPUTAPID
  15. } else {
  16. set _CPUTAPID 0x01f2401d
  17. }
  18. #jtag speed
  19. adapter speed 800
  20. reset_config srst_only
  21. #MASTER tap
  22. jtag newtap $_CHIPNAME chp -irlen 8 -ircapture 1 -irmask 0x03 -expected-id $_CPUTAPID
  23. #CORE tap
  24. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 1 -irmask 0x03 -disable -expected-id 0x02211004
  25. #target configuration - There is only 1 tap at a time, hence only 1 target is defined.
  26. set _TARGETNAME $_CHIPNAME.cpu
  27. target create $_TARGETNAME dsp5680xx -endian $_ENDIAN -chain-position $_TARGETNAME
  28. # Setup the interesting tap
  29. # Disable polling to be able to get idcode from core tap. If re enabled, can be re enabled, but it should be disabled to correctly unlock flash (operations require certain instruction to be in the IR register during reset, and polling would change this)
  30. jtag configure $_CHIPNAME.chp -event setup "
  31. jtag tapenable $_TARGETNAME
  32. poll off
  33. "
  34. #select CORE tap by modifying the TLM register.
  35. #to be used when MASTER tap is selected.
  36. jtag configure $_TARGETNAME -event tap-enable "
  37. irscan $_CHIPNAME.chp 0x05;
  38. drscan $_CHIPNAME.chp 4 0x02;
  39. jtag tapdisable $_CHIPNAME.chp;
  40. "
  41. #select MASTER tap by modifying the TLM register.
  42. #to be used when CORE tap is selected.
  43. jtag configure $_CHIPNAME.chp -event tap-enable "
  44. irscan $_TARGETNAME 0x08;
  45. drscan $_TARGETNAME 4 0x1;
  46. jtag tapdisable $_TARGETNAME;
  47. "
  48. #disables the master tap
  49. jtag configure $_TARGETNAME -event tap-disable "
  50. "
  51. #TODO FIND SMARTER WAY.
  52. jtag configure $_CHIPNAME.chp -event tap-disable "
  53. "
  54. #TODO FIND SMARTER WAY.
  55. #working area at base of ram
  56. $_TARGETNAME configure -work-area-virt 0
  57. #setup flash
  58. set _FLASHNAME $_CHIPNAME.flash
  59. flash bank $_FLASHNAME dsp5680xx_flash 0 0 2 1 $_TARGETNAME