cmd_usb.c 16 KB

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