Skip to content

mediatek: add support for Mercusys MR85X - #19187

Merged
openwrt-bot merged 2 commits into
openwrt:mainfrom
Schneider-Azima:main
Nov 30, 2025
Merged

openwrt-bot merged 2 commits into
openwrt:mainfrom
Schneider-Azima:main

Conversation

@Schneider-Azima

Copy link
Copy Markdown
Contributor

This commit adds support for Mercusys MR85X router.

Device specification:

 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):

 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:

 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:

+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+

label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

@Schneider-Azima

Schneider-Azima commented Jun 20, 2025 •

Copy link
Copy Markdown
Contributor Author

One confusing thing: this switch's id is 0x636700A0, and it uses external port 1, which supports up to 2.5G.

According to rtl8365mb driver, this is a supported model "rtl8367s". However, it can't set "supported_interfaces", for external port 1 don't support rgmii.

[    1.230324] realtek-mdio mdio-bus:1d: found an RTL8367S switch
[    1.374239] realtek-mdio mdio-bus:1d: phylink: error: empty supported_interfaces
[    1.381662] error creating PHYLINK: -22
[    1.386536] realtek-mdio mdio-bus:1d: unable to register switch ret = -22
[    1.393349] realtek-mdio: probe of mdio-bus:1d failed with error -22
static void rtl8365mb_phylink_get_caps(struct dsa_switch *ds, int port,
				       struct phylink_config *config)
{
	const struct rtl8365mb_extint *extint =
		rtl8365mb_get_port_extint(ds->priv, port);

	config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
				   MAC_10 | MAC_100 | MAC_1000FD;

	if (!extint) {
		__set_bit(PHY_INTERFACE_MODE_INTERNAL,
			  config->supported_interfaces);

		/* GMII is the default interface mode for phylib, so
		 * we have to support it for ports with integrated PHY.
		 */
		__set_bit(PHY_INTERFACE_MODE_GMII,
			  config->supported_interfaces);
		return;
	}

	/* Populate according to the modes supported by _this driver_,
	 * not necessarily the modes supported by the hardware, some of
	 * which remain unimplemented.
	 */

	if (extint->supported_interfaces & RTL8365MB_PHY_INTERFACE_MODE_RGMII)
		phy_interface_set_rgmii(config->supported_interfaces);
}

For rtl8365mb driver, my dts node is as follow. If anyone knows how to make it work, please comment.

switch@1d {
    compatible = "realtek,rtl8365mb";
    reg = <29>;
    reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;

    interrupt-controller {
        #interrupt-cells = <1>;
        interrupt-parent = <&pio>;
        interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
    };

    ports {
        #address-cells = <1>;
        #size-cells = <0>;

        port@0 {
            reg = <0>;
            label = "lan0";
        };

        port@1 {
            reg = <1>;
            label = "lan1";
        };

        port@2 {
            reg = <2>;
            label = "lan2";
        };

        port@6 {
            reg = <6>;
            label = "cpu";
            ethernet = <&gmac0>;
            phy-mode = "2500base-x";

            fixed-link {
                speed = <2500>;
                full-duplex;
                pause;
            };
        };
    };
};

According to MR85X's GPL dts code, it seems to use "rtkgsw" (rtl8367c) driver. I tried, and it works.
https://www.mercusys.com/en/support/gpl-code?model=MR85X

@github-actions github-actions Bot added kernel pull request/issue with Linux kernel related changes core packages pull request/issue for core (in-tree) packages target/mediatek pull request/issue for mediatek target labels Jun 20, 2025
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

@dangowrt Hi, what do you think of the change to rtl8367s driver b4f28d1? Is it OK?

@dangowrt

Copy link
Copy Markdown
Member

I'd very much prefer to get rid of that ugly driver altogether in favor of replacing it with the DSA driver. Different initvals will be needed for sure, and probably also other changes to the driver, but it would be so much better than keep using the old swconfig phy driver...

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

I'd very much prefer to get rid of that ugly driver altogether in favor of replacing it with the DSA driver. Different initvals will be needed for sure, and probably also other changes to the driver, but it would be so much better than keep using the old swconfig phy driver...

@dangowrt I noticed your commit log that RTL8367S is supported by RTL8365MB driver, so it's best to remove the old one.

Actually the whole RTL8365MB driver only support up to 1G. For RTL8367S switch, maybe EXT2 (extint 7) can work with it? I don't know. But EXT1 (extint 6) don't work.

In other words, RTL8365MB driver does not fully support rtl8367s switch. To support 2.5G, most of this driver needs to be modified.

{
	.name = "RTL8367S",
	.chip_id = 0x6367,
	.chip_ver = 0x00A0,
	.extints = {
		{ 6, 1, PHY_INTF(SGMII) | PHY_INTF(HSGMII) },
		{ 7, 2, PHY_INTF(MII) | PHY_INTF(TMII) |
			PHY_INTF(RMII) | PHY_INTF(RGMII) },
	},
	.jam_table = rtl8365mb_init_jam_8365mb_vc,
	.jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc),
},

At this moment, I haven't seen any model that uses RTL8367S and supports 2.5G and is using RTL8365MB driver. If you insist to use RTL8365MB driver for 2.5G RTL8367S switch and make some change to the driver, do you have a candidate model for test? I suggest making this model the first one.

@luizluca

luizluca commented Jun 29, 2025 •

Copy link
Copy Markdown
Contributor

Actually the whole RTL8365MB driver only support up to 1G. For RTL8367S switch, maybe EXT2 (extint 7) can work with it? I don't know. But EXT1 (extint 6) don't work.

RTL8365MB still does not support any other interface type but RGMII:

https://github.com/torvalds/linux/blob/master/drivers/net/dsa/realtek/rtl8365mb.c#L43C1-L44C1

In other words, RTL8365MB driver does not fully support rtl8367s switch. To support 2.5G, most of this driver needs to be modified.

{
	.name = "RTL8367S",
	.chip_id = 0x6367,
	.chip_ver = 0x00A0,
	.extints = {
		{ 6, 1, PHY_INTF(SGMII) | PHY_INTF(HSGMII) },
		{ 7, 2, PHY_INTF(MII) | PHY_INTF(TMII) |
			PHY_INTF(RMII) | PHY_INTF(RGMII) },
	},
	.jam_table = rtl8365mb_init_jam_8365mb_vc,
	.jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc),
},

When I added these interfaces descriptions, I added (for completeness) both interfaces. However the driver didn't implement all those types as the two devs involved (me and Alvin Šipraga) didn't have access to devices that uses (H)SGMII. The actual information that the driver passes to the rest of the kernel is from rtl8365mb_phylink_get_caps(). Today it just checks for RGMII intefaces and sets it as capable and bails out if not:

https://github.com/torvalds/linux/blob/master/drivers/net/dsa/realtek/rtl8365mb.c#L1047C37-L1047C71

The driver is not responsible to warn if a mode is supported or not: just to list what it supports (get_caps). You might need to extend rtl8365mb_phylink_get_caps(), and the rest of the driver, to check the interface is being verified and which types it supports.

rtl8365mb_phylink_mac_config and rtl8365mb_phylink_mac_link_{up,down} are also only treating RGMII case as well as you'll need to adapt or creating a new rtl8365mb_ext_config_rgmii for your case (HSGMII/SGMII).

I would avoid adding more registers to the jam_table if HSGMII/SGMII needs some initialization. The jam_table is just an opaque bunch of registers values that should, one day, be gone. The rtl8367c is a good inspiration of what is needed to be configured to get your port up. This might help as well:

https://cdn.jsdelivr.net/gh/libc0607/Realtek_switch_hacking@files/Realtek_Unmanaged_Switch_ProgrammingGuide.pdf

At this moment, I haven't seen any model that uses RTL8367S and supports 2.5G and is using RTL8365MB driver. If you insist to use RTL8365MB driver for 2.5G RTL8367S switch and make some change to the driver, do you have a candidate model for test? I suggest making this model the first one.

At this moment, no other dev has a device, like MR85X, to implement the HSGMII/SGMII interface.

@hauke

hauke commented Jul 12, 2025

Copy link
Copy Markdown
Member

I added SGMII support for the rtl8365mb driver some time ago, but never finished it:
https://patchwork.kernel.org/project/netdevbpf/list/?series=639580&state=*
I also have some OpenWrt branches.

I had problems with the mac in the mt7622, it only supports MTK CPU tags, but not RTL CPU tags and then some offloading functionality doe snot work. maybe this is bette for the more modern MACs.

@dangowrt

Copy link
Copy Markdown
Member

@hauke No, all (also most recent) MediaTek MACs support only MediaTek DSA special tags for PPE offloading. The work-around is to use Q-in-Q instead of the special tag, DSA has some helpers for that. Most modern DSA hardware has support for switching between a proprietary special tag and using Q-in-Q as tag format. The proprietary format has the advantage that all Q and Q-in-Q aka. af VLANs can be used, the Q-in-Q tag format has the advantage of being compatible with various offloading engines while limiting Q-in-Q on user ports.

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

I added SGMII support for the rtl8365mb driver some time ago, but never finished it: https://patchwork.kernel.org/project/netdevbpf/list/?series=639580&state=* I also have some OpenWrt branches.

