Skip to content

Commit

Permalink
PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
Browse files Browse the repository at this point in the history
PCI BAR 5 is not setup correctly for the on-board AHCI
controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
by using BAR 4's resources which are populated correctly but NOT used
by the AHCI controller actually.

Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
  • Loading branch information
Ashok Kumar Sekar authored and Robert Richter committed Jul 16, 2018
1 parent ca9406b commit 940d574
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions drivers/pci/quirks.c
Expand Up @@ -4013,6 +4013,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
quirk_bridge_cavm_thrx2_pcie_root);

/*
* PCI BAR 5 is not setup correctly for the on-board AHCI controller
* on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
* using BAR 4's resources which are populated correctly and NOT
* actually used by the AHCI controller.
*/
static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
{
struct resource *r = &dev->resource[4];

if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
return;

/* Set BAR5 resource to BAR4 */
dev->resource[5] = *r;

/* Update BAR5 in pci config space */
pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);

/* Clear BAR4's resource */
memset(r, 0, sizeof(*r));
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);

/*
* Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
* class code. Fix it.
Expand Down

0 comments on commit 940d574

Please sign in to comment.