reset.c 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 <cpu_func.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/hardware.h>
  10. #include <asm/arch/spr_syscntl.h>
  11. #include <linux/delay.h>
  12. void reset_cpu(void)
  13. {
  14. struct syscntl_regs *syscntl_regs_p =
  15. (struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
  16. printf("System is going to reboot ...\n");
  17. /*
  18. * This 1 second delay will allow the above message
  19. * to be printed before reset
  20. */
  21. udelay((1000 * 1000));
  22. /* Going into slow mode before resetting SOC */
  23. writel(0x02, &syscntl_regs_p->scctrl);
  24. /*
  25. * Writing any value to the system status register will
  26. * reset the SoC
  27. */
  28. writel(0x00, &syscntl_regs_p->scsysstat);
  29. /* system will restart */
  30. while (1)
  31. ;
  32. }