Skip to content

[25.12] airoha: add support for Gemtek W1700K - #22374

Closed
andrewjlamarche wants to merge 9 commits into
openwrt:openwrt-25.12from
andrewjlamarche:w1700k
Closed

andrewjlamarche wants to merge 9 commits into
openwrt:openwrt-25.12from
andrewjlamarche:w1700k

Conversation

@andrewjlamarche

@andrewjlamarche andrewjlamarche commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

@andrewjlamarche andrewjlamarche changed the title [25.12 [25.12] airoha: add support for Gemtek W1700K Mar 11, 2026
@andrewjlamarche
andrewjlamarche marked this pull request as draft March 11, 2026 04:05
@github-actions github-actions Bot added core packages pull request/issue for core (in-tree) packages target/airoha pull request/issue for airoha target release/25.12 pull request/issue targeted (also) for OpenWrt 24.10 release labels Mar 11, 2026
@andrewjlamarche
andrewjlamarche force-pushed the w1700k branch 2 times, most recently from 074e2cc to c311e98 Compare March 14, 2026 21:36
@namiltd

namiltd commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

All the fixes you need in one place: https://github.com/namiltd/openwrt/commits/openwrt-25.12-w1700k/.
Please test it.

@maurerle

Copy link
Copy Markdown
Contributor

building locally, I did get: Missing Build/an7581-chainloader.
So this PR also needs backporting: #22151

@namiltd

namiltd commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

@maurerle

maurerle commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

To build uboot, this PR is also needed: #21984

else you get:

Error: dts/upstream/src/arm64/airoha/.an7581-w1700k-ubi.dtb.pre.tmp:125.1-5 Label or path eth not found
Error: dts/upstream/src/arm64/airoha/.an7581-w1700k-ubi.dtb.pre.tmp:129.1-6 Label or path gdm1 not found

I would recommend to apply these in the order the occurred:

  1. linux-firmware: update to 20260110 #21497 (1)
  2. linux-firmware: update to 20260221 #22139 (1)
  3. uboot-airoha: update to U-Boot v2026.01 #21984 (2)
  4. 57bf713 (1)
  5. airoha: an7581: add uboot chainloader #22151 (5)
  6. airoha: add support for AN7581+MT7996 NPU firmware #22289 (2)
  7. airoha: add support for Gemtek W1700K #17869 (4)
  8. airoha: an7581: fix w1700k fan script #22391 (1)
  9. airoha: rename kmod-pwm-an7581 to kmod-pwm-airoha #22445 (1)

So 13 18 commits in total

@namiltd

namiltd commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

I counted 18 commits + refresh (namiltd#117).

@maurerle

Copy link
Copy Markdown
Contributor

Yes, I missed the NPU related ones. Looks good.

@maurerle

maurerle commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor

I tested this and looks good so far - tested with the patch series from namiltd.

I am not able to get 802.11s mesh working though:

Tue Mar 17 15:44:50 2026 daemon.notice netifd: radio0 (13263): wifi-scripts: Tearing down phy0
Tue Mar 17 15:44:50 2026 daemon.notice netifd: Network device 'mesh0' link is down
Tue Mar 17 15:44:50 2026 daemon.notice netifd: Interface 'mesh_radio0' has link connectivity loss
Tue Mar 17 15:44:50 2026 daemon.notice netifd: Interface 'mesh_radio0' is disabled
Tue Mar 17 15:44:50 2026 daemon.notice netifd: Interface 'mesh_radio0' is now down
Tue Mar 17 15:44:50 2026 daemon.notice netifd: radio1 (13356): wifi-scripts: Tearing down phy0
Tue Mar 17 15:44:50 2026 daemon.notice netifd: radio2 (13392): wifi-scripts: Tearing down phy0
Tue Mar 17 15:44:50 2026 daemon.notice netifd: radio0 (13423): wifi-scripts: Starting
Tue Mar 17 15:44:50 2026 daemon.notice netifd: radio0 (13423): /bin/sh: wpa_supplicant: not found
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is enabled
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is disabled
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is enabled
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Network device 'mesh0' link is up
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' has link connectivity
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is setting up now
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio0 (13423): wifi-scripts: Configuring 'phy0' txantenna: 4294967295, rxantenna: 4294967295 distance: 0
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio0 (13423): wifi-scripts: Preparing interface: mesh0 with MAC: 1a:70:da:82:5c:a9
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is now down
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is setting up now
Tue Mar 17 15:44:51 2026 daemon.notice netifd: Interface 'mesh_radio0' is now up
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio1 (13467): wifi-scripts: Starting
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio1 (13467): command failed: Not supported (-95)
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio1 (13467): wifi-scripts: Configuring 'phy0' txantenna: 4294967295, rxantenna: 4294967295 distance: 0
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio2 (13555): wifi-scripts: Starting
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio2 (13555): command failed: Not supported (-95)
Tue Mar 17 15:44:51 2026 daemon.notice netifd: radio2 (13555): wifi-scripts: Configuring 'phy0' txantenna: 4294967295, rxantenna: 4294967295 distance: 0

I do not have wpa_supplicant installed, but also should not require it..? This is tested on a firmware based on gluon.

With wpad-mesh-mbedtls it works fine - thanks.

@andrewjlamarche

Copy link
Copy Markdown
Contributor Author

You need a wpad-mesh-* variant.

@namiltd

namiltd commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

@andrewjlamarche Update PR with all necessary patches (you may cherry-pick them from namiltd#117)

@namiltd

namiltd commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Add in each commit: (cherry picked from commit XXXXXXX)

@andrewjlamarche

Copy link
Copy Markdown
Contributor Author

Did you open the links? :)

@Rondom

Rondom commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

@andrewjlamarche I think what namiltd is referring to is that your actual commits in the linked 25.12 PRs are lacking the cherry-picked from line with the commit hash from master/main (which is automatically added if you use git cherry-pick -x to do the cherry pick)

@namiltd

namiltd commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

New commit: c5a8ddd

@maurerle

maurerle commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor

further related commits:

this gets messy quick - would be good to not forget about the commits..
Thanks for the progress so far! :)

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backport review of 5 commits cherry-picked to openwrt-25.12. Each commit's diff matches its upstream counterpart byte-for-byte (only hunk-context line offsets differ in image/an7581.mk, reflecting prerequisite commits not yet backported). Inline comments cover the missing (cherry picked from commit <sha>) trailers and the missing Build/an7581-chainloader prerequisite that breaks the build.


Generated by Claude Code

Comment thread target/linux/airoha/image/an7581.mk Resolved
Comment thread target/linux/airoha/image/an7581.mk Resolved
@andrewjlamarche
andrewjlamarche force-pushed the w1700k branch 2 times, most recently from fd78811 to c17078a Compare May 15, 2026 20:27
@andrewjlamarche
andrewjlamarche marked this pull request as ready for review May 15, 2026 20:34
@andrewjlamarche

Copy link
Copy Markdown
Contributor Author

Now that the chainloader has been merged, I think this PR has everything to get a functional W1700K on 25.12.

Note: there are other commits that should probably be backported as well, but to keep this PR focused on W1700K only, this should be sufficient.

Please test :)

