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.
 
 
 
 
 
 

68 lines
1.7 KiB

  1. #Script for AT91EB40a
  2. # FIXME use some standard target config, maybe create one from this
  3. #
  4. # source [find target/...cfg]
  5. if { [info exists CHIPNAME] } {
  6. set _CHIPNAME $CHIPNAME
  7. } else {
  8. set _CHIPNAME at91eb40a
  9. }
  10. if { [info exists ENDIAN] } {
  11. set _ENDIAN $ENDIAN
  12. } else {
  13. set _ENDIAN little
  14. }
  15. if { [info exists CPUTAPID] } {
  16. set _CPUTAPID $CPUTAPID
  17. } else {
  18. set _CPUTAPID 0x1f0f0f0f
  19. }
  20. #Atmel ties SRST & TRST together, at which point it makes
  21. #no sense to use TRST, but use TMS instead.
  22. #
  23. #The annoying thing with tying SRST & TRST together is that
  24. #there is no way to halt the CPU *before and during* the
  25. #SRST reset, which means that the CPU will run a number
  26. #of cycles before it can be halted(as much as milliseconds).
  27. reset_config srst_only srst_pulls_trst
  28. #jtag scan chain
  29. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  30. #target configuration
  31. set _TARGETNAME $_CHIPNAME.cpu
  32. target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME
  33. # speed up memory downloads
  34. arm7_9 fast_memory_access enable
  35. arm7_9 dcc_downloads enable
  36. #flash driver
  37. set _FLASHNAME $_CHIPNAME.flash
  38. flash bank $_FLASHNAME cfi 0x01000000 0x200000 2 2 $_TARGETNAME
  39. # required for usable performance. Used for lots of
  40. # other things than flash programming.
  41. $_TARGETNAME configure -work-area-phys 0x00030000 -work-area-size 0x10000 -work-area-backup 0
  42. $_TARGETNAME configure -event reset-init {
  43. echo "Running reset init script for AT91EB40A"
  44. # Reset script for AT91EB40a
  45. reg cpsr 0x000000D3
  46. mww 0xFFE00020 0x1
  47. mww 0xFFE00024 0x00000000
  48. mww 0xFFE00000 0x01002539
  49. mww 0xFFFFF124 0xFFFFFFFF
  50. mww 0xffff0010 0x100
  51. mww 0xffff0034 0x100
  52. }
  53. # This target is pretty snappy...
  54. adapter_khz 16000