xref: /openbmc/u-boot/arch/arm/mach-at91/armv7/reset.c (revision 88dc4099)
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 
11 #include <common.h>
12 #include <asm/io.h>
13 #include <asm/arch/hardware.h>
14 #include <asm/arch/at91_rstc.h>
15 
16 /* Reset the cpu by telling the reset controller to do so */
17 void reset_cpu(ulong ignored)
18 {
19 	at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
20 
21 	writel(AT91_RSTC_KEY
22 		| AT91_RSTC_CR_PROCRST	/* Processor Reset */
23 		| AT91_RSTC_CR_PERRST	/* Peripheral Reset */
24 #ifdef CONFIG_AT91RESET_EXTRST
25 		| AT91_RSTC_CR_EXTRST	/* External Reset (assert nRST pin) */
26 #endif
27 		, &rstc->cr);
28 	/* never reached */
29 	do { } while (1);
30 }
31