@taylorkline

Copy link
Copy Markdown

I am trying to determine if #23393 is a strict prerequisite or not. My 25.12 build with the U-Boot upgrade to v2026.01 works fine. Time is limited, but I plan to try a build without #23393.

@taylorkline taylorkline left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the U-Boot upgrade #23393 to be a strict requirement; the W1700K hangs here on 2025.10's U-Boot:

U-Boot 2025.10-OpenWrt-r32933-4ccb782af7 (May 13 2026 - 22:42:09 +0000)

CPU:   Airoha AN7581
DRAM:  8 GiB

After the update to U-Boot v2026.01 from #23393, it boots fully.

Similar feedback left at: #23393 (review)

status = "okay";
};

&spi_nand {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on adding support for a similar Airoha AN7853 device. The device also has On-die Flash ECC enabled (see logs below).

  Stock bl Stock fw OpenWrt chainloader (this PR) OpenWrt (this PR)
nand-ecc-mode on-die (NAND_ECC_NONE) on-die (NAND_ECC_NONE) default (hw?) default (hw?)
ecc_step_size 2048 2048 default (512 ?) default (512 ?)
ecc_strength 0 0 default (8 ?) default (8 ?)
bmt enabled enabled ? disabled ? disabled ?

Differrent ECC settings (and bmt too) can lead to:

  • Failures to read data written by the bootloader in OpenWrt drive and vice versa
  • As a result, there are difficulties with rolling back to stock firmware and even fake bad blocks

So, why not use the same parameters everywhere (nand-ecc-mode: on-die (NAND_ECC_NONE), ecc_step_size: 2048, ecc_strength: 0) ? @andrewjlamarche, @hurrian, @mkshevetskiy what do you think?

The settings for OpenWrt:

	nand-ecc-mode = "none";
	nand-ecc-step-size = <2048>;
	nand-ecc-strength = <0>;

	nand-on-flash-bbt;

P.S. I don't know yet how to set the required parameters in OpenWrt U-Boot.
P.S.2.:
Stock (my device):
Using Flash ECC.
nand: NAND_ECC_NONE selected by board driver. This is not recommended!
Stock (this device):
https://openwrt.org/toh/gemtek/mxf-w1700k#oem_bootlog:
Using Flash ECC.
nand: NAND_ECC_NONE selected by board driver. This is not recommended!

# grep -H "" /sys/class/mtd/mtd*/ecc_step_size
/sys/class/mtd/mtd0/ecc_step_size:2048
/sys/class/mtd/mtd1/ecc_step_size:2048
/sys/class/mtd/mtd10/ecc_step_size:2048
/sys/class/mtd/mtd11/ecc_step_size:2048
/sys/class/mtd/mtd12/ecc_step_size:2048
/sys/class/mtd/mtd13/ecc_step_size:2048
/sys/class/mtd/mtd14/ecc_step_size:2048
/sys/class/mtd/mtd15/ecc_step_size:2048
/sys/class/mtd/mtd16/ecc_step_size:2048
/sys/class/mtd/mtd2/ecc_step_size:2048
/sys/class/mtd/mtd3/ecc_step_size:2048
/sys/class/mtd/mtd4/ecc_step_size:2048
/sys/class/mtd/mtd5/ecc_step_size:2048
/sys/class/mtd/mtd6/ecc_step_size:2048
/sys/class/mtd/mtd7/ecc_step_size:2048
/sys/class/mtd/mtd8/ecc_step_size:2048
/sys/class/mtd/mtd9/ecc_step_size:2048
grep -H "" /sys/class/mtd/mtd*/ecc_strength
/sys/class/mtd/mtd0/ecc_strength:0
/sys/class/mtd/mtd1/ecc_strength:0
/sys/class/mtd/mtd10/ecc_strength:0
/sys/class/mtd/mtd11/ecc_strength:0
/sys/class/mtd/mtd12/ecc_strength:0
/sys/class/mtd/mtd13/ecc_strength:0
/sys/class/mtd/mtd14/ecc_strength:0
/sys/class/mtd/mtd15/ecc_strength:0
/sys/class/mtd/mtd16/ecc_strength:0
/sys/class/mtd/mtd2/ecc_strength:0
/sys/class/mtd/mtd3/ecc_strength:0
/sys/class/mtd/mtd4/ecc_strength:0
/sys/class/mtd/mtd5/ecc_strength:0
/sys/class/mtd/mtd6/ecc_strength:0
/sys/class/mtd/mtd7/ecc_strength:0
/sys/class/mtd/mtd8/ecc_strength:0
/sys/class/mtd/mtd9/ecc_strength:0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was wrong. We should use airoha,bmt instead of nand-on-flash-bbt. OpenWrt log with bmt enabled:

[May 24, 2026, 5:37:03 AM UTC] kern.info: [    0.555753] spi-nand spi0.0: SkyHigh SPI NAND was found.
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    0.561069] spi-nand spi0.0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    0.608451] bmt pool size: 143
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    0.612067] bmt/bbt found
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    0.614876] 14 fixed-partitions partitions found on MTD device spi0.0
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    0.621615] Creating 14 MTD partitions on "spi0.0":
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    0.626511] 0x000000000000-0x00000eba0000 : "all_flash"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.145508] 0x000000000000-0x000000080000 : "bootloader"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.151208] 0x000000060000-0x000000080000 : "u-boot-env"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.156903] 0x000000080000-0x0000000c0000 : "romfile"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.162303] 0x0000000c0000-0x000002940000 : "nsb_master"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.168084] 2 fixed-partitions partitions found on MTD device nsb_master
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.174804] Creating 2 MTD partitions on "nsb_master":
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.179941] 0x000000000000-0x000000800000 : "kernel"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.185156] 0x000000800000-0x000002880000 : "rootfs_master"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.191016] 0x000002940000-0x0000051c0000 : "nsb_slave"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.196725] 0x0000051c0000-0x000005200000 : "bosa"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.201872] 0x000005200000-0x000005240000 : "ri"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.207078] 0x000005240000-0x000005280000 : "flag"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.212145] 0x000005280000-0x0000052c0000 : "flagback"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.217684] 0x0000052c0000-0x000005cc0000 : "config"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.223210] 0x000005cc0000-0x00000dda0000 : "data"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.228598] 0x00000dda0000-0x00000e1a0000 : "oopsfs"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.233964] 0x00000e1a0000-0x00000eba0000 : "log"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.239060] 2 fixed-partitions partitions found on MTD device log
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.245172] Creating 2 MTD partitions on "log":
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.249697] 0x000000000000-0x0000009c0000 : "log_truncated"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.255697] 0x0000009c0000-0x000000a00000 : "bootflag"
[May 24, 2026, 5:37:03 AM UTC] kern.warn: [    1.397732] airoha-npu 1e900000.npu: Direct firmware load for airoha/en7581_npu_rv32.bin failed with error -2
[May 24, 2026, 5:37:03 AM UTC] kern.err: [    1.420768] cpufreq: cpufreq_online: ->get() failed
[May 24, 2026, 5:37:03 AM UTC] kern.err: [    1.425769] cpufreq: cpufreq_online: ->get() failed
[May 24, 2026, 5:37:03 AM UTC] kern.err: [    1.430703] cpufreq: cpufreq_online: ->get() failed
[May 24, 2026, 5:37:03 AM UTC] kern.err: [    1.435645] cpufreq: cpufreq_online: ->get() failed
[May 24, 2026, 5:37:03 AM UTC] kern.err: [    1.440554] cpufreq-dt cpufreq-dt: failed register driver: -19
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.447359] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.454352] NET: Registered PF_INET6 protocol family
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.460231] Segment Routing with IPv6
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.463960] In-situ OAM (IOAM) with IPv6
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.467932] NET: Registered PF_PACKET protocol family
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.473086] 8021q: 802.1Q VLAN Support v1.8
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.488794] Concatenating MTD devices:
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.492553] (0): "data"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.495017] (1): "rootfs_master"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.498245] (2): "nsb_slave"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.501118] (3): "config"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.503736] (4): "oopsfs"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.506352] (5): "log_truncated"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.509573] into device "virtual_flash"
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.513535] 1 fixed-partitions partitions found on MTD device virtual_flash
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.520495] Creating 1 MTD partitions on "virtual_flash":
[May 24, 2026, 5:37:03 AM UTC] kern.notice: [    1.525906] 0x000000000000-0x00000e1a0000 : "ubi"
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.593485] mt7530-mmio 1fb58000.switch: configuring for fixed/internal link mode
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.601101] mt7530-mmio 1fb58000.switch lan2 (uninitialized): PHY [mt7530-0:0a] driver [Airoha AN7581 PHY] (irq=POLL)
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.612367] mt7530-mmio 1fb58000.switch lan3 (uninitialized): PHY [mt7530-0:0b] driver [Airoha AN7581 PHY] (irq=POLL)
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.623499] mt7530-mmio 1fb58000.switch lan4 (uninitialized): PHY [mt7530-0:0c] driver [Airoha AN7581 PHY] (irq=POLL)
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.634575] airoha_eth 1fb50000.ethernet eth0: entered promiscuous mode
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.641216] DSA: tree 0 setup
[May 24, 2026, 5:37:03 AM UTC] kern.info: [    1.644709] mt7530-mmio 1fb58000.switch: Link is Up - 10Gbps/Full - flow control rx/tx

