2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2009-06-08 00:12:45 +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>
|
2009-06-08 00:12:45 +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
|
|
|
|
*/
|
2020-12-15 15:47:52 +00:00
|
|
|
void reset_cpu(void)
|
2009-06-08 00:12:45 +00:00
|
|
|
{
|
|
|
|
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
|
|
|
/* Disable watchdog and set Time-Out field to 0 */
|
2016-03-20 13:10:55 +00:00
|
|
|
writew(0x0000, ®s->wcr);
|
2009-06-08 00:12:45 +00:00
|
|
|
|
|
|
|
/* Write Service Sequence */
|
2016-03-20 13:10:55 +00:00
|
|
|
writew(0x5555, ®s->wsr);
|
|
|
|
writew(0xAAAA, ®s->wsr);
|
2009-06-08 00:12:45 +00:00
|
|
|
|
|
|
|
/* Enable watchdog */
|
2016-03-20 13:10:55 +00:00
|
|
|
writew(WCR_WDE, ®s->wcr);
|
2009-06-08 00:12:45 +00:00
|
|
|
|
|
|
|
while (1);
|
|
|
|
/*NOTREACHED*/
|
|
|
|
}
|