Skip to content

mediatek: add support for Mercusys MR85X with DSA switch driver - #19445

Open
Schneider-Azima wants to merge 4 commits into
openwrt:mainfrom
Schneider-Azima:mercusys_mr80x_with_DSA_switch_driver
Open

Schneider-Azima wants to merge 4 commits into
openwrt:mainfrom
Schneider-Azima:mercusys_mr80x_with_DSA_switch_driver

Conversation

@Schneider-Azima

Copy link
Copy Markdown
Contributor

This commit adds support for Mercusys MR85X router with DSA switch driver.

The driver part is almost all based on @hauke 's and @luizluca ''s work.
https://patchwork.kernel.org/project/netdevbpf/list/?series=639580
#19397
The device support part is almost the same as #19187. Differ in dts switch node, network script, and led script.

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".

@github-actions github-actions Bot added core packages pull request/issue for core (in-tree) packages target/mediatek pull request/issue for mediatek target labels Jul 17, 2025
Comment on lines +1 to +4
diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
index 639f741..55d9a11 100644
--- a/drivers/net/dsa/realtek/rtl8365mb.c
+++ b/drivers/net/dsa/realtek/rtl8365mb.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the original patch header or just import the original patches.

@hauke hauke Jul 18, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support for kernel 6.6 was recently removed (7fe6921) please rebase and port to kernel 6.12.

@namiltd

namiltd commented Jul 19, 2025 •

Copy link
Copy Markdown
Contributor

Could you use 72eddc0 and then create an additional patch for hsgmii support?

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Could you use 72eddc0 and then create an additional patch for hsgmii support?

Shall I also move hsgmiii support patch to generic/pending-6.12? I have only mtk devices for test though.

@Schneider-Azima
Schneider-Azima force-pushed the mercusys_mr80x_with_DSA_switch_driver branch from 825feb1 to a5feec8 Compare July 20, 2025 13:00
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Fixed wrong file mode 100644->100755 of platform.sh
Added original patch header to patch files.
HSGMII support patch a14130f now depends on 72eddc0 of #19397. And moved this patch to generic/pending-6.12

@github-actions github-actions Bot added the kernel pull request/issue with Linux kernel related changes label Jul 20, 2025
@namiltd

namiltd commented Jul 21, 2025 •

Copy link
Copy Markdown
Contributor

PR #19397 has been rebuilt, please rebuild your patch or revert to the previous version.

@namiltd

namiltd commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

@Schneider-Azima I updated your patch to the current version of my PR for kernel 6.6 and 6.12: 862-patch.zip

@Schneider-Azima
Schneider-Azima force-pushed the mercusys_mr80x_with_DSA_switch_driver branch from a5feec8 to cba5d12 Compare July 23, 2025 01:14
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

19145bf now depends on d8490e1 of #19397.
Thanks for @namiltd 's work.

@namiltd

namiltd commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

Import the patch d8490e1 to your repository to avoid CI test errors

@Schneider-Azima
Schneider-Azima force-pushed the mercusys_mr80x_with_DSA_switch_driver branch 2 times, most recently from 7ecc144 to a612ce1 Compare July 23, 2025 06:29
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

8bf8972: imported from d8490e1 of #19397 , to avoid CI test errors

@namiltd

namiltd commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

If you have run this PR on real hardware, please attach the syslog (as an attachment, not by pasting) (anonymize MAC addresses, passwords, etc.) so that we can assess the effectiveness of the fixes.

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

I'm afraid this is not very helpful in proving the network works fine. I can also get these print before fixing incompatible mtk cpu tag issue.
mr85x boot log.txt

@Schneider-Azima
Schneider-Azima force-pushed the mercusys_mr80x_with_DSA_switch_driver branch from a612ce1 to 1d0266c Compare July 23, 2025 09:51
@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Refresh patch file to fit in CI requirement.

@namiltd

namiltd commented Jul 30, 2025 •

Copy link
Copy Markdown
Contributor

Question: Where did you read or how did you test the interrupt for rtl8367mb (IRQ/IRQ_TYPE)?

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

@Schneider-Azima

Copy link
Copy Markdown
Contributor Author

Question: Where did you read or how did you test the interrupt for rtl8367mb (IRQ/IRQ_TYPE)?

Official GPL code has a dts.

@luizluca

luizluca commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

Question: Where did you read or how did you test the interrupt for rtl8367mb (IRQ/IRQ_TYPE)?

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

You can test checking that the switch is using interruption and not polling (dmesg will show you this during module loading). If you still have link down/up events, everything is fine.

In a new device, you can detect the GPIO by commenting this code and adding a debugfs regmap rw patch (it changes an unconfigurable macro). This way you can export all unused ports via sysfs and monitor them. Once something happens that generates an interruption, like link down/up, the signal will change, as well as the RTL8365MB_INTR_STATUS_REG. With the debugfs regmap rw patch, you can write to RTL8365MB_INTR_STATUS_REG to bring it back to rest state.

@namiltd

namiltd commented Aug 16, 2025

Copy link
Copy Markdown
Contributor

Please update patch "kernel: modules: netdevices: improve Realtek DSA driver" from #19397 and refresh your patches.

@namiltd

namiltd commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Next code to test: namiltd#131

@Shine-

Shine- commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Oh, I had already built your latest namiltd#94 and was going to run speed tests against it probably tonight...

Built namiltd#131 now against current Main. Builds/boots fine, but from a brief test, no speed/load difference compared to namiltd#94.

