Skip to content

Commit 22391ba

Browse files
lexmark3200hauke
authored andcommitted
ramips: fix support for Cudy r700
This PR fixes support for Cudy r700. Original PR: openwrt/openwrt#18532 Fixed: - WAN port functionality; - RESET button; - Status LED; - LAN port names consistent with the chassis; - Merged partitions "debug", "backup" & "firmware" to one partition "firmware" ("debug" & "backup" contained unimportant data); - Removed redundant DTS elements. 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. Fixes: 75403dd ("ramips: add support for Cudy R700") Link: openwrt/openwrt#20756 (cherry picked from commit 35a8626) Signed-off-by: Marcin Leksmark <[email protected]> Link: openwrt/openwrt#21068 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 4a3409f commit 22391ba

File tree

4 files changed

+16
-69
lines changed

4 files changed

+16
-69
lines changed

target/linux/ramips/dts/mt7621_cudy_r700.dts

Lines changed: 14 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
model = "Cudy R700";
1212

1313
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;
14+
led-boot = &led_status_green;
15+
led-failsafe = &led_status_green;
16+
led-running = &led_status_green;
1817
label-mac-device = &gmac0;
1918
};
2019

@@ -27,49 +26,19 @@
2726

2827
reset {
2928
label = "reset";
30-
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
29+
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
3130
linux,code = <KEY_RESTART>;
3231
};
3332
};
3433

3534
leds {
3635
compatible = "gpio-leds";
3736

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;
37+
led_status_green: led-status-green {
5038
color = <LED_COLOR_ID_GREEN>;
39+
function = LED_FUNCTION_STATUS;
5140
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
5241
};
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-
};
7342
};
7443
};
7544

@@ -107,38 +76,12 @@
10776
label = "factory";
10877
reg = <0x40000 0x10000>;
10978
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-
};
12479
};
12580

12681
partition@50000 {
12782
compatible = "denx,uimage";
12883
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;
84+
reg = <0x50000 0xfa0000>;
14285
};
14386

14487
partition@ff0000 {
@@ -178,16 +121,20 @@
178121
nvmem-cell-names = "mac-address";
179122
};
180123

124+
&ethphy4 {
125+
/delete-property/ interrupts;
126+
};
127+
181128
&switch0 {
182129
ports {
183130
port@0 {
184131
status = "okay";
185-
label = "lan1";
132+
label = "lan5";
186133
};
187134

188135
port@1 {
189136
status = "okay";
190-
label = "lan2";
137+
label = "lan4";
191138
};
192139

193140
port@2 {
@@ -197,7 +144,7 @@
197144

198145
port@3 {
199146
status = "okay";
200-
label = "lan4";
147+
label = "lan2";
201148
};
202149
};
203150
};

target/linux/ramips/image/mt7621.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ define Device/cudy_r700
801801
DEVICE_MODEL := R700
802802
IMAGE_SIZE := 15872k
803803
UIMAGE_NAME := R29
804-
DEVICE_PACKAGES := -uboot-envtools
804+
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
805805
endef
806806
TARGET_DEVICES += cudy_r700
807807

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

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ ramips_setup_interfaces()
116116
uci add_list firewall.@zone[1].network='eth_om'
117117
;;
118118
cudy,c200p|\
119+
cudy,r700|\
119120
mikrotik,routerboard-750gr3)
120121
ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan"
121122
;;

0 commit comments

Comments
 (0)