Skip to content

Commit 6606bb3

Browse files
committed
mediatek: add support for ABT ASR3000
1 parent 64f24a2 commit 6606bb3

File tree

5 files changed

+282
-4
lines changed

5 files changed

+282
-4
lines changed
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
#include <dt-bindings/gpio/gpio.h>
5+
#include <dt-bindings/input/input.h>
6+
7+
#include "mt7981.dtsi"
8+
9+
/ {
10+
model = "ABT ASR3000";
11+
compatible = "abt,asr3000", "mediatek,mt7981";
12+
13+
aliases {
14+
serial0 = &uart0;
15+
led-boot = &led_wps;
16+
led-upgrade = &led_wps;
17+
label-mac-device = &gmac0;
18+
};
19+
20+
chosen {
21+
stdout-path = "serial0:115200n8";
22+
};
23+
24+
memory {
25+
reg = <0 0x40000000 0 0x10000000>;
26+
};
27+
28+
gpio-keys {
29+
compatible = "gpio-keys";
30+
31+
reset {
32+
label = "reset";
33+
linux,code = <KEY_RESTART>;
34+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
35+
};
36+
37+
mesh {
38+
label = "mesh";
39+
linux,code = <KEY_WPS_BUTTON>;
40+
gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
41+
};
42+
};
43+
44+
leds {
45+
compatible = "gpio-leds";
46+
47+
wan {
48+
label = "green:wan";
49+
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
50+
};
51+
52+
led_wps: wps {
53+
label = "green:wps";
54+
gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
55+
};
56+
};
57+
};
58+
59+
&eth {
60+
status = "okay";
61+
62+
gmac0: mac@0 {
63+
compatible = "mediatek,eth-mac";
64+
reg = <0>;
65+
phy-mode = "2500base-x";
66+
67+
nvmem-cells = <&macaddr_art_0>;
68+
nvmem-cell-names = "mac-address";
69+
70+
fixed-link {
71+
speed = <2500>;
72+
full-duplex;
73+
pause;
74+
};
75+
};
76+
77+
gmac1: mac@1 {
78+
compatible = "mediatek,eth-mac";
79+
reg = <1>;
80+
phy-mode = "gmii";
81+
phy-handle = <&int_gbe_phy>;
82+
83+
nvmem-cells = <&macaddr_art_0>;
84+
nvmem-cell-names = "mac-address";
85+
mac-address-increment = <0x500000>;
86+
};
87+
};
88+
89+
&mdio_bus {
90+
switch: switch@0 {
91+
compatible = "mediatek,mt7531";
92+
reg = <31>;
93+
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
94+
interrupt-controller;
95+
#interrupt-cells = <1>;
96+
interrupt-parent = <&pio>;
97+
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
98+
};
99+
};
100+
101+
&spi0 {
102+
pinctrl-names = "default";
103+
pinctrl-0 = <&spi0_flash_pins>;
104+
status = "okay";
105+
106+
spi_nand@0 {
107+
compatible = "spi-nand";
108+
#address-cells = <1>;
109+
#size-cells = <1>;
110+
reg = <0>;
111+
112+
spi-max-frequency = <52000000>;
113+
spi-tx-bus-width = <4>;
114+
spi-rx-bus-width = <4>;
115+
116+
mediatek,nmbm;
117+
mediatek,bmt-max-ratio = <1>;
118+
mediatek,bmt-max-reserved-blocks = <64>;
119+
120+
partitions {
121+
compatible = "fixed-partitions";
122+
#address-cells = <1>;
123+
#size-cells = <1>;
124+
125+
partition@0 {
126+
label = "BL2";
127+
reg = <0x0000000 0x0100000>;
128+
read-only;
129+
};
130+
131+
partition@100000 {
132+
label = "u-boot-env";
133+
reg = <0x0100000 0x0080000>;
134+
};
135+
136+
partition@180000 {
137+
label = "art";
138+
reg = <0x0180000 0x0100000>;
139+
read-only;
140+
141+
compatible = "nvmem-cells";
142+
#address-cells = <1>;
143+
#size-cells = <1>;
144+
145+
macaddr_art_0: macaddr@0 {
146+
reg = <0x0 0x6>;
147+
};
148+
149+
macaddr_art_6: macaddr@6 {
150+
reg = <0x6 0x6>;
151+
};
152+
};
153+
154+
factory: partition@280000 {
155+
label = "Factory";
156+
reg = <0x0280000 0x0100000>;
157+
read-only;
158+
};
159+
160+
partition@380000 {
161+
label = "FIP";
162+
reg = <0x0380000 0x0200000>;
163+
read-only;
164+
};
165+
166+
partition@580000 {
167+
label = "ubi";
168+
reg = <0x0580000 0x7000000>;
169+
};
170+
};
171+
};
172+
};
173+
174+
&switch {
175+
ports {
176+
#address-cells = <1>;
177+
#size-cells = <0>;
178+
179+
port@0 {
180+
reg = <0>;
181+
label = "lan3";
182+
};
183+
184+
port@1 {
185+
reg = <1>;
186+
label = "lan2";
187+
};
188+
189+
port@2 {
190+
reg = <2>;
191+
label = "lan1";
192+
};
193+
194+
port@6 {
195+
reg = <6>;
196+
label = "cpu";
197+
ethernet = <&gmac0>;
198+
phy-mode = "2500base-x";
199+
200+
fixed-link {
201+
speed = <2500>;
202+
full-duplex;
203+
pause;
204+
};
205+
};
206+
};
207+
};
208+
209+
&pio {
210+
spi0_flash_pins: spi0-pins {
211+
mux {
212+
function = "spi";
213+
groups = "spi0", "spi0_wp_hold";
214+
};
215+
216+
conf-pu {
217+
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
218+
drive-strength = <8>;
219+
mediatek,pull-up-adv = <0>; /* bias-disable */
220+
};
221+
222+
conf-pd {
223+
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
224+
drive-strength = <8>;
225+
mediatek,pull-up-adv = <0>; /* bias-disable */
226+
};
227+
};
228+
229+
wf_led_pins: wf-led-pins {
230+
mux {
231+
function = "led";
232+
groups = "wf2g_led1", "wf5g_led1";
233+
};
234+
};
235+
};
236+
237+
&uart0 {
238+
status = "okay";
239+
};
240+
241+
&watchdog {
242+
status = "okay";
243+
};
244+
245+
&wifi {
246+
status = "okay";
247+
pinctrl-0 = <&wifi_dbdc_pins>, <&wf_led_pins>;
248+
nvmem-cells = <&macaddr_art_6>;
249+
nvmem-cell-names = "mac-address";
250+
mediatek,mtd-eeprom = <&factory 0x0>;
251+
252+
led {
253+
led-active-low;
254+
};
255+
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ board=$(board_name)
66
board_config_update
77

88
case $board in
9+
abt,asr3000)
10+
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
11+
;;
912
imou,lc-hx3001)
1013
ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
1114
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ mediatek_setup_interfaces()
88
local board="$1"
99

