reset.c 802 B

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