diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2012-10-29 05:23:48 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-11-02 15:20:40 -0700 |
commit | 447c031ba4b6b306bb3f77690af06f5d2ad0691b (patch) | |
tree | 53c2de2d3ddc343acdd06c700ec2a034ad1f06f5 /common | |
parent | c4fa493d3a822757af8fbcdc516e12bb7f72d071 (diff) | |
download | u-boot-imx-447c031ba4b6b306bb3f77690af06f5d2ad0691b.zip u-boot-imx-447c031ba4b6b306bb3f77690af06f5d2ad0691b.tar.gz u-boot-imx-447c031ba4b6b306bb3f77690af06f5d2ad0691b.tar.bz2 |
scsi: Add function and env var to report number of scsi drives
Add a new function to find out the number of available SCSI disks. Also
set the 'scsidevs' environment variable after each scan.
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_scsi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c index 31ea788..9bd8ec9 100644 --- a/common/cmd_scsi.c +++ b/common/cmd_scsi.c @@ -184,6 +184,14 @@ removable: scsi_curr_dev=0; else scsi_curr_dev = -1; + + printf("Found %d device(s).\n", scsi_max_devs); + setenv_ulong("scsidevs", scsi_max_devs); +} + +int scsi_get_disk_count(void) +{ + return scsi_max_devs; } #ifdef CONFIG_PCI |