blob: fc75ad87acbfe4a7d8d8139b631e17d2fd69619d [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*******************************************************************************
2 * Copyright (C) 2016, ZIXC Corporation.
3 *
4 * File Name:cmd_cp_reset.c
5 * File Mark:
6 * Description:
7 * Others:
8 * Version: 1.0
9 * Author: zangxiaofeng
10 * Date: 2013-4-22
11 * History 1:
12 * Date:
13 * Version:
14 * Author:
15 * Modification:
16 * History 2:
17 ********************************************************************************/
18
19
20/****************************************************************************
21* Include files
22****************************************************************************/
23#include <common.h>
24#include <command.h>
25#include <net.h>
26#include <jffs2/load_kernel.h>
27#include "downloader_nand.h"
28#include "downloader_config.h"
29#include "errno.h"
30#include <asm/io.h>
31
32/****************************************************************************
33* Global Function Prototypes
34****************************************************************************/
35
36extern int downloader_serial_write(const char * buffer,unsigned int len);
37extern char *tsp_console_buffer;
38
39/*******************************************************************************
40 * Function:do_reboot
41 * Description:
42 * Parameters:
43 * Input:
44 *
45 * Output:
46 *
47 * Returns:
48 *
49 *
50 * Others:
51 ********************************************************************************/
52int do_reboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
53{
54 char *ack = tsp_console_buffer;
55 uint32_t reg_start = 0;
56
57 if(argc < 1)
58 {
59 return cmd_usage(cmdtp);
60 }
61
62 sprintf(ack,"OKAY REBOOT");
63 downloader_serial_write(ack, strlen(ack)+1);
64
65 run_command("reset",0);
66 return 0;
67}
68
69U_BOOT_CMD(
70 reboot, CONFIG_SYS_MAXARGS, 0, do_reboot,
71 "reboot: reboot",
72 ""
73);
74
75