Skip to content

Commit a9858a9

Browse files
lexmark3200hauke
authored andcommitted
ramips: add support for Cudy C200P
This patch adds support for Cudy C200P. Because v24.10 stable has no regulator definition, so we cannot make simple cherry-pick. We need another DTS file. Specifications: SoC: MediaTek MT7621AT RAM: 256 MB (DDR3) Flash: 16 MB (NOR) POE Chip: IP804AR Interfaces: Switch: 1 WAN, 4 LAN (Gigabit) Gigabit RJ45 PoE Ports on 2~5 Max Power on a Single PoE Ports 30W PoE Ports : The PoE ports comply with IEEE 802.3at/af standards. Ports: 1 USB-A 3.0 Ports LED: System PoE Max Status Link/ACT/PoE Status of Each PoE Port Physical Buttons: Reset Button Power Input: DC Jack Power Methods: DC: 54V 1.11A 802.3at/af PoE Passive PoE: 24/48V Max Power Consumption (W): Total: 60W PoE: 55W PoE (when USB Device is plugged in): 50W No PoE: 5W Installation: To install OpenWRT, you need the intermediate firmware from Cudy. (U-boot is locked). After installing the intermediate firmware, you can install OpenWRT via sysupgrade. Recovery: TFTP available. 1. Place the recovery.bin in the serving directory of your TFTP server. 2. Set your IP to 192.168.1.88/24. 3. Press the “Reset” button of Cudy router and hold it. Before the Cudy router is powered on and before TFTP start to download the firmware, don't release the “Reset” button. 4. Power on the Cudy router. 5. You can release the reset button only when TFTP starts downloading firmware. 6. When the SYSTEM LED turns solid green, the upgrade is complete. Serial: 1. Serial connection parameters: 115200 / 8N1 2. Serial connection voltage: 3.3V PoE is not supported at the time of PR. The IP804R chip is not yet supported by OpenWRT. Signed-off-by: Marcin Leksmark <[email protected]> Link: openwrt/openwrt#21064 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 61408bb commit a9858a9

File tree

3 files changed

+213
-3
lines changed

3 files changed

