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>
Specifications:
SoC: Allwinner A527 SoC (Octa-core Cortex-A55)
DRAM: 1/2/4 GB LPDDR4 DRAM
Power: 5V USB-C
Video: HDMI (Type 2.0A), MIPI FPC
Storage: microSD / 16MByte SPI flash, m.2 2230 for SSD or wifi
Network: 2x Gbit ethernet (1x with PoE), BLink BL-M8800DS2 (unsupported)
Debug: serial UART
This patchset also adds IOMMU, PCIe, USB3, LED and SPI support from
backported patches for the A523/527 SoCs.
Flashing instructions:
Standard sunxi SD card installation procedure - copy image to SD card,
insert into SD card slot on the device and boot.
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Modernize the target slightly to use kernel+dtb FIT images,
which is also a preparation step for labgrid-automated testing
with initramfs. This follows similar changes in d1 and sunxi.
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
The binman build of u-boot.itb needs pylibfdt, which failed to build in two
ways:
- SWIG 4.3 dropped its Python 2 compatibility macros, but libfdt.i_shipped
still calls PyString_FromString and PyInt_AsLong. Switch to
PyUnicode_FromString and PyLong_AsLong.
- LDSHARED is hardcoded to "$(HOSTCC) -shared". On macOS, Python extensions
resolve libpython symbols at load time, so the link fails with undefined _Py*
symbols. Add -undefined dynamic_lookup on Darwin hosts.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Enable the ramdisk feature so an initramfs kernel is built by default and
listed in profiles.json.
Keep the initramfs kernel uncompressed. QEMU's RISC-V -kernel loader only
handles ELF, uImage and raw images, not a gzip-compressed Image. With that,
"qemu-system-riscv64 -machine sifive_u -kernel ..." boots OpenWrt for runtime
testing via openwrt-tests. U-Boot on real Unleashed/Unmatched boards can boot
the same file with booti.
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>
[updated the INITRAMFS section]
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
The Hasivo S5800W-24GT-6S+ (board silkscreen S5800W-24GT-6SX V1.01) is a
24x 2.5GBASE-T + 6x SFP+ switch built around an RTL9313.
Hardware:
- SoC: Realtek RTL9313
- RAM: 512 MiB DDR3
- Flash: 32 MiB SPI-NOR
- Ports: 24x 2.5GBASE-T via six RTL8224 quad PHYs in 10G-QXGMII on
SerDes 2-7, 6x SFP+ on SerDes 8-13
- Console: 38400 8N1
The RTL8224 PHYs sit on two SMI buses, 12 per bus. Unlike the Plasma
Cloud RTL9312 boards, each bus restarts at address 0; this was found by
reading the C45 PMA IDs of every address on both buses. Every SerDes
lane is routed with an inverted TX pair.
The SFP+ cages use I2C master 1 channels 0-5. Their module presence
lines are GPIOs 9, 11, 14, 22, 24 and 26, measured one cage at a time.
LOS and TX disable lines, if wired, have not been identified.
The flash keeps the vendor layout. The vendor boot loader loads the
runtime image from 0x300000 and requires the 0x93000000 uImage magic.
The vendor's second runtime region spans the firmware and firmware2
partitions as one JFFS2 filesystem, so restoring stock firmware needs
both written from the same backup.
The U-Boot environment only holds the Realtek placeholder MAC address,
so a random address is generated on first boot.
Installation: the vendor U-Boot has no working network, so load an
initramfs image with loady at 115200 baud and bootm it, then sysupgrade.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26726
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The MAC ports of an RTL931x QXGMII group are not contiguous: channels 0
and 1 of SerDes n (2 to 7) serve MAC ports base and base+1, channels 2
and 3 serve base+4 and base+5, with base = 8 * (n - 2). Channels 2 and 3
reach their ports through SERDES_MUX_CTRL_0/1, where each such MAC port
has a selector for its SerDes and each such channel a selector for its
MAC port. SerDes 9 serves MAC ports 42, 43, 46 and 47 the same way, and
MAC port 50 has a selector for SerDes 8.
The driver never programs this mux and relies on the boot loader having
done so. Program it once at init, from the topology rtpcs_map_links()
has read from the device tree: a SerDes with one of these MAC ports on
its channels 0 to 3 gets its selectors set, and every other selector is
written to its default of 0, so a mux left set up by the boot loader
does not carry over.
On an RTL9313 with six RTL8224 PHYs in 10G-QXGMII whose boot loader
leaves the mux at 0, a copper port on channel 3 of SerDes 5 links up but
passes no frames in either direction without this change, and passes
traffic with it.
Co-developed-by: Jonas Jelonek <jonas@jonasjelonek.de>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Quinn O'Shea <qoshea@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26756
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The factory MAC cell was missing the mac-base compatible and
#nvmem-cell-cells, so the offsets given for gmac and the wan port were
ignored and both used the unmodified base address, colliding with the
2.4 GHz radio.
Mark the cell as mac-base so LAN gets base+1 and WAN base+3, matching
the vendor firmware.
Fixes: 120b70a6e2 ("ipq40xx: add support for ASUS Lyra Mini (MAP-AC1300)")
Signed-off-by: Christoph Krapp <achterin@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26766
Signed-off-by: Robert Marko <robimarko@gmail.com>
This PR aligns the U-Boot Airoha AN8855 switch initialization code with
the proposed Linux DSA driver [1], fixing several register configuration
bugs and improving overall signal integrity.
[1] https://lore.kernel.org/all/20261009161102.38961-11-ansuelsmth@gmail.com/
The current default U-Boot configuration leaves the SerDes with
marginal drive characteristics. On some hardware iterations, this
results in severe packet loss (50-60%) and timeouts during TFTP
recovery. This drop occurs because of marginal signal integrity on the
internal 2500Base-X link connecting the switch to the CPU.
By correcting a bitwise shift overlap, enabling link error recovery,
and applying the proper TX FIR / RX CDR analog tuning parameters used
in the proposed Linux driver, this series ensures a stable physical
link between the CPU and switch across different boards.
These changes have been run-tested on the CMCC RAX3000ME and Xiaomi
AX3000T, both featuring the AN8855 switch, confirming stable network
operation and reliable gigabit TFTP recovery.
Upstream-Status: Submitted
Link: https://patchwork.ozlabs.org/project/uboot/list/?series=533727
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26549
Signed-off-by: Robert Marko <robimarko@gmail.com>
Quote sysfs paths and preserve complete LED names in the saved state.
DSA LEDs include their switch model in the name, so splitting names on
whitespace prevents triggers and state from being applied.
Use a tab separator for new state files and retain the legacy reader.
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Kosuke Shibuya <kakiringopcneko@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26521
Signed-off-by: Robert Marko <robimarko@gmail.com>
When the netdev trigger gets a device on an LED driven by a PHY in
hardware control, it reads the mode currently programmed into the PHY
back into its own state. The LED script then only sets the configured
mode bits on top of that, so whatever the PHY came up with stays, and
the kernel rejects link_10/link_100/link_1000 with -EINVAL while link
is set (and the other way round).
Seen on the Gemtek XR1710G: the amber lan3/lan4 LEDs come up with
"link tx rx" from the PHY, so "link_10 link_100" fails with four
"write error: Invalid argument" lines from S96led, and the amber LEDs
light up together with the green ones on every gigabit link.
Clear all mode bits before applying the configured ones when a mode is
given; an LED without a configured mode keeps what it inherited.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Andrey Korshunov <razor1702@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26297
Signed-off-by: Robert Marko <robimarko@gmail.com>
gcc-ipq5018 has the MDIO AHB clocks and block resets the wrong way
round. The GCC pair at 0x58010/0x58014 serves the MDIO0 controller
(0x88000) and the pair at 0x58000/0x58004 serves MDIO1 (0x90000), so
each MDIO bus enables the other bus's clock. The UniFi 6 Pro enables
only mdio0 and needs the correct mapping to keep MDIO0 running.
No affected targets were found: every other IPQ5018 board in the tree
enables both MDIO buses, so both clocks run with or without this change,
and nothing uses the MDIO resets.
Backport of the patch sent upstream:
https://lore.kernel.org/r/20261112155801.610730-1-david@dsg.is
Signed-off-by: Davíð Steinn Geirsson <david@dsg.is>
Signed-off-by: Daniel Plank <tyrolyean@escpe.net>
Link: https://github.com/openwrt/openwrt/pull/26562
Signed-off-by: Robert Marko <robimarko@gmail.com>
With `require_mode` set, `hostapd.sh` clears `legacy_rates` before it
picks the `cell_density` rates. `generate()` in `hostapd.uc` clears it
only after `device_cell_density_append()` has run, and nothing reads it
afterwards. A 2.4 GHz radio with `legacy_rates 1` therefore keeps the
802.11b rates: 5.5 and 11 Mbps as basic rates with `cell_density 1`,
11 Mbps with `cell_density 2`, and no rate lines with `cell_density 0`,
which leaves the hostapd defaults.
Call `device_cell_density_append()` after the `require_mode` check. It
only sets the rate defaults that `ap.uc` writes for each BSS, so the
rest of the generated config stays the same.
Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Link: https://github.com/openwrt/openwrt/issues/26580
Signed-off-by: Nicolás Capdet <nicolas@tedpac.xyz>
Link: https://github.com/openwrt/openwrt/pull/26587
Signed-off-by: Robert Marko <robimarko@gmail.com>
On a 2.4 GHz radio with `legacy_rates 1`, `hostapd.sh` treats
`cell_density 3` like `cell_density 2` and uses 11 Mbps as the basic
rate, as described in commit 81ff23fc91 ("hostapd: Add cell_density
data rates option"). `hostapd.uc` tests `cell_density > 3`, which is
never true because the schema caps the option at 3, so the radio gets
24 Mbps as the basic rate.
Test `cell_density > 2` instead, and mention the exception in the
schema description.
Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Link: https://github.com/openwrt/openwrt/issues/26580
Signed-off-by: Nicolás Capdet <nicolas@tedpac.xyz>
Link: https://github.com/openwrt/openwrt/pull/26587
Signed-off-by: Robert Marko <robimarko@gmail.com>
iface.set_bss_order() takes the struct hostapd_data of every listed BSS
from its ucode resource and dereferences it without a check. When the
list holds a BSS object whose hostapd_data has already been freed, the
resource data is NULL and hostapd crashes with SIGSEGV.
Seen on an OpenWrt One: a reload whose only change was the radios' TX
power went down iface_reload_config()'s BSS path for one radio, and all
four BSS objects it then passed to set_bss_order() were already empty
(read from the core dump). The crash took every BSS on both radios
down until netifd restarted Wi-Fi.
Treat such an entry like one that belongs to another interface and
return null: the reload then logs "Failed to update BSS order" and
restarts only that radio.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26635
Signed-off-by: Robert Marko <robimarko@gmail.com>
Commit a43cbfe2e3 ("ramips: remove default switch setup in 02_network")
added aximcom,mr-102n to two cases in ramips_setup_interfaces: the generic
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" switch setup, and a
dedicated "4:lan" "6@eth0" one. As the first matching case wins, the
dedicated setup was never used, and port 4 is set up as WAN.
The dedicated setup is the intended one: before that commit, the board
used eth0.2 as its only LAN interface, and the DTS sets the switch
portmap to 0x2f, which leaves port 4 as the only port outside of the
default LAN group, so eth0.2 maps to port 4. With the generic setup,
this LAN port ends up as WAN.
Remove the board from the generic case so the dedicated one is used.
Fixes: a43cbfe2e3 ("ramips: remove default switch setup in 02_network")
Signed-off-by: Christoph Krapp <achterin@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26609
Signed-off-by: Robert Marko <robimarko@gmail.com>
Support for per-instance working directories has been merged into upstream
commit 2e013572e8b3 ("service: add workdir support for daemon instances").
Accept workdir as a string parameter in procd_set_param() and document
it among the available parameter types, allowing init scripts to select
a working directory for service instances.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/26612
Signed-off-by: Robert Marko <robimarko@gmail.com>
The R6400's USB LEDs have no trigger-sources in the device tree, so the
kernel's usbport trigger logs at boot:
leds white:usb-1: Failed to get trigger sources for /leds/led-usb1
Add a kernel patch that names the ports as the other BCM5301X boards do
(USB 1: OHCI, EHCI and XHCI port 1; USB 2: OHCI and EHCI port 2) and
makes usbport the default trigger. The R6400 v2 includes the v1 DTS, so
this covers both versions. Refresh the switch LED patch that follows it.
Tested on the R6400 v1 and v2: the warning is gone, and a USB stick
lights USB 1 in the front port (USB 3.0) and USB 2 in the back port.
Fixes: 21d9bd899b ("bcm53xx: add support for Netgear R6400 v1")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Erik Conijn <egc112@msn.com>
Link: https://github.com/openwrt/openwrt/pull/26631
Signed-off-by: Robert Marko <robimarko@gmail.com>
Commit 1d976f83e4 ("bmips: add support for TP-Link TD-W8968 V3")
added the new board as a second label to the existing case, but left
the closing parenthesis of the first label in place:
comtrend,ar-5315u) |\
tp-link,td-w8968-v3)
This is a syntax error, so the script can not be parsed at all. As
uci-defaults scripts are only removed once they succeed, it is retried
on every boot, and "mtd fixtrx firmware" never runs, neither for the
TP-Link TD-W8968 V3 nor for the Comtrend AR-5315u, where it worked
before.
Drop the stray parenthesis.
Fixes: 1d976f83e4 ("bmips: add support for TP-Link TD-W8968 V3")
Signed-off-by: Christoph Krapp <achterin@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26641
Signed-off-by: Robert Marko <robimarko@gmail.com>
11-ath12k-trigger restarts an ath12k radio whose setup failed because
the device appeared after the wireless configuration was applied. It
only acts on devices bound to ath12k_pci, but since ath12k was split
into a common module and ath12k_wifi7, the PCI driver is named
ath12k_wifi7_pci, so on current kernels the script never acts. Match
both names.
Seen on an Arista C-460 (IPQ9574, three QCN9224 on PCIe), where the
new match finds the three ath12k radios and leaves the ath11k one
alone.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26636
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add upstream patch for FriendlyELEC NanoPi R76S ADC button that has been merged to the maintainer's
staging tree and is scheduled for Linux kernel v7.5
Add the kmod-button-hotplug and kmod-input-adc-keys to the R76S default packages accordingly.
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/26671
Signed-off-by: Robert Marko <robimarko@gmail.com>
Replace downstream patch for FriendlyELEC NanoPi M5 ADC buttons with upstream patch that has been
merged to the maintainer's staging tree and is scheduled for Linux kernel v7.5
The input event codes have changed which is not an issue because the device hasn't been backported
to a stable release branch.
Signed-off-by: Ryan Leung <untilscour@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/26671
Signed-off-by: Robert Marko <robimarko@gmail.com>
devm_regulator_get_enable_optional() returns -ENODEV when the device
tree does not describe a vbus-supply. Treating that as a fatal error
makes fsl-mph-dr-of fail to probe on every mpc85xx board without a
vbus regulator (all of them except the TP-Link TL-WDR4900 v1), leaving
USB unusable:
fsl-usb2-mph-dr ffe22000.usb: error -ENODEV: failed to get vbus regulator
Use devm_regulator_get_enable() instead. Without a vbus-supply it
falls back to a dummy regulator, so the probe succeeds, while boards
that describe one keep controlling it as before.
Tested on a WatchGuard Firebox T30.
Fixes: 9e43544bc6 ("mpc85xx: use regulator for USB power")
Suggested-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Lefteris Koutrakis <lefteris.koutrakis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26667
Signed-off-by: Robert Marko <robimarko@gmail.com>
RTL9607C switch is capable of changing max packet frame sizes
per port with RTL960X_ACCEPT_MAX_LEN register. Add support for
port_change_mtu and port_max_mtu following similar logic to
RTL8365MB except allow for any port, not just cpu port.
Since the CPU NIC does not currently support jumbo frames, the
actual limit is around ~1576 and DSA would throw an error if
some would try going higher.
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/26592
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
The kernel device-tree bindings mark qcom,ath10k-calibration-variant
and qcom,ath11k-calibration-variant as deprecated in favour of the
generic qcom,calibration-variant. In-tree device trees have been
converted in commit f246bdf1f2 ("ipq40xx: replace deprecated dts
properties"), commit d51b1bd834 ("ipq806x: replace deprecated dts
properties") and commit b2ea590e51 ("qualcommax: replace deprecated
dts properties"). main now has 345 uses of the generic property and 16
of the prefixed ones.
New device PRs still add the prefixed properties, so let the review
bot flag them.
Signed-off-by: Christoph Krapp <achterin@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/26758
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport two mmc core changes from mmc/next, on their way to v7.5:
- "mmc: core: sdio: skip CMD11 if signalling is already 1.8V"
(67a97316a31a): the RTL8822CS answers CMD5 with S18A = 1 even when
its bus is hardwired to 1.8V. The core then sends CMD11, which times
out, and the card ends up in 50 MHz high-speed mode instead of
SDR104. Skip CMD11 when the host already signals at 1.8V.
- "mmc: core: sdio: retry without UHS if UHS init fails"
(a3838c21e28e): if UHS init fails, e.g. because tuning finds no
working phase, fall back to high-speed mode instead of leaving the
card unusable. The first patch depends on this fallback for
non-compliant cards that do need CMD11.
Only hosts that start at a fixed 1.8V vqmmc are affected; hosts that
start at 3.3V and cards that report S18A correctly are not.
Tested on a FriendlyElec NanoPi R76S (RTL8822CS, fixed 1.8V vqmmc):
the "Unexpected CMD11 timeout" at boot is gone and the WiFi card runs
in SDR104 at 198 MHz instead of high speed at 50 MHz. TCP throughput
as an AP goes from ~37 to ~60 Mbit/s (AP transmitting) and from ~78
to ~150 Mbit/s (AP receiving) with the in-tree rtw88 driver.
Checked on first boot, 5 warm reboots, a host unbind/bind and
repeated wifi down/up: SDR104 every time, no mmc or rtw88 errors.
Upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/commit/?h=next&id=67a97316a31ahttps://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/commit/?h=next&id=a3838c21e28e
Link: https://github.com/openwrt/openwrt/issues/21361
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/26760
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for multicast, broadcast and unicast bridge flooding
in same way as rtl8365mb does it. Everything apart from register
address is pretty much identical. However, no BR_MCAST_FLOOD due
to lack of MDB support yet.
Signed-off-by: Rustam Adilov <adilov@tutamail.com>
Link: https://github.com/openwrt/openwrt/pull/26594
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>