]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - common/cmd_scsi.c
autostart: unify duplicated logic into the bootm code
[karo-tx-uboot.git] / common / cmd_scsi.c
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  *
25  */
26
27 /*
28  * SCSI support.
29  */
30 #include <common.h>
31 #include <command.h>
32 #include <asm/processor.h>
33 #include <scsi.h>
34 #include <image.h>
35 #include <pci.h>
36
37 #ifdef CONFIG_SCSI_SYM53C8XX
38 #define SCSI_VEND_ID    0x1000
39 #ifndef CONFIG_SCSI_DEV_ID
40 #define SCSI_DEV_ID             0x0001
41 #else
42 #define SCSI_DEV_ID             CONFIG_SCSI_DEV_ID
43 #endif
44 #elif defined CONFIG_SATA_ULI5288
45
46 #define SCSI_VEND_ID 0x10b9
47 #define SCSI_DEV_ID  0x5288
48
49 #else
50 #error no scsi device defined
51 #endif
52
53
54 static ccb tempccb;     /* temporary scsi command buffer */
55
56 static unsigned char tempbuff[512]; /* temporary data buffer */
57
58 static int scsi_max_devs; /* number of highest available scsi device */
59
60 static int scsi_curr_dev; /* current device */
61
62 static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
63
64 /********************************************************************************
65  *  forward declerations of some Setup Routines
66  */
67 void scsi_setup_test_unit_ready(ccb * pccb);
68 void scsi_setup_read_capacity(ccb * pccb);
69 void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks);
70 void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks);
71 void scsi_setup_inquiry(ccb * pccb);
72 void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
73
74
75 ulong scsi_read(int device, ulong blknr, ulong blkcnt, void *buffer);
76
77
78 /*********************************************************************************
79  * (re)-scan the scsi bus and reports scsi device info
80  * to the user if mode = 1
81  */
82 void scsi_scan(int mode)
83 {
84         unsigned char i,perq,modi,lun;
85         unsigned long capacity,blksz;
86         ccb* pccb=(ccb *)&tempccb;
87
88         if(mode==1) {
89                 printf("scanning bus for devices...\n");
90         }
91         for(i=0;i<CONFIG_SYS_SCSI_MAX_DEVICE;i++) {
92                 scsi_dev_desc[i].target=0xff;
93                 scsi_dev_desc[i].lun=0xff;
94                 scsi_dev_desc[i].lba=0;
95                 scsi_dev_desc[i].blksz=0;
96                 scsi_dev_desc[i].type=DEV_TYPE_UNKNOWN;
97                 scsi_dev_desc[i].vendor[0]=0;
98                 scsi_dev_desc[i].product[0]=0;
99                 scsi_dev_desc[i].revision[0]=0;
100                 scsi_dev_desc[i].removable=FALSE;
101                 scsi_dev_desc[i].if_type=IF_TYPE_SCSI;
102                 scsi_dev_desc[i].dev=i;
103                 scsi_dev_desc[i].part_type=PART_TYPE_UNKNOWN;
104                 scsi_dev_desc[i].block_read=scsi_read;
105         }
106         scsi_max_devs=0;
107         for(i=0;i<CONFIG_SYS_SCSI_MAX_SCSI_ID;i++) {
108                 pccb->target=i;
109                 for(lun=0;lun<CONFIG_SYS_SCSI_MAX_LUN;lun++) {
110                         pccb->lun=lun;
111                         pccb->pdata=(unsigned char *)&tempbuff;
112                         pccb->datalen=512;
113                         scsi_setup_inquiry(pccb);
114                         if(scsi_exec(pccb)!=TRUE) {
115                                 if(pccb->contr_stat==SCSI_SEL_TIME_OUT) {
116                                         debug ("Selection timeout ID %d\n",pccb->target);
117                                         continue; /* selection timeout => assuming no device present */
118                                 }
119                                 scsi_print_error(pccb);
120                                 continue;
121                         }
122                         perq=tempbuff[0];
123                         modi=tempbuff[1];
124                         if((perq & 0x1f)==0x1f) {
125                                 continue; /* skip unknown devices */
126                         }
127                         if((modi&0x80)==0x80) /* drive is removable */
128                                 scsi_dev_desc[scsi_max_devs].removable=TRUE;
129                         /* get info for this device */
130                         scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].vendor[0],
131                                        &tempbuff[8], 8);
132                         scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].product[0],
133                                        &tempbuff[16], 16);
134                         scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].revision[0],
135                                        &tempbuff[32], 4);
136                         scsi_dev_desc[scsi_max_devs].target=pccb->target;
137                         scsi_dev_desc[scsi_max_devs].lun=pccb->lun;
138
139                         pccb->datalen=0;
140                         scsi_setup_test_unit_ready(pccb);
141                         if(scsi_exec(pccb)!=TRUE) {
142                                 if(scsi_dev_desc[scsi_max_devs].removable==TRUE) {
143                                         scsi_dev_desc[scsi_max_devs].type=perq;
144                                         goto removable;
145                                 }
146                                 scsi_print_error(pccb);
147                                 continue;
148                         }
149                         pccb->datalen=8;
150                         scsi_setup_read_capacity(pccb);
151                         if(scsi_exec(pccb)!=TRUE) {
152                                 scsi_print_error(pccb);
153                                 continue;
154                         }
155                         capacity=((unsigned long)tempbuff[0]<<24)|((unsigned long)tempbuff[1]<<16)|
156                                         ((unsigned long)tempbuff[2]<<8)|((unsigned long)tempbuff[3]);
157                         blksz=((unsigned long)tempbuff[4]<<24)|((unsigned long)tempbuff[5]<<16)|
158                                 ((unsigned long)tempbuff[6]<<8)|((unsigned long)tempbuff[7]);
159                         scsi_dev_desc[scsi_max_devs].lba=capacity;
160                         scsi_dev_desc[scsi_max_devs].blksz=blksz;
161                         scsi_dev_desc[scsi_max_devs].type=perq;
162                         init_part(&scsi_dev_desc[scsi_max_devs]);
163 removable:
164                         if(mode==1) {
165                                 printf ("  Device %d: ", scsi_max_devs);
166                                 dev_print(&scsi_dev_desc[scsi_max_devs]);
167                         } /* if mode */
168                         scsi_max_devs++;
169                 } /* next LUN */
170         }
171         if(scsi_max_devs>0)
172                 scsi_curr_dev=0;
173         else
174                 scsi_curr_dev = -1;
175 }
176
177
178 void scsi_init(void)
179 {
180         int busdevfunc;
181
182         busdevfunc=pci_find_device(SCSI_VEND_ID,SCSI_DEV_ID,0); /* get PCI Device ID */
183         if(busdevfunc==-1) {
184                 printf("Error SCSI Controller (%04X,%04X) not found\n",SCSI_VEND_ID,SCSI_DEV_ID);
185                 return;
186         }
187 #ifdef DEBUG
188         else {
189                 printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n",SCSI_VEND_ID,SCSI_DEV_ID,(busdevfunc>>16)&0xFF,(busdevfunc>>11)&0x1F,(busdevfunc>>8)&0x7);
190         }
191 #endif
192         scsi_low_level_init(busdevfunc);
193         scsi_scan(1);
194 }
195
196 block_dev_desc_t * scsi_get_dev(int dev)
197 {
198         return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
199 }
200
201
202 /******************************************************************************
203  * scsi boot command intepreter. Derived from diskboot
204  */
205 int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
206 {
207         char *boot_device = NULL;
208         char *ep;
209         int dev, part = 0;
210         ulong addr, cnt;
211         disk_partition_t info;
212         image_header_t *hdr;
213 #if defined(CONFIG_FIT)
214         const void *fit_hdr = NULL;
215 #endif
216
217         switch (argc) {
218         case 1:
219                 addr = CONFIG_SYS_LOAD_ADDR;
220                 boot_device = getenv ("bootdevice");
221                 break;
222         case 2:
223                 addr = simple_strtoul(argv[1], NULL, 16);
224                 boot_device = getenv ("bootdevice");
225                 break;
226         case 3:
227                 addr = simple_strtoul(argv[1], NULL, 16);
228                 boot_device = argv[2];
229                 break;
230         default:
231                 return cmd_usage(cmdtp);
232         }
233
234         if (!boot_device) {
235                 puts ("\n** No boot device **\n");
236                 return 1;
237         }
238
239         dev = simple_strtoul(boot_device, &ep, 16);
240         printf("booting from dev %d\n",dev);
241         if (scsi_dev_desc[dev].type == DEV_TYPE_UNKNOWN) {
242                 printf ("\n** Device %d not available\n", dev);
243                 return 1;
244         }
245
246         if (*ep) {
247                 if (*ep != ':') {
248                         puts ("\n** Invalid boot device, use `dev[:part]' **\n");
249                         return 1;
250                 }
251                 part = simple_strtoul(++ep, NULL, 16);
252         }
253         if (get_partition_info (&scsi_dev_desc[dev], part, &info)) {
254                 printf("error reading partinfo\n");
255                 return 1;
256         }
257         if ((strncmp((char *)(info.type), BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
258             (strncmp((char *)(info.type), BOOT_PART_COMP, sizeof(info.type)) != 0)) {
259                 printf ("\n** Invalid partition type \"%.32s\""
260                         " (expect \"" BOOT_PART_TYPE "\")\n",
261                         info.type);
262                 return 1;
263         }
264
265         printf ("\nLoading from SCSI device %d, partition %d: "
266                 "Name: %.32s  Type: %.32s\n",
267                 dev, part, info.name, info.type);
268
269         debug ("First Block: %ld,  # of blocks: %ld, Block Size: %ld\n",
270                 info.start, info.size, info.blksz);
271
272         if (scsi_read (dev, info.start, 1, (ulong *)addr) != 1) {
273                 printf ("** Read error on %d:%d\n", dev, part);
274                 return 1;
275         }
276
277         switch (genimg_get_format ((void *)addr)) {
278         case IMAGE_FORMAT_LEGACY:
279                 hdr = (image_header_t *)addr;
280
281                 if (!image_check_hcrc (hdr)) {
282                         puts ("\n** Bad Header Checksum **\n");
283                         return 1;
284                 }
285
286                 image_print_contents (hdr);
287                 cnt = image_get_image_size (hdr);
288                 break;
289 #if defined(CONFIG_FIT)
290         case IMAGE_FORMAT_FIT:
291                 fit_hdr = (const void *)addr;
292                 puts ("Fit image detected...\n");
293
294                 cnt = fit_get_size (fit_hdr);
295                 break;
296 #endif
297         default:
298                 puts ("** Unknown image type\n");
299                 return 1;
300         }
301
302         cnt += info.blksz - 1;
303         cnt /= info.blksz;
304         cnt -= 1;
305
306         if (scsi_read (dev, info.start+1, cnt,
307                       (ulong *)(addr+info.blksz)) != cnt) {
308                 printf ("** Read error on %d:%d\n", dev, part);
309                 return 1;
310         }
311
312 #if defined(CONFIG_FIT)
313         /* This cannot be done earlier, we need complete FIT image in RAM first */
314         if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) {
315                 if (!fit_check_format (fit_hdr)) {
316                         puts ("** Bad FIT image format\n");
317                         return 1;
318                 }
319                 fit_print_contents (fit_hdr);
320         }
321 #endif
322
323         /* Loading ok, update default load address */
324         load_addr = addr;
325
326         flush_cache (addr, (cnt+1)*info.blksz);
327
328         return bootm_maybe_autostart(cmdtp, argv[0]);
329 }
330
331 /*********************************************************************************
332  * scsi command intepreter
333  */
334 int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
335 {
336         switch (argc) {
337     case 0:
338     case 1:     return cmd_usage(cmdtp);
339
340     case 2:
341                         if (strncmp(argv[1],"res",3) == 0) {
342                                 printf("\nReset SCSI\n");
343                                 scsi_bus_reset();
344                                 scsi_scan(1);
345                                 return 0;
346                         }
347                         if (strncmp(argv[1],"inf",3) == 0) {
348                                 int i;
349                                 for (i=0; i<CONFIG_SYS_SCSI_MAX_DEVICE; ++i) {
350                                         if(scsi_dev_desc[i].type==DEV_TYPE_UNKNOWN)
351                                                 continue; /* list only known devices */
352                                         printf ("SCSI dev. %d:  ", i);
353                                         dev_print(&scsi_dev_desc[i]);
354                                 }
355                                 return 0;
356                         }
357                         if (strncmp(argv[1],"dev",3) == 0) {
358                                 if ((scsi_curr_dev < 0) || (scsi_curr_dev >= CONFIG_SYS_SCSI_MAX_DEVICE)) {
359                                         printf("\nno SCSI devices available\n");
360                                         return 1;
361                                 }
362                                 printf ("\n    Device %d: ", scsi_curr_dev);
363                                 dev_print(&scsi_dev_desc[scsi_curr_dev]);
364                                 return 0;
365                         }
366                         if (strncmp(argv[1],"scan",4) == 0) {
367                                 scsi_scan(1);
368                                 return 0;
369                         }
370                         if (strncmp(argv[1],"part",4) == 0) {
371                                 int dev, ok;
372                                 for (ok=0, dev=0; dev<CONFIG_SYS_SCSI_MAX_DEVICE; ++dev) {
373                                         if (scsi_dev_desc[dev].type!=DEV_TYPE_UNKNOWN) {
374                                                 ok++;
375                                                 if (dev)
376                                                         printf("\n");
377                                                 debug ("print_part of %x\n",dev);
378                                                         print_part(&scsi_dev_desc[dev]);
379                                         }
380                                 }
381                                 if (!ok)
382                                         printf("\nno SCSI devices available\n");
383                                 return 1;
384                         }
385                         return cmd_usage(cmdtp);
386         case 3:
387                         if (strncmp(argv[1],"dev",3) == 0) {
388                                 int dev = (int)simple_strtoul(argv[2], NULL, 10);
389                                 printf ("\nSCSI device %d: ", dev);
390                                 if (dev >= CONFIG_SYS_SCSI_MAX_DEVICE) {
391                                         printf("unknown device\n");
392                                         return 1;
393                                 }
394                                 printf ("\n    Device %d: ", dev);
395                                 dev_print(&scsi_dev_desc[dev]);
396                                 if(scsi_dev_desc[dev].type == DEV_TYPE_UNKNOWN) {
397                                         return 1;
398                                 }
399                                 scsi_curr_dev = dev;
400                                 printf("... is now current device\n");
401                                 return 0;
402                         }
403                         if (strncmp(argv[1],"part",4) == 0) {
404                                 int dev = (int)simple_strtoul(argv[2], NULL, 10);
405                                 if(scsi_dev_desc[dev].type != DEV_TYPE_UNKNOWN) {
406                                         print_part(&scsi_dev_desc[dev]);
407                                 }
408                                 else {
409                                         printf ("\nSCSI device %d not available\n", dev);
410                                 }
411                                 return 1;
412                         }
413                         return cmd_usage(cmdtp);
414     default:
415                         /* at least 4 args */
416                         if (strcmp(argv[1],"read") == 0) {
417                                 ulong addr = simple_strtoul(argv[2], NULL, 16);
418                                 ulong blk  = simple_strtoul(argv[3], NULL, 16);
419                                 ulong cnt  = simple_strtoul(argv[4], NULL, 16);
420                                 ulong n;
421                                 printf ("\nSCSI read: device %d block # %ld, count %ld ... ",
422                                                 scsi_curr_dev, blk, cnt);
423                                 n = scsi_read(scsi_curr_dev, blk, cnt, (ulong *)addr);
424                                 printf ("%ld blocks read: %s\n",n,(n==cnt) ? "OK" : "ERROR");
425                                 return 0;
426                         }
427         } /* switch */
428         return cmd_usage(cmdtp);
429 }
430
431 /****************************************************************************************
432  * scsi_read
433  */
434
435 #define SCSI_MAX_READ_BLK 0xFFFF /* almost the maximum amount of the scsi_ext command.. */
436
437 ulong scsi_read(int device, ulong blknr, ulong blkcnt, void *buffer)
438 {
439         ulong start,blks, buf_addr;
440         unsigned short smallblks;
441         ccb* pccb=(ccb *)&tempccb;
442         device&=0xff;
443         /* Setup  device
444          */
445         pccb->target=scsi_dev_desc[device].target;
446         pccb->lun=scsi_dev_desc[device].lun;
447         buf_addr=(unsigned long)buffer;
448         start=blknr;
449         blks=blkcnt;
450         debug ("\nscsi_read: dev %d startblk %lx, blccnt %lx buffer %lx\n",device,start,blks,(unsigned long)buffer);
451         do {
452                 pccb->pdata=(unsigned char *)buf_addr;
453                 if(blks>SCSI_MAX_READ_BLK) {
454                         pccb->datalen=scsi_dev_desc[device].blksz * SCSI_MAX_READ_BLK;
455                         smallblks=SCSI_MAX_READ_BLK;
456                         scsi_setup_read_ext(pccb,start,smallblks);
457                         start+=SCSI_MAX_READ_BLK;
458                         blks-=SCSI_MAX_READ_BLK;
459                 }
460                 else {
461                         pccb->datalen=scsi_dev_desc[device].blksz * blks;
462                         smallblks=(unsigned short) blks;
463                         scsi_setup_read_ext(pccb,start,smallblks);
464                         start+=blks;
465                         blks=0;
466                 }
467                 debug ("scsi_read_ext: startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
468                 if(scsi_exec(pccb)!=TRUE) {
469                         scsi_print_error(pccb);
470                         blkcnt-=blks;
471                         break;
472                 }
473                 buf_addr+=pccb->datalen;
474         } while(blks!=0);
475         debug ("scsi_read_ext: end startblk %lx, blccnt %x buffer %lx\n",start,smallblks,buf_addr);
476         return(blkcnt);
477 }
478
479 /* copy src to dest, skipping leading and trailing blanks
480  * and null terminate the string
481  */
482 void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len)
483 {
484         int start,end;
485
486         start=0;
487         while(start<len) {
488                 if(src[start]!=' ')
489                         break;
490                 start++;
491         }
492         end=len-1;
493         while(end>start) {
494                 if(src[end]!=' ')
495                         break;
496                 end--;
497         }
498         for( ; start<=end; start++) {
499                 *dest++=src[start];
500         }
501         *dest='\0';
502 }
503
504
505 /* Trim trailing blanks, and NUL-terminate string
506  */
507 void scsi_trim_trail (unsigned char *str, unsigned int len)
508 {
509         unsigned char *p = str + len - 1;
510
511         while (len-- > 0) {
512                 *p-- = '\0';
513                 if (*p != ' ') {
514                         return;
515                 }
516         }
517 }
518
519
520 /************************************************************************************
521  * Some setup (fill-in) routines
522  */
523 void scsi_setup_test_unit_ready(ccb * pccb)
524 {
525         pccb->cmd[0]=SCSI_TST_U_RDY;
526         pccb->cmd[1]=pccb->lun<<5;
527         pccb->cmd[2]=0;
528         pccb->cmd[3]=0;
529         pccb->cmd[4]=0;
530         pccb->cmd[5]=0;
531         pccb->cmdlen=6;
532         pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
533 }
534
535 void scsi_setup_read_capacity(ccb * pccb)
536 {
537         pccb->cmd[0]=SCSI_RD_CAPAC;
538         pccb->cmd[1]=pccb->lun<<5;
539         pccb->cmd[2]=0;
540         pccb->cmd[3]=0;
541         pccb->cmd[4]=0;
542         pccb->cmd[5]=0;
543         pccb->cmd[6]=0;
544         pccb->cmd[7]=0;
545         pccb->cmd[8]=0;
546         pccb->cmd[9]=0;
547         pccb->cmdlen=10;
548         pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
549
550 }
551
552 void scsi_setup_read_ext(ccb * pccb, unsigned long start, unsigned short blocks)
553 {
554         pccb->cmd[0]=SCSI_READ10;
555         pccb->cmd[1]=pccb->lun<<5;
556         pccb->cmd[2]=((unsigned char) (start>>24))&0xff;
557         pccb->cmd[3]=((unsigned char) (start>>16))&0xff;
558         pccb->cmd[4]=((unsigned char) (start>>8))&0xff;
559         pccb->cmd[5]=((unsigned char) (start))&0xff;
560         pccb->cmd[6]=0;
561         pccb->cmd[7]=((unsigned char) (blocks>>8))&0xff;
562         pccb->cmd[8]=(unsigned char) blocks & 0xff;
563         pccb->cmd[6]=0;
564         pccb->cmdlen=10;
565         pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
566         debug ("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
567                 pccb->cmd[0],pccb->cmd[1],
568                 pccb->cmd[2],pccb->cmd[3],pccb->cmd[4],pccb->cmd[5],
569                 pccb->cmd[7],pccb->cmd[8]);
570 }
571
572 void scsi_setup_read6(ccb * pccb, unsigned long start, unsigned short blocks)
573 {
574         pccb->cmd[0]=SCSI_READ6;
575         pccb->cmd[1]=pccb->lun<<5 | (((unsigned char)(start>>16))&0x1f);
576         pccb->cmd[2]=((unsigned char) (start>>8))&0xff;
577         pccb->cmd[3]=((unsigned char) (start))&0xff;
578         pccb->cmd[4]=(unsigned char) blocks & 0xff;
579         pccb->cmd[5]=0;
580         pccb->cmdlen=6;
581         pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
582         debug ("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
583                 pccb->cmd[0],pccb->cmd[1],
584                 pccb->cmd[2],pccb->cmd[3],pccb->cmd[4]);
585 }
586
587
588 void scsi_setup_inquiry(ccb * pccb)
589 {
590         pccb->cmd[0]=SCSI_INQUIRY;
591         pccb->cmd[1]=pccb->lun<<5;
592         pccb->cmd[2]=0;
593         pccb->cmd[3]=0;
594         if(pccb->datalen>255)
595                 pccb->cmd[4]=255;
596         else
597                 pccb->cmd[4]=(unsigned char)pccb->datalen;
598         pccb->cmd[5]=0;
599         pccb->cmdlen=6;
600         pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
601 }
602
603
604 U_BOOT_CMD(
605         scsi, 5, 1, do_scsi,
606         "SCSI sub-system",
607         "reset - reset SCSI controller\n"
608         "scsi info  - show available SCSI devices\n"
609         "scsi scan  - (re-)scan SCSI bus\n"
610         "scsi device [dev] - show or set current device\n"
611         "scsi part [dev] - print partition table of one or all SCSI devices\n"
612         "scsi read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
613         "     to memory address `addr'"
614 );
615
616 U_BOOT_CMD(
617         scsiboot, 3, 1, do_scsiboot,
618         "boot from SCSI device",
619         "loadAddr dev:part"
620 );