Skip to content

Commit 04e9d15

Browse files
Michal Halvahauke
authored andcommitted
mediatek: filogic: add support for Cudy WR3000P v1
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 <[email protected]> Link: openwrt#19636 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent d16d276 commit 04e9d15

File tree

5 files changed

+175
-2
lines changed

5 files changed

+175
-2
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
/dts-v1/;
4+
5+
#include "mt7981b-cudy-wr3000-nand.dtsi"
6+
7+
/ {
8+
model = "Cudy WR3000P v1";
9+
compatible = "cudy,wr3000p-v1", "mediatek,mt7981";
10+
11+
aliases {
12+
label-mac-device = &gmac0;
13+
led-boot = &led_status;
14+
led-failsafe = &led_status;
15+
led-running = &led_status;
16+
led-upgrade = &led_status;
17+
serial0 = &uart0;
18+
};
19+
20+
leds {
21+
compatible = "gpio-leds";
22+
23+
led_status: led-status {
24+
function = LED_FUNCTION_STATUS;
25+
color = <LED_COLOR_ID_WHITE>;
26+
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
27+
};
28+
29+
led-internet {
30+
function = LED_FUNCTION_WAN_ONLINE;
31+
color = <LED_COLOR_ID_WHITE>;
32+
gpios = <&pio 6 GPIO_ACTIVE_LOW>;
33+
};
34+
35+
led-wlan2g {
36+
function = LED_FUNCTION_WLAN_2GHZ;
37+
color = <LED_COLOR_ID_WHITE>;
38+
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
39+
linux,default-trigger = "phy0tpt";
40+
};
41+
42+
led-wlan5g {
43+
function = LED_FUNCTION_WLAN_5GHZ;
44+
color = <LED_COLOR_ID_WHITE>;
45+
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
46+
linux,default-trigger = "phy1tpt";
47+
};
48+
49+
led-wan {
50+
function = LED_FUNCTION_WAN;
51+
color = <LED_COLOR_ID_WHITE>;
52+
gpios = <&pio 5 GPIO_ACTIVE_LOW>;
53+
};
54+
55+
led-usb {
56+
function = LED_FUNCTION_USB;
57+
color = <LED_COLOR_ID_WHITE>;
58+
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
59+
};
60+
};
61+
62+
reg_3p3v: regulator-3p3v {
63+
compatible = "regulator-fixed";
64+
regulator-name = "fixed-3.3V";
65+
regulator-min-microvolt = <3300000>;
66+
regulator-max-microvolt = <3300000>;
67+
regulator-boot-on;
68+
regulator-always-on;
69+
};
70+
71+
usb_vbus: regulator-5v {
72+
compatible = "regulator-fixed";
73+
regulator-name = "usb_vbus";
74+
regulator-min-microvolt = <5000000>;
75+
regulator-max-microvolt = <5000000>;
76+
gpios = <&pio 10 GPIO_ACTIVE_LOW>;
77+
regulator-boot-on;
78+
};
79+
};
80+
81+
&eth {
82+
gmac1: mac@1 {
83+
compatible = "mediatek,eth-mac";
84+
reg = <1>;
85+
phy-handle = <&phy6>;
86+
phy-mode = "2500base-x";
87+
nvmem-cell-names = "mac-address";
88+
nvmem-cells = <&macaddr_bdinfo_de00 1>;
89+
label = "wan";
90+
};
91+
};
92+
93+
&mdio_bus {
94+
phy6: ethernet-phy@6 {
95+
compatible = "ethernet-phy-ieee802.3-c45";
96+
reg = <6>;
97+
reset-assert-us = <100000>;
98+
reset-deassert-us = <100000>;
99+
reset-gpios = <&pio 3 GPIO_ACTIVE_LOW>;
100+
};
101+
};
102+
103+
&switch {
104+
ports {
105+
#address-cells = <1>;
106+
#size-cells = <0>;
107+
108+
port@0 {
109+
reg = <0>;
110+
label = "lan4";
111+
};
112+
113+
port@1 {
114+
reg = <1>;
115+
label = "lan3";
116+
};
117+
118+
port@2 {
119+
reg = <2>;
120+
label = "lan2";
121+
};
122+
123+
port@3 {
124+
reg = <3>;
125+
label = "lan1";
126+
};
127+
128+
port@6 {
129+
reg = <6>;
130+
label = "cpu";
131+
ethernet = <&gmac0>;
132+
phy-mode = "2500base-x";
133+
134+
fixed-link {
135+
speed = <2500>;
136+
full-duplex;
137+
pause;
138+
};
139+
};
140+
};
141+
};
142+
143+
&xhci {
144+
vusb33-supply = <&reg_3p3v>;
145+
vbus-supply = <&usb_vbus>;
146+
mediatek,u3p-dis-msk = <0x01>;
147+
phys = <&u2port0 PHY_TYPE_USB2>;
148+
status = "okay";
149+
};
150+
151+
&usb_phy {
152+
status = "okay";
153+
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ wavlink,wl-wn573hx3)
5959
cudy,wr3000-v1)
6060
ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan"
6161
;;
62-
cudy,wr3000h-v1)
62+
cudy,wr3000h-v1|\
63+
cudy,wr3000p-v1)
6364
ucidef_set_led_netdev "lan1" "lan1" "white:lan-1" "lan1" "link tx rx"
6465
ucidef_set_led_netdev "lan2" "lan2" "white:lan-2" "lan2" "link tx rx"
6566
ucidef_set_led_netdev "lan3" "lan3" "white:lan-3" "lan3" "link tx rx"

target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ case "$board" in
9090
cudy,wr3000e-v1|\
9191
cudy,wr3000s-v1|\
9292
cudy,wr3000h-v1|\
93+
cudy,wr3000p-v1|\
9394
cudy,wr3000-v1)
9495
addr=$(mtd_get_mac_binary bdinfo 0xde00)
9596
# Originally, phy0 is phy1 mac with LA bit set. However, this would conflict

target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ platform_do_upgrade() {
131131
CI_KERNPART="linux"
132132
nand_do_upgrade "$1"
133133
;;
134-
cudy,wr3000h-v1)
134+
cudy,wr3000h-v1|\
135+
cudy,wr3000p-v1)
135136
CI_UBIPART="ubi"
136137
nand_do_upgrade "$1"
137138
;;

target/linux/mediatek/image/filogic.mk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,23 @@ define Device/cudy_wr3000h-v1
969969
endef
970970
TARGET_DEVICES += cudy_wr3000h-v1
971971

972+
define Device/cudy_wr3000p-v1
973+
DEVICE_VENDOR := Cudy
974+
DEVICE_MODEL := WR3000P
975+
DEVICE_VARIANT := v1
976+
DEVICE_DTS := mt7981b-cudy-wr3000p-v1
977+
DEVICE_DTS_DIR := ../dts
978+
SUPPORTED_DEVICES += R57
979+
UBINIZE_OPTS := -E 5
980+
BLOCKSIZE := 128k
981+
PAGESIZE := 2048
982+
IMAGE_SIZE := 65536k
983+
KERNEL_IN_UBI := 1
984+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
985+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
986+
endef
987+
TARGET_DEVICES += cudy_wr3000p-v1
988+
972989
define Device/dlink_aquila-pro-ai-m30-a1
973990
DEVICE_VENDOR := D-Link
974991
DEVICE_MODEL := AQUILA PRO AI M30

0 commit comments

Comments
 (0)