Commit Graph

65196 Commits

Author SHA1 Message Date
Markus Stockhausen
07a04d8485 realtek: RTL930x: reorganize mdio functions and SerDes register layout
The RTL930x mdio functions are scattered around the code. Relocate
them to the bus (still inside the ethernet driver). With this change
the phy identification looks into the proper registers. The SerDes
phy identifier (register 2/3) must be changed.

Additionally provide a consistent SerDes register access through the
mdio bus. Until now when a SerDes directly drives a SFP module there
is no clear rule of how to handle its register set that consists of
two parts:

- c22 phy registers 0-15 live in the fiber page (2) of the SerDes
- other SerDes specific registers exist in pages before and after

The mdio bus and other SerDes functions are a wild mix of directly
looking into page 2 or just using self defined methods to access
data.

Adapt the bus to the new consistent phy interface that mixes the
SerDes register set like classic Realtek phys do it.

- Use register 31 as page select (already in the bus)
- Always keep the common registers 0-15 in place and read fiber page
- Map the SerDes internal registers into the upper vendor specific
  registers 16-23 according to the page select register (31).

That gives a register mapping as follows:

+-----------------------+-----------------------+---------------+-------------+
| reg 0x00-0x0f         | reg 0x10-0x17         | reg 0x18-0x1e | reg 0x1f    |
+-----------------------+-----------------------+---------------+-------------+
| SerDes fiber page (3) | real SerDes registers | zero          | SerDes page |
| registers 0 - 15      | in packages of 8      |               | select reg  |
+-----------------------+-----------------------+---------------+-------------+

Example to make it as clear as possible.

SerDes registers on a RTL930x show

Page / Reg   | 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B ...
-------------+----------------------------------------------------------------
0 - SDS      | 0C03 0F00 7060 7106 074D 0EBF 0F0F 0359 5248 0000 0F80 0000 ...
1 - SDS_EXT  | 0000 0000 85FA 8C6D 5CCC 0000 20D8 0003 79AA 8C64 00C3 1482 ...
2 - FIB      | 1140 6189 001C CA40 01A0 0000 0000 0004 0000 0000 0000 0000 ...
3 - FIB_EXT  | 1140 6109 001C CA40 01A0 0000 0000 0004 0000 0000 0000 0000 ...

This translates to this phy layout

             | SerDes fiber registers  normal SerDes registers  zero     p.sel
Page / Reg   | 0x00 0x01 0x02 0x03 ... 0x10 0x11 0x12 0x13 ...  0x18 ... 0x1f
-------------+---------------------------------------------------------------
0            | 1140 6189 001C CA40 ... 0C03 0F00 7060 7106 ...  0000 ... 0000
1            | 1140 6189 001C CA40 ... 5248 0000 0F80 0000 ...  0000 ... 0001
...
4            | 1140 6189 001C CA40 ... 0000 0000 85FA 8C6D ...  0000 ... 0004

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19692
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-10 11:47:30 +02:00
Markus Stockhausen
7cf7f7c6b9 realtek: add NAND targets for RTL93xx
Some known RTL93xx devices like the Linksys LGS328C or LGS352C are
NAND based. These require additional drivers and packages (e.g. UBI).
The current subtargets are already taylored down for devices with
only 16MB flash. Adding features that are not used will only make
the storage situation more complicated.

Add two new subtargets for RTL93xx that include the basic NAND, UBI
and MTD features. To achieve this do the following:

- Create new subtarget folders
- Copy the existing config and makefiles over
- Add the basic additional features
- Mark them as SOURCE-ONLY
- Add empty image makefiles
- Remove unneded NAND/MTD features from existing configs

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19700
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-10 11:46:52 +02:00
Robert Marko
7bc227b82d gcc: 15.x: update to 15.2
Update GCC15 to 15.2 to include upstream bugfixes.

Link: https://github.com/openwrt/openwrt/pull/19713
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-10 11:43:07 +02:00
Felix Fietkau
aa0b5eb429 wifi-scripts: ucode: fix unencrypted sta connection
add missing key_mgmt option

Fixes: https://github.com/openwrt/openwrt/issues/17578
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-10 10:17:41 +02:00
Felix Fietkau
886c4f054e mac80211: fix division by zero in expected throughput estimation
Fixes: https://github.com/openwrt/openwrt/issues/19729
Fixes: f10732fb56 ("mac80211: estimate expected throughput if not provided by driver/rc")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-09 16:48:33 +02:00
Felix Fietkau
7df4f7d709 rpcd: update to Git HEAD (2025-08-09)
1905e096a8b7 ucode: adjust for new ext resource type

