John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 4 | * Marius Groeger <mgroeger@sysgo.de> |
| 5 | * |
| 6 | * (C) Copyright 2002 |
| 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 8 | * Alex Zuepke <azu@sysgo.de> |
| 9 | * |
| 10 | * (C) Copyright 2002 |
| 11 | * Gary Jennejohn, DENX Software Engineering, <gj@denx.de> |
| 12 | * |
| 13 | * (C) Copyright 2009 |
| 14 | * Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com> |
| 15 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 16 | * SPDX-License-Identifier: GPL-2.0+ |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 17 | */ |
| 18 | |
| 19 | #include <common.h> |
| 20 | #include <asm/io.h> |
| 21 | #include <asm/arch/imx-regs.h> |
| 22 | |
| 23 | /* |
| 24 | * Reset the cpu by setting up the watchdog timer and let it time out |
| 25 | */ |
Fabio Estevam | f231efb | 2011-10-13 05:34:59 +0000 | [diff] [blame] | 26 | void reset_cpu(ulong ignored) |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 27 | { |
| 28 | struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE; |
| 29 | /* Disable watchdog and set Time-Out field to 0 */ |
Matthias Weisser | 0fe61ce | 2010-10-27 16:34:38 +0200 | [diff] [blame] | 30 | writew(0, ®s->wcr); |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 31 | |
| 32 | /* Write Service Sequence */ |
Matthias Weisser | 0fe61ce | 2010-10-27 16:34:38 +0200 | [diff] [blame] | 33 | writew(WSR_UNLOCK1, ®s->wsr); |
| 34 | writew(WSR_UNLOCK2, ®s->wsr); |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 35 | |
| 36 | /* Enable watchdog */ |
Matthias Weisser | 0fe61ce | 2010-10-27 16:34:38 +0200 | [diff] [blame] | 37 | writew(WCR_WDE, ®s->wcr); |
John Rigby | 9c14603 | 2010-01-25 23:12:56 -0700 | [diff] [blame] | 38 | |
| 39 | while (1) ; |
| 40 | } |