33225 Commits

Author SHA1 Message Date
Emre Yavuzalp
6bfb305394 mediatek: filogic: TP-Link Archer AX80 v1 (EU) support
Device specification

SoC Type: MediaTek MT7986B, Cortex-A53, 64-bit 1.6GHz Quad Core
RAM: ESMT M15T4G16256 (512MB)
Flash: ESMT F50L1G41LB (128 MB)
Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8)
Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 4xGbE (WAN/LAN 1Gbps, LAN1, LAN2, LAN3)
WLAN 2g: MediaTek MT7975
WLAN 5g: MediaTek MT7975
LEDs: All White(probably)

Buttons: 4 (Reset,ledswitch,wps,wlan),
USB ports: 1 (USB 3.0)
Power: 12 VDC, 2.0 A
Connector: Barrel
Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI
slots contain "seconduboot" (also U-Boot 2022.01-rc4)
Serial console (UART)

                            V
+-------+-------+-------+-------+
| +3.3V |  GND  |  TX   |  RX   |
+---+---+-------+-------+-------+
    |
    +--- Don't connect

CPU BLOCK HERE                                                         LAN PORTS HERE

Installation (UART)
Note: There might be methods without UART possible soon.
Place OpenWrt initramfs image on tftp server with IP 192.168.1.2

Attach UART, switch on the router and interrupt the boot process by pressing 'Ctrl-C'

Load and run OpenWrt initramfs image:

      tftpboot initramfs-kernel.bin
      bootm

!!Attention!! is very important! After entering OpenWrt, please set / update the environment variables:

fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit"
fw_setenv mtdids "spi-nand0=spi-nand0"
fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data),8M(mali_data)"
fw_setenv tp_boot_idx 0

Run 'sysupgrade -n' with the sysupgrade OpenWrt image from console or Luci WebUI.

Recovery

Press Reset button and power on the router
Navigate to U-Boot recovery web server (192.168.1.1) and upload the OEM firmware

Stock layout

0x000000000000-0x000000200000 : "boot"
0x000000200000-0x000000300000 : "u-boot-env"
0x000000300000-0x000003500000 : "ubi0"
0x000003500000-0x000006700000 : "ubi1"
0x000006700000-0x000006f00000 : "userconfig"
0x000006f00000-0x000007300000 : "tp_data"
0x000007300000-0x000007B00000 : "mali_data"

ubi0/ubi1 format
U-Boot at boot checks that all volumes are in place:

+-------------------------------+
| Volume Name: uboot Vol ID: 0|
| Volume Name: kernel Vol ID: 1|
| Volume Name: rootfs Vol ID: 2|
+-------------------------------+
MAC addresses
+---------+-------------------+-----------+
| label | 00:eb:xx:xx:xx:be | label |
| LAN | 00:eb:xx:xx:xx:be | label |
| WAN | 00:eb:xx:xx:xx:bf | label+1 |
| WLAN 2g | 00:eb:xx:xx:xx:be | label |
| WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there (file "MT7986_EEPROM.bin").

Signed-off-by: Emre Yavuzalp <emreyavuzalp2@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20630
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-20 17:59:58 +01:00
Chester A. Unal
4284d56568 bcm53xx: add support for ASUS RT-AC3200 and ASUS RT-AC5300
ASUS RT-AC3200 and ASUS RT-AC5300 are AC3200 and AC5300 routers,
respectively, featuring 5 Ethernet ports over the integrated Broadcom
switch.

ASUS RT-AC3200 hardware info:
* Processor: Broadcom BCM4709A0 dual-core @ 1.0 GHz
* Switch: BCM53012 in BCM4709A0
* DDR3 RAM: 256 MB
* Flash: 128 MB
* 2.4GHz: BCM43602 3x3 single chip 802.11b/g/n SoC
* 5GHz: BCM43602 3x3 two chips 802.11a/n/ac SoC
* Ports: 4 LAN Ports, 1 WAN Port

ASUS RT-AC5300 hardware info:
* Processor: Broadcom BCM4709C0 dual-core @ 1.4 GHz
* Switch: BCM53012 in BCM4709C0
* DDR3 RAM: 512 MB
* Flash: 128 MB
* 2.4GHz: BCM4366 4x4 single chip 802.11b/g/n SoC
* 5GHz: BCM4366 4x4 two chips 802.11a/n/ac SoC
* Ports: 4 LAN Ports, 1 WAN Port