Fixes: https://github.com/openwrt/rpcd/issues/17
Fixes: https://github.com/openwrt/luci/issues/7878
Fixes: https://github.com/openwrt/openwrt/issues/19726
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-09 15:56:20 +02:00
Felix Fietkau
f650f2975c netifd: add missing dependencies
Fixes: https://github.com/openwrt/openwrt/issues/19704
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-09 09:25:47 +02:00
Felix Fietkau
3aee42001f wifi-scripts: add modular wps button handler scripts
Execute scripts in /etc/rc.wps until one of them returns a exit code of 0.
Split up sta and ap handling of wps into separate scripts.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-08 18:53:30 +02:00
Markus Stockhausen
8eea855846 realtek: switch Zyxel GS1900 initramfs recipe to rt-loader
These devices need a tiny (<8MB) initramfs. There are first
occurrences where this fails with newer kernels and diagnostic
packages.

Switch the recipe over to use lzma compression and rt-loader.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19687
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:29:21 +02:00
Coia Prant
ebee946227 ramips: add support for Hongdian H7920 v40
This is an industrial 4G router equipped with OpenWrt SNAPSHOT OEM
customized version

WARNING: The original firmware device tree is modified from evb
boards, and the device tree name is evb board. This submitted device
tree is a modified version, which deletes the non-this-device parts
and adds GPIO watchdog.

Specification:
- SoC: MediaTek MT7628NN
- Flash: 16 MB
- RAM: 128 MB
- Power: DC 5V-36V 1.5A
- Ethernet: 1x WAN [slot not install], 1x LAN (10/100 Mbps)
- Wireless radio: 802.11n 2.4g-only [antenna not install]
- LED:
  System/Power (RUN): GPIO/37 active-low
  Modem: GPIO/3 active-low
  RF (Modem Signal): GPIO/2 active-low
- Button:
  WPS / RESET: GPIO/11 active-low
- UART: 1x UART on PCB - 115200 8N1
- Serial / COM: 1X RS232/RS485 on board (GPIO/6 hi:RS485 lo:RS232)
- GPIO Watchdog: GPIO/0 mode=toggle timeout=1s
- Modem: 1x Built-in modem on board (Power: GPIO/4 active-high)
- PCIe: 1x miniPCIe for modem [slot not install]
- SIM Slots: 1x SIM Slots

Issue:
- Factory partition not store mac address on original firmware

Flash instruction:
Using SSH/Telnet:
1. Connect the board to the computer via RJ45 Ethernet
2. Login 192.168.8.1 with root password "superzxmn" (SSH Port 22, Telnet Port 5188)
3. Download openwrt firmware on the computer.
4. Use scp or sftp put firmware to board /tmp
5. Use command "mtd -r write openwrt-ramips-mt76x8-hongdian_h7920-v40-squashfs-sysupgrade.bin firmware"
   to flash

Original Firmware Dump / More details:
https://blog.gov.cooking/archives/research-hongdian-h7920-v40-and-flash.html

Signed-off-by: Coia Prant <coiaprant@gmail.com>
Tested-by: Coia Prant <coiaprant@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17726
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:15:51 +02:00
Andrii Kuiukoff
2fea2ede63 mediatek: add support for CreatLentem CLT-R30B1
CreatLentem CLT-R30B1 is a wireless WiFi 6 router.
This device uses the CLT-R30B1_0824_V1.1 board
shared by EDUP RT2980, Dragonglass DXG21,
and other diamond-shaped 5-antenna routers.

Specification
-------------
- SoC          : MediaTek MT7981B dual-core ARM Cortex-A53 1.3 GHz
- RAM          : DDR3 256 MiB
- Flash        : SPI-NAND 128 MiB (ESMT F50L1G41LB)
- WLAN         : MediaTek MT7976CN dual-band WiFi 6
  - 2.4 GHz    : b/g/n/ax, MU-MIMO (2x 5 dBi antennas)
  - 5 GHz      : a/n/ac/ax, MU-MIMO (3x 5 dBi antennas)
- Ethernet     :
  - LAN x3     : 10/100/1000 Mbps (MediaTek MT7531AE)
  - WAN x1     : 10/100/1000 Mbps (MT7981 internal PHY)
- UART         : through-hole on PCB
  - assignment : (RX), (TX), (GND), [3.3V]
  - settings   : 115200n8
