Commit Graph
70212 Commits
Author SHA1 Message Date
Magnus Kroken 5d8a8a33dc mbedtls: update to 3.6.7
This version fixes security issues and bugs.

Security fixes:
* Fix a side channel in RSA PKCS#1 v1.5 decryption. (CVE-2026-50587)
* Fix a bug where transcript-hash computation errors during TLS 1.2 extended master secret calculation could be ignored instead of causing the handshake to fail. (CVE-2026-50581)
* Fix a TLS 1.3 server-side error-handling bug affecting session ticket generation. (CVE-2026-50640)
* Fix renegotiation failing and potentially causing a buffer overflow in DTLS when badmac_limit is enabled. (CVE-2026-50713)
* Reject ChaCha20 operations that would make the 32-bit block counter wrap around, which could otherwise reuse keystream and compromise confidentiality. (CVE-2026-50584)
* Fixed a TLS 1.3 record-boundary validation issue that could allow unauthenticated plaintext data to be processed across a key change.
* Fix a possible buffer overflow in mbedtls_ecdh_calc_secret() (CVE-2026-35336)
* Fix a remote buffer overflow in (D)TLS with ECDHE-PSK cipher suites when CBC is disabled. (CVE-ID-50580)
* Fix a side channel in ECC computations that allows a powerful local attacker (typically, untrusted OS attacking a secure enclave) to fully recover long-term secret keys). (CVE-2026-54435)
* Fix a potential information disclosure in TLS 1.2 servers using session tickets. (CVE-2026-50586)
* Fix timing side channel in RSA key generation, prime generation and primality testing, on platforms where division is not constant-time.
* Fix a 1-byte buffer overread when parsing a malformed ECC public key in the PK module. (CVE-2026-50583)
* Fix an out-of-bounds read when parsing TLS 1.2 ECJPAKE ServerKeyExchange messages. (CVE-2026-50588)
* Fix a use-after-free/double-free risk in mbedtls_pkcs7_free() when reusing an mbedtls_pkcs7 context across parse -> free -> parse -> free cycles. (CVE-2026-50579)
* PKCS7 now rejects weak hash algorithms (RIPEMD160, MD5, SHA-1, SHA-224, SHA3-224) on signature verification.
* Improved documentation of mbedtls_ssl_conf_sig_algs() to emphasize that this function only sets signature algorithms that are enforced during TLS key exchange and not on certificate verification. (CVE-2026-54441)
* Ensure 'dtls_srtp_info' field from 'mbedtls_ssl_context' is properly zeroized when mbedtls_ssl_session_reset() is called. (CVE-2026-50585)
* Fix a bug where mbedtls_ssl_read() and mbedtls_ssl_write() could return 1 instead of an error code if the random generator failed when a server called these functions before the end of a TLS 1.3 handshake.
* Fix TLS 1.3 clients to reject a HelloRetryRequest whose selected group was not advertised in the original ClientHello. (CVE-2026-25832)
* Fix two bugs in the X.509 certificate parser that caused some inputs with a malformed basicConstraints extension to be accepted. (CVE-2026-49300)

Full release notes: https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.7

Remove backported upstream patches that are included in this release.

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24131
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-08-12 02:09:37 +02:00
Russell Senior f95def2098 realtek: set power management mode
Discovered that EnGenius EWS2910P v1 appears to require a Set Power
Management Mode command for the port control to function.  Ensure
that the power management mode is set to dynamic power management
mode with priority. This should be safe for all gen1 and gen2 boards,
issue a warning if an error is detected.

Signed-off-by: Russell Senior <russell@personaltelco.net>
Link: https://github.com/openwrt/openwrt/pull/24550
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 23:38:42 +02:00
Rosen Penev d419aa9a88 bcm53xx: ea9200: use network LED trigger
The LED controls the state of all wireless interfaces. Use the new
network LED trigger to control this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22223
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 23:22:47 +02:00
Rosen Penev f46fa08dfb bcm53xx: backport various fixes
Several fixes made it upstream. Backport them.

Also add some local fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22223
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 23:22:46 +02:00
Charles Joynson d63c0ed825 ramips: mt7621: add support for TP-Link ER605 v1
This commit adds support for TP-Link ER605 v1. Like its successor the
ER605 v2, the MAC address can only be found in the tddp partition.

