Lines Matching +full:pci +full:- +full:x
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
52 #include <dev/pci/pcireg.h>
53 #include <dev/pci/pcivar.h>
54 #include <dev/pci/pcib_private.h>
55 #include <dev/pci/pci_private.h>
94 "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge 2C)" },
96 "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge LP)" },
98 "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge C 4C)" },
100 "Thunderbolt 3 PCI-PCI Bridge C (Alpine Ridge C 2C)" },
102 "Thunderbolt 3 PCI-PCI Bridge (IceLake)" },
104 "Thunderbolt 3 PCI-PCI Bridge (IceLake)" },
119 for (n = tb_pcib_identifiers; n->vendor != 0; n++) { in tb_pcib_find_ident()
120 if ((n->vendor != v) || (n->device != d)) in tb_pcib_find_ident()
122 if (((n->subvendor != 0xffff) && (n->subvendor != sv)) || in tb_pcib_find_ident()
123 ((n->subdevice != 0xffff) && (n->subdevice != sd))) in tb_pcib_find_ident()
137 sc->debug = 0; in tb_pcib_get_tunables()
142 tb_parse_debug(&sc->debug, oid); in tb_pcib_get_tunables()
147 device_get_unit(sc->dev)); in tb_pcib_get_tunables()
149 tb_parse_debug(&sc->debug, oid); in tb_pcib_get_tunables()
160 ctx = device_get_sysctl_ctx(sc->dev); in tb_pcib_setup_sysctl()
162 tree = device_get_sysctl_tree(sc->dev); in tb_pcib_setup_sysctl()
168 sc->sysctl_tree = tree; in tb_pcib_setup_sysctl()
169 sc->sysctl_ctx = ctx; in tb_pcib_setup_sysctl()
173 &sc->debug, 0, tb_debug_sysctl, "A", "Thunderbolt debug level"); in tb_pcib_setup_sysctl()
179 * This is used for both the PCI and ACPI attachments. It shouldn't return
195 snprintf(desc, TB_DESC_MAX, "%s %s", n->desc, suffix); in tb_pcib_probe_common()
223 sc->dev = dev; in tb_pcib_attach_common()
224 sc->vsec = -1; in tb_pcib_attach_common()
228 sc->flags = n->flags; in tb_pcib_attach_common()
242 * that there aren't unique PCI ID's to help with this. in tb_pcib_attach_common()
247 sc->flags |= TB_FLAGS_ISUFP; in tb_pcib_attach_common()
250 sc->flags |= TB_FLAGS_ISROOT; in tb_pcib_attach_common()
256 * Find the PCI Vendor Specific Extended Capability. It's the magic in tb_pcib_attach_common()
260 error = pci_find_extcap(dev, PCIZ_VENDOR, &sc->vsec); in tb_pcib_attach_common()
269 * Take the AR bridge out of low-power mode. in tb_pcib_attach_common()
279 tb_debug(sc, DBG_BRIDGE, "SXEXIT returned error= %d resp= 0x%x " in tb_pcib_attach_common()
280 "data= 0x%x\n", error, cmd.cmd_resp, cmd.data_out); in tb_pcib_attach_common()
286 val = pci_read_config(dev, sc->vsec + AR_VSCAP_1C, 4); in tb_pcib_attach_common()
287 tb_debug(sc, DBG_BRIDGE|DBG_FULL, "VSEC+0x1c= 0x%08x\n", val); in tb_pcib_attach_common()
289 pci_write_config(dev, sc->vsec + AR_VSCAP_1C, val, 4); in tb_pcib_attach_common()
291 val = pci_read_config(dev, sc->vsec + AR_VSCAP_B0, 4); in tb_pcib_attach_common()
292 tb_debug(sc, DBG_BRIDGE|DBG_FULL, "VSEC+0xb0= 0x%08x\n", val); in tb_pcib_attach_common()
294 pci_write_config(dev, sc->vsec + AR_VSCAP_B0, val, 4); in tb_pcib_attach_common()
330 tb_debug(sc, DBG_BRIDGE, "SXEXIT returned error= %d resp= 0x%x " in tb_pcib_detach()
331 "data= 0x%x\n", error, cmd.cmd_resp, cmd.data_out); in tb_pcib_detach()
348 if (vsec == -1) in tb_pcib_lc_mailbox()
361 regcmd = LC_MBOXOUT_VALID | (cmd->cmd & LC_MBOXOUT_CMD_MASK); in tb_pcib_lc_mailbox()
362 regcmd |= (cmd->data_in << LC_MBOXOUT_DATA_SHIFT); in tb_pcib_lc_mailbox()
363 tb_debug(sc, DBG_BRIDGE|DBG_FULL, "Writing LC cmd 0x%x\n", regcmd); in tb_pcib_lc_mailbox()
369 tb_debug(sc, DBG_BRIDGE|DBG_FULL, "LC Mailbox= 0x%08x\n", in tb_pcib_lc_mailbox()
378 cmd->cmd_resp = result & LC_MBOXIN_CMD_MASK; in tb_pcib_lc_mailbox()
379 cmd->data_out = result >> LC_MBOXIN_CMD_SHIFT; in tb_pcib_lc_mailbox()
419 if (vsec == -1) in tb_pcib_pcie2cio_read()
445 if (vsec == -1) in tb_pcib_pcie2cio_write()
463 * differentiated by PCI ID, so a heuristic approach to identifying it is
529 *debug = sc->debug; in tb_pcib_get_debug()
550 DRIVER_MODULE_ORDERED(tb_pcib, pci, tb_pcib_driver,
552 MODULE_DEPEND(tb_pcib, pci, 1, 1, 1);
554 pci, tb_pcib, tb_pcib_identifiers, nitems(tb_pcib_identifiers) - 1);
564 * This driver is only valid if the parent device is a PCI-PCI in tb_pci_probe()
566 * PCI bus. in tb_pci_probe()
570 if (strcmp(devclass_get_name(dc), "pci") != 0) in tb_pci_probe()
574 switch (n->flags & TB_GEN_MASK) { in tb_pci_probe()
622 DEFINE_CLASS_1(pci, tb_pci_driver, tb_pci_methods, sizeof(struct pci_softc),
625 MODULE_DEPEND(tb_pci, pci, 1, 1, 1);