@marccdb

marccdb commented Jun 24, 2026

Copy link
Copy Markdown

kindly pinging @robimarko here =)
I see that #23393 was merged!

@taylorkline taylorkline left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to float the idea of disabling the NPU on WiFi before this device support PR is merged. I've been running this PR for months now across my 3-device WDS hub/spokes model with 6Ghz backhaul and it's been solid, with the caveat that I found it necessary to disable wireless NPU offloading for both stability and throughput.

With wireless NPU offloading enabled, as per the current PR state, there are two significant issues:

  • Clients behind the WDS AP see throughput heavily limited to 50-400 Mbps (depending on the exact test conditions) with traffic spiking only one core of the four-core CPU
  • Kernel WARNING arising every 1-3 days under my normal usage, or reproducible within seconds to minutes by, on one w1700k, issuing iperf3 -u -b 0 -P 4 -t 300 -c <other-wirelessly-connected-w1700k> (the w1700k on the receiving end will crash)
    • Stack trace attached below
    • This has been reported by other users on the forum thread such as by glassdoor, by hwti, by imrouter, by russell (though the details of their exact build may not be the same as this PR, we can see it is a recurring issue)
    • After this crash, throughput is degraded to a few Mbps until a reboot

With wireless NPU offloading disabled, I see throughput between my devices behind my WDS APs reach the limit of my 1 GbE ethernet cap, load is distributed all CPU cores, and I can run for weeks with zero issues.

