Skip to content

Commit 8fb644e

Browse files
LuisMitaHLDanielRIOThauke
committed
ramips: mt7621: add support for Cudy AP1300 Outdoor v1
Hardware: - SoC: MediaTek MT7621DAT - Flash: 16 MiB XM25QH128C - RAM: 128 MiB - WLAN: 2.4 GHz (MT7603E, 11n), 5 GHz (MediaTek MT7613BEN, 11ac) - Ethernet: 1x10/100/1000 Mbps LAN - Buttons: 1 Reset button, 1 WPS button - LEDs: 5x Green - Serial Console: unpopulated header 115200 8n1 (silkscreen on PCB) - Power: POE 802.3af (37-57V DC) MAC addresses: +---------+-------------------+-----------+ | | MAC | Algorithm | +---------+-------------------+-----------+ | LAN | 80:af:ca:xx:xx:x0 | label | | WLAN 2g | 80:af:ca:xx:xx:x0 | label | | WLAN 5g | 82:af:ca:xx:xx:x1 | +1 | +---------+-------------------+-----------+ Installation: The factory firmware is locked: you can only work with Cudy signed firmware. Download a intermediate firmware signed by Cudy here: https://www.cudy.com/blogs/faq/openwrt-software-download After that, login to the router (192.168.10.254, password "admin") and install the intermediate firmware. If you can reach LuCI or SSH now on the intermediate firmware, just use the sysupgrade image with the 'Keep settings' option turned off. Special thanks to Daniel de Kock for starting the porting work at #16265. Signed-off-by: Luis Mita <[email protected]> Co-Authored-By: Daniel de Kock <[email protected]> Co-Authored-By: Hauke Mehrtens <[email protected]> Link: openwrt/openwrt#20268 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent b10663c commit 8fb644e

File tree

4 files changed

+231
-0
lines changed

4 files changed