Thanks for your work. I tried it, IP protocol works, but TCP TX hardware checksum is wrong. If I trun off hardware checksum with ethtool -K eth0 tx off, network link seems OK. As eth0's mtu is 1508 (1500 and a tag?), I suppose this cause the error.

Now I remove the change to old phy switch driver, MR85X still works, with all LAN LEDs always on. Is it OK to merge?

@luizluca

Copy link
Copy Markdown
Contributor

@hauke No, all (also most recent) MediaTek MACs support only MediaTek DSA special tags for PPE offloading. The work-around is to use Q-in-Q instead of the special tag, DSA has some helpers for that. Most modern DSA hardware has support for switching between a proprietary special tag and using Q-in-Q as tag format. The proprietary format has the advantage that all Q and Q-in-Q aka. af VLANs can be used, the Q-in-Q tag format has the advantage of being compatible with various offloading engines while limiting Q-in-Q on user ports.

Q-in-Q is a nice workaround. Losing Q-in-Q on the user ports is preferable to losing offload. The issue with Mediatek offload is that you cannot indicate where the IP packet starts, so it needs to parse the entire packet. If it doesn't expect a second layer of dot1Q, it won’t find the IP and TCP/UDP headers—similar to what happens with an alien (Realtek) CPU tag.

I assume that the DSA switch driver doesn’t need to explicitly support Q-in-Q, since it could consume the outer VLAN tag independently of what's encapsulated inside. Are these assumptions correct?

My test system uses a ramips/mt7620 with an rtl8367s. I'm not sure if Q-in-Q will work, but I can give it a try. Is there any supported device currently using it?

@luizluca

Copy link
Copy Markdown
Contributor

I added SGMII support for the rtl8365mb driver some time ago, but never finished it: https://patchwork.kernel.org/project/netdevbpf/list/?series=639580&state=* I also have some OpenWrt branches.

Thanks for your work. I tried it, IP protocol works, but TCP TX hardware checksum is wrong. If I trun off hardware checksum with ethtool -K eth0 tx off, network link seems OK. As eth0's mtu is 1508 (1500 and a tag?), I suppose this cause the error.

Yes, the MTU is increased to fit the CPU tag. For mt7620, I needed to enable the jumbo frames.
luizluca@2034d2c
You can test this hypothesis by lowering the MTU in your router and in a remote system (i.e. 1400 bytes) and check if everything works.

The offload also might need a fix like this:
luizluca@a0b554a
It is better than workaround it in userland.

Now I remove the change to old phy switch driver, MR85X still works, with all LAN LEDs always on. Is it OK to merge?

According to your DTS, the LEDs are connected the mt7981b and not the switch. It is a good news as both rtl8367s_gsw and rtl8365mb does not support LED control (yet). As rtl8367s_gsw is a swconfig switch, there won't be a lanN device to trigger the LED and you cannot use ucidef_set_led_netdev. Check a swconfig device as an example. I'll be something like this:

        ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
        ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10" 
        ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08" 
        ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04"
        ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Changed 01_leds script, use ucidef_set_led_switch to set LAN LED control. Now functionality seems all OK with rtl8367s_gsw driver.

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

luizluca/openwrt@a0b554a This way test works with mt7981. But ethtool isn't aware of this. Maybe need some more code to expose the change of HW checksum to the stat interface?

root@OpenWrt:~# ethtool -k eth0 | grep checksum
rx-checksuming: on
tx-checksuming: on
	tx-checksum-ipv4: on
	tx-checksum-ip-generic: off [fixed]
	tx-checksum-ipv6: on
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]

Forwarding offload still don't work. Seems @luizluca already know this.

@hauke 's HSGMII support seems unlikely to be accepted by kernel for quite a period of time. So may I open a new PR to support MR85X with DSA switch? There will be two OpenWrt kernel patches, one for HSGMII support, one for MTK HW checksum. Shall QinQ be completed one day and rtl8365mb enters a relatively usable state, simply delete/modify these two patches, and MR85X can still works without some new support commits.

I can help with test. MR85X uses ext1, works in HSGMII mode.

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

I made a new PR #19445 to support Mercusys MR85X with rtl8365mb DSA switch driver.

This PR uses the old rtl8367s_gsw swconfig driver. Functionality seems all OK.
If it is clearly decided that no more new device will rely on this old driver, please let me know. And I will close this one. Thanks.

@hauke

hauke commented Jul 19, 2025

Copy link
Copy Markdown
Member

I did not follow up on the upstream submission. If you want you can continue the effort. I do not know how to handle the firmware needed for the HSGMII part of the switch. It is part of a binary with a GPL header.

