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