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