reset.c 938 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2002
  4. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  5. * Marius Groeger <mgroeger@sysgo.de>
  6. *
  7. * (C) Copyright 2002
  8. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  9. * Alex Zuepke <azu@sysgo.de>
  10. *
  11. * (C) Copyright 2002
  12. * Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
  13. *
  14. * (C) Copyright 2009
  15. * Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
  16. */
  17. #include <common.h>
  18. #include <cpu_func.h>
  19. #include <asm/io.h>
  20. #include <asm/arch/imx-regs.h>
  21. /*
  22. * Reset the cpu by setting up the watchdog timer and let it time out
  23. */
  24. void reset_cpu(void)
  25. {
  26. struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
  27. /* Disable watchdog and set Time-Out field to 0 */
  28. writew(0x0000, &regs->wcr);
  29. /* Write Service Sequence */
  30. writew(0x5555, &regs->wsr);
  31. writew(0xAAAA, &regs->wsr);
  32. /* Enable watchdog */
  33. writew(WCR_WDE, &regs->wcr);
  34. while (1);
  35. /*NOTREACHED*/
  36. }