+213
-3
lines changed
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7621.dtsi"
4+
5+
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/input/input.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
/ {
10+
compatible = "cudy,c200p", "mediatek,mt7621-soc";
11+
model = "Cudy C200P";
12+
13+
aliases {
14+
led-boot = &led_sys;
15+
led-failsafe = &led_sys;
16+
led-running = &led_sys;
17+
led-upgrade = &led_sys;
18+
label-mac-device = &gmac0;
19+
};
20+
21+
chosen {
22+
bootargs = "console=ttyS0,115200";
23+
};
24+
25+
watchdog {
26+
compatible = "linux,wdt-gpio";
27+
gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
28+
hw_algo = "toggle";
29+
hw_margin_ms = <1000>;
30+
always-running;
31+
};
32+
33+
reg_vbus: regulator {
34+
compatible = "regulator-fixed";
35+
regulator-name = "power_usb";
36+
regulator-min-microvolt = <5000000>;
37+
regulator-max-microvolt = <5000000>;
38+
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
39+
enable-active-high;
40+
};
41+
42+
output-reg-vbus {
43+
compatible = "regulator-output";
44+
vout-supply = <&reg_vbus>;
45+
};
46+
47+
gpio-export {
48+
compatible = "gpio-export";
49+
#size-cells = <0>;
50+
51+
pse {
52+
gpio-export,name = "pse";
53+
gpio-export,output = <1>;
54+
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
55+
};
56+
};
57+
58+
keys {
59+
compatible = "gpio-keys";
60+
61+
reset {
62+
label = "reset";
63+
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
64+
linux,code = <KEY_RESTART>;
65+
};
66+
};
67+
68+
leds {
69+
compatible = "gpio-leds";
70+
71+
led_sys: status {
72+
color = <LED_COLOR_ID_GREEN>;
73+
function = LED_FUNCTION_STATUS;
74+
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
75+
};
76+
77+
led_poe {
78+
color = <LED_COLOR_ID_GREEN>;
79+
function = LED_FUNCTION_INDICATOR;
80+
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
81+
};
82+
};
83+
};
84+
85+
&xhci {
86+
vbus-supply = <&reg_vbus>;
87+
};
88+
89+
&i2c {
90+
status = "okay";
91+
};
92+
93+
&gmac0 {
94+
nvmem-cells = <&macaddr_bdinfo_de00 0>;
95+
nvmem-cell-names = "mac-address";
96+
};
97+
98+
&spi0 {
99+
status = "okay";
100+
101+
flash@0 {
102+
compatible = "jedec,spi-nor";
103+
reg = <0>;
104+
spi-max-frequency = <50000000>;
105+
106+
partitions {
107+
compatible = "fixed-partitions";
108+
#address-cells = <1>;
109+
#size-cells = <1>;
110+
111+
partition@0 {
112+
label = "u-boot";
113+
reg = <0x0 0x30000>;
114+
read-only;
115+
};
116+
117+
partition@30000 {
118+
label = "u-boot-env";
119+
reg = <0x30000 0x10000>;
120+
read-only;
121+
};
122+
123+
partition@40000 {
124+
label = "factory";
125+
reg = <0x40000 0x10000>;
126+
read-only;
127+
};
128+
129+
partition@50000 {
130+
compatible = "denx,uimage";
131+
label = "firmware";
132+
reg = <0x50000 0xfa0000>;
133+
};
134+
135+
partition@ff0000 {
136+
label = "bdinfo";
137+
reg = <0xff0000 0x10000>;
138+
read-only;
139+
140+
nvmem-layout {
141+
compatible = "fixed-layout";
142+
#address-cells = <1>;
143+
#size-cells = <1>;
144+
145+
macaddr_bdinfo_de00: macaddr@de00 {
146+
compatible = "mac-base";
147+
reg = <0xde00 0x6>;
148+
#nvmem-cell-cells = <1>;
149+
};
150+
};
151+
};
152+
};
153+
};
154+
};
155+
156+
&state_default {
157+
gpio {
158+
groups = "jtag", "uart2", "uart3", "wdt";
159+
function = "gpio";
160+
};
161+
};
162+
163+
&gmac1 {
164+
status = "okay";
165+
label = "wan";
166+
phy-handle = <&ethphy4>;
167+
168+
nvmem-cells = <&macaddr_bdinfo_de00 1>;
169+
nvmem-cell-names = "mac-address";
170+
};
171+
172+
&ethphy4 {
173+
/delete-property/ interrupts;
174+
};
175+
176+
&switch0 {
177+
ports {
178+
port@0 {
179+
status = "okay";
180+
label = "lan5";
181+
};
182+
183+
port@1 {
184+
status = "okay";
185+
label = "lan4";
186+
};
187+
188+
port@2 {
189+
status = "okay";
190+
label = "lan3";
191+
};
192+
193+
port@3 {
194+
status = "okay";
195+
label = "lan2";
196+
};
197+
198+
};
199+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,16 @@ define Device/cudy_ap1300-outdoor-v1
716716
endef
717717
TARGET_DEVICES += cudy_ap1300-outdoor-v1
718718

719+
define Device/cudy_c200p
720+
$(Device/dsa-migration)
721+
DEVICE_VENDOR := Cudy
722+
DEVICE_MODEL := C200P
723+
IMAGE_SIZE := 15872k
724+
UIMAGE_NAME := R74
725+
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
726+
endef
727+
TARGET_DEVICES += cudy_c200p
728+
719729
define Device/cudy_m1300-v2
720730
$(Device/dsa-migration)
721731
IMAGE_SIZE := 15872k

target/linux/ramips/mt7621/base-files/etc/board.d/02_network

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ ramips_setup_interfaces()
115115
uci add_list firewall.@zone[1].network='eth_data'
116116
uci add_list firewall.@zone[1].network='eth_om'
117117
;;
118+
cudy,c200p|\
119+
mikrotik,routerboard-750gr3)
120+
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
121+
;;
118122
dlink,covr-x1860-a1)
119123
ucidef_set_interfaces_lan_wan "ethernet" "internet"
120124
;;
@@ -133,9 +137,6 @@ ramips_setup_interfaces()
133137
gnubee,gb-pc2)
134138
ucidef_set_interface_lan "ethblack ethblue ethyellow"
135139
;;
136-
mikrotik,routerboard-750gr3)
137-
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
138-
;;
139140
mikrotik,routerboard-760igs)
140141
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp"
141142
;;

0 commit comments

Comments
 (0)