openwrt/target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch
Felix Fietkau a3764ee29d ramips: add linux 5.15 support for mt7621
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-27 21:36:40 +02:00

20 lines
506 B
Diff

--- a/arch/mips/include/asm/mach-ralink/mt7620.h
+++ b/arch/mips/include/asm/mach-ralink/mt7620.h
@@ -96,4 +96,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