blob: 3164182b697949c456f9b1c63b3d5534be142c2e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jens Scharsig9bbaae32010-02-03 22:47:35 +01002/*
3 * (C) Copyright 2002
4 * Lineo, Inc. <www.lineo.com>
5 * Bernhard Kuhn <bkuhn@lineo.com>
6 *
7 * (C) Copyright 2002
8 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
9 * Marius Groeger <mgroeger@sysgo.de>
10 *
11 * (C) Copyright 2002
12 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
13 * Alex Zuepke <azu@sysgo.de>
Jens Scharsig9bbaae32010-02-03 22:47:35 +010014 */
15
16#include <common.h>
17#include <asm/io.h>
18#include <asm/arch/hardware.h>
19#include <asm/arch/at91_st.h>
20
Andreas Bießmann470b4b02010-11-30 09:45:05 +000021void __attribute__((weak)) board_reset(void)
22{
23 /* true empty function for defining weak symbol */
24}
Jens Scharsig9bbaae32010-02-03 22:47:35 +010025
26void reset_cpu(ulong ignored)
27{
Jens Scharsig58aa5632011-02-19 06:17:02 +000028 at91_st_t *st = (at91_st_t *) ATMEL_BASE_ST;
Jens Scharsig9bbaae32010-02-03 22:47:35 +010029
Andreas Bießmann470b4b02010-11-30 09:45:05 +000030 board_reset();
Jens Scharsig9bbaae32010-02-03 22:47:35 +010031
32 /* Reset the cpu by setting up the watchdog timer */
33 writel(AT91_ST_WDMR_RSTEN | AT91_ST_WDMR_EXTEN | AT91_ST_WDMR_WDV(2),
34 &st->wdmr);
35 writel(AT91_ST_CR_WDRST, &st->cr);
36 /* and let it timeout */
37 while (1)
38 ;
39 /* Never reached */
40}