Comment thread target/linux/mediatek/modules.mk Resolved
Comment thread target/linux/mediatek/modules.mk Resolved
Comment thread target/linux/mediatek/image/filogic.mk Resolved
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Moved dependency of kmod-swconfig to modules.mk.
And replaced AutoLoad with AutoProbe. Test works fine.

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

@dangowrt @hauke @luizluca @namiltd
Hi, may I kindly suggest that we merge this PR as a first support for this device? And I will change #19445 to a "convert to DSA".

As we continue to wait for the DSA driver to be completed, PRs need to be constantly updated to handle merge conflicts. "convert" only needs to modify dts and network initialization scripts, and things will be much simpler.

@luizluca

luizluca commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

@dangowrt @hauke @luizluca @namiltd Hi, may I kindly suggest that we merge this PR as a first support for this device? And I will change #19445 to a "convert to DSA".

As we continue to wait for the DSA driver to be completed, PRs need to be constantly updated to handle merge conflicts. "convert" only needs to modify dts and network initialization scripts, and things will be much simpler.

Whether the device is using swconfig or DSA should not block the merge. I just don't know how devs feels about rtl8367s_gsw. It was born as a target specific module and it looks like it was kept as a low profile. Being a generic code, independent from arch/target, it should have landed in the linux/generic, not mediatek.

Comment thread target/linux/mediatek/modules.mk Resolved
@hauke

hauke commented Sep 11, 2025

Copy link
Copy Markdown
Member

Adding this target with the swconfig driver is fin.

The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
@openwrt-bot
openwrt-bot merged commit b2648d8 into openwrt:main Nov 30, 2025
danpawlik pushed a commit to danpawlik/openwrt that referenced this pull request Dec 1, 2025
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
danpawlik pushed a commit to danpawlik/openwrt that referenced this pull request Dec 1, 2025
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Dec 1, 2025
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt/openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Dec 1, 2025
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt/openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
danpawlik pushed a commit to danpawlik/openwrt that referenced this pull request Dec 1, 2025
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
danpawlik pushed a commit to danpawlik/openwrt that referenced this pull request Dec 1, 2025
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
codetiger666 pushed a commit to codetiger666/openwrt that referenced this pull request Dec 14, 2025
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
codetiger666 pushed a commit to codetiger666/openwrt that referenced this pull request Dec 14, 2025
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Dec 16, 2025
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt/openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Dec 16, 2025
This commit adds support for Mercusys MR85X router.

Device specification:
 - SoC: Mediatek MT7981b, Cortex-A53, 64-bit
 - RAM: 512MB
 - Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB)
 - Ethernet: Realtek rtl8367s + 2.5Gbe Airoha en8811h
 - Ethernet: 1x2.5Gbe (WAN 2.5Gbps), 3xGbe (LAN 1Gbps, port0, port1, port2)
 - Wireless: 2.4GHz (802.11 b/g/n/ax)
 - Wireless: 5GHz (802.11 a/n/ac/ax)
 - LEDs: 1 amber and 1 green status LEDs, 4 green gpio-controlled LEDs
   on ethernet ports
 - Buttons: 2 (reset,wps)
 - Bootloader: Main U-Boot - U-Boot 2022.07-rc3. Additionally, both UBI
   slots contain "seconduboot" (also U-Boot 2022.07-rc3)

Installation (UART):
 - Place OpenWrt initramfs-kernel 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'.
 - Set the uboot environment for startup.
   setenv tp_boot_idx 0; saveenv
   If the bootarg is set to boot from ubi1, also change it to ubi0.
 - Load and run OpenWrt initramfs image.
   setenv serverip 192.168.1.2; setenv ipaddr 192.168.1.1; tftpboot initramfs-kernel.bin; bootm
 - Browse IP 192.168.1.1, upload the 'sysupgrade' image and do upgrade.

Recovery:
 - Press Reset button and power on the router.
 - Navigate to U-Boot recovery web server (http://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"

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:
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| label   | 00:FF:xx:xx:xx:EE | label     |
| WAN     | 00:FF:xx:xx:xx:EF | label+1   |
| LAN     | 00:FF:xx:xx:xx:EE | label     |
| WLAN 2g | 00:FF:xx:xx:xx:ED | label-1   |
| WLAN 5g | 00:FF:xx:xx:xx:EC | label-2   |
+---------+-------------------+-----------+
label MAC address was found in UBI partition "tp_data", file "default-mac".
OEM wireless eeprom is also there, file "MT7981_EEPROM.bin".

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt/openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
HateTM pushed a commit to HateTM/tpl_ax80_ubi that referenced this pull request Jan 6, 2026
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: openwrt#19187
Signed-off-by: Hauke Mehrtens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes target/mediatek pull request/issue for mediatek target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants