common.tcl 1.3 KB

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