aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-10-03 14:13:07 -0400
committerBjorn Helgaas <bhelgaas@google.com>2015-10-09 12:20:24 -0400
commit3884d846a4ed402992ac84e6b79962848ba5f521 (patch)
tree7c31db01d602a6792e30c6ea4f2120e891646e11
parent37bfa771cda1734454e4304050cfddbcda5f16ed (diff)
PCI: mvebu: Split port parsing and resource claiming from port setup
Split the PCIe port DT parsing and resource claiming from setting up the actual ports. This allows us to gather all the resources first, before touching the hardware. This is important as some of these resources (such as the GPIO for the PCIe reset) may defer probing. Tested-by: Willy Tarreau <w@1wt.eu> (Iomega iConnect Kirkwood, MiraBox Armada 370) Tested-by: Andrew Lunn <andrew@lunn.ch> (D-Link DIR664 Kirkwood) Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP) Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--drivers/pci/host/pci-mvebu.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index e8c51bb58e99..92c777e1aa3c 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -1093,6 +1093,18 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
1093 continue; 1093 continue;
1094 } 1094 }
1095 1095
1096 port->dn = child;
1097 i++;
1098 }
1099 pcie->nports = i;
1100
1101 for (i = 0; i < pcie->nports; i++) {
1102 struct mvebu_pcie_port *port = &pcie->ports[i];
1103
1104 child = port->dn;
1105 if (!child)
1106 continue;
1107
1096 if (gpio_is_valid(port->reset_gpio)) { 1108 if (gpio_is_valid(port->reset_gpio)) {
1097 u32 reset_udelay = 20000; 1109 u32 reset_udelay = 20000;
1098 1110
@@ -1118,10 +1130,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
1118 } 1130 }
1119 1131
1120 mvebu_pcie_set_local_dev_nr(port, 1); 1132 mvebu_pcie_set_local_dev_nr(port, 1);
1121
1122 port->dn = child;
1123 mvebu_sw_pci_bridge_init(port); 1133 mvebu_sw_pci_bridge_init(port);
1124 i++;
1125 } 1134 }
1126 1135
1127 pcie->nports = i; 1136 pcie->nports = i;