Flashing instructions:
* Boot to CFE Recovery Mode by holding the reset button while power-on.
* Connect to the router with an ethernet cable.
* Set IPv4 address of the computer to 192.168.1.2 subnet 255.255.255.0.
* Head to http://192.168.1.1.
* Reset NVRAM.
* Upload the OpenWrt image.

CFE bootloader may reject flashing the image due to image integrity check.
In that case, follow the instructions below.

* Rename the OpenWrt image as firmware.trx.
* Run a TFTP server and make it serve the firmware.trx file.
* Run the URL below on a browser or curl.
  http://192.168.1.1/do.htm?cmd=flash+-noheader+192.168.1.2:firmware.trx+flash0.trx

Signed-off-by: Chester A. Unal <chester.a.unal@arinc9.com>
2025-12-18 18:18:48 +00:00
Hauke Mehrtens
0bfc66e7b5 kernel: Fix boot of realtek rtl838x
Revert two patches from upstream Linux:
135178e90a
63a93d1cd6

This fixes a boot hang on realtek rtl838x switches.
This is the last printed message:
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)

Thread on mips mailing list:
https://lore.kernel.org/linux-mips/b35fe4b3-8f42-49f4-a6bf-9f0e56d4050c@hauke-m.de/T/#u

Link: https://github.com/openwrt/openwrt/pull/21166
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 00:30:46 +01:00
John Audia
97e9d7038e kernel: bump 6.12 to 6.12.62
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.12.62

Manually rebased:
  bcm27xx/patches-6.12/950-0358-mmc-sdhci-of-dwcmshc-define-sdio-timeout-clocks.patch

Removed upstreamed:
  backport-6.12/830-v6.18-spi-bcm63xx-fix-premature-CS-deassertion-on-RX-only-transactions.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.12.62&id=e31194bf494f6900a5f96f55ed194a00e458f8d1

Build system: x86/64
Build-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc
Run-tested: flogic/glinet_gl-mt6000, ramips/tplink_archer-a6-v3, x86/64-glibc

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21126
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-17 00:27:21 +01:00
Jonas Jelonek
d519a3ee86 realtek: mdio-serdes: use correct device table identifier
Use the correct identifier 'rtsds_of_match' instead of
'rtsds_mdio_of_match' because the latter doesn't exist.

This doesn't cause an error for 6.12. However, with 6.18 the
implementation of MODULE_DEVICE_TABLE has changed to use 'static' and
'used' [1] instead of 'extern' and 'unused' [2].

[1] 7d0a66e4bb/include/linux/module.h (L260)
[2] adc218676e/include/linux/module.h (L249)

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21182
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 14:01:59 +01:00
Jonas Jelonek
56a71f3c82 realtek: pcs: move polarity into SerDes struct
As a first real usage of the new SerDes struct, move the polarity
configuration there. It was previously located in the global rtpcs_ctrl
struct as an array, indexed by SerDes id. Because this is per-SerDes
information, the new SerDes struct is the correct place to live in.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
18eea05483 realtek: pcs: drop unneeded SerDes number range checks
By using references to pre-initiated SerDes instances instead of plain
SerDes number, there is no need to check for the range anymore in
various places. During driver/pcs init it is ensured that only valid
SerDes will reach the configuration functions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
d8dd8bd88f realtek: pcs: make use of SerDes struct in set_autoneg
Also switch set_autoneg (and related helper rtpcs_sds_modify) to the
SerDes struct instead of the plain SerDes id by using just the reference
to the SerDes instance instead of (ctrl, sds_id) tuple. This completes
the transition.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
1fccb0eb16 realtek: pcs: make use of SerDes struct in SerDes setup
Make use of the previously added SerDes struct in SerDes setup and all
functions in its call path by removing (ctrl, sds_num) being passed to
every function call and instead just pass the reference to the
corresponding SerDes instance.

Various SerDes calculations for even, odd and neighbor are unified by
switching to previously introduced helpers.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
4d9400f86b realtek: pcs: switch to id from SerDes struct
Drop usage of the to-be-phased-out SerDes id stored in rtpcs_link and
use the reference to the SerDes instance to use the embedded id in
rtpcs_serdes instead.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
69bbcc685b realtek: pcs: assign SerDes reference upon PCS creation
Upon creation of a phylink_pcs instance by calling rtpcs_create, assign
a reference to the corresponding SerDes to the link structure. In the
next step, this should be used everywhere instead of the plain SerDes
number.

Rename the field used to hold the SerDes number from 'sds' to 'sds_num'
and name the new field 'sds' to make clear what is what.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
232c1fb14a realtek: pcs: add helpers for even, odd, neighbor SerDes
Add dedicated helpers to get references to even, odd and neigbor SerDes
if needed. This should replace the various calculations scattered
throughout the code, providing a unified way to work with adjacent
SerDes.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
6b3f8fb16f realtek: pcs: add separate SerDes struct
Add a separate structure for a SerDes. This is needed to appropriately
store per-SerDes information, which in turn is needed for future work.
Additionally, it's intended to reduce boilerplate and several
inconsistencies.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
6cf33aacfe realtek: pcs: use per-variant SerDes count
Use a separate configuration field for the number of SerDes for each
variant of the Realtek Otto family. Add this field to the config
structure, assign it and use it during driver probe. This narrows
possible error cases and is needed for upcoming extensions.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:32 +01:00
Jonas Jelonek
a4d6e10bf2 realtek: pcs: add dedicated enum for SerDes modes
The Realtek SerDes mode capabilities do not map 1:1 to the
PHY_INTERFACE_MODE_* modes used in the kernel and passed to the PCS.
For example, some PHY chips use the proprietary XSGMII mode for which
there isn't an equivalent in the kernel, or HSGMII.

In the past, this led to problems and confusion using kernel's XGMII to
handle the XSGMII mode, and needed a downstream patch for HSGMII. They
have been solved/worked around for now, but XSGMII is currently not
implemented at all. And who knows what might come in the future.

To make our life easier, introduce a dedicated internal representation
of SerDes modes which differs from kernel's PHY_INTERFACE_MODE_*. This
allows us to map "external" modes to different internal modes as needed
instead of carrying the PHY_INTERFACE_MODE_* through the whole SerDes
configuration code. The PCS driver needs to map PHY_INTERFACE_MODE_* to
RTPCS_SDS_MODE_* in pcs_config, and the latter should be used as the
only one.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
decc4f6ba8 realtek: pcs: rtl930x: drop unused and broken function
Drop the unused and broken function rtpcs_930x_sds_clock_wait from the
PCS driver. The proper working variant is already some lines above and
called rtpcs_930x_sds_wait_clock_ready.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
a58e41e522 realtek: pcs: drop PCS creation without SerDes ref
Since the beginning, the PCS driver had the ability to call its
rtpcs_create without a reference to a valid PCS node. A comment in the
code mentions that this is done for RTL838X and its built-in octa-PHY
which is connected directly instead of via a SerDes. Further
explanations are not provided.

Drop this ability and make the rtpcs_create call in the dsa driver
conditional. As the built-in PHY of RTL838X isn't attached to a SerDes,
there is no obvious point of having the PCS driver in that chain. The
ports are marked as internal and have no pcs-handle, thus no phylink_pcs
instance should be created.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21146
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:37:31 +01:00
Jonas Jelonek
8e4730fd60 realtek: mdio-serdes: improve debugfs creation
Commit 3c073b5cb2 cleaned up the debugfs creation in
mdio-realtek-otto-serdes driver to not explicitly check if the root
directory already exists. This is fine because kernel handles the case
properly so there's no need to check anymore.

However, this pollutes the boot log with:
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'
[..] debugfs: 'realtek_otto_serdes' already exists in '/'

Now, the root directory creation is attempted multiple times, causing
the kernel to print an error message because the directory already
exists.

Fix this by moving the SerDes loop into rtsds_debug_init and only try
to create the root debugfs directory once.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21179
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 13:11:34 +01:00
Christoph Krapp
3045f205b3 ipq40xx: convert Orbi led labels to function/color
The eight leds controlled by the LED controller are RGB leds themselves
but are flashing white by default. The color part is controlled by GPIOs
53 (green), 54 (red), 57 (blue) and 60 (white).
Therefore define the led nodes of the controller as white instead of RBG
as well as backlight as their function.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:33 +01:00
Christoph Krapp
f0909f7a05 ipq40xx: fix second 5ghz radio on Netgear RBx40
When support was added for the RBR40 and RBS40 it was assumed that they
also share the same second 5ghz wifi chip as their bigger siblings.
Turns out that instead of QCA9984 (RBx50, SRx60) these devices use
QCA9886 like the RBx20 devices to.
They also load different boardfiles for the IPQ4019 chip.

This moves the wifi nodes from the orbi.dtsi to each device dts file and
change the RBx40 boardfile variants.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:33 +01:00
Christoph Krapp
0f0f578d0a ipq40xx: fix Netgear RBR40 wan mac
The WAN port currently has the same MAC set as all the other LAN ports.
Fix this by adding the missing case in ipq40xx_setup_macs().

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:32 +01:00
Christoph Krapp
314dbb7fec ipq40xx: split orbi devices in router and satellite
Netgear Orbi devices are split into router and satellite units. Even
though the hardware is mostly the same, the network configuration is
different. Router units have a designated WAN port while satellite units
have all available ports labeled as "Ethernet".
This splits the device trees into both unit types and adjusts the port
labels.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20877
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:29:32 +01:00
Christoph Krapp
f0c5348775 qualcommax: ipq807x: use ascii-env driver for Linksys MX4200v1
Just like it has already been changed for v2, use the ascii-eq-delim-env
driver to extract the label mac from the devinfo partition.

Signed-off-by: Christoph Krapp <achterin@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20732
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-16 10:22:33 +01:00
Mario Andrés Pérez
d871e95e7f sunxi: image: sync target profiles names with DT compatible
Following up with errors reported in the ASU repo, these bananapi cases
do not match the DT compatible "bpi", sync with dts sources.
Also some profiles were overwriting SUPPORTED_DEVICES.
Sysupgrade would be failing in SUPPORTED_DEVICES check since
the DT compatible(/tmp/sysinfo/board_name) is not in SUPPORTED_DEVICES.
This should also fix errors when using ASU sysupgrade clients.
- Sync profile makefile target names with DT compatibles.
- Fix overwrites of SUPPORTED_DEVICES instead of appending.
- Adapt the uboot-sunxi profiles accordingly.
*bpi-p2-zero dts is still not upstream.

V2:
- Include fixes for arm926ejs(ARM926EJ-S) subtarget (LicheePi Nano and
PopStick v1.1) (profile rename for correct default SUPPORTED_DEVICES)

Fixes: https://forum.openwrt.org/t/luci-attended-sysupgrade-support-thread/230552/246
Fixes: https://github.com/openwrt/asu/issues/486
Fixes: https://github.com/openwrt/asu/issues/524
Fixes: 9aa66b8ce7 "sunxi: add support for Banana Pi M2 Berry"
Fixes: d5f615bf2a "sunxi: add support for Sinovoip Banana Pi M2 Plus"
Fixes: 3819c1638a "sunxi: Add support for Banana Pi M2 Ultra"
Fixes: 6bf8193b25 "sunxi: add support for Bananapi P2 Zero"
Fixes: 80edfaf675 "sunxi: add support for Banana Pi M3"
Fixes: 3c24a1d423 "sunxi: add support for NanoPi NEO Plus2 board"
Fixes: a689307c97 "sunxi: build image/uboot for the NanoPi NEO2"
Fixes: fde68cb809 "sunxi: add support for FriendlyARM NanoPi R1S H5"
Fixes: 3ec468ff4f "sunxi: add F1C100 (arm926ej-s) support"

Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21095
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 01:44:34 +01:00
Martin Nadvornik
e5cd6461c9 mediatek: fix IPv4 address missing on interface in failsafe mode for cudy ap3000-v1
cudy ap3000-v1 did not work correctly in failsafe mode
because the address 192.168.1.1 was missing on the eth0 inteface.
it was reachable via it's IPv6 link-local address however.
this commit fixes the issue.

Fixes: https://github.com/openwrt/openwrt/issues/20750
Signed-off-by: Martin Nadvornik <martin.nadvornik@gmx.at>
Link: https://github.com/openwrt/openwrt/pull/21172
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-16 00:17:32 +01:00
Shiji Yang
852d17ed82 kernel: rtl836x: remove legacy platform_data support
There are no platform_data based devices using it anymore. Also move
header files to the driver folder.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/21138
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:31:20 +01:00
Markus Stockhausen
a4011797c2 realtek: use devm_kzalloc() for serdes debugfs setup
This will free memory automatically during driver unloading.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Markus Stockhausen
3c073b5cb2 realtek: cleanup debugfs creation in serdes driver
debugfs_create_dir() has a proper logic to handle existing directories.
Skip the manual test. Additionally quit early if directory creation fails.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Markus Stockhausen
dcbc8722e9 realtek: simplify backing serdes calculation
Calculating the backing serdes of a given frontend serdes does
not need any info about the control structure. Drop the reference.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-15 09:29:17 +01:00
Shiji Yang
86bd55c4fd bcm27xx: fix patch wrong CRLF line-ending
Use Unix LF style instead of Windows CRLF style.

