reset.c 647 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2014, STMicroelectronics - All Rights Reserved
  4. * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
  5. */
  6. #include <common.h>
  7. #include <cpu_func.h>
  8. #include <asm/io.h>
  9. #include <asm/arch/stv0991_wdru.h>
  10. #include <linux/delay.h>
  11. void reset_cpu(void)
  12. {
  13. puts("System is going to reboot ...\n");
  14. /*
  15. * This 1 second delay will allow the above message
  16. * to be printed before reset
  17. */
  18. udelay((1000 * 1000));
  19. /* Setting bit 1 of the WDRU unit will reset the SoC */
  20. writel(WDRU_RST_SYS, &stv0991_wd_ru_ptr->wdru_ctrl1);
  21. /* system will restart */
  22. while (1)
  23. ;
  24. }