2007-07-05 16:02:19 +00:00
|
|
|
/*
|
|
|
|
* reset.c - reset the cpu
|
|
|
|
*
|
|
|
|
* Copyright (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-07-05 16:02:13 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version
for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-06-07 09:32:02 +00:00
|
|
|
#include <complete.h>
|
2013-01-29 11:03:05 +00:00
|
|
|
#include <getopt.h>
|
2007-07-05 16:02:13 +00:00
|
|
|
|
2011-12-21 13:18:57 +00:00
|
|
|
static int cmd_reset(int argc, char *argv[])
|
2007-07-05 16:02:13 +00:00
|
|
|
{
|
2013-01-29 11:03:05 +00:00
|
|
|
int opt, shutdown_flag;
|
|
|
|
|
|
|
|
shutdown_flag = 1;
|
|
|
|
|
|
|
|
while ((opt = getopt(argc, argv, "f")) > 0) {
|
|
|
|
switch (opt) {
|
|
|
|
case 'f':
|
|
|
|
shutdown_flag = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (shutdown_flag)
|
|
|
|
shutdown_barebox();
|
|
|
|
|
2007-07-05 16:02:18 +00:00
|
|
|
reset_cpu(0);
|
2007-07-05 16:02:13 +00:00
|
|
|
|
|
|
|
/* Not reached */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2013-01-29 11:03:05 +00:00
|
|
|
BAREBOX_CMD_HELP_START(reset)
|
|
|
|
BAREBOX_CMD_HELP_USAGE("reset [-f]\n")
|
|
|
|
BAREBOX_CMD_HELP_SHORT("Perform RESET of the CPU.\n")
|
|
|
|
BAREBOX_CMD_HELP_OPT("-f", "force RESET, don't call shutdown\n")
|
|
|
|
BAREBOX_CMD_HELP_END
|
|
|
|
|
2009-12-15 08:11:09 +00:00
|
|
|
BAREBOX_CMD_START(reset)
|
2007-07-05 16:02:13 +00:00
|
|
|
.cmd = cmd_reset,
|
|
|
|
.usage = "Perform RESET of the CPU",
|
2013-01-29 11:03:05 +00:00
|
|
|
BAREBOX_CMD_HELP(cmd_reset_help)
|
complete: add empty complete support
for cpuinfo, clear, dhcp, false, login, lsmod, meminfo, passwd, pwd, reginfo,
reset, true, usb, version
for mach-imx and mach-mxs: dump_clocks
for u_serial: mycdev
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-06-07 09:32:02 +00:00
|
|
|
BAREBOX_CMD_COMPLETE(empty_complete)
|
2009-12-15 08:11:09 +00:00
|
|
|
BAREBOX_CMD_END
|