The 'mode' parameter is actually a flag to determine whether to display
a list of devices found during the scan. Rename it to reflect this, add a
function comment and adjust callers to use a boolean.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
ahci_init((void __iomem *)AHCI_BASE_ADDR);
out_le32(&ccsr_ahci->ptc, AHCI_PORT_TRANS_CFG);
ahci_init((void __iomem *)AHCI_BASE_ADDR);
out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG);
ahci_init((void __iomem *)CONFIG_SYS_SATA1);
out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG);
ahci_init((void __iomem *)CONFIG_SYS_SATA1);
out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG);
ahci_init((void __iomem *)CONFIG_SYS_SATA);
out_le32(&ccsr_ahci->axicc, AHCI_PORT_AXICC_CFG);
ahci_init((void __iomem *)CONFIG_SYS_SATA);
cphy_disable_overrides();
if (reg & PWRDOM_STAT_SATA) {
ahci_init((void __iomem *)HB_AHCI_BASE);
cphy_disable_overrides();
if (reg & PWRDOM_STAT_SATA) {
ahci_init((void __iomem *)HB_AHCI_BASE);
if (strncmp(argv[1], "res", 3) == 0) {
printf("\nReset SCSI\n");
scsi_bus_reset(NULL);
if (strncmp(argv[1], "res", 3) == 0) {
printf("\nReset SCSI\n");
scsi_bus_reset(NULL);
if (ret)
return CMD_RET_FAILURE;
return ret;
if (ret)
return CMD_RET_FAILURE;
return ret;
return 0;
}
if (strncmp(argv[1], "scan", 4) == 0) {
return 0;
}
if (strncmp(argv[1], "scan", 4) == 0) {
if (ret)
return CMD_RET_FAILURE;
return ret;
if (ret)
return CMD_RET_FAILURE;
return ret;
return err;
} else {
/* try to recognize storage devices immediately */
return err;
} else {
/* try to recognize storage devices immediately */
stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
if (!stor_dev)
return -ENODEV;
stor_dev = blk_get_devnum_by_type(IF_TYPE_SCSI, 0);
if (!stor_dev)
return -ENODEV;
#endif
bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci");
scsi_low_level_init(busdevfunc);
#endif
bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci");
scsi_low_level_init(busdevfunc);
bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI);
}
#endif
bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI);
}
#endif
* to the user if mode = 1
*/
#if defined(CONFIG_DM_SCSI)
* to the user if mode = 1
*/
#if defined(CONFIG_DM_SCSI)
-static int do_scsi_scan_one(struct udevice *dev, int id, int lun, int mode)
+static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose)
{
int ret;
struct udevice *bdev;
{
int ret;
struct udevice *bdev;
memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision));
part_init(bdesc);
memcpy(&bdesc->revision, &bd.revision, sizeof(bd.revision));
part_init(bdesc);
printf(" Device %d: ", 0);
dev_print(bdesc);
}
return 0;
}
printf(" Device %d: ", 0);
dev_print(bdesc);
}
return 0;
}
+int scsi_scan(bool verbose)
{
unsigned char i, lun;
struct uclass *uc;
struct udevice *dev; /* SCSI controller */
int ret;
{
unsigned char i, lun;
struct uclass *uc;
struct udevice *dev; /* SCSI controller */
int ret;
printf("scanning bus for devices...\n");
blk_unbind_all(IF_TYPE_SCSI);
printf("scanning bus for devices...\n");
blk_unbind_all(IF_TYPE_SCSI);
for (i = 0; i < plat->max_id; i++)
for (lun = 0; lun < plat->max_lun; lun++)
for (i = 0; i < plat->max_id; i++)
for (lun = 0; lun < plat->max_lun; lun++)
- do_scsi_scan_one(dev, i, lun, mode);
+ do_scsi_scan_one(dev, i, lun, verbose);
+int scsi_scan(bool verbose)
{
unsigned char i, lun;
int ret;
{
unsigned char i, lun;
int ret;
printf("scanning bus for devices...\n");
for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++)
scsi_init_dev_desc(&scsi_dev_desc[i], i);
printf("scanning bus for devices...\n");
for (i = 0; i < CONFIG_SYS_SCSI_MAX_DEVICE; i++)
scsi_init_dev_desc(&scsi_dev_desc[i], i);
continue;
part_init(&scsi_dev_desc[scsi_max_devs]);
continue;
part_init(&scsi_dev_desc[scsi_max_devs]);
printf(" Device %d: ", 0);
dev_print(&scsi_dev_desc[scsi_max_devs]);
printf(" Device %d: ", 0);
dev_print(&scsi_dev_desc[scsi_max_devs]);
scsi_max_devs++;
} /* next LUN */
}
scsi_max_devs++;
} /* next LUN */
}
int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb);
int scsi_bus_reset(struct udevice *dev);
int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb);
int scsi_bus_reset(struct udevice *dev);
-/***************************************************************************
- * functions residing inside cmd_scsi.c
+/**
+ * scsi_scan() - Scan all SCSI controllers for available devices
+ *
+ * @vebose: true to show information about each device found
-int scsi_scan(int mode);
+int scsi_scan(bool verbose);
#define SCSI_IDENTIFY 0xC0 /* not used */
#define SCSI_IDENTIFY 0xC0 /* not used */