Commit graph

66322 commits

Author SHA1 Message Date
Hauke Mehrtens
916e5e1528 build: Add support for linking with DT_RELR
This adds the -Wl,-z,pack-relative-relocs linking options.
This reduces the size of some binaries.

This is only supported on i386, x86_64, aarch64 and loongarch64 in
binutils. This feature is not support for MIPS.

musl libc supports it since version 1.2.4 .
glibc supports it since vesion 2.36.
binutils ld supports it since version 2.38 for x86 and since version
2.43 for LoongArch.

This reduces the size of the armsr default root file system from
5,262,198 bytes to 5,200,950 bytes by 61,248 bytes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-17 00:04:25 +01:00
Andrii Kuiukoff
97256a28fe ramips: add support for EDUP EP-RT2960S
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
EDUP EP-RT2960S has the similar hardware design as the SIMAX1800T.
The main difference is the arrangement of the GPIO pins
and the location of the MAC address.

Specification
-------------
- SoC       : Mediatek MT7621
- RAM       : 256 MiB DDR3
- Flash     : 128 MiB NAND Flash
- WLAN      : Mediatek MT7905 DBDC
  - 2.4 GHz : 2x2 MIMO WiFi6
  - 5 GHz   : 2x2 MIMO WiFi6
- Ethernet  : MT7621 built-in 10/100/1000 Mbps 1x WAN; 3x LAN
- UART      : 3.3V, 115200n8
- Buttons   : 1x RESET; 1x WPS/MESH
- LEDs      : 1x Multi-Color(Blue;Green;Red)
- Power     : DC 12V1A
- CMIIT ID  : 2022AP7163
- TFTP IP   :
  - server  : 192.168.1.254
  - router  : 192.168.1.28

TFTP Installation(recommend)
------------
1. Set local tftp server IP "192.168.1.254" and NetMask "255.255.255.0".
2. Rename initramfs-kernel.bin to "factory.bin" and put it in the root
   directory of the tftp server. tftpd64 is a good choice for Windows.
3. Remove all Ethernet cables and WiFi connections from the PC, except
   for the one connected to the EDUP EP-RT2960S. Start the TFTP server, plug
   in the power adapter and wait for the OpenWrt system to boot.
4. Backup "firmware" partition and rename it to "firmware.bin". We need
   it to back to the stock firmware.
5. Use "fw_printenv" command to list envs. If "firmware_select=2" is
   observed then set u-boot env variable via command:
   `fw_setenv firmware_select 1`
6. Apply sysupgrade.bin in OpenWrt LuCI.

Web UI Installation
------------
1. Apply update by uploading initramfs-factory.bin to the web UI.
2. Use "fw_printenv" command to list envs. If "firmware_select=2" is
   observed then set u-boot env variable via command:
   `fw_setenv firmware_select 1`
3. Apply squashfs-sysupgrade.bin in OpenWrt LuCI.

Return to Stock Firmware
----------------------------
  Restore the backup firmware partition in the installation step 4.

MAC addresses
-------------
+---------+-------------------+
|         | MAC example       |
+---------+-------------------+
| LABEL   | 24:D5:1C:xx:xx:xx |
| LAN     | 24:D5:1C:xx:xx:xx |
| WAN     | 24:D5:1C:xx:xx:xx |
| WLAN2G  | 24:D5:1C:xx:xx:xx |
| WLAN5G  | 26:D5:1C:xx:xx:xx |
+---------+-------------------+

Tips:
-----------
  User can use `TFTP Installation` method to recover a brick device.

Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20600
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 21:59:28 +01:00
Matthias Van Parys
59ecc11ccf hostapd: pass global linker options to CLI tools
The CLI tools hostapd_cli and wpa_cli are compiled with
`TARGET_LDFLAGS_C` rather than the standard `TARGET_LDFLAGS`.
This variable is empty, leading to global linker options not being
applied.

Set this variable equal to `TARGET_LDFLAGS` right after the package.mk
include to make sure global linker options are applied, but local options
such as linking to crypto libraries are not.

Signed-off-by: Matthias Van Parys <matthias.vanparys@softathome.com>
Link: https://github.com/openwrt/openwrt/pull/20345
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 21:44:49 +01:00
Jonathan Luijsmans
8afdc50092 lua5.3: Add TARGET_LDFLAGS to MYLDFLAGS
Add TARGET_LDFLAGS to MYLDFLAGS make sure that the required flags are used
during the compilation.

