blob: 576f7fac6faa151f5814d53f9cc8d4718f31ac47 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
John Rigby9c146032010-01-25 23:12:56 -07002/*
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 Rigby9c146032010-01-25 23:12:56 -070016 */
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 Estevamf231efb2011-10-13 05:34:59 +000025void reset_cpu(ulong ignored)
John Rigby9c146032010-01-25 23:12:56 -070026{
27 struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
28 /* Disable watchdog and set Time-Out field to 0 */
Matthias Weisser0fe61ce2010-10-27 16:34:38 +020029 writew(0, &regs->wcr);
John Rigby9c146032010-01-25 23:12:56 -070030
31 /* Write Service Sequence */
Matthias Weisser0fe61ce2010-10-27 16:34:38 +020032 writew(WSR_UNLOCK1, &regs->wsr);
33 writew(WSR_UNLOCK2, &regs->wsr);
John Rigby9c146032010-01-25 23:12:56 -070034
35 /* Enable watchdog */
Matthias Weisser0fe61ce2010-10-27 16:34:38 +020036 writew(WCR_WDE, &regs->wcr);
John Rigby9c146032010-01-25 23:12:56 -070037
38 while (1) ;
39}