str912.cfg 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # script for str9
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME str912
  6. }
  7. if { [info exists ENDIAN] } {
  8. set _ENDIAN $ENDIAN
  9. } else {
  10. set _ENDIAN little
  11. }
  12. # jtag speed. We need to stick to 16kHz until we've finished reset.
  13. adapter speed 16
  14. adapter srst delay 100
  15. jtag_ntrst_delay 100
  16. #use combined on interfaces or targets that can't set TRST/SRST separately
  17. reset_config trst_and_srst
  18. if { [info exists FLASHTAPID] } {
  19. set _FLASHTAPID $FLASHTAPID
  20. } else {
  21. set _FLASHTAPID 0x04570041
  22. }
  23. jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
  24. if { [info exists CPUTAPID] } {
  25. set _CPUTAPID $CPUTAPID
  26. } else {
  27. set _CPUTAPID 0x25966041
  28. }
  29. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  30. if { [info exists BSTAPID] } {
  31. set _BSTAPID $BSTAPID
  32. } else {
  33. # possible values: 0x1457f041, 0x2457f041
  34. # we ignore version in check below
  35. set _BSTAPID 0x1457f041
  36. }
  37. jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID -ignore-version
  38. set _TARGETNAME $_CHIPNAME.cpu
  39. target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME
  40. $_TARGETNAME configure -event reset-start { adapter speed 16 }
  41. $_TARGETNAME configure -event reset-init {
  42. # We can increase speed now that we know the target is halted.
  43. #adapter speed 3000
  44. # -- Enable 96K RAM
  45. # PFQBC enabled / DTCM & AHB wait-states disabled
  46. mww 0x5C002034 0x0191
  47. str9x flash_config 0 4 2 0 0x80000
  48. flash protect 0 0 7 off
  49. }
  50. $_TARGETNAME configure -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0
  51. #flash bank str9x <base> <size> 0 0 <target#> <variant>
  52. set _FLASHNAME $_CHIPNAME.flash0
  53. flash bank $_FLASHNAME str9x 0x00000000 0x00080000 0 0 $_TARGETNAME
  54. set _FLASHNAME $_CHIPNAME.flash1
  55. flash bank $_FLASHNAME str9x 0x00080000 0x00008000 0 0 $_TARGETNAME