Initial revision
[platform/kernel/u-boot.git] / include / cmd_usb.h
1 /*
2  * (C) Copyright 2001
3  * Denis Peter, MPL AG Switzerland
4  *
5  * See file CREDITS for list of people who contributed to this
6  * project.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of
11  * the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  * MA 02111-1307 USA
22  *
23  */
24 #ifndef _CMD_USB_H
25 #define _CMD_USB_H
26
27 #include <common.h>
28 #include <command.h>
29
30
31 #if (CONFIG_COMMANDS & CFG_CMD_USB)
32
33 #ifdef CONFIG_USB_STORAGE
34 #define CMD_TBL_USB     MK_CMD_TBL_ENTRY(                                       \
35         "usb",  4,      5,      1,      do_usb,                         \
36         "usb     - USB sub-system\n",                                           \
37         "reset - reset (rescan) USB controller\n"                                       \
38         "usb  stop [f]  - stop USB [f]=force stop\n"                            \
39         "usb  tree  - show USB device tree\n"                           \
40         "usb  info [dev] - show available USB devices\n"                                \
41         "usb  scan  - (re-)scan USB bus for storage devices\n"                                  \
42         "usb  device [dev] - show or set current USB storage device\n"                  \
43         "usb  part [dev] - print partition table of one or all USB storage devices\n"   \
44         "usb  read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"\
45         "     to memory address `addr'\n"                                       \
46 ),
47
48
49 #define CMD_TBL_USBBOOT MK_CMD_TBL_ENTRY(                                       \
50         "usbboot",      5,      3,      1,      do_usbboot,                                     \
51         "usbboot - boot from USB device\n",                                             \
52         "loadAddr dev:part\n"                   \
53 ),
54
55 #else
56 #define CMD_TBL_USB     MK_CMD_TBL_ENTRY(                                       \
57         "usb",  4,      5,      1,      do_usb,                         \
58         "usb     - USB sub-system\n",                                           \
59         "reset - reset (rescan) USB controller\n"                                       \
60         "usb  tree  - show USB device tree\n"                           \
61         "usb  info [dev] - show available USB devices\n"                                \
62 ),
63
64 #define CMD_TBL_USBBOOT
65 #endif
66
67 int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
68 int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
69
70
71 #else
72 #define CMD_TBL_USB
73 #define CMD_TBL_USBBOOT
74 #endif
75
76 #endif  /* _CMD_USB_H */
77