Fixes: 738876e76b ("kernel: bump 6.12 to 6.12.58")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20973
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-11 00:26:37 +01:00
Qingfang Deng
8b05db405b kernel: add network teaming modules
Teaming is a link aggregation implementation similar to bonding, but
it's configured by a userspace program.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21120
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:54:39 +01:00
Shine
be7aa5bda4 mpc85xx: add support for Watchguard Firebox T10-W, T15(-W)
This commit adds support for the Watchguard Firebox models
T10-W, T15 and T15-W.

CPU:      Freescale P1010
RAM:      512MB (T10) / 1024MB (T15)
Flash:    1MB SPI-NOR, 512MB NAND (T10) / 1024MB NAND (T15)
WiFi:     802.11abgn 2T2R AR9582 based Mini-PCIe card (-W models only)
Ethernet: 3x GBE (via AR8033 PHY)
LEDs:     7x hard-wired (6x LAN, 1x Power)
          4x GPIO single-colored (Attn/Status/Mode/Failover)
          1x GPIO dual-colored (2.4/5G WiFi, -W models only)
Serial:   RJ45, Cisco pinout, 115200/8N1
Other:    Battery backed RTC
          Atmel TPM 1.2 chip (unsupported)

Based on 35f6d79, which introduced Watchguard Firebox T10 support.

The T10 and T15 are identical hardware, with the exception of the T15
having twice the flash and RAM size.

The T10-W and T15-W models have their Mini-PCIe slot populated with an ath9
(AR9582) based WiFi card. The slot is either unpopulated or empty for
non-WiFi models. All required drivers are present by default on the mpc85xx
target, so T10/T10-W resp. T15/T15-W can use the same OpenWrt image.

This commit also introduces the zImage loader from 7d768a9 to boot the
kernel. This is required, since the U-Boot version used in these devices
appears to have a hard limit of 16MB for the kernel size it can handle. The
current kernel size is around 17MB, though, due to kernel page alignment
required for memory protection.

Installation (replaces previous instructions for T10):

1. If the U-Boot password is known, proceed with step 2.

   If the U-Boot password is unknown, dump the NOR flash using a SPI
   programmer and patch the unknown password to a known one. You can use
   blocktrron's Python script:

   https://github.com/blocktrron/t10-uboot-patcher/

   This script will patch the password to '1234' (without quotes).

   Alternatively, you can search for the hashed password in the NOR dump
   yourself and overwrite it with a known one. The SHA1 hash is:

   E597301A1D89FF3F6D318DBF4DBA0A5ABC5ECBEA

   Write the patched NOR dump back to the device.

2. Connect the device via serial cable, power it on and interrupt
   the boot process by pressing Ctrl+C. Enter the U-Boot password to access
   the CLI.

3. (Optional) Populate the uboot-env partition by entering:

   saveenv

   This will allow you to use uboot-envtools from within OpenWrt later,
   e.g. to increase the loadable kernel size.

   The default loadable kernel size is 5MB, the compressed kernel size at
   the time of this commit is 3.1MB.

4. Serve the initramfs OpenWrt image from a TFTP server at 10.0.1.13/24,
   connected to eth0 (WAN) of the device. File name must be 'uImage'. Boot
   with:

   tftpboot; bootm;

   Make sure to use the correct image for your device (T10 resp. T15)!

5. After booting, connect to OpenWrt on eth1 (LAN) via SSH. Verify
   that the UBI partiton is mtd7, format it and install the sysupgrade
   image.

   $ cat /proc/mtd
   $ ubiformat /dev/mtd7 -y
   $ sysupgrade -n <path to sysupgrade.bin>

6. The device should now boot OpenWrt from NAND flash. Enjoy.

Back to stock:

Use the vendor recovery procedure.

Stock recovery might also be necessary in case you have accidentally used
the fw_setenv command from within OpenWrt without using saveenv in U-Boot
first.

In order to use the vendor firmware recovery procedure, the NAND partitions
mtd3 to mtd6 must remain intact. Make sure not to overwrite them, or keep
dumps of them for later recovery.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:48:48 +01:00
Shine
15ef024805 mpc85xx: p1010: use common DTSI for Watchguard Firebox T1X
In preparation of adding support for additional Watchguard Firebox devices
based on Freescale P1010, introduce a common DTSI.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/16776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-10 23:48:48 +01:00
Vincent Li
9e9206427f loongarch64: Disable strict alignment to fix BPF program failures
CONFIG_ARCH_STRICT_ALIGN=y (default in config-6.12) causes BPF programs
(XDP, TC, tracing, etc.) to fail verification with misaligned packet
and memory access errors, breaking essential kernel functionality.

Hardware support status:
- Supported (modern CPUs): 2K2000, 2K3000, 3A5000, 3A6000, 3C5000,
                          3C6000, 3D5000
