reset_manager.c 606 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2013 Altera Corporation <www.altera.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. #include <asm/arch/reset_manager.h>
  9. DECLARE_GLOBAL_DATA_PTR;
  10. static const struct socfpga_reset_manager *reset_manager_base =
  11. (void *)SOCFPGA_RSTMGR_ADDRESS;
  12. /*
  13. * Write the reset manager register to cause reset
  14. */
  15. void reset_cpu(ulong addr)
  16. {
  17. /* request a warm reset */
  18. writel(1 << RSTMGR_CTRL_SWWARMRSTREQ_LSB,
  19. &reset_manager_base->ctrl);
  20. /*
  21. * infinite loop here as watchdog will trigger and reset
  22. * the processor
  23. */
  24. while (1)
  25. ;
  26. }