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