Пример #1
0
/*
 * drm_probe_helper: called by a driver at the end of its probe
 * method.
 */
int
drm_probe_helper(device_t kdev, drm_pci_id_list_t *idlist)
{
	drm_pci_id_list_t *id_entry;
	int vendor, device;

	vendor = pci_get_vendor(kdev);
	device = pci_get_device(kdev);

	if (pci_get_class(kdev) != PCIC_DISPLAY ||
	    (pci_get_subclass(kdev) != PCIS_DISPLAY_VGA &&
	     pci_get_subclass(kdev) != PCIS_DISPLAY_OTHER))
		return (-ENXIO);

	id_entry = drm_find_description(vendor, device, idlist);
	if (id_entry != NULL) {
		if (device_get_desc(kdev) == NULL) {
			DRM_DEBUG("%s desc: %s\n",
			    device_get_nameunit(kdev), id_entry->name);
			device_set_desc(kdev, id_entry->name);
		}
		return (0);
	}

	return (-ENXIO);
}
Пример #2
0
/*
 * XXX we need to add a quirk list here for bridges that don't correctly
 *     report themselves.
 */
static int
isab_pci_probe(device_t dev)
{
    int		matched = 0;

    /*
     * Try for a generic match based on class/subclass.
     */
    if ((pci_get_class(dev) == PCIC_BRIDGE) &&
	(pci_get_subclass(dev) == PCIS_BRIDGE_ISA)) {
	matched = 1;
    } else {
	/*
	 * These are devices that we *know* are PCI:ISA bridges. 
	 * Sometimes, however, they don't report themselves as
	 * such.  Check in case one of them is pretending to be
	 * something else.
	 */
	switch (pci_get_devid(dev)) {
	case 0x04848086:	/* Intel 82378ZB/82378IB */
	case 0x122e8086:	/* Intel 82371FB */
	case 0x70008086:	/* Intel 82371SB */
	case 0x71108086:	/* Intel 82371AB */
	case 0x71988086:	/* Intel 82443MX */
	case 0x24108086:	/* Intel 82801AA (ICH) */
	case 0x24208086:	/* Intel 82801AB (ICH0) */
	case 0x24408086:	/* Intel 82801AB (ICH2) */
	case 0x00061004:	/* VLSI 82C593 */
	case 0x05861106:	/* VIA 82C586 */
	case 0x05961106:	/* VIA 82C596 */
	case 0x06861106:	/* VIA 82C686 */
	case 0x153310b9:	/* AcerLabs M1533 */
	case 0x154310b9:	/* AcerLabs M1543 */
	case 0x00081039:	/* SiS 85c503 */
	case 0x00001078:	/* Cyrix Cx5510 */
	case 0x01001078:	/* Cyrix Cx5530 */
	case 0xc7001045:	/* OPTi 82C700 (FireStar) */
	case 0x00011033:	/* NEC 0001 (C-bus) */
	case 0x002c1033:	/* NEC 002C (C-bus) */
	case 0x003b1033:	/* NEC 003B (C-bus) */
	case 0x886a1060:	/* UMC UM8886 ISA */
	case 0x02001166:	/* ServerWorks IB6566 PCI */
	    if (bootverbose)
		printf("PCI-ISA bridge with incorrect subclass 0x%x\n",
		       pci_get_subclass(dev));
	    matched = 1;
	    break;
	
	default:
	    break;
	}
    }

    if (matched) {
	device_set_desc(dev, "PCI-ISA bridge");
	return(-10000);
    }
    return(ENXIO);
}
Пример #3
0
static int
nvme_probe (device_t device)
{
	struct _pcsid	*ep;
	u_int32_t	type;

	type = pci_get_devid(device);
	ep = pci_ids;

	while (ep->type && ep->type != type)
		++ep;

	if (ep->desc) {
		device_set_desc(device, ep->desc);
		return (BUS_PROBE_DEFAULT);
	}

#if defined(PCIS_STORAGE_NVM)
	if (pci_get_class(device)    == PCIC_STORAGE &&
	    pci_get_subclass(device) == PCIS_STORAGE_NVM &&
	    pci_get_progif(device)   == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) {
		device_set_desc(device, "Generic NVMe Device");
		return (BUS_PROBE_GENERIC);
	}
#endif

	return (ENXIO);
}
Пример #4
0
static int
cbb_pci_probe(device_t brdev)
{
	const char *name;
	uint32_t progif;
	uint32_t baseclass;
	uint32_t subclass;

	/*
	 * Do we know that we support the chipset?  If so, then we
	 * accept the device.
	 */
	if (cbb_chipset(pci_get_devid(brdev), &name) != CB_UNKNOWN) {
		device_set_desc(brdev, name);
		return (BUS_PROBE_DEFAULT);
	}

	/*
	 * We do support generic CardBus bridges.  All that we've seen
	 * to date have progif 0 (the Yenta spec, and successors mandate
	 * this).
	 */
	baseclass = pci_get_class(brdev);
	subclass = pci_get_subclass(brdev);
	progif = pci_get_progif(brdev);
	if (baseclass == PCIC_BRIDGE &&
	    subclass == PCIS_BRIDGE_CARDBUS && progif == 0) {
		device_set_desc(brdev, "PCI-CardBus Bridge");
		return (BUS_PROBE_GENERIC);
	}
	return (ENXIO);
}
Пример #5
0
static const char *
xhci_pci_match(device_t self)
{
	uint32_t device_id = pci_get_devid(self);

	switch (device_id) {
	case 0x01941033:
		return ("NEC uPD720200 USB 3.0 controller");

	case 0x10421b21:
		return ("ASMedia ASM1042 USB 3.0 controller");

	case 0x0f358086:
		return ("Intel Intel BayTrail USB 3.0 controller");
	case 0x9c318086:
	case 0x1e318086:
		return ("Intel Panther Point USB 3.0 controller");
	case 0x8c318086:
		return ("Intel Lynx Point USB 3.0 controller");
	case 0x8cb18086:
		return ("Intel Wildcat Point USB 3.0 controller");
	case 0x9cb18086:
		return ("Intel Wildcat Point-LB USB 3.0 controller");
	default:
		break;
	}

	if ((pci_get_class(self) == PCIC_SERIALBUS)
	    && (pci_get_subclass(self) == PCIS_SERIALBUS_USB)
	    && (pci_get_progif(self) == PCIP_SERIALBUS_USB_XHCI)) {
		return ("XHCI (generic) USB 3.0 controller");
	}
	return (NULL);			/* dunno */
}
Пример #6
0
static int
ata_ati_chipinit(device_t dev)
{
    struct ata_pci_controller *ctlr = device_get_softc(dev);

    if (ata_setup_interrupt(dev, ata_generic_intr))
	return ENXIO;

    /* IXP600 & IXP700 only have 1 PATA channel */
    if ((ctlr->chip->chipid == ATA_ATI_IXP600) ||
	(ctlr->chip->chipid == ATA_ATI_IXP700))
	ctlr->channels = 1;

    /* The SB600 needs special treatment. */
    if (ctlr->chip->cfg1 & ATI_AHCI) {
	/* Check if the chip is configured as an AHCI part. */
	if ((pci_get_subclass(dev) == PCIS_STORAGE_SATA) &&
	    (pci_read_config(dev, PCIR_PROGIF, 1) == PCIP_STORAGE_SATA_AHCI_1_0)) {
	    ctlr->setmode = ata_sata_setmode;
	    if (ata_ahci_chipinit(dev) != ENXIO)
		return 0;
	}
    }

    ctlr->setmode = ata_ati_setmode;
    return 0;
}
Пример #7
0
static int
ofw_pcib_probe(device_t dev)
{
	char desc[sizeof("OFW PCIe-PCIe bridge")];
	const char *dtype, *pbdtype;

#define	ISDTYPE(dtype, type)						\
	(((dtype) != NULL) && strcmp((dtype), (type)) == 0)

	if ((pci_get_class(dev) == PCIC_BRIDGE) &&
	    (pci_get_subclass(dev) == PCIS_BRIDGE_PCI) &&
	    ofw_bus_get_node(dev) != 0) {
		dtype = ofw_bus_get_type(dev);
		pbdtype = ofw_bus_get_type(device_get_parent(
		    device_get_parent(dev)));
		snprintf(desc, sizeof(desc), "OFW PCI%s-PCI%s bridge",
		    ISDTYPE(pbdtype, OFW_TYPE_PCIE) ? "e" : "",
		    ISDTYPE(dtype, OFW_TYPE_PCIE) ? "e" : "");
		device_set_desc_copy(dev, desc);
		return (0);
	}

#undef ISDTYPE

	return (ENXIO);
}
Пример #8
0
static int
vga_pci_probe(device_t dev)
{
	device_t bdev;
	int unit;
	uint16_t bctl;

	switch (pci_get_class(dev)) {
	case PCIC_DISPLAY:
		break;
	case PCIC_OLD:
		if (pci_get_subclass(dev) != PCIS_OLD_VGA)
			return (ENXIO);
		break;
	default:
		return (ENXIO);
	}

	/* Probe default display. */
	unit = device_get_unit(dev);
	bdev = device_get_parent(device_get_parent(dev));
	bctl = pci_read_config(bdev, PCIR_BRIDGECTL_1, 2);
	if (vga_pci_default_unit < 0 && (bctl & PCIB_BCR_VGA_ENABLE) != 0)
		vga_pci_default_unit = unit;
	if (vga_pci_default_unit == unit)
		device_set_flags(dev, 1);

	device_set_desc(dev, "VGA-compatible display");
	return (BUS_PROBE_GENERIC);
}
Пример #9
0
static int
nvme_probe (device_t device)
{
	struct _pcsid	*ep;
	uint32_t	devid;
	uint16_t	subdevice;

	devid = pci_get_devid(device);
	subdevice = pci_get_subdevice(device);
	ep = pci_ids;

	while (ep->devid) {
		if (nvme_match(devid, subdevice, ep))
			break;
		++ep;
	}

	if (ep->desc) {
		device_set_desc(device, ep->desc);
		return (BUS_PROBE_DEFAULT);
	}

#if defined(PCIS_STORAGE_NVM)
	if (pci_get_class(device)    == PCIC_STORAGE &&
	    pci_get_subclass(device) == PCIS_STORAGE_NVM &&
	    pci_get_progif(device)   == PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0) {
		device_set_desc(device, "Generic NVMe Device");
		return (BUS_PROBE_GENERIC);
	}
#endif

	return (ENXIO);
}
Пример #10
0
static const char *
ohci_pci_match(device_t self)
{
	u_int32_t device_id = pci_get_devid(self);

	switch(device_id) {
	case PCI_OHCI_DEVICEID_ALADDIN_V:
		return (ohci_device_aladdin_v);
	case PCI_OHCI_DEVICEID_AMD756:
		return (ohci_device_amd756);
	case PCI_OHCI_DEVICEID_USB0670:
		return (ohci_device_usb0670);
	case PCI_OHCI_DEVICEID_USB0673:
		return (ohci_device_usb0673);
	case PCI_OHCI_DEVICEID_FIRELINK:
		return (ohci_device_firelink);
	case PCI_OHCI_DEVICEID_NEC:
		return (ohci_device_nec);
	default:
		if (   pci_get_class(self)    == PCIC_SERIALBUS
		    && pci_get_subclass(self) == PCIS_SERIALBUS_USB
		    && pci_get_progif(self)   == PCI_INTERFACE_OHCI) {
			return (ohci_device_generic);
		}
	}

	return NULL;	/* dunno */
}
Пример #11
0
static int
eisab_probe(device_t dev)
{
    int		matched = 0;

    /*
     * Generic match by class/subclass.
     */
    if ((pci_get_class(dev) == PCIC_BRIDGE) &&
	(pci_get_subclass(dev) == PCIS_BRIDGE_EISA))
	matched = 1;

    /*
     * Some bridges don't correctly report their class.
     */
    switch (pci_get_devid(dev)) {
    case 0x04828086:		/* may show up as PCI-HOST or 0:0 */
	matched = 1;
	break;
    default:
	break;
    }
    
    if (matched) {
	device_set_desc(dev, "PCI-EISA bridge");
	return(-10000);
    }
    return(ENXIO);
}
Пример #12
0
/*
 * Provide a device to "eat" the host->pci bridge devices that show up
 * on PCI busses and stop them showing up twice on the probes.  This also
 * stops them showing up as 'none' in pciconf -l.  If the host bridge
 * provides an AGP capability then we create a child agp device for the
 * agp GART driver to attach to.
 */