Signed-off-by: Jonathan Luijsmans <jonathan.luijsmans_ext@softathome.com>
Link: https://github.com/openwrt/openwrt/pull/20642
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 21:34:08 +01:00
Sven Eckelmann
501f4edb04 realtek: dsa: Clarify statistic port iterator variable
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
The functions iterating through the port statistic/counter (for
initialization or polling) use the generic name "i" for the iterator. This
makes reading the actual body of the loop cumbersome because it is not
clear that various parameters of functions are about a ports.

Suggested-by: Felix Baumann <felix.bau@gmx.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Sven Eckelmann
e20ab65281 realtek: dsa: rtl931x: Reduce HW counters polling interval
Some SoC families require table access to get the HW counters. A mutex is
required for this access - which will potentially cause a sleep in the
current context. This is not always possible with .get_stats64 because it
is also called in atomic contexts.

For these SoCs, the retrieval of the current counters in .get_stats64 is
skipped and the counters are simply retrieved a lot more often from the HW.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Sven Eckelmann
e76ed39f3b realtek: dsa: Refresh link_stats in .get_stats64
If an architecture doesn't need to sleep for retrieving the current
statistics from the HW, it is possible to directly retrieve the last values
from the HW when .get_stats64 is called. This avoids the stale counters
with the current refresh interval of 60 seconds.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Sven Eckelmann
bd78eeb53f realtek: dsa: Select counter lock based on sleeping behavior
On many architectures, retrieving the HW counters from the switch is not
potentially sleeping. This would potentially allow these architectures to
retrieve the most recent values from the HW when .get_stats64 is called.
But because of the global mutex (which may sleep on lock), this would no
longer be possible.

Reintroduce the per port counters lock which protects from parallel
writes+reads of the non-link_stat counters. The locking is made abstract by
using helpers which identify the correct locking mechanism based on the
used read methods of the SoC.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Harshal Gohel
3c95a60e33 realtek: dsa: rtl931x: add ethtool statistics support
Add MIB data structures and table access routines for the RTL931X family.
These counters can now be exposed through the ethtool statistics interface.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Sharadanand Karanjkar
fdc424c1e3 realtek: dsa: add table-based statistics infrastructure
Some Realtek SoCs such as the RTL931X store MIB counters in tables rather
than registers. Unlike register reads, table access requires programming
the table control register, setting the command field to determine read or
write, and then polling for completion. This makes it necessary to
implement a separate path for table-based statistics.

Like register-based MIBs, the table-based MIBs also come in two types: STD
and PRIV which will require slightly different implementations.

Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Sharadanand Karanjkar
ac6bd8473d realtek: dsa: rework MIB read locking and polling
Some Realtek SoCs do not expose MIB counters as simple registers. Instead,
retrieving counters may require blocking operations or take longer than a
normal register read. This makes the existing approach of direct reads
unsuitable. The existing approach uses spin locks which forbid sleeping
inside their context. But some hardware accesses methods (for example table
reads) might block (sleep).

To handle this, the MIB read path is redesigned with two levels of
locking:

* A global mutex protects updates of MIB data from the hardware. This is
  necessary because reads can occur both in the polling workqueue and from
  ethtool callbacks, also two user threads might call the ethtools
  callbacks. A global mutex helps to avoid parallel reads of the same
  hardware data. For table reads, this is not necessarily required because
  they are already using a table lock. But they are the reason why
  spin-locks can no longer be used (see above).

* A per-port spinlock protects the shared memory region where per-port
  counters are copied. Avoids reading of half copied values in
  .get_stats64()

As part of this change, MIB reads were removed from .get_stats64() since
that callback can be started from an atomic context and must never sleep
(block) in this context. A shared memory region is provided which will be
updated periodically by MIB workqueue and .get_stats64() will simply return
data from the shared memory.

Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-16 00:10:56 +01:00
Pawel Dembicki
38ed1510db mac80211: mwl8k: inject DSSS Parameter Set element into beacons if missing
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Some Marvell AP firmware used with mwl8k misbehaves when beacons do not
contain the DSSS Parameter Set (WLAN_EID_DS_PARAMS) with the current
channel. When hostapd/mac80211 omits this element (which is valid on
some bands), the firmware may report bogus RX channel information and AP
mode becomes unusable.

Backport the upstream fix that ensures beacons always carry the DSSS
Parameter Set for mwl8k: when setting the beacon, detect if the element
is missing and inject it after SSID and Supported Rates (per spec
ordering). This mirrors behaviour in newer Marvell drivers and restores
stable operation.

Tested on Linksys EA4500 (88W8366).

Fixes: openwrt/openwrt#19088
Link: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git/commit/?id=c4e1ac09ee1c750890e36cb1f841f25518f23589

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20757
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 22:11:29 +01:00
Aleksander Jan Bajkowski
787c1106d5 kernel: backport upstream realtek PHY patches
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Changelog:
18aa36238a4d: net: phy: realtek: add interrupt support for RTL8221B
61958b33ef0b: net: phy: realtek: Add RTL8224 cable testing support
ffff5c8fc2af: net: phy: realtek: fix rtl8221b-vm-cg name
2c67301584f2: net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
f63f21e82eca: net: phy: realtek: support for TRIGGER_NETDEV_LINK on RTL8211E and RTL8211F
a9b24b3583ae: net: phy: realtek: add error handling to rtl8211f_get_wol

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20650
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 20:43:19 +01:00
Marcin Leksmark
35a86267e9 ramips: fix support for Cudy r700
This PR fixes support for Cudy r700.

Original PR: https://github.com/openwrt/openwrt/pull/18532
Fixed:

- WAN port functionality;
- RESET button;
- Status LED;
- LAN port names consistent with the chassis;
- Merged partitions "debug", "backup" & "firmware"  to one partition "firmware" ("debug" & "backup" contained unimportant data);
- Removed redundant DTS elements.

Installation:

To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade.

Recovery:

TFTP available.
1. Place the recovery.bin in the serving directory of your TFTP server.
2. Set your IP to 192.168.1.88/24.
3. Press the “Reset” button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the “Reset” button.
4. Power on the Cudy router.
5. You can release the reset button only when TFTP starts downloading firmware.
6. When the SYSTEM LED turns solid green, the upgrade is complete.

Fixes: 75403dd1d0 ("ramips: add support for Cudy R700")
Signed-off-by: Marcin Leksmark <lexmark3200@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20756
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 20:37:20 +01:00
Tianling Shen
2f184801c3 rockchip: add Radxa ROCK 2A/F support
Hardware
--------
RockChip RK3528 ARM64 (4 cores)
1/2/4GB LPDDR4 RAM
1x LED (state)
1x Reset button
0/8/16/32/64GB eMMC on-board
Micro-SD Slot
PCIe FPC connector
3x USB 2.0 Port
HDMI/AV OUT
USB Type-C 5V Power

ROCK 2A:
+ 3.5mm audio out
+ 1000 Base-T
+ SYS LED
+ USB 3.0 Port (conflicts with PCIe)

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
b400ef9dbc uboot-rockchip: add ROCK 2A/2F support
Add support for the Radxa ROCK 2A/2F board.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
da08958a30 rockchip: add Radxa E20C support
Hardware
--------
RockChip RK3528 ARM64 (4 cores)
1/2/4GB LPDDR4 RAM
2x 1000 Base-T
3x LEDs (LAN / SYS / WAN)
1x User button
0/8/16/32/64GB eMMC on-board
Micro-SD Slot
USB 2.0 Port
USB Type-C 5V2A Power

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
9aca1216d1 uboot-rockchip: add Radxa E20C support
Add support for the Radxa E20C board.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
decaf4cc7a uboot-rockchip: backport updates for RK3528
Added USB boot support and eMMC r/w fixes for RK3528.
Refreshed upstreamed patches while at it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
bdb269c163 rockchip: unset KERNEL_LOADADDR in default profile
Unset KERNEL_LOADADDR in default profile to avoid using the value
from other boards (if someone forgets to set KERNEL_LOADADDR).

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
9483f4459f rkbin: pack rk3528 atf/tpl blobs
Currently there's no usable mainline (open source) TF-A implementation
for rk3528 SoCs, so pack the prebuilt firmware from the vendor.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
221e6c845c rockchip: backport pending driver/dts updates for rk3528
Backport pending nvmem/thermal/usb updates for rk3528.
These patches are not merged by upstream yet but worthy to have here.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
97b90c5951 rockchip: backport dts updates for rk3528
Backport core dts updates for rk3528.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Tianling Shen
c7a26da60d rockchip: backport driver updates for rk3528
Backport clk/mac/phy driver updates for rk3528.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Link: https://github.com/openwrt/openwrt/pull/20375
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:56:27 +01:00
Liangbin Lian
d7530c1e54 rockchip: make NIC name predictable for LinkEase EasePi R1
The probe order for PCIe buses and devices is non-deterministic,
making the names eth2 and eth3 unpredictable (they may be swapped).

