Commit Graph

33742 Commits

Author SHA1 Message Date
Ziyang Huang
f5bf8c2b94 airoha: an7581: correct led nodename
Use standard name.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:25 +01:00
Ziyang Huang
077120fb64 airoha: an7581: correct phy nodename
Let node unit address same as reg.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
ea54b6a478 airoha: an7581: move the switch led label from soc-level to board-level
Different boards use different port map. For example, some board may use
a GE port as WAN. So defining the led label in board-level is better.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
e2f7ad08c7 airoha: an7581: move the switch port label from soc-level to board-level
Different boards use different port map. Defining the port labels in
board-level is better.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
007aa5a51c airoha: an7581: disable all switch port and phy by default
Some board only use some of them, so enable as necessary in
board-level dts.

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Ziyang Huang
65aed6aa12 airoha: an7581: correct the pinctrl-name of phy leds
address the following issues:

    [    3.542844] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.552550] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.562449] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl
    [    3.574350] mdio_bus mt7530-0: Failed to setup PHY LED pinctrl

Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20482
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-05 01:00:24 +01:00
Markus Stockhausen
17b90c59fa realtek: eth: adapt prefix of ops structures
Convert all ops structures to the new rteth prefix.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
f14fed9a92 realtek: eth: move netdev_ops to config structure
Simplify netdev_ops initialization by moving the data
into the configuration structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
2d8212e8a4 realtek: eth: reorder configuration data
The configuration data needs to reference the netdev_ops
in the future. Reorder it in a separate commit to avoid
confusion later.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
b8c6713ce4 realtek: eth: move cpu_port to config structure
There is no need to set the cpu port depending on the
given family. Remove it from the private control structure
and add the fixed value to the configuration structure.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Markus Stockhausen
e6d282eee7 realtek: eth: Rename configuration structure
The name of the configuration structure suggests that it
contains a list of registers. As it contains functions too
change the name according to other realtek drivers.

- "Invent" a new driver prefix "rteth"
- Rename the structure and variables to config/cfg

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21345
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-04 19:06:26 +01:00
Linus Walleij
b73fd273b3 ixp4xx: fix bug in Actiontec DTS file
This misassigned ethernet port bug was merged in the upstream
kernel.

Link: https://github.com/openwrt/openwrt/pull/21367
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-01-04 16:51:31 +01:00
Hauke Mehrtens
5230157a16 kernel: QCOM SPI NAND: backport multiple fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

The patches were reordered to match the ordering in the upstream Linux kernel.

Fixes: 93173aee96 ("qualcommbe: ipq95xx: Add initial support for new target")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
69d76e3a14 kernel: phylink: disable autoneg for interfaces that have no inband
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The first two patches are providing function needed by the last patch.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
2c7241b209 kernel: RTL8211FVD: restore disabling of PHY-mode EEE
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 48c9e55094 ("kernel: backport upstream Realtek PHY patches")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
9c4b7fbaad kernel: mv88e6xxx: backport fixes
These patches fix bugs in a patch we backported.

These patch were cherry picked from upstream Linux because it references
a patch we backported in the fixes tag.

Fixes: c990f6e156 ("linux: generic: net: dsa: mv88e6xxx LED support")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
b3cc77eead kernel: reserved_mem: add missing IORESOURCE_MEM flag on resources
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 9d3009f426 ("airoha: major backport of Airoha Ethernet driver feature support")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:30 +01:00
Hauke Mehrtens
b3318fe819 kernel: as21xxx: backport patch improve PHY HW reset
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

The function phy_id_compare_vendor() is needed by the fix.
Refresh 782-05-v6.16-net-phy-Add-support-for-Aeonsemi-AS21xxx-PHYs.patch with the upstream code.

Fixes: 08a616b216 ("generic: backport support for Aeonsemi AS21xxx PHY")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
7390e63374 kernel: pcs-mtk-lynxi: backport fix for in-band status capabilities
This patch fixes a bug in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 813ecda1f3 ("generic: backport phylink patches for PCS/PHY caps OPs")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
63b45a10c0 kernel: PHY: backport led fixes commit
This patch fixes a bug in some patches we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
6ac5e28902 kernel: r8169: backport upstream fix
This fixes a bug introduced in a patch we backported.

