OSDN Git Service

PCI: layerscape: Add class code and multifunction fixups for ls1021a
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Mon, 28 Aug 2017 10:52:55 +0000 (18:52 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 20:29:26 +0000 (15:29 -0500)
The current code depends on class code and multifunction fixups done by the
bootloader.  Perform these fixups in ls1021_pcie_host_init() to remove this
dependency.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Roy Zang <tie-fei.zang@freescale.com>
drivers/pci/dwc/pci-layerscape.c

index c169400..3aa3421 100644 (file)
@@ -134,6 +134,11 @@ static int ls1021_pcie_host_init(struct pcie_port *pp)
 
        dw_pcie_setup_rc(pp);
 
+       iowrite32(1, pci->dbi_base + PCIE_DBI_RO_WR_EN);
+       ls_pcie_fix_class(pcie);
+       ls_pcie_clear_multifunction(pcie);
+       iowrite32(0, pci->dbi_base + PCIE_DBI_RO_WR_EN);
+
        ls_pcie_drop_msg_tlp(pcie);
 
        return 0;