Compare commits

...

2 Commits

Author SHA1 Message Date
cpchangemplu
eb7f7650e5 mediatek: Add thermal protection for EMPLUS WAP588M model
Signed-off-by: cpchangemplu <cp.chang@emplustech.com>
2025-06-06 10:07:16 +08:00
cpchangemplu
5973dabaad mediatek: Fix image upgrade fail for EMPLUS WAP588M
Signed-off-by: cpchangemplu <cp.chang@emplustech.com>
2025-06-05 09:58:44 +08:00
3 changed files with 51 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
REQUIRE_IMAGE_METADATA=1
senao_swap_active_fw() {
swap_wap588m_active_fw() {
echo "Doing swap active_fw" > /dev/console
tmp_active_fw=$(fw_printenv | grep active_fw | awk -F= {'print $2'})
if [ $tmp_active_fw == "0" ]; then
@@ -12,6 +12,18 @@ senao_swap_active_fw() {
fi
}
senao_swap_active_fw() {
echo "Doing swap active_fw" > /dev/console
tmp_active_fw=$(fw_printenv -n active_fw)
if [ $tmp_active_fw == "0" ]; then
fw_setenv active_fw 1
fw_setenv mtdparts nmbm0:1024k\(bl2\),512k\(u-boot-env\),2048k\(factory\),2048k\(fip\),112640k\(ubi_1\),112640k\(ubi\),384k\(cert\),640k\(userconfig\),384k\(crashdump\)
else
fw_setenv active_fw 0
fw_setenv mtdparts nmbm0:1024k\(bl2\),512k\(u-boot-env\),2048k\(factory\),2048k\(fip\),112640k\(ubi\),112640k\(ubi_1\),384k\(cert\),640k\(userconfig\),384k\(crashdump\)
fi
}
platform_do_upgrade() {
local board=$(board_name)
@@ -94,5 +106,8 @@ platform_post_upgrade_success() {
senao,jeap6500)
senao_swap_active_fw
;;
emplus,wap588m)
swap_wap588m_active_fw
;;
esac
}

View File

@@ -483,6 +483,14 @@ ifdef CONFIG_PACKAGE_kmod-mt7925e
PKG_MAKE_FLAGS += CONFIG_MT7925E=m
endif
define Build/Prepare
ifeq ($(CONFIG_TARGET_PROFILE), "DEVICE_emplus_wap588m")
$(CP) src/EMPLUS/3000-wifi-mt76-mt7915-emplus-wap588m-thermal-protech.patch patches/
endif
$(Build/Prepare/Default)
endef
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) \
@@ -493,6 +501,7 @@ define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/tools
endef
define Build/Install
:
endef

View File

@@ -0,0 +1,26 @@
Index: mt76-2024-04-03-1e336a85/mt7915/mt7915.h
===================================================================
--- mt76-2024-04-03-1e336a85.orig/mt7915/mt7915.h
+++ mt76-2024-04-03-1e336a85/mt7915/mt7915.h
@@ -71,8 +71,8 @@
#define MT7915_CFEND_RATE_DEFAULT 0x49 /* OFDM 24M */
#define MT7915_CFEND_RATE_11B 0x03 /* 11B LP, 11M */
-#define MT7915_THERMAL_THROTTLE_MAX 100
-#define MT7915_CDEV_THROTTLE_MAX 99
+#define MT7915_THERMAL_THROTTLE_MAX 80
+#define MT7915_CDEV_THROTTLE_MAX 79
#define MT7915_SKU_RATE_NUM 161
#define MT7915_SKU_PATH_NUM 185
@@ -86,8 +86,8 @@
#define MT7915_CRIT_TEMP_IDX 0
#define MT7915_MAX_TEMP_IDX 1
-#define MT7915_CRIT_TEMP 110
-#define MT7915_MAX_TEMP 120
+#define MT7915_CRIT_TEMP 103
+#define MT7915_MAX_TEMP 118
struct mt7915_vif;
struct mt7915_sta;