Lines Matching +full:vendor +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0
18 #include "xhci-trace.h"
19 #include "xhci-pci.h"
85 /* called after powerup, by probe or system-pm "wakeup" */
94 /* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */ in xhci_pci_reinit()
106 const struct pci_device_id *id; in xhci_pci_quirks() local
108 id = pci_match_id(pdev->driver->id_table, pdev); in xhci_pci_quirks()
110 if (id && id->driver_data) { in xhci_pci_quirks()
111 driver_data = (struct xhci_driver_data *)id->driver_data; in xhci_pci_quirks()
112 xhci->quirks |= driver_data->quirks; in xhci_pci_quirks()
115 /* Look for vendor-specific quirks */ in xhci_pci_quirks()
116 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && in xhci_pci_quirks()
117 (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK || in xhci_pci_quirks()
118 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) { in xhci_pci_quirks()
119 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && in xhci_pci_quirks()
120 pdev->revision == 0x0) { in xhci_pci_quirks()
121 xhci->quirks |= XHCI_RESET_EP_QUIRK; in xhci_pci_quirks()
126 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && in xhci_pci_quirks()
127 pdev->revision == 0x4) { in xhci_pci_quirks()
128 xhci->quirks |= XHCI_SLOW_SUSPEND; in xhci_pci_quirks()
132 pdev->revision); in xhci_pci_quirks()
134 if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) in xhci_pci_quirks()
135 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
140 xhci->quirks |= XHCI_BROKEN_MSI; in xhci_pci_quirks()
144 pdev->revision); in xhci_pci_quirks()
145 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
148 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && in xhci_pci_quirks()
149 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1009) in xhci_pci_quirks()
150 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
152 if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && in xhci_pci_quirks()
153 pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100) in xhci_pci_quirks()
154 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
156 if (pdev->vendor == PCI_VENDOR_ID_NEC) in xhci_pci_quirks()
157 xhci->quirks |= XHCI_NEC_HOST; in xhci_pci_quirks()
159 if (pdev->vendor == PCI_VENDOR_ID_AMD && xhci->hci_version == 0x96) in xhci_pci_quirks()
160 xhci->quirks |= XHCI_AMD_0x96_HOST; in xhci_pci_quirks()
163 if (pdev->vendor == PCI_VENDOR_ID_AMD && usb_amd_quirk_pll_check()) in xhci_pci_quirks()
164 xhci->quirks |= XHCI_AMD_PLL_FIX; in xhci_pci_quirks()
166 if (pdev->vendor == PCI_VENDOR_ID_AMD && in xhci_pci_quirks()
167 (pdev->device == 0x145c || in xhci_pci_quirks()
168 pdev->device == 0x15e0 || in xhci_pci_quirks()
169 pdev->device == 0x15e1 || in xhci_pci_quirks()
170 pdev->device == 0x43bb)) in xhci_pci_quirks()
171 xhci->quirks |= XHCI_SUSPEND_DELAY; in xhci_pci_quirks()
173 if (pdev->vendor == PCI_VENDOR_ID_AMD && in xhci_pci_quirks()
174 (pdev->device == 0x15e0 || pdev->device == 0x15e1)) in xhci_pci_quirks()
175 xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND; in xhci_pci_quirks()
177 if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5) { in xhci_pci_quirks()
178 xhci->quirks |= XHCI_DISABLE_SPARSE; in xhci_pci_quirks()
179 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
182 if (pdev->vendor == PCI_VENDOR_ID_AMD) in xhci_pci_quirks()
183 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
185 if ((pdev->vendor == PCI_VENDOR_ID_AMD) && in xhci_pci_quirks()
186 ((pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4) || in xhci_pci_quirks()
187 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_3) || in xhci_pci_quirks()
188 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2) || in xhci_pci_quirks()
189 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_1))) in xhci_pci_quirks()
190 xhci->quirks |= XHCI_U2_DISABLE_WAKE; in xhci_pci_quirks()
192 if (pdev->vendor == PCI_VENDOR_ID_INTEL) { in xhci_pci_quirks()
193 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_pci_quirks()
194 xhci->quirks |= XHCI_INTEL_HOST; in xhci_pci_quirks()
195 xhci->quirks |= XHCI_AVOID_BEI; in xhci_pci_quirks()
197 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
198 pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { in xhci_pci_quirks()
199 xhci->quirks |= XHCI_EP_LIMIT_QUIRK; in xhci_pci_quirks()
200 xhci->limit_active_eps = 64; in xhci_pci_quirks()
201 xhci->quirks |= XHCI_SW_BW_CHECKING; in xhci_pci_quirks()
207 * vendor will change the board name), so we have to key off all in xhci_pci_quirks()
210 xhci->quirks |= XHCI_SPURIOUS_REBOOT; in xhci_pci_quirks()
212 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
213 (pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI || in xhci_pci_quirks()
214 pdev->device == PCI_DEVICE_ID_INTEL_WILDCATPOINT_LP_XHCI)) { in xhci_pci_quirks()
215 xhci->quirks |= XHCI_SPURIOUS_REBOOT; in xhci_pci_quirks()
216 xhci->quirks |= XHCI_SPURIOUS_WAKEUP; in xhci_pci_quirks()
218 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
219 (pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
220 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || in xhci_pci_quirks()
221 pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
222 pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_M_XHCI || in xhci_pci_quirks()
223 pdev->device == PCI_DEVICE_ID_INTEL_BROXTON_B_XHCI || in xhci_pci_quirks()
224 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || in xhci_pci_quirks()
225 pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI || in xhci_pci_quirks()
226 pdev->device == PCI_DEVICE_ID_INTEL_CML_XHCI)) { in xhci_pci_quirks()
227 xhci->quirks |= XHCI_PME_STUCK_QUIRK; in xhci_pci_quirks()
229 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
230 pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) in xhci_pci_quirks()
231 xhci->quirks |= XHCI_SSIC_PORT_UNUSED; in xhci_pci_quirks()
232 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
233 (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
234 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
235 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI)) in xhci_pci_quirks()
236 xhci->quirks |= XHCI_INTEL_USB_ROLE_SW; in xhci_pci_quirks()
237 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
238 (pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI || in xhci_pci_quirks()
239 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_LP_XHCI || in xhci_pci_quirks()
240 pdev->device == PCI_DEVICE_ID_INTEL_SUNRISEPOINT_H_XHCI || in xhci_pci_quirks()
241 pdev->device == PCI_DEVICE_ID_INTEL_APL_XHCI || in xhci_pci_quirks()
242 pdev->device == PCI_DEVICE_ID_INTEL_DNV_XHCI)) in xhci_pci_quirks()
243 xhci->quirks |= XHCI_MISSING_CAS; in xhci_pci_quirks()
245 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
246 (pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI || in xhci_pci_quirks()
247 pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI)) in xhci_pci_quirks()
248 xhci->quirks |= XHCI_RESET_TO_DEFAULT; in xhci_pci_quirks()
250 if (pdev->vendor == PCI_VENDOR_ID_INTEL && in xhci_pci_quirks()
251 (pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_XHCI || in xhci_pci_quirks()
252 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_XHCI || in xhci_pci_quirks()
253 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_LP_XHCI || in xhci_pci_quirks()
254 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_2C_XHCI || in xhci_pci_quirks()
255 pdev->device == PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_C_4C_XHCI || in xhci_pci_quirks()
256 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_2C_XHCI || in xhci_pci_quirks()
257 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_4C_XHCI || in xhci_pci_quirks()
258 pdev->device == PCI_DEVICE_ID_INTEL_TITAN_RIDGE_DD_XHCI || in xhci_pci_quirks()
259 pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI || in xhci_pci_quirks()
260 pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI || in xhci_pci_quirks()
261 pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI)) in xhci_pci_quirks()
262 xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; in xhci_pci_quirks()
264 if (pdev->vendor == PCI_VENDOR_ID_ETRON && in xhci_pci_quirks()
265 pdev->device == PCI_DEVICE_ID_EJ168) { in xhci_pci_quirks()
266 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
267 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
268 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
270 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && in xhci_pci_quirks()
271 pdev->device == 0x0014) { in xhci_pci_quirks()
272 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
273 xhci->quirks |= XHCI_ZERO_64B_REGS; in xhci_pci_quirks()
275 if (pdev->vendor == PCI_VENDOR_ID_RENESAS && in xhci_pci_quirks()
276 pdev->device == 0x0015) { in xhci_pci_quirks()
277 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
278 xhci->quirks |= XHCI_ZERO_64B_REGS; in xhci_pci_quirks()
280 if (pdev->vendor == PCI_VENDOR_ID_VIA) in xhci_pci_quirks()
281 xhci->quirks |= XHCI_RESET_ON_RESUME; in xhci_pci_quirks()
283 /* See https://bugzilla.kernel.org/show_bug.cgi?id=79511 */ in xhci_pci_quirks()
284 if (pdev->vendor == PCI_VENDOR_ID_VIA && in xhci_pci_quirks()
285 pdev->device == 0x3432) in xhci_pci_quirks()
286 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
288 if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { in xhci_pci_quirks()
289 xhci->quirks |= XHCI_LPM_SUPPORT; in xhci_pci_quirks()
290 xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; in xhci_pci_quirks()
293 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
294 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) { in xhci_pci_quirks()
299 xhci->quirks |= XHCI_SPURIOUS_SUCCESS; in xhci_pci_quirks()
300 xhci->quirks |= XHCI_BROKEN_STREAMS; in xhci_pci_quirks()
302 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
303 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) { in xhci_pci_quirks()
304 xhci->quirks |= XHCI_TRUST_TX_LENGTH; in xhci_pci_quirks()
305 xhci->quirks |= XHCI_NO_64BIT_SUPPORT; in xhci_pci_quirks()
307 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
308 (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI || in xhci_pci_quirks()
309 pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI || in xhci_pci_quirks()
310 pdev->device == PCI_DEVICE_ID_ASMEDIA_3242_XHCI)) in xhci_pci_quirks()
311 xhci->quirks |= XHCI_NO_64BIT_SUPPORT; in xhci_pci_quirks()
313 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && in xhci_pci_quirks()
314 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI) in xhci_pci_quirks()
315 xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL; in xhci_pci_quirks()
317 if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) in xhci_pci_quirks()
318 xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7; in xhci_pci_quirks()
320 if ((pdev->vendor == PCI_VENDOR_ID_BROADCOM || in xhci_pci_quirks()
321 pdev->vendor == PCI_VENDOR_ID_CAVIUM) && in xhci_pci_quirks()
322 pdev->device == 0x9026) in xhci_pci_quirks()
323 xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT; in xhci_pci_quirks()
325 if (pdev->vendor == PCI_VENDOR_ID_AMD && in xhci_pci_quirks()
326 (pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2 || in xhci_pci_quirks()
327 pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4)) in xhci_pci_quirks()
328 xhci->quirks |= XHCI_NO_SOFT_RETRY; in xhci_pci_quirks()
331 if (xhci->hci_version >= 0x120) in xhci_pci_quirks()
332 xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; in xhci_pci_quirks()
334 if (xhci->quirks & XHCI_RESET_ON_RESUME) in xhci_pci_quirks()
347 obj = acpi_evaluate_dsm(ACPI_HANDLE(&dev->dev), &intel_dsm_guid, 3, 1, in xhci_pme_acpi_rtd3_enable()
359 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_setup()
363 if (!xhci->sbrn) in xhci_pci_setup()
364 pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); in xhci_pci_setup()
367 xhci->imod_interval = 40000; in xhci_pci_setup()
376 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_setup()
379 xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn); in xhci_pci_setup()
389 static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) in xhci_pci_probe() argument
397 driver_data = (struct xhci_driver_data *)id->driver_data; in xhci_pci_probe()
398 if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { in xhci_pci_probe()
399 retval = renesas_xhci_check_request_fw(dev, id); in xhci_pci_probe()
404 reset = devm_reset_control_get_optional_exclusive(&dev->dev, NULL); in xhci_pci_probe()
409 /* Prevent runtime suspending between USB-2 and USB-3 initialization */ in xhci_pci_probe()
410 pm_runtime_get_noresume(&dev->dev); in xhci_pci_probe()
418 retval = usb_hcd_pci_probe(dev, id, &xhci_pci_hc_driver); in xhci_pci_probe()
424 hcd = dev_get_drvdata(&dev->dev); in xhci_pci_probe()
426 xhci->reset = reset; in xhci_pci_probe()
427 xhci->shared_hcd = usb_create_shared_hcd(&xhci_pci_hc_driver, &dev->dev, in xhci_pci_probe()
429 if (!xhci->shared_hcd) { in xhci_pci_probe()
430 retval = -ENOMEM; in xhci_pci_probe()
438 retval = usb_add_hcd(xhci->shared_hcd, dev->irq, in xhci_pci_probe()
444 if (!(xhci->quirks & XHCI_BROKEN_STREAMS) && in xhci_pci_probe()
445 HCC_MAX_PSA(xhci->hcc_params) >= 4) in xhci_pci_probe()
446 xhci->shared_hcd->can_do_streams = 1; in xhci_pci_probe()
448 /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */ in xhci_pci_probe()
449 pm_runtime_put_noidle(&dev->dev); in xhci_pci_probe()
451 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) in xhci_pci_probe()
452 pm_runtime_allow(&dev->dev); in xhci_pci_probe()
457 usb_put_hcd(xhci->shared_hcd); in xhci_pci_probe()
461 pm_runtime_put_noidle(&dev->dev); in xhci_pci_probe()
470 if (xhci->quirks & XHCI_RENESAS_FW_QUIRK) in xhci_pci_remove()
473 xhci->xhc_state |= XHCI_STATE_REMOVING; in xhci_pci_remove()
475 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) in xhci_pci_remove()
476 pm_runtime_forbid(&dev->dev); in xhci_pci_remove()
478 if (xhci->shared_hcd) { in xhci_pci_remove()
479 usb_remove_hcd(xhci->shared_hcd); in xhci_pci_remove()
480 usb_put_hcd(xhci->shared_hcd); in xhci_pci_remove()
481 xhci->shared_hcd = NULL; in xhci_pci_remove()
485 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) in xhci_pci_remove()
494 * through a vendor specific SSIC CONFIG register at offset 0x883c,
507 reg = (void __iomem *) xhci->cap_regs + in xhci_ssic_port_unused_quirk()
532 * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
540 reg = (void __iomem *) xhci->cap_regs + 0x80a4; in xhci_pme_quirk()
550 reg = readl(hcd->regs + SPARSE_CNTL_ENABLE); in xhci_sparse_control_quirk()
552 writel(reg, hcd->regs + SPARSE_CNTL_ENABLE); in xhci_sparse_control_quirk()
558 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_suspend()
565 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) in xhci_pci_suspend()
568 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_suspend()
571 if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) in xhci_pci_suspend()
574 if (xhci->quirks & XHCI_DISABLE_SPARSE) in xhci_pci_suspend()
578 if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED)) in xhci_pci_suspend()
587 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_resume()
590 reset_control_reset(xhci->reset); in xhci_pci_resume()
610 if (pdev->vendor == PCI_VENDOR_ID_INTEL) in xhci_pci_resume()
613 if (xhci->quirks & XHCI_SSIC_PORT_UNUSED) in xhci_pci_resume()
616 if (xhci->quirks & XHCI_PME_STUCK_QUIRK) in xhci_pci_resume()
626 struct pci_dev *pdev = to_pci_dev(hcd->self.controller); in xhci_pci_shutdown()
631 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP) in xhci_pci_shutdown()
636 /*-------------------------------------------------------------------------*/
660 * load firmware, so don't encumber the xhci-pci driver with it.