3 * Denis Peter, MPL AG Switzerland
5 * SPDX-License-Identifier: GPL-2.0+
15 static int scsi_curr_dev; /* current device */
18 * scsi boot command intepreter. Derived from diskboot
20 static int do_scsiboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
22 return common_diskboot(cmdtp, "scsi", argc, argv);
26 * scsi command intepreter
28 static int do_scsi(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
33 if (strncmp(argv[1], "res", 3) == 0) {
34 printf("\nReset SCSI\n");
35 #ifndef CONFIG_DM_SCSI
38 ret = scsi_scan(true);
40 return CMD_RET_FAILURE;
43 if (strncmp(argv[1], "scan", 4) == 0) {
44 ret = scsi_scan(true);
46 return CMD_RET_FAILURE;
51 return blk_common_cmd(argc, argv, IF_TYPE_SCSI, &scsi_curr_dev);
57 "reset - reset SCSI controller\n"
58 "scsi info - show available SCSI devices\n"
59 "scsi scan - (re-)scan SCSI bus\n"
60 "scsi device [dev] - show or set current device\n"
61 "scsi part [dev] - print partition table of one or all SCSI devices\n"
62 "scsi read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
63 " to memory address `addr'\n"
64 "scsi write addr blk# cnt - write `cnt' blocks starting at block\n"
65 " `blk#' from memory address `addr'"
69 scsiboot, 3, 1, do_scsiboot,
70 "boot from SCSI device",