Overall, wireless NPU offloading appears to still be in its infancy, and especially so on kernel 6.12. I think it's defensible to make a minor deviation in the backport to disable it for OpenWrt stable. (Aside, while the WARNINGs are fixed on main with kernel 6.18, I still experience enough performance issues in various use cases that trying to patch the NPU offloading in this backport does not seem like a worthwhile avenue to explore versus disabling it.)

Kernel WARNING stack trace on 25.12 with NPU on
[59930.227403] ------------[ cut here ]------------
[59930.232061] WARNING: CPU: 0 PID: 1128 at mt7996_mac_wtbl_lmac_addr+0x610/0x820 [mt7996e]
[59930.240189] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_inet wireguard pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_compat nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack nct7802 mt7996e(O) mt76_connac_lib(O) mt76(O) mac80211(O) libchacha20poly1305 ipt_REJECT chacha_neon cfg80211(O) xt_time xt_tcpudp xt_tcpmss xt_statistic xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY slhc sch_cake regmap_i2c poly1305_neon nfnetlink nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 macvlan libcurve25519_generic libcrc32c libchacha iptable_mangle iptable_filter ipt_ECN ip_tables hwmon compat(O) i2c_mt7621 sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact i2c_dev i2c_core
[59930.240471]  ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ifb ip6_udp_tunnel udp_tunnel sha512_arm64 cmac leds_gpio gpio_button_hotplug(O) rtl8261n
[59930.346183] CPU: 0 UID: 0 PID: 1128 Comm: napi/phy0-77 Tainted: G           O       6.12.87 #0
[59930.354800] Tainted: [O]=OOT_MODULE
[59930.358288] Hardware name: Gemtek W1700K (OpenWrt U-Boot layout) (DT)
[59930.364723] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[59930.371683] pc : mt7996_mac_wtbl_lmac_addr+0x610/0x820 [mt7996e]
[59930.377707] lr : mt7996_mac_wtbl_lmac_addr+0x528/0x820 [mt7996e]
[59930.383722] sp : ffffffc0812aba90
[59930.387029] x29: ffffffc0812aba90 x28: 0000000000000005 x27: 0000000000000046
[59930.394164] x26: ffffff801691aba8 x25: 000000000000001b x24: ffffff80119f6058
[59930.401300] x23: ffffff801691ad28 x22: ffffff80119f6058 x21: ffffff80119f6058
[59930.408435] x20: 000000001058a0b0 x19: ffffff8006812040 x18: 0000000000000014
[59930.415571] x17: ffffffbfff094000 x16: ffffffc080cf8000 x15: 000000009ccf78be
[59930.422706] x14: 0000000000000000 x13: ffffff8001717198 x12: ffffff8001716fe8
[59930.429842] x11: 0000000000000002 x10: ffffff8006815888 x9 : ffffff8006815880
[59930.436977] x8 : ffffff8001717010 x7 : ffffff8006282460 x6 : 0000000000000000
[59930.444113] x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000000001
[59930.451248] x2 : ffffff80023398cc x1 : ffffff8006814bf8 x0 : ffffff800681280c
[59930.458384] Call trace:
[59930.460824]  mt7996_mac_wtbl_lmac_addr+0x610/0x820 [mt7996e]
[59930.466491]  mt7996_queue_rx_skb+0x95c/0xd78 [mt7996e]
[59930.471639]  mt76_npu_rx_queue_init+0x3e8/0x4e0 [mt76]
[59930.476795]  __napi_poll+0x34/0x174
[59930.480284]  napi_threaded_poll_loop+0xb0/0x21c
[59930.484817]  napi_threaded_poll+0x70/0x80
[59930.488826]  kthread+0xd8/0xdc
[59930.491882]  ret_from_fork+0x10/0x20
[59930.495460] ---[ end trace 0000000000000000 ]---

