2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2010-01-26 06:12:56 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
|
|
* Marius Groeger <mgroeger@sysgo.de>
|
|
|
|
*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
|
|
|
* Alex Zuepke <azu@sysgo.de>
|
|
|
|
*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
|
|
|
*
|
|
|
|
* (C) Copyright 2009
|
|
|
|
* Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-28 17:45:01 +00:00
|
|
|
#include <cpu_func.h>
|
2010-01-26 06:12:56 +00:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/imx-regs.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reset the cpu by setting up the watchdog timer and let it time out
|
|
|
|
*/
|
2011-10-13 05:34:59 +00:00
|
|
|
void reset_cpu(ulong ignored)
|
2010-01-26 06:12:56 +00:00
|
|
|
{
|
|
|
|
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
|
|
|
/* Disable watchdog and set Time-Out field to 0 */
|
2010-10-27 14:34:38 +00:00
|
|
|
writew(0, ®s->wcr);
|
2010-01-26 06:12:56 +00:00
|
|
|
|
|
|
|
/* Write Service Sequence */
|
2010-10-27 14:34:38 +00:00
|
|
|
writew(WSR_UNLOCK1, ®s->wsr);
|
|
|
|
writew(WSR_UNLOCK2, ®s->wsr);
|
2010-01-26 06:12:56 +00:00
|
|
|
|
|
|
|
/* Enable watchdog */
|
2010-10-27 14:34:38 +00:00
|
|
|
writew(WCR_WDE, ®s->wcr);
|
2010-01-26 06:12:56 +00:00
|
|
|
|
|
|
|
while (1) ;
|
|
|
|
}
|