aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/dwc/pci-keystone-dw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/dwc/pci-keystone-dw.c')
-rw-r--r--drivers/pci/dwc/pci-keystone-dw.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/pci/dwc/pci-keystone-dw.c b/drivers/pci/dwc/pci-keystone-dw.c
index 8bc626e640c8..2fb20b887d2a 100644
--- a/drivers/pci/dwc/pci-keystone-dw.c
+++ b/drivers/pci/dwc/pci-keystone-dw.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Designware application register space functions for Keystone PCI controller 2 * DesignWare application register space functions for Keystone PCI controller
3 * 3 *
4 * Copyright (C) 2013-2014 Texas Instruments., Ltd. 4 * Copyright (C) 2013-2014 Texas Instruments., Ltd.
5 * http://www.ti.com 5 * http://www.ti.com
@@ -168,16 +168,12 @@ void ks_dw_pcie_msi_clear_irq(struct pcie_port *pp, int irq)
168 168
169static void ks_dw_pcie_msi_irq_mask(struct irq_data *d) 169static void ks_dw_pcie_msi_irq_mask(struct irq_data *d)
170{ 170{
171 struct keystone_pcie *ks_pcie;
172 struct msi_desc *msi; 171 struct msi_desc *msi;
173 struct pcie_port *pp; 172 struct pcie_port *pp;
174 struct dw_pcie *pci;
175 u32 offset; 173 u32 offset;
176 174
177 msi = irq_data_get_msi_desc(d); 175 msi = irq_data_get_msi_desc(d);
178 pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi); 176 pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi);
179 pci = to_dw_pcie_from_pp(pp);
180 ks_pcie = to_keystone_pcie(pci);
181 offset = d->irq - irq_linear_revmap(pp->irq_domain, 0); 177 offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
182 178
183 /* Mask the end point if PVM implemented */ 179 /* Mask the end point if PVM implemented */
@@ -191,16 +187,12 @@ static void ks_dw_pcie_msi_irq_mask(struct irq_data *d)
191 187
192static void ks_dw_pcie_msi_irq_unmask(struct irq_data *d) 188static void ks_dw_pcie_msi_irq_unmask(struct irq_data *d)
193{ 189{
194 struct keystone_pcie *ks_pcie;
195 struct msi_desc *msi; 190 struct msi_desc *msi;
196 struct pcie_port *pp; 191 struct pcie_port *pp;
197 struct dw_pcie *pci;
198 u32 offset; 192 u32 offset;
199 193
200 msi = irq_data_get_msi_desc(d); 194 msi = irq_data_get_msi_desc(d);
201 pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi); 195 pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi);
202 pci = to_dw_pcie_from_pp(pp);
203 ks_pcie = to_keystone_pcie(pci);
204 offset = d->irq - irq_linear_revmap(pp->irq_domain, 0); 196 offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
205 197
206 /* Mask the end point if PVM implemented */ 198 /* Mask the end point if PVM implemented */
@@ -259,7 +251,7 @@ void ks_dw_pcie_enable_legacy_irqs(struct keystone_pcie *ks_pcie)
259{ 251{
260 int i; 252 int i;
261 253
262 for (i = 0; i < MAX_LEGACY_IRQS; i++) 254 for (i = 0; i < PCI_NUM_INTX; i++)
263 ks_dw_app_writel(ks_pcie, IRQ_ENABLE_SET + (i << 4), 0x1); 255 ks_dw_app_writel(ks_pcie, IRQ_ENABLE_SET + (i << 4), 0x1);
264} 256}
265 257
@@ -565,7 +557,7 @@ int __init ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie,
565 /* Create legacy IRQ domain */ 557 /* Create legacy IRQ domain */
566 ks_pcie->legacy_irq_domain = 558 ks_pcie->legacy_irq_domain =
567 irq_domain_add_linear(ks_pcie->legacy_intc_np, 559 irq_domain_add_linear(ks_pcie->legacy_intc_np,
568 MAX_LEGACY_IRQS, 560 PCI_NUM_INTX,
569 &ks_dw_pcie_legacy_irq_domain_ops, 561 &ks_dw_pcie_legacy_irq_domain_ops,
570 NULL); 562 NULL);
571 if (!ks_pcie->legacy_irq_domain) { 563 if (!ks_pcie->legacy_irq_domain) {