This patch fixes the names by referencing the device path using
`ucidef_set_network_device_path`.

This patch ensures that the OpenWrt interface name matches the case label.

Fixes: 8ca4caacd0 ("rockchip: Add support for RK3568 LinkEase EasePi R1")
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20779
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:48:47 +01:00
Zhi-Jun You
7ea377ed71 wifi-scripts: ucode: fix init value of config.ht_capab under 20MHz
Currently the path for setting 20MHz doesn't set ht_capab to '' at the
beginning which results in null in ht_capab in hostapd.conf.

Fix this by setting config.ht_capab to '' for 20MHz htmode.

Fixes: #20762

Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/20768
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:45:37 +01:00
John Audia
c4986bf921 intel-microcode: update to 2025111
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Change log: https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/tag/microcode-20251111

Build system: x86/64
Build-tested: x86/64-glibc
Run-tested: x86/64-glibc (Intel N150)

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/20774
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:28:03 +01:00
Álvaro Fernández Rojas
4b1c2fb270 odhcp6c: update to Git HEAD (2025-11-14)
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
cbc8ff0e6226 github: ci: add powerpc arch
8eba02233133 github: ci: add cmake build and source directories
5f3104ea17ae github: ci: disable json-c tests
27ff42cd40f9 scripts: devel-build: disable json-c tests
e0a9d02b52d1 dhcpv6: DHCPV6_OPT_INFO_REFRESH contains a 4 byte option
5a02da9c1200 dhcpv6: use compile time resolved sizeof(struct in6_addr) for IPv6 values
cf203ceb3fc8 dhcpv6: set a static define for DUID max length
3627e85d1540 dhcpv6: set static defines for DHCPv6 option header size
ecb9a0243e77 odhcp6c: RFC comments
c284c587d37d all: spell fixes
1259a32d7e4d dhcpv6: dhcpv6_handle_reply switch case handling
227280a37853 dhcpv6: dhcpv6_handle_advert; migrate if blocks to switch case
b253f8907e72 dhcpv6: migrate to switch case for dhcpv6_handle_reply
61a54db802cb dhcpv6: migrate to switch case for dhcpv6_handle_reply
49c64bbe00ba all: drop CER_ID
16ce83075b2e dhcpv6: refactor u8 and u16 to u32 to avoid boolean coercion

e5690c1f13...cbc8ff0e62

Options related to homenet (EXT_CER_ID) have been removed, so drop them from
the package.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20791
2025-11-15 16:41:29 +01:00
Sven Eckelmann
44976dcac4 realtek: dsa: Add MSTI to HW MST ID mapping
The MSTI range is 0..4095 but the HW range is only supporting a lower
range - for example 0..63 for RTL930x. But the HW doesn't really need to
know the actual MSTI. It is therefore possible to use a mapping from MSTI
to HW slot to allow a larger range of MSTIs.

Since the CIST (MSTI 0) is always needed, the mapping data structure is
skipping this entry and is always keeping the HW slot 0 for CIST.

This doesn't increase the total number of MSTIs a HW supports.

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Issam Hamdi
6c15c5d5eb realtek: dsa: rtl93xx: Support multi spanning tree states
The MSTP support (usually implemented by mstpd) requires from the kernel
that a VLAN can associated with an MSTI. At the moment, all these VLANs
just get the msti 0 harcoded on creation. But the
vlan_tables_read()+vlan_tables_write() helper already allow the
modification of the MSTI and only require a minimal hook to expose this
functionality.

It is also necessary to adjust the (M)STP states per MSTI and not only per
port (or for the CIST). The rtl83xx_port_stp_state_set() function was in
theory already capable to modify other MSTIs than CIST - if the msti would
not have been hardcoded to 0.

The userspace can trigger these modifications using netlink:

* (Re)associating VLANs with an MSTI:

      bridge vlan global set dev <BR> vid <X> msti <Y>