@marccdb

marccdb commented Jun 24, 2026

Copy link
Copy Markdown

When enabling Hardware Offload in latest Snapshot, I'm getting constant reboots...
My HW is 1.1, not sure if that matters.

@r33bnet r33bnet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taylorkline

Copy link
Copy Markdown

@andrewjlamarche Polite nudge, any thoughts on my proposal above?

I'd like to float the idea of disabling the NPU on WiFi before this device support PR is merged.

@andrewjlamarche

andrewjlamarche commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Truthfully, there have been so many commits and improvements to snapshot that I've been considering dropping this 25.12 backport and just waiting for 26.x for a formal support release.
I don't use my unit except as a mesh node that is very far away and already receives poor signal, so performance is already pretty bad but if the consensus is that it does not work very well on 25.12, I don't really see a point in making it officially supported here.

@taylorkline

taylorkline commented Jun 29, 2026 •

Copy link
Copy Markdown

[...] so performance is already pretty bad but if the consensus is that it does not work very well on 25.12, I don't really see a point in making it officially supported here.

@andrewjlamarche I can ease your concern by mentioning that 25.12 works absolutely fantastic under extensive use with the caveat that wireless NPU offloading must be off for both throughput and stability.

edit: well, to be honest the LAN2 10GbE port does not work. Which does not affect my usecase, but may for others...

