Skip to content

Commit 2898d1d

Browse files
goldwrthauke
authored andcommitted
mediatek: add support for Acer Predator W6d and Acer Vero W6m
This commit adds support for two variants of the already supported router Acer Predator Connect W6: The Acer Predator Connect W6d (W6 without 6 GHz wifi) and the Acer Connect Vero W6m (W6 without 2.5G eth1 port, usb3 port, and the 6 on-board gpio RGB LEDs, and with a KTD2026 RGB LED controller instead of the KTD2061 LED controller of the W6/W6d). The device tree for the W6m refers to the KTD202x driver suggested in PR #16860. Patching target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh removes the code repetition in (old) lines 121 to 124 on the occasion. This is the last of four commits into which the original commit was split to make reviews easier and more targeted. Signed-off-by: George Oldfort <[email protected]> Link: openwrt/openwrt#16861 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent d42075d commit 2898d1d

File tree

8 files changed

+312
-12
lines changed

8 files changed

+312
-12
lines changed

package/boot/uboot-envtools/files/mediatek_filogic

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ zyxel,ex5601-t0-ubootmod)
5050
ubootenv_add_ubi_default
5151
;;
5252
acer,predator-w6|\
53+
acer,predator-w6d|\
54+
acer,vero-w6m|\
5355
glinet,gl-mt2500|\
5456
glinet,gl-mt6000|\
5557
glinet,gl-x3000|\
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
#include "mt7986a-acer-w6-common.dtsi"
5+
6+
/ {
7+
model = "Acer Predator Connect W6d";
8+
compatible = "acer,predator-w6d", "mediatek,mt7986a";
9+
10+
aliases {
11+
serial0 = &uart0;
12+
led-boot = &led_status_blue;
13+
led-failsafe = &led_status_blue;
14+
led-running = &led_status_green;
15+
led-upgrade = &led_status_red;
16+
};
17+
18+
leds {
19+
compatible = "gpio-leds";
20+
21+
led_status_red: led-0 {
22+
color = <LED_COLOR_ID_RED>;
23+
function = LED_FUNCTION_STATUS;
24+
function-enumerator = <0>;
25+
gpios = <&pio 1 GPIO_ACTIVE_HIGH>;
26+
};
27+
28+
led_status_green: led-1 {
29+
color = <LED_COLOR_ID_GREEN>;
30+
function = LED_FUNCTION_STATUS;
31+
function-enumerator = <0>;
32+
gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
33+
};
34+
35+
led_status_blue: led-2 {
36+
color = <LED_COLOR_ID_BLUE>;
37+
function = LED_FUNCTION_STATUS;
38+
function-enumerator = <0>;
39+
gpios = <&pio 36 GPIO_ACTIVE_HIGH>;
40+
};
41+
42+
led-3 {
43+
color = <LED_COLOR_ID_RED>;
44+
function = LED_FUNCTION_STATUS;
45+
function-enumerator = <1>;
46+
gpios = <&pio 35 GPIO_ACTIVE_HIGH>;
47+
};
48+
49+
led-4 {
50+
color = <LED_COLOR_ID_GREEN>;
51+
function = LED_FUNCTION_STATUS;
52+
function-enumerator = <1>;
53+
gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
54+
};
55+
56+
led-5 {
57+
color = <LED_COLOR_ID_BLUE>;
58+
function = LED_FUNCTION_STATUS;
59+
function-enumerator = <1>;
60+
gpios = <&pio 33 GPIO_ACTIVE_HIGH>;
61+
};
62+
63+
led-6 {
64+
color = <LED_COLOR_ID_RED>;
65+
function = LED_FUNCTION_STATUS;
66+
function-enumerator = <2>;
67+
gpios = <&pio 38 GPIO_ACTIVE_HIGH>;
68+
};
69+
70+
led-7 {
71+
color = <LED_COLOR_ID_GREEN>;
72+
function = LED_FUNCTION_STATUS;
73+
function-enumerator = <2>;
74+
gpios = <&pio 37 GPIO_ACTIVE_HIGH>;
75+
};
76+
77+
led-8 {
78+
color = <LED_COLOR_ID_BLUE>;
79+
function = LED_FUNCTION_STATUS;
80+
function-enumerator = <2>;
81+
gpios = <&pio 26 GPIO_ACTIVE_HIGH>;
82+
};
83+
84+
led-9 {
85+
color = <LED_COLOR_ID_RED>;
86+
function = LED_FUNCTION_STATUS;
87+
function-enumerator = <3>;
88+
gpios = <&pio 25 GPIO_ACTIVE_HIGH>;
89+
};
90+
91+
led-10 {
92+
color = <LED_COLOR_ID_GREEN>;
93+
function = LED_FUNCTION_STATUS;
94+
function-enumerator = <3>;
95+
gpios = <&pio 24 GPIO_ACTIVE_HIGH>;
96+
};
97+
98+
led-11 {
99+
color = <LED_COLOR_ID_BLUE>;
100+
function = LED_FUNCTION_STATUS;
101+
function-enumerator = <3>;
102+
gpios = <&pio 23 GPIO_ACTIVE_HIGH>;
103+
};
104+
105+
led-12 {
106+
color = <LED_COLOR_ID_RED>;
107+
function = LED_FUNCTION_STATUS;
108+
function-enumerator = <4>;
109+
gpios = <&pio 28 GPIO_ACTIVE_HIGH>;
110+
};
111+
112+
led-13 {
113+
color = <LED_COLOR_ID_GREEN>;
114+
function = LED_FUNCTION_STATUS;
115+
function-enumerator = <4>;
116+
gpios = <&pio 27 GPIO_ACTIVE_HIGH>;
117+
};
118+
119+
led-14 {
120+
color = <LED_COLOR_ID_BLUE>;
121+
function = LED_FUNCTION_STATUS;
122+
function-enumerator = <4>;
123+
gpios = <&pio 32 GPIO_ACTIVE_HIGH>;
124+
};
125+
126+
led-15 {
127+
color = <LED_COLOR_ID_RED>;
128+
function = LED_FUNCTION_STATUS;
129+
function-enumerator = <5>;
130+
gpios = <&pio 45 GPIO_ACTIVE_HIGH>;
131+
};
132+
133+
led-16 {
134+
color = <LED_COLOR_ID_GREEN>;
135+
function = LED_FUNCTION_STATUS;
136+
function-enumerator = <5>;
137+
gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
138+
};
139+
140+
led-17 {
141+
color = <LED_COLOR_ID_BLUE>;
142+
function = LED_FUNCTION_STATUS;
143+
function-enumerator = <5>;
144+
gpios = <&pio 43 GPIO_ACTIVE_HIGH>;
145+
};
146+
};
147+
};
148+
149+
&ssusb {
150+
vusb33-supply = <&reg_3p3v>;
151+
vbus-supply = <&reg_5v>;
152+
status = "okay";
153+
};
154+
155+
&usb_phy {
156+
status = "okay";
157+
};
158+
159+
&eth {
160+
gmac1: mac@1 {
161+
compatible = "mediatek,eth-mac";
162+
reg = <1>;
163+
phy-mode = "2500base-x";
164+
phy-handle = <&phy6>;
165+
};
166+
};
167+
168+
&mdio {
169+
phy6: phy@6 {
170+
compatible = "ethernet-phy-ieee802.3-c45";
171+
reg = <6>;
172+
reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
173+
reset-assert-us = <10000>;
174+
reset-deassert-us = <10000>;
175+
/* LED0: nc ; LED1: nc ; LED2: amber ; LED3: green */
176+
mxl,led-config = <0x0 0x0 0x370 0x380>;
177+
};
178+
};
179+
180+
&swport0 {
181+
label = "game";
182+
};
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2+
3+
/dts-v1/;
4+
#include "mt7986a-acer-w6-common.dtsi"
5+
6+
/ {
7+
model = "Acer Connect Vero W6m";
8+
compatible = "acer,vero-w6m", "mediatek,mt7986a";
9+
10+
aliases {
11+
serial0 = &uart0;
12+
led-boot = &led_status;
13+
led-failsafe = &led_status;
14+
led-running = &led_status;
15+
led-upgrade = &led_status;
16+
};
17+
};
18+
19+
&i2c0 {
20+
led-controller@30 {
21+
compatible = "kinetic,ktd2026";
22+
reg = <0x30>;
23+
vin-supply = <&reg_5v>;
24+
vio-supply = <&reg_3p3v>;
25+
26+
led_status: multi-led {
27+
color = <LED_COLOR_ID_RGB>;
28+
function = LED_FUNCTION_STATUS;
29+
#address-cells = <1>;
30+
#size-cells = <0>;
31+
32+
led@0 {
33+
reg = <0>;
34+
color = <LED_COLOR_ID_RED>;
35+
};
36+
37+
led@1 {
38+
reg = <1>;
39+
color = <LED_COLOR_ID_GREEN>;
40+
};
41+
42+
led@2 {
43+
reg = <2>;
44+
color = <LED_COLOR_ID_BLUE>;
45+
};
46+
};
47+
};
48+
};
49+
50+
&nvmem {
51+
eeprom_factory_a0000: eeprom@a0000 {
52+
reg = <0xa0000 0x1000>;
53+
};
54+
};
55+
56+
&slot0 {
57+
radio0: mt7915@0,0 {
58+
reg = <0x0000 0 0 0 0>;
59+
nvmem-cells = <&eeprom_factory_a0000>;
60+
nvmem-cell-names = "eeprom";
61+
};
62+
};
63+
64+
&swport0 {
65+
label = "internet";
66+
};

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ mediatek_setup_interfaces()
1818
acelink,ew-7886cax)
1919
ucidef_set_interface_lan "eth0" "dhcp"
2020
;;
21-
acer,predator-w6)
21+
acer,predator-w6|\
22+
acer,predator-w6d)
2223
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1
2324
;;
25+
acer,vero-w6m)
26+
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" internet
27+
;;
2428
arcadyan,mozart)
2529
ucidef_set_interfaces_lan_wan "lan0 eth1" eth2
2630
;;
@@ -132,7 +136,9 @@ mediatek_setup_macs()
132136
local label_mac=""
133137