Hardware specifications:
- CPU: MediaTek MT7621DAT (880 MHz, 2 cores)
- CPU type: MIPS 1004Kc
- Flash: 16 MiB (GigaDevice GD25Q127CSIG)
- RAM: 128 MiB
- LAN speed: 1GbE
- LAN ports: 4
- WAN speed: 1GbE
- WAN ports: 1
- Serial: 4-pin header, unpopulated, 3.3V TTL, (115200 8N1)
- Power: 9 VDC, 0.85 A
- LEDs: Power (Green), System (Green)
- Button: RESET

Factory firmware (v1.2.0 Build 20220114 Rel.76871):
root@ER605:~# ubus call system board
{
	"kernel": "3.10.108",
	"hostname": "ER605",
	"system": "MT7621",
	"model": "mtk-apsoc-demo",
	"release": {
		"distribution": "OpenWrt",
		"version": "Barrier Breaker",
		"revision": "unknown",
		"codename": "barrier_breaker",
		"target": "ramips\/generic",
		"description": "OpenWrt Barrier Breaker 14.07"
	}
}

Factory partitions:
0x000000000000-0x000000040000 : "bootloader"
0x000000040000-0x000000070000 : "bootloader-fs"
0x000000070000-0x000000080000 : "extra-para"
0x000000080000-0x000000200000 : "kernel"
0x000000200000-0x000000df0000 : "rootfs"
0x000000df0000-0x000000e10000 : "panic-oops"
0x000000e10000-0x000000e20000 : "partition-table"
0x000000e20000-0x000000e30000 : "device-info"
0x000000e30000-0x000000e40000 : "support-list"
0x000000e40000-0x000000e50000 : "firmware-info"
0x000000e50000-0x000000e60000 : "tddp"
0x000000e60000-0x000000e80000 : "log"
0x000000e80000-0x000001000000 : "rootfs_data"
0x000000000000-0x000001000000 : "firmware"

New OpenWrt partitions:
...
0x000000080000-0x000000df0000 : "firmware"
...
0x000000e80000-0x000001000000 : "rootfs_data_back"

MAC addresses:
 - label/LAN = 'option macaddr' from factory tddp partition
 - WAN = label MAC + 1

Installation:
Split initramfs into 2 parts for writing to the kernel and rootfs
partitions on live device, leave http server up for sysupgrade.

dd if=initramfs-kernel.bin of=kernel-part.bin bs=64k count=24
dd if=initramfs-kernel.bin of=rootfs-part.bin bs=64k skip=24
md5sum kernel-part.bin rootfs-part.bin
python3 -m http.server -d . 8080

Downgrade to TP-Link firmware v1.3.1 or less if running v1.3.2.

From the web UI, open "System Tools" and select "Diagnostics".
Enable "Remote Assistance" and login as root.

tplink_label_mac=01:23:45:67:89:AB
tplink_username=admin
echo -n "$tplink_label_mac$tplink_username" | md5sum | cut -c1-16
ssh \
  -o "KexAlgorithms=+diffie-hellman-group1-sha1" \
  -o "HostKeyAlgorithms=+ssh-rsa" \
  root@192.168.0.1

Download partial initramfs binaries to /tmp and verify checksums match.

cd /tmp
wget http://192.168.0.20:8080/kernel-part.bin
wget http://192.168.0.20:8080/rootfs-part.bin
md5sum kernel-part.bin rootfs-part.bin

Write partial initramfs binaries to kernel and rootfs.

mtd -e kernel write kernel-part.bin kernel
mtd -r -e rootfs write rootfs-part.bin rootfs

Login to OpenWrt initramfs as root.

ssh root@192.168.1.1

Erase firmware partition and perform sysupgrade.

mtd erase firmware
sysupgrade -n -p http://192.168.1.111:8080/squashfs-sysupgrade.bin

Signed-off-by: Charles Joynson <ctjoynson@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24331
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 23:18:27 +02:00
Charles Joynson 180fa957e3 base-files: add mtd_get_mac_uci_config()
Add mtd_get_mac_uci_config() for reading a MAC address from a UCI-style
config stored in an MTD partition. This is needed to support the
TP-Link ER605 v1; the existing UBI helper already covers the ER605 v2.
Also refactor common sed logic into a shared helper used by both
variants and drop the redundant cat pipe.

