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.
 
 
 
 
 
 

57 lines
1.6 KiB

  1. # Defines basic Tcl procs for OpenOCD JTAG module
  2. # Executed during "init". Can be overridden
  3. # by board/target/... scripts
  4. proc jtag_init {} {
  5. if {[catch {jtag arp_init} err]!=0} {
  6. # try resetting additionally
  7. init_reset startup
  8. }
  9. }
  10. # This reset logic may be overridden by board/target/... scripts as needed
  11. # to provide a reset that, if possible, is close to a power-up reset.
  12. #
  13. # Exit requirements include: (a) JTAG must be working, (b) the scan
  14. # chain was validated with "jtag arp_init" (or equivalent), (c) nothing
  15. # stays in reset. No TAP-specific scans were performed. It's OK if
  16. # some targets haven't been reset yet; they may need TAP-specific scans.
  17. #
  18. # The "mode" values include: halt, init, run (from "reset" command);
  19. # startup (at OpenOCD server startup, when JTAG may not yet work); and
  20. # potentially more (for reset types like cold, warm, etc)
  21. proc init_reset { mode } {
  22. jtag arp_init-reset
  23. }
  24. #########
  25. # TODO: power_restore and power_dropout are currently neither
  26. # documented nor supported except on ZY1000.
  27. proc power_restore {} {
  28. puts "Sensed power restore."
  29. reset init
  30. }
  31. add_help_text power_restore "Overridable procedure run when power restore is detected. Runs 'reset init' by default."
  32. proc power_dropout {} {
  33. puts "Sensed power dropout."
  34. }
  35. #########
  36. # TODO: srst_deasserted and srst_asserted are currently neither
  37. # documented nor supported except on ZY1000.
  38. proc srst_deasserted {} {
  39. puts "Sensed nSRST deasserted."
  40. reset init
  41. }
  42. add_help_text srst_deasserted "Overridable procedure run when srst deassert is detected. Runs 'reset init' by default."
  43. proc srst_asserted {} {
  44. puts "Sensed nSRST asserted."
  45. }