Justin Vreeland 794d92
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
Justin Vreeland 794d92
From: Robert Richter <rrichter@redhat.com>
Justin Vreeland 794d92
Date: Thu, 7 Jun 2018 22:59:32 -0400
Justin Vreeland 794d92
Subject: [PATCH] Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
Justin Vreeland 794d92
Justin Vreeland 794d92
Message-id: <1528412373-19128-2-git-send-email-rrichter@redhat.com>
Justin Vreeland 794d92
Patchwork-id: 220950
Justin Vreeland 794d92
O-Subject: [RHEL-8.0 BZ 1563590 v2 1/2] PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early silicon
Justin Vreeland 794d92
Bugzilla: 1563590
Justin Vreeland 794d92
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
Justin Vreeland 794d92
RH-Acked-by: Mark Langsdorf <mlangsdo@redhat.com>
Justin Vreeland 794d92
RH-Acked-by: Mark Salter <msalter@redhat.com>
Justin Vreeland 794d92
Justin Vreeland 794d92
From: Ashok Kumar Sekar <asekar@redhat.com>
Justin Vreeland 794d92
Justin Vreeland 794d92
PCI BAR 5 is not setup correctly for the on-board AHCI
Justin Vreeland 794d92
controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5
Justin Vreeland 794d92
by using BAR 4's resources which are populated correctly but NOT used
Justin Vreeland 794d92
by the AHCI controller actually.
Justin Vreeland 794d92
Justin Vreeland 794d92
RHEL-only:
Justin Vreeland 794d92
Justin Vreeland 794d92
Both patches are in RHEL-7.6 also. Inclusion of the patches into RHEL-8
Justin Vreeland 794d92
was discussed. Since there are partners with Ax system configurations it
Justin Vreeland 794d92
was decided to carry them in RHEL8 too. See:
Justin Vreeland 794d92
Justin Vreeland 794d92
 https://bugzilla.redhat.com/show_bug.cgi?id=1563590#c1
Justin Vreeland 794d92
Justin Vreeland 794d92
Upstream Status: RHEL only
Justin Vreeland 794d92
Signed-off-by: Ashok Kumar Sekar <asekar@redhat.com>
Justin Vreeland 794d92
Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Justin Vreeland 794d92
Signed-off-by: Robert Richter <rrichter@redhat.com>
Justin Vreeland 794d92
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Justin Vreeland 794d92
---
Justin Vreeland 794d92
 drivers/pci/quirks.c | 24 ++++++++++++++++++++++++
Justin Vreeland 794d92
 1 file changed, 24 insertions(+)
Justin Vreeland 794d92
Justin Vreeland 794d92
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
Justin Vreeland 794d92
index bdf9b52567e0..1e98e20b7cc2 100644
Justin Vreeland 794d92
--- a/drivers/pci/quirks.c
Justin Vreeland 794d92
+++ b/drivers/pci/quirks.c
Justin Vreeland 794d92
@@ -4196,6 +4196,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000,
Justin Vreeland 794d92
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084,
Justin Vreeland 794d92
 				quirk_bridge_cavm_thrx2_pcie_root);
Justin Vreeland 794d92
Justin Vreeland 794d92
+/*
Justin Vreeland 794d92
+ * PCI BAR 5 is not setup correctly for the on-board AHCI controller
Justin Vreeland 794d92
+ * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by
Justin Vreeland 794d92
+ * using BAR 4's resources which are populated correctly and NOT
Justin Vreeland 794d92
+ * actually used by the AHCI controller.
Justin Vreeland 794d92
+ */
Justin Vreeland 794d92
+static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev)
Justin Vreeland 794d92
+{
Justin Vreeland 794d92
+	struct resource *r =  &dev->resource[4];
Justin Vreeland 794d92
+
Justin Vreeland 794d92
+	if (!(r->flags & IORESOURCE_MEM) || (r->start == 0))
Justin Vreeland 794d92
+		return;
Justin Vreeland 794d92
+
Justin Vreeland 794d92
+	/* Set BAR5 resource to BAR4 */
Justin Vreeland 794d92
+	dev->resource[5] = *r;
Justin Vreeland 794d92
+
Justin Vreeland 794d92
+	/* Update BAR5 in pci config space */
Justin Vreeland 794d92
+	pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start);
Justin Vreeland 794d92
+
Justin Vreeland 794d92
+	/* Clear BAR4's resource */
Justin Vreeland 794d92
+	memset(r, 0, sizeof(*r));
Justin Vreeland 794d92
+}
Justin Vreeland 794d92
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars);
Justin Vreeland 794d92
+
Justin Vreeland 794d92
 /*
Justin Vreeland 794d92
  * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
Justin Vreeland 794d92
  * class code.  Fix it.
Justin Vreeland 794d92
-- 
Justin Vreeland 794d92
2.28.0
Justin Vreeland 794d92