@@ -348,7 +348,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
struct platform_device *pdev = to_platform_device(pp->dev);
struct of_pci_range range;
struct of_pci_range_parser parser;
- struct resource *cfg_res;
+ struct resource *cfg_res = NULL;
u32 val, na, ns;
const __be32 *addrp;
int i, index, ret;
@@ -359,7 +359,11 @@ int dw_pcie_host_init(struct pcie_port *pp)
of_property_read_u32(np, "#address-cells", &na);
ns = of_n_size_cells(np);
- cfg_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"config");
+ if (!pp->va_cfg0_base && !pp->va_cfg0_base)
+ cfg_res = platform_get_resource_byname(pdev,
+ IORESOURCE_MEM,
+ "config");
+
if (cfg_res) {
pp->cfg0_size = resource_size(cfg_res)/2;