From d3b4de7bea6aafa351a60aa8070af577fe2705eb Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Mon, 2 Mar 2020 01:48:56 +0100 Subject: drivers/broadcom: Add ASPM blacklist The Broadcom BCM5751 NIC on a PCIe card will make the computer hang if ASPM gets enabled. Blacklist it. Change-Id: I2cf8d56e9139928a6acfd1d09e47a96b9554fb06 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/39193 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/drivers/broadcom/Makefile.inc | 14 ++++++++++ src/drivers/broadcom/bcm57xx_aspm_disable.c | 43 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/drivers/broadcom/Makefile.inc create mode 100644 src/drivers/broadcom/bcm57xx_aspm_disable.c diff --git a/src/drivers/broadcom/Makefile.inc b/src/drivers/broadcom/Makefile.inc new file mode 100644 index 0000000000..88433d291f --- /dev/null +++ b/src/drivers/broadcom/Makefile.inc @@ -0,0 +1,14 @@ +## +## This file is part of the coreboot project. +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; version 2 of the License. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## + +ramstage-$(CONFIG_PCIEXP_ASPM) += bcm57xx_aspm_disable.c diff --git a/src/drivers/broadcom/bcm57xx_aspm_disable.c b/src/drivers/broadcom/bcm57xx_aspm_disable.c new file mode 100644 index 0000000000..427ba623a2 --- /dev/null +++ b/src/drivers/broadcom/bcm57xx_aspm_disable.c @@ -0,0 +1,43 @@ +/* + * This file is part of the coreboot project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include + +static void bcm57xx_disable_aspm(struct device *const dev) +{ + printk(BIOS_INFO, "bcm57xx: Disabling ASPM for %s [%04x/%04x]\n", + dev_path(dev), dev->vendor, dev->device); + + dev->disable_pcie_aspm = 1; +} + +static struct device_operations bcm57xx_aspm_fixup_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, + .enable = bcm57xx_disable_aspm, +}; + +static const unsigned short pci_device_ids[] = { + 0x1677, /* BCM5751 */ + 0, +}; + +static const struct pci_driver bcm57xx_aspm_fixup __pci_driver = { + .ops = &bcm57xx_aspm_fixup_ops, + .vendor = PCI_VENDOR_ID_BROADCOM, + .devices = pci_device_ids, +}; -- cgit v1.2.3