TP-Link ER605 v2 device support is unaffected. The one and only MAC
address on the tddp partition for v1/v2 is the label MAC address.

Signed-off-by: Charles Joynson <ctjoynson@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24331
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 23:18:26 +02:00
Aleksander Jan Bajkowski 0256e6a1e4 kernel: backport quirk for Horaco SFP+ Copper module
Backport quirks for Horaco SFP+ Copper modules. This module support
RollBall protocol.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/24559
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:27:29 +02:00
Lars Gierth 8dfd6ae905 realtek: rtl930x: add PoE support for Hasivo F1100WP-4SX-4XGT
Manage the HS104 behind the STC8 MCU, register the LEDs, attach the PSE PIs.

Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/24643
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:20:13 +02:00
Lars Gierth 95b3e13fcb realtek: rtl930x: add STC8 MCU support for Hasivo F1100W/WP-4SX-4XGT
This MCU is present on most Hasivo devices and controls basic things
such as watchdog, sensor, and RTC if available.
On devices with PoE PSE support, it also controls the PSE chip and LEDs.

One funny detail is that while the watchdog is present on most Hasivo devices
and (unless armed) resets the whole device, here it only resets the PoE LEDs.
The PoE LEDs reset and blink twice every 75s, even if PoE is unmanaged or off.

Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/24643
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:20:13 +02:00
Lars Gierth 8992053dac realtek: rtl930x: split PoE variant off of Hasivo F1100W-4SX-4XGT
Now that there's the potential for PoE support on this device,
we make the PoE variant its own device, so that later commits can add
the respective device tree items.

While at it, be explicit about the real SoC in the root compatible.

Signed-off-by: Lars Gierth <larsg@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/24643
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:20:12 +02:00
Chad Monroe 5684f0d174 mediatek: filogic: SDG-8733A: reset the radio through pcie3
GPIO 9 is the reset input of the MT7995 radio module, active low.
The old description used it as a PERST line on pcie0 with active
high polarity, so the port reset toggled the module reset at the
wrong time and with the wrong polarity.

Describe it as wifi-reset-gpios on pcie3, the port wired to the
module reset. The PCIe controller then releases the module from
reset before link training, with a 100 ms delay.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:11 +02:00
Chad Monroe c5ff6007b3 mediatek: filogic: mt-stuart: limit USB to USB2
USB3 SuperSpeed signaling interferes with the 6 GHz radio. Disable
the SuperSpeed port on ssusb1 with mediatek,u3p-dis-msk; the port
then runs at USB2 speed.

Stop enabling ssusb0 and its xs-phy. Nothing connects to them on
these boards.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:11 +02:00
Chad Monroe 367d47f967 mediatek: filogic: SDG-8733A: point label-mac-device at wan
The MAC address on the product label is the base MAC, mfginfo
cell 0. On this board gmac2 (wan) uses cell 0. The alias pointed
at gmac1 (lan), which uses cell 1, so the reported label MAC did
not match the label.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:10 +02:00
Chad Monroe bb38f71acb mediatek: filogic: SDG-8733A: describe the LAN LEDs per hardware
The board has three LAN LEDs: white on GPIO 59, amber on GPIO 60
and green on GPIO 68. The old description listed two GPIO LEDs
with swapped colors and drove the green LED from the internal
2.5G PHY.

Describe all three as GPIO LEDs and set the netdev triggers to
match: white 2.5G, green 1G, amber 100M. Drop the PHY LED node
and the LED pinctrl state: the PHY LED pad (2p5gbe_led0, pin 68)
now works as the green LED GPIO, so the PHY drives no LED.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:10 +02:00
Chad Monroe 5314c98fa2 mediatek: filogic: mt-stuart: use in-band-status on usxgmii links
The USXGMII links to the AQR113C PHYs signal link state and rate
adaptation in-band. Set managed "in-band-status" so phylink tracks
the PCS state instead of a fixed link.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:10 +02:00
Chad Monroe dfec67f9ff mediatek: filogic: mt-stuart: drive fan from AQR113C temperature
The AQR113C PHYs run hot and sit away from the SoC sensor. Export
the PHY hwmon sensor as a thermal sensor and add a thermal zone per
AQR113C on all three boards. The zones drive the fan with trips at
108/104/100/90/80/40 C.

Set critical-action "reboot" so a runaway zone restarts the board
instead of an unclean thermal shutdown. Raise the trip hysteresis
from 2 C to 4 C to stop the fan from cycling near a trip point.
Stop passive polling; the zones use active cooling only.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:10 +02:00
Chad Monroe cb158aba32 mediatek: filogic: mt-stuart: move AQR113C reset to MDIO bus level
Each board wires one reset line that resets the AQR113C PHYs as a
group: GPIO 71 on SDG-8733/SDG-8734 and GPIO 62 on SDG-8733A.
Describe that line as the MDIO bus reset with the same assert and
deassert times.

Drop the per-PHY reset-gpios. On SDG-8733 the second AQR113C
claimed GPIO 62, which is not connected on that board.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:09 +02:00
Chad Monroe 5376d6ae7c mediatek: filogic: restructure SmartRG MT7988 device trees
Replace mt7988a-smartrg-mt-stuart.dtsi with layered dtsi files.
The existing 3 boards assemble from shared building blocks instead
of include-then-delete:

 * mt798x-smartrg-common.dtsi: thermal trip/cooling-map macros
 * mt798x-smartrg-factory.dtsi: eMMC factory/mfginfo nvmem layout
 * mt7988-smartrg-base.dtsi: PMIC, regulators, eMMC, ramoops,
   console, watchdog, reset button
 * mt7988-smartrg-sysled.dtsi: system LED controller and aliases
 * mt7988-smartrg-mt-stuart-gsw.dtsi: built-in switch as lan2-4
   with the per-port PHY LEDs
 * mt7988-smartrg-wifi-pcie3.dtsi / -wifi-mt7995.dtsi: radio second
   PCIe function and pcie0 radio wiring for SDG-8733A
 * mt7988a-smartrg-mt-stuart-phase1.dtsi plus per-model pair dtsi
   for SDG-8733 (AQR113C WAN) and SDG-8734 (SFP+ WAN)

No functional change is intended. Nodes for hardware that a board
does not have are no longer instantiated on that board: the
unstuffed WAN PHY on SDG-8734, unused pin groups per model, and
the PHY LED setup of the disabled switch on SDG-8733A.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:09 +02:00
Chad Monroe d4af641990 mediatek: filogic: mt-stuart: drop pci=pcie_bus_perf bootarg
The parameter came from the vendor SDK. The default kernel MPS and
MRRS configuration works correctly on these boards. The parameter
gives no measured benefit.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:09 +02:00
Chad Monroe ec48487d97 mediatek: filogic: mt-stuart: fix dtc warnings
Rename the system LED children to led@1..led@4. The nodes have a
reg property, so dtc wants unit addresses. The sysled driver names
the LEDs from the label property, which does not change.

Remove #address-cells and #size-cells from the eMMC card@0 node.
The node has no children with a reg property.

No functional change.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:08 +02:00
Chad Monroe fe1158a99d mediatek: filogic: mt-stuart: remove stale device tree nodes
No Mt. Stuart model has SLIC voice hardware or SPI NAND flash.
Remove the SLIC gpio-exports and the spi0/spi_nand nodes.

Remove phy-connection-type where phy-mode gives the same value.

Remove the pcie1 pinctrl properties. They are identical to the
SoC defaults in mt7988a.dtsi.

No functional change.

Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://github.com/openwrt/openwrt/pull/24352
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:13:08 +02:00
Andrew LaMarche 38e544ef94 realtek: dts: specify rtl9303 soc compatible on two Hasivo boards
S1100W-8XGT-SE and S1100WP-8XGT-SE have realtek,rtl930x-soc in their
compatibles. Specify realtek,rtl9303-soc to be explicit.

Signed-off-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24648
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-11 22:02:47 +02:00
Zoltan HERPAI 5b2c9ce8bf uboot-sifiveu: bump to 2026.04
Remove upstreamed patches and refresh remaining ones as required.

Compile-tested: sifiveu/*, d1/*
Runtime-tested: sifiveu/unleashed, sifiveu/unmatched, d1/nezha

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-08-11 18:56:57 +02:00
Zoltan HERPAI cdb3757a8a opensbi: bump to v1.9
While at it, move away from using dated builds to release tags.

Compile-tested: sifiveu/*, d1/*
Runtime-tested: sifiveu/unleashed, sifiveu/unmatched, d1/nezha

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-08-11 18:56:57 +02:00
Mikhail Kshevetskiy 82e2e4f492 uboot-airoha: update an7583 patches
The same patches were submitted to upstream U-Boot.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/24646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 13:58:52 +02:00
Mikhail Kshevetskiy 57e5eab97e uboot-airoha: update pinctrl driver to match linux-7.3
U-Boot airoha pinctrl code was synced with linux-pinctrl/for-next
(future linux-7.3) branch.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/24646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 13:58:52 +02:00
Mikhail Kshevetskiy 9ccec981f5 airoha: an7581: dts: update number of available gpios
AN7581 SoC have more GPIOs. PCIE reset pins can be muxed to gpio,
so we have 50 GPIOs instead of 47.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/24646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 13:58:52 +02:00
Mikhail Kshevetskiy 00f9f060a8 airoha: update pinctrl driver to match linux-7.3
Changes are based on linux-pinctrl/for-next (future linux-7.3) branch.
Existing pinctrl patches were adapted for upstream driver.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/24646
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 13:58:52 +02:00
Vitaliy Sochnev 3d25753554 airoha: npu: load the firmware without the sysfs fallback
The NPU driver maps a missing firmware file to -EPROBE_DEFER, so that it
can be retried once the rootfs carrying /lib/firmware is mounted. That
mapping holds only while request_firmware() reports -ENOENT, and it does
not when the sysfs fallback is in play: the request goes to a userspace
helper, blocks for the full 60 second loading_timeout and comes back as
-ETIMEDOUT, which dev_err_probe() then turns into a hard failure. The
board boots a minute slower and ends up with no NPU at all, so no
hardware flow offloading either.

Our own config disables FW_LOADER_USER_HELPER for the target, but that
is not a dependable guard: LEDS_LP55XX_COMMON selects it, so any build
that pulls in kmod-leds-lp55xx-common - every image built with
ALL_KMODS, snapshots included - gets it back, and generic's
FW_LOADER_USER_HELPER_FALLBACK=y then arms the fallback.

Add a patch switching the driver to request_firmware_direct(), which
sets FW_OPT_NOFALLBACK_SYSFS and so reports -ENOENT whatever the
firmware loader is configured to do.

request_firmware_direct() also sets FW_OPT_NO_WARN, so the "Direct
firmware load for airoha/en7581_npu_rv32.bin failed with error -2"
line goes away together with the fallback. There is no variant that
skips the fallback but keeps the warning. While the probe is being
deferred that message was noise, but on a board where the firmware
package is genuinely missing it was the only hint naming the file.

Measured on a Nokia XG-040G-MD with FW_LOADER_USER_HELPER=y and
FW_LOADER_USER_HELPER_FALLBACK=y forced on, the two images differing
only by this patch:

  without:  2.477 fallback -> 64.555 -ETIMEDOUT -> probe failed -110,
            preinit at 69.6s, NPU unbound
  with:     no fallback and no warning at all, NPU fw version 1456.62
            at 3.665s, preinit at 7.6s

Note the fallback is still compiled in and forced in both cases; the
patch does not disable it, it only keeps the driver from falling into
it.

The patch carries Fixes: 23290c7bc190 ("net: airoha: Introduce Airoha
NPU support") and Cc: stable@vger.kernel.org, so it can be dropped once
it lands upstream and reaches us through a stable update.

Link: https://lore.kernel.org/netdev/20260807024125.434055-1-sochnev.v.74@gmail.com/
Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24593
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 12:14:23 +02:00
Vitaliy Sochnev ab2dc6ab16 airoha: an7581: reserve NPU Wi-Fi regions only on Wi-Fi boards
an7581.dtsi reserves five no-map regions for the NPU and hands all of
them to the npu node. Four of them - pkt, tx-pkt, tx-bufid and ba,
110 MiB plus 26 KiB - are consumed only by
airoha_npu_wlan_init_memory(), which the mt76 NPU layer calls when it
attaches an Airoha-offloaded Wi-Fi chip. To run its firmware and to
offload flows the NPU needs the binary region alone, and the driver
looks that one up by index rather than by name.

Boards that bind no Wi-Fi chip to the NPU therefore lose 110 MiB of
DRAM for nothing, and they lose it whether or not the NPU probes at
all: the memory is carved out by the reserved-memory node itself. On
AN7581 that is both Nokia XG-040G-MD variants. an7583.dtsi already does
this correctly and reserves npu_binary only.

Move the four regions into a new an7581-npu-wlan.dtsi and include it
from the two NPU overlays the Wi-Fi boards already pull in, so that the
regions and the full memory-region list follow the Wi-Fi chip instead
of the SoC.

an7581-evb includes the new overlay directly instead. It declares two
mediatek,mt76 nodes with airoha,npu and enables the NPU, but pins no
particular chip because the card goes into a PCIe slot, so it is the
one board using the offload that pulls in neither NPU overlay.

Keep the ba region on all four Wi-Fi boards even though it is described
as MT7996-only. It is already optional in the driver, but narrowing it
down to MT7996 would change behaviour on Kite, so leave that for a
separate change.

Verified by building the device trees before and after: the DTBs of
an7581-evb, an7581-evb-emmc-eagle, an7581-evb-emmc-kite,
an7581-nokia-valyrian and an7581-w1700k-ubi are byte for byte
identical, while an7581-nokia_xg-040g-md and an7581-nokia_xg-040g-md-ubi
each shrink by 376 bytes and lose the four regions.

Tested on a Nokia XG-040G-MD. Reserved memory drops from 197296K to
84400K and MemTotal rises from 325900 kB to 438736 kB, 110 MiB given
back. The NPU still comes up on the binary region alone and reports
"NPU fw version: 1456.62", so dropping the four regions costs the board
neither the NPU nor its flow offloading. Not tested on Wi-Fi hardware,
where the argument rests on the DTBs being unchanged.

Signed-off-by: Vitaliy Sochnev <sochnev.v.74@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24593
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-11 12:14:23 +02:00
xiao bo 486b4a4b3e arm-trusted-firmware-airoha: sync an7581-bl31 BUILD_DEVICES with bl2
an7581-bl31 BUILD_DEVICES list was incomplete and missed:
 - airoha_an7581-evb-emmc-eagle
 - airoha_an7581-evb-emmc-kite
 - nokia_valyrian
 - nokia_xg-040g-md-ubi

These devices are present in an7581-bl2 but missing for bl31.
When building these targets, an7581‑bl31 package is never built,
causes FIP failure "fopen ...an7581‑bl31.lzma: No such file or directory".

Sync an7581‑bl31 BUILD_DEVICES to exactly match an7581‑bl2.

Fixes: https://github.com/openwrt/openwrt/commit/467c5b90ba1140dcdabc2e2e203c1d91fca9963e

Signed-off-by: xiao bo <peterwillcn@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24626
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-09 16:49:23 +02:00
Robert Marko 467c5b90ba airoha: fix AN7581 chainloader U-Boot filename
The uboot-airoha package now stages compressed U-Boot images using the
u-boot.lzma suffix. The AN7581 chainloader still looks for the previous
u-boot.bin.lzma filename and consequently falls back to a nonexistent
uncompressed image.

Use the staged u-boot.lzma filename when generating the chainloader FIT.

Fixes: 94a21b3fe9 ("uboot-airoha: move FIP generation to target and enable autoselection")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-09 13:05:48 +02:00
Robert Marko 76cda5ddac airoha: fix U-Boot artifacts for AN7581 eMMC boards
The AN7581 eMMC Eagle and Kite boards use the shared an7581_rfb
U-Boot build, which produces artifacts with the rfb suffix. The image
recipes instead look for nonexistent per-device rfb-emmc-eagle and
rfb-emmc-kite artifacts.

Use the shared rfb artifacts for both boards so their preloader and
BL31/U-Boot FIP artifacts can be generated.

Fixes: 94a21b3fe9 ("uboot-airoha: move FIP generation to target and enable autoselection")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-09 12:52:07 +02:00
Robert Marko aaf01ed8af uboot-airoha: use separate DTB for Nokia XG-040G-MD
CONFIG_OF_EMBED is intended for debugging and is not recommended for
production devices. Remove it from the Nokia XG-040G-MD defconfig so
Kconfig selects CONFIG_OF_SEPARATE, consistent with the other Airoha
boards.

The existing default device tree and u-boot.bin build target ensure that
the separate DTB is built and appended to the deployable U-Boot image.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-09 12:38:08 +02:00
Robert Marko 831900b41b arm-trusted-firmware-airoha: fix BL2 packing on Debian 11
Debian 11 ships coreutils 8.32, whose cksum does not support the
-a crc32b option. This leaves crc empty and causes the subsequent shell
arithmetic expression to fail.

Use Python's built-in binascii.crc32 implementation instead. Python 3 is
already required by the OpenWrt build system and produces the same CRC-32
value before the existing final XOR.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-09 11:22:55 +02:00
Carlo Szelinsky 83e93e04b4 realtek: dts: add missing soc compatible to two Hasivo boards
Both boards only list their board compatible in the root node, so they
do not match the realtek MIPS machine and hang early during boot.

Fixes: 7cc31af7bd ("realtek: convert to generic machine initialization")
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
Link: https://github.com/openwrt/openwrt/pull/24615
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-08-08 23:08:21 +02:00
Christian Marangi 94a21b3fe9 uboot-airoha: move FIP generation to target and enable autoselection
Move FIP handling to target now that we compile ATF. This is to have always
in sync new ATF and new U-Boot if one of the 2 is already compiled.

Also add HIDDEN ops to enable autoselection of the U-Boot for the required
target. This is needed to prevent user to deselect the U-Boot package
causing failure on ARTIFACTS generation.

Drop precompiled BL2 and BL31 as they can be now compiled from source.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24257
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-08 17:10:12 +02:00
Christian Marangi c249552ea5 packages/boot: add arm-trusted-firmware-airoha
Add support for compiling Airoha ATF, based on a modified version of the
TF-A based on 2.10.

The package will clone the base TF-A and apply the modified source and
pre-compiled objects (DDR calibration, eFUSE handling, TX/RX path...) to
correctly compile.

An helper script is added to implement the same format used for special BL2
handling. BL2 is composed of 3 sub-phase with a initial BL21, a BL22 that
loads a LZMA decompressor and BL23 that actually calibrate and loads BL31
ATF.

Also a special flash_table is used to handle SPI-NAND externally to the
BL2, a special Host target is added for that.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24257
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-08 17:10:02 +02:00
Daniel Schwierzeck 652b2e90b3 airoha: add missing CONFIG_AIROHA_CPU_PM_DOMAIN
The kernel config refresh done with commit
ada7ded disabled the Airoha PM Domain driver
due to the broken Kconfig dependency fixed with an earlier commit.

Add the missing symbol to enable the driver again. Also do a another
kernel config refresh to resolve some dependent PM domain symbols.

Fixes: ada7ded ("airoha: an7583: refresh kernel config")
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2026-08-08 11:39:30 +02:00
Daniel Schwierzeck db25d50bf6 airoha: an7581: add airoha,chip-scu phandle to scuclk node
The clk-en7523 driver tries to look up the chip-scu regmap via the
"airoha,chip-scu" phandle first. If absent, it falls back to a
compatible-based lookup with syscon_regmap_lookup_by_compatible().

The AN7583 DTSI already had the phandle but AN7581 did not, relying
on the fallback instead. Add it so the DT explicitly describes the
connection and both platforms use the same lookup path.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2026-08-08 11:39:30 +02:00
Daniel Schwierzeck b3bcc4d57c airoha: fix cpufreq probe failure
dev_pm_domain_attach_list() returns the number of attached PM domains
on success (a positive count), or a negative error code on failure.
The airoha-cpufreq driver checks 'if (ret)' which treats a successful
attachment as an error.

Fix by checking 'if (ret < 0)' like all other users of this API.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2026-08-08 11:39:30 +02:00
Daniel Schwierzeck 044d2f52cb airoha: make PM domain driver working for AN7583
Add SoC compatible for AN7583 to PM domain driver (the cpufreq driver
already has it).

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2026-08-08 11:39:30 +02:00
Daniel Schwierzeck 3458057195 airoha: fix Kconfig dependency issue with PM Domain driver
The AIROHA_CPU_PM_DOMAIN option was added inside the MediaTek PM Domains
menu, which depends on ARCH_MEDIATEK || COMPILE_TEST. Since Airoha
platforms use ARCH_AIROHA, the menu is invisible during kernel
configuration, silently dropping AIROHA_CPU_PM_DOMAIN. This breaks
running `make kernel_menuconfig`.

Add ARCH_AIROHA to the menu dependency so that this option and its
dependencies (PM_GENERIC_DOMAINS, PM_GENERIC_DOMAINS_OF) remain
enabled on Airoha targets.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2026-08-08 11:39:30 +02:00
Rustam Adilov 2991205555 realtek: board: some family check cleanups
The prom initialization is a bit of a mess now with all these
model and soc family checks. And realtek_read_model() function
is the worst offender of all as it goes through all of the model
info register from different SoCs just to read details from one
of them.

We can make use of the .data property in realtek_of_match to
clean things up so that each soc family has its own way of
initialization and reading model details.

Create a struct that will be used for that and add all of the
soc data structs for all chip families.

With all that, remove realtek_read_model() function and most
of the soc_info.family checks in various functions.

In addition, add the rtl960x compatibles along as well so that
rtl960x model info details has somewhere to be used. RTL8198D
is also added as it is part of RTL9607C family.

Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/24588
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-08-07 19:54:49 +02:00
Rustam Adilov 76d124a18c realtek: dts: fix up the wrong soc compatibles
Some rtl9302 based boards use the realtek,rtl838x-soc compatible
in their device tree instead of the correct realtek,rtl9302-soc.

This is also the case for main rtl931x and rtl930x device tree files.

In preperation for utilizing device data in the board-realtek, fix
this up now so that these boards don't end up breaking due to incorrect
prom initialization caused by rtl838x-soc compatible.

Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/24588
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
2026-08-07 19:54:49 +02:00
Robert Marko f23aff6808 generic: 6.18: disable CONFIG_SND_SOC_AN7581
Instead of putting in the target config where each refresh drops it,
lets disable it in the generic config.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-07 19:25:14 +02:00
Mikhail Zhilkin 71f139a048 airoha: an7583: fix ethernet breakage on Nokia XG-040G-MF
Recent upstream cleanups moved switch port labels to the board level and
disabled switch ports/PHYs by default on the AN7583 SoC dtsi. This broke
ethernet on the Nokia XG-040G-MF since its board DTS was not updated to
explicitly configure and enable them.

Fix this by explicitly enabling gsw_port2-4 along with their respective
PHYs and restoring the "lan2", "lan3", and "lan4" port labels.

Fixes: ce55cdde26 ("airoha: an7583: move the switch port label from soc-level to board-level")
Fixes: d2698d325b ("airoha: an7583: disable all switch ports and PHYs by default")
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24606
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-08-07 19:01:51 +02:00
Zoltan HERPAI a3c3a18cc3 zynq: enable writable MMC on Antminer S9
Disable write-protection on sdhci0, similar to the upstream
U-boot DTS. This also enables (obviously) the working overlayfs.

Link: https://github.com/openwrt/openwrt/issues/24602
Fixes: e050bb7946 ("zynq: add Bitmain Antminer S9 control board support")
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
2026-08-07 18:26:36 +02:00
Robert Marko 15a2a6f463 airoha: pinctrl: fix AN7583 eMMC pinmux
The SCU IOMUX reset puts AN7583 pins 45-47 into GPIO mode. These pins
are shared with eMMC, but the generic eMMC function group only enables
the eMMC mode bit and leaves the GPIO overrides active, preventing the
card from initializing.

Add an AN7583-specific eMMC function group that also clears the GPIO
mode bits for the shared pins.

Fixes: d0110a25ed ("airoha: add pinctrl fixes for AN7581 and AN7583")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-07 13:53:58 +02:00
Robert Marko 9dccdd708d airoha: an7581/7583: build-in I2C support
There is no reason to add a custom kmod which is not even an7581
specific as its just the regular Mediatek MT7621 I2C driver.

So, simply enable the driver in kernel configs, drop the inclusion
per-board and remove the kmod definition.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2026-08-07 13:09:02 +02:00