Skip to content

[pre] mediatek: mt7622: convert devices with RTL8367S switch to DSA - #94

Closed
namiltd wants to merge 2 commits into
mainfrom
dsa-mediatek1
Closed

namiltd wants to merge 2 commits into
mainfrom
dsa-mediatek1

Conversation

@namiltd

@namiltd namiltd commented Jul 27, 2025 •

Copy link
Copy Markdown
Owner

Migrates selected MT7622 boards from the legacy RTL8367S/swconfig driver to the RTL8365MB DSA driver.

Changes:

  • Adds DSA switch topologies, packages, and network configuration.
  • Updates compatibility-version migration handling.
  • Removes legacy RTL8367S/RTL8367C driver integration and sources.
  • Disable swconfig in the kernel config

@namiltd
namiltd force-pushed the dsa-mediatek1 branch 5 times, most recently from a51d7eb to d68dc91 Compare August 3, 2025 10:15
@namiltd namiltd changed the title Dsa mediatek1 mediatek: move to DSA Aug 3, 2025
@namiltd
namiltd marked this pull request as ready for review August 3, 2025 14:56
@namiltd
namiltd changed the base branch from dsa to Realtek_DSA August 3, 2025 15:00
@namiltd
namiltd changed the base branch from Realtek_DSA to main August 3, 2025 15:01
@namiltd
namiltd force-pushed the dsa-mediatek1 branch 2 times, most recently from bccc79c to d79ab11 Compare August 8, 2025 23:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two moderate compatibility-metadata issues remain unresolved.

Pull request overview

Migrates selected MT7622 boards from the legacy RTL8367S/swconfig driver to the RTL8365MB DSA driver.

Changes:

  • Adds DSA switch topologies, packages, and network configuration.
  • Updates compatibility-version migration handling.
  • Removes legacy RTL8367S/RTL8367C driver integration and sources.
File summaries
File Summary
target/linux/mediatek/patches-6.18/500-gsw-rtl8367s-mt7622-support.patch Removes legacy driver integration.
target/linux/mediatek/mt7629/config-6.18 Removes obsolete configuration.
target/linux/mediatek/mt7623/config-6.18 Removes obsolete configuration.
target/linux/mediatek/mt7622/config-6.18 Removes legacy driver configuration.
target/linux/mediatek/mt7622/base-files/etc/uci-defaults/05_fix-compat-version Compatibility migration; Buffalo branch ordering requires changes.
target/linux/mediatek/mt7622/base-files/etc/board.d/05_compat-version Updates compatibility versions.
target/linux/mediatek/mt7622/base-files/etc/board.d/02_network Removes legacy swconfig setup.
target/linux/mediatek/image/mt7622.mk Adds DSA packages and migration metadata; Elecom metadata helper requires changes.
target/linux/mediatek/filogic/config-6.18 Removes obsolete configuration.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367s_mdio.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_unknownMulticast.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_portIsolation.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_oam.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_misc.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_interrupt.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_inbwctrl.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_hsb.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/rtl8367c_asicdrv_eee.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/oam.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/smi.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_vlan.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_unknownMulticast.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_trunking.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_svlan.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_storm.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_scheduling.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_rma.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_rldp.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_qos.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_portIsolation.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_port.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_phy.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_oam.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_misc.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_mirror.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_mii_mgr.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_mib.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_meter.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_lut.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_led.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_interrupt.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_inbwctrl.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_igmp.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_i2c.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_hsb.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_green.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_fc.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_eee.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_eav.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_dot1x.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_cputag.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtl8367c_asicdrv_acl.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtk_types.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rtk_hal.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/rldp.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/oam.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/mirror.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/interrupt.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/i2c.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/include/eee.h Removes legacy driver header.
target/linux/mediatek/files/drivers/net/phy/rtk/rtl8367c/eee.c Removes legacy driver source.
target/linux/mediatek/files/drivers/net/phy/rtk/Makefile Removes legacy driver build integration.
target/linux/mediatek/dts/mt7622-totolink-a8000ru.dts Adds the DSA switch topology.
target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts Adds the DSA switch topology.
target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts Adds the DSA switch topology.
Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Resolve the two moderate compatibility metadata migration issues before approval.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Elecom image’s DSA migration metadata is ineffective and must be corrected.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review comments were supplied.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The hardware-specific switch, SerDes, and upgrade-path changes require validation on all three physical boards.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Hardware-specific switch modes, port mappings, and upgrade behavior require validation on all three affected boards.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Elecom CPU port and its connected GMAC use incompatible link modes and speeds.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The hardware-facing DSA topology and upgrade behavior require validation on all three physical boards.

Review details
  • Files reviewed: 65/137 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Migrate Buffalo WSR-2533DHP2, ELECOM WRC-2533GENT and TOTOLINK A8000RU
from swconfig to DSA. These devices use an external Realtek RTL8367S
switch handled by the rtl8365mb DSA driver.

Per-device changes:
 - Drop the proprietary mediatek,rtk-gsw node
 - Add realtek,rtl8365mb DSA switch with ports lan1-lan4, wan and CPU
 - Move CPU port to gmac0 at 2500base-x (HSGMII)
 - Remove gmac1 (was 5u@eth1 in swconfig; DSA uses single CPU port)
 - Drop unused rgmii_via_gmac2 pin group
 - Replace swconfig with kmod-dsa-rtl8365mb
 - Bump DEVICE_COMPAT_VERSION (config migration not possible)
 - Remove swconfig board setup from 02_network
 - Disable CONFIG_RTL8367S_GSW in mt7622 kernel config

MAC address assignment notes:
 - Buffalo WSR-2533DHP2: WAN uses base MAC + 1, gmac0/LAN uses base MAC
   (previously the WAN MAC existed on the implicit eth1/gmac1 interface)
 - ELECOM WRC-2533GENT: WAN inherits CPU MAC via DSA conduit
   (original gmac1 had no nvmem-cells assignment)
 - TOTOLINK A8000RU: WAN reuses macaddr_factory_24 (previously gmac1)

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
All mt7622 devices using the RTL8367S switch have been migrated to
the generic rtl8365mb DSA driver. Remove the now-unused RTL8367S_GSW
driver and disable swconfig in the mt7622 kernel config, since no
device in this target needs it anymore.

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
@namiltd

namiltd commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

Moved to openwrt#24861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants