PCI: dwc: designware: Provide page_size to pci_epc_mem
authorKishon Vijay Abraham I <kishon@ti.com>
Fri, 18 Aug 2017 14:58:02 +0000 (20:28 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Aug 2017 21:00:38 +0000 (16:00 -0500)
Use the newly introduced __pci_epc_mem_init() instead of pci_epc_mem_init()
to provide page_size to pci_epc_mem. This is in preparation for
adding EP support to K2G which has a restriction that the
address region should be either divided into 1MB/2MB/4MB or 8MB
sizes (Ref: 11.14.4.9.1 Outbound Address Translation in K2G TRM SPRUHY8F
January 2016 – Revised May 2017).

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/dwc/pcie-designware-ep.c
drivers/pci/dwc/pcie-designware.h

index 398406393f37076398e0ed33a407fc5944e16ccd..e70ebe3b9b6f38b1e0a3f6a7f1c04bcd02832936 100644 (file)
@@ -328,7 +328,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
        if (ret < 0)
                epc->max_functions = 1;
 
-       ret = pci_epc_mem_init(epc, ep->phys_base, ep->addr_size);
+       ret = __pci_epc_mem_init(epc, ep->phys_base, ep->addr_size,
+                                ep->page_size);
        if (ret < 0) {
                dev_err(dev, "Failed to initialize address space\n");
                return ret;
index b4d2a89f8e58591c6a08ea4e5204d56ddfc00466..714f6f21ea9399c079c86cf24405c6dc3877e0a8 100644 (file)
@@ -186,6 +186,7 @@ struct dw_pcie_ep {
        struct dw_pcie_ep_ops   *ops;
        phys_addr_t             phys_base;
        size_t                  addr_size;
+       size_t                  page_size;
        u8                      bar_to_atu[6];
        phys_addr_t             *outbound_addr;
        unsigned long           ib_window_map;