Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2007-2008 |
Stelian Pop | c9e798d | 2011-11-01 00:00:39 +0100 | [diff] [blame] | 4 | * Stelian Pop <stelian@popies.net> |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 5 | * Lead Tech Design <www.leadtechdesign.com> |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <common.h> |
Simon Glass | 9a3b4ce | 2019-12-28 10:45:01 -0700 | [diff] [blame] | 9 | #include <cpu_func.h> |
Reinhard Meyer | 86592f6 | 2010-11-07 13:26:14 +0100 | [diff] [blame] | 10 | #include <asm/io.h> |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 11 | #include <asm/arch/hardware.h> |
| 12 | #include <asm/arch/at91_rstc.h> |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 13 | |
Reinhard Meyer | e0cd44c | 2010-08-09 13:25:37 +0200 | [diff] [blame] | 14 | /* Reset the cpu by telling the reset controller to do so */ |
Harald Seiler | 35b65dd | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 15 | void reset_cpu(void) |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 16 | { |
Reinhard Meyer | 9f3fe90 | 2010-11-03 15:39:55 +0100 | [diff] [blame] | 17 | at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC; |
Jens Scharsig | 0cf0b93 | 2010-02-03 22:46:58 +0100 | [diff] [blame] | 18 | |
Reinhard Meyer | e0cd44c | 2010-08-09 13:25:37 +0200 | [diff] [blame] | 19 | writel(AT91_RSTC_KEY |
| 20 | | AT91_RSTC_CR_PROCRST /* Processor Reset */ |
| 21 | | AT91_RSTC_CR_PERRST /* Peripheral Reset */ |
| 22 | #ifdef CONFIG_AT91RESET_EXTRST |
| 23 | | AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */ |
| 24 | #endif |
| 25 | , &rstc->cr); |
| 26 | /* never reached */ |
| 27 | while (1) |
| 28 | ; |
Jean-Christophe PLAGNIOL-VILLARD | 5bb59b3 | 2009-05-31 12:44:45 +0200 | [diff] [blame] | 29 | } |