]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: add support for Cudy WR3000P v1 20830/head
authorMichal Halva <hedik01@gmail.com>
Sat, 2 Aug 2025 18:46:14 +0000 (20:46 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 29 Nov 2025 00:10:10 +0000 (01:10 +0100)
Hardware
--------
MediaTek MT7981 WiSoC
512MB DDR4 RAM
128MB SPI-NAND
MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5)
4 LAN MediaTek MT7531 PHY
1 WAN RTL8221B-VB-CG 2.5Gbps PHY
UART: 115200 8N1 3.3V
USB2 Port
PoE on WAN Port

MAC:
LAN MAC: label mac
WAN MAC: label mac + 1
2.4G MAC: label mac
5G MAC: label mac + 1 with LA bit set

Gotchas:
WAN LED does not light up (might require further DTS tweaks)
PoE on WAN port was not tested

This commit is heavily based on WR3000H one, I've just ported DTS differences
from the official image to get USB support and proper LED mapping.

Installation
------------
[Untested as I've received and used a transitional image from Cudy]

1. Connect to the serial port as described in the "Hardware" section.

2. Power on the device + press reset pin. Keep pressing reset pin to enter the U-Boot  shell.

3. Download the OpenWrt initramfs image. Place it on an TFTP server
   connected to the Cudy LAN ports. Make sure the server is reachable at
   192.168.1.88. Rename the image to "cudy3000p.bin"

4. Download and boot the OpenWrt initramfs image.

   $ tftpboot 0x46000000 cudy3000s.bin; bootm 0x46000000

5. Transfer the OpenWrt sysupgrade image to the device using scp.
   Install with sysupgrade.

Signed-off-by: Michal Halva <hedik01@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19636
(cherry picked from commit 04e9d154f209c0390d962c10e75ed3c49bd5a9e9)
Signed-off-by: Thibaut VARĂˆNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/20830
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dts
new file mode 100644 (file)
index 0000000..0bee64d
--- /dev/null
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include "mt7981b-cudy-wr3000-nand.dtsi"
+
+/ {
+       model = "Cudy WR3000P v1";
+       compatible = "cudy,wr3000p-v1", "mediatek,mt7981";
+
+       aliases {
+               label-mac-device = &gmac0;
+               led-boot = &led_status;
+               led-failsafe = &led_status;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+               serial0 = &uart0;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_status: led-status {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 11 GPIO_ACTIVE_LOW>;
+               };
+
+               led-internet {
+                       function = LED_FUNCTION_WAN_ONLINE;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+               };
+
+               led-wlan2g {
+                       function = LED_FUNCTION_WLAN_2GHZ;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy0tpt";
+               };
+
+               led-wlan5g {
+                       function = LED_FUNCTION_WLAN_5GHZ;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy1tpt";
+               };
+
+               led-wan {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+               };
+
+               led-usb {
+                       function = LED_FUNCTION_USB;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       usb_vbus: regulator-5v {
+               compatible = "regulator-fixed";
+               regulator-name = "usb_vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+               regulator-boot-on;
+       };
+};
+
+&eth {
+       gmac1: mac@1 {
+               compatible = "mediatek,eth-mac";
+               reg = <1>;
+               phy-handle = <&phy6>;
+               phy-mode = "2500base-x";
+               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&macaddr_bdinfo_de00 1>;
+               label = "wan";
+       };
+};
+
+&mdio_bus {
+       phy6: ethernet-phy@6 {
+               compatible = "ethernet-phy-ieee802.3-c45";
+               reg = <6>;
+               reset-assert-us = <100000>;
+               reset-deassert-us = <100000>;
+               reset-gpios = <&pio 3 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&switch {
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+                       label = "lan4";
+               };
+
+               port@1 {
+                       reg = <1>;
+                       label = "lan3";
+               };
+
+               port@2 {
+                       reg = <2>;
+                       label = "lan2";
+               };
+
+               port@3 {
+                       reg = <3>;
+                       label = "lan1";
+               };
+
+               port@6 {
+                       reg = <6>;
+                       label = "cpu";
+                       ethernet = <&gmac0>;
+                       phy-mode = "2500base-x";
+
+                       fixed-link {
+                               speed = <2500>;
+                               full-duplex;
+                               pause;
+                       };
+               };
+       };
+};
+
+&xhci {
+       vusb33-supply = <&reg_3p3v>;
+       vbus-supply = <&usb_vbus>;
+       mediatek,u3p-dis-msk = <0x01>;
+       phys = <&u2port0 PHY_TYPE_USB2>;
+       status = "okay";
+};
+
+&usb_phy {
+       status = "okay";
+};
index 217f495f95f5d60a2655a3e646ab22daacc7a233..950dcf71437539e7b7a0fc63b940904c63606e74 100644 (file)
@@ -42,7 +42,8 @@ wavlink,wl-wn573hx3)
 cudy,wr3000-v1)
        ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan"
        ;;
-cudy,wr3000h-v1)
+cudy,wr3000h-v1|\
+cudy,wr3000p-v1)
        ucidef_set_led_netdev "lan1" "lan1" "white:lan-1" "lan1" "link tx rx"
        ucidef_set_led_netdev "lan2" "lan2" "white:lan-2" "lan2" "link tx rx"
        ucidef_set_led_netdev "lan3" "lan3" "white:lan-3" "lan3" "link tx rx"
index 58672d9d72f5acd56eb47018886bc745a6bad8f5..fe98657a1aa138abcab4589719730c0683f2e194 100644 (file)
@@ -84,6 +84,7 @@ case "$board" in
        cudy,wr3000e-v1|\
        cudy,wr3000s-v1|\
        cudy,wr3000h-v1|\
+       cudy,wr3000p-v1|\
        cudy,wr3000-v1)
                addr=$(mtd_get_mac_binary bdinfo 0xde00)
                # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
index bd6655119822f80c2095caff8d17e52fa93ea86d..3cc8b91b7437873b871f751fe3dc09ee642d4f0d 100755 (executable)
@@ -127,7 +127,8 @@ platform_do_upgrade() {
                CI_KERNPART="linux"
                nand_do_upgrade "$1"
                ;;
-       cudy,wr3000h-v1)
+       cudy,wr3000h-v1|\
+       cudy,wr3000p-v1)
                CI_UBIPART="ubi"
                nand_do_upgrade "$1"
                ;;
index 2cf44bee143e5f019769e1ad1ced80c9734484bb..17289675a6997afdb6a0cefc4b4a08db41df2784 100644 (file)
@@ -856,6 +856,23 @@ define Device/cudy_wr3000h-v1
 endef
 TARGET_DEVICES += cudy_wr3000h-v1
 
+define Device/cudy_wr3000p-v1
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := WR3000P
+  DEVICE_VARIANT := v1
+  DEVICE_DTS := mt7981b-cudy-wr3000p-v1
+  DEVICE_DTS_DIR := ../dts
+  SUPPORTED_DEVICES += R57
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 65536k
+  KERNEL_IN_UBI := 1
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+endef
+TARGET_DEVICES += cudy_wr3000p-v1
+
 define Device/dlink_aquila-pro-ai-m30-a1
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := AQUILA PRO AI M30