blob: e7649867372555b692338df81cd8fa030cbbf1d5 [file] [log] [blame]
Ilya Yanok416a41f2009-06-08 04:12:45 +04001/*
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 Denkd79de1d2013-07-08 09:37:19 +020016 * SPDX-License-Identifier: GPL-2.0+
Ilya Yanok416a41f2009-06-08 04:12:45 +040017 */
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 Estevamf231efb2011-10-13 05:34:59 +000026void reset_cpu(ulong ignored)
Ilya Yanok416a41f2009-06-08 04:12:45 +040027{
28 struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
29 /* Disable watchdog and set Time-Out field to 0 */
Leonid Iziumtsev3056e502016-03-20 14:10:55 +010030 writew(0x0000, &regs->wcr);
Ilya Yanok416a41f2009-06-08 04:12:45 +040031
32 /* Write Service Sequence */
Leonid Iziumtsev3056e502016-03-20 14:10:55 +010033 writew(0x5555, &regs->wsr);
34 writew(0xAAAA, &regs->wsr);
Ilya Yanok416a41f2009-06-08 04:12:45 +040035
36 /* Enable watchdog */
Leonid Iziumtsev3056e502016-03-20 14:10:55 +010037 writew(WCR_WDE, &regs->wcr);
Ilya Yanok416a41f2009-06-08 04:12:45 +040038
39 while (1);
40 /*NOTREACHED*/
41}