diff options
author | Daniel Golle <daniel@makrotopia.org> | 2017-02-05 15:03:14 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2019-03-06 01:11:54 +0100 |
commit | c8778250a91d691a274d2070dc25827325e3f090 (patch) | |
tree | 0b1a11f8af0a4dcc928ee73961ef1cd4b1ffeeb7 | |
parent | 7fa9794c4ce5988c8ef483d6f402033bf08eabb3 (diff) | |
download | upstream-c8778250a91d691a274d2070dc25827325e3f090.tar.gz upstream-c8778250a91d691a274d2070dc25827325e3f090.tar.bz2 upstream-c8778250a91d691a274d2070dc25827325e3f090.zip |
ramips: mt7620: export chip version and pkg
Similar to the (currently unused) mt7620_get_eco() function, introduce
mt7620_get_chipver() and mt7620_get_pkg() functions to allow rt2x00 to
probe for the type of WiSoC. This is ugly and probably unacceptable
for upstream, however, it should help to evaluate which of those hacks
are actually really needed, enumerate the possible values and label
them in a more meaningful way than currently done in the vendor driver.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r-- | target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch b/target/linux/ramips/patches-4.14/300-mt7620-export-chip-version-and-pkg.patch new file mode 100644 index 0000000000..0cb1fede30 --- /dev/null +++ b/target/linux/ramips/patches-4.14/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 +@@ -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 |