blob: 427ba623a234a9ac247feca32bfe7534e444a0e8 [file] [log] [blame]
Angel Ponsd3b4de72020-03-02 01:48:56 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <console/console.h>
15#include <device/device.h>
16#include <device/pci.h>
17#include <device/pci_ids.h>
18
19static void bcm57xx_disable_aspm(struct device *const dev)
20{
21 printk(BIOS_INFO, "bcm57xx: Disabling ASPM for %s [%04x/%04x]\n",
22 dev_path(dev), dev->vendor, dev->device);
23
24 dev->disable_pcie_aspm = 1;
25}
26
27static struct device_operations bcm57xx_aspm_fixup_ops = {
28 .read_resources = pci_dev_read_resources,
29 .set_resources = pci_dev_set_resources,
30 .enable_resources = pci_dev_enable_resources,
31 .enable = bcm57xx_disable_aspm,
32};
33
34static const unsigned short pci_device_ids[] = {
35 0x1677, /* BCM5751 */
36 0,
37};
38
39static const struct pci_driver bcm57xx_aspm_fixup __pci_driver = {
40 .ops = &bcm57xx_aspm_fixup_ops,
41 .vendor = PCI_VENDOR_ID_BROADCOM,
42 .devices = pci_device_ids,
43};