Skip to content

Commit 2fea2ed

Browse files
andros-uahauke
authored andcommitted
mediatek: add support for CreatLentem CLT-R30B1
CreatLentem CLT-R30B1 is a wireless WiFi 6 router. This device uses the CLT-R30B1_0824_V1.1 board shared by EDUP RT2980, Dragonglass DXG21, and other diamond-shaped 5-antenna routers. Specification ------------- - SoC : MediaTek MT7981B dual-core ARM Cortex-A53 1.3 GHz - RAM : DDR3 256 MiB - Flash : SPI-NAND 128 MiB (ESMT F50L1G41LB) - WLAN : MediaTek MT7976CN dual-band WiFi 6 - 2.4 GHz : b/g/n/ax, MU-MIMO (2x 5 dBi antennas) - 5 GHz : a/n/ac/ax, MU-MIMO (3x 5 dBi antennas) - Ethernet : - LAN x3 : 10/100/1000 Mbps (MediaTek MT7531AE) - WAN x1 : 10/100/1000 Mbps (MT7981 internal PHY) - UART : through-hole on PCB - assignment : (RX), (TX), (GND), [3.3V] - settings : 115200n8 - Buttons x2 : Mesh/WPS, Reset - LEDs x2 : Status (Red, Green) - Power : 12 VDC, 1 A, 2.1*5.5 mm Important notes --------------- The device is supplied in two variants. The main difference is the size of the mtd5 (ubi) partition in the flash layout: 64M or 112M. 112M version: Has ImmortalWrt firmware installed with LuCI WebUI. 64M version: Has stock firmware based on OpenWrt, with the WaveLink/GL.iNet WebUI and older U-Boot compared to the 112M version. Flash instructions for 112M version ----------------------------------- Follow the standard OpenWrt sysupgrade procedure without saving data. Use the clt-r30b1-112m-squashfs-sysupgrade.bin image. All checks should pass - don't proceed if a "not supported" warning is issued. Flash instructions for 64M version ---------------------------------- WebUI Method: 1. Prepare the upgrade image with clt-r30b1-squashfs-sysupgrade.bin using the script: make_staged_upgrade_tar.sh or use the prepared image: staged_openwrt_upgrade.bin Downloaded from: https://github.com/andros-ua/owrt-misc/tree/main/clt-r30b1 2. Install the prepared image using the stock WebUI update page. 3. Press and hold the reset button after reboot to wipe the stock config and gain access. SSH Method: 1. Connect via SSH using dg:ivanlee credentials. 2. Upload the clt-r30b1-squashfs-sysupgrade.bin image. 3. Use the command: sysupgrade -n All checks should pass - don't proceed if a "not supported" warning is issued. Return to stock --------------- Flash a backup of the ubi mtdblock (mtd5) using the OpenWrt sysupgrade method. Recovery -------- Both variants: Connect UART and use the U-Boot menu to flash the firmware image or boot an OpenWrt initramfs image. 112M with newer U-Boot: Power on the router while pressing the mesh button for 3 seconds. The U-Boot Flash WebUI will be available at http://192.168.1.1 MAC Addresses: ------------------------------------------------------- | Interface | MAC | Source | ---------------|-------------------|------------------- | LAN | B4:4D:43:D1:xx:xx | Factory, 0x2A | | WAN | B4:4D:43:D1:xx:xx | Factory, 0x24 | | WLAN 2.4 GHz | B4:4D:43:D2:xx:xx | Factory, 0x4 | | WLAN 5 GHz | B4:4D:43:D2:xx:xx | Factory, 0x4 + 1 | ------------------------------------------------------- Signed-off-by: Andrii Kuiukoff <[email protected]> Link: openwrt/openwrt#19534 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent 96be6d4 commit 2fea2ed

File tree

6 files changed

+347
-0
lines changed

6 files changed

