Jens Scharsig | 98250e8 | 2010-02-03 22:47:35 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Lineo, Inc. <www.lineo.com> |
| 4 | * Bernhard Kuhn <bkuhn@lineo.com> |
| 5 | * |
| 6 | * (C) Copyright 2002 |
| 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 8 | * Marius Groeger <mgroeger@sysgo.de> |
| 9 | * |
| 10 | * (C) Copyright 2002 |
| 11 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 12 | * Alex Zuepke <azu@sysgo.de> |
| 13 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 14 | * SPDX-License-Identifier: GPL-2.0+ |
Jens Scharsig | 98250e8 | 2010-02-03 22:47:35 +0100 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <common.h> |
| 18 | #include <asm/io.h> |
| 19 | #include <asm/arch/hardware.h> |
| 20 | #include <asm/arch/at91_st.h> |
| 21 | |
Andreas Bießmann | 305bf48 | 2010-11-30 09:45:05 +0000 | [diff] [blame] | 22 | void __attribute__((weak)) board_reset(void) |
| 23 | { |
| 24 | /* true empty function for defining weak symbol */ |
| 25 | } |
Jens Scharsig | 98250e8 | 2010-02-03 22:47:35 +0100 | [diff] [blame] | 26 | |
| 27 | void reset_cpu(ulong ignored) |
| 28 | { |
Jens Scharsig | 8073399 | 2011-02-19 06:17:02 +0000 | [diff] [blame] | 29 | at91_st_t *st = (at91_st_t *) ATMEL_BASE_ST; |
Jens Scharsig | 98250e8 | 2010-02-03 22:47:35 +0100 | [diff] [blame] | 30 | |
Andreas Bießmann | 305bf48 | 2010-11-30 09:45:05 +0000 | [diff] [blame] | 31 | board_reset(); |
Jens Scharsig | 98250e8 | 2010-02-03 22:47:35 +0100 | [diff] [blame] | 32 | |
| 33 | /* Reset the cpu by setting up the watchdog timer */ |
| 34 | writel(AT91_ST_WDMR_RSTEN | AT91_ST_WDMR_EXTEN | AT91_ST_WDMR_WDV(2), |
| 35 | &st->wdmr); |
| 36 | writel(AT91_ST_CR_WDRST, &st->cr); |
| 37 | /* and let it timeout */ |
| 38 | while (1) |
| 39 | ; |
| 40 | /* Never reached */ |
| 41 | } |