Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
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 th3fanbus@gmail.com --- A src/drivers/broadcom/Makefile.inc A src/drivers/broadcom/bcm57xx_aspm_disable.c 2 files changed, 57 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/39193/1
diff --git a/src/drivers/broadcom/Makefile.inc b/src/drivers/broadcom/Makefile.inc new file mode 100644 index 0000000..863ee56 --- /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-y += 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 0000000..427ba62 --- /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 <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> + +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, +};
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39193/1/src/drivers/broadcom/Makefi... File src/drivers/broadcom/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/39193/1/src/drivers/broadcom/Makefi... PS1, Line 14: ramstage-y += bcm57xx_aspm_disable.c ramstage-$(CONFIG_PCIEXP_ASPM) maybe?
Hello build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39193
to look at the new patch set (#2).
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
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 th3fanbus@gmail.com --- A src/drivers/broadcom/Makefile.inc A src/drivers/broadcom/bcm57xx_aspm_disable.c 2 files changed, 57 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/39193/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/39193/1/src/drivers/broadcom/Makefi... File src/drivers/broadcom/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/39193/1/src/drivers/broadcom/Makefi... PS1, Line 14: ramstage-y += bcm57xx_aspm_disable.c
ramstage-$(CONFIG_PCIEXP_ASPM) maybe?
Maybe. Let's ask Jenkins.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
Patch Set 2: Code-Review+2
Linux kernel does the same (but because it's pre-1.1 PCIe). From https://ubuntuforums.org/showthread.php?t=2185886&page=2:
[ 0.156027] pci 0000:02:00.0: [14e4:1677] type 00 class 0x020000 [ 0.156062] pci 0000:02:00.0: reg 10: [mem 0xdfdf0000-0xdfdfffff 64bit] [ 0.156238] pci 0000:02:00.0: PME# supported from D3hot D3cold [ 0.156267] pci 0000:02:00.0: disabling ASPM on pre-1.1 PCIe device. You can enable it with 'pcie_aspm=force'
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
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 th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/39193 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- A src/drivers/broadcom/Makefile.inc A src/drivers/broadcom/bcm57xx_aspm_disable.c 2 files changed, 57 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/src/drivers/broadcom/Makefile.inc b/src/drivers/broadcom/Makefile.inc new file mode 100644 index 0000000..88433d2 --- /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 0000000..427ba62 --- /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 <console/console.h> +#include <device/device.h> +#include <device/pci.h> +#include <device/pci_ids.h> + +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, +};
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/1158 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1157 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1156
Please note: This test is under development and might not be accurate at all!
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39193 )
Change subject: drivers/broadcom: Add ASPM blacklist ......................................................................
Patch Set 3:
Patch Set 2: Code-Review+2
Linux kernel does the same (but because it's pre-1.1 PCIe). From https://ubuntuforums.org/showthread.php?t=2185886&page=2:
[ 0.156027] pci 0000:02:00.0: [14e4:1677] type 00 class 0x020000 [ 0.156062] pci 0000:02:00.0: reg 10: [mem 0xdfdf0000-0xdfdfffff 64bit] [ 0.156238] pci 0000:02:00.0: PME# supported from D3hot D3cold [ 0.156267] pci 0000:02:00.0: disabling ASPM on pre-1.1 PCIe device. You can enable it with 'pcie_aspm=force'
Interesting, thanks for finding this!