Skip to content

[23.05] ramips: add support for TP-Link Archer C5 v4#14314

Closed
namiltd wants to merge 5 commits intoopenwrt:openwrt-23.05from
namiltd:openwrt-23.05-archer-c5-v4
Closed

[23.05] ramips: add support for TP-Link Archer C5 v4#14314
namiltd wants to merge 5 commits intoopenwrt:openwrt-23.05from
namiltd:openwrt-23.05-archer-c5-v4

Conversation

@namiltd
Copy link
Copy Markdown
Contributor

@namiltd namiltd commented Jan 1, 2024

Patch #14599 successor. PR #14418 compatible with release 23.05.

TP-Link Archer C5 v4 is a dual band router with 5 GbE ports
Advertised as AC1200 for its 867Mbps (2x2) 5GHz band
and 300 Mbps (2x2) 2.4GHz band.

Specs:

  • SoC: MediaTek MT7620A
  • Ethernet: 5x GbE ports (Realtek RTL8367S)
  • Wireless 2.4GHz: MediaTek MT7620A
  • Wireless 5GHz: MediaTek MT7612E
  • RAM: 64MiB
  • ROM: 8MiB (GD25Q64CSIG)
  • 1 USB 2.0 port
  • 2 Buttons (WPS and reset)
  • 8 LEDs

Currently, you can install OpenWrt via serial console or TFTP.

Flash instructions via serial console:

  1. Rename the factory.bin to to test.bin
  2. start a TFTP server from IP address 192.168.0.225 and serve the image named test.bin
  3. connect your device to the LAN port
  4. power up the router and press 4 on the console to stop the boot process.
  5. enter the following commands on the router console
    tftp 0x80060000 test.bin
    erase tplink 0x20000 0x7a0000
    cp.b 0x80060000 0x20000 0x7a0000
    reset

Flash instructions via TFTP:

  1. Update orginal firmware of the router to the latest one.
  2. Rename openwrt-ramips-mt7620-tplink_archer-c5-v4-squashfs-tftp-recovery.bin to tp_recovery.bin
  3. Change computer IP to 192.168.0.66
  4. Run TFTP serwer
  5. Start the router with the reset button pressed, the file will be automatically downloaded and after a while the router will restart.
  6. After updating, set your computer's IP to DHCP

A little note: Since there are problems with the performance of 2.4GHz WiFi for Mediatek MT7620, disable 802.11w Management Frame Protection in Wireless Security.

Serge Vasilugin and others added 3 commits November 23, 2023 22:52
From driver point of view no differance between rtl8367b and rtl8367s
if it connected through EXT2 (rgmii only).
So this trivial patch add some identification and initialization only.
SGMII/HSGMII mode for EXT1 is not implemented for the sake of patch
clairity.

Signed-off-by: Serge Vasilugin <[email protected]>
[Fix code format]
Signed-off-by: DENG Qingfang <[email protected]>
[add flags to separate chip_num/chip_id detection; drop error print in
rtl8367b_init_regs, drop unnecessary info prints, code style fixes]
Signed-off-by: Chuanhong Guo <[email protected]>
[rebase; use MII macros]
Signed-off-by: Gaspare Bruno <[email protected]>
TP-Link Archer C5 v4 is a dual band router with 5 GbE ports
Advertised as AC1200 for its 867Mbps (2x2) 5GHz band
and 300 Mbps (2x2) 2.4GHz band.

Specs:
- SoC: MediaTek MT7620A
- Ethernet: 5x GbE ports (Realtek RTL8367S)
- Wireless 2.4GHz: MediaTek MT7620A
- Wireless 5GHz: MediaTek MT7612E
- RAM: 64MiB
- ROM: 8MiB (GD25Q64CSIG)
- 1 USB 2.0 port
- 2 Buttons (WPS and reset)
- 8 LEDs

Flash instructions:
Currently one has to install OpenWrt only via the serial console

1. Rename the factory.bin to to test.bin
2. start a TFTP server from IP address 192.168.0.225 and serve the image named test.bin
3. connect your device to the LAN port
4. power up the router and press 4 on the console to stop the boot process.
5. enter the following commands on the router console
	tftp 0x80060000 test.bin
	erase tplink 0x20000 0x7a0000
	cp.b 0x80060000 0x20000 0x7a0000
	reset

Signed-off-by: DENG Qingfang <[email protected]>
[Update leds, add fast-read]
Signed-off-by: Gaspare Bruno <[email protected]>
By default rtl8366_smi use phy addr 0 at mii-bus to access switch registers.
This patch allow to set it explicitly in dts-file:

	rtl8367 {
		compatible = "realtek,rtl8367b";
		phy-id = <29>; /* switch address at mii-bus */
		realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
		mii-bus = <&mdio>;
		cpu-port = <7>;
	}

Use default 0 address if not set.
Backward compatibility tested on tplink archer c2 v1 (rtl8367rb switch)

Signed-off-by: Serge Vasilugin <[email protected]>
[code style fixes, add explicit phy_id assignment in probe_plat, use
phy-id instead of phy_id for of property name]
Signed-off-by: Chuanhong Guo <[email protected]>
[rebase]
Signed-off-by: Gaspare Bruno <[email protected]>
@github-actions github-actions bot added kernel pull request/issue with Linux kernel related changes target/ramips pull request/issue for ramips target release/23.05 pull request/issue targeted (also) for OpenWrt 23.05 release labels Jan 1, 2024
@namiltd namiltd changed the title ramips: add support for TP-Link Archer C5 v4 [23.05] ramips: add support for TP-Link Archer C5 v4 Jan 1, 2024
…r.dtsi

New version based on mt7620 tplink_archer.dtsi and added support for external LNA

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
@namiltd namiltd force-pushed the openwrt-23.05-archer-c5-v4 branch 4 times, most recently from ab8679a to be776db Compare January 3, 2024 00:07
Improved detection of rtl8137c on 64-bit systems.
Uses flags assigned to chip definitions.

Signed-off-by: Mieczyslaw Nalewaj <[email protected]>
@luizluca
Copy link
Copy Markdown
Contributor

@namiltd, you should target main branch for new devices. I don't think a PR for a released version will ever be merged without the corresponding support for the next version.

@namiltd
Copy link
Copy Markdown
Contributor Author

namiltd commented Jan 17, 2024

This PR without any changes will also work for "main". For compatibility with the remaining dts files in the tree, you only need to move mac-address-increment to nvmem-cells.

@hauke
Copy link
Copy Markdown
Member

hauke commented Feb 11, 2024

Please target the main branch first. When it was merged into main you can create a new pull request with a backport to 23.05.

@namiltd namiltd closed this Feb 13, 2024
@namiltd
Copy link
Copy Markdown
Contributor Author

namiltd commented Feb 13, 2024

Closed due to PR #14599 closing.

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

Labels

kernel pull request/issue with Linux kernel related changes release/23.05 pull request/issue targeted (also) for OpenWrt 23.05 release target/ramips pull request/issue for ramips target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants