Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Bo Shen | 60f3dd3 | 2013-05-12 22:40:54 +0000 | [diff] [blame] | 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> |
Bo Shen | 60f3dd3 | 2013-05-12 22:40:54 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <common.h> |
Simon Glass | afb0215 | 2019-12-28 10:45:01 -0700 | [diff] [blame] | 12 | #include <cpu_func.h> |
Bo Shen | 60f3dd3 | 2013-05-12 22:40:54 +0000 | [diff] [blame] | 13 | #include <asm/io.h> |
| 14 | #include <asm/arch/hardware.h> |
| 15 | #include <asm/arch/at91_rstc.h> |
| 16 | |
| 17 | /* Reset the cpu by telling the reset controller to do so */ |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 18 | void reset_cpu(void) |
Bo Shen | 60f3dd3 | 2013-05-12 22:40:54 +0000 | [diff] [blame] | 19 | { |
| 20 | at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC; |
| 21 | |
| 22 | writel(AT91_RSTC_KEY |
| 23 | | AT91_RSTC_CR_PROCRST /* Processor Reset */ |
| 24 | | AT91_RSTC_CR_PERRST /* Peripheral Reset */ |
| 25 | #ifdef CONFIG_AT91RESET_EXTRST |
| 26 | | AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */ |
| 27 | #endif |
| 28 | , &rstc->cr); |
| 29 | /* never reached */ |
| 30 | do { } while (1); |
| 31 | } |