134138
case $board in
135-
acer,predator-w6)
139+
acer,predator-w6|\
140+
acer,predator-w6d|\
141+
acer,vero-w6m)
136142
wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
137143
lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
138144
;;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ case "$board" in
1717
[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
1818
[ "$PHYNBR" = "1" ] && macaddr_setbit_la $addr > /sys${DEVPATH}/macaddress
1919
;;
20-
acer,predator-w6)
20+
acer,predator-w6|\
21+
acer,vero-w6m)
2122
[ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress
2223
[ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 6gMAC > /sys${DEVPATH}/macaddress
2324
[ "$PHYNBR" = "2" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress
2425
;;
26+
acer,predator-w6d)
27+
[ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress
28+
[ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress
29+
;;
2530
asus,rt-ax59u)
2631
CI_UBIPART="UBI_DEV"
2732
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)

target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
preinit_set_mac_address() {
44
case $(board_name) in
5-
acer,predator-w6)
5+
acer,predator-w6|\
6+
acer,predator-w6d)
67
$(mmc_get_mac_ascii u-boot-env WANMAC)
78
$(mmc_get_mac_ascii u-boot-env LANMAC)
89
ip link set dev lan1 address "$lan_mac"
@@ -11,6 +12,14 @@ preinit_set_mac_address() {
1112
ip link set dev game address "$lan_mac"
1213
ip link set dev eth1 address "$wan_mac"
1314
;;
15+
acer,vero-w6m)
16+
wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
17+
lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
18+
ip link set dev lan1 address "$lan_mac"
19+
ip link set dev lan2 address "$lan_mac"
20+
ip link set dev lan3 address "$lan_mac"
21+
ip link set dev internet address "$wan_mac"
22+
;;
1423
asus,tuf-ax4200|\
1524
asus,tuf-ax6000)
1625
CI_UBIPART="UBI_DEV"

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ platform_do_upgrade() {
9191
fit_do_upgrade "$1"
9292
;;
9393
acer,predator-w6|\
94+
acer,predator-w6d|\
95+
acer,vero-w6m|\
9496
arcadyan,mozart|\
97+
glinet,gl-mt2500|\
98+
glinet,gl-mt6000|\
99+
glinet,gl-x3000|\
100+
glinet,gl-xe3000|\
95101
smartrg,sdg-8612|\
96102
smartrg,sdg-8614|\
97103
smartrg,sdg-8622|\
@@ -115,14 +121,6 @@ platform_do_upgrade() {
115121
yuncore,ax835)
116122
default_do_upgrade "$1"
117123
;;
118-
glinet,gl-mt2500|\
119-
glinet,gl-mt6000|\
120-
glinet,gl-x3000|\
121-
glinet,gl-xe3000)
122-
CI_KERNPART="kernel"
123-
CI_ROOTPART="rootfs"
124-
emmc_do_upgrade "$1"
125-
;;
126124
mercusys,mr90x-v1|\
127125
tplink,re6000xd)
128126
CI_UBIPART="ubi0"
@@ -204,6 +202,8 @@ platform_copy_config() {
204202
fi
205203
;;
206204
acer,predator-w6|\
205+
acer,predator-w6d|\
206+
acer,vero-w6m|\
207207
arcadyan,mozart|\
208208
glinet,gl-mt2500|\
209209
glinet,gl-mt6000|\

0 commit comments

Comments
 (0)