- Buttons x2   : Mesh/WPS, Reset
- LEDs x2      : Status (Red, Green)
- Power        : 12 VDC, 1 A, 2.1*5.5 mm

Important notes
---------------
The device is supplied in two variants.
The main difference is the size of the mtd5 (ubi)
partition in the flash layout: 64M or 112M.
112M version: Has ImmortalWrt firmware installed with LuCI WebUI.
64M version: Has stock firmware based on OpenWrt,
with the WaveLink/GL.iNet WebUI and older U-Boot
compared to the 112M version.

Flash instructions for 112M version
-----------------------------------
Follow the standard OpenWrt sysupgrade procedure without saving data.
Use the clt-r30b1-112m-squashfs-sysupgrade.bin image.
All checks should pass - don't proceed if a "not supported"
warning is issued.

Flash instructions for 64M version
----------------------------------
WebUI Method:

1. Prepare the upgrade image with clt-r30b1-squashfs-sysupgrade.bin
   using the script: make_staged_upgrade_tar.sh
   or use the prepared image: staged_openwrt_upgrade.bin
   Downloaded from:
   https://github.com/andros-ua/owrt-misc/tree/main/clt-r30b1
2. Install the prepared image using the stock WebUI update page.
3. Press and hold the reset button after reboot
   to wipe the stock config and gain access.

SSH Method:

1. Connect via SSH using dg:ivanlee credentials.
2. Upload the clt-r30b1-squashfs-sysupgrade.bin image.
3. Use the command: sysupgrade -n
   All checks should pass - don't proceed if a "not supported"
   warning is issued.

Return to stock
---------------
Flash a backup of the ubi mtdblock (mtd5)
using the OpenWrt sysupgrade method.

Recovery
--------
Both variants:
Connect UART and use the U-Boot menu to flash the firmware image
or boot an OpenWrt initramfs image.

112M with newer U-Boot:
Power on the router while pressing the mesh button for 3 seconds.
The U-Boot Flash WebUI will be available at http://192.168.1.1

MAC Addresses:
-------------------------------------------------------
| Interface    |  MAC              | Source           |
---------------|-------------------|-------------------
| LAN          | B4:4D:43:D1:xx:xx | Factory, 0x2A    |
| WAN          | B4:4D:43:D1:xx:xx | Factory, 0x24    |
| WLAN 2.4 GHz | B4:4D:43:D2:xx:xx | Factory, 0x4     |
| WLAN 5 GHz   | B4:4D:43:D2:xx:xx | Factory, 0x4 + 1 |
-------------------------------------------------------

Signed-off-by: Andrii Kuiukoff <andros.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19534
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:12:50 +02:00
Thomas Richard
96be6d4f8a kernel: usb: fix dependencies for kmod-cdns3 and kmod-cdns
The cdns3 driver can be built without usb host mode support. Fix
dependencies to handle the case it is built with only gadget support.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:06:51 +02:00
Thomas Richard
0546f8b74d kernel: usb: kmod-usb-dwc3: add gadget and dual-role modes support
Build DWC3 driver in the right mode:
- host mode if kernel have usb host support only.
- gadget mode if kernel have usbgadget support only.
- dual-role mode if kernel have both usb host and usbgadget support.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:06:51 +02:00
Thomas Richard
0f782fc2e9 kernel: usb: fix dependencies for kmod-usb-roles package
The usb role driver does not depend on the kernel config CONFIG_USB (host
side support). It only depends on the kernel config CONFIG_USB_SUPPORT.

Now it depends on the OpenWrt configurations USB_SUPPORT or
USB_GADGET_SUPPORT (usb and usbgadget features). We can assume that if usb
or usbgadget features are set, CONFIG_USB_SUPPORT has been set in the
target/subtarget kernel config.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:06:51 +02:00
Thomas Richard
65aea930a5 kernel: usb: gadget drivers do not depend on usb host support
The usb gadget drivers don't depend on usb host support, so fix the package
dependencies accordingly.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:06:51 +02:00
Thomas Richard
defce7cefd kernel: usb: add kmod-usb-common package
Move usb-common driver from usb-core package to a new usb-common package.
The usb-common driver is needed by usb-gadget driver which can be used
without host support.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://github.com/openwrt/openwrt/pull/19246
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:06:51 +02:00
Markus Stockhausen
5f06b8ebbc realtek: dsa: rename tagged_ports to member_ports
The current variables tagged_ports and untagged_ports suggest that
these are distinct and describe only the ports in each of these
configuration types.