andrewjlamarche and others added 9 commits July 1, 2026 13:08
This commit adds support for Gemtek (Centurylink/Lumen/Quantum Fiber)
W1700K.

Device specification
--------------------
SoC Type:	Airoha AN7581
RAM:		ESMT M16U8G16512A (2GB)
Flash:		Winbond 25N04KVZEIR (512MB)
Ethernet:	2x gigabit via AN7581, 2x 10g via RTL8261N
Wi-Fi:		MT7996 - BE19000
LEDs:		1 LED, power/status
Button:		Reset
USB ports:	None
Bootloader:	U-Boot 2014.04-rc1 (Jun 12 2024 - 08:14:34) AXON 2.0
Fan:		1x controlled by Nuvoton NCT7511Y

This device is pretty useless with the stock firmware as it requires an
account to completely set it up. Additionally, the vendor bootloader is
signed and uses Airoha/Mediatek's BBT/BMT for bad block management on
the flash. It does not support UBI, thus kernel updates are subject to
BMT/BBT which OpenWrt does not support. In turn, if a kernel update
happens and a block is marked bad in the process, the device will fail
to boot and will need to be recovered via serial.

The workaround is to chainload U-Boot in place of the kernel, as it
should not need frequent updates and thus should not cause BBT/BMT to
misbehave and soft-brick the device. Upstream U-Boot supports loading
a FIT image from UBI, so we create a UBI partition for the new u-boot
env, FIT image and factory data. This way, bad blocks are managed by UBI
instead, which will not soft-brick the device should a block be marked
bad during a normal OpenWrt update. Users wishing to update U-Boot can
do so, but should be prepared to recover if a block goes bad.

Because the device is not useful with stock firmware, this is a one-way
ticket for most users and reverting will not be documented.

The following steps can be used to install OpenWrt on the W1700K.

Connect to serial console. There is a Torx T10 screw underneath the QR
code printed onto the label. Then, pry between the gray and white
plastic, starting by the ports on the back. There are clips arount the
entire device. Starting closest to the screw next to the UART header,
TX - GND - VCC - N/A - RX. The bootloader can be interrupted by
pressing any key.

Configuring Vendor Bootloader and Installing U-Boot Chainloader:
The bootloader's default bootcmd will only run a signed image. However,
we can still bootm our own image from flash.

NOTE: The vendor's ethernet drivers are flaky. You may have to reboot
and try the tftpboot part several times for it to work.

- setenv one flash read 0x600000 0x1000000 \$loadaddr
- setenv two "; bootm"
- setenv bootcmd "$one$two"
- setenv one
- setenv two
- saveenv
- setenv serverip 192.168.1.10; setenv ipaddr 192.168.1.1; tftpboot
0x89000000 openwrt-airoha-an7581-gemtek_w1700k-ubi-chainload-uboot.itb
- flash erase 0x600000 0x100000
- flash write 0x600000 0x100000 0x89000000
- reset

The device will now reboot into the U-Boot chainloader.

Loading the W1700K UBI Installer:
The installer can be downloaded at
https://github.com/hurrian/w1700k-ubi-installer/releases

- Boot the installer via the TFTP option in the U-Boot menu. This
  process is automatic, though you may be prompted to answer some
  questions.
- Once it is done, you may upgrade to your preferred build.
- For more information: https://github.com/hurrian/w1700k-ubi-installer

For those wishing to explore the stock firmware:

Rooting Stock FW (for making backups, recommended):
- Boot the router and watch serial console until presented with failsafe
  mode. Enter it (f + enter).
- mount_root
- Change the root password (passwd).
- Open /etc/config/axon_platform_manager and set sshServerEnable,
  localAccessEnable and remoteAccessEnable to 1.
- Search for "SSH". You'll find a long string with 3 matches such as
  Enabled%25252c1%25252cSSH%Drop. Change any instances of "Disabled"
  preceding SSH to "Enabled" and any instances of "Drop" to "Accept"
  that follow SSH. Same for "Local SSH" and "Remote SSH".
- Set /etc/config/dropbear to:

config dropbear
	option PasswordAuth 'on'
	option RootPasswordAuth 'on'
	option Port '22'

- Reboot.
- Connect 10g WAN port to existing network and SSH in with the password
  you set.
- SSH into rooted stock fw.

