str912.cfg 1.9 KB

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