diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-02-15 08:38:23 -0500 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-02-19 03:36:32 -0500 |
commit | 0a5f3b1c9f20eb44142e3b37662de15c944f759d (patch) | |
tree | 4449da00868b3878745c6e18e666ca03e59be2c0 /arch/mips/ath79/pci.c | |
parent | e9c0d0aaa3a7a6e66135e8b44f3323143a635098 (diff) |
MIPS: ath79: add PCI controller registration code for the QCA955X SoCs
Add SoC specific PCI IRQ map, and register platform
devices for the two built-in PCIe RCs.
Cc: Rodriguez, Luis <rodrigue@qca.qualcomm.com>
Cc: Giori, Kathy <kgiori@qca.qualcomm.com>
Cc: QCA Linux Team <qca-linux-team@qca.qualcomm.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/4951/
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/ath79/pci.c')
-rw-r--r-- | arch/mips/ath79/pci.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c index 4350c252bce5..730c0b03060d 100644 --- a/arch/mips/ath79/pci.c +++ b/arch/mips/ath79/pci.c | |||
@@ -49,6 +49,21 @@ static const struct ath79_pci_irq ar724x_pci_irq_map[] __initconst = { | |||
49 | } | 49 | } |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static const struct ath79_pci_irq qca955x_pci_irq_map[] __initconst = { | ||
53 | { | ||
54 | .bus = 0, | ||
55 | .slot = 0, | ||
56 | .pin = 1, | ||
57 | .irq = ATH79_PCI_IRQ(0), | ||
58 | }, | ||
59 | { | ||
60 | .bus = 1, | ||
61 | .slot = 0, | ||
62 | .pin = 1, | ||
63 | .irq = ATH79_PCI_IRQ(1), | ||
64 | }, | ||
65 | }; | ||
66 | |||
52 | int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) | 67 | int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) |
53 | { | 68 | { |
54 | int irq = -1; | 69 | int irq = -1; |
@@ -64,6 +79,9 @@ int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) | |||
64 | soc_is_ar9344()) { | 79 | soc_is_ar9344()) { |
65 | ath79_pci_irq_map = ar724x_pci_irq_map; | 80 | ath79_pci_irq_map = ar724x_pci_irq_map; |
66 | ath79_pci_nr_irqs = ARRAY_SIZE(ar724x_pci_irq_map); | 81 | ath79_pci_nr_irqs = ARRAY_SIZE(ar724x_pci_irq_map); |
82 | } else if (soc_is_qca955x()) { | ||
83 | ath79_pci_irq_map = qca955x_pci_irq_map; | ||
84 | ath79_pci_nr_irqs = ARRAY_SIZE(qca955x_pci_irq_map); | ||
67 | } else { | 85 | } else { |
68 | pr_crit("pci %s: invalid irq map\n", | 86 | pr_crit("pci %s: invalid irq map\n", |
69 | pci_name((struct pci_dev *) dev)); | 87 | pci_name((struct pci_dev *) dev)); |
@@ -225,6 +243,24 @@ int __init ath79_register_pci(void) | |||
225 | AR724X_PCI_MEM_SIZE, | 243 | AR724X_PCI_MEM_SIZE, |
226 | 0, | 244 | 0, |
227 | ATH79_IP2_IRQ(0)); | 245 | ATH79_IP2_IRQ(0)); |
246 | } else if (soc_is_qca9558()) { | ||
247 | pdev = ath79_register_pci_ar724x(0, | ||
248 | QCA955X_PCI_CFG_BASE0, | ||
249 | QCA955X_PCI_CTRL_BASE0, | ||
250 | QCA955X_PCI_CRP_BASE0, | ||
251 | QCA955X_PCI_MEM_BASE0, | ||
252 | QCA955X_PCI_MEM_SIZE, | ||
253 | 0, | ||
254 | ATH79_IP2_IRQ(0)); | ||
255 | |||
256 | pdev = ath79_register_pci_ar724x(1, | ||
257 | QCA955X_PCI_CFG_BASE1, | ||
258 | QCA955X_PCI_CTRL_BASE1, | ||
259 | QCA955X_PCI_CRP_BASE1, | ||
260 | QCA955X_PCI_MEM_BASE1, | ||
261 | QCA955X_PCI_MEM_SIZE, | ||
262 | 1, | ||
263 | ATH79_IP3_IRQ(2)); | ||
228 | } else { | 264 | } else { |
229 | /* No PCI support */ | 265 | /* No PCI support */ |
230 | return -ENODEV; | 266 | return -ENODEV; |