static int
pci_hostb_probe(device_t dev)
{
	u_int32_t id;

	id = pci_get_devid(dev);

	switch (id) {

	/* VIA VT82C596 Power Managment Function */
	case 0x30501106:
		return (ENXIO);

	default:
		break;
	}

	if (pci_get_class(dev) == PCIC_BRIDGE &&
	    pci_get_subclass(dev) == PCIS_BRIDGE_HOST) {
		device_set_desc(dev, "Host to PCI bridge");
		device_quiet(dev);
		return (-10000);
	}
	return (ENXIO);
}
Пример #13
0
static const char *
ehci_pci_match(device_t self)
{
	u_int32_t device_id = pci_get_devid(self);

	switch (device_id) {
	case PCI_EHCI_DEVICEID_M5239:
		return (ehci_device_m5239);
	case PCI_EHCI_DEVICEID_8111:
		return (ehci_device_8111);
	case PCI_EHCI_DEVICEID_CS5536:
		return (ehci_device_cs5536);
	case PCI_EHCI_DEVICEID_SB200:
		return (ehci_device_sb200);
	case PCI_EHCI_DEVICEID_SB400:
		return (ehci_device_sb400);
	case PCI_EHCI_DEVICEID_6300:
		return (ehci_device_6300);
	case PCI_EHCI_DEVICEID_63XX:
		return (ehci_device_63XX);
	case PCI_EHCI_DEVICEID_ICH4:
		return (ehci_device_ich4);
	case PCI_EHCI_DEVICEID_ICH5:
		return (ehci_device_ich5);
	case PCI_EHCI_DEVICEID_ICH6:
		return (ehci_device_ich6);
	case PCI_EHCI_DEVICEID_ICH7:
		return (ehci_device_ich7);
	case PCI_EHCI_DEVICEID_ICH8_A:
		return (ehci_device_ich8_a);
	case PCI_EHCI_DEVICEID_ICH8_B:
		return (ehci_device_ich8_b);
	case PCI_EHCI_DEVICEID_NEC:
		return (ehci_device_nec);
	case PCI_EHCI_DEVICEID_NF2:
		return (ehci_device_nf2);
	case PCI_EHCI_DEVICEID_NF2_400:
		return (ehci_device_nf2_400);
	case PCI_EHCI_DEVICEID_NF3:
		return (ehci_device_nf3);
	case PCI_EHCI_DEVICEID_NF3_250:
		return (ehci_device_nf3_250);
	case PCI_EHCI_DEVICEID_NF4:
		return (ehci_device_nf4);
	case PCI_EHCI_DEVICEID_ISP156X:
		return (ehci_device_isp156x);
	case PCI_EHCI_DEVICEID_VIA:
		return (ehci_device_via);
	default:
		if (pci_get_class(self) == PCIC_SERIALBUS
		    && pci_get_subclass(self) == PCIS_SERIALBUS_USB
		    && pci_get_progif(self) == PCI_INTERFACE_EHCI) {
			return (ehci_device_generic);
		}
	}

	return NULL;		/* dunno */
}
Пример #14
0
static const char *
ohci_pci_match(device_t self)
{
	uint32_t device_id = pci_get_devid(self);

	switch (device_id) {
	case 0x523710b9:
		return ("AcerLabs M5237 (Aladdin-V) USB controller");

	case 0x740c1022:
		return ("AMD-756 USB Controller");

	case 0x74141022:
		return ("AMD-766 USB Controller");

	case 0x43741002:
		return "ATI SB400 USB Controller";
	case 0x43751002:
		return "ATI SB400 USB Controller";

	case 0x06701095:
		return ("CMD Tech 670 (USB0670) USB controller");

	case 0x06731095:
		return ("CMD Tech 673 (USB0673) USB controller");

	case 0xc8611045:
		return ("OPTi 82C861 (FireLink) USB controller");

	case 0x00351033:
		return ("NEC uPD 9210 USB controller");

	case 0x00d710de:
		return ("nVidia nForce3 USB Controller");

	case 0x03f110de:
		return ("nVidia nForce MCP61 USB Controller");

	case 0x70011039:
		return ("SiS 5571 USB controller");

	case 0x1103108e:
		return "Sun PCIO-2 USB controller";

	case 0x0019106b:
		return ("Apple KeyLargo USB controller");

	default:
		break;
	}
	if ((pci_get_class(self) == PCIC_SERIALBUS) &&
	    (pci_get_subclass(self) == PCIS_SERIALBUS_USB) &&
	    (pci_get_progif(self) == PCI_INTERFACE_OHCI)) {
		return ("OHCI (generic) USB controller");
	}
	return (NULL);
}
Пример #15
0
int
vga_pci_is_boot_display(device_t dev)
{
	int unit;
	device_t pcib;
	uint16_t config;

	/* Check that the given device is a video card */
	if ((pci_get_class(dev) != PCIC_DISPLAY &&
	    (pci_get_class(dev) != PCIC_OLD ||
	     pci_get_subclass(dev) != PCIS_OLD_VGA)))
		return (0);

	unit = device_get_unit(dev);

	if (vga_pci_default_unit >= 0) {
		/*
		 * The boot display device was determined by a previous
		 * call to this function, or the user forced it using
		 * the hw.pci.default_vgapci_unit tunable.
		 */
		return (vga_pci_default_unit == unit);
	}

	/*
	 * The primary video card used as a boot display must have the
	 * "I/O" and "Memory Address Space Decoding" bits set in its
	 * Command register.
	 *
	 * Furthermore, if the card is attached to a bridge, instead of
	 * the root PCI bus, the bridge must have the "VGA Enable" bit
	 * set in its Control register.
	 */

	pcib = device_get_parent(device_get_parent(dev));
	if (device_get_devclass(device_get_parent(pcib)) ==
	    devclass_find("pci")) {
		/*
		 * The parent bridge is a PCI-to-PCI bridge: check the
		 * value of the "VGA Enable" bit.
		 */
		config = pci_read_config(pcib, PCIR_BRIDGECTL_1, 2);
		if ((config & PCIB_BCR_VGA_ENABLE) == 0)
			return (0);
	}

	config = pci_read_config(dev, PCIR_COMMAND, 2);
	if ((config & (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN)) == 0)
		return (0);

	/* This video card is the boot display: record its unit number. */
	vga_pci_default_unit = unit;
	device_set_flags(dev, 1);

	return (1);
}
/*
 * generic PCI ATA device probe
 */