That is wrong. The hardware is configured via member ports and
untagged ports. The first one being a superset of the second.
Rename the variables to reflect that.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19684
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 18:04:57 +02:00
Harshal Gohel
f6603de71d realtek: rtl93xx: Add learning and flooding enable/disable
Both RTL930x and RTL931x were missing the code to support enabling and
disabling MAC address learning and unknown unicast flooding on a per-port
basis.

* rtl93*x_enable_learning() allows toggling of dynamic MAC learning on
  individual ports by modifying the L2 learning constraint control
  register.
* rtl93*x_enable_flood() provides the ability to control unknown unicast
  flooding behavior, disabling forwarding when set. If it is enabled, it
  will just forward it. If it is disabled, packets will simply be dropped.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19581
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 13:56:58 +02:00
Markus Stockhausen
1a235a7f0b mediatek: filogic: Add support for Wavlink WL-WN551X3
Hardware
--------
- SOC: MediaTek MT7981B
- RAM: 256MB DDR3
- FLASH: 128MB SPI-NAND WinBond W25N01GVZEIG
- NETWORK: 2x1Gb Lan 1x1Gb Wan
- WIFI: MediaTek MT7981B 2x2 DBDC 802.11ax 2T2R (2.4/5)
- LEDs: 3x WAN/LAN (green) 2x STATUS (red/blue)
- USB: 1x XHCI

Installation via Webinterface
-----------------------------

1. Rename OpenWrt sysupgrade bin to wavlink_wl-wn551X3-squashfs-sysupgrade.bin
   The uppercase chars 551X3 are essential and checked by web interface.
2. Logon to webinterface
3. Go to network configuration -> mode selection
4. Choose mode "LAN bridge/access point"
5. Save configuration (maybe network reconfig needed)
6. Go to system upgrade
7. Choose local upgrade and provide renamed sysupgrade file
8. Start upgrade and wait for completion
9. Logon to OpenWrt (network config is preserved during upgrade)

Boot initramfs via TFTP & console
---------------------------------

1. Connect switch to network via LAN1 or LAN2
2. Power on switch
3. Press ESC until prompt reached "MT7981>"
4. Set own IP "setenv ipaddr 192.168.x.y"
5. Set TFTP IP "setenv serverip 192.168.a.b"
6. Set memory address "setenv loadaddr 0x46000000"
7. Download image "tftpboot openwrt-mediatek-filogic-wavlink_wl-wn551x3-initramfs.itb"
8. Boot image "bootm"

Notes
-----

- The red/blue LEDs give a background illumination to the top of the
  case. The red LED is totally disabled to avoid noisy blinking.

- Aside from the design and the different LED colors & placements
  the hardware and partitioning  matches the WAVLINK WL-WN586X3 Rev B.
  Therefor a common DTSI was prepared.

MAC Addresses (same as stock)
-----------------------------

LAN   : 80:3F:5D:xx:xx:B1 (hw, 0x44e(text))
WAN   : 80:3F:5D:xx:xx:B2 (hw, 0x460(text))
2.4GHz: 80:3F:5D:xx:xx:B1 (Factory, 0x4 (hex))
5GHz  : driver auto generated

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19515
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-08 12:22:38 +02:00
Nick Hainke
56b083221f strace: update to 6.15
Release Notes:
- https://github.com/strace/strace/releases/tag/v6.15

Link: https://github.com/openwrt/openwrt/pull/19643
Signed-off-by: Nick Hainke <vincent@systemli.org>
2025-08-07 22:44:21 +02:00
Jan Taczanowski
8a9b9e928e mpc85xx: HPE MSM460 add HPE MSM430 alias
Define MSM430 as alternative name, to explicitly show the device is
supported using existing image (MSM460).

I can confirm that the guide from
https://github.com/blocktrron/msm460-flashing works perfectly fine with
the HP MSM430 as well.

In fact, the MSM430 running the original firmware operates as
a 2x3:2 access point, but after flashing it with OpenWRT, it functions
as a 3x3:3 access point — just like the MSM460 model.

It seems that the MSM430 is essentially the same hardware as the MSM460,
with limitations imposed by the original (HP) software.

Signed-off-by: Jan Taczanowski <jan.taczanowski@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19540
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:53:49 +02:00
Rani Hod
cbc2cdbb80 ramips: mt76x8: add support for Wodesys WD-R1208U
This commit adds support for a dual-band AC1200 wall plug
manufactured by Shenzhen Century Xinyang Tech Co., Ltd.

SoC:     Mediatek MT7628AN (MIPS 24KEc single core, 580 MHz)
RAM:     128 MiB DDR2 (Hynix HY5PS1G1631C)
ROM:     8 MiB SPI NOR (Zbit ZB25VQ64ASIG)
Wired:   one FE RJ45 port (+ an unpopulated footprint for a 2nd)
WiFi:    Mediatek MT7612E
Ant.:    four 2 dBi external antennas (two 2.4GHz, two 5 GHz)
LEDs:    - Power    (green, always on)
         - 2.4G     (green, controlled by MT7628)
         - 5G       (green, controlled by MT7612)
         - Extender (green, GPIO 37, used as status LED)
         - LAN      (green/yellow, controlled by RT3050 ESW)
Buttons: WPS and reset (both connected to GPIO 38)
Power:   5V 2-pin JST-XH on main PCB
         110/220V AC to 5V 1.5A DC on auxiliary PCB
UART:    57600 8n1 3.3v, holes available on the PCB as J5
         pinout is (Gnd) (Tx) (Rx)
MAC:     1C:BF:CE:xx:xx:xx       (2.4 GHz, label)
         1C:BF:CE:xx:xx:xx + 1   (LAN)
         1C:BF:CE:xx:xx:xx + 2   (WAN, not in use)
         1C:BF:CE:xx:xx:xx + 3   (5 GHz)

Original firmware is Chaos Calmer 15.05.01 (kernel 3.10.108)
with a few custom packages and a non-LuCI web interface.
Telnet is enabled, requiring an unknown root password [1].
Root password is also needed to access the router via UART console,
but passwordless telnet can be enabled via a trivial web exploit [2]
and then the root password can be removed by editing `/etc/shadow`.

Installation: Upload `sysupgrade` binary via web interface at
  `http://192.168.188.1/settings.shtml`. Alternatively, remove
  root password and use u-boot menu to flash image via TFTP.

Notes:
- Device model in Chaos Calmer is "mtk-apsoc-demo".
- It is sold under several brands, e.g., Fenvi and Linkavenir.
  It is available in two colors: white and black.
- PCB is marked "WD206AD v1.0".
- Instead of a standard ethernet transformer, the PCB has a few tiny
  SMD coils.
- The housing is identical to the one used by a 2020 model,
  WD-R1203U, which is RTL8812-based. The older model has an FCC
  listing with external and internal images: ZNPWD-R1203U.
  The FCC listing contains a letter [3] claiming WD-R1203U and
  WD-R1208U are internally identical, but evidently they are not.

[1] root:$1$7rmMiPJj$91iv9LWhfkZE/t7aCBdo.0:18388:0:99999:7:::
    This is the same hash as in Wodesys WD-R1802U.
    There are other root password hashes in `/etc/shadow_sf` and
    `/etc/shadow_yn`.
[2] curl -X POST http://192.168.188.1/cgi-bin/adm.cgi \
    -d page=Lang -d langType="en;killall telnetd;telnetd -l /bin/sh"
[3] https://fcc.report/FCC-ID/ZNPWD-R1203U/4767033

Signed-off-by: Rani Hod <rani.hod@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19535
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:48:54 +02:00
Harshal Gohel
4c4cecab2f realtek: rtl93xx: Add GPIO access register definitions
mach-rtl83xx.h contained the required register definitions for older SoC
families but was missing it for RTL930x and RTL931x.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19574
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:40:30 +02:00
Sven Eckelmann
92489f50c7 realtek: rtl931x: Fix size of TRK_MBR_CTRL group block
Each MBR ctrl block has 64 bits to store the 56 possible ports. The offsets
between the groups is therefore also 64 bit.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19574
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:40:30 +02:00
Harshal Gohel
62938204db realtek: rtl931x: Add smi_poll_ctrl
The comment incorrectly stated that RTL931X doesn't have smi_poll_ctrl. But
there is actually a register for using it.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19574
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:40:30 +02:00
Harshal Gohel
56499702a3 realtek: rtl931x: Sync family parameters with RTL930x
Some of the parameters added to RTL9300_FAMILY_ID are missing for
RTL9310_FAMILY_ID. Simply add the missing ones to keep sharing code between
the two SoCs.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19574
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:40:30 +02:00
Harshal Gohel
e45d783bce realtek: rtl931x: Fix VLAN tagging and untagging
* In RTL931x, bit 31 of the (4th column) of 802_1Q_VLAN_QINQ table
  indicates the validity of l2 tunnel. Before bit 63 (3rd column)
  was being checked for validity of l2 tunnel.

