mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
c8778250a9
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>
20 lines
508 B
Diff
20 lines
508 B
Diff
--- 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
|