reset.c 738 B

123456789101112131415161718192021222324252627282930
  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. * (C) Copyright 2013
  8. * Bo Shen <voice.shen@atmel.com>
  9. */
  10. #include <common.h>
  11. #include <asm/io.h>
  12. #include <asm/arch/hardware.h>
  13. #include <asm/arch/at91_rstc.h>
  14. /* Reset the cpu by telling the reset controller to do so */
  15. void reset_cpu(ulong ignored)
  16. {
  17. at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
  18. writel(AT91_RSTC_KEY
  19. | AT91_RSTC_CR_PROCRST /* Processor Reset */
  20. | AT91_RSTC_CR_PERRST /* Peripheral Reset */
  21. #ifdef CONFIG_AT91RESET_EXTRST
  22. | AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */
  23. #endif
  24. , &rstc->cr);
  25. /* never reached */
  26. do { } while (1);
  27. }