Repository navigation
mediatek: MERCUSYS MR85X: add OpenWrt UBI layout and convert to DSA - #24435
Conversation
ae4fc9b to
e8a5260
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
e8a5260"mediatek: add OpenWrt UBI layout for MERCUSYS MR85X" — the diff does more than the subject/body describe: besides adding the UBI variant, it refactors the existingmt7981b-mercusys-mr85x.dtsinto a new sharedmt7981b-mercusys-mr85x-common.dtsiand, in doing so, changes the already-supported non-UBI board (three properties dropped from the EN8811H PHY node,&watchdog { status = "okay"; }added, button nodes renamed). Splitting the "move shared nodes into a common dtsi" refactor into its own commit — or at least mentioning it in the body — would make the functional delta on the existing device reviewable. See the inline comment on the PHY node.
Reviewed 2 commits at e8a5260. Main things to look at: the mac-base cell width vs. the default-mac format used in the flash instructions, the green:lan-2 GPIO differing between the U-Boot DTS and the kernel DTS, and the check_buttons → boot_tftp dangling reference in the default environment.
Generated by Claude Code
40f0018 to
4c10215
Compare
Fixed.
I've added the section to the commit message.
I added the section to the commit message. I have no idea why it’s different in the non-UBI version. MAC addresseslabel MAC address was found in UBI partition "tp_data", file "default-mac" (raw binary MAC). Proof: OEM wireless eeprom is also there (file "MT7981_EEPROM.bin").
Fixed. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the 3 files that changed since e8a5260.
Resolved from the previous round: the EN8811H phy-mode/full-duplex/pause properties are back in the common dtsi, the green:lan-2 GPIO now matches the kernel DTS (&pio 10), check_buttons and reset_factory no longer reference undefined variables, the stray replacevol=1 is gone, and fip as static now matches both the tree convention and the flash instructions. The mac-base question is answered by the new MAC-address section, and the new (0)/(-1) band offsets line up with the documented table.
One new issue introduced by this push — see the inline comment on ubi_create_env.
Generated by Claude Code
4c10215 to
ac917f3
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since 4c10215. The only change is the one-line fix in 474-add-mercusys_mr85x.patch — ubi_create_env now creates ubootenv/ubootenv2 as dynamic again, which resolves the fw_setenv/-EROFS issue from the previous round. Both commit messages are unchanged and still match their diffs, and all checks on ac917f3 are green.
No new issues found.
Generated by Claude Code
U-Boot network supportI have successfully integrated the Realtek switch driver (taken from D-Link DIR-X3260 GPL sources https://github.com/hsj79/dir-x3260-gplcode/). Everything is working perfectly and users can operate the device without any issues. TFTP flashing (FIP, preloader, recovery images) works flawlessly across both cold and warm boot cycles with stable speeds around 6.5 MiB/s. Why it's not ready for upstream OpenWrt yet:
Patches and binariesLogThe network is fully working: |
ac917f3 to
2ad49f2
Compare
|
Changes:
Cc @Schneider-Azima @namiltd @hauke (participants of the #19445 "mediatek: add support for Mercusys MR85X with DSA switch driver") |
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
75869e0"mediatek: fix LED enumerators for MERCUSYS MR85X" —Fixes: b2648d8 ("mediatek: add support for Mercusys MR85X")points at a commit that doesn't contain the file this patch touches:mt7981b-mercusys-mr85x-common.dtsiis created two commits earlier in this very series, so the tag can't be used to pick the fix back ontob2648d8. (OpenWrt/kernel convention is also a 12-char SHA, not 7.) See the inline comment — squashing this into the DSA commit sidesteps both problems.
Reviewed the 2 new commits since ac917f3 (75869e0, 2ad49f2); the two earlier commits are unchanged apart from the rebase onto b941179. The DSA switch node itself matches the realtek,rtl8365mb binding apart from the interrupt-controller child, and lan1/lan2/lan3 + openwrt,netdev-name = "wan" line up consistently across the DTS, 01_leds, 02_network and the 1.1 compat bump (correctly applied only to the pre-existing mercusys_mr85x, not to the brand-new -ubi variant). All checks on 2ad49f2 are green.
Generated by Claude Code
2ad49f2 to
86f8832
Compare
86f8832 to
3081a1d
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since 2ad49f2, which is just two hunks: the completed interrupt-controller node in mt7981b-mercusys-mr85x-common.dtsi and the KernelPackage/switch-rtl8367s removal in modules.mk. The three commits carrying them (f350bb9, bf38a31, 3081a1d) all have messages that match their diffs.
Resolved from the previous round: 75869e0's LED renumbering no longer leaves the tree broken — f350bb9 now moves 01_leds to lan1/lan2/lan3 + masks 0x01/0x02/0x04 in the same commit, so every commit is self-consistent (the block is then replaced by netdev triggers in bf38a31, which is expected).
On 3081a1d: I checked the concern from the filogic.mk thread. git grep switch-rtl8367s at head returns nothing outside the removed block, and the three remaining users (mt7622-{buffalo-wsr-2533dhp2,elecom-wrc-2533gent,totolink-a8000ru}.dts, all mediatek,rtk-gsw) get the driver from CONFIG_RTL8367S_GSW=y in target/linux/mediatek/mt7622/config-6.18:448, not from the kmod — so dropping the package definition while keeping files/drivers/net/phy/rtk/ is consistent with what the commit message says, and @namiltd's point is covered. filogic/config-6.18 already carries # CONFIG_RTL8367S_GSW is not set, so nothing there needs a refresh.
One question on the interrupt hunk — see the inline comment. All checks on 3081a1d are green.
Generated by Claude Code
3081a1d to
6eda51c
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since 3081a1d. Two commits have new OIDs (3a24bf2, 6eda51c), but 6eda51c is a pure rebase of the modules.mk removal — the only content change in the whole push is one hunk in mt7981b-mercusys-mr85x-common.dtsi: the rtl8367s_intc node and the three interrupt-parent/interrupts pairs on [email protected] are dropped again, putting the switch PHYs back in polled mode.
That closes the question from the previous round, and with hardware evidence: your log shows the IRQs are wired up correctly (irq=78/79/80 instead of POLL) but no lan1/lan2/lan3 link ever comes up, so falling back to polling is the right call for now. Worth noting realtek.yaml makes the interrupt-controller child optional and rtl8365mb_irq_setup() is skipped entirely when it is absent, so this is a supported configuration, not a workaround. No dangling references are left behind — git grep rtl8367s_intc at head returns nothing, and IRQ_TYPE_* is no longer used in either mr85x DTS.
Both commit messages are unchanged and still match their diffs. All checks on 6eda51c are green.
Reviewed 2 new commits; no new issues found.
Generated by Claude Code
6eda51c to
4d99280
Compare
|
Changes:
Avoid numbering conflict since after the latest commits to |
069b710 to
8d1f6df
Compare
|
Changes:
Avoid numbering conflict since after the latest commits to |
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since bb60afe. git range-diff shows commits 2–5 (ac03858, 60fc920, 35e294a, 8d1f6df) are byte-identical to their previous OIDs; the only content change in the whole push is in commit 1893080 — the 475-add-mercusys_mr85x.patch → 476-add-mercusys_mr85x.patch rename plus the 45-line git-format header you added in response to the FormalityCheck bot.
The renumbering is correct: origin/main now carries 475-add-teralink_tl3020-256mb.patch, 476 is free (nothing between 474 and 500 besides 475), and git grep '47[45]-add-mercusys' at head returns nothing, so no dangling references.
The header itself is internally consistent — the diffstat (arch/arm/dts/mt7981_mercusys-mr85x.dts 160, configs/mt7981_mercusys_mr85x_defconfig 97, defenvs/mercusys-mr85x_env 34, 291 total) matches the three hunks in the file exactly, and everything above --- /dev/null is ignored by quilt/patch. One cosmetic point on the Subject: line — see the inline comment.
CI on 8d1f6df: all 22 check runs green, including FormalityCheck / Code Patches, which was the warning that prompted this push.
Reviewed 5 commits (1 with new content); 1 nit.
Generated by Claude Code
| From 7fdff1f4c493be5b240b44227dada51007698122 Mon Sep 17 00:00:00 2001 | ||
| From: Mikhail Zhilkin <[email protected]> | ||
| Date: Sun, 26 Jul 2026 16:41:38 +0300 | ||
| Subject: uboot-mediatek: add support for MERCUSYS MR85X |
There was a problem hiding this comment.
nit: the new header's Subject: is the OpenWrt commit subject (uboot-mediatek: prefix) and drops the [PATCH] tag. Inside a U-Boot patch this should read like a U-Boot commit — both neighbours added recently do: 474-add-tplink-be450.patch:4 is Subject: [PATCH] add TP-Link BE450, 475-add-teralink_tl3020-256mb.patch:4 is Subject: [PATCH] board: mediatek: add Teralink TL3020 256mb.
| Subject: uboot-mediatek: add support for MERCUSYS MR85X | |
| Subject: [PATCH] board: mediatek: add MERCUSYS MR85X |
Two related points on the same header block, prose only since neither has a single obvious replacement:
- Line 1's
From 7fdff1f4c493be5b240b44227dada51007698122is the OID this commit had before the last rebase (it is now1893080), i.e. an OpenWrt-tree SHA that no longer resolves anywhere. It is inert as far asquilt/patchare concerned, so not worth another push on its own, but if you touch the header again a freshgit format-patch-generated line (or just dropping the SHA) avoids the stale pointer. - The header body carries the OpenWrt-packaging discussion verbatim ("Why it's not ready for upstream OpenWrt yet", the 3 MB SDK size, the link to your out-of-tree binaries). That reads oddly as a U-Boot commit message and duplicates commit
1893080's body; the "Networking Configuration Note" part is the piece that actually belongs here.
Generated by Claude Code
There was a problem hiding this comment.
As you noticed before: Not something I'd block on, but adding the header is trivial if you want the bot quiet. I dropped the header, since it's not trivial and this story is becoming never ending.
8d1f6df to
2c8395e
Compare
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
|
Please remove "Link: namiltd#131" from "mediatek: convert MERCUSYS MR85X to DSA". It might disappear if I delete the local openwrt tree, and it would point to a non-existent page. |
2c8395e to
bc0bb46
Compare
Done. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Re-reviewed the delta since 8d1f6df. git range-diff shows commits 2, 3 and 5 (7a43cc3, 9912ea6, bc0bb46) are byte-identical to their previous OIDs; only two things changed in the whole push:
cd274d3— the 45-line git-format header is removed from476-add-mercusys_mr85x.patchagain (git diff 8d1f6df..bc0bb46is exactly-45lines in that one file, no code touched). I'm not re-raising this: you explained the reasoning in the previous thread, and a bare--- /dev/nullstart matches the prevailing convention in that directory (470-add-bpi-r4-lite.patch,473-add-creatlentem_clt-r30b1-ubi.patch). It also makes theSubject:nit from last round moot. The patch itself is still well-formed — three hunks, and the@@ -0,0 +1,97/160/34 @@counts match the 300-line file exactly.086dcc2—Link: https://github.com/namiltd/openwrt/pull/131/dropped from the DSA commit message, which is what @namiltd asked for. The rest of the message is unchanged and still matches its diff.
Patch numbering is still valid: origin/main at 94a21b3 tops out at 475-add-teralink_tl3020-256mb.patch, so 476 is free, and git grep -E '47[0-9]-add-mercusys' at head returns nothing outside the file itself.
CI on bc0bb46: all 22 check runs green, including FormalityCheck / Code Patches (the bot's missing-git-header note is a warning, not a failure).
Reviewed 5 commits (2 with new content); no new issues found.
Generated by Claude Code
|
@jonasjelonek hi! Could you take a look when you have time? |
|
Hi! |
|
In commit message of the "uboot-mediatek: add support for MERCUSYS MR85X" commit, what's the purpose of the "ToDo" section? Is this a development relic? Sounds weird to have something like "not ready for OpenWrt", etc. described there. |
Thank you for the review. This is the final version of the initial support patch. Due to the lack of an upstream driver for the Realtek switch, Ethernet functionality is disabled by default in this U-Boot commit. The "ToDo" section is intentionally kept as a guide for future developers and users. Since enabling upstream Ethernet requires a massive 3MB SDK driver that is not ready for OpenWrt, this section provides a clear roadmap and links to the source code for anyone who wants to continue this work. Additionally, the ready-to-use binaries allow users to utilize full Ethernet functionality right now. Regarding device recovery: since Ethernet is disabled in this initial U-Boot build, a UART serial connection is required for emergency recovery when using this bootloader. It is worth noting that a UART connection is also required for installing / recovering OpenWrt on the stock bootloader anyway. Ultimately, this means the user experience and recovery situation do not become any worse compared to using the stock bootloader. |
Introduce initial board support for the Mercusys MR85X, an AX3000 wireless router powered by the MediaTek MT7981 (Filogic 820) SoC. Networking Configuration Note ----------------------------- Ethernet functionality is currently disabled in this stage of U-Boot due to the specific board configuration: 1. The Realtek RTL8367S switch does not have an available U-Boot driver 2. The Airoha EN8811 PHY is physically routed to GMAC1 rather than the standard GMAC0 pipeline. This requires further adjustment to bind and trace MDIO/PHY operations over GMAC1. ToDo ---- I have successfully integrated the Realtek switch driver (taken from D-Link DIR-X3260 GPL sources. Link: https://github.com/hsj79/dir-x3260-gplcode/ Everything is working perfectly and users can operate the device without any issues. TFTP flashing (FIP, preloader, recovery images) works flawlessly across both cold and warm boot cycles with stable speeds around 6.5 MiB/s. Why it's not ready for upstream OpenWrt yet: - Patch Size: The included Realtek SDK files are massive (approximately 3 MB), which is way too large for a standard OpenWrt package patch - Code Optimization: The implementation is currently a functional workaround and requires significant refactoring, cleanup and optimization to match official OpenWrt submission standards Patches and ready-to-use binaries Link: https://github.com/csharper2005/uboot-mediatek-rtl8367s/ Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR85X.
Stock bootloader UBI size: 50 MiB
OpenWrt U-Boot UBI size: 127 MiB
Other changes
-------------
- Watchdog is enabled for the both layouts
- Button labels renamed according to the kernel documentation
Preparation
-----------
OpenWrt for stock U-Boot should be installed first. Before formatting or
rewriting any partition structures, you must copy EEPROM data and unique
MAC address. Navigate to the /tmp/tp_data directory on the router. Locate
and copy these files to your PC:
- default-mac (contains your device's unique MAC address mapping)
- MT7981_EEPROM.bin (contains factory wireless calibration data)
Installation
------------
1. Initialize the Hardware Environment
Power off the router. Run the mtk_uartboot utility on your computer. Power
on the router. Wait for the utility to push the initial payload, boot the
device temporarily and format the UBI partition structure.
2. Access the U-Boot Promp
Run mtk_uartboot on your computer a second time. When the utility menu
appears on your terminal screen, choose Exit. This will drop you safely
into the interactive U-Boot command line interface prompt (MT7981>).
3. Flash the BL2 (preloader)
You must write the second-stage bootloader (BL2) directly to the MTD
partition. Prepare the router to receive the BL2 image over serial Ymodem
protocol:
MT7981> loady
In your terminal application, select File -> Transfer -> Ymodem -> Send
and select the path to:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-preloader.bin
Erase the existing BL2 partition:
MT7981> mtd erase bl2
Commit the new BL2 binary from RAM to the flash memory:
MT7981> mtd write bl2 $loadaddr 0x0 ${filesize}
4. Provision the FIP Partition (BL31 & U-Boot)
Ready the router to receive the FIP package:
MT7981> loady
In your terminal application, send the following file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-bl31-uboot.fip
Clear the legacy tracking data and configure the UBI block allocation:
MT7981> ubi write $loadaddr fip ${filesize}
5. Boot into OpenWrt Recovery
With the core partition structures and boot code firmly written, you can
now push and execute the temporary OpenWrt recovery environment to finish
the installation. Prepare for the final serial download:
MT7981> loady
Send the following recovery image file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-initramfs-recovery.itb
Boot the OpenWrt kernel image directly out of the memory cache:
MT7981> bootm
6. Flash OpenWrt permanently
Once the router finishes booting the initramfs image, navigate to
192.168.1.1 in your web browser to access the OpenWrt LuCI recovery
interface. From there, permanently flash the production sysupgrade image.
7. Recovery factory data
Once the router finishes booting into OpenWrt, you must rebuild and flash
the factory volume payload. This process combines your unique wireless
calibration data and MAC address back into a single compliant block.
Use SCP or an SFTP client (like WinSCP) to copy your two backup files from
your PC into the router's /tmp directory:
- default-mac
- MT7981_EEPROM.bin
Connect to the router via SSH and run the following commands:
dd if=/dev/zero bs=$((0x8000)) count=1 | tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7981_EEPROM.bin of=/tmp/factory.bin conv=notrunc
dd if=/tmp/default-mac >> /tmp/factory.bin
Query the system to confirm the exact logical UBI character device target
for the factory volume:
ubinfo /dev/ubi0 -N factory | grep "Volume ID" | awk '{print $3}'
Commit the newly created factory.bin file directly into the designated
factory UBI block (replace _1 below if your volume ID query returned a
different number):
ubiupdatevol /dev/ubi0_1 /tmp/factory.bin
Reboot your router to apply the changes.
Recovery
--------
The same as installation.
UART
----
Connection parameters: 115200, 8N1, 3.3V
UART pins are silkscreened on the PCB.
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 08:xx:xx:xx:xx:f5 | label |
| LAN | 08:xx:xx:xx:xx:f5 | label |
| WAN | 08:xx:xx:xx:xx:f6 | label+1 |
| WLAN 2g | 08:xx:xx:xx:xx:f5 | label |
| WLAN 5g | 08:xx:xx:xx:xx:f4 | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac" (raw binary MAC). Proof:
hexdump -C default-mac
00000000 08 xx xx xx xx f5 |....Y.|
00000006
OEM wireless eeprom is also there (file
"MT7981_EEPROM.bin").
Link: https://github.com/981213/mtk_uartboot
Signed-off-by: Mikhail Zhilkin <[email protected]>
Link: openwrt#24435
Signed-off-by: Jonas Jelonek <[email protected]>
Update the LED enumeration layout from 0, 1, 2 to 1, 2, 3. This aligns the internal LED identifiers directly with physical LAN ports 1, 2, and 3 to improve code readability and eliminate off-by-one mapping confusion. Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
Migrate the Mercusys MR85X network switch configuration from the legacy swconfig architecture to the Distributed Switch Architecture (DSA) driver framework. This updates the device tree bindings to utilize the realtek-rtl8365mb DSA driver for the integrated Realtek RTL8367S switch, enabling proper native Linux bridging interface management. Co-authored-by: Schneider Azima <[email protected]> Link: openwrt#19445 Co-authored-by: Mieczyslaw Nalewaj <[email protected]> Co-authored-by: Mikhail Zhilkin <[email protected]> Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
Dropping kmod-switch-rtl8367s leaves it with zero in-tree users. Clean up the tree by removing its definition in modules.mk. Keep Realtek SDK located under target/linux/mediatek/files/drivers/net/phy/rtk/ untouched since it's necessary for mt7622 devices: - totolink,a8000ru - elecom,wrc-2533gent - buffalo,wsr-2533dhp2 Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
bc0bb46 to
725cbf1
Compare
|
Thanks! Rebased on top of main and merged! |
Introduce initial board support for the Mercusys MR85X, an AX3000 wireless router powered by the MediaTek MT7981 (Filogic 820) SoC. Networking Configuration Note ----------------------------- Ethernet functionality is currently disabled in this stage of U-Boot due to the specific board configuration: 1. The Realtek RTL8367S switch does not have an available U-Boot driver 2. The Airoha EN8811 PHY is physically routed to GMAC1 rather than the standard GMAC0 pipeline. This requires further adjustment to bind and trace MDIO/PHY operations over GMAC1. ToDo ---- I have successfully integrated the Realtek switch driver (taken from D-Link DIR-X3260 GPL sources. Link: https://github.com/hsj79/dir-x3260-gplcode/ Everything is working perfectly and users can operate the device without any issues. TFTP flashing (FIP, preloader, recovery images) works flawlessly across both cold and warm boot cycles with stable speeds around 6.5 MiB/s. Why it's not ready for upstream OpenWrt yet: - Patch Size: The included Realtek SDK files are massive (approximately 3 MB), which is way too large for a standard OpenWrt package patch - Code Optimization: The implementation is currently a functional workaround and requires significant refactoring, cleanup and optimization to match official OpenWrt submission standards Patches and ready-to-use binaries Link: https://github.com/csharper2005/uboot-mediatek-rtl8367s/ Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR85X.
Stock bootloader UBI size: 50 MiB
OpenWrt U-Boot UBI size: 127 MiB
Other changes
-------------
- Watchdog is enabled for the both layouts
- Button labels renamed according to the kernel documentation
Preparation
-----------
OpenWrt for stock U-Boot should be installed first. Before formatting or
rewriting any partition structures, you must copy EEPROM data and unique
MAC address. Navigate to the /tmp/tp_data directory on the router. Locate
and copy these files to your PC:
- default-mac (contains your device's unique MAC address mapping)
- MT7981_EEPROM.bin (contains factory wireless calibration data)
Installation
------------
1. Initialize the Hardware Environment
Power off the router. Run the mtk_uartboot utility on your computer. Power
on the router. Wait for the utility to push the initial payload, boot the
device temporarily and format the UBI partition structure.
2. Access the U-Boot Promp
Run mtk_uartboot on your computer a second time. When the utility menu
appears on your terminal screen, choose Exit. This will drop you safely
into the interactive U-Boot command line interface prompt (MT7981>).
3. Flash the BL2 (preloader)
You must write the second-stage bootloader (BL2) directly to the MTD
partition. Prepare the router to receive the BL2 image over serial Ymodem
protocol:
MT7981> loady
In your terminal application, select File -> Transfer -> Ymodem -> Send
and select the path to:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-preloader.bin
Erase the existing BL2 partition:
MT7981> mtd erase bl2
Commit the new BL2 binary from RAM to the flash memory:
MT7981> mtd write bl2 $loadaddr 0x0 ${filesize}
4. Provision the FIP Partition (BL31 & U-Boot)
Ready the router to receive the FIP package:
MT7981> loady
In your terminal application, send the following file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-bl31-uboot.fip
Clear the legacy tracking data and configure the UBI block allocation:
MT7981> ubi write $loadaddr fip ${filesize}
5. Boot into OpenWrt Recovery
With the core partition structures and boot code firmly written, you can
now push and execute the temporary OpenWrt recovery environment to finish
the installation. Prepare for the final serial download:
MT7981> loady
Send the following recovery image file via Ymodem:
openwrt-mediatek-filogic-mercusys_mr85x-ubi-initramfs-recovery.itb
Boot the OpenWrt kernel image directly out of the memory cache:
MT7981> bootm
6. Flash OpenWrt permanently
Once the router finishes booting the initramfs image, navigate to
192.168.1.1 in your web browser to access the OpenWrt LuCI recovery
interface. From there, permanently flash the production sysupgrade image.
7. Recovery factory data
Once the router finishes booting into OpenWrt, you must rebuild and flash
the factory volume payload. This process combines your unique wireless
calibration data and MAC address back into a single compliant block.
Use SCP or an SFTP client (like WinSCP) to copy your two backup files from
your PC into the router's /tmp directory:
- default-mac
- MT7981_EEPROM.bin
Connect to the router via SSH and run the following commands:
dd if=/dev/zero bs=$((0x8000)) count=1 | tr '\000' '\377' > /tmp/factory.bin
dd if=/tmp/MT7981_EEPROM.bin of=/tmp/factory.bin conv=notrunc
dd if=/tmp/default-mac >> /tmp/factory.bin
Query the system to confirm the exact logical UBI character device target
for the factory volume:
ubinfo /dev/ubi0 -N factory | grep "Volume ID" | awk '{print $3}'
Commit the newly created factory.bin file directly into the designated
factory UBI block (replace _1 below if your volume ID query returned a
different number):
ubiupdatevol /dev/ubi0_1 /tmp/factory.bin
Reboot your router to apply the changes.
Recovery
--------
The same as installation.
UART
----
Connection parameters: 115200, 8N1, 3.3V
UART pins are silkscreened on the PCB.
MAC addresses
-------------
+---------+-------------------+-----------+
| | MAC | Algorithm |
+---------+-------------------+-----------+
| label | 08:xx:xx:xx:xx:f5 | label |
| LAN | 08:xx:xx:xx:xx:f5 | label |
| WAN | 08:xx:xx:xx:xx:f6 | label+1 |
| WLAN 2g | 08:xx:xx:xx:xx:f5 | label |
| WLAN 5g | 08:xx:xx:xx:xx:f4 | label-1 |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file
"default-mac" (raw binary MAC). Proof:
hexdump -C default-mac
00000000 08 xx xx xx xx f5 |....Y.|
00000006
OEM wireless eeprom is also there (file
"MT7981_EEPROM.bin").
Link: https://github.com/981213/mtk_uartboot
Signed-off-by: Mikhail Zhilkin <[email protected]>
Link: openwrt#24435
Signed-off-by: Jonas Jelonek <[email protected]>
Update the LED enumeration layout from 0, 1, 2 to 1, 2, 3. This aligns the internal LED identifiers directly with physical LAN ports 1, 2, and 3 to improve code readability and eliminate off-by-one mapping confusion. Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
Migrate the Mercusys MR85X network switch configuration from the legacy swconfig architecture to the Distributed Switch Architecture (DSA) driver framework. This updates the device tree bindings to utilize the realtek-rtl8365mb DSA driver for the integrated Realtek RTL8367S switch, enabling proper native Linux bridging interface management. Co-authored-by: Schneider Azima <[email protected]> Link: openwrt#19445 Co-authored-by: Mieczyslaw Nalewaj <[email protected]> Co-authored-by: Mikhail Zhilkin <[email protected]> Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>
Dropping kmod-switch-rtl8367s leaves it with zero in-tree users. Clean up the tree by removing its definition in modules.mk. Keep Realtek SDK located under target/linux/mediatek/files/drivers/net/phy/rtk/ untouched since it's necessary for mt7622 devices: - totolink,a8000ru - elecom,wrc-2533gent - buffalo,wsr-2533dhp2 Signed-off-by: Mikhail Zhilkin <[email protected]> Link: openwrt#24435 Signed-off-by: Jonas Jelonek <[email protected]>



This commit adds OpenWrt U-Boot (UBI) layout support for MERCUSYS MR85X.
A note about U-Boot network support #24435 (comment)