1010
case $board in
11+
abt,asr3000|\
12+
h3c,magic-nx30-pro|\
13+
imou,lc-hx3001)
14+
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
15+
;;
1116
asus,tuf-ax4200|\
1217
jdcloud,re-cs-05|\
1318
netcore,n60|\
@@ -27,10 +32,6 @@ mediatek_setup_interfaces()
2732
glinet,gl-mt3000)
2833
ucidef_set_interfaces_lan_wan eth1 eth0
2934
;;
30-
h3c,magic-nx30-pro|\
31-
imou,lc-hx3001)
32-
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
33-
;;
3435
mediatek,mt7986a-rfb|\
3536
mediatek,mt7986b-rfb)
3637
ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" eth1

target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ PHYNBR=${DEVPATH##*/phy}
1010
board=$(board_name)
1111

1212
case "$board" in
13+
abt,asr3000)
14+
addr=$(mtd_get_mac_binary "art" 0x6)
15+
[ "$PHYNBR" = "1" ] && \
16+
macaddr_setbit_la "$(macaddr_add $addr 0x600000)" > /sys${DEVPATH}/macaddress
17+
;;
1318
asus,tuf-ax4200)
1419
CI_UBIPART="UBI_DEV"
1520
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)

target/linux/mediatek/image/filogic.mk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ define Build/cetron-header
5151
rm $@.tmp
5252
endef
5353

54+
define Device/abt_asr3000
55+
DEVICE_VENDOR := ABT
56+
DEVICE_MODEL := ASR3000
57+
DEVICE_DTS := mt7981b-abt-asr3000
58+
DEVICE_DTS_DIR := ../dts
59+
UBINIZE_OPTS := -E 5
60+
BLOCKSIZE := 128k
61+
PAGESIZE := 2048
62+
KERNEL_IN_UBI := 1
63+
DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
64+
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
65+
endef
66+
TARGET_DEVICES += abt_asr3000
67+
5468
define Device/asus_tuf-ax4200
5569
DEVICE_VENDOR := ASUS
5670
DEVICE_MODEL := TUF-AX4200

0 commit comments

Comments
 (0)