Skip to content

Convert TP-Link Archer C5 v4 and EC220-G5 v2 to DSA - #19397

Draft
namiltd wants to merge 6 commits into
openwrt:mainfrom
namiltd:dsa
Draft

namiltd wants to merge 6 commits into
openwrt:mainfrom
namiltd:dsa

Conversation

@namiltd

@namiltd namiltd commented Jul 13, 2025 •

Copy link
Copy Markdown
Contributor

Convert TP-Link Archer C5 v4 and EC220-G5 v2 to DSA.

Commits:

  • kernel: modules: netdevices: forward offload for rtl8365mb - already implemented
  • kernel: modules: netdevices: add (H)SGMII rtl8365mb support - unnecessary
  • ramips: ethernet: ralink: mt7620 enable jumbo frames - already implemented
  • ramips: ethernet: ralink: fix MT7620A_GDMA regs - already implemented
  • ramips: ethernet: ralink: mtu change while interface is down - already implemented
  • ramips: ethernet: ralink: fix offload with diff dsa tag - already implemented
  • ramips: ethernet: ralink: add mediatek,no-swconfig property - already implemented
  • kernel: modules: netdevices: fixes for DSA tag rtl8_4 - already implemented
  • generic: rtl8365mb: add support for RTL8367S-VB
  • ramips: convert TP-Link Archer C5 v4 to DSA
  • ramips: convert TP-Link EC220-G5 v2 to DSA

Depends on #25101

@namiltd namiltd changed the title [WIP] kernel: modules: netdevices: improve Realtek DSA driver [WIP] Convert TP-Link Archer C5 v4 (rtl8367s) to DSA Jul 13, 2025
@github-actions github-actions Bot added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target labels Jul 13, 2025
@namiltd
namiltd marked this pull request as ready for review July 18, 2025 05:26
@namiltd
namiltd marked this pull request as draft July 18, 2025 05:51
@namiltd
namiltd marked this pull request as ready for review July 18, 2025 21:15
@namiltd

namiltd commented Jul 19, 2025 •

Copy link
Copy Markdown
Contributor Author

Since the router comes with two switch versions, either RTL8367S or RTL8367S-VB, a new DTS was created. Next to tplink,archer-c5-v4 (RTL8367S or RTL8367S-VB) is tplink,archer-c5-v4-dsa with DSA support, but only for the RTL8367S.

@namiltd

namiltd commented Jul 21, 2025 •

Copy link
Copy Markdown
Contributor Author

Since 6986e5f is still not finished, I reverted to the older version developed by @luizluca

@namiltd namiltd changed the title [WIP] Convert TP-Link Archer C5 v4 (rtl8367s) to DSA Convert TP-Link Archer C5 v4 (rtl8367s) to DSA Jul 21, 2025
@namiltd
namiltd force-pushed the dsa branch 2 times, most recently from abfda1b to 47d5557 Compare July 21, 2025 20:17
@namiltd

namiltd commented Jul 21, 2025

Copy link
Copy Markdown
Contributor Author

All tests and comments are welcome.

@Schneider-Azima

Copy link
Copy Markdown
Contributor

Hi, do you have any plan of updating d8490e1 to "new version"?
If I do not base my HSGMII support patch on this patch, there will be code conflicts.

@namiltd

namiltd commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor Author

I don't have any plans yet, the "new version" is much more complicated so it requires longer testing.

@namiltd

namiltd commented Jul 22, 2025

Copy link
Copy Markdown
Contributor Author

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

@namiltd

namiltd commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor Author

Kernel log of the Archer C5 v4 router: log-dsa_old-6.12.39.log

@namiltd

namiltd commented Jul 26, 2025 •

Copy link
Copy Markdown
Contributor Author

Ultimately, I'd like all RTL8367S routers to switch to the realtek,rtl8365mb driver.
There are currently three drivers for the RTL8367S:

  • mediatek,rtk-gsw (target/linux/mediatek/files/drivers/net/phy/rtk)
  • realtek,rtl8367b (target/linux/generic/files/drivers/net/phy/rtl8367b.c)
  • realtek,rtl8365mb (DSA) (kernel: drivers/net/dsa/realtek/rtl8365mb.c)

More at #19473 (comment) and below.

@namiltd namiltd changed the title Convert TP-Link Archer C5 v4 (rtl8367s) to DSA Convert TP-Link Archer C5 v4 and EC220-G5 v2 (rtl8367s) to DSA Jul 27, 2025
@namiltd namiltd changed the title Convert TP-Link Archer C5 v4 and EC220-G5 v2 (rtl8367s) to DSA Convert TP-Link Archer C5 v4 and EC220-G5 v2 (routers with rtl8367s) to DSA Jul 27, 2025
@hauke

