cmd_usb.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland
  4. *
  5. * Most of this source has been derived from the Linux USB
  6. * project.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. *
  26. */
  27. #include <common.h>
  28. #include <command.h>
  29. #include <asm/byteorder.h>
  30. #include <part.h>
  31. #include <usb.h>
  32. #ifdef CONFIG_USB_STORAGE
  33. static int usb_stor_curr_dev=-1; /* current device */
  34. #endif
  35. /* some display routines (info command) */
  36. char * usb_get_class_desc(unsigned char dclass)
  37. {
  38. switch(dclass) {
  39. case USB_CLASS_PER_INTERFACE:
  40. return("See Interface");
  41. case USB_CLASS_AUDIO:
  42. return("Audio");
  43. case USB_CLASS_COMM:
  44. return("Communication");
  45. case USB_CLASS_HID:
  46. return("Human Interface");
  47. case USB_CLASS_PRINTER:
  48. return("Printer");
  49. case USB_CLASS_MASS_STORAGE:
  50. return("Mass Storage");
  51. case USB_CLASS_HUB:
  52. return("Hub");
  53. case USB_CLASS_DATA:
  54. return("CDC Data");
  55. case USB_CLASS_VENDOR_SPEC:
  56. return("Vendor specific");
  57. default :
  58. return("");
  59. }
  60. }
  61. void usb_display_class_sub(unsigned char dclass,unsigned char subclass,unsigned char proto)
  62. {
  63. switch(dclass) {
  64. case USB_CLASS_PER_INTERFACE:
  65. printf("See Interface");
  66. break;
  67. case USB_CLASS_HID:
  68. printf("Human Interface, Subclass: ");
  69. switch(subclass) {
  70. case USB_SUB_HID_NONE:
  71. printf("None");
  72. break;
  73. case USB_SUB_HID_BOOT:
  74. printf("Boot ");
  75. switch(proto) {
  76. case USB_PROT_HID_NONE:
  77. printf("None");
  78. break;
  79. case USB_PROT_HID_KEYBOARD:
  80. printf("Keyboard");
  81. break;
  82. case USB_PROT_HID_MOUSE:
  83. printf("Mouse");
  84. break;
  85. default:
  86. printf("reserved");
  87. }
  88. break;
  89. default:
  90. printf("reserved");
  91. }
  92. break;
  93. case USB_CLASS_MASS_STORAGE:
  94. printf("Mass Storage, ");
  95. switch(subclass) {
  96. case US_SC_RBC:
  97. printf("RBC ");
  98. break;
  99. case US_SC_8020:
  100. printf("SFF-8020i (ATAPI)");
  101. break;
  102. case US_SC_QIC:
  103. printf("QIC-157 (Tape)");
  104. break;
  105. case US_SC_UFI:
  106. printf("UFI");
  107. break;
  108. case US_SC_8070:
  109. printf("SFF-8070");
  110. break;
  111. case US_SC_SCSI:
  112. printf("Transp. SCSI");
  113. break;
  114. default:
  115. printf("reserved");
  116. break;
  117. }
  118. printf(", ");
  119. switch(proto) {
  120. case US_PR_CB:
  121. printf("Command/Bulk");
  122. break;
  123. case US_PR_CBI:
  124. printf("Command/Bulk/Int");
  125. break;
  126. case US_PR_BULK:
  127. printf("Bulk only");
  128. break;
  129. default:
  130. printf("reserved");
  131. }
  132. break;
  133. default:
  134. printf("%s",usb_get_class_desc(dclass));
  135. }
  136. }
  137. void usb_display_string(struct usb_device *dev,int index)
  138. {
  139. char buffer[256];
  140. if (index!=0) {
  141. if (usb_string(dev,index,&buffer[0],256)>0);
  142. printf("String: \"%s\"",buffer);
  143. }
  144. }
  145. void usb_display_desc(struct usb_device *dev)
  146. {
  147. if (dev->descriptor.bDescriptorType==USB_DT_DEVICE) {
  148. printf("%d: %s, USB Revision %x.%x\n",dev->devnum,usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass),
  149. (dev->descriptor.bcdUSB>>8) & 0xff,dev->descriptor.bcdUSB & 0xff);
  150. if (strlen(dev->mf) || strlen(dev->prod) || strlen(dev->serial))
  151. printf(" - %s %s %s\n",dev->mf,dev->prod,dev->serial);
  152. if (dev->descriptor.bDeviceClass) {
  153. printf(" - Class: ");
  154. usb_display_class_sub(dev->descriptor.bDeviceClass,dev->descriptor.bDeviceSubClass,dev->descriptor.bDeviceProtocol);
  155. printf("\n");
  156. }
  157. else {
  158. printf(" - Class: (from Interface) %s\n",usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass));
  159. }
  160. printf(" - PacketSize: %d Configurations: %d\n",dev->descriptor.bMaxPacketSize0,dev->descriptor.bNumConfigurations);
  161. printf(" - Vendor: 0x%04x Product 0x%04x Version %d.%d\n",dev->descriptor.idVendor,dev->descriptor.idProduct,(dev->descriptor.bcdDevice>>8) & 0xff,dev->descriptor.bcdDevice & 0xff);
  162. }
  163. }
  164. void usb_display_conf_desc(struct usb_config_descriptor *config,struct usb_device *dev)
  165. {
  166. printf(" Configuration: %d\n",config->bConfigurationValue);
  167. printf(" - Interfaces: %d %s%s%dmA\n",config->bNumInterfaces,(config->bmAttributes & 0x40) ? "Self Powered " : "Bus Powered ",
  168. (config->bmAttributes & 0x20) ? "Remote Wakeup " : "",config->MaxPower*2);
  169. if (config->iConfiguration) {
  170. printf(" - ");
  171. usb_display_string(dev,config->iConfiguration);
  172. printf("\n");
  173. }
  174. }
  175. void usb_display_if_desc(struct usb_interface_descriptor *ifdesc,struct usb_device *dev)
  176. {
  177. printf(" Interface: %d\n",ifdesc->bInterfaceNumber);
  178. printf(" - Alternate Setting %d, Endpoints: %d\n",ifdesc->bAlternateSetting,ifdesc->bNumEndpoints);
  179. printf(" - Class ");
  180. usb_display_class_sub(ifdesc->bInterfaceClass,ifdesc->bInterfaceSubClass,ifdesc->bInterfaceProtocol);
  181. printf("\n");
  182. if (ifdesc->iInterface) {
  183. printf(" - ");
  184. usb_display_string(dev,ifdesc->iInterface);
  185. printf("\n");
  186. }
  187. }
  188. void usb_display_ep_desc(struct usb_endpoint_descriptor *epdesc)
  189. {
  190. printf(" - Endpoint %d %s ",epdesc->bEndpointAddress & 0xf,(epdesc->bEndpointAddress & 0x80) ? "In" : "Out");
  191. switch((epdesc->bmAttributes & 0x03))
  192. {
  193. case 0: printf("Control"); break;
  194. case 1: printf("Isochronous"); break;
  195. case 2: printf("Bulk"); break;
  196. case 3: printf("Interrupt"); break;
  197. }
  198. printf(" MaxPacket %d",epdesc->wMaxPacketSize);
  199. if ((epdesc->bmAttributes & 0x03)==0x3)
  200. printf(" Interval %dms",epdesc->bInterval);
  201. printf("\n");
  202. }
  203. /* main routine to diasplay the configs, interfaces and endpoints */
  204. void usb_display_config(struct usb_device *dev)
  205. {
  206. struct usb_config_descriptor *config;
  207. struct usb_interface_descriptor *ifdesc;
  208. struct usb_endpoint_descriptor *epdesc;
  209. int i,ii;
  210. config= &dev->config;
  211. usb_display_conf_desc(config,dev);
  212. for(i=0;i<config->no_of_if;i++) {
  213. ifdesc= &config->if_desc[i];
  214. usb_display_if_desc(ifdesc,dev);
  215. for(ii=0;ii<ifdesc->no_of_ep;ii++) {
  216. epdesc= &ifdesc->ep_desc[ii];
  217. usb_display_ep_desc(epdesc);
  218. }
  219. }
  220. printf("\n");
  221. }
  222. /* shows the device tree recursively */
  223. void usb_show_tree_graph(struct usb_device *dev,char *pre)
  224. {
  225. int i,index;
  226. int has_child,last_child,port;
  227. index=strlen(pre);
  228. printf(" %s",pre);
  229. /* check if the device has connected children */
  230. has_child=0;
  231. for(i=0;i<dev->maxchild;i++) {
  232. if (dev->children[i]!=NULL)
  233. has_child=1;
  234. }
  235. /* check if we are the last one */
  236. last_child=1;
  237. if (dev->parent!=NULL) {
  238. for(i=0;i<dev->parent->maxchild;i++) {
  239. /* search for children */
  240. if (dev->parent->children[i]==dev) {
  241. /* found our pointer, see if we have a little sister */
  242. port=i;
  243. while(i++<dev->parent->maxchild) {
  244. if (dev->parent->children[i]!=NULL) {
  245. /* found a sister */
  246. last_child=0;
  247. break;
  248. } /* if */
  249. } /* while */
  250. } /* device found */
  251. } /* for all children of the parent */
  252. printf("\b+-");
  253. /* correct last child */
  254. if (last_child) {
  255. pre[index-1]=' ';
  256. }
  257. } /* if not root hub */
  258. else
  259. printf(" ");
  260. printf("%d ",dev->devnum);
  261. pre[index++]=' ';
  262. pre[index++]= has_child ? '|' : ' ';
  263. pre[index]=0;
  264. printf(" %s (%s, %dmA)\n",usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass),
  265. dev->slow ? "1.5MBit/s" : "12MBit/s",dev->config.MaxPower * 2);
  266. if (strlen(dev->mf) ||
  267. strlen(dev->prod) ||
  268. strlen(dev->serial))
  269. printf(" %s %s %s %s\n",pre,dev->mf,dev->prod,dev->serial);
  270. printf(" %s\n",pre);
  271. if (dev->maxchild>0) {
  272. for(i=0;i<dev->maxchild;i++) {
  273. if (dev->children[i]!=NULL) {
  274. usb_show_tree_graph(dev->children[i],pre);
  275. pre[index]=0;
  276. }
  277. }
  278. }
  279. }
  280. /* main routine for the tree command */
  281. void usb_show_tree(struct usb_device *dev)
  282. {
  283. char preamble[32];
  284. memset(preamble,0,32);
  285. usb_show_tree_graph(dev,&preamble[0]);
  286. }
  287. /******************************************************************************
  288. * usb boot command intepreter. Derived from diskboot
  289. */
  290. #ifdef CONFIG_USB_STORAGE
  291. int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  292. {
  293. char *boot_device = NULL;
  294. char *ep;
  295. int dev, part=1, rcode;
  296. ulong addr, cnt;
  297. disk_partition_t info;
  298. image_header_t *hdr;
  299. block_dev_desc_t *stor_dev;
  300. #if defined(CONFIG_FIT)
  301. const void *fit_hdr = NULL;
  302. #endif
  303. switch (argc) {
  304. case 1:
  305. addr = CFG_LOAD_ADDR;
  306. boot_device = getenv ("bootdevice");
  307. break;
  308. case 2:
  309. addr = simple_strtoul(argv[1], NULL, 16);
  310. boot_device = getenv ("bootdevice");
  311. break;
  312. case 3:
  313. addr = simple_strtoul(argv[1], NULL, 16);
  314. boot_device = argv[2];
  315. break;
  316. default:
  317. printf ("Usage:\n%s\n", cmdtp->usage);
  318. return 1;
  319. }
  320. if (!boot_device) {
  321. puts ("\n** No boot device **\n");
  322. return 1;
  323. }
  324. dev = simple_strtoul(boot_device, &ep, 16);
  325. stor_dev=usb_stor_get_dev(dev);
  326. if (stor_dev->type == DEV_TYPE_UNKNOWN) {
  327. printf ("\n** Device %d not available\n", dev);
  328. return 1;
  329. }
  330. if (stor_dev->block_read==NULL) {
  331. printf("storage device not initialized. Use usb scan\n");
  332. return 1;
  333. }
  334. if (*ep) {
  335. if (*ep != ':') {
  336. puts ("\n** Invalid boot device, use `dev[:part]' **\n");
  337. return 1;
  338. }
  339. part = simple_strtoul(++ep, NULL, 16);
  340. }
  341. if (get_partition_info (stor_dev, part, &info)) {
  342. /* try to boot raw .... */
  343. strncpy((char *)&info.type[0], BOOT_PART_TYPE, sizeof(BOOT_PART_TYPE));
  344. strncpy((char *)&info.name[0], "Raw", 4);
  345. info.start=0;
  346. info.blksz=0x200;
  347. info.size=2880;
  348. printf("error reading partinfo...try to boot raw\n");
  349. }
  350. if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
  351. (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
  352. printf ("\n** Invalid partition type \"%.32s\""
  353. " (expect \"" BOOT_PART_TYPE "\")\n",
  354. info.type);
  355. return 1;
  356. }
  357. printf ("\nLoading from USB device %d, partition %d: "
  358. "Name: %.32s Type: %.32s\n",
  359. dev, part, info.name, info.type);
  360. debug ("First Block: %ld, # of blocks: %ld, Block Size: %ld\n",
  361. info.start, info.size, info.blksz);
  362. if (stor_dev->block_read(dev, info.start, 1, (ulong *)addr) != 1) {
  363. printf ("** Read error on %d:%d\n", dev, part);
  364. return 1;
  365. }
  366. switch (genimg_get_format ((void *)addr)) {
  367. case IMAGE_FORMAT_LEGACY:
  368. hdr = (image_header_t *)addr;
  369. if (!image_check_hcrc (hdr)) {
  370. puts ("\n** Bad Header Checksum **\n");
  371. return 1;
  372. }
  373. image_print_contents (hdr);
  374. cnt = image_get_image_size (hdr);
  375. break;
  376. #if defined(CONFIG_FIT)
  377. case IMAGE_FORMAT_FIT:
  378. fit_hdr = (const void *)addr;
  379. puts ("Fit image detected...\n");
  380. cnt = fit_get_size (fit_hdr);
  381. break;
  382. #endif
  383. default:
  384. puts ("** Unknown image type\n");
  385. return 1;
  386. }
  387. cnt += info.blksz - 1;
  388. cnt /= info.blksz;
  389. cnt -= 1;
  390. if (stor_dev->block_read (dev, info.start+1, cnt,
  391. (ulong *)(addr+info.blksz)) != cnt) {
  392. printf ("\n** Read error on %d:%d\n", dev, part);
  393. return 1;
  394. }
  395. #if defined(CONFIG_FIT)
  396. /* This cannot be done earlier, we need complete FIT image in RAM first */
  397. if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
  398. if (!fit_check_format (fit_hdr)) {
  399. puts ("** Bad FIT image format\n");
  400. return 1;
  401. }
  402. fit_print_contents (fit_hdr);
  403. }
  404. #endif
  405. /* Loading ok, update default load address */
  406. load_addr = addr;
  407. flush_cache (addr, (cnt+1)*info.blksz);
  408. /* Check if we should attempt an auto-start */
  409. if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) {
  410. char *local_args[2];
  411. extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
  412. local_args[0] = argv[0];
  413. local_args[1] = NULL;
  414. printf ("Automatic boot of image at addr 0x%08lX ...\n", addr);
  415. rcode=do_bootm (cmdtp, 0, 1, local_args);
  416. return rcode;
  417. }
  418. return 0;
  419. }
  420. #endif /* CONFIG_USB_STORAGE */
  421. /*********************************************************************************
  422. * usb command intepreter
  423. */
  424. int do_usb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  425. {
  426. int i;
  427. struct usb_device *dev = NULL;
  428. extern char usb_started;
  429. #ifdef CONFIG_USB_STORAGE
  430. block_dev_desc_t *stor_dev;
  431. #endif
  432. if ((strncmp(argv[1], "reset", 5) == 0) ||
  433. (strncmp(argv[1], "start", 5) == 0)){
  434. usb_stop();
  435. printf("(Re)start USB...\n");
  436. i = usb_init();
  437. #ifdef CONFIG_USB_STORAGE
  438. /* try to recognize storage devices immediately */
  439. if (i >= 0)
  440. usb_stor_curr_dev = usb_stor_scan(1);
  441. #endif
  442. return 0;
  443. }
  444. if (strncmp(argv[1],"stop",4) == 0) {
  445. #ifdef CONFIG_USB_KEYBOARD
  446. if (argc==2) {
  447. if (usb_kbd_deregister()!=0) {
  448. printf("USB not stopped: usbkbd still using USB\n");
  449. return 1;
  450. }
  451. }
  452. else { /* forced stop, switch console in to serial */
  453. console_assign(stdin,"serial");
  454. usb_kbd_deregister();
  455. }
  456. #endif
  457. printf("stopping USB..\n");
  458. usb_stop();
  459. return 0;
  460. }
  461. if (!usb_started) {
  462. printf("USB is stopped. Please issue 'usb start' first.\n");
  463. return 1;
  464. }
  465. if (strncmp(argv[1],"tree",4) == 0) {
  466. printf("\nDevice Tree:\n");
  467. usb_show_tree(usb_get_dev_index(0));
  468. return 0;
  469. }
  470. if (strncmp(argv[1],"inf",3) == 0) {
  471. int d;
  472. if (argc==2) {
  473. for(d=0;d<USB_MAX_DEVICE;d++) {
  474. dev=usb_get_dev_index(d);
  475. if (dev==NULL)
  476. break;
  477. usb_display_desc(dev);
  478. usb_display_config(dev);
  479. }
  480. return 0;
  481. }
  482. else {
  483. int d;
  484. i=simple_strtoul(argv[2], NULL, 16);
  485. printf("config for device %d\n",i);
  486. for(d=0;d<USB_MAX_DEVICE;d++) {
  487. dev=usb_get_dev_index(d);
  488. if (dev==NULL)
  489. break;
  490. if (dev->devnum==i)
  491. break;
  492. }
  493. if (dev==NULL) {
  494. printf("*** NO Device avaiable ***\n");
  495. return 0;
  496. }
  497. else {
  498. usb_display_desc(dev);
  499. usb_display_config(dev);
  500. }
  501. }
  502. return 0;
  503. }
  504. #ifdef CONFIG_USB_STORAGE
  505. if (strncmp(argv[1], "scan", 4) == 0) {
  506. printf(" NOTE: this command is obsolete and will be phased out\n");
  507. printf(" please use 'usb storage' for USB storage devices information\n\n");
  508. usb_stor_info();
  509. return 0;
  510. }
  511. if (strncmp(argv[1], "stor", 4) == 0) {
  512. return usb_stor_info();
  513. }
  514. if (strncmp(argv[1],"part",4) == 0) {
  515. int devno, ok;
  516. for (ok=0, devno=0; devno<USB_MAX_STOR_DEV; ++devno) {
  517. stor_dev=usb_stor_get_dev(devno);
  518. if (stor_dev->type!=DEV_TYPE_UNKNOWN) {
  519. ok++;
  520. if (devno)
  521. printf("\n");
  522. printf("print_part of %x\n",devno);
  523. print_part(stor_dev);
  524. }
  525. }
  526. if (!ok) {
  527. printf("\nno USB devices available\n");
  528. return 1;
  529. }
  530. return 0;
  531. }
  532. if (strcmp(argv[1],"read") == 0) {
  533. if (usb_stor_curr_dev<0) {
  534. printf("no current device selected\n");
  535. return 1;
  536. }
  537. if (argc==5) {
  538. unsigned long addr = simple_strtoul(argv[2], NULL, 16);
  539. unsigned long blk = simple_strtoul(argv[3], NULL, 16);
  540. unsigned long cnt = simple_strtoul(argv[4], NULL, 16);
  541. unsigned long n;
  542. printf ("\nUSB read: device %d block # %ld, count %ld ... ",
  543. usb_stor_curr_dev, blk, cnt);
  544. stor_dev=usb_stor_get_dev(usb_stor_curr_dev);
  545. n = stor_dev->block_read(usb_stor_curr_dev, blk, cnt, (ulong *)addr);
  546. printf ("%ld blocks read: %s\n",n,(n==cnt) ? "OK" : "ERROR");
  547. if (n==cnt)
  548. return 0;
  549. return 1;
  550. }
  551. }
  552. if (strncmp(argv[1], "dev", 3) == 0) {
  553. if (argc == 3) {
  554. int dev = (int)simple_strtoul(argv[2], NULL, 10);
  555. printf ("\nUSB device %d: ", dev);
  556. if (dev >= USB_MAX_STOR_DEV) {
  557. printf("unknown device\n");
  558. return 1;
  559. }
  560. printf ("\n Device %d: ", dev);
  561. stor_dev=usb_stor_get_dev(dev);
  562. dev_print(stor_dev);
  563. if (stor_dev->type == DEV_TYPE_UNKNOWN) {
  564. return 1;
  565. }
  566. usb_stor_curr_dev = dev;
  567. printf("... is now current device\n");
  568. return 0;
  569. }
  570. else {
  571. printf ("\nUSB device %d: ", usb_stor_curr_dev);
  572. stor_dev=usb_stor_get_dev(usb_stor_curr_dev);
  573. dev_print(stor_dev);
  574. if (stor_dev->type == DEV_TYPE_UNKNOWN) {
  575. return 1;
  576. }
  577. return 0;
  578. }
  579. return 0;
  580. }
  581. #endif /* CONFIG_USB_STORAGE */
  582. printf ("Usage:\n%s\n", cmdtp->usage);
  583. return 1;
  584. }
  585. #ifdef CONFIG_USB_STORAGE
  586. U_BOOT_CMD(
  587. usb, 5, 1, do_usb,
  588. "usb - USB sub-system\n",
  589. "reset - reset (rescan) USB controller\n"
  590. "usb stop [f] - stop USB [f]=force stop\n"
  591. "usb tree - show USB device tree\n"
  592. "usb info [dev] - show available USB devices\n"
  593. "usb storage - show details of USB storage devices\n"
  594. "usb dev [dev] - show or set current USB storage device\n"
  595. "usb part [dev] - print partition table of one or all USB storage devices\n"
  596. "usb read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
  597. " to memory address `addr'\n"
  598. );
  599. U_BOOT_CMD(
  600. usbboot, 3, 1, do_usbboot,
  601. "usbboot - boot from USB device\n",
  602. "loadAddr dev:part\n"
  603. );
  604. #else
  605. U_BOOT_CMD(
  606. usb, 5, 1, do_usb,
  607. "usb - USB sub-system\n",
  608. "reset - reset (rescan) USB controller\n"
  609. "usb tree - show USB device tree\n"
  610. "usb info [dev] - show available USB devices\n"
  611. );
  612. #endif