summaryrefslogtreecommitdiff
path: root/include/cmd_boot.h
blob: 1bd93145233e76a7475a7c7f5b14100ae64d90d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
 * (C) Copyright 2000
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 *
 * 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 as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 */

/*
 * Boot support
 */
#ifndef	_CMD_BOOT_H
#define	_CMD_BOOT_H

#if (CONFIG_COMMANDS & CFG_CMD_BDI)
#define	CMD_TBL_BDINFO	MK_CMD_TBL_ENTRY(					\
	"bdinfo",	2,	1,	1,	do_bdinfo,			\
	"bdinfo  - print Board Info structure\n",				\
	NULL									\
),
int do_bdinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

#else
#define CMD_TBL_BDINFO
#endif


#define CMD_TBL_GO	MK_CMD_TBL_ENTRY(					\
	"go",		2,	CFG_MAXARGS,	1,	do_go,			\
	"go      - start application at address 'addr'\n",			\
	"addr [arg ...]\n    - start application at address 'addr'\n"		\
	"      passing 'arg' as arguments\n"					\
),
int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

#if (CONFIG_COMMANDS & CFG_CMD_LOADS)
#ifdef	CFG_LOADS_BAUD_CHANGE
#define	CMD_TBL_LOADS	MK_CMD_TBL_ENTRY(					\
	"loads",	5,	3,	0,	do_load_serial,			\
	"loads   - load S-Record file over serial line\n",			\
	"[ off ] [ baud ]\n"							\
	"    - load S-Record file over serial line"				\
	" with offset 'off' and baudrate 'baud'\n"				\
),
#else	/* ! CFG_LOADS_BAUD_CHANGE */
#define	CMD_TBL_LOADS	MK_CMD_TBL_ENTRY(					\
	"loads",	5,	2,	0,	do_load_serial,			\
	"loads   - load S-Record file over serial line\n",			\
	"[ off ]\n"								\
	"    - load S-Record file over serial line with offset 'off'\n"		\
),
#endif	/* CFG_LOADS_BAUD_CHANGE */
int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

/*
 * SAVES always requires LOADS support, but not vice versa
 */
#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
#ifdef	CFG_LOADS_BAUD_CHANGE
#define	CMD_TBL_SAVES	MK_CMD_TBL_ENTRY(					\
	"saves",	5,	4,	0,	do_save_serial,			\
	"saves   - save S-Record file over serial line\n",			\
	"[ off ] [size] [ baud ]\n"							\
	"    - save S-Record file over serial line"				\
	" with offset 'off', size 'size' and baudrate 'baud'\n"				\
),
#else	/* ! CFG_LOADS_BAUD_CHANGE */
#define	CMD_TBL_SAVES	MK_CMD_TBL_ENTRY(					\
	"saves",	5,	3,	0,	do_save_serial,			\
	"saves   - save S-Record file over serial line\n",			\
	"[ off ] [size]\n"								\
	"    - save S-Record file over serial line with offset 'off' and size 'size'\n"		\
),
#endif	/* CFG_LOADS_BAUD_CHANGE */

int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
#else	/* ! CFG_CMD_SAVES */
#define CMD_TBL_SAVES
#endif	/* CFG_CMD_SAVES */

#else	/* ! CFG_CMD_LOADS */
#define CMD_TBL_LOADS
#define CMD_TBL_SAVES
#endif	/* CFG_CMD_LOADS */


#if (CONFIG_COMMANDS & CFG_CMD_LOADB)
#define	CMD_TBL_LOADB	MK_CMD_TBL_ENTRY(					\
	"loadb",	5,	3,	0,	do_load_serial_bin,		\
	"loadb   - load binary file over serial line (kermit mode)\n",		\
	"[ off ] [ baud ]\n"							\
	"    - load binary file over serial line"				\
	" with offset 'off' and baudrate 'baud'\n"				\
),
int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

#else
#define CMD_TBL_LOADB
#endif	/* CFG_CMD_LOADB */

#define CMD_TBL_RESET	MK_CMD_TBL_ENTRY(					\
	"reset",	5,	1,	0,	do_reset,			\
	"reset   - Perform RESET of the CPU\n",					\
	NULL									\
),

/* Implemented in $(CPU)/cpu.c */
int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

#if (CONFIG_COMMANDS & CFG_CMD_HWFLOW)
#define	CMD_TBL_HWFLOW	MK_CMD_TBL_ENTRY(					\
	"hwflow [on|off]",	2,	2,	0,	do_hwflow,			\
    "hwflow  - turn the harwdare flow control on/off\n", \
	"\n - change RTS/CTS hardware flow control over serial line\n" \
),

int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);

#else
#define CMD_TBL_HWFLOW
#endif
#endif	/* _CMD_BOOT_H */