Angel Pons | 8a3453f | 2020-04-02 23:48:19 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Angel Pons | d3b4de7 | 2020-03-02 01:48:56 +0100 | [diff] [blame] | 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <device/device.h> |
| 5 | #include <device/pci.h> |
| 6 | #include <device/pci_ids.h> |
| 7 | |
| 8 | static void bcm57xx_disable_aspm(struct device *const dev) |
| 9 | { |
| 10 | printk(BIOS_INFO, "bcm57xx: Disabling ASPM for %s [%04x/%04x]\n", |
| 11 | dev_path(dev), dev->vendor, dev->device); |
| 12 | |
| 13 | dev->disable_pcie_aspm = 1; |
| 14 | } |
| 15 | |
| 16 | static struct device_operations bcm57xx_aspm_fixup_ops = { |
| 17 | .read_resources = pci_dev_read_resources, |
| 18 | .set_resources = pci_dev_set_resources, |
| 19 | .enable_resources = pci_dev_enable_resources, |
| 20 | .enable = bcm57xx_disable_aspm, |
| 21 | }; |
| 22 | |
| 23 | static const unsigned short pci_device_ids[] = { |
| 24 | 0x1677, /* BCM5751 */ |
| 25 | 0, |
| 26 | }; |
| 27 | |
| 28 | static const struct pci_driver bcm57xx_aspm_fixup __pci_driver = { |
| 29 | .ops = &bcm57xx_aspm_fixup_ops, |
| 30 | .vendor = PCI_VENDOR_ID_BROADCOM, |
| 31 | .devices = pci_device_ids, |
| 32 | }; |