reset.c 698 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2007-2008
  4. * Stelian Pop <stelian@popies.net>
  5. * Lead Tech Design <www.leadtechdesign.com>
  6. */
  7. #include <common.h>
  8. #include <cpu_func.h>
  9. #include <asm/io.h>
  10. #include <asm/arch/hardware.h>
  11. #include <asm/arch/at91_rstc.h>
  12. /* Reset the cpu by telling the reset controller to do so */
  13. void reset_cpu(ulong ignored)
  14. {
  15. at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
  16. writel(AT91_RSTC_KEY
  17. | AT91_RSTC_CR_PROCRST /* Processor Reset */
  18. | AT91_RSTC_CR_PERRST /* Peripheral Reset */
  19. #ifdef CONFIG_AT91RESET_EXTRST
  20. | AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */
  21. #endif
  22. , &rstc->cr);
  23. /* never reached */
  24. while (1)
  25. ;
  26. }