blob: b30e79b60adebe132a1f2853399a8f00feec31a2 [file] [log] [blame]
Bo Shen60f3dd32013-05-12 22:40:54 +00001/*
2 * (C) Copyright 2007-2008
3 * Stelian Pop <stelian@popies.net>
4 * Lead Tech Design <www.leadtechdesign.com>
5 *
6 * (C) Copyright 2013
7 * Bo Shen <voice.shen@atmel.com>
8 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
Bo Shen60f3dd32013-05-12 22:40:54 +000010 */
11
12#include <common.h>
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 */
18void reset_cpu(ulong ignored)
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}