2018-05-07 06:58:06 +09:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2009-05-31 19:44:45 +09:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2007-2008
|
2011-11-01 08:00:39 +09:00
|
|
|
* Stelian Pop <stelian@popies.net>
|
2009-05-31 19:44:45 +09:00
|
|
|
* Lead Tech Design <www.leadtechdesign.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-29 02:45:01 +09:00
|
|
|
#include <cpu_func.h>
|
2010-11-07 21:26:14 +09:00
|
|
|
#include <asm/io.h>
|
2009-05-31 19:44:45 +09:00
|
|
|
#include <asm/arch/hardware.h>
|
|
|
|
#include <asm/arch/at91_rstc.h>
|
|
|
|
|
2010-08-09 20:25:37 +09:00
|
|
|
/* Reset the cpu by telling the reset controller to do so */
|
2009-05-31 19:44:45 +09:00
|
|
|
void reset_cpu(ulong ignored)
|
|
|
|
{
|
2010-11-03 23:39:55 +09:00
|
|
|
at91_rstc_t *rstc = (at91_rstc_t *) ATMEL_BASE_RSTC;
|
2010-02-04 06:46:58 +09:00
|
|
|
|
2010-08-09 20:25:37 +09:00
|
|
|
writel(AT91_RSTC_KEY
|
|
|
|
| AT91_RSTC_CR_PROCRST /* Processor Reset */
|
|
|
|
| AT91_RSTC_CR_PERRST /* Peripheral Reset */
|
|
|
|
#ifdef CONFIG_AT91RESET_EXTRST
|
|
|
|
| AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */
|
|
|
|
#endif
|
|
|
|
, &rstc->cr);
|
|
|
|
/* never reached */
|
|
|
|
while (1)
|
|
|
|
;
|
2009-05-31 19:44:45 +09:00
|
|
|
}
|