blob: e67f47bd041a58cd5b6e533f486d67de014ce7b6 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +02001/*
2 * (C) Copyright 2007-2008
Stelian Pop5ee0c7f2011-11-01 00:00:39 +01003 * Stelian Pop <stelian@popies.net>
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +02004 * Lead Tech Design <www.leadtechdesign.com>
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +02007 */
8
9#include <common.h>
Reinhard Meyerb06208c2010-11-07 13:26:14 +010010#include <asm/io.h>
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +020011#include <asm/arch/hardware.h>
12#include <asm/arch/at91_rstc.h>
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +020013
Reinhard Meyer609e6312010-08-09 13:25:37 +020014/* Reset the cpu by telling the reset controller to do so */
Jean-Christophe PLAGNIOL-VILLARD9c5c8242009-05-31 12:44:45 +020015void reset_cpu(ulong ignored)
16{
Reinhard Meyere260d0b2010-11-03 15:39:55 +010017 at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
Jens Scharsiga4db1ca2010-02-03 22:46:58 +010018
Reinhard Meyer609e6312010-08-09 13:25:37 +020019 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-VILLARD9c5c8242009-05-31 12:44:45 +020029}