+347
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7981b-creatlentem-clt-r30b1-common.dtsi"
4+
5+
/ {
6+
model = "CreatLentem CLT-R30B1 (112M)";
7+
compatible = "creatlentem,clt-r30b1-112m", "mediatek,mt7981";
8+
};
9+
10+
&partitions {
11+
partition@580000 {
12+
label = "ubi";
13+
reg = <0x0580000 0x7000000>;
14+
};
15+
};
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
5+
#include <dt-bindings/gpio/gpio.h>
6+
#include <dt-bindings/input/input.h>
7+
#include <dt-bindings/leds/common.h>
8+
9+
#include "mt7981b.dtsi"
10+
11+
/ {
12+
aliases {
13+
led-boot = &led_status_red;
14+
led-failsafe = &led_status_red;
15+
led-running = &led_status_green;
16+
led-upgrade = &led_status_green;
17+
serial0 = &uart0;
18+
};
19+
20+
chosen {
21+
stdout-path = "serial0:115200n8";
22+
};
23+
24+
gpio-keys {
25+
compatible = "gpio-keys";
26+
27+
reset {
28+
label = "reset";
29+
linux,code = <KEY_RESTART>;
30+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
31+
debounce-interval = <60>;
32+
};
33+
34+
wps {
35+
label = "wps";
36+
linux,code = <KEY_WPS_BUTTON>;
37+
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
38+
debounce-interval = <60>;
39+
};
40+
};
41+
42+
leds {
43+
compatible = "gpio-leds";
44+
45+
led_status_green: green {
46+
color = <LED_COLOR_ID_GREEN>;
47+
function = LED_FUNCTION_STATUS;
48+
gpios = <&pio 11 GPIO_ACTIVE_LOW>;
49+
};
50+
51+
led_status_red: red {
52+
color = <LED_COLOR_ID_RED>;
53+
function = LED_FUNCTION_STATUS;
54+
gpios = <&pio 12 GPIO_ACTIVE_LOW>;
55+
};
56+
};
57+
58+
memory {
59+
reg = <0 0x40000000 0 0x10000000>;
60+
};
61+
};
62+
63+
&eth {
64+
status = "okay";
65+
66+
gmac0: mac@0 {
67+
compatible = "mediatek,eth-mac";
68+
reg = <0>;
69+
phy-mode = "2500base-x";
70+
71+
nvmem-cell-names = "mac-address";
72+
nvmem-cells = <&macaddr_factory_24 0>;
73+
74+
fixed-link {
75+
speed = <2500>;
76+
full-duplex;
77+
pause;
78+
};
79+
};
80+
81+
gmac1: mac@1 {
82+
compatible = "mediatek,eth-mac";
83+
reg = <1>;
84+
label = "wan";
85+
phy-mode = "gmii";
86+
phy-handle = <&int_gbe_phy>;
87+
88+
nvmem-cell-names = "mac-address";
89+
nvmem-cells = <&macaddr_factory_2a 0>;
90+
};
91+
92+
};
93+
94+
&mdio_bus {
95+
switch: switch@1f {
96+
compatible = "mediatek,mt7531";
97+
reg = <31>;
98+
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
99+
interrupt-controller;
100+
#interrupt-cells = <1>;
101+
interrupt-parent = <&pio>;
102+
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
103+
};
104+
};
105+
106+
&spi0 {
107+
pinctrl-names = "default";
108+
pinctrl-0 = <&spi0_flash_pins>;
109+
status = "okay";
110+
111+
spi_nand@0 {
112+
#address-cells = <1>;
113+
#size-cells = <1>;
114+
compatible = "spi-nand";
115+
reg = <0>;
116+
117+
spi-max-frequency = <52000000>;
118+
spi-tx-bus-width = <4>;
119+
spi-rx-bus-width = <4>;
120+
121+
spi-cal-enable;
122+
spi-cal-mode = "read-data";
123+
spi-cal-datalen = <7>;
124+
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>;
125+
spi-cal-addrlen = <5>;
126+
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
127+
128+
mediatek,nmbm;
129+
mediatek,bmt-max-ratio = <1>;
130+
mediatek,bmt-max-reserved-blocks = <64>;
131+
132+
partitions: partitions {
133+
compatible = "fixed-partitions";
134+
#address-cells = <1>;
135+
#size-cells = <1>;
136+
137+
partition@0 {
138+
label = "BL2";
139+
reg = <0x0 0x100000>;
140+
read-only;
141+
};
142+
143+
partition@100000 {
144+
label = "u-boot-env";
145+
reg = <0x100000 0x80000>;
146+
};
147+
148+
partition@180000 {
149+
label = "Factory";
150+
reg = <0x180000 0x200000>;
151+
read-only;
152+
153+
nvmem-layout {
154+
compatible = "fixed-layout";
155+
#address-cells = <1>;
156+
#size-cells = <1>;
157+
158+
eeprom_factory_0: eeprom@0 {
159+
reg = <0x0 0x1000>;
160+
};
161+
162+
macaddr_factory_4: macaddr@4 {
163+
reg = <0x4 0x6>;
164+
compatible = "mac-base";
165+
#nvmem-cell-cells = <1>;
166+
};
167+
168+
macaddr_factory_24: macaddr@24 {
169+
compatible = "mac-base";
170+
reg = <0x24 0x6>;
171+
#nvmem-cell-cells = <1>;
172+
};
173+
174+
macaddr_factory_2a: macaddr@2a {
175+
compatible = "mac-base";
176+
reg = <0x2a 0x6>;
177+
#nvmem-cell-cells = <1>;
178+
};
179+
};
180+
};
181+
182+
partition@380000 {
183+
label = "FIP";
184+
reg = <0x380000 0x200000>;
185+
read-only;
186+
};
187+
};
188+
};
189+
};
190+
191+
192+
&switch {
193+
ports {
194+
#address-cells = <1>;
195+
#size-cells = <0>;
196+
197+
port@0 {
198+
reg = <0>;
199+
label = "lan1";
200+
};
201+
202+
port@1 {
203+
reg = <1>;
204+
label = "lan2";
205+
};
206+
207+
port@2 {
208+
reg = <2>;
209+
label = "lan3";
210+
};
211+
212+
port@6 {
213+
reg = <6>;
214+
ethernet = <&gmac0>;
215+
phy-mode = "2500base-x";
216+
217+
fixed-link {
218+
speed = <2500>;
219+
full-duplex;
220+
pause;
221+
};
222+
};
223+
};
224+
};
225+
226+
&pio {
227+
spi0_flash_pins: spi0-pins {
228+
mux {
229+
function = "spi";
230+
groups = "spi0", "spi0_wp_hold";
231+
};
232+
233+
conf-pu {
234+
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
235+
drive-strength = <MTK_DRIVE_4mA>;
236+
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
237+
};
238+
239+
conf-pd {
240+
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
241+
drive-strength = <MTK_DRIVE_4mA>;
242+
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
243+
};
244+
};
245+
};
246+
247+
&uart0 {
248+
status = "okay";
249+
};
250+
251+
&watchdog {
252+
status = "okay";
253+
};
254+
255+
&wifi {
256+
#address-cells = <1>;
257+
#size-cells = <0>;
258+
nvmem-cells = <&eeprom_factory_0>;
259+
nvmem-cell-names = "eeprom";
260+
status = "okay";
261+
262+
band@0 {
263+
reg = <0>;
264+
nvmem-cells = <&macaddr_factory_4 0>;
265+
nvmem-cell-names = "mac-address";
266+
};
267+
268+
band@1 {
269+
reg = <1>;
270+
nvmem-cells = <&macaddr_factory_4 1>;
271+
nvmem-cell-names = "mac-address";
272+
};
273+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
#include "mt7981b-creatlentem-clt-r30b1-common.dtsi"
4+
5+
/ {
6+
model = "CreatLentem CLT-R30B1";
7+
compatible = "creatlentem,clt-r30b1", "mediatek,mt7981";
8+
};
9+
10+
&partitions {
11+
partition@580000 {
12+
label = "ubi";
13+
reg = <0x0580000 0x4000000>;
14+
};
15+
partition@4580000 {
16+
label = "data";
17+
reg = <0x4580000 0x2000000>;
18+
};
19+
20+
};

target/linux/mediatek/filogic/base-files/etc/board.d/02_network

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ mediatek_setup_interfaces()
3939
cmcc,a10-stock|\
4040
cmcc,a10-ubootmod|\
4141
confiabits,mt7981|\
42+
creatlentem,clt-r30b1|\
43+
creatlentem,clt-r30b1-112m|\
4244
cudy,wr3000-v1|\
4345
jcg,q30-pro|\
4446
keenetic,kn-3811|\

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ platform_check_image() {
256256
fit_check_image "$1"
257257
return $?
258258
;;
259+
creatlentem,clt-r30b1|\
260+
creatlentem,clt-r30b1-112m|\
259261
nradio,c8-668gl)
260262
# tar magic `ustar`
261263
magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)"

