PCI: xgene: Add support for a 64-bit prefetchable memory window
authorDuc Dang <dhdang@apm.com>
Thu, 9 Jul 2015 21:20:12 +0000 (14:20 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 21 Jul 2015 16:13:15 +0000 (11:13 -0500)
X-Gene PCIe controller has registers to support multiple memory ranges.

Add support for a 64-bit prefetchable memory window.

[bhelgaas: changelog]
Signed-off-by: Duc Dang <dhdang@apm.com>
Signed-off-by: Tanmay Inamdar <tinamdar@apm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pci-xgene.c

index a9dfb70d623ae0acbb54d96ada58a68ecc3074fe..55fe86548d77a9be11763c8b0689e595b6568499 100644 (file)
@@ -321,8 +321,16 @@ static int xgene_pcie_map_ranges(struct xgene_pcie_port *port,
                                return ret;
                        break;
                case IORESOURCE_MEM:
-                       xgene_pcie_setup_ob_reg(port, res, OMR1BARL, res->start,
-                                               res->start - window->offset);
+                       if (res->flags & IORESOURCE_PREFETCH)
+                               xgene_pcie_setup_ob_reg(port, res, OMR2BARL,
+                                                       res->start,
+                                                       res->start -
+                                                       window->offset);
+                       else
+                               xgene_pcie_setup_ob_reg(port, res, OMR1BARL,
+                                                       res->start,
+                                                       res->start -
+                                                       window->offset);
                        break;
                case IORESOURCE_BUS:
                        break;