reset_manager.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
  4. */
  5. #ifndef _RESET_MANAGER_H_
  6. #define _RESET_MANAGER_H_
  7. void reset_cpu(ulong addr);
  8. void socfpga_per_reset(u32 reset, int set);
  9. void socfpga_per_reset_all(void);
  10. #define RSTMGR_CTRL_SWWARMRSTREQ_LSB 1
  11. /*
  12. * Define a reset identifier, from which a permodrst bank ID
  13. * and reset ID can be extracted using the subsequent macros
  14. * RSTMGR_RESET() and RSTMGR_BANK().
  15. */
  16. #define RSTMGR_BANK_OFFSET 8
  17. #define RSTMGR_BANK_MASK 0x7
  18. #define RSTMGR_RESET_OFFSET 0
  19. #define RSTMGR_RESET_MASK 0x1f
  20. #define RSTMGR_DEFINE(_bank, _offset) \
  21. ((_bank) << RSTMGR_BANK_OFFSET) | ((_offset) << RSTMGR_RESET_OFFSET)
  22. /* Extract reset ID from the reset identifier. */
  23. #define RSTMGR_RESET(_reset) \
  24. (((_reset) >> RSTMGR_RESET_OFFSET) & RSTMGR_RESET_MASK)
  25. /* Extract bank ID from the reset identifier. */
  26. #define RSTMGR_BANK(_reset) \
  27. (((_reset) >> RSTMGR_BANK_OFFSET) & RSTMGR_BANK_MASK)
  28. /* Create a human-readable reference to SoCFPGA reset. */
  29. #define SOCFPGA_RESET(_name) RSTMGR_##_name
  30. #if defined(CONFIG_TARGET_SOCFPGA_GEN5)
  31. #include <asm/arch/reset_manager_gen5.h>
  32. #elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
  33. #include <asm/arch/reset_manager_arria10.h>
  34. #endif
  35. #endif /* _RESET_MANAGER_H_ */