Gemtek XR1710G, sold by Brightspeed, is an AN7581 Wi-Fi 7 gateway.
It is a close relative of the Gemtek W1700K: the Silabs
Bluetooth/Zigbee radio and the Airoha GPS are gone, and the LEDs of
the two 1 GbE ports are driven by the internal switch PHYs instead of
GPIOs. The device tree shares an7581-gemtek-common.dtsi with
the W1700K and only adds these LEDs and the label MAC.
Specification:
- SoC : Airoha AN7581GT, 4x Cortex-A53
- RAM : 2 GiB DDR4-2666 (ESMT M16U8G16512A)
- Flash : 512 MiB SPI-NAND (Winbond W25N04KV)
- WLAN : MediaTek MT7996 (BE19000) on PCIe
- 2.4 GHz : 4x4, MT7976GN
- 5 GHz : 4x4, MT7977BN
- 6 GHz : 4x4, MT7977AN
- Ethernet : 2x 10 GbE (Realtek RTL8261BE, wan and lan2),
2x 1 GbE (AN7581 internal switch, lan3 and lan4)
- LEDs : 1x status, red/green/blue/white (GPIO),
2x2 lan3/lan4 green/amber (switch PHY)
- Button : reset
- Fan : PWM controlled by a Nuvoton NCT7802 on I2C
- UART : 5-pin header next to the case screw, 115200n8
- pinout : TX, GND, VCC, N/C, RX, starting at the screw
- Power : 12 VDC, 5 A, barrel jack, center positive
- Bootloader: U-Boot 2014.04-rc1 "AXON 1.6", signed, vendor BMT/BBT
The vendor bootloader verifies the image it boots by default and uses
Airoha BMT/BBT for bad block management, which Linux does not know
about. As on the W1700K, a U-Boot chainloader is therefore placed into
the "chainloader" partition (the start of the first vendor firmware
bank), which the vendor bootloader writes and loads, and everything
else lives in UBI, which handles bad blocks itself. The vendor
bootloader and its 66 MiB BMT pool at the end of flash are left alone.
The factory UBI volume holds the MT7996 EEPROM and the MAC addresses.
All of it comes from the vendor partition, which OpenWrt never writes:
the DSD block at 0x400000 holds the MACs, fan_id and the serial number
as text, the EEPROM is in the first good block from 0x405000. When the
volume is missing or holds no valid EEPROM and MACs, as on a new
install, sysupgrade builds it from there before writing the firmware.
The serial number has to match the board, and nothing is written when
the vendor data does not look right.
Installation (via serial console):
1. Open the case: there is a Torx T10 screw under the QR code label,
then pry the grey and white halves apart starting at the ports.
2. Connect to the UART header and interrupt the vendor bootloader with
any key.
3. Make the vendor bootloader boot the chainloader from flash, write
the chainloader with TFTP (server 192.168.1.254), and erase the rest
of the stock firmware. The vendor Ethernet driver is flaky, the
tftpboot may need a few attempts:
setenv serverip 192.168.1.254
setenv ipaddr 192.168.1.1
tftpboot 0x89000000 openwrt-airoha-an7581-gemtek_xr1710g-ubi-chainload-uboot.itb
setenv one flash read 0x600000 0x100000 \$loadaddr
setenv two "; bootm"
setenv bootcmd "$one$two"
saveenv
flash erase 0x600000 0x100000
flash write 0x600000 0x100000 0x89000000
flash erase 0x700000 0x1b700000
reset
The last erase matters: the stock firmware keeps its own UBI in this
area, which the chainloader would otherwise attach and keep.
If tftpboot keeps failing, load the chainloader over the serial
console instead: run "loady 0x89000000" in place of the tftpboot,
send the file with YMODEM (about 30 s at 115200 baud), then go on
with the setenv commands.
4. The chainloader creates UBI in the erased ubi partition with the
ubootenv, ubootenv2 and an empty factory volume, and saves its
environment. With nothing to boot, it lights the blue LED and loads
openwrt-airoha-an7581-gemtek_xr1710g-ubi-initramfs-recovery.itb via
TFTP from 192.168.1.254 until a server answers.
5. In the recovery system (192.168.1.1), copy over the sysupgrade.itb
image and run sysupgrade. It fills the factory volume with the Wi-Fi
calibration data and the MAC addresses from the vendor partition and
installs OpenWrt. The recovery volume is optional; without it, the
chainloader falls back to TFTP when the system does not boot.
6. Further updates use the sysupgrade.itb image.
Reverting to the stock firmware is not documented: the stock firmware
needs an ISP account to be useful.
MAC addresses ("factory" UBI volume):
- WAN : 0x5000 xx:xx:xx:xx:xx:xx
- LAN : 0x6000 xx:xx:xx:xx:xx:xx
- 2.4 GHz : 0x6000 + 1
- 5 GHz : 0x6000 + 2
- 6 GHz : 0x6000 + 3
Known issues:
- The 10 GbE ports (wan and lan2) may come up without link or lose
link: the AN7581 USXGMII PCS sometimes fails RX calibration ("No
FBCK Lock") with the RTL8261BE. The PCS and PHY fixes are being
worked on separately.
Based on the XR1710G support by Kenneth Kasilag (openwrt/openwrt#22397).
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Andrey Korshunov <razor1702@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26296
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Gemtek XR1710G (Brightspeed XR1710G) runs the same AXON vendor
bootloader as the Gemtek W1700K, including its Airoha BMT/BBT
handling, so it needs the same chainloader: the vendor bootloader only
loads this U-Boot from the "chainloader" partition, and all OpenWrt data
lives in UBI, which does its own bad block management.
The parts of the board U-Boot uses (UART, reset button, status LEDs,
SPI-NAND and the flash layout) match the W1700K, so the configuration is
the W1700K one with the names changed, plus:
- CONFIG_PINCONF is replaced by CONFIG_PINCTRL_AIROHA_AN7581, as for the
AN7581 reference board. The W1700K configuration lacks the pin
controller driver, so U-Boot finds neither the reset button nor the
status LEDs there ("LED 'status:red' not found (err=-19)").
- The reset button is read when the chainloader starts. If it is held,
the blue status LED lights up and the recovery image
(openwrt-airoha-an7581-gemtek_xr1710g-ubi-initramfs-recovery.itb) is
booted via TFTP from 192.168.1.254, retrying until a server answers.
This allows recovery without a serial console. The button has to be
pressed after power is applied: held at power-on, it makes the AN7581
boot ROM wait for a UART download instead. The chainloader starts about
15 s after power-on.
- The default menu entry runs boot_ubi instead of boot_production, so a
broken production volume falls back to the recovery volume, and when
neither boots the recovery image is loaded via TFTP until a server
answers. boot_recovery only runs bootm after the recovery volume was
read, so a warm reset cannot boot a stale image left in RAM.
- As on the Nokia boards, a ubi partition that does not attach is
formatted, missing ubootenv, ubootenv2 and factory volumes are
created, and the environment is saved once, so fw_printenv and
fw_setenv work. CONFIG_ENV_SIZE is set to the ubootenv volume size
that uboot-envtools uses. The factory volume holds the Wi-Fi EEPROM
and the MAC addresses and is filled by sysupgrade from the vendor
partition. Created empty here, it lets the kernel fall back to random
MAC addresses instead of deferring the Ethernet probe, so the recovery
image has a working network.
- MMC support is disabled, as on the Nokia boards. The board has no
eMMC, and with the environment in MMC or UBI the saveenv right after a
format went to MMC: when no location holds an environment yet,
env_load() selects the first one.
- The installer variables and menu entry of the W1700K are dropped: the
device is installed by booting the recovery image and running
sysupgrade.
- CONFIG_CMD_ASKENV is enabled, as on the Nokia boards: the TFTP and
recovery menu entries wait for Enter with askenv when they fail. The
W1700K configuration lacks it, so there they print "Unknown command
'askenv'" and return to the menu at once.
Based on the XR1710G chainloader by Kenneth Kasilag.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Andrey Korshunov <razor1702@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26296
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Gemtek XR1710G is a close relative of the W1700K and shares almost
all of its device tree: flash layout and UBI volumes, MAC addresses,
Wi-Fi, Ethernet, the 10G PHYs, the reset button and the status LEDs.
Move these parts into an7581-gemtek-common.dtsi and keep only
what is specific to the W1700K in its DTS: the GPIO driven lan3/lan4
LEDs, the 10G PHY LEDs and the UARTs of the Bluetooth/Zigbee radio and
the GPS.
While at it, reference the wan_mac cell without an argument: it is a
plain cell, not a "mac-base" one with #nvmem-cell-cells, so the
trailing 0 was invalid and only worked because the nvmem core ignores
it for index 0. Also use generic node names for the Wi-Fi and the BMT
partition, and sort the status LEDs by GPIO (white 20 before red 29),
which swaps the led-2 and led-3 node names. The resulting devicetree
is otherwise unchanged.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Andrey Korshunov <razor1702@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26296
Signed-off-by: Robert Marko <robimarko@gmail.com>
A port keeps the ETS weight of each queue in an array of its own,
beside the other arrays indexed by queue. Keep it in the struct of the
queue instead, with the drop counters of the queue.
No functional change.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26825
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
An offloaded ETS reports no statistics of the hardware either. Report
the drops of all queues of the port and the bytes and packets it sent,
less those the CPU sent through the qdisc, as a root RED or TBF does.
The qdiscs on its bands keep their own counts, and as in software the
drops of a band count for the ETS as well. Each ETS counts from the
time it is offloaded, and an ETS kept after a failed replace goes on
from its own counts.
On an RTL9303 with 400 Mbit/s of UDP offered to a 10G port and a TBF of
100 Mbit/s on the band of the load, the ETS reported 208942 drops where
iperf3 counted 208942 lost datagrams, and 67567 packets sent for 67330
received. With 2000 pings of 1000 bytes sent by the CPU out of the port,
the packets sent of the ETS grew by 2070.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26825
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
An offloaded TBF reports no statistics of the hardware, so tc -s shows
only the traffic the CPU sent through it and none of the frames the
shaper made the queues drop.
The per-queue egress drop counters count those drops, and those of an
offloaded egress police on the port, which a software qdisc does not
see. Report the drops of the queue of a TBF on a band of an ETS, and of
all queues of the port for a root TBF, which also reports the bytes and
packets the port sent, less those the CPU sent through the qdisc, as a
root RED does. The software TBF counts the times it had to wait for
tokens as overlimits; the hardware has no such counter, so they stay as
they are. Each TBF counts from the time it is offloaded or replaced by
another.
On an RTL9303 with 400 Mbit/s of UDP offered to a 10G port, a root TBF
of 100 Mbit/s reported 208962 drops where iperf3 counted 208922 lost
datagrams, and 67568 packets sent for 67321 received. A TBF of
100 Mbit/s on the band of the load of an ETS reported 208942 drops for
208942 lost. With 2000 pings of 1000 bytes sent by the CPU out of the
port, the packets sent of a root TBF grew by 2062.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26825
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The per-queue egress drop counters count every frame a queue drops, not
only the drops of RED, and TBF and ETS need them too. Keep them apart
from RED: the counters of a port are polled while it is in a new mask of
ports, kept by tc.c from the qdiscs offloaded there, and every read adds
the difference to the running total, so no base has to be taken when a
port joins. The counters of a queue go into a struct for the queues of
a port, the counts a qdisc starts from into a struct of their own, and
the function that reports them goes above the TBF code.
RED reports the same statistics as before.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26825
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Fixes the ethernet MAC silently discarding packets with unset UDP
checksum.
These patches have been applied upstream, thus they can be dropped once
they land in the stable release.
Signed-off-by: David Bauer <mail@david-bauer.net>
The PMU driver is not initialized on KERNEL_PERF_EVENTS=y builds because
the device node is missing.
Add the PMU nodes to AN7581 and AN7583. PMU interrupt generally uses
GIC_PPI 7. Verified on both SoCs.
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26902
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since the switch to the new PCI drivers, each PCIe host bridge has a PCI
domain of its own. The Meraki MR18 has a radio on both, and the one on
the second is now 0001:00:00.0 instead of 0000:01:00.0. ath9k asks for
ath9k-eeprom-pci-0001:00:00.0.bin, which 10-ath9k-eeprom does not serve,
and the radio does not come up.
Serve the EEPROM data under both names.
Fixes: 13e5b0b98b ("ath79: switch to new pci drivers")
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
spi-ath79 takes its clock by name ("ahb"). The SPI node of ar934x.dtsi
has no clock-names, as spi-ar934x takes the first clock. The MikroTik
RB911G/RB912UAG and the WD My Net N600/N750 switch that node to
qca,ar7100-spi, so spi-ath79 got the clock from the global "ahb"
clkdev alias, which the ath79 clock driver no longer registers. The
probe fails:
ath79-spi 1f000000.spi: probe with driver ath79-spi failed with error -2
and everything behind the SPI is gone: the flash, and on the
RouterBOARDs the RouterBOOT hard_config with the wireless calibration
data (no radio) and the shift register with the LEDs.
Name the clock in the nodes that use spi-ath79, as ar7100.dtsi,
ar724x.dtsi and ar9132.dtsi already do.
Fixes: ee0c03564e ("ath79: replace the clk patches with the reworked upstream series")
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Since the switch to the new PCI drivers, each PCIe host bridge has a PCI
domain of its own. The QCA9882 of the RB922UAGS-5HPacD sits on the
second one, and is now 0001:00:00.0 instead of 0000:01:00.0. The ath10k
asks for cal-pci-0001:00:00.0.bin, 11-ath10k-caldata only serves
cal-pci-0000:01:00.0.bin, and the radio does not come up:
ath10k_pci 0001:00:00.0: otp calibration failed: 2
ath10k_pci 0001:00:00.0: failed to run otp: -22 (download-cal-data)
ath10k_pci 0001:00:00.0: could not probe fw (-22)
Serve the calibration data under both names.
Tested on a RB922UAGS-5HPacD: the ath10k loads its calibration data
and comes up again.
Fixes: 13e5b0b98b ("ath79: switch to new pci drivers")
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
The NanoPi R2S Plus has an M.2 E-key SDIO slot, populated on some units
with a Fn-Link 6222B-SRC (RTL8822CS) Wi-Fi module, which is currently
unused.
Backport the device tree fixes applied by the Rockchip maintainer for
v7.5 (mmind/linux-rockchip.git v7.5-armsoc/dts64), which correct the
board's VCCIO4/VCCIO6 io-domain supplies and enable the slot:
f889f5d1f9a8 ("arm64: dts: rockchip: Fix VCCIO4/VCCIO6 supplies on NanoPi R2S Plus")
bcb95c3641b0 ("arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus")
and include the rtw88 SDIO driver (which pulls in its firmware) and
wpad-basic-mbedtls in the image.
With the mmc core fixes that are already backported (generic
backport-6.18/445-0x), the module is tuned to SDR104 (150 MHz); as a
station on a 5 GHz VHT80 AP, iperf throughput goes from 70/29 Mbit/s
(rx/tx, 50 MHz high-speed) to 123/125 Mbit/s. Ethernet is unaffected.
Link: https://lore.kernel.org/linux-rockchip/20261031104714.3271017-1-rojer@rojer.me/
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Deomid rojer Ryabkov <rojer@rojer.me>
Link: https://github.com/openwrt/openwrt/pull/26692
Signed-off-by: Robert Marko <robimarko@gmail.com>
This fixes the issue of ethernet reset failed
after every software reboot:
dwmac-sun8i ...: EMAC reset timeout
dwmac-sun8i .... eth0: stmmac_dvr_remove: removing driver
dwmac-sun8i ...: probe with driver dwmac-sun8i failed with error -110
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/26890
Signed-off-by: Robert Marko <robimarko@gmail.com>
Nothing selects kmod-brcmsmac by default. Rosen Penev reports that on
the RT-N16 it only works with a firmware whose version check is patched
by hand [1], and the bcm47xx target uses b43 for these SoCs.
Remove the driver, the option that cuts its firmware out of broadcom-wl
and the brcmsmac only regulatory patch. BCM4313 cards lose their driver,
kmod-b43 has no LCN-PHY support.
Checked with CONFIG_ALL defconfig on bcm47xx, bcm53xx and x86. There
are no new warnings, and b43, brcmfmac and brcmutil are still built.
[1] https://github.com/openwrt/openwrt/pull/26267#issuecomment-6475312956
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26267
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Broadcom-bgmac-brcmsmac and Broadcom-mips74k-brcmsmac profiles are
the only users of kmod-brcmsmac, which is about to be removed. Both
have a b43 counterpart, Broadcom-bgmac-b43 and Broadcom-mips74k-b43.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26267
Signed-off-by: Robert Marko <robimarko@gmail.com>
bss_delete and a failed add_bss drop the AP MLD reference by hand but
leave the link ID set in used_link_ids. Adding the link back then fails
with "Link ID N already in use" and the link stays out of the AP MLD,
as seen with the 6 GHz link of a GL-BE9300 after wifi reload.
Drop the reference with hostapd_mld_ref_dec(), which also clears the
link ID bit, and export it from hostapd.c like the other helpers used
by ucode.c.
Signed-off-by: Zakk P <zakk@gentoozh.org>
Link: https://github.com/openwrt/openwrt/pull/26807
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Specifications:
- SoC: MediaTek MT7986A, 4x Cortex-A53
- RAM: 512 MiB DDR3
- Flash: 128 MiB SPI-NAND
- Switch: MediaTek MT7531
- Ethernet: 5 ports (1x 2.5G WAN, 3x 1G LAN, 1x 2.5G LAN)
- Ethernet PHYs: 2x MaxLinear GPY211C (2.5G WAN and 2.5G LAN)
- Wi-Fi: MT7986A built-in MAC/baseband with MediaTek MT7975 RF
front end, 2.4 GHz and 5 GHz Wi-Fi 6, 4T4R on both bands
- USB: 1x USB 3.0
- LEDs: 12 (power, status, WAN online, WAN, 4x LAN, 2.4 GHz,
5 GHz, phone, USB). The phone LED is not used, as the voice
(FXS) ports are not supported.
- Buttons: reset, WPS
- Power: 12 VDC, 2.5 A
Installation:
1. Open the case and connect a 3.3 V USB-UART adapter to the 4-pin
through-hole serial header (115200 baud, 8N1). Pin order of the
board pads, from top to bottom: VCC, GND, RX, TX. Do not connect VCC.
2. Connect a PC to one of the 1G LAN ports and set its address to
192.168.1.2/24. Serve the initramfs image
(openwrt-mediatek-filogic-tplink_ex820v-initramfs-kernel.bin)
with a TFTP server.
3. Power on the router and press Ctrl-C (or "t") when prompted to
enter the U-Boot command line. By default U-Boot uses 192.168.1.1
for itself and 192.168.1.2 as the TFTP server.
4. Boot the initramfs image:
tftpboot openwrt-mediatek-filogic-tplink_ex820v-initramfs-kernel.bin
bootm 0x46000000
5. Back up the stock "ubi0" partition. Do not skip this step: no
stock firmware image that can be flashed from OpenWrt is
available, so this backup is the only way to return to stock.
Check that "ubi0" is mtd4:
cat /proc/mtd
Then, on the router:
ubidetach -m 4
cat /dev/mtd4 > /tmp/ex820v-stock-ubi0.bin
sha256sum /tmp/ex820v-stock-ubi0.bin
Copy the file to the PC, for example:
scp -O root@192.168.1.1:/tmp/ex820v-stock-ubi0.bin .
The initramfs runs from RAM, so the file is lost on reboot. Check
that the copy on the PC is 41943040 bytes and that its checksum
(sha256sum ex820v-stock-ubi0.bin) matches the one printed on the
router before continuing. Note the checksum, as it is needed to
verify the file again when returning to stock. The backup is a
stock firmware image and may contain device-specific data. Keep
it for your own use and do not share it.
6. Copy the sysupgrade image to the router with "scp -O" and run
"sysupgrade -n -v <image>".
Return to stock:
This needs the "ubi0" backup from step 5 of the installation. Only
"ubi0" is changed by the installation. Boot the initramfs again as
in steps 2 to 4, then copy the backup from the PC to the router:
scp -O ex820v-stock-ubi0.bin root@192.168.1.1:/tmp/
Check that the transfer was successful before continuing: the file
on the router must be 41943040 bytes and its checksum must match the
one of the backup on the PC:
ls -l /tmp/ex820v-stock-ubi0.bin
sha256sum /tmp/ex820v-stock-ubi0.bin
Then, on the router:
ubidetach -m 4
mtd write /tmp/ex820v-stock-ubi0.bin ubi0
Check that "mtd write" finished without errors. Do not reboot if the
transfer check or the write failed, otherwise the router may not
boot. If everything went well, reboot:
reboot
Notes:
- Tested on an EX820v v1.0, GBBRSK variant (Brsk, UK). Other hardware
versions and regional variants were not tested.
- Installation and return to stock were tested on two units.
- The Wi-Fi EEPROM is read from the stock "misc_ro" UBIFS file
0x003A0000 (first 4096 bytes).
- The LAN MAC comes from "flashmac" in u-boot-env. WAN uses +1, the
2.4 GHz radio +2 and the 5 GHz radio +3.
- The NMBM layout matches the stock firmware, so the stock U-Boot
boots the "uboot", "rootfs" and "kernel" volumes from ubi0 and no
tp_boot_idx handling is needed.
- The flash is reported as ESMT SPI NAND by OpenWrt and as GigaDevice
by stock. Both report the same ID (0xc8).
- NMBM bad-block remapping was not exercised, the unit has no bad
blocks.
Signed-off-by: Michele Lizzit <michele@lizzit.it>
Co-developed-by: Koen van Mierlo <k.j.vanmierlo@gmail.com>
Signed-off-by: Koen van Mierlo <k.j.vanmierlo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26747
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
With ft_psk_generate_local=1, the default for FT with a PSK, hostapd
does not look at the VLAN ID that a PSK in wpa_psk_file has
(vlanid=<VLAN ID>) when a station roams with FT. The station then drops
out of the VLAN of its PSK onto the interface of the BSS. A wifi-station
section with a vid gives a PSK such a VLAN ID.
hostap main fixes this with commit ad66108dbc5a, which is not in the
2.12 release that the package pins:
https://git.w1.fi/cgit/hostap/commit/?id=ad66108dbc5a8a28b7164c6cd05eda6550f94481
Backport it as patch 927.
A PSK lookup that asks for the VLAN ID also sets psk_idx, so the
sta_connected ucode hook now gets the psk_idx after an FT-PSK roam too.
Tested on a TP-Link Archer C7: after an FT-PSK roam, a station whose
PSK has vlanid=1 stayed in VLAN 1 ("AP-STA-CONNECTED ... vlanid=1
auth_alg=ft").
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/26864
Signed-off-by: Robert Marko <robimarko@gmail.com>
Set ATH10K_FW_FEATURE_MFP_SUPPORT despite no mfp support being
advertised by the firmware, based on exact firmware version and chip
type.
The QCA99X0 firmware in linux-firmware (10.4.1.00030-1, from around
2015), does not - unlike firmwares for similar chips - advertise the
"mfp" feature. As a result of missing mfp advertisement from firmware
side, ATH10K_FW_FEATURE_MFP_SUPPORT is not set and ath10k never sets the
PMF peer flag in WMI peer assoc for 802.11w peers.
Effect is heavily degraded throughput on the TX path (QCA99X0 as
AP -> STA, capped at a fraction of the RX path), when using 802.11w,
which e.g. is a requirement for wpa3.
However, the hardware itself appears to support mfp, as indicated by
alternative firmware projects, such as ath10k-ct, which advertises mfp
for QCA99X0.
Also the original firmware appears to actually support mfp, despite not
advertising it. Just assuming mfp support from the linux side and not
relying on advertised features, results in the TX path being on par with
the RX path.
Experienced and tested on an Aruba AP-325 running OpenWrt.
Tested-on: QCA99X0 hw2.0 PCI 10.4.1.00030-1 (Aruba AP-325)
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
Link: https://github.com/openwrt/openwrt/pull/26651
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Hardware specification:
SoC: MediaTek MT7981B
RAM: 512 MB DDR4
Flash: 128 MB SPI-NAND
Ethernet: 1x WAN + 1x LAN, 1 Gbps (MT7531 switch)
WiFi: MediaTek MT7976CN, Wi-Fi 6, 2x 2.4/5.8 GHz
5G: 1x M.2 (Quectel RM520N), 4x 5G antenna
SIM: 2x Nano-SIM
USB: 1x USB
Storage: 1x MicroSD
UART: 3.3V TTL, 115200 8n1,
pinout: 3.3V RX TX GND
LEDs: 8x
Buttons: 1x (reset)
Power: 12V DC, 2.0A
Product Model: ZBT-Z8114AX-DS
MAC address layout:
LAN: 0x2a
WAN: 0x24
2.4G: 0x04
5.8G: 0x0a
Tested on a ZBT Z8114AX-DS unit running a self-built image:
- [x] OpenWrt boots and runs normally
- [x] All LEDs
- [x] USB port
- [x] SD card slot
- [x] UART console
- [x] 5G module communication
- [x] SIM card detection and operation
- [x] Fan control
MicroSD:
The microSD slot is connected over USB, so it shows up as USB mass
storage. Tested with a 16GB sdcard
5G Module:
The modem communication is set to Ethernet Control Mode (ECM) by the
vendor. The vendor wires the modem to the internal switch port
port@4, which is referred to as lan5 in the vendor firmware. OpenWrt
exposes this port as WWAN.
The USB interface is also available as usb0. The WWAN interface is
intended to be the preferred network interface, while usb0 can be
configured with higher metric.
This is similar to the ZBT-Z8106AX-T. For further details on the
modem configuration, see PR #23045
Bootlog: https://raw.githubusercontent.com/vigilante-1337/zbtlink-zbt-z8114ax-ds_bootlog/refs/heads/main/bootlog.txt
Flash instructions:
Via U-Boot web recovery:
1. Press and hold the reset button
2. Plug in power while continuing to hold reset
3. Hold reset for 10 seconds
4. Browse to http://192.168.1.1
5. Upload openwrt-mediatek-filogic-zbtlink_zbt-z8114ax-ds-squashfs-factory.bin
6. Press upgrade
7. Wait for the power LED to turn green
8. Enjoy
Via sysupgrade from an existing OpenWrt install:
1. Browse to http://192.168.1.1 and log in
2. Go to System -> Backup / Flash Firmware -> Flash image
3. Browse and select openwrt-mediatek-filogic-zbtlink_zbt-z8114ax-ds-squashfs-sysupgrade.bin
4. Uncheck "Keep settings and retain the current configuration"
5. Press continue
6. Wait for the power LED to turn green
7. Enjoy
Signed-off-by: Marcus William <notVigilante-1337@proton.me>
Link: https://github.com/openwrt/openwrt/pull/26016
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add support for the MERCUSYS Halo H90X (EU) v1 using the stock
flash layout and an optional OpenWrt U-Boot UBI layout.
Hardware:
- SoC: MediaTek MT7986B, 4x Cortex-A53
- RAM: 512 MiB DDR3
- Flash: 128 MiB SPI-NAND (ESMT F50L1G41LB /
POWERCHIP PSU1GS20DX / GigaDevice GD5F1GQ5UEYIGY)
- Ethernet: 1x 2.5GbE WAN/LAN via MaxLinear GPY211
- Ethernet: 2x 1GbE LAN via MediaTek MT7531
- 2.4 GHz: MediaTek MT7975N, 4x4 802.11ax
- 5 GHz: MediaTek MT7975P, 4x4 802.11ax
- LEDs: green and amber status, 2x green LAN, green 2.5GbE
- Button: reset
- Power: 12 VDC, 1.5 A
H90X shares the MR90X hardware description, but has one fewer MT7531
LAN port and uses H90X-specific partitioning and board setup.
Move the MR90X image settings into shared definitions so H90X can
reuse them; the MR90X images are unchanged.
All Ethernet ports, LEDs, and the reset button were tested.
MAC address layout:
LAN: label MAC
WAN: label MAC + 1
2.4 GHz: label MAC
5 GHz: label MAC - 1
Stock flash layout:
0x0000000-0x0200000 boot 2 MiB
0x0200000-0x0300000 u-boot-env 1 MiB
0x0300000-0x2d00000 ubi0 42 MiB
0x2d00000-0x5700000 ubi1 42 MiB
0x5700000-0x5800000 radio 1 MiB
0x5800000-0x6100000 factory_data 9 MiB
0x6100000-0x7200000 runtime_data 17 MiB
The named stock partitions end at 0x07200000. No functional
partition is defined for the remaining 14 MiB.
The factory_data UBI partition stores wireless calibration and the
label MAC in its ubi_factory_data volume. The OpenWrt U-Boot layout
stores the same data in its factory partition using NVMEM.
UART:
The four UART pads are present on the PCB. R3 on TX and R6 on RX are
unpopulated. Bridge their pads to use the 115200 8N1 UART console.
V
+-------+-------+-------+-------+
| +3.3V | GND | TX | RX |
+---+---+-------+-------+-------+
|
+--- Do not connect
Not all installation and recovery paths have been tested end-to-end.
The test H90X had already been modified with an incorrect partition
layout and had no original backups. Until the procedures are verified
on an untouched device, install OpenWrt only if UART recovery is
available.
Stock layout installation using UART:
1. Connect the TFTP host to LAN1, configure it as 192.168.0.2/24,
and connect UART at 115200 8N1.
2. Interrupt stock U-Boot with Ctrl-C and boot the stock-layout
initramfs:
printenv ipaddr serverip
setenv image openwrt-mediatek-filogic-mercusys_h90x-v1
setenv bootfile ${image}-initramfs-kernel.bin
tftpboot 0x46000000 ${bootfile}
bootm 0x46000000
The expected values are ipaddr=192.168.0.1 and
serverip=192.168.0.2.
After OpenWrt initramfs boots, enable DHCP on the host Ethernet
interface.
3. Create the five raw recovery backups after OpenWrt initramfs boots:
cat /dev/mtd0 > /tmp/boot.bin
cat /dev/mtd1 > /tmp/u-boot-env.bin
cat /dev/mtd4 > /tmp/radio.bin
cat /dev/mtd5 > /tmp/factory_data.bin
cat /dev/mtd6 > /tmp/runtime_data.bin
Extract the calibration and MAC files needed by the OpenWrt
U-Boot layout:
cp /tmp/factory_data/MT7986_EEPROM.bin /tmp/
cp /tmp/factory_data/default-mac /tmp/
Copy the five raw backups and two extracted files to the host:
mkdir -p h90x-backup
scp -O \
root@192.168.1.1:/tmp/boot.bin \
root@192.168.1.1:/tmp/u-boot-env.bin \
root@192.168.1.1:/tmp/radio.bin \
root@192.168.1.1:/tmp/factory_data.bin \
root@192.168.1.1:/tmp/runtime_data.bin \
root@192.168.1.1:/tmp/MT7986_EEPROM.bin \
root@192.168.1.1:/tmp/default-mac \
h90x-backup/
Keep these files in a safe place.
4. Copy the stock-layout sysupgrade image to /tmp and install it:
prefix=openwrt-mediatek-filogic-mercusys_h90x-v1
sysupgrade -n "/tmp/${prefix}-squashfs-sysupgrade.bin"
Stock layout installation without UART:
Let ROUTER_IP be the stock firmware's configured LAN address.
1. Create and enable a guest network in the stock firmware and set
its SSID to:
""; $(telnetd -l /bin/sh)
Apply the configuration and connect to ROUTER_IP port 23 for a root
shell.
2. Check the active stock boot slot:
fw_printenv tp_boot_idx
If the result is tp_boot_idx=1, install MERCUSYS stock firmware
using the web interface and repeat this step after the router
reboots. Otherwise, continue to the next step.
3. Create the five raw recovery backups:
cat /dev/mtd0 > /tmp/boot.bin
cat /dev/mtd1 > /tmp/u-boot-env.bin
cat /dev/mtd4 > /tmp/radio.bin
cat /dev/mtd5 > /tmp/factory_data.bin
cat /dev/mtd6 > /tmp/runtime_data.bin
4. Temporarily clear the root password to enable stock SSH access:
passwd -d root
This creates passwordless root access through the OEM SSH server.
Use an isolated or trusted network and continue immediately.
5. Stock SSH listens on port 20001. Copy the five backups to the host:
mkdir -p h90x-backup
scp -O -P 20001 \
root@ROUTER_IP:/tmp/boot.bin \
root@ROUTER_IP:/tmp/u-boot-env.bin \
root@ROUTER_IP:/tmp/radio.bin \
root@ROUTER_IP:/tmp/factory_data.bin \
root@ROUTER_IP:/tmp/runtime_data.bin \
h90x-backup/
6. The stock firmware does not provide ubiupdatevol. Upload a static
AArch64 BusyBox providing it together with the stock-layout
initramfs:
scp -O -P 20001 \
busybox \
openwrt-mediatek-filogic-mercusys_h90x-v1-initramfs-kernel.bin \
root@ROUTER_IP:/tmp/
Recreate OEM kernel volume ID 1 as a static 12 MiB volume, write
the OpenWrt initramfs, and reboot:
image=openwrt-mediatek-filogic-mercusys_h90x-v1
chmod 755 /tmp/busybox
ubirmvol /dev/ubi0 -N kernel
ubimkvol /dev/ubi0 -n 1 -N kernel -t static -s 12MiB
/tmp/busybox ubiupdatevol /dev/ubi0_1 \
"/tmp/${image}-initramfs-kernel.bin"
sync
reboot
7. After OpenWrt initramfs boots, extract the calibration and MAC
files:
cp /tmp/factory_data/MT7986_EEPROM.bin /tmp/
cp /tmp/factory_data/default-mac /tmp/
Copy both files to the host:
scp -O \
root@192.168.1.1:/tmp/MT7986_EEPROM.bin \
root@192.168.1.1:/tmp/default-mac \
h90x-backup/
8. Copy the stock-layout sysupgrade image to /tmp and install it:
prefix=openwrt-mediatek-filogic-mercusys_h90x-v1
sysupgrade -n "/tmp/${prefix}-squashfs-sysupgrade.bin"
U-Boot layout installation using UART:
1. Boot the stock-layout OpenWrt initramfs and copy the five raw
backups and two extracted factory-data files to the host as
described above.
2. Reboot, interrupt stock U-Boot, and boot the UBI-layout recovery
image using the stock 192.168.0.1/192.168.0.2 addresses:
printenv ipaddr serverip
setenv image openwrt-mediatek-filogic-mercusys_h90x-v1-ubi
setenv bootfile ${image}-initramfs-recovery.itb
tftpboot 0x46000000 ${bootfile}
bootm 0x46000000#config-1
3. Continue with the common U-Boot layout installation below.
U-Boot layout installation without UART:
1. Follow the software-only stock-layout procedure through booting
the stock-layout OpenWrt initramfs and copying the five raw backups
and two extracted files to the host. Do not install the
stock-layout sysupgrade image.
2. Copy the UBI-layout recovery image to /tmp, replace the temporary
initramfs, and reboot:
prefix=openwrt-mediatek-filogic-mercusys_h90x-v1-ubi
ubiupdatevol /dev/ubi0_1 \
"/tmp/${prefix}-initramfs-recovery.itb"
sync
reboot
3. Continue with the common U-Boot layout installation below.
Common U-Boot layout installation:
1. Copy the H90X UBI profile artifacts and the extracted factory-data
files to /tmp from the host:
scp -O \
*h90x-v1-ubi-bl31-uboot.fip \
*h90x-v1-ubi-preloader.bin \
*h90x-v1-ubi-squashfs-sysupgrade.itb \
h90x-backup/MT7986_EEPROM.bin \
h90x-backup/default-mac \
root@192.168.1.1:/tmp/
2. Prepare UBI and install the FIP:
prefix=openwrt-mediatek-filogic-mercusys_h90x-v1-ubi
ubidetach -p /dev/mtd3
ubiformat /dev/mtd3 -y
ubiattach -d 0 -p /dev/mtd3
ubimkvol /dev/ubi0 -n 0 -N fip -t static -s 1MiB
ubiupdatevol /dev/ubi0_0 "/tmp/${prefix}-bl31-uboot.fip"
ubimkvol /dev/ubi0 -n 1 -N ubootenv -s 0x1f000
ubimkvol /dev/ubi0 -n 2 -N ubootenv2 -s 0x1f000
3. Install kmod-mtd-rw and unlock the boot subpartitions:
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
mtd unlock boot
mtd unlock bl2
mtd unlock factory
4. Create a 128 KiB factory erase block with the full 20 KiB
MT7986_EEPROM.bin at offset 0 and default-mac at offset 0x8000:
dd if=/dev/zero bs=$((0x20000)) count=1 2>/dev/null | \
tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7986_EEPROM.bin of=/tmp/factory.bin \
conv=notrunc
dd if=/tmp/default-mac of=/tmp/factory.bin \
bs=1 seek=$((0x8000)) conv=notrunc
Write the factory data and preloader:
mtd write /tmp/factory.bin factory
mtd write "/tmp/${prefix}-preloader.bin" bl2
5. Install the UBI-layout sysupgrade image:
sysupgrade -n "/tmp/${prefix}-squashfs-sysupgrade.itb"
OpenWrt U-Boot layout recovery:
1. Configure a TFTP host as 192.168.1.254 and place this image in its
TFTP root:
openwrt-mediatek-filogic-mercusys_h90x-v1-ubi-initramfs-recovery.itb
2. Hold the reset button to make OpenWrt U-Boot download and boot it.
This recovery path was tested after installing the UBI layout.
Return to stock:
From the stock layout:
The stock-layout installation keeps stock U-Boot and the stock
partition map. No raw partition restoration is required. Continue with
the common stock U-Boot web recovery below.
From the OpenWrt U-Boot layout:
This procedure is the same for UART and software-only installations.
It requires these five stock partition backups:
boot.bin
u-boot-env.bin
radio.bin
factory_data.bin
runtime_data.bin
1. Put the stock-layout initramfs FIT in the TFTP root under the
filename expected by OpenWrt U-Boot layout recovery:
image=openwrt-mediatek-filogic-mercusys_h90x-v1
cp "/path/to/${image}-initramfs-kernel.bin" \
"/path/to/tftp-root/${image}-ubi-initramfs-recovery.itb"
2. Connect the TFTP host at 192.168.1.254 and hold the reset button.
The stock-layout FIT boots in RAM and exposes the stock partition
names.
3. Copy the five stock partition backups to /tmp.
4. Install kmod-mtd-rw and detach factory_data if it was attached by
preinit:
apk update && apk add kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
umount /tmp/factory_data 2>/dev/null || true
ubidetach -p /dev/mtd5 2>/dev/null || true
5. Erase both stock firmware slots:
mtd erase ubi0
mtd erase ubi1
6. Restore the stock environment and persistent data, then restore
the stock bootloader last:
mtd write /tmp/u-boot-env.bin u-boot-env
mtd write /tmp/radio.bin radio
mtd write /tmp/factory_data.bin factory_data
mtd write /tmp/runtime_data.bin runtime_data
mtd write /tmp/boot.bin boot
sync
reboot
Common stock U-Boot web recovery:
1. Connect the host to LAN1 and configure it as 192.168.0.2/24.
2. When returning from the stock layout, hold the reset button to enter
recovery. The OpenWrt U-Boot layout restore enters recovery after
reboot because both stock firmware slots were erased.
3. The recovery page is available at 192.168.0.1, but its browser
upload is unreliable. Upload the OEM image as the multipart form
field "firmware" with curl:
curl -v http://192.168.0.1/ \
-F "firmware=@/path/to/h90x-stock-firmware.bin"
Full bootloader recovery:
If BL2 or FIP is damaged, recover it over UART with mtk_uartboot.
Use the OpenWrt-built mt7986-ram-ddr3-bl2.bin as the BL2 payload:
https://github.com/981213/mtk_uartboot
Keep the five raw recovery backups and two extracted factory-data
files for future recovery.
Signed-off-by: Nadim Sbaihi <nadimsbaihi@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22877
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cudy WR1300 v4 is a MT7621 based dual-band router.
Hardware:
- SoC: MediaTek MT7621
- RAM: 128 MiB
- Flash: 16 MiB SPI NOR (XMC XM25QH128C)
- WiFi 2.4 GHz: MediaTek MT7603E
- WiFi 5 GHz: MediaTek MT7663E
- Ethernet: 5x 10/100/1000 Mbps (1x WAN, 4x LAN)
- Buttons: Reset, WPS
- LEDs: System, Internet, WAN, LAN1-4, WiFi 2.4 GHz, WiFi 5 GHz
- UART: ttyS0, 115200 8N1
- Power: 12 V DC barrel jack
MAC addresses (bdinfo 0xde00):
- LAN, WiFi 2.4 GHz: base
- WAN: base + 1
- WiFi 5 GHz: base + 2
The v4 hardware differs from v3 in GPIO assignments for LEDs and
buttons. The WiFi LEDs are connected to MT7621 GPIO5/GPIO6, not to
mt76, and LEDs and buttons use GPIO5-12, so the uart2 and uart3 pin
groups are muxed as GPIO.
Move what all WR1300 revisions share into mt7621_cudy_wr1300.dtsi
(flash layout, MAC cells, ethernet, the keys and the base pinmux).
Each device dts defines its own LEDs and WiFi nodes and overrides the
settings that differ: v1 the WPS key GPIO, SPI frequency and 5 GHz
EEPROM size, v4 both key GPIOs and the GPIO pin groups. The compiled
DTBs of v1, v2 and v3 are byte-identical before and after this change.
Tested on retail Cudy WR1300 v4:
- sysupgrade image boots
- WAN and LAN1-4
- 2.4 GHz and 5 GHz WiFi
- Reset and WPS button events
- System, Internet, WAN, LAN1-4 and WiFi LEDs
Installation from stock firmware:
- request the OpenWrt intermediate image for the WR1300 v4 from Cudy
support and flash it from the stock web interface
- it boots OpenWrt 23.05.5 at 192.168.1.1
- upload the OpenWrt sysupgrade image and run "sysupgrade -n"; no
force is needed (board name and compat version match)
Revert to stock: Cudy's TFTP recovery with the stock firmware image.
Link: https://patchwork.ozlabs.org/project/openwrt/patch/20260512133722.896830-1-jan.brudna@gmail.com/
Link: https://lists.openwrt.org/pipermail/openwrt-devel/2026-May/044819.html
Closes: https://github.com/openwrt/openwrt/issues/22082
Signed-off-by: Jan Brudna <jan.brudna@gmail.com>
[rebased on main, added installation notes, SUPPORTED_DEVICES: replace
v3's "cudy,wr1300 R30" with the v4 stock board name R98, use device
dts overrides instead of #if, add uart2 pinmux, v4 LEDs use
color/function, add flash, UART, power and MAC layout]
Tested-by: Michael Bates <mbates1401@gmail.com>
Tested-by: nullcrimson <null.crimson.dev@gmail.com>
Tested-by: stek29 <11808223+stek29@users.noreply.github.com>
Signed-off-by: Michael Bates <mbates1401@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26322
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The host configure script can detect libselinux in staging_dir/hostpkg
when libselinux/host has already been built. This links msgfmt against
libselinux.so.1 without a runtime search path to the staging directory,
causing translation builds such as util-linux to fail on hosts without
a system libselinux.
Pass --without-selinux to avoid this optional dependency and keep the
host tools independent of whether libselinux/host was built earlier.
Rebuilt gettext-full/host and util-linux successfully.
Link: https://github.com/openwrt/openwrt/pull/26843
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Backport the Python 3 C API conversions for pylibfdt. SWIG 4.5
removed the Python 2 aliases used by the bundled bindings.
Disable YAML support in the bundled dtc. Its build can find the
system yaml.h even when OpenWrt pkg-config cannot find libyaml.
Assisted-by: LLM
Link: https://github.com/openwrt/openwrt/pull/26856
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The perf build currently fails with the following error:
Error: libzstd is required by libelf, please do not set NO_LIBZSTD
This is caused by upstream kernel commit 44b44ffd5dce ("perf build:
Minor improvement for linking libzstd"), which strictly aborts the build
if the `libelf-zstd` feature is detected while `NO_LIBZSTD` is set.
Because OpenWrt explicitly sets `NO_LIBZSTD=1`, this upstream check
triggers a false positive whenever `libzstd` happens to be present in the
build staging directory. The probe only checks for a linkable `-lzstd`
and the `ELFCOMPRESS_ZSTD` macro in `elf.h`; it does not verify if
`libelf` actually requires it (OpenWrt configures elfutils
`--without-zstd`).
Fix this build failure by explicitly passing `feature-libelf-zstd=0` in
MAKE_FLAGS. This disables the auto-detection probe and prevents the
upstream Makefile from incorrectly enforcing a libzstd dependency.
Signed-off-by: Til Kaiser <mail@tk154.de>
Link: https://github.com/openwrt/openwrt/pull/25256
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Drop unused VLAN and statistics macros. Use the RTL931x LED control
register definition from the platform header.
Remove stale hash prototypes and redundant structure declarations.
Make file-local helpers static and place the LAG and L3 resync helpers
before their first callers so their forward declarations can be dropped.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/26839
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Linux 6.18 requires CONFIG_BRIDGE_NF_EBTABLES_LEGACY to build ebtables.ko.
Add the missing symbol to the module mapping used by kmod-ebtables.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
When kmod-nf-ipt is enabled, but kmod-ipt-core and kmod-nf-nat are not,
build fails due to a missing kernel module:
ERROR: module '/home/stijn/Development/OpenWrt/openwrt/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/linux-bcm27xx_bcm2708/linux-6.12.54/net/ipv4/netfilter/ip_tables.ko' is missing.
Fix this by adding the CONFIG_IP_NF_IPTABLES_LEGACY symbol.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
When kmod-nf-ipt6 is enabled, but kmod-ip6tables and kmod-ipt-nat are
not, build fails due to a missing kernel module:
ERROR: module '/home/stijn/Development/OpenWrt/openwrt/build_dir/target-powerpc64_e5500_musl/linux-qoriq_generic/linux-6.12.67/net/ipv6/netfilter/ip6_tables.ko' is missing.
Fix this by adding the CONFIG_IP6_NF_IPTABLES_LEGACY symbol.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
According to the help text in the kernel, NFT_COMPAT is required to use
x_tables extensions over the nf_tables framework.
Commit 1ebb8e3b6b ("netfilter: add kmod-nft-compat") claimed that this
is required by iptables-nft. Even if that is true, kmod-nft-compat
should not depend on kmod-nf-ipt, as this makes it impossible to build
nftables-only images with kmod-nft-compat enabled.
As iptables-nft depends on kmod-ipt-core, and kmod-ipt-core depends on
kmod-nf-ipt, kmod-nf-ipt will be enabled anyway if iptables-nft is
enabled.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
When building nftables-only images, with all iptables related packages
disabled, NETFILTER_XTABLES is not enabled in the kernel, as it is
enabled by kmod-ipt-core and kmod-nf-ipt.
This makes it impossible to build e.g. kmod-nf-nathelper-rtsp from the
xtables-addon package in the packages feed, without enabling unneeded
packages.
Add a new package kmod-nf-xtables that packages both the kernel modules
that are built when NETFILTER_XTABLES is enabled in the kernel, and add
dependencies to the new package in kmod-ipt-core, kmod-nf-ipt and
kmod-nft-compat.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
The patch fixes the following LTO linking problem:
```
/__w/openwrt/openwrt/openwrt/staging_dir/toolchain-mips64_mips64r2_64_gcc-15.3.0_musl/mips64-openwrt-linux-musl/bin/ld.bfd: /__w/openwrt/openwrt/openwrt/tmp/ccM29fOJ.ltrans6.ltrans.o: in function `handle_SCSS_change':
/__w/openwrt/openwrt/openwrt/build_dir/target-mips64_mips64r2_64_musl/valgrind-3.26.0/memcheck/../coregrind/m_signals.c:1165:(.text+0x239c): undefined reference to `my_sigreturn'
collect2: error: ld returned 1 exit status
```
Link: https://github.com/openwrt/openwrt/pull/26841
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
GCC 15 defaults to GNU C23, where bool, true and false are keywords.
This conflicts with the definitions in APEX's bundled Linux headers.
Pass -std=gnu17 through KCFLAGS to retain the language dialect used by
GCC 14. APEX appends KCFLAGS to KBUILD_CFLAGS and does not use the
OpenWrt TARGET_CFLAGS for compiling its sources.
Tested with GCC 15.3.0 using:
make package/apex/{clean,refresh,compile} V=99 FIXUP=1
All four APEX images built successfully.
Link: https://github.com/openwrt/openwrt/pull/26842
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
GCC 15 reports stack frames larger than 1024 bytes in seven AMDGPU
Display Mode Library objects on x86/generic. With warnings treated
as errors, these diagnostics stop the build.
Apply AMDGPU's existing 2048-byte frame warning threshold to those
objects. Keep the kernel-wide CONFIG_FRAME_WARN at 1024 bytes.
Link: https://github.com/openwrt/openwrt/pull/26822
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
When the Linux kernel is compiled with GCC 15, it supports the new
option CONFIG_RISCV_ISA_ZABHA. This is needed for a new RISCV extension.
I think none of our SoCs support it, deactivate support for it for now.
Activate it for sifiveu qemu already supports it.
Link: https://github.com/openwrt/openwrt/pull/26818
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This fixes the following compile error:
```
-Map=./build/binaries/sama7g5-sdcardboot-uboot-4.0.10.map --cref -static -z noexecstack --no-warn-rwx-segments -T elf32-littlearm.lds --gc-sections -Ttext 0x100000
CC device/sama7g5/sama7g5.c
In file included from include/string.h:10,
from device/sama7g5/sama7g5.c:12:
include/types.h:23:23: error: 'bool' cannot be defined via 'typedef'
23 | typedef unsigned char bool;
| ^~~~
include/types.h:23:23: note: 'bool' is a keyword with '-std=c23' onwards
include/types.h:23:1: warning: useless type name in empty declaration
23 | typedef unsigned char bool;
| ^~~~~~~
make[4]: *** [Makefile:371: build/device/sama7g5/sama7g5.o] Error 1
```
Upstream commit: https://github.com/linux4sam/at91bootstrap/commit/32bbb4f73a9f3e94326f709413c1b58baefdfbfa
Link: https://github.com/openwrt/openwrt/pull/26819
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The conversion to generic machine initialization moved the DT-dependent
watchdog quirk from device_tree_init() to an arch_initcall. This delays
hardware-assisted watchdog setup until after architecture initialization,
whereas affected boards require it early to avoid a watchdog reset.
Rename the quirk for RTL931x and register it in the SoC-specific
apply_quirks hook. Pass the flat DT to that hook and use libfdt to find
the watchdog node, since the live tree is not available at this stage.
The SoC configuration now provides the family restriction.
Validate the DT header before realtek_prom_init() consumes the flat tree
and refresh the hunk offsets in the following board patch.
Fixes: 7cc31af7bd ("realtek: convert to generic machine initialization")
Link: https://github.com/openwrt/openwrt/pull/26832
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The Zyxel NWA55AX PTP is a 802.11ax outdoor wireless bridge introduced in 2026.
Hardware
--------
| | |
|----------|----------------------------------------------------------------|
| SoC | MT7981B |
| RAM | 512 MB DDR4 |
| Flash | 256 MB SPI NAND, Winbond W25N02KVZEIR, 50 MB usable by OpenWrt |
| Ethernet | 1x RJ45 via SoC (1G/100M) |
| Wifi | 802.11ax via SoC |
| | - 5 GHz: 2x2:2SS, 9 dBi, HPBW 70°H / 22°V, internal detachable |
| | - 2.4 GHz: 1x1:1SS, 3 dBi, omni, internal soldered |
| Power | PoE 802.3af |
| LEDs | 1x multi-color |
| Button | 1x reset |
| Console | 115200n8 pin holes for GND/RX/TX/VCC @ 3V3 (VCC not needed) |
Installing OpenWrt via Web UI
-----------------------------
1. Download squashfs-factory.bin image, rename it to just factory.bin so it's short.
2. Boot the device, open its Web UI in a browser.
3. Upload factory.bin at Maintenance > File Manager > Firmware Package.
4. Wait for the device to reboot. Note that OpenWrt disables wifi by default.
If the device keeps rebooting into vendor firmware, you've hit the wrong A/B slot.
OpenWrt must be installed to the first slot (0), vendor firmware remains in the second slot (1).
You can flash any Zyxel firmware update to activate the respective other slot,
e.g. flash from 7.11 to 7.12, or from 7.11 to 7.10.
Afterwards another upload of OpenWrt factory.bin will succeed.
Installing OpenWrt via serial console
-------------------------------------
1. Attach to GND/RX/TX pins after opening the case and removing the antenna panel.
2. Serve initramfs-kernel.bin on TFTP 192.168.1.66.
3. Power on the device.
4. Interrupt U-Boot by pressing `Esc,Esc` when prompted.
5. Set device TFTP config:
- `atna 192.168.1.88 ; atnf initramfs-kernel.bin`
6. Boot from TFTP:
- `atns "192.168.1.66 ; tftpboot ; setenv fdt_high 0xffffffffffffffff ; bootm"`
7. Activate the first A/B slot:
- `zyxel-bootconfig /dev/mtd9 set-image-status 0 valid`
- `zyxel-bootconfig /dev/mtd9 set-active-image 0`
8. Use SCP to copy `squashfs-sysupgrade.bin` to the device, then run `sysupgrade`.
9. Wait for the device to reboot. Note that OpenWrt disables wifi by default.
Restoring factory firmware
--------------------------
OpenWrt installs into the first A/B slot, while vendor firmware remains in the second slot.
You can activate the second slot (1) from within OpenWrt:
zyxel-bootconfig /dev/mtd9 get-status
zyxel-bootconfig /dev/mtd9 set-image-status 1 valid
zyxel-bootconfig /dev/mtd9 set-active-image 1
reboot
MAC addresses
-------------
OpenWrt uses the same MAC addresses as vendor firmware and chassis labels.
The base address is read from the `mrd` flash partition.
- Ethernet: base address + 0
- Wifi 2.4G: base address + 1
- Wifi 5G: base address + 2
Notes/Quirks
------------
- The A/B partition layout has two slots of 50 MB each. OpenWrt installs into
the first slot, so you need to make sure to flash from within the second slot.
- The vendor Web UI requires the firmware image filename to be of a certain length,
otherwise you get the following error: `Warning ULCGI unalbe to parse CGI query!`.
Shorten the full squashfs factory image name to just factory.bin and it'll work.
- The model code `a4 e1` was found in tmp/root/upper/rw/fwversion,
extracted from clone_tmp.tar.gz from a vendor diaginfo dump.
Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/25510
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Add the ramdisk feature and build an initramfs FIT image (-initramfs.itb) that
combines the initramfs kernel with the board's device tree.
mkits.sh requires a load address, so set KERNEL_LOADADDR per SoC: 0x40200000
for JH7110 and 0x84000000 for JH7100, matching the existing JH7100 boot script.
The image code names compiled dtbs after the basename of DEVICE_DTS, so the
starfive/ prefix made the FIT step look for a dtb that does not exist. Set
DEVICE_DTS_DIR to the starfive DTS directory, drop the prefix from DEVICE_DTS,
and update the SD card recipe to copy the dtb from DEVICE_DTS_DIR.
Add squashfs to FEATURES and enable CONFIG_BLK_DEV_LOOP, which fstools needs to
set up the overlay after the squashfs on the root partition. Also add
rootfs-part, so that TARGET_ROOTFS_PARTSIZE is available when ext4 is not
selected; otherwise the SD card generator script gets an empty rootfs size and
fails.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Move MAX_INTF_MTUS to otto_dsa.h, where it sizes the interface MTU
arrays. This was the only definition in l3_limits.h, so remove the
header and both includes.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/26827
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Rename all static functions in otto_dsa.c and update their callers and
callback registrations. Use otto_dsa_ for shared functions,
otto_dsa_83xx_ for functions specific to RTL838x and RTL839x, and
otto_dsa_93xx_ for those specific to RTL930x and RTL931x.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/26827
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>