str750.cfg 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. #STR750 CPU
  3. if { [info exists CHIPNAME] } {
  4. set _CHIPNAME $CHIPNAME
  5. } else {
  6. set _CHIPNAME str750
  7. }
  8. if { [info exists ENDIAN] } {
  9. set _ENDIAN $ENDIAN
  10. } else {
  11. set _ENDIAN little
  12. }
  13. if { [info exists CPUTAPID] } {
  14. set _CPUTAPID $CPUTAPID
  15. } else {
  16. set _CPUTAPID 0x4f1f0041
  17. }
  18. # jtag speed
  19. adapter speed 10
  20. #use combined on interfaces or targets that can't set TRST/SRST separately
  21. reset_config trst_and_srst srst_pulls_trst
  22. #jtag scan chain
  23. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID
  24. #jtag nTRST and nSRST delay
  25. adapter srst delay 500
  26. jtag_ntrst_delay 500
  27. set _TARGETNAME $_CHIPNAME.cpu
  28. target create $_TARGETNAME arm7tdmi -endian little -chain-position 0
  29. $_TARGETNAME configure -event reset-start { adapter speed 10 }
  30. $_TARGETNAME configure -event reset-init {
  31. adapter speed 3000
  32. init_smi
  33. # Because the hardware cannot be interrogated for the protection state
  34. # of sectors, initialize all the sectors to be unprotected. The initial
  35. # state is reflected by the driver, too.
  36. flash protect 0 0 last off
  37. flash protect 1 0 last off
  38. }
  39. $_TARGETNAME configure -event gdb-flash-erase-start {
  40. flash protect 0 0 7 off
  41. flash protect 1 0 1 off
  42. }
  43. $_TARGETNAME configure -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0
  44. #flash bank <driver> <base> <size> <chip_width> <bus_width>
  45. set _FLASHNAME $_CHIPNAME.flash0
  46. flash bank $_FLASHNAME str7x 0x20000000 0x00040000 0 0 $_TARGETNAME STR75x
  47. set _FLASHNAME $_CHIPNAME.flash1
  48. flash bank $_FLASHNAME str7x 0x200C0000 0x00004000 0 0 $_TARGETNAME STR75x
  49. # Serial NOR on SMI CS0.
  50. set _FLASHNAME $_CHIPNAME.snor
  51. flash bank $_FLASHNAME stmsmi 0x80000000 0 0 0 $_TARGETNAME
  52. source [find mem_helper.tcl]
  53. proc init_smi {} {
  54. mmw 0x60000030 0x01000000 0x00000000; # enable clock for GPIO regs
  55. mmw 0xffffe420 0x00000001 0x00000000; # set SMI_EN bit
  56. mmw 0x90000000 0x00000001 0x00000000; # set BLOCK_EN_1
  57. }