Пример #1
0
void scsi_init(void)
{
    /*
     * Find a device from the list, this driver will support a single
     * controller.
     */

#ifdef	CONFIG_SCSI_6820
    board_ahci_init();
#endif
#if defined CONFIG_SCSI_MV94XX
    int busdevfunc;
    if ((busdevfunc = pci_find_devices (mv94xx_pci_ids, 0)) < 0) {
        printf("MV94XX controller not present\n");
        return;
    }
    if (scsi_curr_dev == -1)
        scsi_low_level_init(busdevfunc);
    else
        scsi_bus_reset(); /*mult-time "scsi init", no need re-assign resource"*/
#else
    int i, busdevfunc, index = 0;
    for (;;) {
        busdevfunc = pci_find_devices(scsi_device_list, index);
        if (busdevfunc == -1) {
            if (index == 0) {
                printf("Error: SCSI Controller(s) ");
                for (i = 0; i < ARRAY_SIZE(scsi_device_list) - 1; i++) {
                    printf("%04X:%04X ",
                           scsi_device_list[i].vendor,
                           scsi_device_list[i].device);
                }
                printf("not found\n");
            }
            break;
        }
#ifdef DEBUG
        else {
            printf("SCSI Controller found (%d:%d:%d)\n",
                   (busdevfunc >> 16) & 0xFF,
                   (busdevfunc >> 11) & 0x1F,
                   (busdevfunc >> 8) & 0x7);
        }
#endif
        scsi_low_level_init(busdevfunc);
        index++;
    }
#endif
    scsi_scan(1);
}
Пример #2
0
void scsi_init(void)
{
	int busdevfunc = -1;
	int i;
	/*
	 * Find a device from the list, this driver will support a single
	 * controller.
	 */
	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;
	}

	if (busdevfunc == -1) {
		printf("Error: SCSI Controller(s) ");
		for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
			printf("%04X:%04X ",
			       scsi_device_list[i].vendor,
			       scsi_device_list[i].device);
		}
		printf("not found\n");
		return;
	}
#ifdef DEBUG
	else {
		printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n",
		       scsi_device_list[i].vendor,
		       scsi_device_list[i].device,
		       (busdevfunc >> 16) & 0xFF,
		       (busdevfunc >> 11) & 0x1F,
		       (busdevfunc >> 8) & 0x7);
	}
#endif
	bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci");
	scsi_low_level_init(busdevfunc);
	scsi_scan(true);
	bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI);
}
Пример #3
0
void scsi_init(void)
{
	int busdevfunc;

	busdevfunc=pci_find_device(SCSI_VEND_ID,SCSI_DEV_ID,0); /* get PCI Device ID */
	if(busdevfunc==-1) {
		printf("Error SCSI Controller (%04X,%04X) not found\n",SCSI_VEND_ID,SCSI_DEV_ID);
		return;
	}
#ifdef DEBUG
	else {
		printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n",SCSI_VEND_ID,SCSI_DEV_ID,(busdevfunc>>16)&0xFF,(busdevfunc>>11)&0x1F,(busdevfunc>>8)&0x7);
	}
#endif
	scsi_low_level_init(busdevfunc);
	scsi_scan(1);
}
Пример #4
0
void scsi_init(void)
{
	int busdevfunc;
	int i;
	/*
	 * Find a device from the list, this driver will support a single
	 * controller.
	 */
	for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
		/* get PCI Device ID */
		busdevfunc = pci_find_device(scsi_device_list[i].scsi_vendor_id,
					     scsi_device_list[i].scsi_dev_id,
					     0);
		if (busdevfunc != -1)
			break;
	}

	if (busdevfunc == -1) {
		printf("Error: SCSI Controller(s) ");
		for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
			printf("%04X:%04X ",
			       scsi_device_list[i].scsi_vendor_id,
			       scsi_device_list[i].scsi_dev_id);
		}
		printf("not found\n");
		return;
	}
#ifdef DEBUG
	else {
		printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n",
		       scsi_device_list[i].scsi_vendor_id,
		       scsi_device_list[i].scsi_dev_id,
		       (busdevfunc >> 16) & 0xFF,
		       (busdevfunc >> 11) & 0x1F,
		       (busdevfunc >> 8) & 0x7);
	}
#endif
	scsi_low_level_init(busdevfunc);
	scsi_scan(1);
}