diff options
| -rw-r--r-- | drivers/pci/host/pcie-iproc-platform.c | 7 | ||||
| -rw-r--r-- | drivers/pci/host/pcie-iproc.c | 8 | ||||
| -rw-r--r-- | drivers/pci/host/pcie-iproc.h | 2 | 
3 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c index a5073a921a04..32228d41f746 100644 --- a/drivers/pci/host/pcie-iproc-platform.c +++ b/drivers/pci/host/pcie-iproc-platform.c @@ -92,6 +92,13 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)  		pcie->need_ob_cfg = true;  	} +	/* +	 * DT nodes are not used by all platforms that use the iProc PCIe +	 * core driver. For platforms that require explict inbound mapping +	 * configuration, "dma-ranges" would have been present in DT +	 */ +	pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges"); +  	/* PHY use is optional */  	pcie->phy = devm_phy_get(dev, "pcie-phy");  	if (IS_ERR(pcie->phy)) { diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 935909bbe5c4..75836067f538 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -1378,9 +1378,11 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res)  		}  	} -	ret = iproc_pcie_map_dma_ranges(pcie); -	if (ret && ret != -ENOENT) -		goto err_power_off_phy; +	if (pcie->need_ib_cfg) { +		ret = iproc_pcie_map_dma_ranges(pcie); +		if (ret && ret != -ENOENT) +			goto err_power_off_phy; +	}  #ifdef CONFIG_ARM  	pcie->sysdata.private_data = pcie; diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h index a6b55cec9a66..4ac6282f2bfd 100644 --- a/drivers/pci/host/pcie-iproc.h +++ b/drivers/pci/host/pcie-iproc.h @@ -74,6 +74,7 @@ struct iproc_msi;   * @ob: outbound mapping related parameters   * @ob_map: outbound mapping related parameters specific to the controller   * + * @need_ib_cfg: indicates SW needs to configure the inbound mapping window   * @ib: inbound mapping related parameters   * @ib_map: outbound mapping region related parameters   * @@ -101,6 +102,7 @@ struct iproc_pcie {  	struct iproc_pcie_ob ob;  	const struct iproc_pcie_ob_map *ob_map; +	bool need_ib_cfg;  	struct iproc_pcie_ib ib;  	const struct iproc_pcie_ib_map *ib_map;  | 