* Setting the port state in a given MSTI:

      bridge mst set dev <PORT> msti <Y> state <Z>

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Sven Eckelmann
5e77a81877 realtek: dsa: Sync CIST with MSTI state for unbridged ports
The VLANs and their MSTIs are shared on the realtek switch HW between
bridged and unbridged ports. But the MSTI state cannot be updated for an
unbridged port via DSA. To ensure that the port is still configured
correctly after leaving a bridge, the CIST state updates via DSA must also
be propagated to the MSTI states.

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Sven Eckelmann
5d36445dc1 realtek: dsa: Adjust MSTP states after joining/leaving bridge
When joining a bridge or leaving a bridge, the CIST state will
automatically be adjusted by DSA using .port_stp_state_set(). But MSTIs are
completely unhandled.

If a port is joining a bridge, the default state must be disabled. The MSTP
daemon is then responsible for adjusting the state.

If the bridge is left, the forwarding state must be enforced because VLANs
(and with this also the MSTIs assigned to them) are shared between bridged
and non-bridged ports. An unbridged port must therefore not be left in an
blocked/disabled state for a VLAN (MSTI).

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Sven Eckelmann
2d14c1008e realtek: dsa: Automatically return lost VLANs to CIST
If a VLAN doesn't have any members anymore, then it is removed and
implicitly returns back from any MSTI to CIST. The DSA layer will not
create any call to .vlan_msti_set and the driver is required to handle this
directly.

Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Sven Eckelmann
280cf19cdb realtek: dsa: Record number of supported MSTs
Each SoC supports a different number of MST(I)s. The code must know this
limitation to correctly reject unsupported MSTIs or to allocate a large
enough mapping table.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Issam Hamdi
9c2e8d6cef realtek: dsa: rtl93xx: Implement vlan fast age flushing
The DSA port code is trying to flush associated VLANs whenever the MST
state is changed. This functionality is available on a per port+vid based
using the L2_TBL_FLUSH_CTRL which is already used for the .port_fast_age
callbacks.

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Issam Hamdi
6236291cb4 realtek: dsa: rtl93xx: Switch to MSTP compatible STP mode
The realtek DSA switch driver sets up all VLANs using CIST. It is therefore
not necessary to enforce CIST using the ST_CTRL register.

This allows us later to overwrite the MSTI of VLANs. This is necessary to
get MSTP working on RTL93xx.

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20421
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 16:21:16 +01:00
Andy Chiang
337557a158 download: use reasonable timeout and retry parameters
Set a timeout of 5 seconds and 3 retries to reduce the time it takes for connection timeout.

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19977
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 15:47:23 +01:00
Roland Reinl
00bb18b851 ipq40xx: Add support for Linksys MR6350
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
This pull request is based on
- the discussions in https://forum.openwrt.org/t/adding-openwrt-support-for-linksys-mr6350
- https://github.com/openwrt/openwrt/pull/11405 which added support for similar devices.

Device Specs:
- IPQ4019
- Quad Core CPU
- 256 MB RAM
- 256 MB FLASH
- 4 LAN ports, 1 WAN port
- 2.4GHz (802.11n) and 5GHz (802.11c) wifi
- 3 LEDs (Red, blue, green) which are routed to one indicator at the top of the case
- 2 buttons (Reset, WPS)

Disassembling the device:
- There are 4 screws at the bottom of the device which must be removed
- Two are under the fron rubber feets
- Two are under the labels in the back (corner next to the rear rubber feets)

Serial interface:
- The serial interface is already populated on the device with a 6-pin header
- Pin 1 is next to the heatsink
- Pinout: 1: 3.3V, 2: TX, 3: RX, 4: unknown, 5: GND, 6: GND
- Settings: 115200, 8N1

Migrating to OpenWrt requires multiple steps:
- Load and boot the initramfs image
- Adapt U-Boot settings to support bigger kernels
- Flash the sysupgrade image

Load and boot initramfs:
- Connect serial interface
- Set up a TFTP server on IP 192.168.1.254
- Copy openwrt-ipq40xx-generic-linksys_mr6350-initramfs-zImage.itb to TFTP server
- Rename file to C0A80101.img
- Boot up the device and stop in U-Boot
- Run the following U-Boot commands after a link has been established:
  tftp
  bootm
- Initramfs image is started now.

Adapt U-Boot settings to support bigger kernels:
- Run "fw_printenv" in the initramfs image  after booting
- There should be an entry kernsize=300000 which indicates the maximum size for the kernel is 3MB
- Execute "fw_setenv kernsize 500000" to increase the max kernel size to 5MB
- Check that the change are applied with "fw_printenv"

Flash the sysupgrade image:
- Default sysupgrade routine either with a initramfs image containing LuCI or via command line.

Revert back to OEM firmware:
- Only tested with FW_MR6350_1.1.3.210129_prod.img
- Flash the OEM firmware via sysupgrade
- Forced update is required

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17977
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:28:22 +01:00
Christoph Krapp
0db1b11073 ipq40xx: add support for Netgear RBS20
This device has only half the flash and ram of the RBR20. It also has
two lan ports instead of wan and lan.

Hardware
--------
SOC:    Qualcomm IPQ4019
FLASH:  128MB (Winbond W29N01HVSINF)
RAM:    256MB (Winbond W632GU6MB-12)
WIFI:   Qualcomm IPQ4019
        Qualcomm Atheros QCA9886
ETH:    2x LAN
LED:    5 (4 RGB at top, 1 RG at back)
BTN:    WPS, Reset
UART:   115200 8N1 (dotted Pin = VCC) VCC-TX-RX-GND

MAC addresses
-------------
LAN     Label MAC (stored in boarddata1 offset 0x0)
2.4G    LAN
5GLow   LAN + 3 (stored in boarddata1 offset 0xc)
5GUpper LAN + 2 (stored in boarddata1 offset 0x12)

Installation
------------
Either use the vendor ui upgrade method or nmrpflash to install the
factory image.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20560
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:24:50 +01:00
Christoph Krapp
251d551fa6 ipq40xx: add support for Netgear RBR20
This device shares a lot of similarities with the LBR20 - the RBR20 just
misses the LTE modem and its formfactor is alot smaller. Other than that
the LED configuration matches other RBR devices but the RBR20 has less
LEDs than its larger counterparts.

Hardware
--------
SOC:    Qualcomm IPQ4019
FLASH:	256MB (Winbond W29N02GVSIAF)
RAM:  	512MB (Nanya NT5CC256M16EP-EK)
WIFI:   Qualcomm IPQ4019
        Qualcomm Atheros QCA9886
ETH:	1x WAN, 1x LAN
LED:	5 (4 RGB at top, 1 RG at back)
BTN:	WPS, Reset
UART:	115200 8N1 (dotted Pin = VCC) VCC-TX-RX-GND

MAC addresses
-------------
LAN	Label MAC (stored in boarddata1 offset 0x0)
WAN	LAN + 1 (stored in boarddata1 offset 0x6)
2.4G	LAN
5GLow	LAN + 3 (stored in boarddata1 offset 0xc)
5GUpper LAN + 2 (stored in boarddata1 offset 0x12)

Installation
------------
Either use the vendor ui upgrade method or nmrpflash to install the
factory image.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20560
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:24:50 +01:00
Robert Marko
14446b3201 ipq-wifi: update to Git HEAD (2025-11-15)
fa62f8a2885c ipq8074: add BDF for Zyxel NWA210AX
7c6b7545f69a qca4019: qca9888: add bdfs for Netgear RBK20

Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:23:21 +01:00
Issam Hamdi
22178914c6 realtek: dsa: rtl93xx: Configure default QoS prioritization
RTL838x+RTL839x both configure a default QoS behavior with a default
mapping. This also needs to be added to RTL93xx to ensure a consistent
behavior:

* Set the default mapping between DSCP and priority: prio = dscp >> 3.
* Set the default mapping between internal priority and queues
* Set uniform prioritization of queues (as with other SoCs)

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20640
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:19:46 +01:00
Sven Eckelmann
d78a2a6597 realtek: rtl93xx: Send per port packets on physical port
If link aggregation with LACP is activated, we must send out the LACP
packets on the physical port and not on a logic port. Otherwise, the per
port packets might be (rebalanced) between the different ports in a link
aggregation group.

Such rebalancing breaks 802.3ad and will leave ports in a churned state.

Fixes: 8c42e63a69 ("realtek: rtl93xx: fix incorrect destination port selection")
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20728
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:18:18 +01:00
Sven Eckelmann
993a44b24c realtek: dsa: Add non-primary LAG ports to port matrix
If ports of a RTL93xx switch are not added to a port matrix then they are
not used for the link aggregation. As result, communication will then just
break on non-primary interfaces.

This can be reproduced in balanced-xor and 802.3ad bandwidth mode.

Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20729
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:17:21 +01:00
Jonas Jelonek
203b8886bd realtek: pcs: rtl93xx: fix SerDes polarity configuration for RTL931X
Commit 56e9a73d0b added support for configuring the SerDes polarity for
both RTL930X and RTL931X. Based on the code in the Realtek SDK in [1]
and [2], in both cases the same register bits are set. Thus, a common
implementation was provided which worked with e.g. USXGMII or 10GBase-R
configured SerDes.

However, after further tests, a strange issue occured where it didn't
work that well for all SerDes configurations. While running fine for
10GBase-R links on two adjacent SerDes, it didn't for 1000Base-X links
on one of two adjacent SerDes with the link not being detected as a
symptom.

Diving into the SDK again revealed that the referenced implementation of
polarity configuration is (by accident or by purpose) misleading. While
[1] and [3] for RTL930X match, [2] and [4] for RTL931X actually don't.
[4] writes the bits for the 1G polarity setting on different background
SerDes, thus in another frontend page.

Split implementations for RTL930X and RTL931X again and adjust the one
for RTL931X according to [4]. This resolves the issues with 1000Base-X
behavior.

[1] 69d2890a2e/sources/rtk-xgs1210/src/hal/phy/phy_rtl9300.c (L1384)
[2] 69d2890a2e/sources/rtk-xgs1210/src/hal/phy/phy_rtl9310.c (L3479)
[3] 69d2890a2e/sources/rtk-xgs1210/src/dal/longan/dal_longan_construct.c (L2246)
[4] 69d2890a2e/sources/rtk-xgs1210/src/dal/mango/dal_mango_construct.c (L1550)

Fixes: 56e9a73d0b ("realtek: pcs: rtl93xx: provide proper SerDes polarity
configuration")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20767
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:16:20 +01:00
Daniel Golle
e811e6480a ath79: fix MAC addresses on MikroTik RB962UiGS-5HacT2HnT
The MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac) currently comes up
with random MAC addresses. Assign the MAC addresses from hard_config for
LAN and WAN ports.

Fixes: c2140e32ce ("ath79: add support for MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac)")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/20782
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:15:29 +01:00
Rany Hany
6df060ba4a wifi-scripts: ucode: create wpa_psk_file and sae_password_file when needed
This handles the case when 'wpad' or 'wpad-mini' package is used which is
missing WPA3 support. This makes it impossible to use ucode wifi-scripts
on such APs as it will raise an error:

   daemon.err hostapd: Line 87: unknown configuration item 'sae_password_file'

This also achieves parity with what is currently happening with old wifi-scripts.
The behavior now matches.

Fixes: https://github.com/openwrt/openwrt/issues/20781
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20784
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:13:36 +01:00
Álvaro Fernández Rojas
27c9b706e7 libubox: update to Git HEAD (2025-11-14)
a75209f62982 blobmsg: refactor blobmsg_cast_u64/s64
97d1839295e5 github: ci: minor fixes
e8dafede37fc github: ci: add powerpc arch
c1f0024fb052 github: ci: add cmake build and source directories
4dd874d2b412 github: ci: tests: rename test step
7686b12d11ba github: ci: tests: add build/bin to path
be21d12b2bed github: ci: disable json-c tests
af438ba0705f scripts: devel-build: disable json-c tests
240d2d5ef58b tests: shunit2: add test for _jshn_append leading space fix
82cb5fd66af9 libubox: Drop extraneous space when appending values to variable
17143f94dcbf libubox: add a simple build script
5b11fb18dc05 github: ci: add tests

e357be611c...a75209f629

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-11-15 08:22:24 +01:00
Daniel Golle
971c058cf5 mediatek: add mt7987-2p5g-phy-firmware to MT7987 devices
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Add mt7987-2p5g-phy-firmware to DEVICES_PACKAGES of the MT7987A RFB as
well as the BananaPi R4 Lite.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-11-14 02:25:15 +00:00
Daniel Golle
60fc2918dc linux-firmware: package mt7987-2p5g-phy-firmware
Package firmware for the built-in 2.5G PHY of the MediaTek MT7987 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2025-11-14 02:25:15 +00:00