Lines Matching +full:pci +full:- +full:dev

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
41 #include <dev/pci/pcivar.h>
42 #include <dev/pci/pcireg.h>
43 #include <dev/pci/pcib_private.h>
55 legacy_pcib_maxslots(device_t dev) in legacy_pcib_maxslots() argument
63 legacy_pcib_read_config(device_t dev, u_int bus, u_int slot, u_int func, in legacy_pcib_read_config() argument
72 legacy_pcib_write_config(device_t dev, u_int bus, u_int slot, u_int func, in legacy_pcib_write_config() argument
81 legacy_pcib_route_interrupt(device_t pcib, device_t dev, int pin) in legacy_pcib_route_interrupt() argument
85 return (pci_pir_route_interrupt(pci_get_bus(dev), pci_get_slot(dev), in legacy_pcib_route_interrupt()
86 pci_get_function(dev), pin)); in legacy_pcib_route_interrupt()
96 legacy_pcib_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, in legacy_pcib_alloc_msi() argument
102 return (PCIB_ALLOC_MSI(device_get_parent(bus), dev, count, maxcount, in legacy_pcib_alloc_msi()
107 legacy_pcib_alloc_msix(device_t pcib, device_t dev, int *irq) in legacy_pcib_alloc_msix() argument
112 return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq)); in legacy_pcib_alloc_msix()
116 legacy_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, in legacy_pcib_map_msi() argument
123 error = PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data); in legacy_pcib_map_msi()
129 if (slot == -1 || func == -1) in legacy_pcib_map_msi()
151 s = "Intel 824?? host to PCI bridge"; in legacy_pcib_is_host_bridge()
160 s = "Intel 82810-DC100 (i810-DC100 GMCH) Host To Hub bridge"; in legacy_pcib_is_host_bridge()
169 s = "Intel 82443LX (440 LX) host to PCI bridge"; in legacy_pcib_is_host_bridge()
172 s = "Intel 82443BX (440 BX) host to PCI bridge"; in legacy_pcib_is_host_bridge()
175 s = "Intel 82443BX host to PCI bridge (AGP disabled)"; in legacy_pcib_is_host_bridge()
178 s = "Intel 82443MX host to PCI bridge"; in legacy_pcib_is_host_bridge()
181 s = "Intel 82443GX host to PCI bridge"; in legacy_pcib_is_host_bridge()
187 s = "Intel 82443GX host to PCI bridge (AGP disabled)"; in legacy_pcib_is_host_bridge()
190 s = "Intel 82454KX/GX (Orion) host to PCI bridge"; in legacy_pcib_is_host_bridge()
197 * be seen first and isn't really a pci bridge (the in legacy_pcib_is_host_bridge()
202 * Since the MIOC doesn't have a pci bus attached, we in legacy_pcib_is_host_bridge()
235 s = "Intel 82845 Host to PCI bridge"; in legacy_pcib_is_host_bridge()
238 /* AMD -- vendor 0x1022 */ in legacy_pcib_is_host_bridge()
240 s = "AMD Elan SC520 host to PCI bridge"; in legacy_pcib_is_host_bridge()
245 "*** WARNING: missing CPU_ELAN -- timekeeping may be wrong\n"); in legacy_pcib_is_host_bridge()
249 s = "AMD-751 host to PCI bridge"; in legacy_pcib_is_host_bridge()
252 s = "AMD-761 host to PCI bridge"; in legacy_pcib_is_host_bridge()
255 /* SiS -- vendor 0x1039 */ in legacy_pcib_is_host_bridge()
266 s = "SiS 5591 host to PCI bridge"; in legacy_pcib_is_host_bridge()
272 /* VLSI -- vendor 0x1004 */ in legacy_pcib_is_host_bridge()
274 s = "VLSI 82C592 Host to PCI bridge"; in legacy_pcib_is_host_bridge()
278 /* totally. Please let me know if anything wrong. -F */ in legacy_pcib_is_host_bridge()
279 /* XXX need info on the MVP3 -- any takers? */ in legacy_pcib_is_host_bridge()
284 /* AcerLabs -- vendor 0x10b9 */ in legacy_pcib_is_host_bridge()
285 /* Funny : The datasheet told me vendor id is "10b8",sub-vendor */ in legacy_pcib_is_host_bridge()
286 /* id is '10b9" but the register always shows "10b9". -Foxfair */ in legacy_pcib_is_host_bridge()
288 s = "AcerLabs M1541 (Aladdin-V) PCI host bridge"; in legacy_pcib_is_host_bridge()
291 /* OPTi -- vendor 0x1045 */ in legacy_pcib_is_host_bridge()
293 s = "OPTi 82C700 host to PCI bridge"; in legacy_pcib_is_host_bridge()
296 s = "OPTi 82C822 host to PCI Bridge"; in legacy_pcib_is_host_bridge()
299 /* ServerWorks -- vendor 0x1166 */ in legacy_pcib_is_host_bridge()
301 s = "ServerWorks NB6536 2.0HE host to PCI bridge"; in legacy_pcib_is_host_bridge()
311 case 0x010f1014: /* IBM re-badged ServerWorks chipset */ in legacy_pcib_is_host_bridge()
312 s = "ServerWorks host to PCI bridge"; in legacy_pcib_is_host_bridge()
317 s = "ServerWorks NB6635 3.0LE host to PCI bridge"; in legacy_pcib_is_host_bridge()
322 s = "ServerWorks CIOB30 host to PCI bridge"; in legacy_pcib_is_host_bridge()
328 case 0x03021014: /* IBM re-badged ServerWorks chipset */ in legacy_pcib_is_host_bridge()
329 s = "ServerWorks CMIC-HE host to PCI-X bridge"; in legacy_pcib_is_host_bridge()
339 s = "ServerWorks host to PCI bridge(unknown chipset)"; in legacy_pcib_is_host_bridge()
343 /* Compaq/HP -- vendor 0x0e11 */ in legacy_pcib_is_host_bridge()
345 s = "Compaq/HP Model 6010 HotPlug PCI Bridge"; in legacy_pcib_is_host_bridge()
349 /* Integrated Micro Solutions -- vendor 0x10e0 */ in legacy_pcib_is_host_bridge()
356 s = "Host to PCI bridge"; in legacy_pcib_is_host_bridge()
366 s = "Host to PCI bridge"; in legacy_pcib_is_host_bridge()
372 * Scan the first pci bus for host-pci bridges and add pcib instances
390 * Check to see if we haven't already had a PCI bus added in legacy_pcib_identify()
394 if ((pci_devclass = devclass_find("pci")) && in legacy_pcib_identify()
429 if (id == -1) in legacy_pcib_identify()
485 * hardware doesn't actually have a host-pci bridge device. in legacy_pcib_identify()
486 * Note that pci_cfgregopen() thinks we have PCI devices.. in legacy_pcib_identify()
500 legacy_pcib_probe(device_t dev) in legacy_pcib_probe() argument
505 return -100; in legacy_pcib_probe()
509 legacy_pcib_attach(device_t dev) in legacy_pcib_attach() argument
515 bus = pcib_get_bus(dev); in legacy_pcib_attach()
517 * Look for a PCI BIOS interrupt routing table as that will be in legacy_pcib_attach()
521 pir = BUS_ADD_CHILD(device_get_parent(dev), 0, "pir", 0); in legacy_pcib_attach()
526 device_add_child(dev, "pci", DEVICE_UNIT_ANY); in legacy_pcib_attach()
527 bus_attach_children(dev); in legacy_pcib_attach()
532 legacy_pcib_read_ivar(device_t dev, device_t child, int which, in legacy_pcib_read_ivar() argument
541 *result = legacy_get_pcibus(dev); in legacy_pcib_read_ivar()
548 legacy_pcib_write_ivar(device_t dev, device_t child, int which, in legacy_pcib_write_ivar() argument
556 legacy_set_pcibus(dev, value); in legacy_pcib_write_ivar()
563 * Helper routine for x86 Host-PCI bridge driver resource allocation.
569 * laptops that don't have PCI buses behind a PCI bridge, so assuming
573 * this tunable by hw.pci.host_mem_start.
585 if (start + count - 1 != end) { in hostb_alloc_start()
595 legacy_pcib_alloc_resource(device_t dev, device_t child, int type, int rid, in legacy_pcib_alloc_resource() argument
603 return (bus_generic_alloc_resource(dev, child, type, rid, start, end, in legacy_pcib_alloc_resource()
608 legacy_pcib_adjust_resource(device_t dev, device_t child, in legacy_pcib_adjust_resource() argument
614 return (bus_generic_adjust_resource(dev, child, r, start, end)); in legacy_pcib_adjust_resource()
618 legacy_pcib_release_resource(device_t dev, device_t child, struct resource *r) in legacy_pcib_release_resource() argument
623 return (bus_generic_release_resource(dev, child, r)); in legacy_pcib_release_resource()
627 legacy_pcib_activate_resource(device_t dev, device_t child, struct resource *r) in legacy_pcib_activate_resource() argument
631 return (bus_generic_activate_resource(dev, child, r)); in legacy_pcib_activate_resource()
635 legacy_pcib_deactivate_resource(device_t dev, device_t child, in legacy_pcib_deactivate_resource() argument
640 return (bus_generic_deactivate_resource(dev, child, r)); in legacy_pcib_deactivate_resource()
683 * PCI bus interface. This could be used to extract the
685 * ID is available and the PCI BIOS isn't, but for now we just
691 { 0x030ad041 /* PNP0A03 */, "PCI Bus" },
697 pcibus_pnp_probe(device_t dev) in pcibus_pnp_probe() argument
701 if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, pcibus_pnp_ids)) <= 0) in pcibus_pnp_probe()
702 device_quiet(dev); in pcibus_pnp_probe()
707 pcibus_pnp_attach(device_t dev) in pcibus_pnp_attach() argument
724 * Provide a PCI-PCI bridge driver for PCI buses behind PCI-PCI bridges
741 DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, 0, 0);
745 pcibios_pcib_probe(device_t dev) in pcibios_pcib_probe() argument
749 if ((pci_get_class(dev) != PCIC_BRIDGE) || in pcibios_pcib_probe()
750 (pci_get_subclass(dev) != PCIS_BRIDGE_PCI)) in pcibios_pcib_probe()
752 bus = pci_read_config(dev, PCIR_SECBUS_1, 1); in pcibios_pcib_probe()
757 device_set_desc(dev, "PCIBIOS PCI-PCI bridge"); in pcibios_pcib_probe()
758 return (-2000); in pcibios_pcib_probe()