aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch
blob: 0cb1fede306ec1b844269df8fedf6ed014431468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- a/arch/mips/include/asm/mach-ralink/mt7620.h
+++ b/arch/mips/include/asm/mach-ralink/mt7620.h
@@ -137,4 +137,16 @@ static inline int mt7620_get_eco(void)
 	return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
 }
 
+static inline int mt7620_get_chipver(void)
+{
+	return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_VER_SHIFT) &
+		CHIP_REV_VER_MASK;
+}
+
+static inline int mt7620_get_pkg(void)
+{
+	return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_PKG_SHIFT) &
+		CHIP_REV_PKG_MASK;
+}
+
 #endif