* The untagged_ports requires 64 bits to represent 56 ports. Do not
  store u64 in u32 variable

* First 24 ports are represented in the 2nd register not just first 20

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19576
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:33:09 +02:00
Jiasheng Zhu
536a25ebf8 mediatek: add support for OpenFi 6C
OpenFi 6C is a portable Wi-Fi 6 travel router based on MediaTek MT7981B+MT7976CN.

Two slightly different versions have been sold. The V1 board has a green color and lacks the modem LED. The V2 board is black and has a LED for the modem. The firmware should work on both of them.

Specifications:
- SoC: MediaTek MT7981B (Filogic 820) 1.3GHz dual-core ARM Cortex-A53
- RAM: 1GB DDR4
- Flash: 256MB SPI NAND
- Wireless: 2.4GHz/5GHz 802.11ax
- Ethernet: 1x 10/100/1000M LAN
- USB: 1x USB 3.0 Type-A port
- Expansion: M.2 slot for 5G modem
- Cooling: PWM-controlled fan
- Buttons: Reset, Mode switch
- LEDs: System, Ethernet, 5G WiFi, Modem status

**Installation via U-Boot web page**

1. Set static IP 192.168.21.2/255.255.255.0 on your computer.
2. Connect to the Ethernet port and hold the reset button while booting the device. Wait for 6-8 seconds, and release the reset button.
3. Open U-boot web page on your browser at http://192.168.21.1
4. Select the OpenWRT sysupgrade image, upload it, and start the upgrade.
5. Wait for automatic reboot.

**Installation via sysupgrade**

Flash the sysupgrade file via LuCI upgrade page without saving the settings.

Signed-off-by: Jiasheng Zhu <newbanyaya@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19512
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 18:17:10 +02:00
Shiji Yang
c65ae24cf1 uboot-envtools: ramips: add env config for SIM SIMAX1800U
This newly supported device has the same env partition size and
offset as SIMAX1800T.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19455
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 17:41:54 +02:00
Shiji Yang
1199a7aad6 ramips: add support for SIM SIMAX1800U
SIM SIMAX1800U has the similar hardware design as the SIMAX1800T. The
only difference is the Ethernet portmap.

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 SIMAX1800U. 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   | 98:xx:xx:xx:xx:b2 |
| LAN     | 98:xx:xx:xx:xx:b5 |
| WAN     | 98:xx:xx:xx:xx:b2 |
| WLAN2G  | 98:xx:xx:xx:xx:b4 |
| WLAN5G  | 9a:xx:xx:xx:xx:b4 |
+---------+-------------------+

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

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19455
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 17:41:54 +02:00
Felix Golatofski
9ce23ac840 ath79: fix LED GPIOs for COMFAST CF-EW71 v2
The vendor DTS defined incorrect GPIOs for the LEDs, which caused them
to not function properly. Initially, the WAN, WLAN LEDs appeared to
work, but further testing showed that they were non-functional.

This patch corrects the GPIO assignments in the DTS, restoring full LED
functionality including blinking, except the power LED which cannot be
software controlled.

Tested on a CF-EW71 v2 unit.

Fixes: ee3a6adc6c ("ath79: add support for Comfast CF-EW71 v2")
Signed-off-by: Felix Golatofski <git@xdfr.de>
Link: https://github.com/openwrt/openwrt/pull/19665
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 17:35:59 +02:00
Issam Hamdi
feec7cf34d realtek: dsa: rtl83xx: flush scheduled work on removal
The workqueue items don't need to be processed directly when they are
scheduled. It can happen that they are simply processed at a much later
time. It is therefore necessary to ensure that all workqueue items of a
driver are no longer being processed before the driver (or structures of
this driver) are destroyed.

When skipping this step, the driver driver can cause a kernel Oops on
reboot.

Unfortunately, it is not recommended [1] to flush items out of the system
workqueue - simply because this can cause deadlocks. The driver itself must
have a private workqueue which is then flushed.

[1] https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp

Signed-off-by: Issam Hamdi <ih@simonwunderlich.de>
Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19570
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 17:29:14 +02:00
Andres Heinloo
0fa192a3a2 kernel: Add kmod-w1-slave-ds2438
This patch adds support for building the ds2438 one-wire kernel module.

