Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Gabor 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: Ralf Baechle <ralf@linux-mips.org>

authored by

Gabor Juhos and committed by
Ralf Baechle
be5f3623 2dc7b4a1

+4
+1
arch/mips/ath79/common.c
··· 30 30 EXPORT_SYMBOL_GPL(ath79_ddr_freq); 31 31 32 32 enum ath79_soc_type ath79_soc; 33 + unsigned int ath79_soc_rev; 33 34 34 35 void __iomem *ath79_pll_base; 35 36 void __iomem *ath79_reset_base;
+2
arch/mips/ath79/setup.c
··· 149 149 panic("ath79: unknown SoC, id:0x%08x\n", id); 150 150 } 151 151 152 + ath79_soc_rev = rev; 153 + 152 154 sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev); 153 155 pr_info("SoC: %s\n", ath79_sys_type); 154 156 }
+1
arch/mips/include/asm/mach-ath79/ath79.h
··· 32 32 }; 33 33 34 34 extern enum ath79_soc_type ath79_soc; 35 + extern unsigned int ath79_soc_rev; 35 36 36 37 static inline int soc_is_ar71xx(void) 37 38 {