FYI, I noticed that the port numbering on the device is different (didn't care before, but the closer a merge comes...):

  • lan0/lan1/lan2 should be LAN1/LAN2/LAN3.
  • eth1 is labelled WAN on the device.

@namiltd

namiltd commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

In namiltd#131 there is no longer any 8051 firmware loading, so it was important to check if it would work.

@Shine-

Shine- commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Ah nice, yes, I can confirm that combined routing performance is definitely identical (close to 2G) with namiltd#131. So it looks like the 8051 code isn't needed for >1G.

@namiltd

namiltd commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

@Shine- PR namiltd#131 updated, try LED labels (lan1-lan3)

@Shine-

Shine- commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Thanks, ports are named identically as labelled on the device now, in correct order.

@luizluca

Copy link
Copy Markdown
Contributor

Ah nice, yes, I can confirm that combined routing performance is definitely identical (close to 2G) with namiltd#131. So it looks like the 8051 code isn't needed for >1G.

The good old reverse engineering was worth it. That firmware blob will not be missed.

kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Jul 20, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by:  Luiz Angelo Daros de Luca <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Jul 21, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by:  Luiz Angelo Daros de Luca <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
kuba-moo pushed a commit to linux-netdev/testing-bpf-ci that referenced this pull request Jul 22, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by:  Luiz Angelo Daros de Luca <[email protected]>
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: NipaLocal <nipa@local>
namiltd pushed a commit to namiltd/rtl8367d that referenced this pull request Jul 22, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by: Luiz Angelo Daros de Luca <[email protected]>
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>
Tested-by: Stanislaw Pal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
LorenzoBianconi pushed a commit to LorenzoBianconi/net-next that referenced this pull request Jul 22, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by: Luiz Angelo Daros de Luca <[email protected]>
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>
Tested-by: Stanislaw Pal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 4, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 4, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 5, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 6, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 7, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 7, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 7, 2026
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]>
Link: namiltd#131
Co-authored-by: Mikhail Zhilkin <[email protected]>
Signed-off-by: Mikhail Zhilkin <[email protected]>
csharper2005 added a commit to csharper2005/openwrt that referenced this pull request Aug 8, 2026
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]>
jonasjelonek pushed a commit to csharper2005/openwrt that referenced this pull request Aug 20, 2026
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]>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Aug 22, 2026
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]>
Sirherobrine23 pushed a commit to Sirherobrine23/airoha_kernel that referenced this pull request Aug 30, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by: Luiz Angelo Daros de Luca <[email protected]>
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>
Tested-by: Stanislaw Pal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
unifreq pushed a commit to unifreq/linux-6.18.y that referenced this pull request Sep 2, 2026
In addition to SGMII, the RTL8367S SerDes also supports HSGMII, which
carries 2.5 Gbps with the same signaling as SGMII at 2.5x clock rate.
The chip info table already declares HSGMII as a supported interface
mode for external interface 1.

Extend the SerDes PCS to handle HSGMII, which phylink represents as
2500base-x:

 - Select the HSGMII SerDes tuning parameters and external interface
   mode, and mux the SerDes to MAC8 in HSGMII mode, from pcs_config()
   according to the interface. The parameters are again lifted from the
   GPL-licensed Realtek rtl8367c vendor driver, and again only cover
   the tuning variant for a non-zero chip option, so the mode is gated
   on the option probed at setup.

 - Advertise 2500base-x and MAC_2500FD on ports whose external
   interface supports HSGMII.

 - Accept SPEED_2500 in the forced link configuration. The MAC speed
   field has no 2.5 Gbps value: the rate is determined by the HSGMII
   SerDes configuration, and the vendor driver programs the 1 Gbps
   value here, so do the same.

 - Raise the port 6 ingress and egress rate limiters to their maximum
   at setup time, as the vendor switch init does unconditionally for
   the whole chip family. The chip resets them to 0x1FFFF (~1.048 Gbps
   in units of 8 Kbps), which caps the aggregate HSGMII throughput at
   roughly 1 Gbps. The vendor documentation describes the reset
   default as disabling the limiter, but the cap is real: on an
   RTL8367S-based Mercusys MR85X running an OpenWrt backport of this
   series, several clients on 1 Gbps user ports were limited to about
   1.02 Gbps combined across the HSGMII CPU port until these limiters
   were raised, after which throughput reached about 2 Gbps [1]. The
   related HSGMII scheduler line rate (LINE_RATE_HSG_H) is already set
   to its maximum by the common init jam table.

Tested on a Mercusys MR80X v2.20, where the RTL8367S is connected to
the SoC over HSGMII.

Link: openwrt/openwrt#19445 (comment) [1]
Suggested-by: Luiz Angelo Daros de Luca <[email protected]>
Suggested-by: Mieczyslaw Nalewaj <[email protected]>
Signed-off-by: Johan Alvarado <[email protected]>
Tested-by: Stanisław Pal <[email protected]>
Reviewed-by: Luiz Angelo Daros de Luca <[email protected]>
Reviewed-by: Mieczyslaw Nalewaj <[email protected]>
Tested-by: Stanislaw Pal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Sep 4, 2026
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/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/openwrt#24435
Signed-off-by: Jonas Jelonek <[email protected]>
xize pushed a commit to xize/openwrt-xsdk that referenced this pull request Sep 20, 2026
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]>
Quarx2k pushed a commit to Quarx2k/OpenWRT-BE7000 that referenced this pull request Sep 22, 2026
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/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/openwrt#24435
Signed-off-by: Jonas Jelonek <[email protected]>
xize pushed a commit to xize/openwrt-xsdk that referenced this pull request Oct 17, 2026
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]>
@namiltd

namiltd commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Mr85x is already in the DSA version; this PR can be closed.

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.

6 participants