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 02/11] MIPS: ath79: add SoC detection code for the QCA955X SoCs
Date: Fri, 15 Feb 2013 15:38:16 +0100	[thread overview]
Message-ID: <1360939105-23591-3-git-send-email-juhosg@openwrt.org> (raw)
In-Reply-To: <1360939105-23591-1-git-send-email-juhosg@openwrt.org>

Also add 'soc_is_qca955[68x]' helper functions
and a Kconfig symbol for the SoC family.

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                        |    4 ++++
 arch/mips/ath79/setup.c                        |   18 +++++++++++++++++-
 arch/mips/include/asm/mach-ath79/ar71xx_regs.h |    2 ++
 arch/mips/include/asm/mach-ath79/ath79.h       |   17 +++++++++++++++++
 4 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
index f44feee..cffdc8e 100644
--- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig
@@ -88,6 +88,10 @@ config SOC_AR934X
 	select PCI_AR724X if PCI
 	def_bool n
 
+config SOC_QCA955X
+	select USB_ARCH_HAS_EHCI
+	def_bool n
+
 config PCI_AR724X
 	def_bool n
 
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 60d212e..d5b3c90 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -164,13 +164,29 @@ static void __init ath79_detect_sys_type(void)
 		rev = id & AR934X_REV_ID_REVISION_MASK;
 		break;
 
+	case REV_ID_MAJOR_QCA9556:
+		ath79_soc = ATH79_SOC_QCA9556;
+		chip = "9556";
+		rev = id & QCA955X_REV_ID_REVISION_MASK;
+		break;
+
+	case REV_ID_MAJOR_QCA9558:
+		ath79_soc = ATH79_SOC_QCA9558;
+		chip = "9558";
+		rev = id & QCA955X_REV_ID_REVISION_MASK;
+		break;
+
 	default:
 		panic("ath79: unknown SoC, id:0x%08x", id);
 	}
 
 	ath79_soc_rev = rev;
 
-	sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
+	if (soc_is_qca955x())
+		sprintf(ath79_sys_type, "Qualcomm Atheros QCA%s rev %u",
+			chip, rev);
+	else
+		sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
 	pr_info("SoC: %s\n", ath79_sys_type);
 }
 
diff --git a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
index d02c2d4..63a9f2b 100644
--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h
@@ -392,6 +392,8 @@
 
 #define AR934X_REV_ID_REVISION_MASK     0xf
 
+#define QCA955X_REV_ID_REVISION_MASK	0xf
+
 /*
  * SPI block
  */
diff --git a/arch/mips/include/asm/mach-ath79/ath79.h b/arch/mips/include/asm/mach-ath79/ath79.h
index 4f248c3..1557934 100644
--- a/arch/mips/include/asm/mach-ath79/ath79.h
+++ b/arch/mips/include/asm/mach-ath79/ath79.h
@@ -32,6 +32,8 @@ enum ath79_soc_type {
 	ATH79_SOC_AR9341,
 	ATH79_SOC_AR9342,
 	ATH79_SOC_AR9344,
+	ATH79_SOC_QCA9556,
+	ATH79_SOC_QCA9558,
 };
 
 extern enum ath79_soc_type ath79_soc;
@@ -98,6 +100,21 @@ static inline int soc_is_ar934x(void)
 	return soc_is_ar9341() || soc_is_ar9342() || soc_is_ar9344();
 }
 
+static inline int soc_is_qca9556(void)
+{
+	return ath79_soc == ATH79_SOC_QCA9556;
+}
+
+static inline int soc_is_qca9558(void)
+{
+	return ath79_soc == ATH79_SOC_QCA9558;
+}
+
+static inline int soc_is_qca955x(void)
+{
+	return soc_is_qca9556() || soc_is_qca9558();
+}
+
 extern void __iomem *ath79_ddr_base;
 extern void __iomem *ath79_pll_base;
 extern void __iomem *ath79_reset_base;
-- 
1.7.10

  parent reply	other threads:[~2013-02-15 14:38 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 ` Gabor Juhos [this message]
2013-02-15 16:00   ` [PATCH 02/11] MIPS: ath79: add SoC detection code " 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 ` [PATCH 09/11] MIPS: ath79: add PCI controller " Gabor Juhos
2013-02-15 14:38 ` [PATCH 10/11] MIPS: ath79: add USB " 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-3-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.