This patch was cherry picked from upstream Linux because it references a
patch we backported in the fixes tag.

Fixes: 91ce7f606a ("generic: backport upstream v6.16 r8169 patches")
Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
3c821c19a8 kernel: move patches to backported
These formally pending patches were merged into upstream Linux some time
ago. Move them to the backports folder and add the kernel version they
were added to the file name.

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:29 +01:00
Hauke Mehrtens
7130053695 kernel: refresh upstreamed patches
Replace pending patches which are already integrated in upstream Linux
with their upstream versions.

These patches were exported with:
git format-patch -1 -k

Link: https://github.com/openwrt/openwrt/pull/21366
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-04 16:41:28 +01:00
Rosen Penev
9934c716ed treewide: replace remove_new with remove
Preparation for kernel 6.18. It removes the former.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21226
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:27:25 +01:00
Aleksander Jan Bajkowski
79ff31104c airoha: an7583: fix scuclk unit-address
Fix the unit-address of the scuclk node.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20985
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:04:58 +01:00
Aleksander Jan Bajkowski
914fe44647 airoha: en7583: dts: fix typo disable
No functional changes intended.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/20985
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 17:04:58 +01:00
Jonas Jelonek
2055a4df78 realtek: pcs: rtl931x: soften early exit for USXGMII
Now that the PCS driver keeps track of how many links are registered per
SerDes, we can also decide which real hardware mode to use when USXGMII
is set. While there is still no proper setup for 10G-QXGMII or XSGMII,
the existing USXGMII 10G-SXGMII setup seems to work properly.

Soften the condition when to exit early so that single 10G port USXGMII
can be setup properly.

Fixes: c18476d0c5 ("realtek: RTL931x: disable USXGMII SerDes setup")
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:49 +01:00
Jonas Jelonek
b63f68e409 realtek: pcs: select OFF mode with no links on SerDes
Because the PCS driver keeps track of the number of registered links for
each SerDes now, we now know when there is no link on a SerDes. In this
case, determine to turn off the SerDes in the mode mapper.

Though the phylink subsystem shouldn't attempt to config something
different when no link/port references a Serdes, be on the safe side.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
7cd3407fde realtek: pcs: cover number of links per SerDes for USXGMII
A SerDes may supply multiple ports and depending on that number,
different hardware modes need to be used. While there are corresponding
modes in the kernel in some cases (e.g. USXGMII with 4 2.5G ports aka
10G-QXGMII), this doesn't always map to Realtek hardware modes. Use the
previously added link number accounting for that.

An obvious example of this is the SerDes on XGS12xx-12 switches which
is connected to an octa-PHY. This runs Realtek proprietary XSGMII mode
(10G-pumped SGMII interface) for which there is no corresponding mode
in the kernel.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
76f392194b realtek: pcs: keep track of number of links per SerDes
Add a field to the rtpcs_serdes structure to keep track of how many
links (aka ports) are used on a single SerDes. This is needed to be
known to map kernel interface modes to SerDes hardware modes properly
(e.g. USXGMII --> USXGMII/10G-QXGMII/XSGMII).

While working in rtpcs_create, optimize referencing the SerDes instance
for cleaner code.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Jonas Jelonek
dfd6a4212f realtek: pcs: add missing SerDes modes
100Base-X mode was missing before in the enum rtpcs_sds_mode. So add it
to be able to support this mode too. Handle this mode in the
_determine_hw_mode mapper.

10G_QXGMII mode was missing in the mode mapper. Add it and map it to
USXGMII_10GQXGMII mode.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21365
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 16:59:48 +01:00
Hannu Nyman
93e9e67ee9 mediatek: remove erroneous pipe action from BE7200 recipe
Remove the errorneous pipe action from the BE7200 device package list.

It causes visible errors into config:

 perus@ub2510:/OpenWrt/aarch64$ make defconfig
 ...
 tmp/.config-target.in:55023:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191877:warning: ignoring unsupported character '|'
 tmp/.config-target.in:191878:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285812:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285815:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285819:warning: ignoring unsupported character '|'
 tmp/.config-target.in:285820:warning: ignoring unsupported character '|'
 #
 # configuration written to .config
 #

 File tmp/.config-target.in:

  55020         select DEFAULT_urandom-seed
  55021         select DEFAULT_urngd
  55022         select DEFAULT_wpad-basic-mbedtls
  55023         select DEFAULT_|
  55024         help
  55025           Build firmware images for Routerich BE7200

Fixes: ff5e66a920 ("mediatek: add support for Routerich BE7200")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/21376
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 12:38:10 +01:00
Michel Promonet
ce282459e7 kernel: add kernel module sun6i_csi and ov5640
This is adding SUN6I-CSI and OV5640 driver for AllWinner platform for NanoPi

Signed-off-by: Michel Promonet <michel.promonet@free.fr>
Link: https://github.com/openwrt/openwrt/pull/20085
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 01:11:09 +01:00
Jörg Seitz
479f1403f2 mediatek: add support for device zbt-z8103ax-c
- adopted MTD partition size increase from 64M to 128M
  -> this allows boot to complete
- moved MAC addressing stuff out of partition definitions
- all MAC addressing stuff is in .dtsi

Specifications:

SoC: MediaTek MT7981B
RAM: 256MiB
Flash: Winbond SPI-NAND 128 MiB
Switch: 1 WAN, 3 LAN (Gigabit) MediaTek MT7531
Buttons: Reset, Mesh
Power: DC 12V 1A
WiFi: MT7981B 2.4Ghz & 5.8Ghz

Led Layout from bottom to top:

    Power
    Mesh (RGB Led, user controllable, default set to OpenWrt Status)
    WLAN 2 GHz (user controllable)
    WAN (user controllable)
    LAN3
    LAN2
    LAN1
    WLAN 5 GHz (Not on front panel but blinks through enclosure,
               user controllable)

Buttons:

    Reset
    Mesh (user controllable, no default function)

Installation:

A. Through U-Boot menu:

 -  Prepare your connecting computer to use a static IP in
	network 192.168.1.0/24
 -  Power down the router and hold in the Reset button.
 -  While holding in the button power up the router again.
 -  Hold the button in for 10 seconds and then release.
 -  Use your browser to go to 192.168.1.1
 -  If you see a GUI allowing for flashing firmware then
	you got the right model.
 -  Upload the sysupgrade file.

Note: Recovery GUI can be used to recover from an incorrect
      firmware flash.

B. Through OpenWrt Dashboard:

    If your router comes with OpenWrt preinstalled
	(modified by the seller), you can easily upgrade
	by going to the dashboard (192.168.1.1) and then
	navigate to System -> Backup/Flash firmware,
	then flash the firmware

MAC Addresses were found in Factory partition:

offset 0x4 F8:5E:3C:xx:xx:aa --> Router Label -2
offset 0xa F8:5E:3C:xx:xx:bb --> Router Label -1
offset 0x24 F8:5E:3C:xx:xx:cc --> Router Label +1
offset 0x2a F8:5E:3C:xx:xx:yy --> printed on Router Label

Signed-off-by: Jörg Seitz <github.joeterminal@xoxy.net>
Link: https://github.com/openwrt/openwrt/pull/19823
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:58:39 +01:00
Jörg Seitz
b21b019af4 mediatek: extract DTS include for zbt z8103ax
- Use .dtsi for old z8103ax featuring a 64M Nand
- Prepare .dtsi for model C of z8103ax featuring a 128M Nand

This .dtsi is supposed to match boards labeled as hardware
revision Z8103AX_V01. Model variant D of zbt-z8103ax appears
to use very same board.

DTS include does also

- set wifi mac addresses in &wifi section
- set eth mac addresses in &eth section
- set LAN switch mac addresses in &switch section

All of the above allows to get rid of 11_fix_wifi_mac script

Signed-off-by: Jörg Seitz <github.joeterminal@xoxy.net>
Link: https://github.com/openwrt/openwrt/pull/19823
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:58:39 +01:00
Aleksander Jan Bajkowski
f49b452cc0 airoha: replace patches with upstream version
Replace patches with version accepted upstream.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/21333
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:02:46 +01:00
Derek Denk
afad4c71f8 mediatek: filogic: add support for Cudy AP3000 Wall v1
This commit adds support for the Cudy AP3000 Wall v1.

SoC: MediaTek MT7981b
RAM: 256MiB
Flash: spi-nand spi0.0: 128 MiB
Wifi: MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
LEDs: 1 LED in two colors (red & white)
Buttons: 1 reset, 1 led on/off
Ethernet: 5x 1GbE
Power: PoE powered (standalone)

The stock firmware is a customized variant of OpenWrt, which implements
a signature check that only allows flashing official firmware. Cudy offers
intermediate OpenWrt firmware images on their website [1][2] which do not
implement the signature check. After flashing the intermediate image the
upstream official OpenWrt image can be installed.

The stock firmware can be recovered via TFTP using the U-Boot based boot
loader[3]. Set up a TFTP server on your computer with IP 192.168.1.88/24
serving the stock firmware from Cudy's website renamed to "recovery.bin".
Press and hold the reset button while powering on the device, wait for the
TFTP server to send the recovery.bin file, then release the reset button.
The router will take a couple of minutes to reboot and set up the stock
firmware.

[1] https://www.cudy.com/blogs/faq/openwrt-software-download
[2] https://drive.google.com/drive/folders/1BKVarlwlNxf7uJUtRhuMGUqeCa5KpMnj
[3] https://www.cudy.com/en-us/blogs/faq/how-to-recovery-the-cudy-router-from-openwrt-firmware-to-cudy-official-firmware

Signed-off-by: Derek Denk <derek.denk@live.com>
Link: https://github.com/openwrt/openwrt/pull/21266
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-03 00:01:24 +01:00
Mikhail Zhilkin
ff5e66a920 mediatek: add support for Routerich BE7200
This PR adds support for Routerich BE7200 router.

Specification
-------------
- SoC       : MediaTek MT7987A Quad-core ARM Cortex-A53 2.0 GHz
- RAM       : 1024 MiB DDR4
- Flash     : SPI-NAND 512 MiB (Giga Device)
- WLAN      : MediaTek MT7992E, WiFi 7
  - 2.4 GHz : b/g/n/ax, MIMO 4x4
  - 5 GHz   : a/n/ac/ax, MIMO 4x4
- Ethernet  : 10/100/1000 Mbps x3 (LAN, Airoha AN8855AE)
              10/100/1000/2500 Mbps x1 (WAN, SoC internal phy)
- USB       : 3.0 x1
- Buttons   : Mesh, Reset
- LEDs      : 1x Status (blue), gpio-controlled
              1x WiFi (blue), gpio-controlled
              1x mesh (blue), gpio-controlled
              3x LAN activity (blue), gpio-controlled
              1x WAN activity (blue), gpio-controlled
              1x WAN no-link (red), gpio-controlled
- Power     : 12 VDC, 1.5 A

Installation
------------
1. Update stock firmware via the web interface (don't keep settings).

Update U-Boot (optional)
------------------------
After installing OpenWrt, you may want to install opensource U-Boot.
1. Install kmod-mtd-rw:
   apk update && apk add kmod-mtd-rw
2. Unlock bootloader:
   insmod mtd-rw i_want_a_brick=1
   mtd unlock BL2
   mtd unlock FIP
3. Download and write open-source BL2 and FIP:
   cd /tmp
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-preloader.bin
   wget https://.../openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-preloader.bin BL2
   mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip FIP
4. Reboot the router.

Return to stock
---------------
1. Update OpenWrt wirh the vendor's firmware (don't keep settings).

Recovery (original U-Boot)
-----------------------------
1. Press Reset button and power on the router. After ~10 sec release
   the button;
2. Upload and flash squashfs-sysupgrade.itb image via the web interface.

Recovery (open-source U-Boot)
-----------------------------
1. Place OpenWrt
   'openwrt-mediatek-filogic-routerich_be7200-initramfs-recovery.itb'
   image on the tftp server (IP: 192.168.1.254)
2. Press Reset button and power on the router. After ~10 sec release
   the button.
3. Use OpenWrt initramfs system for recovery

Recovery (full disaster)
------------------------
Use UART and mtk_uartboot tool.
Link: https://github.com/981213/mtk_uartboot

USB power control
-----------------
Disable: echo disabled > /sys/devices/platform/usb-power/state
Enable: echo enabled > /sys/devices/platform/usb-power/state

UART
----
UART pins are silkscreened on the PCB. Don't connect Vcc.
Serial connection parameters: 115200, 8n1, 3.3V

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| WAN     | 24:0f:5e:xx:xx:30 | label     |
| LAN     | 24:0f:5e:xx:xx:31 | label+1   |
| WLAN 2g | 24:0f:5e:xx:xx:32 | label+2   |
| WLAN 5g | 24:0f:5e:xx:xx:33 | label+3   |
+---------+-------------------+-----------+
The WLAN 2g MAC was found in 'Factory', 0x4

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21235
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 23:30:27 +01:00
Jonas Jelonek
e581929341 realtek: dsa: rtl931x: configure phy ability source
The MAC can get PHY abilities, link status, etc. via different ways. In
RTL931x, the corresponding register needs to be setup properly. By
default, all ports use out-of-band MDIO polling to retrieve that
information. Thus, PHY-backed ports usually work with the default
setting.

For SFP ports, there is no MDIO polling available. Instead, the SerDes
ability bus needs to be used to retrieve the link information.

So far, the bootloader (e.g. U-boot) had to properly initialize that
setting. Instead of relying on that, do that properly during MAC setup.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21351
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 21:35:28 +01:00
Jacob Potter
b2c0182f26 realtek: rtl838x: fix lan9 and lan10 on Netgear GS110TUP
The GS110TUP's lan9 port is connected via a QSGMII PHY to SERDES 2, and
therefore should use the SWITCH_PORT_SDS macro instead of SWITCH_PORT. This
was missed in e956adfe because the GS110TUP is not particularly well
documented and the old code was confusing.

lan10 is an SFP and doesn't have an onboard PHY, so also remove its
associated PHY references and update it to match other devices' SFP ports.

Fixes: https://github.com/openwrt/openwrt/issues/21324
Signed-off-by: Jacob Potter <jacob@j4cbo.com>
Link: https://github.com/openwrt/openwrt/pull/21346
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 18:10:05 +01:00
Robert Senderek
96ad29a0f3 mvebu: Add support for WD MyCloud EX2 Ultra
Hardware
--------
Marvell Armada 385 (MV88F6820)
1GB RAM
256MB NAND
1x 1Gbit
2x USB 3.0
2x SATA-III
UART: 115200 8N1 3.3V
RTC
Weltrend MCU WT6703F connected via UART1 for Power LED / PWM Fan / hw reset / WoL

Installation
------------
Connect UART 3.3V adapter to JP2  pins: 1-RX / 2-GND / 5-TX

Use USB2.0 FAT32 pendrive with openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin
 1. stop boot by pressing 1
 2. usb start
 3. fatload usb 0:1  0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin;bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

Or tftp
 1. stop boot by pressing 1
 2. setenv ethact egiga2;setenv serverip 192.168.11.114;setenv ipaddr 192.168.11.113
 3. tftpboot 0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin; bootm 0x02000000 -
 4. do backup mtd1 mtd3
 5. use sysupgrade

or Evgeny Kolesnikov <evgenyz@gmail.com> method from his failed PR 2040

- Using original firmware's network settings obtain SSH access to the device.
- Put *-image-cfs-factory.bin and *-uImage-factory.bin images into device's /tmp directory.
- Write kernel (uImage) image 'flash_eraseall /dev/mtd1 && nandwrite --markbad -p /dev/mtd1 /tmp/*-uImage-factory.bin'.
- Write rootfs (image-cfs) image 'ubiformat /dev/mtd3 -f /tmp/*-image.cfs-factory.bin -y'.
- Reboot the device.

Installation (upgrade):

Use *-sysupgrade.bin in a usual way.
Weltrend MCU control is done via uart1 19200
install coreutils-stty
stty -F /dev/ttyS1 raw speed 19200
stty -F /dev/ttyS1 raw speed 19200

PWM Fan Control
off: 00
echo -n -e '\xfa\x02\x00\x00\x00\x00\xfb' > /dev/ttyS1
slow: 5F
echo -n -e '\xfa\x02\x00\x5f\x00\x00\xfb' > /dev/ttyS1
max: FF
echo -n -e '\xfa\x02\x00\xff\x00\x00\xfb' > /dev/ttyS1

Power LED Control
Blue
echo -n -e '\xfa\x26\x00\x11\x00\x01\xfb' > /dev/ttyS1
Red
echo -n -e '\xfa\x26\x00\x14\x00\x01\xfb' > /dev/ttyS1
Orange
echo -n -e '\xfa\x26\x00\x12\x00\x01\xfb' > /dev/ttyS1

more here: https://github.com/c-MM/mcm-daemon/blob/master/mcm.h

Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
Link: https://github.com/openwrt/openwrt/pull/17779
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-02 18:07:42 +01:00
Markus Stockhausen
7bfa1fa83b realtek: rename smi-address dts property
The rtl9300,smi-address property was first developed for the RTL930x
targets. So it got a device specific prefix. Nowadays it is used for
RTL931x targets too. Convert it to our gerneric realtek prefix.

find ./realtek -type f -exec sed -i 's/rtl9300,smi-address/realtek,smi-address/g' {} +

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21343
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:05:02 +01:00
Markus Stockhausen
cd13ed6fcf realtek: rt-loader: allow piggy-backed uimage
Until now rt-loader expects a piggy-backed lzma compressed data
stream. Be more flexible and allow a piggy-backed uimage as well.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
4491f1d233 realtek: rt-loader: rename flash loading function
The loading function searches the image on flash (or its memory
copy). Rename it to make clearer what the function does. Adapt
comments accordingly.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
2e74ef5be1 realtek: rt-loader: make search_image() generic
Until now search_image() is used for searching a uImage on
flash (or the memory mapped equivalent). In a future commit
this will be reused to search for a piggy-backed uimage.
Make this function generic by

- replacing "flash" with "image" in variables
- Search bytewise and do not rely on 4 byte alignment
- remove 2 obsolete variables
- move console output to caller

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
8f66b33503 realtek: rt-loader: enhance is_uimage()
Until now is_uimage() is only a crc check and the caller
still needs to check other bits of the uimage header. Make
this function what it is meant to be.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21332
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-02 18:03:45 +01:00
Markus Stockhausen
8e6cd2608a realtek: setup cpu port in soc_info structure
A lot of soc_info usage has been reorganized. Nevertheless there
are some consumers left. A very critical one is the dsa/qos coding.
It makes use of the cpu_port in this shared structure. This is
totally broken as that info is never properly initialized. Fill
the cpu_port according to the identified hardware.

Remark: Looking at the prom.c history soc_info.cpu_port was never
setup since the beginning of time. So no "fixes" tag here.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
6b2e7ffd4b realtek: RTL930x: setup highmem registers during init
For some reason the highmem configuration of RTL930x
devices was totally missed until now. Take over the
setup from the SDK. This will avoid boot stalls on
switches with more than 256 MB RAM when switching
over to kernel 6.18.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
88e79af543 realtek: determine memory size during initialization
For proper highmem initialization on RTL930x the size of the
installed memory is needed during early bootup. Enhance the
soc_info structure and fill the data from the registers.

While we are here remove the obsolete compatible variable from
the soc_info structure.

Adapt boot message to show the memory size.

old: SoC Type: Realtek RTL9301 rev B (6487)
new: Realtek RTL9301 rev B (6487) SoC with 512 MB

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00
Markus Stockhausen
8337573422 realtek: harmonize variables in prom.c
There is mix of variable naming in prom.c. Use a fixed
prefix of "rtl_" for all static variables. Additionally
remove the prefix from rtl83xx_set_system_type as it is
a generic function for all SoC types.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21327
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-31 21:55:32 +01:00