static int
hv_ata_pci_probe(device_t dev)
{
	int ata_disk_enable = 0;
	if(bootverbose)
		device_printf(dev,
		    "hv_ata_pci_probe dev_class/subslcass = %d, %d\n",
			pci_get_class(dev), pci_get_subclass(dev));
			
	/* is this a storage class device ? */
	if (pci_get_class(dev) != PCIC_STORAGE)
		return (ENXIO);

	/* is this an IDE/ATA type device ? */
	if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
		return (ENXIO);

	if(bootverbose)
		device_printf(dev,
		    "Hyper-V probe for disabling ATA-PCI, emulated driver\n");

	/*
	 * On Hyper-V the default is to use the enlightened driver for
	 * IDE disks. However, if the user wishes to use the native
	 * ATA driver, the environment variable
	 * hw_ata.disk_enable must be explicitly set to 1.
	 */
	if (hv_check_for_hyper_v()) {
		if (getenv_int("hw.ata.disk_enable", &ata_disk_enable)) {
			if(bootverbose)
				device_printf(dev,
				"hw.ata.disk_enable flag is disabling Hyper-V"
				" ATA driver support\n");
			return (ENXIO);
		}

	}

	if(bootverbose)
		device_printf(dev, "Hyper-V ATA storage driver enabled.\n");

	return (BUS_PROBE_VENDOR);
}
Пример #17
0
static const char *
xhci_pci_match(device_t self)
{
    if ((pci_get_class(self) == PCIC_SERIALBUS)
            && (pci_get_subclass(self) == PCIS_SERIALBUS_USB)
            && (pci_get_progif(self) == PCIP_SERIALBUS_USB_XHCI)) {
        return ("XHCI (generic) USB 3.0 controller");
    }
    return (NULL);			/* dunno */
}
Пример #18
0
/*
 * Generic device interface
 */
static int
pcib_probe(device_t dev)
{
    if ((pci_get_class(dev) == PCIC_BRIDGE) &&
	(pci_get_subclass(dev) == PCIS_BRIDGE_PCI)) {
	device_set_desc(dev, "PCI-PCI bridge");
	return(-10000);
    }
    return(ENXIO);
}
Пример #19
0
static int
ipmi2_pci_probe(device_t dev)
{
	if (pci_get_class(dev) == PCIC_SERIALBUS &&
	    pci_get_subclass(dev) == PCIS_SERIALBUS_IPMI) {
		device_set_desc(dev, "IPMI System Interface");
		return (BUS_PROBE_GENERIC);
	}

	return (ENXIO);
}
Пример #20
0
static const char *
uhci_pci_match(device_t self)
{
	u_int32_t device_id = pci_get_devid(self);

	if (device_id == PCI_UHCI_DEVICEID_PIIX3) {
		return (uhci_device_piix3);
	} else if (device_id == PCI_UHCI_DEVICEID_PIIX4) {
		return (uhci_device_piix4);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH) {
		return (uhci_device_ich);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH0) {
		return (uhci_device_ich0);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH2_A) {
		return (uhci_device_ich2_a);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH2_B) {
		return (uhci_device_ich2_b);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH3_A) {
		return (uhci_device_ich3_a);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH3_B) {
		return (uhci_device_ich3_b);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH3_C) {
		return (uhci_device_ich3_c);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH4_A) {
		return (uhci_device_ich4_a);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH4_B) {
		return (uhci_device_ich4_b);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH4_C) {
		return (uhci_device_ich4_c);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH5_A) {
		return (uhci_device_ich5_a);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH5_B) {
		return (uhci_device_ich5_b);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH5_C) {
		return (uhci_device_ich5_c);
	} else if (device_id == PCI_UHCI_DEVICEID_ICH5_D) {
		return (uhci_device_ich5_d);
	} else if (device_id == PCI_UHCI_DEVICEID_440MX) {
		return (uhci_device_440mx);
	} else if (device_id == PCI_UHCI_DEVICEID_460GX) {
		return (uhci_device_460gx);
	} else if (device_id == PCI_UHCI_DEVICEID_VT83C572) {
		return (uhci_device_vt83c572);
	} else {
		if (pci_get_class(self) == PCIC_SERIALBUS
		    && pci_get_subclass(self) == PCIS_SERIALBUS_USB
		    && pci_get_progif(self) == PCI_INTERFACE_UHCI) {
			return (uhci_device_generic);
		}
	}

	return NULL;		/* dunno... */
}
Пример #21
0
/*
 * Driver to swallow UniNorth host bridges from the PCI bus side.
 */