Signed-off-by: Andrew LaMarche <[email protected]>
Link: openwrt#17869
Signed-off-by: Christian Marangi <[email protected]>
(cherry picked from commit 9930758)
Add uboot-envtools to default packages to facilitate modifying the
u-boot environment.

Signed-off-by: Andrew LaMarche <[email protected]>
Link: openwrt#17869
Signed-off-by: Christian Marangi <[email protected]>
(cherry picked from commit 449c8d8)
Most, if not all Airoha devices will have LEDs and buttons. Add them to
default packages.

Signed-off-by: Andrew LaMarche <[email protected]>
Link: openwrt#17869
Signed-off-by: Christian Marangi <[email protected]>
(cherry picked from commit db4c141)
Remove source-only from an7581.

Signed-off-by: Andrew LaMarche <[email protected]>
Link: openwrt#17869
Signed-off-by: Christian Marangi <[email protected]>
(cherry picked from commit 87c2c47)
W1700K fan script is missing the #!/bin/sh /etc/rc.common shebang and
requires execution bits set. Also, set the fallback to hwmon 3 instead
of 5, since the new RTL PHY driver was not merged.

Signed-off-by: Andrew LaMarche <[email protected]>
(cherry picked from commit 400b08a)
The vendor firmware checks for a bmt header in the last 528 erase blocks
of flash. The OpenWrt partition table did not respect that requirement,
and therefore the vendor and openwrt chainloader fight over those blocks
on every boot, potentially corrupting data stored in UBI blocks there.
This commit increases the size of the reserved_bmt partition to avoid
that fight.

Although the vendor bootloader only seems to touch the final 250 erase
blocks[1], the original vendor firmware system partition ended at
0x1be00000[2], so to be conservative, the consensus is to use that as
the end of mtd2 (ubi) partition and leave the last 528 blocks for mtd3
(reserved_bmt).

From https://openwrt.org/toh/gemtek/mxf-w1700k:
[1] OEM bootlog: [    5.324337] bmt pool size: 250
[2] OEM bootlog: [    5.478927] 0x000008600000-0x00001be00000 : "system"

Adds a compat_version to warn users to re-install to accomodate the
shrunken mtd2 ubi partition.

Fixed two nits suggested by Claude, zero padding a hex value and removed
an extra space.

Removed the wildcard setting of compat_version for other boards, as
suggested by Robert Marko, set compat_version only for the w1700k.

Reported-by: Loïc Yhuel <[email protected]>
Signed-off-by: Russell Senior <[email protected]>
Link: openwrt#23061
Signed-off-by: Robert Marko <[email protected]>
(cherry picked from commit ee771d3)
…reset timing

Some W1700K and XR1701G boards with Realtek RTL8261N/RTL8261BE 10G PHYs
fail to bring up the USXGMII link on cold boot. The PHY enters a bad
state during initialization and the link stays down permanently until
power cycle.

Root cause: the GPIO reset assert/deassert timing (40ms/150ms) is too
short for the RTL8261N to complete its internal firmware load. The OEM
firmware uses 200ms/200ms.

Increase both PHY reset timings to 200ms/200ms to match OEM values.
Confirmed to fix intermittent boot failures on both W1700K (Gemtek)
and XR1701G boards.

Signed-off-by: Ryan Chen <[email protected]>
Link: openwrt#22564
Signed-off-by: Hauke Mehrtens <[email protected]>
(cherry picked from commit 7be78e7)
The AN7531N SoC has currently problems communicating using `phy_mmd_...`
when irqbalance is active. But when there is a communication error in the
interrupt handler, the interrupt will be disabled. This can usually be seen
in the logs as:

    irq 53: nobody cared (try booting with the "irqpoll" option)
    CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Tainted: G       O   6.12.77 #0
    Tainted: [O]=OOT_MODULE
    Hardware name: Gemtek W1700K (OpenWrt U-Boot layout) (DT)
    Call trace:
     dump_backtrace.part.0+0xbc/0xcc
     show_stack+0x14/0x20
     dump_stack_lvl+0x58/0x74
     dump_stack+0x14/0x1c
     __report_bad_irq+0x48/0xf8
     note_interrupt+0x2f4/0x340
     handle_irq_event+0xac/0xe0
     handle_simple_irq+0xa8/0xfc
     handle_irq_desc+0x30/0x54
     generic_handle_irq+0x1c/0x24
     airoha_irq_handler+0x90/0xe0
     __handle_irq_event_percpu+0x44/0x11c
     handle_irq_event+0x40/0xe0
     handle_fasteoi_irq+0xb4/0x240
     handle_irq_desc+0x30/0x54
     generic_handle_domain_irq+0x18/0x20
     gic_handle_irq+0x60/0xec
     do_interrupt_handler+0x4c/0x84
     el1_interrupt+0x30/0x4c
     el1h_64_irq_handler+0x14/0x1c
     el1h_64_irq+0x68/0x6c
     handle_softirqs+0x98/0x210
     __do_softirq+0x10/0x18
     ____do_softirq+0xc/0x20
     call_on_irq_stack+0x30/0x50
     do_softirq_own_stack+0x18/0x20
     irq_exit_rcu+0x80/0xb8
     el1_interrupt+0x34/0x4c
     el1h_64_irq_handler+0x14/0x1c
     el1h_64_irq+0x68/0x6c
     default_idle_call+0x24/0x34
     do_idle+0x98/0xf0
     cpu_startup_entry+0x30/0x38
     kernel_init+0x0/0x130
     console_on_rootfs+0x0/0x64
     __primary_switched+0x80/0x88
    handlers:
    [<000000002b75be58>] irq_default_primary_handler threaded
                            [<000000006d87ada6>] phy_interrupt
    Disabling IRQ openwrt#53

This is not a problem with the rtl8261n driver because it is not
registering an interrupt handler. But with the kernel realtek PHY driver, a
interrupt handler is registered which can trigger this problem on bootup.

To avoid is, disable the interrupt and use the PHY polling mode also wit
the upcoming realtek PHY driver support for RTL8261.

Co-authored-by: Aleksander Jan Bajkowski <[email protected]>
Co-authored-by: Sven Eckelmann <[email protected]>
Signed-off-by: Daniel Pawlik <[email protected]>
Link: openwrt#23078
Signed-off-by: Hauke Mehrtens <[email protected]>
(cherry picked from commit 07f140f)

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 new commits since the last review; no new issues found.

  • 1f1181821e "airoha: an7581: fix w1700k fan script" — matches upstream 400b08a7ca verbatim and carries the (cherry picked from commit ...) trailer.
  • 52ed9e4722 "airoha: disable wireless NPU offload for w1700k" — a deliberate stable-only deviation (requested in review #4564795344), so correctly carries no cherry-pick trailer. It disables the airoha,npu phandle on the mt7996@0,0 node by commenting it out with //, which is consistent with the existing //-commented properties already in this DTS. The &npu node itself remains enabled (firmware-name is still set), so only wireless offload is disabled and no dangling label results.

The other 7 PR commits are unchanged in content (rebase only altered SHAs and patch hunk offsets); the two substantive DTS commits still match their upstream counterparts (07f140f633, 7be78e718e) apart from expected one-line hunk offsets.


Generated by Claude Code

@taylorkline taylorkline left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewjlamarche Thanks for making that change!

This PR is now in the exact state that I use every day across my 3 W1700Ks (when I'm not trying out a main build). It's perfectly stable for daily use.

@hauke @robimarko Other than a known issue that 10GbE LAN2 port does not work, which cannot easily be backported to 25.12 as it requires kernel 6.18 and #23427, this device is fully supported. The 10GbE WAN port works fine in the meantime so there is 1x10GbE and 2x1GbE working. Can this PR be slated for the next round of 25.12 backports, at your convenience?

Edited: ports are 10GbE, not 5GbE

@castillofrancodamian

Copy link
Copy Markdown

@taylorkline It's 10 Gbps, not 5.

@robimarko

Copy link
Copy Markdown
Contributor

Considering that there are known issues when using this on 25.12, what is the point of backporting?

Honestly, I see a lot of board backports, but what benefit do you get really?

@andrewjlamarche

Copy link
Copy Markdown
Contributor Author

@robimarko I had been running 25.12 builds the entire time and I still have one unit running. I have no issues on it, LAN and WLAN works perfectly but it seems that there are some quirks that other people have found. This PR was prepared before a lot of the reports were made (or before I had been made aware of them).

TL;DR: everything works for me, but I could go either way in adding 25.12 or waiting for 26.x.

@robimarko

Copy link
Copy Markdown
Contributor

I dont think that enabling a new subtarget is really appropriate considering we are already 5 service releases into 25.12.

@andrewjlamarche

Copy link
Copy Markdown
Contributor Author

Closing this PR for now. I agree, its probably better to wait for 26.x for this target.

@andrewjlamarche
andrewjlamarche deleted the w1700k branch July 26, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages release/25.12 pull request/issue targeted (also) for OpenWrt 24.10 release target/airoha pull request/issue for airoha target

Projects

None yet

Development

Successfully merging this pull request may close these issues.