Skip to content

Commit

Permalink
add various patches
Browse files Browse the repository at this point in the history
fb7430-mac address
add tp-link ax23
add temp mt7915 mcu tryout
wax220-leds
  • Loading branch information
FFAC committed Jan 16, 2025
1 parent 7af94dd commit e3bfaaf
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 0 deletions.
36 changes: 36 additions & 0 deletions patches/fb7430-mac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/patches/openwrt/17618.patch b/patches/openwrt/17618.patch
new file mode 100644
index 00000000..da642017
--- /dev/null
+++ b/patches/openwrt/17618.patch
@@ -0,0 +1,30 @@
+From 1a56f8ffdc668123585544d1b17b99a5faecdd4d Mon Sep 17 00:00:00 2001
+From: Florian Maurer <[email protected]>
+Date: Wed, 15 Jan 2025 21:31:47 +0100
+Subject: [PATCH] lantiq-xrx200: fb7430 set correct label-mac
+
+Signed-off-by: Florian Maurer <[email protected]>
+---
+ target/linux/lantiq/xrx200/base-files/etc/board.d/02_network | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
+index 8c2cdb12af51f7..bf907578970cdb 100644
+--- a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
++++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
+@@ -125,6 +125,7 @@ lantiq_setup_macs()
+ tffsdev=$(find_mtd_chardev "nand-tffs")
+ lan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n maca -o)
+ wan_mac=$(/usr/bin/fritz_tffs_nand -d $tffsdev -n macdsl -o)
++ label_mac=$lan_mac
+ ;;
+ bt,homehub-v5a)
+ lan_mac=$(mtd_get_mac_binary_ubi caldata 0x110c)
+@@ -142,6 +143,7 @@ lantiq_setup_macs()
+
+ [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
+ [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
++ [ -n "$label_mac" ] && ucidef_set_label_macaddr "$label_mac"
+ }
+
+ board_config_update
159 changes: 159 additions & 0 deletions patches/mt7915-mcu-fixer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
From ceb3262db91a4065437ccdf4f7bec2e56d4eb05c Mon Sep 17 00:00:00 2001
From: David Bauer <[email protected]>
Date: Mon, 13 Jan 2025 09:06:06 +0100
Subject: [PATCH] mt76: import MT7915 recovery fixes

---
...10-mt76-import-MT7915-recovery-fixes.patch | 143 ++++++++++++++++++
1 file changed, 143 insertions(+)
create mode 100644 patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch

diff --git a/patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch b/patches/openwrt/0010-mt76-import-MT7915-recovery-fixes.patch
new file mode 100644
index 0000000000..6eaf2da555
--- /dev/null
+++ b/patches/openwrt/0010-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
++
13 changes: 13 additions & 0 deletions patches/targets-ramips-mt7621.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/targets/ramips-mt7621 b/targets/ramips-mt7621
index 10c9d19f..fc9faf36 100644
--- a/targets/ramips-mt7621
+++ b/targets/ramips-mt7621
@@ -105,6 +105,8 @@ device('tp-link-re500-v1', 'tplink_re500-v1')

device('tp-link-re650-v1', 'tplink_re650-v1')

+device('tp-link-archer-ax23-v1', 'tplink_archer-ax23-v1')
+

-- Ubiquiti

53 changes: 53 additions & 0 deletions patches/wax220-leds.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/patches/openwrt/17627.patch b/patches/openwrt/17627.patch
new file mode 100644
index 00000000..107fccbf
--- /dev/null
+++ b/patches/openwrt/17627.patch
@@ -0,0 +1,47 @@
+From 6b48afba4fc39d053e02d8b944846ee16a8f985e Mon Sep 17 00:00:00 2001
+From: Florian Maurer <[email protected]>
+Date: Thu, 16 Jan 2025 09:29:55 +0100
+Subject: [PATCH] mediatek-filogic: fix wax220 wifi leds
+
+The WAX220 does have a 2.4GHz and 5GHz wifi led, which was set to trigger on netdev before.
+This commit changes this to trigger on activity of the respective radio
+
+Signed-off-by: Florian Maurer <[email protected]>
+---
+ target/linux/mediatek/dts/mt7986b-netgear-wax220.dts | 2 ++
+ target/linux/mediatek/filogic/base-files/etc/board.d/01_leds | 2 --
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts b/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts
+index 6e51d884702358..9537afba898aed 100644
+--- a/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts
++++ b/target/linux/mediatek/dts/mt7986b-netgear-wax220.dts
+@@ -67,6 +67,7 @@
+ wlan2g_blue {
+ gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+ label = "blue:wlan2g";
++ linux,default-trigger = "phy0tpt";
+ };
+
+ lan_green {
+@@ -84,6 +85,7 @@
+ wlan5g_blue {
+ gpios = <&pio 2 GPIO_ACTIVE_LOW>;
+ label = "blue:wlan5g";
++ linux,default-trigger = "phy1tpt";
+ };
+ };
+ };
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+index a6bb9b0ca8ac30..fded01a73ea783 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+@@ -66,8 +66,6 @@ mercusys,mr90x-v1-ubi)
+ ;;
+ netgear,wax220)
+ ucidef_set_led_netdev "eth0" "LAN" "green:lan" "eth0"
+- ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0"
+- ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
+ ;;
+ nokia,ea0326gmp)
+ ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" "link"

0 comments on commit e3bfaaf

Please sign in to comment.