target/linux/mediatek/image/filogic.mk

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,41 @@ define Device/confiabits_mt7981
711711
endef
712712
TARGET_DEVICES += confiabits_mt7981
713713

714+
define Device/creatlentem_clt-r30b1-common
715+
DEVICE_VENDOR := CreatLentem
716+
DEVICE_MODEL := CLT-R30B1
717+
DEVICE_ALT0_VENDOR := EDUP
718+
DEVICE_ALT0_MODEL := RT2980
719+
DEVICE_ALT1_VENDOR := Dragonglass
720+
DEVICE_ALT1_MODEL := DXG21
721+
DEVICE_DTS_DIR := ../dts
722+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
723+
UBINIZE_OPTS := -E 5
724+
BLOCKSIZE := 128k
725+
PAGESIZE := 2048
726+
KERNEL_IN_UBI := 1
727+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
728+
endef
729+
730+
define Device/creatlentem_clt-r30b1-112m
731+
DEVICE_VARIANT := 112M
732+
DEVICE_ALT0_VARIANT := 112M
733+
DEVICE_ALT1_VARIANT := 112M
734+
DEVICE_DTS := mt7981b-creatlentem-clt-r30b1-112m
735+
SUPPORTED_DEVICES += clt,r30b1 clt,r30b1-112m
736+
IMAGE_SIZE := 114688k
737+
$(call Device/creatlentem_clt-r30b1-common)
738+
endef
739+
TARGET_DEVICES += creatlentem_clt-r30b1-112m
740+
741+
define Device/creatlentem_clt-r30b1
742+
DEVICE_DTS := mt7981b-creatlentem-clt-r30b1
743+
SUPPORTED_DEVICES += mediatek,mt7981-spim-snand-rfb
744+
IMAGE_SIZE := 65536k
745+
$(call Device/creatlentem_clt-r30b1-common)
746+
endef
747+
TARGET_DEVICES += creatlentem_clt-r30b1
748+
714749
define Device/cudy_ap3000outdoor-v1
715750
DEVICE_VENDOR := Cudy
716751
DEVICE_MODEL := AP3000 Outdoor

0 commit comments

Comments
 (0)