Signed-off-by: Andres Heinloo <andres@gfz.de>
Link: https://github.com/openwrt/openwrt/pull/19694
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:56:09 +02:00
Konstantin Demin
68e5f46899 dropbear: relax path permission checks for authorized keys
Check permissions of correct folder for certificates too.

Fixes: bbe4d6ddb2 ("dropbear: bump to 2025.88")
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19611
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:46:30 +02:00
Konstantin Demin
27baa3c731 dropbear: fix FTBFS when CONFIG_DROPBEAR_SVR_PUBKEY_OPTIONS is not enabled
While this is discouraged to disable this option, both upstream and OpenWrt allows one to do it.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19611
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:44:11 +02:00
Konstantin Demin
07b20b6d35 dropbear: fix typos in path configuration
Replace _FILE with _PATH

Fixes: d8ff2d8cba ("dropbear: refactor configuration")
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19611
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:43:59 +02:00
Harshal Gohel
6473e3ed5e realtek: rtl931x: Fix link status get not fetching correct status
Just like rtl930x, rtl931x also requires two reads to fetch current link
status.

While at it, rename the function to a proper naming scheme.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Co-developed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19578
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:01:51 +02:00
Harshal Gohel
445af8c038 realtek: rtl930x: Fetch link status for all ports in switch IRQ
Link status needs to be read twice, and a single register value is
enough for determining link status for all the ports

It is not necessary to go through each potential port separately and later
actually identify for which ports the interrupt actually was. The helper
for_each_set_bit() directly iterate through all set bits.

While at it, rename the function to a proper naming scheme.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19578
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 16:01:51 +02:00
Harshal Gohel
9ccfca3303 realtek: dsa: enhance pcs_get_state() for RTL93xx
Currently the SerDes driven SFP ports give strange ethtool readings
on RTL93xx devices. Especially duplex and speed are shown even if
no link is up and running. That leads to confusion because the MAC
reports arbitrary values.

Enhance the readout by refactoring the pcs_get_state() function.
Calculate speed/duplex/pause only if link is detected.

Suggested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19575
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 15:50:01 +02:00
Harshal Gohel
2645c4afbb realtek: rtl93xx: Do not use media register to get link status
The media_sts register only shows type of link, fiber/copper,
and has nothing to do with the link status

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Signed-off-by: Sharadanand Karanjkar <sk@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19575
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 15:50:01 +02:00
Felix Fietkau
71c85bd88a procd: update to Git HEAD (2025-08-07)
84372dab89a8 hotplug: switch to using avl tree for hotplug subsystems
4d023b8a8c51 hotplug: send event notifications
467800980021 hotplug: ensure that the button subsystem is always registered

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-07 15:45:10 +02:00
Steve Wavler
4880e8e338 x86: add board mapping for Sophos XG 210r3
Sophos XG 210r3 is a rackmounted x86 based firewall with 6 RJ-45 gigabit
ethernet ports (eth0-5) and 2 SFP gigabit ethernet ports (eth6, eth7)
all running Intel NICs supported by igb driver. This board update maps
eth0 (left most RJ-45 port) as wan and eth1-7 as lan.

Signed-off-by: Steve Wavler <trenchcoatjedi@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19647
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 14:07:42 +02:00
Steve Wavler
2c3b1f41d9 kernel: Add kmod-sfc-siena for Solarflare SFN5000/6000 series NICs
kmod-sfc should add support for Solarflare SFC9000 series based cards.
However after kernel 5.19, support for the 'Siena' subclass of
SFN5000/6000 devices has been separated out since they went EOL as they
are no longer being actively developed. As kmod-sfc no longer provides
driver support for these cards and hasn't since kernel 5.2, a new kernel
module is needed to support these 10Gb Ethernet cards. More info here:
https://cateee.net/lkddb/web-lkddb/SFC_SIENA.html and here:
https://www.phoronix.com/news/Solarflare-SFC-Siena-Linux-5.19

The module can be compiled in separately and works if kernel is custom
compiled;

OpenWRT has made these changes already with the SFC 'falcon' subclass of
drivers already. See 3c5d70a and e5ba6e9

This is building on excellent work by @ynezz and @nasbdh9

Signed-off-by: Steve Wavler <trenchcoatjedi@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19647
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 14:07:42 +02:00
Markus Stockhausen
17822d5d18 realtek: use consistent definition in DTS for SFP(+) ports
We are slowly getting to the point where the mdio driver will be
carved out from the ethernet driver. Since the beginning it had
the feature to hand out SFP serdes as phys. So one can access
them from the phy driver. This will be kept during the final
migration and it even will provide a consistent interface for the
phy/serdes registers.

