Skip to content

Commit 4a3409f

Browse files
catskullhauke
authored andcommitted
ramips: add support for Cudy R700
This is the same hardware as the Cudy WR2100 that's had support for some time now, just without the WLAN hardware. This PR is mostly copied from the commit that added support for the WR2100, here: 3501db9 Specifications: SoC: MT7621 CPU: 880 MHz Flash: 16 MiB RAM: 128 MiB Ethernet: 5x Gbit ports Installation: There are two known options: The Luci-based UI. Press and hold the reset button during power up. The router will request 'recovery.bin' from a TFTP server at 192.168.1.88. Both options require a signed firmware binary. A signed firmware can be found in GitHub PR #18532. R4 & R5 need to be shorted (0-100Ω) for the UART to work. Link: openwrt/openwrt#18532 Signed-off-by: David DeGraw <[email protected]> (cherry picked from commit 75403dd) Link: openwrt/openwrt#21068 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent a9858a9 commit 4a3409f

File tree

3 files changed

+214
-0
lines changed

3 files changed

+214
-0
lines changed
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
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,r700", "mediatek,mt7621-soc";
11+
model = "Cudy R700";
12+
13+
aliases {
14+
led-boot = &led_internet_blue;
15+
led-failsafe = &led_internet_blue;
16+
led-running = &led_internet_blue;
17+
led-upgrade = &led_internet_blue;
18+
label-mac-device = &gmac0;
19+
};
20+
21+
chosen {
22+
bootargs = "console=ttyS0,115200";
23+
};
24+
25+
keys {
26+
compatible = "gpio-keys";
27+
28+
reset {
29+
label = "reset";
30+
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
31+
linux,code = <KEY_RESTART>;
32+
};
33+
};
34+
35+
leds {
36+
compatible = "gpio-leds";
37+
38+
led_internet_blue: internet_blue {
39+
label = "blue:internet";
40+
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
41+
};
42+
43+
internet_red {
44+
label = "red:internet";
45+
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
46+
};
47+
48+
wan {
49+
function = LED_FUNCTION_WAN;
50+
color = <LED_COLOR_ID_GREEN>;
51+
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
52+
};
53+
54+
lan1 {
55+
label = "green:lan1";
56+
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
57+
};
58+
59+
lan2 {
60+
label = "green:lan2";
61+
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
62+
};
63+
64+
lan3 {
65+
label = "green:lan3";
66+
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
67+
};
68+
69+
lan4 {
70+
label = "green:lan4";
71+
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
72+
};
73+
};
74+
};
75+
76+
&gmac0 {
77+
nvmem-cells = <&macaddr_bdinfo_de00 0>;
78+
nvmem-cell-names = "mac-address";
79+
};
80+
81+
&spi0 {
82+
status = "okay";
83+
84+
flash@0 {
85+
compatible = "jedec,spi-nor";
86+
reg = <0>;
87+
spi-max-frequency = <50000000>;
88+
89+
partitions {
90+
compatible = "fixed-partitions";
91+
#address-cells = <1>;
92+
#size-cells = <1>;
93+
94+
partition@0 {
95+
label = "u-boot";
96+
reg = <0x0 0x30000>;
97+
read-only;
98+
};
99+
100+
partition@30000 {
101+
label = "u-boot-env";
102+
reg = <0x30000 0x10000>;
103+
read-only;
104+
};
105+
106+
partition@40000 {
107+
label = "factory";
108+
reg = <0x40000 0x10000>;
109+
read-only;
110+
111+
nvmem-layout {
112+
compatible = "fixed-layout";
113+
#address-cells = <1>;
114+
#size-cells = <1>;
115+
116+
eeprom_factory_0: eeprom@0 {
117+
reg = <0x0 0x400>;
118+
};
119+
120+
eeprom_factory_8000: eeprom@8000 {
121+
reg = <0x8000 0x4da8>;
122+
};
123+
};
124+
};
125+
126+
partition@50000 {
127+
compatible = "denx,uimage";
128+
label = "firmware";
129+
reg = <0x50000 0xf80000>;
130+
};
131+
132+
partition@fd0000 {
133+
label = "debug";
134+
reg = <0xfd0000 0x10000>;
135+
read-only;
136+
};
137+
138+
partition@fe0000 {
139+
label = "backup";
140+
reg = <0xfe0000 0x10000>;
141+
read-only;
142+
};
143+
144+
partition@ff0000 {
145+
label = "bdinfo";
146+
reg = <0xff0000 0x10000>;
147+
read-only;
148+
149+
nvmem-layout {
150+
compatible = "fixed-layout";
151+
#address-cells = <1>;
152+
#size-cells = <1>;
153+
154+
macaddr_bdinfo_de00: macaddr@de00 {
155+
compatible = "mac-base";
156+
reg = <0xde00 0x6>;
157+
#nvmem-cell-cells = <1>;
158+
};
159+
};
160+
};
161+
};
162+
};
163+
};
164+
165+
&state_default {
166+
gpio {
167+
groups = "i2c", "jtag", "uart3", "wdt";
168+
function = "gpio";
169+
};
170+
};
171+
172+
&gmac1 {
173+
status = "okay";
174+
label = "wan";
175+
phy-handle = <&ethphy4>;
176+
177+
nvmem-cells = <&macaddr_bdinfo_de00 1>;
178+
nvmem-cell-names = "mac-address";
179+
};
180+
181+
&switch0 {
182+
ports {
183+
port@0 {
184+
status = "okay";
185+
label = "lan1";
186+
};
187+
188+
port@1 {
189+
status = "okay";
190+
label = "lan2";
191+
};
192+
193+
port@2 {
194+
status = "okay";
195+
label = "lan3";
196+
};
197+
198+
port@3 {
199+
status = "okay";
200+
label = "lan4";
201+
};
202+
};
203+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,16 @@ define Device/cudy_wr2100
795795
endef
796796
TARGET_DEVICES += cudy_wr2100
797797

798+
define Device/cudy_r700
799+
$(Device/dsa-migration)
800+
DEVICE_VENDOR := Cudy
801+
DEVICE_MODEL := R700
802+
IMAGE_SIZE := 15872k
803+
UIMAGE_NAME := R29
804+
DEVICE_PACKAGES := -uboot-envtools
805+
endef
806+
TARGET_DEVICES += cudy_r700
807+
798808
define Device/cudy_x6-v1
799809
$(Device/dsa-migration)
800810
IMAGE_SIZE := 32256k

target/linux/ramips/mt7621/base-files/etc/board.d/01_leds

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ genexis,pulse-ex400|\
6666
netis,n6)
6767
ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
6868
;;
69+
cudy,r700|\
6970
cudy,wr2100)
7071
ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
7172
ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"

0 commit comments

Comments
 (0)