linux-mips
[Top] [All Lists]

[PATCH 1/6] MIPS: ath79: store the SoC revision in a global variable

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 1/6] MIPS: ath79: store the SoC revision in a global variable
From: Gabor Juhos <juhosg@openwrt.org>
Date: Thu, 17 Nov 2011 23:13:42 +0100
Cc: Imre Kaloz <kaloz@openwrt.org>, linux-mips@linux-mips.org, Gabor Juhos <juhosg@openwrt.org>
In-reply-to: <1321568027-32066-1-git-send-email-juhosg@openwrt.org>
References: <1321568027-32066-1-git-send-email-juhosg@openwrt.org>
Sender: linux-mips-bounce@linux-mips.org
Knowing the exact revision of the SoC is required
to make runtime decisions in various code paths.
We have determined the SoC revision already, so
we only need to store that in a global variable.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 arch/mips/ath79/common.c                 |    1 +
 arch/mips/ath79/setup.c                  |    2 ++
 arch/mips/include/asm/mach-ath79/ath79.h |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/mips/ath79/common.c b/arch/mips/ath79/common.c
index 38c2ad7..f0fda98 100644
--- a/arch/mips/ath79/common.c
+++ b/arch/mips/ath79/common.c
@@ -30,6 +30,7 @@ u32 ath79_ddr_freq;
 EXPORT_SYMBOL_GPL(ath79_ddr_freq);
 
 enum ath79_soc_type ath79_soc;
+unsigned int ath79_soc_rev;
 
 void __iomem *ath79_pll_base;
 void __iomem *ath79_reset_base;
diff --git a/arch/mips/ath79/setup.c b/arch/mips/ath79/setup.c
index 4187a11..61bf339 100644
--- a/arch/mips/ath79/setup.c
+++ b/arch/mips/ath79/setup.c
@@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type(void)
                panic("ath79: unknown SoC, id:0x%08x\n", id);
        }
 
+       ath79_soc_rev = rev;
+
        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/ath79.h 
b/arch/mips/include/asm/mach-ath79/ath79.h
index 407c935..6d0c6c9 100644
--- a/arch/mips/include/asm/mach-ath79/ath79.h
+++ b/arch/mips/include/asm/mach-ath79/ath79.h
@@ -32,6 +32,7 @@ enum ath79_soc_type {
 };
 
 extern enum ath79_soc_type ath79_soc;
+extern unsigned int ath79_soc_rev;
 
 static inline int soc_is_ar71xx(void)
 {
-- 
1.7.2.1


<Prev in Thread] Current Thread [Next in Thread>