aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinghuan Lian <Minghuan.Lian@freescale.com>2015-10-16 03:19:20 -0400
committerBjorn Helgaas <bhelgaas@google.com>2015-11-02 16:38:39 -0500
commitbd33b87a9a15f8182e8c6a49f5413e7ef79372bf (patch)
treeaac2e79ae24033c2c68492bce857d87235344b98
parent5192ec7b24dd78bd82fe554995b8889d317da0c1 (diff)
PCI: layerscape: Add ls_pcie_msi_host_init()
Layerscape PCIe has its own MSI implementation. Register ls_pcie_msi_host_init() to avoid using DesignWare's MSI. [bhelgaas: add comment] Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/host/pci-layerscape.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
index 0f6dd4456409..3923bed93c7e 100644
--- a/drivers/pci/host/pci-layerscape.c
+++ b/drivers/pci/host/pci-layerscape.c
@@ -150,14 +150,37 @@ static void ls_pcie_host_init(struct pcie_port *pp)
150 iowrite32(0, pcie->dbi + PCIE_DBI_RO_WR_EN); 150 iowrite32(0, pcie->dbi + PCIE_DBI_RO_WR_EN);
151} 151}
152 152
153static int ls_pcie_msi_host_init(struct pcie_port *pp,
154 struct msi_controller *chip)
155{
156 struct device_node *msi_node;
157 struct device_node *np = pp->dev->of_node;
158
159 /*
160 * The MSI domain is set by the generic of_msi_configure(). This
161 * .msi_host_init() function keeps us from doing the default MSI
162 * domain setup in dw_pcie_host_init() and also enforces the
163 * requirement that "msi-parent" exists.
164 */
165 msi_node = of_parse_phandle(np, "msi-parent", 0);
166 if (!msi_node) {
167 dev_err(pp->dev, "failed to find msi-parent\n");
168 return -EINVAL;
169 }
170
171 return 0;
172}
173
153static struct pcie_host_ops ls1021_pcie_host_ops = { 174static struct pcie_host_ops ls1021_pcie_host_ops = {
154 .link_up = ls1021_pcie_link_up, 175 .link_up = ls1021_pcie_link_up,
155 .host_init = ls1021_pcie_host_init, 176 .host_init = ls1021_pcie_host_init,
177 .msi_host_init = ls_pcie_msi_host_init,
156}; 178};
157 179
158static struct pcie_host_ops ls_pcie_host_ops = { 180static struct pcie_host_ops ls_pcie_host_ops = {
159 .link_up = ls_pcie_link_up, 181 .link_up = ls_pcie_link_up,
160 .host_init = ls_pcie_host_init, 182 .host_init = ls_pcie_host_init,
183 .msi_host_init = ls_pcie_msi_host_init,
161}; 184};
162 185
163static struct ls_pcie_drvdata ls1021_drvdata = { 186static struct ls_pcie_drvdata ls1021_drvdata = {