[linux-yocto] [PATCH 19/48] drivers/pci: Axxia Hardware Work Around

Daniel Dragomir daniel.dragomir at windriver.com
Mon Dec 11 05:13:49 PST 2017


From: John Jacques <john.jacques at intel.com>

The Axxia pci controller has the wrong class code.  This
commit updates the code each time the controller gets
reset.

Signed-off-by: John Jacques <john.jacques at intel.com>
---
 drivers/pci/host/pcie-axxia.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/pci/host/pcie-axxia.c b/drivers/pci/host/pcie-axxia.c
index 6d93ba0..faa9788 100644
--- a/drivers/pci/host/pcie-axxia.c
+++ b/drivers/pci/host/pcie-axxia.c
@@ -893,6 +893,20 @@ axxia_pcie_los_wa(struct pcie_port *pp, unsigned int max_width)
 	return rc;
 }
 
+static void pci_axxia_program_rc_class(struct pcie_port *pp)
+{
+	u32 dbi_ro_wr_en;
+	/* program correct class for RC */
+	axxia_pcie_readl_rc(pp, 0x8bc, &dbi_ro_wr_en);
+	/* DBI_RO_WR_EN */
+	if (!(dbi_ro_wr_en & 0x1))
+		axxia_pcie_writel_rc(pp, (dbi_ro_wr_en | 0x1), 0x8bc);
+	axxia_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
+	/* DBI_RO_WR_EN */
+	if (!(dbi_ro_wr_en & 0x1))
+		axxia_pcie_writel_rc(pp, dbi_ro_wr_en, 0x8bc);
+}
+
 void axxia_pcie_setup_rc(struct pcie_port *pp)
 {
 	u32 val;
@@ -906,6 +920,9 @@ void axxia_pcie_setup_rc(struct pcie_port *pp)
 		return;
 
 	for (;;) {
+		/* program correct class for RC */
+		pci_axxia_program_rc_class(pp);
+
 		/*
 		 * To work around a hardware problem, set
 		 * PCIE_LINK_WIDTH_SPEED_CONTROL to 1 lane in all cases.
@@ -1018,20 +1035,6 @@ static int axxia_pcie_establish_link(struct pcie_port *pp)
 	return 0;
 }
 
-static void pci_axxia_program_rc_class(struct pcie_port *pp)
-{
-	u32 dbi_ro_wr_en;
-	/* program correct class for RC */
-	axxia_pcie_readl_rc(pp, 0x8bc, &dbi_ro_wr_en);
-	/* DBI_RO_WR_EN */
-	if (!(dbi_ro_wr_en & 0x1))
-		axxia_pcie_writel_rc(pp, (dbi_ro_wr_en | 0x1), 0x8bc);
-	axxia_pcie_wr_own_conf(pp, PCI_CLASS_DEVICE, 2, PCI_CLASS_BRIDGE_PCI);
-	/* DBI_RO_WR_EN */
-	if (!(dbi_ro_wr_en & 0x1))
-		axxia_pcie_writel_rc(pp, dbi_ro_wr_en, 0x8bc);
-}
-
 static irqreturn_t axxia_pcie_irq_handler(int irq, void *arg)
 {
 	struct pcie_port *pp = arg;
@@ -1298,9 +1301,6 @@ int axxia_pcie_host_init(struct pcie_port *pp)
 		return -EINVAL;
 	}
 
-	/* program correct class for RC */
-	pci_axxia_program_rc_class(pp);
-
 	if (axxia_pcie_establish_link(pp))
 		dev_warn(pp->dev, "axxia_pcie_establish_link failed\n");
 
-- 
2.7.4



More information about the linux-yocto mailing list