1 // SPDX-License-Identifier: GPL-2.0+
4 * Denis Peter, MPL AG Switzerland
15 static int scsi_curr_dev; /* current device */
18 * scsi boot command intepreter. Derived from diskboot
20 static int do_scsiboot(struct cmd_tbl *cmdtp, int flag, int argc,
23 return common_diskboot(cmdtp, "scsi", argc, argv);
27 * scsi command intepreter
29 static int do_scsi(struct cmd_tbl *cmdtp, int flag, int argc,
35 if (strncmp(argv[1], "res", 3) == 0) {
36 printf("\nReset SCSI\n");
37 #ifndef CONFIG_DM_SCSI
40 ret = scsi_scan(true);
42 return CMD_RET_FAILURE;
45 if (strncmp(argv[1], "scan", 4) == 0) {
46 ret = scsi_scan(true);
48 return CMD_RET_FAILURE;
53 return blk_common_cmd(argc, argv, IF_TYPE_SCSI, &scsi_curr_dev);
59 "reset - reset SCSI controller\n"
60 "scsi info - show available SCSI devices\n"
61 "scsi scan - (re-)scan SCSI bus\n"
62 "scsi device [dev] - show or set current device\n"
63 "scsi part [dev] - print partition table of one or all SCSI devices\n"
64 "scsi read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
65 " to memory address `addr'\n"
66 "scsi write addr blk# cnt - write `cnt' blocks starting at block\n"
67 " `blk#' from memory address `addr'"
71 scsiboot, 3, 1, do_scsiboot,
72 "boot from SCSI device",