Lines Matching +full:vendor +full:- +full:id
1 // SPDX-License-Identifier: GPL-2.0
18 #include "xhci-trace.h"
19 #include "xhci-pci.h"
78 /* called after powerup, by probe or system-pm "wakeup" */
87 /* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */ in xhci_pci_reinit()
99 const struct pci_device_id *id; in xhci_pci_quirks() local
101 id = pci_match_id(pdev->driver->id_table, pdev); in xhci_pci_quirks()
103 if (id && id->driver_data) { in xhci_pci_quirks()
104 driver_data = (struct xhci_driver_data *)id->driver_data; in xhci_pci_quirks()
105 xhci->quirks |= driver_data->quirks; in xhci_pci_quirks()
108 /* Look for vendor-specific quirks */ in xhci_pci_quirks()
109 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && in xhci_pci_quirks()
110 (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK || in xhci_pci_quirks()
111 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) { in xhci_pci_quirks()
112 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && in xhci_pci_quirks()
113 pdev->revision == 0x0) { in xhci_pci_quirks()
114 xhci->quirks |= XHCI_RESET_EP_QUIRK; in xhci_pci_quirks()
119 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && in xhci_pci_quirks()
120 pdev->revision == 0x4) { in xhci_pci_quirks()
121 xhci->quirks |= XHCI_SLOW_SUSPEND; in xhci_pci_quirks()
125 pdev->revision); in xhci_pci_quirks()
127 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) in xhci_pci_quirks()
128 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
133 xhci->quirks |= XHCI_BROKEN_MSI; in xhci_pci_quirks()
137 pdev->revision); in xhci_pci_quirks()
138 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
141 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && in xhci_pci_quirks()
142 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1009) in xhci_pci_quirks()
143 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
145 if (pdev->vendor == PCI_VENDOR_ID_NEC) in xhci_pci_quirks()
146 xhci->quirks |= XHCI_NEC_HOST; in xhci_pci_quirks()
148 if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version == 0x96) in xhci_pci_quirks()
149 xhci->quirks |= XHCI_AMD_0x96_HOST; in xhci_pci_quirks()
152 if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_quirk_pll_check()) in xhci_pci_quirks()
153 xhci->quirks |= XHCI_AMD_PLL_FIX; in xhci_pci_quirks()
155 if (pdev->vendor == PCI_VENDOR_ID_AMD && in xhci_pci_quirks()
156 (pdev->device == 0x145c || in xhci_pci_quirks()
157 pdev->device == 0x15e0 || in xhci_pci_quirks()
158 pdev->device == 0x15e1 || in xhci_pci_quirks()
159 pdev->device == 0x43bb)) in xhci_pci_quirks()
160 xhci->quirks |= XHCI_SUSPEND_DELAY; in xhci_pci_quirks()
162 if (pdev->vendor == PCI_VENDOR_ID_AMD && in xhci_pci_quirks()
163 (pdev->device == 0x15e0 || pdev->device == 0x15e1)) in xhci_pci_quirks()
164 xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND; in xhci_pci_quirks()
166 if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5) in xhci_pci_quirks()
167 xhci->quirks |= XHCI_DISABLE_SPARSE; in xhci_pci_quirks()
169 if (pdev->vendor == PCI_VENDOR_ID_AMD) in xhci_pci_quirks()
170 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
172 if ((pdev->vendor == PCI_VENDOR_ID_AMD) && in xhci_pci_quirks()
173 ((pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4) || in xhci_pci_quirks()
174 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_3) || in xhci_pci_quirks()
175 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2) || in xhci_pci_quirks()
176 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1))) in xhci_pci_quirks()
177 xhci->quirks |= XHCI_U2_DISABLE_WAKE; in xhci_pci_quirks()
179 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in xhci_pci_quirks()
180 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_pci_quirks()
181 xhci->quirks |= XHCI_INTEL_HOST; in xhci_pci_quirks()
182 xhci->quirks |= XHCI_AVOID_BEI; in xhci_pci_quirks()
184 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
185 pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { in xhci_pci_quirks()
186 xhci->quirks |= XHCI_EP_LIMIT_QUIRK; in xhci_pci_quirks()
187 xhci->limit_active_eps = 64; in xhci_pci_quirks()
188 xhci->quirks |= XHCI_SW_BW_CHECKING; in xhci_pci_quirks()
194 * vendor will change the board name), so we have to key off all in xhci_pci_quirks()
197 xhci->quirks |= XHCI_SPURIOUS_REBOOT; in xhci_pci_quirks()
199 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
200 (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI || in xhci_pci_quirks()
201 pdev->device == PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI)) { in xhci_pci_quirks()
202 xhci->quirks |= XHCI_SPURIOUS_REBOOT; in xhci_pci_quirks()
203 xhci->quirks |= XHCI_SPURIOUS_WAKEUP; in xhci_pci_quirks()
205 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
206 (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
207 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || in xhci_pci_quirks()
208 pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
209 pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI || in xhci_pci_quirks()
210 pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI || in xhci_pci_quirks()
211 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || in xhci_pci_quirks()
212 pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI || in xhci_pci_quirks()
213 pdev->device == PCI_DEVICE_ID_INTEL_CML_XHCI)) { in xhci_pci_quirks()
214 xhci->quirks |= XHCI_PME_STUCK_QUIRK; in xhci_pci_quirks()
216 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
217 pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) in xhci_pci_quirks()
218 xhci->quirks |= XHCI_SSIC_PORT_UNUSED; in xhci_pci_quirks()
219 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
220 (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
221 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
222 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI)) in xhci_pci_quirks()
223 xhci->quirks |= XHCI_INTEL_USB_ROLE_SW; in xhci_pci_quirks()
224 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
225 (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
226 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
227 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || in xhci_pci_quirks()
228 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || in xhci_pci_quirks()
229 pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI)) in xhci_pci_quirks()
230 xhci->quirks |= XHCI_MISSING_CAS; in xhci_pci_quirks()
232 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
233 (pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_XHCI || in xhci_pci_quirks()
234 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_XHCI || in xhci_pci_quirks()
235 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_XHCI || in xhci_pci_quirks()
236 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_XHCI || in xhci_pci_quirks()
237 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_XHCI || in xhci_pci_quirks()
238 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_XHCI || in xhci_pci_quirks()
239 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI || in xhci_pci_quirks()
240 pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI || in xhci_pci_quirks()
241 pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI)) in xhci_pci_quirks()
242 xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; in xhci_pci_quirks()
244 if (pdev->vendor == PCI_VENDOR_ID_ETRON && in xhci_pci_quirks()
245 pdev->device == PCI_DEVICE_ID_EJ168) { in xhci_pci_quirks()
246 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
247 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
248 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
250 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && in xhci_pci_quirks()
251 pdev->device == 0x0014) { in xhci_pci_quirks()
252 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
253 xhci->quirks |= XHCI_ZERO_64B_REGS; in xhci_pci_quirks()
255 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && in xhci_pci_quirks()
256 pdev->device == 0x0015) { in xhci_pci_quirks()
257 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
258 xhci->quirks |= XHCI_ZERO_64B_REGS; in xhci_pci_quirks()
260 if (pdev->vendor == PCI_VENDOR_ID_VIA) in xhci_pci_quirks()
261 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
263 /* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ in xhci_pci_quirks()
264 if (pdev->vendor == PCI_VENDOR_ID_VIA && in xhci_pci_quirks()
265 pdev->device == 0x3432) in xhci_pci_quirks()
266 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
268 if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) in xhci_pci_quirks()
269 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_pci_quirks()
271 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
272 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) in xhci_pci_quirks()
273 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
274 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
275 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) in xhci_pci_quirks()
276 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
277 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
278 (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI || in xhci_pci_quirks()
279 pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)) in xhci_pci_quirks()
280 xhci->quirks |= XHCI_NO_64BIT_SUPPORT; in xhci_pci_quirks()
282 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
283 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) in xhci_pci_quirks()
284 xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL; in xhci_pci_quirks()
286 if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) in xhci_pci_quirks()
287 xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7; in xhci_pci_quirks()
289 if ((pdev->vendor == PCI_VENDOR_ID_BROADCOM || in xhci_pci_quirks()
290 pdev->vendor == PCI_VENDOR_ID_CAVIUM) && in xhci_pci_quirks()
291 pdev->device == 0x9026) in xhci_pci_quirks()
292 xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; in xhci_pci_quirks()
294 if (xhci->quirks & XHCI_RESET_ON_RESUME) in xhci_pci_quirks()
307 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), &intel_dsm_guid, 3, 1, in xhci_pme_acpi_rtd3_enable()
319 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_setup()
323 if (!xhci->sbrn) in xhci_pci_setup()
324 pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); in xhci_pci_setup()
327 xhci->imod_interval = 40000; in xhci_pci_setup()
336 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_setup()
339 xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn); in xhci_pci_setup()
349 static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) in xhci_pci_probe() argument
357 driver_data = (struct xhci_driver_data *)id->driver_data; in xhci_pci_probe()
358 if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { in xhci_pci_probe()
359 retval = renesas_xhci_check_request_fw(dev, id); in xhci_pci_probe()
364 reset = devm_reset_control_get_optional_exclusive(&dev->dev, NULL); in xhci_pci_probe()
369 /* Prevent runtime suspending between USB-2 and USB-3 initialization */ in xhci_pci_probe()
370 pm_runtime_get_noresume(&dev->dev); in xhci_pci_probe()
378 retval = usb_hcd_pci_probe(dev, id, &xhci_pci_hc_driver); in xhci_pci_probe()
384 hcd = dev_get_drvdata(&dev->dev); in xhci_pci_probe()
386 xhci->reset = reset; in xhci_pci_probe()
387 xhci->shared_hcd = usb_create_shared_hcd(&xhci_pci_hc_driver, &dev->dev, in xhci_pci_probe()
389 if (!xhci->shared_hcd) { in xhci_pci_probe()
390 retval = -ENOMEM; in xhci_pci_probe()
398 retval = usb_add_hcd(xhci->shared_hcd, dev->irq, in xhci_pci_probe()
404 if (!(xhci->quirks & XHCI_BROKEN_STREAMS) && in xhci_pci_probe()
405 HCC_MAX_PSA(xhci->hcc_params) >= 4) in xhci_pci_probe()
406 xhci->shared_hcd->can_do_streams = 1; in xhci_pci_probe()
408 /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ in xhci_pci_probe()
409 pm_runtime_put_noidle(&dev->dev); in xhci_pci_probe()
411 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) in xhci_pci_probe()
412 pm_runtime_allow(&dev->dev); in xhci_pci_probe()
417 usb_put_hcd(xhci->shared_hcd); in xhci_pci_probe()
421 pm_runtime_put_noidle(&dev->dev); in xhci_pci_probe()
430 if (xhci->quirks & XHCI_RENESAS_FW_QUIRK) in xhci_pci_remove()
433 xhci->xhc_state |= XHCI_STATE_REMOVING; in xhci_pci_remove()
435 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) in xhci_pci_remove()
436 pm_runtime_forbid(&dev->dev); in xhci_pci_remove()
438 if (xhci->shared_hcd) { in xhci_pci_remove()
439 usb_remove_hcd(xhci->shared_hcd); in xhci_pci_remove()
440 usb_put_hcd(xhci->shared_hcd); in xhci_pci_remove()
441 xhci->shared_hcd = NULL; in xhci_pci_remove()
445 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) in xhci_pci_remove()
454 * through a vendor specific SSIC CONFIG register at offset 0x883c,
467 reg = (void __iomem *) xhci->cap_regs + in xhci_ssic_port_unused_quirk()
492 * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
500 reg = (void __iomem *) xhci->cap_regs + 0x80a4; in xhci_pme_quirk()
510 reg = readl(hcd->regs + SPARSE_CNTL_ENABLE); in xhci_sparse_control_quirk()
512 writel(reg, hcd->regs + SPARSE_CNTL_ENABLE); in xhci_sparse_control_quirk()
518 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_suspend()
525 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) in xhci_pci_suspend()
528 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_suspend()
531 if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) in xhci_pci_suspend()
534 if (xhci->quirks & XHCI_DISABLE_SPARSE) in xhci_pci_suspend()
538 if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED)) in xhci_pci_suspend()
547 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_resume()
550 reset_control_reset(xhci->reset); in xhci_pci_resume()
570 if (pdev->vendor == PCI_VENDOR_ID_INTEL) in xhci_pci_resume()
573 if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) in xhci_pci_resume()
576 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_resume()
586 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_shutdown()
591 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) in xhci_pci_shutdown()
596 /*-------------------------------------------------------------------------*/