pci-quirks.c (0fdc50dfab47d525b71a9f0d8310746cdc0c09c5) pci-quirks.c (c65822fef4adc0ba40c37a47337376ce75f7a7bc)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This file contains code to reset and initialize USB host controllers.
4 * Some of it includes work-arounds for PCI hardware and BIOS quirks.
5 * It may need to run early during booting -- before USB would normally
6 * initialize -- to ensure that Linux doesn't use any legacy modes.
7 *
8 * Copyright (c) 1999 Martin Mares <mj@ucw.cz>
9 * (and others)
10 */
11
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/delay.h>
16#include <linux/export.h>
17#include <linux/acpi.h>
18#include <linux/dmi.h>
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * This file contains code to reset and initialize USB host controllers.
4 * Some of it includes work-arounds for PCI hardware and BIOS quirks.
5 * It may need to run early during booting -- before USB would normally
6 * initialize -- to ensure that Linux doesn't use any legacy modes.
7 *
8 * Copyright (c) 1999 Martin Mares <mj@ucw.cz>
9 * (and others)
10 */
11
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/delay.h>
16#include <linux/export.h>
17#include <linux/acpi.h>
18#include <linux/dmi.h>
19
20#include <soc/bcm2835/raspberrypi-firmware.h>
21
19#include "pci-quirks.h"
20#include "xhci-ext-caps.h"
21
22
23#define UHCI_USBLEGSUP 0xc0 /* legacy support */
24#define UHCI_USBCMD 0 /* command register */
25#define UHCI_USBINTR 4 /* interrupt register */
26#define UHCI_USBLEGSUP_RWC 0x8f00 /* the R/WC bits */

--- 1211 unchanged lines hidden (view full) ---

1238 }
1239
1240iounmap:
1241 iounmap(base);
1242}
1243
1244static void quirk_usb_early_handoff(struct pci_dev *pdev)
1245{
22#include "pci-quirks.h"
23#include "xhci-ext-caps.h"
24
25
26#define UHCI_USBLEGSUP 0xc0 /* legacy support */
27#define UHCI_USBCMD 0 /* command register */
28#define UHCI_USBINTR 4 /* interrupt register */
29#define UHCI_USBLEGSUP_RWC 0x8f00 /* the R/WC bits */

--- 1211 unchanged lines hidden (view full) ---

1241 }
1242
1243iounmap:
1244 iounmap(base);
1245}
1246
1247static void quirk_usb_early_handoff(struct pci_dev *pdev)
1248{
1249 int ret;
1250
1246 /* Skip Netlogic mips SoC's internal PCI USB controller.
1247 * This device does not need/support EHCI/OHCI handoff
1248 */
1249 if (pdev->vendor == 0x184e) /* vendor Netlogic */
1250 return;
1251 /* Skip Netlogic mips SoC's internal PCI USB controller.
1252 * This device does not need/support EHCI/OHCI handoff
1253 */
1254 if (pdev->vendor == 0x184e) /* vendor Netlogic */
1255 return;
1256
1257 if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
1258 ret = rpi_firmware_init_vl805(pdev);
1259 if (ret) {
1260 /* Firmware might be outdated, or something failed */
1261 dev_warn(&pdev->dev,
1262 "Failed to load VL805's firmware: %d. Will continue to attempt to work, but bad things might happen. You should fix this...\n",
1263 ret);
1264 }
1265 }
1266
1251 if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
1252 pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
1253 pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
1254 pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
1255 return;
1256
1257 if (pci_enable_device(pdev) < 0) {
1258 dev_warn(&pdev->dev,

--- 15 unchanged lines hidden ---
1267 if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
1268 pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
1269 pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
1270 pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
1271 return;
1272
1273 if (pci_enable_device(pdev) < 0) {
1274 dev_warn(&pdev->dev,

--- 15 unchanged lines hidden ---