hauke commented Jul 28, 2025

Copy link
Copy Markdown
Member

Please rebase to fix the CI problem.

@namiltd
namiltd force-pushed the dsa branch 2 times, most recently from 5eaa764 to 4a57cff Compare July 29, 2025 19:36

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 1 new commit.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@namiltd

namiltd commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

The current CI test failures are not related to this PR.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@namiltd

namiltd commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Since I do not own a router equipped with this integrated circuit, I am unable to perform testing of the software submitted to the Linux kernel’s main code tree (the net-next branch - https://lore.kernel.org/netdev/[email protected]). Consequently, I have left the v6 patch set in an unfinished state; anyone with the appropriate hardware and a suitable test environment is welcome to take it over, refine the L2/FDB layer support and other shared code segments, and continue the work. I encourage others to use, modify, or resubmit any parts of this code.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 3 new commits; no new issues found.


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Commit checks

  • 8ee8717 "qualcommax: ipq50xx: program the UNIPHY at gmac probe" — authored by Johan Alvarado but committed and submitted by you, and only his Signed-off-by is present; append your own Signed-off-by: Mieczyslaw Nalewaj <[email protected]> as the submitter.

Generated by Claude Code

namiltd and others added 6 commits November 28, 2026 10:29
Add ingress QoS offload for the RTL8365MB switch through the dcbnl app
interface: a per-port default priority, PCP trust and DSCP trust. The
mapping helpers go to net/core/ieee8021q_helpers.c so other drivers
can share them.

Two changes are visible to users. The driver now rejects a devicetree
port that the chip does not have. With a default priority set, an
untagged frame that leaves a VLAN-tagged port carries that priority as
its PCP.

Tested on an RTL8365MB-VC with eight queues.

ETS scheduling and CPU-tag pre-classification will follow in separate
series.

Signed-off-by: Oleksij Rempel <[email protected]>
Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
This series (15 patches) extends the existing family C
(RTL8365MB/RTL8367S/RTL8367SB/RTL8367RB-VB) driver with a new
family D branch. Family C's functional behaviour is unchanged.

Patches:
 - dt-bindings: net: dsa: realtek: add RTL8367S-VB
 - net: dsa: realtek: rtl8365mb: add chip family infrastructure
 - net: dsa: realtek: rtl8365mb: refactor forcemode handling
 - net: dsa: realtek: rtl8365mb: set speed for family D
 - net: dsa: realtek: rtl8365mb: set RGMII mode for family D
 - net: dsa: realtek: rtl8365mb: refactor VLAN 4k handling
 - net: dsa: realtek: rtl8365mb: set and get VLAN 4k for family D
 - net: dsa: realtek: rtl8365mb: refactor PVID handling
 - net: dsa: realtek: rtl8365mb: use raw VID for PVID on family D
 - net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support
 - net: dsa: realtek: rtl8365mb: refactor L2 MAC handling
 - net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D
 - net: dsa: realtek: rtl8365mb: refactor QoS priority handling
 - net: dsa: realtek: rtl8365mb: use PCP numbering on family D
 - net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
Refresh the rtl8365mb hunk to match the current 6.18 tree.

No functional change.

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
- phylink configures the PCS only at ndo_open, until then the UNIPHY
  keeps the bootloader mode
- MR80X v2 u-boot hands over in SGMII (MODE_CTRL 0x421, MISC2 0x70)
  while the board runs the trunk at 2500base-x
- the RTL8367S CPU port brings its SerDes up at DSA setup, 2 s before
  the first open, and trains its receiver against the wrong line rate
- CPU port dead or FCS errors on 18 of 51 boots, 0 of 32 with the mode
  sequence run from pcs_init
- add qca_uniphy_pcs_preconfig() and call it from dwmac-ipq5018 with
  the DT phy-mode; pcs_config at open then hits the mode cache

Signed-off-by: Johan Alvarado <[email protected]>
Convert TP-Link Archer C5 v4 router switch drivers to DSA.

Co-authored-by: Luiz Angelo Daros de Luca <[email protected]>
Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
Convert TP-Link EC220-G5 v2 router switch drivers to DSA.

Signed-off-by: Mieczyslaw Nalewaj <[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/qualcommax pull request/issue for qualcommax target target/ramips pull request/issue for ramips target target/realtek pull request/issue for realtek target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants