Skip to content

Commit

Permalink
add mt7915-recovery-patch, add mesh1 rssi led, update gluon
Browse files Browse the repository at this point in the history
update patches, remove upstreamed patches
  • Loading branch information
maurerle authored and FFAC committed Feb 1, 2025
1 parent 21f43ef commit 971b604
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 107 deletions.
2 changes: 1 addition & 1 deletion patches/3357-triband.patch
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ index ff4ca17f..98443bed 100755
+
uci:save('wireless')
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
index 2bbe1a8f..a4b5060f 100755
index 2cf2e8da..cc0d9bb8 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
@@ -53,7 +53,7 @@ local function is_outdoor()
Expand Down
4 changes: 2 additions & 2 deletions patches/cellular.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ index 300347e3..94e0737e 100755
setup_ncm_qmi('/dev/ttyACM0', 'ncm', 15)
elseif platform.match('ipq40xx', 'generic', {
diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
index 2241ac9a..9d8b7ac4 100644
index 33ebeefc..34bd7d20 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
@@ -82,6 +82,7 @@ end
@@ -84,6 +84,7 @@ end
function M.is_cellular_device()
if M.match('ath79', 'nand', {
'zte,mf281',
Expand Down
4 changes: 2 additions & 2 deletions patches/gluon-packages.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/patches/packages/gluon/x0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch b/patches/packages/gluon/x0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch
diff --git a/patches/packages/gluon/0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch b/patches/packages/gluon/0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch
new file mode 100644
index 00000000..ac347e07
--- /dev/null
+++ b/patches/packages/gluon/x0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch
+++ b/patches/packages/gluon/0001-delete-etc-opkg-keys-on-autoupdater-upgrade-does-trigger-on-autoupdate-after-checking-that-the-image-is-correct.patch
@@ -0,0 +1,21 @@
+From: Florian Maurer <[email protected]>
+Date: Wed, 14 Jun 2023 09:33:48 +0200
Expand Down
15 changes: 15 additions & 0 deletions patches/mesh1-led-3427.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
index 2bbe1a8f..2cf2e8da 100755
--- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
+++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless
@@ -249,5 +249,10 @@ if uci:get('system', 'rssid_wlan0') then
uci:save('system')
end

+if uci:get('system', 'rssid_wlan1') then
+ uci:set('system', 'rssid_wlan1', 'dev', 'mesh1')
+ uci:save('system')
+end
+
uci:save('wireless')
uci:save('network')
28 changes: 0 additions & 28 deletions patches/mt7622-3430.patch

This file was deleted.

149 changes: 149 additions & 0 deletions patches/mt7915-recovery-3436.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
diff --git a/patches/openwrt/0009-mt76-import-MT7915-recovery-fixes.patch b/patches/openwrt/0009-mt76-import-MT7915-recovery-fixes.patch
new file mode 100644
index 00000000..6eaf2da5
--- /dev/null
+++ b/patches/openwrt/0009-mt76-import-MT7915-recovery-fixes.patch
@@ -0,0 +1,143 @@
+From: David Bauer <[email protected]>
+Date: Mon, 13 Jan 2025 11:52:37 +0100
+Subject: mt76: import MT7915 recovery fixes
+
+diff --git a/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch b/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..f05d6b830f6c323e8e0dce4ebaf1cc9689f43c86
+--- /dev/null
++++ b/package/kernel/mt76/patches/0001-mt7915-mcu-lower-default-timeout.patch
+@@ -0,0 +1,32 @@
++From 0a577333e89f49fd29f07b70d4d865d221451ac0 Mon Sep 17 00:00:00 2001
++From: David Bauer <[email protected]>
++Date: Mon, 13 Jan 2025 08:48:41 +0100
++Subject: [PATCH 1/3] mt7915: mcu: lower default timeout
++
++The default timeout set in mt76_connac2_mcu_fill_message of 20 seconds
++leads to excessive stalling in case messages are lost.
++
++Testing showed that a much smaller timeout of 3 seconds is sufficient
++in normal operation.
++
++Signed-off-by: David Bauer <[email protected]>
++---
++ mt7915/mcu.c | 2 ++
++ 1 file changed, 2 insertions(+)
++
++diff --git a/mt7915/mcu.c b/mt7915/mcu.c
++index 9d790f23..809d8f99 100644
++--- a/mt7915/mcu.c
+++++ b/mt7915/mcu.c
++@@ -197,6 +197,8 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
++ static void
++ mt7915_mcu_set_timeout(struct mt76_dev *mdev, int cmd)
++ {
+++ mdev->mcu.timeout = 3 * HZ;
+++
++ if ((cmd & __MCU_CMD_FIELD_ID) != MCU_CMD_EXT_CID)
++ return;
++
++--
++2.45.2
++
+diff --git a/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch b/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..2aedb9fd791912dd2800074762e316ad27f41d90
+--- /dev/null
++++ b/package/kernel/mt76/patches/0002-mt7915-mcu-increase-command-timeout.patch
+@@ -0,0 +1,34 @@
++From 49894f4ce805ccb73fe0a09c53ffcc8aeaf712b5 Mon Sep 17 00:00:00 2001
++From: David Bauer <[email protected]>
++Date: Mon, 13 Jan 2025 08:51:30 +0100
++Subject: [PATCH 2/3] mt7915: mcu: increase command timeout
++
++Increase the timeout for MCU_EXT_CMD_EFUSE_BUFFER_MODE as
++well as MCU_EXT_CMD_TXBF_ACTION command types.
++
++Regular retries upon hardware-recovery have been observed. Increasing
++the timeout slightly remedies this problem.
++
++Signed-off-by: David Bauer <[email protected]>
++---
++ mt7915/mcu.c | 4 ++++
++ 1 file changed, 4 insertions(+)
++
++diff --git a/mt7915/mcu.c b/mt7915/mcu.c
++index 809d8f99..f3e9f9f0 100644
++--- a/mt7915/mcu.c
+++++ b/mt7915/mcu.c
++@@ -210,6 +210,10 @@ mt7915_mcu_set_timeout(struct mt76_dev *mdev, int cmd)
++ case MCU_EXT_CMD_BSS_INFO_UPDATE:
++ mdev->mcu.timeout = 2 * HZ;
++ return;
+++ case MCU_EXT_CMD_EFUSE_BUFFER_MODE:
+++ case MCU_EXT_CMD_TXBF_ACTION:
+++ mdev->mcu.timeout = 5 * HZ;
+++ return;
++ default:
++ break;
++ }
++--
++2.45.2
++
+diff --git a/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch b/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..c97d4b1d6fd61f3c231dee6971dd019561c313f3
+--- /dev/null
++++ b/package/kernel/mt76/patches/0003-mt7915-mcu-re-init-MCU-before-loading-FW-patch.patch
+@@ -0,0 +1,55 @@
++From 1177b55da6fbc3d095383b3bcfe4ac741985dbff Mon Sep 17 00:00:00 2001
++From: David Bauer <[email protected]>
++Date: Sun, 12 Jan 2025 15:30:54 +0100
++Subject: [PATCH 3/3] mt7915: mcu: re-init MCU before loading FW patch
++
++Restart the MCU and release the patch semaphore before loading the MCU
++patch firmware from the host.
++
++This fixes failures upon error recovery in case the semaphore was
++previously taken and never released by the host.
++
++Signed-off-by: David Bauer <[email protected]>
++---
++ mt7915/mcu.c | 25 +++++++++++++++----------
++ 1 file changed, 15 insertions(+), 10 deletions(-)
++
++diff --git a/mt7915/mcu.c b/mt7915/mcu.c
++index f3e9f9f0..e03292a8 100644
++--- a/mt7915/mcu.c
+++++ b/mt7915/mcu.c
++@@ -2098,16 +2098,21 @@ static int mt7915_load_firmware(struct mt7915_dev *dev)
++ {
++ int ret;
++
++- /* make sure fw is download state */
++- if (mt7915_firmware_state(dev, false)) {
++- /* restart firmware once */
++- mt76_connac_mcu_restart(&dev->mt76);
++- ret = mt7915_firmware_state(dev, false);
++- if (ret) {
++- dev_err(dev->mt76.dev,
++- "Firmware is not ready for download\n");
++- return ret;
++- }
+++ /* Release Semaphore if taken by previous failed attempt */
+++ ret = mt76_connac_mcu_patch_sem_ctrl(&dev->mt76, false);
+++ if (ret != PATCH_REL_SEM_SUCCESS) {
+++ dev_err(dev->mt76.dev, "Could not release semaphore\n");
+++ /* Continue anyways */
+++ }
+++
+++ /* Always restart MCU firmware */
+++ mt76_connac_mcu_restart(&dev->mt76);
+++
+++ /* Check if MCU is ready */
+++ ret = mt7915_firmware_state(dev, false);
+++ if (ret) {
+++ dev_err(dev->mt76.dev, "Firmware did not enter download state\n");
+++ return ret;
++ }
++
++ ret = mt76_connac2_load_patch(&dev->mt76, fw_name_var(dev, ROM_PATCH));
++--
++2.45.2
++
2 changes: 1 addition & 1 deletion patches/targets-ipq40xx-mikrotik.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
index 9d8b7ac4..34bd7d20 100644
index 2241ac9a..33ebeefc 100644
--- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
+++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
@@ -26,6 +26,8 @@ function M.is_outdoor_device()
Expand Down
24 changes: 0 additions & 24 deletions patches/targets-ramips-mt7621.patch

This file was deleted.

48 changes: 0 additions & 48 deletions patches/wax206-fixes.patch

This file was deleted.

2 changes: 1 addition & 1 deletion release.mk
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
GLUON_GIT_URL := https://github.com/freifunk-gluon/gluon.git
GLUON_GIT_REF := ad321f50e6c2568d7702cdd5b3253b09c0535198 # main
GLUON_GIT_REF := cd074cc93d2fdaacbf91c90ca25c6a28f4d1b575 # main

0 comments on commit 971b604

Please sign in to comment.