reset.c 908 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2002
  4. * Lineo, Inc. <www.lineo.com>
  5. * Bernhard Kuhn <bkuhn@lineo.com>
  6. *
  7. * (C) Copyright 2002
  8. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  9. * Marius Groeger <mgroeger@sysgo.de>
  10. *
  11. * (C) Copyright 2002
  12. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  13. * Alex Zuepke <azu@sysgo.de>
  14. */
  15. #include <common.h>
  16. #include <cpu_func.h>
  17. #include <asm/io.h>
  18. #include <asm/arch/hardware.h>
  19. #include <asm/arch/at91_st.h>
  20. void __attribute__((weak)) board_reset(void)
  21. {
  22. /* true empty function for defining weak symbol */
  23. }
  24. void reset_cpu(void)
  25. {
  26. at91_st_t *st = (at91_st_t *) ATMEL_BASE_ST;
  27. board_reset();
  28. /* Reset the cpu by setting up the watchdog timer */
  29. writel(AT91_ST_WDMR_RSTEN | AT91_ST_WDMR_EXTEN | AT91_ST_WDMR_WDV(2),
  30. &st->wdmr);
  31. writel(AT91_ST_CR_WDRST, &st->cr);
  32. /* and let it timeout */
  33. while (1)
  34. ;
  35. /* Never reached */
  36. }