aduc702x.cfg 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME aduc702x
  6. }
  7. if { [info exists ENDIAN] } {
  8. set _ENDIAN $ENDIAN
  9. } else {
  10. # This config file was defaulting to big endian..
  11. set _ENDIAN little
  12. }
  13. if { [info exists CPUTAPID] } {
  14. set _CPUTAPID $CPUTAPID
  15. } else {
  16. set _CPUTAPID 0x3f0f0f0f
  17. }
  18. adapter srst delay 200
  19. jtag_ntrst_delay 200
  20. ## JTAG scan chain
  21. #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
  22. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  23. ##
  24. ## Target configuration
  25. ##
  26. set _TARGETNAME $_CHIPNAME.cpu
  27. target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME
  28. # allocate the entire SRAM as working area
  29. $_TARGETNAME configure -work-area-phys 0x10000 -work-area-size 0x2000
  30. ## flash configuration
  31. # only target number is needed
  32. set _FLASHNAME $_CHIPNAME.flash
  33. flash bank $_FLASHNAME aduc702x 0 0 0 0 $_TARGETNAME
  34. ## If you use the watchdog, the following code makes sure that the board
  35. ## doesn't reboot when halted via JTAG. Yes, on the older generation
  36. ## AdUC702x, timer3 continues running even when the CPU is halted.
  37. proc watchdog_service {} {
  38. global watchdog_hdl
  39. mww 0xffff036c 0
  40. # echo "watchdog!!"
  41. set watchdog_hdl [after 500 watchdog_service]
  42. }
  43. $_TARGETNAME configure -event reset-halt-post { watchdog_service }
  44. $_TARGETNAME configure -event resume-start { global watchdog_hdl; after cancel $watchdog_hdl }