- Unsupported (legacy): 2K500, 2K1000

The current default prioritizes legacy compatibility over:
1. BPF program functionality across multiple subsystems
2. Performance on widely deployed modern hardware
3. Modern kernel features relying on unaligned accesses

Since BPF programs require unaligned access capabilities and most
LoongArch deployments use modern CPUs with hardware support, disable
CONFIG_ARCH_STRICT_ALIGN. Legacy system users can manually enable
it if needed.

Link: https://github.com/vincentmli/BPFire/issues/69
Reference: https://elixir.bootlin.com/linux/v6.12/source/arch/loongarch/Kconfig#L534

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21121
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-12-10 19:10:30 +01:00
Kyle Hendry
c2c38469a8 bmips: b53: enable bcm63268 internal PHYs
On the smartrg sr505n the bootloader only sets registers to enable the
PHYs if it's interrupted. When Linux boots this results in a -EINVAL
error when trying to read from the EPHYs and the GPHY doesn't work.
This patch disables low power mode in the GPHY/EPHYs and properly resets
the EPHYs.

Signed-off-by: Kyle Hendry <kylehendrydev@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17648
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-12-09 15:12:43 +01:00
Zhiwei Cao
344bb7f916 mediatek: filogic: add support Netcore NX30V2/N30PRO/POWER30AX/W7/GW3001
Hardware specification:
  SoC: MediaTek MT7981B
  Flash: ESMT F50L1G41LB 128MB
  RAM: ESMT M15T2G16128A DDR3 256MB
  Ethernet: 3x 1G
  Button: Reset, WPS

MAC addresses
  LAN:	Label MAC (stored in Factory partition offset 0x1fef20)
  WAN:	LAN + 1
  WiFi:	LAN

Official LED layout, from left to right:
  [power] [internet] [wps] [wifi] [lan3/2/1] [wan]

Redefinition for OpenWrt:
  [power]: used for led-boot, led-failsafe, and led-running
  [internet]: used for WAN RX/TX indication
  [wps]: used for led-upgrade
  [wifi] and [lan3/2/1]: unchanged
  [wan]: used for WAN link indication

Installing OpenWrt:
  - Setup a tftp server on your PC. Copy
    xxx-preloader.bin, xxx-bl31-uboot.fip and
    xxx-initramfs.itb to tftp root directory.
  - Connect to the router via ssh or telnet,
    username: useradmin, password is the web
    login password of the router.
  - Backup all critical flash partitions with
    the following commands where x.x.x.x is
    the IP of your PC.

    IP=x.x.x.x
    cd /dev
    for d in /sys/class/mtd/mtd?; do
      if [ "$(cat $d/name)" = "BL2" ]; then
        tftp -l $(basename $d) -r bl2.img -p $IP
      elif [ "$(cat $d/name)" = "FIP" ]; then
        tftp -l $(basename $d) -r fip.bin -p $IP
      elif [ "$(cat $d/name)" = "Factory" ]; then
        tftp -l $(basename $d) -r factory.bin -p $IP
      fi
    done
    for d in /sys/devices/virtual/ubi/ubi0/ubi0_*; do
      [ "$(cat $d/name)" != "customer" ] && continue
      tftp -l $(basename $d) -r customer -p $IP
      break
    done

  - Flash with the following commands:

     cd /tmp
     tftp -r xxx-preloader.bin -g x.x.x.x
     tftp -r xxx-bl31-uboot.fip -g x.x.x.x
     mtd write xxx-preloader.bin spi0.0
     mtd write xxx-bl31-uboot.fip FIP
     mtd erase ubi

  - Set a static ip(192.168.1.254) for your PC.
    And then reboot the router. It will run
    initramfs image automatically.
  - After openwrt boots up, perform sysupgrade
    via web UI.

Reverting to the vendor firmware:
  - Setup a tftp server on your PC with ip
    address 192.168.1.254. And make sure
    bl2.img, fip.bin, factory.bin and customer
    are located in tftp root directory.
  - Power off the router.
  - Press and hold WPS key, then power on
    the router.
  - Release WPS key, when internet/wifi/wps
    leds are blinking.
  - Wait until internet/wifi/wps leds light
    up, power off the router.
  - Press and hold reset key, power up the
    router, release reset key 15s later.
  - Connect to http://192.168.1.1, now you
    can upload vendor .bin firmware.

Uboot netconsole:
  Uboot netconsole can be enabled by WPS
  or reset key.

  - Setup a linux PC with ip 192.168.1.254.
    Open a new terminal and execute
    'stty -isig -echo cbreak; nc -lup 6666'
  - Press and hold WPS(or reset) key, then
    power on the router.
  - Release key once internet/wifi/wps leds
    are all on.
    NOTE: don't hold the key more than 5s
    after internet/wifi/wps leds on, or it
    will try to revert to vendor firmware.
  - 5s later, uboot bootmenu will show on
    the terminal.

Signed-off-by: Zhiwei Cao <bfdeh@126.com>
Link: https://github.com/openwrt/openwrt/pull/18631
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:29:39 +01:00
Rosen Penev
b182f2e0b4 ath79: meraki_mr1[26]: userspace cal to nvmem
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21002
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:21:03 +01:00
Rosen Penev
6b961303e0 ath79: moxa,awk-1137c: use nvmem for calibration
Userspace handling is deprecated.

Use led-sources for simplicity.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21026
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:17:48 +01:00
Brian Lee
26ff8efc8a mediatek: filogic: replace spaces with tabs for indentation
This commit replaces the 7-8 spaces with 1 tab to modify the indentation appropriately.

Signed-off-by: Brian Lee <larte332@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21018
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:15:20 +01:00
Pawel Dembicki
011890ad93 mediatek: filogic: add support for Kebidumei AX3000-U22
Kebidumei AX3000-U22 is one of many clones of the same range extender
that can be found on Aliexpress or other Chinese portals.

The easiest way to identify this model is by searching for "AX3000
Repeater" and picking the device that looks like mine [0].

Specification:
- SoC:     MediaTek MT7981B (1.3 GHz)
- RAM:     256 MB
- Flash:   16 MB SPI NOR
- Ports:   1 x 1 GbE
- Antenna: 6 (2 fake)
- WiFi:    MediaTek dual-band WiFi 6
  - 2.4 GHz: b/g/n/ax, MIMO 2x2
  - 5 GHz:   a/n/ac/ax, MIMO 2x2
- Buttons: Reset & WPS
- LEDs:    Ethernet (green), Status (red, green, blue)
- Power:   110–240 V AC (internal PSU, board uses 12 V DC)
- Serial:  unmarked connector on PCB
           [1: Vcc, 2: RX, 3: TX, 4: GND]

Install via OEM web UI:
1. Use reset button to perform factory reset.
2. Connect PC to LAN port and obtain DHCP address.
3. Upload the sysupgrade image via OEM firmware upgrade page,
   e.g. http://192.168.18.1/upgrade.html
4. After reboot, hold reset button to clear leftover vendor config.

Install via serial:
1. Connect serial console (115200 8N1).
2. Enter the console.
3. Backup mtd4 partition if you want to restore OEM FW later.
4. Download image.
5. Run 'sysupgrade -n'.

Revert to stock:
1. Run sysupgrade without keeping config using mtd4 backup.

[0] https://openwrt.org/_media/media/kebidumei_ax3000-u22.png

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20287
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 01:12:07 +01:00
Maxim Anisimov
cc2aefe619 mediatek: add Keenetic KN-1812/Netcraze NC-1812 support
This commit adds support for Keenetic KN-1812/Netcraze NC-1812

Device specification
--------------------
SoC Type:   MediaTek MT7988D, Cortex-A73, 64-bit
RAM:        1024MB DDR4 Micron MT40A512M16TB-062E:R
Flash:      SPI NAND Winbond W25N02KV (256 MiB)
Ethernet:   4x1GbE (internal MT7988 built-in) + 2.5GbE (internal MT7988 phy) + 10GbE (RTL8261BE)

WLAN:       MT7992AV
WLAN 2g:    MediaTek MT7975N, b/g/n/ax/be, MIMO 4x4
WLAN 5g:    MediaTek MT7977B, a/n/ac/ax/be, MIMO 4x4
LEDs:       5 LEDs, 1 power green, 1 internet green,
            2x fn green, 1 wlan green, gpio-controlled
Button:     4 (Reset, WPS, FN1, FN2)
USB port:   Yes, 1xUSB3.2 and 1xUSB2.0 (via GL850G)
Power:      12 VDC, 3 A

Notes:
 * The device supports dual boot mode
 * Fn2 led reassigned to wlan 2.4

Flash instruction:
The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24 and tftp server.
2. a) Keenetic
      Rename "openwrt-mediatek-filogic-keenetic_kn-1812-squashfs-factory.bin"
      to "KN-1812_recovery.bin" and place it in tftp server directory.
   b) Netcraze
      Rename "openwrt-mediatek-filogic-netcraze_nc-1812-squashfs-factory.bin"
      to "NC-1812_recovery.bin" and place it in tftp server directory.
3. Connect PC with ethernet port, press the reset button, power up
   the device and keep button pressed until status led start blinking.
4. Device will download file from server, write it to flash and reboot.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20737
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:55:51 +01:00
Maxim Anisimov
7423edb393 mediatek: import patch from Mediatek SDK for pcie
Without this patch some devices can't detect wifi chip.

Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20737
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:55:50 +01:00
Marcin Leksmark
7ff663cc31 ramips: mt7621.mk: fix alphabetical ordering some Cudy devices
This PR doesn't change anything other than fixing the alphabetical order of some Cudy devices
(R700 and c200p)

Signed-off-by: Marcin Leksmark <lexmark3200@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21044
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:31:07 +01:00
Jonas Jelonek
c3887c126d realtek: dsa,phy: rtl838x: remove 'SerDes as PHY' leftovers
RTL838X SerDes is now completely managed by the PCS driver so it's time
to remove all the unused leftovers from DSA and PHY drivers to have that
finally separated.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:44 +01:00
Jonas Jelonek
a63da75e44 realtek: rtl838x: drop SFP pseudo-PHYs and phy-handle
Remove all pseudo-PHYs and phy-handle properties from DTS of RTL838X
devices. RTL838X SerDes is now handled by PCS driver and thus not
treated as PHY anymore.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:41 +01:00
Jonas Jelonek
e956adfe3e realtek: rtl838x: setup SDS entirely in PCS driver
After having moved the configuration code and sequences from PHY and
DSA drivers to the PCS driver, add the hooks in PCS driver and remove
calls in PHY and DSA drivers to let PCS driver setup the SerDes
entirely on its own.

Also add pcs-handle to device tree definitions for most of the switch
ports because, due to the refactoring of the SerDes configuration, this
is needed now for all SerDes-attached ports.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:38 +01:00
Jonas Jelonek
b670d48366 realtek: pcs: rtl838x: refactor imported code
The previous commit just imported some code as-is and commented it.
It needs heavy adjustments to compile and work within the PCS driver.
Do that now to that extent that it can be used within the driver. More
cosmetics and improvements will be done later.

Split the once-for-all SerDes configuration into the usual flow where
each SerDes is configured separately and on its own, as requested by the
PCS subsystem.

Move mode setting and patching into proper functions which are called
during SerDes configuration. Some configuration sequences are broken up
and moved into the SerDes configuration flow, e.g. reset sequences
because they were usually a single/few values applied to all SerDes at
once before.

Add proper configuration for SerDes 4 QSGMII to be able to setup this
mode properly on our own.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:34 +01:00
Jonas Jelonek
f4129beb39 realtek: pcs: rtl838x: import SerDes code from DSA/PHY
Import functions 'rtl8380_sds_rst', 'rtl8380_sds_power',
'rtl8380_configure_serdes' and 'rtl83xx_config_interface' from DSA and
PHY driver respectively but comment the code for now.

The code needs heavy adjustments to make it compile and work. To make
this as transparent as possible, do that in two stages.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:31 +01:00
Jonas Jelonek
6a5cae7d74 realtek: pcs: rtl838x: transplant firmware config
In the PHY driver, firmware files were used to store configuration
values for the SerDes which need to be applied upon initialization.
There are several issues which prevent to just take that over into the
PCS driver:
* SerDes and PHY parts are mixed within a firmware file
* SerDes access in PHY driver is based on writing into the switch's
  global register space; PCS driver uses access via MDIO interface
  --> destination values do not match
* firmware file format is not SerDes-agnostic
* no documentation or script for the "old" firmware files

Unfortunately, there is no proper firmware format yet where to take over
the required sequences. Thus, extract the sequences needed for RTL838X
SerDes, transform them to work with the MDIO based access and put them
as functions in the PCS driver.

Note that this should just be a temporary solution. In a next step, a
proper firmware format should be established and all configuration
sequences currently in the code should be moved into firmware files.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:28:27 +01:00
Jonas Jelonek
328b970ecd realtek: pcs: add init_serdes_common hook
Add a new hook called 'init_serdes_common' to be able to perform
initialisations or anything else subject to all SerDes. This hook is
called in the end of 'rtpcs_probe' after everything else is done.

This is meant primarily to support the transition of RTL83XX from PHY
driver to PCS driver. Thus, it may be removed later again or kept if
there is sufficient need for this.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-09 00:27:57 +01:00