+231
-0
lines changed
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7621.dtsi"
4+
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/leds/common.h>
7+
#include <dt-bindings/gpio/gpio.h>
8+
9+
/ {
10+
compatible = "cudy,ap1300-outdoor-v1", "mediatek,mt7621-soc";
11+
model = "Cudy AP1300 Outdoor v1";
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+
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+
wps {
35+
label = "wps";
36+
gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
37+
linux,code = <KEY_WPS_BUTTON>;
38+
};
39+
};
40+
41+
leds {
42+
compatible = "gpio-leds";
43+
led_sys:status {
44+
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
45+
color = <LED_COLOR_ID_GREEN>;
46+
function = LED_FUNCTION_STATUS;
47+
};
48+
49+
internet {
50+
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
51+
color = <LED_COLOR_ID_GREEN>;
52+
function = LED_FUNCTION_WAN_ONLINE;
53+
};
54+
55+
lan {
56+
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
57+
color = <LED_COLOR_ID_GREEN>;
58+
function = LED_FUNCTION_LAN;
59+
};
60+
61+
wifi2g {
62+
gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
63+
color = <LED_COLOR_ID_GREEN>;
64+
function = LED_FUNCTION_WLAN_2GHZ;
65+
linux,default-trigger = "phy0tpt";
66+
};
67+
68+
wifi5g {
69+
gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
70+
color = <LED_COLOR_ID_GREEN>;
71+
function = LED_FUNCTION_WLAN_5GHZ;
72+
linux,default-trigger = "phy1tpt";
73+
};
74+
};
75+
76+
watchdog {
77+
compatible = "linux,wdt-gpio";
78+
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
79+
hw_algo = "toggle";
80+
/* hw_margin_ms seems to be around 30s for this device*/
81+
hw_margin_ms = <10000>;
82+
always-running;
83+
};
84+
};
85+
86+
&spi0 {
87+
status = "okay";
88+
89+
flash@0 {
90+
compatible = "jedec,spi-nor";
91+
reg = <0>;
92+
spi-max-frequency = <40000000>;
93+
partitions {
94+
compatible = "fixed-partitions";
95+
#address-cells = <1>;
96+
#size-cells = <1>;
97+
98+
partition@0 {
99+
label = "u-boot";
100+
reg = <0x0 0x30000>;
101+
read-only;
102+
};
103+
104+
partition@30000 {
105+
label = "u-boot-env";
106+
reg = <0x30000 0x10000>;
107+
read-only;
108+
};
109+
110+
partition@40000 {
111+
label = "factory";
112+
reg = <0x40000 0x10000>;
113+
read-only;
114+
115+
nvmem-layout {
116+
compatible = "fixed-layout";
117+
#address-cells = <1>;
118+
#size-cells = <1>;
119+
120+
eeprom_factory_0: eeprom@0 {
121+
reg = <0x0 0x400>;
122+
};
123+
124+
eeprom_factory_8000: eeprom@8000 {
125+
reg = <0x8000 0x4da8>;
126+
};
127+
};
128+
};
129+
130+
partition@50000 {
131+
compatible = "denx,uimage";
132+
label = "firmware";
133+
reg = <0x50000 0xf80000>;
134+
};
135+
136+
partition@fd0000 {
137+
label = "debug";
138+
reg = <0xfd0000 0x10000>;
139+
read-only;
140+
};
141+
142+
partition@fe0000 {
143+
label = "backup";
144+
reg = <0xfe0000 0x10000>;
145+
read-only;
146+
};
147+
148+
partition@ff0000 {
149+
label = "bdinfo";
150+
reg = <0xff0000 0x10000>;
151+
read-only;
152+
153+
nvmem-layout {
154+
compatible = "fixed-layout";
155+
#address-cells = <1>;
156+
#size-cells = <1>;
157+
158+
macaddr_bdinfo_de00: macaddr@de00 {
159+
compatible = "mac-base";
160+
reg = <0xde00 0x6>;
161+
#nvmem-cell-cells = <1>;
162+
};
163+
};
164+
};
165+
};
166+
};
167+
};
168+
169+
&pcie {
170+
status = "okay";
171+
};
172+
173+
174+
&pcie0 {
175+
wifi@0,0 {
176+
compatible = "mediatek,mt76";
177+
reg = <0x0000 0 0 0 0>;
178+
nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00 1>;
179+
nvmem-cell-names = "eeprom", "mac-address";
180+
ieee80211-freq-limit = <2400000 2500000>;
181+
};
182+
};
183+
184+
&pcie1 {
185+
wifi@1,0 {
186+
compatible = "mediatek,mt76";
187+
reg = <0x0000 0 0 0 0>;
188+
nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00 2>;
189+
nvmem-cell-names = "eeprom", "mac-address";
190+
ieee80211-freq-limit = <5000000 6000000>;
191+
};
192+
};
193+
194+
&gmac0 {
195+
nvmem-cells = <&macaddr_bdinfo_de00 1>;
196+
nvmem-cell-names = "mac-address";
197+
};
198+
199+
&switch0 {
200+
ports {
201+
port@4 {
202+
status = "okay";
203+
label = "lan";
204+
};
205+
};
206+
};
207+
208+
&state_default {
209+
gpio {
210+
groups = "wdt", "i2c", "jtag";
211+
function = "gpio";
212+
};
213+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,20 @@ define Device/confiabits_mt7621-v1
728728
endef
729729
TARGET_DEVICES += confiabits_mt7621-v1
730730

731+
define Device/cudy_ap1300-outdoor-v1
732+
$(Device/dsa-migration)
733+
$(Device/uimage-lzma-loader)
734+
DEVICE_VENDOR := Cudy
735+
DEVICE_MODEL := AP1300 Outdoor
736+
DEVICE_VARIANT := v1
737+
IMAGE_SIZE := 15872k
738+
UIMAGE_NAME := R39
739+
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
740+
-uboot-envtools
741+
SUPPORTED_DEVICES += R39
742+
endef
743+
TARGET_DEVICES += cudy_ap1300-outdoor-v1
744+
731745
define Device/cudy_m1300-v2
732746
$(Device/dsa-migration)
733747
IMAGE_SIZE := 15872k

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ wifire,s1500-nbn)
5858
belkin,rt1800)
5959
ucidef_set_led_netdev "wan" "wan" "white:wan" "wan"
6060
;;
61+
cudy,ap1300-outdoor-v1)
62+
ucidef_set_led_netdev "lan" "lan" "green:lan" "lan"
63+
;;
6164
confiabits,mt7621-v1|\
6265
genexis,pulse-ex400|\
6366
netis,n6)

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
@@ -42,6 +42,7 @@ ramips_setup_interfaces()
4242
arcadyan,we410443|\
4343
asus,rp-ac56|\
4444
asus,rp-ac87|\
45+
cudy,ap1300-outdoor-v1|\
4546
dlink,dap-1620-b1|\
4647
dlink,dap-x1860-a1|\
4748
dlink,dra-1360-a1|\

0 commit comments

Comments
 (0)