reset.c 780 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2009
  4. * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
  5. */
  6. #include <common.h>
  7. #include <asm/io.h>
  8. #include <asm/arch/hardware.h>
  9. #include <asm/arch/spr_syscntl.h>
  10. void reset_cpu(ulong ignored)
  11. {
  12. struct syscntl_regs *syscntl_regs_p =
  13. (struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
  14. printf("System is going to reboot ...\n");
  15. /*
  16. * This 1 second delay will allow the above message
  17. * to be printed before reset
  18. */
  19. udelay((1000 * 1000));
  20. /* Going into slow mode before resetting SOC */
  21. writel(0x02, &syscntl_regs_p->scctrl);
  22. /*
  23. * Writing any value to the system status register will
  24. * reset the SoC
  25. */
  26. writel(0x00, &syscntl_regs_p->scsysstat);
  27. /* system will restart */
  28. while (1)
  29. ;
  30. }