common.tcl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # Copyright (C) 2015, 2020 Synopsys, Inc.
  3. # Anton Kolesov <anton.kolesov@synopsys.com>
  4. # Didin Evgeniy <didin@synopsys.com>
  5. # Things common to all ARCs
  6. # It is assumed that target is already halted.
  7. proc arc_common_reset { {target ""} } {
  8. if { $target != "" } {
  9. targets $target
  10. }
  11. halt
  12. # 1. Interrupts are disabled (STATUS32.IE)
  13. # 2. The status register flags are cleared.
  14. # All fields, except the H bit, are set to 0 when the processor is Reset.
  15. arc jtag set-aux-reg 0xA 0x1
  16. # 3. The loop count, loop start, and loop end registers are cleared.
  17. arc jtag set-core-reg 60 0
  18. arc jtag set-aux-reg 0x2 0
  19. arc jtag set-aux-reg 0x3 0
  20. # Program execution begins at the address referenced by the four byte reset
  21. # vector located at the interrupt vector base address, which is the first
  22. # entry (offset 0x00) in the vector table.
  23. set int_vector_base [arc jtag get-aux-reg 0x25]
  24. set start_pc [read_memory $int_vector_base 32 1]
  25. arc jtag set-aux-reg 0x6 $start_pc
  26. # It is OK to do uncached writes - register cache will be invalidated by
  27. # the reset_assert() function.
  28. }
  29. # vim:expandtab: