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>
The longterm plan is to drop common.c and the rtlXXXX.c files
and merge their contents into otto_dsa.c. As a first step
rename dsa.c to otto_dsa.c and rtl-otto.h to otto_dsa.h so the source
and header share the same driver-specific basename. Update the include
directives, header guard and Makefile object list to match.
Assisted-by: ChatGPT (OpenAI GPT-6 Astra)
Link: https://github.com/openwrt/openwrt/pull/26827
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
ieee80211_lookup_ra_sta() looks up the receiver of a frame sent on an
AP_VLAN interface in the whole BSS. A unicast frame that the bridge of
one VLAN floods to its AP_VLAN port is therefore sent to a station of
another VLAN of the same BSS, bypassing the bridge and firewall of that
VLAN. With wifi-vlan/wifi-station (PPSK) or RADIUS assigned VLANs, a
client can reach clients of the other VLANs on the same SSID
(CVE-2026-98822).
Backport commit 7f93ca31f7fd ("wifi: mac80211: prevent AP VLAN tx from
other interfaces") from wireless, and refresh the line numbers of the
later patches that change ieee80211_i.h and tx.c.
Link: https://lists.openwall.net/linux-cve-announce/2026/10/18/382
Signed-off-by: Miroslav Rýzek <miroslav.ryzek@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26810
Signed-off-by: Robert Marko <robimarko@gmail.com>
The kernel offloads a new ETS qdisc from its init, before the rest of
its setup, and destroys it again when a later step fails, such as a rate
estimator the kernel refuses. The ETS it was to replace then stays in
place. The driver dropped the old ETS and the TBF and RED qdiscs on its
bands as soon as the new ETS arrived, so after such a failure none of
them was offloaded any more.
Keep the ETS that is replaced, with the qdiscs on its bands, until it is
destroyed, and set it up again when the new ETS goes first.
On an RTL9303 with the egress of a 10G port held to 100 Mbit/s and
400 Mbit/s of UDP offered to it, an ETS with a RED of 4/8 pages on the
band of the load and a TBF on another band, a root ETS replace that the
kernel refused for its rate estimator left all three in software, and a
ping through the RED band took 56.7 ms. With this change all three stay
offloaded and the ping takes 0.31 ms.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26696
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
An offloaded RED reports no statistics of the hardware, so tc -s shows
the qdisc as offloaded with only the traffic the CPU sent through it
and none of the drops.
The RTL930x counts the packets each egress queue drops in a 16 bit
counter per port and queue, which wraps. While a port has RED, read its
counters every 50 ms, often enough to add them up at up to 1.3 million
drops per second and queue, and report the drops of the queues of a RED
as its drops and overlimits, as the software RED counts its early and
forced drops in both. The hardware does not tell the two apart, so the
RED statistics of their own stay as they are. A root RED also reports
the bytes and packets sent by the port, less those the CPU sent through
the qdisc, which the kernel counts itself. The hardware has no such
counter per queue, so a RED on a band of an ETS reports its drops only.
Each RED counts from the time it is offloaded. The counters are added
under the lock of the root qdisc, which the kernel holds when it updates
them on enqueue and dequeue.
On an RTL9303 with the egress of a 10G port held to 100 Mbit/s and
400 Mbit/s of UDP offered to it, a root RED of 4/8 pages reported
314206 drops where iperf3 counted 313985 lost datagrams, and 100683
packets sent for 100413 received. A RED of 4/8 on the band of the load
reported 314246 drops for 314023 lost. With 2000 pings of 1000 bytes
sent by the CPU out of the port, the packets sent of a root RED grew by
2111.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26696
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
RED is offloaded at the root only, with one setting for all queues of
the port. The usual arrangement, RED on some of the queues behind a
scheduler, stays in software.
The switch holds the thresholds per queue, in one table for all ports,
and enables RED per port. Keep the setting each port wants per queue
and offload a RED that is the child of a band of the offloaded ETS to
the queue of that band. A queue without RED gets both thresholds at its
tail drop threshold: with RED enabled on the port the row replaces the
tail drop threshold, and a row that never drops would let one queue
take the whole packet buffer. Such a queue drops at that threshold
rather than at the congestion limit of the ingress port, so it holds
less of a burst than without RED, and the driver warns about it once.
As the table is shared and RED is enabled for all queues of a port at
once, the ports with RED must agree on the whole table. The setting of
all queues of a port is put together from its REDs and then checked and
written at once, so a port with the same REDs as another is offloaded
too. A port that wants a different table is refused, and a port whose
remaining settings no longer match the table loses its offload instead
of running RED on queues it did not ask for. As the hardware follows
the REDs that are offloaded at the time, a RED that moves to software,
such as a root RED with ECN replacing the ETS, leaves nothing behind.
Every RED keeps its handle and its settings, at the root as on a band.
The kernel keeps a child the driver refuses and puts the noop qdisc,
which drops everything, in place of a deleted one, so a RED stays out of
the hardware once a child was grafted to it, until a change with a limit
replaces that child with a byte FIFO. A RED on a band also stays out
while the ETS is out of the hardware, and its settings are written again
when the ETS returns. The ETS takes a RED on a band as a child the
hardware runs, and leaves the hardware while that RED cannot be
offloaded; the REDs of the bands are released when the ETS goes or
another one takes over. A root RED that replaces the ETS is set up while
the ETS is still there, so when that RED goes again, as it does when the
rest of its setup fails and the kernel keeps the ETS, the ETS is set up
again in full.
A RED that replaces another RED, at the root or on a band, keeps the
one it replaces until that one is destroyed, and sets it up again when
the new RED goes first.
On the setup of the root RED, with an ETS on the port, RED 16/64 on the
band of the load gave 1.6 ms and 4/8 gave 0.3 ms. With RED only on
another band, the queue of the load dropped at its own tail drop
threshold of 52 pages and took 1.4 ms instead of 57 ms.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26696
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
RTL930x has a simple RED engine at the egress of a port: two thresholds
in pages of 256 bytes and a drop rate. Measured on an RTL9303, a queue
below the lower threshold drops nothing, between the thresholds it drops
with one fixed probability of rate / 1023, and above the upper threshold
it drops everything. The engine is only consulted when the egress drop
stage of the port looks at the egress queue rather than at the
congestion state of the ingress port, which is not the reset setting.
Egress drops also wait until the packet buffer as a whole holds more
pages than the system utilisation threshold. Its reset value of 768
pages kept a queue under RED near 18 ms at 100 Mbit/s whatever the
thresholds of the queue. Set it to 1, as the vendor SDK does at the end
of its initialisation. A port on the reset reference drops the same
with either value.
Offload a RED qdisc at the root of a port to it: min and max become the
two thresholds, the probability becomes the rate, and the port is
switched to the egress queue reference for as long as the qdisc exists.
ECN marking cannot be offloaded, and neither can a probability above
255 / 1023 or a limit below max, as the hardware queue fills up to max
whatever the limit. The thresholds are one table for the whole switch,
so a second port can only use the parameters already in use.
A qdisc that replaces another one is set up before the old one is
destroyed. The offload remembers the handle of its qdisc, and only that
qdisc takes it away or gets statistics for it, so the destroy of the
old qdisc leaves the offload of the new one alone. The RED that is
replaced is kept until it is destroyed, so when the new qdisc goes
first, as it does when the rest of its setup fails and the kernel keeps
the old one, the old RED is set up again.
On an RTL9303 with the egress of a 10G port held to 100 Mbit/s and
400 Mbit/s offered to it, a ping through the same queue took 57 ms with
tail drop, and 1.6, 0.3 and 5.0 ms with RED thresholds of 16/64, 4/8 and
100/200 pages.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26696
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
otto_l3_fib4_flags_set() and otto_l3_fib6_flags_report() report the
offload state of a route from the route alone. Pass the L3 controller
to both and update their callers, so that the flags can later depend
on the state of the controller.
No functional change.
Signed-off-by: João Silva <jgc3silva@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26740
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The switch routes only frames addressed to a router MAC. On IPv6 the
driver registers one only from otto_l3_fib_add_v6(), for a route with
a gateway. Connected prefixes and local addresses are trapped by
otto_l3_fib_trap_v6(), which never registers the MAC of their device,
and defaults and RA gateways are not offloaded. On an interface that
has only IPv6, nothing gives its MAC a router MAC entry, so the switch
does not route what arrives on it, and the trap rows for its addresses
and prefixes are never looked up.
Take the router MAC of the device in otto_l3_fib_trap_v6() for an
on-link route through a switch port, once its trap row is installed,
so that a destination left without its row does not have the MAC
start routing past it. The row now goes through
otto_l3_route_install(), which also reports a failed write: the row is
taken back and the MAC is not taken. Do it also when the destination
already traps, so that a replaced entry still registers it. The entry
follows the devices that have the MAC, not the route, so nothing is
released when the route is deleted.
Taking the MAC is best effort. Without it the switch does not route
what arrives on that device, but what arrives on any other router MAC
is still looked up against the trap row, so the row stays whether or
not the MAC could be taken.
Signed-off-by: João Silva <jgc3silva@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26740
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The router MAC table decides which frames reach the RTL930x route
tables, and nothing shows what it holds. Add a read-only router_macs
file to the realtek_otto_l3 debugfs directory that prints every valid
entry, decoded and raw.
The dump reads the hardware table through a new router_mac_dump
operation, under the register lock that router MAC updates hold.
Signed-off-by: João Silva <jgc3silva@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26740
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The parent PLL of nss_crypto_clk_src does not run until the PPE
driver enables its clock. This resulted in the following error
when calling clk_set_rate():
nss_crypto_clk_src: rcg didn't update its configuration.
Fixed this issue by adding CLK_OPS_PARENT_ENABLE.
Also fixed the frequency of nss_crypto_clk. It should be 300 MHz.
(1200 MHz main, post-divided to 600 MHz, then pre-div 2).
Fixes: 16d110a ("qualcommax: replace NSS-DP DTSI with PPE DTSI")
Assisted-by: deepseek-harness:deepseek-v4-flash
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://github.com/openwrt/openwrt/pull/25150
Signed-off-by: Robert Marko <robimarko@gmail.com>
Let device-tree thermal zones use the Realtek PHY temperature sensor.
Pending 744 sets HWMON_C_REGISTER_TZ in the hwmon channel info; without
it the RTL8261N sensors never become thermal zones, so the XGS1250-12
B1 cooling maps in rtl9302_zyxel_xgs1250-12-common.dtsi have no input.
Mainline declined it because its only user, RTL8261N support, is
OpenWrt's pending 742, so 744 sits next to it and 743 and goes upstream
with them.
Backport 787, applied to net-next as d5b5ab50d2f6 for v7.5, returns
MDIO read errors from the hwmon read instead of reporting them as
temperatures.
Tested on a B1 with Linux 6.18.55 and the thermal-zone change alone:
phy24-thermal, phy25-thermal and phy26-thermal register and drive the
fan. 787 is build-tested only.
This change was prepared with AI assistance (Claude Opus 5.5 and Sol
6.1), which also helped run the tests on my switch.
Signed-off-by: Hleb Shauchenka <me@marleb.org>
Link: https://github.com/openwrt/openwrt/pull/26301
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
On the B1 revision, GPIO 11 selects a reduced fan drive that cannot
start the fan from rest, so the fan never spins. Zyxel's firmware
drives GPIO 5 for full speed and never raises both lines together.
Point the B1 gpio-fan at GPIO 5 and hold GPIO 11 low with a GPIO hog.
Keep the cooling device binary: off, or full speed at an estimated
8000 RPM. A1 is unchanged.
Tested on a B1: with GPIO 11 high the tachometer on GPIO 1 showed no
pulses; with GPIO 5 high it counted 868 edges in 4000 reads. With the
PHY thermal-zone patch, an emulated 85 C on phy24 switched the fan on
and clearing it switched the fan off.
This change was prepared with AI assistance (Claude Opus 5.5 and Sol
6.1), which also helped analyse Zyxel's firmware and run the tests on
my switch.
Signed-off-by: Hleb Shauchenka <me@marleb.org>
Link: https://github.com/openwrt/openwrt/pull/26301
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The Zyxel WAX300H is an 802.11ax access point based on the MediaTek
MT7981B. It shares the flash layout, bootloader, dual-image handling
and image recipe of the NWA50AX Pro, but has an MT7531 switch with four
Ethernet ports instead of a single 2.5G PHY, and uses its own model ID
("84e1").
Hardware
--------
SoC: MediaTek MT7981B
RAM: 512M DDR4
FLASH: 256M SPI-NAND
ETH: 4x Gigabit Ethernet (MediaTek MT7531)
- Uplink (PoE-in)
- LAN1 (PoE-out passthrough, ~5W, only when powered by 802.3at;
hardware-controlled)
- LAN2
- LAN3
WiFi: MediaTek MT7981B + MT7976C (2.4/5GHz 802.11ax 2x2)
BTN: 1x Reset
LED: 1x Multi-Color (RGB)
Power: 802.3af/at PoE
All four ports are bridged into "lan". The stock firmware disables both
radios when powered by 802.3af, OpenWrt does not.
UART Console
------------
Externally accessible on the "CONSOLE" header.
Settings: 3.3V TTL, 115200 8N1
Layout: GND TX RX 3.3V (don't connect, marked with a triangle)
Installation Web-UI
-------------------
The device uses a dual-image setup and OpenWrt can only be installed as
image 0. When the currently running stock firmware is image 0, OpenWrt
will be installed as image 1, fail to boot and the device returns to
stock firmware. If this happens, install any version of stock firmware
so that it runs as image 1, before installing OpenWrt. Alternatively, if
there already is a valid stock firmware in image 1, the "debug
dual-image show" and "debug dual-image set boot-image image1" commands
can be used in the stock CLI via serial/SSH/telnet to switch to image 1.
* Rename the OpenWrt factory image to a shorter name, for example
"openwrt.bin" (the stock firmware has a character limit)
* In the web interface, go to "Maintenance" -> "File Manager" ->
"Firmware Package" (or click the link next to "Firmware Version"
under "Device Information" on the dashboard)
* Under "Upload File" browse to the renamed OpenWrt factory image and
click on "Upload"
The factory image is a UBI image wrapped in an outer FIT carrying the
device model ID ("84e1"), which the stock firmware checks before
accepting it. On first boot, zyxel-bootconfig marks the OpenWrt image
as the selected one so the bootloader keeps booting it.
Switch Boot Image
-----------------
OpenWrt to stock: "zyxel-bootconfig /dev/mtd9 set-active-image 1"
Stock to OpenWrt: "debug dual-image set boot-image image0"
Unbrick / Revert to Stock with the Boot Module
----------------------------------------------
* Disconnect the device from power
* Configure your machine to 192.168.1.103/24 and start a TFTP server
* Put the stock firmware image into the TFTP server root and rename it
to "ZLD-current"
* Establish a serial connection to the device through the console port
* Connect the device to power
* When prompted, press a key to abort automatic boot and enter debug
mode
* Use the "atnz" command to flash the firmware image
* Use the "atgo" command to boot from the newly flashed image
MAC addresses
-------------
Uplink: base MAC (mrd partition, offset 0x1fff8)
LAN1: base MAC + 1
LAN2: base MAC + 2
LAN3: base MAC + 3
2.4GHz: base MAC + 4
5GHz: base MAC + 5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mark Chiou <chiouss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25506
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
Move the NWA50AX Pro image settings into Device/zyxel_filogic_common,
so other Zyxel MT7981B access points with the same flash layout and
factory image format can reuse them.
Rename Build/zyxel-nwa-fit-filogic to Build/zyxel-fit-filogic, after
the script it calls, as it is not specific to the NWA series. It had
the model IDs of the factory image's "compat-models" list hardcoded.
Take them from the new ZYXEL_MODEL_IDS device variable instead, e.g.
"80e1 81e1". The common recipe clears it, as device variables are not
reset between devices. The NWA50AX Pro factory image is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mark Chiou <chiouss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25506
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The callers pass the factory image's "compat-models" list as raw bytes,
already padded to the five model IDs the stock firmware images carry,
with "ff ff" for the unused ones, e.g. "59 e1 ff ff ff ff ff ff ff ff".
Take a list of one to five model IDs of four hex digits each instead,
e.g. "80e1 81e1", and split them into bytes and pad the list in the
script. Malformed IDs and empty or too long lists now fail the build,
instead of producing a factory image the stock firmware rejects.
Update both callers, the NWA50AX Pro on mediatek and the NWA110AX and
NWA210AX on qualcommax. Their factory images are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mark Chiou <chiouss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25506
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
When the bootloader leaves the NSS crypto RCG root enabled, the PPE
node's assigned-clock-rates switches it to the NSS crypto PLL while the
PLL is still off, and the RCG does not take the new configuration:
nss_crypto_clk_src: rcg didn't update its configuration.
Set CLK_OPS_PARENT_ENABLE on the IPQ8074 nss_crypto_clk_src so the
parents run across the switch.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25372
Signed-off-by: Robert Marko <robimarko@gmail.com>
wg's config parser refuses the whole configuration for one bad value,
so since the ucode rewrite a peer section holding one value the parser
refuses (an endpoint hostname that does not resolve, a malformed
preshared key, a keepalive that is not a number) takes the whole
interface down, and netifd's retry keeps it down until the section is
fixed (#24511).
This checks each peer value against wg's own grammar while the
configuration is built, and a refused one costs its line instead of the
tunnel: an endpoint that does not resolve omits its Endpoint= line (the
peer stays installed and reachable inbound, and wg fills the endpoint in
from the first authenticated handshake, as the watchdog already relies
on), a malformed preshared key or a keepalive that is neither 0-65535
nor off omits its line, and a public_key that is not a WireGuard key
skips the peer. Every refusal is logged with the interface, the peer's
uci section and public key, and the refused value, so the operator can
find the offending section; a peer section without a public_key is
skipped and logged too. The preshared key warning stays valueless,
because a key is a secret. The happy path is unchanged: one atomic
syncconf, peer removals included. PKG_RELEASE is bumped so users on
main receive it.
Reviewer questions, answered:
- a malformed PresharedKey omits its line only, the peer keeps running
without it, an optional value fails open on its line rather than
closed on the peer;
- AllowedIPs entries stay unvalidated here, wg remains the judge,
because a false omission would cost routes;
- endpoint names resolve through nslookup at each setup, ucode has no
getaddrinfo and wg set cannot run from the handler without touching
the live interface.
Fixes#24511.
Assisted-by: OpenCode:mistral-large-4-0
Signed-off-by: Guy Godfroy <guy.godfroy@gugod.fr>
Link: https://github.com/openwrt/openwrt/pull/26543
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for the Lite-On WPX8324, an IPQ5018 indoor Wi-Fi 6 access
point. The same board is sold as WPX8324 (full hardware) and WPX8324-BT
(with or without PoE). The -BT variants ship without TPM, USB and the
Bluetooth antenna, but keep the PCB pads for them, so a single device
tree covers all variants.
Hardware specification:
- SoC: Qualcomm IPQ5018, dual-core Arm Cortex-A53
- RAM: 512 MiB DDR3
- Boot flash: 16 MiB SPI NOR (Macronix MX25U12835F)
- Data flash: 128 MiB SPI-NAND (W25N01GW)
- Wi-Fi: IPQ5018 2x2 2.4 GHz + QCN6122 2x2 5 GHz (AX3000)
- Ethernet: 1x Gigabit LAN (internal PHY), 1x 2.5G WAN (QCA8081)
- LEDs: orange status (GPIO18), blue 5 GHz (GPIO19), green 2.4 GHz (GPIO39)
- Button: reset (GPIO29)
- UART: ttyMSM0 on GPIO20/21, 115200 8N1
- Power: 12 V DC; PoE on the WPX8324-BT PoE variant
Flash instructions:
The bootloader is U-Boot 2016.01 with a 5 second autoboot delay and the
IPQ5018# prompt. Serve the images from 192.168.1.100 and use 192.168.1.3
for the device:
setenv ipaddr 192.168.1.3
setenv serverip 192.168.1.100
tftpboot 0x50000000 openwrt-qualcommax-ipq50xx-liteon_wpx8324-initramfs-uImage.itb
bootm 0x50000000
Then install openwrt-qualcommax-ipq50xx-liteon_wpx8324-squashfs-sysupgrade.bin
from LuCI (System -> Backup / Flash Firmware) or with sysupgrade(8).
The NAND rootfs partition starts at 0x80000 and is 0x3e00000 bytes long;
only sysupgrade should write it.
MAC address layout:
The base MAC is stored in 0:ART at offset 0. LAN uses the base address,
WAN is base + 1, 2.4 GHz is base + 2 and 5 GHz is base + 3, applied
through the hw_mac_addr nvmem cell.
Signed-off-by: Ayra Hikari <ayrahikari@linuxmail.org>
Link: https://github.com/openwrt/openwrt/pull/26676
Signed-off-by: Robert Marko <robimarko@gmail.com>
Back-to-back RTL930x SerDes transactions can return incorrect data or be
dropped by the hardware. Add a 10 microsecond delay after each completed
read or write, matching the SDK's transaction pacing. Make the delay
configurable per variant so RTL931x and other SoCs retain their existing
timing.
Tests on a Zyxel XGS1210-12 B1 reproduced stale reads and dropped writes.
With a 10 microsecond delay after the busy poll, no wrong accesses were
seen in 14 million bus test pairs, versus 2,501 in 7 million without it.
Under a ping flood, SerDes setup had no stuck states in 309 trials with
the delay, versus 6 in 318 without it. All 520 warm reboots with the delay
passed traffic.
Link: https://github.com/openwrt/openwrt/issues/26698
Suggested-by: Ivan Rainbolt <ivan@github.ivanthegeek.com>
Tested-by: Anatoliy Oleinikov <admin@wizle.tech>
Link: https://github.com/openwrt/openwrt/pull/26775
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The LM63 driver accepts non-decreasing lookup table values.
Replace the unused individual temperature points with a common loop.
Keep the original OEM fan curve, PWM frequency and hysteresis.
Signed-off-by: Flo Mee <fjkmeereis@web.de>
Link: https://github.com/openwrt/openwrt/pull/26771
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Add the PCIe0 (Gen3) and PCIe1 (Gen2) controllers and their corresponding
PHYs for AN7583. Enable both controllers in the shared AN7583 EVB base
device tree, with an MT76 Wi-Fi device described under each controller.
Refresh the Gen3 PCIe PHY backport to upstream v5 and the AN7583 USB
and Gen2 PCIe PHY backports to v4. Backport the required PCIe controller,
clock, reset and SCU SerDes support, and update the device tree bindings
and configuration accordingly.
Adapt the AN7581 USB monitor clock selectors to the updated binding,
which no longer provides the old constants header.
Keep the USB SerDes selection before U3 calibration and additional USB
mode handling in a separate downstream kernel patch, so these changes
remain explicit when refreshing the upstream backports.
Signed-off-by: Zhengping Zhang <zhengping.zhang@airoha.com>
Link: https://github.com/openwrt/openwrt/pull/25376
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Commit 74238413b1 ("ramips: disable CONFIG_LIST_HARDENED on MT7620")
disabled it after the crashes in #16396, whose cause was unknown. Their
traces show the MIPS 24K EPC erratum: ra in the first 32 KiB of KSEG0
and the EPC in the segment below (0x7...). The checks only made the
crashes more likely, with more cold code and calls in those 32 KiB.
The mt76x8 subtarget kept them, and the MT7628 does not show the fault.
With kernel and module code kept out of the first 32 KiB of a segment,
it can be enabled again, as on the other ramips subtargets. On a
TL-WPA7510 v2 it adds 50 KiB of kernel text, 13 KiB to the compressed
kernel and 2 KiB to the root file system, the modules' checks.
Tested on a TL-WPA7510 v2 booted from RAM: 10 minutes of the reproducer
from #16396, a loop of `iw <ap> station dump` on both access points
(2200 rounds), together with exec-heavy load (24.5k rounds), without an
oops or a warning. Tested on a TP-Link Archer C5 v4 by Mieczyslaw
Nalewaj.
Suggested-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Tested-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
The 24KEc of the RT5350 shows the same EPC fault as the MT7620's,
measured from user space: about 38 wrong EPCs a second with J and with
JAL from 0x20003f90 to 0x22e70040, none with JALR. rt305x also links
the kernel at 0x80000000, so turn RALINK_PAD_FIRST_32K on for
SOC_RT305X too. The
padding is freed again as on mt7620, and the module allocator already
keeps module code out of it on every 24K core.
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
The first 32 KiB of the kernel image are kept free of code because of
the MIPS 24K EPC erratum, and the module allocator keeps module code
out of them, so hand them back to the page allocator as ordinary data
pages. The first page stays reserved, as the kernel reserves it on
every CPU, which leaves 28 KiB. Nothing is freed if the exception
vectors are in the padding.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
[Marco: drop the second message, free_reserved_area() logs one; say
what keeps code out of the pages; keep the first page; move it from
mt7620.c to of.c, for every SoC with RALINK_PAD_FIRST_32K; add it as a
patch file]
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
MIPS 24K cores can save a wrong EPC for an interrupt taken at the
target of a J or JAL in the first 32 KiB of a 256 MiB segment, and the
return from the interrupt then goes to the segment below. This was
measured on the 24KEc of an MT7620A and an RT5350 and on the 24Kc of an
AR9132 and a QCA9531, though not on the 24KEc of an MT7628.
OpenWrt's module allocator (301-02) runs module and BPF JIT code from
the KSEG0 address of the pages it gets, and falls back to vmalloc,
whose area starts at 0xc0000000. On ath79 the kernel starts at
0x80060000, and what the early boot allocations leave free of the RAM
below it goes to the page allocator; on mt7620 the next commit frees
most of the padding that head.S puts there.
Add 301-03: on the 24K cores known to have the fault, those with a PRId
below 0x00019655 (every 24Kc, and the 24KEc before V5.5, which leaves
out the MT7628), hold the blocks the page allocator offers in the first
32 KiB of a segment and ask again, and take the vmalloc fallback from
the rest of the first segment of its area. module_finalize() warns if
module code starts there all the same. Other cores keep the allocator
as it is.
Tested on a TL-WPA7510 v2 with the whole series, in a test build that
took code blocks from the freed movable pages: the seven freed pages
were offered to each 4 KiB block and held, 28 times in all, and none of
9 blocks landed in the first 32 KiB. With the test of the address
switched off, 4 of 9 blocks landed at 0x80004000-0x80007000.
Without the test code: 24 modules, none in a first 32 KiB, in 15 boots
and after 50 rounds of reloading five modules, and 10 minutes of
exec-heavy load without an oops or a warning.
Co-developed-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
Patches 330 and 331 avoided direct JALs at the call sites that had been
seen to crash: the random helpers of get_random_u32_below() and
blkcg_maybe_throttle_current() in resume_user_mode_work(). They only
applied to the mt7620 subtarget, and they did not cover the jumps in
random.c that crash the boot in try_to_generate_entropy().
With the kernel code out of the first 32 KiB, no jump is left where the
erratum gives a wrong EPC, so drop them. 332, which skips
arch_align_stack() on exec, stays: it is an optimization of its own,
not one of the jump workarounds.
Tested on a TL-WPA7510 v2 with the whole series: no oops in 15 boots,
nor in 10 minutes of exec-heavy load (24.5k rounds) together with the
reproducer from #16396.
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
The MIPS 24K core of the MT7620 can save a wrong EPC for an interrupt
taken at the first instruction of a J or JAL target, when the jump is
in the first 32 KiB of a 256 MiB segment. The return from the
interrupt then goes to 0x7... instead of 0x8..., and the kernel dies
with "Unable to handle kernel paging request". ramips links the kernel
at 0x80000000, so its first 32 KiB hold such jumps.
The fault was measured without Linux, from a program started by the
boot loader, and the 24Kc of an AR9132 shows it too. MediaTek's SDK
kernels leave the same 32 KiB empty for the MT7620 and the MT7628, but
an MT7628 doesn't show the fault, so the padding comes with
RALINK_PAD_FIRST_32K. It has no prompt, so it cannot be switched off,
and is on for SOC_MT7620 kernels without the MT76x8 pin controller: the
mt7620 subtarget, not mt76x8.
On the TL-WPA7510 v2, 6 of 17 boots crashed in
try_to_generate_entropy(). With the kernel code moved behind
0x80008000, no J or JAL is left in the first 32 KiB; with the whole
series, 15 boots and 10 minutes of load gave no oops.
Suggested-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26650
Signed-off-by: Robert Marko <robimarko@gmail.com>
The RTL8214QF is a quad 1000BASE-X fibre PHY with clause 37 registers.
Realtek documents it with a QSGMII interface; two of them can also share
one XSGMII SerDes, as on the Acorid GLS7700-24F8G-4X, where the "master"
carries all eight ports and the "slave" reaches the switch through it.
The generic PHY driver treats it as a copper PHY.
Add a driver with 1000BASE-X features, clause 37 autonegotiation and the
chip setup, without which autonegotiation never completes. The setup
tables are the net effect of the vendor SDK patch sequence, measured by
register dumps after a cold power-on and after the vendor firmware
setup; 11 differences in registers that ignore writes are left out. The
internal SerDes are then reset like the vendor SDK does.
The chip is set up through its first port, which must be described in
the device tree, with the MDIO bus locked for the whole setup. Only a
successful setup is recorded, so after an error the next port of the
chip tries again. Resets and the receiver hold are released also on
errors.
The link between the two chips of a pair only trains when they leave
reset, so it needs a PHY reset from the SoC before probing. The vendor
SDK's RX calibration of that link and its fibre RX watchdog are not
needed: without them the link was in sync in every boot, and in 80 link
down/up cycles the watchdog condition never occurred.
Tested on an Acorid GLS7700-24F8G-4X (4x RTL8214QF in pairs); the
QSGMII setup of a single chip is untested.
Signed-off-by: Anatoliy Oleinikov <admin@wizle.tech>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/26748
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The RTL8214QF is a quad 1000BASE-X fibre PHY that reaches the switch
through an XSGMII SerDes, two of them per SerDes. Unknown PHYs are
polled as SerDes attached, and with that MAC type the switch never
sees the link of these ports. Poll it over MDIO as a GE PHY, as the
vendor SDK does. It has no giga lite mode.
The PHY type table is shared by RTL930x and RTL931x; tested on RTL930x
only, an Acorid GLS7700-24F8G-4X (4x RTL8214QF).
Signed-off-by: Anatoliy Oleinikov <admin@wizle.tech>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/26748
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
rtl821x_package_join() ignores the result of devm_phy_package_join()
and then dereferences the shared data of the package, which is NULL
when joining failed, e.g. for lack of memory. Its own result, which
port of the package joined (RTL821X_JOIN_*), is not used by any
caller.
Return the error of devm_phy_package_join() instead, and fail the probe
of the PHY with it. The join counter and the RTL821X_JOIN_* values go
away, as nothing uses them.
Signed-off-by: Anatoliy Oleinikov <admin@wizle.tech>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/26748
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
In addition drop compatibility patch for GCC 14. The issue the patch
solved was fixed upstream in mbed TLS 3.6.6, by commit
https://github.com/Mbed-TLS/mbedtls/commit/292b96c0a69016a6d99ce324837a9e96d59e21f6.
This release of Mbed TLS provides bug fixes and minor enhancements.
This release includes fixes for security issues.
Security fixes:
* Fix resource leaks in TLS 1.3 transform setup when a setup step fails after allocating cipher
contexts or importing the encryption traffic key. (CVE-2026-93843)
* Fix a memory leak when a TLS 1.3 server receives a valid session ticket but has no compatible PSK
key exchange mode enabled. (CVE-2026-115491)
* Fixed a security issue in TLS 1.2 session resumption by rejecting session tickets issued for a
different TLS version. (CVE-2026-93831)
* Fix TLS 1.3 server handling of the second ClientHello after a HelloRetryRequest.
(CVE-2026-116375)
* Fix a TLS client vulnerability caused by accepting the TLS 1.3 version (0x0304) in the
legacy_version field of a TLS 1.2 ServerHello. (CVE-2026-115490)
* Fix incorrect bounds check while parsing ECDHE-RSA/ECDHE-ECDSA ClientKeyExchange in TLS 1.2
servers.
* Document that CRL name matching does not fully normalize names. (CVE-2026-116462)
* Fix a remotely exploitable buffer overflow in TLS in some configurations where ECJPAKE is
enabled. (CVE-2026-90469)
* Fix an out-of-bounds read when parsing truncated TLS 1.2 ECJPAKE peer messages.
* When parsing a CRL, if the chain is not empty and the allocation of a new element fails, do not
clear an existing element. (CVE-2026-90475)
* Fix a client-authentication bypass in TLS servers that use SNI to support
several virtual hosts with different client-authentication policies and
use session resumption. (CVE-2026-93776)
* Fix a side channel in the p256-m implementation of ECDH/ECDSA on NIST P-256. (CVE-2026-93845)
* Build symbol MBEDTLS_PK_DECRYPT_MAX_ITERATIONS has been added to
limit the maximum number of iterations for the PBKDF2 algorithm used when
decrypting a PKCS#8 encrypted private key in PK module. (CVE-2026-50582)
* Fix a Spectre v1 side channel in AES and GCM acceleration. (CVE-2026-115493)
* Fix a Spectre v1 side channel in non-authenticated ciphers that can leak many key bits to
powerful local attackers. (CVE-2026-93833)
* Fix possible Spectre v1 side channels in mbedtls_cipher_setkey(), mbedtls_cipher_crypt(),
mbedtls_cipher_auth_encrypt_ext() and mbedtls_cipher_auth_decrypt_ext() when
MBEDTLS_USE_PSA_CRYPTO is enabled. (CVE-2026-93833)
* Fix possible Spectre v1 side channels in mbedtls_cipher_auth_encrypt_ext() and
mbedtls_cipher_auth_decrypt_ext() when MBEDTLS_NIST_KW_C is enabled. (CVE-2026-93833)
* Fix a Spectre v1 side channel in ECDSA signature that may leak the secret key to powerful local
attackers. (CVE-2026-93835)
* Fix a Spectre v1 side channel in ECC operations that can leak part of a private key to powerful
local attackers. (CVE-2026-93842)
* Fix a use-after-free in TLS 1.2 clients when renegotiation starts while unread application data
remains buffered, with variable buffer lengths enabled and a maximum fragment length negotiated.
(CVE-2026-93844)
* Reject handshakes with signature algorithms disabled via mbedtls_ssl_conf_sig_algs() in the TLS
1.2 server. (CVE-2026-93777)
* Fix a potential information disclosure during TLS 1.2 renegotiation when
MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is enabled. If outgoing data is pending while the output
buffer is resized, a peer could receive memory outside the output buffer. (CVE-2026-115488)
* When verifying a certificate chain and passing a URI as the cn argument to the verify function,
the URI was incorrectly matched against DNS wildcards if found in the certificate.
(CVE-2026-90470)
* In mbedtls_x509_dn_gets(), output a null terminator even when the output string is empty.
(CVE-2026-115489)
* Document the use of PEM decryption as deprecated, due its inherent security risks.
Full release announcement: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.8
Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26780
Signed-off-by: Robert Marko <robimarko@gmail.com>