summaryrefslogtreecommitdiffstats
path: root/common/cmd_scsi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-01-12 18:12:42 -0500
committerTom Rini <trini@konsulko.com>2016-01-12 18:12:42 -0500
commit077678eb0c226e52a1f90edabd3369ab26065b32 (patch)
treee8bf70144f896a1ea09f694fe1182ba305b25df9 /common/cmd_scsi.c
parente69514cc7087255d0e9754a9bf04129309d81ed5 (diff)
parentab971e192adcf0a501c8998542ab116512c0c260 (diff)
downloadtalos-obmc-uboot-077678eb0c226e52a1f90edabd3369ab26065b32.tar.gz
talos-obmc-uboot-077678eb0c226e52a1f90edabd3369ab26065b32.zip
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'common/cmd_scsi.c')
-rw-r--r--common/cmd_scsi.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index 31c43195e4..86954089fe 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -184,7 +184,7 @@ int scsi_get_disk_count(void)
#if defined(CONFIG_PCI) && !defined(CONFIG_SCSI_AHCI_PLAT)
void scsi_init(void)
{
- int busdevfunc;
+ int busdevfunc = -1;
int i;
/*
* Find a device from the list, this driver will support a single
@@ -192,9 +192,21 @@ void scsi_init(void)
*/
for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
/* get PCI Device ID */
+#ifdef CONFIG_DM_PCI
+ struct udevice *dev;
+ int ret;
+
+ ret = dm_pci_find_device(scsi_device_list[i].vendor,
+ scsi_device_list[i].device, 0, &dev);
+ if (!ret) {
+ busdevfunc = dm_pci_get_bdf(dev);
+ break;
+ }
+#else
busdevfunc = pci_find_device(scsi_device_list[i].vendor,
scsi_device_list[i].device,
0);
+#endif
if (busdevfunc != -1)
break;
}
OpenPOWER on IntegriCloud