blob: 3e051e36f12dd0739934d4b7c2ece9fdb7ecb06f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-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 Zundelf1b3f2b2009-05-13 10:54:10 +020012 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-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-VILLARD189b87a2009-04-05 13:08:03 +020021 */
22
23#include <common.h>
Simon Glassed38aef2020-05-10 11:40:03 -060024#include <command.h>
Simon Glassafb02152019-12-28 10:45:01 -070025#include <cpu_func.h>
Simon Glass8f3f7612019-11-14 12:57:42 -070026#include <irq_func.h>
Simon Glassdbd79542020-05-10 11:40:11 -060027#include <linux/delay.h>
Tony Dinh88d0f5b2023-03-14 17:24:26 -070028#include <stdio.h>
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-04-05 13:08:03 +020029
Przemyslaw Marczakec1c1222014-09-01 13:50:48 +020030__weak void reset_misc(void)
31{
32}
33
Simon Glassed38aef2020-05-10 11:40:03 -060034int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-04-05 13:08:03 +020035{
36 puts ("resetting ...\n");
Tony Dinh88d0f5b2023-03-14 17:24:26 -070037 flush();
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-04-05 13:08:03 +020038
39 disable_interrupts();
Przemyslaw Marczakec1c1222014-09-01 13:50:48 +020040
41 reset_misc();
Harald Seiler6f14d5f2020-12-15 16:47:52 +010042 reset_cpu();
Jean-Christophe PLAGNIOL-VILLARD189b87a2009-04-05 13:08:03 +020043
44 /*NOTREACHED*/
45 return 0;
46}