With this being done we need to identify how to handle the affected
ports in a generic way for all targets. Doing first things first,
this starts with a consistent DTS. Currently we have:

for RTL838x + Zyxel XGS1210:
  phy-mode = "1000base-x"
  managed = "in-band-status"
  phy-handle = ...

for all other RTL93x devices:
  phy-mode = "10gbase-r"
  managed = "in-band-status"
  pseudo-phy-handle = ...

Looking at the phylink kernel code one can see a nifty detail.
There is dynamic phy bringup depending on the mode.

int phylink_fwnode_phy_connect(struct phylink *pl,
                               const struct fwnode_handle *fwnode,
                               u32 flags)
{
        struct fwnode_handle *phy_fwnode;
        struct phy_device *phy_dev;
        int ret;

        /* Fixed links and 802.3z are handled without needing a PHY */
        if (pl->cfg_link_an_mode == MLO_AN_FIXED ||
            (pl->cfg_link_an_mode == MLO_AN_INBAND &&
             phy_interface_mode_is_8023z(pl->link_interface)))
                return 0;
        ...
}

Where 802.3z means 1000base-x or 2500base-x. Aligning this with
IEEE specs it means essentially:

- 10gbase-r defined ports with phy-handle must statically bring up
  a phylink from the beginning that immediately depends on a
  phy read_status() implementation.

- 1000base-x/2500base-x defined ports will dynamically bringup a
  phylink during link detection regardless of a phy-handle. So
  it usually runs at the moment when a SFP has been plugged in.

We currently still rely on a phy-handle but do not want to bring
up the phy immediately. Commit 4457c1eee4 ("realtek: rtl93xx:
support SFPs with phys") tried to fix exactly that error for
10gbase-r definied ports. Kernel shows "sfp sfp-p8: sfp_add_phy
failed: -EBUSY" in that case.

But it did it in the wrong way. It implemented a workaround by
introducing a DTS property "pseudo-phy-handle". Instead it
should have simply converted the DTS nodes to 1000base-x.

Revert the commit and fix the DTS with wrong definitions. From
now on we have a consistent SFP definition throughout all DTS
and targets.

Aside from the positive effect this setting has it is more or
less an arbitrary speed definition. When plugging in the SFP the
real speed will be choosen dynamically.

Fixes: 4457c1eee4 ("realtek: rtl93xx: support SFPs with phys")
Tested-By: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19648
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 13:47:27 +02:00
Aleksander Jan Bajkowski
a0e3998b48 lantiq: replace patches with upstream version
Patches 12 and 13 have been superseded by patch 12. Other patches
have no significant changes.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/19675
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-08-07 13:36:49 +02:00
Rosen Penev
03542312f7 lantiq: use nvmem for bthomehub v5a
Userspace handling of both calibration and mac addresses is deprecated.

Also fixed calibration size for ath9k. AR9287 uses 3d8 for its size.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17289
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-06 23:42:43 +02:00
Rosen Penev
fcc48204d2 ltq-ptm: add NVMEM MAC support
This will be used in the following commit to move MAC assignment of the
DSL interface to NVMEM.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17289
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-06 23:42:43 +02:00
Ondrej Kolar
77132c2fc1 kernel/modules: add MCP342x I2C ADCs kernel module support
This commit adds kernel module support for Microchip MCP342x family of I2C ADCs.

Tested on a custom board based on Hi-Link HLK-7628N.

Signed-off-by: Ondrej Kolar <ondrej@kolarovo.cz>
Link: https://github.com/openwrt/openwrt/pull/19619
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-06 23:41:01 +02:00
Markus Stockhausen
2c501d9db9 realtek: rtl930x: convert Hasivo S1100W to lzma only.
The current build recipe creates a lzma based initramfs and
a gzip based sysupgrade (installation) image. No need to
use different compression methods. Use lzma for both.

Tested-by: Andrew LaMarche <andrewjlamarche@gmail.com>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19669
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-06 15:22:52 +02:00
Jan Hoffmann
2a9f0db76f realtek: extend SoC information
Add SoC revision, CPU part number, and a flag for engineering samples to
the rtl83xx_soc_info structure.

Also extend the system type string to include this information.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Link: https://github.com/openwrt/openwrt/pull/19653
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-08-06 13:41:51 +02:00