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.
 
 
 
 
 
 

73 lines
1.9 KiB

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