blob: 65b4be20b819fc6cfb2aec14babb7c29e33f8458 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +02002/*
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
Detlev Zundel792a09e2009-05-13 10:54:10 +020012 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020013 *
14 * (C) Copyright 2004
15 * DAVE Srl
16 * http://www.dave-tech.it
17 * http://www.wawnet.biz
18 * mailto:info@wawnet.biz
19 *
20 * (C) Copyright 2004 Texas Insturments
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020021 */
22
23#include <common.h>
Simon Glass09140112020-05-10 11:40:03 -060024#include <command.h>
Simon Glass9a3b4ce2019-12-28 10:45:01 -070025#include <cpu_func.h>
Simon Glass36bf4462019-11-14 12:57:42 -070026#include <irq_func.h>
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020027
Przemyslaw Marczak1fb4dab2014-09-01 13:50:48 +020028__weak void reset_misc(void)
29{
30}
31
Simon Glass09140112020-05-10 11:40:03 -060032int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020033{
34 puts ("resetting ...\n");
35
Simon Glass09140112020-05-10 11:40:03 -060036 mdelay(50); /* wait 50 ms */
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020037
38 disable_interrupts();
Przemyslaw Marczak1fb4dab2014-09-01 13:50:48 +020039
40 reset_misc();
Jean-Christophe PLAGNIOL-VILLARDab298232009-04-05 13:08:03 +020041 reset_cpu(0);
42
43 /*NOTREACHED*/
44 return 0;
45}