diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-03-14 05:45:30 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2012-05-15 11:49:11 -0400 |
commit | ec9502599cd837c8e4e279585817d1ffb1249126 (patch) | |
tree | c650946f4508c942cdb03f12a0f9949509199d46 /arch | |
parent | 67644c547fef2739f49c80e5eb1ace82f3e916e2 (diff) |
MIPS: ath79: add PCI registration code for AR934X
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Cc: linux-mips@linux-mips.org
Cc: mcgrof@infradead.org
Patchwork: https://patchwork.linux-mips.org/patch/3516/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/ath79/Kconfig | 2 | ||||
-rw-r--r-- | arch/mips/ath79/pci.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig index 123cc3773b49..ea28e89d0a3c 100644 --- a/arch/mips/ath79/Kconfig +++ b/arch/mips/ath79/Kconfig | |||
@@ -72,6 +72,8 @@ config SOC_AR933X | |||
72 | 72 | ||
73 | config SOC_AR934X | 73 | config SOC_AR934X |
74 | select USB_ARCH_HAS_EHCI | 74 | select USB_ARCH_HAS_EHCI |
75 | select HW_HAS_PCI | ||
76 | select PCI_AR724X if PCI | ||
75 | def_bool n | 77 | def_bool n |
76 | 78 | ||
77 | config PCI_AR724X | 79 | config PCI_AR724X |
diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c index bc40070e45c9..ca83abd9d31e 100644 --- a/arch/mips/ath79/pci.c +++ b/arch/mips/ath79/pci.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
17 | #include <asm/mach-ath79/ar71xx_regs.h> | ||
17 | #include <asm/mach-ath79/ath79.h> | 18 | #include <asm/mach-ath79/ath79.h> |
18 | #include <asm/mach-ath79/irq.h> | 19 | #include <asm/mach-ath79/irq.h> |
19 | #include <asm/mach-ath79/pci.h> | 20 | #include <asm/mach-ath79/pci.h> |
@@ -57,7 +58,9 @@ int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin) | |||
57 | if (soc_is_ar71xx()) { | 58 | if (soc_is_ar71xx()) { |
58 | ath79_pci_irq_map = ar71xx_pci_irq_map; | 59 | ath79_pci_irq_map = ar71xx_pci_irq_map; |
59 | ath79_pci_nr_irqs = ARRAY_SIZE(ar71xx_pci_irq_map); | 60 | ath79_pci_nr_irqs = ARRAY_SIZE(ar71xx_pci_irq_map); |
60 | } else if (soc_is_ar724x()) { | 61 | } else if (soc_is_ar724x() || |
62 | soc_is_ar9342() || | ||
63 | soc_is_ar9344()) { | ||
61 | ath79_pci_irq_map = ar724x_pci_irq_map; | 64 | ath79_pci_irq_map = ar724x_pci_irq_map; |
62 | ath79_pci_nr_irqs = ARRAY_SIZE(ar724x_pci_irq_map); | 65 | ath79_pci_nr_irqs = ARRAY_SIZE(ar724x_pci_irq_map); |
63 | } else { | 66 | } else { |
@@ -115,5 +118,13 @@ int __init ath79_register_pci(void) | |||
115 | if (soc_is_ar724x()) | 118 | if (soc_is_ar724x()) |
116 | return ar724x_pcibios_init(ATH79_CPU_IRQ_IP2); | 119 | return ar724x_pcibios_init(ATH79_CPU_IRQ_IP2); |
117 | 120 | ||
121 | if (soc_is_ar9342() || soc_is_ar9344()) { | ||
122 | u32 bootstrap; | ||
123 | |||
124 | bootstrap = ath79_reset_rr(AR934X_RESET_REG_BOOTSTRAP); | ||
125 | if (bootstrap & AR934X_BOOTSTRAP_PCIE_RC) | ||
126 | return ar724x_pcibios_init(ATH79_IP2_IRQ(0)); | ||
127 | } | ||
128 | |||
118 | return -ENODEV; | 129 | return -ENODEV; |
119 | } | 130 | } |