Merge tag 'efi-2020-07-rc6' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / mx27 / reset.c
1 // SPDX-License-Identifier: GPL-2.0+
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>
16  */
17
18 #include <common.h>
19 #include <cpu_func.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  */
26 void reset_cpu(ulong ignored)
27 {
28         struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
29         /* Disable watchdog and set Time-Out field to 0 */
30         writew(0x0000, &regs->wcr);
31
32         /* Write Service Sequence */
33         writew(0x5555, &regs->wsr);
34         writew(0xAAAA, &regs->wsr);
35
36         /* Enable watchdog */
37         writew(WCR_WDE, &regs->wcr);
38
39         while (1);
40         /*NOTREACHED*/
41 }