static int
unhb_probe(device_t dev)
{

	if (pci_get_class(dev) == PCIC_BRIDGE &&
	    pci_get_subclass(dev) == PCIS_BRIDGE_HOST) {
		device_set_desc(dev, "Host to PCI bridge");
		device_quiet(dev);
		return (-10000);
	}

	return (ENXIO);
}
Пример #22
0
int
vga_pci_is_boot_display(device_t dev)
{

	/*
	 * Return true if the given device is the default display used
	 * at boot time.
	 */
	return (
	    (pci_get_class(dev) == PCIC_DISPLAY ||
	     (pci_get_class(dev) == PCIC_OLD &&
	      pci_get_subclass(dev) == PCIS_OLD_VGA)) &&
	    device_get_unit(dev) == vga_pci_default_unit);
}
Пример #23
0
/*
 * ATI chipset support functions
 */
int
ata_ati_ident(device_t dev)
{
    struct ata_pci_controller *ctlr = device_get_softc(dev);
    static const struct ata_chip_id ids[] =
    {{ ATA_ATI_IXP200,    0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" },
     { ATA_ATI_IXP300,    0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" },
     { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" },
     { ATA_ATI_IXP400,    0x00, ATI_PATA, 0, ATA_UDMA6, "IXP400" },
     { ATA_ATI_IXP400_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP400" },
     { ATA_ATI_IXP400_S2, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP400" },
     { ATA_ATI_IXP600,    0x00, ATI_PATA, 0, ATA_UDMA6, "IXP600" },
     { ATA_ATI_IXP600_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP600" },
     { ATA_ATI_IXP600_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP600" },
     { ATA_ATI_IXP700,    0x00, ATI_PATA, 0, ATA_UDMA6, "IXP700/800" },
     { ATA_ATI_IXP700_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" },
     { ATA_ATI_IXP700_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" },
     { ATA_ATI_IXP700_S3, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" },
     { ATA_ATI_IXP700_S4, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP700/800" },
     { ATA_ATI_IXP800_S1, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" },
     { ATA_ATI_IXP800_S2, 0x00, ATI_AHCI, 0, ATA_SA300, "IXP800" },
     { 0, 0, 0, 0, 0, 0}};

    if (pci_get_vendor(dev) != ATA_ATI_ID)
	return ENXIO;

    if (!(ctlr->chip = ata_match_chip(dev, ids)))
	return ENXIO;

    ata_set_desc(dev);

    switch (ctlr->chip->cfg1) {
    case ATI_PATA:
	ctlr->chipinit = ata_ati_chipinit;
	break;
    case ATI_SATA:
	/*
	 * the ATI SATA controller is actually a SiI 3112 controller
	 */
	ctlr->chipinit = ata_sii_chipinit;
	break;
    case ATI_AHCI:
	if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
		ctlr->chipinit = ata_ahci_chipinit;
	else
		ctlr->chipinit = ata_ati_chipinit;
	break;
    }
    return 0;
}
Пример #24
0
static int
ofw_pcib_pci_probe(device_t dev)
{

	if ((pci_get_class(dev) != PCIC_BRIDGE) ||
	    (pci_get_subclass(dev) != PCIS_BRIDGE_PCI)) {
		return (ENXIO);
	}

	if (ofw_bus_get_node(dev) == -1)
		return (ENXIO);

	device_set_desc(dev, "OFW PCI-PCI bridge");
	return (0);
}
Пример #25
0
static int
mptable_pcib_probe(device_t dev)
{
	int bus;

	if ((pci_get_class(dev) != PCIC_BRIDGE) ||
	    (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
		return (ENXIO);
	bus = pci_read_config(dev, PCIR_SECBUS_1, 1);
	if (bus == 0)
		return (ENXIO);
	if (mptable_pci_probe_table(bus) != 0)
		return (ENXIO);
	device_set_desc(dev, "MPTable PCI-PCI bridge");
	return (-1000);
}
Пример #26
0
static const char *
agp_nvidia_match (device_t dev)
{
	if (pci_get_class(dev) != PCIC_BRIDGE ||
	    pci_get_subclass(dev) != PCIS_BRIDGE_HOST ||
	    pci_get_vendor(dev) != NVIDIA_VENDORID)
		return (NULL);

	switch (pci_get_device(dev)) {
	case NVIDIA_DEVICEID_NFORCE:
		return ("NVIDIA nForce AGP Controller");
	case NVIDIA_DEVICEID_NFORCE2:
		return ("NVIDIA nForce2 AGP Controller");
	}
	return (NULL);
}
Пример #27
0
static int
acpi_pcib_pci_probe(device_t dev)
{

    if (pci_get_class(dev) != PCIC_BRIDGE ||
	pci_get_subclass(dev) != PCIS_BRIDGE_PCI ||
	acpi_disabled("pci"))
	return (ENXIO);
    if (acpi_get_handle(dev) == NULL)
	return (ENXIO);
    if (pci_cfgregopen() == 0)
	return (ENXIO);

    device_set_desc(dev, "ACPI PCI-PCI bridge");
    return (-1000);
}
Пример #28
0
static int
acpi_pcib_pci_probe(device_t dev)
{
    int error;

    if (pci_get_class(dev) != PCIC_BRIDGE ||
	pci_get_subclass(dev) != PCIS_BRIDGE_PCI ||
	acpi_disabled("pci"))
	return (ENXIO);

    error = acpi_pcib_probe(dev);
    if (error)
	return (error);

    device_set_desc(dev, "ACPI PCI-PCI bridge");
    return (-100);
}
Пример #29
0
static int
vga_pci_probe(device_t dev)
{

	switch (pci_get_class(dev)) {
	case PCIC_DISPLAY:
		break;
	case PCIC_OLD:
		if (pci_get_subclass(dev) != PCIS_OLD_VGA)
			return (ENXIO);
		break;
	default:
		return (ENXIO);
	}
	device_set_desc(dev, "VGA-compatible display");
	return (BUS_PROBE_GENERIC);
}
Пример #30
0
static int
ahci_acpi_probe(device_t dev)
{
	ACPI_HANDLE h;

	if ((h = acpi_get_handle(dev)) == NULL)
		return (ENXIO);

	if (pci_get_class(dev) == PCIC_STORAGE &&
	    pci_get_subclass(dev) == PCIS_STORAGE_SATA &&
	    pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) {
		device_set_desc_copy(dev, "AHCI SATA controller");
		return (BUS_PROBE_DEFAULT);
	}

	return (ENXIO);
}