All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: John Crispin <blogic@openwrt.org>,
	linux-mips <linux-mips@linux-mips.org>,
	Gabor Juhos <juhosg@openwrt.org>,
	"Rodriguez, Luis" <rodrigue@qca.qualcomm.com>,
	"Giori, Kathy" <kgiori@qca.qualcomm.com>,
	QCA Linux Team <qca-linux-team@qca.qualcomm.com>
Subject: [PATCH 09/11] MIPS: ath79: add PCI controller registration code for the QCA955X SoCs
Date: Fri, 15 Feb 2013 15:38:23 +0100	[thread overview]
Message-ID: <1360939105-23591-10-git-send-email-juhosg@openwrt.org> (raw)
In-Reply-To: <1360939105-23591-1-git-send-email-juhosg@openwrt.org>

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>
---
 arch/mips/ath79/Kconfig                        |    2 ++
 arch/mips/ath79/pci.c                          |   36 ++++++++++++++++++++++++
 arch/mips/include/asm/mach-ath79/ar71xx_regs.h |   13 +++++++++
 3 files changed, 51 insertions(+)

diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
index 77926e3..76a001e 100644
--- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig
@@ -90,6 +90,8 @@ config SOC_AR934X
 
 config SOC_QCA955X
 	select USB_ARCH_HAS_EHCI
+	select HW_HAS_PCI
+	select PCI_AR724X if PCI
 	def_bool n
 
 config PCI_AR724X
diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c
index 4350c25..730c0b0 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 = {
 	}
 };
 
+static const struct ath79_pci_irq qca955x_pci_irq_map[] __initconst = {
+	{
+		.bus	= 0,
+		.slot	= 0,
+		.pin	= 1,
+		.irq	= ATH79_PCI_IRQ(0),
+	},
+	{
+		.bus	= 1,
+		.slot	= 0,
+		.pin	= 1,
+		.irq	= ATH79_PCI_IRQ(1),
+	},
+};
+
 int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
 {
 	int irq = -1;
@@ -64,6 +79,9 @@ int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t slot, uint8_t pin)
 			   soc_is_ar9344()) {
 			ath79_pci_irq_map = ar724x_pci_irq_map;
 			ath79_pci_nr_irqs = ARRAY_SIZE(ar724x_pci_irq_map);
+		} else if (soc_is_qca955x()) {
+			ath79_pci_irq_map = qca955x_pci_irq_map;
+			ath79_pci_nr_irqs = ARRAY_SIZE(qca955x_pci_irq_map);
 		} else {
 			pr_crit("pci %s: invalid irq map\n",
 				pci_name((struct pci_dev *) dev));
@@ -225,6 +243,24 @@ int __init ath79_register_pci(void)
 						 AR724X_PCI_MEM_SIZE,
 						 0,
 						 ATH79_IP2_IRQ(0));
+	} else if (soc_is_qca9558()) {
+		pdev = ath79_register_pci_ar724x(0,
+						 QCA955X_PCI_CFG_BASE0,
+						 QCA955X_PCI_CTRL_BASE0,
+						 QCA955X_PCI_CRP_BASE0,
+						 QCA955X_PCI_MEM_BASE0,
+						 QCA955X_PCI_MEM_SIZE,
+						 0,
+						 ATH79_IP2_IRQ(0));
+
+		pdev = ath79_register_pci_ar724x(1,
+						 QCA955X_PCI_CFG_BASE1,
+						 QCA955X_PCI_CTRL_BASE1,
+						 QCA955X_PCI_CRP_BASE1,
+						 QCA955X_PCI_MEM_BASE1,
+						 QCA955X_PCI_MEM_SIZE,
+						 1,
+						 ATH79_IP3_IRQ(2));
 	} else {
 		/* No PCI support */
 		return -ENODEV;
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index 4728212..b7fa9d1 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -94,6 +94,19 @@
 #define AR934X_SRIF_BASE	(AR71XX_APB_BASE + 0x00116000)
 #define AR934X_SRIF_SIZE	0x1000
 
+#define QCA955X_PCI_MEM_BASE0	0x10000000
+#define QCA955X_PCI_MEM_BASE1	0x12000000
+#define QCA955X_PCI_MEM_SIZE	0x02000000
+#define QCA955X_PCI_CFG_BASE0	0x14000000
+#define QCA955X_PCI_CFG_BASE1	0x16000000
+#define QCA955X_PCI_CFG_SIZE	0x1000
+#define QCA955X_PCI_CRP_BASE0	(AR71XX_APB_BASE + 0x000c0000)
+#define QCA955X_PCI_CRP_BASE1	(AR71XX_APB_BASE + 0x00250000)
+#define QCA955X_PCI_CRP_SIZE	0x1000
+#define QCA955X_PCI_CTRL_BASE0	(AR71XX_APB_BASE + 0x000f0000)
+#define QCA955X_PCI_CTRL_BASE1	(AR71XX_APB_BASE + 0x00280000)
+#define QCA955X_PCI_CTRL_SIZE	0x100
+
 #define QCA955X_WMAC_BASE	(AR71XX_APB_BASE + 0x00100000)
 #define QCA955X_WMAC_SIZE	0x20000
 
-- 
1.7.10

  parent reply	other threads:[~2013-02-15 14:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 14:38 [PATCH 00/11] MIPS: ath79: add support for the QCA955X SoCs Gabor Juhos
2013-02-15 14:38 ` [PATCH 01/11] MIPS: ath79: add early printk " Gabor Juhos
2013-02-15 14:38 ` [PATCH 02/11] MIPS: ath79: add SoC detection code " Gabor Juhos
2013-02-15 16:00   ` John Crispin
2013-02-15 16:42     ` Gabor Juhos
2013-02-15 14:38 ` [PATCH 03/11] MIPS: ath79: add clock setup " Gabor Juhos
2013-02-15 14:38 ` [PATCH 04/11] MIPS: ath79: add IRQ handling " Gabor Juhos
2013-02-15 16:01   ` John Crispin
2013-02-15 17:26     ` Gabor Juhos
2013-02-15 14:38 ` [PATCH 05/11] MIPS: ath79: add GPIO setup " Gabor Juhos
2013-02-15 14:38 ` [PATCH 06/11] MIPS: ath79: add QCA955X specific glue to ath79_device_reset_{set,clear} Gabor Juhos
2013-02-15 14:38 ` [PATCH 07/11] MIPS: ath79: register UART for the QCA955X SoCs Gabor Juhos
2013-02-15 14:38 ` [PATCH 08/11] MIPS: ath79: add WMAC registration code " Gabor Juhos
2013-02-15 16:01   ` John Crispin
2013-02-15 17:13     ` Gabor Juhos
2013-02-15 14:38 ` Gabor Juhos [this message]
2013-02-15 14:38 ` [PATCH 10/11] MIPS: ath79: add USB controller " Gabor Juhos
2013-02-15 14:38 ` [PATCH 11/11] MIPS: ath79: add support for the Qualcomm Atheros AP136-010 board Gabor Juhos
2013-02-15 16:02   ` John Crispin
2013-02-15 17:34     ` Gabor Juhos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360939105-23591-10-git-send-email-juhosg@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=blogic@openwrt.org \
    --cc=kgiori@qca.qualcomm.com \
    --cc=linux-mips@linux-mips.org \
    --cc=qca-linux-team@qca.qualcomm.com \
    --cc=ralf@linux-mips.org \
    --cc=rodrigue@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.