Skip to content

Commit 331f634

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: of: Add inbound resource parsing to helpers
Extend devm_of_pci_get_host_bridge_resources() and pci_parse_request_of_pci_ranges() helpers to also parse the inbound addresses from DT 'dma-ranges' and populate a resource list with the translated addresses. This will help ensure 'dma-ranges' is always parsed in a consistent way. Tested-by: Srinath Mannam <[email protected]> Tested-by: Thomas Petazzoni <[email protected]> # for AArdvark Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Srinath Mannam <[email protected]> Reviewed-by: Andrew Murray <[email protected]> Acked-by: Gustavo Pimentel <[email protected]> Cc: Jingoo Han <[email protected]> Cc: Gustavo Pimentel <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: Will Deacon <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Toan Le <[email protected]> Cc: Ley Foon Tan <[email protected]> Cc: Tom Joseph <[email protected]> Cc: Ray Jui <[email protected]> Cc: Scott Branden <[email protected]> Cc: [email protected] Cc: Ryder Lee <[email protected]> Cc: Karthikeyan Mitran <[email protected]> Cc: Hou Zhiqiang <[email protected]> Cc: Simon Horman <[email protected]> Cc: Shawn Lin <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Michal Simek <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent ecf8fd6 commit 331f634

19 files changed

+93
-28
lines changed

drivers/pci/controller/dwc/pcie-designware-host.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ int dw_pcie_host_init(struct pcie_port *pp)
342342
if (!bridge)
343343
return -ENOMEM;
344344

345-
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
345+
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
346+
&bridge->dma_ranges, NULL);
346347
if (ret)
347348
return ret;
348349

drivers/pci/controller/pci-aardvark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ static int advk_pcie_probe(struct platform_device *pdev)
939939
}
940940

941941
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
942-
&bus);
942+
&bridge->dma_ranges, &bus);
943943
if (ret) {
944944
dev_err(dev, "Failed to parse resources\n");
945945
return ret;

drivers/pci/controller/pci-ftpci100.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ static int faraday_pci_probe(struct platform_device *pdev)
477477
if (IS_ERR(p->base))
478478
return PTR_ERR(p->base);
479479

480-
ret = pci_parse_request_of_pci_ranges(dev, &host->windows, NULL);
480+
ret = pci_parse_request_of_pci_ranges(dev, &host->windows,
481+
&host->dma_ranges, NULL);
481482
if (ret)
482483
return ret;
483484

drivers/pci/controller/pci-host-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static struct pci_config_window *gen_pci_init(struct device *dev,
2727
struct pci_config_window *cfg;
2828

2929
/* Parse our PCI ranges and request their resources */
30-
err = pci_parse_request_of_pci_ranges(dev, resources, &bus_range);
30+
err = pci_parse_request_of_pci_ranges(dev, resources, NULL, &bus_range);
3131
if (err)
3232
return ERR_PTR(err);
3333

drivers/pci/controller/pci-v3-semi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ static int v3_pci_probe(struct platform_device *pdev)
776776
if (IS_ERR(v3->config_base))
777777
return PTR_ERR(v3->config_base);
778778

779-
ret = pci_parse_request_of_pci_ranges(dev, &host->windows, NULL);
779+
ret = pci_parse_request_of_pci_ranges(dev, &host->windows,
780+
&host->dma_ranges, NULL);
780781
if (ret)
781782
return ret;
782783

drivers/pci/controller/pci-versatile.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ static int versatile_pci_probe(struct platform_device *pdev)
9292
if (IS_ERR(versatile_cfg_base[1]))
9393
return PTR_ERR(versatile_cfg_base[1]);
9494

95-
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
95+
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
96+
NULL, NULL);
9697
if (ret)
9798
return ret;
9899

drivers/pci/controller/pci-xgene.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,8 @@ static int xgene_pcie_probe(struct platform_device *pdev)
627627
if (ret)
628628
return ret;
629629

630-
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
630+
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
631+
&bridge->dma_ranges, NULL);
631632
if (ret)
632633
return ret;
633634

drivers/pci/controller/pcie-altera.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ static int altera_pcie_probe(struct platform_device *pdev)
800800
}
801801

802802
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
803-
NULL);
803+
&bridge->dma_ranges, NULL);
804804
if (ret) {
805805
dev_err(dev, "Failed add resources\n");
806806
return ret;

drivers/pci/controller/pcie-cadence-host.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int cdns_pcie_host_init(struct device *dev,
211211
int err;
212212

213213
/* Parse our PCI ranges and request their resources */
214-
err = pci_parse_request_of_pci_ranges(dev, resources, &bus_range);
214+
err = pci_parse_request_of_pci_ranges(dev, resources, NULL, &bus_range);
215215
if (err)
216216
return err;
217217

drivers/pci/controller/pcie-iproc-platform.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev)
9595
if (IS_ERR(pcie->phy))
9696
return PTR_ERR(pcie->phy);
9797

98-
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL);
98+
ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows,
99+
&bridge->dma_ranges, NULL);
99100
if (ret) {
100101
dev_err(dev, "unable to get PCI host bridge resources\n");
101102
return ret;

0 commit comments

Comments
 (0)