aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch')
-rw-r--r--target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch b/target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch
new file mode 100644
index 0000000000..c31be4a5df
--- /dev/null
+++ b/target/linux/ramips/patches-5.15/300-mt7620-export-chip-version-and-pkg.patch
@@ -0,0 +1,19 @@
+--- 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