]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: add Motorcomm PHY support to Cudy AP3000 v1 21776/head
authorAnton Danilov <frimen.c@gmail.com>
Thu, 29 Jan 2026 11:43:17 +0000 (14:43 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 3 Feb 2026 23:58:22 +0000 (00:58 +0100)
Newer Cudy AP3000 v1 routers feature a Motorcomm YT8821 PHY
instead of the Realtek PHY [1]. Support for the YT8821
was recently introduced for the Cudy WR3000H router [2].
On the AP3000, the changes allow the PHY to be autodetected.

[1]: https://forum.openwrt.org/t/cudy-ap3000-v1-indoor-wan-motorcomm-yt8821-support/245491
[2]: https://github.com/openwrt/openwrt/pull/21399

Signed-off-by: Anton Danilov <frimen.c@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21776
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-cudy-ap3000-v1.dts
target/linux/mediatek/image/filogic.mk

index b4c4e9a5c0f34e6e61f86497c80ecc8e8aaa7448..7ebb90df9e8ee732c3657f37acfc64114d3a3762 100644 (file)
 };
 
 &mdio_bus {
+       /* We need to have the reset GPIO on the MDIO bus node,
+        * otherwise the PHY would be held in reset during PHY detection */
+       reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
+       reset-delay-us = <100000>;
+       reset-post-delay-us = <100000>;
+
        phy1: phy@1 {
+               /* Either Realtek RTL8221B-VB-CG or Motorcomm YT8821,
+                * depending on HW revision */
+               compatible = "ethernet-phy-ieee802.3-c45";
                reg = <1>;
                interrupt-parent = <&pio>;
                interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
-               reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
-               reset-assert-us = <100000>;
-               reset-deassert-us = <100000>;
        };
 };
 
index 7fefca3a1178b04bb0ae5c21e4f3ba533c29e9ad..5f15c7f9a9c36df59d2cffab80290a1eaf3dabf6 100644 (file)
@@ -1096,7 +1096,7 @@ define Device/cudy_ap3000-v1
   IMAGE_SIZE := 65536k
   KERNEL_IN_UBI := 1
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-phy-motorcomm
 endef
 TARGET_DEVICES += cudy_ap3000-v1