Commit be5f3623 authored by Gabor Juhos's avatar Gabor Juhos Committed by Ralf Baechle

MIPS: ath79: Store the SoC revision in a global variable

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: default avatarGabor Juhos <juhosg@openwrt.org>
Cc: Imre Kaloz <kaloz@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3027/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 2dc7b4a1
...@@ -30,6 +30,7 @@ u32 ath79_ddr_freq; ...@@ -30,6 +30,7 @@ u32 ath79_ddr_freq;
EXPORT_SYMBOL_GPL(ath79_ddr_freq); EXPORT_SYMBOL_GPL(ath79_ddr_freq);
enum ath79_soc_type ath79_soc; enum ath79_soc_type ath79_soc;
unsigned int ath79_soc_rev;
void __iomem *ath79_pll_base; void __iomem *ath79_pll_base;
void __iomem *ath79_reset_base; void __iomem *ath79_reset_base;
......
...@@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type(void) ...@@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type(void)
panic("ath79: unknown SoC, id:0x%08x\n", id); panic("ath79: unknown SoC, id:0x%08x\n", id);
} }
ath79_soc_rev = rev;
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
pr_info("SoC: %s\n", ath79_sys_type); pr_info("SoC: %s\n", ath79_sys_type);
} }
......
...@@ -32,6 +32,7 @@ enum ath79_soc_type { ...@@ -32,6 +32,7 @@ enum ath79_soc_type {
}; };
extern enum ath79_soc_type ath79_soc; extern enum ath79_soc_type ath79_soc;
extern unsigned int ath79_soc_rev;
static inline int soc_is_ar71xx(void) static inline int soc_is_ar71xx(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment