Skip to content

Commit be5f362

Browse files
juhosgralfbaechle
authored andcommitted
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>
1 parent 2dc7b4a commit be5f362

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎arch/mips/ath79/common.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ u32 ath79_ddr_freq;
3030
EXPORT_SYMBOL_GPL(ath79_ddr_freq);
3131

3232
enum ath79_soc_type ath79_soc;
33+
unsigned int ath79_soc_rev;
3334

3435
void __iomem *ath79_pll_base;
3536
void __iomem *ath79_reset_base;

‎arch/mips/ath79/setup.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ static void __init ath79_detect_sys_type(void)
149149
panic("ath79: unknown SoC, id:0x%08x\n", id);
150150
}
151151

152+
ath79_soc_rev = rev;
153+
152154
sprintf(ath79_sys_type, "Atheros AR%s rev %u", chip, rev);
153155
pr_info("SoC: %s\n", ath79_sys_type);
154156
}

‎arch/mips/include/asm/mach-ath79/ath79.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum ath79_soc_type {
3232
};
3333

3434
extern enum ath79_soc_type ath79_soc;
35+
extern unsigned int ath79_soc_rev;
3536

3637
static inline int soc_is_ar71xx(void)
3738
{

0 commit comments

Comments
 (0)